Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG-- branch : trunk
This commit is contained in:
@@ -55,7 +55,7 @@ ArenaTeam::ArenaTeam()
|
||||
m_stats.games_week = 0;
|
||||
m_stats.games_season = 0;
|
||||
m_stats.rank = 0;
|
||||
m_stats.rating = sWorld.getIntConfig(CONFIG_ARENA_START_RATING);
|
||||
m_stats.rating = sWorld->getIntConfig(CONFIG_ARENA_START_RATING);
|
||||
m_stats.wins_week = 0;
|
||||
m_stats.wins_season = 0;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
|
||||
return false;
|
||||
|
||||
uint32 captainLowGuid = GUID_LOPART(captainGuid);
|
||||
sLog.outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid);
|
||||
sLog->outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid);
|
||||
|
||||
m_CaptainGuid = captainGuid;
|
||||
m_Name = ArenaTeamName;
|
||||
@@ -95,7 +95,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
AddMember(m_CaptainGuid);
|
||||
sLog.outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
|
||||
sLog->outArena("New ArenaTeam created [Id: %u] [Type: %u] [Captain low GUID: %u]", GetId(), GetType(), captainLowGuid);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
{
|
||||
if (pl->GetArenaTeamId(GetSlot()))
|
||||
{
|
||||
sLog.outError("Arena::AddMember() : player already in this sized team");
|
||||
sLog->outError("Arena::AddMember() : player already in this sized team");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -135,20 +135,20 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
// check if player already in arenateam of that size
|
||||
if (Player::GetArenaTeamIdFromDB(PlayerGuid, GetType()) != 0)
|
||||
{
|
||||
sLog.outError("Arena::AddMember() : player already in this sized team");
|
||||
sLog->outError("Arena::AddMember() : player already in this sized team");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
plMMRating = sWorld.getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);
|
||||
plMMRating = sWorld->getIntConfig(CONFIG_ARENA_START_MATCHMAKER_RATING);
|
||||
plPRating = 0;
|
||||
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)
|
||||
plPRating = sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
if (sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING) > 0)
|
||||
plPRating = sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
else if (GetRating() >= 1000)
|
||||
plPRating = 1000;
|
||||
|
||||
sWorld.getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
sWorld->getIntConfig(CONFIG_ARENA_START_PERSONAL_RATING);
|
||||
|
||||
QueryResult result = CharacterDatabase.PQuery("SELECT matchmaker_rating FROM character_arena_stats WHERE guid='%u' AND slot='%u'", GUID_LOPART(PlayerGuid), GetSlot());
|
||||
if (result)
|
||||
@@ -181,7 +181,7 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
||||
// hide promote/remove buttons
|
||||
if (m_CaptainGuid != PlayerGuid)
|
||||
pl->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 1);
|
||||
sLog.outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId());
|
||||
sLog->outArena("Player: %s [GUID: %u] joined arena team type: %u [Id: %u].", pl->GetName(), pl->GetGUIDLow(), GetType(), GetId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -230,7 +230,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult)
|
||||
if (arenaTeamId < m_TeamId)
|
||||
{
|
||||
//there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error
|
||||
sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId);
|
||||
sLog->outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId);
|
||||
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId);
|
||||
continue;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult)
|
||||
//check if member exists in characters table
|
||||
if (newmember.name.empty())
|
||||
{
|
||||
sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newmember.guid));
|
||||
sLog->outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newmember.guid));
|
||||
this->DelMember(newmember.guid);
|
||||
continue;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult arenaTeamMembersResult)
|
||||
if (Empty() || !captainPresentInTeam)
|
||||
{
|
||||
// arena team is empty or captain is not in team, delete from db
|
||||
sLog.outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId);
|
||||
sLog->outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ void ArenaTeam::SetCaptain(const uint64& guid)
|
||||
if (newcaptain)
|
||||
{
|
||||
newcaptain->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_MEMBER, 0);
|
||||
sLog.outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUIDLow(), GetId(), GetType());
|
||||
sLog->outArena("Player: %s [GUID: %u] promoted player: %s [GUID: %u] to leader of arena team [Id: %u] [Type: %u].", oldcaptain->GetName(), oldcaptain->GetGUIDLow(), newcaptain->GetName(), newcaptain->GetGUIDLow(), GetId(), GetType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ void ArenaTeam::DelMember(uint64 guid)
|
||||
// delete all info regarding this team
|
||||
for (uint32 i = 0; i < ARENA_TEAM_END; ++i)
|
||||
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
|
||||
sLog.outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
sLog->outArena("Player: %s [GUID: %u] left arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
}
|
||||
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), GUID_LOPART(guid));
|
||||
}
|
||||
@@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession *session)
|
||||
|
||||
if (session)
|
||||
if (Player *player = session->GetPlayer())
|
||||
sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
|
||||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
trans->PAppend("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId);
|
||||
@@ -388,7 +388,7 @@ void ArenaTeam::Roster(WorldSession *session)
|
||||
}
|
||||
|
||||
session->SendPacket(&data);
|
||||
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
|
||||
sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER");
|
||||
}
|
||||
|
||||
void ArenaTeam::Query(WorldSession *session)
|
||||
@@ -403,7 +403,7 @@ void ArenaTeam::Query(WorldSession *session)
|
||||
data << uint32(m_BorderStyle); // border style
|
||||
data << uint32(m_BorderColor); // border color
|
||||
session->SendPacket(&data);
|
||||
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE");
|
||||
sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE");
|
||||
}
|
||||
|
||||
void ArenaTeam::Stats(WorldSession *session)
|
||||
@@ -489,7 +489,7 @@ void ArenaTeam::SetStats(uint32 stat_type, uint32 value)
|
||||
CharacterDatabase.PExecute("UPDATE arena_team_stats SET rank = '%u' WHERE arenateamid = '%u'", value, GetId());
|
||||
break;
|
||||
default:
|
||||
sLog.outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type);
|
||||
sLog->outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -523,7 +523,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun
|
||||
data << str1 << str2 << str3;
|
||||
break;
|
||||
default:
|
||||
sLog.outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
|
||||
sLog->outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun
|
||||
|
||||
BroadcastPacket(&data);
|
||||
|
||||
sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT");
|
||||
sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT");
|
||||
}
|
||||
|
||||
uint8 ArenaTeam::GetSlotByType(uint32 type)
|
||||
@@ -545,7 +545,7 @@ uint8 ArenaTeam::GetSlotByType(uint32 type)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sLog.outError("FATAL: Unknown arena team type %u for some arena team", type);
|
||||
sLog->outError("FATAL: Unknown arena team type %u for some arena team", type);
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ uint32 ArenaTeam::GetPoints(uint32 MemberRating)
|
||||
|
||||
if (rating <= 1500)
|
||||
{
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) < 6)
|
||||
points = (float)rating * 0.22f + 14.0f;
|
||||
else
|
||||
points = 344;
|
||||
@@ -619,7 +619,7 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
|
||||
// returns the chance to win against a team with the given rating, used in the rating adjustment calculation
|
||||
// ELO system
|
||||
|
||||
/* if (sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
/* if (sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
if (enemy_rating < 1000)
|
||||
enemy_rating = 1000;*/
|
||||
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
|
||||
|
||||
@@ -260,7 +260,7 @@ void Battleground::Update(uint32 diff)
|
||||
BattlegroundPlayerMap::iterator itr = m_Players.find(*(m_OfflineQueue.begin()));
|
||||
if (itr != m_Players.end())
|
||||
{
|
||||
if (itr->second.OfflineRemoveTime <= sWorld.GetGameTime())
|
||||
if (itr->second.OfflineRemoveTime <= sWorld->GetGameTime())
|
||||
{
|
||||
RemovePlayerAtLeave(itr->first, true, true);// remove player from BG
|
||||
m_OfflineQueue.pop_front(); // remove from offline queue
|
||||
@@ -321,7 +321,7 @@ void Battleground::Update(uint32 diff)
|
||||
plr->ResurrectPlayer(1.0f);
|
||||
plr->CastSpell(plr, 6962, true);
|
||||
plr->CastSpell(plr, SPELL_SPIRIT_HEAL_MANA, true);
|
||||
sObjectAccessor.ConvertCorpseForPlayer(*itr);
|
||||
sObjectAccessor->ConvertCorpseForPlayer(*itr);
|
||||
}
|
||||
m_ResurrectQueue.clear();
|
||||
}
|
||||
@@ -473,9 +473,9 @@ void Battleground::Update(uint32 diff)
|
||||
plr->ResetAllPowers();
|
||||
}
|
||||
//Announce BG starting
|
||||
if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
|
||||
sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,7 +528,7 @@ void Battleground::SendPacketToAll(WorldPacket *packet)
|
||||
if (plr)
|
||||
plr->GetSession()->SendPacket(packet);
|
||||
else
|
||||
sLog.outError("Battleground:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *
|
||||
Player *plr = sObjectMgr->GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -600,7 +600,7 @@ void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ void Battleground::YellToAll(Creature* creature, const char* text, uint32 langua
|
||||
Player *plr = sObjectMgr->GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground: Player " UI64FMTD " not found!", itr->first);
|
||||
sLog->outError("Battleground: Player " UI64FMTD " not found!", itr->first);
|
||||
continue;
|
||||
}
|
||||
creature->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,creature->GetName(),itr->first);
|
||||
@@ -638,7 +638,7 @@ void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -665,7 +665,7 @@ void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -746,15 +746,15 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
winner_matchmaker_rating = GetArenaMatchmakerRating(winner);
|
||||
winner_change = winner_arena_team->WonAgainst(loser_matchmaker_rating);
|
||||
loser_change = loser_arena_team->LostAgainst(winner_matchmaker_rating);
|
||||
sLog.outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating,
|
||||
sLog->outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating,
|
||||
winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_change);
|
||||
SetArenaTeamRatingChangeForTeam(winner, winner_change);
|
||||
SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change);
|
||||
sLog.outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
|
||||
if (sWorld.getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
|
||||
sLog->outArena("Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE], winner_arena_team->GetId(), winner_change, loser_change);
|
||||
if (sWorld->getBoolConfig(CONFIG_ARENA_LOG_EXTENDED_INFO))
|
||||
for (Battleground::BattlegroundScoreMap::const_iterator itr = GetPlayerScoresBegin(); itr != GetPlayerScoresEnd(); itr++)
|
||||
if (Player* player = sObjectMgr->GetPlayer(itr->first))
|
||||
sLog.outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
|
||||
sLog->outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
|
||||
}
|
||||
// Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes
|
||||
else
|
||||
@@ -791,7 +791,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
Player *plr = sObjectMgr->GetPlayer(itr->first);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
sLog->outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1039,7 +1039,7 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
|
||||
if (Transport)
|
||||
plr->TeleportToBGEntryPoint();
|
||||
|
||||
sLog.outDetail("BATTLEGROUND: Removed player %s from Battleground.", plr->GetName());
|
||||
sLog->outDetail("BATTLEGROUND: Removed player %s from Battleground.", plr->GetName());
|
||||
plr->GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_CONDITION_MAP, GetMapId(), true);
|
||||
}
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void Battleground::Reset()
|
||||
m_Events = 0;
|
||||
|
||||
if (m_InvitedAlliance > 0 || m_InvitedHorde > 0)
|
||||
sLog.outError("Battleground system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde);
|
||||
sLog->outError("Battleground system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde);
|
||||
|
||||
m_InvitedAlliance = 0;
|
||||
m_InvitedHorde = 0;
|
||||
@@ -1087,7 +1087,7 @@ void Battleground::StartBattleground()
|
||||
// and it doesn't matter if we call StartBattleground() more times, because m_Battlegrounds is a map and instance id never changes
|
||||
sBattlegroundMgr->AddBattleground(GetInstanceID(), GetTypeID(), this);
|
||||
if (m_IsRated)
|
||||
sLog.outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
|
||||
sLog->outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]);
|
||||
}
|
||||
|
||||
void Battleground::AddPlayer(Player *plr)
|
||||
@@ -1169,7 +1169,7 @@ void Battleground::AddPlayer(Player *plr)
|
||||
AddOrSetPlayerToCorrectBgGroup(plr, guid, team);
|
||||
|
||||
// Log
|
||||
sLog.outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName());
|
||||
sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName());
|
||||
}
|
||||
|
||||
/* this method adds player to his team's bg group, or sets his correct group if player is already in bg group */
|
||||
@@ -1222,7 +1222,7 @@ void Battleground::EventPlayerLoggedOut(Player* player)
|
||||
{
|
||||
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
|
||||
m_OfflineQueue.push_back(player->GetGUID());
|
||||
m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
|
||||
m_Players[player->GetGUID()].OfflineRemoveTime = sWorld->GetGameTime() + MAX_OFFLINE_TIME;
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
// drop flag and handle other cleanups
|
||||
@@ -1365,7 +1365,7 @@ void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value,
|
||||
itr->second->HealingDone += value;
|
||||
break;
|
||||
default:
|
||||
sLog.outError("Battleground: Unknown player score type %u", type);
|
||||
sLog->outError("Battleground: Unknown player score type %u", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1415,8 +1415,8 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(),
|
||||
PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY))
|
||||
{
|
||||
sLog.outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry);
|
||||
sLog.outError("Cannot create gameobject template %u! Battleground not created!", entry);
|
||||
sLog->outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry);
|
||||
sLog->outError("Cannot create gameobject template %u! Battleground not created!", entry);
|
||||
delete go;
|
||||
return false;
|
||||
}
|
||||
@@ -1465,7 +1465,7 @@ void Battleground::DoorClose(uint32 type)
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("Battleground: Door object not found (cannot close doors)");
|
||||
sLog->outError("Battleground: Door object not found (cannot close doors)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1480,7 +1480,7 @@ void Battleground::DoorOpen(uint32 type)
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("Battleground: Door object not found! - doors will be closed.");
|
||||
sLog->outError("Battleground: Door object not found! - doors will be closed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1488,7 +1488,7 @@ GameObject* Battleground::GetBGObject(uint32 type)
|
||||
{
|
||||
GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]);
|
||||
if (!obj)
|
||||
sLog.outError("couldn't get gameobject %i",type);
|
||||
sLog->outError("couldn't get gameobject %i",type);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -1496,7 +1496,7 @@ Creature* Battleground::GetBGCreature(uint32 type)
|
||||
{
|
||||
Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type]);
|
||||
if (!creature)
|
||||
sLog.outError("couldn't get creature %i",type);
|
||||
sLog->outError("couldn't get creature %i",type);
|
||||
return creature;
|
||||
}
|
||||
|
||||
@@ -1538,7 +1538,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
Creature* pCreature = new Creature;
|
||||
if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o))
|
||||
{
|
||||
sLog.outError("Can't create creature entry: %u",entry);
|
||||
sLog->outError("Can't create creature entry: %u",entry);
|
||||
delete pCreature;
|
||||
return NULL;
|
||||
}
|
||||
@@ -1548,7 +1548,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
|
||||
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(entry);
|
||||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry);
|
||||
sLog->outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry);
|
||||
return NULL;
|
||||
}
|
||||
//force using DB speeds
|
||||
@@ -1601,7 +1601,7 @@ bool Battleground::DelCreature(uint32 type)
|
||||
Creature *cr = GetBgMap()->GetCreature(m_BgCreatures[type]);
|
||||
if (!cr)
|
||||
{
|
||||
sLog.outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type]));
|
||||
sLog->outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type]));
|
||||
return false;
|
||||
}
|
||||
cr->AddObjectToRemoveList();
|
||||
@@ -1617,7 +1617,7 @@ bool Battleground::DelObject(uint32 type)
|
||||
GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]);
|
||||
if (!obj)
|
||||
{
|
||||
sLog.outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type]));
|
||||
sLog->outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type]));
|
||||
return false;
|
||||
}
|
||||
obj->SetRespawnTime(0); // not save respawn time
|
||||
@@ -1638,7 +1638,7 @@ bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float
|
||||
Creature* pCreature = AddCreature(entry,type,team,x,y,z,o);
|
||||
if (!pCreature)
|
||||
{
|
||||
sLog.outError("Can't create Spirit guide. Battleground not created!");
|
||||
sLog->outError("Can't create Spirit guide. Battleground not created!");
|
||||
EndNow();
|
||||
return false;
|
||||
}
|
||||
@@ -1744,7 +1744,7 @@ void Battleground::HandleTriggerBuff(uint64 const& go_guid)
|
||||
index--;
|
||||
if (index < 0)
|
||||
{
|
||||
sLog.outError("Battleground (Type: %u) has buff gameobject (Guid: %u Entry: %u Type:%u) but it hasn't that object in its internal data",GetTypeID(true),GUID_LOPART(go_guid),obj->GetEntry(),obj->GetGoType());
|
||||
sLog->outError("Battleground (Type: %u) has buff gameobject (Guid: %u Entry: %u Type:%u) but it hasn't that object in its internal data",GetTypeID(true),GUID_LOPART(go_guid),obj->GetEntry(),obj->GetGoType());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1868,7 +1868,7 @@ int32 Battleground::GetObjectType(uint64 guid)
|
||||
for (uint32 i = 0; i < m_BgObjects.size(); ++i)
|
||||
if (m_BgObjects[i] == guid)
|
||||
return i;
|
||||
sLog.outError("Battleground: cheating? a player used a gameobject which isnt supposed to be a usable object!");
|
||||
sLog->outError("Battleground: cheating? a player used a gameobject which isnt supposed to be a usable object!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1930,7 +1930,7 @@ void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry)
|
||||
|
||||
void Battleground::RewardXPAtKill(Player* plr, Player* victim)
|
||||
{
|
||||
if (!sWorld.getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim)
|
||||
if (!sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim)
|
||||
return;
|
||||
|
||||
uint32 xp = 0;
|
||||
|
||||
@@ -55,7 +55,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
|
||||
{
|
||||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
m_Battlegrounds[i].clear();
|
||||
m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_Testing=false;
|
||||
}
|
||||
|
||||
@@ -138,33 +138,33 @@ void BattlegroundMgr::Update(uint32 diff)
|
||||
}
|
||||
|
||||
// if rating difference counts, maybe force-update queues
|
||||
if (sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
|
||||
if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
|
||||
{
|
||||
// it's time to force update
|
||||
if (m_NextRatingDiscardUpdate < diff)
|
||||
{
|
||||
// forced update for rated arenas (scan all, but skipped non rated)
|
||||
sLog.outDebug("BattlegroundMgr: UPDATING ARENA QUEUES");
|
||||
sLog->outDebug("BattlegroundMgr: UPDATING ARENA QUEUES");
|
||||
for (int qtype = BATTLEGROUND_QUEUE_2v2; qtype <= BATTLEGROUND_QUEUE_5v5; ++qtype)
|
||||
for (int bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket)
|
||||
m_BattlegroundQueues[qtype].Update(
|
||||
BATTLEGROUND_AA, BattlegroundBracketId(bracket),
|
||||
BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0);
|
||||
|
||||
m_NextRatingDiscardUpdate = sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
else
|
||||
m_NextRatingDiscardUpdate -= diff;
|
||||
}
|
||||
if (sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
{
|
||||
if (m_AutoDistributionTimeChecker < diff)
|
||||
{
|
||||
if (time(NULL) > m_NextAutoDistributionTime)
|
||||
{
|
||||
DistributeArenaPoints();
|
||||
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
sWorld.setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime));
|
||||
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime));
|
||||
}
|
||||
m_AutoDistributionTimeChecker = 600000; // check 10 minutes
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
*data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time
|
||||
// The following segment is read as uint64 in client but can be appended as their original type.
|
||||
*data << uint8(arenatype);
|
||||
sLog.outDebug("BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID());
|
||||
sLog->outDebug("BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID());
|
||||
*data << uint8(bg->isArena() ? 0xC : 0x2);
|
||||
*data << uint32(bg->GetTypeID());
|
||||
*data << uint16(0x1F90);
|
||||
@@ -221,7 +221,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro
|
||||
*data << uint8(uiFrame);
|
||||
break;
|
||||
default:
|
||||
sLog.outError("Unknown BG status!");
|
||||
sLog->outError("Unknown BG status!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
|
||||
*data << uint32(pointsLost); // Rating Lost
|
||||
*data << uint32(pointsGained); // Rating gained
|
||||
*data << uint32(MatchmakerRating); // Matchmaking Value
|
||||
sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
|
||||
sLog->outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
|
||||
}
|
||||
for (int8 i = 1; i >= 0; --i)
|
||||
{
|
||||
@@ -276,7 +276,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
|
||||
itr2 = itr++;
|
||||
if (!bg->IsPlayerInBattleground(itr2->first))
|
||||
{
|
||||
sLog.outError("Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
|
||||
sLog->outError("Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -372,14 +372,14 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
|
||||
*data << uint32(0);
|
||||
break;
|
||||
default:
|
||||
sLog.outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID());
|
||||
sLog->outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID());
|
||||
*data << uint32(0);
|
||||
break;
|
||||
}
|
||||
// should never happen
|
||||
if (++scoreCount >= bg->GetMaxPlayers() && itr != bg->GetPlayerScoresEnd())
|
||||
{
|
||||
sLog.outError("Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
|
||||
sLog->outError("Battleground %u scoreboard has more entries (%u) than allowed players in this bg (%u)", bg->GetTypeID(true), bg->GetPlayerScoresSize(), bg->GetMaxPlayers());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -496,7 +496,7 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI
|
||||
|
||||
if (!bg_template)
|
||||
{
|
||||
sLog.outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
|
||||
sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
|
||||
return NULL;
|
||||
}
|
||||
bool isRandom = false;
|
||||
@@ -538,7 +538,7 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI
|
||||
bg_template = GetBattlegroundTemplate(bgTypeId);
|
||||
if (!bg_template)
|
||||
{
|
||||
sLog.outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
|
||||
sLog->outError("Battleground: CreateNewBattleground - bg template not found for %u", bgTypeId);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -676,8 +676,8 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog.outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
|
||||
sLog.outString();
|
||||
sLog->outErrorDb(">> Loaded 0 battlegrounds. DB table `battleground_template` is empty.");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
bl = sBattlemasterListStore.LookupEntry(bgTypeID_);
|
||||
if (!bl)
|
||||
{
|
||||
sLog.outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
|
||||
sLog->outError("Battleground ID %u not found in BattlemasterList.dbc. Battleground not created.", bgTypeID_);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTypeID, start1);
|
||||
sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `AllianceStartLoc`. BG not created.", bgTypeID, start1);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -761,14 +761,14 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTypeID, start2);
|
||||
sLog->outErrorDb("Table `battleground_template` for id %u have non-existed WorldSafeLocs.dbc id %u in field `HordeStartLoc`. BG not created.", bgTypeID, start2);
|
||||
continue;
|
||||
}
|
||||
|
||||
selectionWeight = fields[9].GetUInt8();
|
||||
scriptId = sObjectMgr->GetScriptId(fields[10].GetCString());
|
||||
//sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl);
|
||||
if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId))
|
||||
//sLog->outDetail("Creating battleground %s, %u-%u", bl->name[sWorld->GetDBClang()], MinLvl, MaxLvl);
|
||||
if (!CreateBattleground(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, bl->name[sWorld->GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3], scriptId))
|
||||
continue;
|
||||
|
||||
if (IsArena)
|
||||
@@ -782,34 +782,34 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog.outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog.outString();
|
||||
sLog->outString(">> Loaded %u battlegrounds in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void BattlegroundMgr::InitAutomaticArenaPointDistribution()
|
||||
{
|
||||
if (!sWorld.getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
|
||||
return;
|
||||
|
||||
time_t wstime = time_t(sWorld.getWorldState(WS_ARENA_DISTRIBUTION_TIME));
|
||||
time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
|
||||
time_t curtime = time(NULL);
|
||||
sLog.outDebug("Initializing Automatic Arena Point Distribution");
|
||||
sLog->outDebug("Initializing Automatic Arena Point Distribution");
|
||||
if (wstime < curtime)
|
||||
{
|
||||
m_NextAutoDistributionTime = curtime; // reset will be called in the next update
|
||||
sLog.outDebug("Battleground: Next arena point distribution time in the past, reseting it now.");
|
||||
sLog->outDebug("Battleground: Next arena point distribution time in the past, reseting it now.");
|
||||
}
|
||||
else
|
||||
m_NextAutoDistributionTime = wstime;
|
||||
sLog.outDebug("Automatic Arena Point Distribution initialized.");
|
||||
sLog->outDebug("Automatic Arena Point Distribution initialized.");
|
||||
}
|
||||
|
||||
void BattlegroundMgr::DistributeArenaPoints()
|
||||
{
|
||||
// used to distribute arena points based on last week's stats
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_START);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_START);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START);
|
||||
|
||||
//temporary structure for storing maximum points to add values for all players
|
||||
std::map<uint32, uint32> PlayerPoints;
|
||||
@@ -833,9 +833,9 @@ void BattlegroundMgr::DistributeArenaPoints()
|
||||
|
||||
PlayerPoints.clear();
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
for (ObjectMgr::ArenaTeamMap::iterator titr = sObjectMgr->GetArenaTeamMapBegin(); titr != sObjectMgr->GetArenaTeamMapEnd(); ++titr)
|
||||
{
|
||||
if (ArenaTeam * at = titr->second)
|
||||
@@ -846,9 +846,9 @@ void BattlegroundMgr::DistributeArenaPoints()
|
||||
}
|
||||
}
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
||||
sWorld->SendWorldText(LANG_DIST_ARENA_POINTS_END);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, const uint64& guid, Player* plr, BattlegroundTypeId bgTypeId, uint8 fromWhere)
|
||||
@@ -927,12 +927,12 @@ void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, Battlegr
|
||||
team = pl->GetTeam();
|
||||
bg->GetTeamStartLoc(team, x, y, z, O);
|
||||
|
||||
sLog.outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", pl->GetName(), mapid, x, y, z, O);
|
||||
sLog->outDetail("BATTLEGROUND: Sending %s to map %u, X %f, Y %f, Z %f, O %f", pl->GetName(), mapid, x, y, z, O);
|
||||
pl->TeleportTo(mapid, x, y, z, O);
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId);
|
||||
sLog->outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,18 +1043,18 @@ void BattlegroundMgr::ToggleTesting()
|
||||
{
|
||||
m_Testing = !m_Testing;
|
||||
if (m_Testing)
|
||||
sWorld.SendWorldText(LANG_DEBUG_BG_ON);
|
||||
sWorld->SendWorldText(LANG_DEBUG_BG_ON);
|
||||
else
|
||||
sWorld.SendWorldText(LANG_DEBUG_BG_OFF);
|
||||
sWorld->SendWorldText(LANG_DEBUG_BG_OFF);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::ToggleArenaTesting()
|
||||
{
|
||||
m_ArenaTesting = !m_ArenaTesting;
|
||||
if (m_ArenaTesting)
|
||||
sWorld.SendWorldText(LANG_DEBUG_ARENA_ON);
|
||||
sWorld->SendWorldText(LANG_DEBUG_ARENA_ON);
|
||||
else
|
||||
sWorld.SendWorldText(LANG_DEBUG_ARENA_OFF);
|
||||
sWorld->SendWorldText(LANG_DEBUG_ARENA_OFF);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::SetHolidayWeekends(uint32 mask)
|
||||
@@ -1089,7 +1089,7 @@ void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaMatchmakerRating, uint8 ar
|
||||
uint32 BattlegroundMgr::GetMaxRatingDifference() const
|
||||
{
|
||||
// this is for stupid people who can't use brain and set max rating difference to 0
|
||||
uint32 diff = sWorld.getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
|
||||
uint32 diff = sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE);
|
||||
if (diff == 0)
|
||||
diff = 5000;
|
||||
return diff;
|
||||
@@ -1097,12 +1097,12 @@ uint32 BattlegroundMgr::GetMaxRatingDifference() const
|
||||
|
||||
uint32 BattlegroundMgr::GetRatingDiscardTimer() const
|
||||
{
|
||||
return sWorld.getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
return sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
}
|
||||
|
||||
uint32 BattlegroundMgr::GetPrematureFinishTime() const
|
||||
{
|
||||
return sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
|
||||
return sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER);
|
||||
}
|
||||
|
||||
void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
@@ -1115,8 +1115,8 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog.outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
|
||||
sLog.outString();
|
||||
sLog->outString(">> Loaded 0 battlemaster entries. DB table `battlemaster_entry` is empty!");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1132,7 +1132,7 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
uint32 bgTypeId = fields[1].GetUInt32();
|
||||
if (!sBattlemasterListStore.LookupEntry(bgTypeId))
|
||||
{
|
||||
sLog.outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId);
|
||||
sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1141,8 +1141,8 @@ void BattlegroundMgr::LoadBattleMastersEntry()
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog.outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog.outString();
|
||||
sLog->outString(">> Loaded %u battlemaster entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId)
|
||||
|
||||
@@ -151,16 +151,16 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
index += BG_TEAMS_COUNT;
|
||||
if (ginfo->Team == HORDE)
|
||||
index++;
|
||||
sLog.outDebug("Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index);
|
||||
sLog->outDebug("Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index);
|
||||
|
||||
uint32 lastOnlineTime = getMSTime();
|
||||
|
||||
//announce world (this don't need mutex)
|
||||
if (isRated && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (isRated && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr->GetArenaTeamById(arenateamid);
|
||||
if (Team)
|
||||
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
|
||||
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, Team->GetName().c_str(), ginfo->ArenaType, ginfo->ArenaType, ginfo->ArenaTeamRating);
|
||||
}
|
||||
|
||||
//add players from group to ginfo
|
||||
@@ -192,7 +192,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
m_QueuedGroups[bracketId][index].push_back(ginfo);
|
||||
|
||||
//announce to world, this code needs mutex
|
||||
if (!isRated && !isPremade && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (!isRated && !isPremade && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
if (Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(ginfo->BgTypeId))
|
||||
{
|
||||
@@ -211,7 +211,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
qHorde += (*itr)->Players.size();
|
||||
|
||||
// Show queue status to player only (when joining queue)
|
||||
if (sWorld.getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
|
||||
if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY))
|
||||
{
|
||||
ChatHandler(leader).PSendSysMessage(LANG_BG_QUEUE_ANNOUNCE_SELF, bgName, q_min_level, q_max_level,
|
||||
qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0);
|
||||
@@ -219,7 +219,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
|
||||
// System message
|
||||
else
|
||||
{
|
||||
sWorld.SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level,
|
||||
sWorld->SendWorldText(LANG_BG_QUEUE_ANNOUNCE_WORLD, bgName, q_min_level, q_max_level,
|
||||
qAlliance, (MinPlayers > qAlliance) ? MinPlayers - qAlliance : (uint32)0, qHorde, (MinPlayers > qHorde) ? MinPlayers - qHorde : (uint32)0);
|
||||
}
|
||||
}
|
||||
@@ -291,7 +291,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
itr = m_QueuedPlayers.find(guid);
|
||||
if (itr == m_QueuedPlayers.end())
|
||||
{
|
||||
sLog.outError("BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
|
||||
sLog->outError("BattlegroundQueue: couldn't find player to remove GUID: %u", GUID_LOPART(guid));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,10 +324,10 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
//player can't be in queue without group, but just in case
|
||||
if (bracket_id == -1)
|
||||
{
|
||||
sLog.outError("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
|
||||
sLog->outError("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid));
|
||||
return;
|
||||
}
|
||||
sLog.outDebug("BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id);
|
||||
sLog->outDebug("BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id);
|
||||
|
||||
// ALL variables are correctly set
|
||||
// We can ignore leveling up in queue - it should not cause crash
|
||||
@@ -351,11 +351,11 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
m_QueuedPlayers.erase(itr);
|
||||
|
||||
// announce to world if arena team left queue for rated match, show only once
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld.getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
if (group->ArenaType && group->IsRated && group->Players.empty() && sWorld->getBoolConfig(CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE))
|
||||
{
|
||||
ArenaTeam *Team = sObjectMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
if (Team)
|
||||
sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
|
||||
sWorld->SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, Team->GetName().c_str(), group->ArenaType, group->ArenaType, group->ArenaTeamRating);
|
||||
}
|
||||
|
||||
//if player leaves queue and he is invited to rated arena match, then he have to lose
|
||||
@@ -364,7 +364,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
ArenaTeam * at = sObjectMgr->GetArenaTeamById(group->ArenaTeamId);
|
||||
if (at)
|
||||
{
|
||||
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
|
||||
sLog->outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
|
||||
Player *plr = sObjectMgr->GetPlayer(guid);
|
||||
if (plr)
|
||||
at->MemberLost(plr, group->OpponentsMatchmakerRating);
|
||||
@@ -471,7 +471,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b
|
||||
|
||||
uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId);
|
||||
|
||||
sLog.outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID());
|
||||
sLog->outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID());
|
||||
|
||||
// send status packet
|
||||
sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType);
|
||||
@@ -509,7 +509,7 @@ void BattlegroundQueue::FillPlayersToBG(Battleground* bg, BattlegroundBracketId
|
||||
++Horde_itr;
|
||||
|
||||
//if ofc like BG queue invitation is set in config, then we are happy
|
||||
if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0)
|
||||
if (sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) == 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -605,7 +605,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
|
||||
// this could be 2 cycles but i'm checking only first team in queue - it can cause problem -
|
||||
// if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
|
||||
// and when they click or after 80 seconds the queue info is removed from queue
|
||||
uint32 time_before = getMSTime() - sWorld.getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
|
||||
uint32 time_before = getMSTime() - sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
|
||||
@@ -644,7 +644,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* bg_template, Battleground
|
||||
uint32 j = BG_TEAM_ALLIANCE;
|
||||
if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())
|
||||
j = BG_TEAM_HORDE;
|
||||
if (sWorld.getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0
|
||||
if (sWorld->getIntConfig(CONFIG_BATTLEGROUND_INVITATION_TYPE) != 0
|
||||
&& m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers)
|
||||
{
|
||||
//we will try to invite more groups to team with less players indexed by j
|
||||
@@ -779,14 +779,14 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
Battleground * bg_template = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||
if (!bg_template)
|
||||
{
|
||||
sLog.outError("Battleground: Update: bg template not found for %u", bgTypeId);
|
||||
sLog->outError("Battleground: Update: bg template not found for %u", bgTypeId);
|
||||
return;
|
||||
}
|
||||
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(),bracket_id);
|
||||
if (!bracketEntry)
|
||||
{
|
||||
sLog.outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
|
||||
sLog->outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -837,7 +837,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, 0, false);
|
||||
if (!bg2)
|
||||
{
|
||||
sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
return;
|
||||
}
|
||||
//invite those selection pools
|
||||
@@ -863,7 +863,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
Battleground * bg2 = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, false);
|
||||
if (!bg2)
|
||||
{
|
||||
sLog.outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
sLog->outError("BattlegroundQueue::Update - Cannot create battleground: %u", bgTypeId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -977,16 +977,16 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
Battleground* arena = sBattlegroundMgr->CreateNewBattleground(bgTypeId, bracketEntry, arenaType, true);
|
||||
if (!arena)
|
||||
{
|
||||
sLog.outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
|
||||
sLog->outError("BattlegroundQueue::Update couldn't create arena instance for rated arena match!");
|
||||
return;
|
||||
}
|
||||
|
||||
(*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamRating;
|
||||
(*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaMatchmakerRating;
|
||||
sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating);
|
||||
sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating);
|
||||
(*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamRating;
|
||||
(*(itr_team[BG_TEAM_HORDE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaMatchmakerRating;
|
||||
sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating);
|
||||
sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating);
|
||||
// now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer
|
||||
if ((*(itr_team[BG_TEAM_ALLIANCE]))->Team != ALLIANCE)
|
||||
{
|
||||
@@ -1008,7 +1008,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
|
||||
InviteGroupToBG(*(itr_team[BG_TEAM_ALLIANCE]), arena, ALLIANCE);
|
||||
InviteGroupToBG(*(itr_team[BG_TEAM_HORDE]), arena, HORDE);
|
||||
|
||||
sLog.outDebug("Starting rated arena match!");
|
||||
sLog->outDebug("Starting rated arena match!");
|
||||
|
||||
arena->StartBattleground();
|
||||
}
|
||||
@@ -1080,7 +1080,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[m_BgQueueTypeId];
|
||||
if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime))
|
||||
{
|
||||
sLog.outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
|
||||
sLog->outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID);
|
||||
|
||||
plr->RemoveBattlegroundQueueId(m_BgQueueTypeId);
|
||||
bgQueue.RemovePlayer(m_PlayerGuid, true);
|
||||
|
||||
@@ -248,7 +248,7 @@ void BattlegroundAB::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 4021: // Unk2
|
||||
//break;
|
||||
default:
|
||||
//sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
//sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
//Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ void BattlegroundAB::_SendNodeUpdate(uint8 node)
|
||||
void BattlegroundAB::_NodeOccupied(uint8 node,Team team)
|
||||
{
|
||||
if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team))
|
||||
sLog.outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team);
|
||||
sLog->outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team);
|
||||
|
||||
uint8 capturedNodes = 0;
|
||||
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
@@ -571,7 +571,7 @@ bool BattlegroundAB::SetupBattleground()
|
||||
|| !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i,BG_AB_OBJECTID_AURA_C,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -579,7 +579,7 @@ bool BattlegroundAB::SetupBattleground()
|
||||
|| !AddObject(BG_AB_OBJECT_GATE_H,BG_AB_OBJECTID_GATE_H,BG_AB_DoorPositions[1][0],BG_AB_DoorPositions[1][1],BG_AB_DoorPositions[1][2],BG_AB_DoorPositions[1][3],BG_AB_DoorPositions[1][4],BG_AB_DoorPositions[1][5],BG_AB_DoorPositions[1][6],BG_AB_DoorPositions[1][7],RESPAWN_IMMEDIATELY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
//buffs
|
||||
@@ -589,7 +589,7 @@ bool BattlegroundAB::SetupBattleground()
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 1, Buff_Entries[1], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i + 2, Buff_Entries[2], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3]/2), cos(BG_AB_BuffPositions[i][3]/2), RESPAWN_ONE_DAY)
|
||||
)
|
||||
sLog.outErrorDb("BatteGroundAB: Failed to spawn buff object!");
|
||||
sLog->outErrorDb("BatteGroundAB: Failed to spawn buff object!");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -58,7 +58,7 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
{
|
||||
sLog.outDebug("bg_av HandleKillUnit %i",unit->GetEntry());
|
||||
sLog->outDebug("bg_av HandleKillUnit %i",unit->GetEntry());
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
uint32 entry = unit->GetEntry();
|
||||
@@ -93,7 +93,7 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
{
|
||||
if (!m_CaptainAlive[0])
|
||||
{
|
||||
sLog.outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
return;
|
||||
}
|
||||
m_CaptainAlive[0]=false;
|
||||
@@ -112,7 +112,7 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
{
|
||||
if (!m_CaptainAlive[1])
|
||||
{
|
||||
sLog.outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
sLog->outError("Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
return;
|
||||
}
|
||||
m_CaptainAlive[1]=false;
|
||||
@@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
return;//maybe we should log this, cause this must be a cheater or a big bug
|
||||
uint8 team = GetTeamIndexByTeamId(player->GetTeam());
|
||||
//TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor
|
||||
sLog.outDebug("BG_AV Quest %i completed",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed",questid);
|
||||
switch(questid)
|
||||
{
|
||||
case AV_QUEST_A_SCRAPS1:
|
||||
@@ -149,7 +149,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
m_Team_QuestStatus[team][0]+=20;
|
||||
if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins
|
||||
{
|
||||
sLog.outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid);
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
|
||||
if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED)
|
||||
{
|
||||
@@ -164,21 +164,21 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
m_Team_QuestStatus[team][1]++;
|
||||
RewardReputationToTeam(team,1,player->GetTeam());
|
||||
if (m_Team_QuestStatus[team][1] == 30)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER2:
|
||||
case AV_QUEST_H_COMMANDER2:
|
||||
m_Team_QuestStatus[team][2]++;
|
||||
RewardReputationToTeam(team,1,player->GetTeam());
|
||||
if (m_Team_QuestStatus[team][2] == 60)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER3:
|
||||
case AV_QUEST_H_COMMANDER3:
|
||||
m_Team_QuestStatus[team][3]++;
|
||||
RewardReputationToTeam(team,1,player->GetTeam());
|
||||
if (m_Team_QuestStatus[team][1] == 120)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
break;
|
||||
case AV_QUEST_A_BOSS1:
|
||||
case AV_QUEST_H_BOSS1:
|
||||
@@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
case AV_QUEST_H_BOSS2:
|
||||
m_Team_QuestStatus[team][4]++;
|
||||
if (m_Team_QuestStatus[team][4] >= 200)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
break;
|
||||
case AV_QUEST_A_NEAR_MINE:
|
||||
case AV_QUEST_H_NEAR_MINE:
|
||||
m_Team_QuestStatus[team][5]++;
|
||||
if (m_Team_QuestStatus[team][5] == 28)
|
||||
{
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
if (m_Team_QuestStatus[team][6] == 7)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
|
||||
}
|
||||
break;
|
||||
case AV_QUEST_A_OTHER_MINE:
|
||||
@@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
m_Team_QuestStatus[team][6]++;
|
||||
if (m_Team_QuestStatus[team][6] == 7)
|
||||
{
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
if (m_Team_QuestStatus[team][5] == 20)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid);
|
||||
}
|
||||
break;
|
||||
case AV_QUEST_A_RIDER_HIDE:
|
||||
@@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
m_Team_QuestStatus[team][7]++;
|
||||
if (m_Team_QuestStatus[team][7] == 25)
|
||||
{
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
if (m_Team_QuestStatus[team][8] == 25)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
|
||||
}
|
||||
break;
|
||||
case AV_QUEST_A_RIDER_TAME:
|
||||
@@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
m_Team_QuestStatus[team][8]++;
|
||||
if (m_Team_QuestStatus[team][8] == 25)
|
||||
{
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid);
|
||||
if (m_Team_QuestStatus[team][7] == 25)
|
||||
sLog.outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
sLog.outDebug("BG_AV Quest %i completed but is not interesting at all",questid);
|
||||
sLog->outDebug("BG_AV Quest %i completed but is not interesting at all",questid);
|
||||
return; //was no interesting quest at all
|
||||
break;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ void BattlegroundAV::StartingEventCloseDoors()
|
||||
|
||||
void BattlegroundAV::StartingEventOpenDoors()
|
||||
{
|
||||
sLog.outDebug("BG_AV: start spawning mine stuff");
|
||||
sLog->outDebug("BG_AV: start spawning mine stuff");
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
|
||||
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
|
||||
@@ -479,7 +479,7 @@ void BattlegroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("bg_AV no player at remove");
|
||||
sLog->outError("bg_AV no player at remove");
|
||||
return;
|
||||
}
|
||||
//TODO search more buffs
|
||||
@@ -519,7 +519,7 @@ void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
//Source->Unmount();
|
||||
break;
|
||||
default:
|
||||
sLog.outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
// Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
{
|
||||
|
||||
uint32 object = GetObjectThroughNode(node);
|
||||
sLog.outDebug("bg_av: player destroyed point node %i object %i",node,object);
|
||||
sLog->outDebug("bg_av: player destroyed point node %i object %i",node,object);
|
||||
|
||||
//despawn banner
|
||||
SpawnBGObject(object, RESPAWN_ONE_DAY);
|
||||
@@ -587,7 +587,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
if (m_BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp])
|
||||
DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp);
|
||||
else
|
||||
sLog.outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist",AV_CPLACE_A_MARSHAL_SOUTH + tmp);
|
||||
sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist",AV_CPLACE_A_MARSHAL_SOUTH + tmp);
|
||||
//spawn destroyed aura
|
||||
for (uint8 i=0; i <= 9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10),RESPAWN_IMMEDIATELY);
|
||||
@@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
|
||||
if (!initial)
|
||||
{
|
||||
sLog.outDebug("bg_av depopulating mine %i (0=north,1=south)",mine);
|
||||
sLog->outDebug("bg_av depopulating mine %i (0=north,1=south)",mine);
|
||||
if (mine == AV_SOUTH_MINE)
|
||||
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
if (m_BgCreatures[i])
|
||||
@@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
}
|
||||
SendMineWorldStates(mine);
|
||||
|
||||
sLog.outDebug("bg_av populating mine %i (0=north,1=south)",mine);
|
||||
sLog->outDebug("bg_av populating mine %i (0=north,1=south)",mine);
|
||||
uint16 miner;
|
||||
//also neutral team exists.. after a big time, the neutral team tries to conquer the mine
|
||||
if (mine == AV_NORTH_MINE)
|
||||
@@ -678,7 +678,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
else
|
||||
miner = AV_NPC_S_MINE_N_1;
|
||||
//vermin
|
||||
sLog.outDebug("spawning vermin");
|
||||
sLog->outDebug("spawning vermin");
|
||||
if (team == ALLIANCE)
|
||||
cinfo = AV_NPC_S_MINE_A_3;
|
||||
else if (team == HORDE)
|
||||
@@ -752,7 +752,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
if (m_BgCreatures[node])
|
||||
DelCreature(node);
|
||||
if (!AddSpiritGuide(node, BG_AV_CreaturePos[node][0], BG_AV_CreaturePos[node][1], BG_AV_CreaturePos[node][2], BG_AV_CreaturePos[node][3], owner))
|
||||
sLog.outError("AV: couldn't spawn spiritguide at node %i",node);
|
||||
sLog->outError("AV: couldn't spawn spiritguide at node %i",node);
|
||||
|
||||
}
|
||||
for (uint8 i=0; i<4; i++)
|
||||
@@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
|
||||
BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
||||
{
|
||||
sLog.outDebug("bg_AV getnodethroughobject %i",object);
|
||||
sLog->outDebug("bg_AV getnodethroughobject %i",object);
|
||||
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
|
||||
return BG_AV_Nodes(object);
|
||||
if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT)
|
||||
@@ -810,14 +810,14 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
||||
return BG_AV_Nodes(object - 29);
|
||||
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
|
||||
return BG_AV_NODES_SNOWFALL_GRAVE;
|
||||
sLog.outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
sLog->outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
ASSERT(false);
|
||||
return BG_AV_Nodes(0);
|
||||
}
|
||||
|
||||
uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
{ //this function is the counterpart to GetNodeThroughObject()
|
||||
sLog.outDebug("bg_AV GetObjectThroughNode %i",node);
|
||||
sLog->outDebug("bg_AV GetObjectThroughNode %i",node);
|
||||
if (m_Nodes[node].Owner == ALLIANCE)
|
||||
{
|
||||
if (m_Nodes[node].State == POINT_ASSAULTED)
|
||||
@@ -848,7 +848,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
}
|
||||
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
|
||||
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
|
||||
sLog.outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
|
||||
sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
|
||||
ASSERT(false);
|
||||
return 0;
|
||||
}
|
||||
@@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
int32 object = GetObjectType(target_obj->GetGUID());
|
||||
sLog.outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object);
|
||||
sLog->outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object);
|
||||
if (object < 0)
|
||||
return;
|
||||
switch(target_obj->GetEntry())
|
||||
@@ -899,10 +899,10 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
EventPlayerAssaultsPoint(player,object);
|
||||
return;
|
||||
}
|
||||
sLog.outDebug("player defends point object: %i node: %i",object,node);
|
||||
sLog->outDebug("player defends point object: %i node: %i",object,node);
|
||||
if (m_Nodes[node].PrevOwner != team)
|
||||
{
|
||||
sLog.outError("BG_AV: player defends point which doesn't belong to his team %i",node);
|
||||
sLog->outError("BG_AV: player defends point which doesn't belong to his team %i",node);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
BG_AV_Nodes node = GetNodeThroughObject(object);
|
||||
uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
|
||||
uint32 team = player->GetTeam();
|
||||
sLog.outDebug("bg_av: player assaults point object %i node %i",object,node);
|
||||
sLog->outDebug("bg_av: player assaults point object %i node %i",object,node);
|
||||
if (owner == team || team == m_Nodes[node].TotalOwner)
|
||||
return; //surely a gm used this object
|
||||
|
||||
@@ -1118,7 +1118,7 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used
|
||||
if (state == POINT_ASSAULTED)
|
||||
return 3;
|
||||
}
|
||||
sLog.outError("BG_AV: should update a strange worldstate state:%i team:%i",state,team);
|
||||
sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i",state,team);
|
||||
return 5; //this will crash the game, but i want to know if something is wrong here
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
// horde gates
|
||||
|| !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0],BG_AV_DoorPositons[1][1],BG_AV_DoorPositons[1][2],BG_AV_DoorPositons[1][3],0,0,sin(BG_AV_DoorPositons[1][3]/2),cos(BG_AV_DoorPositons[1][3]/2),RESPAWN_IMMEDIATELY))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
|
||||
sLog->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1215,7 +1215,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|| !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!2");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1230,7 +1230,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PH,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!3");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1243,7 +1243,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PA,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!4");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_SMOKE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1273,7 +1273,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1283,7 +1283,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i,BG_AV_OBJECTID_MINE_N,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1291,14 +1291,14 @@ bool BattlegroundAV::SetupBattleground()
|
||||
{
|
||||
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i,BG_AV_OBJECTID_MINE_S,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N ,BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3],0,0,sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
return false;
|
||||
}
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
@@ -1308,13 +1308,13 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i);
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint16 i;
|
||||
sLog.outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ...");
|
||||
sLog->outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ...");
|
||||
// Initial Nodes
|
||||
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
@@ -1345,22 +1345,22 @@ bool BattlegroundAV::SetupBattleground()
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY);
|
||||
|
||||
//creatures
|
||||
sLog.outDebug("BG_AV start poputlating nodes");
|
||||
sLog->outDebug("BG_AV start poputlating nodes");
|
||||
for (BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
{
|
||||
if (m_Nodes[i].Owner)
|
||||
PopulateNode(i);
|
||||
}
|
||||
//all creatures which don't get despawned through the script are static
|
||||
sLog.outDebug("BG_AV: start spawning static creatures");
|
||||
sLog->outDebug("BG_AV: start spawning static creatures");
|
||||
for (i=0; i < AV_STATICCPLACE_MAX; i++)
|
||||
AddAVCreature(0,i+AV_CPLACE_MAX);
|
||||
//mainspiritguides:
|
||||
sLog.outDebug("BG_AV: start spawning spiritguides creatures");
|
||||
sLog->outDebug("BG_AV: start spawning spiritguides creatures");
|
||||
AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE);
|
||||
AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE);
|
||||
//spawn the marshals (those who get deleted, if a tower gets destroyed)
|
||||
sLog.outDebug("BG_AV: start spawning marshal creatures");
|
||||
sLog->outDebug("BG_AV: start spawning marshal creatures");
|
||||
for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++)
|
||||
AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
|
||||
AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD);
|
||||
@@ -1387,7 +1387,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W);
|
||||
case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
|
||||
default:
|
||||
sLog.outError("tried to get name for node %u",node);
|
||||
sLog->outError("tried to get name for node %u",node);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1398,22 +1398,22 @@ void BattlegroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
|
||||
{
|
||||
if (m_Nodes[node].TotalOwner == team)
|
||||
{
|
||||
sLog.outCrash("Assaulting team is TotalOwner of node");
|
||||
sLog->outCrash("Assaulting team is TotalOwner of node");
|
||||
ASSERT (false);
|
||||
}
|
||||
if (m_Nodes[node].Owner == team)
|
||||
{
|
||||
sLog.outCrash("Assaulting team is owner of node");
|
||||
sLog->outCrash("Assaulting team is owner of node");
|
||||
ASSERT (false);
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_DESTROYED)
|
||||
{
|
||||
sLog.outCrash("Destroyed node is being assaulted");
|
||||
sLog->outCrash("Destroyed node is being assaulted");
|
||||
ASSERT (false);
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists
|
||||
{
|
||||
sLog.outCrash("Assault on an not assaulted node with total owner");
|
||||
sLog->outCrash("Assault on an not assaulted node with total owner");
|
||||
ASSERT (false);
|
||||
}
|
||||
//the timer gets another time, if the previous owner was 0 == Neutral
|
||||
|
||||
@@ -103,7 +103,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("Killer player not found");
|
||||
sLog->outError("Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
//buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2];
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ bool BattlegroundBE::SetupBattleground()
|
||||
|| !AddObject(BG_BE_OBJECT_BUFF_1, BG_BE_OBJECT_TYPE_BUFF_1, 6249.042f, 275.3239f, 11.22033f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|
||||
|| !AddObject(BG_BE_OBJECT_BUFF_2, BG_BE_OBJECT_TYPE_BUFF_2, 6228.26f, 249.566f, 11.21812f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundBE: Failed to spawn some object!");
|
||||
sLog->outErrorDb("BatteGroundBE: Failed to spawn some object!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer)
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattlegroundDS: Killer player not found");
|
||||
sLog->outError("BattlegroundDS: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ void BattlegroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 5348:
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ bool BattlegroundDS::SetupBattleground()
|
||||
|| !AddObject(BG_DS_OBJECT_BUFF_1, BG_DS_OBJECT_TYPE_BUFF_1, 1291.7f, 813.424f, 7.11472f, 4.64562f, 0, 0, 0.730314f, -0.683111f, 120)
|
||||
|| !AddObject(BG_DS_OBJECT_BUFF_2, BG_DS_OBJECT_TYPE_BUFF_2, 1291.7f, 768.911f, 7.11472f, 1.55194f, 0, 0, 0.700409f, 0.713742f, 120))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundDS: Failed to spawn some object!");
|
||||
sLog->outErrorDb("BatteGroundDS: Failed to spawn some object!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ void BattlegroundEY::CheckSomeoneJoinedPoint()
|
||||
Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[EY_POINTS_MAX][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
sLog->outError("BattlegroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[EY_POINTS_MAX][j]));
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void BattlegroundEY::CheckSomeoneLeftPoint()
|
||||
Player *plr = sObjectMgr->GetPlayer(m_PlayersNearPoint[i][j]);
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
sLog->outError("BattlegroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
|
||||
//move not existed player to "free space" - this will cause many error showing in log, but it is a very important bug
|
||||
m_PlayersNearPoint[EY_POINTS_MAX].push_back(m_PlayersNearPoint[i][j]);
|
||||
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
|
||||
@@ -410,7 +410,7 @@ void BattlegroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 5866:
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ bool BattlegroundEY::SetupBattleground()
|
||||
|| !AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundEY: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -483,28 +483,28 @@ bool BattlegroundEY::SetupBattleground()
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]);
|
||||
if (!at)
|
||||
{
|
||||
sLog.outError("BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
sLog->outError("BattlegroundEY: Unknown trigger: %u", m_Points_Trigger[i]);
|
||||
continue;
|
||||
}
|
||||
if (!AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY)
|
||||
)
|
||||
sLog.outError("BattlegroundEY: Cannot spawn buff");
|
||||
sLog->outError("BattlegroundEY: Cannot spawn buff");
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(EY_GRAVEYARD_MAIN_HORDE);
|
||||
if (!sg || !AddSpiritGuide(EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundEY: Failed to spawn spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
sLog.outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
|
||||
sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID()));
|
||||
|
||||
SetDroppedFlagGUID(0);
|
||||
}
|
||||
@@ -741,7 +741,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
|
||||
WorldSafeLocsEntry const *sg = NULL;
|
||||
sg = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[Point].GraveYardId);
|
||||
if (!sg || !AddSpiritGuide(Point, sg->x, sg->y, sg->z, 3.124139f, Team))
|
||||
sLog.outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
|
||||
sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u",
|
||||
Point, Team, m_CapturingPointTypes[Point].GraveYardId);
|
||||
|
||||
// SpawnBGCreature(Point,RESPAWN_IMMEDIATELY);
|
||||
@@ -893,7 +893,7 @@ WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player)
|
||||
|
||||
if (!entry)
|
||||
{
|
||||
sLog.outError("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
|
||||
sLog->outError("BattlegroundEY: Not found the main team graveyard. Graveyard system isn't working!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -910,7 +910,7 @@ WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId);
|
||||
if (!entry)
|
||||
sLog.outError("BattlegroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
|
||||
sLog->outError("BattlegroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId);
|
||||
else
|
||||
{
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
|
||||
@@ -100,7 +100,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattlegroundNA: Killer player not found");
|
||||
sLog->outError("BattlegroundNA: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ void BattlegroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 4537: // buff trigger?
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ bool BattlegroundNA::SetupBattleground()
|
||||
|| !AddObject(BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|
||||
|| !AddObject(BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_TYPE_BUFF_2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundNA: Failed to spawn some object!");
|
||||
sLog->outErrorDb("BatteGroundNA: Failed to spawn some object!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("Killer player not found");
|
||||
sLog->outError("Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void BattlegroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 4697: // buff trigger?
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ bool BattlegroundRL::SetupBattleground()
|
||||
|| !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
|
||||
|| !AddObject(BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_TYPE_BUFF_2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundRL: Failed to spawn some object!");
|
||||
sLog->outErrorDb("BatteGroundRL: Failed to spawn some object!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void BattlegroundRV::HandleKillPlayer(Player *player, Player *killer)
|
||||
|
||||
if (!killer)
|
||||
{
|
||||
sLog.outError("BattlegroundRV: Killer player not found");
|
||||
sLog->outError("BattlegroundRV: Killer player not found");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void BattlegroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 5226:
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ bool BattlegroundRV::SetupBattleground()
|
||||
*/
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundRV: Failed to spawn some object!");
|
||||
sLog->outErrorDb("BatteGroundRV: Failed to spawn some object!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -158,7 +158,7 @@ bool BattlegroundSA::ResetObjs()
|
||||
|
||||
if (!sg)
|
||||
{
|
||||
sLog.outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]);
|
||||
sLog->outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ bool BattlegroundSA::ResetObjs()
|
||||
{
|
||||
GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE);
|
||||
if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((Attackers == TEAM_HORDE)? ALLIANCE : HORDE)))
|
||||
sLog.outError("SOTA: couldn't spawn GY: %u",i);
|
||||
sLog->outError("SOTA: couldn't spawn GY: %u",i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -217,12 +217,12 @@ void BattlegroundWS::RespawnFlag(uint32 Team, bool captured)
|
||||
{
|
||||
if (Team == ALLIANCE)
|
||||
{
|
||||
sLog.outDebug("Respawn Alliance flag");
|
||||
sLog->outDebug("Respawn Alliance flag");
|
||||
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog.outDebug("Respawn Horde flag");
|
||||
sLog->outDebug("Respawn Horde flag");
|
||||
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team)
|
||||
if (obj)
|
||||
obj->Delete();
|
||||
else
|
||||
sLog.outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team)));
|
||||
sLog->outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team)));
|
||||
|
||||
SetDroppedFlagGUID(0,team);
|
||||
m_BothFlagsKept = false;
|
||||
@@ -566,7 +566,7 @@ void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
this->SetAllianceFlagPicker(0);
|
||||
this->RespawnFlag(ALLIANCE, false);
|
||||
}
|
||||
@@ -577,7 +577,7 @@ void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid)
|
||||
{
|
||||
if (!plr)
|
||||
{
|
||||
sLog.outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
sLog->outError("BattlegroundWS: Removing offline player who has the FLAG!!");
|
||||
this->SetHordeFlagPicker(0);
|
||||
this->RespawnFlag(HORDE, false);
|
||||
}
|
||||
@@ -646,7 +646,7 @@ void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
case 4629: // unk4
|
||||
break;
|
||||
default:
|
||||
sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
sLog->outError("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger);
|
||||
break;
|
||||
}
|
||||
@@ -681,25 +681,25 @@ bool BattlegroundWS::SetupBattleground()
|
||||
|| !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
|
||||
)
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundWS: Failed to spawn some object Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldSafeLocsEntry const *sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_ALLIANCE);
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, ALLIANCE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sg = sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
|
||||
if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, HORDE))
|
||||
{
|
||||
sLog.outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
|
||||
sLog->outErrorDb("BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
|
||||
return false;
|
||||
}
|
||||
|
||||
sLog.outDebug("BatteGroundWS: BG objects and spirit guides spawned");
|
||||
sLog->outDebug("BatteGroundWS: BG objects and spirit guides spawned");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user