From 7448afc043a17399fe3c4352229dff14e1de7d48 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Fri, 13 Dec 2019 23:24:25 +0100 Subject: [PATCH] Core/Spells: Heroic Leap may not target destinations that are more than 4 yards above the caster's ground position --- .../custom/custom_2019_12_13_00_world.sql | 3 +++ src/server/scripts/Spells/spell_warrior.cpp | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 sql/updates/world/custom/custom_2019_12_13_00_world.sql diff --git a/sql/updates/world/custom/custom_2019_12_13_00_world.sql b/sql/updates/world/custom/custom_2019_12_13_00_world.sql new file mode 100644 index 00000000000..e2be1d54095 --- /dev/null +++ b/sql/updates/world/custom/custom_2019_12_13_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_warr_heroic_leap'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(6544, 'spell_warr_heroic_leap'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 73229a3d94c..27e243f578a 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -1194,6 +1194,25 @@ private: uint8 _hitTargets = 0; }; +class spell_warr_heroic_leap : public SpellScript +{ + PrepareSpellScript(spell_warr_heroic_leap); + + SpellCastResult CheckLocation() + { + // The client shows an area as unreachable once the target destination is 4 yards above your position + if (!GetExplTargetDest() || GetExplTargetDest()->GetPositionZ() - GetCaster()->GetPositionZ() > 4.f) + return SPELL_FAILED_NOPATH; + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_warr_heroic_leap::CheckLocation); + } +}; + void AddSC_warrior_spell_scripts() { RegisterAuraScript(spell_warr_blood_craze); @@ -1205,6 +1224,7 @@ void AddSC_warrior_spell_scripts() RegisterSpellScript(spell_warr_devastate); new spell_warr_execute(); new spell_warr_glyph_of_sunder_armor(); + RegisterSpellScript(spell_warr_heroic_leap); new spell_warr_intimidating_shout(); new spell_warr_lambs_to_the_slaughter(); new spell_warr_last_stand();