diff options
author | offl <11556157+offl@users.noreply.github.com> | 2021-04-14 12:50:10 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-08 22:02:31 +0100 |
commit | 6837df28d5fbf47100490a5f3384abfd24ed0e1b (patch) | |
tree | d00c275bc1eae7ddffd6170ec053ce0d1814cda9 /src | |
parent | 8d716dcd39bdba8816acb56a9eb3080b428f291c (diff) |
Scripts/Violet Hold: Update Lavanthor to new model (#26397)
Co-authored-by: offl <offl@users.noreply.github.com>
(cherry picked from commit 8e9d35ad5a8e4cc3be58e2c7f3a0ce97b324f55d)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp | 99 |
1 files changed, 49 insertions, 50 deletions
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 - { - boss_lavanthorAI(Creature* creature) : BossAI(creature, DATA_LAVANTHOR) { } + void Reset() override + { + BossAI::Reset(); + } - void JustReachedHome() override - { - BossAI::JustReachedHome(); - instance->SetData(DATA_HANDLE_CELLS, DATA_LAVANTHOR); - } + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + } - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; + void JustReachedHome() override + { + BossAI::JustReachedHome(); + instance->SetData(DATA_HANDLE_CELLS, DATA_LAVANTHOR); + } - scheduler.Update(diff, - std::bind(&BossAI::DoMeleeAttackIfReady, this)); - } + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; - 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.Update(diff, + std::bind(&BossAI::DoMeleeAttackIfReady, this)); + } - scheduler.Schedule(Seconds(5), [this](TaskContext task) - { - DoCastVictim(SPELL_FLAME_BREATH); - task.Repeat(Seconds(10), Seconds(15)); - }); + 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(10), [this](TaskContext task) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f)) - DoCast(target, SPELL_LAVA_BURN); - task.Repeat(Seconds(15), Seconds(23)); - }); + scheduler.Schedule(Seconds(5), [this](TaskContext task) + { + DoCastVictim(SPELL_FLAME_BREATH); + task.Repeat(Seconds(10), Seconds(15)); + }); - if (IsHeroic()) - { - scheduler.Schedule(Seconds(3), [this](TaskContext task) - { - DoCastAOE(SPELL_CAUTERIZING_FLAMES); - task.Repeat(Seconds(10), Seconds(16)); - }); - } - } - }; + 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)); + }); - CreatureAI* GetAI(Creature* creature) const override + if (IsHeroic()) { - return GetVioletHoldAI<boss_lavanthorAI>(creature); + 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); } |