mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-03 19:13:49 +00:00
feat(Core/Logging): rework logging (#4692)
* feat(Core/Logging): rework logging * correct level for sql.sql * del unused config options * Correct build * correct after merge * whitespace 20:29:37 1. 'Player.cpp'. Replace (1) 20:29:37 2. 'ObjectMgr.cpp'. Replace (3) * 1 * correct logging * correct affter merge * 1 * 2 * LOG_LEVEL_WARN * #include "AppenderDB.h" * 3 * 4 * 5 * 1. 'WorldSocket.cpp'. Replace (1) * 6 * 1
This commit is contained in:
@@ -60,7 +60,7 @@ void BattlegroundAV::HandleKillPlayer(Player* player, Player* killer)
|
||||
void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry());
|
||||
LOG_DEBUG("bg.battleground", "bg_av HandleKillUnit %i", unit->GetEntry());
|
||||
#endif
|
||||
if (GetStatus() != STATUS_IN_PROGRESS)
|
||||
return;
|
||||
@@ -96,7 +96,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\"");
|
||||
LOG_ERROR("server", "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
return;
|
||||
}
|
||||
m_CaptainAlive[0] = false;
|
||||
@@ -115,7 +115,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\"");
|
||||
LOG_ERROR("server", "Killed a Captain twice, please report this bug, if you haven't done \".respawn\"");
|
||||
return;
|
||||
}
|
||||
m_CaptainAlive[1] = false;
|
||||
@@ -143,7 +143,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
TeamId teamId = player->GetTeamId();
|
||||
//TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed", questid);
|
||||
#endif
|
||||
switch (questid)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
if (m_Team_QuestStatus[teamId][0] == 500 || m_Team_QuestStatus[teamId][0] == 1000 || m_Team_QuestStatus[teamId][0] == 1500) //25, 50, 75 turn ins
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed starting with unit upgrading..", questid);
|
||||
#endif
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i)
|
||||
if (m_Nodes[i].OwnerId == player->GetTeamId() && m_Nodes[i].State == POINT_CONTROLED)
|
||||
@@ -172,7 +172,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (m_Team_QuestStatus[teamId][1] == 30)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
#endif
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER2:
|
||||
@@ -181,7 +181,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (m_Team_QuestStatus[teamId][2] == 60)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
#endif
|
||||
break;
|
||||
case AV_QUEST_A_COMMANDER3:
|
||||
@@ -190,7 +190,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
RewardReputationToTeam(teamId, 1, teamId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (m_Team_QuestStatus[teamId][3] == 120)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
#endif
|
||||
break;
|
||||
case AV_QUEST_A_BOSS1:
|
||||
@@ -202,7 +202,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
m_Team_QuestStatus[teamId][4]++;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
if (m_Team_QuestStatus[teamId][4] >= 200)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
#endif
|
||||
break;
|
||||
case AV_QUEST_A_NEAR_MINE:
|
||||
@@ -211,10 +211,10 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
if (m_Team_QuestStatus[teamId][5] == 28)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
|
||||
if (m_Team_QuestStatus[teamId][6] == 7)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -224,10 +224,10 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
if (m_Team_QuestStatus[teamId][6] == 7)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
|
||||
if (m_Team_QuestStatus[teamId][5] == 20)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -237,10 +237,10 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
if (m_Team_QuestStatus[teamId][7] == 25)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
|
||||
if (m_Team_QuestStatus[teamId][8] == 25)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
@@ -250,16 +250,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
|
||||
if (m_Team_QuestStatus[teamId][8] == 25)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here", questid);
|
||||
|
||||
if (m_Team_QuestStatus[teamId][7] == 25)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid);
|
||||
LOG_DEBUG("bg.battleground", "BG_AV Quest %i completed but is not interesting at all", questid);
|
||||
#endif
|
||||
return; //was no interesting quest at all
|
||||
break;
|
||||
@@ -449,7 +449,7 @@ void BattlegroundAV::StartingEventCloseDoors()
|
||||
void BattlegroundAV::StartingEventOpenDoors()
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff");
|
||||
LOG_DEBUG("bg.battleground", "BG_AV: start spawning mine stuff");
|
||||
#endif
|
||||
for (uint16 i = BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
@@ -600,7 +600,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
{
|
||||
uint32 object = GetObjectThroughNode(node);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object);
|
||||
LOG_DEBUG("bg.battleground", "bg_av: player destroyed point node %i object %i", node, object);
|
||||
#endif
|
||||
|
||||
//despawn banner
|
||||
@@ -616,7 +616,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
if (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);
|
||||
LOG_ERROR("server", "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);
|
||||
@@ -675,7 +675,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
||||
if (!initial)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine);
|
||||
LOG_DEBUG("bg.battleground", "bg_av depopulating mine %i (0=north, 1=south)", mine);
|
||||
#endif
|
||||
if (mine == AV_SOUTH_MINE)
|
||||
for (uint16 i = AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
@@ -688,7 +688,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
||||
SendMineWorldStates(mine);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine);
|
||||
LOG_DEBUG("bg.battleground", "bg_av populating mine %i (0=north, 1=south)", mine);
|
||||
#endif
|
||||
uint16 miner;
|
||||
//also neutral team exists.. after a big time, the neutral team tries to conquer the mine
|
||||
@@ -712,7 +712,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial)
|
||||
miner = AV_NPC_S_MINE_N_1;
|
||||
//vermin
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin");
|
||||
LOG_DEBUG("bg.battleground", "spawning vermin");
|
||||
#endif
|
||||
if (teamId == TEAM_ALLIANCE)
|
||||
cinfo = AV_NPC_S_MINE_A_3;
|
||||
@@ -781,7 +781,7 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
if (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], ownerId))
|
||||
sLog->outError("AV: couldn't spawn spiritguide at node %i", node);
|
||||
LOG_ERROR("server", "AV: couldn't spawn spiritguide at node %i", node);
|
||||
}
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
AddAVCreature(creatureid, c_place + i);
|
||||
@@ -831,7 +831,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object);
|
||||
LOG_DEBUG("bg.battleground", "bg_AV getnodethroughobject %i", object);
|
||||
#endif
|
||||
if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER)
|
||||
return BG_AV_Nodes(object);
|
||||
@@ -847,7 +847,7 @@ 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 :(");
|
||||
LOG_ERROR("server", "BattlegroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
ABORT();
|
||||
return BG_AV_Nodes(0);
|
||||
}
|
||||
@@ -856,7 +856,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
{
|
||||
//this function is the counterpart to GetNodeThroughObject()
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node);
|
||||
LOG_DEBUG("bg.battleground", "bg_AV GetObjectThroughNode %i", node);
|
||||
#endif
|
||||
if (m_Nodes[node].OwnerId == TEAM_ALLIANCE)
|
||||
{
|
||||
@@ -888,7 +888,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
}
|
||||
else if (m_Nodes[node].OwnerId == TEAM_NEUTRAL)
|
||||
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
|
||||
sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
|
||||
LOG_ERROR("server", "BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
|
||||
ABORT();
|
||||
return 0;
|
||||
}
|
||||
@@ -940,11 +940,11 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
return;
|
||||
}
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node);
|
||||
LOG_DEBUG("bg.battleground", "player defends point object: %i node: %i", object, node);
|
||||
#endif
|
||||
if (m_Nodes[node].PrevOwnerId != teamId)
|
||||
{
|
||||
sLog->outError("BG_AV: player defends point which doesn't belong to his team %i", node);
|
||||
LOG_ERROR("server", "BG_AV: player defends point which doesn't belong to his team %i", node);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
TeamId prevOwnerId = m_Nodes[node].OwnerId;
|
||||
TeamId teamId = player->GetTeamId();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node);
|
||||
LOG_DEBUG("bg.battleground", "bg_av: player assaults point object %i node %i", object, node);
|
||||
#endif
|
||||
if (prevOwnerId == teamId || teamId == m_Nodes[node].TotalOwnerId)
|
||||
return; //surely a gm used this object
|
||||
@@ -1157,7 +1157,7 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, TeamId teamId) //this is us
|
||||
if (state == POINT_ASSAULTED)
|
||||
return 3;
|
||||
}
|
||||
sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i", state, teamId);
|
||||
LOG_ERROR("server", "BG_AV: should update a strange worldstate state:%i team:%i", state, teamId);
|
||||
return 5; //this will crash the game, but i want to know if something is wrong here
|
||||
}
|
||||
|
||||
@@ -1234,7 +1234,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");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!2");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1249,7 +1249,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");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!3");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1262,7 +1262,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");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!4");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1270,7 +1270,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);
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1284,7 +1284,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);
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1292,7 +1292,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);
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1302,7 +1302,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);
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1310,14 +1310,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);
|
||||
LOG_ERROR("server", "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");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
return false;
|
||||
}
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
@@ -1327,7 +1327,7 @@ 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);
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1343,18 +1343,18 @@ bool BattlegroundAV::SetupBattleground()
|
||||
// Quest banners
|
||||
if (!AddObject(BG_AV_OBJECT_FROSTWOLF_BANNER, BG_AV_OBJECTID_FROSTWOLF_BANNER, BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_FROSTWOLF_BANNER][3] / 2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
return false;
|
||||
}
|
||||
if (!AddObject(BG_AV_OBJECT_STORMPIKE_BANNER, BG_AV_OBJECTID_STORMPIKE_BANNER, BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][0], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][1], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][2], BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), cos(BG_AV_ObjectPos[AV_OPLACE_STORMPIKE_BANNER][3] / 2), RESPAWN_ONE_DAY))
|
||||
{
|
||||
sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
LOG_ERROR("server", "BatteGroundAV: Failed to spawn some object Battleground not created!8");
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16 i;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ...");
|
||||
LOG_DEBUG("bg.battleground", "Alterac Valley: entering state STATUS_WAIT_JOIN ...");
|
||||
#endif
|
||||
// Initial Nodes
|
||||
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
|
||||
@@ -1403,7 +1403,7 @@ bool BattlegroundAV::SetupBattleground()
|
||||
|
||||
//creatures
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes");
|
||||
LOG_DEBUG("bg.battleground", "BG_AV start poputlating nodes");
|
||||
#endif
|
||||
for (i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
{
|
||||
@@ -1412,19 +1412,19 @@ bool BattlegroundAV::SetupBattleground()
|
||||
}
|
||||
//all creatures which don't get despawned through the script are static
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures");
|
||||
LOG_DEBUG("bg.battleground", "BG_AV: start spawning static creatures");
|
||||
#endif
|
||||
for (i = 0; i < AV_STATICCPLACE_MAX; i++)
|
||||
AddAVCreature(0, i + AV_CPLACE_MAX);
|
||||
//mainspiritguides:
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures");
|
||||
LOG_DEBUG("bg.battleground", "BG_AV: start spawning spiritguides creatures");
|
||||
#endif
|
||||
AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], TEAM_ALLIANCE);
|
||||
AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], TEAM_HORDE);
|
||||
//spawn the marshals (those who get deleted, if a tower gets destroyed)
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures");
|
||||
LOG_DEBUG("bg.battleground", "BG_AV: start spawning marshal creatures");
|
||||
#endif
|
||||
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));
|
||||
@@ -1436,7 +1436,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");
|
||||
LOG_ERROR("sql.sql", "BatteGroundAV: Failed to spawn some object Battleground not created!1");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1478,7 +1478,7 @@ char const* BattlegroundAV::GetNodeName(BG_AV_Nodes node)
|
||||
case BG_AV_NODES_FROSTWOLF_HUT:
|
||||
return GetAcoreString(LANG_BG_AV_NODE_GRAVE_FROST_HUT);
|
||||
default:
|
||||
sLog->outError("tried to get name for node %u", node);
|
||||
LOG_ERROR("server", "tried to get name for node %u", node);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1489,22 +1489,22 @@ void BattlegroundAV::AssaultNode(BG_AV_Nodes node, TeamId teamId)
|
||||
{
|
||||
if (m_Nodes[node].TotalOwnerId == teamId)
|
||||
{
|
||||
sLog->outCrash("Assaulting team is TotalOwner of node");
|
||||
LOG_FATAL("server", "Assaulting team is TotalOwner of node");
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].OwnerId == teamId)
|
||||
{
|
||||
sLog->outCrash("Assaulting team is owner of node");
|
||||
LOG_FATAL("server", "Assaulting team is owner of node");
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_DESTROYED)
|
||||
{
|
||||
sLog->outCrash("Destroyed node is being assaulted");
|
||||
LOG_FATAL("server", "Destroyed node is being assaulted");
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwnerId != TEAM_NEUTRAL) //only assault an assaulted node if no totalowner exists
|
||||
{
|
||||
sLog->outCrash("Assault on an not assaulted node with total owner");
|
||||
LOG_FATAL("server", "Assault on an not assaulted node with total owner");
|
||||
ABORT();
|
||||
}
|
||||
//the timer gets another time, if the previous owner was 0 == Neutral
|
||||
|
||||
Reference in New Issue
Block a user