diff options
author | Ovahlord <dreadkiller@gmx.de> | 2024-11-29 17:35:00 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-11-29 17:35:00 +0100 |
commit | dfb26231fb598d2a034ddf39b519f4995794c1b6 (patch) | |
tree | 063c47f18a88b72a12ddc9b4941b63411bd3fbc6 | |
parent | 592ab3146320afbc720e04157ddeb50d686cbc41 (diff) |
Core/Spells: moved Cobra Shot's spell_linked_spell fix to spell scripts
-rw-r--r-- | sql/updates/world/cata_classic/2024_11_29_01_world.sql | 5 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sql/updates/world/cata_classic/2024_11_29_01_world.sql b/sql/updates/world/cata_classic/2024_11_29_01_world.sql new file mode 100644 index 00000000000..fc1ec150afc --- /dev/null +++ b/sql/updates/world/cata_classic/2024_11_29_01_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_hun_cobra_shot'; +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 77767; + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(77767, 'spell_hun_cobra_shot'); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 12797725746..21bc3d7f8dd 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -106,11 +106,33 @@ namespace Scripts::Spells::Hunter OnEffectLaunchTarget += SpellEffectFn(spell_hun_steady_shot::HandleEnergize, EFFECT_0, SPELL_EFFECT_NORMALIZED_WEAPON_DMG); } }; + + // 77767 - Cobra Shot + class spell_hun_cobra_shot: public SpellScript + { + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HUN_STEADY_SHOT_ENERGIZE }); + } + + // Cast the energize spell when successfully launching the spell against a target. Will not trigger when the target is missed (intentional) + // Despite the energize spell being called 'Steady Shot', it's also being used by Cobra Shot + void HandleEnergize(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(nullptr, SPELL_HUN_STEADY_SHOT_ENERGIZE, CastSpellExtraArgs(TRIGGERED_FULL_MASK)); + } + + void Register() override + { + OnEffectLaunchTarget += SpellEffectFn(spell_hun_cobra_shot::HandleEnergize, EFFECT_0, SPELL_EFFECT_NORMALIZED_WEAPON_DMG); + } + }; } void AddSC_hunter_spell_scripts() { using namespace Scripts::Spells::Hunter; + RegisterSpellScript(spell_hun_cobra_shot); RegisterSpellScript(spell_hun_improved_steady_shot); RegisterSpellScript(spell_hun_steady_shot); } |