mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Implement priest talent Mental Decay (#31480)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user