From 9f5c017e340a289ca1b9b4f5cd2f4a7c4275b651 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 13 Jun 2023 05:01:54 -0400 Subject: [PATCH] Scripts/Spells: Implement Empowered Renew Port From (https://github.com/TrinityCore/TrinityCore/commit/7d15ec0de8e93d77be0ad6a6691588c32040f772) --- Source/Scripts/Spells/Priest.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Source/Scripts/Spells/Priest.cs b/Source/Scripts/Spells/Priest.cs index af737c9fa..4932df01b 100644 --- a/Source/Scripts/Spells/Priest.cs +++ b/Source/Scripts/Spells/Priest.cs @@ -41,6 +41,7 @@ namespace Scripts.Spells.Priest public const uint DivineStarShadowDamage = 390845; public const uint DivineStarShadowHeal = 390981; public const uint DivineWrath = 40441; + public const uint EmpoweredRenewHeal = 391359; public const uint FlashHeal = 2061; public const uint GuardianSpiritHeal = 48153; public const uint HaloHoly = 120517; @@ -502,6 +503,35 @@ namespace Scripts.Spells.Priest }); } } + + [Script] // 391339 - Empowered Renew + class spell_pri_empowered_renew : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.Renew, SpellIds.EmpoweredRenewHeal) + && ValidateSpellEffect(SpellIds.Renew, 0) + && Global.SpellMgr.GetSpellInfo(SpellIds.Renew, Difficulty.None).GetEffect(0).IsAura(AuraType.PeriodicHeal); + } + + void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + Unit caster = eventInfo.GetActor(); + Unit target = eventInfo.GetProcTarget(); + + SpellInfo renewSpellInfo = Global.SpellMgr.GetSpellInfo(SpellIds.Renew, GetCastDifficulty()); + SpellEffectInfo renewEffect = renewSpellInfo.GetEffect(0); + int estimatedTotalHeal = (int)AuraEffect.CalculateEstimatedfTotalPeriodicAmount(caster, target, renewSpellInfo, renewEffect, renewEffect.CalcValue(caster), 1); + int healAmount = MathFunctions.CalculatePct(estimatedTotalHeal, aurEff.GetAmount()); + + caster.CastSpell(target, SpellIds.EmpoweredRenewHeal, new CastSpellExtraArgs(aurEff).AddSpellMod(SpellValueMod.BasePoint0, healAmount)); + } + + public override void Register() + { + OnEffectProc.Add(new EffectProcHandler(HandleProc, 0, AuraType.Dummy)); + } + } [Script] // 47788 - Guardian Spirit class spell_pri_guardian_spirit : AuraScript