From 3e1448ddc184dfd8b08711543e04f68ba92d1007 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 23 May 2023 08:10:51 -0400 Subject: [PATCH] Spells/Scripts: Implement Critical Thinking Port From (https://github.com/TrinityCore/TrinityCore/commit/f0aa85c99e79ed353d69f5dd1f760a4fdc339650) --- Source/Scripts/Spells/Warrior.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Scripts/Spells/Warrior.cs b/Source/Scripts/Spells/Warrior.cs index fc271221f..36f7c0730 100644 --- a/Source/Scripts/Spells/Warrior.cs +++ b/Source/Scripts/Spells/Warrior.cs @@ -24,6 +24,7 @@ namespace Scripts.Spells.Warrior public const uint ChargeSlowEffect = 236027; public const uint ColossusSmash = 167105; public const uint ColossusSmashAura = 208086; + public const uint CriticalThinkingEnergize = 392776; public const uint Execute = 20647; public const uint FueledByViolenceHeal = 383104; public const uint GlyphOfTheBlazingTrail = 123779; @@ -232,6 +233,28 @@ namespace Scripts.Spells.Warrior } } + [Script] // 389306 - Critical Thinking + class spell_warr_critical_thinking : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.CriticalThinkingEnergize); + } + + void HandleProc(AuraEffect aurEff, ProcEventInfo eventInfo) + { + int? rageCost = eventInfo.GetProcSpell().GetPowerTypeCostAmount(PowerType.Rage); + if (rageCost.HasValue) + GetTarget().CastSpell((WorldObject)null, SpellIds.CriticalThinkingEnergize, new CastSpellExtraArgs(TriggerCastFlags.FullMask) + .AddSpellMod(SpellValueMod.BasePoint0, MathFunctions.CalculatePct(rageCost.Value, aurEff.GetAmount()))); + } + + public override void Register() + { + AfterEffectProc.Add(new EffectProcHandler(HandleProc, 1, AuraType.Dummy)); + } + } + [Script] // 383103 - Fueled by Violence class spell_warr_fueled_by_violence : AuraScript {