Scripts/Violet Hold: Update Lavanthor to new model (#26397)

Co-authored-by: offl <offl@users.noreply.github.com>
(cherry picked from commit 8e9d35ad5a)
This commit is contained in:
offl
2021-04-14 12:50:10 +03:00
committed by Shauren
parent 8d716dcd39
commit 6837df28d5

View File

@@ -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<boss_lavanthorAI>(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);
}