aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp99
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);
}