mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
refactor(Scripts/Botanica): Update Laj's script after latest changes (#17814)
This commit is contained in:
@@ -67,7 +67,7 @@ LajTransformData const LajTransform[5] =
|
|||||||
|
|
||||||
struct boss_laj : public BossAI
|
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
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -85,16 +85,13 @@ struct boss_laj : public BossAI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void ScheduleTasks() override
|
||||||
{
|
{
|
||||||
_JustEngagedWith();
|
ScheduleTimedEvent(5s, [&] {
|
||||||
|
|
||||||
scheduler.Schedule(5s, [this](TaskContext context)
|
|
||||||
{
|
|
||||||
DoCastVictim(SPELL_ALLERGIC_REACTION);
|
DoCastVictim(SPELL_ALLERGIC_REACTION);
|
||||||
context.Repeat(25s);
|
}, 25s);
|
||||||
}).Schedule(30s, [this](TaskContext context)
|
|
||||||
{
|
ScheduleTimedEvent(30s, [&] {
|
||||||
me->RemoveAurasDueToSpell(_lastTransform.spellId);
|
me->RemoveAurasDueToSpell(_lastTransform.spellId);
|
||||||
_lastTransform = Acore::Containers::SelectRandomContainerElementIf(_transformContainer, [&](LajTransformData data) -> bool
|
_lastTransform = Acore::Containers::SelectRandomContainerElementIf(_transformContainer, [&](LajTransformData data) -> bool
|
||||||
{
|
{
|
||||||
@@ -102,9 +99,9 @@ struct boss_laj : public BossAI
|
|||||||
});
|
});
|
||||||
me->SetDisplayId(_lastTransform.modelId);
|
me->SetDisplayId(_lastTransform.modelId);
|
||||||
DoCastSelf(_lastTransform.spellId, true);
|
DoCastSelf(_lastTransform.spellId, true);
|
||||||
context.Repeat(35s);
|
}, 35s);
|
||||||
}).Schedule(20s, [this](TaskContext context)
|
|
||||||
{
|
ScheduleTimedEvent(20s, [&] {
|
||||||
DoCastSelf(SPELL_TELEPORT_SELF);
|
DoCastSelf(SPELL_TELEPORT_SELF);
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
me->GetMotionMaster()->Clear();
|
me->GetMotionMaster()->Clear();
|
||||||
@@ -117,14 +114,12 @@ struct boss_laj : public BossAI
|
|||||||
me->SetReactState(REACT_AGGRESSIVE);
|
me->SetReactState(REACT_AGGRESSIVE);
|
||||||
me->ResumeChasingVictim();
|
me->ResumeChasingVictim();
|
||||||
});
|
});
|
||||||
|
}, 30s);
|
||||||
context.Repeat(30s);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LajTransformData _lastTransform;
|
LajTransformData _lastTransform;
|
||||||
std::vector<LajTransformData> _transformContainer;
|
std::list<LajTransformData> _transformContainer;
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_boss_laj()
|
void AddSC_boss_laj()
|
||||||
|
|||||||
Reference in New Issue
Block a user