TrinityCore
Aura Class Referenceabstract

#include <SpellAuras.h>

Public Types

typedef std::unordered_map< ObjectGuid, AuraApplication * > ApplicationMap
 

Public Member Functions

 Aura (AuraCreateInfo const &createInfo)
 
void _InitEffects (uint32 effMask, Unit *caster, int32 const *baseAmount)
 
void SaveCasterInfo (Unit *caster)
 
virtual ~Aura ()
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
Difficulty GetCastDifficulty () const
 
ObjectGuid GetCastId () const
 
ObjectGuid GetCasterGUID () const
 
ObjectGuid GetCastItemGUID () const
 
uint32 GetCastItemId () const
 
int32 GetCastItemLevel () const
 
SpellCastVisual GetSpellVisual () 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)
 
virtual void Remove (AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
 
virtual void FillTargetMap (std::unordered_map< Unit *, uint32 > &targets, Unit *caster)=0
 
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 resetPeriodicTimer)
 
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, bool resetPeriodicTimer=true)
 
uint32 CalcMaxStackAmount () const
 
bool IsUsingStacks () const
 
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 IsSingleTarget () const
 
bool IsSingleTargetWith (Aura const *aura) const
 
void SetIsSingleTarget (bool val)
 
void UnregisterSingleTarget ()
 
int32 CalcDispelChance (Unit const *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 const & GetApplicationMap ()
 
void GetApplicationVector (std::vector< AuraApplication *> &applicationVector) const
 
AuraApplication const * GetApplicationOfTarget (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)
 
bool CanBeAppliedOn (Unit *target)
 
bool CheckAreaTarget (Unit *target)
 
bool CanStackWith (Aura const *existingAura) const
 
bool IsProcOnCooldown (std::chrono::steady_clock::time_point now) const
 
void AddProcCooldown (std::chrono::steady_clock::time_point cooldownEnd)
 
void ResetProcCooldown ()
 
bool IsUsingCharges () const
 
void SetUsingCharges (bool val)
 
void PrepareProcToTrigger (AuraApplication *aurApp, ProcEventInfo &eventInfo, std::chrono::steady_clock::time_point now)
 
uint32 GetProcEffectMask (AuraApplication *aurApp, ProcEventInfo &eventInfo, std::chrono::steady_clock::time_point now) const
 
float CalcProcChance (SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
 
void TriggerProcOnEvent (uint32 procEffectMask, AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
float CalcPPMProcChance (Unit *actor) const
 
void SetLastProcAttemptTime (std::chrono::steady_clock::time_point lastProcAttemptTime)
 
void SetLastProcSuccessTime (std::chrono::steady_clock::time_point lastProcSuccessTime)
 
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 CallScriptEffectCalcCritChanceHandlers (AuraEffect const *aurEff, AuraApplication const *aurApp, Unit const *victim, float &critChance)
 
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)
 
void CallScriptEnterLeaveCombatHandlers (AuraApplication const *aurApp, bool isNowInCombat)
 
bool CallScriptCheckProcHandlers (AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
bool CallScriptCheckEffectProcHandlers (AuraEffect const *aurEff, 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 *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
void CallScriptAfterEffectProcHandlers (AuraEffect *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
 
UnitAuraToUnitAura ()
 
UnitAura const * ToUnitAura () const
 
DynObjAuraToDynObjAura ()
 
DynObjAura const * ToDynObjAura () const
 
template<class Script >
Script * GetScript (std::string const &scriptName) const
 
AuraEffectVector const & GetAuraEffects () const
 

Static Public Member Functions

static uint32 BuildEffectMaskForOwner (SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
 
static AuraTryRefreshStackOrCreate (AuraCreateInfo &createInfo)
 
static AuraTryCreate (AuraCreateInfo &createInfo)
 
static AuraCreate (AuraCreateInfo &createInfo)
 
static int32 CalcMaxDuration (SpellInfo const *spellInfo, WorldObject *caster)
 
static bool EffectTypeNeedsSendingAmount (AuraType type)
 

Public Attributes

std::vector< AuraScript * > m_loadedScripts
 

Protected Attributes

SpellInfo const *const m_spellInfo
 
Difficulty const m_castDifficulty
 
ObjectGuid const m_castId
 
ObjectGuid const m_casterGuid
 
ObjectGuid const m_castItemGuid
 
uint32 m_castItemId
 
int32 m_castItemLevel
 
SpellCastVisual const m_spellVisual
 
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
 
bool m_isSingleTarget
 
bool m_isUsingCharges
 
ChargeDropEventm_dropEvent
 
std::chrono::steady_clock::time_point m_procCooldown
 
std::chrono::steady_clock::time_point m_lastProcAttemptTime
 
std::chrono::steady_clock::time_point m_lastProcSuccessTime
 

Private Member Functions

AuraScriptGetScriptByName (std::string const &scriptName) const
 
void _DeleteRemovedApplications ()
 

Private Attributes

std::vector< AuraApplication * > _removedApplications
 
AuraEffectVector _effects
 

Friends

class Unit
 

Member Typedef Documentation

◆ ApplicationMap

typedef std::unordered_map<ObjectGuid, AuraApplication*> Aura::ApplicationMap

Constructor & Destructor Documentation

◆ Aura()

Aura::Aura ( AuraCreateInfo const &  createInfo)
explicit
448  :
449 m_spellInfo(createInfo._spellInfo), m_castDifficulty(createInfo._castDifficulty), m_castId(createInfo._castId), m_casterGuid(createInfo.CasterGUID),
450 m_castItemGuid(createInfo.CastItemGUID), m_castItemId(createInfo.CastItemId),
451 m_castItemLevel(createInfo.CastItemLevel), m_spellVisual({ createInfo.Caster ? createInfo.Caster->GetCastSpellXSpellVisualId(createInfo._spellInfo) : createInfo._spellInfo->GetSpellXSpellVisualId(), 0 }),
453 m_casterLevel(createInfo.Caster ? createInfo.Caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
454 m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr),
455 m_procCooldown(std::chrono::steady_clock::time_point::min()),
456 m_lastProcAttemptTime(std::chrono::steady_clock::now() - Seconds(10)), m_lastProcSuccessTime(std::chrono::steady_clock::now() - Seconds(120))
457 {
458  for (SpellPowerEntry const* power : m_spellInfo->PowerCosts)
459  if (power && (power->ManaPerSecond != 0 || power->PowerPctPerSecond > 0.0f))
460  m_periodicCosts.push_back(power);
461 
462  if (!m_periodicCosts.empty())
464 
465  m_maxDuration = CalcMaxDuration(createInfo.Caster);
467  m_procCharges = CalcMaxCharges(createInfo.Caster);
469  // m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
470 }
uint8 const m_casterLevel
Definition: SpellAuras.h:326
time_t const m_applyTime
Definition: SpellAuras.h:317
int32 CalcMaxDuration() const
Definition: SpellAuras.h:169
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
uint8 m_stackAmount
Definition: SpellAuras.h:328
uint32 SpellLevel
Definition: SpellInfo.h:394
bool m_isUsingCharges
Definition: SpellAuras.h:334
std::chrono::steady_clock::time_point m_lastProcSuccessTime
Definition: SpellAuras.h:340
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:182
bool m_isSingleTarget
Definition: SpellAuras.h:333
std::chrono::steady_clock::time_point m_procCooldown
Definition: SpellAuras.h:338
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:27
Definition: DB2Structure.h:3254
ObjectGuid const m_castId
Definition: SpellAuras.h:311
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:336
bool m_isRemoved
Definition: SpellAuras.h:332
ObjectGuid const m_casterGuid
Definition: SpellAuras.h:312
int32 ManaPerSecond
Definition: DB2Structure.h:3260
std::vector< SpellPowerEntry const * > m_periodicCosts
Definition: SpellAuras.h:323
std::chrono::steady_clock::time_point m_lastProcAttemptTime
Definition: SpellAuras.h:339
uint32 m_castItemId
Definition: SpellAuras.h:314
time_t GetGameTime()
Definition: GameTime.cpp:39
Definition: Common.h:68
float PowerPctPerSecond
Definition: DB2Structure.h:3265
WorldObject *const m_owner
Definition: SpellAuras.h:318
int32 m_maxDuration
Definition: SpellAuras.h:320
uint8 m_procCharges
Definition: SpellAuras.h:327
int32 m_duration
Definition: SpellAuras.h:321
int32 m_updateTargetMapInterval
Definition: SpellAuras.h:324
Difficulty const m_castDifficulty
Definition: SpellAuras.h:310
int32 m_timeCla
Definition: SpellAuras.h:322
std::array< SpellPowerEntry const *, MAX_POWERS_PER_SPELL > PowerCosts
Definition: SpellInfo.h:396
SpellCastVisual const m_spellVisual
Definition: SpellAuras.h:316
int32 m_castItemLevel
Definition: SpellAuras.h:315
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:313
+ Here is the call graph for this function:

◆ ~Aura()

Aura::~Aura ( )
virtual
491 {
492  // unload scripts
493  for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
494  {
495  (*itr)->_Unload();
496  delete (*itr);
497  }
498 
499  for (AuraEffect* effect : _effects)
500  delete effect;
501 
502  ASSERT(m_applications.empty());
504 }
Definition: SpellAuraEffects.h:28
AuraEffectVector _effects
Definition: SpellAuras.h:345
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
ApplicationMap m_applications
Definition: SpellAuras.h:330
#define ASSERT
Definition: Errors.h:61
void _DeleteRemovedApplications()
Definition: SpellAuras.cpp:1947
+ Here is the call graph for this function:

Member Function Documentation

◆ _ApplyEffectForTargets()

void Aura::_ApplyEffectForTargets ( uint8  effIndex)
732 {
733  // prepare list of aura targets
734  UnitList targetList;
735  for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
736  {
737  if ((appIter->second->GetEffectsToApply() & (1 << effIndex)) && !appIter->second->HasEffect(effIndex))
738  targetList.push_back(appIter->second->GetTarget());
739  }
740 
741  // apply effect to targets
742  for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
743  {
744  if (GetApplicationOfTarget((*itr)->GetGUID()))
745  {
746  // owner has to be in world, or effect has to be applied to self
747  ASSERT((!GetOwner()->IsInWorld() && GetOwner() == *itr) || GetOwner()->IsInMap(*itr));
748  (*itr)->_ApplyAuraEffect(this, effIndex);
749  }
750  }
751 }
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
ApplicationMap m_applications
Definition: SpellAuras.h:330
#define ASSERT
Definition: Errors.h:61
std::list< Unit * > UnitList
Definition: Unit.h:108
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _ApplyForTarget()

void Aura::_ApplyForTarget ( Unit target,
Unit caster,
AuraApplication auraApp 
)
virtual

Reimplemented in UnitAura.

530 {
531  ASSERT(target);
532  ASSERT(auraApp);
533  // aura mustn't be already applied on target
534  ASSERT (!IsAppliedOnTarget(target->GetGUID()) && "Aura::_ApplyForTarget: aura musn't be already applied on target");
535 
536  m_applications[target->GetGUID()] = auraApp;
537 
538  // set infinity cooldown state for spells
539  if (caster && caster->GetTypeId() == TYPEID_PLAYER)
540  {
542  {
543  Item* castItem = !m_castItemGuid.IsEmpty() ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : nullptr;
544  caster->GetSpellHistory()->StartCooldown(m_spellInfo, castItem ? castItem->GetEntry() : 0, nullptr, true);
545  }
546  }
547 }
TypeID GetTypeId() const
Definition: Object.h:167
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
bool IsAppliedOnTarget(ObjectGuid guid) const
Definition: SpellAuras.h:237
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid const & GetGUID() const
Definition: Object.h:154
SpellHistory * GetSpellHistory()
Definition: Unit.h:1505
Definition: Item.h:169
ApplicationMap m_applications
Definition: SpellAuras.h:330
uint32 GetEntry() const
Definition: Object.h:155
Item * GetItemByGuid(ObjectGuid guid) const
Definition: Player.cpp:10096
bool IsEmpty() const
Definition: ObjectGuid.h:299
Definition: ObjectGuid.h:40
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false)
Definition: SpellHistory.cpp:397
bool IsCooldownStartedOnEvent() const
Definition: SpellInfo.cpp:1549
#define ASSERT
Definition: Errors.h:61
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:313
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _DeleteRemovedApplications()

void Aura::_DeleteRemovedApplications ( )
private
1948 {
1949  for (AuraApplication* aurApp : _removedApplications)
1950  delete aurApp;
1951 
1952  _removedApplications.clear();
1953 }
std::vector< AuraApplication * > _removedApplications
Definition: SpellAuras.h:343
Definition: SpellAuras.h:53
+ Here is the caller graph for this function:

◆ _InitEffects()

void Aura::_InitEffects ( uint32  effMask,
Unit caster,
int32 const *  baseAmount 
)
481 {
482  // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism
483  _effects.resize(GetSpellInfo()->GetEffects().size());
484 
485  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
486  if (effMask & (1 << spellEffectInfo.EffectIndex))
487  _effects[spellEffectInfo.EffectIndex] = new AuraEffect(this, spellEffectInfo, baseAmount ? baseAmount + spellEffectInfo.EffectIndex : nullptr, caster);
488 }
Definition: SpellAuraEffects.h:28
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
AuraEffectVector _effects
Definition: SpellAuras.h:345
constexpr auto size(const C &c)
Definition: advstd.h:89
Definition: SpellInfo.h:227
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _RegisterForTargets()

void Aura::_RegisterForTargets ( )
inline
159 { Unit* caster = GetCaster(); UpdateTargetMap(caster, false); }
void UpdateTargetMap(Unit *caster, bool apply=true)
Definition: SpellAuras.cpp:599
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Definition: Unit.h:737
+ Here is the caller graph for this function:

◆ _Remove()

void Aura::_Remove ( AuraRemoveMode  removeMode)
580 {
581  ASSERT (!m_isRemoved);
582  m_isRemoved = true;
583  ApplicationMap::iterator appItr = m_applications.begin();
584  for (appItr = m_applications.begin(); appItr != m_applications.end();)
585  {
586  AuraApplication * aurApp = appItr->second;
587  Unit* target = aurApp->GetTarget();
588  target->_UnapplyAura(aurApp, removeMode);
589  appItr = m_applications.begin();
590  }
591 
592  if (m_dropEvent)
593  {
595  m_dropEvent = nullptr;
596  }
597 }
Definition: SpellAuras.h:53
Unit * GetTarget() const
Definition: SpellAuras.h:74
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:336
bool m_isRemoved
Definition: SpellAuras.h:332
ApplicationMap m_applications
Definition: SpellAuras.h:330
void ScheduleAbort()
Definition: EventProcessor.cpp:21
#define ASSERT
Definition: Errors.h:61
Definition: Unit.h:737
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
Definition: Unit.cpp:3272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _UnapplyForTarget()

void Aura::_UnapplyForTarget ( Unit target,
Unit caster,
AuraApplication auraApp 
)
virtual
Todo:
Figure out why this happens

Reimplemented in UnitAura.

550 {
551  ASSERT(target);
552  ASSERT(auraApp->GetRemoveMode());
553  ASSERT(auraApp);
554 
555  ApplicationMap::iterator itr = m_applications.find(target->GetGUID());
556 
558  if (itr == m_applications.end())
559  {
560  TC_LOG_ERROR("spells", "Aura::_UnapplyForTarget, target: %s, caster:%s, spell:%u was not found in owners application map!",
561  target->GetGUID().ToString().c_str(), caster ? caster->GetGUID().ToString().c_str() : "Empty", auraApp->GetBase()->GetSpellInfo()->Id);
562  ABORT();
563  }
564 
565  // aura has to be already applied
566  ASSERT(itr->second == auraApp);
567  m_applications.erase(itr);
568 
569  _removedApplications.push_back(auraApp);
570 
571  // reset cooldown state for spells
572  if (caster && GetSpellInfo()->IsCooldownStartedOnEvent())
573  // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
575 }
std::vector< AuraApplication * > _removedApplications
Definition: SpellAuras.h:343
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
std::string ToString() const
Definition: ObjectGuid.cpp:238
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:186
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true)
Definition: SpellHistory.cpp:510
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:88
uint32 const Id
Definition: SpellInfo.h:340
ObjectGuid const & GetGUID() const
Definition: Object.h:154
SpellHistory * GetSpellHistory()
Definition: Unit.h:1505
ApplicationMap m_applications
Definition: SpellAuras.h:330
#define ABORT
Definition: Errors.h:64
#define ASSERT
Definition: Errors.h:61
Aura * GetBase() const
Definition: SpellAuras.h:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddProcCooldown()

void Aura::AddProcCooldown ( std::chrono::steady_clock::time_point  cooldownEnd)
1720 {
1721  m_procCooldown = cooldownEnd;
1722 }
std::chrono::steady_clock::time_point m_procCooldown
Definition: SpellAuras.h:338
+ Here is the caller graph for this function:

◆ ApplyForTargets()

void Aura::ApplyForTargets ( )
inline
160 { Unit* caster = GetCaster(); UpdateTargetMap(caster, true); }
void UpdateTargetMap(Unit *caster, bool apply=true)
Definition: SpellAuras.cpp:599
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Definition: Unit.h:737
+ Here is the call graph for this function:

◆ BuildEffectMaskForOwner()

uint32 Aura::BuildEffectMaskForOwner ( SpellInfo const *  spellProto,
uint32  availableEffectMask,
WorldObject owner 
)
static
295 {
296  ASSERT(spellProto);
297  ASSERT(owner);
298  uint32 effMask = 0;
299  switch (owner->GetTypeId())
300  {
301  case TYPEID_UNIT:
302  case TYPEID_PLAYER:
303  for (SpellEffectInfo const& spellEffectInfo : spellProto->GetEffects())
304  {
305  if (spellEffectInfo.IsUnitOwnedAuraEffect())
306  effMask |= 1 << spellEffectInfo.EffectIndex;
307  }
308  break;
310  for (SpellEffectInfo const& spellEffectInfo : spellProto->GetEffects())
311  {
312  if (spellEffectInfo.IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
313  effMask |= 1 << spellEffectInfo.EffectIndex;
314  }
315  break;
316  default:
317  ABORT();
318  break;
319  }
320 
321  return effMask & availableEffectMask;
322 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: ObjectGuid.h:39
Definition: SpellInfo.h:227
uint32_t uint32
Definition: Define.h:152
Definition: ObjectGuid.h:40
#define ABORT
Definition: Errors.h:64
#define ASSERT
Definition: Errors.h:61
Definition: SharedDefines.h:1125
Definition: ObjectGuid.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcDispelChance()

int32 Aura::CalcDispelChance ( Unit const *  auraTarget,
bool  offensive 
) const
1187 {
1188  // we assume that aura dispel chance is 100% on start
1189  // need formula for level difference based chance
1190  int32 resistChance = 0;
1191 
1192  // Apply dispel mod from aura caster
1193  if (Unit* caster = GetCaster())
1194  if (Player* modOwner = caster->GetSpellModOwner())
1195  modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::DispelResistance, resistChance);
1196 
1197  RoundToInterval(resistChance, 0, 100);
1198  return 100 - resistChance;
1199 }
T RoundToInterval(T &num, T floor, T ceil)
Definition: Util.h:95
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
int32_t int32
Definition: Define.h:148
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcMaxCharges() [1/2]

uint8 Aura::CalcMaxCharges ( Unit caster) const
945 {
946  uint32 maxProcCharges = m_spellInfo->ProcCharges;
947  if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetSpellInfo()))
948  maxProcCharges = procEntry->Charges;
949 
950  if (caster)
951  if (Player* modOwner = caster->GetSpellModOwner())
952  modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::ProcCharges, maxProcCharges);
953 
954  return uint8(maxProcCharges);
955 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
uint32 ProcCharges
Definition: SpellInfo.h:388
Definition: SpellMgr.h:275
#define sSpellMgr
Definition: SpellMgr.h:792
uint32_t uint32
Definition: Define.h:152
uint8_t uint8
Definition: Define.h:154
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcMaxCharges() [2/2]

uint8 Aura::CalcMaxCharges ( ) const
inline
182 { return CalcMaxCharges(GetCaster()); }
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:182
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcMaxDuration() [1/3]

int32 Aura::CalcMaxDuration ( ) const
inline
169 { return CalcMaxDuration(GetCaster()); }
int32 CalcMaxDuration() const
Definition: SpellAuras.h:169
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcMaxDuration() [2/3]

int32 Aura::CalcMaxDuration ( Unit caster) const
844 {
845  return Aura::CalcMaxDuration(GetSpellInfo(), caster);
846 }
int32 CalcMaxDuration() const
Definition: SpellAuras.h:169
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
+ Here is the call graph for this function:

◆ CalcMaxDuration() [3/3]

int32 Aura::CalcMaxDuration ( SpellInfo const *  spellInfo,
WorldObject caster 
)
static
849 {
850  Player* modOwner = nullptr;
851  int32 maxDuration;
852 
853  if (caster)
854  {
855  modOwner = caster->GetSpellModOwner();
856  maxDuration = caster->CalcSpellDuration(spellInfo);
857  }
858  else
859  maxDuration = spellInfo->GetDuration();
860 
861  if (spellInfo->IsPassive() && !spellInfo->DurationEntry)
862  maxDuration = -1;
863 
864  // IsPermanent() checks max duration (which we are supposed to calculate here)
865  if (maxDuration != -1 && modOwner)
866  modOwner->ApplySpellMod(spellInfo, SpellModOp::Duration, maxDuration);
867 
868  return maxDuration;
869 }
void ApplySpellMod(SpellInfo const *spellInfo, SpellModOp op, T &basevalue, Spell *spell=nullptr) const
Definition: Player.cpp:22445
int32_t int32
Definition: Define.h:148
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
int32 CalcSpellDuration(SpellInfo const *spellInfo) const
Definition: Object.cpp:2163
Definition: Player.h:1081
+ Here is the call graph for this function:

◆ CalcMaxStackAmount()

uint32 Aura::CalcMaxStackAmount ( ) const
1029 {
1030  int32 maxStackAmount = m_spellInfo->StackAmount;
1031  if (Unit* caster = GetCaster())
1032  if (Player* modOwner = caster->GetSpellModOwner())
1033  modOwner->ApplySpellMod(m_spellInfo, SpellModOp::MaxAuraStacks, maxStackAmount);
1034 
1035  return maxStackAmount;
1036 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
int32_t int32
Definition: Define.h:148
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
uint32 StackAmount
Definition: SpellInfo.h:400
Definition: Unit.h:737
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcPPMProcChance()

float Aura::CalcPPMProcChance ( Unit actor) const
1931 {
1932  using FSeconds = std::chrono::duration<float, Seconds::period>;
1933 
1934  // Formula see http://us.battle.net/wow/en/forum/topic/8197741003#1
1935  float ppm = m_spellInfo->CalcProcPPM(actor, GetCastItemLevel());
1936  float averageProcInterval = 60.0f / ppm;
1937 
1938  std::chrono::steady_clock::time_point currentTime = GameTime::GetGameTimeSteadyPoint();
1939  float secondsSinceLastAttempt = std::min(std::chrono::duration_cast<FSeconds>(currentTime - m_lastProcAttemptTime).count(), 10.0f);
1940  float secondsSinceLastProc = std::min(std::chrono::duration_cast<FSeconds>(currentTime - m_lastProcSuccessTime).count(), 1000.0f);
1941 
1942  float chance = std::max(1.0f, 1.0f + ((secondsSinceLastProc / averageProcInterval - 1.5f) * 3.0f)) * ppm * secondsSinceLastAttempt / 60.0f;
1943  RoundToInterval(chance, 0.0f, 1.0f);
1944  return chance * 100.0f;
1945 }
T RoundToInterval(T &num, T floor, T ceil)
Definition: Util.h:95
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
float CalcProcPPM(Unit *caster, int32 itemLevel) const
Definition: SpellInfo.cpp:4100
std::chrono::steady_clock::time_point m_lastProcSuccessTime
Definition: SpellAuras.h:340
std::chrono::steady_clock::time_point m_lastProcAttemptTime
Definition: SpellAuras.h:339
int32 GetCastItemLevel() const
Definition: SpellAuras.h:142
std::chrono::steady_clock::time_point GetGameTimeSteadyPoint()
Current chrono steady_clock time point.
Definition: GameTime.cpp:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcProcChance()

float Aura::CalcProcChance ( SpellProcEntry const &  procEntry,
ProcEventInfo eventInfo 
) const
1872 {
1873  float chance = procEntry.Chance;
1874  // calculate chances depending on unit with caster's data
1875  // so talents modifying chances and judgements will have properly calculated proc chance
1876  if (Unit* caster = GetCaster())
1877  {
1878  // calculate ppm chance if present and we're using weapon
1879  if (eventInfo.GetDamageInfo() && procEntry.ProcsPerMinute != 0)
1880  {
1881  uint32 WeaponSpeed = caster->GetBaseAttackTime(eventInfo.GetDamageInfo()->GetAttackType());
1882  chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ProcsPerMinute, GetSpellInfo());
1883  }
1884 
1885  if (GetSpellInfo()->ProcBasePPM > 0.0f)
1886  chance = CalcPPMProcChance(caster);
1887 
1888  // apply chance modifer aura, applies also to ppm chance (see improved judgement of light spell)
1889  if (Player* modOwner = caster->GetSpellModOwner())
1890  modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::ProcChance, chance);
1891  }
1892 
1893  // proc chance is reduced by an additional 3.333% per level past 60
1894  if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->getLevel() > 60)
1895  chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->getLevel() - 60) * 1.f / 30.f)) * chance);
1896 
1897  return chance;
1898 }
DamageInfo * GetDamageInfo() const
Definition: Unit.h:496
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellMgr.h:272
uint8 getLevel() const
Definition: Unit.h:847
float CalcPPMProcChance(Unit *actor) const
Definition: SpellAuras.cpp:1930
WeaponAttackType GetAttackType() const
Definition: Unit.h:436
uint32_t uint32
Definition: Define.h:152
Unit * GetActor()
Definition: Unit.h:484
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptAfterDispel()

void Aura::CallScriptAfterDispel ( DispelInfo dispelInfo)
1994 {
1995  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1996  {
1997  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
1998  auto hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
1999  for (; hookItr != hookItrEnd; ++hookItr)
2000  hookItr->Call(*scritr, dispelInfo);
2001 
2002  (*scritr)->_FinishScriptCall();
2003  }
2004 }
Definition: SpellScript.h:535
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the caller graph for this function:

◆ CallScriptAfterEffectApplyHandlers()

void Aura::CallScriptAfterEffectApplyHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
AuraEffectHandleModes  mode 
)
2046 {
2047  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2048  {
2049  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp);
2050  auto effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
2051  for (; effItr != effEndItr; ++effItr)
2052  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2053  effItr->Call(*scritr, aurEff, mode);
2054 
2055  (*scritr)->_FinishScriptCall();
2056  }
2057 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
Definition: SpellScript.h:519
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptAfterEffectProcHandlers()

void Aura::CallScriptAfterEffectProcHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2350 {
2351  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2352  {
2353  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC, aurApp);
2354  auto effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin();
2355  for (; effItr != effEndItr; ++effItr)
2356  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2357  effItr->Call(*scritr, aurEff, eventInfo);
2358 
2359  (*scritr)->_FinishScriptCall();
2360  }
2361 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:543
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptAfterEffectRemoveHandlers()

void Aura::CallScriptAfterEffectRemoveHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
AuraEffectHandleModes  mode 
)
2060 {
2061  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2062  {
2063  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp);
2064  auto effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
2065  for (; effItr != effEndItr; ++effItr)
2066  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2067  effItr->Call(*scritr, aurEff, mode);
2068 
2069  (*scritr)->_FinishScriptCall();
2070  }
2071 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:521
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptAfterProcHandlers()

void Aura::CallScriptAfterProcHandlers ( AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2301 {
2302  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2303  {
2304  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_PROC, aurApp);
2305  auto hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin();
2306  for (; hookItr != hookItrEnd; ++hookItr)
2307  hookItr->Call(*scritr, eventInfo);
2308 
2309  (*scritr)->_FinishScriptCall();
2310  }
2311 }
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:544
+ Here is the caller graph for this function:

◆ CallScriptCheckAreaTargetHandlers()

bool Aura::CallScriptCheckAreaTargetHandlers ( Unit target)
1966 {
1967  bool result = true;
1968  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1969  {
1970  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET);
1971  auto hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin();
1972  for (; hookItr != hookItrEnd; ++hookItr)
1973  result &= hookItr->Call(*scritr, target);
1974 
1975  (*scritr)->_FinishScriptCall();
1976  }
1977  return result;
1978 }
Definition: SpellScript.h:533
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the caller graph for this function:

◆ CallScriptCheckEffectProcHandlers()

bool Aura::CallScriptCheckEffectProcHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2314 {
2315  bool result = true;
2316  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2317  {
2318  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC, aurApp);
2319  auto hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin();
2320  for (; hookItr != hookItrEnd; ++hookItr)
2321  if (hookItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2322  result &= hookItr->Call(*scritr, aurEff, eventInfo);
2323 
2324  (*scritr)->_FinishScriptCall();
2325  }
2326 
2327  return result;
2328 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:539
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptCheckProcHandlers()

bool Aura::CallScriptCheckProcHandlers ( AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2249 {
2250  bool result = true;
2251  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2252  {
2253  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_PROC, aurApp);
2254  auto hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin();
2255  for (; hookItr != hookItrEnd; ++hookItr)
2256  result &= hookItr->Call(*scritr, eventInfo);
2257 
2258  (*scritr)->_FinishScriptCall();
2259  }
2260 
2261  return result;
2262 }
Definition: SpellScript.h:538
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the caller graph for this function:

◆ CallScriptDispel()

void Aura::CallScriptDispel ( DispelInfo dispelInfo)
1981 {
1982  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1983  {
1984  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
1985  auto hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
1986  for (; hookItr != hookItrEnd; ++hookItr)
1987  hookItr->Call(*scritr, dispelInfo);
1988 
1989  (*scritr)->_FinishScriptCall();
1990  }
1991 }
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:534
+ Here is the caller graph for this function:

◆ CallScriptEffectAbsorbHandlers()

void Aura::CallScriptEffectAbsorbHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount,
bool &  defaultPrevented 
)
2163 {
2164  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2165  {
2166  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp);
2167  auto effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
2168  for (; effItr != effEndItr; ++effItr)
2169 
2170  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2171  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2172 
2173  if (!defaultPrevented)
2174  defaultPrevented = (*scritr)->_IsDefaultActionPrevented();
2175 
2176  (*scritr)->_FinishScriptCall();
2177  }
2178 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
Definition: SpellScript.h:528
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectAfterAbsorbHandlers()

void Aura::CallScriptEffectAfterAbsorbHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
2181 {
2182  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2183  {
2184  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp);
2185  auto effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
2186  for (; effItr != effEndItr; ++effItr)
2187  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2188  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2189 
2190  (*scritr)->_FinishScriptCall();
2191  }
2192 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
Definition: SpellScript.h:529
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectAfterManaShieldHandlers()

void Aura::CallScriptEffectAfterManaShieldHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
2209 {
2210  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2211  {
2212  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp);
2213  auto effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin();
2214  for (; effItr != effEndItr; ++effItr)
2215  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2216  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2217 
2218  (*scritr)->_FinishScriptCall();
2219  }
2220 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
Definition: SpellScript.h:531
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectApplyHandlers()

bool Aura::CallScriptEffectApplyHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
AuraEffectHandleModes  mode 
)
2007 {
2008  bool preventDefault = false;
2009  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2010  {
2011  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp);
2012  auto effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
2013  for (; effItr != effEndItr; ++effItr)
2014  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2015  effItr->Call(*scritr, aurEff, mode);
2016 
2017  if (!preventDefault)
2018  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2019 
2020  (*scritr)->_FinishScriptCall();
2021  }
2022 
2023  return preventDefault;
2024 }
Definition: SpellScript.h:518
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectCalcAmountHandlers()

void Aura::CallScriptEffectCalcAmountHandlers ( AuraEffect const *  aurEff,
int32 amount,
bool &  canBeRecalculated 
)
2108 {
2109  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2110  {
2111  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT);
2112  auto effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
2113  for (; effItr != effEndItr; ++effItr)
2114  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2115  effItr->Call(*scritr, aurEff, amount, canBeRecalculated);
2116 
2117  (*scritr)->_FinishScriptCall();
2118  }
2119 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:524
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectCalcCritChanceHandlers()

void Aura::CallScriptEffectCalcCritChanceHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
Unit const *  victim,
float &  critChance 
)
2150 {
2151  for (AuraScript* loadedScript : m_loadedScripts)
2152  {
2153  loadedScript->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_CRIT_CHANCE, aurApp);
2154  for (AuraScript::EffectCalcCritChanceHandler const& hook : loadedScript->DoEffectCalcCritChance)
2155  if (hook.IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2156  hook.Call(loadedScript, aurEff, victim, critChance);
2157 
2158  loadedScript->_FinishScriptCall();
2159  }
2160 }
void Call(AuraScript *auraScript, AuraEffect const *aurEff, Unit const *victim, float &critChance) const
Definition: SpellScript.cpp:977
Definition: SpellScript.h:642
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
bool IsEffectAffected(SpellInfo const *spellInfo, uint8 effIndex) const
Definition: SpellScript.cpp:114
Definition: SpellScript.h:527
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:553
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectCalcPeriodicHandlers()

void Aura::CallScriptEffectCalcPeriodicHandlers ( AuraEffect const *  aurEff,
bool &  isPeriodic,
int32 amplitude 
)
2122 {
2123  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2124  {
2125  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC);
2126  auto effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
2127  for (; effItr != effEndItr; ++effItr)
2128  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2129  effItr->Call(*scritr, aurEff, isPeriodic, amplitude);
2130 
2131  (*scritr)->_FinishScriptCall();
2132  }
2133 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:525
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectCalcSpellModHandlers()

void Aura::CallScriptEffectCalcSpellModHandlers ( AuraEffect const *  aurEff,
SpellModifier *&  spellMod 
)
2136 {
2137  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2138  {
2139  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD);
2140  auto effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
2141  for (; effItr != effEndItr; ++effItr)
2142  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2143  effItr->Call(*scritr, aurEff, spellMod);
2144 
2145  (*scritr)->_FinishScriptCall();
2146  }
2147 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:526
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectManaShieldHandlers()

void Aura::CallScriptEffectManaShieldHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount,
bool &  defaultPrevented 
)
2195 {
2196  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2197  {
2198  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp);
2199  auto effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin();
2200  for (; effItr != effEndItr; ++effItr)
2201  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2202  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2203 
2204  (*scritr)->_FinishScriptCall();
2205  }
2206 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:530
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectPeriodicHandlers()

bool Aura::CallScriptEffectPeriodicHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp 
)
2074 {
2075  bool preventDefault = false;
2076  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2077  {
2078  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp);
2079  auto effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
2080  for (; effItr != effEndItr; ++effItr)
2081  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2082  effItr->Call(*scritr, aurEff);
2083 
2084  if (!preventDefault)
2085  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2086 
2087  (*scritr)->_FinishScriptCall();
2088  }
2089 
2090  return preventDefault;
2091 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
Definition: SpellScript.h:522
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectProcHandlers()

bool Aura::CallScriptEffectProcHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2331 {
2332  bool preventDefault = false;
2333  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2334  {
2335  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PROC, aurApp);
2336  auto effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin();
2337  for (; effItr != effEndItr; ++effItr)
2338  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2339  effItr->Call(*scritr, aurEff, eventInfo);
2340 
2341  if (!preventDefault)
2342  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2343 
2344  (*scritr)->_FinishScriptCall();
2345  }
2346  return preventDefault;
2347 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
Definition: SpellScript.h:542
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectRemoveHandlers()

bool Aura::CallScriptEffectRemoveHandlers ( AuraEffect const *  aurEff,
AuraApplication const *  aurApp,
AuraEffectHandleModes  mode 
)
2027 {
2028  bool preventDefault = false;
2029  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2030  {
2031  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp);
2032  auto effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
2033  for (; effItr != effEndItr; ++effItr)
2034  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2035  effItr->Call(*scritr, aurEff, mode);
2036 
2037  if (!preventDefault)
2038  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2039 
2040  (*scritr)->_FinishScriptCall();
2041  }
2042  return preventDefault;
2043 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
Definition: SpellScript.h:520
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEffectSplitHandlers()

void Aura::CallScriptEffectSplitHandlers ( AuraEffect aurEff,
AuraApplication const *  aurApp,
DamageInfo dmgInfo,
uint32 splitAmount 
)
2223 {
2224  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2225  {
2226  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp);
2227  auto effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin();
2228  for (; effItr != effEndItr; ++effItr)
2229  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2230  effItr->Call(*scritr, aurEff, dmgInfo, splitAmount);
2231 
2232  (*scritr)->_FinishScriptCall();
2233  }
2234 }
Definition: SpellScript.h:532
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:

◆ CallScriptEffectUpdatePeriodicHandlers()

void Aura::CallScriptEffectUpdatePeriodicHandlers ( AuraEffect aurEff)
2094 {
2095  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2096  {
2097  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC);
2098  auto effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
2099  for (; effItr != effEndItr; ++effItr)
2100  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2101  effItr->Call(*scritr, aurEff);
2102 
2103  (*scritr)->_FinishScriptCall();
2104  }
2105 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:523
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptEnterLeaveCombatHandlers()

void Aura::CallScriptEnterLeaveCombatHandlers ( AuraApplication const *  aurApp,
bool  isNowInCombat 
)
2237 {
2238  for (AuraScript* loadedScript : m_loadedScripts)
2239  {
2240  loadedScript->_PrepareScriptCall(AURA_SCRIPT_HOOK_ENTER_LEAVE_COMBAT, aurApp);
2241  for (AuraScript::EnterLeaveCombatHandler const& hook : loadedScript->OnEnterLeaveCombat)
2242  hook.Call(loadedScript, isNowInCombat);
2243 
2244  loadedScript->_FinishScriptCall();
2245  }
2246 }
Definition: SpellScript.h:715
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:536
void Call(AuraScript *auraScript, bool isNowInCombat) const
Definition: SpellScript.cpp:1075
Definition: SpellScript.h:553
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallScriptPrepareProcHandlers()

bool Aura::CallScriptPrepareProcHandlers ( AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2265 {
2266  bool prepare = true;
2267  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2268  {
2269  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PREPARE_PROC, aurApp);
2270  auto effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin();
2271  for (; effItr != effEndItr; ++effItr)
2272  effItr->Call(*scritr, eventInfo);
2273 
2274  if (prepare)
2275  prepare = !(*scritr)->_IsDefaultActionPrevented();
2276 
2277  (*scritr)->_FinishScriptCall();
2278  }
2279 
2280  return prepare;
2281 }
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
Definition: SpellScript.h:540
+ Here is the caller graph for this function:

◆ CallScriptProcHandlers()

bool Aura::CallScriptProcHandlers ( AuraApplication const *  aurApp,
ProcEventInfo eventInfo 
)
2284 {
2285  bool handled = false;
2286  for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2287  {
2288  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp);
2289  auto hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin();
2290  for (; hookItr != hookItrEnd; ++hookItr)
2291  hookItr->Call(*scritr, eventInfo);
2292 
2293  handled |= (*scritr)->_IsDefaultActionPrevented();
2294  (*scritr)->_FinishScriptCall();
2295  }
2296 
2297  return handled;
2298 }
Definition: SpellScript.h:541
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
+ Here is the caller graph for this function:

◆ CanBeAppliedOn()

bool Aura::CanBeAppliedOn ( Unit target)
1545 {
1546  for (uint32 label : GetSpellInfo()->Labels)
1548  return false;
1549 
1550  // unit not in world or during remove from world
1551  if (!target->IsInWorld() || target->IsDuringRemoveFromWorld())
1552  {
1553  // area auras mustn't be applied
1554  if (GetOwner() != target)
1555  return false;
1556  // do not apply non-selfcast single target auras
1558  return false;
1559  return true;
1560  }
1561  else
1562  return CheckAreaTarget(target);
1563 }
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:1796
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
bool CheckAreaTarget(Unit *target)
Definition: SpellAuras.cpp:1565
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1795
bool IsInWorld() const
Definition: Object.h:149
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
ObjectGuid const & GetGUID() const
Definition: Object.h:154
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const
Definition: Unit.cpp:4438
uint32_t uint32
Definition: Define.h:152
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanBeSaved()

bool Aura::CanBeSaved ( ) const
1114 {
1115  if (IsPassive())
1116  return false;
1117 
1118  if (GetSpellInfo()->IsChanneled())
1119  return false;
1120 
1121  // Check if aura is single target, not only spell info
1122  if (GetCasterGUID() != GetOwner()->GetGUID())
1123  {
1124  // owner == caster for area auras, check for possible bad data in DB
1125  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
1126  {
1127  if (!spellEffectInfo.IsEffect())
1128  continue;
1129 
1130  if (spellEffectInfo.IsTargetingArea() || spellEffectInfo.IsAreaAuraEffect())
1131  return false;
1132  }
1133 
1135  return false;
1136  }
1137 
1139  return false;
1140 
1141  // don't save auras removed by proc system
1142  if (IsUsingCharges() && !GetCharges())
1143  return false;
1144 
1145  // don't save permanent auras triggered by items, they'll be recasted on login if necessary
1146  if (!GetCastItemGUID().IsEmpty() && IsPermanent())
1147  return false;
1148 
1149  return true;
1150 }
bool IsPassive() const
Definition: SpellAuras.cpp:1095
bool IsSingleTarget() const
Definition: SpellAuras.h:206
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:140
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1795
Definition: SpellInfo.h:175
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
Definition: SpellInfo.h:227
bool IsUsingCharges() const
Definition: SpellAuras.h:248
uint8 GetCharges() const
Definition: SpellAuras.h:179
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
bool IsEmpty() const
Definition: ObjectGuid.h:299
bool IsPermanent() const
Definition: SpellAuras.h:177
+ Here is the call graph for this function:

◆ CanStackWith()

bool Aura::CanStackWith ( Aura const *  existingAura) const
1571 {
1572  // Can stack with self
1573  if (this == existingAura)
1574  return true;
1575 
1576  // Dynobj auras always stack
1577  if (GetType() == DYNOBJ_AURA_TYPE || existingAura->GetType() == DYNOBJ_AURA_TYPE)
1578  return true;
1579 
1580  SpellInfo const* existingSpellInfo = existingAura->GetSpellInfo();
1581  bool sameCaster = GetCasterGUID() == existingAura->GetCasterGUID();
1582 
1583  // passive auras don't stack with another rank of the spell cast by same caster
1584  if (IsPassive() && sameCaster && (m_spellInfo->IsDifferentRankOf(existingSpellInfo) || (m_spellInfo->Id == existingSpellInfo->Id && m_castItemGuid.IsEmpty())))
1585  return false;
1586 
1587  for (SpellEffectInfo const& spellEffectInfo : existingSpellInfo->GetEffects())
1588  {
1589  // prevent remove triggering aura by triggered aura
1590  if (spellEffectInfo.TriggerSpell == GetId())
1591  return true;
1592  }
1593 
1594  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
1595  {
1596  // prevent remove triggered aura by triggering aura refresh
1597  if (spellEffectInfo.TriggerSpell == existingAura->GetId())
1598  return true;
1599  }
1600 
1601  // Check for custom server setting to allow tracking both Herbs and Minerals
1602  // Note: The following are client limitations and cannot be coded for:
1603  // * The minimap tracking icon will display whichever skill is activated second
1604  // * The minimap tracking list will only show a check mark next to the last skill activated
1605  // Sometimes this bugs out and doesn't switch the check mark. It has no effect on the actual tracking though.
1606  // * The minimap dots are yellow for both resources
1608  return sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES);
1609 
1610  // check spell specific stack rules
1611  if (m_spellInfo->IsAuraExclusiveBySpecificWith(existingSpellInfo)
1612  || (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo)))
1613  return false;
1614 
1615  // check spell group stack rules
1616  switch (sSpellMgr->CheckSpellGroupStackRules(m_spellInfo, existingSpellInfo))
1617  {
1619  case SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST: // if it reaches this point, existing aura is lower/equal
1620  return false;
1622  if (sameCaster)
1623  return false;
1624  break;
1627  default:
1628  break;
1629  }
1630 
1631  if (m_spellInfo->SpellFamilyName != existingSpellInfo->SpellFamilyName)
1632  return true;
1633 
1634  if (!sameCaster)
1635  {
1636  // Channeled auras can stack if not forbidden by db or aura type
1637  if (existingAura->GetSpellInfo()->IsChanneled())
1638  return true;
1639 
1641  return true;
1642 
1643  // check same periodic auras
1644  auto hasPeriodicNonAreaEffect = [](SpellInfo const* spellInfo)
1645  {
1646  for (SpellEffectInfo const& spellEffectInfo : spellInfo->GetEffects())
1647  {
1648  switch (spellEffectInfo.ApplyAuraName)
1649  {
1650  // DOT or HOT from different casters will stack
1659  case SPELL_AURA_POWER_BURN:
1664  // periodic auras which target areas are not allowed to stack this way (replenishment for example)
1665  if (spellEffectInfo.IsTargetingArea())
1666  return false;
1667  return true;
1668  default:
1669  break;
1670  }
1671  }
1672  return false;
1673  };
1674 
1675  if (hasPeriodicNonAreaEffect(m_spellInfo) && hasPeriodicNonAreaEffect(existingSpellInfo))
1676  return true;
1677  }
1678 
1679  if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE) && existingAura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE))
1680  {
1681  Vehicle* veh = nullptr;
1682  if (GetOwner()->ToUnit())
1683  veh = GetOwner()->ToUnit()->GetVehicleKit();
1684 
1685  if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
1686  return true;
1687 
1688  if (!veh->GetAvailableSeatCount())
1689  return false; // No empty seat available
1690 
1691  return true; // Empty seat available (skip rest)
1692  }
1693 
1695  if (existingAura->HasEffectType(SPELL_AURA_SHOW_CONFIRMATION_PROMPT) || existingAura->HasEffectType(SPELL_AURA_SHOW_CONFIRMATION_PROMPT_WITH_DIFFICULTY))
1696  return false;
1697 
1698  // spell of same spell rank chain
1699  if (m_spellInfo->IsRankOf(existingSpellInfo))
1700  {
1701  // don't allow passive area auras to stack
1702  if (m_spellInfo->IsMultiSlotAura() && !IsArea())
1703  return true;
1704  if (!GetCastItemGUID().IsEmpty() && !existingAura->GetCastItemGUID().IsEmpty())
1705  if (GetCastItemGUID() != existingAura->GetCastItemGUID() && (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_ENCHANT_PROC)))
1706  return true;
1707  // same spell with same caster should not stack
1708  return false;
1709  }
1710 
1711  return true;
1712 }
Definition: SpellAuraDefines.h:141
bool IsPassive() const
Definition: SpellAuras.cpp:1095
Definition: SpellAuraDefines.h:557
Definition: SpellAuraDefines.h:111
bool IsArea() const
Definition: SpellAuras.cpp:1086
Definition: SpellAuraDefines.h:133
Definition: Vehicle.h:31
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1243
bool HasAura(AuraType aura) const
Definition: SpellInfo.cpp:1292
Definition: SpellAuraDefines.h:108
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:335
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:140
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Vehicle * GetVehicleKit() const
Definition: Unit.h:1759
uint32 GetId() const
Definition: SpellAuras.h:135
bool IsDifferentRankOf(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:4244
Definition: SpellAuraDefines.h:600
bool IsAuraExclusiveBySpecificWith(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:1812
#define sWorld
Definition: World.h:926
Definition: SpellAuraDefines.h:152
Definition: World.h:174
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
Definition: SpellAuraDefines.h:482
uint32 const Id
Definition: SpellInfo.h:340
bool IsMultiSlotAura() const
Definition: SpellInfo.cpp:1538
Definition: SpellInfo.h:151
Definition: SpellAuraDefines.h:250
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:1844
uint32 SpellFamilyName
Definition: SpellInfo.h:418
#define sSpellMgr
Definition: SpellMgr.h:792
Definition: SpellInfo.h:227
Definition: SpellAuraDefines.h:177
Definition: SpellMgr.h:343
Definition: SpellAuraDefines.h:314
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:579
Definition: SpellAuraDefines.h:315
bool IsRankOf(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:4239
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
bool IsEmpty() const
Definition: ObjectGuid.h:299
Definition: SpellMgr.h:342
Definition: SpellAuraDefines.h:96
Definition: SharedDefines.h:497
Definition: SpellAuraDefines.h:158
Definition: SpellAuraDefines.h:91
uint8 GetAvailableSeatCount() const
Gets the available seat count.
Definition: Vehicle.cpp:655
Definition: SpellAuraDefines.h:324
Definition: SpellAuraDefines.h:112
Definition: SpellAuraDefines.h:109
Unit * ToUnit()
Definition: Object.h:200
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:313
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckAreaTarget()

bool Aura::CheckAreaTarget ( Unit target)
1566 {
1567  return CallScriptCheckAreaTargetHandlers(target);
1568 }
bool CallScriptCheckAreaTargetHandlers(Unit *target)
Definition: SpellAuras.cpp:1965
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Create()

Aura * Aura::Create ( AuraCreateInfo createInfo)
static
377 {
378  // try to get caster of aura
379  if (!createInfo.CasterGUID.IsEmpty())
380  {
381  // world gameobjects can't own auras and they send empty casterguid
382  // checked on sniffs with spell 22247
383  if (createInfo.CasterGUID.IsGameObject())
384  {
385  createInfo.Caster = nullptr;
386  createInfo.CasterGUID.Clear();
387  }
388  else
389  {
390  if (createInfo._owner->GetGUID() == createInfo.CasterGUID)
391  createInfo.Caster = createInfo._owner->ToUnit();
392  else
393  createInfo.Caster = ObjectAccessor::GetUnit(*createInfo._owner, createInfo.CasterGUID);
394  }
395  }
396  else if (createInfo.Caster)
397  createInfo.CasterGUID = createInfo.Caster->GetGUID();
398 
399  // check if aura can be owned by owner
400  if (createInfo._owner->isType(TYPEMASK_UNIT))
401  if (!createInfo._owner->IsInWorld() || createInfo._owner->ToUnit()->IsDuringRemoveFromWorld())
402  // owner not in world so don't allow to own not self cast single target auras
403  if (createInfo.CasterGUID != createInfo._owner->GetGUID() && createInfo._spellInfo->IsSingleTarget())
404  return nullptr;
405 
406  Aura* aura = nullptr;
407  switch (createInfo._owner->GetTypeId())
408  {
409  case TYPEID_UNIT:
410  case TYPEID_PLAYER:
411  {
412  aura = new UnitAura(createInfo);
413 
414  // aura can be removed in Unit::_AddAura call
415  if (aura->IsRemoved())
416  return nullptr;
417 
418  // add owner
419  uint32 effMask = createInfo._auraEffectMask;
420  if (createInfo._targetEffectMask)
421  effMask = createInfo._targetEffectMask;
422 
423  effMask = Aura::BuildEffectMaskForOwner(createInfo._spellInfo, effMask, createInfo._owner);
424  ASSERT(effMask);
425 
426  Unit* unit = createInfo._owner->ToUnit();
427  aura->ToUnitAura()->AddStaticApplication(unit, effMask);
428  break;
429  }
431  createInfo._auraEffectMask = Aura::BuildEffectMaskForOwner(createInfo._spellInfo, createInfo._auraEffectMask, createInfo._owner);
432  ASSERT(createInfo._auraEffectMask);
433 
434  aura = new DynObjAura(createInfo);
435  break;
436  default:
437  ABORT();
438  return nullptr;
439  }
440 
441  // scripts, etc.
442  if (aura->IsRemoved())
443  return nullptr;
444 
445  return aura;
446 }
uint32 _targetEffectMask
Definition: SpellAuraDefines.h:685
Definition: SpellAuras.h:372
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:1796
TypeID GetTypeId() const
Definition: Object.h:167
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:218
void AddStaticApplication(Unit *target, uint32 effMask)
Definition: SpellAuras.cpp:2497
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1795
bool IsInWorld() const
Definition: Object.h:149
Definition: ObjectGuid.h:39
UnitAura * ToUnitAura()
Definition: SpellAuras.h:288
SpellInfo const * _spellInfo
Definition: SpellAuraDefines.h:680
Definition: SpellAuras.h:348
Definition: ObjectGuid.h:59
ObjectGuid CasterGUID
Definition: SpellAuraDefines.h:669
ObjectGuid const & GetGUID() const
Definition: Object.h:154
uint32 _auraEffectMask
Definition: SpellAuraDefines.h:682
bool IsGameObject() const
Definition: ObjectGuid.h:309
bool isType(uint16 mask) const
Definition: Object.h:168
uint32_t uint32
Definition: Define.h:152
WorldObject * _owner
Definition: SpellAuraDefines.h:683
void Clear()
Definition: ObjectGuid.h:266
bool IsEmpty() const
Definition: ObjectGuid.h:299
Definition: ObjectGuid.h:40
Unit * Caster
Definition: SpellAuraDefines.h:670
#define ABORT
Definition: Errors.h:64
bool IsRemoved() const
Definition: SpellAuras.h:204
#define ASSERT
Definition: Errors.h:61
Definition: ObjectGuid.h:43
Definition: SpellAuras.h:118
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
Definition: SpellAuras.cpp:294
Definition: Unit.h:737
Unit * ToUnit()
Definition: Object.h:200
+ Here is the call graph for this function:

◆ DropCharge()

bool Aura::DropCharge ( AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT)
inline
184 { return ModCharges(-1, removeMode); }
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: SpellAuras.cpp:957
+ Here is the caller graph for this function:

◆ DropChargeDelayed()

void Aura::DropChargeDelayed ( uint32  delay,
AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT 
)
987 {
988  // aura is already during delayed charge drop
989  if (m_dropEvent)
990  return;
991  // only units have events
992  Unit* owner = m_owner->ToUnit();
993  if (!owner)
994  return;
995 
996  m_dropEvent = new ChargeDropEvent(this, removeMode);
997  owner->m_Events.AddEvent(m_dropEvent, owner->m_Events.CalculateTime(delay));
998 }
void AddEvent(BasicEvent *event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.cpp:113
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:336
Definition: SpellAuras.cpp:41
EventProcessor m_Events
Definition: Object.h:670
WorldObject *const m_owner
Definition: SpellAuras.h:318
Definition: Unit.h:737
Unit * ToUnit()
Definition: Object.h:200
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.h:84
+ Here is the call graph for this function:

◆ EffectTypeNeedsSendingAmount()

bool Aura::EffectTypeNeedsSendingAmount ( AuraType  type)
static
1254 {
1255  switch (type)
1256  {
1263  return true;
1264  default:
1265  break;
1266  }
1267 
1268  return false;
1269 }
Definition: SpellAuraDefines.h:499
Definition: SpellAuraDefines.h:421
Definition: SpellAuraDefines.h:420
Definition: SpellAuraDefines.h:541
Definition: SpellAuraDefines.h:429
Definition: SpellAuraDefines.h:542
+ Here is the caller graph for this function:

◆ FillTargetMap()

virtual void Aura::FillTargetMap ( std::unordered_map< Unit *, uint32 > &  targets,
Unit caster 
)
pure virtual

Implemented in DynObjAura, and UnitAura.

+ Here is the caller graph for this function:

◆ GenerateKey()

AuraKey Aura::GenerateKey ( uint32 recalculateMask) const

Fills a helper structure containing aura primary key for character_aura, character_aura_effect, pet_aura, pet_aura_effect tables.

Parameters
[out]recalculateMaskMask of effects that can be recalculated to store in database - not part of aura key.
Returns
Aura key.
1202 {
1203  AuraKey key;
1204  key.Caster = GetCasterGUID();
1205  key.Item = GetCastItemGUID();
1206  key.SpellId = GetId();
1207  key.EffectMask = 0;
1208  recalculateMask = 0;
1209  for (uint32 i = 0; i < _effects.size(); ++i)
1210  {
1211  if (AuraEffect const* effect = _effects[i])
1212  {
1213  key.EffectMask |= 1 << i;
1214  if (effect->CanBeRecalculated())
1215  recalculateMask |= 1 << i;
1216  }
1217  }
1218 
1219  return key;
1220 }
ObjectGuid Item
Definition: SpellAuras.h:100
Definition: SpellAuraEffects.h:28
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:140
uint32 EffectMask
Definition: SpellAuras.h:102
uint32 GetId() const
Definition: SpellAuras.h:135
AuraEffectVector _effects
Definition: SpellAuras.h:345
uint32_t uint32
Definition: Define.h:152
ObjectGuid Caster
Definition: SpellAuras.h:99
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
uint32 SpellId
Definition: SpellAuras.h:101
Definition: SpellAuras.h:97
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetApplicationMap()

ApplicationMap const& Aura::GetApplicationMap ( )
inline
233 { return m_applications; }
ApplicationMap m_applications
Definition: SpellAuras.h:330
+ Here is the caller graph for this function:

◆ GetApplicationOfTarget() [1/2]

AuraApplication const* Aura::GetApplicationOfTarget ( ObjectGuid  guid) const
inline
235 { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
ApplicationMap m_applications
Definition: SpellAuras.h:330
+ Here is the caller graph for this function:

◆ GetApplicationOfTarget() [2/2]

AuraApplication* Aura::GetApplicationOfTarget ( ObjectGuid  guid)
inline
236 { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
ApplicationMap m_applications
Definition: SpellAuras.h:330

◆ GetApplicationVector()

void Aura::GetApplicationVector ( std::vector< AuraApplication *> &  applicationVector) const
1298 {
1299  for (auto const& applicationPair : m_applications)
1300  {
1301  if (!applicationPair.second->GetEffectMask())
1302  continue;
1303 
1304  applicationList.push_back(applicationPair.second);
1305  }
1306 }
ApplicationMap m_applications
Definition: SpellAuras.h:330
+ Here is the caller graph for this function:

◆ GetApplyTime()

time_t Aura::GetApplyTime ( ) const
inline
166 { return m_applyTime; }
time_t const m_applyTime
Definition: SpellAuras.h:317
+ Here is the caller graph for this function:

◆ GetAuraEffects()

AuraEffectVector const& Aura::GetAuraEffects ( ) const
inline
302 { return _effects; }
AuraEffectVector _effects
Definition: SpellAuras.h:345
+ Here is the caller graph for this function:

◆ GetCastDifficulty()

Difficulty Aura::GetCastDifficulty ( ) const
inline
136 { return m_castDifficulty; }
Difficulty const m_castDifficulty
Definition: SpellAuras.h:310
+ Here is the caller graph for this function:

◆ GetCaster()

Unit * Aura::GetCaster ( ) const
507 {
508  if (GetOwner()->GetGUID() == GetCasterGUID())
509  return GetUnitOwner();
511  return aurApp->GetTarget();
512 
514 }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:218
Unit * GetUnitOwner() const
Definition: SpellAuras.h:146
Definition: SpellAuras.h:53
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCasterGUID()

ObjectGuid Aura::GetCasterGUID ( ) const
inline
139 { return m_casterGuid; }
ObjectGuid const m_casterGuid
Definition: SpellAuras.h:312
+ Here is the caller graph for this function:

◆ GetCasterLevel()

uint8 Aura::GetCasterLevel ( ) const
inline
194 { return m_casterLevel; }
uint8 const m_casterLevel
Definition: SpellAuras.h:326
+ Here is the caller graph for this function:

◆ GetCastId()

ObjectGuid Aura::GetCastId ( ) const
inline
138 { return m_castId; }
ObjectGuid const m_castId
Definition: SpellAuras.h:311
+ Here is the caller graph for this function:

◆ GetCastItemGUID()

ObjectGuid Aura::GetCastItemGUID ( ) const
inline
140 { return m_castItemGuid; }
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:313
+ Here is the caller graph for this function:

◆ GetCastItemId()

uint32 Aura::GetCastItemId ( ) const
inline
141 { return m_castItemId; }
uint32 m_castItemId
Definition: SpellAuras.h:314
+ Here is the caller graph for this function:

◆ GetCastItemLevel()

int32 Aura::GetCastItemLevel ( ) const
inline
142 { return m_castItemLevel; }
int32 m_castItemLevel
Definition: SpellAuras.h:315
+ Here is the caller graph for this function:

◆ GetCharges()

uint8 Aura::GetCharges ( ) const
inline
179 { return m_procCharges; }
uint8 m_procCharges
Definition: SpellAuras.h:327
+ Here is the caller graph for this function:

◆ GetDuration()

int32 Aura::GetDuration ( ) const
inline
172 { return m_duration; }
int32 m_duration
Definition: SpellAuras.h:321
+ Here is the caller graph for this function:

◆ GetDynobjOwner()

DynamicObject* Aura::GetDynobjOwner ( ) const
inline
147 { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return m_owner->ToDynObject(); }
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuraDefines.h:600
DynamicObject * ToDynObject()
Definition: Object.h:212
WorldObject *const m_owner
Definition: SpellAuras.h:318
#define ASSERT
Definition: Errors.h:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEffect()

AuraEffect * Aura::GetEffect ( uint32  index) const
517 {
518  if (index >= _effects.size())
519  return nullptr;
520 
521  return _effects[index];
522 }
AuraEffectVector _effects
Definition: SpellAuras.h:345
+ Here is the caller graph for this function:

◆ GetEffectMask()

uint32 Aura::GetEffectMask ( ) const
1289 {
1290  uint32 effMask = 0;
1291  for (AuraEffect* aurEff : GetAuraEffects())
1292  if (aurEff)
1293  effMask |= 1 << aurEff->GetEffIndex();
1294  return effMask;
1295 }
Definition: SpellAuraEffects.h:28
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
uint32_t uint32
Definition: Define.h:152
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetId()

uint32 Aura::GetId ( ) const
inline
135 { return GetSpellInfo()->Id; }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
uint32 const Id
Definition: SpellInfo.h:340
+ Here is the caller graph for this function:

◆ GetMaxDuration()

int32 Aura::GetMaxDuration ( ) const
inline
167 { return m_maxDuration; }
int32 m_maxDuration
Definition: SpellAuras.h:320
+ Here is the caller graph for this function:

◆ GetOwner()

WorldObject* Aura::GetOwner ( ) const
inline
145 { return m_owner; }
WorldObject *const m_owner
Definition: SpellAuras.h:318
+ Here is the caller graph for this function:

◆ GetProcEffectMask()

uint32 Aura::GetProcEffectMask ( AuraApplication aurApp,
ProcEventInfo eventInfo,
std::chrono::steady_clock::time_point  now 
) const
Todo:
Todo:
this needs to be unified for all kinds of auras
1757 {
1758  SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetSpellInfo());
1759  // only auras with spell proc entry can trigger proc
1760  if (!procEntry)
1761  return 0;
1762 
1763  // check spell triggering us
1764  if (Spell const* spell = eventInfo.GetProcSpell())
1765  {
1766  // Do not allow auras to proc from effect triggered from itself
1767  if (spell->IsTriggeredByAura(m_spellInfo))
1768  return 0;
1769 
1770  // check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
1771  if (spell->IsTriggered() && !(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK))
1773  return 0;
1774  }
1775 
1776  // check don't break stealth attr present
1778  {
1779  if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
1780  if (spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
1781  return 0;
1782  }
1783 
1784  // check if we have charges to proc with
1785  if (IsUsingCharges())
1786  {
1787  if (!GetCharges())
1788  return 0;
1789 
1790  if (procEntry->AttributesMask & PROC_ATTR_REQ_SPELLMOD)
1791  if (Spell const* spell = eventInfo.GetProcSpell())
1792  if (!spell->m_appliedMods.count(const_cast<Aura*>(this)))
1793  return 0;
1794  }
1795 
1796  // check proc cooldown
1797  if (IsProcOnCooldown(now))
1798  return 0;
1799 
1800  // do checks against db data
1801  if (!SpellMgr::CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
1802  return 0;
1803 
1804  // do checks using conditions table
1805  if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPELL_PROC, GetId(), eventInfo.GetActor(), eventInfo.GetActionTarget()))
1806  return 0;
1807 
1808  // AuraScript Hook
1809  bool check = const_cast<Aura*>(this)->CallScriptCheckProcHandlers(aurApp, eventInfo);
1810  if (!check)
1811  return 0;
1812 
1813  // At least one effect has to pass checks to proc aura
1814  uint32 procEffectMask = aurApp->GetEffectMask();
1815  for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1816  if (procEffectMask & (1u << i))
1817  if ((procEntry->DisableEffectsMask & (1u << i)) || !GetEffect(i)->CheckEffectProc(aurApp, eventInfo))
1818  procEffectMask &= ~(1u << i);
1819 
1820  if (!procEffectMask)
1821  return 0;
1822 
1824  // do allow additional requirements for procs
1825  // this is needed because this is the last moment in which you can prevent aura charge drop on proc
1826  // and possibly a way to prevent default checks (if there're going to be any)
1827 
1828  // Check if current equipment meets aura requirements
1829  // do that only for passive spells
1831  Unit* target = aurApp->GetTarget();
1832  if (IsPassive() && target->GetTypeId() == TYPEID_PLAYER && GetSpellInfo()->EquippedItemClass != -1)
1833  {
1835  {
1836  Item* item = nullptr;
1838  {
1839  if (target->ToPlayer()->IsInFeralForm())
1840  return 0;
1841 
1842  if (DamageInfo const* damageInfo = eventInfo.GetDamageInfo())
1843  {
1844  if (damageInfo->GetAttackType() != OFF_ATTACK)
1846  else
1848  }
1849  }
1850  else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR)
1851  {
1852  // Check if player is wearing shield
1854  }
1855 
1856  if (!item || item->IsBroken() || !item->IsFitToSpellRequirements(GetSpellInfo()))
1857  return 0;
1858  }
1859  }
1860 
1861  bool success = roll_chance_f(CalcProcChance(*procEntry, eventInfo));
1862 
1863  const_cast<Aura*>(this)->SetLastProcAttemptTime(now);
1864 
1865  if (success)
1866  return procEffectMask;
1867 
1868  return 0;
1869 }
bool IsPassive() const
Definition: SpellAuras.cpp:1095
uint32 GetTypeMask() const
Definition: Unit.h:488
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:638
int32 EquippedItemClass
Definition: SpellInfo.h:406
bool roll_chance_f(float chance)
Definition: Random.h:53
DamageInfo * GetDamageInfo() const
Definition: Unit.h:496
Definition: SharedDefines.h:516
bool HasAura(AuraType aura) const
Definition: SpellInfo.cpp:1292
Definition: SpellInfo.h:157
TypeID GetTypeId() const
Definition: Object.h:167
bool IsProcOnCooldown(std::chrono::steady_clock::time_point now) const
Definition: SpellAuras.cpp:1714
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:335
Definition: SpellMgr.h:180
Definition: Player.h:660
uint32 GetId() const
Definition: SpellAuras.h:135
Unit * GetActionTarget() const
Definition: Unit.h:485
float CalcProcChance(SpellProcEntry const &procEntry, ProcEventInfo &eventInfo) const
Definition: SpellAuras.cpp:1871
Unit * GetTarget() const
Definition: SpellAuras.h:74
Definition: ConditionMgr.h:167
Spell const * GetProcSpell() const
Definition: Unit.h:499
#define MAX_SPELL_EFFECTS
Definition: DBCEnums.h:1445
Player * ToPlayer()
Definition: Object.h:192
Item * GetUseableItemByPos(uint8 bag, uint8 slot) const
Definition: Player.cpp:10129
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
Definition: SpellMgr.h:275
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
bool IsBroken() const
Definition: Item.h:250
Definition: Item.h:169
#define sSpellMgr
Definition: SpellMgr.h:792
Definition: ItemTemplate.h:416
uint32_t uint32
Definition: Define.h:152
bool IsUsingCharges() const
Definition: SpellAuras.h:248
#define sConditionMgr
Definition: ConditionMgr.h:330
uint8 GetCharges() const
Definition: SpellAuras.h:179
bool IsInFeralForm() const
Definition: Unit.cpp:8429
Definition: Player.h:659
uint32 AttributesMask
Definition: SpellMgr.h:284
Definition: ItemTemplate.h:418
Unit * GetActor()
Definition: Unit.h:484
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:271
bool IsFitToSpellRequirements(SpellInfo const *spellInfo) const
Definition: Item.cpp:1315
Definition: ObjectGuid.h:40
uint32 GetEffectMask() const
Definition: SpellAuras.h:79
static bool CanSpellTriggerProcOnEvent(SpellProcEntry const &procEntry, ProcEventInfo &eventInfo)
Definition: SpellMgr.cpp:511
void SetLastProcAttemptTime(std::chrono::steady_clock::time_point lastProcAttemptTime)
Definition: SpellAuras.h:255
Definition: SpellMgr.h:266
bool CallScriptCheckProcHandlers(AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuras.cpp:2248
Definition: SharedDefines.h:491
Definition: SpellAuraDefines.h:104
Definition: SpellAuras.h:118
Definition: Unit.h:737
Definition: SpellMgr.h:268
uint32 DisableEffectsMask
Definition: SpellMgr.h:285
Definition: Unit.h:406
Definition: SharedDefines.h:6353
Definition: Spell.h:236
+ Here is the call graph for this function:

◆ GetScript()

template<class Script >
Script* Aura::GetScript ( std::string const &  scriptName) const
inline
296  {
297  return dynamic_cast<Script*>(GetScriptByName(scriptName));
298  }
AuraScript * GetScriptByName(std::string const &scriptName) const
Definition: SpellAuras.cpp:472

◆ GetScriptByName()

AuraScript * Aura::GetScriptByName ( std::string const &  scriptName) const
private
473 {
474  for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
475  if ((*itr)->_GetScriptName()->compare(scriptName) == 0)
476  return *itr;
477  return nullptr;
478 }
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300

◆ GetSpellInfo()

SpellInfo const* Aura::GetSpellInfo ( ) const
inline
134 { return m_spellInfo; }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
+ Here is the caller graph for this function:

◆ GetSpellVisual()

SpellCastVisual Aura::GetSpellVisual ( ) const
inline
143 { return m_spellVisual; }
SpellCastVisual const m_spellVisual
Definition: SpellAuras.h:316
+ Here is the caller graph for this function:

◆ GetStackAmount()

uint8 Aura::GetStackAmount ( ) const
inline
188 { return m_stackAmount; }
uint8 m_stackAmount
Definition: SpellAuras.h:328
+ Here is the caller graph for this function:

◆ GetType()

AuraObjectType Aura::GetType ( ) const
525 {
527 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:600
WorldObject *const m_owner
Definition: SpellAuras.h:318
Definition: SpellAuraDefines.h:599
Definition: ObjectGuid.h:43
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetUnitOwner()

Unit* Aura::GetUnitOwner ( ) const
inline
146 { ASSERT(GetType() == UNIT_AURA_TYPE); return m_owner->ToUnit(); }
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
WorldObject *const m_owner
Definition: SpellAuras.h:318
#define ASSERT
Definition: Errors.h:61
Definition: SpellAuraDefines.h:599
Unit * ToUnit()
Definition: Object.h:200
+ Here is the caller graph for this function:

◆ HandleAllEffects()

void Aura::HandleAllEffects ( AuraApplication aurApp,
uint8  mode,
bool  apply 
)
1281 {
1282  ASSERT (!IsRemoved());
1283  for (AuraEffect* effect : GetAuraEffects())
1284  if (effect && !IsRemoved())
1285  effect->HandleEffect(aurApp, mode, apply);
1286 }
Definition: SpellAuraEffects.h:28
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
bool IsRemoved() const
Definition: SpellAuras.h:204
#define ASSERT
Definition: Errors.h:61
+ Here is the call graph for this function:

◆ HandleAuraSpecificMods()

void Aura::HandleAuraSpecificMods ( AuraApplication const *  aurApp,
Unit caster,
bool  apply,
bool  onReapply 
)
1316 {
1317  Unit* target = aurApp->GetTarget();
1318  AuraRemoveMode removeMode = aurApp->GetRemoveMode();
1319  // handle spell_area table
1320  SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAuraMapBounds(GetId());
1321  if (saBounds.first != saBounds.second)
1322  {
1323  uint32 zone, area;
1324  target->GetZoneAndAreaId(zone, area);
1325 
1326  for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
1327  {
1328  // some auras remove at aura remove
1329  if (itr->second->flags & SPELL_AREA_FLAG_AUTOREMOVE && !itr->second->IsFitToRequirements(target->ToPlayer(), zone, area))
1330  target->RemoveAurasDueToSpell(itr->second->spellId);
1331  // some auras applied at aura apply
1332  else if (itr->second->flags & SPELL_AREA_FLAG_AUTOCAST)
1333  {
1334  if (!target->HasAura(itr->second->spellId))
1335  target->CastSpell(target, itr->second->spellId, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
1336  .SetOriginalCastId(GetCastId()));
1337  }
1338  }
1339  }
1340 
1341  // handle spell_linked_spell table
1342  if (!onReapply)
1343  {
1344  // apply linked auras
1345  if (apply)
1346  {
1347  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1348  {
1349  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1350  {
1351  if (*itr < 0)
1352  target->ApplySpellImmune(GetId(), IMMUNITY_ID, -(*itr), true);
1353  else if (caster)
1354  caster->AddAura(*itr, target);
1355  }
1356  }
1357  }
1358  else
1359  {
1360  // remove linked auras
1361  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(-(int32)GetId()))
1362  {
1363  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1364  {
1365  if (*itr < 0)
1366  target->RemoveAurasDueToSpell(-(*itr));
1367  else if (removeMode != AURA_REMOVE_BY_DEATH)
1368  target->CastSpell(target, *itr, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
1369  .SetOriginalCaster(GetCasterGUID())
1370  .SetOriginalCastId(GetCastId()));
1371  }
1372  }
1373  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1374  {
1375  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1376  {
1377  if (*itr < 0)
1378  target->ApplySpellImmune(GetId(), IMMUNITY_ID, -(*itr), false);
1379  else
1380  target->RemoveAura(*itr, GetCasterGUID(), 0, removeMode);
1381  }
1382  }
1383  }
1384  }
1385  else if (apply)
1386  {
1387  // modify stack amount of linked auras
1388  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1389  {
1390  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1391  if (*itr > 0)
1392  if (Aura* triggeredAura = target->GetAura(*itr, GetCasterGUID()))
1393  triggeredAura->ModStackAmount(GetStackAmount() - triggeredAura->GetStackAmount());
1394  }
1395  }
1396 
1397  // mods at aura apply
1398  if (apply)
1399  {
1400  switch (GetSpellInfo()->SpellFamilyName)
1401  {
1402  case SPELLFAMILY_GENERIC:
1403  switch (GetId())
1404  {
1405  case 32474: // Buffeting Winds of Susurrus
1406  if (target->GetTypeId() == TYPEID_PLAYER)
1407  target->ToPlayer()->ActivateTaxiPathTo(506, GetId());
1408  break;
1409  case 33572: // Gronn Lord's Grasp, becomes stoned
1410  if (GetStackAmount() >= 5 && !target->HasAura(33652))
1411  target->CastSpell(target, 33652, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
1412  .SetOriginalCastId(GetCastId()));
1413  break;
1414  case 50836: //Petrifying Grip, becomes stoned
1415  if (GetStackAmount() >= 5 && !target->HasAura(50812))
1416  target->CastSpell(target, 50812, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
1417  .SetOriginalCastId(GetCastId()));
1418  break;
1419  case 60970: // Heroic Fury (remove Intercept cooldown)
1420  if (target->GetTypeId() == TYPEID_PLAYER)
1421  target->GetSpellHistory()->ResetCooldown(20252, true);
1422  break;
1423  }
1424  break;
1425  case SPELLFAMILY_DRUID:
1426  if (!caster)
1427  break;
1428  // Rejuvenation
1429  if (GetSpellInfo()->SpellFamilyFlags[0] & 0x10 && GetEffect(EFFECT_0))
1430  {
1431  // Druid T8 Restoration 4P Bonus
1432  if (caster->HasAura(64760))
1433  {
1435  args.AddSpellMod(SPELLVALUE_BASE_POINT0, GetEffect(EFFECT_0)->GetAmount());
1436  caster->CastSpell(target, 64801, args);
1437  }
1438  }
1439  break;
1440  }
1441  }
1442  // mods at aura remove
1443  else
1444  {
1445  switch (GetSpellInfo()->SpellFamilyName)
1446  {
1447  case SPELLFAMILY_MAGE:
1448  switch (GetId())
1449  {
1450  case 66: // Invisibility
1451  if (removeMode != AURA_REMOVE_BY_EXPIRE)
1452  break;
1453  target->CastSpell(target, 32612, GetEffect(1));
1454  target->CombatStop();
1455  break;
1456  default:
1457  break;
1458  }
1459  break;
1460  case SPELLFAMILY_PRIEST:
1461  if (!caster)
1462  break;
1463  // Power word: shield
1464  if (removeMode == AURA_REMOVE_BY_ENEMY_SPELL && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000001)
1465  {
1466  // Rapture
1467  if (Aura const* aura = caster->GetAuraOfRankedSpell(47535))
1468  {
1469  // check cooldown
1470  if (caster->GetTypeId() == TYPEID_PLAYER)
1471  {
1472  if (caster->GetSpellHistory()->HasCooldown(aura->GetSpellInfo()))
1473  {
1474  // This additional check is needed to add a minimal delay before cooldown in in effect
1475  // to allow all bubbles broken by a single damage source proc mana return
1476  if (caster->GetSpellHistory()->GetRemainingCooldown(aura->GetSpellInfo()) <= 11 * IN_MILLISECONDS)
1477  break;
1478  }
1479  else // and add if needed
1480  caster->GetSpellHistory()->AddCooldown(aura->GetId(), 0, std::chrono::seconds(12));
1481  }
1482 
1483  // effect on caster
1484  if (AuraEffect const* aurEff = aura->GetEffect(0))
1485  {
1486  float multiplier = float(aurEff->GetAmount());
1488  args.SetOriginalCastId(GetCastId());
1489  args.AddSpellMod(SPELLVALUE_BASE_POINT0, CalculatePct(caster->GetMaxPower(POWER_MANA), multiplier));
1490  caster->CastSpell(caster, 47755, args);
1491  }
1492  }
1493  }
1494  break;
1495  case SPELLFAMILY_ROGUE:
1496  // Remove Vanish on stealth remove
1497  if (GetId() == 1784)
1498  target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, flag128(0x0000800, 0, 0, 0), target->GetGUID());
1499  break;
1500  }
1501  }
1502 
1503  // mods at aura apply or remove
1504  switch (GetSpellInfo()->SpellFamilyName)
1505  {
1506  case SPELLFAMILY_HUNTER:
1507  switch (GetId())
1508  {
1509  case 19574: // Bestial Wrath
1510  // The Beast Within cast on owner if talent present
1511  if (Unit* owner = target->GetOwner())
1512  {
1513  // Search talent
1514  if (owner->HasAura(34692))
1515  {
1516  if (apply)
1517  owner->CastSpell(owner, 34471, GetEffect(0));
1518  else
1519  owner->RemoveAurasDueToSpell(34471);
1520  }
1521  }
1522  break;
1523  }
1524  break;
1525  case SPELLFAMILY_PALADIN:
1526  switch (GetId())
1527  {
1528  case 31842: // Divine Favor
1529  // Item - Paladin T10 Holy 2P Bonus
1530  if (target->HasAura(70755))
1531  {
1532  if (apply)
1533  target->CastSpell(target, 71166, CastSpellExtraArgs(TRIGGERED_FULL_MASK)
1534  .SetOriginalCastId(GetCastId()));
1535  else
1536  target->RemoveAurasDueToSpell(71166);
1537  }
1538  break;
1539  }
1540  break;
1541  }
1542 }
Definition: SharedDefines.h:6064
Definition: SpellAuraEffects.h:28
bool ActivateTaxiPathTo(std::vector< uint32 > const &nodes, Creature *npc=nullptr, uint32 spellid=0, uint32 preferredMountDisplay=0)
Definition: Player.cpp:22659
Aura * GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4341
Definition: SpellAuraDefines.h:68
void AddCooldown(uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration)
Definition: SpellHistory.h:97
Definition: SharedDefines.h:2418
TypeID GetTypeId() const
Definition: Object.h:167
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition: Unit.cpp:5564
Definition: SharedDefines.h:6057
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SharedDefines.h:6062
void CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2633
ObjectGuid GetCastId() const
Definition: SpellAuras.h:138
void RemoveAurasWithFamily(SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID)
Definition: Unit.cpp:3937
uint8 GetStackAmount() const
Definition: SpellAuras.h:188
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4415
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:11243
bool HasCooldown(SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const
Definition: SpellHistory.cpp:631
uint32 GetId() const
Definition: SpellAuras.h:135
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:7439
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3507
Definition: SpellMgr.h:487
Definition: SharedDefines.h:6060
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1807
ObjectGuid const & GetGUID() const
Definition: Object.h:154
SpellHistory * GetSpellHistory()
Definition: Unit.h:1505
uint32 SpellFamilyName
Definition: SpellInfo.h:418
Unit * GetOwner() const
Definition: Object.cpp:2032
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
Definition: SharedDefines.h:6054
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
Definition: Object.h:461
Definition: Common.h:68
Definition: Util.h:400
#define sSpellMgr
Definition: SpellMgr.h:792
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
Definition: SpellMgr.h:488
T CalculatePct(T base, U pct)
Definition: Util.h:70
uint32 GetRemainingCooldown(SpellInfo const *spellInfo) const
Definition: SpellHistory.cpp:652
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3651
Definition: SpellDefines.h:433
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
AuraRemoveMode
Definition: SpellAuraDefines.h:62
void ResetCooldown(uint32 spellId, bool update=false)
Definition: SpellHistory.cpp:589
Definition: ObjectGuid.h:40
Definition: SharedDefines.h:6061
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:8914
Definition: SharedDefines.h:28
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:256
std::pair< SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator > SpellAreaForAreaMapBounds
Definition: SpellMgr.h:517
Definition: SpellDefines.h:188
Definition: SpellAuraDefines.h:69
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4311
Definition: SharedDefines.h:265
Definition: SpellAuras.h:118
Definition: SharedDefines.h:6063
Definition: Unit.h:737
Definition: SpellAuraDefines.h:70
Definition: SpellMgr.h:127
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasEffect()

bool Aura::HasEffect ( uint8  effIndex) const
inline
224 { return GetEffect(effIndex) != nullptr; }
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasEffectType()

bool Aura::HasEffectType ( AuraType  type) const
1244 {
1245  for (AuraEffect* effect : GetAuraEffects())
1246  {
1247  if (effect && effect->GetAuraType() == type)
1248  return true;
1249  }
1250  return false;
1251 }
Definition: SpellAuraEffects.h:28
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasMoreThanOneEffectForType()

bool Aura::HasMoreThanOneEffectForType ( AuraType  auraType) const
1077 {
1078  uint32 count = 0;
1079  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
1080  if (HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.ApplyAuraName == auraType)
1081  ++count;
1082 
1083  return count > 1;
1084 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:227
uint32_t uint32
Definition: Define.h:152
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:224
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsAppliedOnTarget()

bool Aura::IsAppliedOnTarget ( ObjectGuid  guid) const
inline
237 { return m_applications.find(guid) != m_applications.end(); }
ApplicationMap m_applications
Definition: SpellAuras.h:330
+ Here is the caller graph for this function:

◆ IsArea()

bool Aura::IsArea ( ) const
1087 {
1088  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
1089  if (HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsAreaAuraEffect())
1090  return true;
1091 
1092  return false;
1093 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:227
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:224
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsDeathPersistent()

bool Aura::IsDeathPersistent ( ) const
1101 {
1102  return GetSpellInfo()->IsDeathPersistent();
1103 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
bool IsDeathPersistent() const
Definition: SpellInfo.cpp:1558
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsExpired()

bool Aura::IsExpired ( ) const
inline
176 { return !GetDuration() && !m_dropEvent; }
int32 GetDuration() const
Definition: SpellAuras.h:172
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:336
+ Here is the caller graph for this function:

◆ IsPassive()

bool Aura::IsPassive ( ) const
1096 {
1097  return GetSpellInfo()->IsPassive();
1098 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
bool IsPassive() const
Definition: SpellInfo.cpp:1492
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsPermanent()

bool Aura::IsPermanent ( ) const
inline
177 { return GetMaxDuration() == -1; }
int32 GetMaxDuration() const
Definition: SpellAuras.h:167
+ Here is the caller graph for this function:

◆ IsProcOnCooldown()

bool Aura::IsProcOnCooldown ( std::chrono::steady_clock::time_point  now) const
1715 {
1716  return m_procCooldown > now;
1717 }
std::chrono::steady_clock::time_point m_procCooldown
Definition: SpellAuras.h:338
+ Here is the caller graph for this function:

◆ IsRemoved()

bool Aura::IsRemoved ( ) const
inline
204 { return m_isRemoved; }
bool m_isRemoved
Definition: SpellAuras.h:332
+ Here is the caller graph for this function:

◆ IsRemovedOnShapeLost()

bool Aura::IsRemovedOnShapeLost ( Unit target) const
1106 {
1107  return GetCasterGUID() == target->GetGUID()
1108  && m_spellInfo->Stances
1111 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
ObjectGuid const & GetGUID() const
Definition: Object.h:154
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
uint64 Stances
Definition: SpellInfo.h:362
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
Definition: SharedDefines.h:398
Definition: SharedDefines.h:473
+ Here is the call graph for this function:

◆ IsSingleTarget()

bool Aura::IsSingleTarget ( ) const
inline
206 {return m_isSingleTarget; }
bool m_isSingleTarget
Definition: SpellAuras.h:333
+ Here is the caller graph for this function:

◆ IsSingleTargetWith()

bool Aura::IsSingleTargetWith ( Aura const *  aura) const
1153 {
1154  // Same spell?
1155  if (GetSpellInfo()->IsRankOf(aura->GetSpellInfo()))
1156  return true;
1157 
1159  // spell with single target specific types
1160  switch (spec)
1161  {
1164  if (aura->GetSpellInfo()->GetSpellSpecific() == spec)
1165  return true;
1166  break;
1167  default:
1168  break;
1169  }
1170 
1172  return true;
1173 
1174  return false;
1175 }
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1243
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:133
Definition: SpellInfo.h:132
SpellSpecificType GetSpellSpecific() const
Definition: SpellInfo.cpp:2502
SpellSpecificType
Definition: SpellInfo.h:120
Definition: SpellAuraDefines.h:324
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsUsingCharges()

bool Aura::IsUsingCharges ( ) const
inline
248 { return m_isUsingCharges; }
bool m_isUsingCharges
Definition: SpellAuras.h:334
+ Here is the caller graph for this function:

◆ IsUsingStacks()

bool Aura::IsUsingStacks ( ) const
1024 {
1025  return m_spellInfo->StackAmount > 0;
1026 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
uint32 StackAmount
Definition: SpellInfo.h:400
+ Here is the caller graph for this function:

◆ LoadScripts()

void Aura::LoadScripts ( )
1956 {
1957  sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts, this);
1958  for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
1959  {
1960  TC_LOG_DEBUG("spells", "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id);
1961  (*itr)->Register();
1962  }
1963 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
uint32 const Id
Definition: SpellInfo.h:340
std::vector< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:300
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:177
#define sScriptMgr
Definition: ScriptMgr.h:1235
+ Here is the caller graph for this function:

◆ ModCharges()

bool Aura::ModCharges ( int32  num,
AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT 
)
958 {
959  if (IsUsingCharges())
960  {
961  int32 charges = m_procCharges + num;
962  int32 maxCharges = CalcMaxCharges();
963 
964  // limit charges (only on charges increase, charges may be changed manually)
965  if ((num > 0) && (charges > int32(maxCharges)))
966  charges = maxCharges;
967  // we're out of charges, remove
968  else if (charges <= 0)
969  {
970  Remove(removeMode);
971  return true;
972  }
973 
974  SetCharges(charges);
975  }
976 
977  return false;
978 }
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:182
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
void SetCharges(uint8 charges)
Definition: SpellAuras.cpp:934
int32_t int32
Definition: Define.h:148
bool IsUsingCharges() const
Definition: SpellAuras.h:248
uint8 m_procCharges
Definition: SpellAuras.h:327
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ModChargesDelayed()

void Aura::ModChargesDelayed ( int32  num,
AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT 
)
981 {
982  m_dropEvent = nullptr;
983  ModCharges(num, removeMode);
984 }
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:336
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: SpellAuras.cpp:957
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ModStackAmount()

bool Aura::ModStackAmount ( int32  num,
AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT,
bool  resetPeriodicTimer = true 
)
1039 {
1040  int32 stackAmount = m_stackAmount + num;
1041  int32 maxStackAmount = int32(CalcMaxStackAmount());
1042 
1043  // limit the stack amount (only on stack increase, stack amount may be changed manually)
1044  if ((num > 0) && (stackAmount > maxStackAmount))
1045  {
1046  // not stackable aura - set stack amount to 1
1047  if (!m_spellInfo->StackAmount)
1048  stackAmount = 1;
1049  else
1050  stackAmount = m_spellInfo->StackAmount;
1051  }
1052  // we're out of stacks, remove
1053  else if (stackAmount <= 0)
1054  {
1055  Remove(removeMode);
1056  return true;
1057  }
1058 
1060 
1061  // Update stack amount
1062  SetStackAmount(stackAmount);
1063 
1064  if (refresh)
1065  {
1066  RefreshTimers(resetPeriodicTimer);
1067 
1068  // reset charges
1070  }
1071 
1073  return false;
1074 }
void SetStackAmount(uint8 num)
Definition: SpellAuras.cpp:1000
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
uint8 m_stackAmount
Definition: SpellAuras.h:328
uint8 GetStackAmount() const
Definition: SpellAuras.h:188
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:182
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
Definition: SharedDefines.h:429
void SetCharges(uint8 charges)
Definition: SpellAuras.cpp:934
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
int32_t int32
Definition: Define.h:148
void RefreshTimers(bool resetPeriodicTimer)
Definition: SpellAuras.cpp:907
uint32 CalcMaxStackAmount() const
Definition: SpellAuras.cpp:1028
uint32 StackAmount
Definition: SpellInfo.h:400
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrepareProcToTrigger()

void Aura::PrepareProcToTrigger ( AuraApplication aurApp,
ProcEventInfo eventInfo,
std::chrono::steady_clock::time_point  now 
)
1730 {
1731  bool prepare = CallScriptPrepareProcHandlers(aurApp, eventInfo);
1732  if (!prepare)
1733  return;
1734 
1735  SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetSpellInfo());
1736  ASSERT(procEntry);
1737 
1738  // take one charge, aura expiration will be handled in Aura::TriggerProcOnEvent (if needed)
1740  {
1741  --m_procCharges;
1743  }
1744 
1745  // cooldowns should be added to the whole aura (see 51698 area aura)
1746  int32 procCooldown = procEntry->Cooldown.count();
1747  if (Unit* caster = GetCaster())
1748  if (Player* modOwner = caster->GetSpellModOwner())
1749  modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::ProcCooldown, procCooldown);
1750 
1751  AddProcCooldown(now + Milliseconds(procCooldown));
1752 
1754 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
bool CallScriptPrepareProcHandlers(AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuras.cpp:2264
void SetLastProcSuccessTime(std::chrono::steady_clock::time_point lastProcSuccessTime)
Definition: SpellAuras.h:256
void AddProcCooldown(std::chrono::steady_clock::time_point cooldownEnd)
Definition: SpellAuras.cpp:1719
Definition: SharedDefines.h:603
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:24
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
Definition: SpellMgr.h:275
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
#define sSpellMgr
Definition: SpellMgr.h:792
Definition: SpellMgr.h:269
int32_t int32
Definition: Define.h:148
bool IsUsingCharges() const
Definition: SpellAuras.h:248
Milliseconds Cooldown
Definition: SpellMgr.h:288
uint32 AttributesMask
Definition: SpellMgr.h:284
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:271
uint8 m_procCharges
Definition: SpellAuras.h:327
#define ASSERT
Definition: Errors.h:61
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
Definition: Player.h:1081
+ Here is the call graph for this function:

◆ RecalculateAmountOfEffects()

void Aura::RecalculateAmountOfEffects ( )
1272 {
1273  ASSERT (!IsRemoved());
1274  Unit* caster = GetCaster();
1275  for (AuraEffect* effect : GetAuraEffects())
1276  if (effect && !IsRemoved())
1277  effect->RecalculateAmount(caster);
1278 }
Definition: SpellAuraEffects.h:28
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
bool IsRemoved() const
Definition: SpellAuras.h:204
#define ASSERT
Definition: Errors.h:61
Definition: Unit.h:737
+ Here is the call graph for this function:

◆ RefreshDuration()

void Aura::RefreshDuration ( bool  withMods = false)
883 {
884  Unit* caster = GetCaster();
885  if (withMods && caster)
886  {
887  int32 duration = m_spellInfo->GetMaxDuration();
888  // Calculate duration of periodics affected by haste.
890  duration = int32(duration * caster->m_unitData->ModCastingSpeed);
891 
892  SetMaxDuration(duration);
893  SetDuration(duration);
894  }
895  else
897 
898  if (!m_periodicCosts.empty())
900 
901  // also reset periodic counters
902  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
903  if (AuraEffect* aurEff = GetEffect(i))
904  aurEff->ResetTicks();
905 }
Definition: SharedDefines.h:575
Definition: SpellAuraEffects.h:28
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
void SetMaxDuration(int32 duration)
Definition: SpellAuras.h:168
#define MAX_SPELL_EFFECTS
Definition: DBCEnums.h:1445
std::vector< SpellPowerEntry const * > m_periodicCosts
Definition: SpellAuras.h:323
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
Definition: Common.h:68
UF::UpdateField< UF::UnitData, 0, TYPEID_UNIT > m_unitData
Definition: Unit.h:1835
int32_t int32
Definition: Define.h:148
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
int32 m_timeCla
Definition: SpellAuras.h:322
uint8_t uint8
Definition: Define.h:154
void SetDuration(int32 duration, bool withMods=false)
Definition: SpellAuras.cpp:871
int32 GetMaxDuration() const
Definition: SpellInfo.cpp:3712
int32 GetMaxDuration() const
Definition: SpellAuras.h:167
Definition: Unit.h:737
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RefreshTimers()

void Aura::RefreshTimers ( bool  resetPeriodicTimer)
908 {
911  {
912  int32 minPeriod = m_maxDuration;
913  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
914  if (AuraEffect const* eff = GetEffect(i))
915  if (int32 period = eff->GetPeriod())
916  minPeriod = std::min(period, minPeriod);
917 
918  // If only one tick remaining, roll it over into new duration
919  if (GetDuration() <= minPeriod)
920  {
922  resetPeriodicTimer = false;
923  }
924  }
925 
926  RefreshDuration();
927 
928  Unit* caster = GetCaster();
929  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
930  if (AuraEffect* aurEff = GetEffect(i))
931  aurEff->CalculatePeriodic(caster, resetPeriodicTimer, false);
932 }
Definition: SpellAuraEffects.h:28
int32 CalcMaxDuration() const
Definition: SpellAuras.h:169
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
int32 GetDuration() const
Definition: SpellAuras.h:172
void RefreshDuration(bool withMods=false)
Definition: SpellAuras.cpp:882
#define MAX_SPELL_EFFECTS
Definition: DBCEnums.h:1445
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:449
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
int32_t int32
Definition: Define.h:148
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
int32 m_maxDuration
Definition: SpellAuras.h:320
uint8_t uint8
Definition: Define.h:154
Definition: Unit.h:737
Definition: SharedDefines.h:679
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove()

virtual void Aura::Remove ( AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT)
pure virtual

Implemented in DynObjAura, and UnitAura.

+ Here is the caller graph for this function:

◆ ResetProcCooldown()

void Aura::ResetProcCooldown ( )
1725 {
1726  m_procCooldown = std::chrono::steady_clock::now();
1727 }
std::chrono::steady_clock::time_point m_procCooldown
Definition: SpellAuras.h:338

◆ SaveCasterInfo()

void Aura::SaveCasterInfo ( Unit caster)

◆ SetCharges()

void Aura::SetCharges ( uint8  charges)
935 {
936  if (m_procCharges == charges)
937  return;
938 
939  m_procCharges = charges;
942 }
bool m_isUsingCharges
Definition: SpellAuras.h:334
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
uint8 m_procCharges
Definition: SpellAuras.h:327
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetDuration()

void Aura::SetDuration ( int32  duration,
bool  withMods = false 
)
872 {
873  if (withMods)
874  if (Unit* caster = GetCaster())
875  if (Player* modOwner = caster->GetSpellModOwner())
876  modOwner->ApplySpellMod(GetSpellInfo(), SpellModOp::Duration, duration);
877 
878  m_duration = duration;
880 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
int32 m_duration
Definition: SpellAuras.h:321
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
Definition: Player.h:1081
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetIsSingleTarget()

void Aura::SetIsSingleTarget ( bool  val)
inline
208 { m_isSingleTarget = val; }
bool m_isSingleTarget
Definition: SpellAuras.h:333
+ Here is the caller graph for this function:

◆ SetLastProcAttemptTime()

void Aura::SetLastProcAttemptTime ( std::chrono::steady_clock::time_point  lastProcAttemptTime)
inline
255 { m_lastProcAttemptTime = lastProcAttemptTime; }
std::chrono::steady_clock::time_point m_lastProcAttemptTime
Definition: SpellAuras.h:339
+ Here is the caller graph for this function:

◆ SetLastProcSuccessTime()

void Aura::SetLastProcSuccessTime ( std::chrono::steady_clock::time_point  lastProcSuccessTime)
inline
256 { m_lastProcSuccessTime = lastProcSuccessTime; }
std::chrono::steady_clock::time_point m_lastProcSuccessTime
Definition: SpellAuras.h:340
+ Here is the caller graph for this function:

◆ SetLoadedState()

void Aura::SetLoadedState ( int32  maxDuration,
int32  duration,
int32  charges,
uint8  stackAmount,
uint32  recalculateMask,
int32 amount 
)
1223 {
1224  m_maxDuration = maxDuration;
1225  m_duration = duration;
1226  m_procCharges = charges;
1228  m_stackAmount = stackAmount;
1229  Unit* caster = GetCaster();
1230  for (AuraEffect* effect : GetAuraEffects())
1231  {
1232  if (!effect)
1233  continue;
1234 
1235  effect->SetAmount(amount[effect->GetEffIndex()]);
1236  effect->SetCanBeRecalculated((recalculateMask & (1 << effect->GetEffIndex())) != 0);
1237  effect->CalculatePeriodic(caster, false, true);
1238  effect->CalculateSpellMod();
1239  effect->RecalculateAmount(caster);
1240  }
1241 }
Definition: SpellAuraEffects.h:28
uint8 m_stackAmount
Definition: SpellAuras.h:328
bool m_isUsingCharges
Definition: SpellAuras.h:334
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
int32 m_maxDuration
Definition: SpellAuras.h:320
uint8 m_procCharges
Definition: SpellAuras.h:327
int32 m_duration
Definition: SpellAuras.h:321
Definition: Unit.h:737
+ Here is the call graph for this function:

◆ SetMaxDuration()

void Aura::SetMaxDuration ( int32  duration)
inline
168 { m_maxDuration = duration; }
int32 m_maxDuration
Definition: SpellAuras.h:320
+ Here is the caller graph for this function:

◆ SetNeedClientUpdateForTargets()

void Aura::SetNeedClientUpdateForTargets ( ) const
1309 {
1310  for (ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
1311  appIter->second->SetNeedClientUpdate();
1312 }
ApplicationMap m_applications
Definition: SpellAuras.h:330
+ Here is the caller graph for this function:

◆ SetStackAmount()

void Aura::SetStackAmount ( uint8  num)
1001 {
1002  m_stackAmount = stackAmount;
1003  Unit* caster = GetCaster();
1004 
1005  std::vector<AuraApplication*> applications;
1006  GetApplicationVector(applications);
1007 
1008  for (AuraApplication* aurApp : applications)
1009  if (!aurApp->GetRemoveMode())
1010  HandleAuraSpecificMods(aurApp, caster, false, true);
1011 
1012  for (AuraEffect* aurEff : GetAuraEffects())
1013  if (aurEff)
1014  aurEff->ChangeAmount(aurEff->CalculateAmount(caster), false, true);
1015 
1016  for (AuraApplication* aurApp : applications)
1017  if (!aurApp->GetRemoveMode())
1018  HandleAuraSpecificMods(aurApp, caster, true, true);
1019 
1021 }
Definition: SpellAuraEffects.h:28
uint8 m_stackAmount
Definition: SpellAuras.h:328
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
Definition: SpellAuras.cpp:1315
Definition: SpellAuras.h:53
void GetApplicationVector(std::vector< AuraApplication *> &applicationVector) const
Definition: SpellAuras.cpp:1297
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
Definition: Unit.h:737
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetUsingCharges()

void Aura::SetUsingCharges ( bool  val)
inline
249 { m_isUsingCharges = val; }
bool m_isUsingCharges
Definition: SpellAuras.h:334

◆ ToDynObjAura() [1/2]

DynObjAura* Aura::ToDynObjAura ( )
inline
291 { if (GetType() == DYNOBJ_AURA_TYPE) return reinterpret_cast<DynObjAura*>(this); else return nullptr; }
Definition: SpellAuras.h:372
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuraDefines.h:600
+ Here is the caller graph for this function:

◆ ToDynObjAura() [2/2]

DynObjAura const* Aura::ToDynObjAura ( ) const
inline
292 { if (GetType() == DYNOBJ_AURA_TYPE) return reinterpret_cast<DynObjAura const*>(this); else return nullptr; }
Definition: SpellAuras.h:372
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuraDefines.h:600

◆ ToUnitAura() [1/2]

UnitAura* Aura::ToUnitAura ( )
inline
288 { if (GetType() == UNIT_AURA_TYPE) return reinterpret_cast<UnitAura*>(this); else return nullptr; }
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuras.h:348
Definition: SpellAuraDefines.h:599
+ Here is the caller graph for this function:

◆ ToUnitAura() [2/2]

UnitAura const* Aura::ToUnitAura ( ) const
inline
289 { if (GetType() == UNIT_AURA_TYPE) return reinterpret_cast<UnitAura const*>(this); else return nullptr; }
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuras.h:348
Definition: SpellAuraDefines.h:599

◆ TriggerProcOnEvent()

void Aura::TriggerProcOnEvent ( uint32  procEffectMask,
AuraApplication aurApp,
ProcEventInfo eventInfo 
)
1901 {
1902  bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
1903  if (!prevented)
1904  {
1905  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1906  {
1907  if (!(procEffectMask & (1 << i)))
1908  continue;
1909 
1910  // OnEffectProc / AfterEffectProc hooks handled in AuraEffect::HandleProc()
1911  if (aurApp->HasEffect(i))
1912  GetEffect(i)->HandleProc(aurApp, eventInfo);
1913  }
1914 
1915  CallScriptAfterProcHandlers(aurApp, eventInfo);
1916  }
1917 
1918  // Remove aura if we've used last charge to proc
1919  if (ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(m_spellInfo))->AttributesMask & PROC_ATTR_USE_STACKS_FOR_CHARGES)
1920  {
1921  ModStackAmount(-1);
1922  }
1923  else if (IsUsingCharges())
1924  {
1925  if (!GetCharges())
1926  Remove();
1927  }
1928 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:309
void CallScriptAfterProcHandlers(AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuras.cpp:2300
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
#define ASSERT_NOTNULL(pointer)
Definition: Errors.h:73
#define MAX_SPELL_EFFECTS
Definition: DBCEnums.h:1445
void HandleProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuraEffects.cpp:1201
bool CallScriptProcHandlers(AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuras.cpp:2283
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
bool HasEffect(uint8 effect) const
Definition: SpellAuras.h:80
#define sSpellMgr
Definition: SpellMgr.h:792
Definition: SpellMgr.h:269
bool IsUsingCharges() const
Definition: SpellAuras.h:248
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
Definition: SpellAuras.cpp:1038
uint8 GetCharges() const
Definition: SpellAuras.h:179
uint8_t uint8
Definition: Define.h:154
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryCreate()

Aura * Aura::TryCreate ( AuraCreateInfo createInfo)
static
364 {
365  uint32 effMask = createInfo._auraEffectMask;
366  if (createInfo._targetEffectMask)
367  effMask = createInfo._targetEffectMask;
368 
369  effMask = Aura::BuildEffectMaskForOwner(createInfo._spellInfo, effMask, createInfo._owner);
370  if (!effMask)
371  return nullptr;
372 
373  return Create(createInfo);
374 }
uint32 _targetEffectMask
Definition: SpellAuraDefines.h:685
SpellInfo const * _spellInfo
Definition: SpellAuraDefines.h:680
uint32 _auraEffectMask
Definition: SpellAuraDefines.h:682
uint32_t uint32
Definition: Define.h:152
static Aura * Create(AuraCreateInfo &createInfo)
Definition: SpellAuras.cpp:376
WorldObject * _owner
Definition: SpellAuraDefines.h:683
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
Definition: SpellAuras.cpp:294
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryRefreshStackOrCreate()

Aura * Aura::TryRefreshStackOrCreate ( AuraCreateInfo createInfo)
static
325 {
326  ASSERT(createInfo.Caster || !createInfo.CasterGUID.IsEmpty());
327 
328  if (createInfo.IsRefresh)
329  *createInfo.IsRefresh = false;
330 
331  createInfo._auraEffectMask = Aura::BuildEffectMaskForOwner(createInfo._spellInfo, createInfo._auraEffectMask, createInfo._owner);
332  createInfo._targetEffectMask &= createInfo._auraEffectMask;
333 
334  uint32 effMask = createInfo._auraEffectMask;
335  if (createInfo._targetEffectMask)
336  effMask = createInfo._targetEffectMask;
337 
338  if (!effMask)
339  return nullptr;
340 
341  if (Aura* foundAura = createInfo._owner->ToUnit()->_TryStackingOrRefreshingExistingAura(createInfo))
342  {
343  // we've here aura, which script triggered removal after modding stack amount
344  // check the state here, so we won't create new Aura object
345  if (foundAura->IsRemoved())
346  return nullptr;
347 
348  if (createInfo.IsRefresh)
349  *createInfo.IsRefresh = true;
350 
351  // add owner
352  Unit* unit = createInfo._owner->ToUnit();
353 
354  // check effmask on owner application (if existing)
355  if (AuraApplication* aurApp = foundAura->GetApplicationOfTarget(unit->GetGUID()))
356  aurApp->UpdateApplyEffectMask(effMask);
357  return foundAura;
358  }
359  else
360  return Create(createInfo);
361 }
uint32 _targetEffectMask
Definition: SpellAuraDefines.h:685
Definition: SpellAuras.h:53
SpellInfo const * _spellInfo
Definition: SpellAuraDefines.h:680
ObjectGuid CasterGUID
Definition: SpellAuraDefines.h:669
ObjectGuid const & GetGUID() const
Definition: Object.h:154
uint32 _auraEffectMask
Definition: SpellAuraDefines.h:682
uint32_t uint32
Definition: Define.h:152
bool * IsRefresh
Definition: SpellAuraDefines.h:675
static Aura * Create(AuraCreateInfo &createInfo)
Definition: SpellAuras.cpp:376
WorldObject * _owner
Definition: SpellAuraDefines.h:683
bool IsEmpty() const
Definition: ObjectGuid.h:299
Unit * Caster
Definition: SpellAuraDefines.h:670
#define ASSERT
Definition: Errors.h:61
Aura * _TryStackingOrRefreshingExistingAura(AuraCreateInfo &createInfo)
Definition: Unit.cpp:3071
Definition: SpellAuras.h:118
static uint32 BuildEffectMaskForOwner(SpellInfo const *spellProto, uint32 availableEffectMask, WorldObject *owner)
Definition: SpellAuras.cpp:294
Definition: Unit.h:737
Unit * ToUnit()
Definition: Object.h:200
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnregisterSingleTarget()

void Aura::UnregisterSingleTarget ( )
1178 {
1180  Unit* caster = GetCaster();
1181  ASSERT(caster);
1182  caster->GetSingleCastAuras().remove(this);
1183  SetIsSingleTarget(false);
1184 }
void SetIsSingleTarget(bool val)
Definition: SpellAuras.h:208
bool m_isSingleTarget
Definition: SpellAuras.h:333
AuraList & GetSingleCastAuras()
Definition: Unit.h:1376
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
#define ASSERT
Definition: Errors.h:61
Definition: Unit.h:737
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Update()

void Aura::Update ( uint32  diff,
Unit caster 
)
792 {
793  if (m_duration > 0)
794  {
795  m_duration -= diff;
796  if (m_duration < 0)
797  m_duration = 0;
798 
799  // handle manaPerSecond/manaPerSecondPerLevel
800  if (m_timeCla)
801  {
802  if (m_timeCla > int32(diff))
803  m_timeCla -= diff;
804  else if (caster)
805  {
806  if (!m_periodicCosts.empty())
807  {
808  m_timeCla += 1000 - diff;
809 
810  for (SpellPowerEntry const* power : m_periodicCosts)
811  {
812  if (power->RequiredAuraSpellID && !caster->HasAura(power->RequiredAuraSpellID))
813  continue;
814 
815  int32 manaPerSecond = power->ManaPerSecond;
816  Powers powertype = Powers(power->PowerType);
817  if (powertype != POWER_HEALTH)
818  manaPerSecond += int32(CalculatePct(caster->GetMaxPower(powertype), power->PowerPctPerSecond));
819  else
820  manaPerSecond += int32(CalculatePct(caster->GetMaxHealth(), power->PowerPctPerSecond));
821 
822  if (manaPerSecond)
823  {
824  if (powertype == POWER_HEALTH)
825  {
826  if (int32(caster->GetHealth()) > manaPerSecond)
827  caster->ModifyHealth(-manaPerSecond);
828  else
829  Remove();
830  }
831  else if (int32(caster->GetPower(powertype)) >= manaPerSecond)
832  caster->ModifyPower(powertype, -manaPerSecond);
833  else
834  Remove();
835  }
836  }
837  }
838  }
839  }
840  }
841 }
Powers
Definition: SharedDefines.h:263
int64 ModifyHealth(int64 val)
Definition: Unit.cpp:7782
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4415
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:7850
Definition: DB2Structure.h:3254
std::vector< SpellPowerEntry const * > m_periodicCosts
Definition: SpellAuras.h:323
uint64 GetHealth() const
Definition: Unit.h:875
int32_t int32
Definition: Define.h:148
T CalculatePct(T base, U pct)
Definition: Util.h:70
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:8914
int32 GetPower(Powers power) const
Definition: Unit.cpp:8905
int32 m_duration
Definition: SpellAuras.h:321
int32 m_timeCla
Definition: SpellAuras.h:322
uint64 GetMaxHealth() const
Definition: Unit.h:876
Definition: SharedDefines.h:286
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateOwner()

void Aura::UpdateOwner ( uint32  diff,
WorldObject owner 
)
753 {
754  ASSERT(owner == m_owner);
755 
756  Unit* caster = GetCaster();
757  // Apply spellmods for channeled auras
758  // used for example when triggered spell of spell:10 is modded
759  Spell* modSpell = nullptr;
760  Player* modOwner = nullptr;
761  if (caster)
762  {
763  modOwner = caster->GetSpellModOwner();
764  if (modOwner)
765  {
766  modSpell = modOwner->FindCurrentSpellBySpellId(GetId());
767  if (modSpell)
768  modOwner->SetSpellModTakingSpell(modSpell, true);
769  }
770  }
771 
772  Update(diff, caster);
773 
774  if (m_updateTargetMapInterval <= int32(diff))
775  UpdateTargetMap(caster);
776  else
778 
779  // update aura effects
780  for (AuraEffect* effect : GetAuraEffects())
781  if (effect)
782  effect->Update(diff, caster);
783 
784  // remove spellmods after effects update
785  if (modSpell)
786  modOwner->SetSpellModTakingSpell(modSpell, false);
787 
789 }
Definition: SpellAuraEffects.h:28
uint32 GetId() const
Definition: SpellAuras.h:135
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
Definition: Unit.cpp:2951
int32_t int32
Definition: Define.h:148
AuraEffectVector const & GetAuraEffects() const
Definition: SpellAuras.h:302
void SetSpellModTakingSpell(Spell *spell, bool apply)
Definition: Player.cpp:22564
void UpdateTargetMap(Unit *caster, bool apply=true)
Definition: SpellAuras.cpp:599
WorldObject *const m_owner
Definition: SpellAuras.h:318
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
int32 m_updateTargetMapInterval
Definition: SpellAuras.h:324
#define ASSERT
Definition: Errors.h:61
Player * GetSpellModOwner() const
Definition: Object.cpp:2075
Definition: Unit.h:737
void _DeleteRemovedApplications()
Definition: SpellAuras.cpp:1947
Definition: Player.h:1081
void Update(uint32 diff, Unit *caster)
Definition: SpellAuras.cpp:791
Definition: Spell.h:236
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateTargetMap()

void Aura::UpdateTargetMap ( Unit caster,
bool  apply = true 
)
Todo:
There is a crash caused by shadowfiend load addon
600 {
601  if (IsRemoved())
602  return;
603 
605 
606  // fill up to date target list
607  // target, effMask
608  std::unordered_map<Unit*, uint32> targets;
609 
610  FillTargetMap(targets, caster);
611 
612  std::vector<Unit*> targetsToRemove;
613 
614  // mark all auras as ready to remove
615  for (auto const& applicationPair : m_applications)
616  {
617  auto itr = targets.find(applicationPair.second->GetTarget());
618  // not found in current area - remove the aura
619  if (itr == targets.end())
620  targetsToRemove.push_back(applicationPair.second->GetTarget());
621  else
622  {
623  // needs readding - remove now, will be applied in next update cycle
624  // (dbcs do not have auras which apply on same type of targets but have different radius, so this is not really needed)
625  if (!CanBeAppliedOn(itr->first))
626  {
627  targetsToRemove.push_back(applicationPair.second->GetTarget());
628  continue;
629  }
630 
631  // needs to add/remove effects from application, don't remove from map so it gets updated
632  if (applicationPair.second->GetEffectMask() != itr->second)
633  continue;
634 
635  // nothing to do - aura already applied
636  // remove from auras to register list
637  targets.erase(itr);
638  }
639  }
640 
641  // register auras for units
642  for (auto itr = targets.begin(); itr != targets.end();)
643  {
644  bool addUnit = true;
645  // check target immunities
646  for (SpellEffectInfo const& spellEffectInfo : GetSpellInfo()->GetEffects())
647  if (itr->first->IsImmunedToSpellEffect(GetSpellInfo(), spellEffectInfo, caster))
648  itr->second &= ~(1 << spellEffectInfo.EffectIndex);
649 
650  if (!itr->second || itr->first->IsImmunedToSpell(GetSpellInfo(), caster) || !CanBeAppliedOn(itr->first))
651  addUnit = false;
652 
653  if (addUnit && !itr->first->IsHighestExclusiveAura(this, true))
654  addUnit = false;
655 
656  if (addUnit)
657  {
658  // persistent area aura does not hit flying targets
659  if (GetType() == DYNOBJ_AURA_TYPE)
660  {
661  if (itr->first->IsInFlight())
662  addUnit = false;
663  }
664  // unit auras can not stack with each other
665  else // (GetType() == UNIT_AURA_TYPE)
666  {
667  // Allow to remove by stack when aura is going to be applied on owner
668  if (itr->first != GetOwner())
669  {
670  // check if not stacking aura already on target
671  // this one prevents unwanted usefull buff loss because of stacking and prevents overriding auras periodicaly by 2 near area aura owners
672  for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter)
673  {
674  Aura const* aura = iter->second->GetBase();
675  if (!CanStackWith(aura))
676  {
677  addUnit = false;
678  break;
679  }
680  }
681  }
682  }
683  }
684 
685  if (!addUnit)
686  itr = targets.erase(itr);
687  else
688  {
689  // owner has to be in world, or effect has to be applied to self
690  if (!GetOwner()->IsSelfOrInSameMap(itr->first))
691  {
693  TC_LOG_FATAL("spells", "Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
694  GetOwner()->GetName().c_str(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
695  itr->first->GetName().c_str(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
696  ABORT();
697  }
698 
699  if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
700  {
701  // aura is already applied, this means we need to update effects of current application
702  itr->first->_UnapplyAura(aurApp, AURA_REMOVE_BY_DEFAULT);
703  }
704 
705  itr->first->_CreateAuraApplication(this, itr->second);
706  ++itr;
707  }
708  }
709 
710  // remove auras from units no longer needing them
711  for (Unit* unit : targetsToRemove)
712  if (AuraApplication* aurApp = GetApplicationOfTarget(unit->GetGUID()))
713  unit->_UnapplyAura(aurApp, AURA_REMOVE_BY_DEFAULT);
714 
715  if (!apply)
716  return;
717 
718  // apply aura effects for units
719  for (auto itr = targets.begin(); itr!= targets.end(); ++itr)
720  {
721  if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
722  {
723  // owner has to be in world, or effect has to be applied to self
724  ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first));
725  itr->first->_ApplyAura(aurApp, itr->second);
726  }
727  }
728 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
virtual void FillTargetMap(std::unordered_map< Unit *, uint32 > &targets, Unit *caster)=0
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
Definition: SpellAuras.h:53
uint32 GetId() const
Definition: SpellAuras.h:135
Definition: SpellAuraDefines.h:600
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
#define TC_LOG_FATAL(filterType__,...)
Definition: Log.h:189
Definition: SpellInfo.h:227
ApplicationMap m_applications
Definition: SpellAuras.h:330
uint32_t uint32
Definition: Define.h:152
TC_GAME_API bool GetName(uint32 accountId, std::string &name)
Definition: BattlenetAccountMgr.cpp:141
std::vector< SpellEffectInfo > const & GetEffects() const
Definition: SpellInfo.h:579
bool CanStackWith(Aura const *existingAura) const
Definition: SpellAuras.cpp:1570
#define ABORT
Definition: Errors.h:64
bool IsRemoved() const
Definition: SpellAuras.h:204
int32 m_updateTargetMapInterval
Definition: SpellAuras.h:324
#define ASSERT
Definition: Errors.h:61
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
Definition: SpellAuraDefines.h:65
#define UPDATE_TARGET_MAP_INTERVAL
Definition: SpellAuras.h:51
Definition: SpellAuras.h:118
Definition: Unit.h:737
bool CanBeAppliedOn(Unit *target)
Definition: SpellAuras.cpp:1544
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Unit

friend class Unit
friend

Member Data Documentation

◆ _effects

AuraEffectVector Aura::_effects
private

◆ _removedApplications

std::vector<AuraApplication*> Aura::_removedApplications
private

◆ m_applications

ApplicationMap Aura::m_applications
protected

◆ m_applyTime

time_t const Aura::m_applyTime
protected

◆ m_castDifficulty

Difficulty const Aura::m_castDifficulty
protected

◆ m_casterGuid

ObjectGuid const Aura::m_casterGuid
protected

◆ m_casterLevel

uint8 const Aura::m_casterLevel
protected

◆ m_castId

ObjectGuid const Aura::m_castId
protected

◆ m_castItemGuid

ObjectGuid const Aura::m_castItemGuid
protected

◆ m_castItemId

uint32 Aura::m_castItemId
protected

◆ m_castItemLevel

int32 Aura::m_castItemLevel
protected

◆ m_dropEvent

ChargeDropEvent* Aura::m_dropEvent
protected

◆ m_duration

int32 Aura::m_duration
protected

◆ m_isRemoved

bool Aura::m_isRemoved
protected

◆ m_isSingleTarget

bool Aura::m_isSingleTarget
protected

◆ m_isUsingCharges

bool Aura::m_isUsingCharges
protected

◆ m_lastProcAttemptTime

std::chrono::steady_clock::time_point Aura::m_lastProcAttemptTime
protected

◆ m_lastProcSuccessTime

std::chrono::steady_clock::time_point Aura::m_lastProcSuccessTime
protected

◆ m_loadedScripts

std::vector<AuraScript*> Aura::m_loadedScripts

◆ m_maxDuration

int32 Aura::m_maxDuration
protected

◆ m_owner

WorldObject* const Aura::m_owner
protected

◆ m_periodicCosts

std::vector<SpellPowerEntry const*> Aura::m_periodicCosts
protected

◆ m_procCharges

uint8 Aura::m_procCharges
protected

◆ m_procCooldown

std::chrono::steady_clock::time_point Aura::m_procCooldown
protected

◆ m_spellInfo

SpellInfo const* const Aura::m_spellInfo
protected

◆ m_spellVisual

SpellCastVisual const Aura::m_spellVisual
protected

◆ m_stackAmount

uint8 Aura::m_stackAmount
protected

◆ m_timeCla

int32 Aura::m_timeCla
protected

◆ m_updateTargetMapInterval

int32 Aura::m_updateTargetMapInterval
protected

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