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>
This commit is contained in:
Dan
2023-09-05 02:20:09 +02:00
committed by GitHub
parent 0c90bfcf70
commit dd647da913

View File

@@ -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;