mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Merge pull request #15899 from Treeston/3.3.5-thaddius
Scripts/Naxxramas: Thaddius follow-up
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user