From b1f53e19b000459e6c9d7a50a5c27b4b9aa687a1 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Wed, 24 Aug 2022 23:36:04 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/RuinsOfAhnQiraj):=20Anubisath=20Def?= =?UTF-8?q?ender's=20shadow=20storm=20shoul=E2=80=A6=20(#12844)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/RuinsOfAhnQiraj): Anubisath Defender's shadow storm should not hit enemies within 25 yards --- .../rev_1661394337244924700.sql | 5 +++++ .../RuinsOfAhnQiraj/boss_ossirian.cpp | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1661394337244924700.sql diff --git a/data/sql/updates/pending_db_world/rev_1661394337244924700.sql b/data/sql/updates/pending_db_world/rev_1661394337244924700.sql new file mode 100644 index 000000000..c324c701f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1661394337244924700.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` IN (26546, 26555); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(26546, 'spell_aq_shadow_storm'), +(26555, 'spell_aq_shadow_storm'); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 91258c5c1..004665c1e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -470,10 +470,30 @@ class spell_crystal_weakness : public SpellScript } }; +class spell_aq_shadow_storm : public SpellScript +{ + PrepareSpellScript(spell_aq_shadow_storm); + + void FilterTargets(std::list& targets) + { + Unit* caster = GetCaster(); + targets.remove_if([caster](WorldObject const* obj) + { + return caster->GetExactDist2d(obj) < 25.0f; + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_aq_shadow_storm::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } +}; + void AddSC_boss_ossirian() { RegisterRuinsOfAhnQirajCreatureAI(boss_ossirian); new go_ossirian_crystal(); RegisterCreatureAI(npc_anubisath_guardian); RegisterSpellScript(spell_crystal_weakness); + RegisterSpellScript(spell_aq_shadow_storm); }