From 79ec83d03e0a9534331606f1223bcf62a51fd4f7 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:12:19 -0300 Subject: [PATCH] fix(Scripts/Hyjal): Fix Azgalor Doom targetting tanks since its an AoE spell (#19012) * fix(Scripts/Hyjal): Fix Azgalor Doom targetting tanks since its an AoE spell * Update boss_azgalor.cpp --- .../BattleForMountHyjal/boss_azgalor.cpp | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 4bf335c9d..0b0353ea8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -70,7 +70,7 @@ public: context.Repeat(18s, 20s); }).Schedule(45s, 55s, [this](TaskContext context) { - DoCastRandomTarget(SPELL_DOOM, 1, 100.f, true, false, false); + DoCastAOE(SPELL_DOOM); Talk(SAY_DOOM); context.Repeat(); }).Schedule(10min, [this](TaskContext context) @@ -118,9 +118,27 @@ private: bool _recentlySpoken; }; -class spell_azgalor_doom : public AuraScript +class spell_azgalor_doom : public SpellScript { - PrepareAuraScript(spell_azgalor_doom); + PrepareSpellScript(spell_azgalor_doom); + + void FilterTargets(std::list& targets) + { + if (Unit* victim = GetCaster()->GetVictim()) + { + targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true)); + } + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_azgalor_doom::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } +}; + +class spell_azgalor_doom_aura : public AuraScript +{ + PrepareAuraScript(spell_azgalor_doom_aura); void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { @@ -133,12 +151,12 @@ class spell_azgalor_doom : public AuraScript void Register() override { - OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_azgalor_doom_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; void AddSC_boss_azgalor() { RegisterHyjalAI(boss_azgalor); - RegisterSpellScript(spell_azgalor_doom); + RegisterSpellAndAuraScriptPair(spell_azgalor_doom, spell_azgalor_doom_aura); }