chore(Scripts/ZulAman): Update Akilzon to new register method (#20556)

This commit is contained in:
Andrew
2024-11-14 03:29:43 -03:00
committed by GitHub
parent 0fc6f468e6
commit e2020e0886
@@ -57,14 +57,9 @@ enum Misc
constexpr auto NPC_SOARING_EAGLE = 24858; constexpr auto NPC_SOARING_EAGLE = 24858;
class boss_akilzon : public CreatureScript struct boss_akilzon : public BossAI
{ {
public: boss_akilzon(Creature* creature) : BossAI(creature, DATA_AKILZON), _stormCount(0), _isRaining(false) { }
boss_akilzon() : CreatureScript("boss_akilzon") { }
struct boss_akilzonAI : public BossAI
{
boss_akilzonAI(Creature* creature) : BossAI(creature, DATA_AKILZON) { }
void Reset() override void Reset() override
{ {
@@ -86,7 +81,7 @@ public:
{ {
_JustEngagedWith(); _JustEngagedWith();
ScheduleTimedEvent(10s, 20s, [&]{ ScheduleTimedEvent(10s, 20s, [&] {
Unit* target = SelectTarget(SelectTargetMethod::Random, 1); Unit* target = SelectTarget(SelectTargetMethod::Random, 1);
if (!target) if (!target)
target = me->GetVictim(); target = me->GetVictim();
@@ -244,7 +239,7 @@ public:
if (z > 95) if (z > 95)
z = 95.0f - urand(0, 5); z = 95.0f - urand(0, 5);
} }
; ;
if (Creature* creature = me->SummonCreature(NPC_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) if (Creature* creature = me->SummonCreature(NPC_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
{ {
creature->AddThreat(me->GetVictim(), 1.0f); creature->AddThreat(me->GetVictim(), 1.0f);
@@ -255,19 +250,13 @@ public:
} }
} }
private: private:
ObjectGuid _birdGUIDs[8]; ObjectGuid _birdGUIDs[8];
ObjectGuid _targetGUID; ObjectGuid _targetGUID;
ObjectGuid _cycloneGUID; ObjectGuid _cycloneGUID;
ObjectGuid _cloudGUID; ObjectGuid _cloudGUID;
uint8 _stormCount; uint8 _stormCount;
bool _isRaining; bool _isRaining;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetZulAmanAI<boss_akilzonAI>(creature);
}
}; };
struct npc_akilzon_eagle : public ScriptedAI struct npc_akilzon_eagle : public ScriptedAI
@@ -364,7 +353,7 @@ class spell_electrial_storm : public AuraScript
void AddSC_boss_akilzon() void AddSC_boss_akilzon()
{ {
new boss_akilzon(); RegisterZulAmanCreatureAI(boss_akilzon);
RegisterZulAmanCreatureAI(npc_akilzon_eagle); RegisterZulAmanCreatureAI(npc_akilzon_eagle);
RegisterSpellScript(spell_electrial_storm); RegisterSpellScript(spell_electrial_storm);
} }