Scripts/Spells: Implement Deft Experience warrior talent (#31060)

This commit is contained in:
Jeremy
2025-06-15 10:32:49 +02:00
committed by GitHub
parent fd043d611b
commit a946d35897
2 changed files with 37 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);