diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index aef05bd8e5a..4a7705bb984 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -28,70 +28,69 @@ enum Spells SPELL_LAVA_BURN = 54249 }; -class boss_lavanthor : public CreatureScript +struct boss_lavanthor : public BossAI { - public: - boss_lavanthor() : CreatureScript("boss_lavanthor") { } + boss_lavanthor(Creature* creature) : BossAI(creature, DATA_LAVANTHOR) { } - struct boss_lavanthorAI : public BossAI + void Reset() override + { + BossAI::Reset(); + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + } + + void JustReachedHome() override + { + BossAI::JustReachedHome(); + instance->SetData(DATA_HANDLE_CELLS, DATA_LAVANTHOR); + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + scheduler.Update(diff, + std::bind(&BossAI::DoMeleeAttackIfReady, this)); + } + + void ScheduleTasks() override + { + scheduler.Schedule(Seconds(1), [this](TaskContext task) { - boss_lavanthorAI(Creature* creature) : BossAI(creature, DATA_LAVANTHOR) { } + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) + DoCast(target, SPELL_FIREBOLT); + task.Repeat(Seconds(5), Seconds(13)); + }); - void JustReachedHome() override - { - BossAI::JustReachedHome(); - instance->SetData(DATA_HANDLE_CELLS, DATA_LAVANTHOR); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - scheduler.Update(diff, - std::bind(&BossAI::DoMeleeAttackIfReady, this)); - } - - void ScheduleTasks() override - { - scheduler.Schedule(Seconds(1), [this](TaskContext task) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 40.0f, true)) - DoCast(target, SPELL_FIREBOLT); - task.Repeat(Seconds(5), Seconds(13)); - }); - - scheduler.Schedule(Seconds(5), [this](TaskContext task) - { - DoCastVictim(SPELL_FLAME_BREATH); - task.Repeat(Seconds(10), Seconds(15)); - }); - - scheduler.Schedule(Seconds(10), [this](TaskContext task) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f)) - DoCast(target, SPELL_LAVA_BURN); - task.Repeat(Seconds(15), Seconds(23)); - }); - - if (IsHeroic()) - { - scheduler.Schedule(Seconds(3), [this](TaskContext task) - { - DoCastAOE(SPELL_CAUTERIZING_FLAMES); - task.Repeat(Seconds(10), Seconds(16)); - }); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override + scheduler.Schedule(Seconds(5), [this](TaskContext task) { - return GetVioletHoldAI(creature); + DoCastVictim(SPELL_FLAME_BREATH); + task.Repeat(Seconds(10), Seconds(15)); + }); + + scheduler.Schedule(Seconds(10), [this](TaskContext task) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f)) + DoCast(target, SPELL_LAVA_BURN); + task.Repeat(Seconds(15), Seconds(23)); + }); + + if (IsHeroic()) + { + scheduler.Schedule(Seconds(3), [this](TaskContext task) + { + DoCastAOE(SPELL_CAUTERIZING_FLAMES); + task.Repeat(Seconds(10), Seconds(16)); + }); } + } }; void AddSC_boss_lavanthor() { - new boss_lavanthor(); + RegisterVioletHoldCreatureAI(boss_lavanthor); }