Core/Auras: updated some aura flag names

This commit is contained in:
Ovahlord committed 2022-12-19 14:37:53 +01:00
1 parent 5bdcf4264d
commit ede0c3df77
4 files changed
+12 -10

No files matched your search

@@ -125,7 +125,7 @@ void WorldPackets::Party::PartyMemberState::Initialize(Player const* player)
aura.SpellID = aurApp->GetBase()->GetId();
aura.Flags = aurApp->GetFlags();
if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT)
if (aurApp->GetFlags() & AFLAG_SCALABLE)
{
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
@@ -174,7 +174,7 @@ void WorldPackets::Party::PartyMemberState::Initialize(Player const* player)
aura.SpellID = aurApp->GetBase()->GetId();
aura.Flags = aurApp->GetFlags();
if (aurApp->GetFlags() & AFLAG_ANY_EFFECT_AMOUNT_SENT)
if (aurApp->GetFlags() & AFLAG_SCALABLE)
{
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
@@ -34,10 +34,10 @@ enum AURA_FLAGS
AFLAG_EFF_INDEX_0 = 0x01,
AFLAG_EFF_INDEX_1 = 0x02,
AFLAG_EFF_INDEX_2 = 0x04,
AFLAG_CASTER = 0x08,
AFLAG_NOCASTER = 0x08,
AFLAG_POSITIVE = 0x10,
AFLAG_DURATION = 0x20,
AFLAG_ANY_EFFECT_AMOUNT_SENT = 0x40, // used with AFLAG_EFF_INDEX_0/1/2
AFLAG_SCALABLE = 0x40, // used with AFLAG_EFF_INDEX_0/1/2
AFLAG_NEGATIVE = 0x80
};
+7 -5
View File
@@ -129,7 +129,7 @@ void AuraApplication::_Remove()
void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
{
// mark as selfcast if needed
_flags |= (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) ? AFLAG_CASTER : AFLAG_NONE;
_flags |= (GetBase()->GetCasterGUID() == GetTarget()->GetGUID()) ? AFLAG_NOCASTER : AFLAG_NONE;
// aura is cast by self or an enemy
// one negative effect and we know aura is negative
@@ -175,7 +175,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
}();
if (GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_SEND_AMOUNT) || effectNeedsAmount)
_flags |= AFLAG_ANY_EFFECT_AMOUNT_SENT;
_flags |= AFLAG_SCALABLE;
}
void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
@@ -255,7 +255,9 @@ void AuraApplication::BuildUpdatePacket(WorldPackets::Spells::AuraInfo& auraInfo
// stack amount has priority over charges (checked on retail with spell 50262)
auraData.Applications = aura->GetSpellInfo()->StackAmount ? aura->GetStackAmount() : aura->GetCharges();
if (!(auraData.Flags & AFLAG_CASTER))
if (!aura->GetCasterGUID().IsUnit())
auraData.CastUnit = ObjectGuid::Empty; // optional data is filled in, but cast unit contains empty guid in packet
else if (!(auraData.Flags & AFLAG_NOCASTER))
auraData.CastUnit = aura->GetCasterGUID();
if (auraData.Flags & AFLAG_DURATION)
@@ -264,10 +266,10 @@ void AuraApplication::BuildUpdatePacket(WorldPackets::Spells::AuraInfo& auraInfo
auraData.Remaining = aura->GetDuration();
}
if (auraData.Flags & AFLAG_ANY_EFFECT_AMOUNT_SENT)
if (auraData.Flags & AFLAG_SCALABLE)
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (AuraEffect const* effect = aura->GetEffect(i))
if (HasEffect(i)) // Not all of aura's effects have to be applied on every target
if (HasEffect(i)) // Not all of aura's effects have to be applied on every target
auraData.Points[i] = effect->GetAmount();
}
+1 -1
View File
@@ -80,7 +80,7 @@ class TC_GAME_API AuraApplication
uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return (_flags & (1 << effect)) != 0; }
bool IsPositive() const { return (_flags & AFLAG_POSITIVE) != 0; }
bool IsSelfcast() const { return (_flags & AFLAG_CASTER) != 0; }
bool IsSelfcast() const { return (_flags & AFLAG_NOCASTER) != 0; }
uint8 GetEffectsToApply() const { return _effectsToApply; }
void UpdateApplyEffectMask(uint8 newEffMask, bool canHandleNewEffects);