TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DynObjAura Class Reference

#include <SpellAuras.h>

Public Member Functions

 DynObjAura (SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 
void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT) override
 
void FillTargetMap (std::map< Unit *, uint32 > &targets, Unit *caster) override
 
- Public Member Functions inherited from Aura
 Aura (SpellInfo const *spellproto, WorldObject *owner, Unit *caster, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 
void _InitEffects (uint32 effMask, Unit *caster, int32 *baseAmount)
 
virtual ~Aura ()
 
SpellInfo constGetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCastItemGUID () const
 
int32 GetCastItemLevel () const
 
ObjectGuid GetCasterGUID () const
 
UnitGetCaster () const
 
WorldObjectGetOwner () const
 
UnitGetUnitOwner () const
 
DynamicObjectGetDynobjOwner () const
 
AuraObjectType GetType () const
 
virtual void _ApplyForTarget (Unit *target, Unit *caster, AuraApplication *auraApp)
 
virtual void _UnapplyForTarget (Unit *target, Unit *caster, AuraApplication *auraApp)
 
void _Remove (AuraRemoveMode removeMode)
 
void UpdateTargetMap (Unit *caster, bool apply=true)
 
void _RegisterForTargets ()
 
void ApplyForTargets ()
 
void _ApplyEffectForTargets (uint8 effIndex)
 
void UpdateOwner (uint32 diff, WorldObject *owner)
 
void Update (uint32 diff, Unit *caster)
 
time_t GetApplyTime () const
 
int32 GetMaxDuration () const
 
void SetMaxDuration (int32 duration)
 
int32 CalcMaxDuration () const
 
int32 CalcMaxDuration (Unit *caster) const
 
int32 GetDuration () const
 
void SetDuration (int32 duration, bool withMods=false)
 
void RefreshDuration (bool withMods=false)
 
void RefreshTimers ()
 
bool IsExpired () const
 
bool IsPermanent () const
 
uint8 GetCharges () const
 
void SetCharges (uint8 charges)
 
uint8 CalcMaxCharges (Unit *caster) const
 
uint8 CalcMaxCharges () const
 
bool ModCharges (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
bool DropCharge (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void ModChargesDelayed (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void DropChargeDelayed (uint32 delay, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
 
void RefreshSpellMods ()
 
uint8 GetCasterLevel () const
 
bool HasMoreThanOneEffectForType (AuraType auraType) const
 
bool IsArea () const
 
bool IsPassive () const
 
bool IsDeathPersistent () const
 
bool IsRemovedOnShapeLost (Unit *target) const
 
bool CanBeSaved () const
 
bool IsRemoved () const
 
bool CanBeSentToClient () const
 
bool IsSingleTarget () const
 
bool IsSingleTargetWith (Aura const *aura) const
 
void SetIsSingleTarget (bool val)
 
void UnregisterSingleTarget ()
 
int32 CalcDispelChance (Unit *auraTarget, bool offensive) const
 
AuraKey GenerateKey (uint32 &recalculateMask) const
 Fills a helper structure containing aura primary key for character_aura, character_aura_effect, pet_aura, pet_aura_effect tables. More...
 
void SetLoadedState (int32 maxDuration, int32 duration, int32 charges, uint8 stackAmount, uint32 recalculateMask, int32 *amount)
 
bool HasEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
AuraEffectGetEffect (uint32 index) const
 
uint32 GetEffectMask () const
 
void RecalculateAmountOfEffects ()
 
void HandleAllEffects (AuraApplication *aurApp, uint8 mode, bool apply)
 
ApplicationMap constGetApplicationMap ()
 
void GetApplicationList (Unit::AuraApplicationList &applicationList) const
 
const AuraApplicationGetApplicationOfTarget (ObjectGuid guid) const
 
AuraApplicationGetApplicationOfTarget (ObjectGuid guid)
 
bool IsAppliedOnTarget (ObjectGuid guid) const
 
void SetNeedClientUpdateForTargets () const
 
void HandleAuraSpecificMods (AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
 
void HandleAuraSpecificPeriodics (AuraApplication const *aurApp, Unit *caster)
 
bool CanBeAppliedOn (Unit *target)
 
bool CheckAreaTarget (Unit *target)
 
bool CanStackWith (Aura const *existingAura) const
 
bool IsProcOnCooldown () const
 
void AddProcCooldown (uint32 msec)
 
bool IsUsingCharges () const
 
void SetUsingCharges (bool val)
 
void PrepareProcToTrigger (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
bool IsProcTriggeredOnEvent (AuraApplication *aurApp, ProcEventInfo &eventInfo) const
 
float CalcProcChance (SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
 
void TriggerProcOnEvent (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void LoadScripts ()
 
bool CallScriptCheckAreaTargetHandlers (Unit *target)
 
void CallScriptDispel (DispelInfo *dispelInfo)
 
void CallScriptAfterDispel (DispelInfo *dispelInfo)
 
bool CallScriptEffectApplyHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
 
bool CallScriptEffectRemoveHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
 
void CallScriptAfterEffectApplyHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
 
void CallScriptAfterEffectRemoveHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
 
bool CallScriptEffectPeriodicHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp)
 
void CallScriptEffectUpdatePeriodicHandlers (AuraEffect *aurEff)
 
void CallScriptEffectCalcAmountHandlers (AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
 
void CallScriptEffectCalcPeriodicHandlers (AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
 
void CallScriptEffectCalcSpellModHandlers (AuraEffect const *aurEff, SpellModifier *&spellMod)
 
void CallScriptEffectAbsorbHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
 
void CallScriptEffectAfterAbsorbHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
 
void CallScriptEffectManaShieldHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
 
void CallScriptEffectAfterManaShieldHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
 
void CallScriptEffectSplitHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &splitAmount)
 
bool CallScriptCheckProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
bool CallScriptPrepareProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
bool CallScriptProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
void CallScriptAfterProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
bool CallScriptEffectProcHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
void CallScriptAfterEffectProcHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
AuraScriptGetScriptByName (std::string const &scriptName) const
 
AuraEffectVector GetAuraEffects () const
 
SpellEffectInfoVector GetSpellEffectInfos () const
 
SpellEffectInfo constGetSpellEffectInfo (uint32 index) const
 

Friends

AuraAura::Create (SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 

Additional Inherited Members

- Public Types inherited from Aura
typedef std::map< ObjectGuid,
AuraApplication * > 
ApplicationMap
 
- Static Public Member Functions inherited from Aura
static uint32 BuildEffectMaskForOwner (SpellInfo const *spellProto, uint32 avalibleEffectMask, WorldObject *owner)
 
static AuraTryRefreshStackOrCreate (SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, bool *refresh=NULL, int32 castItemLevel=-1)
 
static AuraTryCreate (SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, int32 castItemLevel=-1)
 
static AuraCreate (SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 
- Public Attributes inherited from Aura
std::list< AuraScript * > m_loadedScripts
 
- Protected Attributes inherited from Aura
SpellInfo const *const m_spellInfo
 
ObjectGuid const m_casterGuid
 
ObjectGuid const m_castItemGuid
 
int32 m_castItemLevel
 
time_t const m_applyTime
 
WorldObject *const m_owner
 
int32 m_maxDuration
 
int32 m_duration
 
int32 m_timeCla
 
std::vector< SpellPowerEntry
const * > 
m_periodicCosts
 
int32 m_updateTargetMapInterval
 
uint8 const m_casterLevel
 
uint8 m_procCharges
 
uint8 m_stackAmount
 
ApplicationMap m_applications
 
bool m_isRemoved:1
 
bool m_isSingleTarget:1
 
bool m_isUsingCharges:1
 
ChargeDropEventm_dropEvent
 

Constructor & Destructor Documentation

DynObjAura::DynObjAura ( SpellInfo const spellproto,
uint32  effMask,
WorldObject owner,
Unit caster,
int32 baseAmount,
Item castItem,
ObjectGuid  casterGUID,
int32  castItemLevel 
)
2424  : Aura(spellproto, owner, caster, castItem, casterGUID, castItemLevel)
2425 {
2426  LoadScripts();
2428  ASSERT(GetDynobjOwner()->IsInWorld());
2429  ASSERT(GetDynobjOwner()->GetMap() == caster->GetMap());
2430  _InitEffects(effMask, caster, baseAmount);
2431  GetDynobjOwner()->SetAura(this);
2432 }
Map * GetMap() const
Definition: Object.h:543
Aura(SpellInfo const *spellproto, WorldObject *owner, Unit *caster, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
Definition: SpellAuras.cpp:366
void _InitEffects(uint32 effMask, Unit *caster, int32 *baseAmount)
Definition: SpellAuras.cpp:404
void SetAura(Aura *aura)
Definition: DynamicObject.cpp:192
void LoadScripts()
Definition: SpellAuras.cpp:1945
DynamicObject * GetDynobjOwner() const
Definition: SpellAuras.h:139
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

Member Function Documentation

void DynObjAura::FillTargetMap ( std::map< Unit *, uint32 > &  targets,
Unit caster 
)
overridevirtual

Implements Aura.

2449 {
2450  Unit* dynObjOwnerCaster = GetDynobjOwner()->GetCaster();
2451  float radius = GetDynobjOwner()->GetRadius();
2452 
2453  for (SpellEffectInfo const* effect : GetSpellEffectInfos())
2454  {
2455  if (!effect || !HasEffect(effect->EffectIndex))
2456  continue;
2457  UnitList targetList;
2458  if (effect->TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY
2459  || effect->TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY)
2460  {
2461  Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
2463  GetDynobjOwner()->VisitNearbyObject(radius, searcher);
2464  }
2465  else
2466  {
2467  Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
2469  GetDynobjOwner()->VisitNearbyObject(radius, searcher);
2470  }
2471 
2472  for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
2473  {
2474  std::map<Unit*, uint32>::iterator existing = targets.find(*itr);
2475  if (existing != targets.end())
2476  existing->second |= 1 << effect->EffectIndex;
2477  else
2478  targets[*itr] = 1 << effect->EffectIndex;
2479  }
2480  }
2481 }
Definition: SharedDefines.h:1900
Definition: GridNotifiers.h:840
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:587
Definition: GridNotifiers.h:410
Definition: GridNotifiers.h:926
Definition: SpellInfo.h:238
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:223
DynamicObject * GetDynobjOwner() const
Definition: SpellAuras.h:139
float GetRadius() const
Definition: DynamicObject.h:59
std::list< Unit * > UnitList
Definition: Unit.h:421
Unit * GetCaster() const
Definition: DynamicObject.h:54
Definition: SharedDefines.h:1898
Definition: Unit.h:1305
SpellEffectInfoVector GetSpellEffectInfos() const
Definition: SpellAuras.h:290

+ Here is the call graph for this function:

void DynObjAura::Remove ( AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT)
overridevirtual

Implements Aura.

2442 {
2443  if (IsRemoved())
2444  return;
2445  _Remove(removeMode);
2446 }
bool IsRemoved() const
Definition: SpellAuras.h:201
void _Remove(AuraRemoveMode removeMode)
Definition: SpellAuras.cpp:511

+ Here is the call graph for this function:

Friends And Related Function Documentation

Aura* Aura::Create ( SpellInfo const spellproto,
uint32  effMask,
WorldObject owner,
Unit caster,
int32 baseAmount,
Item castItem,
ObjectGuid  casterGUID,
int32  castItemLevel 
)
friend

The documentation for this class was generated from the following files: