32 if (
GetBase()->CanBeSentToClient())
40 slot = foundAura->GetSlot();
46 Unit::VisibleAuraMap::const_iterator itr = visibleAuras->find(0);
49 if (itr == visibleAuras->end() || itr->first != freeSlot)
76 ASSERT(caster || casterGUID);
87 if (foundAura->IsRemoved())
95 return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
102 ASSERT(caster || casterGUID);
107 return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
115 ASSERT(caster || casterGUID);
120 if (owner->
GetGUID() == casterGUID)
126 casterGUID = caster->
GetGUID();
130 if (!owner->
IsInWorld() || ((
Unit*)owner)->IsDuringRemoveFromWorld())
140 aura =
new UnitAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
143 aura =
new DynObjAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
172 if ((*itr)->_GetScriptName()->compare(scriptName) == 0)
201 return aurApp->GetTarget();
297 targetList.push_back(owner);
304 for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
306 std::map<Unit*, uint32>::iterator existing = targets.find(*itr);
307 if (existing != targets.end())
308 existing->second |= 1 << effIndex;
310 targets[*itr] = 1 << effIndex;
316 :
Aura(spellproto, owner, caster, castItem, casterGUID)
357 for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
359 std::map<Unit*, uint32>::iterator existing = targets.find(*itr);
360 if (existing != targets.end())
361 existing->second |= 1 << effIndex;
363 targets[*itr] = 1 << effIndex;
#define MAX_SPELL_EFFECTS
#define SF_LOG_DEBUG(filterType__,...)
@ SPELL_EFFECT_APPLY_AREA_AURA_PARTY
@ SPELL_EFFECT_APPLY_AREA_AURA_FRIEND
@ SPELL_EFFECT_APPLY_AREA_AURA_PET
@ SPELL_EFFECT_APPLY_AREA_AURA_RAID
@ SPELL_EFFECT_APPLY_AREA_AURA_ENEMY
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_EFFECT_APPLY_AREA_AURA_OWNER
@ TARGET_UNIT_DEST_AREA_ALLY
@ TARGET_DEST_DYNOBJ_ALLY
std::list< Unit * > UnitList
void _InitFlags(Unit *caster, uint32 effMask)
AuraApplication(Unit *target, Unit *caster, Aura *base, uint32 effMask)
void SetNeedClientUpdate()
uint32 GetEffectMask() const
AuraRemoveMode _removeMode
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
uint64 GetCasterGUID() const
const AuraApplication * GetApplicationOfTarget(uint64 guid) const
AuraEffect * m_effects[MAX_SPELL_EFFECTS]
Unit * GetUnitOwner() const
std::list< AuraScript * > m_loadedScripts
DynamicObject * GetDynobjOwner() const
bool HasEffect(uint8 effIndex) const
WorldObject * GetOwner() const
static Aura * TryCreate(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0)
ApplicationMap m_applications
uint64 const m_casterGuid
static Aura * TryRefreshStackOrCreate(SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0, bool *refresh=NULL)
static Aura * Create(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, uint64 casterGUID)
void _InitEffects(uint32 effMask, Unit *caster, int32 *baseAmount)
int32 CalcMaxDuration() const
SpellInfo const *const m_spellInfo
AuraObjectType GetType() const
AuraScript * GetScriptByName(std::string const &scriptName) const
WorldObject *const m_owner
SpellInfo const * GetSpellInfo() const
uint64 const m_castItemGuid
uint8 const m_casterLevel
void _DeleteRemovedApplications()
Aura(SpellInfo const *spellproto, WorldObject *owner, Unit *caster, Item *castItem, uint64 casterGUID)
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
uint8 CalcMaxCharges() const
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 avalibleEffectMask, WorldObject *owner)
int32 m_updateTargetMapInterval
void _Remove(AuraRemoveMode removeMode)
DynObjAura(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, uint64 casterGUID)
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void FillTargetMap(std::map< Unit *, uint32 > &targets, Unit *caster)
static Unit * GetUnit(WorldObject const &, uint64 guid)
bool isType(uint16 mask) const
float CalcRadius(Unit *caster=NULL, Spell *=NULL) const
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
bool IsSingleTarget() const
void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
DiminishingGroup m_AuraDRGroup
void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *aurApp)
DiminishingGroup GetDiminishGroup() const
void FillTargetMap(std::map< Unit *, uint32 > &targets, Unit *caster)
void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *aurApp)
UnitAura(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, uint64 casterGUID)
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Aura * _TryStackingOrRefreshingExistingAura(SpellInfo const *newAura, uint32 effMask, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0)
std::map< uint8, AuraApplication * > VisibleAuraMap
void _AddAura(UnitAura *aura, Unit *caster)
void SetVisibleAura(uint8 slot, AuraApplication *aur)
VisibleAuraMap const * GetVisibleAuras()
void ApplyDiminishingAura(DiminishingGroup group, bool apply)
void VisitNearbyObject(float const &radius, NOTIFIER ¬ifier) const