From e67a0b1a82a0173c6100921b1bcf91b8834c9308 Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Mon, 25 Sep 2023 21:31:36 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/Spells):=20Fix=20Furious=20Howl=20n?= =?UTF-8?q?ot=20giving=20ranged=20attack=20power=20=E2=80=A6=20(#17345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rev_1695604876617457700.sql | 6 +++++ src/server/scripts/Spells/spell_hunter.cpp | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1695604876617457700.sql diff --git a/data/sql/updates/pending_db_world/rev_1695604876617457700.sql b/data/sql/updates/pending_db_world/rev_1695604876617457700.sql new file mode 100644 index 000000000..ba48608ae --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1695604876617457700.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id`= -24604 AND `ScriptName` = 'spell_hun_furious_howl'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(-24604, 'spell_hun_furious_howl'); + +DELETE FROM `spell_dbc` WHERE `ID` IN (24604, 64491, 64492, 64493, 64494, 64495, 53434); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 7f3468659..4bbb80310 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -1308,6 +1308,29 @@ class spell_hun_bestial_wrath : public SpellScript } }; +class spell_hun_furious_howl : public SpellScript +{ + PrepareSpellScript(spell_hun_furious_howl); + + bool Load() override + { + return GetCaster()->IsPet(); + } + + void FilterTargets(std::list& targets) + { + targets.remove_if([&](WorldObject const* target) -> bool + { + return target != GetCaster() && target != GetCaster()->ToPet()->GetOwner(); + }); + } + + void Register() override + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hun_furious_howl::FilterTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_PARTY); + } +}; + void AddSC_hunter_spell_scripts() { RegisterSpellScript(spell_hun_check_pet_los); @@ -1338,4 +1361,5 @@ void AddSC_hunter_spell_scripts() RegisterSpellScript(spell_hun_lock_and_load); RegisterSpellScript(spell_hun_intimidation); RegisterSpellScript(spell_hun_bestial_wrath); + RegisterSpellScript(spell_hun_furious_howl); }