All pastes #895362 Raw Edit

WSG FPS Kills

public diff v1 · immutable
·published 2008-02-07 19:30 UTC
rendered paste body
Index: src/game/BattleGroundNA.cpp===================================================================--- src/game/BattleGroundNA.cpp	(revision 5109)+++ src/game/BattleGroundNA.cpp	(working copy)@@ -106,7 +106,7 @@  } -void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer)+void BattleGroundNA::HandleKillPlayer(Player *player, Player *killer, SpellEntry const *killingSpell) {     if(GetStatus() != STATUS_IN_PROGRESS)         return;Index: src/game/BattleGroundRL.cpp===================================================================--- src/game/BattleGroundRL.cpp	(revision 5109)+++ src/game/BattleGroundRL.cpp	(working copy)@@ -107,7 +107,7 @@  } -void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer)+void BattleGroundRL::HandleKillPlayer(Player *player, Player *killer, SpellEntry const *killingSpell) {     if(GetStatus() != STATUS_IN_PROGRESS)         return;Index: src/game/BattleGroundWS.h===================================================================--- src/game/BattleGroundWS.h	(revision 5109)+++ src/game/BattleGroundWS.h	(working copy)@@ -142,7 +142,7 @@          void RemovePlayer(Player *plr, uint64 guid);         void HandleAreaTrigger(Player *Source, uint32 Trigger);-        void HandleKillPlayer(Player* player, Player *killer);+        void HandleKillPlayer(Player* player, Player *killer, SpellEntry const *killingSpell);         void HandleDropFlag(Player* player);         bool SetupBattleGround();         virtual void ResetBGSubclass();Index: src/game/BattleGroundNA.h===================================================================--- src/game/BattleGroundNA.h	(revision 5109)+++ src/game/BattleGroundNA.h	(working copy)@@ -61,7 +61,7 @@         void HandleAreaTrigger(Player *Source, uint32 Trigger);         bool SetupBattleGround();         virtual void ResetBGSubclass();-        void HandleKillPlayer(Player* player, Player *killer);+        void HandleKillPlayer(Player* player, Player *killer, SpellEntry const *killingSpell);      private:         uint32 m_TeamKills[2];                              // count of kills for each teamIndex: src/game/BattleGroundBE.cpp===================================================================--- src/game/BattleGroundBE.cpp	(revision 5109)+++ src/game/BattleGroundBE.cpp	(working copy)@@ -112,7 +112,7 @@  } -void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer)+void BattleGroundBE::HandleKillPlayer(Player *player, Player *killer, SpellEntry const *killingSpell) {     if(GetStatus() != STATUS_IN_PROGRESS)         return;Index: src/game/BattleGroundAA.h===================================================================--- src/game/BattleGroundAA.h	(revision 5109)+++ src/game/BattleGroundAA.h	(working copy)@@ -42,6 +42,6 @@         void RemovePlayer(Player *plr, uint64 guid);         void HandleAreaTrigger(Player *Source, uint32 Trigger);         bool SetupBattleGround();-        void HandleKillPlayer(Player* player, Player *killer);+        void HandleKillPlayer(Player* player, Player *killer, SpellEntry const *killingSpell); }; #endifIndex: src/game/Unit.cpp===================================================================--- src/game/Unit.cpp	(revision 5109)+++ src/game/Unit.cpp	(working copy)@@ -587,7 +587,7 @@             {                 if(BattleGround *bg = killed->GetBattleGround())                 {-                    bg->HandleKillPlayer(killed, killer);   // drop flags and etc+		     bg->HandleKillPlayer(killed, killer,spellProto);   // drop flags and etc                     // add +1 deaths                     bg->UpdatePlayerScore(killed, SCORE_DEATHS, 1);                     if(killer)Index: src/game/BattleGround.h===================================================================--- src/game/BattleGround.h	(revision 5109)+++ src/game/BattleGround.h	(working copy)@@ -33,6 +33,13 @@     SOUND_BG_START                  = 3439 }; +#define SPELL_MAGE_FIREBALL  {133, 143, 145, 3140, 8400, 8401, 8402, 10148, 10149, 10150, 10151, 25306, 27070, 38692}+#define SPELL_MAGE_FROSTBOLT  {116, 205, 837, 7322, 8406, 8407, 8408, 10179, 10180, 10181, 25304, 27071, 27072, 38697}+#define SPELL_MAGE_ARCANEMISSILES {5143, 5144, 5145, 8416, 8417, 10211, 10212, 25345, 27075, 38699}+#define SPELL_MAGE_SCORCH  {8444, 8445, 8446, 10205, 10206, 10207, 27073, 27074}+#define SPELL_MAGE_CONEOFCOLD  {8444, 8445, 8446, 10205, 10206, 10207, 27073, 27074}++ enum BattleGroundMarks {     //TODO add EY mark spell@@ -338,7 +345,7 @@         // must be implemented in BG subclass         virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}         // must be implemented in BG subclass if need-        virtual void HandleKillPlayer(Player* /*player*/, Player* /*killer*/) {}+        virtual void HandleKillPlayer(Player* /*player*/, Player* /*killer*/, SpellEntry const *killingSpell) {}         // must be implemented in BG subclass if need         virtual void HandleDropFlag(Player* /*player*/) {} Index: src/game/BattleGroundRL.h===================================================================--- src/game/BattleGroundRL.h	(revision 5109)+++ src/game/BattleGroundRL.h	(working copy)@@ -57,7 +57,7 @@         void HandleAreaTrigger(Player *Source, uint32 Trigger);         bool SetupBattleGround();         virtual void ResetBGSubclass();-        void HandleKillPlayer(Player* player, Player *killer);+        void HandleKillPlayer(Player* player, Player *killer, SpellEntry const *killingSpell);      private:         uint32 m_TeamKills[2];                              // count of kills for each teamIndex: src/game/BattleGroundWS.cpp===================================================================--- src/game/BattleGroundWS.cpp	(revision 5109)+++ src/game/BattleGroundWS.cpp	(working copy)@@ -165,7 +165,7 @@     }     else     {-        SetAllianceFlagPicker(0);                           // must be before aura remove to prevent 2 events (drop+capture) at the same time+        SetAllianceFlagPicker(0);                           // must be before aura to prevent 2 events (drop+capture) at the same time         m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;           // alliance flag in base (but not respawned yet)         Source->RemoveAurasDueToSpell(23335);               // Drop Alliance Flag from Player         message = LANG_BG_WS_CAPTURED_AF;@@ -511,11 +511,132 @@         DelCreature(WS_SPIRIT_MAIN_HORDE); } -void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)+void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer, SpellEntry const *killingSpell) {     if(GetStatus() != STATUS_IN_PROGRESS)         return;+	bool spellIsNull = false;+	bool spellFound = false;+	sLog.outDebug("Checking for BattlegroundWS::HandleKillPlayer killingSpell structure nullitification");+	if(killingSpell == NULL)+        {+        spellIsNull = true;+        }+	uint8 type = CHAT_MSG_BG_SYSTEM_ALLIANCE;+	if(killer->GetTeam() == HORDE)+		type = CHAT_MSG_BG_SYSTEM_HORDE;+	+	char message[64];+	int i;+	if(killer->getClass() == CLASS_PRIEST)+		sprintf(message,"%s melted %s's face right off!",killer->GetName(),player->GetName()); +    if(killer->getClass() == CLASS_WARRIOR)+		sprintf(message,"%s mortal striked %s to death.",killer->GetName(),player->GetName());+		+	if(killer->getClass() == CLASS_ROGUE)+		sprintf(message,"%s stabbed %s in the face!",killer->GetName(),player->GetName());++    if(killer->getClass() == CLASS_PALADIN)+		sprintf(message,"%s judged %s to death.",killer->GetName(),player->GetName());++    if(killer->getClass() == CLASS_HUNTER)+		sprintf(message,"%s sniped %s.  Leet skillz...",killer->GetName(),player->GetName());++    if(killer->getClass() == CLASS_SHAMAN)+		sprintf(message,"%s frostshocked %s a little too hard.",killer->GetName(),player->GetName());++    if(killer->getClass() == CLASS_MAGE)+		{+			if(spellIsNull == false)+			{+			int fireballSpellID[] = SPELL_MAGE_FIREBALL;+			int frostboltSpellID[] = SPELL_MAGE_FROSTBOLT;+			int arcanemissilesSpellID[] = SPELL_MAGE_ARCANEMISSILES;+			int scorchSpellID[] = SPELL_MAGE_SCORCH;+		+			for(i=0;fireballSpellID[i];i++)+				{+				if(spellFound == true)+					{+					break;+					}+				if(killingSpell->Id == fireballSpellID[i])+					{+					sprintf(message,"%s burnt %s with a fireball.",killer->GetName(),player->GetName());+					spellFound = true;+					break;+					}+				}+			for(i=0;frostboltSpellID[i];i++)+				{+				if(spellFound == true)+					{+					break;+					}+				if(killingSpell->Id == frostboltSpellID[i])+					{+					sprintf(message,"%s shattered %s with a frostbolt.",killer->GetName(),player->GetName());+					spellFound = true;+					break;+					}+				}+			+		+			for(i=0;arcanemissilesSpellID[i];i++)+				{+				if(spellFound == true)+					{+					break;+					}+				if(killingSpell->Id == arcanemissilesSpellID[i])+					{+					sprintf(message,"%s anhililated %s with some arcane missles.",killer->GetName(),player->GetName());+					spellFound = true;+					break;+					}+				}+			for(i=0;scorchSpellID[i];i++)+				{+				if(spellFound == true)+					{+					break;+					}+				if(killingSpell->Id == scorchSpellID[i])+					{+					sprintf(message,"%s scorched %s.",killer->GetName(),player->GetName());+					spellFound = true;+					break;+					}+				}+			}+		}+		+ +    if(killer->getClass() == CLASS_WARLOCK)+		sprintf(message,"%s spammed dots and feared %s to death.",killer->GetName(),player->GetName());+ +    if(killer->getClass() == CLASS_DRUID)+		sprintf(message,"%s scratched %s to death.",killer->GetName(),player->GetName());+    +    if(killer->GetGUID() == player->GetGUID() && player->getGender() == GENDER_MALE)+		{+		if(player->getGender() == GENDER_FEMALE)+			{+			sprintf(message,"%s managed to kill herself.  Real smooth!",player->GetName());+			}+		if(player->getGender() == GENDER_MALE)+			{+			sprintf(message,"%s managed to kill himself.  Way to go chief!",player->GetName());+			}+		}++	sLog.outDebug("Attempting to send kill message packet!\n");++	WorldPacket data;+    ChatHandler::FillMessageData(&data, player->GetSession(), type, LANG_UNIVERSAL,NULL,NULL,message,NULL);+    SendPacketToAll(&data);+	     EventPlayerDroppedFlag(player); } Index: src/game/BattleGroundAA.cpp===================================================================--- src/game/BattleGroundAA.cpp	(revision 5109)+++ src/game/BattleGroundAA.cpp	(working copy)@@ -48,7 +48,7 @@ { } -void BattleGroundAA::HandleKillPlayer(Player * /*player*/, Player * /*killer*/)+void BattleGroundAA::HandleKillPlayer(Player * /*player*/, Player * /*killer*/, SpellEntry const *killingSpell) { } Index: src/game/BattleGroundBE.h===================================================================--- src/game/BattleGroundBE.h	(revision 5109)+++ src/game/BattleGroundBE.h	(working copy)@@ -64,7 +64,7 @@         void HandleAreaTrigger(Player *Source, uint32 Trigger);         bool SetupBattleGround();         void ResetBGSubclass();-        void HandleKillPlayer(Player* player, Player *killer);+        void HandleKillPlayer(Player* player, Player *killer, SpellEntry const *killingSpell);          /* Scorekeeping */         void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);