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:
@@ -51,10 +51,10 @@ public:
|
||||
{
|
||||
boss_kriAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Cleave_Timer;
|
||||
uint32 ToxicVolley_Timer;
|
||||
@@ -79,13 +79,13 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
|
||||
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
}
|
||||
void UpdateAI(const uint32 diff)
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
//Checking if Vem is dead. If yes we will enrage.
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_VEMISDEAD))
|
||||
if (instance && instance->GetData(DATA_VEMISDEAD))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
VemDead = true;
|
||||
@@ -148,10 +148,10 @@ public:
|
||||
{
|
||||
boss_vemAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Charge_Timer;
|
||||
uint32 KnockBack_Timer;
|
||||
@@ -170,13 +170,13 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
pInstance->SetData(DATA_VEM_DEATH, 0);
|
||||
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
instance->SetData(DATA_VEM_DEATH, 0);
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,10 +241,10 @@ public:
|
||||
{
|
||||
boss_yaujAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Heal_Timer;
|
||||
uint32 Fear_Timer;
|
||||
@@ -263,12 +263,12 @@ public:
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)
|
||||
// Unlootable if death
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
@@ -301,10 +301,10 @@ public:
|
||||
//Casting Heal to other twins or herself.
|
||||
if (Heal_Timer <= diff)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
Unit* pKri = Unit::GetUnit((*me), pInstance->GetData64(DATA_KRI));
|
||||
Unit* pVem = Unit::GetUnit((*me), pInstance->GetData64(DATA_VEM));
|
||||
Unit* pKri = Unit::GetUnit((*me), instance->GetData64(DATA_KRI));
|
||||
Unit* pVem = Unit::GetUnit((*me), instance->GetData64(DATA_VEM));
|
||||
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
@@ -330,9 +330,9 @@ public:
|
||||
{
|
||||
if (!VemDead)
|
||||
{
|
||||
if (pInstance)
|
||||
if (instance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_VEMISDEAD))
|
||||
if (instance->GetData(DATA_VEMISDEAD))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
VemDead = true;
|
||||
|
||||
@@ -178,12 +178,12 @@ public:
|
||||
{
|
||||
eye_of_cthunAI(Creature* c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInst = c->GetInstanceScript();
|
||||
if (!pInst)
|
||||
instance = c->GetInstanceScript();
|
||||
if (!instance)
|
||||
sLog->outError("TSCR: No Instance eye_of_cthunAI");
|
||||
}
|
||||
|
||||
InstanceScript* pInst;
|
||||
InstanceScript* instance;
|
||||
|
||||
//Global variables
|
||||
uint32 PhaseTimer;
|
||||
@@ -222,8 +222,8 @@ public:
|
||||
me->SetVisible(true);
|
||||
|
||||
//Reset Phase
|
||||
if (pInst)
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
|
||||
//to avoid having a following void zone
|
||||
Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
|
||||
@@ -234,8 +234,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
if (pInst)
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
|
||||
if (instance)
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
|
||||
}
|
||||
|
||||
void SpawnEyeTentacle(float x, float y)
|
||||
@@ -253,10 +253,10 @@ public:
|
||||
return;
|
||||
|
||||
//No instance
|
||||
if (!pInst)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
uint32 currentPhase = pInst->GetData(DATA_CTHUN_PHASE);
|
||||
uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
|
||||
if (currentPhase == PHASE_EYE_GREEN_BEAM || currentPhase == PHASE_EYE_RED_BEAM)
|
||||
{
|
||||
// EyeTentacleTimer
|
||||
@@ -319,7 +319,7 @@ public:
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
//Switch to Dark Beam
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_EYE_RED_BEAM);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_RED_BEAM);
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
@@ -379,7 +379,7 @@ public:
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
//Switch to Eye Beam
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
|
||||
|
||||
BeamTimer = 3000;
|
||||
ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam)
|
||||
@@ -421,10 +421,10 @@ public:
|
||||
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
|
||||
{
|
||||
//No instance
|
||||
if (!pInst)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (pInst->GetData(DATA_CTHUN_PHASE))
|
||||
switch (instance->GetData(DATA_CTHUN_PHASE))
|
||||
{
|
||||
case PHASE_EYE_GREEN_BEAM:
|
||||
case PHASE_EYE_RED_BEAM:
|
||||
@@ -445,7 +445,7 @@ public:
|
||||
me->SetTarget(0);
|
||||
|
||||
//Death animation/respawning;
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
|
||||
|
||||
me->SetHealth(0);
|
||||
damage = 0;
|
||||
@@ -484,12 +484,12 @@ public:
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
|
||||
pInst = c->GetInstanceScript();
|
||||
if (!pInst)
|
||||
instance = c->GetInstanceScript();
|
||||
if (!instance)
|
||||
sLog->outError("TSCR: No Instance eye_of_cthunAI");
|
||||
}
|
||||
|
||||
InstanceScript* pInst;
|
||||
InstanceScript* instance;
|
||||
|
||||
//Out of combat whisper timer
|
||||
uint32 WisperTimer;
|
||||
@@ -544,8 +544,8 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisible(false);
|
||||
|
||||
if (pInst)
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
if (instance)
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -606,11 +606,11 @@ public:
|
||||
//WisperTimer
|
||||
if (WisperTimer <= diff)
|
||||
{
|
||||
Map* pMap = me->GetMap();
|
||||
if (!pMap->IsDungeon()) return;
|
||||
Map* map = me->GetMap();
|
||||
if (!map->IsDungeon()) return;
|
||||
|
||||
//Play random sound to the zone
|
||||
Map::PlayerList const &PlayerList = pMap->GetPlayers();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
|
||||
if (!PlayerList.isEmpty())
|
||||
{
|
||||
@@ -631,10 +631,10 @@ public:
|
||||
me->SetTarget(0);
|
||||
|
||||
//No instance
|
||||
if (!pInst)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
uint32 currentPhase = pInst->GetData(DATA_CTHUN_PHASE);
|
||||
uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
|
||||
if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK)
|
||||
{
|
||||
// EyeTentacleTimer
|
||||
@@ -663,7 +663,7 @@ public:
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
//Switch
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
|
||||
|
||||
//Switch to c'thun model
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
@@ -711,7 +711,7 @@ public:
|
||||
//Weaken
|
||||
if (FleshTentaclesKilled > 1)
|
||||
{
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK);
|
||||
|
||||
DoScriptText(EMOTE_WEAKENED, me);
|
||||
PhaseTimer = 45000;
|
||||
@@ -855,7 +855,7 @@ public:
|
||||
if (PhaseTimer <= diff)
|
||||
{
|
||||
//Switch
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
|
||||
|
||||
//Remove purple coloration
|
||||
me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
|
||||
@@ -880,17 +880,17 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInst)
|
||||
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*done_by*/, uint32 &damage)
|
||||
{
|
||||
//No instance
|
||||
if (!pInst)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
switch (pInst->GetData(DATA_CTHUN_PHASE))
|
||||
switch (instance->GetData(DATA_CTHUN_PHASE))
|
||||
{
|
||||
case PHASE_CTHUN_STOMACH:
|
||||
//Not weakened so reduce damage by 99%
|
||||
|
||||
@@ -63,10 +63,10 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
{
|
||||
boss_twinemperorsAI(Creature* c): ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
instance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 Heal_Timer;
|
||||
uint32 Teleport_Timer;
|
||||
@@ -97,8 +97,8 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
|
||||
Creature* GetOtherBoss()
|
||||
{
|
||||
if (pInstance)
|
||||
return Unit::GetCreature(*me, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
|
||||
if (instance)
|
||||
return Unit::GetCreature(*me, instance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
|
||||
void TeleportToMyBrother()
|
||||
{
|
||||
if (!pInstance)
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
Teleport_Timer = TELEPORTTIME;
|
||||
|
||||
@@ -31,14 +31,14 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript
|
||||
public:
|
||||
instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* pMap) const
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_temple_of_ahnqiraj_InstanceMapScript(pMap);
|
||||
return new instance_temple_of_ahnqiraj_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_temple_of_ahnqiraj_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {}
|
||||
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
//If Vem is dead...
|
||||
bool IsBossDied[3];
|
||||
|
||||
Reference in New Issue
Block a user