diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index eaedaf6f5..5d14f7ba1 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -2577,6 +2577,31 @@ class spell_warr_rend : public AuraScript } }; +// Defensive Stance - 71 +class spell_warr_defensive_stance : public AuraScript + { + int32 damageTaken = 0; + + void HandleProc(ProcEventInfo& eventInfo) + { + Unit* caster = GetCaster(); + if (!caster) + return; + + damageTaken = eventInfo.GetDamageInfo() ? eventInfo.GetDamageInfo()->GetDamage() : 0; + if (damageTaken <= 0) + return; + + int32 rageAmount = (50.0f * (float)damageTaken) / (float)caster->GetMaxHealth(); + caster->ModifyPower(POWER_RAGE, 10 * uint32(rageAmount)); + } + + void Register() override + { + OnProc += AuraProcFn(spell_warr_defensive_stance::HandleProc); + } +}; + void AddSC_warrior_spell_scripts() { RegisterSpellScript(spell_warr_anger_management_proc); @@ -2654,4 +2679,5 @@ void AddSC_warrior_spell_scripts() RegisterSpellScript(spell_warr_wirlwind_dmg); RegisterSpellScript(spell_shield_wall); RegisterSpellScript(spell_warr_rend); + RegisterSpellScript(spell_warr_defensive_stance); }