mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Spells: Implement Absolute Corruption warlock talent (#30155)
This commit is contained in:
4
sql/updates/world/master/2024_09_03_05_world.sql
Normal file
4
sql/updates/world/master/2024_09_03_05_world.sql
Normal 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');
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user