REPO: Code-style clean-ups
* Fixed pMap->map * Fixed pInstance->instance * Fixed pInsta->instance * Fixed pQuest->quest * Fixed pWho->who * Fixed pTarget->target * Fixed pGo->go ~DEVNOTES: Handlers/QuestHandler.cpp still needs to be cleaned...
This commit is contained in:
@@ -91,10 +91,10 @@ public:
|
||||
{
|
||||
boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 FireballTimer;
|
||||
uint32 PhoenixTimer;
|
||||
@@ -138,10 +138,10 @@ public:
|
||||
|
||||
Phase = 0;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true);
|
||||
instance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
}
|
||||
@@ -151,10 +151,10 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), true);
|
||||
// Open the encounter door
|
||||
}
|
||||
|
||||
@@ -166,10 +166,10 @@ public:
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), false);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
@@ -361,10 +361,10 @@ public:
|
||||
DoScriptText(SAY_GRAVITY_LAPSE, me);
|
||||
FirstGravityLapse = false;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_LEFT), true);
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_RIGHT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_STATUE_LEFT), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_KAEL_STATUE_RIGHT), true);
|
||||
}
|
||||
}else
|
||||
{
|
||||
@@ -485,10 +485,10 @@ public:
|
||||
{
|
||||
mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
uint32 BurnTimer;
|
||||
uint32 Death_Timer;
|
||||
bool Rebirth;
|
||||
@@ -520,7 +520,7 @@ public:
|
||||
|
||||
}
|
||||
//Don't really die in all phases of Kael'Thas
|
||||
if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
if (instance && instance->GetData(DATA_KAELTHAS_EVENT) == 0)
|
||||
{
|
||||
//prevent death
|
||||
damage = 0;
|
||||
|
||||
@@ -101,12 +101,12 @@ public:
|
||||
{
|
||||
boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID));
|
||||
LackeyEntryList.clear();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
std::vector<uint32> LackeyEntryList;
|
||||
uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY];
|
||||
@@ -137,8 +137,8 @@ public:
|
||||
//this mean she at some point evaded
|
||||
void JustReachedHome()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, FAIL);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void InitializeLackeys()
|
||||
@@ -224,11 +224,11 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
if (instance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY)
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
else
|
||||
{
|
||||
if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
|
||||
@@ -342,12 +342,12 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
{
|
||||
boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs));
|
||||
AcquireGUIDs();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY];
|
||||
uint32 ResetThreatTimer;
|
||||
@@ -365,7 +365,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
ResetThreatTimer = urand(5000, 20000);
|
||||
|
||||
// in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her)
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_DELRISSA) : 0))
|
||||
{
|
||||
if (!pDelrissa->isAlive())
|
||||
pDelrissa->Respawn();
|
||||
@@ -377,7 +377,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
{
|
||||
@@ -391,7 +391,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
|
||||
if (Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
{
|
||||
if (pDelrissa->isAlive() && !pDelrissa->getVictim())
|
||||
{
|
||||
@@ -404,11 +404,11 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA));
|
||||
uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT);
|
||||
Creature* pDelrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA));
|
||||
uint32 uiLackeyDeathCount = instance->GetData(DATA_DELRISSA_DEATH_COUNT);
|
||||
|
||||
if (!pDelrissa)
|
||||
return;
|
||||
@@ -416,7 +416,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
//should delrissa really yell if dead?
|
||||
DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa);
|
||||
|
||||
pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL);
|
||||
instance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL);
|
||||
|
||||
//increase local var, since we now may have four dead
|
||||
++uiLackeyDeathCount;
|
||||
@@ -429,26 +429,26 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
if (!pDelrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
|
||||
pDelrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
|
||||
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
instance->SetData(DATA_DELRISSA_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
|
||||
if (Creature* Delrissa = Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA)))
|
||||
Delrissa->AI()->KilledUnit(victim);
|
||||
}
|
||||
|
||||
void AcquireGUIDs()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))))
|
||||
if (Creature* Delrissa = (Unit::GetCreature(*me, instance->GetData64(DATA_DELRISSA))))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
|
||||
m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissa::boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i];
|
||||
@@ -1055,14 +1055,14 @@ public:
|
||||
if (Freezing_Trap_Timer <= diff)
|
||||
{
|
||||
//attempt find go summoned from spell (casted by me)
|
||||
GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP);
|
||||
GameObject* go = me->GetGameObject(SPELL_FREEZING_TRAP);
|
||||
|
||||
//if we have a pGo, we need to wait (only one trap at a time)
|
||||
if (pGo)
|
||||
//if we have a go, we need to wait (only one trap at a time)
|
||||
if (go)
|
||||
Freezing_Trap_Timer = 2500;
|
||||
else
|
||||
{
|
||||
//if pGo does not exist, then we can cast
|
||||
//if go does not exist, then we can cast
|
||||
DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
|
||||
Freezing_Trap_Timer = 15000;
|
||||
}
|
||||
|
||||
@@ -65,23 +65,23 @@ public:
|
||||
{
|
||||
boss_selin_fireheartAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
|
||||
Crystals.clear();
|
||||
//GUIDs per instance is static, so we only need to load them once.
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
uint32 size = instance->GetData(DATA_FEL_CRYSTAL_SIZE);
|
||||
for (uint8 i = 0; i < size; ++i)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL);
|
||||
uint64 guid = instance->GetData64(DATA_FEL_CRYSTAL);
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid);
|
||||
Crystals.push_back(guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
std::list<uint64> Crystals;
|
||||
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
@@ -115,11 +115,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true);
|
||||
// Open the big encounter door. Close it in Aggro and open it only in JustDied(and here)
|
||||
// Small door opened after event are expected to be closed by default
|
||||
// Set Inst data for encounter
|
||||
pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
instance->SetData(DATA_SELIN_EVENT, NOT_STARTED);
|
||||
} else sLog->outError(ERROR_INST_DATA);
|
||||
|
||||
DrainLifeTimer = 3000 + rand()%4000;
|
||||
@@ -196,8 +196,8 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
if (instance)
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
|
||||
//Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
|
||||
@@ -232,12 +232,12 @@ public:
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
instance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete!
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door
|
||||
instance->HandleGameObject(instance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in
|
||||
ShatterRemainingCrystals();
|
||||
}
|
||||
|
||||
@@ -343,9 +343,9 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
{
|
||||
Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
|
||||
Creature* Selin = (Unit::GetCreature(*me, instance->GetData64(DATA_SELIN)));
|
||||
if (Selin && Selin->isAlive())
|
||||
{
|
||||
if (CAST_AI(boss_selin_fireheart::boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
|
||||
|
||||
@@ -73,10 +73,10 @@ public:
|
||||
{
|
||||
boss_vexallusAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 ArcaneShockTimer;
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
IntervalHealthAmount = 1;
|
||||
Enraged = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
@@ -103,16 +103,16 @@ public:
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
if (instance)
|
||||
instance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
|
||||
@@ -40,14 +40,14 @@ class instance_magisters_terrace : public InstanceMapScript
|
||||
public:
|
||||
instance_magisters_terrace() : InstanceMapScript("instance_magisters_terrace", 585) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_magisters_terrace_InstanceMapScript(pMap);
|
||||
return new instance_magisters_terrace_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_magisters_terrace_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_magisters_terrace_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_magisters_terrace_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint32 DelrissaDeathCount;
|
||||
|
||||
@@ -128,12 +128,12 @@ public:
|
||||
// some targeting issues with the spell, so use this workaround as temporary solution
|
||||
void DoWorkaroundForQuestCredit()
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
Map* map = me->GetMap();
|
||||
|
||||
if (!pMap || pMap->IsHeroic())
|
||||
if (!map || map->IsHeroic())
|
||||
return;
|
||||
|
||||
Map::PlayerList const &lList = pMap->GetPlayers();
|
||||
Map::PlayerList const &lList = map->GetPlayers();
|
||||
|
||||
if (lList.isEmpty())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user