From c0253d91a7e1a5c71f9d03dfe1d17223f5a11ced Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sun, 2 Apr 2023 09:43:50 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/SethekkHalls):=20Prevent=20pets=20f?= =?UTF-8?q?rom=20pulling=20Ikiss=20from=20behin=E2=80=A6=20(#15764)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Scripts/SethekkHalls): Prevent pets from pulling Ikiss from behind doors * Update src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp --- .../SethekkHalls/boss_talon_king_ikiss.cpp | 107 +++++++----------- 1 file changed, 39 insertions(+), 68 deletions(-) diff --git a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp index 521854100..f09f4262a 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp @@ -43,7 +43,7 @@ enum Spells struct boss_talon_king_ikiss : public BossAI { - boss_talon_king_ikiss(Creature* creature) : BossAI(creature, DATA_IKISS), _spoken(false), _manaShield(false) + boss_talon_king_ikiss(Creature* creature) : BossAI(creature, DATA_IKISS), _spoken(false) { scheduler.SetValidator([this] { @@ -55,8 +55,44 @@ struct boss_talon_king_ikiss : public BossAI { _Reset(); _spoken = false; - _manaShield = false; - _comboHealthStages.fill(false); + + ScheduleHealthCheckEvent(80, [&] { + TeleportAndCastExplosion(); + }); + + ScheduleHealthCheckEvent(50, [&] { + TeleportAndCastExplosion(); + }); + + ScheduleHealthCheckEvent(25, [&] { + TeleportAndCastExplosion(); + }); + + ScheduleHealthCheckEvent(20, [&] { + DoCast(me, SPELL_MANA_SHIELD); + }); + } + + /// @todo: remove this once pets stop going through doors. + bool CanAIAttack(Unit const* /*victim*/) const override + { + return _spoken; + } + + void TeleportAndCastExplosion() + { + me->InterruptNonMeleeSpells(false); + DoCastSelf(SPELL_ARCANE_BUBBLE, true); + DoCastAOE(SPELL_BLINK); + Talk(EMOTE_ARCANE_EXP); + + scheduler.Schedule(1s, [this](TaskContext) + { + DoCastAOE(SPELL_ARCANE_EXPLOSION); + }).Schedule(6500ms, [this](TaskContext /*context*/) + { + me->GetThreatMgr().ResetAllThreat(); + }); } void MoveInLineOfSight(Unit* who) override @@ -106,69 +142,6 @@ struct boss_talon_king_ikiss : public BossAI } } - void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override - { - if (!_comboHealthStages[0] && me->HealthBelowPctDamaged(80, damage)) - { - _comboHealthStages[0] = true; - - me->InterruptNonMeleeSpells(false); - DoCastSelf(SPELL_ARCANE_BUBBLE, true); - DoCastAOE(SPELL_BLINK); - Talk(EMOTE_ARCANE_EXP); - - scheduler.Schedule(1s, [this](TaskContext) - { - DoCastAOE(SPELL_ARCANE_EXPLOSION); - }).Schedule(6500ms, [this](TaskContext /*context*/) - { - me->GetThreatMgr().ResetAllThreat(); - }); - } - - if (!_comboHealthStages[1] && me->HealthBelowPctDamaged(50, damage)) - { - _comboHealthStages[1] = true; - - me->InterruptNonMeleeSpells(false); - DoCastSelf(SPELL_ARCANE_BUBBLE, true); - DoCastAOE(SPELL_BLINK); - Talk(EMOTE_ARCANE_EXP); - - scheduler.Schedule(1s, [this](TaskContext) - { - DoCastAOE(SPELL_ARCANE_EXPLOSION); - }).Schedule(6500ms, [this](TaskContext /*context*/) - { - me->GetThreatMgr().ResetAllThreat(); - }); - } - - if (!_comboHealthStages[2] && me->HealthBelowPctDamaged(25, damage)) - { - _comboHealthStages[2] = true; - - me->InterruptNonMeleeSpells(false); - DoCastSelf(SPELL_ARCANE_BUBBLE, true); - DoCastAOE(SPELL_BLINK); - Talk(EMOTE_ARCANE_EXP); - - scheduler.Schedule(1s, [this](TaskContext) - { - DoCastAOE(SPELL_ARCANE_EXPLOSION); - }).Schedule(6500ms, [this](TaskContext /*context*/) - { - me->GetThreatMgr().ResetAllThreat(); - }); - } - - if (!_manaShield && me->HealthBelowPctDamaged(20, damage)) - { - DoCast(me, SPELL_MANA_SHIELD); - _manaShield = true; - } - } - void KilledUnit(Unit* /*victim*/) override { if (urand(0, 1)) @@ -177,8 +150,6 @@ struct boss_talon_king_ikiss : public BossAI private: bool _spoken; - bool _manaShield; - std::array _comboHealthStages; }; // 38194 - Blink