Skip to content

Commit

Permalink
Core/Auras: updated spell aura flags and implemented AFLAG_CANCELABLE…
Browse files Browse the repository at this point in the history
… and AFLAG_PASSIVE (#29634)
  • Loading branch information
Ovahlord committed Jan 30, 2024
1 parent 059dc67 commit a629fe5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/game/Spells/Auras/SpellAuraDefines.h
Expand Up @@ -32,14 +32,15 @@ enum AURA_FLAGS
{
AFLAG_NONE = 0x0000,
AFLAG_NOCASTER = 0x0001,
AFLAG_POSITIVE = 0x0002,
AFLAG_CANCELABLE = 0x0002,
AFLAG_DURATION = 0x0004,
AFLAG_SCALABLE = 0x0008,
AFLAG_NEGATIVE = 0x0010,
AFLAG_UNK20 = 0x0020,
AFLAG_UNK40 = 0x0040,
AFLAG_UNK80 = 0x0080,
AFLAG_MAW_POWER = 0x0100,
AFLAG_POSITIVE = 0x0100,
AFLAG_PASSIVE = 0x0200
};

// these are modes, in which aura effect handler may be called
Expand Down
7 changes: 7 additions & 0 deletions src/server/game/Spells/Auras/SpellAuras.cpp
Expand Up @@ -151,6 +151,13 @@ void AuraApplication::_InitFlags(Unit* caster, uint32 effMask)
if (GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR8_AURA_POINTS_ON_CLIENT)
|| std::find_if(GetBase()->GetAuraEffects().begin(), GetBase()->GetAuraEffects().end(), std::cref(effectNeedsAmount)) != GetBase()->GetAuraEffects().end())
_flags |= AFLAG_SCALABLE;

if ((_flags & AFLAG_POSITIVE))
if (!GetBase()->GetSpellInfo()->IsPassive() && !GetBase()->GetSpellInfo()->HasAttribute(SPELL_ATTR1_NO_AURA_ICON) && GetBase()->GetOwner()->GetGUID() == GetTarget()->GetGUID())
_flags |= AFLAG_CANCELABLE;

if (GetBase()->GetSpellInfo()->IsPassive())
_flags |= AFLAG_PASSIVE;
}

void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
Expand Down

0 comments on commit a629fe5

Please sign in to comment.