fix(Scripts/NPC): Arcanite Dragonling (#13233)

* fix(Scripts/NPC): Arcanite Dragonling

* update
This commit is contained in:
Grimgravy
2022-10-15 12:03:23 -03:00
committed by GitHub
parent d4030db568
commit 9ac3b52d44
2 changed files with 61 additions and 0 deletions

View File

@@ -2542,6 +2542,64 @@ public:
}
};
enum ArcaniteDragonling
{
SPELL_FLAME_BUFFET = 9658,
SPELL_FLAME_BREATH = 8873,
EVENT_FLAME_BUFFET = 1,
EVENT_FLAME_BREATH = 2
};
struct npc_arcanite_dragonling : public ScriptedAI
{
public:
npc_arcanite_dragonling(Creature* creature) : ScriptedAI(creature)
{
creature->SetCanModifyStats(true);
creature->SetReactState(REACT_AGGRESSIVE);
}
void Reset() override
{
me->SetPvP(true);
events.Reset();
}
void EnterCombat(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_FLAME_BUFFET, 4s);
events.ScheduleEvent(EVENT_FLAME_BREATH, 12s);
}
void IsSummonedBy(Unit* summoner) override
{
me->GetMotionMaster()->MoveFollow(summoner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
switch (events.ExecuteEvent())
{
case EVENT_FLAME_BUFFET:
DoCastVictim(SPELL_FLAME_BUFFET);
events.Repeat(12s);
break;
case EVENT_FLAME_BREATH:
DoCastVictim(SPELL_FLAME_BREATH);
events.Repeat(24s);
break;
}
DoMeleeAttackIfReady();
}
};
void AddSC_npcs_special()
{
// Ours
@@ -2568,4 +2626,5 @@ void AddSC_npcs_special()
new npc_firework();
new npc_spring_rabbit();
new npc_stable_master();
RegisterCreatureAI(npc_arcanite_dragonling);
}