diff options
author | raczman <none@none> | 2009-05-22 13:23:07 +0200 |
---|---|---|
committer | raczman <none@none> | 2009-05-22 13:23:07 +0200 |
commit | f1ea5714f24ea0c3e51a6c37e0ce0bec577804b6 (patch) | |
tree | 76c2dc12cc2ca6d56d966606afd2550b3e28eef2 /src | |
parent | b0a48f60c92291c80ff40379316787e77f46321d (diff) |
Implemented carrier debuffs in WSG battleground
After 10 and 15 minutes players carrying flags will receive debuffs, if both flags are kept.
In case of dropping flag buff is removed. When Flag is picked up by another player, he gets debuff.
Please test and report bugs.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/BattleGroundWS.cpp | 65 | ||||
-rw-r--r-- | src/game/BattleGroundWS.h | 10 |
2 files changed, 74 insertions, 1 deletions
diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index 3a8c5668a7a..5462a3de57a 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -152,6 +152,7 @@ void BattleGroundWS::Update(time_t diff) { m_FlagsDropTimer[BG_TEAM_ALLIANCE] = 0; RespawnFlagAfterDrop(ALLIANCE); + m_BothFlagsKept = false; } } if(m_FlagState[BG_TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN) @@ -172,8 +173,40 @@ void BattleGroundWS::Update(time_t diff) { m_FlagsDropTimer[BG_TEAM_HORDE] = 0; RespawnFlagAfterDrop(HORDE); + m_BothFlagsKept = false; } } + if(m_BothFlagsKept) + { + m_FlagSpellForceTimer += diff; + if(m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes + { + if(Player * plr = objmgr.GetPlayer(m_FlagKeepers[0])) + plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); + if(Player * plr = objmgr.GetPlayer(m_FlagKeepers[1])) + plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); + m_FlagDebuffState = 1; + } + else if(m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes + { + if(Player * plr = objmgr.GetPlayer(m_FlagKeepers[0])) + { + plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); + } + if(Player * plr = objmgr.GetPlayer(m_FlagKeepers[1])) + { + plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); + } + m_FlagDebuffState = 2; + } + } + else + { + m_FlagSpellForceTimer = 0; //reset timer. + m_FlagDebuffState = 0; + } } } @@ -207,6 +240,7 @@ void BattleGroundWS::RespawnFlag(uint32 Team, bool captured) SendMessageToAll(GetTrinityString(LANG_BG_WS_F_PLACED)); PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound... } + m_BothFlagsKept = false; } void BattleGroundWS::RespawnFlagAfterDrop(uint32 team) @@ -235,6 +269,7 @@ void BattleGroundWS::RespawnFlagAfterDrop(uint32 team) sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); SetDroppedFlagGUID(0,team); + m_BothFlagsKept = false; } void BattleGroundWS::EventPlayerCapturedFlag(Player *Source) @@ -258,6 +293,10 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source) m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN; // Drop Horde Flag from Player Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); + if(m_FlagDebuffState == 1) + Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + if(m_FlagDebuffState == 2) + Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); message = GetTrinityString(LANG_BG_WS_CAPTURED_HF); type = CHAT_MSG_BG_SYSTEM_ALLIANCE; if(GetTeamScore(ALLIANCE) < BG_WS_MAX_TEAM_SCORE) @@ -275,6 +314,10 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source) m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN; // Drop Alliance Flag from Player Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); + if(m_FlagDebuffState == 1) + Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + if(m_FlagDebuffState == 2) + Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); message = GetTrinityString(LANG_BG_WS_CAPTURED_AF); type = CHAT_MSG_BG_SYSTEM_HORDE; if(GetTeamScore(HORDE) < BG_WS_MAX_TEAM_SCORE) @@ -359,6 +402,10 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source) { SetHordeFlagPicker(0); Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG); + if(m_FlagDebuffState == 1) + Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + if(m_FlagDebuffState == 2) + Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND; message = GetTrinityString(LANG_BG_WS_DROPPED_HF); type = CHAT_MSG_BG_SYSTEM_HORDE; @@ -374,6 +421,10 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source) { SetAllianceFlagPicker(0); Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG); + if(m_FlagDebuffState == 1) + Source->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); + if(m_FlagDebuffState == 2) + Source->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND; message = GetTrinityString(LANG_BG_WS_DROPPED_AF); type = CHAT_MSG_BG_SYSTEM_ALLIANCE; @@ -422,6 +473,8 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); + if(m_FlagState[1] == BG_WS_FLAG_STATE_ON_PLAYER) + m_BothFlagsKept = true; } //horde flag picked up from base @@ -438,6 +491,8 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); + if(m_FlagState[0] == BG_WS_FLAG_STATE_ON_PLAYER) + m_BothFlagsKept = true; } //Alliance flag on ground(not in base) (returned or picked up again from ground!) @@ -452,6 +507,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY); PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); + m_BothFlagsKept = false; } else { @@ -463,6 +519,10 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG, true); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); + if(m_FlagDebuffState == 1) + Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true); + if(m_FlagDebuffState == 2) + Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); } //called in HandleGameObjectUseOpcode: @@ -481,6 +541,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target SpawnBGObject(BG_WS_OBJECT_H_FLAG, RESPAWN_IMMEDIATELY); PlaySoundToAll(BG_WS_SOUND_FLAG_RETURNED); UpdatePlayerScore(Source, SCORE_FLAG_RETURNS, 1); + m_BothFlagsKept = false; } else { @@ -492,6 +553,10 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG, true); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); + if(m_FlagDebuffState == 1) + Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true); + if(m_FlagDebuffState == 2) + Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); } //called in HandleGameObjectUseOpcode: diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGroundWS.h index 4e57826cd30..837414fe6d2 100644 --- a/src/game/BattleGroundWS.h +++ b/src/game/BattleGroundWS.h @@ -128,6 +128,12 @@ enum BG_WS_CreatureTypes BG_CREATURES_MAX_WS = 2 }; +enum BG_WS_CarrierDebuffs +{ + WS_SPELL_FOCUSED_ASSAULT = 46392, + WS_SPELL_BRUTAL_ASSAULT = 46393 +}; + class BattleGroundWGScore : public BattleGroundScore { public: @@ -196,9 +202,11 @@ class BattleGroundWS : public BattleGround uint32 m_TeamScores[2]; int32 m_FlagsTimer[2]; int32 m_FlagsDropTimer[2]; - + int32 m_FlagSpellForceTimer; int32 m_FlagSpellBrutalTimer; + bool m_BothFlagsKept; + uint8 m_FlagDebuffState; // 0 - no debuffs, 1 - focused assault, 2 - brutal assault }; #endif |