aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Deutscher <adeutscher@gmail.com>2022-07-07 01:21:36 -0700
committerShauren <shauren.trinity@gmail.com>2022-09-05 19:50:11 +0200
commit8edee30a62f74d8e13efe7a52bc9e73ef43955d5 (patch)
treee87a526a87e7501e3066c3359781edcbb26e5d6c /src
parenta01141c426be517c1d2bd40753b277b453d15ce0 (diff)
Core/Battlegrounds: Fix WSG Focused/Brutal Assault #28088 (#28094)
* Warsong Gulch: Do not clear Focused Assault or Brutal Assault from one team's flagbearer when the other team's flag is returned. The timer should only stop / reset when both flags have returned to the pedestal. * When a flag is picked up from the pedestal with Focused Assault or Brutal Assaul active, the new flagbearer should receive the debuff. (cherry picked from commit b1db528780c455ad0adc5b8a10c20719e461d3aa)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
index fab658dad53..1e8146891b9 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp
@@ -146,6 +146,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
_flagSpellForceTimer += diff;
if (_flagDebuffState == 0 && _flagSpellForceTimer >= 10*MINUTE*IN_MILLISECONDS) //10 minutes
{
+ // Apply Stage 1 (Focused Assault)
if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))
player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[1]))
@@ -154,6 +155,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
}
else if (_flagDebuffState == 1 && _flagSpellForceTimer >= 15*MINUTE*IN_MILLISECONDS) //15 minutes
{
+ // Apply Stage 2 (Brutal Assault)
if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))
{
player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
@@ -167,8 +169,12 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
_flagDebuffState = 2;
}
}
- else
+ else if ((_flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_ON_BASE || _flagState[TEAM_ALLIANCE] == BG_WS_FLAG_STATE_WAIT_RESPAWN) &&
+ (_flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_ON_BASE || _flagState[TEAM_HORDE] == BG_WS_FLAG_STATE_WAIT_RESPAWN))
{
+ // Both flags are in base or awaiting respawn.
+ // Remove assault debuffs, reset timers
+
if (Player* player = ObjectAccessor::FindPlayer(m_FlagKeepers[0]))
{
player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
@@ -466,6 +472,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target
player->StartCriteriaTimer(CriteriaStartEvent::BeSpellTarget, BG_WS_SPELL_SILVERWING_FLAG_PICKED);
if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER)
_bothFlagsKept = true;
+
+ if (_flagDebuffState == 1)
+ player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
+ else if (_flagDebuffState == 2)
+ player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
}
//horde flag picked up from base
@@ -483,6 +494,11 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player* player, GameObject* target
player->StartCriteriaTimer(CriteriaStartEvent::BeSpellTarget, BG_WS_SPELL_WARSONG_FLAG_PICKED);
if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER)
_bothFlagsKept = true;
+
+ if (_flagDebuffState == 1)
+ player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
+ else if (_flagDebuffState == 2)
+ player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
}
//Alliance flag on ground(not in base) (returned or picked up again from ground!)