Scripts/Spells: Implement Absolute Corruption warlock talent (#30155)

This commit is contained in:
Aqua Deus
2024-09-03 16:49:49 +02:00
committed by GitHub
parent 1580b4ef84
commit dd54edb378
2 changed files with 39 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);