diff options
author | Jeremy <Golrag@users.noreply.github.com> | 2025-06-15 10:32:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-15 10:32:49 +0200 |
commit | a946d3589726badc852e80963577807400a2cf4d (patch) | |
tree | 58cc1b989971fe99e77c3c39b3af1ea37bcf6ba8 | |
parent | fd043d611bdcb3288fe30a968bfa24b584155ec9 (diff) |
Scripts/Spells: Implement Deft Experience warrior talent (#31060)
-rw-r--r-- | sql/updates/world/master/2025_06_15_04_world.sql | 4 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warrior.cpp | 33 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_06_15_04_world.sql b/sql/updates/world/master/2025_06_15_04_world.sql new file mode 100644 index 00000000000..2224f4256ee --- /dev/null +++ b/sql/updates/world/master/2025_06_15_04_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_warr_deft_experience'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(23881, 'spell_warr_deft_experience'), +(335096, 'spell_warr_deft_experience'); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 82292c68c84..f0b6c6af1bd 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -43,6 +43,7 @@ enum WarriorSpells SPELL_WARRIOR_COLOSSUS_SMASH = 167105, SPELL_WARRIOR_COLOSSUS_SMASH_AURA = 208086, SPELL_WARRIOR_CRITICAL_THINKING_ENERGIZE = 392776, + SPELL_WARRIOR_DEFT_EXPERIENCE = 383295, SPELL_WARRIOR_EXECUTE = 20647, SPELL_WARRIOR_ENRAGE = 184362, SPELL_WARRIOR_FRENZIED_ENRAGE = 383848, @@ -326,6 +327,37 @@ class spell_warr_critical_thinking : public AuraScript } }; +// 383295 - Deft Experience (attached to 23881 - Bloodthirst) +// 383295 - Deft Experience (attached to 335096 - Bloodbath) +class spell_warr_deft_experience : public SpellScript +{ + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellEffect({ { SPELL_WARRIOR_DEFT_EXPERIENCE, EFFECT_1 } }); + } + + bool Load() override + { + return GetCaster()->HasAura(SPELL_WARRIOR_DEFT_EXPERIENCE); + } + + void HandleDeftExperience(SpellEffIndex /*effIndex*/) const + { + if (GetHitUnit() != GetExplTargetUnit()) + return; + + Unit const* caster = GetCaster(); + if (Aura* enrageAura = caster->GetAura(SPELL_WARRIOR_ENRAGE)) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_WARRIOR_DEFT_EXPERIENCE, EFFECT_1)) + enrageAura->SetDuration(enrageAura->GetDuration() + aurEff->GetAmount()); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_warr_deft_experience::HandleDeftExperience, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } +}; + // 236279 - Devastator class spell_warr_devastator : public AuraScript { @@ -1160,6 +1192,7 @@ void AddSC_warrior_spell_scripts() RegisterSpellScript(spell_warr_charge_effect); RegisterSpellScript(spell_warr_colossus_smash); RegisterSpellScript(spell_warr_critical_thinking); + RegisterSpellScript(spell_warr_deft_experience); RegisterSpellScript(spell_warr_devastator); RegisterSpellScript(spell_warr_enrage_proc); RegisterSpellScript(spell_warr_execute_damage); |