refactor(Scripts/TempleOfAhnQiraj): Temple of Ahn Qiraj header (#12749)

* refactor(Core/TempleOfAhnQiraj): Temple of Ahn Qiraj header

* remove ouro leftovers
This commit is contained in:
Angelo Venturini
2022-08-21 10:59:45 -03:00
committed by GitHub
parent 2f5e976ce9
commit 787f0ae204
5 changed files with 39 additions and 47 deletions

View File

@@ -142,12 +142,10 @@ public:
//Kick out position
const Position KickPos = { -8545.0f, 1984.0f, -96.0f, 0.0f};
struct boss_eye_of_cthun : public ScriptedAI
struct boss_eye_of_cthun : public BossAI
{
boss_eye_of_cthun(Creature* creature) : ScriptedAI(creature), _summons(creature)
boss_eye_of_cthun(Creature* creature) : BossAI(creature, DATA_CTHUN), _summons(creature)
{
instance = creature->GetInstanceScript();
SetCombatMovement(false);
}
@@ -176,13 +174,18 @@ struct boss_eye_of_cthun : public ScriptedAI
_summons.DespawnAll();
_scheduler.CancelAll();
BossAI::Reset();
}
void EnterCombat(Unit* /*who*/) override
void JustDied(Unit* /*killer*/) override { }
void EnterCombat(Unit* who) override
{
DoZoneInCombat();
ScheduleTasks();
instance->SetData(DATA_CTHUN_PHASE, PHASE_EYE_GREEN_BEAM);
BossAI::EnterCombat(who);
}
void MoveInLineOfSight(Unit* who) override
@@ -388,8 +391,6 @@ struct boss_eye_of_cthun : public ScriptedAI
}
private:
InstanceScript* instance;
//Dark Glare phase
uint32 DarkGlareTick;
float DarkGlareAngle;
@@ -400,17 +401,13 @@ private:
SummonList _summons;
};
struct boss_cthun : public ScriptedAI
struct boss_cthun : public BossAI
{
boss_cthun(Creature* creature) : ScriptedAI(creature)
boss_cthun(Creature* creature) : BossAI(creature, DATA_CTHUN)
{
SetCombatMovement(false);
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
//Out of combat whisper timer
uint32 WisperTimer;
@@ -784,9 +781,10 @@ struct boss_cthun : public ScriptedAI
}
}
void JustDied(Unit* /*killer*/) override
void JustDied(Unit* killer) override
{
instance->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_DONE);
BossAI::JustDied(killer);
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override

View File

@@ -242,9 +242,6 @@ struct boss_ouro : public BossAI
{
DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL);
me->DespawnOrUnsummon(1000);
// Remove after the header file is sorted with the bosses first.
if (Creature* ouroSpawner = instance->GetCreature(DATA_OURO_SPAWNER))
ouroSpawner->Respawn();
instance->SetBossState(DATA_OURO, FAIL);
if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f))
base->DespawnOrUnsummon();
@@ -348,10 +345,6 @@ struct npc_dirt_mound : ScriptedAI
if (_instance)
{
_instance->SetBossState(DATA_OURO, FAIL);
// Remove after the header file is sorted with the bosses first.
if (Creature* ouroSpawner = _instance->GetCreature(DATA_OURO_SPAWNER))
ouroSpawner->Respawn();
}
if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f))

View File

@@ -62,14 +62,9 @@ enum Misc
TELEPORTTIME = 30000
};
struct boss_twinemperorsAI : public ScriptedAI
struct boss_twinemperorsAI : public BossAI
{
boss_twinemperorsAI(Creature* creature): ScriptedAI(creature)
{
instance = creature->GetInstanceScript();
}
InstanceScript* instance;
boss_twinemperorsAI(Creature* creature): BossAI(creature, DATA_TWIN_EMPERORS) { }
uint32 Heal_Timer;
uint32 Teleport_Timer;

View File

@@ -49,6 +49,7 @@ public:
instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map)
{
LoadObjectData(creatureData, nullptr);
SetBossNumber(MAX_BOSS_NUMBER);
}
//If Vem is dead...
@@ -193,7 +194,7 @@ public:
case DATA_OURO:
if (state == FAIL)
{
if (Creature* ouroSpawner = GetCreature(DATA_OURO))
if (Creature* ouroSpawner = GetCreature(DATA_OURO_SPAWNER))
ouroSpawner->Respawn();
}
break;

View File

@@ -25,25 +25,30 @@
enum DataTypes
{
DATA_SKERAM = 1,
DATA_KRI = 2,
DATA_VEM = 3,
DATA_YAUJ = 4,
DATA_BUG_TRIO = 5,
DATA_VEKLOR = 6,
DATA_VEKLORISDEAD = 7,
DATA_VEKLOR_DEATH = 8,
DATA_VEKNILASH = 9,
DATA_VEKNILASHISDEAD = 10,
DATA_VEKNILASH_DEATH = 11,
DATA_FANKRISS = 12,
DATA_OURO = 13,
DATA_OURO_SPAWNER = 14,
DATA_BUG_TRIO_DEATH = 15,
DATA_CTHUN_PHASE = 20,
DATA_VISCIDUS = 21,
DATA_SARTURA = 22,
DATA_BUG_TRIO = 2,
DATA_SARTURA = 3,
DATA_FANKRISS = 4,
DATA_VISCIDUS = 5,
DATA_HUHURAN = 6,
DATA_TWIN_EMPERORS = 7,
DATA_OURO = 8,
DATA_CTHUN = 9,
DATA_EYE_OF_CTHUN = 23
MAX_BOSS_NUMBER = 10,
DATA_KRI = 10,
DATA_VEM = 11,
DATA_YAUJ = 12,
DATA_BUG_TRIO_DEATH = 13,
DATA_OURO_SPAWNER = 14,
DATA_VEKLOR = 15,
DATA_VEKLORISDEAD = 16,
DATA_VEKLOR_DEATH = 17,
DATA_VEKNILASH = 18,
DATA_VEKNILASHISDEAD = 19,
DATA_VEKNILASH_DEATH = 20,
DATA_CTHUN_PHASE = 21,
DATA_EYE_OF_CTHUN = 22
};
enum Creatures