Core/Script: Defensive stance debuff state

Arregla que esté el modo debuff cuando relogueas con el efecto, va junto al commit 480adb3 para funcionar
This commit is contained in:
Sistemas
2026-05-30 01:39:19 +02:00
committed by GitHub
parent 480adb346a
commit bc38c97ed4
+14 -3
View File
@@ -2793,11 +2793,21 @@ class spell_warr_defensive_stance : public AuraScript
return ValidateSpellInfo({ SPELL_WARRIOR_DEFENSIVE_STANCE, SPELL_WARRIOR_DEFENSIVE_STANCE_SPIKE_TALENT });
}
void HandleAbsorb(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/)
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
aurEff->SetAmount(-1);
_absorbAmount = std::max(int32(1), aurEff->GetAmountAsInt());
const_cast<AuraEffect*>(aurEff)->SetAmount(_absorbAmount);
}
void HandleAbsorb(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
{
absorbAmount = 0;
PreventDefaultAction();
aurEff->SetAmount(_absorbAmount);
}
int32 _absorbAmount = 0;
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetDamageInfo() != nullptr && eventInfo.GetDamageInfo()->GetDamage() > 0;
@@ -2846,7 +2856,8 @@ class spell_warr_defensive_stance : public AuraScript
void Register() override
{
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_warr_defensive_stance::HandleAbsorb, EFFECT_FIRST_FOUND);
OnEffectApply += AuraEffectApplyFn(spell_warr_defensive_stance::OnApply, EFFECT_FIRST_FOUND, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_warr_defensive_stance::HandleAbsorb, EFFECT_FIRST_FOUND);
DoCheckProc += AuraCheckProcFn(spell_warr_defensive_stance::CheckProc);
DoPrepareProc += AuraProcFn(spell_warr_defensive_stance::PrepareProc);
OnProc += AuraProcFn(spell_warr_defensive_stance::HandleProc);