Core/Conditions: Implemented PlayerCondition::CurrentPvpFaction
Port From (https://github.com/TrinityCore/TrinityCore/commit/490b6f88d4ceae982da8877e50b20070a8f4f978)
This commit is contained in:
@@ -2111,6 +2111,18 @@ namespace Game
|
||||
}
|
||||
}
|
||||
|
||||
if (condition.CurrentPvpFaction != 0)
|
||||
{
|
||||
byte team;
|
||||
if (player.GetMap().IsBattlegroundOrArena())
|
||||
team = player.m_playerData.ArenaFaction;
|
||||
else
|
||||
team = (byte)player.GetTeamId();
|
||||
|
||||
if (condition.CurrentPvpFaction - 1 != team)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (condition.PvpMedal != 0 && !Convert.ToBoolean((1 << (condition.PvpMedal - 1)) & player.m_activePlayerData.PvpMedals))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user