Cleanup of logging - removed a few duplicit functions from olden times, fixed a typo.

--HG--
branch : trunk
This commit is contained in:
Xanadu
2010-06-22 02:53:04 +02:00
parent 06ef6e2553
commit c9b20170a3
55 changed files with 216 additions and 296 deletions
@@ -214,7 +214,7 @@ struct npc_grimstoneAI : public npc_escortAI
if (pInstance)
{
pInstance->SetData(TYPE_RING_OF_LAW,DONE);
debug_log("TSCR: npc_grimstone: event reached end and set complete.");
sLog.outDebug("TSCR: npc_grimstone: event reached end and set complete.");
}
break;
}
@@ -207,7 +207,7 @@ struct instance_blackrock_depths : public ScriptedInstance
void SetData64(uint32 type, uint64 data)
{
debug_log("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data);
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data);
switch(type)
{
@@ -223,7 +223,7 @@ struct instance_blackrock_depths : public ScriptedInstance
void SetData(uint32 type, uint32 data)
{
debug_log("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
sLog.outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data);
switch(type)
{
@@ -312,7 +312,7 @@ struct boss_victor_nefariusAI : public ScriptedAI
Nefarian->setFaction(103);
NefarianGUID = Nefarian->GetGUID();
}
else error_log("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
else sLog.outError("TSCR: Blackwing Lair: Unable to spawn nefarian properly.");
}
AddSpawnTimer = 4000;
@@ -534,7 +534,7 @@ CreatureAI* GetAI_water_elemental(Creature* pCreature)
// CONVERT TO ACID
CreatureAI* GetAI_shadow_of_aran(Creature* pCreature)
{
outstring_log("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
sLog.outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry());
SimpleAI* ai = new SimpleAI (pCreature);
ai->Spell[0].Enabled = true;
@@ -1154,7 +1154,7 @@ void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage)
if (Phase == PHASE_ROMULO)
{
error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
sLog.outError("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?");
damage = 0;
return;
}
@@ -1188,7 +1188,7 @@ void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage)
return;
}
}
error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen.");
sLog.outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen.");
}
void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage)
@@ -1242,7 +1242,7 @@ void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage)
}
}
error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
sLog.outError("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen.");
}
void boss_julianneAI::UpdateAI(const uint32 diff)
@@ -220,7 +220,7 @@ struct npc_barnesAI : public npc_escortAI
void PrepareEncounter()
{
debug_log("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
sLog.outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId);
uint8 index = 0;
uint8 count = 0;
@@ -371,17 +371,17 @@ bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 /*uiSe
case GOSSIP_ACTION_INFO_DEF+3:
pPlayer->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_OZ;
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID());
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
pPlayer->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_HOOD;
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID());
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
pPlayer->CLOSE_GOSSIP_MENU();
pBarnesAI->m_uiEventId = EVENT_RAJ;
outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID());
sLog.outString("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID());
break;
}
@@ -48,6 +48,6 @@ enum OperaEvents
EVENT_RAJ = 3
};
#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
#define ERROR_INST_DATA(a) sLog.outError("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry());
#endif
@@ -63,7 +63,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
for (uint8 i = 0; i < size; ++i)
{
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
debug_log("TSCR: Selin: Adding Fel Crystal %u to list", guid);
sLog.outDebug("TSCR: Selin: Adding Fel Crystal %u to list", guid);
Crystals.push_back(guid);
}
}
@@ -108,7 +108,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
// Small door opened after event are expected to be closed by default
// Set Inst data for encounter
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
} else error_log(ERROR_INST_DATA);
} else sLog.outError(ERROR_INST_DATA);
DrainLifeTimer = 3000 + rand()%4000;
DrainManaTimer = DrainLifeTimer + 5000;
@@ -208,7 +208,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
else
{
// Make an error message in case something weird happened here
error_log("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
sLog.outError("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned");
DrainingCrystal = false;
}
}
@@ -340,7 +340,7 @@ struct mob_fel_crystalAI : public ScriptedAI
}
}
}
} else error_log(ERROR_INST_DATA);
} else sLog.outError(ERROR_INST_DATA);
}
};
@@ -169,7 +169,7 @@ struct instance_magisters_terrace : public ScriptedInstance
{
if (FelCrystals.empty())
{
error_log("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
sLog.outError("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data");
return 0;
}
@@ -199,7 +199,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
anchorGUID = anchor->GetGUID();
}
else
error_log("npc_unworthy_initiateAI: unable to find anchor!");
sLog.outError("npc_unworthy_initiateAI: unable to find anchor!");
float dist = 99.0f;
GameObject *prison = NULL;
@@ -219,7 +219,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
if (prison)
prison->ResetDoorOrButton();
else
error_log("npc_unworthy_initiateAI: unable to find prison!");
sLog.outError("npc_unworthy_initiateAI: unable to find prison!");
}
return;
case PHASE_TO_EQUIP:
@@ -230,7 +230,7 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff)
else
{
me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ());
//debug_log("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ());
//sLog.outDebug("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ());
phase = PHASE_EQUIPING;
wait_timer = 0;
}
@@ -989,9 +989,9 @@ bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* /*pGO*/)
{
car->AI()->SetGUID(miner->GetGUID());
CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer);
} else error_log("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct.");
} else error_log("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle.");
} else error_log("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script.");
} else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct.");
} else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle.");
} else sLog.outError("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script.");
}
return true;
}
@@ -112,7 +112,7 @@ struct instance_stratholme : public ScriptedInstance
return true;
}
debug_log("TSCR: Instance Stratholme: Cannot open slaugther square yet.");
sLog.outDebug("TSCR: Instance Stratholme: Cannot open slaugther square yet.");
return false;
}
@@ -208,7 +208,7 @@ struct instance_stratholme : public ScriptedInstance
break;
Encounter[0] = data;
BaronRun_Timer = 2700000;
debug_log("TSCR: Instance Stratholme: Baron run in progress.");
sLog.outDebug("TSCR: Instance Stratholme: Baron run in progress.");
break;
case FAIL:
//may add code to remove aura from players, but in theory the time should be up already and removed.
@@ -266,10 +266,10 @@ struct instance_stratholme : public ScriptedInstance
//UpdateGoState(ziggurat4GUID,0,true);
if (Creature* pBaron = instance->GetCreature(baronGUID))
pBaron->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000);
debug_log("TSCR: Instance Stratholme: Ramstein spawned.");
sLog.outDebug("TSCR: Instance Stratholme: Ramstein spawned.");
}
else
debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count);
sLog.outDebug("TSCR: Instance Stratholme: %u Abomnation left to kill.",count);
}
if (data == NOT_STARTED)
@@ -278,7 +278,7 @@ struct instance_stratholme : public ScriptedInstance
if (data == DONE)
{
SlaugtherSquare_Timer = 300000;
debug_log("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes.");
sLog.outDebug("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes.");
}
Encounter[4] = data;
break;
@@ -419,7 +419,7 @@ struct instance_stratholme : public ScriptedInstance
if (GetData(TYPE_BARON_RUN) != DONE)
SetData(TYPE_BARON_RUN, FAIL);
BaronRun_Timer = 0;
debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN));
sLog.outDebug("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN));
} else BaronRun_Timer -= diff;
}
@@ -434,7 +434,7 @@ struct instance_stratholme : public ScriptedInstance
HandleGameObject(ziggurat4GUID, true);
HandleGameObject(ziggurat5GUID, true);
debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
sLog.outDebug("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
}
SlaugtherSquare_Timer = 0;
} else SlaugtherSquare_Timer -= diff;
@@ -143,7 +143,7 @@ struct boss_brutallusAI : public ScriptedAI
{
if (!Intro || IsIntro)
return;
error_log("Start Intro");
sLog.outError("Start Intro");
Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0);
if (Madrigosa)
{
@@ -158,7 +158,7 @@ struct boss_brutallusAI : public ScriptedAI
}else
{
//Madrigosa not found, end intro
error_log("Madrigosa was not found");
sLog.outError("Madrigosa was not found");
EndIntro();
}
}
@@ -168,7 +168,7 @@ struct boss_brutallusAI : public ScriptedAI
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
Intro = false;
IsIntro = false;
error_log("End Intro");
sLog.outError("End Intro");
}
void AttackStart(Unit* pWho)
@@ -260,7 +260,7 @@ struct boss_kalecgosAI : public ScriptedAI
}
else
{
error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted.");
sLog.outError("TSCR: Didn't find Shathrowar. Kalecgos event reseted.");
EnterEvadeMode();
return;
}
@@ -727,7 +727,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI
if (pRandomPlayer)
DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false);
else
error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target");
sLog.outError("try to cast SPELL_LEGION_LIGHTNING on invalid target");
Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
Timer[TIMER_SOUL_FLAY] = 2500;
@@ -1341,7 +1341,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI
DoMeleeAttackIfReady();
break;
}
debug_log("Sinister-Timer");
sLog.outDebug("Sinister-Timer");
for (uint8 i = 0; i < 3; ++i)
uiTimer[i] -= diff;
}
@@ -110,7 +110,7 @@ struct instance_sunwell_plateau : public ScriptedInstance
}
}
debug_log("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
sLog.outDebug("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -436,7 +436,7 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/)
//if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE)
//{
//error_log("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter);
//sLog.outError("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter);
// return false; // not enough people yet
//}
/*
@@ -446,7 +446,7 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/)
for (uint8 x = 0; x < 5; ++x)
{
pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]);
//error_log("number of people currently activating it: %d", x+1);
//sLog.outError("number of people currently activating it: %d", x+1);
if (!pTarget)
continue;
if (pTarget->IsNonMeleeSpellCasted(true))
@@ -457,11 +457,11 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/)
if (count < NUMBER_NEEDED_TO_ACTIVATE)
{
//error_log("still not enough people");
//sLog.outError("still not enough people");
return true; // not enough people
}
*/
//error_log ("activating stone keepers");
//sLog.outError ("activating stone keepers");
pInstance->SetData(NULL,1); // activate the Stone Keepers
return true;
}
@@ -215,7 +215,7 @@ struct instance_uldaman : public ScriptedInstance
void SetData (uint32 /*type*/, uint32 data)
{
//error_log ("SetData: data = %d", data);
//sLog.outError ("SetData: data = %d", data);
if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor);
if (data == 0) OpenDoor (archaedasTempleDoor);
if (data == 3) OpenDoor (ancientVaultDoor);
@@ -242,7 +242,7 @@ struct boss_janalaiAI : public ScriptedAI
cell.Visit(pair, cSearcher, *(me->GetMap()));
}
//error_log("Eggs %d at middle", templist.size());
//sLog.outError("Eggs %d at middle", templist.size());
if (!templist.size())
return false;
@@ -508,7 +508,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI
cell.Visit(pair, cSearcher, *(me->GetMap()));
}
//error_log("Eggs %d at %d", templist.size(), side);
//sLog.outError("Eggs %d at %d", templist.size(), side);
for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i)
if ((*i)->GetDisplayId() != 11686)
@@ -172,7 +172,7 @@ struct instance_zulaman : public ScriptedInstance
ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute;
char* data = new char[ss.str().length()+1];
strcpy(data, ss.str().c_str());
//error_log("TSCR: Zul'aman saved, %s.", data);
//sLog.outError("TSCR: Zul'aman saved, %s.", data);
return data;
}
@@ -180,17 +180,17 @@ struct instance_zulaman : public ScriptedInstance
{
if (!load) return;
std::istringstream ss(load);
//error_log("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
//sLog.outError("TSCR: Zul'aman loaded, %s.", ss.str().c_str());
char dataHead; // S
uint16 data1, data2, data3;
ss >> dataHead >> data1 >> data2 >> data3;
//error_log("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3);
//sLog.outError("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3);
if (dataHead == 'S')
{
BossKilled = data1;
ChestLooted = data2;
QuestMinute = data3;
} else error_log("TSCR: Zul'aman: corrupted save data.");
} else sLog.outError("TSCR: Zul'aman: corrupted save data.");
}
void SetData(uint32 type, uint32 data)
@@ -170,7 +170,7 @@ struct boss_arlokkAI : public ScriptedAI
MarkedTargetGUID = pMarkedTarget->GetGUID();
}
else
error_log("TSCR: boss_arlokk could not accuire pMarkedTarget.");
sLog.outError("TSCR: boss_arlokk could not accuire pMarkedTarget.");
m_uiMark_Timer = 15000;
}