Core/Battlegrounds: Clean up some Team/TeamId parameters to use enums instead of raw integer types (#29535)
* Fix criteria data type bg loss team score
This commit is contained in:
@@ -365,7 +365,7 @@ bool CriteriaData::Meets(uint32 criteriaId, Player const* source, WorldObject co
|
||||
case CRITERIA_DATA_TYPE_T_TEAM:
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
return target->ToPlayer()->GetTeam() == Team.Team;
|
||||
return target->ToPlayer()->GetTeam() == ::Team(Team.Team);
|
||||
case CRITERIA_DATA_TYPE_S_DRUNK:
|
||||
return Player::GetDrunkenstateByValue(source->GetDrunkValue()) >= DrunkenState(Drunk.State);
|
||||
case CRITERIA_DATA_TYPE_HOLIDAY:
|
||||
@@ -378,7 +378,7 @@ bool CriteriaData::Meets(uint32 criteriaId, Player const* source, WorldObject co
|
||||
if (!bg)
|
||||
return false;
|
||||
|
||||
uint32 score = bg->GetTeamScore(bg->GetPlayerTeam(source->GetGUID()) == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
uint32 score = bg->GetTeamScore(bg->GetPlayerTeam(source->GetGUID()) == ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE);
|
||||
return score >= BattlegroundScore.Min && score <= BattlegroundScore.Max;
|
||||
}
|
||||
case CRITERIA_DATA_TYPE_INSTANCE_SCRIPT:
|
||||
|
||||
@@ -114,7 +114,7 @@ void Arena::RemovePlayerAtLeave(ObjectGuid guid, bool transport, bool sendPacket
|
||||
if (itr != m_Players.end()) // check if the player was a participant of the match, or only entered through gm command (appear)
|
||||
{
|
||||
// if the player was a match participant, calculate rating
|
||||
uint32 team = itr->second.Team;
|
||||
Team team = itr->second.Team;
|
||||
|
||||
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team)));
|
||||
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(team));
|
||||
@@ -142,7 +142,7 @@ void Arena::CheckWinConditions()
|
||||
EndBattleground(ALLIANCE);
|
||||
}
|
||||
|
||||
void Arena::EndBattleground(uint32 winner)
|
||||
void Arena::EndBattleground(Team winner)
|
||||
{
|
||||
// arena rating calculation
|
||||
if (isRated())
|
||||
@@ -159,17 +159,17 @@ void Arena::EndBattleground(uint32 winner)
|
||||
|
||||
// In case of arena draw, follow this logic:
|
||||
// winnerArenaTeam => ALLIANCE, loserArenaTeam => HORDE
|
||||
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner == 0 ? uint32(ALLIANCE) : winner));
|
||||
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner == 0 ? uint32(HORDE) : GetOtherTeam(winner)));
|
||||
ArenaTeam* winnerArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner == TEAM_OTHER ? ALLIANCE : winner));
|
||||
ArenaTeam* loserArenaTeam = sArenaTeamMgr->GetArenaTeamById(GetArenaTeamIdForTeam(winner == TEAM_OTHER ? HORDE : GetOtherTeam(winner)));
|
||||
|
||||
if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
|
||||
{
|
||||
// In case of arena draw, follow this logic:
|
||||
// winnerMatchmakerRating => ALLIANCE, loserMatchmakerRating => HORDE
|
||||
loserTeamRating = loserArenaTeam->GetRating();
|
||||
loserMatchmakerRating = GetArenaMatchmakerRating(winner == 0 ? uint32(HORDE) : GetOtherTeam(winner));
|
||||
loserMatchmakerRating = GetArenaMatchmakerRating(winner == TEAM_OTHER ? HORDE : GetOtherTeam(winner));
|
||||
winnerTeamRating = winnerArenaTeam->GetRating();
|
||||
winnerMatchmakerRating = GetArenaMatchmakerRating(winner == 0 ? uint32(ALLIANCE) : winner);
|
||||
winnerMatchmakerRating = GetArenaMatchmakerRating(winner == TEAM_OTHER ? ALLIANCE : winner);
|
||||
|
||||
if (winner != 0)
|
||||
{
|
||||
@@ -217,7 +217,7 @@ void Arena::EndBattleground(uint32 winner)
|
||||
|
||||
for (auto const& i : GetPlayers())
|
||||
{
|
||||
uint32 team = i.second.Team;
|
||||
Team team = i.second.Team;
|
||||
|
||||
if (i.second.OfflineRemoveTime)
|
||||
{
|
||||
|
||||
@@ -70,7 +70,7 @@ class TC_GAME_API Arena : public Battleground
|
||||
private:
|
||||
void RemovePlayerAtLeave(ObjectGuid guid, bool transport, bool sendPacket) override;
|
||||
void CheckWinConditions() override;
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void EndBattleground(Team winner) override;
|
||||
|
||||
ArenaTeamScore _arenaTeamScores[PVP_TEAMS_COUNT];
|
||||
};
|
||||
|
||||
@@ -184,7 +184,7 @@ void Battleground::Update(uint32 diff)
|
||||
{
|
||||
if (GetElapsedTime() >= 47 * MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
EndBattleground(0);
|
||||
EndBattleground(TEAM_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -284,9 +284,9 @@ inline void Battleground::_ProcessOfflineQueue()
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Battleground::GetPrematureWinner()
|
||||
Team Battleground::GetPrematureWinner()
|
||||
{
|
||||
uint32 winner = 0;
|
||||
Team winner = TEAM_OTHER;
|
||||
if (GetPlayersCountByTeam(ALLIANCE) >= GetMinPlayersPerTeam())
|
||||
winner = ALLIANCE;
|
||||
else if (GetPlayersCountByTeam(HORDE) >= GetMinPlayersPerTeam())
|
||||
@@ -516,15 +516,15 @@ Player* Battleground::_GetPlayer(ObjectGuid guid, bool offlineRemove, char const
|
||||
return player;
|
||||
}
|
||||
|
||||
Player* Battleground::_GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, char const* context) const
|
||||
Player* Battleground::_GetPlayerForTeam(Team team, BattlegroundPlayerMap::const_iterator itr, char const* context) const
|
||||
{
|
||||
Player* player = _GetPlayer(itr, context);
|
||||
if (player)
|
||||
{
|
||||
uint32 team = itr->second.Team;
|
||||
if (!team)
|
||||
team = player->GetEffectiveTeam();
|
||||
if (team != teamId)
|
||||
Team playerTeam = itr->second.Team;
|
||||
if (!playerTeam)
|
||||
playerTeam = player->GetEffectiveTeam();
|
||||
if (playerTeam != team)
|
||||
player = nullptr;
|
||||
}
|
||||
return player;
|
||||
@@ -554,11 +554,11 @@ void Battleground::SendPacketToAll(WorldPacket const* packet) const
|
||||
player->SendDirectMessage(packet);
|
||||
}
|
||||
|
||||
void Battleground::SendPacketToTeam(uint32 teamId, WorldPacket const* packet, Player* except /*= nullptr*/) const
|
||||
void Battleground::SendPacketToTeam(Team team, WorldPacket const* packet, Player* except /*= nullptr*/) const
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
if (Player* player = _GetPlayerForTeam(teamId, itr, "SendPacketToTeam"))
|
||||
if (Player* player = _GetPlayerForTeam(team, itr, "SendPacketToTeam"))
|
||||
if (player != except)
|
||||
player->SendDirectMessage(packet);
|
||||
}
|
||||
@@ -587,33 +587,33 @@ void Battleground::PlaySoundToAll(uint32 soundID)
|
||||
SendPacketToAll(WorldPackets::Misc::PlaySound(ObjectGuid::Empty, soundID, 0).Write());
|
||||
}
|
||||
|
||||
void Battleground::PlaySoundToTeam(uint32 soundID, uint32 teamID)
|
||||
void Battleground::PlaySoundToTeam(uint32 soundID, Team team)
|
||||
{
|
||||
SendPacketToTeam(teamID, WorldPackets::Misc::PlaySound(ObjectGuid::Empty, soundID, 0).Write());
|
||||
SendPacketToTeam(team, WorldPackets::Misc::PlaySound(ObjectGuid::Empty, soundID, 0).Write());
|
||||
}
|
||||
|
||||
void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
void Battleground::CastSpellOnTeam(uint32 SpellID, Team team)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (Player* player = _GetPlayerForTeam(TeamID, itr, "CastSpellOnTeam"))
|
||||
if (Player* player = _GetPlayerForTeam(team, itr, "CastSpellOnTeam"))
|
||||
player->CastSpell(player, SpellID, true);
|
||||
}
|
||||
|
||||
void Battleground::RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
void Battleground::RemoveAuraOnTeam(uint32 SpellID, Team team)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (Player* player = _GetPlayerForTeam(TeamID, itr, "RemoveAuraOnTeam"))
|
||||
if (Player* player = _GetPlayerForTeam(team, itr, "RemoveAuraOnTeam"))
|
||||
player->RemoveAura(SpellID);
|
||||
}
|
||||
|
||||
void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
void Battleground::RewardHonorToTeam(uint32 Honor, Team team)
|
||||
{
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (Player* player = _GetPlayerForTeam(TeamID, itr, "RewardHonorToTeam"))
|
||||
if (Player* player = _GetPlayerForTeam(team, itr, "RewardHonorToTeam"))
|
||||
UpdatePlayerScore(player, SCORE_BONUS_HONOR, Honor);
|
||||
}
|
||||
|
||||
void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
|
||||
void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, Team team)
|
||||
{
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id);
|
||||
if (!factionEntry)
|
||||
@@ -621,7 +621,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player* player = _GetPlayerForTeam(TeamID, itr, "RewardReputationToTeam");
|
||||
Player* player = _GetPlayerForTeam(team, itr, "RewardReputationToTeam");
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
@@ -640,7 +640,7 @@ void Battleground::UpdateWorldState(int32 worldStateId, int32 value, bool hidden
|
||||
sWorldStateMgr->SetValue(worldStateId, value, hidden, GetBgMap());
|
||||
}
|
||||
|
||||
void Battleground::EndBattleground(uint32 winner)
|
||||
void Battleground::EndBattleground(Team winner)
|
||||
{
|
||||
RemoveFromBGFreeSlotQueue();
|
||||
|
||||
@@ -703,7 +703,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
|
||||
for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
uint32 team = itr->second.Team;
|
||||
Team team = itr->second.Team;
|
||||
|
||||
Player* player = _GetPlayer(itr, "EndBattleground");
|
||||
if (!player)
|
||||
@@ -825,7 +825,7 @@ void Battleground::BlockMovement(Player* player)
|
||||
|
||||
void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket)
|
||||
{
|
||||
uint32 team = GetPlayerTeam(guid);
|
||||
Team team = GetPlayerTeam(guid);
|
||||
bool participant = false;
|
||||
// Remove from lists/maps
|
||||
BattlegroundPlayerMap::iterator itr = m_Players.find(guid);
|
||||
@@ -932,7 +932,7 @@ void Battleground::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen
|
||||
// Do next only if found in battleground
|
||||
player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, BATTLEGROUND_QUEUE_NONE); // We're not in BG.
|
||||
// reset destination bg team
|
||||
player->SetBGTeam(0);
|
||||
player->SetBGTeam(TEAM_OTHER);
|
||||
|
||||
// remove all criterias on bg leave
|
||||
player->FailCriteria(CriteriaFailEvent::LeaveBattleground, 0);
|
||||
@@ -1001,7 +1001,7 @@ void Battleground::AddPlayer(Player* player, BattlegroundQueueTypeId queueId)
|
||||
|
||||
// score struct must be created in inherited class
|
||||
|
||||
uint32 team = player->GetBGTeam();
|
||||
Team team = player->GetBGTeam();
|
||||
|
||||
BattlegroundPlayer bp;
|
||||
bp.OfflineRemoveTime = 0;
|
||||
@@ -1111,7 +1111,7 @@ void Battleground::AddPlayer(Player* player, BattlegroundQueueTypeId queueId)
|
||||
}
|
||||
|
||||
// this method adds player to his team's bg group, or sets his correct group if player is already in bg group
|
||||
void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team)
|
||||
void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, Team team)
|
||||
{
|
||||
ObjectGuid playerGuid = player->GetGUID();
|
||||
Group* group = GetBgRaid(team);
|
||||
@@ -1204,11 +1204,11 @@ void Battleground::RemoveFromBGFreeSlotQueue()
|
||||
|
||||
// get the number of free slots for team
|
||||
// returns the number how many players can join battleground to MaxPlayersPerTeam
|
||||
uint32 Battleground::GetFreeSlotsForTeam(uint32 Team) const
|
||||
uint32 Battleground::GetFreeSlotsForTeam(Team team) const
|
||||
{
|
||||
// if BG is starting and CONFIG_BATTLEGROUND_INVITATION_TYPE == BG_QUEUE_INVITATION_TYPE_NO_BALANCE, invite anyone
|
||||
if (GetStatus() == STATUS_WAIT_JOIN && sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == BG_QUEUE_INVITATION_TYPE_NO_BALANCE)
|
||||
return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0;
|
||||
return (GetInvitedCount(team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(team) : 0;
|
||||
|
||||
// if BG is already started or CONFIG_BATTLEGROUND_INVITATION_TYPE != BG_QUEUE_INVITATION_TYPE_NO_BALANCE, do not allow to join too much players of one faction
|
||||
uint32 otherTeamInvitedCount;
|
||||
@@ -1216,7 +1216,7 @@ uint32 Battleground::GetFreeSlotsForTeam(uint32 Team) const
|
||||
uint32 otherTeamPlayersCount;
|
||||
uint32 thisTeamPlayersCount;
|
||||
|
||||
if (Team == ALLIANCE)
|
||||
if (team == ALLIANCE)
|
||||
{
|
||||
thisTeamInvitedCount = GetInvitedCount(ALLIANCE);
|
||||
otherTeamInvitedCount = GetInvitedCount(HORDE);
|
||||
@@ -1690,7 +1690,7 @@ void Battleground::HandleKillPlayer(Player* victim, Player* killer)
|
||||
if (killer == victim)
|
||||
return;
|
||||
|
||||
uint32 killerTeam = GetPlayerTeam(killer->GetGUID());
|
||||
Team killerTeam = GetPlayerTeam(killer->GetGUID());
|
||||
|
||||
UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1);
|
||||
UpdatePlayerScore(killer, SCORE_KILLING_BLOWS, 1);
|
||||
@@ -1716,17 +1716,17 @@ void Battleground::HandleKillPlayer(Player* victim, Player* killer)
|
||||
|
||||
// Return the player's team based on battlegroundplayer info
|
||||
// Used in same faction arena matches mainly
|
||||
uint32 Battleground::GetPlayerTeam(ObjectGuid guid) const
|
||||
Team Battleground::GetPlayerTeam(ObjectGuid guid) const
|
||||
{
|
||||
BattlegroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
||||
if (itr != m_Players.end())
|
||||
return itr->second.Team;
|
||||
return 0;
|
||||
return TEAM_OTHER;
|
||||
}
|
||||
|
||||
uint32 Battleground::GetOtherTeam(uint32 teamId) const
|
||||
Team Battleground::GetOtherTeam(Team team) const
|
||||
{
|
||||
return teamId ? ((teamId == ALLIANCE) ? HORDE : ALLIANCE) : 0;
|
||||
return team ? ((team == ALLIANCE) ? HORDE : ALLIANCE) : TEAM_OTHER;
|
||||
}
|
||||
|
||||
bool Battleground::IsPlayerInBattleground(ObjectGuid guid) const
|
||||
@@ -1757,12 +1757,12 @@ void Battleground::PlayerAddedToBGCheckIfBGIsRunning(Player* player)
|
||||
player->SendDirectMessage(pvpMatchStatistics.Write());
|
||||
}
|
||||
|
||||
uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
uint32 Battleground::GetAlivePlayersCountByTeam(Team team) const
|
||||
{
|
||||
int count = 0;
|
||||
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
if (itr->second.Team == Team)
|
||||
if (itr->second.Team == team)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (player && player->IsAlive())
|
||||
@@ -1782,9 +1782,9 @@ int32 Battleground::GetObjectType(ObjectGuid guid)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void Battleground::SetBgRaid(uint32 TeamID, Group* bg_raid)
|
||||
void Battleground::SetBgRaid(Team team, Group* bg_raid)
|
||||
{
|
||||
Group*& old_raid = TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE];
|
||||
Group*& old_raid = team == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE];
|
||||
if (old_raid)
|
||||
old_raid->SetBattlegroundGroup(nullptr);
|
||||
if (bg_raid)
|
||||
@@ -1820,7 +1820,7 @@ void Battleground::RewardXPAtKill(Player* killer, Player* victim)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Battleground::GetTeamScore(uint32 teamId) const
|
||||
uint32 Battleground::GetTeamScore(TeamId teamId) const
|
||||
{
|
||||
if (teamId == TEAM_ALLIANCE || teamId == TEAM_HORDE)
|
||||
return m_TeamScores[teamId];
|
||||
|
||||
@@ -170,7 +170,7 @@ enum BattlegroundStatus
|
||||
struct BattlegroundPlayer
|
||||
{
|
||||
time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
|
||||
uint32 Team; // Player's team
|
||||
::Team Team; // Player's team
|
||||
bool Mercenary;
|
||||
BattlegroundQueueTypeId queueTypeId;
|
||||
};
|
||||
@@ -318,12 +318,12 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
|
||||
void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
|
||||
|
||||
void DecreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
|
||||
void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
|
||||
void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
|
||||
void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
|
||||
|
||||
uint32 GetInvitedCount(uint32 team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; }
|
||||
uint32 GetInvitedCount(Team team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; }
|
||||
bool HasFreeSlots() const;
|
||||
uint32 GetFreeSlotsForTeam(uint32 Team) const;
|
||||
uint32 GetFreeSlotsForTeam(Team team) const;
|
||||
|
||||
bool isArena() const;
|
||||
bool isBattleground() const;
|
||||
@@ -355,7 +355,7 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
|
||||
// Packet Transfer
|
||||
// method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
|
||||
void SendPacketToTeam(uint32 teamId, WorldPacket const* packet, Player* except = nullptr) const;
|
||||
void SendPacketToTeam(Team team, WorldPacket const* packet, Player* except = nullptr) const;
|
||||
void SendPacketToAll(WorldPacket const* packet) const;
|
||||
|
||||
void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = nullptr);
|
||||
@@ -364,22 +364,22 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
template<class Do>
|
||||
void BroadcastWorker(Do& _do);
|
||||
|
||||
void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
|
||||
void PlaySoundToTeam(uint32 SoundID, Team team);
|
||||
void PlaySoundToAll(uint32 SoundID);
|
||||
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
|
||||
void RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID);
|
||||
void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
|
||||
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
|
||||
void CastSpellOnTeam(uint32 SpellID, Team team);
|
||||
void RemoveAuraOnTeam(uint32 SpellID, Team team);
|
||||
void RewardHonorToTeam(uint32 Honor, Team team);
|
||||
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, Team team);
|
||||
void UpdateWorldState(int32 worldStateId, int32 value, bool hidden = false);
|
||||
virtual void EndBattleground(uint32 winner);
|
||||
virtual void EndBattleground(Team winner);
|
||||
void BlockMovement(Player* player);
|
||||
|
||||
void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = nullptr);
|
||||
void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
|
||||
|
||||
// Raid Group
|
||||
Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
|
||||
void SetBgRaid(uint32 TeamID, Group* bg_raid);
|
||||
Group* GetBgRaid(Team team) const { return team == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
|
||||
void SetBgRaid(Team team, Group* bg_raid);
|
||||
|
||||
virtual void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchStatistics& pvpLogData) const;
|
||||
|
||||
@@ -388,25 +388,25 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
virtual bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
|
||||
void UpdatePvpStat(Player* player, uint32 pvpStatId, uint32 value);
|
||||
|
||||
static TeamId GetTeamIndexByTeamId(uint32 Team) { return Team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
|
||||
uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
|
||||
uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
|
||||
void UpdatePlayersCountByTeam(uint32 Team, bool remove)
|
||||
static TeamId GetTeamIndexByTeamId(Team team) { return team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
|
||||
uint32 GetPlayersCountByTeam(Team team) const { return m_PlayersCount[GetTeamIndexByTeamId(team)]; }
|
||||
uint32 GetAlivePlayersCountByTeam(Team team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
|
||||
void UpdatePlayersCountByTeam(Team team, bool remove)
|
||||
{
|
||||
if (remove)
|
||||
--m_PlayersCount[GetTeamIndexByTeamId(Team)];
|
||||
--m_PlayersCount[GetTeamIndexByTeamId(team)];
|
||||
else
|
||||
++m_PlayersCount[GetTeamIndexByTeamId(Team)];
|
||||
++m_PlayersCount[GetTeamIndexByTeamId(team)];
|
||||
}
|
||||
|
||||
virtual void CheckWinConditions() { }
|
||||
|
||||
// used for rated arena battles
|
||||
void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
|
||||
uint32 GetArenaTeamIdByIndex(uint32 index) const { return m_ArenaTeamIds[index]; }
|
||||
void SetArenaMatchmakerRating(uint32 Team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)] = MMR; }
|
||||
uint32 GetArenaMatchmakerRating(uint32 Team) const { return m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)]; }
|
||||
void SetArenaTeamIdForTeam(Team team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(team)] = ArenaTeamId; }
|
||||
uint32 GetArenaTeamIdForTeam(Team team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(team)]; }
|
||||
uint32 GetArenaTeamIdByIndex(TeamId teamId) const { return m_ArenaTeamIds[teamId]; }
|
||||
void SetArenaMatchmakerRating(Team team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(team)] = MMR; }
|
||||
uint32 GetArenaMatchmakerRating(Team team) const { return m_ArenaTeamMMR[GetTeamIndexByTeamId(team)]; }
|
||||
|
||||
// Triggers handle
|
||||
// must be implemented in BG subclass
|
||||
@@ -436,7 +436,7 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
|
||||
virtual void AddPlayer(Player* player, BattlegroundQueueTypeId queueId); // must be implemented in BG subclass
|
||||
|
||||
void AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team);
|
||||
void AddOrSetPlayerToCorrectBgGroup(Player* player, Team team);
|
||||
|
||||
virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
|
||||
// can be extended in in BG subclass
|
||||
@@ -462,8 +462,8 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
|
||||
|
||||
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
|
||||
uint32 GetPlayerTeam(ObjectGuid guid) const;
|
||||
uint32 GetOtherTeam(uint32 teamId) const;
|
||||
Team GetPlayerTeam(ObjectGuid guid) const;
|
||||
Team GetOtherTeam(Team team) const;
|
||||
bool IsPlayerInBattleground(ObjectGuid guid) const;
|
||||
bool IsPlayerMercenaryInBattleground(ObjectGuid guid) const;
|
||||
|
||||
@@ -478,9 +478,9 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
virtual void HandleQuestComplete(uint32 /*questid*/, Player* /*player*/) { }
|
||||
virtual bool CanActivateGO(int32 /*entry*/, uint32 /*team*/) const { return true; }
|
||||
virtual bool IsSpellAllowed(uint32 /*spellId*/, Player const* /*player*/) const { return true; }
|
||||
uint32 GetTeamScore(uint32 TeamID) const;
|
||||
uint32 GetTeamScore(TeamId teamId) const;
|
||||
|
||||
virtual uint32 GetPrematureWinner();
|
||||
virtual Team GetPrematureWinner();
|
||||
|
||||
// because BattleGrounds with different types and same level range has different m_BracketId
|
||||
uint8 GetUniqueBracketId() const;
|
||||
@@ -505,7 +505,7 @@ class TC_GAME_API Battleground : public ZoneScript
|
||||
Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const;
|
||||
Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, char const* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
|
||||
Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
|
||||
Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
|
||||
Player* _GetPlayerForTeam(Team team, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
|
||||
|
||||
/* Pre- and post-update hooks */
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ void BattlegroundMgr::SendToBattleground(Player* player, uint32 instanceId, Batt
|
||||
if (Battleground* bg = GetBattleground(instanceId, bgTypeId))
|
||||
{
|
||||
uint32 mapid = bg->GetMapId();
|
||||
uint32 team = player->GetBGTeam();
|
||||
Team team = player->GetBGTeam();
|
||||
|
||||
WorldSafeLocsEntry const* pos = bg->GetTeamStartPosition(Battleground::GetTeamIndexByTeamId(team));
|
||||
TC_LOG_DEBUG("bg.battleground", "BattlegroundMgr::SendToBattleground: Sending {} to map {}, {} (bgType {})", player->GetName(), mapid, pos->Loc.ToString(), bgTypeId);
|
||||
|
||||
@@ -425,7 +425,7 @@ uint32 BattlegroundQueue::GetPlayersInQueue(TeamId id)
|
||||
return m_SelectionPools[id].GetPlayerCount();
|
||||
}
|
||||
|
||||
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, uint32 side)
|
||||
bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, Team side)
|
||||
{
|
||||
// set side if needed
|
||||
if (side)
|
||||
@@ -701,9 +701,9 @@ bool BattlegroundQueue::CheckSkirmishForSameFaction(BattlegroundBracketId bracke
|
||||
{
|
||||
if (m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount() < minPlayersPerTeam && m_SelectionPools[TEAM_HORDE].GetPlayerCount() < minPlayersPerTeam)
|
||||
return false;
|
||||
uint32 teamIndex = TEAM_ALLIANCE;
|
||||
uint32 otherTeam = TEAM_HORDE;
|
||||
uint32 otherTeamId = HORDE;
|
||||
TeamId teamIndex = TEAM_ALLIANCE;
|
||||
TeamId otherTeam = TEAM_HORDE;
|
||||
Team otherTeamId = HORDE;
|
||||
if (m_SelectionPools[TEAM_HORDE].GetPlayerCount() == minPlayersPerTeam)
|
||||
{
|
||||
teamIndex = TEAM_HORDE;
|
||||
@@ -715,16 +715,16 @@ bool BattlegroundQueue::CheckSkirmishForSameFaction(BattlegroundBracketId bracke
|
||||
//store last ginfo pointer
|
||||
GroupQueueInfo* ginfo = m_SelectionPools[teamIndex].SelectedGroups.back();
|
||||
//set itr_team to group that was added to selection pool latest
|
||||
GroupsQueueType::iterator itr_team = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].begin();
|
||||
for (; itr_team != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team)
|
||||
GroupsQueueType::iterator itr_team = m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].begin();
|
||||
for (; itr_team != m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].end(); ++itr_team)
|
||||
if (ginfo == *itr_team)
|
||||
break;
|
||||
if (itr_team == m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end())
|
||||
if (itr_team == m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].end())
|
||||
return false;
|
||||
GroupsQueueType::iterator itr_team2 = itr_team;
|
||||
++itr_team2;
|
||||
//invite players to other selection pool
|
||||
for (; itr_team2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team2)
|
||||
for (; itr_team2 != m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].end(); ++itr_team2)
|
||||
{
|
||||
//if selection pool is full then break;
|
||||
if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam))
|
||||
@@ -739,15 +739,15 @@ bool BattlegroundQueue::CheckSkirmishForSameFaction(BattlegroundBracketId bracke
|
||||
//set correct team
|
||||
(*itr)->Team = otherTeamId;
|
||||
//add team to other queue
|
||||
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + otherTeam].push_front(*itr);
|
||||
m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(otherTeam)].push_front(*itr);
|
||||
//remove team from old queue
|
||||
GroupsQueueType::iterator itr2 = itr_team;
|
||||
++itr2;
|
||||
for (; itr2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr2)
|
||||
for (; itr2 != m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].end(); ++itr2)
|
||||
{
|
||||
if (*itr2 == *itr)
|
||||
{
|
||||
m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].erase(itr2);
|
||||
m_QueuedGroups[bracket_id][uint8(BG_QUEUE_NORMAL_ALLIANCE) + uint8(teamIndex)].erase(itr2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ struct PlayerQueueInfo // stores informatio
|
||||
struct GroupQueueInfo // stores information about the group in queue (also used when joined as solo!)
|
||||
{
|
||||
std::map<ObjectGuid, PlayerQueueInfo*> Players; // player queue info map
|
||||
uint32 Team; // Player team (ALLIANCE/HORDE)
|
||||
::Team Team; // Player team (ALLIANCE/HORDE)
|
||||
uint32 ArenaTeamId; // team id if rated match
|
||||
uint32 JoinTime; // time when group was added
|
||||
uint32 RemoveInviteTime; // time when we will remove invite for players in group
|
||||
@@ -127,7 +127,7 @@ class TC_GAME_API BattlegroundQueue
|
||||
|
||||
BattlegroundQueueTypeId m_queueId;
|
||||
|
||||
bool InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, uint32 side);
|
||||
bool InviteGroupToBG(GroupQueueInfo* ginfo, Battleground* bg, Team side);
|
||||
uint32 m_WaitTimes[PVP_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME];
|
||||
uint32 m_WaitTimeLastPlayer[PVP_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
|
||||
uint32 m_SumOfWaitTimes[PVP_TEAMS_COUNT][MAX_BATTLEGROUND_BRACKETS];
|
||||
|
||||
@@ -193,7 +193,7 @@ void BattlegroundAB::_CalculateTeamNodes(uint8& alliance, uint8& horde)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 BattlegroundAB::GetPrematureWinner()
|
||||
Team BattlegroundAB::GetPrematureWinner()
|
||||
{
|
||||
// How many bases each team owns
|
||||
uint8 ally = 0, horde = 0;
|
||||
@@ -481,7 +481,7 @@ void BattlegroundAB::Reset()
|
||||
_capturePoints.clear();
|
||||
}
|
||||
|
||||
void BattlegroundAB::EndBattleground(uint32 winner)
|
||||
void BattlegroundAB::EndBattleground(Team winner)
|
||||
{
|
||||
// Win reward
|
||||
if (winner == ALLIANCE)
|
||||
|
||||
@@ -225,11 +225,11 @@ class BattlegroundAB : public Battleground
|
||||
void HandleAreaTrigger(Player* source, uint32 trigger, bool entered) override;
|
||||
bool SetupBattleground() override;
|
||||
void Reset() override;
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void EndBattleground(Team winner) override;
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
|
||||
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
|
||||
|
||||
uint32 GetPrematureWinner() override;
|
||||
Team GetPrematureWinner() override;
|
||||
|
||||
void ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject* invoker = nullptr) override;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ BattlegroundAV::BattlegroundAV(BattlegroundTemplate const* battlegroundTemplate)
|
||||
m_IsInformedNearVictory[i] = false;
|
||||
m_CaptainAlive[i] = true;
|
||||
m_CaptainBuffTimer[i] = 0;
|
||||
m_Mine_Owner[i] = 0;
|
||||
m_Mine_Owner[i] = TEAM_OTHER;
|
||||
m_Mine_PrevOwner[i] = 0;
|
||||
m_Mine_Reclaim_Timer[i] = 0;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ BattlegroundAV::BattlegroundAV(BattlegroundTemplate const* battlegroundTemplate)
|
||||
m_Mine_Timer = 0;
|
||||
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
InitNode(i, 0, false);
|
||||
InitNode(i, TEAM_OTHER, false);
|
||||
|
||||
StartMessageIds[BG_STARTING_EVENT_SECOND] = BG_AV_TEXT_START_ONE_MINUTE;
|
||||
StartMessageIds[BG_STARTING_EVENT_THIRD] = BG_AV_TEXT_START_HALF_MINUTE;
|
||||
@@ -158,7 +158,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
{
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;//maybe we should log this, cause this must be a cheater or a big bug
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
uint8 teamIndex = GetTeamIndexByTeamId(team);
|
||||
/// @todo add reputation, events (including quest not available anymore, next quest available, go/npc de/spawning)and maybe honor
|
||||
TC_LOG_DEBUG("bg.battleground", "BG_AV Quest {} completed", questid);
|
||||
@@ -260,7 +260,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundAV::UpdateScore(uint16 team, int16 points)
|
||||
void BattlegroundAV::UpdateScore(Team team, int16 points)
|
||||
{ //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
|
||||
ASSERT(team == ALLIANCE || team == HORDE);
|
||||
uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
|
||||
@@ -402,7 +402,7 @@ void BattlegroundAV::PostUpdateImpl(uint32 diff)
|
||||
if (m_Mine_Reclaim_Timer[mine] > diff)
|
||||
m_Mine_Reclaim_Timer[mine] -= diff;
|
||||
else{ //we don't need to set this timer to 0 cause this codepart wont get called when this thing is 0
|
||||
ChangeMineOwner(mine, AV_NEUTRAL_TEAM);
|
||||
ChangeMineOwner(mine, TEAM_OTHER);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,7 +435,7 @@ void BattlegroundAV::StartingEventOpenDoors()
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
|
||||
ChangeMineOwner(mine, AV_NEUTRAL_TEAM, true);
|
||||
ChangeMineOwner(mine, TEAM_OTHER, true);
|
||||
|
||||
UpdateWorldState(AV_WS_SHOW_HORDE_REINFORCEMENTS, 1);
|
||||
UpdateWorldState(AV_WS_SHOW_ALLIANCE_REINFORCEMENTS, 1);
|
||||
@@ -447,7 +447,7 @@ void BattlegroundAV::StartingEventOpenDoors()
|
||||
TriggerGameEvent(BG_AV_EVENT_START_BATTLE);
|
||||
}
|
||||
|
||||
void BattlegroundAV::EndBattleground(uint32 winner)
|
||||
void BattlegroundAV::EndBattleground(Team winner)
|
||||
{
|
||||
//calculate bonuskills for both teams:
|
||||
//first towers:
|
||||
@@ -536,7 +536,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
DestroyNode(node);
|
||||
UpdateNodeWorldState(node);
|
||||
|
||||
uint32 owner = m_Nodes[node].Owner;
|
||||
Team owner = m_Nodes[node].Owner;
|
||||
if (IsTower(node))
|
||||
{
|
||||
uint8 tmp = node-BG_AV_NODES_DUNBALDAR_SOUTH;
|
||||
@@ -580,14 +580,14 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
herold->AI()->Talk(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture);
|
||||
}
|
||||
|
||||
void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
void BattlegroundAV::ChangeMineOwner(uint8 mine, Team team, bool initial)
|
||||
{
|
||||
// mine=0 northmine mine=1 southmin
|
||||
// changing the owner results in setting respawntim to infinite for current creatures,
|
||||
// spawning new mine owners creatures and changing the chest-objects so that the current owning team can use them
|
||||
ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
|
||||
if (team != ALLIANCE && team != HORDE)
|
||||
team = AV_NEUTRAL_TEAM;
|
||||
team = TEAM_OTHER;
|
||||
|
||||
if (m_Mine_Owner[mine] == team && !initial)
|
||||
return;
|
||||
@@ -672,15 +672,15 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
bool BattlegroundAV::CanActivateGO(int32 GOId, uint32 team) const
|
||||
{
|
||||
if (GOId == BG_AV_OBJECTID_MINE_N)
|
||||
return (m_Mine_Owner[AV_NORTH_MINE] == team);
|
||||
return (m_Mine_Owner[AV_NORTH_MINE] == Team(team));
|
||||
if (GOId == BG_AV_OBJECTID_MINE_S)
|
||||
return (m_Mine_Owner[AV_SOUTH_MINE] == team);
|
||||
return (m_Mine_Owner[AV_SOUTH_MINE] == Team(team));
|
||||
return true; //cause it's no mine'object it is ok if this is true
|
||||
}
|
||||
|
||||
void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
{
|
||||
uint32 owner = m_Nodes[node].Owner;
|
||||
Team owner = m_Nodes[node].Owner;
|
||||
ASSERT(owner);
|
||||
|
||||
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
|
||||
@@ -800,7 +800,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
return node+29;
|
||||
}
|
||||
}
|
||||
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
|
||||
else if (m_Nodes[node].Owner == TEAM_OTHER)
|
||||
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
|
||||
TC_LOG_ERROR("bg.battleground", "BattlegroundAV: Error! GetPlaceNode couldn't resolve node {}", node);
|
||||
ABORT();
|
||||
@@ -842,8 +842,8 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
||||
BG_AV_Nodes node = GetNodeThroughObject(object);
|
||||
|
||||
uint32 owner = m_Nodes[node].Owner; //maybe should name it prevowner
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team owner = m_Nodes[node].Owner; //maybe should name it prevowner
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
|
||||
if (owner == team || m_Nodes[node].State != POINT_ASSAULTED)
|
||||
return;
|
||||
@@ -908,8 +908,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
|
||||
|
||||
BG_AV_Nodes node = GetNodeThroughObject(object);
|
||||
uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team owner = m_Nodes[node].Owner; //maybe name it prevowner
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
TC_LOG_DEBUG("bg.battleground", "bg_av: player assaults point object {} node {}", object, node);
|
||||
if (owner == team || team == m_Nodes[node].TotalOwner)
|
||||
return; //surely a gm used this object
|
||||
@@ -918,7 +918,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
{
|
||||
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) //initial capping
|
||||
{
|
||||
if (!(owner == AV_NEUTRAL_TEAM && m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM))
|
||||
if (!(owner == TEAM_OTHER && m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM))
|
||||
return;
|
||||
|
||||
if (team == ALLIANCE)
|
||||
@@ -959,7 +959,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
//if snowfall gots capped it can be handled like all other graveyards
|
||||
if (m_Nodes[node].TotalOwner != AV_NEUTRAL_TEAM)
|
||||
{
|
||||
ASSERT(m_Nodes[node].Owner != AV_NEUTRAL_TEAM);
|
||||
ASSERT(m_Nodes[node].Owner != TEAM_OTHER);
|
||||
if (team == ALLIANCE)
|
||||
SpawnBGObject(object-22, RESPAWN_IMMEDIATELY);
|
||||
else
|
||||
@@ -1008,7 +1008,7 @@ void BattlegroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
|
||||
}
|
||||
|
||||
if (node == BG_AV_NODES_SNOWFALL_GRAVE)
|
||||
UpdateWorldState(AV_WS_SNOWFALL_GRAVEYARD_UNCONTROLLED, m_Nodes[node].Owner == AV_NEUTRAL_TEAM);
|
||||
UpdateWorldState(AV_WS_SNOWFALL_GRAVEYARD_UNCONTROLLED, m_Nodes[node].Owner == TEAM_OTHER);
|
||||
}
|
||||
|
||||
void BattlegroundAV::SendMineWorldStates(uint32 mine)
|
||||
@@ -1045,7 +1045,7 @@ WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveyard(Player* player)
|
||||
float x, y;
|
||||
player->GetPosition(x, y);
|
||||
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
WorldSafeLocsEntry const* pGraveyard = sObjectMgr->GetWorldSafeLoc(BG_AV_GraveyardIds[GetTeamIndexByTeamId(team) + 7]);
|
||||
float minDist = (pGraveyard->Loc.GetPositionX() - x) * (pGraveyard->Loc.GetPositionX() - x) + (pGraveyard->Loc.GetPositionY() - y) * (pGraveyard->Loc.GetPositionY() - y);
|
||||
|
||||
@@ -1345,7 +1345,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
return true;
|
||||
}
|
||||
|
||||
void BattlegroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattlegroundAV::AssaultNode(BG_AV_Nodes node, Team team)
|
||||
{
|
||||
if (m_Nodes[node].TotalOwner == team)
|
||||
{
|
||||
@@ -1386,7 +1386,7 @@ void BattlegroundAV::DestroyNode(BG_AV_Nodes node)
|
||||
m_Nodes[node].Timer = 0;
|
||||
}
|
||||
|
||||
void BattlegroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
|
||||
void BattlegroundAV::InitNode(BG_AV_Nodes node, Team team, bool tower)
|
||||
{
|
||||
m_Nodes[node].TotalOwner = team;
|
||||
m_Nodes[node].Owner = team;
|
||||
@@ -1398,7 +1398,7 @@ void BattlegroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
|
||||
m_Nodes[node].Tower = tower;
|
||||
}
|
||||
|
||||
void BattlegroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattlegroundAV::DefendNode(BG_AV_Nodes node, Team team)
|
||||
{
|
||||
ASSERT(m_Nodes[node].TotalOwner == team);
|
||||
ASSERT(m_Nodes[node].Owner != team);
|
||||
@@ -1422,7 +1422,7 @@ void BattlegroundAV::Reset()
|
||||
m_IsInformedNearVictory[i]=false;
|
||||
m_CaptainAlive[i] = true;
|
||||
m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes @todo get the right times
|
||||
m_Mine_Owner[i] = AV_NEUTRAL_TEAM;
|
||||
m_Mine_Owner[i] = TEAM_OTHER;
|
||||
m_Mine_PrevOwner[i] = m_Mine_Owner[i];
|
||||
}
|
||||
|
||||
@@ -1434,7 +1434,7 @@ void BattlegroundAV::Reset()
|
||||
InitNode(i, HORDE, false);
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers
|
||||
InitNode(i, HORDE, true);
|
||||
InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner
|
||||
InitNode(BG_AV_NODES_SNOWFALL_GRAVE, TEAM_OTHER, false); //give snowfall neutral owner
|
||||
|
||||
m_Mine_Timer = AV_MINE_TICK_TIMER;
|
||||
for (uint16 i = 0; i < AV_CPLACE_MAX + AsUnderlyingType(AV_STATICCPLACE_MAX); i++)
|
||||
@@ -1442,7 +1442,7 @@ void BattlegroundAV::Reset()
|
||||
DelCreature(i);
|
||||
}
|
||||
|
||||
uint32 BattlegroundAV::GetPrematureWinner()
|
||||
Team BattlegroundAV::GetPrematureWinner()
|
||||
{
|
||||
uint32 allianceScore = m_Team_Scores[GetTeamIndexByTeamId(ALLIANCE)];
|
||||
uint32 hordeScore = m_Team_Scores[GetTeamIndexByTeamId(HORDE)];
|
||||
|
||||
@@ -1571,7 +1571,7 @@ struct BG_AV_NodeInfo
|
||||
BG_AV_States PrevState;
|
||||
uint32 Timer;
|
||||
uint16 TotalOwner;
|
||||
uint16 Owner;
|
||||
Team Owner;
|
||||
uint16 PrevOwner;
|
||||
bool Tower;
|
||||
};
|
||||
@@ -1594,7 +1594,7 @@ class BattlegroundAV : public Battleground
|
||||
void Reset() override;
|
||||
|
||||
/*general stuff*/
|
||||
void UpdateScore(uint16 team, int16 points);
|
||||
void UpdateScore(Team team, int16 points);
|
||||
|
||||
/*handlestuff*/ //these are functions which get called from extern
|
||||
void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj) override;
|
||||
@@ -1603,12 +1603,12 @@ class BattlegroundAV : public Battleground
|
||||
void HandleQuestComplete(uint32 questid, Player* player) override;
|
||||
bool CanActivateGO(int32 GOId, uint32 team) const override;
|
||||
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void EndBattleground(Team winner) override;
|
||||
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
|
||||
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
|
||||
|
||||
uint32 GetPrematureWinner() override;
|
||||
Team GetPrematureWinner() override;
|
||||
|
||||
private:
|
||||
void PostUpdateImpl(uint32 diff) override;
|
||||
@@ -1618,10 +1618,10 @@ class BattlegroundAV : public Battleground
|
||||
void EventPlayerDefendsPoint(Player* player, uint32 object);
|
||||
void EventPlayerDestroyedPoint(BG_AV_Nodes node);
|
||||
|
||||
void AssaultNode(BG_AV_Nodes node, uint16 team);
|
||||
void AssaultNode(BG_AV_Nodes node, Team team);
|
||||
void DestroyNode(BG_AV_Nodes node);
|
||||
void InitNode(BG_AV_Nodes node, uint16 team, bool tower);
|
||||
void DefendNode(BG_AV_Nodes node, uint16 team);
|
||||
void InitNode(BG_AV_Nodes node, Team team, bool tower);
|
||||
void DefendNode(BG_AV_Nodes node, Team team);
|
||||
|
||||
void PopulateNode(BG_AV_Nodes node);
|
||||
void DePopulateNode(BG_AV_Nodes node);
|
||||
@@ -1639,7 +1639,7 @@ class BattlegroundAV : public Battleground
|
||||
bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
|
||||
|
||||
/*mine*/
|
||||
void ChangeMineOwner(uint8 mine, uint32 team, bool initial = false);
|
||||
void ChangeMineOwner(uint8 mine, Team team, bool initial = false);
|
||||
|
||||
/*worldstates*/
|
||||
void SendMineWorldStates(uint32 mine);
|
||||
@@ -1654,7 +1654,7 @@ class BattlegroundAV : public Battleground
|
||||
|
||||
BG_AV_NodeInfo m_Nodes[BG_AV_NODES_MAX];
|
||||
|
||||
uint32 m_Mine_Owner[2];
|
||||
Team m_Mine_Owner[2];
|
||||
uint32 m_Mine_PrevOwner[2]; //only for worldstates needed
|
||||
int32 m_Mine_Timer; //ticks for both teams
|
||||
uint32 m_Mine_Reclaim_Timer[2];
|
||||
|
||||
@@ -101,14 +101,14 @@ void BattlegroundEY::StartingEventOpenDoors()
|
||||
TriggerGameEvent(BG_EY_EVENT_START_BATTLE);
|
||||
}
|
||||
|
||||
void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
|
||||
void BattlegroundEY::AddPoints(Team team, uint32 Points)
|
||||
{
|
||||
TeamId team_index = GetTeamIndexByTeamId(Team);
|
||||
TeamId team_index = GetTeamIndexByTeamId(team);
|
||||
m_TeamScores[team_index] += Points;
|
||||
m_HonorScoreTics[team_index] += Points;
|
||||
if (m_HonorScoreTics[team_index] >= m_HonorTics)
|
||||
{
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), Team);
|
||||
RewardHonorToTeam(GetBonusHonorFromKill(1), team);
|
||||
m_HonorScoreTics[team_index] -= m_HonorTics;
|
||||
}
|
||||
UpdateTeamScore(team_index);
|
||||
@@ -186,7 +186,7 @@ void BattlegroundEY::RemoveAssaultDebuffFromPlayer(Player* player)
|
||||
player->RemoveAurasDueToSpell(BG_EY_BRUTAL_ASSAULT_SPELL);
|
||||
}
|
||||
|
||||
void BattlegroundEY::UpdateTeamScore(uint32 Team)
|
||||
void BattlegroundEY::UpdateTeamScore(TeamId Team)
|
||||
{
|
||||
uint32 score = GetTeamScore(Team);
|
||||
|
||||
@@ -205,7 +205,7 @@ void BattlegroundEY::UpdateTeamScore(uint32 Team)
|
||||
UpdateWorldState(EY_HORDE_RESOURCES, score);
|
||||
}
|
||||
|
||||
void BattlegroundEY::EndBattleground(uint32 winner)
|
||||
void BattlegroundEY::EndBattleground(Team winner)
|
||||
{
|
||||
// Win reward
|
||||
if (winner == ALLIANCE)
|
||||
@@ -455,7 +455,7 @@ WorldSafeLocsEntry const* BattlegroundEY::GetExploitTeleportLocation(Team team)
|
||||
return sObjectMgr->GetWorldSafeLoc(team == ALLIANCE ? EY_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : EY_EXPLOIT_TELEPORT_LOCATION_HORDE);
|
||||
}
|
||||
|
||||
uint32 BattlegroundEY::GetPrematureWinner()
|
||||
Team BattlegroundEY::GetPrematureWinner()
|
||||
{
|
||||
if (GetTeamScore(TEAM_ALLIANCE) > GetTeamScore(TEAM_HORDE))
|
||||
return ALLIANCE;
|
||||
|
||||
@@ -269,10 +269,10 @@ class BattlegroundEY : public Battleground
|
||||
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
|
||||
bool SetupBattleground() override;
|
||||
void Reset() override;
|
||||
void UpdateTeamScore(uint32 Team);
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void UpdateTeamScore(TeamId Team);
|
||||
void EndBattleground(Team winner) override;
|
||||
|
||||
uint32 GetPrematureWinner() override;
|
||||
Team GetPrematureWinner() override;
|
||||
|
||||
void ProcessEvent(WorldObject* target, uint32 eventId, WorldObject* invoker) override;
|
||||
void PostUpdateImpl(uint32 diff) override;
|
||||
@@ -289,10 +289,10 @@ class BattlegroundEY : public Battleground
|
||||
|
||||
private:
|
||||
/* Scorekeeping */
|
||||
void AddPoints(uint32 Team, uint32 Points);
|
||||
void AddPoints(Team team, uint32 Points);
|
||||
|
||||
void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; }
|
||||
void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; }
|
||||
void RemovePoint(Team team, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= Points; }
|
||||
void SetTeamPoint(Team team, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = Points; }
|
||||
|
||||
uint8 GetControlledBaseCount(TeamId teamId) const;
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target
|
||||
if (!AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
|
||||
{
|
||||
TC_LOG_ERROR("bg.battleground", "Isle of Conquest: There was an error spawning a banner (type: {}, entry: {}). Isle of Conquest BG cancelled.", nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry);
|
||||
EndBattleground(0);
|
||||
EndBattleground(TEAM_OTHER);
|
||||
}
|
||||
|
||||
GetBGObject(nodePoint[i].gameobject_type)->SetFaction(nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]);
|
||||
|
||||
@@ -422,7 +422,7 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
|
||||
RoundScores[1].time = BG_SA_ROUNDLENGTH;
|
||||
RoundScores[1].winner = (Attackers == TEAM_ALLIANCE) ? TEAM_HORDE : TEAM_ALLIANCE;
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleground(0);
|
||||
EndBattleground(TEAM_OTHER);
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
@@ -904,7 +904,7 @@ void BattlegroundSA::TitanRelicActivated(Player* clicker)
|
||||
}
|
||||
|
||||
if (RoundScores[0].time == RoundScores[1].time)
|
||||
EndBattleground(0);
|
||||
EndBattleground(TEAM_OTHER);
|
||||
else if (RoundScores[0].time < RoundScores[1].time)
|
||||
EndBattleground(RoundScores[0].winner == TEAM_ALLIANCE ? ALLIANCE : HORDE);
|
||||
else
|
||||
@@ -920,7 +920,7 @@ void BattlegroundSA::ToggleTimer()
|
||||
UpdateWorldState(BG_SA_ENABLE_TIMER, TimerEnabled);
|
||||
}
|
||||
|
||||
void BattlegroundSA::EndBattleground(uint32 winner)
|
||||
void BattlegroundSA::EndBattleground(Team winner)
|
||||
{
|
||||
// honor reward for winning
|
||||
if (winner == ALLIANCE)
|
||||
|
||||
@@ -562,7 +562,7 @@ class BattlegroundSA : public Battleground
|
||||
}
|
||||
|
||||
/// Called on battleground ending
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void EndBattleground(Team winner) override;
|
||||
|
||||
/// Called when a player leave battleground
|
||||
void RemovePlayer(Player* player, ObjectGuid guid, uint32 team) override;
|
||||
|
||||
@@ -62,7 +62,7 @@ BattlegroundWS::BattlegroundWS(BattlegroundTemplate const* battlegroundTemplate)
|
||||
|
||||
_bothFlagsKept = false;
|
||||
|
||||
_lastFlagCaptureTeam = 0;
|
||||
_lastFlagCaptureTeam = TEAM_OTHER;
|
||||
m_ReputationCapture = 0;
|
||||
m_HonorWinKills = 0;
|
||||
m_HonorEndKills = 0;
|
||||
@@ -85,7 +85,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
|
||||
if (GetTeamScore(TEAM_ALLIANCE) == 0)
|
||||
{
|
||||
if (GetTeamScore(TEAM_HORDE) == 0) // No one scored - result is tie
|
||||
EndBattleground(0);
|
||||
EndBattleground(TEAM_OTHER);
|
||||
else // Horde has more points and thus wins
|
||||
EndBattleground(HORDE);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void BattlegroundWS::UpdateFlagState(uint32 team, FlagState value)
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundWS::UpdateTeamScore(uint32 team)
|
||||
void BattlegroundWS::UpdateTeamScore(TeamId team)
|
||||
{
|
||||
if (team == TEAM_ALLIANCE)
|
||||
UpdateWorldState(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(team));
|
||||
@@ -277,7 +277,7 @@ void BattlegroundWS::Reset()
|
||||
m_HonorWinKills = 1;
|
||||
m_HonorEndKills = 2;
|
||||
}
|
||||
_lastFlagCaptureTeam = 0;
|
||||
_lastFlagCaptureTeam = TEAM_OTHER;
|
||||
_bothFlagsKept = false;
|
||||
|
||||
_doors.clear();
|
||||
@@ -287,7 +287,7 @@ void BattlegroundWS::Reset()
|
||||
_capturePointAreaTriggers = { };
|
||||
}
|
||||
|
||||
void BattlegroundWS::EndBattleground(uint32 winner)
|
||||
void BattlegroundWS::EndBattleground(Team winner)
|
||||
{
|
||||
// Win reward
|
||||
if (winner == ALLIANCE)
|
||||
@@ -322,7 +322,7 @@ WorldSafeLocsEntry const* BattlegroundWS::GetExploitTeleportLocation(Team team)
|
||||
return sObjectMgr->GetWorldSafeLoc(team == ALLIANCE ? WS_EXPLOIT_TELEPORT_LOCATION_ALLIANCE : WS_EXPLOIT_TELEPORT_LOCATION_HORDE);
|
||||
}
|
||||
|
||||
uint32 BattlegroundWS::GetPrematureWinner()
|
||||
Team BattlegroundWS::GetPrematureWinner()
|
||||
{
|
||||
if (GetTeamScore(TEAM_ALLIANCE) > GetTeamScore(TEAM_HORDE))
|
||||
return ALLIANCE;
|
||||
@@ -375,7 +375,7 @@ void BattlegroundWS::OnAreaTriggerCreate(AreaTrigger* areaTrigger)
|
||||
|
||||
void BattlegroundWS::OnFlagStateChange(GameObject* flagInBase, FlagState /*oldValue*/, FlagState newValue, Player* player)
|
||||
{
|
||||
uint32 team = flagInBase->GetEntry() == BG_WS_OBJECT_HORDE_FLAG_IN_BASE ? HORDE : ALLIANCE;
|
||||
Team team = flagInBase->GetEntry() == BG_WS_OBJECT_HORDE_FLAG_IN_BASE ? HORDE : ALLIANCE;
|
||||
TeamId otherTeamId = GetTeamIndexByTeamId(GetOtherTeam(team));
|
||||
|
||||
UpdateFlagState(team, newValue);
|
||||
@@ -467,7 +467,7 @@ bool BattlegroundWS::CanCaptureFlag(AreaTrigger* areaTrigger, Player* player)
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return false;
|
||||
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
TeamId teamId = GetTeamIndexByTeamId(team);
|
||||
TeamId otherTeamId = GetTeamIndexByTeamId(GetOtherTeam(team));
|
||||
|
||||
@@ -484,9 +484,9 @@ bool BattlegroundWS::CanCaptureFlag(AreaTrigger* areaTrigger, Player* player)
|
||||
|
||||
void BattlegroundWS::OnCaptureFlag(AreaTrigger* /*areaTrigger*/, Player* player)
|
||||
{
|
||||
uint32 winner = 0;
|
||||
Team winner = TEAM_OTHER;
|
||||
|
||||
uint32 team = GetPlayerTeam(player->GetGUID());
|
||||
Team team = GetPlayerTeam(player->GetGUID());
|
||||
TeamId teamId = GetTeamIndexByTeamId(team);
|
||||
TeamId otherTeamId = GetTeamIndexByTeamId(GetOtherTeam(team));
|
||||
|
||||
|
||||
@@ -152,20 +152,20 @@ class BattlegroundWS : public Battleground
|
||||
void HandleKillPlayer(Player* player, Player* killer) override;
|
||||
bool SetupBattleground() override;
|
||||
void Reset() override;
|
||||
void EndBattleground(uint32 winner) override;
|
||||
void EndBattleground(Team winner) override;
|
||||
WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
|
||||
WorldSafeLocsEntry const* GetExploitTeleportLocation(Team team) override;
|
||||
|
||||
void UpdateFlagState(uint32 team, FlagState value);
|
||||
void SetLastFlagCapture(uint32 team) { _lastFlagCaptureTeam = team; }
|
||||
void UpdateTeamScore(uint32 team);
|
||||
void SetLastFlagCapture(Team team) { _lastFlagCaptureTeam = team; }
|
||||
void UpdateTeamScore(TeamId team);
|
||||
|
||||
/* Scorekeeping */
|
||||
void AddPoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] += Points; }
|
||||
void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; }
|
||||
void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; }
|
||||
void AddPoint(Team team, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] += Points; }
|
||||
void SetTeamPoint(Team team, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = Points; }
|
||||
void RemovePoint(Team team, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= Points; }
|
||||
|
||||
uint32 GetPrematureWinner() override;
|
||||
Team GetPrematureWinner() override;
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameObject) override;
|
||||
void OnAreaTriggerCreate(AreaTrigger* areaTrigger) override;
|
||||
@@ -184,7 +184,7 @@ class BattlegroundWS : public Battleground
|
||||
void RemoveAssaultDebuffFromPlayer(Player* player);
|
||||
|
||||
private:
|
||||
uint32 _lastFlagCaptureTeam; // Winner is based on this if score is equal
|
||||
Team _lastFlagCaptureTeam; // Winner is based on this if score is equal
|
||||
|
||||
uint32 m_ReputationCapture;
|
||||
uint32 m_HonorWinKills;
|
||||
|
||||
@@ -243,11 +243,11 @@ bool CharacterCache::GetCharacterNameByGuid(ObjectGuid guid, std::string& name)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32 CharacterCache::GetCharacterTeamByGuid(ObjectGuid guid) const
|
||||
Team CharacterCache::GetCharacterTeamByGuid(ObjectGuid guid) const
|
||||
{
|
||||
auto itr = _characterCacheStore.find(guid);
|
||||
if (itr == _characterCacheStore.end())
|
||||
return 0;
|
||||
return TEAM_OTHER;
|
||||
|
||||
return Player::TeamForRace(itr->second.Race);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "Define.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Optional.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <string>
|
||||
|
||||
struct CharacterCacheEntry
|
||||
@@ -62,7 +63,7 @@ class TC_GAME_API CharacterCache
|
||||
|
||||
ObjectGuid GetCharacterGuidByName(std::string const& name) const;
|
||||
bool GetCharacterNameByGuid(ObjectGuid guid, std::string& name) const;
|
||||
uint32 GetCharacterTeamByGuid(ObjectGuid guid) const;
|
||||
Team GetCharacterTeamByGuid(ObjectGuid guid) const;
|
||||
uint32 GetCharacterAccountIdByGuid(ObjectGuid guid) const;
|
||||
uint32 GetCharacterAccountIdByName(std::string const& name) const;
|
||||
uint8 GetCharacterLevelByGuid(ObjectGuid guid) const;
|
||||
|
||||
@@ -323,7 +323,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
case CONDITION_TEAM:
|
||||
{
|
||||
if (Player const* player = object->ToPlayer())
|
||||
condMeets = player->GetTeam() == ConditionValue1;
|
||||
condMeets = player->GetTeam() == Team(ConditionValue1);
|
||||
break;
|
||||
}
|
||||
case CONDITION_CLASS:
|
||||
|
||||
@@ -185,7 +185,7 @@ Player::Player(WorldSession* session) : Unit(true), m_sceneMgr(this)
|
||||
m_zoneUpdateTimer = 0;
|
||||
|
||||
m_areaUpdateId = 0;
|
||||
m_team = 0;
|
||||
m_team = TEAM_OTHER;
|
||||
|
||||
m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
m_customizationsChanged = false;
|
||||
@@ -6491,7 +6491,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
||||
}
|
||||
}
|
||||
|
||||
uint32 Player::TeamForRace(uint8 race)
|
||||
Team Player::TeamForRace(uint8 race)
|
||||
{
|
||||
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
|
||||
{
|
||||
@@ -17400,7 +17400,7 @@ void Player::_LoadBGData(PreparedQueryResult result)
|
||||
// SELECT instanceId, team, joinX, joinY, joinZ, joinO, joinMapId, taxiStart, taxiEnd, mountSpell, queueTypeId FROM character_battleground_data WHERE guid = ?
|
||||
|
||||
m_bgData.bgInstanceID = fields[0].GetUInt32();
|
||||
m_bgData.bgTeam = fields[1].GetUInt16();
|
||||
m_bgData.bgTeam = Team(fields[1].GetUInt16());
|
||||
m_bgData.joinPos = WorldLocation(fields[6].GetUInt16(), // Map
|
||||
fields[2].GetFloat(), // X
|
||||
fields[3].GetFloat(), // Y
|
||||
@@ -23457,13 +23457,13 @@ void Player::SetBattlegroundEntryPoint()
|
||||
m_bgData.joinPos.WorldRelocate(m_homebind);
|
||||
}
|
||||
|
||||
void Player::SetBGTeam(uint32 team)
|
||||
void Player::SetBGTeam(Team team)
|
||||
{
|
||||
m_bgData.bgTeam = team;
|
||||
SetArenaFaction(uint8(team == ALLIANCE ? 1 : 0));
|
||||
}
|
||||
|
||||
uint32 Player::GetBGTeam() const
|
||||
Team Player::GetBGTeam() const
|
||||
{
|
||||
return m_bgData.bgTeam ? m_bgData.bgTeam : GetTeam();
|
||||
}
|
||||
|
||||
@@ -993,7 +993,7 @@ class Player;
|
||||
struct BGData
|
||||
{
|
||||
BGData() : bgInstanceID(0), bgTypeID(BATTLEGROUND_TYPE_NONE), bgAfkReportedCount(0), bgAfkReportedTimer(0),
|
||||
bgTeam(0), mountSpell(0), queueId(BATTLEGROUND_QUEUE_NONE) { ClearTaxiPath(); }
|
||||
bgTeam(TEAM_OTHER), mountSpell(0), queueId(BATTLEGROUND_QUEUE_NONE) { ClearTaxiPath(); }
|
||||
|
||||
uint32 bgInstanceID; ///< This variable is set to bg->m_InstanceID,
|
||||
/// when player is teleported to BG - (it is battleground's GUID)
|
||||
@@ -1003,7 +1003,7 @@ struct BGData
|
||||
uint8 bgAfkReportedCount;
|
||||
time_t bgAfkReportedTimer;
|
||||
|
||||
uint32 bgTeam; ///< What side the player will be added to
|
||||
Team bgTeam; ///< What side the player will be added to
|
||||
|
||||
uint32 mountSpell;
|
||||
uint32 taxiPath[2];
|
||||
@@ -2224,10 +2224,10 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void AddExploredZones(uint32 pos, uint64 mask) { SetUpdateFieldFlagValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::ExploredZones, pos), mask); }
|
||||
void RemoveExploredZones(uint32 pos, uint64 mask) { RemoveUpdateFieldFlagValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::ExploredZones, pos), mask); }
|
||||
|
||||
static uint32 TeamForRace(uint8 race);
|
||||
static Team TeamForRace(uint8 race);
|
||||
static TeamId TeamIdForRace(uint8 race);
|
||||
static uint8 GetFactionGroupForRace(uint8 race);
|
||||
uint32 GetTeam() const { return m_team; }
|
||||
Team GetTeam() const { return m_team; }
|
||||
TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
|
||||
void SetFactionForRace(uint8 race);
|
||||
|
||||
@@ -2411,8 +2411,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
WorldLocation const& GetBattlegroundEntryPoint() const { return m_bgData.joinPos; }
|
||||
void SetBattlegroundEntryPoint();
|
||||
|
||||
void SetBGTeam(uint32 team);
|
||||
uint32 GetBGTeam() const;
|
||||
void SetBGTeam(Team team);
|
||||
Team GetBGTeam() const;
|
||||
|
||||
void LeaveBattleground(bool teleportToEntryPoint = true);
|
||||
bool CanJoinToBattleground(BattlegroundTemplate const* bg) const;
|
||||
@@ -2993,7 +2993,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
|
||||
void outDebugValues() const;
|
||||
|
||||
uint32 m_team;
|
||||
Team m_team;
|
||||
uint32 m_nextSave;
|
||||
bool m_customizationsChanged;
|
||||
std::array<ChatFloodThrottle, ChatFloodThrottle::MAX> m_chatFloodData;
|
||||
|
||||
@@ -88,6 +88,8 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level
|
||||
{
|
||||
case ALLIANCE: SetTaximaskNode(100); break;
|
||||
case HORDE: SetTaximaskNode(99); break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// level dependent taxi hubs
|
||||
|
||||
@@ -1202,7 +1202,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(BattlegroundTemplate
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
|
||||
uint32 arenaTeamId = reference->GetArenaTeamId(arenaSlot);
|
||||
uint32 team = reference->GetTeam();
|
||||
Team team = reference->GetTeam();
|
||||
bool isMercenary = reference->HasAura(SPELL_MERCENARY_CONTRACT_HORDE) || reference->HasAura(SPELL_MERCENARY_CONTRACT_ALLIANCE);
|
||||
|
||||
// check every member of the group to be able to join
|
||||
|
||||
@@ -318,7 +318,7 @@ void WorldSession::HandleCalendarInvite(WorldPackets::Calendar::CalendarInvite&
|
||||
if (!normalizePlayerName(calendarEventInvite.Name))
|
||||
return;
|
||||
|
||||
auto createInvite = [this, playerGuid, inviteeName, eventId, isSignUp](ObjectGuid const& inviteeGuid, uint32 inviteeTeam, ObjectGuid::LowType inviteeGuildId, bool inviteeIsIngoring)
|
||||
auto createInvite = [this, playerGuid, inviteeName, eventId, isSignUp](ObjectGuid const& inviteeGuid, Team inviteeTeam, ObjectGuid::LowType inviteeGuildId, bool inviteeIsIngoring)
|
||||
{
|
||||
if (!_player || _player->GetGUID() != playerGuid)
|
||||
return;
|
||||
|
||||
@@ -138,7 +138,7 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
|
||||
return;
|
||||
}
|
||||
|
||||
auto mailCountCheckContinuation = [this, player = _player, receiverGuid, mailInfo = std::move(sendMail.Info), reqmoney, cost](uint32 receiverTeam, uint64 mailsCount, uint8 receiverLevel, uint32 receiverAccountId, uint32 receiverBnetAccountId) mutable
|
||||
auto mailCountCheckContinuation = [this, player = _player, receiverGuid, mailInfo = std::move(sendMail.Info), reqmoney, cost](Team receiverTeam, uint64 mailsCount, uint8 receiverLevel, uint32 receiverAccountId, uint32 receiverBnetAccountId) mutable
|
||||
{
|
||||
if (_player != player)
|
||||
return;
|
||||
|
||||
@@ -141,7 +141,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
// We're not in BG
|
||||
player->SetBattlegroundId(0, BATTLEGROUND_TYPE_NONE, BATTLEGROUND_QUEUE_NONE);
|
||||
// reset destination bg team
|
||||
player->SetBGTeam(0);
|
||||
player->SetBGTeam(TEAM_OTHER);
|
||||
}
|
||||
// join to bg case
|
||||
else if (Battleground* bg = player->GetBattleground())
|
||||
|
||||
@@ -2877,7 +2877,7 @@ void World::ForceGameEventUpdate()
|
||||
}
|
||||
|
||||
/// Send a packet to all players (except self if mentioned)
|
||||
void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, uint32 team)
|
||||
void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, Optional<Team> team)
|
||||
{
|
||||
SessionMap::const_iterator itr;
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
@@ -2886,7 +2886,7 @@ void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, uin
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
(team == 0 || itr->second->GetPlayer()->GetTeam() == team))
|
||||
(!team || itr->second->GetPlayer()->GetTeam() == team))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
}
|
||||
@@ -2894,7 +2894,7 @@ void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, uin
|
||||
}
|
||||
|
||||
/// Send a packet to all GMs (except self if mentioned)
|
||||
void World::SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self, uint32 team)
|
||||
void World::SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self, Optional<Team> team)
|
||||
{
|
||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
{
|
||||
@@ -3039,7 +3039,7 @@ void World::SendGlobalText(char const* text, WorldSession* self)
|
||||
}
|
||||
|
||||
/// Send a packet to all players (or players selected team) in the zone (except self if mentioned)
|
||||
bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self, uint32 team)
|
||||
bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self, Optional<Team> team)
|
||||
{
|
||||
bool foundPlayerToSend = false;
|
||||
SessionMap::const_iterator itr;
|
||||
@@ -3051,7 +3051,7 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second->GetPlayer()->GetZoneId() == zone &&
|
||||
itr->second != self &&
|
||||
(team == 0 || itr->second->GetPlayer()->GetTeam() == team))
|
||||
(!team || itr->second->GetPlayer()->GetTeam() == team))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
foundPlayerToSend = true;
|
||||
@@ -3062,7 +3062,7 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession
|
||||
}
|
||||
|
||||
/// Send a System Message to all players in the zone (except self if mentioned)
|
||||
void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, uint32 team)
|
||||
void World::SendZoneText(uint32 zone, char const* text, WorldSession* self, Optional<Team> team)
|
||||
{
|
||||
WorldPackets::Chat::Chat packet;
|
||||
packet.Initialize(CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "LockedQueue.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Optional.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "Timer.h"
|
||||
|
||||
@@ -653,10 +654,10 @@ class TC_GAME_API World
|
||||
void SendGlobalText(char const* text, WorldSession* self);
|
||||
void SendGMText(uint32 string_id, ...);
|
||||
void SendServerMessage(ServerMessageType messageID, std::string_view stringParam = {}, Player const* player = nullptr);
|
||||
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
|
||||
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
|
||||
void SendZoneText(uint32 zone, const char *text, WorldSession* self = nullptr, uint32 team = 0);
|
||||
void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, Optional<Team> team = { });
|
||||
void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, Optional<Team> team = { });
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, Optional<Team> team = { });
|
||||
void SendZoneText(uint32 zone, const char *text, WorldSession* self = nullptr, Optional<Team> team = { });
|
||||
|
||||
/// Are we in the middle of a shutdown?
|
||||
bool IsShuttingDown() const { return m_ShutdownTimer > 0; }
|
||||
|
||||
@@ -246,7 +246,7 @@ void HPControlZoneHandler::HandleProgressEventHorde(GameObject* controlZone)
|
||||
if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers())
|
||||
for (ObjectGuid const& guid : *guidSet)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid))
|
||||
if (player->GetTeam() == TEAM_HORDE)
|
||||
if (player->GetTeam() == HORDE)
|
||||
player->KilledMonsterCredit(_killCredit);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ void HPControlZoneHandler::HandleProgressEventAlliance(GameObject* controlZone)
|
||||
if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers())
|
||||
for (ObjectGuid const& guid : *guidSet)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid))
|
||||
if (player->GetTeam() == TEAM_ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
player->KilledMonsterCredit(_killCredit);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,12 +164,12 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount() const
|
||||
return std::count_if(guards.begin(), guards.end(), [](WorldObject* guard) { return guard->IsUnit() && guard->ToUnit()->IsAlive(); });
|
||||
}
|
||||
|
||||
uint32 OPvPCapturePointNA::GetControllingFaction() const
|
||||
Team OPvPCapturePointNA::GetControllingFaction() const
|
||||
{
|
||||
return m_ControllingFaction;
|
||||
}
|
||||
|
||||
void OPvPCapturePointNA::FactionTakeOver(uint32 team)
|
||||
void OPvPCapturePointNA::FactionTakeOver(Team team)
|
||||
{
|
||||
m_ControllingFaction = team;
|
||||
m_GuardsAlive = NA_GUARDS_MAX;
|
||||
@@ -207,7 +207,7 @@ void OPvPCapturePointNA::FactionTakeOver(uint32 team)
|
||||
UpdateWyvernRoostWorldState(NA_ROOST_E);
|
||||
}
|
||||
|
||||
OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(0), m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0),
|
||||
OPvPCapturePointNA::OPvPCapturePointNA(OutdoorPvP* pvp) : OPvPCapturePoint(pvp), m_capturable(true), m_GuardsAlive(0), m_ControllingFaction(TEAM_OTHER), m_WyvernStateNorth(0), m_WyvernStateSouth(0), m_WyvernStateEast(0),
|
||||
m_WyvernStateWest(0), m_RespawnTimer(NA_RESPAWN_TIME), m_GuardCheckTimer(NA_GUARD_CHECK_TIME)
|
||||
{
|
||||
|
||||
|
||||
@@ -158,15 +158,15 @@ class OPvPCapturePointNA : public OPvPCapturePoint
|
||||
int32 HandleOpenGo(Player* player, GameObject* go) override;
|
||||
|
||||
uint32 GetAliveGuardsCount() const;
|
||||
uint32 GetControllingFaction() const;
|
||||
void FactionTakeOver(uint32 team); // called when a faction takes control
|
||||
Team GetControllingFaction() const;
|
||||
void FactionTakeOver(Team team); // called when a faction takes control
|
||||
void UpdateWyvernRoostWorldState(uint32 roost);
|
||||
|
||||
void SetControlZoneGUID(ObjectGuid guid) { _controlZoneGUID = guid; }
|
||||
private:
|
||||
bool m_capturable;
|
||||
uint32 m_GuardsAlive;
|
||||
uint32 m_ControllingFaction;
|
||||
Team m_ControllingFaction;
|
||||
uint32 m_WyvernStateNorth;
|
||||
uint32 m_WyvernStateSouth;
|
||||
uint32 m_WyvernStateEast;
|
||||
|
||||
@@ -40,7 +40,7 @@ uint32 const OutdoorPvPSIBuffZones[OutdoorPvPSIBuffZonesNum] = { 1377, 3428, 342
|
||||
OutdoorPvPSI::OutdoorPvPSI(Map* map) : OutdoorPvP(map)
|
||||
{
|
||||
m_TypeId = OUTDOOR_PVP_SI;
|
||||
m_LastController = 0;
|
||||
m_LastController = TEAM_OTHER;
|
||||
}
|
||||
|
||||
void OutdoorPvPSI::SendRemoveWorldStates(Player* player)
|
||||
|
||||
@@ -50,7 +50,7 @@ class OutdoorPvPSI : public OutdoorPvP
|
||||
bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override;
|
||||
|
||||
private:
|
||||
uint32 m_LastController;
|
||||
Team m_LastController;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@ void TFControlZoneHandler::HandleProgressEventHorde(GameObject* controlZone)
|
||||
if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers())
|
||||
for (ObjectGuid const& guid : *guidSet)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid))
|
||||
if (player->GetTeam() == TEAM_HORDE)
|
||||
if (player->GetTeam() == HORDE)
|
||||
player->AreaExploredOrEventHappens(TF_HORDE_QUEST);
|
||||
|
||||
OutdoorPvPControlZoneHandler::HandleProgressEventHorde(controlZone);
|
||||
@@ -294,7 +294,7 @@ void TFControlZoneHandler::HandleProgressEventAlliance(GameObject* controlZone)
|
||||
if (GuidUnorderedSet const* guidSet = controlZone->GetInsidePlayers())
|
||||
for (ObjectGuid const& guid : *guidSet)
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*controlZone, guid))
|
||||
if (player->GetTeam() == TEAM_ALLIANCE)
|
||||
if (player->GetTeam() == ALLIANCE)
|
||||
player->AreaExploredOrEventHappens(TF_ALLY_QUEST);
|
||||
|
||||
OutdoorPvPControlZoneHandler::HandleProgressEventAlliance(controlZone);
|
||||
|
||||
@@ -149,6 +149,8 @@ class spell_q6124_6129_apply_salve : public SpellScript
|
||||
if (creatureTarget->GetEntry() == NPC_SICKLY_DEER)
|
||||
newEntry = NPC_CURED_DEER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (newEntry)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user