diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2024-09-03 16:49:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-03 16:49:49 +0200 |
commit | dd54edb37808e9d2d811f95c8d7d65fa4b6ba7ad (patch) | |
tree | 32fe664fcc23d55e23f3286be83b92554b1de7fa | |
parent | 1580b4ef84f11c06dc6adab60c09f2791c0876c5 (diff) |
Scripts/Spells: Implement Absolute Corruption warlock talent (#30155)
-rw-r--r-- | sql/updates/world/master/2024_09_03_05_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 35 |
2 files changed, 39 insertions, 0 deletions
diff --git a/sql/updates/world/master/2024_09_03_05_world.sql b/sql/updates/world/master/2024_09_03_05_world.sql new file mode 100644 index 00000000000..879fe147c03 --- /dev/null +++ b/sql/updates/world/master/2024_09_03_05_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_warl_absolute_corruption'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(146739, 'spell_warl_absolute_corruption'), +(445474, 'spell_warl_absolute_corruption'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index d745cf819a2..3ef27e7b922 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -38,6 +38,7 @@ enum WarlockSpells { + SPELL_WARLOCK_ABSOLUTE_CORRUPTION = 196103, SPELL_WARLOCK_CORRUPTION_DAMAGE = 146739, SPELL_WARLOCK_CREATE_HEALTHSTONE = 23517, SPELL_WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388, @@ -82,6 +83,39 @@ enum MiscSpells SPELL_PRIEST_SHADOW_WORD_DEATH = 32409 }; +// 146739 - Corruption +// 445474 - Wither +class spell_warl_absolute_corruption : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellEffect({ { SPELL_WARLOCK_ABSOLUTE_CORRUPTION, EFFECT_0 } }); + } + + bool Load() override + { + return GetCaster()->HasAura(SPELL_WARLOCK_ABSOLUTE_CORRUPTION); + } + + void HandleApply(SpellEffIndex /*effIndex*/) const + { + if (Aura const* absoluteCorruption = GetCaster()->GetAura(SPELL_WARLOCK_ABSOLUTE_CORRUPTION)) + { + Milliseconds duration = GetHitUnit()->IsPvP() + ? Seconds(absoluteCorruption->GetSpellInfo()->GetEffect(EFFECT_0).CalcValue()) + : Milliseconds(-1); + + GetHitAura()->SetMaxDuration(duration.count()); + GetHitAura()->SetDuration(duration.count()); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_warl_absolute_corruption::HandleApply, EFFECT_0, SPELL_EFFECT_APPLY_AURA); + } +}; + // 710 - Banish class spell_warl_banish : public SpellScript { @@ -1093,6 +1127,7 @@ void AddSC_warlock_spell_scripts() RegisterSpellAndAuraScriptPair(spell_warl_burning_rush, spell_warl_burning_rush_aura); RegisterSpellScript(spell_warl_chaos_bolt); RegisterSpellScript(spell_warl_chaotic_energies); + RegisterSpellScript(spell_warl_absolute_corruption); RegisterSpellScript(spell_warl_create_healthstone); RegisterSpellScript(spell_warl_dark_pact); RegisterSpellScript(spell_warl_demonic_circle_summon); |