Core/Battlegrounds: Set PLAYER_FLAGS_EX_MERCENARY_MODE for mercenary players
Port From (https://github.com/TrinityCore/TrinityCore/commit/798693c0b8c6f4ae43f908c9239e14bcf4c3b76f)
This commit is contained in:
@@ -625,7 +625,7 @@ namespace Game.BattleGrounds
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
if (player.GetNativeTeam() != team)
|
||||
if (player.HasPlayerFlagEx(PlayerFlagsEx.MercenaryMode))
|
||||
continue;
|
||||
|
||||
uint repGain = Reputation;
|
||||
@@ -853,8 +853,12 @@ namespace Game.BattleGrounds
|
||||
player.RemoveAurasByType(AuraType.ModShapeshift);
|
||||
|
||||
player.RemoveAurasByType(AuraType.Mounted);
|
||||
player.RemoveAurasByType(AuraType.SwitchTeam);
|
||||
player.RemoveAurasByType(AuraType.ModFaction);
|
||||
player.RemoveAura(BattlegroundConst.SpellMercenaryHorde1);
|
||||
player.RemoveAura(BattlegroundConst.SpellMercenaryHordeReactions);
|
||||
player.RemoveAura(BattlegroundConst.SpellMercenaryAlliance1);
|
||||
player.RemoveAura(BattlegroundConst.SpellMercenaryAllianceReactions);
|
||||
player.RemoveAura(BattlegroundConst.SpellMercenaryShapeshift);
|
||||
player.RemovePlayerFlagEx(PlayerFlagsEx.MercenaryMode);
|
||||
|
||||
if (!player.IsAlive()) // resurrect on exit
|
||||
{
|
||||
@@ -1084,6 +1088,9 @@ namespace Game.BattleGrounds
|
||||
player.CastSpell(player, BattlegroundConst.SpellMercenaryAlliance1, true);
|
||||
player.CastSpell(player, BattlegroundConst.SpellMercenaryAllianceReactions, true);
|
||||
}
|
||||
|
||||
player.CastSpell(player, BattlegroundConst.SpellMercenaryShapeshift);
|
||||
player.SetPlayerFlagEx(PlayerFlagsEx.MercenaryMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3518,14 +3518,11 @@ namespace Game.Entities
|
||||
|
||||
public void SwitchToOppositeTeam(bool apply)
|
||||
{
|
||||
m_team = GetNativeTeam();
|
||||
m_team = TeamForRace(GetRace());
|
||||
|
||||
if (apply)
|
||||
m_team = (m_team == Team.Alliance) ? Team.Horde : Team.Alliance;
|
||||
}
|
||||
|
||||
public Team GetNativeTeam() { return TeamForRace(GetRace()); }
|
||||
public uint GetNativeTeamId() { return TeamIdForRace(GetRace()); }
|
||||
|
||||
public void SetFactionForRace(Race race)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user