Skip to content

Commit

Permalink
Spell: Add DamageEffectType damageType parameter to OnAbsorb
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Sep 28, 2023
1 parent 89c68bf commit 9f2a11d
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ bool AreaTrigger_at_teron_gorefiend(Player* player, AreaTriggerEntry const* /*at

struct ShadowOfDeath : public AuraScript
{
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/) const override
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
{
preventedDeath = true;
currentAbsorb = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ struct VerasDeadlyPoisonTick : public AuraScript
// 41341 - Balance of Power
struct BalanceOfPower : public AuraScript
{
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& dropCharge) const override
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& dropCharge, DamageEffectType /*damageType*/) const override
{
// unused atm
remainingDamage += currentAbsorb;
Expand All @@ -730,7 +730,7 @@ struct BalanceOfPower : public AuraScript
// 41475 - Reflective Shield
struct ReflectiveShieldMalande : public AuraScript
{
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/) const override
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
{
if (remainingDamage < currentAbsorb)
reflectDamage = remainingDamage / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ struct GravityLapseKnockup : public AuraScript
// 36815 - Shock Barrier
struct ShockBarrier : public AuraScript
{
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/) const override
void OnAbsorb(Aura* /*aura*/, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
{
reflectedSpellId = 36822;
if (remainingDamage < currentAbsorb)
Expand Down
2 changes: 1 addition & 1 deletion src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ struct OrbOfDeception : public AuraScript
// 39228 - Argussian Compass
struct ArgussianCompass : public AuraScript
{
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/) const override
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
{
// Max absorb stored in 1 dummy effect
int32 max_absorb = aura->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
Expand Down
2 changes: 1 addition & 1 deletion src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* caster, SpellSchoolMask schoolMa

bool preventedDeath = preventDeathAura != nullptr;
bool dropCharge = true;
(*i)->OnAbsorb(currentAbsorb, remainingDamage, reflectSpell, reflectDamage, preventedDeath, dropCharge);
(*i)->OnAbsorb(currentAbsorb, remainingDamage, reflectSpell, reflectDamage, preventedDeath, dropCharge, damagetype);
if (preventedDeath)
preventDeathAura = (*i);

Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/Scripts/Scripting/ClassScripts/Priest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ struct PainSuppression : public AuraScript
// 17 - Power Word: Shield
struct PowerWordShieldPriest : public AuraScript
{
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/) const override
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const override
{
Unit* caster = aura->GetTarget();
Unit::AuraList const& vOverRideCS = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/Scripts/Scripting/ClassScripts/Rogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct DirtyDeeds : public AuraScript
// 31228 - Cheat Death
struct CheatDeathRogue : public AuraScript
{
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge) const override
void OnAbsorb(Aura* aura, int32& currentAbsorb, int32& remainingDamage, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& preventedDeath, bool& dropCharge, DamageEffectType /*damageType*/) const override
{
if (!preventedDeath && aura->GetTarget()->IsPlayer() &&
aura->GetHolder()->IsProcReady(aura->GetTarget()->GetMap()->GetCurrentClockTime()) &&
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/Scripts/SpellScript.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct AuraScript
// called before proc handler
virtual SpellAuraProcResult OnProc(Aura* /*aura*/, ProcExecutionData& /*procData*/) const { return SPELL_AURA_PROC_OK; }
// called on absorb of this aura
virtual void OnAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/) const {}
virtual void OnAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/, int32& /*remainingDamage*/, uint32& /*reflectedSpellId*/, int32& /*reflectDamage*/, bool& /*preventedDeath*/, bool& /*dropCharge*/, DamageEffectType /*damageType*/) const {}
// called on mana shield absorb of this aura
virtual void OnManaAbsorb(Aura* /*aura*/, int32& /*currentAbsorb*/) const {}
// called on death prevention
Expand Down
4 changes: 2 additions & 2 deletions src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8949,10 +8949,10 @@ SpellAuraProcResult Aura::OnProc(ProcExecutionData& data)
return SPELL_AURA_PROC_OK;
}

void Aura::OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge)
void Aura::OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge, DamageEffectType damageType)
{
if (AuraScript* script = GetAuraScript())
script->OnAbsorb(this, currentAbsorb, remainingDamage, reflectedSpellId, reflectDamage, preventedDeath, dropCharge);
script->OnAbsorb(this, currentAbsorb, remainingDamage, reflectedSpellId, reflectDamage, preventedDeath, dropCharge, damageType);
}

void Aura::OnManaAbsorb(int32& currentAbsorb)
Expand Down
2 changes: 1 addition & 1 deletion src/game/Spells/SpellAuras.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class Aura
void OnAfterApply(bool apply);
bool OnCheckProc(ProcExecutionData& data);
SpellAuraProcResult OnProc(ProcExecutionData& data);
void OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge);
void OnAbsorb(int32& currentAbsorb, int32& remainingDamage, uint32& reflectedSpellId, int32& reflectDamage, bool& preventedDeath, bool& dropCharge, DamageEffectType damageType);
void OnManaAbsorb(int32& currentAbsorb);
void OnAuraDeathPrevention(int32& remainingDamage);
void OnPeriodicTrigger(PeriodicTriggerData& data);
Expand Down

0 comments on commit 9f2a11d

Please sign in to comment.