aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-04-27 19:58:00 +0200
committerShauren <shauren.trinity@gmail.com>2024-04-27 19:58:00 +0200
commit250984a7b7b9016fc675dd4cfe0d29d164cc61bd (patch)
treee5ef2433579ca2fa0b99dcabd4bedda4900d6307 /src
parent55ce5b150f716b6d470af80a9c31adf78e4cc198 (diff)
Scripts/Items: Updated Amalgam's Seventh Spine script - fixed auras lingering after removal and added new case for evokers
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 1bc95391071..347d8936474 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -4308,6 +4308,7 @@ enum AmalgamsSeventhSpine
SPELL_FRAGILE_ECHOES_PALADIN = 225297,
SPELL_FRAGILE_ECHOES_DRUID = 225298,
SPELL_FRAGILE_ECHOES_PRIEST_HOLY = 225366,
+ SPELL_FRAGILE_ECHOES_EVOKER = 429020,
SPELL_FRAGILE_ECHO_ENERGIZE = 215270,
};
@@ -4316,17 +4317,19 @@ class spell_item_amalgams_seventh_spine : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({
+ return ValidateSpellInfo
+ ({
SPELL_FRAGILE_ECHOES_MONK,
SPELL_FRAGILE_ECHOES_SHAMAN,
SPELL_FRAGILE_ECHOES_PRIEST_DISCIPLINE,
SPELL_FRAGILE_ECHOES_PALADIN,
SPELL_FRAGILE_ECHOES_DRUID,
- SPELL_FRAGILE_ECHOES_PRIEST_HOLY
+ SPELL_FRAGILE_ECHOES_PRIEST_HOLY,
+ SPELL_FRAGILE_ECHOES_EVOKER
});
}
- void UpdateSpecAura()
+ void UpdateSpecAura(bool apply) const
{
Player* target = GetUnitOwner()->ToPlayer();
if (!target)
@@ -4334,7 +4337,7 @@ class spell_item_amalgams_seventh_spine : public AuraScript
auto updateAuraIfInCorrectSpec = [&](ChrSpecialization spec, AmalgamsSeventhSpine aura)
{
- if (target->GetPrimarySpecialization() != spec)
+ if (!apply || target->GetPrimarySpecialization() != spec)
target->RemoveAurasDueToSpell(aura);
else if (!target->HasAura(aura))
target->CastSpell(target, aura, GetEffect(EFFECT_0));
@@ -4358,14 +4361,28 @@ class spell_item_amalgams_seventh_spine : public AuraScript
case CLASS_DRUID:
updateAuraIfInCorrectSpec(ChrSpecialization::DruidRestoration, SPELL_FRAGILE_ECHOES_DRUID);
break;
+ case CLASS_EVOKER:
+ updateAuraIfInCorrectSpec(ChrSpecialization::EvokerPreservation, SPELL_FRAGILE_ECHOES_EVOKER);
+ break;
default:
break;
}
}
+ void HandleHeartbeat() const
+ {
+ UpdateSpecAura(true);
+ }
+
+ void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
+ {
+ UpdateSpecAura(false);
+ }
+
void Register() override
{
- OnHeartbeat += AuraHeartbeatFn(spell_item_amalgams_seventh_spine::UpdateSpecAura);
+ OnHeartbeat += AuraHeartbeatFn(spell_item_amalgams_seventh_spine::HandleHeartbeat);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_item_amalgams_seventh_spine::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
@@ -4377,7 +4394,7 @@ class spell_item_amalgams_seventh_spine_mana_restore : public AuraScript
return ValidateSpellInfo({ SPELL_FRAGILE_ECHO_ENERGIZE });
}
- void TriggerManaRestoration(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ void TriggerManaRestoration(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;