aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2024-01-30 14:59:20 +0100
committerGitHub <noreply@github.com>2024-01-30 14:59:20 +0100
commita629fe5cdaba1217976f0be060b254ec88ccad9b (patch)
tree5465fbb8abc70f993e9b2d3ae70697ed1d918916 /src
parent059dc67f4d7b54a9da14456349460fcdef0b1d33 (diff)
Core/Auras: updated spell aura flags and implemented AFLAG_CANCELABLE and AFLAG_PASSIVE (#29634)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraDefines.h5
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h
index b0c7825d6bf..6ee33bf685b 100644
--- a/src/server/game/Spells/Auras/SpellAuraDefines.h
+++ b/src/server/game/Spells/Auras/SpellAuraDefines.h
@@ -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
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index cb541c2f84f..cfc1821bd82 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -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)