aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Battlegrounds/Battleground.cpp
diff options
context:
space:
mode:
authorTraesh <traesh@farahlon.com>2022-04-14 23:31:16 +0200
committerShauren <shauren.trinity@gmail.com>2022-04-16 12:15:37 +0200
commit87723e32e24f03ac1d062e33edcbe935e4e59421 (patch)
tree9c7c655929ee19dd827c6ee48eee6c7438592e6e /src/server/game/Battlegrounds/Battleground.cpp
parentc4ef231e2a25234099391f574942f6490d400f15 (diff)
Core/Battlegrounds: Implement mercenary system
Diffstat (limited to 'src/server/game/Battlegrounds/Battleground.cpp')
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index 5d18797a419..1f7a3ce187c 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -675,6 +675,9 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
if (!player)
continue;
+ if (player->GetNativeTeam() != TeamID)
+ continue;
+
uint32 repGain = Reputation;
AddPct(repGain, player->GetTotalAuraModifier(SPELL_AURA_MOD_REPUTATION_GAIN));
AddPct(repGain, player->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_FACTION_REPUTATION_GAIN, faction_id));
@@ -898,6 +901,8 @@ void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
+ player->RemoveAurasByType(SPELL_AURA_SWITCH_TEAM);
+ player->RemoveAurasByType(SPELL_AURA_MOD_FACTION);
if (!player->IsAlive()) // resurrect on exit
{
@@ -1118,6 +1123,17 @@ void Battleground::AddPlayer(Player* player)
startTimer.TotalTime = countdownMaxForBGType;
player->SendDirectMessage(startTimer.Write());
}
+
+ if (player->HasAura(SPELL_MERCENARY_CONTRACT_HORDE))
+ {
+ player->CastSpell(player, SPELL_MERCENARY_HORDE_1, true);
+ player->CastSpell(player, SPELL_MERCENARY_HORDE_2, true);
+ }
+ else if (player->HasAura(SPELL_MERCENARY_CONTRACT_ALLIANCE))
+ {
+ player->CastSpell(player, SPELL_MERCENARY_ALLIANCE_1, true);
+ player->CastSpell(player, SPELL_MERCENARY_ALLIANCE_2, true);
+ }
}
// reset all map criterias on map enter