aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2015-11-26 18:57:15 +0100
committertreeston <treeston.mmoc@gmail.com>2015-11-26 18:57:15 +0100
commitbf9963039906f4b4df218ecc1818f5b01bcc714d (patch)
treee8ecaf90818643269af22cc96ea7bf59ef1a4fa6
parent981b871d2f2a30c5624c5ffc439e13b7995b1bc9 (diff)
Scripts/Naxxramas: Thaddius follow-up:
- Reduce initial spawn timer on the encounter from 30 seconds to 5 seconds - Rearrange respawn logic to fix the "petrified" visual from not showing properly - Fix a potential infinite respawn loop that could prevent the encounter from initializing properly (fixes and closes #15898)
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp22
-rw-r--r--src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp7
-rw-r--r--src/server/scripts/Northrend/Naxxramas/naxxramas.h2
3 files changed, 18 insertions, 13 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
index 50077fe9dc1..13f0ad3033e 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
@@ -173,7 +173,8 @@ public:
events.SetPhase(PHASE_NOT_ENGAGED);
SetCombatMovement(false);
- BeginResetEncounter(); // initialize everything properly, and ensure that the coils are loaded by the time we initialize
+ // initialize everything properly, and ensure that the coils are loaded by the time we initialize
+ BeginResetEncounter(true);
}
}
@@ -185,7 +186,7 @@ public:
void Reset() override
{
- if(events.IsInPhase(PHASE_TRANSITION) || events.IsInPhase(PHASE_THADDIUS))
+ if(events.IsInPhase(PHASE_TRANSITION) || (events.IsInPhase(PHASE_THADDIUS) && me->IsAlive()))
BeginResetEncounter();
}
@@ -278,15 +279,16 @@ public:
events.ScheduleEvent(EVENT_TRANSITION_3, 14 * IN_MILLISECONDS, 0, PHASE_TRANSITION);
}
- void BeginResetEncounter()
+ void BeginResetEncounter(bool initial = false)
{
- if (!me->IsAlive())
+ if (instance->GetBossState(BOSS_THADDIUS) == DONE)
return;
if (events.IsInPhase(PHASE_RESETTING))
return;
-
- instance->ProcessEvent(me, EVENT_THADDIUS_BEGIN_RESET);
+ if (initial) // signal shorter spawn timer to instance script
+ instance->SetBossState(BOSS_THADDIUS, SPECIAL);
+ instance->ProcessEvent(me, EVENT_THADDIUS_BEGIN_RESET);
instance->SetBossState(BOSS_THADDIUS, NOT_STARTED);
// remove polarity shift debuffs on reset
@@ -307,17 +309,19 @@ public:
void ResetEncounter()
{
- events.SetPhase(PHASE_NOT_ENGAGED);
feugenAlive = true;
stalaggAlive = true;
+
me->Respawn(true);
- me->CastSpell(me, SPELL_THADDIUS_INACTIVE_VISUAL);
+ _Reset();
+ events.SetPhase(PHASE_NOT_ENGAGED);
+
+ me->CastSpell(me, SPELL_THADDIUS_INACTIVE_VISUAL, true);
if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN)))
feugen->AI()->DoAction(ACTION_RESET_ENCOUNTER);
if (Creature* stalagg = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_STALAGG)))
stalagg->AI()->DoAction(ACTION_RESET_ENCOUNTER);
- _Reset();
}
void UpdateAI(uint32 diff) override
diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
index 60999d1d883..63456e3ad11 100644
--- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp
@@ -193,9 +193,10 @@ class instance_naxxramas : public InstanceMapScript
switch (eventId)
{
case EVENT_THADDIUS_BEGIN_RESET:
- if (!source->ToCreature() || source->ToCreature()->GetEntry() != NPC_THADDIUS)
- return;
- events.ScheduleEvent(EVENT_THADDIUS_RESET, 30 * IN_MILLISECONDS);
+ if (GetBossState(BOSS_THADDIUS) == SPECIAL) // this is the initial spawn, we want a shorter spawn time
+ events.ScheduleEvent(EVENT_THADDIUS_RESET, 5 * IN_MILLISECONDS);
+ else
+ events.ScheduleEvent(EVENT_THADDIUS_RESET, 30 * IN_MILLISECONDS);
break;
}
}
diff --git a/src/server/scripts/Northrend/Naxxramas/naxxramas.h b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
index 9c5a4afba91..d2b99784953 100644
--- a/src/server/scripts/Northrend/Naxxramas/naxxramas.h
+++ b/src/server/scripts/Northrend/Naxxramas/naxxramas.h
@@ -175,7 +175,7 @@ enum InstanceEvents
EVENT_DIALOGUE_GOTHIK_KORTHAZZ2,
EVENT_DIALOGUE_GOTHIK_RIVENDARE2,
- // Thaddius AI requesting timed encounter respawn
+ // Thaddius AI requesting timed encounter (re-)spawn
EVENT_THADDIUS_BEGIN_RESET,
EVENT_THADDIUS_RESET,