From b94851b824f6e4d7f7a7cd01a4c99e02b1e86b97 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 13 Mar 2021 01:02:48 +0100 Subject: Scripts/Spells: Fixed Fingers of Frost proc passive Closes #19589 --- src/server/scripts/Spells/spell_mage.cpp | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src') diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 5e0cd6e682b..8dc3e31f781 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -278,6 +278,42 @@ class spell_mage_conjure_refreshment : public SpellScript } }; +// 112965 - Fingers of Frost +class spell_mage_fingers_of_frost : public AuraScript +{ + PrepareAuraScript(spell_mage_fingers_of_frost); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_FINGERS_OF_FROST }); + } + + bool CheckFrostboltProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + return eventInfo.GetSpellInfo() && eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_MAGE, flag128(0, 0x2000000, 0, 0)) + && roll_chance_i(aurEff->GetAmount()); + } + + bool CheckFrozenOrbProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + return eventInfo.GetSpellInfo() && eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_MAGE, flag128(0, 0, 0x80, 0)) + && roll_chance_i(aurEff->GetAmount()); + } + + void Trigger(AuraEffect* aurEff, ProcEventInfo& eventInfo) + { + eventInfo.GetActor()->CastSpell(GetTarget(), SPELL_MAGE_FINGERS_OF_FROST, true, nullptr, aurEff); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_mage_fingers_of_frost::CheckFrostboltProc, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_mage_fingers_of_frost::CheckFrozenOrbProc, EFFECT_1, SPELL_AURA_DUMMY); + AfterEffectProc += AuraEffectProcFn(spell_mage_fingers_of_frost::Trigger, EFFECT_0, SPELL_AURA_DUMMY); + AfterEffectProc += AuraEffectProcFn(spell_mage_fingers_of_frost::Trigger, EFFECT_1, SPELL_AURA_DUMMY); + } +}; + // 11426 - Ice Barrier class spell_mage_ice_barrier : public AuraScript { @@ -831,6 +867,7 @@ void AddSC_mage_spell_scripts() RegisterSpellScript(spell_mage_cold_snap); RegisterSpellScript(spell_mage_cone_of_cold); RegisterSpellScript(spell_mage_conjure_refreshment); + RegisterAuraScript(spell_mage_fingers_of_frost); RegisterAuraScript(spell_mage_ice_barrier); RegisterSpellScript(spell_mage_ice_lance); RegisterSpellScript(spell_mage_ice_lance_damage); -- cgit v1.2.3