mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Battlegrounds: Set PLAYER_FLAGS_EX_MERCENARY_MODE for mercenary players
This commit is contained in:
@@ -675,7 +675,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
if (player->GetNativeTeam() != TeamID)
|
||||
if (player->HasPlayerFlagEx(PLAYER_FLAGS_EX_MERCENARY_MODE))
|
||||
continue;
|
||||
|
||||
uint32 repGain = Reputation;
|
||||
@@ -901,8 +901,12 @@ 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);
|
||||
player->RemoveAura(SPELL_MERCENARY_HORDE_1);
|
||||
player->RemoveAura(SPELL_MERCENARY_HORDE_REACTIONS);
|
||||
player->RemoveAura(SPELL_MERCENARY_ALLIANCE_1);
|
||||
player->RemoveAura(SPELL_MERCENARY_ALLIANCE_REACTIONS);
|
||||
player->RemoveAura(SPELL_MERCENARY_SHAPESHIFT);
|
||||
player->RemovePlayerFlagEx(PLAYER_FLAGS_EX_MERCENARY_MODE);
|
||||
|
||||
if (!player->IsAlive()) // resurrect on exit
|
||||
{
|
||||
@@ -1138,6 +1142,7 @@ void Battleground::AddPlayer(Player* player)
|
||||
player->CastSpell(player, SPELL_MERCENARY_ALLIANCE_REACTIONS);
|
||||
}
|
||||
player->CastSpell(player, SPELL_MERCENARY_SHAPESHIFT);
|
||||
player->SetPlayerFlagEx(PLAYER_FLAGS_EX_MERCENARY_MODE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6287,7 +6287,7 @@ TeamId Player::TeamIdForRace(uint8 race)
|
||||
|
||||
void Player::SwitchToOppositeTeam(bool apply)
|
||||
{
|
||||
m_team = GetNativeTeam();
|
||||
m_team = TeamForRace(GetRace());
|
||||
|
||||
if (apply)
|
||||
m_team = (m_team == ALLIANCE) ? HORDE : ALLIANCE;
|
||||
|
||||
@@ -2214,9 +2214,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
|
||||
void SetFactionForRace(uint8 race);
|
||||
|
||||
uint32 GetNativeTeam() const { return TeamForRace(GetRace()); }
|
||||
TeamId GetNativeTeamId() const { return TeamIdForRace(GetRace()); }
|
||||
|
||||
void InitDisplayIds();
|
||||
|
||||
bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const;
|
||||
|
||||
Reference in New Issue
Block a user