mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[10800] Use ObjectGuid in some battleground structures.
Also fix some catches bugs in code in result.
This commit is contained in:
parent
ce7b98c45e
commit
6d13cd6553
33 changed files with 146 additions and 139 deletions
|
|
@ -202,7 +202,7 @@ template<class Do>
|
||||||
void BattleGround::BroadcastWorker(Do& _do)
|
void BattleGround::BroadcastWorker(Do& _do)
|
||||||
{
|
{
|
||||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||||
if (Player *plr = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)))
|
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
|
||||||
_do(plr);
|
_do(plr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -457,7 +457,7 @@ void BattleGround::Update(uint32 diff)
|
||||||
{
|
{
|
||||||
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
|
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
|
||||||
|
|
||||||
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||||
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
||||||
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||||
|
|
||||||
|
|
@ -468,7 +468,7 @@ void BattleGround::Update(uint32 diff)
|
||||||
|
|
||||||
PlaySoundToAll(SOUND_BG_START);
|
PlaySoundToAll(SOUND_BG_START);
|
||||||
|
|
||||||
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||||
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
|
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
|
||||||
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
|
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
|
||||||
//Announce BG starting
|
//Announce BG starting
|
||||||
|
|
@ -522,11 +522,11 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
|
||||||
if (plr)
|
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
|
||||||
plr->GetSession()->SendPacket(packet);
|
plr->GetSession()->SendPacket(packet);
|
||||||
else
|
else
|
||||||
sLog.outError("BattleGround:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:SendPacketToAll: %s not found!", itr->first.GetString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -536,10 +536,11 @@ void BattleGround::SendPacketToTeam(Team teamId, WorldPacket *packet, Player *se
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:SendPacketToTeam: %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -569,11 +570,11 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, Team teamId)
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
|
||||||
|
|
||||||
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:PlaySoundToTeam: %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -594,11 +595,12 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, Team teamId)
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
|
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:CastSpellOnTeam: %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -616,11 +618,12 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, Team teamId)
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
|
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:RewardHonorToTeam: %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -643,11 +646,12 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||||
{
|
{
|
||||||
if (itr->second.OfflineRemoveTime)
|
if (itr->second.OfflineRemoveTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
|
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:RewardReputationToTeam: %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -747,10 +751,11 @@ void BattleGround::EndBattleGround(Team winner)
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
Player *plr = sObjectMgr.GetPlayer(itr->first);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGround:EndBattleGround Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
sLog.outError("BattleGround:EndBattleGround %s not found!", itr->first.GetString().c_str());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -993,7 +998,7 @@ void BattleGround::BlockMovement(Player *plr)
|
||||||
plr->SetClientControl(plr, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave()
|
plr->SetClientControl(plr, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave()
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket)
|
void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket)
|
||||||
{
|
{
|
||||||
Team team = GetPlayerTeam(guid);
|
Team team = GetPlayerTeam(guid);
|
||||||
bool participant = false;
|
bool participant = false;
|
||||||
|
|
@ -1183,7 +1188,7 @@ void BattleGround::AddPlayer(Player *plr)
|
||||||
bp.PlayerTeam = team;
|
bp.PlayerTeam = team;
|
||||||
|
|
||||||
// Add to list/maps
|
// Add to list/maps
|
||||||
m_Players[guid.GetRawValue()] = bp;
|
m_Players[guid] = bp;
|
||||||
|
|
||||||
UpdatePlayersCountByTeam(team, false); // +1 player
|
UpdatePlayersCountByTeam(team, false); // +1 player
|
||||||
|
|
||||||
|
|
@ -1267,10 +1272,10 @@ void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_gu
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method should be called when player logs into running battleground
|
// This method should be called when player logs into running battleground
|
||||||
void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
|
void BattleGround::EventPlayerLoggedIn(Player* player, ObjectGuid plr_guid)
|
||||||
{
|
{
|
||||||
// player is correct pointer
|
// player is correct pointer
|
||||||
for(std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
for(OfflineQueue::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (*itr == plr_guid)
|
if (*itr == plr_guid)
|
||||||
{
|
{
|
||||||
|
|
@ -1288,12 +1293,12 @@ void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
|
||||||
void BattleGround::EventPlayerLoggedOut(Player* player)
|
void BattleGround::EventPlayerLoggedOut(Player* player)
|
||||||
{
|
{
|
||||||
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
|
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
|
||||||
m_OfflineQueue.push_back(player->GetGUID());
|
m_OfflineQueue.push_back(player->GetObjectGuid());
|
||||||
m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
|
m_Players[player->GetObjectGuid()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
|
||||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||||
{
|
{
|
||||||
// drop flag and handle other cleanups
|
// drop flag and handle other cleanups
|
||||||
RemovePlayer(player, player->GetGUID());
|
RemovePlayer(player, player->GetObjectGuid());
|
||||||
|
|
||||||
// 1 player is logging out, if it is the last, then end arena!
|
// 1 player is logging out, if it is the last, then end arena!
|
||||||
if (isArena())
|
if (isArena())
|
||||||
|
|
@ -1347,7 +1352,7 @@ bool BattleGround::HasFreeSlots() const
|
||||||
void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
//this procedure is called from virtual function implemented in bg subclass
|
//this procedure is called from virtual function implemented in bg subclass
|
||||||
BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
|
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
@ -1751,7 +1756,7 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
|
||||||
|
|
||||||
// return the player's team based on battlegroundplayer info
|
// return the player's team based on battlegroundplayer info
|
||||||
// used in same faction arena matches mainly
|
// used in same faction arena matches mainly
|
||||||
Team BattleGround::GetPlayerTeam(uint64 guid)
|
Team BattleGround::GetPlayerTeam(ObjectGuid guid)
|
||||||
{
|
{
|
||||||
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
||||||
if (itr != m_Players.end())
|
if (itr != m_Players.end())
|
||||||
|
|
@ -1759,7 +1764,7 @@ Team BattleGround::GetPlayerTeam(uint64 guid)
|
||||||
return TEAM_NONE;
|
return TEAM_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BattleGround::IsPlayerInBattleGround(uint64 guid)
|
bool BattleGround::IsPlayerInBattleGround(ObjectGuid guid)
|
||||||
{
|
{
|
||||||
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
|
||||||
if (itr != m_Players.end())
|
if (itr != m_Players.end())
|
||||||
|
|
|
||||||
|
|
@ -375,11 +375,11 @@ class BattleGround
|
||||||
bool isBattleGround() const { return !m_IsArena; }
|
bool isBattleGround() const { return !m_IsArena; }
|
||||||
bool isRated() const { return m_IsRated; }
|
bool isRated() const { return m_IsRated; }
|
||||||
|
|
||||||
typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
|
typedef std::map<ObjectGuid, BattleGroundPlayer> BattleGroundPlayerMap;
|
||||||
BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
|
BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
|
||||||
uint32 GetPlayersSize() const { return m_Players.size(); }
|
uint32 GetPlayersSize() const { return m_Players.size(); }
|
||||||
|
|
||||||
typedef std::map<uint64, BattleGroundScore*> BattleGroundScoreMap;
|
typedef std::map<ObjectGuid, BattleGroundScore*> BattleGroundScoreMap;
|
||||||
BattleGroundScoreMap::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
|
BattleGroundScoreMap::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
|
||||||
BattleGroundScoreMap::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
|
BattleGroundScoreMap::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
|
||||||
uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
|
uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
|
||||||
|
|
@ -475,7 +475,7 @@ class BattleGround
|
||||||
virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
|
virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
|
||||||
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
|
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
|
||||||
virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
|
virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
|
||||||
void EventPlayerLoggedIn(Player* player, uint64 plr_guid);
|
void EventPlayerLoggedIn(Player* player, ObjectGuid plr_guid);
|
||||||
void EventPlayerLoggedOut(Player* player);
|
void EventPlayerLoggedOut(Player* player);
|
||||||
|
|
||||||
/* Death related */
|
/* Death related */
|
||||||
|
|
@ -485,7 +485,7 @@ class BattleGround
|
||||||
|
|
||||||
void AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_guid, Team team);
|
void AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_guid, Team team);
|
||||||
|
|
||||||
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
|
virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
|
||||||
// can be extended in in BG subclass
|
// can be extended in in BG subclass
|
||||||
|
|
||||||
/* event related */
|
/* event related */
|
||||||
|
|
@ -524,10 +524,10 @@ class BattleGround
|
||||||
virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
|
virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
|
||||||
|
|
||||||
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
|
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
|
||||||
Team GetPlayerTeam(uint64 guid);
|
Team GetPlayerTeam(ObjectGuid guid);
|
||||||
static Team GetOtherTeam(Team team){ return team ? ((team == ALLIANCE) ? HORDE : ALLIANCE) : TEAM_NONE; }
|
static Team GetOtherTeam(Team team){ return team ? ((team == ALLIANCE) ? HORDE : ALLIANCE) : TEAM_NONE; }
|
||||||
static BattleGroundTeamIndex GetOtherTeamIndex(BattleGroundTeamIndex teamIdx){ return teamIdx == BG_TEAM_ALLIANCE ? BG_TEAM_HORDE : BG_TEAM_ALLIANCE; }
|
static BattleGroundTeamIndex GetOtherTeamIndex(BattleGroundTeamIndex teamIdx){ return teamIdx == BG_TEAM_ALLIANCE ? BG_TEAM_HORDE : BG_TEAM_ALLIANCE; }
|
||||||
bool IsPlayerInBattleGround(uint64 guid);
|
bool IsPlayerInBattleGround(ObjectGuid guid);
|
||||||
|
|
||||||
/* virtual score-array - get's used in bg-subclasses */
|
/* virtual score-array - get's used in bg-subclasses */
|
||||||
int32 m_TeamScores[BG_TEAMS_COUNT];
|
int32 m_TeamScores[BG_TEAMS_COUNT];
|
||||||
|
|
@ -557,7 +557,7 @@ class BattleGround
|
||||||
|
|
||||||
BattleGroundScoreMap m_PlayerScores; // Player scores
|
BattleGroundScoreMap m_PlayerScores; // Player scores
|
||||||
// must be implemented in BG subclass
|
// must be implemented in BG subclass
|
||||||
virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
|
virtual void RemovePlayer(Player * /*player*/, ObjectGuid /*guid*/) {}
|
||||||
|
|
||||||
/* Player lists, those need to be accessible by inherited classes */
|
/* Player lists, those need to be accessible by inherited classes */
|
||||||
BattleGroundPlayerMap m_Players;
|
BattleGroundPlayerMap m_Players;
|
||||||
|
|
@ -592,8 +592,8 @@ class BattleGround
|
||||||
char const *m_Name;
|
char const *m_Name;
|
||||||
|
|
||||||
/* Player lists */
|
/* Player lists */
|
||||||
std::vector<uint64> m_ResurrectQueue; // Player GUID
|
typedef std::deque<ObjectGuid> OfflineQueue;
|
||||||
std::deque<uint64> m_OfflineQueue; // Player GUID
|
OfflineQueue m_OfflineQueue; // Player GUID
|
||||||
|
|
||||||
/* Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction */
|
/* Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction */
|
||||||
/* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
|
/* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ void BattleGroundAA::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundAAScore* sc = new BattleGroundAAScore;
|
BattleGroundAAScore* sc = new BattleGroundAAScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundAA::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
void BattleGroundAA::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundAA : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
void HandleKillPlayer(Player* player, Player *killer);
|
void HandleKillPlayer(Player* player, Player *killer);
|
||||||
|
|
|
||||||
|
|
@ -182,10 +182,10 @@ void BattleGroundAB::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in the constructor
|
//create score and add it to map, default values are set in the constructor
|
||||||
BattleGroundABScore* sc = new BattleGroundABScore;
|
BattleGroundABScore* sc = new BattleGroundABScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
void BattleGroundAB::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -539,7 +539,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
|
||||||
|
|
||||||
void BattleGroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
void BattleGroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if( itr == m_PlayerScores.end() ) // player not found...
|
if( itr == m_PlayerScores.end() ) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ class BattleGroundAB : public BattleGround
|
||||||
void AddPlayer(Player *plr);
|
void AddPlayer(Player *plr);
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
virtual bool SetupBattleGround();
|
virtual bool SetupBattleGround();
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ void BattleGroundAV::AddPlayer(Player *plr)
|
||||||
BattleGround::AddPlayer(plr);
|
BattleGround::AddPlayer(plr);
|
||||||
// create score and add it to map, default values are set in constructor
|
// create score and add it to map, default values are set in constructor
|
||||||
BattleGroundAVScore* sc = new BattleGroundAVScore;
|
BattleGroundAVScore* sc = new BattleGroundAVScore;
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundAV::EndBattleGround(Team winner)
|
void BattleGroundAV::EndBattleGround(Team winner)
|
||||||
|
|
@ -349,7 +349,7 @@ void BattleGroundAV::EndBattleGround(Team winner)
|
||||||
BattleGround::EndBattleGround(winner);
|
BattleGround::EndBattleGround(winner);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundAV::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
void BattleGroundAV::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -389,7 +389,7 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||||
void BattleGroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
void BattleGroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ class BattleGroundAV : public BattleGround
|
||||||
// world states
|
// world states
|
||||||
virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
|
virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
|
||||||
|
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,13 @@ void BattleGroundBE::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundBEScore* sc = new BattleGroundBEScore;
|
BattleGroundBEScore* sc = new BattleGroundBEScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||||
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundBE::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
@ -156,12 +156,12 @@ bool BattleGroundBE::SetupBattleGround()
|
||||||
void BattleGroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
void BattleGroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//there is nothing special in this score
|
//there is nothing special in this score
|
||||||
BattleGround::UpdatePlayerScore(Source,type,value);
|
BattleGround::UpdatePlayerScore(Source, type, value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class BattleGroundBE : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ void BattleGroundDS::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundDSScore* sc = new BattleGroundDSScore;
|
BattleGroundDSScore* sc = new BattleGroundDSScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
void BattleGroundDS::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundDS : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
void HandleKillPlayer(Player* player, Player *killer);
|
void HandleKillPlayer(Player* player, Player *killer);
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
|
||||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
|
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]));
|
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: %s not found!", m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j].GetString().c_str());
|
||||||
++j;
|
++j;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -170,7 +170,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
|
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint %s not found!", m_PlayersNearPoint[i][j].GetString().c_str());
|
||||||
//move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug
|
//move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug
|
||||||
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
|
||||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||||
|
|
@ -222,8 +222,7 @@ void BattleGroundEY::UpdatePointStatuses()
|
||||||
|
|
||||||
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
|
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
|
||||||
{
|
{
|
||||||
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]);
|
if (Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]))
|
||||||
if (plr)
|
|
||||||
{
|
{
|
||||||
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
|
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
|
||||||
//if point owner changed we must evoke event!
|
//if point owner changed we must evoke event!
|
||||||
|
|
@ -307,12 +306,12 @@ void BattleGroundEY::AddPlayer(Player *plr)
|
||||||
//create score and add it to map
|
//create score and add it to map
|
||||||
BattleGroundEYScore* sc = new BattleGroundEYScore;
|
BattleGroundEYScore* sc = new BattleGroundEYScore;
|
||||||
|
|
||||||
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetGUID());
|
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetObjectGuid());
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
void BattleGroundEY::RemovePlayer(Player *plr, ObjectGuid guid)
|
||||||
{
|
{
|
||||||
// sometimes flag aura not removed :(
|
// sometimes flag aura not removed :(
|
||||||
for (int j = BG_EY_NODES_MAX; j >= 0; --j)
|
for (int j = BG_EY_NODES_MAX; j >= 0; --j)
|
||||||
|
|
@ -329,7 +328,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||||
EventPlayerDroppedFlag(plr);
|
EventPlayerDroppedFlag(plr);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetFlagPicker(0);
|
ClearFlagPicker();
|
||||||
RespawnFlag(true);
|
RespawnFlag(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -348,22 +347,22 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||||
{
|
{
|
||||||
case TR_BLOOD_ELF_POINT:
|
case TR_BLOOD_ELF_POINT:
|
||||||
if (m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
|
||||||
break;
|
break;
|
||||||
case TR_FEL_REAVER_POINT:
|
case TR_FEL_REAVER_POINT:
|
||||||
if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REAVER);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REAVER);
|
||||||
break;
|
break;
|
||||||
case TR_MAGE_TOWER_POINT:
|
case TR_MAGE_TOWER_POINT:
|
||||||
if (m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
|
||||||
break;
|
break;
|
||||||
case TR_DRAENEI_RUINS_POINT:
|
case TR_DRAENEI_RUINS_POINT:
|
||||||
if (m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == Source->GetTeam())
|
if (m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == Source->GetTeam())
|
||||||
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
|
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
|
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
|
||||||
break;
|
break;
|
||||||
case 4512:
|
case 4512:
|
||||||
|
|
@ -418,7 +417,7 @@ void BattleGroundEY::Reset()
|
||||||
m_HonorScoreTics[BG_TEAM_ALLIANCE] = 0;
|
m_HonorScoreTics[BG_TEAM_ALLIANCE] = 0;
|
||||||
m_HonorScoreTics[BG_TEAM_HORDE] = 0;
|
m_HonorScoreTics[BG_TEAM_HORDE] = 0;
|
||||||
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
|
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
|
||||||
m_FlagKeeper = 0;
|
m_FlagKeeper.Clear();
|
||||||
m_DroppedFlagGUID = 0;
|
m_DroppedFlagGUID = 0;
|
||||||
m_PointAddingTimer = 0;
|
m_PointAddingTimer = 0;
|
||||||
m_TowerCapCheckTimer = 0;
|
m_TowerCapCheckTimer = 0;
|
||||||
|
|
@ -484,9 +483,9 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||||
{
|
{
|
||||||
// if not running, do not cast things at the dropper player, neither send unnecessary messages
|
// if not running, do not cast things at the dropper player, neither send unnecessary messages
|
||||||
// just take off the aura
|
// just take off the aura
|
||||||
if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
|
if (IsFlagPickedup() && GetFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
{
|
{
|
||||||
SetFlagPicker(0);
|
ClearFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -495,10 +494,10 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
|
||||||
if (!IsFlagPickedup())
|
if (!IsFlagPickedup())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetFlagPickerGUID() != Source->GetGUID())
|
if (GetFlagPickerGuid() != Source->GetObjectGuid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetFlagPicker(0);
|
ClearFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||||
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
|
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
|
||||||
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
|
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
|
||||||
|
|
@ -537,7 +536,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||||
// despawn center-flag
|
// despawn center-flag
|
||||||
SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false);
|
SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false);
|
||||||
|
|
||||||
SetFlagPicker(Source->GetGUID());
|
SetFlagPicker(Source->GetObjectGuid());
|
||||||
//get flag aura on player
|
//get flag aura on player
|
||||||
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
|
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
|
||||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||||
|
|
@ -608,10 +607,10 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||||
|
|
||||||
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, BG_EY_Nodes node)
|
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, BG_EY_Nodes node)
|
||||||
{
|
{
|
||||||
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
|
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGuid() != Source->GetObjectGuid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetFlagPicker(0);
|
ClearFlagPicker();
|
||||||
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
|
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
|
||||||
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
|
||||||
|
|
||||||
|
|
@ -646,7 +645,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, BG_EY_Nodes node)
|
||||||
|
|
||||||
void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if(itr == m_PlayerScores.end()) // player not found
|
if(itr == m_PlayerScores.end()) // player not found
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -254,14 +254,15 @@ class BattleGroundEY : public BattleGround
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
/* BG Flags */
|
/* BG Flags */
|
||||||
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }
|
ObjectGuid const& GetFlagPickerGuid() const { return m_FlagKeeper; }
|
||||||
void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; }
|
void SetFlagPicker(ObjectGuid guid) { m_FlagKeeper = guid; }
|
||||||
bool IsFlagPickedup() const { return m_FlagKeeper != 0; }
|
void ClearFlagPicker() { m_FlagKeeper.Clear(); }
|
||||||
|
bool IsFlagPickedup() const { return !m_FlagKeeper.IsEmpty(); }
|
||||||
uint8 GetFlagState() const { return m_FlagState; }
|
uint8 GetFlagState() const { return m_FlagState; }
|
||||||
void RespawnFlag(bool send_message);
|
void RespawnFlag(bool send_message);
|
||||||
void RespawnFlagAfterDrop();
|
void RespawnFlagAfterDrop();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleBuffUse(uint64 const& buff_guid);
|
void HandleBuffUse(uint64 const& buff_guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
void HandleKillPlayer(Player *player, Player *killer);
|
void HandleKillPlayer(Player *player, Player *killer);
|
||||||
|
|
@ -306,7 +307,7 @@ class BattleGroundEY : public BattleGround
|
||||||
|
|
||||||
uint32 m_Points_Trigger[BG_EY_NODES_MAX];
|
uint32 m_Points_Trigger[BG_EY_NODES_MAX];
|
||||||
|
|
||||||
uint64 m_FlagKeeper; // keepers guid
|
ObjectGuid m_FlagKeeper; // keepers guid
|
||||||
uint64 m_DroppedFlagGUID;
|
uint64 m_DroppedFlagGUID;
|
||||||
uint8 m_FlagState; // for checking flag state
|
uint8 m_FlagState; // for checking flag state
|
||||||
int32 m_FlagsTimer;
|
int32 m_FlagsTimer;
|
||||||
|
|
@ -315,7 +316,7 @@ class BattleGroundEY : public BattleGround
|
||||||
Team m_PointOwnedByTeam[BG_EY_NODES_MAX];
|
Team m_PointOwnedByTeam[BG_EY_NODES_MAX];
|
||||||
uint8 m_PointState[BG_EY_NODES_MAX];
|
uint8 m_PointState[BG_EY_NODES_MAX];
|
||||||
int32 m_PointBarStatus[BG_EY_NODES_MAX];
|
int32 m_PointBarStatus[BG_EY_NODES_MAX];
|
||||||
typedef std::vector<uint64> PlayersNearPointType;
|
typedef std::vector<ObjectGuid> PlayersNearPointType;
|
||||||
PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
|
PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
|
||||||
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
|
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,11 +229,11 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
|
||||||
uint32 count1 = 0; // always constant zero?
|
uint32 count1 = 0; // always constant zero?
|
||||||
uint32 count2 = 0; // count of next fields
|
uint32 count2 = 0; // count of next fields
|
||||||
|
|
||||||
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
|
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGuid());
|
||||||
if (ali_plr)
|
if (ali_plr)
|
||||||
++count2;
|
++count2;
|
||||||
|
|
||||||
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
|
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGuid());
|
||||||
if (horde_plr)
|
if (horde_plr)
|
||||||
++count2;
|
++count2;
|
||||||
|
|
||||||
|
|
@ -430,7 +430,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
|
||||||
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
|
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
|
||||||
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
|
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
|
||||||
if (BattleGround *currentBg = _player->GetBattleGround())
|
if (BattleGround *currentBg = _player->GetBattleGround())
|
||||||
currentBg->RemovePlayerAtLeave(_player->GetGUID(), false, true);
|
currentBg->RemovePlayerAtLeave(_player->GetObjectGuid(), false, true);
|
||||||
|
|
||||||
// set the destination instance id
|
// set the destination instance id
|
||||||
_player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);
|
_player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,10 @@ void BattleGroundIC::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundICScore* sc = new BattleGroundICScore;
|
BattleGroundICScore* sc = new BattleGroundICScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundIC::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
void BattleGroundIC::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +72,7 @@ void BattleGroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||||
void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
|
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundIC : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
//bool SetupBattleGround();
|
//bool SetupBattleGround();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1303,7 +1303,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
|
||||||
|
|
||||||
for(BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
|
for(BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
|
||||||
{
|
{
|
||||||
*data << (uint64)itr->first;
|
*data << ObjectGuid(itr->first);
|
||||||
*data << (int32)itr->second->KillingBlows;
|
*data << (int32)itr->second->KillingBlows;
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1388,10 +1388,10 @@ void BattleGroundMgr::BuildPlaySoundPacket(WorldPacket *data, uint32 soundid)
|
||||||
*data << uint32(soundid);
|
*data << uint32(soundid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid)
|
void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid)
|
||||||
{
|
{
|
||||||
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
|
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
|
||||||
*data << uint64(guid);
|
*data << ObjectGuid(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr)
|
void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr)
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ class BattleGroundMgr
|
||||||
|
|
||||||
/* Packet Building */
|
/* Packet Building */
|
||||||
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
|
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
|
||||||
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid);
|
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid);
|
||||||
void BuildBattleGroundListPacket(WorldPacket *data, ObjectGuid guid, Player *plr, BattleGroundTypeId bgTypeId, uint8 fromWhere);
|
void BuildBattleGroundListPacket(WorldPacket *data, ObjectGuid guid, Player *plr, BattleGroundTypeId bgTypeId, uint8 fromWhere);
|
||||||
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result);
|
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result);
|
||||||
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
|
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,13 @@ void BattleGroundNA::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundNAScore* sc = new BattleGroundNAScore;
|
BattleGroundNAScore* sc = new BattleGroundNAScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||||
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundNA::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundNA : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
virtual void Reset();
|
virtual void Reset();
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,10 @@ void BattleGroundRB::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundABGScore* sc = new BattleGroundABGScore;
|
BattleGroundABGScore* sc = new BattleGroundABGScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
void BattleGroundRB::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +72,7 @@ void BattleGroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||||
void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
|
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundRB : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
//bool SetupBattleGround();
|
//bool SetupBattleGround();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,13 @@ void BattleGroundRL::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundRLScore* sc = new BattleGroundRLScore;
|
BattleGroundRLScore* sc = new BattleGroundRLScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
|
|
||||||
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
|
||||||
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
|
void BattleGroundRL::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
if (GetStatus() == STATUS_WAIT_LEAVE)
|
if (GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ class BattleGroundRL : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
void HandleKillPlayer(Player* player, Player *killer);
|
void HandleKillPlayer(Player* player, Player *killer);
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ void BattleGroundRV::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundRVScore* sc = new BattleGroundRVScore;
|
BattleGroundRVScore* sc = new BattleGroundRVScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
|
void BattleGroundRV::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundRV : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
void HandleKillPlayer(Player* player, Player *killer);
|
void HandleKillPlayer(Player* player, Player *killer);
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,10 @@ void BattleGroundSA::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundSAScore* sc = new BattleGroundSAScore;
|
BattleGroundSAScore* sc = new BattleGroundSAScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
|
void BattleGroundSA::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +72,7 @@ void BattleGroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
|
||||||
void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if(itr == m_PlayerScores.end()) // player not found...
|
if(itr == m_PlayerScores.end()) // player not found...
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class BattleGroundSA : public BattleGround
|
||||||
virtual void StartingEventCloseDoors();
|
virtual void StartingEventCloseDoors();
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
void RemovePlayer(Player *plr,uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
//bool SetupBattleGround();
|
//bool SetupBattleGround();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ void BattleGroundWS::AddPlayer(Player *plr)
|
||||||
//create score and add it to map, default values are set in constructor
|
//create score and add it to map, default values are set in constructor
|
||||||
BattleGroundWGScore* sc = new BattleGroundWGScore;
|
BattleGroundWGScore* sc = new BattleGroundWGScore;
|
||||||
|
|
||||||
m_PlayerScores[plr->GetGUID()] = sc;
|
m_PlayerScores[plr->GetObjectGuid()] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundWS::RespawnFlag(Team team, bool captured)
|
void BattleGroundWS::RespawnFlag(Team team, bool captured)
|
||||||
|
|
@ -199,7 +199,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||||
{
|
{
|
||||||
if (!IsHordeFlagPickedup())
|
if (!IsHordeFlagPickedup())
|
||||||
return;
|
return;
|
||||||
SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
ClearHordeFlagPicker(); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||||
// horde flag in base (but not respawned yet)
|
// horde flag in base (but not respawned yet)
|
||||||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||||
// Drop Horde Flag from Player
|
// Drop Horde Flag from Player
|
||||||
|
|
@ -213,7 +213,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
|
||||||
{
|
{
|
||||||
if (!IsAllianceFlagPickedup())
|
if (!IsAllianceFlagPickedup())
|
||||||
return;
|
return;
|
||||||
SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
ClearAllianceFlagPicker(); // must be before aura remove to prevent 2 events (drop+capture) at the same time
|
||||||
// alliance flag in base (but not respawned yet)
|
// alliance flag in base (but not respawned yet)
|
||||||
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
|
||||||
// Drop Alliance Flag from Player
|
// Drop Alliance Flag from Player
|
||||||
|
|
@ -269,21 +269,21 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||||
// just take off the aura
|
// just take off the aura
|
||||||
if (Source->GetTeam() == ALLIANCE)
|
if (Source->GetTeam() == ALLIANCE)
|
||||||
{
|
{
|
||||||
if (!this->IsHordeFlagPickedup())
|
if (!IsHordeFlagPickedup())
|
||||||
return;
|
return;
|
||||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
{
|
{
|
||||||
SetHordeFlagPicker(0);
|
ClearHordeFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!this->IsAllianceFlagPickedup())
|
if (!IsAllianceFlagPickedup())
|
||||||
return;
|
return;
|
||||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
{
|
{
|
||||||
SetAllianceFlagPicker(0);
|
ClearAllianceFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -296,9 +296,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||||
{
|
{
|
||||||
if (!IsHordeFlagPickedup())
|
if (!IsHordeFlagPickedup())
|
||||||
return;
|
return;
|
||||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
{
|
{
|
||||||
SetHordeFlagPicker(0);
|
ClearHordeFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
|
||||||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND;
|
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND;
|
||||||
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
|
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
|
||||||
|
|
@ -309,9 +309,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
|
||||||
{
|
{
|
||||||
if (!IsAllianceFlagPickedup())
|
if (!IsAllianceFlagPickedup())
|
||||||
return;
|
return;
|
||||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
{
|
{
|
||||||
SetAllianceFlagPicker(0);
|
ClearAllianceFlagPicker();
|
||||||
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
|
||||||
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND;
|
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND;
|
||||||
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
|
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
|
||||||
|
|
@ -444,7 +444,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target
|
||||||
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
void BattleGroundWS::RemovePlayer(Player *plr, ObjectGuid guid)
|
||||||
{
|
{
|
||||||
// sometimes flag aura not removed :(
|
// sometimes flag aura not removed :(
|
||||||
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
|
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
|
||||||
|
|
@ -452,7 +452,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||||
SetAllianceFlagPicker(0);
|
ClearAllianceFlagPicker();
|
||||||
RespawnFlag(ALLIANCE, false);
|
RespawnFlag(ALLIANCE, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -463,7 +463,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||||
if (!plr)
|
if (!plr)
|
||||||
{
|
{
|
||||||
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
|
||||||
SetHordeFlagPicker(0);
|
ClearHordeFlagPicker();
|
||||||
RespawnFlag(HORDE, false);
|
RespawnFlag(HORDE, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -506,12 +506,12 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||||
break;
|
break;
|
||||||
case 3646: // Alliance Flag spawn
|
case 3646: // Alliance Flag spawn
|
||||||
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
|
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
|
||||||
if (GetHordeFlagPickerGUID() == Source->GetGUID())
|
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source);
|
EventPlayerCapturedFlag(Source);
|
||||||
break;
|
break;
|
||||||
case 3647: // Horde Flag spawn
|
case 3647: // Horde Flag spawn
|
||||||
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
|
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
|
||||||
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
|
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
|
||||||
EventPlayerCapturedFlag(Source);
|
EventPlayerCapturedFlag(Source);
|
||||||
break;
|
break;
|
||||||
case 3649: // unk1
|
case 3649: // unk1
|
||||||
|
|
@ -544,7 +544,7 @@ void BattleGroundWS::Reset()
|
||||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
|
for(uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
|
||||||
{
|
{
|
||||||
m_DroppedFlagGUID[i] = 0;
|
m_DroppedFlagGUID[i] = 0;
|
||||||
m_FlagKeepers[i] = 0;
|
m_FlagKeepers[i].Clear();
|
||||||
m_FlagState[i] = BG_WS_FLAG_STATE_ON_BASE;
|
m_FlagState[i] = BG_WS_FLAG_STATE_ON_BASE;
|
||||||
m_TeamScores[i] = 0;
|
m_TeamScores[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -584,7 +584,7 @@ void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)
|
||||||
void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
|
||||||
{
|
{
|
||||||
|
|
||||||
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
|
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
|
||||||
if(itr == m_PlayerScores.end()) // player not found
|
if(itr == m_PlayerScores.end()) // player not found
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,12 +109,14 @@ class BattleGroundWS : public BattleGround
|
||||||
virtual void StartingEventOpenDoors();
|
virtual void StartingEventOpenDoors();
|
||||||
|
|
||||||
/* BG Flags */
|
/* BG Flags */
|
||||||
uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
|
ObjectGuid GetAllianceFlagPickerGuid() const{ return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
|
||||||
uint64 GetHordeFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_HORDE]; }
|
ObjectGuid GetHordeFlagPickerGuid() const { return m_FlagKeepers[BG_TEAM_HORDE]; }
|
||||||
void SetAllianceFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_ALLIANCE] = guid; }
|
void SetAllianceFlagPicker(ObjectGuid guid) { m_FlagKeepers[BG_TEAM_ALLIANCE] = guid; }
|
||||||
void SetHordeFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_HORDE] = guid; }
|
void SetHordeFlagPicker(ObjectGuid guid) { m_FlagKeepers[BG_TEAM_HORDE] = guid; }
|
||||||
bool IsAllianceFlagPickedup() const { return m_FlagKeepers[BG_TEAM_ALLIANCE] != 0; }
|
void ClearAllianceFlagPicker() { m_FlagKeepers[BG_TEAM_ALLIANCE].Clear(); }
|
||||||
bool IsHordeFlagPickedup() const { return m_FlagKeepers[BG_TEAM_HORDE] != 0; }
|
void ClearHordeFlagPicker() { m_FlagKeepers[BG_TEAM_HORDE].Clear(); }
|
||||||
|
bool IsAllianceFlagPickedup() const { return !m_FlagKeepers[BG_TEAM_ALLIANCE].IsEmpty(); }
|
||||||
|
bool IsHordeFlagPickedup() const { return !m_FlagKeepers[BG_TEAM_HORDE].IsEmpty(); }
|
||||||
void RespawnFlag(Team team, bool captured);
|
void RespawnFlag(Team team, bool captured);
|
||||||
void RespawnFlagAfterDrop(Team team);
|
void RespawnFlagAfterDrop(Team team);
|
||||||
uint8 GetFlagState(Team team) { return m_FlagState[GetTeamIndexByTeamId(team)]; }
|
uint8 GetFlagState(Team team) { return m_FlagState[GetTeamIndexByTeamId(team)]; }
|
||||||
|
|
@ -124,7 +126,7 @@ class BattleGroundWS : public BattleGround
|
||||||
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
|
virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj);
|
||||||
virtual void EventPlayerCapturedFlag(Player *Source);
|
virtual void EventPlayerCapturedFlag(Player *Source);
|
||||||
|
|
||||||
void RemovePlayer(Player *plr, uint64 guid);
|
void RemovePlayer(Player *plr, ObjectGuid guid);
|
||||||
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
void HandleAreaTrigger(Player *Source, uint32 Trigger);
|
||||||
void HandleKillPlayer(Player *player, Player *killer);
|
void HandleKillPlayer(Player *player, Player *killer);
|
||||||
bool SetupBattleGround();
|
bool SetupBattleGround();
|
||||||
|
|
@ -146,7 +148,7 @@ class BattleGroundWS : public BattleGround
|
||||||
void SetTeamPoint(Team team, uint32 Points = 0) { 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; }
|
void RemovePoint(Team team, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= Points; }
|
||||||
private:
|
private:
|
||||||
uint64 m_FlagKeepers[BG_TEAMS_COUNT];
|
ObjectGuid m_FlagKeepers[BG_TEAMS_COUNT];
|
||||||
|
|
||||||
uint64 m_DroppedFlagGUID[BG_TEAMS_COUNT];
|
uint64 m_DroppedFlagGUID[BG_TEAMS_COUNT];
|
||||||
uint8 m_FlagState[BG_TEAMS_COUNT];
|
uint8 m_FlagState[BG_TEAMS_COUNT];
|
||||||
|
|
|
||||||
|
|
@ -15249,7 +15249,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
{
|
{
|
||||||
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE);
|
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE);
|
||||||
|
|
||||||
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetGUID());
|
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetObjectGuid());
|
||||||
|
|
||||||
if(player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
|
if(player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
|
||||||
{
|
{
|
||||||
|
|
@ -15259,7 +15259,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
m_bgData.bgTypeID = currentBg->GetTypeID();
|
m_bgData.bgTypeID = currentBg->GetTypeID();
|
||||||
|
|
||||||
//join player to battleground group
|
//join player to battleground group
|
||||||
currentBg->EventPlayerLoggedIn(this, GetGUID());
|
currentBg->EventPlayerLoggedIn(this, GetObjectGuid());
|
||||||
currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetObjectGuid(), m_bgData.bgTeam);
|
currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetObjectGuid(), m_bgData.bgTeam);
|
||||||
|
|
||||||
SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
|
SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
|
||||||
|
|
@ -15268,7 +15268,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
{
|
{
|
||||||
// leave bg
|
// leave bg
|
||||||
if (player_at_bg)
|
if (player_at_bg)
|
||||||
currentBg->RemovePlayerAtLeave(GetGUID(), false, true);
|
currentBg->RemovePlayerAtLeave(GetObjectGuid(), false, true);
|
||||||
|
|
||||||
// move to bg enter point
|
// move to bg enter point
|
||||||
const WorldLocation& _loc = GetBattleGroundEntryPoint();
|
const WorldLocation& _loc = GetBattleGroundEntryPoint();
|
||||||
|
|
@ -19300,7 +19300,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
|
||||||
{
|
{
|
||||||
if(BattleGround *bg = GetBattleGround())
|
if(BattleGround *bg = GetBattleGround())
|
||||||
{
|
{
|
||||||
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
|
bg->RemovePlayerAtLeave(GetObjectGuid(), teleportToEntryPoint, true);
|
||||||
|
|
||||||
// call after remove to be sure that player resurrected for correct cast
|
// call after remove to be sure that player resurrected for correct cast
|
||||||
if( bg->isBattleGround() && !isGameMaster() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER) )
|
if( bg->isBattleGround() && !isGameMaster() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER) )
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10799"
|
#define REVISION_NR "10800"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue