From 1009fac05f4a732c4bddf0947c5c803f60711bac Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 2 May 2023 17:08:57 -0400 Subject: [PATCH] Scripts/Spells: Added proc requirements to a few auras that have SPELL_ATTR3_CAN_PROC_FROM_PROCS attribute Port From (https://github.com/TrinityCore/TrinityCore/commit/fe38437e67cf7a17911ba6d783466e0a3874535f) --- Source/Scripts/Spells/Azerite.cs | 28 ++++++++++++++++++++++++++++ Source/Scripts/Spells/Items.cs | 19 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/Source/Scripts/Spells/Azerite.cs b/Source/Scripts/Spells/Azerite.cs index bed7ed871..4842d51cb 100644 --- a/Source/Scripts/Spells/Azerite.cs +++ b/Source/Scripts/Spells/Azerite.cs @@ -44,6 +44,9 @@ namespace Scripts.Spells.Azerite // Echoing Blades public const uint EchoingBladesTrait = 287649; + // Hour of Reaping + + public const uint DHSoulBarrier = 263648; } [Script] @@ -438,6 +441,31 @@ namespace Scripts.Spells.Azerite } } + [Script] // 288882 - Hour of Reaping + class spell_item_hour_of_reaping : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.DHSoulBarrier); + } + + bool CheckProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + return GetStackAmount() == GetAura().CalcMaxStackAmount(); + } + + void TriggerSoulBarrier(AuraEffect aurEff, ProcEventInfo procInfo) + { + GetTarget().CastSpell(GetTarget(), SpellIds.DHSoulBarrier, new CastSpellExtraArgs(aurEff)); + } + + public override void Register() + { + DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckProc, 0, AuraType.Dummy)); + AfterEffectProc.Add(new EffectProcHandler(TriggerSoulBarrier, 0, AuraType.Dummy)); + } + } + [Script] // 277253 - Heart of Azeroth class spell_item_heart_of_azeroth : AuraScript { diff --git a/Source/Scripts/Spells/Items.cs b/Source/Scripts/Spells/Items.cs index 25561c666..93def30a8 100644 --- a/Source/Scripts/Spells/Items.cs +++ b/Source/Scripts/Spells/Items.cs @@ -4205,4 +4205,23 @@ namespace Scripts.Spells.Items AfterHit.Add(new HitHandler(TriggerAdditionalDamage)); } } + + [Script] // 295175 - Spiteful Binding + class spell_item_grips_of_forsaken_sanity : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return spellInfo.GetEffects().Count > 1; + } + + bool CheckHealth(AuraEffect aurEff, ProcEventInfo eventInfo) + { + return eventInfo.GetActor().GetHealthPct() >= (float)GetEffectInfo(1).CalcValue(); + } + + public override void Register() + { + DoCheckEffectProc.Add(new CheckEffectProcHandler(CheckHealth, 0, AuraType.ProcTriggerSpell)); + } + } }