diff options
author | Treeston <treeston.mmoc@gmail.com> | 2019-07-08 20:15:59 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-15 00:17:32 +0100 |
commit | 94916504015ce8cb3ea5da2a02f9032e9eb5b196 (patch) | |
tree | 763a25c91b24a71f0d08e913a0eb83543009e4ed /src | |
parent | fa9683fc68cd627e6b80ad7c0892598c5168e89e (diff) |
Scripts/Naxxramas: Thaddius no longer evades on transition, and some general cleanup to that script. Fixes #23026.
(cherry picked from commit f2cd721d5358f7febf36dc757f5e3e9693a6a7b6)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp | 95 |
1 files changed, 31 insertions, 64 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index c5089af75fc..ea8f4d248e1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -64,8 +64,9 @@ enum Events EVENT_REVIVE_STALAGG, // timer until stalagg is revived (if feugen still lives) EVENT_TRANSITION_1, // timer until overload emote EVENT_TRANSITION_2, // timer until thaddius gets zapped by the coils - EVENT_TRANSITION_3, // timer until thaddius engages - EVENT_ENABLE_BALL_LIGHTNING // grace period after thaddius aggro after which he starts being a baller (e.g. tossing ball lightning at out of range targets) + EVENT_TRANSITION_3, // timer until thaddius becomes attackable + EVENT_ENGAGE, // timer until thaddius engages + EVENT_ENABLE_BALL_LIGHTNING // grace period after thaddius aggro after which he starts tossing ball lightning at out of range targets }; enum Misc @@ -381,16 +382,7 @@ struct boss_thaddius : public BossAI me->RemoveAura(SPELL_THADDIUS_INACTIVE_VISUAL); me->RemoveUnitFlag(UNIT_FLAG_STUNNED); me->SetImmuneToPC(false); - me->SetReactState(REACT_AGGRESSIVE); - - DoZoneInCombat(); - if (Unit* closest = SelectTarget(SELECT_TARGET_MINDISTANCE, 0, 500.0f)) - AttackStart(closest); - else // if there is no nearest target, then there is no target, meaning we should reset - { - BeginResetEncounter(); - return; - } + DoZoneInCombat(); if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN))) feugen->AI()->DoAction(ACTION_TRANSITION_3); @@ -401,6 +393,7 @@ struct boss_thaddius : public BossAI Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_ENGAGE, 2s, 0, PHASE_THADDIUS); events.ScheduleEvent(EVENT_ENABLE_BALL_LIGHTNING, 5s, 0, PHASE_THADDIUS); events.ScheduleEvent(EVENT_SHIFT, 10s, 0, PHASE_THADDIUS); events.ScheduleEvent(EVENT_CHAIN, 10s, 20s, 0, PHASE_THADDIUS); @@ -409,6 +402,8 @@ struct boss_thaddius : public BossAI break; case EVENT_ENABLE_BALL_LIGHTNING: ballLightningUnlocked = true; + case EVENT_ENGAGE: + me->SetReactState(REACT_AGGRESSIVE); break; case EVENT_SHIFT: me->CastStop(); // shift overrides all other spells @@ -438,6 +433,7 @@ struct boss_thaddius : public BossAI break; } } + if (events.IsInPhase(PHASE_THADDIUS) && !me->HasUnitState(UNIT_STATE_CASTING) && me->isAttackReady()) { if (me->IsWithinMeleeRange(me->GetVictim())) @@ -472,35 +468,26 @@ public: struct npc_stalaggAI : public ScriptedAI { public: - npc_stalaggAI(Creature* creature) : ScriptedAI(creature), _myCoil(ObjectGuid::Empty), _myCoilGO(ObjectGuid::Empty), isOverloading(false), refreshBeam(false), isFeignDeath(false) + npc_stalaggAI(Creature* creature) : ScriptedAI(creature), + instance(creature->GetInstanceScript()), powerSurgeTimer(), _myCoil(ObjectGuid::Empty), _myCoilGO(ObjectGuid::Empty), isOverloading(false), refreshBeam(false), isFeignDeath(false) { - Initialize(); instance = creature->GetInstanceScript(); SetBoundary(instance->GetBossBoundary(BOSS_THADDIUS)); } - void Initialize() + void InitializeAI() { if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_ACTIVE); - // if the encounter reset while feigning death - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - isOverloading = false; - isFeignDeath = false; + powerSurgeTimer = 10 * IN_MILLISECONDS; // force tesla coil state refresh refreshBeam = true; - - powerSurgeTimer = 10 * IN_MILLISECONDS; } - void Reset() override + void EnterEvadeMode(EvadeReason /*reason*/) override { - if (isFeignDeath || !me->IsAlive()) - return; if (Creature* thaddius = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THADDIUS))) thaddius->AI()->DoAction(ACTION_STALAGG_RESET); } @@ -510,14 +497,6 @@ public: if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_READY); me->DespawnOrUnsummon(0, Hours(24*7)); // will be force respawned by thaddius - me->setActive(false); - me->SetFarVisible(false); - } - - void ResetEncounter() - { - me->Respawn(true); - Initialize(); } void DoAction(int32 action) override @@ -537,21 +516,18 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetReactState(REACT_AGGRESSIVE); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetControlled(false, UNIT_STATE_ROOT); Talk(EMOTE_FEIGN_REVIVE); isFeignDeath = false; refreshBeam = true; // force beam refresh - if (Creature* feugen = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_FEUGEN))) - if (feugen->GetVictim()) - { - AddThreat(feugen->EnsureVictim(), 0.0f); - me->SetInCombatWith(feugen->EnsureVictim()); - } + DoZoneInCombat(); + if (!me->IsEngaged()) + BeginResetEncounter(); break; case ACTION_TRANSITION: me->KillSelf(); // true death - me->DespawnOrUnsummon(0, Hours(24*7)); if (Creature* coil = myCoil()) { @@ -567,6 +543,7 @@ public: case ACTION_TRANSITION_3: if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_READY); + me->DespawnOrUnsummon(0, Hours(24 * 7)); break; default: break; @@ -613,10 +590,10 @@ public: me->RemoveAllAuras(); me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->StopMoving(); + me->SetControlled(true, UNIT_STATE_ROOT); me->SetStandState(UNIT_STAND_STATE_DEAD); - damage = 0; + damage = me->GetHealth()-1; // force beam refresh as we just removed auras refreshBeam = true; @@ -735,36 +712,27 @@ public: struct npc_feugenAI : public ScriptedAI { public: - npc_feugenAI(Creature* creature) : ScriptedAI(creature), _myCoil(ObjectGuid::Empty), _myCoilGO(ObjectGuid::Empty), isOverloading(false), refreshBeam(false), isFeignDeath(false) + npc_feugenAI(Creature* creature) : ScriptedAI(creature), + instance(creature->GetInstanceScript()), magneticPullTimer(), staticFieldTimer(), _myCoil(ObjectGuid::Empty), _myCoilGO(ObjectGuid::Empty), isOverloading(false), refreshBeam(false), isFeignDeath(false) { - Initialize(); instance = creature->GetInstanceScript(); SetBoundary(instance->GetBossBoundary(BOSS_THADDIUS)); } - void Initialize() + void InitializeAI() override { if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_ACTIVE); - // if the encounter reset while feigning death - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - isOverloading = false; - isFeignDeath = false; + staticFieldTimer = 6 * IN_MILLISECONDS; + magneticPullTimer = 20 * IN_MILLISECONDS; // force coil state to refresh refreshBeam = true; - - staticFieldTimer = 6 * IN_MILLISECONDS; - magneticPullTimer = 20 * IN_MILLISECONDS; } - void Reset() override + void EnterEvadeMode(EvadeReason /*why*/) override { - if (isFeignDeath || !me->IsAlive()) - return; if (Creature* thaddius = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THADDIUS))) thaddius->AI()->DoAction(ACTION_FEUGEN_RESET); } @@ -774,8 +742,6 @@ public: if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_READY); me->DespawnOrUnsummon(0, Hours(24*7)); // will be force respawned by thaddius - me->setActive(false); - me->SetFarVisible(false); } void DoAction(int32 action) override @@ -795,6 +761,7 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetReactState(REACT_AGGRESSIVE); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + me->SetControlled(false, UNIT_STATE_ROOT); Talk(EMOTE_FEIGN_REVIVE); isFeignDeath = false; @@ -811,7 +778,6 @@ public: break; case ACTION_TRANSITION: me->KillSelf(); // true death this time around - me->DespawnOrUnsummon(0, Hours(24*7)); if (Creature* coil = myCoil()) { @@ -827,6 +793,7 @@ public: case ACTION_TRANSITION_3: if (GameObject* coil = myCoilGO()) coil->SetGoState(GO_STATE_READY); + me->DespawnOrUnsummon(0, Hours(24 * 7)); default: break; } @@ -868,14 +835,14 @@ public: if (Creature* thaddius = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_THADDIUS))) thaddius->AI()->DoAction(ACTION_FEUGEN_DIED); + me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); me->RemoveAllAuras(); me->SetReactState(REACT_PASSIVE); me->AttackStop(); - me->StopMoving(); + me->SetControlled(true, UNIT_STATE_ROOT); me->SetStandState(UNIT_STAND_STATE_DEAD); - me->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - damage = 0; + damage = me->GetHealth()-1; // force beam refresh as we just removed auras refreshBeam = true; |