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

#include <SpellAuraEffects.h>

Public Member Functions

 ~AuraEffect ()
 
 AuraEffect (Aura *base, uint32 effIndex, int32 *baseAmount, Unit *caster)
 
UnitGetCaster () const
 
ObjectGuid GetCasterGUID () const
 
AuraGetBase () const
 
void GetTargetList (std::list< Unit * > &targetList) const
 
void GetApplicationList (std::list< AuraApplication * > &applicationList) const
 
SpellModifierGetSpellModifier () const
 
SpellInfo constGetSpellInfo () const
 
uint32 GetId () const
 
uint32 GetEffIndex () const
 
int32 GetBaseAmount () const
 
int32 GetPeriod () const
 
int32 GetMiscValueB () const
 
int32 GetMiscValue () const
 
AuraType GetAuraType () const
 
int32 GetAmount () const
 
void SetAmount (int32 amount)
 
int32 GetPeriodicTimer () const
 
void SetPeriodicTimer (int32 periodicTimer)
 
int32 CalculateAmount (Unit *caster)
 
void CalculatePeriodic (Unit *caster, bool resetPeriodicTimer=true, bool load=false)
 
void CalculateSpellMod ()
 
void ChangeAmount (int32 newAmount, bool mark=true, bool onStackOrReapply=false)
 
void RecalculateAmount ()
 
void RecalculateAmount (Unit *caster)
 
bool CanBeRecalculated () const
 
void SetCanBeRecalculated (bool val)
 
void HandleEffect (AuraApplication *aurApp, uint8 mode, bool apply)
 
void HandleEffect (Unit *target, uint8 mode, bool apply)
 
void ApplySpellMod (Unit *target, bool apply)
 
void SetDamage (int32 val)
 
int32 GetDamage () const
 
void SetCritChance (float val)
 
float GetCritChance () const
 
void SetDonePct (float val)
 
float GetDonePct () const
 
void Update (uint32 diff, Unit *caster)
 
void UpdatePeriodic (Unit *caster)
 
uint32 GetTickNumber () const
 
int32 GetTotalTicks () const
 
void ResetPeriodic (bool resetPeriodicTimer=false)
 
bool IsPeriodic () const
 
void SetPeriodic (bool isPeriodic)
 
bool IsAffectingSpell (SpellInfo const *spell) const
 
bool HasSpellClassMask () const
 
void SendTickImmune (Unit *target, Unit *caster) const
 
void PeriodicTick (AuraApplication *aurApp, Unit *caster) const
 
void HandleProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void CleanupTriggeredSpells (Unit *target)
 
void HandleShapeshiftBoosts (Unit *target, bool apply) const
 
SpellEffectInfo constGetSpellEffectInfo () const
 
bool IsEffect () const
 
bool IsEffect (SpellEffectName effectName) const
 
bool IsAreaAuraEffect () const
 
void HandleNULL (AuraApplication const *, uint8, bool) const
 
void HandleUnused (AuraApplication const *, uint8, bool) const
 
void HandleNoImmediateEffect (AuraApplication const *, uint8, bool) const
 
void HandleModInvisibilityDetect (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModInvisibility (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModStealth (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModStealthLevel (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModStealthDetect (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleSpiritOfRedemption (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraGhost (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePhase (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePhaseGroup (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModShapeshift (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTransform (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModScale (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraCloneCaster (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleFeignDeath (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModUnattackable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDisarm (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSilence (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPacify (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPacifyAndSilence (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraAllowOnlyAbility (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackResources (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackCreatures (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackStealthed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStalked (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraUntrackable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPetTalentsPoints (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSkill (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraMounted (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraAllowFlight (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraWaterWalk (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraFeatherFall (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraHover (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleWaterBreathing (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleForceMoveForward (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModThreat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModTotalThreat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTaunt (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModConfuse (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModFear (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStun (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRoot (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePreventFleeing (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPossess (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPossessPet (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModCharm (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleCharmConvert (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraControlVehicle (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseMountedSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseFlightSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseSwimSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDecreaseSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModUseNormalSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModStateImmunityMask (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMechanicImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModEffectImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStateImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSchoolImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDmgImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDispelImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistanceExclusive (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModBaseResistancePCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModResistancePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModBaseResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTargetResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPercentStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellDamagePercentFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHealingPercentFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellDamagePercentFromAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHealingPercentFromAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModHealingDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTotalPercentStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistenceOfStatPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModExpertise (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModStatBonusPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleOverrideSpellPowerByAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleOverrideAttackPowerBySpellPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerRegen (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerRegenPCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModManaRegen (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseHealth (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseMaxHealth (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseEnergy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseEnergyPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseHealthPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraIncreaseBaseHealthPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseBaseManaPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModParryPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDodgePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModBlockPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRegenInterrupt (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModWeaponCritPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModHitChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHitChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCritChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCritChanceShool (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModCritPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModCastingSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMeleeRangedSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModCombatSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModAttackSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMeleeSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedHaste (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModRating (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModRatingFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPowerPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedAttackPowerPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPowerOfArmor (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModDamageDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModDamagePercentDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModOffhandDamagePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleShieldBlockValue (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerCostPCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerCost (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleArenaPreparation (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleNoReagentUseAura (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraRetainComboPoints (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraDummy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleChannelDeathItem (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleBindSight (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleForceReaction (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraEmpathy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModFaction (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleComprehendLanguage (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraConvertRune (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraLinked (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraOpenStable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModFakeInebriation (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraOverrideSpells (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraSetVehicle (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePreventResurrection (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleMastery (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraForceWeather (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleEnableAltPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCategoryCooldown (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePeriodicDummyAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicTriggerSpellAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicTriggerSpellWithValueAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicDamageAurasTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealthLeechAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealthFunnelAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealAurasTick (Unit *target, Unit *caster) const
 
void HandlePeriodicManaLeechAuraTick (Unit *target, Unit *caster) const
 
void HandleObsModPowerAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicEnergizeAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicPowerBurnAuraTick (Unit *target, Unit *caster) const
 
void HandleProcTriggerSpellAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellWithValueAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerDamageAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleRaidProcFromChargeAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleRaidProcFromChargeWithValueAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellOnPowerAmountAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 

Private Member Functions

friend Aura::~Aura ()
 
bool CanPeriodicTickCrit (Unit const *caster) const
 

Private Attributes

Aura *const m_base
 
SpellInfo const *const m_spellInfo
 
SpellEffectInfo const_effectInfo
 
int32 const m_baseAmount
 
int32 m_amount
 
int32 m_damage
 
float m_critChance
 
float m_donePct
 
SpellModifierm_spellmod
 
int32 m_periodicTimer
 
int32 m_period
 
uint32 m_tickNumber
 
uint8 const m_effIndex
 
bool m_canBeRecalculated
 
bool m_isPeriodic
 

Friends

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

Constructor & Destructor Documentation

AuraEffect::Aura::~Aura ( )
private
AuraEffect::~AuraEffect ( )
564 {
565  delete m_spellmod;
566 }
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
AuraEffect::AuraEffect ( Aura base,
uint32  effIndex,
int32 baseAmount,
Unit caster 
)
548  :
549 m_base(base), m_spellInfo(base->GetSpellInfo()),
550 _effectInfo(base->GetSpellEffectInfo(effIndex)),
551 m_baseAmount(baseAmount ? *baseAmount : base->GetSpellEffectInfo(effIndex)->BasePoints),
552 m_damage(0), m_critChance(0.0f), m_donePct(1.0f),
554 m_canBeRecalculated(true), m_isPeriodic(false)
555 {
556  CalculatePeriodic(caster, true, false);
557 
558  m_amount = CalculateAmount(caster);
559 
561 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
void CalculatePeriodic(Unit *caster, bool resetPeriodicTimer=true, bool load=false)
Definition: SpellAuraEffects.cpp:728
int32 m_amount
Definition: SpellAuraEffects.h:115
arena_t NULL
Definition: jemalloc_internal.h:624
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
int32 m_periodicTimer
Definition: SpellAuraEffects.h:122
SpellEffectInfo const * GetSpellEffectInfo(uint32 index) const
Definition: SpellAuras.cpp:396
SpellEffectInfo const * _effectInfo
Definition: SpellAuraEffects.h:112
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:127
int32 m_damage
Definition: SpellAuraEffects.h:116
bool m_isPeriodic
Definition: SpellAuraEffects.h:128
uint32 m_tickNumber
Definition: SpellAuraEffects.h:124
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:804
float m_critChance
Definition: SpellAuraEffects.h:117
Aura *const m_base
Definition: SpellAuraEffects.h:109
float m_donePct
Definition: SpellAuraEffects.h:118
uint8 const m_effIndex
Definition: SpellAuraEffects.h:126
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
int32 BasePoints
Definition: SpellInfo.h:248
int32 CalculateAmount(Unit *caster)
Definition: SpellAuraEffects.cpp:589
int32 const m_baseAmount
Definition: SpellAuraEffects.h:113

+ Here is the call graph for this function:

Member Function Documentation

void AuraEffect::ApplySpellMod ( Unit target,
bool  apply 
)
913 {
914  if (!m_spellmod || target->GetTypeId() != TYPEID_PLAYER)
915  return;
916 
917  target->ToPlayer()->AddSpellMod(m_spellmod, apply);
918 
919  // Auras with charges do not mod amount of passive auras
920  if (GetBase()->IsUsingCharges())
921  return;
922  // reapply some passive spells after add/remove related spellmods
923  // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
924  switch (GetMiscValue())
925  {
927  case SPELLMOD_EFFECT1:
928  case SPELLMOD_EFFECT2:
929  case SPELLMOD_EFFECT3:
930  case SPELLMOD_EFFECT4:
931  case SPELLMOD_EFFECT5:
932  {
933  ObjectGuid guid = target->GetGUID();
934  Unit::AuraApplicationMap & auras = target->GetAppliedAuras();
935  for (Unit::AuraApplicationMap::iterator iter = auras.begin(); iter != auras.end(); ++iter)
936  {
937  Aura* aura = iter->second->GetBase();
938  // only passive and permament auras-active auras should have amount set on spellcast and not be affected
939  // if aura is cast by others, it will not be affected
940  if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
941  {
943  {
944  for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
945  {
946  if (AuraEffect* aurEff = aura->GetEffect(i))
947  aurEff->RecalculateAmount();
948  }
949  }
950  else if (GetMiscValue() == SPELLMOD_EFFECT1)
951  {
952  if (AuraEffect* aurEff = aura->GetEffect(0))
953  aurEff->RecalculateAmount();
954  }
955  else if (GetMiscValue() == SPELLMOD_EFFECT2)
956  {
957  if (AuraEffect* aurEff = aura->GetEffect(1))
958  aurEff->RecalculateAmount();
959  }
960  else if (GetMiscValue() == SPELLMOD_EFFECT3)
961  {
962  if (AuraEffect* aurEff = aura->GetEffect(2))
963  aurEff->RecalculateAmount();
964  }
965  else if (GetMiscValue() == SPELLMOD_EFFECT4)
966  {
967  if (AuraEffect* aurEff = aura->GetEffect(3))
968  aurEff->RecalculateAmount();
969  }
970  else if (GetMiscValue() == SPELLMOD_EFFECT5)
971  {
972  if (AuraEffect* aurEff = aura->GetEffect(4))
973  aurEff->RecalculateAmount();
974  }
975  }
976  }
977  }
978  default:
979  break;
980  }
981 }
Definition: SpellAuraEffects.h:30
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
bool IsPassive() const
Definition: SpellAuras.cpp:1026
Definition: Unit.h:89
Definition: Unit.h:118
Definition: Unit.h:98
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
Definition: Unit.h:94
bool IsPermanent() const
Definition: SpellAuras.h:168
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
void apply(T *val)
Definition: ByteConverter.h:41
Player * ToPlayer()
Definition: Object.h:191
Definition: Unit.h:109
TypeID GetTypeId() const
Definition: Object.h:113
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:448
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1789
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
uint8_t uint8
Definition: Define.h:152
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1026
Definition: ObjectGuid.h:189
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:1315
Definition: SpellAuras.h:116
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
Definition: Unit.h:119
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition: SpellInfo.cpp:1545

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 AuraEffect::CalculateAmount ( Unit caster)
590 {
591  // default amount calculation
592  int32 amount = 0;
593 
595  amount = GetSpellEffectInfo()->CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit(), nullptr, GetBase()->GetCastItemLevel());
596  else if (caster && caster->GetTypeId() == TYPEID_PLAYER)
598 
599  // check item enchant aura cast
600  if (!amount && caster)
601  {
602  ObjectGuid itemGUID = GetBase()->GetCastItemGUID();
603  if (!itemGUID.IsEmpty())
604  {
605  if (Player* playerCaster = caster->ToPlayer())
606  {
607  if (Item* castItem = playerCaster->GetItemByGuid(itemGUID))
608  {
609  if (castItem->GetItemSuffixFactor())
610  {
611  ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()));
612  if (item_rand_suffix)
613  {
614  for (int k = 0; k < MAX_ITEM_RANDOM_PROPERTIES; k++)
615  {
616  SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]);
617  if (pEnchant)
618  {
619  for (int t = 0; t < MAX_ITEM_ENCHANTMENT_EFFECTS; t++)
620  {
621  if (pEnchant->EffectSpellID[t] == m_spellInfo->Id)
622  {
623  amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
624  break;
625  }
626  }
627  }
628 
629  if (amount)
630  break;
631  }
632  }
633  }
634  }
635  }
636  }
637  }
638 
639  // custom amount calculations go here
640  switch (GetAuraType())
641  {
642  // crowd control auras
644  case SPELL_AURA_MOD_FEAR:
645  case SPELL_AURA_MOD_STUN:
646  case SPELL_AURA_MOD_ROOT:
648  m_canBeRecalculated = false;
649  if (!m_spellInfo->ProcFlags)
650  break;
651  amount = int32(GetBase()->GetUnitOwner()->CountPctFromMaxHealth(10));
652  if (caster)
653  {
654  // Glyphs increasing damage cap
655  Unit::AuraEffectList const& overrideClassScripts = caster->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
656  for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
657  {
658  if ((*itr)->IsAffectingSpell(m_spellInfo))
659  {
660  // Glyph of Frost nova and similar auras
661  if ((*itr)->GetMiscValue() == 7801)
662  {
663  AddPct(amount, (*itr)->GetAmount());
664  break;
665  }
666  }
667  }
668  }
669  break;
672  m_canBeRecalculated = false;
673  break;
674  case SPELL_AURA_MOUNTED:
675  {
676  uint32 mountType = uint32(GetMiscValueB());
677  if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId()))
678  mountType = mountEntry->MountTypeId;
679 
680  if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(mountType))
681  {
682  amount = mountCapability->ID;
683  m_canBeRecalculated = false;
684  }
685  break;
686  }
688  {
689  if (caster)
690  {
691  // if Level <= 70 resist = player level
692  int32 resist = caster->getLevel();
693 
694  if (resist > 70 && resist < 81)
695  resist += (resist - 70) * 5;
696  else if (resist > 80)
697  resist += ((resist-70) * 5 + (resist - 80) * 7);
698 
699  switch (GetId())
700  {
701  case 20043: // Aspect of the Wild
702  case 8185: // Elemental Resistance
703  case 19891: // Resistance Aura
704  case 79106: // Shadow Protection
705  case 79107: // Shadow Protection
706  amount = resist;
707  break;
708  case 79060: // Mark of the Wild
709  case 79061: // Mark of the Wild
710  case 79062: // Blessing of Kings
711  case 79063: // Blessing of Kings
712  case 90363: // Embrace of the Shale Spider
713  amount = resist / 2;
714  break;
715  }
716  break;
717  }
718  }
719  default:
720  break;
721  }
722 
724  amount *= GetBase()->GetStackAmount();
725  return amount;
726 }
G3D::Matrix abs(const G3D::Matrix &M)
Definition: Matrix.h:632
#define sDB2Manager
Definition: DB2Stores.h:224
uint32 Id
Definition: SpellInfo.h:329
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
Definition: SpellAuraDefines.h:72
DB2Storage< ItemRandomSuffixEntry > sItemRandomSuffixStore("ItemRandomSuffix.db2", ItemRandomSuffixFormat, HOTFIX_SEL_ITEM_RANDOM_SUFFIX)
uint32 GetId() const
Definition: SpellAuraEffects.h:47
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:133
Definition: SpellAuraDefines.h:203
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition: DBCStructure.h:1212
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1322
Definition: SpellAuraDefines.h:67
Definition: SharedDefines.h:673
Unit * GetUnitOwner() const
Definition: SpellAuras.h:138
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
int32 GetMiscValueB() const
Definition: SpellAuraEffects.h:52
Definition: SpellAuraDefines.h:86
Definition: DBCStructure.h:1214
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:127
Player * ToPlayer()
Definition: Object.h:191
uint8 getLevel() const
Definition: Unit.h:1408
Definition: SpellAuraDefines.h:116
uint32 ProcFlags
Definition: SpellInfo.h:370
TypeID GetTypeId() const
Definition: Object.h:113
Definition: UpdateFields.h:235
Definition: SpellAuraDefines.h:172
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:462
uint32 Enchantment[MAX_ITEM_RANDOM_PROPERTIES]
Definition: DB2Structure.h:784
Definition: Item.h:259
float GetFloatValue(uint16 index) const
Definition: Object.cpp:312
int32_t int32
Definition: Define.h:146
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1832
uint32_t uint32
Definition: Define.h:150
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
Definition: DB2Structure.h:779
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: SpellAuras.cpp:2106
float BonusCoefficient
Definition: SpellInfo.h:252
Definition: SpellAuraDefines.h:157
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
Definition: Unit.cpp:9773
int32 CalcValue(Unit const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:455
Definition: ObjectGuid.h:33
uint32 EffectSpellID[MAX_ITEM_ENCHANTMENT_EFFECTS]
Definition: DBCStructure.h:1220
uint8 GetStackAmount() const
Definition: SpellAuras.h:179
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
T AddPct(T &base, U pct)
Definition: Util.h:98
int32_t int32
Definition: g3dmath.h:167
Definition: ObjectGuid.h:189
uint32_t uint32
Definition: g3dmath.h:168
Definition: DB2Structure.h:927
#define MAX_ITEM_RANDOM_PROPERTIES
Definition: DB2Structure.h:769
int32 const m_baseAmount
Definition: SpellAuraEffects.h:113
Definition: SpellAuraDefines.h:65
Definition: SpellAuraDefines.h:129
bool fuzzyEq(double a, double b)
Definition: g3dmath.h:857
Definition: DB2Structure.h:913
uint32 AllocationPct[MAX_ITEM_RANDOM_PROPERTIES]
Definition: DB2Structure.h:785
bool IsEmpty() const
Definition: ObjectGuid.h:242
Definition: SpellAuraDefines.h:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AuraEffect::CalculatePeriodic ( Unit caster,
bool  resetPeriodicTimer = true,
bool  load = false 
)
729 {
731 
732  // prepare periodics
733  switch (GetAuraType())
734  {
736  // 3 spells have no amplitude set
737  if (!m_period)
751  m_isPeriodic = true;
752  break;
753  default:
754  break;
755  }
756 
758 
759  if (!m_isPeriodic)
760  return;
761 
762  Player* modOwner = caster ? caster->GetSpellModOwner() : NULL;
763 
764  // Apply casting time mods
765  if (m_period)
766  {
767  // Apply periodic time mod
768  if (modOwner)
769  modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, m_period);
770 
771  if (caster)
772  {
773  // Haste modifies periodic time of channeled spells
774  if (m_spellInfo->IsChanneled())
778  }
779  }
780 
781  if (load) // aura loaded from db
782  {
786  ++m_tickNumber;
787  }
788  else // aura just created or reapplied
789  {
790  m_tickNumber = 0;
791  // reset periodic timer on aura create or on reapply when aura isn't dot
792  // possibly we should not reset periodic timers only when aura is triggered by proc
793  // or maybe there's a spell attribute somewhere
794  if (resetPeriodicTimer)
795  {
796  m_periodicTimer = 0;
797  // Start periodic on next tick or at aura apply
800  }
801  }
802 }
Definition: SharedDefines.h:549
Definition: SpellAuraDefines.h:68
Definition: SpellAuraDefines.h:63
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
Definition: SpellAuraDefines.h:287
Definition: SpellAuraDefines.h:222
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition: SpellAuras.cpp:2120
bool IsChanneled() const
Definition: SpellInfo.cpp:1514
void ModSpellDurationTime(SpellInfo const *spellProto, int32 &castTime, Spell *spell=NULL)
Definition: Unit.cpp:11067
uint32 GetId() const
Definition: SpellAuraEffects.h:47
Definition: SpellAuraDefines.h:80
Definition: UpdateFields.h:129
arena_t NULL
Definition: jemalloc_internal.h:624
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
int32 m_periodicTimer
Definition: SpellAuraEffects.h:122
Definition: SharedDefines.h:545
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
bool m_isPeriodic
Definition: SpellAuraEffects.h:128
uint32 m_tickNumber
Definition: SpellAuraEffects.h:124
Definition: SpellAuraDefines.h:83
Definition: SpellAuraDefines.h:286
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:462
int32 m_period
Definition: SpellAuraEffects.h:123
float GetFloatValue(uint16 index) const
Definition: Object.cpp:312
int32 GetDuration() const
Definition: SpellAuras.h:163
Definition: SpellAuraDefines.h:124
Definition: SpellAuraDefines.h:81
Definition: Unit.h:105
Definition: SpellAuraDefines.h:84
Player * GetSpellModOwner() const
Definition: Unit.cpp:12691
Definition: Common.h:103
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
int32_t int32
Definition: g3dmath.h:167
Definition: SpellAuraDefines.h:113
Definition: SpellAuraDefines.h:149
Definition: SpellAuraDefines.h:122
uint32 ApplyAuraPeriod
Definition: SpellInfo.h:245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AuraEffect::CalculateSpellMod ( )
805 {
806  switch (GetAuraType())
807  {
810  if (!m_spellmod)
811  {
814 
815  m_spellmod->type = SpellModType(uint32(GetAuraType())); // SpellModType value == spell aura types
816  m_spellmod->spellId = GetId();
819  }
821  break;
822  default:
823  break;
824  }
826 }
SpellModOp op
Definition: Player.h:170
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition: SpellAuras.cpp:2134
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
SpellModOp
Definition: Unit.h:84
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
Definition: Player.h:167
uint32 GetId() const
Definition: SpellAuraEffects.h:47
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Definition: SpellAuraDefines.h:168
SpellModType type
Definition: Player.h:171
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
uint32 spellId
Definition: Player.h:175
flag128 mask
Definition: Player.h:174
flag128 SpellClassMask
Definition: SpellInfo.h:264
Definition: SpellAuraDefines.h:167
uint8 GetCharges() const
Definition: SpellAuras.h:170
int32 value
Definition: Player.h:173
SpellModType
Definition: Player.h:75
uint32_t uint32
Definition: g3dmath.h:168
int16 charges
Definition: Player.h:172

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AuraEffect::CanBeRecalculated ( ) const
inline
67 { return m_canBeRecalculated; }
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:127

+ Here is the caller graph for this function:

bool AuraEffect::CanPeriodicTickCrit ( Unit const caster) const
private
1141 {
1142  ASSERT(caster);
1143 
1144  return caster->HasAuraTypeWithAffectMask(SPELL_AURA_ABILITY_PERIODIC_CRIT, m_spellInfo);
1145 }
Definition: SpellAuraDefines.h:346
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
#define ASSERT
Definition: Errors.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AuraEffect::ChangeAmount ( int32  newAmount,
bool  mark = true,
bool  onStackOrReapply = false 
)
829 {
830  // Reapply if amount change
831  uint8 handleMask = 0;
832  if (newAmount != GetAmount())
833  handleMask |= AURA_EFFECT_HANDLE_CHANGE_AMOUNT;
834  if (onStackOrReapply)
835  handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
836 
837  if (!handleMask)
838  return;
839 
840  std::list<AuraApplication*> effectApplications;
841  GetApplicationList(effectApplications);
842 
843  for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
844  if ((*apptItr)->HasEffect(GetEffIndex()))
845  HandleEffect(*apptItr, handleMask, false);
846 
847  if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
848  {
849  if (!mark)
850  m_amount = newAmount;
851  else
852  SetAmount(newAmount);
854  }
855 
856  for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
857  if ((*apptItr)->HasEffect(GetEffIndex()))
858  HandleEffect(*apptItr, handleMask, true);
859 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
int32 m_amount
Definition: SpellAuraEffects.h:115
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition: SpellAuraEffects.cpp:861
void GetApplicationList(std::list< AuraApplication * > &applicationList) const
Definition: SpellAuraEffects.cpp:579
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:804
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
Definition: SpellAuraDefines.h:41
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:56
uint8_t uint8
Definition: Define.h:152
Definition: SpellAuraDefines.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AuraEffect::CleanupTriggeredSpells ( Unit target)
Todo:
is there a spell flag, which can solve this in a more sophisticated way?
1251 {
1252  uint32 tSpellId = GetSpellEffectInfo()->TriggerSpell;
1253  if (!tSpellId)
1254  return;
1255 
1256  SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
1257  if (!tProto)
1258  return;
1259 
1260  if (tProto->GetDuration() != -1)
1261  return;
1262 
1263  // needed for spell 43680, maybe others
1267  return;
1268 
1269  target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
1270 }
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
Definition: SpellInfo.h:326
uint32 ApplyAuraName
Definition: SpellInfo.h:244
int32 GetDuration() const
Definition: SpellInfo.cpp:2490
uint32 TriggerSpell
Definition: SpellInfo.h:263
Definition: SpellAuraDefines.h:83
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
uint32_t uint32
Definition: g3dmath.h:168
uint32 ApplyAuraPeriod
Definition: SpellInfo.h:245

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int32 AuraEffect::GetAmount ( ) const
inline
55 { return m_amount; }
int32 m_amount
Definition: SpellAuraEffects.h:115
void AuraEffect::GetApplicationList ( std::list< AuraApplication * > &  applicationList) const
580 {
581  Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
582  for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
583  {
584  if (appIter->second->HasEffect(GetEffIndex()))
585  applicationList.push_back(appIter->second);
586  }
587 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
ApplicationMap const & GetApplicationMap()
Definition: SpellAuras.h:231
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:120

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AuraType AuraEffect::GetAuraType ( ) const
inline
AuraType
Definition: SpellAuraDefines.h:58
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
uint32 ApplyAuraName
Definition: SpellInfo.h:244

+ Here is the caller graph for this function:

Aura* AuraEffect::GetBase ( ) const
inline
41 { return m_base; }
Aura *const m_base
Definition: SpellAuraEffects.h:109

+ Here is the caller graph for this function:

int32 AuraEffect::GetBaseAmount ( ) const
inline
49 { return m_baseAmount; }
int32 const m_baseAmount
Definition: SpellAuraEffects.h:113

+ Here is the caller graph for this function:

Unit* AuraEffect::GetCaster ( ) const
inline
39 { return GetBase()->GetCaster(); }
Unit * GetCaster() const
Definition: SpellAuras.cpp:438
Aura * GetBase() const
Definition: SpellAuraEffects.h:41

+ Here is the caller graph for this function:

ObjectGuid AuraEffect::GetCasterGUID ( ) const
inline
40 { return GetBase()->GetCasterGUID(); }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135

+ Here is the caller graph for this function:

float AuraEffect::GetCritChance ( ) const
inline
76 { return m_critChance; }
float m_critChance
Definition: SpellAuraEffects.h:117
int32 AuraEffect::GetDamage ( ) const
inline
74 { return m_damage; }
int32 m_damage
Definition: SpellAuraEffects.h:116
float AuraEffect::GetDonePct ( ) const
inline
78 { return m_donePct; }
float m_donePct
Definition: SpellAuraEffects.h:118
uint32 AuraEffect::GetEffIndex ( ) const
inline
48 { return m_effIndex; }
uint8 const m_effIndex
Definition: SpellAuraEffects.h:126

+ Here is the caller graph for this function:

uint32 AuraEffect::GetId ( void  ) const
inline
47 { return m_spellInfo->Id; }
uint32 Id
Definition: SpellInfo.h:329
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111

+ Here is the caller graph for this function:

int32 AuraEffect::GetMiscValue ( ) const
inline
53 { return GetSpellEffectInfo()->MiscValue; }
int32 MiscValue
Definition: SpellInfo.h:253
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
int32 AuraEffect::GetMiscValueB ( ) const
inline
52 { return GetSpellEffectInfo()->MiscValueB; }
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
int32 MiscValueB
Definition: SpellInfo.h:254

+ Here is the caller graph for this function:

int32 AuraEffect::GetPeriod ( ) const
inline
50 { return m_period; }
int32 m_period
Definition: SpellAuraEffects.h:123

+ Here is the caller graph for this function:

int32 AuraEffect::GetPeriodicTimer ( ) const
inline
58 { return m_periodicTimer; }
int32 m_periodicTimer
Definition: SpellAuraEffects.h:122

+ Here is the caller graph for this function:

SpellEffectInfo const* AuraEffect::GetSpellEffectInfo ( ) const
inline
102 { return _effectInfo; }
SpellEffectInfo const * _effectInfo
Definition: SpellAuraEffects.h:112

+ Here is the caller graph for this function:

SpellInfo const* AuraEffect::GetSpellInfo ( ) const
inline
46 { return m_spellInfo; }
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111

+ Here is the caller graph for this function:

SpellModifier* AuraEffect::GetSpellModifier ( ) const
inline
44 { return m_spellmod; }
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
void AuraEffect::GetTargetList ( std::list< Unit * > &  targetList) const
569 {
570  Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
571  // remove all targets which were not added to new list - they no longer deserve area aura
572  for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
573  {
574  if (appIter->second->HasEffect(GetEffIndex()))
575  targetList.push_back(appIter->second->GetTarget());
576  }
577 }
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
ApplicationMap const & GetApplicationMap()
Definition: SpellAuras.h:231
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:120

+ Here is the call graph for this function:

uint32 AuraEffect::GetTickNumber ( ) const
inline
83 { return m_tickNumber; }
uint32 m_tickNumber
Definition: SpellAuraEffects.h:124

+ Here is the caller graph for this function:

int32 AuraEffect::GetTotalTicks ( ) const
inline
84 { return m_period ? (GetBase()->GetMaxDuration() / m_period) : 1;}
int32 GetMaxDuration() const
Definition: SpellAuras.h:159
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
int32 m_period
Definition: SpellAuraEffects.h:123

+ Here is the caller graph for this function:

void AuraEffect::HandleArenaPreparation ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4729 {
4730  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4731  return;
4732 
4733  Unit* target = aurApp->GetTarget();
4734 
4735  if (apply)
4737  else
4738  {
4739  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4740  if (target->HasAuraType(GetAuraType()))
4741  return;
4743  }
4744 }
Definition: Unit.h:678
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
Definition: SpellAuraDefines.h:39
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: UpdateFields.h:109
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraAllowFlight ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
2719 {
2721  return;
2722 
2723  Unit* target = aurApp->GetTarget();
2724 
2725  if (!apply)
2726  {
2727  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2729  return;
2730  }
2731 
2732  target->SetCanFly(apply);
2733 
2734  if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
2735  target->GetMotionMaster()->MoveFall();
2736 }
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: ObjectGuid.h:32
bool IsLevitating() const
Definition: Unit.h:1667
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
void MoveFall(uint32 id=0)
Definition: MotionMaster.cpp:440
TypeID GetTypeId() const
Definition: Object.h:113
bool SetCanFly(bool enable)
Definition: Unit.cpp:15899
Definition: SpellAuraDefines.h:45
ObjectGuid GetTarget() const
Definition: Unit.h:2209
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: SpellAuraDefines.h:267
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraAllowOnlyAbility ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
2502 {
2504  return;
2505 
2506  Unit* target = aurApp->GetTarget();
2507 
2508  if (target->GetTypeId() == TYPEID_PLAYER)
2509  {
2510  if (apply)
2512  else
2513  {
2514  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2516  return;
2518  }
2519  }
2520 }
Definition: SpellAuraDefines.h:323
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
TypeID GetTypeId() const
Definition: Object.h:113
Definition: Player.h:540
Definition: SpellAuraDefines.h:45
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: UpdateFields.h:191
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraCloneCaster ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
2239 {
2241  return;
2242 
2243  Unit* target = aurApp->GetTarget();
2244 
2245  if (apply)
2246  {
2247  Unit* caster = GetCaster();
2248  if (!caster || caster == target)
2249  return;
2250 
2251  // What must be cloned? at least display and scale
2252  target->SetDisplayId(caster->GetDisplayId());
2253  //target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?)
2255  }
2256  else
2257  {
2258  target->SetDisplayId(target->GetNativeDisplayId());
2260  }
2261 }
uint32 GetDisplayId() const
Definition: Unit.h:2012
Definition: UpdateFields.h:110
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
Definition: Unit.h:715
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:12799
Definition: SpellAuraDefines.h:45
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
uint32 GetNativeDisplayId() const
Definition: Unit.h:2014
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraControlVehicle ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const

Such auras are applied from a caster(=player) to a vehicle. This has been verified using spell #49256

3049 {
3051  return;
3052 
3053  Unit* target = aurApp->GetTarget();
3054  if (!target->IsVehicle())
3055  return;
3056 
3057  Unit* caster = GetCaster();
3058  if (!caster || caster == target)
3059  return;
3060 
3061  if (apply)
3062  {
3063  // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3064  // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3065  // so this break such spells or most of them.
3066  // Current formula about m_amount: effect base points + dieside - 1
3067  // TO DO: Reasearch more about 0/0 and fix it.
3068  caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3069  }
3070  else
3071  {
3072  // Remove pending passengers before exiting vehicle - might cause an Uninstall
3074 
3075  if (GetId() == 53111) // Devour Humanoid
3076  {
3077  target->Kill(caster);
3078  if (caster->GetTypeId() == TYPEID_UNIT)
3079  caster->ToCreature()->RemoveCorpse();
3080  }
3081 
3082  if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT))
3083  caster->_ExitVehicle();
3084  else
3085  target->GetVehicleKit()->RemovePassenger(caster); // Only remove passenger from vehicle without launching exit movement or despawning the vehicle
3086 
3087  // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3088  caster->RemoveAurasDueToSpell(GetId());
3089  }
3090 }
void Kill(Unit *victim, bool durabilityLoss=true)
Definition: Unit.cpp:13513
bool IsVehicle() const
Definition: Unit.h:1406
uint32 GetId() const
Definition: SpellAuraEffects.h:47
int32 m_amount
Definition: SpellAuraEffects.h:115
void _ExitVehicle(Position const *exitPosition=NULL)
Definition: Unit.cpp:15340
Definition: ObjectGuid.h:32
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
void apply(T *val)
Definition: ByteConverter.h:41
TypeID GetTypeId() const
Definition: Object.h:113
void RemovePendingEventsForPassenger(Unit *passenger)
Definition: Vehicle.cpp:713
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=NULL)
Definition: Unit.cpp:15254
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
Definition: Vehicle.cpp:466
Definition: SpellAuraDefines.h:41
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Creature * ToCreature()
Definition: Object.h:194
void RemoveCorpse(bool setSpawnTime=true)
Definition: Creature.cpp:280
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46
Vehicle * GetVehicleKit() const
Definition: Unit.h:2165

+ Here is the call graph for this function:

void AuraEffect::HandleAuraConvertRune ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
5270 {
5271  if (!(mode & AURA_EFFECT_HANDLE_REAL))
5272  return;
5273 
5274  Unit* target = aurApp->GetTarget();
5275 
5276  Player* player = target->ToPlayer();
5277  if (!player)
5278  return;
5279 
5280  if (player->getClass() != CLASS_DEATH_KNIGHT)
5281  return;
5282 
5283  uint32 runes = m_amount;
5284  // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
5285  if (apply)
5286  {
5287  for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
5288  {
5289  if (GetMiscValue() != player->GetCurrentRune(i))
5290  continue;
5291  if (!player->GetRuneCooldown(i))
5292  {
5293  player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
5294  --runes;
5295  }
5296  }
5297  }
5298  else
5299  player->RemoveRunesByAuraEffect(this);
5300 }
Definition: SharedDefines.h:172
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
int32 m_amount
Definition: SpellAuraEffects.h:115
#define MAX_RUNES
Definition: Player.h:451
int32 GetMiscValueB() const
Definition: SpellAuraEffects.h:52
void apply(T *val)
Definition: ByteConverter.h:41
Player * ToPlayer()
Definition: Object.h:191
uint32_t uint32
Definition: Define.h:150
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
RuneType
Definition: Player.h:459
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraDummy ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4789 {
4791  return;
4792 
4793  Unit* target = aurApp->GetTarget();
4794 
4795  Unit* caster = GetCaster();
4796 
4797  if (mode & AURA_EFFECT_HANDLE_REAL)
4798  {
4799  // pet auras
4800  if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
4801  {
4802  if (apply)
4803  target->AddPetAura(petSpell);
4804  else
4805  target->RemovePetAura(petSpell);
4806  }
4807  }
4808 
4809  if (mode & (AURA_EFFECT_HANDLE_REAL | AURA_EFFECT_HANDLE_REAPPLY))
4810  {
4811  // AT APPLY
4812  if (apply)
4813  {
4814  switch (GetId())
4815  {
4816  case 1515: // Tame beast
4817  // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
4818  if (caster && target->CanHaveThreatList())
4819  target->AddThreat(caster, 10.0f);
4820  break;
4821  case 13139: // net-o-matic
4822  // root to self part of (root_target->charge->root_self sequence
4823  if (caster)
4824  caster->CastSpell(caster, 13138, true, NULL, this);
4825  break;
4826  case 34026: // kill command
4827  {
4828  Unit* pet = target->GetGuardianPet();
4829  if (!pet)
4830  break;
4831 
4832  target->CastSpell(target, 34027, true, NULL, this);
4833 
4834  // set 3 stacks and 3 charges (to make all auras not disappear at once)
4835  Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
4836  Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
4837  if (owner_aura)
4838  {
4839  owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4840  if (pet_aura)
4841  {
4842  pet_aura->SetCharges(0);
4843  pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4844  }
4845  }
4846  break;
4847  }
4848  case 37096: // Blood Elf Illusion
4849  {
4850  if (caster)
4851  {
4852  if (caster->getGender() == GENDER_FEMALE)
4853  caster->CastSpell(target, 37095, true, NULL, this); // Blood Elf Disguise
4854  else
4855  caster->CastSpell(target, 37093, true, NULL, this);
4856  }
4857  break;
4858  }
4859  case 39850: // Rocket Blast
4860  if (roll_chance_i(20)) // backfire stun
4861  target->CastSpell(target, 51581, true, NULL, this);
4862  break;
4863  case 43873: // Headless Horseman Laugh
4864  target->PlayDistanceSound(11965);
4865  break;
4866  case 46354: // Blood Elf Illusion
4867  if (caster)
4868  {
4869  if (caster->getGender() == GENDER_FEMALE)
4870  caster->CastSpell(target, 46356, true, NULL, this);
4871  else
4872  caster->CastSpell(target, 46355, true, NULL, this);
4873  }
4874  break;
4875  case 46361: // Reinforced Net
4876  if (caster)
4877  target->GetMotionMaster()->MoveFall();
4878  break;
4879  case 71563:
4880  if (Aura* newAura = target->AddAura(71564, target))
4881  newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
4882  break;
4883  }
4884  }
4885  // AT REMOVE
4886  else
4887  {
4888  if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive())
4889  {
4890  uint32 finalSpelId = 0;
4891  switch (GetId())
4892  {
4893  case 19548: finalSpelId = 19597; break;
4894  case 19674: finalSpelId = 19677; break;
4895  case 19687: finalSpelId = 19676; break;
4896  case 19688: finalSpelId = 19678; break;
4897  case 19689: finalSpelId = 19679; break;
4898  case 19692: finalSpelId = 19680; break;
4899  case 19693: finalSpelId = 19684; break;
4900  case 19694: finalSpelId = 19681; break;
4901  case 19696: finalSpelId = 19682; break;
4902  case 19697: finalSpelId = 19683; break;
4903  case 19699: finalSpelId = 19685; break;
4904  case 19700: finalSpelId = 19686; break;
4905  case 30646: finalSpelId = 30647; break;
4906  case 30653: finalSpelId = 30648; break;
4907  case 30654: finalSpelId = 30652; break;
4908  case 30099: finalSpelId = 30100; break;
4909  case 30102: finalSpelId = 30103; break;
4910  case 30105: finalSpelId = 30104; break;
4911  }
4912 
4913  if (finalSpelId)
4914  caster->CastSpell(target, finalSpelId, true, NULL, this);
4915  }
4916 
4917  switch (m_spellInfo->SpellFamilyName)
4918  {
4919  case SPELLFAMILY_GENERIC:
4920  switch (GetId())
4921  {
4922  case 2584: // Waiting to Resurrect
4923  // Waiting to resurrect spell cancel, we must remove player from resurrect queue
4924  if (target->GetTypeId() == TYPEID_PLAYER)
4925  {
4926  if (Battleground* bg = target->ToPlayer()->GetBattleground())
4927  bg->RemovePlayerFromResurrectQueue(target->GetGUID());
4928  if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
4929  bf->RemovePlayerFromResurrectQueue(target->GetGUID());
4930  }
4931  break;
4932  case 36730: // Flame Strike
4933  {
4934  target->CastSpell(target, 36731, true, NULL, this);
4935  break;
4936  }
4937  case 44191: // Flame Strike
4938  {
4939  if (target->GetMap()->IsDungeon())
4940  {
4941  uint32 spellId = target->GetMap()->IsHeroic() ? 46163 : 44190;
4942 
4943  target->CastSpell(target, spellId, true, NULL, this);
4944  }
4945  break;
4946  }
4947  case 43681: // Inactive
4948  {
4949  if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
4950  return;
4951 
4952  if (target->GetMap()->IsBattleground())
4953  target->ToPlayer()->LeaveBattleground();
4954  break;
4955  }
4956  case 42783: // Wrath of the Astromancer
4957  target->CastSpell(target, GetAmount(), true, NULL, this);
4958  break;
4959  case 46308: // Burning Winds cast only at creatures at spawn
4960  target->CastSpell(target, 47287, true, NULL, this);
4961  break;
4962  case 52172: // Coyote Spirit Despawn Aura
4963  case 60244: // Blood Parrot Despawn Aura
4964  target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this);
4965  break;
4966  case 91604: // Restricted Flight Area
4967  if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
4968  target->CastSpell(target, 58601, true);
4969  break;
4970  }
4971  break;
4973  // Summon Gargoyle (Dismiss Gargoyle at remove)
4974  if (GetId() == 61777)
4975  target->CastSpell(target, GetAmount(), true);
4976  break;
4977  default:
4978  break;
4979  }
4980  }
4981  }
4982 
4983  // AT APPLY & REMOVE
4984 
4985  switch (m_spellInfo->SpellFamilyName)
4986  {
4987  case SPELLFAMILY_GENERIC:
4988  {
4989  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4990  break;
4991  switch (GetId())
4992  {
4993  // Recently Bandaged
4994  case 11196:
4996  break;
4997  // Unstable Power
4998  case 24658:
4999  {
5000  uint32 spellId = 24659;
5001  if (apply && caster)
5002  {
5003  SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5004 
5005  for (uint32 i = 0; i < spell->StackAmount; ++i)
5006  caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
5007  break;
5008  }
5009  target->RemoveAurasDueToSpell(spellId);
5010  break;
5011  }
5012  // Restless Strength
5013  case 24661:
5014  {
5015  uint32 spellId = 24662;
5016  if (apply && caster)
5017  {
5018  SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5019  for (uint32 i = 0; i < spell->StackAmount; ++i)
5020  caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID());
5021  break;
5022  }
5023  target->RemoveAurasDueToSpell(spellId);
5024  break;
5025  }
5026  // Tag Murloc
5027  case 30877:
5028  {
5029  // Tag/untag Blacksilt Scout
5030  target->SetEntry(apply ? 17654 : 17326);
5031  break;
5032  }
5033  case 57819: // Argent Champion
5034  case 57820: // Ebon Champion
5035  case 57821: // Champion of the Kirin Tor
5036  case 57822: // Wyrmrest Champion
5037  {
5038  if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
5039  break;
5040 
5041  uint32 FactionID = 0;
5042 
5043  if (apply)
5044  {
5045  switch (m_spellInfo->Id)
5046  {
5047  case 57819: FactionID = 1106; break; // Argent Crusade
5048  case 57820: FactionID = 1098; break; // Knights of the Ebon Blade
5049  case 57821: FactionID = 1090; break; // Kirin Tor
5050  case 57822: FactionID = 1091; break; // The Wyrmrest Accord
5051  }
5052  }
5053  caster->ToPlayer()->SetChampioningFaction(FactionID);
5054  break;
5055  }
5056  // LK Intro VO (1)
5057  case 58204:
5058  if (target->GetTypeId() == TYPEID_PLAYER)
5059  {
5060  // Play part 1
5061  if (apply)
5062  target->PlayDirectSound(14970, target->ToPlayer());
5063  // continue in 58205
5064  else
5065  target->CastSpell(target, 58205, true);
5066  }
5067  break;
5068  // LK Intro VO (2)
5069  case 58205:
5070  if (target->GetTypeId() == TYPEID_PLAYER)
5071  {
5072  // Play part 2
5073  if (apply)
5074  target->PlayDirectSound(14971, target->ToPlayer());
5075  // Play part 3
5076  else
5077  target->PlayDirectSound(14972, target->ToPlayer());
5078  }
5079  break;
5080  }
5081 
5082  break;
5083  }
5084  case SPELLFAMILY_MAGE:
5085  {
5086  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5087  //break;
5088  break;
5089  }
5090  case SPELLFAMILY_PRIEST:
5091  {
5092  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5093  //break;
5094  break;
5095  }
5096  case SPELLFAMILY_DRUID:
5097  {
5098  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5099  //break;
5100  break;
5101  }
5102  case SPELLFAMILY_SHAMAN:
5103  {
5104  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5105  //break;
5106  break;
5107  }
5108  case SPELLFAMILY_PALADIN:
5109  // if (!(mode & AURA_EFFECT_HANDLE_REAL))
5110  // break;
5111  break;
5113  {
5114  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5115  // break;
5116  break;
5117  }
5118  }
5119 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
Definition: SharedDefines.h:4633
uint32 Id
Definition: SpellInfo.h:329
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:46
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
bool IsBattleground() const
Definition: Map.h:401
Guardian * GetGuardianPet() const
Definition: Unit.cpp:7596
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
void SetStackAmount(uint8 num)
Definition: SpellAuras.cpp:930
void PlayDirectSound(uint32 sound_id, Player *target=NULL)
Definition: Object.cpp:2966
Map * GetMap() const
Definition: Object.h:543
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
Definition: SpellInfo.h:326
uint32 GetId() const
Definition: SpellAuraEffects.h:47
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4151
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:14463
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
uint32 GetZoneId() const
Definition: Object.cpp:1525
Definition: SharedDefines.h:4638
arena_t NULL
Definition: jemalloc_internal.h:624
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
bool IsDungeon() const
Definition: Map.h:395
void SetEntry(uint32 entry)
Definition: Object.h:108
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
void apply(T *val)
Definition: ByteConverter.h:41
bool CanHaveThreatList(bool skipAliveCheck=false) const
Definition: Unit.cpp:10652
Player * ToPlayer()
Definition: Object.h:191
void MoveFall(uint32 id=0)
Definition: MotionMaster.cpp:440
void RemovePetAura(PetAura const *petSpell)
Definition: Unit.cpp:13171
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SharedDefines.h:94
Definition: SharedDefines.h:4626
Definition: SpellMgr.h:433
void SetCharges(uint8 charges)
Definition: SpellAuras.cpp:864
bool IsHeroic() const
Definition: Map.cpp:3420
uint32 SpellFamilyName
Definition: SpellInfo.h:396
Definition: SharedDefines.h:4634
Definition: SharedDefines.h:4629
bool IsAlive() const
Definition: Unit.h:1692
void AddPetAura(PetAura const *petSpell)
Definition: Unit.cpp:13161
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
bool roll_chance_i(int chance)
Definition: Random.h:53
Definition: Battlefield.h:196
Definition: SpellAuraDefines.h:39
Definition: SharedDefines.h:4630
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:67
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
ObjectGuid GetTarget() const
Definition: Unit.h:2209
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: Unit.h:454
Definition: ObjectGuid.h:33
Definition: SharedDefines.h:4623
uint8 const m_effIndex
Definition: SpellAuraEffects.h:126
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
uint8 getGender() const
Definition: Unit.h:1415
Definition: Battleground.h:235
void PlayDistanceSound(uint32 sound_id, Player *target=NULL)
Definition: Object.cpp:2955
uint32 StackAmount
Definition: SpellInfo.h:381
Definition: SpellAuraDefines.h:42
Definition: SpellAuras.h:116
Definition: Unit.h:1305
Definition: SharedDefines.h:1865
Definition: SpellAuraDefines.h:46
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

void AuraEffect::HandleAuraEmpathy ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
5214 {
5215  if (!(mode & AURA_EFFECT_HANDLE_REAL))
5216  return;
5217 
5218  Unit* target = aurApp->GetTarget();
5219  if (!apply)
5220  {
5221  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5222  if (target->HasAuraType(GetAuraType()))
5223  return;
5224  }
5225 
5226  if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5228 }
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition: Object.cpp:1151
uint32 GetCreatureType() const
Definition: Unit.cpp:11248
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: SharedDefines.h:4205
Definition: SharedDefines.h:3554
Definition: UpdateFields.h:30
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraFeatherFall ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
2756 {
2758  return;
2759 
2760  Unit* target = aurApp->GetTarget();
2761 
2762  if (!apply)
2763  {
2764  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2765  if (target->HasAuraType(GetAuraType()))
2766  return;
2767  }
2768 
2769  target->SetFeatherFall(apply);
2770 
2771  // start fall from current height
2772  if (!apply && target->GetTypeId() == TYPEID_PLAYER)
2773  target->ToPlayer()->SetFallInformation(0, target->GetPositionZ());
2774 }
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
float GetPositionZ() const
Definition: Position.h:106
bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition: Unit.cpp:15980
Definition: SpellAuraDefines.h:45
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraForceWeather ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
6631 {
6632  if (!(mode & AURA_EFFECT_HANDLE_REAL))
6633  return;
6634 
6635  Player* target = aurApp->GetTarget()->ToPlayer();
6636 
6637  if (!target)
6638  return;
6639 
6640  if (apply)
6641  {
6643  target->GetSession()->SendPacket(weather.Write());
6644  }
6645  else
6646  {
6647  // send weather for current zone
6648  if (Weather* weather = WeatherMgr::FindWeather(target->GetZoneId()))
6649  weather->SendWeatherUpdateToPlayer(target);
6650  else
6651  {
6652  if (!WeatherMgr::AddWeather(target->GetZoneId()))
6653  {
6654  // send fine weather packet to remove old weather
6656  }
6657  }
6658  }
6659 }
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
void apply(T *val)
Definition: ByteConverter.h:41
Definition: MiscPackets.h:400
Weather * FindWeather(uint32 id)
Find a Weather object by the given zoneid.
Definition: WeatherMgr.cpp:50
Definition: SpellAuraDefines.h:39
Weather * AddWeather(uint32 zone_id)
Add a Weather object to the list.
Definition: WeatherMgr.cpp:67
void SendFineWeatherUpdateToPlayer(Player *player)
Definition: WeatherMgr.cpp:144
Weather for one zone.
Definition: Weather.h:65
WeatherState
Definition: Weather.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraGhost ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
1683 {
1685  return;
1686 
1687  Unit* target = aurApp->GetTarget();
1688 
1689  if (target->GetTypeId() != TYPEID_PLAYER)
1690  return;
1691 
1692  if (apply)
1693  {
1697  }
1698  else
1699  {
1700  if (target->HasAuraType(SPELL_AURA_GHOST))
1701  return;
1702 
1706  }
1707 }
Definition: SpellAuraDefines.h:155
Definition: Player.h:521
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:538
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:383
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
Definition: SharedDefines.h:1749
Definition: SharedDefines.h:1750
TypeID GetTypeId() const
Definition: Object.h:113
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:539
Definition: SpellAuraDefines.h:45
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: SharedDefines.h:1742
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: UpdateFields.h:191
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraHover ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const

Sets movementflags

2777 {
2779  return;
2780 
2781  Unit* target = aurApp->GetTarget();
2782 
2783  if (!apply)
2784  {
2785  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2786  if (target->HasAuraType(GetAuraType()))
2787  return;
2788  }
2789 
2790  target->SetHover(apply);
2791 }
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
bool SetHover(bool enable, bool packetOnly=false)
Definition: Unit.cpp:16018
Definition: SpellAuraDefines.h:45
ObjectGuid GetTarget() const
Definition: Unit.h:2209
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraIncreaseBaseHealthPercent ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4177 {
4179  return;
4180 
4181  Unit* target = aurApp->GetTarget();
4182 
4184 }
Definition: SpellAuraDefines.h:43
void apply(T *val)
Definition: ByteConverter.h:41
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:11323
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Unit.h:489
Definition: Unit.h:436
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraLinked ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
5303 {
5304  Unit* target = aurApp->GetTarget();
5305 
5306  uint32 triggeredSpellId = GetSpellEffectInfo()->TriggerSpell;
5307  SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
5308  if (!triggeredSpellInfo)
5309  return;
5310 
5311  Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, target->GetMap()->GetDifficultyID()) ? GetCaster() : target;
5312  if (!caster)
5313  return;
5314 
5315  if (mode & AURA_EFFECT_HANDLE_REAL)
5316  {
5317  if (apply)
5318  {
5319  // If amount avalible cast with basepoints (Crypt Fever for example)
5320  if (GetAmount())
5321  caster->CastCustomSpell(target, triggeredSpellId, &m_amount, NULL, NULL, true, NULL, this);
5322  else
5323  caster->CastSpell(target, triggeredSpellId, true, NULL, this);
5324  }
5325  else
5326  {
5327  ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, caster->GetMap()->GetDifficultyID()) ? GetCasterGUID() : target->GetGUID();
5328  target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
5329  }
5330  }
5331  else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
5332  {
5333  ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, caster->GetMap()->GetDifficultyID()) ? GetCasterGUID() : target->GetGUID();
5334  // change the stack amount to be equal to stack amount of our aura
5335  if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
5336  triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
5337  }
5338 }
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
Map * GetMap() const
Definition: Object.h:543
Definition: SpellInfo.h:326
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4151
int32 m_amount
Definition: SpellAuraEffects.h:115
Difficulty GetDifficultyID() const
Definition: Map.h:390
arena_t NULL
Definition: jemalloc_internal.h:624
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3442
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
void apply(T *val)
Definition: ByteConverter.h:41
uint32 TriggerSpell
Definition: SpellInfo.h:263
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint8 GetStackAmount() const
Definition: SpellAuras.h:179
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
Definition: ObjectGuid.h:189
Definition: SpellAuraDefines.h:42
Definition: SpellAuras.h:116
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:920
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell, uint32 difficulty) const
Definition: SpellInfo.cpp:1363

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModAttackPower ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4485 {
4487  return;
4488 
4489  Unit* target = aurApp->GetTarget();
4490 
4492 }
Definition: Unit.h:508
Definition: SpellAuraDefines.h:43
void apply(T *val)
Definition: ByteConverter.h:41
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:11323
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
Definition: Unit.h:437
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModAttackPowerOfArmor ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4533 {
4535  return;
4536 
4537  Unit* target = aurApp->GetTarget();
4538 
4539  // Recalculate bonus
4540  if (target->GetTypeId() == TYPEID_PLAYER)
4541  target->ToPlayer()->UpdateAttackPowerAndDamage(false);
4542 }
Definition: SpellAuraDefines.h:43
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4508 {
4510  return;
4511 
4512  Unit* target = aurApp->GetTarget();
4513 
4514  //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4516 }
Definition: Unit.h:508
Definition: SpellAuraDefines.h:43
void apply(T *val)
Definition: ByteConverter.h:41
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:11323
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
Definition: Unit.h:438
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3649 {
3651  return;
3652 
3653  Unit* target = aurApp->GetTarget();
3654 
3655  // only players have base stats
3656  if (target->GetTypeId() != TYPEID_PLAYER)
3657  {
3658  //pets only have base armor
3659  if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
3661  }
3662  else
3663  {
3665  {
3666  if (GetMiscValue() & int32(1<<x))
3668  }
3669  }
3670 }
int8_t int8
Definition: Define.h:148
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
UnitMods
Definition: Unit.h:482
Definition: Unit.h:517
Definition: SpellAuraDefines.h:43
void apply(T *val)
Definition: ByteConverter.h:41
#define MAX_SPELL_SCHOOL
Definition: SharedDefines.h:283
TypeID GetTypeId() const
Definition: Object.h:113
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:11323
Definition: SharedDefines.h:288
Definition: SharedDefines.h:274
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
bool IsPet() const
Definition: Unit.h:1403
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
int32_t int32
Definition: g3dmath.h:167
Definition: Unit.h:436
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46
Definition: Unit.h:501

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4225 {
4227  return;
4228 
4229  Unit* target = aurApp->GetTarget();
4230 
4231  if (target->GetTypeId() != TYPEID_PLAYER)
4232  return;
4233 
4234  target->ToPlayer()->UpdateBlockPercentage();
4235 }
Definition: SpellAuraDefines.h:43
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModCritPct ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4333 {
4335  return;
4336 
4337  Unit* target = aurApp->GetTarget();
4338 
4339  if (target->GetTypeId() != TYPEID_PLAYER)
4340  {
4341  target->m_baseSpellCritChance += (apply) ? GetAmount():-GetAmount();
4342  return;
4343  }
4344 
4345  target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4346  target->ToPlayer()->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4347  target->ToPlayer()->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4348 
4349  // included in Player::UpdateSpellCritChance calculation
4350  target->ToPlayer()->UpdateAllSpellCritChances();
4351 }
Definition: Unit.h:525
int32 m_baseSpellCritChance
Definition: Unit.h:1942
Definition: SpellAuraDefines.h:43
void apply(T *val)
Definition: ByteConverter.h:41
Definition: Unit.h:527
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
Definition: Unit.h:534
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: Unit.h:526
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModDecreaseSpeed ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3156 {
3158  return;
3159 
3160  Unit* target = aurApp->GetTarget();
3161 
3162  target->UpdateSpeed(MOVE_RUN, true);
3163  target->UpdateSpeed(MOVE_SWIM, true);
3164  target->UpdateSpeed(MOVE_FLIGHT, true);
3165  target->UpdateSpeed(MOVE_RUN_BACK, true);
3166  target->UpdateSpeed(MOVE_SWIM_BACK, true);
3167  target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3168 }
Definition: Unit.h:605
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition: Unit.cpp:10378
Definition: Unit.h:601
Definition: Unit.h:602
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Unit.h:600
Definition: Unit.h:606
Definition: Unit.h:603
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModDisarm ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
2359 {
2360  if (!(mode & AURA_EFFECT_HANDLE_REAL))
2361  return;
2362 
2363  Unit* target = aurApp->GetTarget();
2364 
2365  AuraType type = GetAuraType();
2366 
2367  // Prevent handling aura twice
2368  if (apply ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2369  return;
2370 
2371  uint32 field, flag, slot;
2372  WeaponAttackType attType;
2373  switch (type)
2374  {
2375  case SPELL_AURA_MOD_DISARM:
2376  field = UNIT_FIELD_FLAGS;
2377  flag = UNIT_FLAG_DISARMED;
2378  slot = EQUIPMENT_SLOT_MAINHAND;
2379  attType = BASE_ATTACK;
2380  break;
2382  field = UNIT_FIELD_FLAGS_2;
2384  slot = EQUIPMENT_SLOT_OFFHAND;
2385  attType = OFF_ATTACK;
2386  break;
2388  field = UNIT_FIELD_FLAGS_2;
2389  flag = UNIT_FLAG2_DISARM_RANGED;
2390  slot = EQUIPMENT_SLOT_MAINHAND;
2391  attType = RANGED_ATTACK;
2392  break;
2393  default:
2394  return;
2395  }
2396 
2397  // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
2398  if (!apply)
2399  target->RemoveFlag(field, flag);
2400 
2401  // Handle damage modification, shapeshifted druids are not affected
2402  if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
2403  {
2404  Player* player = target->ToPlayer();
2405  if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2406  {
2407  uint8 attacktype = Player::GetAttackBySlot(slot, item->GetTemplate()->GetInventoryType());
2408 
2409  if (attacktype < MAX_ATTACK)
2410  {
2411  player->_ApplyWeaponDamage(slot, item, !apply);
2412  player->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply);
2413  }
2414  }
2415  }
2416 
2417  // if disarm effects should be applied, wait to set flag until damage mods are unapplied
2418  if (apply)
2419  target->SetFlag(field, flag);
2420 
2421  if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
2422  target->UpdateDamagePhysical(attType);
2423 }
AuraType
Definition: SpellAuraDefines.h:58
Definition: Unit.h:718
Definition: Unit.h:620
#define INVENTORY_SLOT_BAG_0
Definition: Unit.h:619
Definition: ObjectGuid.h:32
bool IsInFeralForm() const
Definition: Unit.cpp:11274
Definition: UpdateFields.h:110
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
Definition: SpellAuraDefines.h:127
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SpellAuraDefines.h:338
Definition: Unit.h:618
Definition: Item.h:259
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1832
uint32_t uint32
Definition: Define.h:150
Definition: SpellAuraDefines.h:39
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: SpellAuraDefines.h:314
Definition: ObjectGuid.h:33
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition: StatSystem.cpp:60
Definition: UpdateFields.h:109
Definition: Unit.h:720
Creature * ToCreature()
Definition: Object.h:194
uint8_t uint8
Definition: Define.h:152
uint8 GetCurrentEquipmentId() const
Definition: Creature.h:547
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
WeaponAttackType
Definition: Unit.h:615
Definition: Unit.h:1305
Definition: Unit.h:694
Definition: Unit.h:617

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3590 {
3591  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3592  return;
3593 
3594  Unit* target = aurApp->GetTarget();
3595 
3597 }
void ApplySpellDispelImmunity(const SpellInfo *spellProto, DispelType type, bool apply)
Definition: Unit.cpp:9646
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
DispelType
Definition: SharedDefines.h:1836
void apply(T *val)
Definition: ByteConverter.h:41
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModDmgImmunity ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3580 {
3581  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3582  return;
3583 
3584  Unit* target = aurApp->GetTarget();
3585 
3587 }
Definition: SharedDefines.h:1863
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
uint32 GetId() const
Definition: SpellAuraEffects.h:47
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
void apply(T *val)
Definition: ByteConverter.h:41
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
4212 {
4214  return;
4215 
4216  Unit* target = aurApp->GetTarget();
4217 
4218  if (target->GetTypeId() != TYPEID_PLAYER)
4219  return;
4220 
4221  target->ToPlayer()->UpdateDodgePercentage();
4222 }
Definition: SpellAuraDefines.h:43
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModEffectImmunity ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3485 {
3486  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3487  return;
3488 
3489  Unit* target = aurApp->GetTarget();
3490 
3492 
3493  // when removing flag aura, handle flag drop
3494  Player* player = target->ToPlayer();
3495  if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
3496  {
3497  if (player->InBattleground())
3498  {
3499  if (Battleground* bg = player->GetBattleground())
3500  bg->EventPlayerDroppedFlag(player);
3501  }
3502  else
3503  sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3504  }
3505 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:46
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:105
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
uint32 GetId() const
Definition: SpellAuraEffects.h:47
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
void apply(T *val)
Definition: ByteConverter.h:41
Player * ToPlayer()
Definition: Object.h:191
Definition: SpellAuraDefines.h:39
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: Battleground.h:235
Definition: SharedDefines.h:1860
Definition: Unit.h:1305

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModExpertise ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
3960 {
3962  return;
3963 
3964  Unit* target = aurApp->GetTarget();
3965 
3966  if (target->GetTypeId() != TYPEID_PLAYER)
3967  return;
3968 
3969  target->ToPlayer()->UpdateExpertise(BASE_ATTACK);
3970  target->ToPlayer()->UpdateExpertise(OFF_ATTACK);
3971 }
Definition: SpellAuraDefines.h:43
Player * ToPlayer()
Definition: Object.h:191
TypeID GetTypeId() const
Definition: Object.h:113
Definition: Unit.h:618
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33
Definition: Unit.h:1305
Definition: SpellAuraDefines.h:46
Definition: Unit.h:617

+ Here is the call graph for this function:

void AuraEffect::HandleAuraModFaction ( AuraApplication const aurApp,
uint8  mode,
bool  apply 
) const
5231 {
5232  if (!(mode & AURA_EFFECT_HANDLE_REAL))
5233  return;
5234 
5235  Unit* target = aurApp->GetTarget();
5236 
5237  if (apply)
5238  {
5239  target->setFaction(GetMiscValue());
5240  if (target->GetTypeId() == TYPEID_PLAYER)
5242  }
5243  else
5244  {
5245  target->RestoreFaction();
5246  if (target->GetTypeId() == TYPEID_PLAYER)
5248  }
5249 }
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void apply(T *val)
Definition: ByteConverter.h:41
void setFaction(uint32 faction)
Definition: Unit.h:1467
TypeID GetTypeId() const
Definition: Object.h:113
void RestoreFaction()
Definition: Unit.cpp:14277
Definition: SpellAuraDefines.h:39
Definition: Unit.h:676
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid GetTarget() const
Definition: Unit.h:2209
Definition: ObjectGuid.h:33