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

#include "SpellAuras.h"

Inheritance diagram for DynObjAura:
Aura

Public Member Functions

void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT) override
 
void FillTargetMap (std::map< Unit *, uint8 > &targets, Unit *caster) override
 
- Public Member Functions inherited from Aura
 Aura (SpellInfo const *spellproto, WorldObject *owner, Unit *caster, Item *castItem, ObjectGuid casterGUID, ObjectGuid itemGUID=ObjectGuid::Empty)
 
void _InitEffects (uint8 effMask, Unit *caster, int32 *baseAmount)
 
virtual ~Aura ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
ObjectGuid GetCastItemGUID () const
 
uint32 GetCastItemEntry () const
 
ObjectGuid GetCasterGUID () const
 
Unit * GetCaster () const
 
WorldObject * GetOwner () const
 
Unit * GetUnitOwner () const
 
DynamicObject * GetDynobjOwner () 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 periodicReset=false)
 
void RefreshTimersWithMods ()
 
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)
 
uint8 GetStackAmount () const
 
void SetStackAmount (uint8 num)
 
bool ModStackAmount (int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool periodicReset=false)
 
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
 
void SetLoadedState (int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 *amount)
 
bool HasEffect (uint8 effIndex) const
 
bool HasEffectType (AuraType type) const
 
AuraEffect * GetEffect (uint8 effIndex) const
 
uint8 GetEffectMask () const
 
void RecalculateAmountOfEffects ()
 
void HandleAllEffects (AuraApplication *aurApp, uint8 mode, bool apply)
 
ApplicationMap const & GetApplicationMap ()
 
void GetApplicationList (std::list< AuraApplication * > &applicationList) const
 
AuraApplication const * GetApplicationOfTarget (ObjectGuid guid) const
 
AuraApplication * GetApplicationOfTarget (ObjectGuid guid)
 
bool IsAppliedOnTarget (ObjectGuid guid) const
 
void SetNeedClientUpdateForTargets () const
 
void HandleAuraSpecificMods (AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
 
bool CanBeAppliedOn (Unit *target)
 
bool CheckAreaTarget (Unit *target)
 
bool CanStackWith (Aura const *existingAura) const
 
bool IsAuraStronger (Aura const *newAura) const
 
bool IsProcOnCooldown (TimePoint now) const
 
void AddProcCooldown (TimePoint cooldownEnd)
 
void AddProcCooldown (SpellProcEntry const *procEntry, TimePoint now)
 
void ResetProcCooldown ()
 
bool IsUsingCharges () const
 
void SetUsingCharges (bool val)
 
void PrepareProcToTrigger (AuraApplication *aurApp, ProcEventInfo &eventInfo, TimePoint now)
 
uint8 GetProcEffectMask (AuraApplication *aurApp, ProcEventInfo &eventInfo, TimePoint now) const
 
float CalcProcChance (SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
 
void TriggerProcOnEvent (uint8 procEffectMask, AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void ConsumeProcCharges (SpellProcEntry const *procEntry)
 
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 CallScriptCheckEffectProcHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
bool CallScriptAfterCheckProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo, bool isTriggeredAtSpellProcEvent)
 
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)
 
AuraScript * GetScriptByName (std::string const &scriptName) const
 
template<class Script >
Script * GetScript (std::string const &scriptName) const
 
virtual std::string GetDebugInfo () const
 
void SetTriggeredByAuraSpellInfo (SpellInfo const *triggeredByAuraSpellInfo)
 
SpellInfo const * GetTriggeredByAuraSpellInfo () const
 

Protected Member Functions

 DynObjAura (SpellInfo const *spellproto, uint8 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, ObjectGuid itemGUID=ObjectGuid::Empty)
 

Friends

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

Additional Inherited Members

- Public Types inherited from Aura
typedef std::map< ObjectGuid, AuraApplication * > ApplicationMap
 
- Static Public Member Functions inherited from Aura
static uint8 BuildEffectMaskForOwner (SpellInfo const *spellProto, uint8 avalibleEffectMask, WorldObject *owner)
 
static Aura * TryRefreshStackOrCreate (SpellInfo const *spellproto, uint8 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, bool *refresh=nullptr, bool periodicReset=false)
 
static Aura * TryCreate (SpellInfo const *spellproto, uint8 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount=nullptr, Item *castItem=nullptr, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemGUID=ObjectGuid::Empty)
 
static Aura * Create (SpellInfo const *spellproto, uint8 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, ObjectGuid itemGUID=ObjectGuid::Empty)
 
- 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
 
uint32 const m_castItemEntry
 
time_t const m_applyTime
 
WorldObject *const m_owner
 
int32 m_maxDuration
 
int32 m_duration
 
int32 m_timeCla
 
int32 m_updateTargetMapInterval
 
uint8 const m_casterLevel
 
uint8 m_procCharges
 
uint8 m_stackAmount
 
AuraEffect * m_effects [3]
 
ApplicationMap m_applications
 
bool m_isRemoved: 1
 
bool m_isSingleTarget: 1
 
bool m_isUsingCharges: 1
 
TimePoint m_procCooldown
 

Detailed Description

Constructor & Destructor Documentation

◆ DynObjAura()

DynObjAura::DynObjAura ( SpellInfo const *  spellproto,
uint8  effMask,
WorldObject *  owner,
Unit *  caster,
int32 *  baseAmount,
Item *  castItem,
ObjectGuid  casterGUID,
ObjectGuid  itemGUID = ObjectGuid::Empty 
)
explicitprotected
2979 : Aura(spellproto, owner, caster, castItem, casterGUID, itemGUID)
2980{
2981 LoadScripts();
2983 ASSERT(GetDynobjOwner()->IsInWorld());
2984 ASSERT(GetDynobjOwner()->GetMap() == caster->GetMap());
2985 _InitEffects(effMask, caster, baseAmount);
2986 GetDynobjOwner()->SetAura(this);
2987}
#define ASSERT
Definition Errors.h:68
Definition SpellAuras.h:88
DynamicObject * GetDynobjOwner() const
Definition SpellAuras.h:110
void LoadScripts()
Definition SpellAuras.cpp:2448
void _InitEffects(uint8 effMask, Unit *caster, int32 *baseAmount)
Definition SpellAuras.cpp:379
void SetAura(Aura *aura)
Definition DynamicObject.cpp:211
Map * GetMap() const
Definition Object.h:637

References Aura::_InitEffects(), ASSERT, Aura::GetDynobjOwner(), WorldObject::GetMap(), Aura::LoadScripts(), and DynamicObject::SetAura().

Member Function Documentation

◆ FillTargetMap()

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

Implements Aura.

2997{
2998 Unit* dynObjOwnerCaster = GetDynobjOwner()->GetCaster();
2999 float radius = GetDynobjOwner()->GetRadius();
3000
3001 for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
3002 {
3003 if (!HasEffect(effIndex))
3004 continue;
3005
3006 SpellInfo const* spellInfo = GetSpellInfo();
3007 UnitList targetList;
3008 if (spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY || spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY)
3009 {
3010 Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
3012 Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
3013 }
3014 // pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit
3015 // what about EffectImplicitTargetA?
3016 else if (spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_NONE)
3017 {
3020 Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
3021 }
3022 else
3023 {
3024 Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
3026 Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
3027 }
3028
3029 for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
3030 {
3031 Unit* target = *itr;
3032
3033 Optional<float> collisionHeight = { };
3034 Optional<float> combatReach = { };
3035 if (Unit* dynObjCaster = GetDynobjOwner()->GetCaster())
3036 {
3037 collisionHeight = dynObjCaster->GetCollisionHeight();
3038 combatReach = dynObjCaster->GetCombatReach();
3039 }
3040
3043 {
3044 continue;
3045 }
3046
3047 std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
3048 if (existing != targets.end())
3049 existing->second |= 1 << effIndex;
3050 else
3051 targets[*itr] = 1 << effIndex;
3052 }
3053 }
3054}
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1673
std::uint8_t uint8
Definition Define.h:109
@ LINEOFSIGHT_ALL_CHECKS
Definition Map.h:115
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:24
@ SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT
Definition SharedDefines.h:581
@ TARGET_UNIT_DEST_AREA_ALLY
Definition SharedDefines.h:1439
@ TARGET_DEST_DYNOBJ_NONE
Definition SharedDefines.h:1496
@ TARGET_DEST_DYNOBJ_ALLY
Definition SharedDefines.h:1437
@ SPELL_ATTR2_IGNORE_LINE_OF_SIGHT
Definition SharedDefines.h:446
std::list< Unit * > UnitList
Definition Unit.h:78
Definition GridNotifiers.h:1103
Definition GridNotifiers.h:999
bool HasEffect(uint8 effIndex) const
Definition SpellAuras.h:175
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:101
Unit * GetCaster() const
Definition DynamicObject.h:56
float GetRadius() const
Definition DynamicObject.h:62
Definition SpellInfo.h:340
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:441
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:417
Definition Unit.h:665
float GetCollisionHeight() const override
Return collision height sent to client.
Definition Unit.cpp:16764
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1412
Definition GridNotifiers.h:446
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165

References SpellInfo::Effects, DynamicObject::GetCaster(), Unit::GetCollisionHeight(), Aura::GetDynobjOwner(), DynamicObject::GetRadius(), Aura::GetSpellInfo(), SpellInfo::HasAttribute(), Aura::HasEffect(), WorldObject::IsWithinLOSInMap(), LINEOFSIGHT_ALL_CHECKS, MAX_SPELL_EFFECTS, VMAP::Nothing, SPELL_ATTR2_IGNORE_LINE_OF_SIGHT, SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT, TARGET_DEST_DYNOBJ_ALLY, TARGET_DEST_DYNOBJ_NONE, TARGET_UNIT_DEST_AREA_ALLY, and Cell::VisitObjects().

◆ Remove()

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

Implements Aura.

2990{
2991 if (IsRemoved())
2992 return;
2993 _Remove(removeMode);
2994}
bool IsRemoved() const
Definition SpellAuras.h:163
void _Remove(AuraRemoveMode removeMode)
Definition SpellAuras.cpp:518

References Aura::_Remove(), and Aura::IsRemoved().

Friends And Related Symbol Documentation

◆ Aura::Create

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

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