mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
fix(Scripts/Naxxramas): fix issues with safety dance and gate opening on dying (#24274)
This commit is contained in:
@@ -59,7 +59,7 @@ float const heiganFastDanceFaceDirection = 2.40f;
|
||||
|
||||
struct boss_heigan : public BossAI
|
||||
{
|
||||
boss_heigan(Creature* creature) : BossAI(creature, DATA_HEIGAN_BOSS) { }
|
||||
boss_heigan(Creature* creature) : BossAI(creature, BOSS_HEIGAN) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -67,6 +67,7 @@ struct boss_heigan : public BossAI
|
||||
_currentPhase = 0;
|
||||
_currentSection = 3;
|
||||
_moveRight = true;
|
||||
_eruptionScheduler.CancelAll();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
@@ -80,6 +81,7 @@ struct boss_heigan : public BossAI
|
||||
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
_eruptionScheduler.CancelAll();
|
||||
BossAI::JustDied(killer);
|
||||
Talk(EMOTE_DEATH);
|
||||
}
|
||||
@@ -97,18 +99,19 @@ struct boss_heigan : public BossAI
|
||||
_currentSection = 3;
|
||||
_currentPhase = phase;
|
||||
scheduler.CancelAll();
|
||||
_eruptionScheduler.CancelAll();
|
||||
if (phase == PHASE_SLOW_DANCE)
|
||||
{
|
||||
me->CastStop();
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoZoneInCombat();
|
||||
ScheduleTimedEvent(12s, 15s, [&] {
|
||||
DoCastSelf(SPELL_ERUPTION);
|
||||
DoCastSelf(SPELL_SPELL_DISRUPTION);
|
||||
}, 10s);
|
||||
ScheduleTimedEvent(17s, [&] {
|
||||
DoCastSelf(SPELL_DECREPIT_FEVER);
|
||||
}, 22s, 25s);
|
||||
ScheduleTimedEvent(15s, [&] {
|
||||
_eruptionScheduler.Schedule(15s, [this](TaskContext context){
|
||||
instance->SetData(DATA_HEIGAN_ERUPTION, _currentSection);
|
||||
if (_currentSection == 3)
|
||||
_moveRight = false;
|
||||
@@ -117,8 +120,8 @@ struct boss_heigan : public BossAI
|
||||
|
||||
_moveRight ? _currentSection++ : _currentSection--;
|
||||
Talk(SAY_TAUNT);
|
||||
}, 10s);
|
||||
scheduler.Schedule(90s, [this](TaskContext /*context*/) {
|
||||
context.Repeat(10s);
|
||||
}).Schedule(90s, [this](TaskContext /*context*/) {
|
||||
StartFightPhase(PHASE_FAST_DANCE);
|
||||
});
|
||||
}
|
||||
@@ -134,7 +137,7 @@ struct boss_heigan : public BossAI
|
||||
scheduler.Schedule(1s, [this](TaskContext /*context*/) {
|
||||
DoCastSelf(SPELL_PLAGUE_CLOUD);
|
||||
});
|
||||
ScheduleTimedEvent(7s, [&] {
|
||||
_eruptionScheduler.Schedule(7s, [this](TaskContext context){
|
||||
instance->SetData(DATA_HEIGAN_ERUPTION, _currentSection);
|
||||
if (_currentSection == 3)
|
||||
_moveRight = false;
|
||||
@@ -142,8 +145,8 @@ struct boss_heigan : public BossAI
|
||||
_moveRight = true;
|
||||
|
||||
_moveRight ? _currentSection++ : _currentSection--;
|
||||
}, 4s);
|
||||
scheduler.Schedule(45s, [this](TaskContext /*context*/) {
|
||||
context.Repeat(4s);
|
||||
}).Schedule(45s, [this](TaskContext /*context*/) {
|
||||
StartFightPhase(PHASE_SLOW_DANCE);
|
||||
Talk(EMOTE_DANCE_END); // avoid play the emote on aggro
|
||||
});
|
||||
@@ -153,6 +156,18 @@ struct boss_heigan : public BossAI
|
||||
}, 5s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_eruptionScheduler.Update(diff);
|
||||
|
||||
BossAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
void CheckSafetyDance()
|
||||
{
|
||||
if (Map* map = me->GetMap())
|
||||
@@ -172,6 +187,7 @@ private:
|
||||
uint8 _currentPhase{};
|
||||
uint8 _currentSection{};
|
||||
bool _moveRight{true};
|
||||
TaskScheduler _eruptionScheduler;
|
||||
};
|
||||
|
||||
void AddSC_boss_heigan()
|
||||
|
||||
@@ -36,6 +36,7 @@ BossBoundaryData const boundaries =
|
||||
/* Plague Quarter */
|
||||
{ BOSS_NOTH, new RectangleBoundary(2618.0f, 2754.0f, -3557.43f, -3450.0f) },
|
||||
{ BOSS_HEIGAN, new CircleBoundary(Position(2772.57f, -3685.28f), 56.0f) },
|
||||
{ BOSS_HEIGAN, new RectangleBoundary(2723.0f, 2826.0f, -3736.0f, -3641.0f) },
|
||||
{ BOSS_LOATHEB, new CircleBoundary(Position(2909.0f, -3997.41f), 57.0f) },
|
||||
|
||||
/* Military Quarter */
|
||||
@@ -55,10 +56,7 @@ BossBoundaryData const boundaries =
|
||||
|
||||
/* Frostwyrm Lair */
|
||||
{ BOSS_SAPPHIRON, new CircleBoundary(Position(3517.627f, -5255.5f), 110.0) },
|
||||
{ BOSS_KELTHUZAD, new CircleBoundary(Position(3716.0f, -5107.0f), 85.0) },
|
||||
|
||||
/* Heigan */
|
||||
{ DATA_HEIGAN_BOSS, new RectangleBoundary(2723.0f, 2826.0f, -3736.0f, -3641.0f) }
|
||||
{ BOSS_KELTHUZAD, new CircleBoundary(Position(3716.0f, -5107.0f), 85.0) }
|
||||
};
|
||||
|
||||
struct LivingPoisonData
|
||||
|
||||
Reference in New Issue
Block a user