diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2024-03-18 22:54:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 22:54:21 +0100 |
commit | 41055c7a32bbd45cb9ab714f5cf2c5c473bf4a99 (patch) | |
tree | 054a3f34df661f412bb1aa163551298ac3ab73de /src | |
parent | ad3475cbe98954ec9efc71185670f7a3d72f00b9 (diff) |
Scripts/Spells: Fix rhapsody talent (#29804)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_priest.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index eefce2d3e82..419e9f51a8d 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -162,6 +162,7 @@ enum PriestSpells SPELL_PRIEST_RENEWED_HOPE = 197469, SPELL_PRIEST_RENEWED_HOPE_EFFECT = 197470, SPELL_PRIEST_REVEL_IN_PURITY = 373003, + SPELL_PRIEST_RHAPSODY_PROC = 390636, SPELL_PRIEST_SAY_YOUR_PRAYERS = 391186, SPELL_PRIEST_SCHISM = 424509, SPELL_PRIEST_SCHISM_AURA = 214621, @@ -2642,6 +2643,51 @@ class spell_pri_purge_the_wicked_dummy : public SpellScript } }; +// 390622 - Rhapsody +class spell_pri_rhapsody : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_PRIEST_RHAPSODY_PROC }); + } + + void HandlePeriodic(AuraEffect const* aurEff) const + { + Unit* target = GetTarget(); + if (Aura* rhapsodyStack = target->GetAura(SPELL_PRIEST_RHAPSODY_PROC, GetCasterGUID())) + rhapsodyStack->ModStackAmount(1); + else + target->CastSpell(target, SPELL_PRIEST_RHAPSODY_PROC, + CastSpellExtraArgs(aurEff).SetTriggerFlags(TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR)); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_pri_rhapsody::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +// 390636 - Rhapsody +class spell_pri_rhapsody_proc : public AuraScript +{ + void PreventChargeDrop(ProcEventInfo const& /*eventInfo*/) + { + PreventDefaultAction(); + } + + void RemoveAura(ProcEventInfo const& /*eventInfo*/) const + { + // delay charge drop to allow spellmod to be applied to both damaging and healing spells + GetAura()->DropChargeDelayed(1); + } + + void Register() override + { + DoPrepareProc += AuraProcFn(spell_pri_rhapsody_proc::PreventChargeDrop); + AfterProc += AuraProcFn(spell_pri_rhapsody_proc::RemoveAura); + } +}; + // 47536 - Rapture class spell_pri_rapture : public SpellScript { @@ -3241,6 +3287,8 @@ void AddSC_priest_spell_scripts() RegisterSpellScript(spell_pri_purge_the_wicked); RegisterSpellScript(spell_pri_purge_the_wicked_dummy); RegisterSpellScript(spell_pri_rapture); + RegisterSpellScript(spell_pri_rhapsody); + RegisterSpellScript(spell_pri_rhapsody_proc); RegisterSpellScript(spell_pri_schism); RegisterSpellScript(spell_pri_sins_of_the_many); RegisterSpellScript(spell_pri_spirit_of_redemption); |