fix(Scripts/TheEye): maybe fix Al'ar transition (#18552)

initial
This commit is contained in:
Dan
2024-03-13 20:53:17 +01:00
committed by GitHub
parent 0da6b17f7b
commit 28ea5ca879

View File

@@ -115,6 +115,7 @@ struct boss_alar : public BossAI
_canAttackCooldown = true; _canAttackCooldown = true;
_baseAttackOverride = false; _baseAttackOverride = false;
_spawnPhoenixes = false; _spawnPhoenixes = false;
_transitionScheduler.CancelAll();
_platform = 0; _platform = 0;
_noMelee = false; _noMelee = false;
_platformRoll = 0; _platformRoll = 0;
@@ -183,20 +184,20 @@ struct boss_alar : public BossAI
damage = 0; damage = 0;
DoCastSelf(SPELL_EMBER_BLAST, true); DoCastSelf(SPELL_EMBER_BLAST, true);
PretendToDie(me); PretendToDie(me);
ScheduleUniqueTimedEvent(1s, [&]{ _transitionScheduler.Schedule(1s, [this](TaskContext)
{
me->SetVisible(false); me->SetVisible(false);
}, EVENT_INVISIBLE); }).Schedule(8s, [this](TaskContext)
ScheduleUniqueTimedEvent(8s, [&]{ {
me->SetPosition(alarPoints[POINT_MIDDLE]); me->SetPosition(alarPoints[POINT_MIDDLE]);
}, EVENT_RELOCATE_MIDDLE); }).Schedule(12s, [this](TaskContext)
ScheduleUniqueTimedEvent(12s, [&]
{ {
me->SetStandState(UNIT_STAND_STATE_STAND); me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetVisible(true); me->SetVisible(true);
DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true); DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true);
DoCastSelf(SPELL_REBIRTH_PHASE2); DoCastSelf(SPELL_REBIRTH_PHASE2);
}, EVENT_MOVE_TO_PHASE_2); }).Schedule(16001ms, [this](TaskContext)
ScheduleUniqueTimedEvent(16001ms, [&]{ {
me->SetHealth(me->GetMaxHealth()); me->SetHealth(me->GetMaxHealth());
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
_noMelee = false; _noMelee = false;
@@ -204,7 +205,7 @@ struct boss_alar : public BossAI
_platform = POINT_MIDDLE; _platform = POINT_MIDDLE;
me->GetMotionMaster()->MoveChase(me->GetVictim()); me->GetMotionMaster()->MoveChase(me->GetVictim());
ScheduleAbilities(); ScheduleAbilities();
}, EVENT_REBIRTH); });
} }
} }
@@ -356,6 +357,8 @@ struct boss_alar : public BossAI
void UpdateAI(uint32 diff) override void UpdateAI(uint32 diff) override
{ {
_transitionScheduler.Update(diff);
if (!UpdateVictim()) if (!UpdateVictim())
{ {
return; return;
@@ -413,6 +416,7 @@ private:
uint8 _platformRoll; uint8 _platformRoll;
uint8 _noQuillTimes; uint8 _noQuillTimes;
std::chrono::seconds _platformMoveRepeatTimer; std::chrono::seconds _platformMoveRepeatTimer;
TaskScheduler _transitionScheduler;
}; };
class CastQuill : public BasicEvent class CastQuill : public BasicEvent