Core/Spells: cleaned up SpellAuraEffects::SetAmount helper and restore original handing of sending amounts

This commit is contained in:
Ovahlord committed 2022-09-30 00:40:37 +02:00
1 parent 34386e2b47
commit 62b8db9f6e
4 files changed
+15 -12

No files matched your search

@@ -481,15 +481,6 @@ void AuraEffect::GetApplicationList(Container& applicationContainer) const
}
}
void AuraEffect::SetAmount(int32 amount)
{
_amount = amount;
m_canBeRecalculated = false;
if (GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_SEND_AMOUNT) || Aura::EffectTypeNeedsSendingAmount(GetAuraType()))
GetBase()->SetNeedClientUpdateForTargets();
}
int32 AuraEffect::CalculateAmount(Unit* caster)
{
// default amount calculation
@@ -58,7 +58,7 @@ class TC_GAME_API AuraEffect
int32 GetMiscValue() const { return m_spellInfo->Effects[m_effIndex].MiscValue; }
AuraType GetAuraType() const { return (AuraType)m_spellInfo->Effects[m_effIndex].ApplyAuraName; }
int32 GetAmount() const { return _amount; }
void SetAmount(int32 amount);
void SetAmount(int32 amount) { _amount = amount; m_canBeRecalculated = false; }
int32 GetPeriodicTimer() const { return _periodicTimer; }
void SetPeriodicTimer(int32 periodicTimer) { _periodicTimer = periodicTimer; }
+13 -1
View File
@@ -162,7 +162,19 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
_flags |= positiveFound ? AFLAG_POSITIVE : AFLAG_NEGATIVE;
}
if (GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_SEND_AMOUNT) || GetBase()->HasEffectType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS))
bool effectNeedsAmount = [this]()
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
AuraEffect const* aurEff = GetBase()->GetEffect(i);
if (aurEff && (GetEffectsToApply() & (1 << aurEff->GetEffIndex())) && Aura::EffectTypeNeedsSendingAmount(aurEff->GetAuraType()))
return true;
}
return false;
}();
if (GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_SEND_AMOUNT) || effectNeedsAmount)
_flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT;
}
+1 -1
View File
@@ -1036,7 +1036,7 @@ class spell_pal_exorcism : public SpellScript
return;
if (AuraEffect* exorcismAuraEff = target->GetAuraEffect(GetSpellInfo()->Id, EFFECT_1, caster->GetGUID()))
exorcismAuraEff->SetAmount(GetHitDamage() * 0.0688f);
exorcismAuraEff->ChangeAmount(GetHitDamage() * 0.0688f);
}
void Register() override