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:
@@ -0,0 +1,5 @@
|
|||||||
|
-- Cobra Strikes spell script bindings
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` IN (-53256, 53257);
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(-53256, 'spell_hun_cobra_strikes'),
|
||||||
|
(53257, 'spell_hun_cobra_strikes_triggered');
|
||||||
@@ -13040,6 +13040,23 @@ void Unit::TriggerAurasProcOnEvent(std::list<AuraApplication*>* myProcAuras, std
|
|||||||
AuraApplicationProcContainer myAurasTriggeringProc;
|
AuraApplicationProcContainer myAurasTriggeringProc;
|
||||||
GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, myProcAuras, myProcEventInfo);
|
GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, myProcAuras, myProcEventInfo);
|
||||||
|
|
||||||
|
// needed for example for Cobra Strikes, pet does the attack, but aura is on owner
|
||||||
|
if (Player* modOwner = GetSpellModOwner())
|
||||||
|
{
|
||||||
|
if (modOwner != this && spell)
|
||||||
|
{
|
||||||
|
std::list<AuraApplication*> modAuras;
|
||||||
|
for (auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
|
||||||
|
{
|
||||||
|
if (spell->m_appliedMods.count(itr->second->GetBase()) != 0)
|
||||||
|
modAuras.push_back(itr->second);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!modAuras.empty())
|
||||||
|
modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// prepare data for target trigger
|
// prepare data for target trigger
|
||||||
ProcEventInfo targetProcEventInfo = ProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
|
ProcEventInfo targetProcEventInfo = ProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
|
||||||
AuraApplicationProcContainer targetAurasTriggeringProc;
|
AuraApplicationProcContainer targetAurasTriggeringProc;
|
||||||
|
|||||||
@@ -1313,10 +1313,10 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
|
|||||||
if (affectSpell->SpellFamilyName != SpellFamilyName)
|
if (affectSpell->SpellFamilyName != SpellFamilyName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mod->mask & SpellFamilyFlags)
|
if (mod->mask && !(mod->mask & SpellFamilyFlags))
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
|
||||||
|
|||||||
@@ -652,13 +652,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
|||||||
spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
|
spellInfo->AttributesEx3 |= SPELL_ATTR3_ALWAYS_HIT;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Cobra Strikes
|
|
||||||
ApplySpellFix({ 53257 }, [](SpellInfo* spellInfo)
|
|
||||||
{
|
|
||||||
spellInfo->ProcCharges = 2;
|
|
||||||
spellInfo->StackAmount = 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Kill Command
|
// Kill Command
|
||||||
// Kill Command, Overpower
|
// Kill Command, Overpower
|
||||||
ApplySpellFix({ 34027, 37529 }, [](SpellInfo* spellInfo)
|
ApplySpellFix({ 34027, 37529 }, [](SpellInfo* spellInfo)
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ enum HunterSpells
|
|||||||
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
|
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1 = 56654,
|
||||||
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 = 58882,
|
SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 = 58882,
|
||||||
SPELL_HUNTER_PIERCING_SHOTS = 63468,
|
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
|
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
|
// 781 - Disengage
|
||||||
class spell_hun_disengage : public SpellScript
|
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_aspect_of_the_beast);
|
||||||
RegisterSpellScript(spell_hun_ascpect_of_the_viper);
|
RegisterSpellScript(spell_hun_ascpect_of_the_viper);
|
||||||
RegisterSpellScript(spell_hun_chimera_shot);
|
RegisterSpellScript(spell_hun_chimera_shot);
|
||||||
|
RegisterSpellScript(spell_hun_cobra_strikes);
|
||||||
|
RegisterSpellScript(spell_hun_cobra_strikes_triggered);
|
||||||
RegisterSpellScript(spell_hun_disengage);
|
RegisterSpellScript(spell_hun_disengage);
|
||||||
RegisterSpellScript(spell_hun_improved_mend_pet);
|
RegisterSpellScript(spell_hun_improved_mend_pet);
|
||||||
RegisterSpellScript(spell_hun_invigoration);
|
RegisterSpellScript(spell_hun_invigoration);
|
||||||
|
|||||||
Reference in New Issue
Block a user