TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Aura Class Referenceabstract

#include <SpellAuras.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

static uint32 BuildEffectMaskForOwner (SpellInfo const *spellProto, uint32 avalibleEffectMask, WorldObject *owner)
 
static AuraTryRefreshStackOrCreate (SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, bool *refresh=NULL, int32 castItemLevel=-1)
 
static AuraTryCreate (SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, int32 castItemLevel=-1)
 
static AuraCreate (SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 

Public Attributes

std::list< AuraScript * > m_loadedScripts
 

Protected Attributes

SpellInfo const *const m_spellInfo
 
ObjectGuid const m_casterGuid
 
ObjectGuid const m_castItemGuid
 
int32 m_castItemLevel
 
time_t const m_applyTime
 
WorldObject *const m_owner
 
int32 m_maxDuration
 
int32 m_duration
 
int32 m_timeCla
 
std::vector< SpellPowerEntry
const * > 
m_periodicCosts
 
int32 m_updateTargetMapInterval
 
uint8 const m_casterLevel
 
uint8 m_procCharges
 
uint8 m_stackAmount
 
ApplicationMap m_applications
 
bool m_isRemoved:1
 
bool m_isSingleTarget:1
 
bool m_isUsingCharges:1
 
ChargeDropEventm_dropEvent
 

Private Member Functions

void _DeleteRemovedApplications ()
 

Private Attributes

Unit::AuraApplicationList m_removedApplications
 
AuraEffectVector _effects
 
SpellEffectInfoVector _spelEffectInfos
 

Friends

AuraUnit::_TryStackingOrRefreshingExistingAura (SpellInfo const *newAura, uint32 effMask, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
 

Member Typedef Documentation

Constructor & Destructor Documentation

Aura::Aura ( SpellInfo const spellproto,
WorldObject owner,
Unit caster,
Item castItem,
ObjectGuid  casterGUID,
int32  castItemLevel 
)
366  :
367 m_spellInfo(spellproto), m_casterGuid(!casterGUID.IsEmpty() ? casterGUID : caster->GetGUID()),
368 m_castItemGuid(castItem ? castItem->GetGUID() : ObjectGuid::Empty), m_castItemLevel(castItemLevel),
371 m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr)
372 {
373  std::vector<SpellPowerEntry const*> powers = sDB2Manager.GetSpellPowers(GetId(), caster ? caster->GetMap()->GetDifficultyID() : DIFFICULTY_NONE);
374  for (SpellPowerEntry const* power : powers)
375  if (power->ManaCostPerSecond != 0 || power->ManaCostPercentagePerSecond > 0.0f)
376  m_periodicCosts.push_back(power);
377 
378  if (!m_periodicCosts.empty())
380 
381  m_maxDuration = CalcMaxDuration(caster);
383  m_procCharges = CalcMaxCharges(caster);
385  // m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
386 }
Definition: DBCEnums.h:404
uint8 const m_casterLevel
Definition: SpellAuras.h:309
#define sDB2Manager
Definition: DB2Stores.h:224
time_t const m_applyTime
Definition: SpellAuras.h:300
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
int32 CalcMaxDuration() const
Definition: SpellAuras.h:161
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
uint8 m_stackAmount
Definition: SpellAuras.h:311
Map * GetMap() const
Definition: Object.h:543
uint32 SpellLevel
Definition: SpellInfo.h:375
bool m_isUsingCharges
Definition: SpellAuras.h:318
Difficulty GetDifficultyID() const
Definition: Map.h:390
bool m_isSingleTarget
Definition: SpellAuras.h:317
arena_t NULL
Definition: jemalloc_internal.h:624
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:173
Definition: DB2Structure.h:1238
uint8 getLevel() const
Definition: Unit.h:1408
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:320
bool m_isRemoved
Definition: SpellAuras.h:316
ObjectGuid const m_casterGuid
Definition: SpellAuras.h:297
std::vector< SpellPowerEntry const * > m_periodicCosts
Definition: SpellAuras.h:306
WorldObject *const m_owner
Definition: SpellAuras.h:301
ObjectGuid const & GetGUID() const
Definition: Object.h:105
int32 m_maxDuration
Definition: SpellAuras.h:303
uint8 m_procCharges
Definition: SpellAuras.h:310
Definition: Common.h:103
int32 m_duration
Definition: SpellAuras.h:304
int32 m_updateTargetMapInterval
Definition: SpellAuras.h:307
int32 m_timeCla
Definition: SpellAuras.h:305
int32 m_castItemLevel
Definition: SpellAuras.h:299
bool IsEmpty() const
Definition: ObjectGuid.h:242
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:298
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

Aura::~Aura ( )
virtual
421 {
422  // unload scripts
423  while (!m_loadedScripts.empty())
424  {
425  std::list<AuraScript*>::iterator itr = m_loadedScripts.begin();
426  (*itr)->_Unload();
427  delete (*itr);
428  m_loadedScripts.erase(itr);
429  }
430 
431  for (AuraEffect* effect : _effects)
432  delete effect;
433 
434  ASSERT(m_applications.empty());
436 }
Definition: SpellAuraEffects.h:30
AuraEffectVector _effects
Definition: SpellAuras.h:325
ApplicationMap m_applications
Definition: SpellAuras.h:314
#define ASSERT
Definition: Errors.h:55
void _DeleteRemovedApplications()
Definition: SpellAuras.cpp:1936
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

Member Function Documentation

void Aura::_ApplyEffectForTargets ( uint8  effIndex)
672 {
673  // prepare list of aura targets
674  UnitList targetList;
675  for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
676  {
677  if ((appIter->second->GetEffectsToApply() & (1 << effIndex)) && !appIter->second->HasEffect(effIndex))
678  targetList.push_back(appIter->second->GetTarget());
679  }
680 
681  // apply effect to targets
682  for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
683  {
684  if (GetApplicationOfTarget((*itr)->GetGUID()))
685  {
686  // owner has to be in world, or effect has to be applied to self
687  ASSERT((!GetOwner()->IsInWorld() && GetOwner() == *itr) || GetOwner()->IsInMap(*itr));
688  (*itr)->_ApplyAuraEffect(this, effIndex);
689  }
690  }
691 }
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:233
ApplicationMap m_applications
Definition: SpellAuras.h:314
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
#define ASSERT
Definition: Errors.h:55
std::list< Unit * > UnitList
Definition: Unit.h:421

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented in UnitAura.

462 {
463  ASSERT(target);
464  ASSERT(auraApp);
465  // aura mustn't be already applied on target
466  ASSERT (!IsAppliedOnTarget(target->GetGUID()) && "Aura::_ApplyForTarget: aura musn't be already applied on target");
467 
468  m_applications[target->GetGUID()] = auraApp;
469 
470  // set infinity cooldown state for spells
471  if (caster && caster->GetTypeId() == TYPEID_PLAYER)
472  {
474  {
475  Item* castItem = !m_castItemGuid.IsEmpty() ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL;
476  caster->GetSpellHistory()->StartCooldown(m_spellInfo, castItem ? castItem->GetEntry() : 0, nullptr, true);
477  }
478  }
479 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
arena_t NULL
Definition: jemalloc_internal.h:624
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
SpellHistory * GetSpellHistory()
Definition: Unit.h:1926
Definition: Item.h:259
ApplicationMap m_applications
Definition: SpellAuras.h:314
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false)
Definition: SpellHistory.cpp:386
bool IsAppliedOnTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
#define ASSERT
Definition: Errors.h:55
uint32 GetEntry() const
Definition: Object.h:107
bool IsEmpty() const
Definition: ObjectGuid.h:242
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:298
bool IsCooldownStartedOnEvent() const
Definition: SpellInfo.cpp:1470

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::_DeleteRemovedApplications ( )
private
1937 {
1938  while (!m_removedApplications.empty())
1939  {
1940  delete m_removedApplications.front();
1941  m_removedApplications.pop_front();
1942  }
1943 }
Unit::AuraApplicationList m_removedApplications
Definition: SpellAuras.h:323

+ Here is the caller graph for this function:

void Aura::_InitEffects ( uint32  effMask,
Unit caster,
int32 baseAmount 
)
405 {
406  // shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism
407  _spelEffectInfos = m_spellInfo->GetEffectsForDifficulty(GetOwner()->GetMap()->GetDifficultyID());
408 
409  ASSERT(!_spelEffectInfos.empty());
410 
411  _effects.resize(GetSpellEffectInfos().size());
412 
413  for (SpellEffectInfo const* effect : GetSpellEffectInfos())
414  {
415  if (effect && effMask & (1 << effect->EffectIndex))
416  _effects[effect->EffectIndex] = new AuraEffect(this, effect->EffectIndex, baseAmount ? baseAmount + effect->EffectIndex : NULL, caster);
417  }
418 }
Definition: SpellAuraEffects.h:30
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
arena_t NULL
Definition: jemalloc_internal.h:624
AuraEffectVector _effects
Definition: SpellAuras.h:325
Definition: SpellInfo.h:238
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
SpellEffectInfoVector _spelEffectInfos
Definition: SpellAuras.h:326
SpellEffectInfoVector GetEffectsForDifficulty(uint32 difficulty) const
Definition: SpellInfo.cpp:3311
#define ASSERT
Definition: Errors.h:55
SpellEffectInfoVector GetSpellEffectInfos() const
Definition: SpellAuras.h:290

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::_RegisterForTargets ( )
inline
151 {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
void UpdateTargetMap(Unit *caster, bool apply=true)
Definition: SpellAuras.cpp:531
Definition: Unit.h:1305

+ Here is the caller graph for this function:

void Aura::_Remove ( AuraRemoveMode  removeMode)
512 {
513  ASSERT (!m_isRemoved);
514  m_isRemoved = true;
515  ApplicationMap::iterator appItr = m_applications.begin();
516  for (appItr = m_applications.begin(); appItr != m_applications.end();)
517  {
518  AuraApplication * aurApp = appItr->second;
519  Unit* target = aurApp->GetTarget();
520  target->_UnapplyAura(aurApp, removeMode);
521  appItr = m_applications.begin();
522  }
523 
524  if (m_dropEvent)
525  {
526  m_dropEvent->to_Abort = true;
527  m_dropEvent = nullptr;
528  }
529 }
bool to_Abort
Definition: EventProcessor.h:48
Unit * GetTarget() const
Definition: SpellAuras.h:74
Definition: SpellAuras.h:50
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:320
bool m_isRemoved
Definition: SpellAuras.h:316
ApplicationMap m_applications
Definition: SpellAuras.h:314
#define ASSERT
Definition: Errors.h:55
Definition: Unit.h:1305
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
Definition: Unit.cpp:3217

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented in UnitAura.

482 {
483  ASSERT(target);
484  ASSERT(auraApp->GetRemoveMode());
485  ASSERT(auraApp);
486 
487  ApplicationMap::iterator itr = m_applications.find(target->GetGUID());
488 
490  if (itr == m_applications.end())
491  {
492  TC_LOG_ERROR("spells", "Aura::_UnapplyForTarget, target: %s, caster:%s, spell:%u was not found in owners application map!",
493  target->GetGUID().ToString().c_str(), caster ? caster->GetGUID().ToString().c_str() : "Empty", auraApp->GetBase()->GetSpellInfo()->Id);
494  ABORT();
495  }
496 
497  // aura has to be already applied
498  ASSERT(itr->second == auraApp);
499  m_applications.erase(itr);
500 
501  m_removedApplications.push_back(auraApp);
502 
503  // reset cooldown state for spells
504  if (caster && GetSpellInfo()->IsCooldownStartedOnEvent())
505  // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases)
507 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
uint32 Id
Definition: SpellInfo.h:329
Aura * GetBase() const
Definition: SpellAuras.h:75
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true)
Definition: SpellHistory.cpp:487
SpellHistory * GetSpellHistory()
Definition: Unit.h:1926
Unit::AuraApplicationList m_removedApplications
Definition: SpellAuras.h:323
ApplicationMap m_applications
Definition: SpellAuras.h:314
ObjectGuid const & GetGUID() const
Definition: Object.h:105
#define ABORT
Definition: Errors.h:56
#define ASSERT
Definition: Errors.h:55
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:86
std::string ToString() const
Definition: ObjectGuid.cpp:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::AddProcCooldown ( uint32  msec)
1803 {
1804  //m_procCooldown = time(NULL) + msec;
1805 }

+ Here is the caller graph for this function:

void Aura::ApplyForTargets ( )
inline
152 {Unit* caster = GetCaster(); UpdateTargetMap(caster, true);}
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
void UpdateTargetMap(Unit *caster, bool apply=true)
Definition: SpellAuras.cpp:531
Definition: Unit.h:1305
uint32 Aura::BuildEffectMaskForOwner ( SpellInfo const spellProto,
uint32  avalibleEffectMask,
WorldObject owner 
)
static
255 {
256  ASSERT(spellProto);
257  ASSERT(owner);
258  uint32 effMask = 0;
259  switch (owner->GetTypeId())
260  {
261  case TYPEID_UNIT:
262  case TYPEID_PLAYER:
263  for (SpellEffectInfo const* effect : spellProto->GetEffectsForDifficulty(owner->GetMap()->GetDifficultyID()))
264  {
265  if (effect && effect->IsUnitOwnedAuraEffect())
266  effMask |= 1 << effect->EffectIndex;
267  }
268  break;
270  for (SpellEffectInfo const* effect : spellProto->GetEffectsForDifficulty(owner->GetMap()->GetDifficultyID()))
271  {
272  if (effect && effect->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
273  effMask |= 1 << effect->EffectIndex;
274  }
275  break;
276  default:
277  break;
278  }
279  return effMask & avalibleEffectMask;
280 }
Map * GetMap() const
Definition: Object.h:543
Difficulty GetDifficultyID() const
Definition: Map.h:390
Definition: ObjectGuid.h:32
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SpellInfo.h:238
uint32_t uint32
Definition: Define.h:150
Definition: ObjectGuid.h:33
#define ASSERT
Definition: Errors.h:55
Definition: SharedDefines.h:1037
Definition: ObjectGuid.h:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 Aura::CalcDispelChance ( Unit auraTarget,
bool  offensive 
) const
1125 {
1126  // we assume that aura dispel chance is 100% on start
1127  // need formula for level difference based chance
1128  int32 resistChance = 0;
1129 
1130  // Apply dispel mod from aura caster
1131  if (Unit* caster = GetCaster())
1132  if (Player* modOwner = caster->GetSpellModOwner())
1133  modOwner->ApplySpellMod(GetId(), SPELLMOD_RESIST_DISPEL_CHANCE, resistChance);
1134 
1135  // Dispel resistance from target SPELL_AURA_MOD_DISPEL_RESIST
1136  // Only affects offensive dispels
1137  if (offensive && auraTarget)
1138  resistChance += auraTarget->GetTotalAuraModifier(SPELL_AURA_MOD_DISPEL_RESIST);
1139 
1140  RoundToInterval(resistChance, 0, 100);
1141  return 100 - resistChance;
1142 }
T RoundToInterval(T &num, T floor, T ceil)
Definition: Util.h:110
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
int32 GetTotalAuraModifier(AuraType auratype) const
Definition: Unit.cpp:4396
Definition: Unit.h:114
Definition: SpellAuraDefines.h:295
int32_t int32
Definition: Define.h:146
Definition: Unit.h:1305
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8 Aura::CalcMaxCharges ( Unit caster) const
875 {
876  uint32 maxProcCharges = m_spellInfo->ProcCharges;
877  if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId()))
878  maxProcCharges = procEntry->charges;
879 
880  if (caster)
881  if (Player* modOwner = caster->GetSpellModOwner())
882  modOwner->ApplySpellMod(GetId(), SPELLMOD_CHARGES, maxProcCharges);
883 
884  return uint8(maxProcCharges);
885 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
uint32 ProcCharges
Definition: SpellInfo.h:372
Definition: SpellMgr.h:290
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Definition: Unit.h:90
uint8_t uint8
Definition: g3dmath.h:164
Player * GetSpellModOwner() const
Definition: Unit.cpp:12691
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint8 Aura::CalcMaxCharges ( ) const
inline
173 { return CalcMaxCharges(GetCaster()); }
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:173

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 Aura::CalcMaxDuration ( ) const
inline
161 { return CalcMaxDuration(GetCaster()); }
int32 CalcMaxDuration() const
Definition: SpellAuras.h:161
Unit * GetCaster() const
Definition: SpellAuras.cpp:438

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 Aura::CalcMaxDuration ( Unit caster) const
784 {
785  Player* modOwner = NULL;
786  int32 maxDuration;
787 
788  if (caster)
789  {
790  modOwner = caster->GetSpellModOwner();
791  maxDuration = caster->CalcSpellDuration(m_spellInfo);
792  }
793  else
794  maxDuration = m_spellInfo->GetDuration();
795 
797  maxDuration = -1;
798 
799  // IsPermanent() checks max duration (which we are supposed to calculate here)
800  if (maxDuration != -1 && modOwner)
801  modOwner->ApplySpellMod(GetId(), SPELLMOD_DURATION, maxDuration);
802 
803  return maxDuration;
804 }
bool IsPassive() const
Definition: SpellAuras.cpp:1026
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: Unit.h:87
arena_t NULL
Definition: jemalloc_internal.h:624
int32 GetDuration() const
Definition: SpellInfo.cpp:2490
SpellDurationEntry const * DurationEntry
Definition: SpellInfo.h:376
int32_t int32
Definition: Define.h:146
int32 CalcSpellDuration(SpellInfo const *spellProto)
Definition: Unit.cpp:10939
Player * GetSpellModOwner() const
Definition: Unit.cpp:12691
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

float Aura::CalcProcChance ( SpellProcEntry const procEntry,
ProcEventInfo eventInfo 
) const
1901 {
1902  float chance = procEntry.chance;
1903  // calculate chances depending on unit with caster's data
1904  // so talents modifying chances and judgements will have properly calculated proc chance
1905  if (Unit* caster = GetCaster())
1906  {
1907  // calculate ppm chance if present and we're using weapon
1908  if (eventInfo.GetDamageInfo() && procEntry.ratePerMinute != 0)
1909  {
1910  uint32 WeaponSpeed = caster->GetAttackTime(eventInfo.GetDamageInfo()->GetAttackType());
1911  chance = caster->GetPPMProcChance(WeaponSpeed, procEntry.ratePerMinute, GetSpellInfo());
1912  }
1913  // apply chance modifer aura, applies also to ppm chance (see improved judgement of light spell)
1914  if (Player* modOwner = caster->GetSpellModOwner())
1915  modOwner->ApplySpellMod(GetId(), SPELLMOD_CHANCE_OF_SUCCESS, chance);
1916  }
1917  return chance;
1918 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
Definition: Unit.h:104
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
uint32_t uint32
Definition: Define.h:150
WeaponAttackType GetAttackType() const
Definition: Unit.h:948
Definition: Unit.h:1305
DamageInfo * GetDamageInfo() const
Definition: Unit.h:1003
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptAfterDispel ( DispelInfo dispelInfo)
1993 {
1994  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1995  {
1996  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
1997  std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
1998  for (; hookItr != hookItrEnd; ++hookItr)
1999  hookItr->Call(*scritr, dispelInfo);
2000 
2001  (*scritr)->_FinishScriptCall();
2002  }
2003 }
Definition: SpellScript.h:459
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

void Aura::CallScriptAfterEffectApplyHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
AuraEffectHandleModes  mode 
)
2045 {
2046  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2047  {
2048  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp);
2049  std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
2050  for (; effItr != effEndItr; ++effItr)
2051  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2052  effItr->Call(*scritr, aurEff, mode);
2053 
2054  (*scritr)->_FinishScriptCall();
2055  }
2056 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:444
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptAfterEffectProcHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2307 {
2308  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2309  {
2310  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC, aurApp);
2311  std::list<AuraScript::EffectProcHandler>::iterator effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin();
2312  for (; effItr != effEndItr; ++effItr)
2313  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2314  effItr->Call(*scritr, aurEff, eventInfo);
2315 
2316  (*scritr)->_FinishScriptCall();
2317  }
2318 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:465
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptAfterEffectRemoveHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
AuraEffectHandleModes  mode 
)
2059 {
2060  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2061  {
2062  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp);
2063  std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
2064  for (; effItr != effEndItr; ++effItr)
2065  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2066  effItr->Call(*scritr, aurEff, mode);
2067 
2068  (*scritr)->_FinishScriptCall();
2069  }
2070 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:446
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptAfterProcHandlers ( AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2275 {
2276  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2277  {
2278  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_PROC, aurApp);
2279  std::list<AuraScript::AuraProcHandler>::iterator hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin();
2280  for (; hookItr != hookItrEnd; ++hookItr)
2281  hookItr->Call(*scritr, eventInfo);
2282 
2283  (*scritr)->_FinishScriptCall();
2284  }
2285 }
Definition: SpellScript.h:466
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

bool Aura::CallScriptCheckAreaTargetHandlers ( Unit target)
1965 {
1966  bool result = true;
1967  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1968  {
1969  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET);
1970  std::list<AuraScript::CheckAreaTargetHandler>::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin();
1971  for (; hookItr != hookItrEnd; ++hookItr)
1972  result &= hookItr->Call(*scritr, target);
1973 
1974  (*scritr)->_FinishScriptCall();
1975  }
1976  return result;
1977 }
Definition: SpellScript.h:457
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

bool Aura::CallScriptCheckProcHandlers ( AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2223 {
2224  bool result = true;
2225  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2226  {
2227  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_PROC, aurApp);
2228  std::list<AuraScript::CheckProcHandler>::iterator hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin();
2229  for (; hookItr != hookItrEnd; ++hookItr)
2230  result &= hookItr->Call(*scritr, eventInfo);
2231 
2232  (*scritr)->_FinishScriptCall();
2233  }
2234 
2235  return result;
2236 }
Definition: SpellScript.h:461
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

void Aura::CallScriptDispel ( DispelInfo dispelInfo)
1980 {
1981  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
1982  {
1983  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
1984  std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
1985  for (; hookItr != hookItrEnd; ++hookItr)
1986  hookItr->Call(*scritr, dispelInfo);
1987 
1988  (*scritr)->_FinishScriptCall();
1989  }
1990 }
Definition: SpellScript.h:458
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

void Aura::CallScriptEffectAbsorbHandlers ( AuraEffect aurEff,
AuraApplication const aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount,
bool defaultPrevented 
)
2149 {
2150  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2151  {
2152  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp);
2153  std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
2154  for (; effItr != effEndItr; ++effItr)
2155 
2156  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2157  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2158 
2159  if (!defaultPrevented)
2160  defaultPrevented = (*scritr)->_IsDefaultActionPrevented();
2161 
2162  (*scritr)->_FinishScriptCall();
2163  }
2164 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:452
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectAfterAbsorbHandlers ( AuraEffect aurEff,
AuraApplication const aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
2167 {
2168  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2169  {
2170  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp);
2171  std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
2172  for (; effItr != effEndItr; ++effItr)
2173  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2174  effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
2175 
2176  (*scritr)->_FinishScriptCall();
2177  }
2178 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:453
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectAfterManaShieldHandlers ( AuraEffect aurEff,
AuraApplication const aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount 
)
2195 {
2196  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2197  {
2198  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp);
2199  std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.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 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286
Definition: SpellScript.h:455

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CallScriptEffectApplyHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
AuraEffectHandleModes  mode 
)
2006 {
2007  bool preventDefault = false;
2008  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2009  {
2010  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp);
2011  std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
2012  for (; effItr != effEndItr; ++effItr)
2013  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2014  effItr->Call(*scritr, aurEff, mode);
2015 
2016  if (!preventDefault)
2017  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2018 
2019  (*scritr)->_FinishScriptCall();
2020  }
2021 
2022  return preventDefault;
2023 }
Definition: SpellScript.h:443
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectCalcAmountHandlers ( AuraEffect const aurEff,
int32 amount,
bool canBeRecalculated 
)
2107 {
2108  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2109  {
2110  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT);
2111  std::list<AuraScript::EffectCalcAmountHandler>::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
2112  for (; effItr != effEndItr; ++effItr)
2113  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2114  effItr->Call(*scritr, aurEff, amount, canBeRecalculated);
2115 
2116  (*scritr)->_FinishScriptCall();
2117  }
2118 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286
Definition: SpellScript.h:449

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectCalcPeriodicHandlers ( AuraEffect const aurEff,
bool isPeriodic,
int32 amplitude 
)
2121 {
2122  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2123  {
2124  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC);
2125  std::list<AuraScript::EffectCalcPeriodicHandler>::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
2126  for (; effItr != effEndItr; ++effItr)
2127  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2128  effItr->Call(*scritr, aurEff, isPeriodic, amplitude);
2129 
2130  (*scritr)->_FinishScriptCall();
2131  }
2132 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:450
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectCalcSpellModHandlers ( AuraEffect const aurEff,
SpellModifier *&  spellMod 
)
2135 {
2136  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2137  {
2138  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD);
2139  std::list<AuraScript::EffectCalcSpellModHandler>::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
2140  for (; effItr != effEndItr; ++effItr)
2141  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2142  effItr->Call(*scritr, aurEff, spellMod);
2143 
2144  (*scritr)->_FinishScriptCall();
2145  }
2146 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:451
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectManaShieldHandlers ( AuraEffect aurEff,
AuraApplication const aurApp,
DamageInfo dmgInfo,
uint32 absorbAmount,
bool defaultPrevented 
)
2181 {
2182  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2183  {
2184  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp);
2185  std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.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 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:454
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CallScriptEffectPeriodicHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp 
)
2073 {
2074  bool preventDefault = false;
2075  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2076  {
2077  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp);
2078  std::list<AuraScript::EffectPeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
2079  for (; effItr != effEndItr; ++effItr)
2080  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2081  effItr->Call(*scritr, aurEff);
2082 
2083  if (!preventDefault)
2084  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2085 
2086  (*scritr)->_FinishScriptCall();
2087  }
2088 
2089  return preventDefault;
2090 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:447
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CallScriptEffectProcHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2288 {
2289  bool preventDefault = false;
2290  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2291  {
2292  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PROC, aurApp);
2293  std::list<AuraScript::EffectProcHandler>::iterator effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin();
2294  for (; effItr != effEndItr; ++effItr)
2295  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2296  effItr->Call(*scritr, aurEff, eventInfo);
2297 
2298  if (!preventDefault)
2299  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2300 
2301  (*scritr)->_FinishScriptCall();
2302  }
2303  return preventDefault;
2304 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:464
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CallScriptEffectRemoveHandlers ( AuraEffect const aurEff,
AuraApplication const aurApp,
AuraEffectHandleModes  mode 
)
2026 {
2027  bool preventDefault = false;
2028  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2029  {
2030  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp);
2031  std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
2032  for (; effItr != effEndItr; ++effItr)
2033  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2034  effItr->Call(*scritr, aurEff, mode);
2035 
2036  if (!preventDefault)
2037  preventDefault = (*scritr)->_IsDefaultActionPrevented();
2038 
2039  (*scritr)->_FinishScriptCall();
2040  }
2041  return preventDefault;
2042 }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:445
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::CallScriptEffectSplitHandlers ( AuraEffect aurEff,
AuraApplication const aurApp,
DamageInfo dmgInfo,
uint32 splitAmount 
)
2209 {
2210  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2211  {
2212  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp);
2213  std::list<AuraScript::EffectSplitHandler>::iterator effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin();
2214  for (; effItr != effEndItr; ++effItr)
2215  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2216  effItr->Call(*scritr, aurEff, dmgInfo, splitAmount);
2217 
2218  (*scritr)->_FinishScriptCall();
2219  }
2220 }
Definition: SpellScript.h:456
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

void Aura::CallScriptEffectUpdatePeriodicHandlers ( AuraEffect aurEff)
2093 {
2094  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2095  {
2096  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC);
2097  std::list<AuraScript::EffectUpdatePeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
2098  for (; effItr != effEndItr; ++effItr)
2099  if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
2100  effItr->Call(*scritr, aurEff);
2101 
2102  (*scritr)->_FinishScriptCall();
2103  }
2104 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellScript.h:448
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CallScriptPrepareProcHandlers ( AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2239 {
2240  bool prepare = true;
2241  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2242  {
2243  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PREPARE_PROC, aurApp);
2244  std::list<AuraScript::AuraProcHandler>::iterator effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin();
2245  for (; effItr != effEndItr; ++effItr)
2246  effItr->Call(*scritr, eventInfo);
2247 
2248  if (prepare)
2249  prepare = !(*scritr)->_IsDefaultActionPrevented();
2250 
2251  (*scritr)->_FinishScriptCall();
2252  }
2253 
2254  return prepare;
2255 }
Definition: SpellScript.h:462
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

bool Aura::CallScriptProcHandlers ( AuraApplication const aurApp,
ProcEventInfo eventInfo 
)
2258 {
2259  bool handled = false;
2260  for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
2261  {
2262  (*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp);
2263  std::list<AuraScript::AuraProcHandler>::iterator hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin();
2264  for (; hookItr != hookItrEnd; ++hookItr)
2265  hookItr->Call(*scritr, eventInfo);
2266 
2267  handled |= (*scritr)->_IsDefaultActionPrevented();
2268  (*scritr)->_FinishScriptCall();
2269  }
2270 
2271  return handled;
2272 }
Definition: SpellScript.h:463
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286

+ Here is the caller graph for this function:

bool Aura::CanBeAppliedOn ( Unit target)
1634 {
1635  // unit not in world or during remove from world
1636  if (!target->IsInWorld() || target->IsDuringRemoveFromWorld())
1637  {
1638  // area auras mustn't be applied
1639  if (GetOwner() != target)
1640  return false;
1641  // do not apply non-selfcast single target auras
1643  return false;
1644  return true;
1645  }
1646  else
1647  return CheckAreaTarget(target);
1648 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
bool CheckAreaTarget(Unit *target)
Definition: SpellAuras.cpp:1650
bool IsDuringRemoveFromWorld() const
Definition: Unit.h:2198
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
ObjectGuid const & GetGUID() const
Definition: Object.h:105
bool IsSingleTarget() const
Definition: SpellInfo.cpp:1596
bool IsInWorld() const
Definition: Object.h:100
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CanBeSaved ( ) const
1037 {
1038  if (IsPassive())
1039  return false;
1040 
1041  if (GetCasterGUID() != GetOwner()->GetGUID())
1042  if (GetSpellInfo()->IsSingleTarget())
1043  return false;
1044 
1045  // Can't be saved - aura handler relies on calculated amount and changes it
1047  return false;
1048 
1049  // No point in saving this, since the stable dialog can't be open on aura load anyway.
1051  return false;
1052 
1053  // Can't save vehicle auras, it requires both caster & target to be in world
1055  return false;
1056 
1057  // Incanter's Absorbtion - considering the minimal duration and problems with aura stacking
1058  // we skip saving this aura
1059  // Also for some reason other auras put as MultiSlot crash core on keeping them after restart,
1060  // so put here only these for which you are sure they get removed
1061  switch (GetId())
1062  {
1063  case 44413: // Incanter's Absorption
1064  case 40075: // Fel Flak Fire
1065  case 55849: // Power Spark
1066  return false;
1067  }
1068 
1069  // When a druid logins, he doesnt have either eclipse power, nor the marker auras, nor the eclipse buffs. Dont save them.
1070  if (GetId() == 67483 || GetId() == 67484 || GetId() == 48517 || GetId() == 48518)
1071  return false;
1072 
1073  // don't save auras removed by proc system
1074  if (IsUsingCharges() && !GetCharges())
1075  return false;
1076 
1077  return true;
1078 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
bool IsPassive() const
Definition: SpellAuras.cpp:1026
bool IsSingleTarget() const
Definition: SpellAuras.h:204
Definition: SpellAuraDefines.h:309
Definition: SpellAuraDefines.h:296
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
bool IsUsingCharges() const
Definition: SpellAuras.h:250
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1186
uint8 GetCharges() const
Definition: SpellAuras.h:170
Definition: SpellAuraDefines.h:352
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

bool Aura::CanBeSentToClient ( ) const
1081 {
1082  return !IsPassive() || GetSpellInfo()->HasAreaAuraEffect(GetOwner() ? GetOwner()->GetMap()->GetDifficultyID() : DIFFICULTY_NONE)
1088 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
bool IsPassive() const
Definition: SpellAuras.cpp:1026
Definition: DBCEnums.h:404
Definition: SpellAuraDefines.h:471
Definition: SpellAuraDefines.h:514
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
Definition: SpellAuraDefines.h:322
Definition: SpellAuraDefines.h:390
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1186
Definition: SpellAuraDefines.h:513
bool HasAreaAuraEffect(uint32 difficulty) const
Definition: SpellInfo.cpp:1204

+ Here is the call graph for this function:

bool Aura::CanStackWith ( Aura const existingAura) const
1656 {
1657  // Can stack with self
1658  if (this == existingAura)
1659  return true;
1660 
1661  // Dynobj auras always stack
1662  if (GetType() == DYNOBJ_AURA_TYPE || existingAura->GetType() == DYNOBJ_AURA_TYPE)
1663  return true;
1664 
1665  SpellInfo const* existingSpellInfo = existingAura->GetSpellInfo();
1666  bool sameCaster = GetCasterGUID() == existingAura->GetCasterGUID();
1667 
1668  // passive auras don't stack with another rank of the spell cast by same caster
1669  if (IsPassive() && sameCaster && m_spellInfo->IsDifferentRankOf(existingSpellInfo))
1670  return false;
1671 
1672  for (SpellEffectInfo const* effect : existingAura->GetSpellEffectInfos())
1673  {
1674  // prevent remove triggering aura by triggered aura
1675  if (effect && effect->TriggerSpell == GetId())
1676  return true;
1677  }
1678 
1679  for (SpellEffectInfo const* effect : GetSpellEffectInfos())
1680  {
1681  // prevent remove triggered aura by triggering aura refresh
1682  if (effect && effect->TriggerSpell == existingAura->GetId())
1683  return true;
1684  }
1685 
1686  // Check for custom server setting to allow tracking both Herbs and Minerals
1687  // Note: The following are client limitations and cannot be coded for:
1688  // * The minimap tracking icon will display whichever skill is activated second
1689  // * The minimap tracking list will only show a check mark next to the last skill activated
1690  // Sometimes this bugs out and doesn't switch the check mark. It has no effect on the actual tracking though.
1691  // * The minimap dots are yellow for both resources
1692  if (m_spellInfo->HasAura(GetOwner()->GetMap()->GetDifficultyID(), SPELL_AURA_TRACK_RESOURCES) && existingSpellInfo->HasAura(GetOwner()->GetMap()->GetDifficultyID(), SPELL_AURA_TRACK_RESOURCES))
1693  return sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES);
1694 
1695  // check spell specific stack rules
1696  if (m_spellInfo->IsAuraExclusiveBySpecificWith(existingSpellInfo)
1697  || (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo)))
1698  return false;
1699 
1700  // check spell group stack rules
1701  switch (sSpellMgr->CheckSpellGroupStackRules(m_spellInfo, existingSpellInfo))
1702  {
1704  case SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST: // if it reaches this point, existing aura is lower/equal
1705  return false;
1707  if (sameCaster)
1708  return false;
1709  break;
1712  default:
1713  break;
1714  }
1715 
1716  if (m_spellInfo->SpellFamilyName != existingSpellInfo->SpellFamilyName)
1717  return true;
1718 
1719  if (!sameCaster)
1720  {
1721  // Channeled auras can stack if not forbidden by db or aura type
1722  if (existingAura->GetSpellInfo()->IsChanneled())
1723  return true;
1724 
1726  return true;
1727 
1728  // check same periodic auras
1729  for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
1730  {
1731  SpellEffectInfo const* effect = GetSpellEffectInfo(i);
1732  if (!effect)
1733  continue;
1734  switch (effect->ApplyAuraName)
1735  {
1736  // DOT or HOT from different casters will stack
1744  case SPELL_AURA_POWER_BURN:
1748  {
1749  SpellEffectInfo const* existingEffect = GetSpellEffectInfo(i);
1750  // periodic auras which target areas are not allowed to stack this way (replenishment for example)
1751  if (effect->IsTargetingArea() || (existingEffect && existingEffect->IsTargetingArea()))
1752  break;
1753  }
1754  return true;
1755  default:
1756  break;
1757  }
1758  }
1759  }
1760 
1761  if (HasEffectType(SPELL_AURA_CONTROL_VEHICLE) && existingAura->HasEffectType(SPELL_AURA_CONTROL_VEHICLE))
1762  {
1763  Vehicle* veh = NULL;
1764  if (GetOwner()->ToUnit())
1765  veh = GetOwner()->ToUnit()->GetVehicleKit();
1766 
1767  if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later
1768  return true;
1769 
1770  if (!veh->GetAvailableSeatCount())
1771  return false; // No empty seat available
1772 
1773  return true; // Empty seat available (skip rest)
1774  }
1775 
1776  // spell of same spell rank chain
1777  if (m_spellInfo->IsRankOf(existingSpellInfo))
1778  {
1779  // don't allow passive area auras to stack
1780  if (m_spellInfo->IsMultiSlotAura() && !IsArea())
1781  return true;
1782  if (!GetCastItemGUID().IsEmpty() && !existingAura->GetCastItemGUID().IsEmpty())
1783  if (GetCastItemGUID() != existingAura->GetCastItemGUID() && (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_ENCHANT_PROC)))
1784  return true;
1785  // same spell with same caster should not stack
1786  return false;
1787  }
1788 
1789  return true;
1790 }
Definition: SpellAuraDefines.h:68
Definition: SpellAuraDefines.h:63
bool IsPassive() const
Definition: SpellAuras.cpp:1026
Definition: Vehicle.h:32
Definition: SpellAuraDefines.h:287
Definition: SpellAuraDefines.h:222
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
Definition: SpellInfo.h:326
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:133
Definition: SpellAuraDefines.h:80
uint32 ApplyAuraName
Definition: SpellInfo.h:244
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SpellAuraDefines.h:549
#define sWorld
Definition: World.h:887
SpellEffectInfo const * GetSpellEffectInfo(uint32 index) const
Definition: SpellAuras.cpp:396
Definition: World.h:174
bool HasAura(uint32 difficulty, AuraType aura) const
Definition: SpellInfo.cpp:1193
bool IsMultiSlotAura() const
Definition: SpellInfo.cpp:1459
Definition: SpellInfo.h:184
bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:1645
Definition: SpellAuraDefines.h:296
Definition: SpellAuraDefines.h:83
uint32 SpellFamilyName
Definition: SpellInfo.h:396
Definition: SpellAuraDefines.h:286
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:462
bool IsAuraExclusiveBySpecificWith(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:1613
#define sSpellMgr
Definition: SpellMgr.h:756
Definition: SpellInfo.h:238
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
uint32_t uint32
Definition: Define.h:150
Definition: SpellMgr.h:340
Definition: SpellAuraDefines.h:124
uint8 GetAvailableSeatCount() const
Gets the available seat count.
Definition: Vehicle.cpp:641
bool HasEffectType(AuraType type) const
Definition: SpellAuras.cpp:1186
bool IsTargetingArea() const
Definition: SpellInfo.cpp:419
Definition: SpellAuraDefines.h:81
Definition: SpellAuraDefines.h:105
bool IsRankOf(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:2815
Definition: SpellAuraDefines.h:84
Definition: SpellMgr.h:339
bool IsArea() const
Definition: SpellAuras.cpp:1017
Definition: SharedDefines.h:471
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1026
Definition: SpellAuraDefines.h:113
AuraObjectType GetType() const
Definition: SpellAuras.cpp:456
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
SpellEffectInfoVector GetSpellEffectInfos() const
Definition: SpellAuras.h:290
bool IsDifferentRankOf(SpellInfo const *spellInfo) const
Definition: SpellInfo.cpp:2820
Unit * ToUnit()
Definition: Object.h:197
bool IsEmpty() const
Definition: ObjectGuid.h:242
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::CheckAreaTarget ( Unit target)
1651 {
1652  return CallScriptCheckAreaTargetHandlers(target);
1653 }
bool CallScriptCheckAreaTargetHandlers(Unit *target)
Definition: SpellAuras.cpp:1964

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Aura * Aura::Create ( SpellInfo const spellproto,
uint32  effMask,
WorldObject owner,
Unit caster,
int32 baseAmount,
Item castItem,
ObjectGuid  casterGUID,
int32  castItemLevel 
)
static
322 {
323  ASSERT(effMask);
324  ASSERT(spellproto);
325  ASSERT(owner);
326  ASSERT(caster || !casterGUID.IsEmpty());
327  ASSERT(effMask <= MAX_EFFECT_MASK);
328  // try to get caster of aura
329  if (!casterGUID.IsEmpty())
330  {
331  if (owner->GetGUID() == casterGUID)
332  caster = owner->ToUnit();
333  else
334  caster = ObjectAccessor::GetUnit(*owner, casterGUID);
335  }
336  else
337  casterGUID = caster->GetGUID();
338 
339  // check if aura can be owned by owner
340  if (owner->isType(TYPEMASK_UNIT))
341  if (!owner->IsInWorld() || ((Unit*)owner)->IsDuringRemoveFromWorld())
342  // owner not in world so don't allow to own not self cast single target auras
343  if (casterGUID != owner->GetGUID() && spellproto->IsSingleTarget())
344  return NULL;
345 
346  Aura* aura = NULL;
347  switch (owner->GetTypeId())
348  {
349  case TYPEID_UNIT:
350  case TYPEID_PLAYER:
351  aura = new UnitAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemLevel);
352  break;
354  aura = new DynObjAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemLevel);
355  break;
356  default:
357  ABORT();
358  return NULL;
359  }
360  // aura can be removed in Unit::_AddAura call
361  if (aura->IsRemoved())
362  return NULL;
363  return aura;
364 }
Definition: SpellAuras.h:350
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
bool isType(uint16 mask) const
Definition: Object.h:114
Definition: ObjectGuid.h:32
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: SpellAuras.h:329
Definition: ObjectGuid.h:49
TypeID GetTypeId() const
Definition: Object.h:113
bool IsRemoved() const
Definition: SpellAuras.h:201
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
#define ABORT
Definition: Errors.h:56
#define ASSERT
Definition: Errors.h:55
bool IsInWorld() const
Definition: Object.h:100
Definition: ObjectGuid.h:35
Definition: SpellAuras.h:116
Definition: Unit.h:1305
#define MAX_EFFECT_MASK
Definition: DBCStructure.h:1027
Unit * ToUnit()
Definition: Object.h:197
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Aura::DropCharge ( AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT)
inline
175 { return ModCharges(-1, removeMode); }
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: SpellAuras.cpp:887

+ Here is the caller graph for this function:

void Aura::DropChargeDelayed ( uint32  delay,
AuraRemoveMode  removeMode = AURA_REMOVE_BY_DEFAULT 
)
917 {
918  // aura is already during delayed charge drop
919  if (m_dropEvent)
920  return;
921  // only units have events
922  Unit* owner = m_owner->ToUnit();
923  if (!owner)
924  return;
925 
926  m_dropEvent = new ChargeDropEvent(this, removeMode);
927  owner->m_Events.AddEvent(m_dropEvent, owner->m_Events.CalculateTime(delay));
928 }
EventProcessor m_Events
Definition: Unit.h:1948
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.cpp:88
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:320
Definition: SpellAuras.h:361
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:95
WorldObject *const m_owner
Definition: SpellAuras.h:301
Definition: Unit.h:1305
Unit * ToUnit()
Definition: Object.h:197

+ Here is the call graph for this function:

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

Implemented in DynObjAura, and UnitAura.

+ Here is the caller graph for this function:

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.
1145 {
1146  AuraKey key;
1147  key.Caster = GetCasterGUID();
1148  key.Item = GetCastItemGUID();
1149  key.SpellId = GetId();
1150  key.EffectMask = 0;
1151  recalculateMask = 0;
1152  for (uint32 i = 0; i < _effects.size(); ++i)
1153  {
1154  if (AuraEffect const* effect = _effects[i])
1155  {
1156  key.EffectMask |= 1 << i;
1157  if (effect->CanBeRecalculated())
1158  recalculateMask |= 1 << i;
1159  }
1160  }
1161 
1162  return key;
1163 }
ObjectGuid Item
Definition: SpellAuras.h:99
Definition: SpellAuraEffects.h:30
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:133
uint32 EffectMask
Definition: SpellAuras.h:101
AuraEffectVector _effects
Definition: SpellAuras.h:325
uint32_t uint32
Definition: Define.h:150
ObjectGuid Caster
Definition: SpellAuras.h:98
uint32 SpellId
Definition: SpellAuras.h:100
Definition: SpellAuras.h:96
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
uint32 GetId() const
Definition: SpellAuras.h:131

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Aura::GetApplicationList ( Unit::AuraApplicationList applicationList) const
1223 {
1224  for (Aura::ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
1225  {
1226  if (appIter->second->GetEffectMask())
1227  applicationList.push_back(appIter->second);
1228  }
1229 }
ApplicationMap m_applications
Definition: SpellAuras.h:314

+ Here is the caller graph for this function:

ApplicationMap const& Aura::GetApplicationMap ( )
inline
231 { return m_applications; }
ApplicationMap m_applications
Definition: SpellAuras.h:314

+ Here is the caller graph for this function:

const AuraApplication* Aura::GetApplicationOfTarget ( ObjectGuid  guid) const
inline
233 { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
arena_t NULL
Definition: jemalloc_internal.h:624
ApplicationMap m_applications
Definition: SpellAuras.h:314

+ Here is the caller graph for this function:

AuraApplication* Aura::GetApplicationOfTarget ( ObjectGuid  guid)
inline
234 { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
arena_t NULL
Definition: jemalloc_internal.h:624
ApplicationMap m_applications
Definition: SpellAuras.h:314
time_t Aura::GetApplyTime ( ) const
inline
158 { return m_applyTime; }
time_t const m_applyTime
Definition: SpellAuras.h:300

+ Here is the caller graph for this function:

AuraEffectVector Aura::GetAuraEffects ( ) const
inline
288 { return _effects; }
AuraEffectVector _effects
Definition: SpellAuras.h:325

+ Here is the caller graph for this function:

Unit * Aura::GetCaster ( ) const
439 {
440  if (GetOwner()->GetGUID() == GetCasterGUID())
441  return GetUnitOwner();
443  return aurApp->GetTarget();
444 
446 }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: SpellAuras.h:50
Unit * GetUnitOwner() const
Definition: SpellAuras.h:138
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:233
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ObjectGuid Aura::GetCasterGUID ( ) const
inline
135 { return m_casterGuid; }
ObjectGuid const m_casterGuid
Definition: SpellAuras.h:297

+ Here is the caller graph for this function:

uint8 Aura::GetCasterLevel ( ) const
inline
185 { return m_casterLevel; }
uint8 const m_casterLevel
Definition: SpellAuras.h:309

+ Here is the caller graph for this function:

ObjectGuid Aura::GetCastItemGUID ( ) const
inline
133 { return m_castItemGuid; }
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:298

+ Here is the caller graph for this function:

int32 Aura::GetCastItemLevel ( ) const
inline
134 { return m_castItemLevel; }
int32 m_castItemLevel
Definition: SpellAuras.h:299

+ Here is the caller graph for this function:

uint8 Aura::GetCharges ( ) const
inline
170 { return m_procCharges; }
uint8 m_procCharges
Definition: SpellAuras.h:310

+ Here is the caller graph for this function:

int32 Aura::GetDuration ( ) const
inline
163 { return m_duration; }
int32 m_duration
Definition: SpellAuras.h:304

+ Here is the caller graph for this function:

DynamicObject* Aura::GetDynobjOwner ( ) const
inline
Definition: SpellAuraDefines.h:549
Definition: DynamicObject.h:35
WorldObject *const m_owner
Definition: SpellAuras.h:301
#define ASSERT
Definition: Errors.h:55
AuraObjectType GetType() const
Definition: SpellAuras.cpp:456

+ Here is the caller graph for this function:

AuraEffect * Aura::GetEffect ( uint32  index) const
449 {
450  if (index >= _effects.size())
451  return nullptr;
452 
453  return _effects[index];
454 }
AuraEffectVector _effects
Definition: SpellAuras.h:325

+ Here is the caller graph for this function:

uint32 Aura::GetEffectMask ( ) const
1214 {
1215  uint32 effMask = 0;
1216  for (AuraEffect* effect : GetAuraEffects())
1217  if (effect)
1218  effMask |= 1 << effect->GetEffIndex();
1219  return effMask;
1220 }
Definition: SpellAuraEffects.h:30
AuraEffectVector GetAuraEffects() const
Definition: SpellAuras.h:288
uint32_t uint32
Definition: Define.h:150

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 Aura::GetId ( void  ) const
inline
131 { return GetSpellInfo()->Id; }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
uint32 Id
Definition: SpellInfo.h:329

+ Here is the caller graph for this function:

int32 Aura::GetMaxDuration ( ) const
inline
159 { return m_maxDuration; }
int32 m_maxDuration
Definition: SpellAuras.h:303

+ Here is the caller graph for this function:

WorldObject* Aura::GetOwner ( ) const
inline
137 { return m_owner; }
WorldObject *const m_owner
Definition: SpellAuras.h:301

+ Here is the caller graph for this function:

AuraScript * Aura::GetScriptByName ( std::string const scriptName) const
389 {
390  for (std::list<AuraScript*>::const_iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
391  if ((*itr)->_GetScriptName()->compare(scriptName) == 0)
392  return *itr;
393  return NULL;
394 }
arena_t NULL
Definition: jemalloc_internal.h:624
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286
SpellEffectInfo const * Aura::GetSpellEffectInfo ( uint32  index) const
397 {
398  if (index >= _spelEffectInfos.size())
399  return nullptr;
400 
401  return _spelEffectInfos[index];
402 }
SpellEffectInfoVector _spelEffectInfos
Definition: SpellAuras.h:326

+ Here is the caller graph for this function:

SpellEffectInfoVector Aura::GetSpellEffectInfos ( ) const
inline
290 { return _spelEffectInfos; }
SpellEffectInfoVector _spelEffectInfos
Definition: SpellAuras.h:326

+ Here is the caller graph for this function:

SpellInfo const* Aura::GetSpellInfo ( ) const
inline
130 { return m_spellInfo; }
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296

+ Here is the caller graph for this function:

uint8 Aura::GetStackAmount ( ) const
inline
179 { return m_stackAmount; }
uint8 m_stackAmount
Definition: SpellAuras.h:311

+ Here is the caller graph for this function:

AuraObjectType Aura::GetType ( ) const
457 {
459 }
Definition: SpellAuraDefines.h:549
TypeID GetTypeId() const
Definition: Object.h:113
WorldObject *const m_owner
Definition: SpellAuras.h:301
Definition: SpellAuraDefines.h:548
Definition: ObjectGuid.h:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Unit* Aura::GetUnitOwner ( ) const
inline
138 { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
WorldObject *const m_owner
Definition: SpellAuras.h:301
#define ASSERT
Definition: Errors.h:55
Definition: SpellAuraDefines.h:548
AuraObjectType GetType() const
Definition: SpellAuras.cpp:456
Definition: Unit.h:1305

+ Here is the caller graph for this function:

void Aura::HandleAllEffects ( AuraApplication aurApp,
uint8  mode,
bool  apply 
)
1206 {
1207  ASSERT (!IsRemoved());
1208  for (AuraEffect* effect : GetAuraEffects())
1209  if (effect && !IsRemoved())
1210  effect->HandleEffect(aurApp, mode, apply);
1211 }
Definition: SpellAuraEffects.h:30
void apply(T *val)
Definition: ByteConverter.h:41
AuraEffectVector GetAuraEffects() const
Definition: SpellAuras.h:288
bool IsRemoved() const
Definition: SpellAuras.h:201
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

void Aura::HandleAuraSpecificMods ( AuraApplication const aurApp,
Unit caster,
bool  apply,
bool  onReapply 
)
1239 {
1240  Unit* target = aurApp->GetTarget();
1241  AuraRemoveMode removeMode = aurApp->GetRemoveMode();
1242  // handle spell_area table
1243  SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAuraMapBounds(GetId());
1244  if (saBounds.first != saBounds.second)
1245  {
1246  uint32 zone, area;
1247  target->GetZoneAndAreaId(zone, area);
1248 
1249  for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
1250  {
1251  // some auras remove at aura remove
1252  if (!itr->second->IsFitToRequirements(target->ToPlayer(), zone, area))
1253  target->RemoveAurasDueToSpell(itr->second->spellId);
1254  // some auras applied at aura apply
1255  else if (itr->second->autocast)
1256  {
1257  if (!target->HasAura(itr->second->spellId))
1258  target->CastSpell(target, itr->second->spellId, true);
1259  }
1260  }
1261  }
1262 
1263  // handle spell_linked_spell table
1264  if (!onReapply)
1265  {
1266  // apply linked auras
1267  if (apply)
1268  {
1269  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1270  {
1271  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1272  {
1273  if (*itr < 0)
1274  target->ApplySpellImmune(GetId(), IMMUNITY_ID, -(*itr), true);
1275  else if (caster)
1276  caster->AddAura(*itr, target);
1277  }
1278  }
1279  }
1280  else
1281  {
1282  // remove linked auras
1283  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(-(int32)GetId()))
1284  {
1285  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1286  {
1287  if (*itr < 0)
1288  target->RemoveAurasDueToSpell(-(*itr));
1289  else if (removeMode != AURA_REMOVE_BY_DEATH)
1290  target->CastSpell(target, *itr, true, NULL, NULL, GetCasterGUID());
1291  }
1292  }
1293  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1294  {
1295  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1296  {
1297  if (*itr < 0)
1298  target->ApplySpellImmune(GetId(), IMMUNITY_ID, -(*itr), false);
1299  else
1300  target->RemoveAura(*itr, GetCasterGUID(), 0, removeMode);
1301  }
1302  }
1303  }
1304  }
1305  else if (apply)
1306  {
1307  // modify stack amount of linked auras
1308  if (std::vector<int32> const* spellTriggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
1309  {
1310  for (std::vector<int32>::const_iterator itr = spellTriggered->begin(); itr != spellTriggered->end(); ++itr)
1311  if (*itr > 0)
1312  if (Aura* triggeredAura = target->GetAura(*itr, GetCasterGUID()))
1313  triggeredAura->ModStackAmount(GetStackAmount() - triggeredAura->GetStackAmount());
1314  }
1315  }
1316 
1317  // mods at aura apply
1318  if (apply)
1319  {
1320  switch (GetSpellInfo()->SpellFamilyName)
1321  {
1322  case SPELLFAMILY_GENERIC:
1323  switch (GetId())
1324  {
1325  case 32474: // Buffeting Winds of Susurrus
1326  if (target->GetTypeId() == TYPEID_PLAYER)
1327  target->ToPlayer()->ActivateTaxiPathTo(506, GetId());
1328  break;
1329  case 33572: // Gronn Lord's Grasp, becomes stoned
1330  if (GetStackAmount() >= 5 && !target->HasAura(33652))
1331  target->CastSpell(target, 33652, true);
1332  break;
1333  case 50836: //Petrifying Grip, becomes stoned
1334  if (GetStackAmount() >= 5 && !target->HasAura(50812))
1335  target->CastSpell(target, 50812, true);
1336  break;
1337  case 60970: // Heroic Fury (remove Intercept cooldown)
1338  if (target->GetTypeId() == TYPEID_PLAYER)
1339  target->GetSpellHistory()->ResetCooldown(20252, true);
1340  break;
1341  }
1342  break;
1343  case SPELLFAMILY_DRUID:
1344  if (!caster)
1345  break;
1346  // Rejuvenation
1347  if (GetSpellInfo()->SpellFamilyFlags[0] & 0x10 && GetEffect(EFFECT_0))
1348  {
1349  // Druid T8 Restoration 4P Bonus
1350  if (caster->HasAura(64760))
1351  {
1352  int32 heal = GetEffect(EFFECT_0)->GetAmount();
1353  caster->CastCustomSpell(target, 64801, &heal, NULL, NULL, true, NULL, GetEffect(EFFECT_0));
1354  }
1355  }
1356  break;
1357  case SPELLFAMILY_MAGE:
1358  if (!caster)
1359  break;
1360  switch (GetId())
1361  {
1362  case 12536: // Clearcasting
1363  case 12043: // Presence of Mind
1364  // Arcane Potency
1365  if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, 2120, 0))
1366  {
1367  uint32 spellId = 0;
1368 
1369  switch (aurEff->GetId())
1370  {
1371  case 31571: spellId = 57529; break;
1372  case 31572: spellId = 57531; break;
1373  default:
1374  TC_LOG_ERROR("spells", "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
1375  }
1376  if (spellId)
1377  caster->CastSpell(caster, spellId, true);
1378  }
1379  break;
1380  default:
1381  break;
1382  }
1383  break;
1384  case SPELLFAMILY_PRIEST:
1385  if (!caster)
1386  break;
1387  // Devouring Plague
1388  if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0))
1389  {
1390  // Improved Devouring Plague
1391  if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 0))
1392  {
1393  uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT, GetEffect(0)->GetSpellEffectInfo());
1394  damage *= caster->SpellDamagePctDone(target, GetSpellInfo(), SPELL_DIRECT_DAMAGE);
1395  damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetEffect(0)->GetSpellEffectInfo());
1396  int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100;
1397  int32 heal = int32(CalculatePct(basepoints0, 15));
1398 
1399  caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
1400  caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
1401  }
1402  }
1403  // Power Word: Shield
1404  else if (m_spellInfo->SpellFamilyFlags[0] & 0x1 && m_spellInfo->SpellFamilyFlags[2] & 0x400 && GetEffect(0))
1405  {
1406  // Glyph of Power Word: Shield
1407  if (AuraEffect* glyph = caster->GetAuraEffect(55672, 0))
1408  {
1409  // instantly heal m_amount% of the absorb-value
1410  int32 heal = glyph->GetAmount() * GetEffect(0)->GetAmount()/100;
1411  caster->CastCustomSpell(GetUnitOwner(), 56160, &heal, nullptr, nullptr, true, nullptr, GetEffect(0));
1412  }
1413  }
1414  break;
1415  case SPELLFAMILY_ROGUE:
1416  // Sprint (skip non player cast spells by category)
1417  if (GetSpellInfo()->SpellFamilyFlags[0] & 0x40 && GetSpellInfo()->GetCategory() == 44)
1418  // in official maybe there is only one icon?
1419  if (target->HasAura(58039)) // Glyph of Blurred Speed
1420  target->CastSpell(target, 61922, true); // Sprint (waterwalk)
1421  break;
1422  }
1423  }
1424  // mods at aura remove
1425  else
1426  {
1427  switch (GetSpellInfo()->SpellFamilyName)
1428  {
1429  case SPELLFAMILY_GENERIC:
1430  switch (GetId())
1431  {
1432  case 61987: // Avenging Wrath
1433  // Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
1434  if (target->HasAura(61988) && !target->HasAura(25771))
1435  target->RemoveAura(61988);
1436  break;
1437  default:
1438  break;
1439  }
1440  break;
1441  case SPELLFAMILY_MAGE:
1442  switch (GetId())
1443  {
1444  case 66: // Invisibility
1445  if (removeMode != AURA_REMOVE_BY_EXPIRE)
1446  break;
1447  target->CastSpell(target, 32612, true, NULL, GetEffect(1));
1448  target->CombatStop();
1449  break;
1450  default:
1451  break;
1452  }
1453  break;
1454  case SPELLFAMILY_WARLOCK:
1455  if (!caster)
1456  break;
1457  // Improved Fear
1458  if (GetSpellInfo()->SpellFamilyFlags[1] & 0x00000400)
1459  {