AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AuraApplication Class Reference

#include "SpellAuras.h"

Public Member Functions

UnitGetTarget () const
 
AuraGetBase () const
 
uint8 GetSlot () const
 
uint8 GetFlags () const
 
uint8 GetEffectMask () const
 
bool HasEffect (uint8 effect) const
 
bool IsPositive () const
 
bool IsSelfcasted () const
 
uint8 GetEffectsToApply () const
 
void SetRemoveMode (AuraRemoveMode mode)
 
AuraRemoveMode GetRemoveMode () const
 
void SetNeedClientUpdate ()
 
bool IsNeedClientUpdate () const
 
void BuildUpdatePacket (ByteBuffer &data, bool remove) const
 
void ClientUpdate (bool remove=false)
 
bool IsActive (uint8 effIdx)
 
void SetDisableMask (uint8 effIdx)
 
void RemoveDisableMask (uint8 effIdx)
 

Private Member Functions

 AuraApplication (Unit *target, Unit *caster, Aura *base, uint8 effMask)
 
void _Remove ()
 
void _InitFlags (Unit *caster, uint8 effMask)
 
void _HandleEffect (uint8 effIndex, bool apply)
 

Private Attributes

Unit *const _target
 
Aura *const _base
 
AuraRemoveMode _removeMode: 8
 
uint8 _slot
 
uint8 _flags
 
uint8 _effectsToApply
 
bool _needClientUpdate: 1
 
uint8 _disableMask
 

Friends

void Unit::_ApplyAura (AuraApplication *aurApp, uint8 effMask)
 
void Unit::_UnapplyAura (AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
 
void Unit::_ApplyAuraEffect (Aura *aura, uint8 effIndex)
 
void Unit::RemoveAura (AuraApplication *aurApp, AuraRemoveMode mode)
 
AuraApplicationUnit::_CreateAuraApplication (Aura *aura, uint8 effMask)
 

Detailed Description

Constructor & Destructor Documentation

◆ AuraApplication()

AuraApplication::AuraApplication ( Unit target,
Unit caster,
Aura base,
uint8  effMask 
)
explicitprivate
47 :
50{
51 ASSERT(GetTarget() && GetBase());
52
53 if (GetBase()->CanBeSentToClient())
54 {
55 // Try find slot for aura
56 uint8 slot = MAX_AURAS;
57 // Lookup for auras already applied from spell
58 if (AuraApplication* foundAura = GetTarget()->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
59 {
60 // allow use single slot only by auras from same caster
61 slot = foundAura->GetSlot();
62 }
63 else
64 {
65 Unit::VisibleAuraMap const* visibleAuras = GetTarget()->GetVisibleAuras();
66 // lookup for free slots in units visibleAuras
67 Unit::VisibleAuraMap::const_iterator itr = visibleAuras->find(0);
68 for (uint32 freeSlot = 0; freeSlot < MAX_AURAS; ++itr, ++freeSlot)
69 {
70 if (itr == visibleAuras->end() || itr->first != freeSlot)
71 {
72 slot = freeSlot;
73 break;
74 }
75 }
76 }
77
78 // Register Visible Aura
79 if (slot < MAX_AURAS)
80 {
81 _slot = slot;
82 GetTarget()->SetVisibleAura(slot, this);
84 LOG_DEBUG("spells.aura", "Aura: {} Effect: {} put to unit visible auras slot: {}", GetBase()->GetId(), GetEffectMask(), slot);
85 }
86 else
87 {
88 LOG_ERROR("spells.aura", "Aura: {} Effect: {} could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask());
89 }
90 }
91 _InitFlags(caster, effMask);
92}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:168
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
#define ASSERT
Definition: Errors.h:68
#define MAX_AURAS
Definition: SpellAuraDefines.h:21
@ AURA_REMOVE_NONE
Definition: SpellAuraDefines.h:391
@ AFLAG_NONE
Definition: SpellAuraDefines.h:26
uint32 GetId(std::string const &username)
Definition: AccountMgr.cpp:229
std::map< uint8, AuraApplication * > VisibleAuraMap
Definition: Unit.h:652
void SetVisibleAura(uint8 slot, AuraApplication *aur)
Definition: Unit.h:1498
VisibleAuraMap const * GetVisibleAuras()
Definition: Unit.h:1490
Definition: SpellAuras.h:37
Unit * GetTarget() const
Definition: SpellAuras.h:61
uint8 _slot
Definition: SpellAuras.h:47
uint8 _effectsToApply
Definition: SpellAuras.h:49
bool _needClientUpdate
Definition: SpellAuras.h:50
uint8 GetEffectMask() const
Definition: SpellAuras.h:66
void _InitFlags(Unit *caster, uint8 effMask)
Definition: SpellAuras.cpp:124
uint8 _disableMask
Definition: SpellAuras.h:53
Aura *const _base
Definition: SpellAuras.h:45
Aura * GetBase() const
Definition: SpellAuras.h:62
uint8 _flags
Definition: SpellAuras.h:48
void SetNeedClientUpdate()
Definition: SpellAuras.h:75
Unit *const _target
Definition: SpellAuras.h:44
AuraRemoveMode _removeMode
Definition: SpellAuras.h:46

References _InitFlags(), _slot, ASSERT, GetBase(), GetEffectMask(), GetTarget(), Unit::GetVisibleAuras(), LOG_DEBUG, LOG_ERROR, MAX_AURAS, SetNeedClientUpdate(), and Unit::SetVisibleAura().

Member Function Documentation

◆ _HandleEffect()

void AuraApplication::_HandleEffect ( uint8  effIndex,
bool  apply 
)
private
162{
163 AuraEffect* aurEff = GetBase()->GetEffect(effIndex);
164 ASSERT(aurEff);
165 ASSERT(HasEffect(effIndex) == (!apply));
166 ASSERT((1 << effIndex) & _effectsToApply);
167 LOG_DEBUG("spells.aura", "AuraApplication::_HandleEffect: {}, apply: {}: amount: {}", aurEff->GetAuraType(), apply, aurEff->GetAmount());
168
169 if (apply)
170 {
171 ASSERT(!(_flags & (1 << effIndex)));
172 _flags |= 1 << effIndex;
173 aurEff->HandleEffect(this, AURA_EFFECT_HANDLE_REAL, true);
174 }
175 else
176 {
177 ASSERT(_flags & (1 << effIndex));
178 _flags &= ~(1 << effIndex);
179 aurEff->HandleEffect(this, AURA_EFFECT_HANDLE_REAL, false);
180
181 // Remove all triggered by aura spells vs unlimited duration
183 }
184
185 // Stacking!
186 if (uint32 groupId = aurEff->GetAuraGroup())
187 {
188 SpellGroupStackFlags sFlag = sSpellMgr->GetGroupStackFlags(groupId);
189 if (!aurEff->IsPeriodic() && (sFlag & SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE))
190 {
191 AuraApplication* strongestApp = apply ? this : nullptr;
192 AuraEffect* strongestEff = apply ? aurEff : nullptr;
193 int32 amount = apply ? std::abs(aurEff->GetAmount()) : 0;
194 Unit* target = GetTarget();
195 Unit::AuraEffectList const& auraList = target->GetAuraEffectsByType(aurEff->GetAuraType());
196 for (Unit::AuraEffectList::const_iterator iter = auraList.begin(); iter != auraList.end(); ++iter)
197 {
198 if ((*iter)->GetAuraGroup() != groupId || (*iter) == strongestEff || (*iter)->GetBase()->IsRemoved())
199 continue;
200
201 // xinef: skip different misc values
202 if (aurEff->GetAuraType() != SPELL_AURA_230 /*SPELL_AURA_MOD_INCREASE_HEALTH_2*/ && aurEff->GetAuraType() != SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK &&
203 aurEff->GetMiscValue() != (*iter)->GetMiscValue())
204 continue;
205
206 // xinef: should not happen
207 AuraApplication* aurApp = (*iter)->GetBase()->GetApplicationOfTarget(target->GetGUID());
208 if (!aurApp)
209 continue;
210
211 if (amount < std::abs((*iter)->GetForcedAmount()))
212 {
213 // xinef: if we have strongest aura and it is active, turn it off
214 // xinef: otherwise just save new aura;
215 if (strongestApp && strongestEff && strongestApp->IsActive(strongestEff->GetEffIndex()))
216 {
217 strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
218 if (!strongestEff->GetSpellInfo()->HasAreaAuraEffect())
219 strongestEff->SetEnabled(false);
220 strongestApp->SetDisableMask(strongestEff->GetEffIndex());
221 }
222 strongestApp = aurApp;
223 strongestEff = (*iter);
224 amount = std::abs((*iter)->GetAmount());
225 }
226 // xinef: itered aura is weaker, deactivate if active
227 else if (aurApp->IsActive((*iter)->GetEffIndex()))
228 {
229 (*iter)->HandleEffect(aurApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, false);
230 if (!(*iter)->GetSpellInfo()->HasAreaAuraEffect())
231 (*iter)->SetEnabled(false);
232 aurApp->SetDisableMask((*iter)->GetEffIndex());
233 }
234 }
235
236 // xinef: if we have new strongest aura, and it is not active
237 if (strongestApp && strongestEff && !strongestApp->IsActive(strongestEff->GetEffIndex()))
238 {
239 strongestApp->RemoveDisableMask(strongestEff->GetEffIndex());
240 strongestEff->SetEnabled(true);
241 strongestEff->HandleEffect(strongestApp, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, true);
242 }
243 }
244 }
246}
std::int32_t int32
Definition: Define.h:103
@ SPELL_AURA_230
Definition: SpellAuraDefines.h:293
@ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
Definition: SpellAuraDefines.h:128
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
Definition: SpellAuraDefines.h:44
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
SpellGroupStackFlags
Definition: SpellMgr.h:356
@ SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE
Definition: SpellMgr.h:362
#define sSpellMgr
Definition: SpellMgr.h:825
void apply(T *val)
Definition: ByteConverter.h:40
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Definition: Unit.h:630
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1362
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:646
Definition: SpellAuraEffects.h:39
void SetEnabled(bool enabled)
Definition: SpellAuraEffects.h:118
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:54
AuraType GetAuraType() const
Definition: SpellAuraEffects.cpp:447
uint32 GetAuraGroup() const
Definition: SpellAuraEffects.h:115
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition: SpellAuraEffects.cpp:741
bool IsPeriodic() const
Definition: SpellAuraEffects.h:92
int32 GetMiscValue() const
Definition: SpellAuraEffects.cpp:442
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:56
void CleanupTriggeredSpells(Unit *target)
Definition: SpellAuraEffects.cpp:1199
int32 GetAmount() const
Definition: SpellAuraEffects.h:64
bool IsActive(uint8 effIdx)
Definition: SpellAuras.h:81
void RemoveDisableMask(uint8 effIdx)
Definition: SpellAuras.h:83
bool HasEffect(uint8 effect) const
Definition: SpellAuras.h:67
void SetDisableMask(uint8 effIdx)
Definition: SpellAuras.h:82
AuraEffect * GetEffect(uint8 effIndex) const
Definition: SpellAuras.h:175
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:183
bool HasAreaAuraEffect() const
Definition: SpellInfo.cpp:908

References _effectsToApply, _flags, ASSERT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, AURA_EFFECT_HANDLE_REAL, AuraEffect::CleanupTriggeredSpells(), AuraEffect::GetAmount(), Aura::GetApplicationOfTarget(), Unit::GetAuraEffectsByType(), AuraEffect::GetAuraGroup(), AuraEffect::GetAuraType(), AuraEffect::GetBase(), GetBase(), Aura::GetEffect(), AuraEffect::GetEffIndex(), Object::GetGUID(), AuraEffect::GetMiscValue(), AuraEffect::GetSpellInfo(), GetTarget(), AuraEffect::HandleEffect(), SpellInfo::HasAreaAuraEffect(), HasEffect(), IsActive(), AuraEffect::IsPeriodic(), Aura::IsRemoved(), LOG_DEBUG, RemoveDisableMask(), SetDisableMask(), AuraEffect::SetEnabled(), SetNeedClientUpdate(), SPELL_AURA_230, SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK, SPELL_GROUP_STACK_FLAG_EFFECT_EXCLUSIVE, and sSpellMgr.

Referenced by Unit::_ApplyAura(), Unit::_ApplyAuraEffect(), Unit::_UnapplyAura(), and Unit::RemoveAura().

◆ _InitFlags()

void AuraApplication::_InitFlags ( Unit caster,
uint8  effMask 
)
private
125{
126 // mark as selfcasted if needed
128
129 // aura is casted by self or an enemy
130 // one negative effect and we know aura is negative
131 if (IsSelfcasted() || !caster || !caster->IsFriendlyTo(GetTarget()))
132 {
133 bool negativeFound = false;
134 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
135 {
136 if (((1 << i) & effMask) && !GetBase()->GetSpellInfo()->IsPositiveEffect(i))
137 {
138 negativeFound = true;
139 break;
140 }
141 }
142 _flags |= negativeFound ? AFLAG_NEGATIVE : AFLAG_POSITIVE;
143 }
144 // aura is casted by friend
145 // one positive effect and we know aura is positive
146 else
147 {
148 bool positiveFound = false;
149 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
150 {
151 if (((1 << i) & effMask) && GetBase()->GetSpellInfo()->IsPositiveEffect(i))
152 {
153 positiveFound = true;
154 break;
155 }
156 }
157 _flags |= positiveFound ? AFLAG_POSITIVE : AFLAG_NEGATIVE;
158 }
159}
@ AFLAG_POSITIVE
Definition: SpellAuraDefines.h:31
@ AFLAG_NEGATIVE
Definition: SpellAuraDefines.h:34
@ AFLAG_CASTER
Definition: SpellAuraDefines.h:30
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1637
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10203
bool IsSelfcasted() const
Definition: SpellAuras.h:69
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:105
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:100
bool IsPositiveEffect(uint8 effIndex) const
Definition: SpellInfo.cpp:1241

References _flags, AFLAG_CASTER, AFLAG_NEGATIVE, AFLAG_NONE, AFLAG_POSITIVE, GetBase(), Aura::GetCasterGUID(), Object::GetGUID(), Aura::GetSpellInfo(), GetTarget(), Unit::IsFriendlyTo(), SpellInfo::IsPositiveEffect(), IsSelfcasted(), and MAX_SPELL_EFFECTS.

Referenced by AuraApplication().

◆ _Remove()

void AuraApplication::_Remove ( )
private
95{
96 uint8 slot = GetSlot();
97
98 if (slot >= MAX_AURAS)
99 return;
100
101 if (AuraApplication* foundAura = _target->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
102 {
103 // Reuse visible aura slot by aura which is still applied - prevent storing dead pointers
104 if (slot == foundAura->GetSlot())
105 {
106 if (GetTarget()->GetVisibleAura(slot) == this)
107 {
108 GetTarget()->SetVisibleAura(slot, foundAura);
109 foundAura->SetNeedClientUpdate();
110 }
111 // set not valid slot for aura - prevent removing other visible aura
112 slot = MAX_AURAS;
113 }
114 }
115
116 // update for out of range group members
117 if (slot < MAX_AURAS)
118 {
120 ClientUpdate(true);
121 }
122}
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
Definition: Unit.cpp:5533
void RemoveVisibleAura(uint8 slot)
Definition: Unit.h:1499
void ClientUpdate(bool remove=false)
Definition: SpellAuras.cpp:281
uint8 GetSlot() const
Definition: SpellAuras.h:64

References _target, ClientUpdate(), Unit::GetAuraApplication(), GetBase(), GetSlot(), GetTarget(), MAX_AURAS, Unit::RemoveVisibleAura(), and Unit::SetVisibleAura().

Referenced by Unit::_UnapplyAura().

◆ BuildUpdatePacket()

void AuraApplication::BuildUpdatePacket ( ByteBuffer data,
bool  remove 
) const
249{
250 data << uint8(_slot);
251
252 if (remove)
253 {
255 data << uint32(0);
256 return;
257 }
259
260 Aura const* aura = GetBase();
261 data << uint32(aura->GetId());
262 uint32 flags = _flags;
264 flags |= AFLAG_DURATION;
265 data << uint8(flags);
266 data << uint8(aura->GetCasterLevel());
267 // send stack amount for aura which could be stacked (never 0 - causes incorrect display) or charges
268 // stack amount has priority over charges (checked on retail with spell 50262)
269 data << uint8(aura->GetSpellInfo()->StackAmount ? aura->GetStackAmount() : aura->GetCharges());
270
271 if (!(flags & AFLAG_CASTER))
272 data << aura->GetCasterGUID().WriteAsPacked();
273
274 if (flags & AFLAG_DURATION)
275 {
276 data << uint32(aura->GetMaxDuration());
277 data << uint32(aura->GetDuration());
278 }
279}
@ AFLAG_DURATION
Definition: SpellAuraDefines.h:32
@ SPELL_ATTR5_DO_NOT_DISPLAY_DURATION
Definition: SharedDefines.h:577
PackedGuid WriteAsPacked() const
Definition: ObjectGuid.h:316
AuraApplication * GetVisibleAura(uint8 slot)
Definition: Unit.h:1491
Definition: SpellAuras.h:87
int32 GetMaxDuration() const
Definition: SpellAuras.h:129
uint8 GetCasterLevel() const
Definition: SpellAuras.h:154
uint32 GetId() const
Definition: SpellAuras.cpp:466
int32 GetDuration() const
Definition: SpellAuras.h:133
uint8 GetStackAmount() const
Definition: SpellAuras.h:148
uint8 GetCharges() const
Definition: SpellAuras.h:141
uint32 StackAmount
Definition: SpellInfo.h:371
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:415

References _flags, _slot, _target, AFLAG_CASTER, AFLAG_DURATION, ASSERT, GetBase(), Aura::GetCasterGUID(), Aura::GetCasterLevel(), Aura::GetCharges(), Aura::GetDuration(), Aura::GetId(), Aura::GetMaxDuration(), Aura::GetSpellInfo(), Aura::GetStackAmount(), Unit::GetVisibleAura(), SpellInfo::HasAttribute(), SPELL_ATTR5_DO_NOT_DISPLAY_DURATION, SpellInfo::StackAmount, and ObjectGuid::WriteAsPacked().

Referenced by ClientUpdate(), and Player::GetAurasForTarget().

◆ ClientUpdate()

void AuraApplication::ClientUpdate ( bool  remove = false)
282{
283 _needClientUpdate = false;
284
286 data << GetTarget()->GetPackGUID();
287 BuildUpdatePacket(data, remove);
288
289 if (GetSlot() < MAX_AURAS)
290 if (Player const* plr = GetTarget()->ToPlayer())
291 if (Aura* aura = GetBase())
292 if (plr->NeedSendSpectatorData() && ArenaSpectator::ShouldSendAura(aura, GetEffectMask(), GetTarget()->GetGUID(), remove))
293 ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);
294
295 _target->SendMessageToSet(&data, true);
296}
@ SMSG_AURA_UPDATE
Definition: Opcodes.h:1204
AC_GAME_API bool ShouldSendAura(Aura *aura, uint8 effMask, ObjectGuid targetGUID, bool remove)
Definition: ArenaSpectator.cpp:283
void SendCommand_Aura(T *o, ObjectGuid targetGUID, const char *prefix, ObjectGuid caster, uint32 id, bool isDebuff, uint32 dispel, int32 dur, int32 maxdur, uint32 stack, bool remove)
Definition: ArenaSpectator.h:102
PackedGuid const & GetPackGUID() const
Definition: Object.h:111
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition: Object.cpp:2080
Definition: Player.h:1064
Definition: WorldPacket.h:27
void BuildUpdatePacket(ByteBuffer &data, bool remove) const
Definition: SpellAuras.cpp:248

References _needClientUpdate, _target, BuildUpdatePacket(), GetBase(), GetEffectMask(), Object::GetPackGUID(), GetSlot(), GetTarget(), MAX_AURAS, ArenaSpectator::SendCommand_Aura(), WorldObject::SendMessageToSet(), ArenaSpectator::ShouldSendAura(), and SMSG_AURA_UPDATE.

Referenced by _Remove().

◆ GetBase()

◆ GetEffectMask()

uint8 AuraApplication::GetEffectMask ( ) const
inline
@ AFLAG_EFF_INDEX_1
Definition: SpellAuraDefines.h:28
@ AFLAG_EFF_INDEX_2
Definition: SpellAuraDefines.h:29
@ AFLAG_EFF_INDEX_0
Definition: SpellAuraDefines.h:27

References _flags, AFLAG_EFF_INDEX_0, AFLAG_EFF_INDEX_1, and AFLAG_EFF_INDEX_2.

Referenced by Unit::_ApplyAuraEffect(), Unit::_UnapplyAura(), AuraApplication(), and ClientUpdate().

◆ GetEffectsToApply()

uint8 AuraApplication::GetEffectsToApply ( ) const
inline
70{ return _effectsToApply; }

References _effectsToApply.

◆ GetFlags()

uint8 AuraApplication::GetFlags ( ) const
inline
65{ return _flags; }

References _flags.

Referenced by WorldSession::BuildPartyMemberStatsChangedPacket().

◆ GetRemoveMode()

◆ GetSlot()

uint8 AuraApplication::GetSlot ( ) const
inline
64{ return _slot; }

References _slot.

Referenced by _Remove(), and ClientUpdate().

◆ GetTarget()

Unit * AuraApplication::GetTarget ( ) const
inline
61{ return _target; }

References _target.

Referenced by _HandleEffect(), _InitFlags(), _Remove(), Aura::_Remove(), Unit::_UnapplyAura(), AuraApplication(), ClientUpdate(), AuraScript::GetTarget(), AuraEffect::HandleArenaPreparation(), AuraEffect::HandleAuraAllowFlight(), AuraEffect::HandleAuraAllowOnlyAbility(), AuraEffect::HandleAuraCloneCaster(), AuraEffect::HandleAuraControlVehicle(), AuraEffect::HandleAuraConvertRune(), AuraEffect::HandleAuraDummy(), AuraEffect::HandleAuraEmpathy(), AuraEffect::HandleAuraFeatherFall(), AuraEffect::HandleAuraGhost(), AuraEffect::HandleAuraHover(), AuraEffect::HandleAuraIncreaseBaseHealthPercent(), AuraEffect::HandleAuraLinked(), AuraEffect::HandleAuraModAttackPower(), AuraEffect::HandleAuraModAttackPowerOfArmor(), AuraEffect::HandleAuraModAttackPowerPercent(), AuraEffect::HandleAuraModBaseResistancePCT(), AuraEffect::HandleAuraModBlockPercent(), AuraEffect::HandleAuraModCritPct(), AuraEffect::HandleAuraModDecreaseSpeed(), AuraEffect::HandleAuraModDisarm(), AuraEffect::HandleAuraModDispelImmunity(), AuraEffect::HandleAuraModDmgImmunity(), AuraEffect::HandleAuraModDodgePercent(), AuraEffect::HandleAuraModEffectImmunity(), AuraEffect::HandleAuraModExpertise(), AuraEffect::HandleAuraModFaction(), AuraEffect::HandleAuraModFakeInebriation(), AuraEffect::HandleAuraModIncreaseEnergy(), AuraEffect::HandleAuraModIncreaseEnergyPercent(), AuraEffect::HandleAuraModIncreaseFlightSpeed(), AuraEffect::HandleAuraModIncreaseHealth(), AuraEffect::HandleAuraModIncreaseHealthPercent(), AuraEffect::HandleAuraModIncreaseMaxHealth(), AuraEffect::HandleAuraModIncreaseSpeed(), AuraEffect::HandleAuraModIncreaseSwimSpeed(), AuraEffect::HandleAuraModPacify(), AuraEffect::HandleAuraModPacifyAndSilence(), AuraEffect::HandleAuraModParryPercent(), AuraEffect::HandleAuraModPetTalentsPoints(), AuraEffect::HandleAuraModRangedAttackPower(), AuraEffect::HandleAuraModRangedAttackPowerOfStatPercent(), AuraEffect::HandleAuraModRangedAttackPowerPercent(), AuraEffect::HandleAuraModRangedHaste(), AuraEffect::HandleAuraModResistance(), AuraEffect::HandleAuraModResistanceExclusive(), AuraEffect::HandleAuraModResistenceOfStatPercent(), AuraEffect::HandleAuraModRoot(), AuraEffect::HandleAuraModScale(), AuraEffect::HandleAuraModSchoolImmunity(), AuraEffect::HandleAuraModShapeshift(), AuraEffect::HandleAuraModSilence(), AuraEffect::HandleAuraModSkill(), AuraEffect::HandleAuraModStalked(), AuraEffect::HandleAuraModStat(), AuraEffect::HandleAuraModStateImmunity(), AuraEffect::HandleAuraModStun(), AuraEffect::HandleAuraModTotalThreat(), AuraEffect::HandleAuraModUseNormalSpeed(), AuraEffect::HandleAuraModWeaponCritPercent(), AuraEffect::HandleAuraMounted(), AuraEffect::HandleAuraOpenStable(), AuraEffect::HandleAuraOverrideSpells(), AuraEffect::HandleAuraRetainComboPoints(), AuraEffect::HandleAuraSetVehicle(), Aura::HandleAuraSpecificMods(), AuraEffect::HandleAuraTrackCreatures(), AuraEffect::HandleAuraTrackResources(), AuraEffect::HandleAuraTrackStealthed(), AuraEffect::HandleAuraTransform(), AuraEffect::HandleAuraUntrackable(), AuraEffect::HandleAuraWaterWalk(), AuraEffect::HandleBindSight(), AuraEffect::HandleCharmConvert(), AuraEffect::HandleComprehendLanguage(), AuraEffect::HandleDetectAmore(), AuraEffect::HandleEffect(), AuraEffect::HandleFeignDeath(), AuraEffect::HandleForceMoveForward(), AuraEffect::HandleForceReaction(), AuraEffect::HandleModAttackSpeed(), AuraEffect::HandleModBaseResistance(), AuraEffect::HandleModCastingSpeed(), AuraEffect::HandleModCharm(), AuraEffect::HandleModCombatSpeedPct(), AuraEffect::HandleModConfuse(), AuraEffect::HandleModDamageDone(), AuraEffect::HandleModDamagePercentDone(), AuraEffect::HandleModFear(), AuraEffect::HandleModHealingDone(), AuraEffect::HandleModHitChance(), AuraEffect::HandleModInvisibility(), AuraEffect::HandleModInvisibilityDetect(), AuraEffect::HandleModManaRegen(), AuraEffect::HandleModMechanicImmunity(), AuraEffect::HandleModMeleeRangedSpeedPct(), AuraEffect::HandleModMeleeSpeedPct(), AuraEffect::HandleModOffhandDamagePercent(), AuraEffect::HandleModPercentStat(), AuraEffect::HandleModPossess(), AuraEffect::HandleModPossessPet(), AuraEffect::HandleModPowerCost(), AuraEffect::HandleModPowerCostPCT(), AuraEffect::HandleModPowerRegen(), AuraEffect::HandleModRating(), AuraEffect::HandleModRatingFromStat(), AuraEffect::HandleModResistancePercent(), AuraEffect::HandleModSpellCritChance(), AuraEffect::HandleModSpellCritChanceShool(), AuraEffect::HandleModSpellDamagePercentFromAttackPower(), AuraEffect::HandleModSpellDamagePercentFromStat(), AuraEffect::HandleModSpellHealingPercentFromAttackPower(), AuraEffect::HandleModSpellHealingPercentFromStat(), AuraEffect::HandleModSpellHitChance(), AuraEffect::HandleModStateImmunityMask(), AuraEffect::HandleModStealth(), AuraEffect::HandleModStealthDetect(), AuraEffect::HandleModStealthLevel(), AuraEffect::HandleModTargetResistance(), AuraEffect::HandleModTaunt(), AuraEffect::HandleModThreat(), AuraEffect::HandleModTotalPercentStat(), AuraEffect::HandleModUnattackable(), AuraEffect::HandleNoReagentUseAura(), AuraEffect::HandlePhase(), AuraEffect::HandlePreventFleeing(), AuraEffect::HandlePreventResurrection(), AuraEffect::HandleProcTriggerDamageAuraProc(), AuraEffect::HandleProcTriggerSpellAuraProc(), AuraEffect::HandleProcTriggerSpellWithValueAuraProc(), AuraEffect::HandleRaidProcFromChargeAuraProc(), AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(), AuraEffect::HandleRangedAmmoHaste(), AuraEffect::HandleShieldBlockValue(), AuraEffect::HandleSpiritOfRedemption(), AuraEffect::HandleWaterBreathing(), Aura::IsProcTriggeredOnEvent(), AuraEffect::PeriodicTick(), and Unit::RemoveAreaAurasDueToLeaveWorld().

◆ HasEffect()

bool AuraApplication::HasEffect ( uint8  effect) const
inline
67{ ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1 << effect); }

References _flags, ASSERT, and MAX_SPELL_EFFECTS.

Referenced by _HandleEffect(), Unit::_UnapplyAura(), Unit::RemoveAura(), and Aura::TriggerProcOnEvent().

◆ IsActive()

bool AuraApplication::IsActive ( uint8  effIdx)
inline
81{ return ((1 << effIdx) & _disableMask) == 0; }

References _disableMask.

Referenced by _HandleEffect(), AuraEffect::HandleEffect(), and SpellInfo::IsStrongerAuraActive().

◆ IsNeedClientUpdate()

bool AuraApplication::IsNeedClientUpdate ( ) const
inline
76{ return _needClientUpdate;}

References _needClientUpdate.

◆ IsPositive()

◆ IsSelfcasted()

bool AuraApplication::IsSelfcasted ( ) const
inline
69{ return _flags & AFLAG_CASTER; }

References _flags, and AFLAG_CASTER.

Referenced by _InitFlags().

◆ RemoveDisableMask()

void AuraApplication::RemoveDisableMask ( uint8  effIdx)
inline
83{ _disableMask &= ~(1 << effIdx); }

References _disableMask.

Referenced by _HandleEffect().

◆ SetDisableMask()

void AuraApplication::SetDisableMask ( uint8  effIdx)
inline
82{ _disableMask |= 1 << effIdx; }

References _disableMask.

Referenced by _HandleEffect().

◆ SetNeedClientUpdate()

void AuraApplication::SetNeedClientUpdate ( )
inline
75{ _needClientUpdate = true;}

References _needClientUpdate.

Referenced by _HandleEffect(), and AuraApplication().

◆ SetRemoveMode()

void AuraApplication::SetRemoveMode ( AuraRemoveMode  mode)
inline
72{ _removeMode = mode; }

References _removeMode.

Referenced by Unit::_UnapplyAura().

Friends And Related Function Documentation

◆ Unit::_ApplyAura

void Unit::_ApplyAura ( AuraApplication aurApp,
uint8  effMask 
)
friend

◆ Unit::_ApplyAuraEffect

void Unit::_ApplyAuraEffect ( Aura aura,
uint8  effIndex 
)
friend

◆ Unit::_CreateAuraApplication

AuraApplication * Unit::_CreateAuraApplication ( Aura aura,
uint8  effMask 
)
friend

◆ Unit::_UnapplyAura

void Unit::_UnapplyAura ( AuraApplicationMap::iterator &  i,
AuraRemoveMode  removeMode 
)
friend

◆ Unit::RemoveAura

void Unit::RemoveAura ( AuraApplication aurApp,
AuraRemoveMode  mode 
)
friend

Member Data Documentation

◆ _base

Aura* const AuraApplication::_base
private

Referenced by GetBase().

◆ _disableMask

uint8 AuraApplication::_disableMask
private

◆ _effectsToApply

uint8 AuraApplication::_effectsToApply
private

Referenced by _HandleEffect(), and GetEffectsToApply().

◆ _flags

◆ _needClientUpdate

bool AuraApplication::_needClientUpdate
private

◆ _removeMode

AuraRemoveMode AuraApplication::_removeMode
private

Referenced by GetRemoveMode(), and SetRemoveMode().

◆ _slot

uint8 AuraApplication::_slot
private

◆ _target

Unit* const AuraApplication::_target
private