From dc9c79ec8426b2dce96cdf8fe3fcaae22906bc7c Mon Sep 17 00:00:00 2001 From: Aqua Deus <95978183+aquadeus@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:52:52 +0200 Subject: [PATCH] Scropts/Spells: Implement warlock talent Cunning Cruelty (#31951) --- .../world/master/2026_09_21_00_world.sql | 7 ++++ src/server/scripts/Spells/spell_warlock.cpp | 35 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 sql/updates/world/master/2026_09_21_00_world.sql diff --git a/sql/updates/world/master/2026_09_21_00_world.sql b/sql/updates/world/master/2026_09_21_00_world.sql new file mode 100644 index 0000000000..26b2aac47e --- /dev/null +++ b/sql/updates/world/master/2026_09_21_00_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc` WHERE `SpellId` IN (453172); +INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES +(453172,0x00,5,0x00800001,0x00000000,0x00000000,0x00000000,0x0,0x0,0x1,0x2,0x0,0x0,0x0,0,0,0,0); -- Cunning Cruelty + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_warl_cunning_cruelty'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(453172, 'spell_warl_cunning_cruelty'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index fa5a33c7ef..8615f3e77a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -83,6 +83,7 @@ enum WarlockSpells SPELL_WARLOCK_ROARING_BLAZE = 205184, SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE = 27285, SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC = 32865, + SPELL_WARLOCK_SHADOWBOLT_VOLLEY_AREA = 453176, SPELL_WARLOCK_SHADOWBURN_ENERGIZE = 245731, SPELL_WARLOCK_SHADOW_BOLT_ENERGIZE = 194192, SPELL_WARLOCK_SHADOWFLAME = 37378, @@ -526,6 +527,39 @@ class spell_warl_create_healthstone : public SpellScript } }; +// 453172 - Cunning Cruelty +class spell_warl_cunning_cruelty : public AuraScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WARLOCK_SHADOWBOLT_VOLLEY_AREA }); + } + + bool CheckProc(AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) + { + // Shadow Bolt proc chance is 50% + // Drain Soul proc chance is 25% + float chance = 50.0f; + if (eventInfo.GetSpellInfo()->IsAffected(SPELLFAMILY_WARLOCK, { 0x800000 })) + chance = 25.0f; + + return roll_chance(chance, _rng); + } + + static void HandleProc(AuraScript const&, AuraEffect const* /*aurEff*/, ProcEventInfo const& eventInfo) + { + eventInfo.GetActor()->CastSpell(eventInfo.GetActionTarget()->GetPosition(), SPELL_WARLOCK_SHADOWBOLT_VOLLEY_AREA, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } + + void Register() override + { + DoCheckEffectProc += AuraCheckEffectProcFn(spell_warl_cunning_cruelty::CheckProc, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_warl_cunning_cruelty::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + + PseudoRandomDistributionState _rng; +}; + // 108416 - Dark Pact class spell_warl_dark_pact : public AuraScript { @@ -1805,6 +1839,7 @@ void AddSC_warlock_spell_scripts() RegisterSpellScript(spell_warl_chaotic_energies); RegisterSpellScript(spell_warl_conflagrate); RegisterSpellScript(spell_warl_create_healthstone); + RegisterSpellScript(spell_warl_cunning_cruelty); RegisterSpellScript(spell_warl_dark_pact); RegisterSpellScript(spell_warl_deaths_embrace); RegisterSpellScript(spell_warl_deaths_embrace_dots);