mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
refactor(Scripts/TempleOfAhnQiraj): Clean up unused variables (#14979)
This commit is contained in:
@@ -163,9 +163,6 @@ struct boss_eye_of_cthun : public BossAI
|
||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetVisible(true);
|
||||
|
||||
//Reset Phase
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
|
||||
|
||||
//to avoid having a following void zone
|
||||
Creature* pPortal = me->FindNearestCreature(NPC_CTHUN_PORTAL, 10);
|
||||
if (pPortal)
|
||||
@@ -544,8 +541,6 @@ struct boss_cthun : public BossAI
|
||||
{
|
||||
eye->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* creature, Unit* /*killer*/) override
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ NPC_VEM, DATA_VEM },
|
||||
{ NPC_KRI, DATA_KRI },
|
||||
{ NPC_YAUJ, DATA_YAUJ },
|
||||
{ NPC_SARTURA, DATA_SARTURA },
|
||||
{ NPC_CTHUN, DATA_CTHUN },
|
||||
{ NPC_VEM, DATA_VEM },
|
||||
{ NPC_KRI, DATA_KRI },
|
||||
{ NPC_YAUJ, DATA_YAUJ },
|
||||
{ NPC_SARTURA, DATA_SARTURA },
|
||||
{ NPC_CTHUN, DATA_CTHUN },
|
||||
{ NPC_EYE_OF_CTHUN, DATA_EYE_OF_CTHUN },
|
||||
{ NPC_OURO, DATA_OURO },
|
||||
{ NPC_OURO, DATA_OURO },
|
||||
{ NPC_OURO_SPAWNER, DATA_OURO_SPAWNER },
|
||||
{ NPC_MASTERS_EYE, DATA_MASTERS_EYE },
|
||||
{ NPC_VEKLOR, DATA_VEKLOR },
|
||||
{ NPC_VEKNILASH, DATA_VEKNILASH },
|
||||
{ NPC_VISCIDUS, DATA_VISCIDUS }
|
||||
{ NPC_MASTERS_EYE, DATA_MASTERS_EYE },
|
||||
{ NPC_VEKLOR, DATA_VEKLOR },
|
||||
{ NPC_VEKNILASH, DATA_VEKNILASH },
|
||||
{ NPC_VISCIDUS, DATA_VISCIDUS }
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
@@ -66,28 +66,15 @@ public:
|
||||
LoadDoorData(doorData);
|
||||
}
|
||||
|
||||
ObjectGuid SkeramGUID;
|
||||
ObjectGuid CThunGUID;
|
||||
GuidVector CThunGraspGUIDs;
|
||||
|
||||
uint32 BugTrioDeathCount;
|
||||
uint32 CthunPhase;
|
||||
|
||||
TaskScheduler scheduler;
|
||||
|
||||
void Initialize() override
|
||||
{
|
||||
BugTrioDeathCount = 0;
|
||||
CthunPhase = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SKERAM:
|
||||
SkeramGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_OURO_SPAWNER:
|
||||
if (GetBossState(DATA_OURO) != DONE)
|
||||
creature->Respawn();
|
||||
@@ -97,7 +84,6 @@ public:
|
||||
creature->Respawn(true);
|
||||
break;
|
||||
case NPC_CTHUN:
|
||||
CThunGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
{
|
||||
for (ObjectGuid const& guid : CThunGraspGUIDs)
|
||||
@@ -122,7 +108,7 @@ public:
|
||||
{
|
||||
case GO_CTHUN_GRASP:
|
||||
CThunGraspGUIDs.push_back(go->GetGUID());
|
||||
if (Creature* CThun = instance->GetCreature(CThunGUID))
|
||||
if (Creature* CThun = GetCreature(DATA_CTHUN))
|
||||
{
|
||||
if (!CThun->IsAlive())
|
||||
{
|
||||
@@ -163,6 +149,15 @@ public:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NPC_CTHUN:
|
||||
for (ObjectGuid const& guid : CThunGraspGUIDs)
|
||||
{
|
||||
if (GameObject* cthunGrasp = instance->GetGameObject(guid))
|
||||
{
|
||||
cthunGrasp->DespawnOrUnsummon(1s);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -174,23 +169,10 @@ public:
|
||||
{
|
||||
case DATA_BUG_TRIO_DEATH:
|
||||
return BugTrioDeathCount;
|
||||
|
||||
case DATA_CTHUN_PHASE:
|
||||
return CthunPhase;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
ObjectGuid GetGuidData(uint32 identifier) const override
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_SKERAM:
|
||||
return SkeramGUID;
|
||||
}
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
switch (type)
|
||||
@@ -201,19 +183,6 @@ public:
|
||||
else
|
||||
BugTrioDeathCount = 0;
|
||||
break;
|
||||
case DATA_CTHUN_PHASE:
|
||||
CthunPhase = data;
|
||||
if (data == PHASE_CTHUN_DONE)
|
||||
{
|
||||
for (ObjectGuid const& guid : CThunGraspGUIDs)
|
||||
{
|
||||
if (GameObject* cthunGrasp = instance->GetGameObject(guid))
|
||||
{
|
||||
cthunGrasp->DespawnOrUnsummon(1s);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -244,33 +213,15 @@ public:
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidVector CThunGraspGUIDs;
|
||||
uint32 BugTrioDeathCount;
|
||||
TaskScheduler scheduler;
|
||||
};
|
||||
};
|
||||
|
||||
// 4052, At Battleguard Sartura
|
||||
class at_battleguard_sartura : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_battleguard_sartura() : AreaTriggerScript("at_battleguard_sartura") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTrigger* /*at*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
if (Creature* sartura = instance->GetCreature(DATA_SARTURA))
|
||||
{
|
||||
if (sartura->IsAlive())
|
||||
{
|
||||
sartura->SetInCombatWith(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_temple_of_ahnqiraj()
|
||||
{
|
||||
new instance_temple_of_ahnqiraj();
|
||||
new at_battleguard_sartura();
|
||||
}
|
||||
|
||||
@@ -572,6 +572,28 @@ class spell_nullify : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 4052, At Battleguard Sartura
|
||||
class at_battleguard_sartura : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_battleguard_sartura() : AreaTriggerScript("at_battleguard_sartura") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTrigger* /*at*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
if (Creature* sartura = instance->GetCreature(DATA_SARTURA))
|
||||
{
|
||||
if (sartura->IsAlive())
|
||||
{
|
||||
sartura->SetInCombatWith(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_temple_of_ahnqiraj()
|
||||
{
|
||||
RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_defender);
|
||||
@@ -582,4 +604,5 @@ void AddSC_temple_of_ahnqiraj()
|
||||
RegisterTempleOfAhnQirajCreatureAI(npc_ahnqiraji_critter);
|
||||
RegisterSpellScript(spell_aggro_drones);
|
||||
RegisterSpellScript(spell_nullify);
|
||||
new at_battleguard_sartura();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ enum DataTypes
|
||||
DATA_OURO_SPAWNER = 14,
|
||||
DATA_VEKLOR = 15,
|
||||
DATA_VEKNILASH = 16,
|
||||
DATA_CTHUN_PHASE = 17,
|
||||
DATA_EYE_OF_CTHUN = 18,
|
||||
DATA_MASTERS_EYE = 19
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user