From 40ba30a61c6164966fb044e52457677a39df4250 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 19 Aug 2024 12:27:21 -0400 Subject: [PATCH] Scripts/Items: Updated Amalgam's Seventh Spine script - fixed auras lingering after removal and added new case for evokers Port From (https://github.com/TrinityCore/TrinityCore/commit/250984a7b7b9016fc675dd4cfe0d29d164cc61bd) --- Source/Scripts/Spells/Item.cs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Source/Scripts/Spells/Item.cs b/Source/Scripts/Spells/Item.cs index 6cf221907..a303f6b2a 100644 --- a/Source/Scripts/Spells/Item.cs +++ b/Source/Scripts/Spells/Item.cs @@ -3877,13 +3877,14 @@ namespace Scripts.Spells.Azerite const uint SpellFragileEchoesPaladin = 225297; const uint SpellFragileEchoesDruid = 225298; const uint SpellFragileEchoesPriestHoly = 225366; + const uint SpellFragileEchoesEvoker = 429020; public override bool Validate(SpellInfo spellInfo) { - return ValidateSpellInfo(SpellFragileEchoesMonk, SpellFragileEchoesShaman, SpellFragileEchoesPriestDiscipline, SpellFragileEchoesPaladin, SpellFragileEchoesDruid, SpellFragileEchoesPriestHoly); + return ValidateSpellInfo(SpellFragileEchoesMonk, SpellFragileEchoesShaman, SpellFragileEchoesPriestDiscipline, SpellFragileEchoesPaladin, SpellFragileEchoesDruid, SpellFragileEchoesPriestHoly, SpellFragileEchoesEvoker); } - void UpdateSpecAura() + void UpdateSpecAura(bool apply) { Player target = GetUnitOwner().ToPlayer(); if (target == null) @@ -3891,7 +3892,7 @@ namespace Scripts.Spells.Azerite void updateAuraIfInCorrectSpec(ChrSpecialization spec, uint aura) { - if (target.GetPrimarySpecialization() != spec) + if (!apply || target.GetPrimarySpecialization() != spec) target.RemoveAurasDueToSpell(aura); else if (!target.HasAura(aura)) target.CastSpell(target, aura, GetEffect(0)); @@ -3915,14 +3916,28 @@ namespace Scripts.Spells.Azerite case Class.Druid: updateAuraIfInCorrectSpec(ChrSpecialization.DruidRestoration, SpellFragileEchoesDruid); break; + case Class.Evoker: + updateAuraIfInCorrectSpec(ChrSpecialization.EvokerPreservation, SpellFragileEchoesEvoker); + break; default: break; } } + void HandleHeartbeat() + { + UpdateSpecAura(true); + } + + void HandleRemove(AuraEffect aurEff, AuraEffectHandleModes mode) + { + UpdateSpecAura(false); + } + public override void Register() { - OnHeartbeat.Add(new(UpdateSpecAura)); + OnHeartbeat.Add(new(HandleHeartbeat)); + AfterEffectRemove.Add(new(HandleRemove, 0, AuraType.Dummy, AuraEffectHandleModes.Real)); } }