fix(Core/Spells): Fix Cobra Strikes stack consumption (#24906)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: TrinityCore <TrinityCore@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-02-27 08:42:17 -06:00
committed by GitHub
parent 74dd60a7b1
commit 396c35be2f
5 changed files with 72 additions and 11 deletions

View File

@@ -78,7 +78,8 @@ enum HunterSpells
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 = 58882,
SPELL_HUNTER_PIERCING_SHOTS = 63468,
SPELL_HUNTER_T9_4P_GREATNESS = 68130
SPELL_HUNTER_T9_4P_GREATNESS = 68130,
SPELL_HUNTER_COBRA_STRIKES_TRIGGERED = 53257
};
enum HunterSpellIcons
@@ -934,6 +935,49 @@ class spell_hun_misdirection_proc : public AuraScript
}
};
// -53256 - Cobra Strikes (talent)
class spell_hun_cobra_strikes : public AuraScript
{
PrepareAuraScript(spell_hun_cobra_strikes);
bool Validate(SpellInfo const* spellInfo) override
{
return ValidateSpellInfo({ spellInfo->Effects[EFFECT_0].TriggerSpell });
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell);
if (!triggeredSpellInfo)
return;
GetTarget()->CastCustomSpell(triggeredSpellInfo->Id, SPELLVALUE_AURA_STACK, triggeredSpellInfo->StackAmount, GetTarget(), true);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_hun_cobra_strikes::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 53257 - Cobra Strikes (triggered buff)
class spell_hun_cobra_strikes_triggered : public AuraScript
{
PrepareAuraScript(spell_hun_cobra_strikes_triggered);
void HandleStackDrop(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
{
ModStackAmount(-1);
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_hun_cobra_strikes_triggered::HandleStackDrop, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
}
};
// 781 - Disengage
class spell_hun_disengage : public SpellScript
{
@@ -1633,6 +1677,8 @@ void AddSC_hunter_spell_scripts()
RegisterSpellScript(spell_hun_aspect_of_the_beast);
RegisterSpellScript(spell_hun_ascpect_of_the_viper);
RegisterSpellScript(spell_hun_chimera_shot);
RegisterSpellScript(spell_hun_cobra_strikes);
RegisterSpellScript(spell_hun_cobra_strikes_triggered);
RegisterSpellScript(spell_hun_disengage);
RegisterSpellScript(spell_hun_improved_mend_pet);
RegisterSpellScript(spell_hun_invigoration);