From dd647da913ef99ab3a0a86ac8f1ab2adb3acc621 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Tue, 5 Sep 2023 02:20:09 +0200 Subject: [PATCH] fix(Scripts/MagtheridonsLair): make it so no attack is being done during Quake and fix p1 cheese tactic (#17136) * initial - adds condition for taunt speech - makes it so no attack happens whatsoever during quake * fix p1 channeler skip bug * initialise channelers * doforallminions * thisiswhathappenswhenyoucodeinbrowser * Update src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp --------- Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> --- .../MagtheridonsLair/boss_magtheridon.cpp | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 132af1a6c..0c5c70a2c 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -102,12 +102,16 @@ struct boss_magtheridon : public BossAI BossAI::Reset(); _channelersKilled = 0; _currentPhase = 0; + _castingQuake = false; _recentlySpoken = false; _magReleased = false; _interruptScheduler.CancelAll(); scheduler.Schedule(90s, [this](TaskContext context) { - Talk(SAY_TAUNT); + if (!me->IsEngaged()) + { + Talk(SAY_TAUNT); + } context.Repeat(90s); }); DoCastSelf(SPELL_SHADOW_CAGE, true); @@ -182,9 +186,18 @@ struct boss_magtheridon : public BossAI context.Repeat(11s, 39s); }).Schedule(40s, [this](TaskContext context) { - DoCastSelf(SPELL_QUAKE); //needs fixes with custom spell + DoCastSelf(SPELL_QUAKE); + _castingQuake = true; + me->GetMotionMaster()->Clear(); + me->SetReactState(REACT_PASSIVE); + me->SetOrientation(me->GetAngle(me->GetVictim())); + me->SetTarget(ObjectGuid::Empty); + scheduler.DelayAll(6999ms); scheduler.Schedule(7s, [this](TaskContext /*context*/) { + _castingQuake = false; + me->SetReactState(REACT_AGGRESSIVE); + me->GetMotionMaster()->MoveChase(me->GetVictim()); DoCastSelf(SPELL_BLAST_NOVA); _interruptScheduler.Schedule(50ms, GROUP_INTERRUPT_CHECK, [this](TaskContext context) @@ -234,6 +247,10 @@ struct boss_magtheridon : public BossAI BossAI::JustEngagedWith(who); Talk(SAY_EMOTE_BEGIN); + instance->DoForAllMinions(TYPE_MAGTHERIDON, [&](Creature* creature) { + creature->SetInCombatWithZone(); + }); + scheduler.Schedule(60s, GROUP_EARLY_RELEASE_CHECK, [this](TaskContext /*context*/) { Talk(SAY_EMOTE_NEARLY); @@ -256,13 +273,14 @@ struct boss_magtheridon : public BossAI scheduler.Update(diff); _interruptScheduler.Update(diff); - if (_currentPhase != 1) + if (_currentPhase != 1 && !_castingQuake) { DoMeleeAttackIfReady(); } } private: + bool _castingQuake; bool _recentlySpoken; bool _magReleased; uint8 _currentPhase;