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)
|
if (!player)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (player.GetNativeTeam() != team)
|
if (player.HasPlayerFlagEx(PlayerFlagsEx.MercenaryMode))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint repGain = Reputation;
|
uint repGain = Reputation;
|
||||||
@@ -853,8 +853,12 @@ namespace Game.BattleGrounds
|
|||||||
player.RemoveAurasByType(AuraType.ModShapeshift);
|
player.RemoveAurasByType(AuraType.ModShapeshift);
|
||||||
|
|
||||||
player.RemoveAurasByType(AuraType.Mounted);
|
player.RemoveAurasByType(AuraType.Mounted);
|
||||||
player.RemoveAurasByType(AuraType.SwitchTeam);
|
player.RemoveAura(BattlegroundConst.SpellMercenaryHorde1);
|
||||||
player.RemoveAurasByType(AuraType.ModFaction);
|
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
|
if (!player.IsAlive()) // resurrect on exit
|
||||||
{
|
{
|
||||||
@@ -1084,6 +1088,9 @@ namespace Game.BattleGrounds
|
|||||||
player.CastSpell(player, BattlegroundConst.SpellMercenaryAlliance1, true);
|
player.CastSpell(player, BattlegroundConst.SpellMercenaryAlliance1, true);
|
||||||
player.CastSpell(player, BattlegroundConst.SpellMercenaryAllianceReactions, true);
|
player.CastSpell(player, BattlegroundConst.SpellMercenaryAllianceReactions, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.CastSpell(player, BattlegroundConst.SpellMercenaryShapeshift);
|
||||||
|
player.SetPlayerFlagEx(PlayerFlagsEx.MercenaryMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3518,15 +3518,12 @@ namespace Game.Entities
|
|||||||
|
|
||||||
public void SwitchToOppositeTeam(bool apply)
|
public void SwitchToOppositeTeam(bool apply)
|
||||||
{
|
{
|
||||||
m_team = GetNativeTeam();
|
m_team = TeamForRace(GetRace());
|
||||||
|
|
||||||
if (apply)
|
if (apply)
|
||||||
m_team = (m_team == Team.Alliance) ? Team.Horde : Team.Alliance;
|
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)
|
public void SetFactionForRace(Race race)
|
||||||
{
|
{
|
||||||
m_team = TeamForRace(race);
|
m_team = TeamForRace(race);
|
||||||
|
|||||||
Reference in New Issue
Block a user