aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2024-11-29 17:35:00 +0100
committerOvahlord <dreadkiller@gmx.de>2024-11-29 17:35:00 +0100
commitdfb26231fb598d2a034ddf39b519f4995794c1b6 (patch)
tree063c47f18a88b72a12ddc9b4941b63411bd3fbc6 /src
parent592ab3146320afbc720e04157ddeb50d686cbc41 (diff)
Core/Spells: moved Cobra Shot's spell_linked_spell fix to spell scripts
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp22
1 files changed, 22 insertions, 0 deletions
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);
}