diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2025-06-08 20:00:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-08 20:00:13 +0200 |
commit | 6ff851fdcfd86f0a199f60a745d314b0f5870a7a (patch) | |
tree | 5c115c6c1a9030b5fff4cf25688e5dded100cb60 | |
parent | bb68bf610ef97f2836ea1c3df4853a60cad99413 (diff) |
Scripts/Spells: Implement Raging Blow cooldown reset talents (#31038)
-rw-r--r-- | sql/updates/world/master/2025_06_08_01_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 40 |
2 files changed, 44 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_06_08_01_world.sql b/sql/updates/world/master/2025_06_08_01_world.sql new file mode 100644 index 00000000000..f5fd0f223af --- /dev/null +++ b/sql/updates/world/master/2025_06_08_01_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warr_raging_blow_cooldown_reset'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(85288, 'spell_warr_raging_blow_cooldown_reset'), +(335097, 'spell_warr_raging_blow_cooldown_reset' ); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index aa8ee8a08bf..fb652d0b197 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -52,6 +52,7 @@ enum WarriorSpells SPELL_WARRIOR_GLYPH_OF_HEROIC_LEAP_BUFF = 133278, SPELL_WARRIOR_HEROIC_LEAP_JUMP = 178368, SPELL_WARRIOR_IGNORE_PAIN = 190456, + SPELL_WARRIOR_IMPROVED_RAGING_BLOW = 383854, SPELL_WARRIOR_INVIGORATING_FURY = 385174, SPELL_WARRIOR_INVIGORATING_FURY_TALENT = 383468, SPELL_WARRIOR_IN_FOR_THE_KILL = 248621, @@ -80,6 +81,7 @@ enum WarriorSpells SPELL_WARRIOR_TRAUMA_EFFECT = 215537, SPELL_WARRIOR_VICTORIOUS = 32216, SPELL_WARRIOR_VICTORY_RUSH_HEAL = 118779, + SPELL_WARRIOR_WRATH_AND_FURY = 392936 }; enum WarriorMisc @@ -636,6 +638,43 @@ class spell_warr_mortal_strike : public SpellScript } }; +// 383854 - Improved Raging Blow (attached to 85288 - Raging Blow, 335097 - Crushing Blow) +// 392936 - Wrath and Fury (attached to 85288 - Raging Blow, 335097 - Crushing Blow) +class spell_warr_raging_blow_cooldown_reset : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_WARRIOR_IMPROVED_RAGING_BLOW }) + && ValidateSpellEffect({{ SPELL_WARRIOR_WRATH_AND_FURY, EFFECT_0 }}); + } + + bool Load() override + { + Unit const* caster = GetCaster(); + return caster->HasAura(SPELL_WARRIOR_IMPROVED_RAGING_BLOW) || caster->HasAuraEffect(SPELL_WARRIOR_WRATH_AND_FURY, EFFECT_0); + } + + void HandleResetCooldown(SpellEffIndex /*effIndex*/) const + { + // it is currently impossible to have Wrath and Fury without having Improved Raging Blow, but we will check it anyway + Unit* caster = GetCaster(); + int32 value = 0; + if (caster->HasAura(SPELL_WARRIOR_IMPROVED_RAGING_BLOW)) + value = GetEffectValue(); + + if (AuraEffect const* auraEffect = caster->GetAuraEffect(SPELL_WARRIOR_WRATH_AND_FURY, EFFECT_0)) + value += auraEffect->GetAmount(); + + if (roll_chance_i(value)) + caster->GetSpellHistory()->RestoreCharge(GetSpellInfo()->ChargeCategoryId); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_warr_raging_blow_cooldown_reset::HandleResetCooldown, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + // 97462 - Rallying Cry class spell_warr_rallying_cry : public SpellScript { @@ -1012,6 +1051,7 @@ void AddSC_warrior_spell_scripts() RegisterSpellScript(spell_warr_item_t10_prot_4p_bonus); RegisterSpellScript(spell_warr_mortal_strike); RegisterSpellScript(spell_warr_powerful_enrage); + RegisterSpellScript(spell_warr_raging_blow_cooldown_reset); RegisterSpellScript(spell_warr_rallying_cry); RegisterSpellScript(spell_warr_rampage_enrage); RegisterSpellScript(spell_warr_rumbling_earth); |