Scripts/Spells: Implement priest talent Mental Decay (#31480)

This commit is contained in:
Cristian Vintila
2026-01-11 23:15:38 +02:00
committed by GitHub
parent 3782d2f4f4
commit 963e69902b
2 changed files with 44 additions and 0 deletions

View File

@@ -2641,6 +2641,42 @@ class spell_pri_lights_wrath : public SpellScript
}
};
// 375994 - Mental Decay
class spell_pri_mental_decay : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_PRIEST_SHADOW_WORD_PAIN, SPELL_PRIEST_VAMPIRIC_TOUCH });
}
static void HandleEffectProc(AuraScript const&, AuraEffect const* aurEff, ProcEventInfo const& eventInfo)
{
Unit* caster = eventInfo.GetActor();
if (!caster)
return;
Unit* target = eventInfo.GetActionTarget();
int32 durationExtend = aurEff->GetAmount() * IN_MILLISECONDS;
if (Aura* shadowWordPain = target->GetOwnedAura(SPELL_PRIEST_SHADOW_WORD_PAIN, caster->GetGUID()))
{
shadowWordPain->SetMaxDuration(shadowWordPain->GetDuration() + durationExtend);
shadowWordPain->SetDuration(shadowWordPain->GetDuration() + durationExtend);
}
if (Aura* vampiricTouch = target->GetOwnedAura(SPELL_PRIEST_VAMPIRIC_TOUCH, caster->GetGUID()))
{
vampiricTouch->SetMaxDuration(vampiricTouch->GetDuration() + durationExtend);
vampiricTouch->SetDuration(vampiricTouch->GetDuration() + durationExtend);
}
}
void Register() override
{
OnEffectProc += AuraEffectProcFn(spell_pri_mental_decay::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
// 205369 - Mind Bomb
class spell_pri_mind_bomb : public AuraScript
{
@@ -5125,6 +5161,7 @@ void AddSC_priest_spell_scripts()
RegisterSpellScript(spell_pri_leap_of_faith_effect_trigger);
RegisterSpellScript(spell_pri_levitate);
RegisterSpellScript(spell_pri_lights_wrath);
RegisterSpellScript(spell_pri_mental_decay);
RegisterSpellScript(spell_pri_mind_bomb);
RegisterSpellScript(spell_pri_mind_devourer);
RegisterSpellAndAuraScriptPair(spell_pri_mind_devourer_buff, spell_pri_mind_devourer_buff_aura);