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)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user