Scropts/Spells: Implement warlock talent Cunning Cruelty (#31951)

This commit is contained in:
Aqua Deus
2026-09-21 14:52:52 +02:00
committed by GitHub
parent 17f8d5a78a
commit dc9c79ec84
2 changed files with 42 additions and 0 deletions
@@ -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');
@@ -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);