From 369e92b6b2d993a8d00c807f1e5921a2520fe193 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 27 Feb 2024 14:00:45 -0500 Subject: [PATCH] Scripts/Spells: Fix DK talent Permafrost Port From (https://github.com/TrinityCore/TrinityCore/commit/24539e8d2779f6181d578009907982808edcd497) --- Source/Scripts/Spells/DeathKnight.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Source/Scripts/Spells/DeathKnight.cs b/Source/Scripts/Spells/DeathKnight.cs index 3764a9e1e..cf78a4efe 100644 --- a/Source/Scripts/Spells/DeathKnight.cs +++ b/Source/Scripts/Spells/DeathKnight.cs @@ -40,6 +40,7 @@ namespace Scripts.Spells.DeathKnight public const uint Frost = 137006; public const uint FrostFever = 55095; public const uint FrostScythe = 207230; + public const uint FrostShield = 207203; public const uint GlyphOfFoulMenagerie = 58642; public const uint GlyphOfTheGeist = 58640; public const uint GlyphOfTheSkeleton = 146652; @@ -682,6 +683,27 @@ namespace Scripts.Spells.DeathKnight } } + [Script] // 207200 - Permafrost + class spell_dk_permafrost : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.FrostShield); + } + + void HandleEffectProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + CastSpellExtraArgs args = new(aurEff); + args.AddSpellMod(SpellValueMod.BasePoint0, (int)MathFunctions.CalculatePct(eventInfo.GetDamageInfo().GetDamage(), aurEff.GetAmount())); + GetTarget().CastSpell(GetTarget(), SpellIds.FrostShield, args); + } + + public override void Register() + { + OnEffectProc.Add(new(HandleEffectProc, 0, AuraType.Dummy)); + } + } + // 121916 - Glyph of the Geist (Unholy) [Script] /// 6.x, does this belong here or in spell_generic? apply this in creature_template_addon? sniffs say this is always cast on raise dead. class spell_dk_pet_geist_transform : SpellScript