refactor(Scripts/Botanica): Update Laj's script after latest changes (#17814)

This commit is contained in:
Andrew
2023-11-21 03:53:17 -03:00
committed by GitHub
parent 42ec86680c
commit d838cad171

View File

@@ -67,7 +67,7 @@ LajTransformData const LajTransform[5] =
struct boss_laj : public BossAI
{
boss_laj(Creature* creature) : BossAI(creature, DATA_LAJ) { }
boss_laj(Creature* creature) : BossAI(creature, DATA_LAJ), _lastTransform(LajTransform[0]) { }
void Reset() override
{
@@ -85,16 +85,13 @@ struct boss_laj : public BossAI
}
}
void JustEngagedWith(Unit* /*who*/) override
void ScheduleTasks() override
{
_JustEngagedWith();
scheduler.Schedule(5s, [this](TaskContext context)
{
ScheduleTimedEvent(5s, [&] {
DoCastVictim(SPELL_ALLERGIC_REACTION);
context.Repeat(25s);
}).Schedule(30s, [this](TaskContext context)
{
}, 25s);
ScheduleTimedEvent(30s, [&] {
me->RemoveAurasDueToSpell(_lastTransform.spellId);
_lastTransform = Acore::Containers::SelectRandomContainerElementIf(_transformContainer, [&](LajTransformData data) -> bool
{
@@ -102,9 +99,9 @@ struct boss_laj : public BossAI
});
me->SetDisplayId(_lastTransform.modelId);
DoCastSelf(_lastTransform.spellId, true);
context.Repeat(35s);
}).Schedule(20s, [this](TaskContext context)
{
}, 35s);
ScheduleTimedEvent(20s, [&] {
DoCastSelf(SPELL_TELEPORT_SELF);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear();
@@ -117,14 +114,12 @@ struct boss_laj : public BossAI
me->SetReactState(REACT_AGGRESSIVE);
me->ResumeChasingVictim();
});
context.Repeat(30s);
});
}, 30s);
}
private:
LajTransformData _lastTransform;
std::vector<LajTransformData> _transformContainer;
std::list<LajTransformData> _transformContainer;
};
void AddSC_boss_laj()