TrinityCore
AuraEffect Class Reference

#include <SpellAuraEffects.h>

Public Member Functions

UnitGetCaster () const
 
ObjectGuid GetCasterGUID () const
 
AuraGetBase () const
 
template<typename Container >
void GetTargetList (Container &targetContainer) const
 
template<typename Container >
void GetApplicationList (Container &applicationContainer) const
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
SpellEffIndex GetEffIndex () const
 
int32 GetBaseAmount () const
 
int32 GetPeriod () const
 
int32 GetMiscValueB () const
 
int32 GetMiscValue () const
 
AuraType GetAuraType () const
 
int32 GetAmount () const
 
void SetAmount (int32 amount)
 
Optional< float > GetEstimatedAmount () const
 
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, AuraEffect const *triggeredBy=nullptr)
 
void RecalculateAmount (AuraEffect const *triggeredBy=nullptr)
 
void RecalculateAmount (Unit *caster, AuraEffect const *triggeredBy=nullptr)
 
bool CanBeRecalculated () const
 
void SetCanBeRecalculated (bool val)
 
void HandleEffect (AuraApplication *aurApp, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
 
void HandleEffect (Unit *target, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
 
void ApplySpellMod (Unit *target, bool apply, AuraEffect const *triggeredBy=nullptr)
 
void Update (uint32 diff, Unit *caster)
 
uint32 GetTickNumber () const
 
uint32 GetRemainingTicks () const
 
uint32 GetTotalTicks () const
 
void ResetPeriodic (bool resetPeriodicTimer=false)
 
void ResetTicks ()
 
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
 
bool CheckEffectProc (AuraApplication *aurApp, ProcEventInfo &eventInfo) const
 
void HandleProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleShapeshiftBoosts (Unit *target, bool apply) const
 
SpellEffectInfo const & GetSpellEffectInfo () 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 HandleDetectAmore (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 HandlePhaseAlwaysVisible (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 HandleAuraDisableAttackingExceptAbilities (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModNoActions (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 HandleAuraModSkill (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraAllowTalentSwapping (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 HandleAuraCanTurnWhileFalling (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleIgnoreMovementForces (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 HandleModDetaunt (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 HandleAuraModMinimumSpeedRate (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMovementForceMagnitude (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMechanicImmunityMask (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 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 HandleModHealingDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModHealingDonePct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTotalPercentStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModExpertise (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModArmorPctFromStat (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 HandleModVersatilityByPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModMaxPower (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 HandleModManaRegenPct (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 HandleModManaCostPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPowerDisplay (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModOverridePowerDisplay (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModMaxPowerPct (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 HandleModSpellHitChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCritChance (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 HandleModRatingPct (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 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 HandleShieldBlockValuePercent (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 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 HandleLearnSpell (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleComprehendLanguage (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 HandleAbsorbOverkill (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 HandleShowConfirmationPrompt (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleOverridePetSpecs (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAllowUsingGameobjectsWhileMounted (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePlayScene (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleCreateAreaTrigger (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleLinkedSummon (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleSetFFAPvP (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModOverrideZonePVPType (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleBattlegroundPlayerPosition (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleTriggerSpellOnPowerAmount (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleTriggerSpellOnPowerPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleStoreTeleportReturnPoint (AuraApplication const *aurApp, uint8 mode, bool apply) 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
 
bool CanPeriodicTickCrit () const
 
float CalcPeriodicCritChance (Unit const *caster) const
 
void HandleBreakableCCAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellWithValueAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerDamageAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleAuraPvpTalents (AuraApplication const *auraApp, uint8 mode, bool apply) const
 

Private Member Functions

friend Aura::~Aura ()
 
 ~AuraEffect ()
 
 AuraEffect (Aura *base, SpellEffectInfo const &spellEfffectInfo, int32 const *baseAmount, Unit *caster)
 
float GetCritChanceFor (Unit const *caster, Unit const *target) const
 

Private Attributes

Aura *const m_base
 
SpellInfo const *const m_spellInfo
 
SpellEffectInfo const & m_effectInfo
 
SpellModifierm_spellmod
 
int32 const m_baseAmount
 
int32 _amount
 
Optional< float > _estimatedAmount
 
int32 _periodicTimer
 
int32 _period
 
uint32 _ticksDone
 
bool m_canBeRecalculated
 
bool m_isPeriodic
 

Friends

class Unit
 
void Aura::_InitEffects (uint32 effMask, Unit *caster, int32 const *baseAmount)
 

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

AuraEffect::~AuraEffect ( )
private
593 {
594  delete m_spellmod;
595 }
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:112

◆ AuraEffect()

AuraEffect::AuraEffect ( Aura base,
SpellEffectInfo const &  spellEfffectInfo,
int32 const *  baseAmount,
Unit caster 
)
explicitprivate
579  :
580 m_base(base), m_spellInfo(base->GetSpellInfo()), m_effectInfo(spellEfffectInfo), m_spellmod(nullptr),
581 m_baseAmount(baseAmount ? *baseAmount : spellEfffectInfo.CalcBaseValue(caster, base->GetType() == UNIT_AURA_TYPE ? base->GetOwner()->ToUnit() : nullptr, base->GetCastItemId(), base->GetCastItemLevel())),
583 m_canBeRecalculated(true), m_isPeriodic(false)
584 {
585  CalculatePeriodic(caster, true, false);
586 
587  _amount = CalculateAmount(caster);
588 
590 }
void CalculatePeriodic(Unit *caster, bool resetPeriodicTimer=true, bool load=false)
Definition: SpellAuraEffects.cpp:732
int32 _period
Definition: SpellAuraEffects.h:120
SpellEffectInfo const & m_effectInfo
Definition: SpellAuraEffects.h:110
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
AuraObjectType GetType() const
Definition: SpellAuras.cpp:524
int32 _amount
Definition: SpellAuraEffects.h:115
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:112
uint32 _ticksDone
Definition: SpellAuraEffects.h:121
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:123
WorldObject * GetOwner() const
Definition: SpellAuras.h:145
bool m_isPeriodic
Definition: SpellAuraEffects.h:124
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:803
Aura *const m_base
Definition: SpellAuraEffects.h:107
int32 _periodicTimer
Definition: SpellAuraEffects.h:119
int32 GetCastItemLevel() const
Definition: SpellAuras.h:142
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: SpellAuraDefines.h:599
int32 CalculateAmount(Unit *caster)
Definition: SpellAuraEffects.cpp:620
int32 const m_baseAmount
Definition: SpellAuraEffects.h:114
Unit * ToUnit()
Definition: Object.h:200
uint32 GetCastItemId() const
Definition: SpellAuras.h:141
+ Here is the call graph for this function:

Member Function Documentation

◆ ApplySpellMod()

void AuraEffect::ApplySpellMod ( Unit target,
bool  apply,
AuraEffect const *  triggeredBy = nullptr 
)
923 {
924  if (!m_spellmod || target->GetTypeId() != TYPEID_PLAYER)
925  return;
926 
927  target->ToPlayer()->AddSpellMod(m_spellmod, apply);
928 
929  // Auras with charges do not mod amount of passive auras
930  if (GetBase()->IsUsingCharges())
931  return;
932 
933  // reapply some passive spells after add/remove related spellmods
934  // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
935  std::bitset<MAX_SPELL_EFFECTS> recalculateEffectMask;
936  switch (SpellModOp(GetMiscValue()))
937  {
938  case SpellModOp::Points:
939  recalculateEffectMask.set();
940  break;
942  recalculateEffectMask.set(EFFECT_0);
943  break;
945  recalculateEffectMask.set(EFFECT_1);
946  break;
948  recalculateEffectMask.set(EFFECT_2);
949  break;
951  recalculateEffectMask.set(EFFECT_3);
952  break;
954  recalculateEffectMask.set(EFFECT_4);
955  break;
956  default:
957  break;
958  }
959 
960  if (recalculateEffectMask.any())
961  {
962  if (!triggeredBy)
963  triggeredBy = this;
964 
965  ObjectGuid guid = target->GetGUID();
966  Unit::AuraApplicationMap& auras = target->GetAppliedAuras();
967  for (auto iter = auras.begin(); iter != auras.end(); ++iter)
968  {
969  Aura* aura = iter->second->GetBase();
970  // only passive and permament auras-active auras should have amount set on spellcast and not be affected
971  // if aura is cast by others, it will not be affected
972  if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
973  for (size_t i = 0; i < recalculateEffectMask.size(); ++i)
974  if (recalculateEffectMask[i])
975  if (AuraEffect* aurEff = aura->GetEffect(i))
976  if (aurEff != triggeredBy)
977  aurEff->RecalculateAmount(triggeredBy);
978  }
979  }
980 }
Definition: SpellAuraEffects.h:28
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
bool IsPassive() const
Definition: SpellAuras.cpp:1095
void AddSpellMod(SpellModifier *mod, bool apply)
Definition: Player.cpp:22374
TypeID GetTypeId() const
Definition: Object.h:167
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:112
Definition: SharedDefines.h:30
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
Definition: SharedDefines.h:32
ObjectGuid const & GetGUID() const
Definition: Object.h:154
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition: SpellInfo.cpp:1722
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1318
AuraEffect * GetEffect(uint32 index) const
Definition: SpellAuras.cpp:516
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
SpellModOp
Definition: SpellDefines.h:131
Definition: ObjectGuid.h:40
Definition: SharedDefines.h:28
Definition: SharedDefines.h:29
bool IsPermanent() const
Definition: SpellAuras.h:177
Definition: ObjectGuid.h:248
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:747
Definition: SpellAuras.h:118
Definition: SharedDefines.h:31
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalcPeriodicCritChance()

float AuraEffect::CalcPeriodicCritChance ( Unit const *  caster) const
5661 {
5662  if (!caster || !CanPeriodicTickCrit())
5663  return 0.0f;
5664 
5665  Player* modOwner = caster->GetSpellModOwner();
5666  if (!modOwner)
5667  return 0.0f;
5668 
5669  float critChance = modOwner->SpellCritChanceDone(nullptr, this, GetSpellInfo()->GetSchoolMask(), GetSpellInfo()->GetAttackType());
5670  return std::max(0.0f, critChance);
5671 }
float SpellCritChanceDone(Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
Definition: Unit.cpp:6621
bool CanPeriodicTickCrit() const
Definition: SpellAuraEffects.cpp:5652
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
Player * GetSpellModOwner() const
Definition: Object.cpp:2073
Definition: Player.h:1056
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateAmount()

int32 AuraEffect::CalculateAmount ( Unit caster)
621 {
622  // default amount calculation
623  int32 amount = 0;
624 
626  amount = GetSpellEffectInfo().CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit(), nullptr, GetBase()->GetCastItemId(), GetBase()->GetCastItemLevel());
627  else if (caster && caster->GetTypeId() == TYPEID_PLAYER)
628  amount = int32(caster->ToPlayer()->m_activePlayerData->Mastery * GetSpellEffectInfo().BonusCoefficient);
629 
630  // custom amount calculations go here
631  switch (GetAuraType())
632  {
633  // crowd control auras
635  case SPELL_AURA_MOD_FEAR:
636  case SPELL_AURA_MOD_STUN:
637  case SPELL_AURA_MOD_ROOT:
640  m_canBeRecalculated = false;
641  if (!m_spellInfo->ProcFlags)
642  break;
643  amount = int32(GetBase()->GetUnitOwner()->CountPctFromMaxHealth(10));
644  break;
647  m_canBeRecalculated = false;
648  break;
649  case SPELL_AURA_MOUNTED:
650  {
651  uint32 mountType = uint32(GetMiscValueB());
652  if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId()))
653  mountType = mountEntry->MountTypeID;
654 
655  if (MountCapabilityEntry const* mountCapability = GetBase()->GetUnitOwner()->GetMountCapability(mountType))
656  {
657  amount = mountCapability->ID;
658  m_canBeRecalculated = false;
659  }
660  break;
661  }
663  if (caster)
664  amount = caster->GetMap()->GetDifficultyID();
665  m_canBeRecalculated = false;
666  break;
667  default:
668  break;
669  }
670 
671  if (GetSpellInfo()->HasAttribute(SPELL_ATTR10_ROLLING_PERIODIC))
672  {
674  amount = std::accumulate(std::begin(periodicAuras), std::end(periodicAuras), amount, [this](int32 val, AuraEffect const* aurEff)
675  {
676  if (aurEff->GetCasterGUID() == GetCasterGUID() && aurEff->GetId() == GetId() && aurEff->GetEffIndex() == GetEffIndex() && aurEff->GetTotalTicks() > 0)
677  val += aurEff->GetAmount() * static_cast<int32>(aurEff->GetRemainingTicks()) / static_cast<int32>(aurEff->GetTotalTicks());
678  return val;
679  });
680  }
681 
683  if (!GetSpellEffectInfo().EffectAttributes.HasFlag(SpellEffectAttributes::NoScaleWithStack))
684  amount *= GetBase()->GetStackAmount();
685 
686  if (caster && GetBase()->GetType() == UNIT_AURA_TYPE)
687  {
689 
690  switch (GetAuraType())
691  {
694  _estimatedAmount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetSpellEffectInfo(), stackAmountForBonuses);
695  break;
697  _estimatedAmount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetSpellEffectInfo(), stackAmountForBonuses);
698  break;
699  default:
700  break;
701  }
702  }
703 
704  return amount;
705 }
Definition: SpellAuraDefines.h:141
Definition: SpellAuraEffects.h:28
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Definition: SpellAuraDefines.h:557
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
Definition: Unit.cpp:6828
Definition: SharedDefines.h:750
Definition: SpellAuraDefines.h:100
#define sDB2Manager
Definition: DB2Stores.h:445
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
Definition: SpellAuraDefines.h:95
Difficulty GetDifficultyID() const
Definition: Map.h:387
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:114
UF::UpdateField< UF::ActivePlayerData, 0, TYPEID_ACTIVE_PLAYER > m_activePlayerData
Definition: Player.h:2686
Definition: SpellAuraDefines.h:166
Unit * GetUnitOwner() const
Definition: SpellAuras.h:146
uint8 GetStackAmount() const
Definition: SpellAuras.h:188
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
Definition: Unit.cpp:7582
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:754
uint32 GetRemainingTicks() const
Definition: SpellAuraEffects.h:81
Definition: SharedDefines.h:693
uint32 GetId() const
Definition: SpellAuraEffects.h:50
Optional< float > _estimatedAmount
Definition: SpellAuraEffects.h:116
Definition: Unit.h:331
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:123
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1) const
Definition: Unit.cpp:6341
Map * GetMap() const
Definition: Object.h:535
uint32 ProcFlags
Definition: SpellInfo.h:423
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:486
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1365
uint32 GetTotalTicks() const
Definition: SpellAuraEffects.cpp:707
Definition: SpellAuraDefines.h:93
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
int32 CalcValue(WorldObject const *caster=nullptr, int32 const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
Definition: SpellInfo.cpp:456
int32 GetMiscValueB() const
Definition: SpellAuraEffects.h:55
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: SpellAuras.cpp:2091
float BonusCoefficient
Definition: SpellInfo.h:278
Definition: ObjectGuid.h:40
Definition: SpellAuraDefines.h:543
Definition: SpellAuraDefines.h:144
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: SpellAuraDefines.h:96
constexpr bool HasFlag(T flag) const
Definition: EnumFlag.h:106
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: SpellAuraDefines.h:185
EnumFlag< SpellEffectAttributes > EffectAttributes
Definition: SpellInfo.h:293
Definition: SpellAuraDefines.h:157
Definition: SpellAuraDefines.h:91
Definition: DB2Structure.h:2466
Definition: SpellAuraDefines.h:599
int32 const m_baseAmount
Definition: SpellAuraEffects.h:114
Definition: DB2Structure.h:2447
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculatePeriodic()

void AuraEffect::CalculatePeriodic ( Unit caster,
bool  resetPeriodicTimer = true,
bool  load = false 
)
733 {
735 
736  // prepare periodics
737  switch (GetAuraType())
738  {
752  m_isPeriodic = true;
753  break;
754  default:
755  break;
756  }
757 
759 
760  if (!m_isPeriodic)
761  return;
762 
763  Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
764  // Apply casting time mods
765  if (_period)
766  {
767  // Apply periodic time mod
768  if (modOwner)
770 
771  if (caster)
772  {
773  // Haste modifies periodic time of channeled spells
774  if (m_spellInfo->IsChanneled())
777  _period = int32(_period * caster->m_unitData->ModCastingSpeed);
778  }
779  }
780  else // prevent infinite loop on Update
781  m_isPeriodic = false;
782 
783  if (load) // aura loaded from db
784  {
785  if (_period && !GetBase()->IsPermanent())
786  {
787  uint32 elapsedTime = GetBase()->GetMaxDuration() - GetBase()->GetDuration();
788  _ticksDone = elapsedTime / uint32(_period);
789  _periodicTimer = elapsedTime % uint32(_period);
790  }
791 
793  ++_ticksDone;
794  }
795  else // aura just created or reapplied
796  {
797  // reset periodic timer on aura create or reapply
798  // we don't reset periodic timers when aura is triggered by proc
799  ResetPeriodic(resetPeriodicTimer);
800  }
801 }
Definition: SpellAuraDefines.h:141
Definition: SharedDefines.h:569
bool IsChanneled() const
Definition: SpellInfo.cpp:1617
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Definition: SpellAuraDefines.h:111
void ModSpellDurationTime(SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
Definition: Object.cpp:2266
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
Definition: SpellAuraDefines.h:150
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition: SpellAuras.cpp:2105
Definition: SpellAuraDefines.h:108
int32 _period
Definition: SpellAuraEffects.h:120
int32 GetDuration() const
Definition: SpellAuras.h:172
void ApplySpellMod(SpellInfo const *spellInfo, SpellModOp op, T &basevalue, Spell *spell=nullptr) const
Definition: Player.cpp:22360
void ResetPeriodic(bool resetPeriodicTimer=false)
Definition: SpellAuraEffects.cpp:720
uint32 _ticksDone
Definition: SpellAuraEffects.h:121
Definition: SharedDefines.h:565
Definition: SpellAuraDefines.h:152
bool m_isPeriodic
Definition: SpellAuraEffects.h:124
Definition: SpellAuraDefines.h:250
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:486
UF::UpdateField< UF::UnitData, 0, TYPEID_UNIT > m_unitData
Definition: Unit.h:1826
int32 _periodicTimer
Definition: SpellAuraEffects.h:119
Definition: SpellAuraDefines.h:177
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
Definition: SpellAuraDefines.h:314
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:315
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: SpellAuraDefines.h:96
bool IsPermanent() const
Definition: SpellAuras.h:177
Player * GetSpellModOwner() const
Definition: Object.cpp:2073
Definition: SpellAuraDefines.h:91
int32 GetMaxDuration() const
Definition: SpellAuras.h:167
Definition: SpellAuraDefines.h:112
Definition: SpellAuraDefines.h:109
Definition: Player.h:1056
uint32 ApplyAuraPeriod
Definition: SpellInfo.h:272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateSpellMod()

void AuraEffect::CalculateSpellMod ( )
804 {
805  switch (GetAuraType())
806  {
809  if (!m_spellmod)
810  {
813 
815  m_spellmod->spellId = GetId();
817  }
819  break;
820  default:
821  break;
822  }
824 }
SpellModOp op
Definition: Player.h:249
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition: SpellAuras.cpp:2119
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
Definition: Player.h:245
Definition: Player.h:143
uint32 GetId() const
Definition: SpellAuraEffects.h:50
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:112
SpellModType type
Definition: Player.h:250
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
Definition: SpellAuraDefines.h:196
uint32 spellId
Definition: Player.h:254
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
flag128 mask
Definition: Player.h:253
flag128 SpellClassMask
Definition: SpellInfo.h:290
SpellModOp
Definition: SpellDefines.h:131
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Player.h:142
int32 value
Definition: Player.h:252
Definition: SpellAuraDefines.h:195
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanBeRecalculated()

bool AuraEffect::CanBeRecalculated ( ) const
inline
72 { return m_canBeRecalculated; }
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:123
+ Here is the caller graph for this function:

◆ CanPeriodicTickCrit()

bool AuraEffect::CanPeriodicTickCrit ( ) const
5653 {
5654  if (GetSpellInfo()->HasAttribute(SPELL_ATTR2_CANT_CRIT))
5655  return false;
5656 
5657  return true;
5658 }
Definition: SharedDefines.h:477
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ChangeAmount()

void AuraEffect::ChangeAmount ( int32  newAmount,
bool  mark = true,
bool  onStackOrReapply = false,
AuraEffect const *  triggeredBy = nullptr 
)
827 {
828  // Reapply if amount change
829  uint8 handleMask = 0;
830  if (newAmount != GetAmount())
831  handleMask |= AURA_EFFECT_HANDLE_CHANGE_AMOUNT;
832  if (onStackOrReapply)
833  handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
834 
835  if (!handleMask)
836  return;
837 
838  std::vector<AuraApplication*> effectApplications;
839  GetApplicationList(effectApplications);
840 
841  for (AuraApplication* aurApp : effectApplications)
842  {
843  aurApp->GetTarget()->_RegisterAuraEffect(this, false);
844  HandleEffect(aurApp, handleMask, false, triggeredBy);
845  }
846 
847  if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
848  {
849  if (!mark)
850  _amount = newAmount;
851  else
852  SetAmount(newAmount);
854  }
855 
856  for (AuraApplication* aurApp : effectApplications)
857  {
858  if (aurApp->GetRemoveMode() != AURA_REMOVE_NONE)
859  continue;
860 
861  aurApp->GetTarget()->_RegisterAuraEffect(this, true);
862  HandleEffect(aurApp, handleMask, true, triggeredBy);
863  }
864 
867 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
Definition: SpellAuraEffects.cpp:869
Definition: SpellAuras.h:53
int32 _amount
Definition: SpellAuraEffects.h:115
static bool EffectTypeNeedsSendingAmount(AuraType type)
Definition: SpellAuras.cpp:1253
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:803
void SetNeedClientUpdateForTargets() const
Definition: SpellAuras.cpp:1308
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:64
Definition: SpellAuraDefines.h:52
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:59
void GetApplicationList(Container &applicationContainer) const
Definition: SpellAuraEffects.cpp:610
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
Definition: SharedDefines.h:676
uint8_t uint8
Definition: Define.h:154
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: SpellAuraDefines.h:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckEffectProc()

bool AuraEffect::CheckEffectProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
) const
1085 {
1086  bool result = GetBase()->CallScriptCheckEffectProcHandlers(this, aurApp, eventInfo);
1087  if (!result)
1088  return false;
1089 
1090  SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1091  switch (GetAuraType())
1092  {
1094  case SPELL_AURA_MOD_FEAR:
1095  case SPELL_AURA_MOD_STUN:
1096  case SPELL_AURA_MOD_ROOT:
1097  case SPELL_AURA_TRANSFORM:
1098  {
1099  DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1100  if (!damageInfo || !damageInfo->GetDamage())
1101  return false;
1102 
1103  // Spell own damage at apply won't break CC
1104  if (spellInfo && spellInfo == GetSpellInfo())
1105  {
1106  Aura* aura = GetBase();
1107  // called from spellcast, should not have ticked yet
1108  if (aura->GetDuration() == aura->GetMaxDuration())
1109  return false;
1110  }
1111  break;
1112  }
1115  // compare mechanic
1116  if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (1 << GetMiscValue())))
1117  return false;
1118  break;
1120  // skip melee hits and instant cast spells
1121  if (!eventInfo.GetProcSpell() || !eventInfo.GetProcSpell()->GetCastTime())
1122  return false;
1123  break;
1126  // Compare casters
1127  if (GetCasterGUID() != eventInfo.GetActor()->GetGUID())
1128  return false;
1129  break;
1132  {
1133  // Skip melee hits and spells with wrong school or zero cost
1134  if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue()) // School Check
1135  || !eventInfo.GetProcSpell())
1136  return false;
1137 
1138  // Costs Check
1139  std::vector<SpellPowerCost> const& costs = eventInfo.GetProcSpell()->GetPowerCost();
1140  auto m = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Amount > 0; });
1141  if (m == costs.end())
1142  return false;
1143  break;
1144  }
1146  // Skip melee hits and spells with wrong school
1147  if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue()))
1148  return false;
1149  break;
1152  {
1153  // Don't proc extra attacks while already processing extra attack spell
1154  uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
1155  if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
1156  if (aurApp->GetTarget()->m_extraAttacks && triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
1157  return false;
1158  break;
1159  }
1161  // skip spells that can't crit
1162  if (!spellInfo || !spellInfo->HasAttribute(SPELL_ATTR0_CU_CAN_CRIT))
1163  return false;
1164  break;
1165  default:
1166  break;
1167  }
1168 
1169  return result;
1170 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Definition: SpellInfo.h:195
Definition: SpellAuraDefines.h:100
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
Definition: SpellAuraDefines.h:95
DamageInfo * GetDamageInfo() const
Definition: Unit.h:495
Definition: SpellAuraDefines.h:161
Definition: SpellAuraDefines.h:114
Definition: SpellAuraDefines.h:358
Definition: SpellInfo.h:372
int32 GetDuration() const
Definition: SpellAuras.h:172
std::vector< SpellPowerCost > const & GetPowerCost() const
Definition: Spell.h:713
int32 GetCastTime() const
Definition: Spell.h:681
Definition: SpellAuraDefines.h:145
Definition: SharedDefines.h:1111
uint32 GetAllEffectsMechanicMask() const
Definition: SpellInfo.cpp:2335
Unit * GetTarget() const
Definition: SpellAuras.h:74
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
Spell const * GetProcSpell() const
Definition: Unit.h:498
Definition: SpellAuraDefines.h:130
Definition: SpellAuraDefines.h:359
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
Definition: SpellAuraDefines.h:165
Definition: SpellInfo.h:366
Definition: SpellAuraDefines.h:162
ObjectGuid const & GetGUID() const
Definition: Object.h:154
uint32 TriggerSpell
Definition: SpellInfo.h:289
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:486
Definition: SpellAuraDefines.h:93
#define sSpellMgr
Definition: SpellMgr.h:790
Definition: SpellAuraDefines.h:205
uint32_t uint32
Definition: Define.h:152
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:2330
Definition: SpellAuraDefines.h:153
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
uint32 m_extraAttacks
Definition: Unit.h:801
Unit * GetActor()
Definition: Unit.h:483
SpellInfo const * GetSpellInfo() const
Definition: Unit.cpp:268
Definition: SpellAuraDefines.h:144
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
Definition: SpellAuraDefines.h:319
int32 GetMaxDuration() const
Definition: SpellAuras.h:167
Definition: SpellAuras.h:118
Definition: SpellAuraDefines.h:160
bool CallScriptCheckEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition: SpellAuras.cpp:2297
uint32 GetDamage() const
Definition: Unit.h:436
Definition: Unit.h:405
+ Here is the call graph for this function:

◆ GetAmount()

int32 AuraEffect::GetAmount ( ) const
inline
58 { return _amount; }
int32 _amount
Definition: SpellAuraEffects.h:115

◆ GetApplicationList()

template<typename Container >
template TC_GAME_API void AuraEffect::GetApplicationList ( Container &  applicationContainer) const
611 {
612  Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
613  for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
614  {
615  if (appIter->second->HasEffect(GetEffIndex()))
616  applicationContainer.push_back(appIter->second);
617  }
618 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
std::unordered_map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:123
ApplicationMap const & GetApplicationMap()
Definition: SpellAuras.h:233
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAuraType()

AuraType AuraEffect::GetAuraType ( ) const
inline
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
AuraType ApplyAuraName
Definition: SpellInfo.h:271
+ Here is the caller graph for this function:

◆ GetBase()

Aura* AuraEffect::GetBase ( ) const
inline
41 { return m_base; }
Aura *const m_base
Definition: SpellAuraEffects.h:107
+ Here is the caller graph for this function:

◆ GetBaseAmount()

int32 AuraEffect::GetBaseAmount ( ) const
inline
52 { return m_baseAmount; }
int32 const m_baseAmount
Definition: SpellAuraEffects.h:114
+ Here is the caller graph for this function:

◆ GetCaster()

Unit* AuraEffect::GetCaster ( ) const
inline
39 { return GetBase()->GetCaster(); }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Unit * GetCaster() const
Definition: SpellAuras.cpp:506
+ Here is the caller graph for this function:

◆ GetCasterGUID()

ObjectGuid AuraEffect::GetCasterGUID ( ) const
inline
40 { return GetBase()->GetCasterGUID(); }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:139
+ Here is the caller graph for this function:

◆ GetCritChanceFor()

float AuraEffect::GetCritChanceFor ( Unit const *  caster,
Unit const *  target 
) const
private
1011 {
1012  return target->SpellCritChanceTaken(caster, nullptr, this, GetSpellInfo()->GetSchoolMask(), CalcPeriodicCritChance(caster), GetSpellInfo()->GetAttackType());
1013 }
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
float CalcPeriodicCritChance(Unit const *caster) const
Definition: SpellAuraEffects.cpp:5660
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEffIndex()

SpellEffIndex AuraEffect::GetEffIndex ( ) const
inline
51 { return m_effectInfo.EffectIndex; }
SpellEffectInfo const & m_effectInfo
Definition: SpellAuraEffects.h:110
SpellEffIndex EffectIndex
Definition: SpellInfo.h:269
+ Here is the caller graph for this function:

◆ GetEstimatedAmount()

Optional<float> AuraEffect::GetEstimatedAmount ( ) const
inline
61 { return _estimatedAmount; }
Optional< float > _estimatedAmount
Definition: SpellAuraEffects.h:116

◆ GetId()

uint32 AuraEffect::GetId ( ) const
inline
50 { return m_spellInfo->Id; }
uint32 const Id
Definition: SpellInfo.h:377
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
+ Here is the caller graph for this function:

◆ GetMiscValue()

int32 AuraEffect::GetMiscValue ( ) const
inline
56 { return GetSpellEffectInfo().MiscValue; }
int32 MiscValue
Definition: SpellInfo.h:279
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
+ Here is the caller graph for this function:

◆ GetMiscValueB()

int32 AuraEffect::GetMiscValueB ( ) const
inline
55 { return GetSpellEffectInfo().MiscValueB; }
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
int32 MiscValueB
Definition: SpellInfo.h:280
+ Here is the caller graph for this function:

◆ GetPeriod()

int32 AuraEffect::GetPeriod ( ) const
inline
53 { return _period; }
int32 _period
Definition: SpellAuraEffects.h:120
+ Here is the caller graph for this function:

◆ GetPeriodicTimer()

int32 AuraEffect::GetPeriodicTimer ( ) const
inline
63 { return _periodicTimer; }
int32 _periodicTimer
Definition: SpellAuraEffects.h:119
+ Here is the caller graph for this function:

◆ GetRemainingTicks()

uint32 AuraEffect::GetRemainingTicks ( ) const
inline
81 { return GetTotalTicks() - _ticksDone; }
uint32 _ticksDone
Definition: SpellAuraEffects.h:121
uint32 GetTotalTicks() const
Definition: SpellAuraEffects.cpp:707
+ Here is the caller graph for this function:

◆ GetSpellEffectInfo()

SpellEffectInfo const& AuraEffect::GetSpellEffectInfo ( ) const
inline
100 { return m_effectInfo; }
SpellEffectInfo const & m_effectInfo
Definition: SpellAuraEffects.h:110
+ Here is the caller graph for this function:

◆ GetSpellInfo()

SpellInfo const* AuraEffect::GetSpellInfo ( ) const
inline
49 { return m_spellInfo; }
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
+ Here is the caller graph for this function:

◆ GetTargetList()

template<typename Container >
template TC_GAME_API void AuraEffect::GetTargetList ( Container &  targetContainer) const
599 {
600  Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
601  // remove all targets which were not added to new list - they no longer deserve area aura
602  for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
603  {
604  if (appIter->second->HasEffect(GetEffIndex()))
605  targetContainer.push_back(appIter->second->GetTarget());
606  }
607 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
std::unordered_map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:123
ApplicationMap const & GetApplicationMap()
Definition: SpellAuras.h:233
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTickNumber()

uint32 AuraEffect::GetTickNumber ( ) const
inline
80 { return _ticksDone; }
uint32 _ticksDone
Definition: SpellAuraEffects.h:121
+ Here is the caller graph for this function:

◆ GetTotalTicks()

uint32 AuraEffect::GetTotalTicks ( ) const
708 {
709  uint32 totalTicks = 0;
710  if (_period && !GetBase()->IsPermanent())
711  {
712  totalTicks = static_cast<uint32>(GetBase()->GetMaxDuration() / _period);
714  ++totalTicks;
715  }
716 
717  return totalTicks;
718 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
int32 _period
Definition: SpellAuraEffects.h:120
Definition: SharedDefines.h:565
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:486
uint32_t uint32
Definition: Define.h:152
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
int32 GetMaxDuration() const
Definition: SpellAuras.h:167
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAbsorbOverkill()

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

◆ HandleAllowUsingGameobjectsWhileMounted()

void AuraEffect::HandleAllowUsingGameobjectsWhileMounted ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5815 {
5816  if (!(mode & AURA_EFFECT_HANDLE_REAL))
5817  return;
5818 
5819  Player* target = aurApp->GetTarget()->ToPlayer();
5820  if (!target)
5821  return;
5822 
5823  if (apply)
5827 }
void RemovePlayerLocalFlag(PlayerLocalFlags flags)
Definition: Player.h:2669
void AddPlayerLocalFlag(PlayerLocalFlags flags)
Definition: Player.h:2668
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: SpellAuraDefines.h:563
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ HandleArenaPreparation()

void AuraEffect::HandleArenaPreparation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4338 {
4339  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4340  return;
4341 
4342  Unit* target = aurApp->GetTarget();
4343 
4344  if (apply)
4346  else
4347  {
4348  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4349  if (target->HasAuraType(GetAuraType()))
4350  return;
4352  }
4353 
4355 }
void ModifyAuraState(AuraStateType flag, bool apply)
Definition: Unit.cpp:5626
Definition: UnitDefines.h:124
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:927
Definition: SharedDefines.h:2323
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
void AddUnitFlag(UnitFlags flags)
Definition: Unit.h:926
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraAllowFlight()

void AuraEffect::HandleAuraAllowFlight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2566 {
2568  return;
2569 
2570  Unit* target = aurApp->GetTarget();
2571 
2572  if (!apply)
2573  {
2574  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2576  return;
2577  }
2578 
2580 
2581  if (target->SetCanFly(apply))
2582  if (!apply && !target->IsLevitating())
2583  target->GetMotionMaster()->MoveFall();
2584 }
MotionMaster * GetMotionMaster()
Definition: Unit.h:1691
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void MoveFall(uint32 id=0)
Definition: MotionMaster.cpp:593
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:295
bool SetCanFly(bool enable)
Definition: Unit.cpp:12428
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
bool SetCanTransitionBetweenSwimAndFly(bool enable)
Definition: Unit.cpp:12635
Definition: Unit.h:736
bool IsLevitating() const
Definition: Unit.h:1190
+ Here is the call graph for this function:

◆ HandleAuraAllowTalentSwapping()

void AuraEffect::HandleAuraAllowTalentSwapping ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2464 {
2465  if (!(mode & (AURA_EFFECT_HANDLE_REAL)))
2466  return;
2467 
2468  Player* target = aurApp->GetTarget()->ToPlayer();
2469  if (!target)
2470  return;
2471 
2472  if (apply)
2474  else if (!target->HasAuraType(GetAuraType()))
2476 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:166
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:931
void AddUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:930
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ HandleAuraCanTurnWhileFalling()

void AuraEffect::HandleAuraCanTurnWhileFalling ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2672 {
2674  return;
2675 
2676  Unit* target = aurApp->GetTarget();
2677 
2678  if (!apply)
2679  {
2680  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2681  if (target->HasAuraType(GetAuraType()))
2682  return;
2683  }
2684 
2685  target->SetCanTurnWhileFalling(apply);
2686 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
bool SetCanTurnWhileFalling(bool enable)
Definition: Unit.cpp:12669
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraCloneCaster()

void AuraEffect::HandleAuraCloneCaster ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2033 {
2035  return;
2036 
2037  Unit* target = aurApp->GetTarget();
2038 
2039  if (apply)
2040  {
2041  Unit* caster = GetCaster();
2042  if (!caster || caster == target)
2043  return;
2044 
2045  // What must be cloned? at least display and scale
2046  target->SetDisplayId(caster->GetDisplayId());
2047  //target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?)
2049  }
2050  else
2051  {
2052  target->SetDisplayId(target->GetNativeDisplayId());
2054  }
2055 }
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint32 GetNativeDisplayId() const
Definition: Unit.h:1605
Definition: SpellAuraDefines.h:56
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:931
uint32 GetDisplayId() const
Definition: Unit.h:1603
virtual void SetDisplayId(uint32 modelId, float displayScale=1.f)
Definition: Unit.cpp:9878
Definition: UnitDefines.h:161
void AddUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:930
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraControlVehicle()

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

2936 {
2938  return;
2939 
2940  Unit* target = aurApp->GetTarget();
2941  if (!target->IsVehicle())
2942  return;
2943 
2944  Unit* caster = GetCaster();
2945  if (!caster || caster == target)
2946  return;
2947 
2948  if (apply)
2949  {
2950  // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
2951  // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
2952  // so this break such spells or most of them.
2953  // Current formula about m_amount: effect base points + dieside - 1
2954  // TO DO: Reasearch more about 0/0 and fix it.
2955  caster->_EnterVehicle(target->GetVehicleKit(), GetAmount() - 1, aurApp);
2956  }
2957  else
2958  {
2959  // Remove pending passengers before exiting vehicle - might cause an Uninstall
2961 
2962  if (GetId() == 53111) // Devour Humanoid
2963  {
2964  Unit::Kill(target, caster);
2965  if (caster->GetTypeId() == TYPEID_UNIT)
2966  caster->ToCreature()->DespawnOrUnsummon();
2967  }
2968 
2969  bool seatChange = (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT) // Seat change on the same direct vehicle
2970  || target->HasAuraTypeWithCaster(SPELL_AURA_CONTROL_VEHICLE, caster->GetGUID()); // Seat change to a proxy vehicle (for example turret mounted on a siege engine)
2971 
2972  if (!seatChange)
2973  caster->_ExitVehicle();
2974  else
2975  target->GetVehicleKit()->RemovePassenger(caster); // Only remove passenger from vehicle without launching exit movement or despawning the vehicle
2976 
2977  // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
2978  caster->RemoveAurasDueToSpell(GetId());
2979  }
2980 }
bool HasAuraTypeWithCaster(AuraType auratype, ObjectGuid caster) const
Definition: Unit.cpp:4433
void DespawnOrUnsummon(uint32 msTimeToDespawn=0, Seconds const &forceRespawnTime=Seconds(0))
Definition: Creature.cpp:2314
TypeID GetTypeId() const
Definition: Object.h:167
Vehicle * GetVehicleKit() const
Definition: Unit.h:1748
Definition: ObjectGuid.h:39
uint32 GetId() const
Definition: SpellAuraEffects.h:50
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:11917
ObjectGuid GetTarget() const
Definition: Unit.h:1798
ObjectGuid const & GetGUID() const
Definition: Object.h:154
void RemovePendingEventsForPassenger(Unit *passenger)
Definition: Vehicle.cpp:726
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition: Unit.cpp:10328
bool IsVehicle() const
Definition: Unit.h:841
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
Definition: Vehicle.cpp:469
Definition: SpellAuraDefines.h:52
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3654
Creature * ToCreature()
Definition: Object.h:196
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition: Unit.cpp:11831
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: SpellAuraDefines.h:324
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraDisableAttackingExceptAbilities()

void AuraEffect::HandleAuraDisableAttackingExceptAbilities ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2307 {
2309  return;
2310 
2311  if (apply)
2312  aurApp->GetTarget()->AttackStop();
2313 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Definition: SpellAuraDefines.h:56
+ Here is the call graph for this function:

◆ HandleAuraDummy()

void AuraEffect::HandleAuraDummy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4380 {
4382  return;
4383 
4384  Unit* target = aurApp->GetTarget();
4385 
4386  Unit* caster = GetCaster();
4387 
4388  // pet auras
4389  if (target->GetTypeId() == TYPEID_PLAYER && (mode & AURA_EFFECT_HANDLE_REAL))
4390  {
4391  if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), GetEffIndex()))
4392  {
4393  if (apply)
4394  target->ToPlayer()->AddPetAura(petSpell);
4395  else
4396  target->ToPlayer()->RemovePetAura(petSpell);
4397  }
4398  }
4399 
4401  {
4402  // AT APPLY
4403  if (apply)
4404  {
4405  switch (GetId())
4406  {
4407  case 1515: // Tame beast
4408  // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
4409  if (caster && target->CanHaveThreatList())
4410  target->GetThreatManager().AddThreat(caster, 10.0f);
4411  break;
4412  case 13139: // net-o-matic
4413  // root to self part of (root_target->charge->root_self sequence
4414  if (caster)
4415  caster->CastSpell(caster, 13138, this);
4416  break;
4417  case 34026: // kill command
4418  {
4419  Unit* pet = target->GetGuardianPet();
4420  if (!pet)
4421  break;
4422 
4423  target->CastSpell(target, 34027, this);
4424 
4425  // set 3 stacks and 3 charges (to make all auras not disappear at once)
4426  Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
4427  Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
4428  if (owner_aura)
4429  {
4430  owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4431  if (pet_aura)
4432  {
4433  pet_aura->SetCharges(0);
4434  pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4435  }
4436  }
4437  break;
4438  }
4439  case 37096: // Blood Elf Illusion
4440  {
4441  if (caster)
4442  {
4443  if (caster->getGender() == GENDER_FEMALE)
4444  caster->CastSpell(target, 37095, this); // Blood Elf Disguise
4445  else
4446  caster->CastSpell(target, 37093, this);
4447  }
4448  break;
4449  }
4450  case 39850: // Rocket Blast
4451  if (roll_chance_i(20)) // backfire stun
4452  target->CastSpell(target, 51581, this);
4453  break;
4454  case 43873: // Headless Horseman Laugh
4455  target->PlayDistanceSound(11965);
4456  break;
4457  case 46354: // Blood Elf Illusion
4458  if (caster)
4459  {
4460  if (caster->getGender() == GENDER_FEMALE)
4461  caster->CastSpell(target, 46356, this);
4462  else
4463  caster->CastSpell(target, 46355, this);
4464  }
4465  break;
4466  case 46361: // Reinforced Net
4467  if (caster)
4468  target->GetMotionMaster()->MoveFall();
4469  break;
4470  }
4471  }
4472  // AT REMOVE
4473  else
4474  {
4475  if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive())
4476  {
4477  uint32 finalSpelId = 0;
4478  switch (GetId())
4479  {
4480  case 19548: finalSpelId = 19597; break;
4481  case 19674: finalSpelId = 19677; break;
4482  case 19687: finalSpelId = 19676; break;
4483  case 19688: finalSpelId = 19678; break;
4484  case 19689: finalSpelId = 19679; break;
4485  case 19692: finalSpelId = 19680; break;
4486  case 19693: finalSpelId = 19684; break;
4487  case 19694: finalSpelId = 19681; break;
4488  case 19696: finalSpelId = 19682; break;
4489  case 19697: finalSpelId = 19683; break;
4490  case 19699: finalSpelId = 19685; break;
4491  case 19700: finalSpelId = 19686; break;
4492  case 30646: finalSpelId = 30647; break;
4493  case 30653: finalSpelId = 30648; break;
4494  case 30654: finalSpelId = 30652; break;
4495  case 30099: finalSpelId = 30100; break;
4496  case 30102: finalSpelId = 30103; break;
4497  case 30105: finalSpelId = 30104; break;
4498  }
4499 
4500  if (finalSpelId)
4501  caster->CastSpell(target, finalSpelId, this);
4502  }
4503 
4504  switch (m_spellInfo->SpellFamilyName)
4505  {
4506  case SPELLFAMILY_GENERIC:
4507  switch (GetId())
4508  {
4509  case 2584: // Waiting to Resurrect
4510  // Waiting to resurrect spell cancel, we must remove player from resurrect queue
4511  if (target->GetTypeId() == TYPEID_PLAYER)
4512  {
4513  if (Battleground* bg = target->ToPlayer()->GetBattleground())
4514  bg->RemovePlayerFromResurrectQueue(target->GetGUID());
4515  if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
4516  bf->RemovePlayerFromResurrectQueue(target->GetGUID());
4517  }
4518  break;
4519  case 36730: // Flame Strike
4520  {
4521  target->CastSpell(target, 36731, this);
4522  break;
4523  }
4524  case 44191: // Flame Strike
4525  {
4526  if (target->GetMap()->IsDungeon())
4527  {
4528  uint32 spellId = target->GetMap()->IsHeroic() ? 46163 : 44190;
4529 
4530  target->CastSpell(target, spellId, this);
4531  }
4532  break;
4533  }
4534  case 43681: // Inactive
4535  {
4536  if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
4537  return;
4538 
4539  if (target->GetMap()->IsBattleground())
4540  target->ToPlayer()->LeaveBattleground();
4541  break;
4542  }
4543  case 42783: // Wrath of the Astromancer
4544  target->CastSpell(target, GetAmount(), this);
4545  break;
4546  case 46308: // Burning Winds cast only at creatures at spawn
4547  target->CastSpell(target, 47287, this);
4548  break;
4549  case 52172: // Coyote Spirit Despawn Aura
4550  case 60244: // Blood Parrot Despawn Aura
4551  target->CastSpell(nullptr, GetAmount(), this);
4552  break;
4553  case 91604: // Restricted Flight Area
4554  if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
4555  target->CastSpell(target, 58601, true);
4556  break;
4557  }
4558  break;
4560  // Summon Gargoyle (Dismiss Gargoyle at remove)
4561  if (GetId() == 61777)
4562  target->CastSpell(target, GetAmount(), true);
4563  break;
4564  default:
4565  break;
4566  }
4567  }
4568  }
4569 
4570  // AT APPLY & REMOVE
4571 
4572  switch (m_spellInfo->SpellFamilyName)
4573  {
4574  case SPELLFAMILY_GENERIC:
4575  {
4576  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4577  break;
4578  switch (GetId())
4579  {
4580  // Recently Bandaged
4581  case 11196:
4583  break;
4584  // Unstable Power
4585  case 24658:
4586  {
4587  uint32 spellId = 24659;
4588  if (apply && caster)
4589  {
4590  SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
4591  CastSpellExtraArgs args;
4593  args.OriginalCaster = GetCasterGUID();
4594  args.CastDifficulty = spell->Difficulty;
4595 
4596  for (uint32 i = 0; i < spell->StackAmount; ++i)
4597  caster->CastSpell(target, spell->Id, args);
4598  break;
4599  }
4600  target->RemoveAurasDueToSpell(spellId);
4601  break;
4602  }
4603  // Restless Strength
4604  case 24661:
4605  {
4606  uint32 spellId = 24662;
4607  if (apply && caster)
4608  {
4609  SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
4610  CastSpellExtraArgs args;
4612  args.OriginalCaster = GetCasterGUID();
4613  args.CastDifficulty = spell->Difficulty;
4614 
4615  for (uint32 i = 0; i < spell->StackAmount; ++i)
4616  caster->CastSpell(target, spell->Id, args);
4617  break;
4618  }
4619  target->RemoveAurasDueToSpell(spellId);
4620  break;
4621  }
4622  // Tag Murloc
4623  case 30877:
4624  {
4625  // Tag/untag Blacksilt Scout
4626  target->SetEntry(apply ? 17654 : 17326);
4627  break;
4628  }
4629  case 57819: // Argent Champion
4630  case 57820: // Ebon Champion
4631  case 57821: // Champion of the Kirin Tor
4632  case 57822: // Wyrmrest Champion
4633  {
4634  if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
4635  break;
4636 
4637  uint32 FactionID = 0;
4638 
4639  if (apply)
4640  {
4641  switch (m_spellInfo->Id)
4642  {
4643  case 57819: FactionID = 1106; break; // Argent Crusade
4644  case 57820: FactionID = 1098; break; // Knights of the Ebon Blade
4645  case 57821: FactionID = 1090; break; // Kirin Tor
4646  case 57822: FactionID = 1091; break; // The Wyrmrest Accord
4647  }
4648  }
4649  caster->ToPlayer()->SetChampioningFaction(FactionID);
4650  break;
4651  }
4652  // LK Intro VO (1)
4653  case 58204:
4654  if (target->GetTypeId() == TYPEID_PLAYER)
4655  {
4656  // Play part 1
4657  if (apply)
4658  target->PlayDirectSound(14970, target->ToPlayer());
4659  // continue in 58205
4660  else
4661  target->CastSpell(target, 58205, true);
4662  }
4663  break;
4664  // LK Intro VO (2)
4665  case 58205:
4666  if (target->GetTypeId() == TYPEID_PLAYER)
4667  {
4668  // Play part 2
4669  if (apply)
4670  target->PlayDirectSound(14971, target->ToPlayer());
4671  // Play part 3
4672  else
4673  target->PlayDirectSound(14972, target->ToPlayer());
4674  }
4675  break;
4676  }
4677 
4678  break;
4679  }
4680  case SPELLFAMILY_MAGE:
4681  {
4682  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
4683  //break;
4684  break;
4685  }
4686  case SPELLFAMILY_PRIEST:
4687  {
4688  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
4689  //break;
4690  break;
4691  }
4692  case SPELLFAMILY_DRUID:
4693  {
4694  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
4695  //break;
4696  break;
4697  }
4698  case SPELLFAMILY_SHAMAN:
4699  {
4700  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
4701  //break;
4702  break;
4703  }
4704  case SPELLFAMILY_PALADIN:
4705  // if (!(mode & AURA_EFFECT_HANDLE_REAL))
4706  // break;
4707  break;
4709  {
4710  //if (!(mode & AURA_EFFECT_HANDLE_REAL))
4711  // break;
4712  break;
4713  }
4714  }
4715 }
Definition: SharedDefines.h:6053
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
bool roll_chance_i(int chance)
Definition: Random.h:59
uint8 getGender() const
Definition: Unit.h:852
void SetStackAmount(uint8 num)
Definition: SpellAuras.cpp:1000
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SharedDefines.h:6046
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
Definition: Unit.h:1086
TriggerCastFlags TriggerFlags
Definition: SpellDefines.h:274
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:134
Definition: SpellInfo.h:372
void AddPetAura(PetAura const *petSpell)
Definition: Player.cpp:21882
MotionMaster * GetMotionMaster()
Definition: Unit.h:1691
uint32 GetId() const
Definition: SpellAuraEffects.h:50
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:7456
Definition: SharedDefines.h:6058
bool IsDungeon() const
Definition: Map.cpp:4240
Battleground * GetBattleground() const
Definition: Player.cpp:24820
void SetEntry(uint32 entry)
Definition: Object.h:156
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
uint32 GetZoneId() const
Definition: Object.h:459
bool IsHeroic() const
Definition: Map.cpp:4260
Definition: SharedDefines.h:6049
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
void MoveFall(uint32 id=0)
Definition: MotionMaster.cpp:593
bool IsBattleground() const
Definition: Map.cpp:4272
Difficulty CastDifficulty
Definition: SpellDefines.h:278
Map * GetMap() const
Definition: Object.h:535
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint32 const Id
Definition: SpellInfo.h:377
ObjectGuid const & GetGUID() const
Definition: Object.h:154
Definition: SharedDefines.h:130
void PlayDistanceSound(uint32 soundId, Player *target=nullptr)
Definition: Object.cpp:3163
Definition: SpellMgr.h:437
void SetCharges(uint8 charges)
Definition: SpellAuras.cpp:934
void LeaveBattleground(bool teleportToEntryPoint=true)
Definition: Player.cpp:23643
uint32 SpellFamilyName
Definition: SpellInfo.h:454
void SetChampioningFaction(uint32 faction)
Definition: Player.h:2513
Definition: SharedDefines.h:6043
bool IsAlive() const
Definition: Unit.h:1217
#define sSpellMgr
Definition: SpellMgr.h:790
uint32_t uint32
Definition: Define.h:152
Definition: Battlefield.h:210
Definition: SpellAuraDefines.h:50
::Difficulty const Difficulty
Definition: SpellInfo.h:378
ThreatManager & GetThreatManager()
Definition: Unit.h:1119
#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:3654
Definition: SpellDefines.h:254
void PlayDirectSound(uint32 soundId, Player *target=nullptr, uint32 broadcastTextId=0)
Definition: Object.cpp:3171
Definition: ObjectGuid.h:40
Definition: SharedDefines.h:6050
ObjectGuid OriginalCaster
Definition: SpellDefines.h:277
Guardian * GetGuardianPet() const
Definition: Unit.cpp:5764
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:246
SpellEffIndex GetEffIndex() const
Definition: SpellAuraEffects.h:51
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Battleground.h:259
Definition: SpellAuraDefines.h:69
void CastSpell(SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2631
Definition: SharedDefines.h:6054
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4314
uint32 StackAmount
Definition: SpellInfo.h:437
void RemovePetAura(PetAura const *petSpell)
Definition: Player.cpp:21889
Definition: SpellAuraDefines.h:53
Definition: SpellAuras.h:118
Definition: Unit.h:736
Definition: SharedDefines.h:2411
Definition: SpellAuraDefines.h:57
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
Definition: ThreatManager.cpp:290
+ Here is the call graph for this function:

◆ HandleAuraEmpathy()

void AuraEffect::HandleAuraEmpathy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4810 {
4811  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4812  return;
4813 
4814  Unit* target = aurApp->GetTarget();
4815  if (!apply)
4816  {
4817  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4818  if (target->HasAuraType(GetAuraType()))
4819  return;
4820  }
4821 
4822  if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
4823  {
4824  if (apply)
4826  else
4828  }
4829 }
void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:164
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
uint32 GetCreatureType() const
Definition: Unit.cpp:8435
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: SharedDefines.h:5517
Definition: SharedDefines.h:4306
Definition: Unit.h:736
void AddDynamicFlag(uint32 flag)
Definition: Object.h:163
+ Here is the call graph for this function:

◆ HandleAuraFeatherFall()

void AuraEffect::HandleAuraFeatherFall ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2604 {
2606  return;
2607 
2608  Unit* target = aurApp->GetTarget();
2609 
2610  if (!apply)
2611  {
2612  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2613  if (target->HasAuraType(GetAuraType()))
2614  return;
2615  }
2616 
2617  target->SetFeatherFall(apply);
2618 
2619  // start fall from current height
2620  if (!apply && target->GetTypeId() == TYPEID_PLAYER)
2621  target->ToPlayer()->SetFallInformation(0, target->GetPositionZ());
2622 }
TypeID GetTypeId() const
Definition: Object.h:167
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
bool SetFeatherFall(bool enable)
Definition: Unit.cpp:12508
ObjectGuid GetTarget() const
Definition: Unit.h:1798
float GetPositionZ() const
Definition: Position.h:103
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: ObjectGuid.h:40
void SetFallInformation(uint32 time, float z)
Definition: Player.cpp:26494
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraForceWeather()

void AuraEffect::HandleAuraForceWeather ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5736 {
5737  if (!(mode & AURA_EFFECT_HANDLE_REAL))
5738  return;
5739 
5740  Player* target = aurApp->GetTarget()->ToPlayer();
5741 
5742  if (!target)
5743  return;
5744 
5745  if (apply)
5747  else
5748  target->GetMap()->SendZoneWeather(target->GetZoneId(), target);
5749 }
void SendZoneWeather(uint32 zoneId, Player *player) const
Definition: Map.cpp:4804
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
uint32 GetZoneId() const
Definition: Object.h:459
Definition: MiscPackets.h:400
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Map * GetMap() const
Definition: Object.h:535
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void SendDirectMessage(WorldPacket const *data) const
Definition: Player.cpp:6123
Definition: SpellAuraDefines.h:50
Definition: Player.h:1056
WeatherState
Definition: Weather.h:45
+ Here is the call graph for this function:

◆ HandleAuraGhost()

void AuraEffect::HandleAuraGhost ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1586 {
1588  return;
1589 
1590  Player* target = aurApp->GetTarget()->ToPlayer();
1591  if (!target)
1592  return;
1593 
1594  if (apply)
1595  {
1599  }
1600  else
1601  {
1602  if (target->HasAuraType(SPELL_AURA_GHOST))
1603  return;
1604 
1608  }
1609 }
void AddPlayerFlag(PlayerFlags flags)
Definition: Player.h:2574
Definition: Player.h:426
Definition: SpellAuraDefines.h:183
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:530
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:402
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Definition: SharedDefines.h:2295
Definition: SharedDefines.h:2296
ObjectGuid GetTarget() const
Definition: Unit.h:1798
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:531
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
void RemovePlayerFlag(PlayerFlags flags)
Definition: Player.h:2575
Definition: SharedDefines.h:2288
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ HandleAuraHover()

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

Sets movementflags

2625 {
2627  return;
2628 
2629  Unit* target = aurApp->GetTarget();
2630 
2631  if (!apply)
2632  {
2633  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2634  if (target->HasAuraType(GetAuraType()))
2635  return;
2636  }
2637 
2638  target->SetHover(apply);
2639 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
bool SetHover(bool enable)
Definition: Unit.cpp:12545
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraIncreaseBaseHealthPercent()

void AuraEffect::HandleAuraIncreaseBaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3772 {
3774  return;
3775 
3776  Unit* target = aurApp->GetTarget();
3777 
3778  if (apply)
3780  else
3781  {
3783  target->SetStatPctModifier(UNIT_MOD_HEALTH, BASE_PCT, amount);
3784  }
3785 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
Definition: SpellAuraDefines.h:370
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:148
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
Definition: Unit.h:165
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraLinked()

void AuraEffect::HandleAuraLinked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4886 {
4887  Unit* target = aurApp->GetTarget();
4888 
4889  uint32 triggeredSpellId = GetSpellEffectInfo().TriggerSpell;
4890  SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId, GetBase()->GetCastDifficulty());
4891  if (!triggeredSpellInfo)
4892  return;
4893 
4894  Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCaster() : target;
4895  if (!caster)
4896  return;
4897 
4898  if (mode & AURA_EFFECT_HANDLE_REAL)
4899  {
4900  if (apply)
4901  {
4902  CastSpellExtraArgs args(this);
4903  if (GetAmount()) // If amount avalible cast with basepoints (Crypt Fever for example)
4904  args.AddSpellMod(SPELLVALUE_BASE_POINT0, GetAmount());
4905 
4906  caster->CastSpell(target, triggeredSpellId, args);
4907  }
4908  else
4909  {
4910  ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID();
4911  target->RemoveAura(triggeredSpellId, casterGUID);
4912  }
4913  }
4914  else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
4915  {
4916  ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID();
4917  // change the stack amount to be equal to stack amount of our aura
4918  if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
4919  triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
4920  }
4921 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell) const
Definition: SpellInfo.cpp:1455
Definition: SpellInfo.h:372
uint8 GetStackAmount() const
Definition: SpellAuras.h:188
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3510
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint32 TriggerSpell
Definition: SpellInfo.h:289
#define sSpellMgr
Definition: SpellMgr.h:790
uint32_t uint32
Definition: Define.h:152
Definition: SpellAuraDefines.h:50
Definition: SpellDefines.h:254
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: SpellDefines.h:179
void CastSpell(SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2631
Definition: ObjectGuid.h:248
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4314
Definition: SpellAuraDefines.h:53
Definition: SpellAuras.h:118
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModAttackPower()

void AuraEffect::HandleAuraModAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4164 {
4166  return;
4167 
4168  Unit* target = aurApp->GetTarget();
4169 
4171 }
Definition: Unit.h:142
Definition: Unit.h:192
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4187 {
4189  return;
4190 
4191  Unit* target = aurApp->GetTarget();
4192 
4193  //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4194  if (apply)
4196  else
4197  {
4200  }
4201 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
Definition: Unit.h:192
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:149
Definition: SpellAuraDefines.h:254
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModBaseResistancePCT()

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3230 {
3232  return;
3233 
3234  Unit* target = aurApp->GetTarget();
3235 
3236  // only players have base stats
3237  if (target->GetTypeId() != TYPEID_PLAYER)
3238  {
3239  //pets only have base armor
3240  if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
3241  {
3242  if (apply)
3244  else
3245  {
3247  target->SetStatPctModifier(UNIT_MOD_ARMOR, BASE_PCT, amount);
3248  }
3249  }
3250  }
3251  else
3252  {
3253  for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; ++x)
3254  {
3255  if (GetMiscValue() & (1 << x))
3256  {
3257  if (apply)
3259  else
3260  {
3263  }
3264  }
3265  }
3266  }
3267 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
TypeID GetTypeId() const
Definition: Object.h:167
UnitMods
Definition: Unit.h:159
Definition: Unit.h:201
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SharedDefines.h:300
bool IsPet() const
Definition: Unit.h:838
Definition: SharedDefines.h:293
Definition: Unit.h:148
Definition: ObjectGuid.h:40
Definition: SpellAuraDefines.h:230
uint8_t uint8
Definition: Define.h:154
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
Definition: Unit.cpp:4706
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
Definition: Unit.h:185
Definition: SharedDefines.h:306
+ Here is the call graph for this function:

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3922 {
3924  return;
3925 
3926  Unit* target = aurApp->GetTarget();
3927 
3928  if (target->GetTypeId() != TYPEID_PLAYER)
3929  return;
3930 
3931  target->ToPlayer()->UpdateBlockPercentage();
3932 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:54
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void UpdateBlockPercentage()
Definition: StatSystem.cpp:466
Definition: ObjectGuid.h:40
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModCritPct()

void AuraEffect::HandleAuraModCritPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3986 {
3988  return;
3989 
3990  Unit* target = aurApp->GetTarget();
3991 
3992  if (target->GetTypeId() != TYPEID_PLAYER)
3993  {
3994  target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
3995  return;
3996  }
3997 
3999 
4000  // included in Player::UpdateSpellCritChance calculation
4001  target->ToPlayer()->UpdateSpellCritChance();
4002 }
TypeID GetTypeId() const
Definition: Object.h:167
int32 m_baseSpellCritChance
Definition: Unit.h:1512
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void UpdateAllWeaponDependentCritAuras()
Definition: Player.cpp:7900
Definition: ObjectGuid.h:40
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
void UpdateSpellCritChance()
Definition: StatSystem.cpp:696
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModDecreaseSpeed()

void AuraEffect::HandleAuraModDecreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3047 {
3049  return;
3050 
3051  Unit* target = aurApp->GetTarget();
3052 
3053  target->UpdateSpeed(MOVE_RUN);
3054  target->UpdateSpeed(MOVE_SWIM);
3055  target->UpdateSpeed(MOVE_FLIGHT);
3056  target->UpdateSpeed(MOVE_RUN_BACK);
3057  target->UpdateSpeed(MOVE_SWIM_BACK);
3058  target->UpdateSpeed(MOVE_FLIGHT_BACK);
3059 }
Definition: UnitDefines.h:109
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:104
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
Definition: UnitDefines.h:106
Definition: UnitDefines.h:110
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
Definition: UnitDefines.h:107
Definition: UnitDefines.h:105
+ Here is the call graph for this function:

◆ HandleAuraModDisarm()

void AuraEffect::HandleAuraModDisarm ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2159 {
2160  if (!(mode & AURA_EFFECT_HANDLE_REAL))
2161  return;
2162 
2163  Unit* target = aurApp->GetTarget();
2164 
2165  //Prevent handling aura twice
2166  AuraType type = GetAuraType();
2167  if (apply ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2168  return;
2169 
2170  void(*flagChangeFunc)(Unit* u) = nullptr;
2171 
2172  uint32 slot;
2173  WeaponAttackType attType;
2174  switch (type)
2175  {
2176  case SPELL_AURA_MOD_DISARM:
2177  if (apply)
2178  flagChangeFunc = [](Unit* u) { u->AddUnitFlag(UNIT_FLAG_DISARMED); };
2179  else
2180  flagChangeFunc = [](Unit* u) { u->RemoveUnitFlag(UNIT_FLAG_DISARMED); };
2181  slot = EQUIPMENT_SLOT_MAINHAND;
2182  attType = BASE_ATTACK;
2183  break;
2185  if (apply)
2186  flagChangeFunc = [](Unit* u) { u->AddUnitFlag2(UNIT_FLAG2_DISARM_OFFHAND); };
2187  else
2188  flagChangeFunc = [](Unit* u) { u->RemoveUnitFlag2(UNIT_FLAG2_DISARM_OFFHAND); };
2189  slot = EQUIPMENT_SLOT_OFFHAND;
2190  attType = OFF_ATTACK;
2191  break;
2193  if (apply)
2194  flagChangeFunc = [](Unit* u) { u->AddUnitFlag2(UNIT_FLAG2_DISARM_RANGED); };
2195  else
2196  flagChangeFunc = [](Unit* u) { u->RemoveUnitFlag2(UNIT_FLAG2_DISARM_RANGED); };
2197  slot = EQUIPMENT_SLOT_MAINHAND;
2198  attType = RANGED_ATTACK;
2199  break;
2200  default:
2201  return;
2202  }
2203 
2204  // set/remove flag before weapon bonuses so it's properly reflected in CanUseAttackType
2205  if (flagChangeFunc)
2206  flagChangeFunc(target);
2207 
2208  // Handle damage modification, shapeshifted druids are not affected
2209  if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
2210  {
2211  Player* player = target->ToPlayer();
2212  if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2213  {
2214  WeaponAttackType const attackType = Player::GetAttackBySlot(slot, item->GetTemplate()->GetInventoryType());
2215 
2216  player->ApplyItemDependentAuras(item, !apply);
2217  if (attackType != MAX_ATTACK)
2218  {
2219  player->_ApplyWeaponDamage(slot, item, !apply);
2220  if (!apply) // apply case already handled on item dependent aura removal (if any)
2221  player->UpdateWeaponDependentAuras(attackType);
2222  }
2223  }
2224  }
2225 
2226  if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
2227  target->UpdateDamagePhysical(attType);
2228 }
Definition: SpellAuraDefines.h:366
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:613
TypeID GetTypeId() const
Definition: Object.h:167
Definition: UnitDefines.h:164
Definition: Player.h:635
Definition: ObjectGuid.h:39
void UpdateWeaponDependentAuras(WeaponAttackType attackType)
Definition: Player.cpp:7906
AuraType
Definition: SpellAuraDefines.h:86
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint8 GetCurrentEquipmentId() const
Definition: Creature.h:178
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1365
Definition: Item.h:169
static WeaponAttackType GetAttackBySlot(uint8 slot, InventoryType inventoryType)
Definition: Player.cpp:10204
uint32_t uint32
Definition: Define.h:152
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SharedDefines.h:6344
Definition: UnitDefines.h:167
bool IsInFeralForm() const
Definition: Unit.cpp:8461
Definition: Player.h:634
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: SharedDefines.h:6341
Definition: ObjectGuid.h:40
Definition: SharedDefines.h:6343
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition: StatSystem.cpp:64
Creature * ToCreature()
Definition: Object.h:196
void _ApplyWeaponDamage(uint8 slot, Item *item, bool apply)
Definition: Player.cpp:7774
Item * GetItemByPos(uint16 pos) const
Definition: Player.cpp:10103
Definition: SpellAuraDefines.h:342
Definition: UnitDefines.h:140
Definition: SpellAuraDefines.h:155
WeaponAttackType
Definition: SharedDefines.h:6339
void ApplyItemDependentAuras(Item *item, bool apply)
Definition: Player.cpp:7913
Definition: Unit.h:736
Definition: Player.h:1056
Definition: SharedDefines.h:6342
+ Here is the call graph for this function:

◆ HandleAuraModDispelImmunity()

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3201 {
3202  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3203  return;
3204 
3205  Unit* target = aurApp->GetTarget();
3207 }
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const &spellEffectInfo, bool apply) const
Definition: SpellInfo.cpp:3457
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModDmgImmunity()

void AuraEffect::HandleAuraModDmgImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3190 {
3191  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3192  return;
3193 
3194  Unit* target = aurApp->GetTarget();
3196 
3197  target->GetThreatManager().UpdateOnlineStates(true, false);
3198 }
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
ThreatManager & GetThreatManager()
Definition: Unit.h:1119
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const &spellEffectInfo, bool apply) const
Definition: SpellInfo.cpp:3457
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
void UpdateOnlineStates(bool meThreateningOthers=true, bool othersThreateningMe=true)
Definition: ThreatManager.cpp:273
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModDodgePercent()

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3909 {
3911  return;
3912 
3913  Unit* target = aurApp->GetTarget();
3914 
3915  if (target->GetTypeId() != TYPEID_PLAYER)
3916  return;
3917 
3918  target->ToPlayer()->UpdateDodgePercentage();
3919 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:54
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: ObjectGuid.h:40
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
void UpdateDodgePercentage()
Definition: StatSystem.cpp:678
+ Here is the call graph for this function:

◆ HandleAuraModEffectImmunity()

void AuraEffect::HandleAuraModEffectImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3114 {
3115  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3116  return;
3117 
3118  Unit* target = aurApp->GetTarget();
3120 
3121  // when removing flag aura, handle flag drop
3122  // TODO: this should be handled in aura script for flag spells using AfterEffectRemove hook
3123  Player* player = target->ToPlayer();
3124  if (!apply && player && GetSpellInfo()->HasAuraInterruptFlag(SpellAuraInterruptFlags::StealthOrInvis))
3125  {
3126  if (player->InBattleground())
3127  {
3128  if (Battleground* bg = player->GetBattleground())
3129  bg->EventPlayerDroppedFlag(player);
3130  }
3131  else
3132  sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3133  }
3134 }
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:102
bool InBattleground() const
Definition: Player.h:2263
Battleground * GetBattleground() const
Definition: Player.cpp:24820
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const &spellEffectInfo, bool apply) const
Definition: SpellInfo.cpp:3457
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: Battleground.h:259
Definition: Unit.h:736
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ HandleAuraModExpertise()

void AuraEffect::HandleAuraModExpertise ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3504 {
3506  return;
3507 
3508  Unit* target = aurApp->GetTarget();
3509 
3510  if (target->GetTypeId() != TYPEID_PLAYER)
3511  return;
3512 
3513  target->ToPlayer()->UpdateExpertise(BASE_ATTACK);
3514  target->ToPlayer()->UpdateExpertise(OFF_ATTACK);
3515 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:54
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SharedDefines.h:6341
Definition: ObjectGuid.h:40
void UpdateExpertise(WeaponAttackType attType)
Definition: StatSystem.cpp:759
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
Definition: SharedDefines.h:6342
+ Here is the call graph for this function:

◆ HandleAuraModFaction()

void AuraEffect::HandleAuraModFaction ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4832 {
4833  if (!(mode & AURA_EFFECT_HANDLE_REAL))
4834  return;
4835 
4836  Unit* target = aurApp->GetTarget();
4837 
4838  if (apply)
4839  {
4840  target->SetFaction(GetMiscValue());
4841  if (target->GetTypeId() == TYPEID_PLAYER)
4843  }
4844  else
4845  {
4846  target->RestoreFaction();
4847  if (target->GetTypeId() == TYPEID_PLAYER)
4849  }
4850 }
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:927
TypeID GetTypeId() const
Definition: Object.h:167
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:122
void RestoreFaction()
Definition: Unit.cpp:11117
Definition: SpellAuraDefines.h:50
Definition: ObjectGuid.h:40
void AddUnitFlag(UnitFlags flags)
Definition: Unit.h:926
void SetFaction(uint32 faction) override
Definition: Unit.h:948
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModFakeInebriation()

void AuraEffect::HandleAuraModFakeInebriation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4996 {
4998  return;
4999 
5000  Unit* target = aurApp->GetTarget();
5001 
5002  if (apply)
5003  {
5006 
5007  if (Player* playerTarget = target->ToPlayer())
5008  playerTarget->ApplyModFakeInebriation(GetAmount(), true);
5009  }
5010  else
5011  {
5012  bool removeDetect = !target->HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE);
5013 
5015 
5016  if (Player* playerTarget = target->ToPlayer())
5017  {
5018  playerTarget->ApplyModFakeInebriation(GetAmount(), false);
5019 
5020  if (removeDetect)
5021  removeDetect = !playerTarget->GetDrunkValue();
5022  }
5023 
5024  if (removeDetect)
5026  }
5027 
5028  // call functions which may have additional effects after chainging state of unit
5029  target->UpdateObjectVisibility();
5030 }
Definition: SpellAuraDefines.h:392
void UpdateObjectVisibility(bool forced=true) override
Definition: Unit.cpp:11541
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition: Object.h:528
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:403
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
void AddFlag(FLAG_TYPE flag)
Definition: Object.h:398
void DelFlag(FLAG_TYPE flag)
Definition: Object.h:399
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
Definition: Player.h:1056
Definition: SharedDefines.h:2249
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseBaseManaPercent()

void AuraEffect::HandleAuraModIncreaseBaseManaPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3788 {
3790  return;
3791 
3792  Unit* target = aurApp->GetTarget();
3793 
3794  if (apply)
3796  else
3797  {
3798  float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_BASE_MANA_PCT);
3799  target->SetStatPctModifier(UNIT_MOD_MANA, BASE_PCT, amount);
3800  }
3801 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
Definition: SpellAuraDefines.h:507
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:148
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
Definition: Unit.h:166
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseEnergy()

void AuraEffect::HandleAuraModIncreaseEnergy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3693 {
3695  return;
3696 
3697  Unit* target = aurApp->GetTarget();
3698  Powers powerType = Powers(GetMiscValue());
3699  UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
3700 
3701  target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
3702 }
Powers
Definition: SharedDefines.h:263
UnitMods
Definition: Unit.h:159
Definition: Unit.h:142
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
Definition: Unit.h:203
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseEnergyPercent()

void AuraEffect::HandleAuraModIncreaseEnergyPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3705 {
3707  return;
3708 
3709  Unit* target = aurApp->GetTarget();
3710 
3711  Powers powerType = Powers(GetMiscValue());
3712  UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
3713 
3714  // Save old powers for further calculation
3715  int32 oldPower = target->GetPower(powerType);
3716  int32 oldMaxPower = target->GetMaxPower(powerType);
3717 
3718  // Handle aura effect for max power
3719  if (apply)
3720  target->ApplyStatPctModifier(unitMod, TOTAL_PCT, float(GetAmount()));
3721  else
3722  {
3723  float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, [powerType](AuraEffect const* aurEff) -> bool
3724  {
3725  if (aurEff->GetMiscValue() == powerType)
3726  return true;
3727  return false;
3728  });
3729 
3730  amount *= target->GetTotalAuraMultiplier(SPELL_AURA_MOD_MAX_POWER_PCT, [powerType](AuraEffect const* aurEff) -> bool
3731  {
3732  if (aurEff->GetMiscValue() == powerType)
3733  return true;
3734  return false;
3735  });
3736 
3737  target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
3738  }
3739 
3740  // Calculate the current power change
3741  int32 change = target->GetMaxPower(powerType) - oldMaxPower;
3742  change = (oldPower + change) - target->GetPower(powerType);
3743  target->ModifyPower(powerType, change);
3744 }
Definition: SpellAuraEffects.h:28
Powers
Definition: SharedDefines.h:263
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
UnitMods
Definition: Unit.h:159
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:7885
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:149
Definition: SpellAuraDefines.h:220
int32_t int32
Definition: Define.h:148
Definition: SpellAuraDefines.h:266
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:8946
int32 GetPower(Powers power) const
Definition: Unit.cpp:8937
Definition: Unit.h:203
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseFlightSpeed()

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

Update ability to fly

Someone should clean up these hacks and remove it from this function. It doesn't even belong here.

3001 {
3003  return;
3004 
3005  Unit* target = aurApp->GetTarget();
3007  target->UpdateSpeed(MOVE_FLIGHT);
3008 
3011  {
3012  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3014  {
3016 
3017  if (target->SetCanFly(apply))
3018  if (!apply && !target->IsLevitating())
3019  target->GetMotionMaster()->MoveFall();
3020  }
3021 
3023  if (mode & AURA_EFFECT_HANDLE_REAL)
3024  {
3025  //Players on flying mounts must be immune to polymorph
3026  if (target->GetTypeId() == TYPEID_PLAYER)
3028 
3029  // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3030  if (apply && target->HasAuraEffect(42016, 0) && target->GetMountDisplayId())
3031  target->SetMountDisplayId(16314);
3032  }
3033  }
3034 }
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:4388
TypeID GetTypeId() const
Definition: Object.h:167
MotionMaster * GetMotionMaster()
Definition: Unit.h:1691
uint32 GetId() const
Definition: SpellAuraEffects.h:50
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:7456
uint32 GetMountDisplayId() const
Definition: Unit.h:985
Definition: UnitDefines.h:109
void SetMountDisplayId(uint32 mountDisplayId)
Definition: Unit.h:986
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void MoveFall(uint32 id=0)
Definition: MotionMaster.cpp:593
Definition: SharedDefines.h:2353
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
Definition: SpellAuraDefines.h:295
Definition: SpellAuraDefines.h:289
bool SetCanFly(bool enable)
Definition: Unit.cpp:12428
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: ObjectGuid.h:40
bool SetCanTransitionBetweenSwimAndFly(bool enable)
Definition: Unit.cpp:12635
Definition: Unit.h:736
Definition: SharedDefines.h:2411
Definition: SpellAuraDefines.h:57
bool IsLevitating() const
Definition: Unit.h:1190
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseHealth()

void AuraEffect::HandleAuraModIncreaseHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3651 {
3653  return;
3654 
3655  Unit* target = aurApp->GetTarget();
3656 
3657  if (apply)
3658  {
3660  target->ModifyHealth(GetAmount());
3661  }
3662  else
3663  {
3664  if (target->GetHealth() > 0)
3665  {
3666  int32 value = std::min<int32>(target->GetHealth() - 1, GetAmount());
3667  target->ModifyHealth(-value);
3668  }
3670  }
3671 }
int64 ModifyHealth(int64 val)
Definition: Unit.cpp:7817
Definition: Unit.h:142
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint64 GetHealth() const
Definition: Unit.h:871
int32_t int32
Definition: Define.h:148
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
Definition: Unit.h:165
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseHealthPercent()

void AuraEffect::HandleAuraModIncreaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3747 {
3749  return;
3750 
3751  Unit* target = aurApp->GetTarget();
3752 
3753  // Unit will keep hp% after MaxHealth being modified if unit is alive.
3754  float percent = target->GetHealthPct();
3755  if (apply)
3757  else
3758  {
3761  target->SetStatPctModifier(UNIT_MOD_HEALTH, TOTAL_PCT, amount);
3762  }
3763 
3764  if (target->GetHealth() > 0)
3765  {
3766  uint32 newHealth = std::max<uint32>(CalculatePct(target->GetMaxHealth(), percent), 1);
3767  target->SetHealth(newHealth);
3768  }
3769 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
Definition: SpellAuraDefines.h:221
Definition: SpellAuraDefines.h:233
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
void SetHealth(uint64 val)
Definition: Unit.cpp:8885
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:149
uint64 GetHealth() const
Definition: Unit.h:871
uint32_t uint32
Definition: Define.h:152
T CalculatePct(T base, U pct)
Definition: Util.h:70
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
Definition: Unit.h:165
float GetHealthPct() const
Definition: Unit.h:879
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
uint64 GetMaxHealth() const
Definition: Unit.h:872
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseMaxHealth()

void AuraEffect::HandleAuraModIncreaseMaxHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3674 {
3676  return;
3677 
3678  Unit* target = aurApp->GetTarget();
3679 
3680  float percent = target->GetHealthPct();
3681 
3683 
3684  // refresh percentage
3685  if (target->GetHealth() > 0)
3686  {
3687  uint32 newHealth = std::max<uint32>(target->CountPctFromMaxHealth(int32(percent)), 1);
3688  target->SetHealth(newHealth);
3689  }
3690 }
Definition: Unit.h:142
uint64 CountPctFromMaxHealth(int32 pct) const
Definition: Unit.h:880
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetHealth(uint64 val)
Definition: Unit.cpp:8885
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint64 GetHealth() const
Definition: Unit.h:871
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
Definition: Unit.h:165
float GetHealthPct() const
Definition: Unit.h:879
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseMountedSpeed()

void AuraEffect::HandleAuraModIncreaseMountedSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2996 {
2997  HandleAuraModIncreaseSpeed(aurApp, mode, apply);
2998 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2985
+ Here is the call graph for this function:

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2986 {
2988  return;
2989 
2990  Unit* target = aurApp->GetTarget();
2991 
2992  target->UpdateSpeed(MOVE_RUN);
2993 }
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:104
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuraModIncreaseSwimSpeed()

void AuraEffect::HandleAuraModIncreaseSwimSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3037 {
3039  return;
3040 
3041  Unit* target = aurApp->GetTarget();
3042 
3043  target->UpdateSpeed(MOVE_SWIM);
3044 }
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
Definition: UnitDefines.h:106
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModMaxPower()

void AuraEffect::HandleAuraModMaxPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3599 {
3601  return;
3602 
3603  Unit* target = aurApp->GetTarget();
3604 
3605  Powers power = Powers(GetMiscValue());
3606  UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
3607 
3608  target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
3609 }
Powers
Definition: SharedDefines.h:263
UnitMods
Definition: Unit.h:159
Definition: Unit.h:142
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
Definition: Unit.h:203
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModMaxPowerPct()

void AuraEffect::HandleAuraModMaxPowerPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3848 {
3850  return;
3851 
3852  Unit * target = aurApp->GetTarget();
3853  if (!target->IsPlayer())
3854  return;
3855 
3856  Powers powerType = Powers(GetMiscValue());
3857  UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
3858 
3859  // Save old powers for further calculation
3860  int32 oldPower = target->GetPower(powerType);
3861  int32 oldMaxPower = target->GetMaxPower(powerType);
3862 
3863  // Handle aura effect for max power
3864  if (apply)
3865  target->ApplyStatPctModifier(unitMod, TOTAL_PCT, float(GetAmount()));
3866  else
3867  {
3868  float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_MAX_POWER_PCT, [powerType](AuraEffect const* aurEff) -> bool
3869  {
3870  if (aurEff->GetMiscValue() == powerType)
3871  return true;
3872  return false;
3873  });
3874 
3875  amount *= target->GetTotalAuraMultiplier(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, [powerType](AuraEffect const* aurEff) -> bool
3876  {
3877  if (aurEff->GetMiscValue() == powerType)
3878  return true;
3879  return false;
3880  });
3881 
3882  target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
3883  }
3884 
3885  // Calculate the current power change
3886  int32 change = target->GetMaxPower(powerType) - oldMaxPower;
3887  change = (oldPower + change) - target->GetPower(powerType);
3888  target->ModifyPower(powerType, change);
3889 }
Definition: SpellAuraEffects.h:28
Powers
Definition: SharedDefines.h:263
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
UnitMods
Definition: Unit.h:159
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition: Unit.cpp:7885
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:149
bool IsPlayer() const
Definition: Object.h:191
Definition: SpellAuraDefines.h:220
int32_t int32
Definition: Define.h:148
Definition: SpellAuraDefines.h:266
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
int32 GetMaxPower(Powers power) const
Definition: Unit.cpp:8946
int32 GetPower(Powers power) const
Definition: Unit.cpp:8937
Definition: Unit.h:203
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModMinimumSpeedRate()

void AuraEffect::HandleAuraModMinimumSpeedRate ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3074 {
3075  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3076  return;
3077 
3078  Unit* target = aurApp->GetTarget();
3079 
3080  target->UpdateSpeed(MOVE_RUN);
3081 }
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:104
void UpdateSpeed(UnitMoveType mtype)
Definition: Unit.cpp:7966
Definition: SpellAuraDefines.h:50
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModNoActions()

void AuraEffect::HandleAuraModNoActions ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2316 {
2317  if (!(mode & AURA_EFFECT_HANDLE_REAL))
2318  return;
2319 
2320  Unit* target = aurApp->GetTarget();
2321 
2322  if (apply)
2323  {
2325 
2326  // call functions which may have additional effects after chainging state of unit
2327  // Stop cast only spells vs PreventionType & SPELL_PREVENTION_TYPE_SILENCE
2328  for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
2329  if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
2330  if (spell->m_spellInfo->PreventionType & SPELL_PREVENTION_TYPE_NO_ACTIONS)
2331  // Stop spells on prepare or casting state
2332  target->InterruptSpell(CurrentSpellTypes(i), false);
2333  }
2334  else
2335  {
2336  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2338  return;
2339 
2341  }
2342 }
Definition: Unit.h:579
Definition: SpellAuraDefines.h:409
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:2886
Definition: SharedDefines.h:2611
uint32_t uint32
Definition: Define.h:152
Definition: SpellAuraDefines.h:50
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1485
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:931
Definition: UnitDefines.h:176
#define CURRENT_MAX_SPELL
Definition: Unit.h:586
void AddUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:930
Definition: Unit.h:736
CurrentSpellTypes
Definition: Unit.h:577
Definition: Spell.h:348
+ Here is the call graph for this function:

◆ HandleAuraModOverridePowerDisplay()

void AuraEffect::HandleAuraModOverridePowerDisplay ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3826 {
3827  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3828  return;
3829 
3830  PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(GetMiscValue());
3831  if (!powerDisplay)
3832  return;
3833 
3834  Unit* target = aurApp->GetTarget();
3835  if (target->GetPowerIndex(Powers(powerDisplay->ActualType)) == MAX_POWERS)
3836  return;
3837 
3838  if (apply)
3839  {
3841  target->SetOverrideDisplayPowerId(powerDisplay->ID);
3842  }
3843  else
3844  target->SetOverrideDisplayPowerId(0);
3845 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Powers
Definition: SharedDefines.h:263
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
DB2Storage< PowerDisplayEntry > sPowerDisplayStore("PowerDisplay.db2", PowerDisplayLoadInfo::Instance())
Definition: SharedDefines.h:284
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetOverrideDisplayPowerId(uint32 powerDisplayId)
Definition: Unit.h:895
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
virtual uint32 GetPowerIndex(Powers power) const =0
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check)
Definition: Unit.cpp:3635
uint32 ID
Definition: DB2Structure.h:2658
Definition: DB2Structure.h:2656
uint8 ActualType
Definition: DB2Structure.h:2660
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModPacify()

void AuraEffect::HandleAuraModPacify ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2260 {
2262  return;
2263 
2264  Unit* target = aurApp->GetTarget();
2265 
2266  if (apply)
2267  {
2269  target->AttackStop();
2270  }
2271  else
2272  {
2273  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2275  return;
2277  }
2278 }
bool AttackStop()
Definition: Unit.cpp:5516
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:927
Definition: SpellAuraDefines.h:113
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: UnitDefines.h:136
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
Definition: SpellAuraDefines.h:148
void AddUnitFlag(UnitFlags flags)
Definition: Unit.h:926
Definition: Unit.h:736
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuraModPacifyAndSilence()

void AuraEffect::HandleAuraModPacifyAndSilence ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2281 {
2283  return;
2284 
2285  Unit* target = aurApp->GetTarget();
2286 
2287  // Vengeance of the Blue Flight (@todo REMOVE THIS!)
2289  if (m_spellInfo->Id == 45839)
2290  {
2291  if (apply)
2293  else
2295  }
2296  if (!(apply))
2297  {
2298  // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2300  return;
2301  }
2302  HandleAuraModPacify(aurApp, mode, apply);
2303  HandleAuraModSilence(aurApp, mode, apply);
2304 }
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:927
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
uint32 const Id
Definition: SpellInfo.h:377
Definition: UnitDefines.h:120
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2230
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2259
Definition: SpellAuraDefines.h:56
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4428
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
Definition: SpellAuraDefines.h:148
void AddUnitFlag(UnitFlags flags)
Definition: Unit.h:926
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModParryPercent()

void AuraEffect::HandleAuraModParryPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3896 {
3898  return;
3899 
3900  Unit* target = aurApp->GetTarget();
3901 
3902  if (target->GetTypeId() != TYPEID_PLAYER)
3903  return;
3904 
3905  target->ToPlayer()->UpdateParryPercentage();
3906 }
TypeID GetTypeId() const
Definition: Object.h:167
Definition: SpellAuraDefines.h:54
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void UpdateParryPercentage()
Definition: StatSystem.cpp:639
Definition: ObjectGuid.h:40
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModPowerDisplay()

void AuraEffect::HandleAuraModPowerDisplay ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3812 {
3814  return;
3815 
3816  if (GetMiscValue() >= MAX_POWERS)
3817  return;
3818 
3819  if (apply)
3820  aurApp->GetTarget()->RemoveAurasByType(GetAuraType(), ObjectGuid::Empty, GetBase());
3821 
3822  aurApp->GetTarget()->UpdateDisplayPower();
3823 }
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
Definition: SharedDefines.h:284
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
Definition: SpellAuraDefines.h:59
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
+ Here is the call graph for this function:

◆ HandleAuraModRangedAttackPower()

void AuraEffect::HandleAuraModRangedAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4174 {
4176  return;
4177 
4178  Unit* target = aurApp->GetTarget();
4179 
4180  if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4181  return;
4182 
4184 }
Definition: Unit.h:142
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
#define CLASSMASK_WAND_USERS
Definition: SharedDefines.h:180
Definition: Unit.h:193
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
uint32 getClassMask() const
Definition: Unit.h:851
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModRangedAttackPowerPercent()

void AuraEffect::HandleAuraModRangedAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4204 {
4206  return;
4207 
4208  Unit* target = aurApp->GetTarget();
4209 
4210  if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4211  return;
4212 
4213  //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
4214  if (apply)
4216  else
4217  {
4220  }
4221 }
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition: Unit.cpp:8540
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition: Unit.cpp:8573
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: Unit.h:149
float GetTotalAuraMultiplier(AuraType auratype) const
Definition: Unit.cpp:4681
#define CLASSMASK_WAND_USERS
Definition: SharedDefines.h:180
Definition: Unit.h:193
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
uint32 getClassMask() const
Definition: Unit.h:851
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
Definition: SpellAuraDefines.h:255
+ Here is the call graph for this function:

◆ HandleAuraModRangedHaste()

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

ToDo: Haste auras with the same handler CAN'T stack together

4114 {
4116  return;
4117 
4119  Unit* target = aurApp->GetTarget();
4120 
4122 }
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition: Unit.cpp:10088
Definition: SpellAuraDefines.h:54
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SharedDefines.h:6343
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModRegenInterrupt()

void AuraEffect::HandleAuraModRegenInterrupt ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3935 {
3937  return;
3938 
3939  Unit* target = aurApp->GetTarget();
3940 
3941  if (!target->IsPlayer())
3942  return;
3943 
3944  target->ToPlayer()->UpdateManaRegen();
3945 }
void UpdateManaRegen()
Definition: StatSystem.cpp:799
Definition: SpellAuraDefines.h:54
Player * ToPlayer()
Definition: Object.h:192
ObjectGuid GetTarget() const
Definition: Unit.h:1798
bool IsPlayer() const
Definition: Object.h:191
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3218 {
3220  return;
3221 
3222  Unit* target = aurApp->GetTarget();
3223 
3224  for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; ++x)
3225  if (GetMiscValue() & (1 << x))
3227 }
UnitMods
Definition: Unit.h:159
Definition: Unit.h:142
Definition: Unit.h:201
Definition: SpellAuraDefines.h:54
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SharedDefines.h:300
Definition: SharedDefines.h:293
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition: Unit.cpp:8515
uint8_t uint8
Definition: Define.h:154
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
Definition: SpellAuraDefines.h:57
+ Here is the call graph for this function:

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2797 {
2798  if (!(mode & AURA_EFFECT_HANDLE_REAL))
2799  return;
2800 
2801  Unit* target = aurApp->GetTarget();
2802 
2804  target->GetThreatManager().UpdateOnlineStates(true, false);
2805 }
Definition: Unit.h:246
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:10604
Definition: SpellAuraDefines.h:50
ThreatManager & GetThreatManager()
Definition: Unit.h:1119
void UpdateOnlineStates(bool meThreateningOthers=true, bool othersThreateningMe=true)
Definition: ThreatManager.cpp:273
Definition: Unit.h:736
+ Here is the call graph for this function:

◆ HandleAuraModScale()

void AuraEffect::HandleAuraModScale ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2021 {
2023  return;
2024 
2025  Unit* target = aurApp->GetTarget();
2026 
2027  float scale = target->GetObjectScale();
2028  scale += CalculatePct(1.0f, apply ? GetAmount() : -GetAmount());
2029  target->SetObjectScale(scale);
2030 }
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
ObjectGuid GetTarget() const
Definition: Unit.h:1798
T CalculatePct(T base, U pct)
Definition: Util.h:70
float GetObjectScale() const
Definition: Object.h:158
virtual void SetObjectScale(float scale)
Definition: Object.h:159
int32 GetAmount() const
Definition: SpellAuraEffects.h:58
Definition: Unit.h:736
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuraModSchoolImmunity()

void AuraEffect::HandleAuraModSchoolImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3146 {
3147  if (!(mode & AURA_EFFECT_HANDLE_REAL))
3148  return;
3149 
3150  Unit* target = aurApp->GetTarget();
3152 
3153  if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3154  {
3155  if (apply)
3157  else
3158  {
3159  bool banishFound = false;
3160  Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
3161  for (AuraEffect const* aurEff : banishAuras)
3162  {
3163  if (aurEff->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3164  {
3165  banishFound = true;
3166  break;
3167  }
3168  }
3169 
3170  if (!banishFound)
3172  }
3173  }
3174 
3175  // TODO: should be changed to a proc script on flag spell (they have "Taken positive" proc flags in db2)
3176  {
3179 
3180  // remove all flag auras (they are positive, but they must be removed when you are immune)
3182  && GetSpellInfo()->HasAttribute(SPELL_ATTR2_DAMAGE_REDUCED_SHIELD))
3184  }
3185 
3186  target->GetThreatManager().UpdateOnlineStates(true, false);
3187 }
Definition: SpellAuraEffects.h:28
SpellEffectInfo const & GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:100
void AddUnitState(uint32 f)
Definition: Unit.h:829
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:754
Definition: SharedDefines.h:2354
Definition: Unit.h:249
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:56
R apply(R(*func)(Ts...), apply_tuple_type< Ts... > &&args)
Definition: advstd.h:37
void RemoveAurasWithInterruptFlags(InterruptFlags flag, uint32 except=0)
Definition: Unit.cpp:3905
void ClearUnitState(uint32 f)
Definition: Unit.h:831
ObjectGuid GetTarget() const
Definition: Unit.h:1798
Definition: SharedDefines.h:427
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1365
Definition: SharedDefines.h:469
Definition: SpellAuraDefines.h:50
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:57
ThreatManager & GetThreatManager()
Definition: Unit.h:1119
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:49
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const &spellEffectInfo, bool apply) const
Definition: SpellInfo.cpp:3457
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:109
void UpdateOnlineStates(bool meThreateningOthers=true, bool othersThreateningMe=true)
Definition: ThreatManager.cpp:273
Definition: Unit.h:736
Definition: SharedDefines.h:306
+ Here is the call graph for this function:

◆ HandleAuraModShapeshift()

void AuraEffect::HandleAuraModShapeshift ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1660 {
1662  return;
1663 
1664  SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(GetMiscValue());
1665  ASSERT(shapeInfo, "Spell %u uses unknown ShapeshiftForm (%u).", GetId(), GetMiscValue());
1666 
1667  Unit* target = aurApp->GetTarget();
1668 
1670  uint32 modelid = target->GetModelForForm(form, GetId());
1671 
1672  if (apply)
1673  {
1674  // remove polymorph before changing display id to keep new display id
1675  switch (form)
1676  {
1677  case FORM_CAT_FORM:
1678  case FORM_TREE_OF_LIFE:
1679  case FORM_TRAVEL_FORM:
1680  case FORM_AQUATIC_FORM:
1681  case FORM_BEAR_FORM:
1682  case FORM_FLIGHT_FORM_EPIC:
1683  case FORM_FLIGHT_FORM:
1684  case FORM_MOONKIN_FORM:
1685  {
1686  // remove movement affects
1687  target->RemoveAurasByShapeShift();
1688 
1689  // and polymorphic affects
1690  if (target->IsPolymorphed())
1691  target->RemoveAurasDueToSpell(target->getTransForm());
1692  break;
1693  }
1694  default:
1695  break;
1696  }
1697 
1698  // remove other shapeshift before applying a new one
1700 
1701  // stop handling the effect if it was removed by linked event
1702  if (aurApp->GetRemoveMode())
1703  return;
1704 
1705  ShapeshiftForm prevForm = target->GetShapeshiftForm();
1706  target->SetShapeshiftForm(form);
1707  // add the shapeshift aura's boosts
1708  if (prevForm != form)
1709  HandleShapeshiftBoosts(target, true);
1710 
1711  if (modelid > 0)
1712  {
1713  SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm(), GetBase()->GetCastDifficulty());
1714  if (!transformSpellInfo || !GetSpellInfo()->IsPositive())
1715  target->SetDisplayId(modelid);
1716  }
1717 
1718  if (!shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::Stance))
1720  }
1721  else
1722  {
1723  // reset model id if no other auras present
1724  // may happen when aura is applied on linked event on aura removal
1725  if (!target->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
1726  {
1727  target->SetShapeshiftForm(FORM_NONE);
1728  if (target->getClass() == CLASS_DRUID)
1729  {
1730  // Remove movement impairing effects also when shifting out
1731  target->RemoveAurasByShapeShift();
1732  }
1733  }
1734 
1735  if (modelid > 0)
1736  target->RestoreDisplayId(target->IsMounted());
1737 
1738  switch (form)
1739  {
1740  // Nordrassil Harness - bonus
1741  case FORM_BEAR_FORM:
1742  case FORM_CAT_FORM:
1743  if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
1744  target->CastSpell(target, 37316, dummy);
1745  break;
1746  // Nordrassil Regalia - bonus
1747  case FORM_MOONKIN_FORM:
1748  if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
1749  target->CastSpell(target, 37325, dummy);
1750  break;
1751  default:
1752  break;
1753  }
1754 
1755  // remove the shapeshift aura's boosts
1756  HandleShapeshiftBoosts(target, false);
1757  }
1758 
1759  if (Player* playerTarget = target->ToPlayer())
1760  {
1761  playerTarget->SendMovementSetCollisionHeight(playerTarget->GetCollisionHeight(), WorldPackets::Movement::UpdateCollisionHeightReason::Force);
1762  playerTarget->InitDataForForm();
1763  }
1764  else
1765  target->UpdateDisplayPower();
1766 
1767  if (target->getClass() == CLASS_DRUID)
1768  {
1769  // Dash
1771  aurEff->RecalculateAmount();
1772 
1773  // Disarm handling
1774  // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
1775  // and also HandleAuraModDisarm is not triggered
1776  if (!target->CanUseAttackType(BASE_ATTACK))
1777  {
1780  }
1781  }
1782 
1783  // stop handling the effect if it was removed by linked event
1784  if (apply && aurApp->GetRemoveMode())
1785  return;
1786 
1787  if (target->GetTypeId() == TYPEID_PLAYER)
1788  {
1789  // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
1790  for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
1791  {
1792  if (!shapeInfo->PresetSpellID[i])
1793  continue;
1794  if (apply)
1795  target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]);
1796  else
1797  target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]);
1798  }
1799  }
1800 }
Definition: SpellAuraEffects.h:28
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
Definition: SpellAuraDefines.h:610
void UpdateDisplayPower()
Definition: Unit.cpp:5306
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:613
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
TypeID GetTypeId() const
Definition: Object.h:167
bool IsMounted() const