aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp10
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
3 files changed, 11 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index 24e2c2dbfc2..2bb9799bedf 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -586,7 +586,7 @@ enum AuraType : uint32
SPELL_AURA_492 = 492,
SPELL_AURA_493 = 493, // 1 spell, 267116 - Animal Companion (modifies Call Pet)
SPELL_AURA_SET_POWER_POINT_CHARGE = 494, // NYI
- SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE = 495, // NYI
+ SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE = 495,
SPELL_AURA_ALLOW_CHANGING_EQUIPMENT_IN_TORGHAST = 496, // NYI
SPELL_AURA_MOD_ANIMA_GAIN = 497, // NYI
SPELL_AURA_CURRENCY_LOSS_PCT_ON_DEATH = 498, // NYI
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 5139d05c562..9a5df6d08dd 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -563,7 +563,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //492
&AuraEffect::HandleNULL, //493
&AuraEffect::HandleNULL, //494 SPELL_AURA_SET_POWER_POINT_CHARGE
- &AuraEffect::HandleNULL, //495 SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE
+ &AuraEffect::HandleTriggerSpellOnExpire, //495 SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE
&AuraEffect::HandleNULL, //496 SPELL_AURA_ALLOW_CHANGING_EQUIPMENT_IN_TORGHAST
&AuraEffect::HandleNULL, //497 SPELL_AURA_MOD_ANIMA_GAIN
&AuraEffect::HandleNULL, //498 SPELL_AURA_CURRENCY_LOSS_PCT_ON_DEATH
@@ -4998,6 +4998,14 @@ void AuraEffect::HandleTriggerSpellOnPowerAmount(AuraApplication const* aurApp,
target->CastSpell(target, triggerSpell, this);
}
+void AuraEffect::HandleTriggerSpellOnExpire(AuraApplication const* aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL) || apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ aurApp->GetTarget()->CastSpell(aurApp->GetTarget(), GetSpellEffectInfo().TriggerSpell, this);
+}
+
void AuraEffect::HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index b63f50e8f67..a85ea1fc14c 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -320,6 +320,7 @@ class TC_GAME_API AuraEffect
void HandleBattlegroundPlayerPosition(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleTriggerSpellOnPowerAmount(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleTriggerSpellOnPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleTriggerSpellOnExpire(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleStoreTeleportReturnPoint(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleMountRestrictions(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleCosmeticMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const;