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

#include "SpellAuraEffects.h"

Public Member Functions

UnitGetCaster () const
 
ObjectGuid GetCasterGUID () const
 
AuraGetBase () const
 
void GetTargetList (std::list< Unit * > &targetList) const
 
void GetApplicationList (std::list< AuraApplication * > &applicationList) const
 
SpellModifierGetSpellModifier () const
 
SpellInfo const * GetSpellInfo () const
 
uint32 GetId () const
 
uint32 GetEffIndex () const
 
int32 GetBaseAmount () const
 
int32 GetDieSides () const
 
int32 GetAmplitude () const
 
int32 GetMiscValueB () const
 
int32 GetMiscValue () const
 
AuraType GetAuraType () const
 
int32 GetAmount () const
 
int32 GetForcedAmount () const
 
void SetAmount (int32 amount)
 
int32 GetPeriodicTimer () const
 
void SetPeriodicTimer (int32 periodicTimer)
 
int32 CalculateAmount (Unit *caster)
 
void CalculatePeriodic (Unit *caster, bool create=false, bool load=false)
 
void CalculatePeriodicData ()
 
void CalculateSpellMod ()
 
void ChangeAmount (int32 newAmount, bool mark=true, bool onStackOrReapply=false)
 
void RecalculateAmount ()
 
void RecalculateAmount (Unit *caster)
 
bool CanBeRecalculated () const
 
void SetCanBeRecalculated (bool val)
 
void HandleEffect (AuraApplication *aurApp, uint8 mode, bool apply)
 
void HandleEffect (Unit *target, uint8 mode, bool apply)
 
void ApplySpellMod (Unit *target, bool apply)
 
void Update (uint32 diff, Unit *caster)
 
void UpdatePeriodic (Unit *caster)
 
uint32 GetTickNumber () const
 
int32 GetTotalTicks () const
 
void ResetPeriodic (bool resetPeriodicTimer=false)
 
void ResetTicks ()
 
bool IsPeriodic () const
 
void SetPeriodic (bool isPeriodic)
 
bool IsAffectedOnSpell (SpellInfo const *spell) const
 
bool HasSpellClassMask () const
 
void SendTickImmune (Unit *target, Unit *caster) const
 
void PeriodicTick (AuraApplication *aurApp, Unit *caster) const
 
void HandleProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
bool CheckEffectProc (AuraApplication *aurApp, ProcEventInfo &eventInfo) const
 
void CleanupTriggeredSpells (Unit *target)
 
void HandleShapeshiftBoosts (Unit *target, bool apply) const
 
float GetCritChance () const
 
void SetCritChance (float crit)
 
uint8 GetCasterLevel () const
 
bool CanApplyResilience () const
 
float GetPctMods () const
 
void SetPctMods (float pctMods)
 
int32 GetOldAmount () const
 
void SetOldAmount (int32 amount)
 
void SetEnabled (bool enabled)
 
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 HandleAuraModShapeshift (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTransform (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModScale (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraCloneCaster (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleFeignDeath (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModUnattackable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDisarm (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSilence (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPacify (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPacifyAndSilence (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraAllowOnlyAbility (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackResources (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackCreatures (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraTrackStealthed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStalked (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraUntrackable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModPetTalentsPoints (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSkill (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraMounted (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraAllowFlight (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraWaterWalk (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraFeatherFall (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraHover (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleWaterBreathing (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleForceMoveForward (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModThreat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModTotalThreat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTaunt (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void 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 HandleModStateImmunityMask (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMechanicImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModEffectImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStateImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModSchoolImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDmgImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDispelImmunity (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistanceExclusive (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModBaseResistancePCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModResistancePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModBaseResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTargetResistance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPercentStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellDamagePercentFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHealingPercentFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellDamagePercentFromAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHealingPercentFromAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModHealingDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModTotalPercentStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModResistenceOfStatPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModExpertise (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerRegen (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerRegenPCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModManaRegen (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseHealth (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseMaxHealth (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseEnergy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseEnergyPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModIncreaseHealthPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraIncreaseBaseHealthPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModParryPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModDodgePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModBlockPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRegenInterrupt (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModWeaponCritPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModHitChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellHitChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCritChance (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModSpellCritChanceShool (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModCritPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModCastingSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMeleeRangedSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModCombatSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModAttackSpeed (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModMeleeSpeedPct (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedHaste (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleRangedAmmoHaste (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModRating (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModRatingFromStat (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedAttackPower (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPowerPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedAttackPowerPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModRangedAttackPowerOfStatPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPowerOfStatPercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModAttackPowerOfArmor (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModDamageDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModDamagePercentDone (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModOffhandDamagePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleShieldBlockValue (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleShieldBlockValuePercent (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerCostPCT (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleModPowerCost (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleArenaPreparation (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleNoReagentUseAura (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraRetainComboPoints (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraDummy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleChannelDeathItem (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleBindSight (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleFarSight (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleForceReaction (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraEmpathy (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModFaction (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleComprehendLanguage (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraConvertRune (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraLinked (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraOpenStable (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraModFakeInebriation (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraOverrideSpells (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandleAuraSetVehicle (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePreventResurrection (AuraApplication const *aurApp, uint8 mode, bool apply) const
 
void HandlePeriodicDummyAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicTriggerSpellAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicTriggerSpellWithValueAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicDamageAurasTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealthLeechAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealthFunnelAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicHealAurasTick (Unit *target, Unit *caster) const
 
void HandlePeriodicManaLeechAuraTick (Unit *target, Unit *caster) const
 
void HandleObsModPowerAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicEnergizeAuraTick (Unit *target, Unit *caster) const
 
void HandlePeriodicPowerBurnAuraTick (Unit *target, Unit *caster) const
 
void HandleBreakableCCAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerSpellWithValueAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleProcTriggerDamageAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleRaidProcFromChargeAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 
void HandleRaidProcFromChargeWithValueAuraProc (AuraApplication *aurApp, ProcEventInfo &eventInfo)
 

Private Member Functions

friend Aura::~Aura ()
 
 ~AuraEffect ()
 
 AuraEffect (Aura *base, uint8 effIndex, int32 *baseAmount, Unit *caster)
 
float CalcPeriodicCritChance (Unit const *caster, Unit const *target) const
 

Private Attributes

Aura *const m_base
 
SpellInfo const *const m_spellInfo
 
int32 const m_baseAmount
 
int32 const m_dieSides
 
bool m_applyResilience
 
uint8 m_casterLevel
 
int32 m_amount
 
float m_critChance
 
float m_pctMods
 
int32 m_oldAmount
 
bool m_isAuraEnabled
 
ChannelTargetDatam_channelData
 
SpellModifierm_spellmod
 
int32 m_periodicTimer
 
int32 m_amplitude
 
uint32 m_tickNumber
 
uint8 const m_effIndex
 
bool m_canBeRecalculated
 
bool m_isPeriodic
 
bool m_isRecalculatingPassiveAuras = false
 

Friends

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

Detailed Description

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

AuraEffect::~AuraEffect ( )
private
406{
407 delete m_spellmod;
408 delete m_channelData;
409}
ChannelTargetData * m_channelData
Definition SpellAuraEffects.h:136
SpellModifier * m_spellmod
Definition SpellAuraEffects.h:138

References m_channelData, and m_spellmod.

◆ AuraEffect()

AuraEffect::AuraEffect ( Aura base,
uint8  effIndex,
int32 baseAmount,
Unit caster 
)
explicitprivate
384 :
385 m_base(base), m_spellInfo(base->GetSpellInfo()),
386 m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_dieSides(m_spellInfo->Effects[effIndex].DieSides),
387 m_critChance(0), m_pctMods(1.0f), m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_amplitude(0), m_tickNumber(0), m_effIndex(effIndex),
389{
390 CalculatePeriodic(caster, true, false);
392
393 m_amount = CalculateAmount(caster);
394 m_casterLevel = caster ? caster->GetLevel() : 0;
395 m_applyResilience = caster && caster->CanApplyResilience();
396
398
399 // Xinef: channel data structure
400 if (caster)
401 if (Spell* spell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
402 m_channelData = new ChannelTargetData(caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : nullptr);
403}
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:557
@ UNIT_FIELD_CHANNEL_OBJECT
Definition UpdateFields.h:93
int32 m_periodicTimer
Definition SpellAuraEffects.h:140
bool m_canBeRecalculated
Definition SpellAuraEffects.h:145
uint8 const m_effIndex
Definition SpellAuraEffects.h:144
uint8 m_casterLevel
Definition SpellAuraEffects.h:128
bool m_applyResilience
Definition SpellAuraEffects.h:127
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition SpellAuraEffects.cpp:599
void CalculateSpellMod()
Definition SpellAuraEffects.cpp:690
int32 m_oldAmount
Definition SpellAuraEffects.h:133
int32 CalculateAmount(Unit *caster)
Definition SpellAuraEffects.cpp:452
int32 m_amount
Definition SpellAuraEffects.h:129
float m_pctMods
Definition SpellAuraEffects.h:131
int32 m_amplitude
Definition SpellAuraEffects.h:141
void CalculatePeriodicData()
Definition SpellAuraEffects.cpp:584
uint32 m_tickNumber
Definition SpellAuraEffects.h:142
int32 const m_baseAmount
Definition SpellAuraEffects.h:124
SpellInfo const *const m_spellInfo
Definition SpellAuraEffects.h:123
bool m_isAuraEnabled
Definition SpellAuraEffects.h:134
bool m_isPeriodic
Definition SpellAuraEffects.h:146
int32 const m_dieSides
Definition SpellAuraEffects.h:125
float m_critChance
Definition SpellAuraEffects.h:130
Aura *const m_base
Definition SpellAuraEffects.h:121
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:326
Definition Spell.h:298
bool CanApplyResilience() const
Definition Unit.h:1171
uint8 GetLevel() const
Definition Unit.h:1103
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1576
Definition Spell.h:254

References CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), CalculateSpellMod(), Unit::CanApplyResilience(), CURRENT_CHANNELED_SPELL, Unit::GetCurrentSpell(), Object::GetGuidValue(), Unit::GetLevel(), m_amount, m_applyResilience, m_casterLevel, m_channelData, and UNIT_FIELD_CHANNEL_OBJECT.

Member Function Documentation

◆ ApplySpellMod()

void AuraEffect::ApplySpellMod ( Unit target,
bool  apply 
)
814{
815 if (!m_spellmod || !target->IsPlayer())
816 return;
817
818 target->ToPlayer()->AddSpellMod(m_spellmod, apply);
819
820 // Auras with charges do not mod amount of passive auras
821 if (GetBase()->IsUsingCharges())
822 return;
823
824 // Guard against infinite recursion: a spell mod recalculating an aura that
825 // triggers ApplySpellMod again (self-referencing or mutual spell mods).
827 {
828 LOG_DEBUG("spells.aura", "AuraEffect::ApplySpellMod: Recursion detected for spell {} effect {}, skipping passive aura recalculation",
829 GetId(), GetEffIndex());
830 return;
831 }
833
834 // reapply some passive spells after add/remove related spellmods
835 // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
836 switch (GetMiscValue())
837 {
839 case SPELLMOD_EFFECT1:
840 case SPELLMOD_EFFECT2:
841 case SPELLMOD_EFFECT3:
842 {
843 ObjectGuid guid = target->GetGUID();
844 Unit::AuraApplicationMap& auras = target->GetAppliedAuras();
845 for (Unit::AuraApplicationMap::iterator iter = auras.begin(); iter != auras.end(); ++iter)
846 {
847 Aura* aura = iter->second->GetBase();
848 // only passive and permament auras-active auras should have amount set on spellcast and not be affected
849 // if aura is casted by others, it will not be affected
850 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
851 {
853 {
854 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
855 {
856 if (AuraEffect* aurEff = aura->GetEffect(i))
857 aurEff->RecalculateAmount();
858 }
859 }
860 else if (GetMiscValue() == SPELLMOD_EFFECT1)
861 {
862 if (AuraEffect* aurEff = aura->GetEffect(0))
863 aurEff->RecalculateAmount();
864 }
865 else if (GetMiscValue() == SPELLMOD_EFFECT2)
866 {
867 if (AuraEffect* aurEff = aura->GetEffect(1))
868 aurEff->RecalculateAmount();
869 }
870 else //if (modOp == SPELLMOD_EFFECT3)
871 {
872 if (AuraEffect* aurEff = aura->GetEffect(2))
873 aurEff->RecalculateAmount();
874 }
875 }
876 }
877
878 Pet* pet = target->ToPlayer()->GetPet();
879 if (!pet)
880 break;
881
882 ObjectGuid petguid = pet->GetGUID();
883 Unit::AuraApplicationMap& petauras = pet->GetAppliedAuras();
884 for (Unit::AuraApplicationMap::iterator iter = petauras.begin(); iter != petauras.end(); ++iter)
885 {
886 Aura* aura = iter->second->GetBase();
887 // only passive auras-active auras should have amount set on spellcast and not be affected
888 // if aura is casted by others, it will not be affected
889 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == petguid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
890 {
892 {
893 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
894 {
895 if (AuraEffect* aurEff = aura->GetEffect(i))
896 aurEff->RecalculateAmount();
897 }
898 }
899 else if (GetMiscValue() == SPELLMOD_EFFECT1)
900 {
901 if (AuraEffect* aurEff = aura->GetEffect(0))
902 aurEff->RecalculateAmount();
903 }
904 else if (GetMiscValue() == SPELLMOD_EFFECT2)
905 {
906 if (AuraEffect* aurEff = aura->GetEffect(1))
907 aurEff->RecalculateAmount();
908 }
909 else //if (modOp == SPELLMOD_EFFECT3)
910 {
911 if (AuraEffect* aurEff = aura->GetEffect(2))
912 aurEff->RecalculateAmount();
913 }
914 }
915 }
916 }
917 default:
918 break;
919 }
920
922}
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1637
std::uint8_t uint8
Definition Define.h:109
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
@ SPELLMOD_EFFECT2
Definition SpellDefines.h:88
@ SPELLMOD_ALL_EFFECTS
Definition SpellDefines.h:84
@ SPELLMOD_EFFECT3
Definition SpellDefines.h:99
@ SPELLMOD_EFFECT1
Definition SpellDefines.h:79
Definition SpellAuraEffects.h:39
uint32 GetId() const
Definition SpellAuraEffects.cpp:432
int32 GetMiscValue() const
Definition SpellAuraEffects.cpp:442
Aura * GetBase() const
Definition SpellAuraEffects.h:49
uint32 GetEffIndex() const
Definition SpellAuraEffects.h:56
bool m_isRecalculatingPassiveAuras
Definition SpellAuraEffects.h:147
Definition SpellAuras.h:87
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:105
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellAuras.h:176
bool IsPassive() const
Definition SpellAuras.cpp:1028
bool IsPermanent() const
Definition SpellAuras.h:139
Definition ObjectGuid.h:118
bool IsPlayer() const
Definition Object.h:201
Player * ToPlayer()
Definition Object.h:202
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
Definition Pet.h:41
Pet * GetPet() const
Definition Player.cpp:8950
void AddSpellMod(SpellModifier *mod, bool apply)
Definition Player.cpp:9845
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition SpellInfo.cpp:1344
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:673
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1383

References Player::AddSpellMod(), Unit::GetAppliedAuras(), GetBase(), Aura::GetCasterGUID(), Aura::GetEffect(), GetEffIndex(), Object::GetGUID(), GetId(), GetMiscValue(), Player::GetPet(), Aura::GetSpellInfo(), SpellInfo::IsAffectedBySpellMod(), Aura::IsPassive(), Aura::IsPermanent(), Object::IsPlayer(), LOG_DEBUG, m_isRecalculatingPassiveAuras, m_spellmod, MAX_SPELL_EFFECTS, SPELLMOD_ALL_EFFECTS, SPELLMOD_EFFECT1, SPELLMOD_EFFECT2, SPELLMOD_EFFECT3, and Object::ToPlayer().

Referenced by HandleEffect().

◆ CalcPeriodicCritChance()

float AuraEffect::CalcPeriodicCritChance ( Unit const *  caster,
Unit const *  target 
) const
private
1072{
1073 float critChance = 0.0f;
1074 if (caster)
1075 {
1076 if (Player* modOwner = caster->GetSpellModOwner())
1077 {
1078 Unit::AuraEffectList const& mPeriodicCritAuras = modOwner->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
1079 for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
1080 {
1081 if ((*itr)->IsAffectedOnSpell(GetSpellInfo()))
1082 {
1083 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
1084 break;
1085 }
1086 }
1087
1088 switch (GetSpellInfo()->SpellFamilyName)
1089 {
1090 // Rupture - since 3.3.3 can crit
1091 case SPELLFAMILY_ROGUE:
1092 if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100000)
1093 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
1094 break;
1095 }
1096 }
1097 }
1098 if (target && critChance > 0.0f)
1099 critChance = target->SpellTakenCritChance(caster, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), critChance, BASE_ATTACK, true);
1100
1101 return std::max(0.0f, critChance);
1102}
@ SPELL_DAMAGE_CLASS_RANGED
Definition SharedDefines.h:1552
@ SPELLFAMILY_ROGUE
Definition SharedDefines.h:3792
@ SPELL_AURA_ABILITY_PERIODIC_CRIT
Definition SpellAuraDefines.h:349
@ BASE_ATTACK
Definition Unit.h:215
@ RANGED_ATTACK
Definition Unit.h:217
SpellInfo const * GetSpellInfo() const
Definition SpellAuraEffects.h:54
Definition Player.h:1084
flag96 SpellFamilyFlags
Definition SpellInfo.h:412
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1894
uint32 DmgClass
Definition SpellInfo.h:413
uint32 SpellFamilyName
Definition SpellInfo.h:411
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:680
Player * GetSpellModOwner() const
Definition Unit.cpp:12949

References BASE_ATTACK, SpellInfo::DmgClass, SpellInfo::GetSchoolMask(), GetSpellInfo(), Unit::GetSpellModOwner(), RANGED_ATTACK, SPELL_AURA_ABILITY_PERIODIC_CRIT, SPELL_DAMAGE_CLASS_RANGED, SPELLFAMILY_ROGUE, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, and Unit::SpellTakenCritChance().

Referenced by CalculatePeriodicData().

◆ CalculateAmount()

int32 AuraEffect::CalculateAmount ( Unit caster)
453{
454 int32 amount;
455 // default amount calculation
456 amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
457
458 // check item enchant aura cast
459 if (!amount && caster)
460 if (ObjectGuid itemGUID = GetBase()->GetCastItemGUID())
461 if (Player* playerCaster = caster->ToPlayer())
462 if (Item* castItem = playerCaster->GetItemByGuid(itemGUID))
463 if (castItem->GetItemSuffixFactor())
464 {
465 ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(std::abs(castItem->GetItemRandomPropertyId()));
466 if (item_rand_suffix)
467 {
468 for (uint8 k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++)
469 {
470 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]);
471 if (pEnchant)
472 {
473 for (uint8 t = 0; t < MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS; t++)
474 if (pEnchant->spellid[t] == m_spellInfo->Id)
475 {
476 amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
477 break;
478 }
479 }
480
481 if (amount)
482 break;
483 }
484 }
485 }
486
487 // custom amount calculations go here
488 // xinef: normal auras
489 switch (GetAuraType())
490 {
491 // crowd control auras
497 {
498 m_canBeRecalculated = false;
499 if (!m_spellInfo->ProcFlags || m_spellInfo->HasAura(SPELL_AURA_PROC_TRIGGER_SPELL)) // xinef: skip auras with proctriggerspell, they must have procflags...
500 break;
501 if (!caster)
502 break;
503 // not impacted by gear
504 // not impacted by target level
505 // not impacted by rank
506 // asumption - depends on caster level
507 amount = sObjectMgr->GetCreatureBaseStats(caster->GetLevel(), Classes::CLASS_WARRIOR)->BaseHealth[EXPANSION_WRATH_OF_THE_LICH_KING] / 4.75f;
508 // Glyphs increasing damage cap
510 for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
511 {
512 if ((*itr)->IsAffectedOnSpell(m_spellInfo))
513 {
514 // Glyph of Fear, Glyph of Frost nova and similar auras
515 if ((*itr)->GetMiscValue() == 7801)
516 {
517 AddPct(amount, (*itr)->GetAmount());
518 break;
519 }
520 }
521 }
522 break;
523 }
526 m_canBeRecalculated = false;
527 break;
529 // Titan's Grip
530 if (!caster)
531 break;
532 if (GetId() == 49152 && caster->ToPlayer())
533 {
534 Item* item1 = caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
535 Item* item2 = caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
536
537 if (!item2)
538 item2 = caster->ToPlayer()->GetShield();
539
540 if (item1 && item2
542 {
543 amount = -10;
544 }
545 else
546 amount = 0;
547 }
548 break;
549 default:
550 break;
551 }
552
553 // xinef: save base amount, before calculating sp etc. Used for Unit::CastDelayedSpellWithPeriodicAmount
554 SetOldAmount(amount * GetBase()->GetStackAmount());
555
556 // Xinef: Periodic auras
557 if (caster)
558 switch (GetAuraType())
559 {
562 // xinef: save caster depending auras, always pass 1 as stack amount, effect will be multiplicated at the end of the function by correct value!
563 if (GetBase()->GetType() == UNIT_AURA_TYPE)
564 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
565 break;
567 if (GetBase()->GetType() == UNIT_AURA_TYPE)
568 amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
569 break;
571 if (GetBase()->GetType() == UNIT_AURA_TYPE)
572 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE, 0.0f, 1);
573 break;
574 default:
575 break;
576 }
577
579
580 amount *= GetBase()->GetStackAmount();
581 return amount;
582}
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
#define MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS
Definition DBCStructure.h:1838
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition DBCStructure.h:1207
std::int32_t int32
Definition Define.h:103
std::uint32_t uint32
Definition Define.h:107
@ INVTYPE_2HWEAPON
Definition ItemTemplate.h:273
#define sObjectMgr
Definition ObjectMgr.h:1723
@ CLASS_WARRIOR
Definition SharedDefines.h:126
@ EXPANSION_WRATH_OF_THE_LICH_KING
Definition SharedDefines.h:55
@ SPELL_AURA_MANA_SHIELD
Definition SpellAuraDefines.h:160
@ SPELL_AURA_PERIODIC_DAMAGE
Definition SpellAuraDefines.h:66
@ SPELL_AURA_DAMAGE_SHIELD
Definition SpellAuraDefines.h:78
@ SPELL_AURA_PROC_TRIGGER_SPELL
Definition SpellAuraDefines.h:105
@ SPELL_AURA_MOD_FEAR
Definition SpellAuraDefines.h:70
@ SPELL_AURA_PERIODIC_HEAL
Definition SpellAuraDefines.h:71
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
Definition SpellAuraDefines.h:142
@ SPELL_AURA_MOD_ROOT
Definition SpellAuraDefines.h:89
@ SPELL_AURA_TRANSFORM
Definition SpellAuraDefines.h:119
@ SPELL_AURA_SCHOOL_ABSORB
Definition SpellAuraDefines.h:132
@ SPELL_AURA_PERIODIC_LEECH
Definition SpellAuraDefines.h:116
@ SPELL_AURA_MOD_CONFUSE
Definition SpellAuraDefines.h:68
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
Definition SpellAuraDefines.h:175
@ SPELL_AURA_MOD_STUN
Definition SpellAuraDefines.h:75
@ UNIT_AURA_TYPE
Definition SpellAuraDefines.h:385
@ OFF_ATTACK
Definition Unit.h:216
@ DOT
Definition Unit.h:256
@ SPELL_DIRECT_DAMAGE
Definition Unit.h:255
T AddPct(T &base, U pct)
Definition Util.h:58
void SetOldAmount(int32 amount)
Definition SpellAuraEffects.h:117
AuraType GetAuraType() const
Definition SpellAuraEffects.cpp:447
float GetPctMods() const
Definition SpellAuraEffects.h:113
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition SpellAuras.cpp:2509
uint8 GetStackAmount() const
Definition SpellAuras.h:148
Definition Item.h:220
ItemTemplate const * GetTemplate() const
Definition Item.cpp:544
Item * GetShield(bool useable=false) const
Definition PlayerStorage.cpp:525
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition PlayerStorage.cpp:490
uint32 Id
Definition SpellInfo.h:344
uint32 ProcFlags
Definition SpellInfo.h:379
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:417
bool HasAura(AuraType aura) const
Definition SpellInfo.cpp:902
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1428
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition Unit.cpp:9537
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition Unit.cpp:8718
Definition DBCStructure.h:1219
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > AllocationPct
Definition DBCStructure.h:1225
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition DBCStructure.h:1224
uint32 InventoryType
Definition ItemTemplate.h:632
Definition DBCStructure.h:1841
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition DBCStructure.h:1847

References AddPct(), ItemRandomSuffixEntry::AllocationPct, BASE_ATTACK, Aura::CallScriptEffectCalcAmountHandlers(), CLASS_WARRIOR, DOT, SpellInfo::Effects, ItemRandomSuffixEntry::Enchantment, EXPANSION_WRATH_OF_THE_LICH_KING, Unit::GetAuraEffectsByType(), GetAuraType(), GetBase(), GetEffIndex(), GetId(), Unit::GetLevel(), GetPctMods(), Player::GetShield(), GetSpellInfo(), Aura::GetStackAmount(), Item::GetTemplate(), Player::GetWeaponForAttack(), SpellInfo::HasAura(), SpellInfo::Id, ItemTemplate::InventoryType, INVTYPE_2HWEAPON, m_baseAmount, m_canBeRecalculated, m_effIndex, m_spellInfo, MAX_ITEM_ENCHANTMENT_EFFECTS, MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS, OFF_ATTACK, SpellInfo::ProcFlags, SetOldAmount(), sItemRandomSuffixStore, sObjectMgr, SPELL_AURA_DAMAGE_SHIELD, SPELL_AURA_MANA_SHIELD, SPELL_AURA_MOD_CONFUSE, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_HEAL, SPELL_AURA_PERIODIC_LEECH, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_SCHOOL_ABSORB, SPELL_AURA_TRANSFORM, SPELL_DIRECT_DAMAGE, Unit::SpellDamageBonusDone(), Unit::SpellHealingBonusDone(), SpellItemEnchantmentEntry::spellid, sSpellItemEnchantmentStore, Object::ToPlayer(), and UNIT_AURA_TYPE.

Referenced by AuraEffect(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), RecalculateAmount(), and RecalculateAmount().

◆ CalculatePeriodic()

void AuraEffect::CalculatePeriodic ( Unit caster,
bool  create = false,
bool  load = false 
)
Todo:
: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
600{
602
603 // prepare periodics
604 switch (GetAuraType())
605 {
607 // 3 spells have no amplitude set
608 if (!m_amplitude)
610 [[fallthrough]];
624 m_isPeriodic = true;
625 break;
626 default:
627 break;
628 }
629
631
632 if (!m_isPeriodic)
633 return;
634
635 // Xinef: fix broken data in dbc
636 if (m_amplitude <= 0)
637 m_amplitude = 1000;
638
639 Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
640
641 // Apply casting time mods
642 if (m_amplitude)
643 {
644 // Apply periodic time mod
645 if (modOwner)
647
648 if (caster)
649 {
652 }
653 }
654
655 if (load) // aura loaded from db
656 {
660 ++m_tickNumber;
661 }
662 else // aura just created or reapplied
663 {
664 m_tickNumber = 0;
665 // reset periodic timer on aura create or on reapply when aura isn't dot
666 // possibly we should not reset periodic timers only when aura is triggered by proc
667 // or maybe there's a spell attribute somewhere
668 bool resetPeriodicTimer = create
670
671 if (resetPeriodicTimer)
672 {
673 m_periodicTimer = 0;
674 // Start periodic on next tick or at aura apply
675 if (m_amplitude)
676 {
679 else if (caster && caster->IsTotem()) // for totems only ;d
680 {
681 m_periodicTimer = 100; // make it ALMOST instant
682 if (!GetBase()->IsPassive())
683 GetBase()->SetDuration(GetBase()->GetDuration() + 100);
684 }
685 }
686 }
687 }
688}
constexpr auto IN_MILLISECONDS
Definition Common.h:53
@ SPELL_ATTR5_EXTRA_INITIAL_PERIOD
Definition SharedDefines.h:564
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition SharedDefines.h:568
@ SPELL_AURA_PERIODIC_HASTE
Definition SpellAuraDefines.h:379
@ SPELL_AURA_OBS_MOD_HEALTH
Definition SpellAuraDefines.h:83
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
Definition SpellAuraDefines.h:125
@ SPELL_AURA_PERIODIC_MANA_LEECH
Definition SpellAuraDefines.h:127
@ SPELL_AURA_OBS_MOD_POWER
Definition SpellAuraDefines.h:84
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
Definition SpellAuraDefines.h:152
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
Definition SpellAuraDefines.h:290
@ SPELL_AURA_PERIODIC_ENERGIZE
Definition SpellAuraDefines.h:87
@ SPELL_AURA_POWER_BURN
Definition SpellAuraDefines.h:225
@ SPELL_AURA_PERIODIC_DUMMY
Definition SpellAuraDefines.h:289
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
Definition SpellAuraDefines.h:111
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
Definition SpellAuraDefines.h:86
@ SPELLMOD_ACTIVATION_TIME
Definition SpellDefines.h:95
@ UNIT_MOD_CAST_SPEED
Definition UpdateFields.h:137
int32 GetDuration() const
Definition SpellAuras.h:133
void SetDuration(int32 duration, bool withMods=false)
Definition SpellAuras.cpp:810
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition SpellAuras.cpp:2523
float GetFloatValue(uint16 index) const
Definition Object.cpp:306
void ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell *spell=nullptr, bool temporaryPet=false)
Definition Player.cpp:9763
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:441
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition Unit.cpp:6039
bool IsTotem() const
Definition Unit.h:799

References Player::ApplySpellMod(), Aura::CallScriptEffectCalcPeriodicHandlers(), SpellInfo::Effects, GetAuraType(), GetBase(), Aura::GetDuration(), Object::GetFloatValue(), GetId(), GetSpellInfo(), Unit::GetSpellModOwner(), SpellInfo::HasAttribute(), Unit::HasAuraTypeWithAffectMask(), IN_MILLISECONDS, Aura::IsPassive(), Unit::IsTotem(), m_amplitude, m_effIndex, m_isPeriodic, m_periodicTimer, m_spellInfo, m_tickNumber, Aura::SetDuration(), SPELL_ATTR5_EXTRA_INITIAL_PERIOD, SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC, SPELL_AURA_OBS_MOD_HEALTH, SPELL_AURA_OBS_MOD_POWER, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE_PERCENT, SPELL_AURA_PERIODIC_DUMMY, SPELL_AURA_PERIODIC_ENERGIZE, SPELL_AURA_PERIODIC_HASTE, SPELL_AURA_PERIODIC_HEAL, SPELL_AURA_PERIODIC_HEALTH_FUNNEL, SPELL_AURA_PERIODIC_LEECH, SPELL_AURA_PERIODIC_MANA_LEECH, SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_POWER_BURN, SPELLMOD_ACTIVATION_TIME, and UNIT_MOD_CAST_SPEED.

Referenced by AuraEffect(), spell_shadowfang_keep_haunting_spirits_aura::HandleUpdatePeriodic(), and Aura::SetLoadedState().

◆ CalculatePeriodicData()

void AuraEffect::CalculatePeriodicData ( )
585{
586 // xinef: save caster depending auras with pct mods
587 if (GetBase()->GetType() == UNIT_AURA_TYPE && GetCaster())
588 {
590 m_pctMods = GetCaster()->SpellPctHealingModsDone(GetBase()->GetUnitOwner(), GetSpellInfo(), DOT, false);
593 }
594
595 if (GetCaster())
596 SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : nullptr)));
597}
float CalcPeriodicCritChance(Unit const *caster, Unit const *target) const
Definition SpellAuraEffects.cpp:1071
Unit * GetCaster() const
Definition SpellAuraEffects.h:47
void SetCritChance(float crit)
Definition SpellAuraEffects.h:110
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype, bool includeHealingDonePct=true)
Definition Unit.cpp:9451
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition Unit.cpp:8390

References CalcPeriodicCritChance(), DOT, GetBase(), GetCaster(), GetSpellInfo(), SpellInfo::HasAura(), m_pctMods, m_spellInfo, SetCritChance(), SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_HEAL, SPELL_AURA_PERIODIC_LEECH, Unit::SpellPctDamageModsDone(), Unit::SpellPctHealingModsDone(), and UNIT_AURA_TYPE.

Referenced by AuraEffect().

◆ CalculateSpellMod()

void AuraEffect::CalculateSpellMod ( )
691{
692 switch (GetAuraType())
693 {
696 if (!m_spellmod)
697 {
700
701 m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
703 m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
704 }
706 break;
707 default:
708 break;
709 }
711}
SpellModType
Definition Player.h:93
@ SPELL_AURA_ADD_PCT_MODIFIER
Definition SpellAuraDefines.h:171
@ SPELL_AURA_ADD_FLAT_MODIFIER
Definition SpellAuraDefines.h:170
SpellModOp
Definition SpellDefines.h:75
int32 GetAmount() const
Definition SpellAuraEffects.h:64
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition SpellAuras.cpp:2537
Definition Player.h:182
SpellModOp op
Definition Player.h:185
SpellModType type
Definition Player.h:186
int32 value
Definition Player.h:187
uint32 spellId
Definition Player.h:189
flag96 mask
Definition Player.h:188

References Aura::CallScriptEffectCalcSpellModHandlers(), SpellInfo::Effects, GetAmount(), GetAuraType(), GetBase(), GetEffIndex(), GetId(), GetMiscValue(), GetSpellInfo(), m_spellmod, SpellModifier::mask, SpellModifier::op, SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SpellModifier::spellId, SpellModifier::type, and SpellModifier::value.

Referenced by AuraEffect(), ChangeAmount(), and Aura::SetLoadedState().

◆ CanApplyResilience()

bool AuraEffect::CanApplyResilience ( ) const
inline

◆ CanBeRecalculated()

bool AuraEffect::CanBeRecalculated ( ) const
inline

◆ ChangeAmount()

void AuraEffect::ChangeAmount ( int32  newAmount,
bool  mark = true,
bool  onStackOrReapply = false 
)
714{
715 // Reapply if amount change
716 uint8 handleMask = 0;
717 if (newAmount != GetAmount())
719 if (onStackOrReapply)
720 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
721
722 if (!handleMask)
723 return;
724
725 std::list<AuraApplication*> effectApplications;
726 GetApplicationList(effectApplications);
727
728 for (AuraApplication* aurApp : effectApplications)
729 if (aurApp->HasEffect(GetEffIndex()))
730 {
731 aurApp->GetTarget()->_RegisterAuraEffect(this, false);
732 HandleEffect(aurApp, handleMask, false);
733 }
734
735 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
736 {
737 if (!mark)
738 m_amount = newAmount;
739 else
740 SetAmount(newAmount);
742 }
743
744 for (AuraApplication* aurApp : effectApplications)
745 if (aurApp->HasEffect(GetEffIndex()))
746 {
747 if (aurApp->GetRemoveMode() != AURA_REMOVE_NONE)
748 continue;
749
750 aurApp->GetTarget()->_RegisterAuraEffect(this, true);
751 HandleEffect(aurApp, handleMask, true);
752 }
753}
@ AURA_REMOVE_NONE
Definition SpellAuraDefines.h:391
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
Definition SpellAuraDefines.h:44
@ AURA_EFFECT_HANDLE_REAPPLY
Definition SpellAuraDefines.h:45
Definition SpellAuras.h:37
void GetApplicationList(std::list< AuraApplication * > &applicationList) const
Definition SpellAuraEffects.cpp:422
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition SpellAuraEffects.cpp:755
void SetAmount(int32 amount)
Definition SpellAuraEffects.h:66

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT, AURA_EFFECT_HANDLE_REAPPLY, AURA_REMOVE_NONE, CalculateSpellMod(), GetAmount(), GetApplicationList(), GetEffIndex(), HandleEffect(), m_amount, and SetAmount().

Referenced by spell_gen_arena_drink::CalcAmount(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), RecalculateAmount(), RecalculateAmount(), and spell_gen_arena_drink::UpdatePeriodic().

◆ CheckEffectProc()

bool AuraEffect::CheckEffectProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
) const
1195{
1196 bool result = GetBase()->CallScriptCheckEffectProcHandlers(this, aurApp, eventInfo);
1197 if (!result)
1198 return false;
1199
1200 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1201 switch (GetAuraType())
1202 {
1208 {
1209 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1210 if (!damageInfo || !damageInfo->GetDamage())
1211 return false;
1212
1213 // Spell own damage at apply won't break CC
1214 if (spellInfo && spellInfo == GetSpellInfo())
1215 {
1216 Aura* aura = GetBase();
1217 // called from spellcast, should not have ticked yet
1218 if (aura->GetDuration() == aura->GetMaxDuration())
1219 return false;
1220 }
1221 break;
1222 }
1225 // compare mechanic
1226 if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (1ULL << GetMiscValue())))
1227 return false;
1228 break;
1230 // skip melee hits and instant cast spells
1231 if (!eventInfo.GetProcSpell() || !eventInfo.GetProcSpell()->GetCastTime())
1232 return false;
1233 break;
1236 {
1237 // Skip melee hits and spells with wrong school or zero cost
1238 if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())
1239 || !spellInfo->ManaCost || !spellInfo->ManaCostPercentage)
1240 return false;
1241 break;
1242 }
1244 // Skip melee hits and spells with wrong school
1245 if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue()))
1246 return false;
1247 break;
1249 // Compare casters
1250 if (GetCasterGUID() != eventInfo.GetActor()->GetGUID())
1251 return false;
1252 break;
1255 {
1256 // Don't proc extra attacks while already processing extra attack spell
1257 uint32 triggerSpellId = m_spellInfo->Effects[GetEffIndex()].TriggerSpell;
1258 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
1259 {
1260 if (triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
1261 {
1262 uint32 lastExtraAttackSpell = eventInfo.GetActor()->GetLastExtraAttackSpell();
1263
1264 // Patch 1.12.0(?) extra attack abilities can no longer chain proc themselves
1265 if (lastExtraAttackSpell == triggerSpellId)
1266 return false;
1267
1268 // Patch 2.2.0 Sword Specialization (Warrior, Rogue) extra attack can no longer proc additional extra attacks
1269 // 3.3.5 Sword Specialization (Warrior), Hack and Slash (Rogue)
1270 if (lastExtraAttackSpell == SPELL_SWORD_SPECIALIZATION || lastExtraAttackSpell == SPELL_HACK_AND_SLASH)
1271 return false;
1272 }
1273 }
1274 break;
1275 }
1276 default:
1277 break;
1278 }
1279
1280 return result;
1281}
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
Definition SharedDefines.h:785
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
Definition SpellAuraDefines.h:294
@ SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
Definition SpellAuraDefines.h:135
@ SPELL_AURA_MOD_POWER_COST_SCHOOL
Definition SpellAuraDefines.h:136
@ SPELL_AURA_MECHANIC_IMMUNITY
Definition SpellAuraDefines.h:140
@ SPELL_AURA_MOD_DAMAGE_FROM_CASTER
Definition SpellAuraDefines.h:334
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
Definition SpellAuraDefines.h:137
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
Definition SpellAuraDefines.h:180
@ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
Definition SpellAuraDefines.h:128
#define sSpellMgr
Definition SpellMgr.h:836
@ SPELL_HACK_AND_SLASH
Definition Unit.h:298
@ SPELL_SWORD_SPECIALIZATION
Definition Unit.h:297
ObjectGuid GetCasterGUID() const
Definition SpellAuraEffects.h:48
int32 GetMaxDuration() const
Definition SpellAuras.h:129
bool CallScriptCheckEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuras.cpp:2641
Definition Unit.h:336
uint32 GetDamage() const
Definition Unit.h:372
Spell const * GetProcSpell() const
Definition Unit.h:468
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:300
Unit * GetActor()
Definition Unit.h:459
DamageInfo * GetDamageInfo() const
Definition Unit.h:469
Definition SpellInfo.h:340
uint64 GetAllEffectsMechanicMask() const
Definition SpellInfo.cpp:1899
uint32 ManaCostPercentage
Definition SpellInfo.h:391
uint32 ManaCost
Definition SpellInfo.h:387
int32 GetCastTime() const
Definition Spell.h:562
uint32 GetLastExtraAttackSpell() const
Definition Unit.h:1010

References Aura::CallScriptCheckEffectProcHandlers(), SpellInfo::Effects, ProcEventInfo::GetActor(), SpellInfo::GetAllEffectsMechanicMask(), GetAuraType(), GetBase(), GetCasterGUID(), Spell::GetCastTime(), DamageInfo::GetDamage(), ProcEventInfo::GetDamageInfo(), Aura::GetDuration(), GetEffIndex(), Object::GetGUID(), Unit::GetLastExtraAttackSpell(), Aura::GetMaxDuration(), GetMiscValue(), ProcEventInfo::GetProcSpell(), SpellInfo::GetSchoolMask(), ProcEventInfo::GetSpellInfo(), GetSpellInfo(), m_spellInfo, SpellInfo::ManaCost, SpellInfo::ManaCostPercentage, SPELL_AURA_MECHANIC_IMMUNITY, SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK, SPELL_AURA_MOD_CONFUSE, SPELL_AURA_MOD_DAMAGE_FROM_CASTER, SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_MECHANIC_RESISTANCE, SPELL_AURA_MOD_POWER_COST_SCHOOL, SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT, SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_REFLECT_SPELLS_SCHOOL, SPELL_AURA_TRANSFORM, SPELL_EFFECT_ADD_EXTRA_ATTACKS, SPELL_HACK_AND_SLASH, SPELL_SWORD_SPECIALIZATION, and sSpellMgr.

◆ CleanupTriggeredSpells()

void AuraEffect::CleanupTriggeredSpells ( Unit target)
Todo:
: is there a spell flag, which can solve this in a more sophisticated way?
1322{
1323 uint32 tSpellId = m_spellInfo->Effects[GetEffIndex()].TriggerSpell;
1324 if (!tSpellId)
1325 return;
1326
1327 SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
1328 if (!tProto)
1329 return;
1330
1331 if (tProto->GetDuration() != -1)
1332 return;
1333
1334 // needed for spell 43680, maybe others
1338 return;
1339
1340 target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
1341}
int32 GetDuration() const
Definition SpellInfo.cpp:2738
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5171

References SpellInfo::Effects, GetCasterGUID(), SpellInfo::GetDuration(), GetEffIndex(), m_spellInfo, Unit::RemoveAurasDueToSpell(), SPELL_AURA_PERIODIC_TRIGGER_SPELL, and sSpellMgr.

Referenced by AuraApplication::_HandleEffect().

◆ GetAmount()

int32 AuraEffect::GetAmount ( ) const
inline
64{ return m_isAuraEnabled ? m_amount : 0; }

References m_amount, and m_isAuraEnabled.

Referenced by AuraApplication::_HandleEffect(), Pet::_SaveAuras(), spell_dru_survival_instincts_aura::AfterApply(), spell_the_lich_king_necrotic_plague_jump_aura::AfterDispel(), spell_dru_lifebloom::AfterRemove(), spell_mage_living_bomb::AfterRemove(), spell_warl_curse_of_agony::ApplyEffect(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), spell_sha_earth_shield::CalculateAmount(), spell_warl_generic_scaling::CalculateAPAmount(), CalculateSpellMod(), ChangeAmount(), spell_hun_lock_and_load::CheckPeriodicProc(), spell_hun_lock_and_load::CheckTrapProc(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), spell_nether_portal_perseverence::HandleApply(), spell_pri_renew::HandleApplyEffect(), HandleAuraDummy(), HandleAuraIncreaseBaseHealthPercent(), HandleAuraLinked(), HandleAuraModAttackPower(), HandleAuraModAttackPowerPercent(), HandleAuraModBaseResistancePCT(), HandleAuraModCritPct(), HandleAuraModFakeInebriation(), HandleAuraModIncreaseEnergy(), HandleAuraModIncreaseEnergyPercent(), HandleAuraModIncreaseHealth(), HandleAuraModIncreaseHealthPercent(), HandleAuraModIncreaseMaxHealth(), HandleAuraModRangedAttackPower(), HandleAuraModRangedAttackPowerPercent(), HandleAuraModRangedHaste(), HandleAuraModResistance(), HandleAuraModResistanceExclusive(), HandleAuraModSkill(), HandleAuraModStat(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), Aura::HandleAuraSpecificMods(), spell_sha_maelstrom_weapon::HandleBonus(), HandleBreakableCCAuraProc(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), spell_shadowfang_keep_haunting_spirits_aura::HandleDummyTick(), spell_dk_improved_blood_presence::HandleEffectApply(), spell_dk_improved_frost_presence::HandleEffectApply(), spell_dk_improved_unholy_presence::HandleEffectApply(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), spell_pal_exorcism_and_holy_wrath_damage::HandleEffectCalcSpellMod(), spell_warl_improved_demonic_tactics::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), spell_gen_leeching_swarm_aura::HandleEffectPeriodic(), spell_icc_yh_volley_aura::HandleEffectPeriodic(), spell_hallows_end_base_fire::HandleEffectPeriodicUpdate(), spell_gen_burn_brutallus::HandleEffectPeriodicUpdate(), spell_sha_item_t10_elemental_2p_bonus::HandleEffectProc(), spell_serpentshrine_cavern_infection::HandleEffectRemove(), HandleModAttackSpeed(), HandleModBaseResistance(), HandleModCastingSpeed(), HandleModCombatSpeedPct(), HandleModDamageDone(), HandleModHitChance(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModMeleeRangedSpeedPct(), HandleModMeleeSpeedPct(), HandleModPercentStat(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModRating(), HandleModSpellCritChance(), HandleModSpellHitChance(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), spell_dk_chains_of_ice_aura::HandlePeriodic(), spell_ragin_flames_inferno::HandlePeriodic(), spell_dk_death_and_decay_aura::HandlePeriodic(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_hun_sniper_training::HandlePeriodic(), spell_hun_rapid_recuperation::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dk_butchery::HandleProc(), spell_dk_vendetta::HandleProc(), spell_dru_living_seed_proc::HandleProc(), spell_dru_glyph_of_innervate::HandleProc(), spell_dru_leader_of_the_pack::HandleProc(), spell_mage_magic_absorption::HandleProc(), spell_pal_sacred_shield_dummy::HandleProc(), spell_pri_imp_shadowform::HandleProc(), spell_sha_earth_shield::HandleProc(), spell_sha_shamanistic_rage::HandleProc(), spell_oculus_temporal_rift_aura::HandleProc(), spell_pet_guard_dog::HandleProc(), spell_dk_improved_blood_presence_triggered::HandleProc(), spell_dk_unholy_blight::HandleProc(), spell_dk_necrosis::HandleProc(), spell_dk_threat_of_thassarian::HandleProc(), spell_dru_t10_balance_4p_bonus::HandleProc(), spell_dru_living_seed::HandleProc(), spell_dru_glyph_of_rejuvenation::HandleProc(), spell_dru_revitalize::HandleProc(), spell_dru_t3_8p_bonus::HandleProc(), spell_dru_glyph_of_shred::HandleProc(), spell_hun_glyph_of_arcane_shot::HandleProc(), spell_hun_piercing_shots::HandleProc(), spell_item_necrotic_touch::HandleProc(), spell_item_trinket_stack< StackSpell, TriggerSpell >::HandleProc(), spell_item_frozen_shadoweave::HandleProc(), spell_item_pet_healing::HandleProc(), spell_item_swift_hand_justice_dummy::HandleProc(), spell_mage_burnout::HandleProc(), spell_mage_master_of_elements::HandleProc(), spell_mage_hot_streak::HandleProc(), spell_pal_righteous_vengeance::HandleProc(), spell_pal_sheath_of_light::HandleProc(), spell_pal_judgement_of_light_heal::HandleProc(), spell_pal_spiritual_attunement::HandleProc(), spell_pal_t8_2p_bonus::HandleProc(), spell_pal_glyph_of_holy_light_dummy::HandleProc(), spell_pal_light_s_beacon::HandleProc(), spell_pri_divine_aegis::HandleProc(), spell_pri_glyph_of_prayer_of_healing::HandleProc(), spell_pri_vampiric_embrace::HandleProc(), spell_pri_glyph_of_dispel_magic::HandleProc(), spell_pri_t10_heal_2p_bonus::HandleProc(), spell_pri_blessed_recovery::HandleProc(), spell_rog_glyph_of_backstab::HandleProc(), spell_rog_quick_recovery::HandleProc(), spell_sha_t10_restoration_4p_bonus::HandleProc(), spell_sha_nature_guardian::HandleProc(), spell_sha_glyph_of_healing_wave::HandleProc(), spell_sha_spirit_hunt::HandleProc(), spell_sha_ancestral_awakening::HandleProc(), spell_sha_glyph_of_earth_shield::HandleProc(), spell_sha_glyph_of_totem_of_wrath::HandleProc(), spell_sha_t10_elemental_4p_bonus::HandleProc(), spell_sha_t8_elemental_4p_bonus::HandleProc(), spell_sha_t9_elemental_4p_bonus::HandleProc(), spell_warl_seed_of_corruption_dummy::HandleProc(), spell_warl_seed_of_corruption_generic::HandleProc(), spell_warl_soul_leech::HandleProc(), spell_dk_wandering_plague_aura::HandleProc(), spell_pri_body_and_soul::HandleProcDummy(), HandleProcTriggerDamageAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), HandleRangedAmmoHaste(), spell_warl_haunt_aura::HandleRemove(), HandleShieldBlockValue(), HandleShieldBlockValuePercent(), spell_hun_sniper_training::HandleUpdatePeriodic(), Aura::IsAuraStronger(), Unit::IsHighestExclusiveAuraEffect(), Unit::MeleeDamageBonusTaken(), Unit::ModSpellDuration(), spell_valanar_kinetic_bomb_absorb_aura::OnAbsorb(), spell_the_lich_king_necrotic_plague_jump_aura::OnDispel(), spell_kalecgos_curse_of_boundless_agony_aura::OnPeriodic(), spell_xt002_gravity_bomb_aura::OnPeriodic(), spell_lurker_below_spout::OnPeriodic(), spell_blood_queen_essence_of_the_blood_queen_aura::OnProc(), spell_pal_eye_for_an_eye::OnProc(), spell_warl_siphon_life::OnProc(), spell_warl_fel_synergy::OnProc(), spell_warr_improved_spell_reflection::OnProc(), spell_warr_damage_shield::OnProc(), spell_sindragosa_instability_aura::OnRemove(), spell_the_lich_king_necrotic_plague_jump_aura::OnRemove(), spell_shield_of_runes_aura::OnRemove(), spell_xt002_gravity_bomb_aura::OnRemove(), spell_xt002_searing_light_spawn_life_spark_aura::OnRemove(), spell_claw_swipe_check::OnRemove(), spell_ulduar_stone_grip_aura::OnRemoveStun(), spell_the_lich_king_infest_aura::OnUpdate(), spell_karazhan_overload_aura::PeriodicTick(), spell_sha_mana_tide::PeriodicTick(), Unit::RemoveAurasDueToSpellBySteal(), ArenaSpectator::ShouldSendAura(), Unit::SpellDamageBonusDone(), Unit::SpellPctDamageModsDone(), spell_black_temple_shadow_inferno_aura::Update(), spell_black_temple_spell_absorption_aura::Update(), Player::UpdateAttackPowerAndDamage(), spell_gen_arena_drink::UpdatePeriodic(), UpdatePeriodic(), Unit::UpdateResistanceBuffModsMod(), Unit::UpdateStatBuffMod(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetAmplitude()

int32 AuraEffect::GetAmplitude ( ) const
inline
59{ return m_amplitude; }

References m_amplitude.

Referenced by spell_igb_rocket_pack_aura::HandleRemove().

◆ GetApplicationList()

void AuraEffect::GetApplicationList ( std::list< AuraApplication * > &  applicationList) const
423{
424 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
425 for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
426 {
427 if (appIter->second->HasEffect(GetEffIndex()))
428 applicationList.push_back(appIter->second);
429 }
430}
ApplicationMap const & GetApplicationMap()
Definition SpellAuras.h:182
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition SpellAuras.h:90

References Aura::GetApplicationMap(), GetBase(), and GetEffIndex().

Referenced by ChangeAmount(), and Update().

◆ GetAuraType()

AuraType AuraEffect::GetAuraType ( ) const
448{
449 return (AuraType)m_spellInfo->Effects[m_effIndex].ApplyAuraName;
450}
AuraType
Definition SpellAuraDefines.h:62

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by AuraApplication::_HandleEffect(), Unit::_RegisterAuraEffect(), CalculateAmount(), CalculatePeriodic(), CalculateSpellMod(), CheckEffectProc(), HandleArenaPreparation(), HandleAuraAllowFlight(), HandleAuraEmpathy(), HandleAuraFeatherFall(), HandleAuraHover(), HandleAuraModDisarm(), HandleAuraModIncreaseFlightSpeed(), HandleAuraModSchoolImmunity(), HandleAuraModSkill(), HandleAuraModStalked(), HandleAuraTrackStealthed(), HandleAuraUntrackable(), HandleAuraWaterWalk(), HandleComprehendLanguage(), HandleEffect(), spell_dk_pet_scaling::HandleEffectApply(), spell_dru_treant_scaling::HandleEffectApply(), spell_pet_hit_expertise_scalling::HandleEffectApply(), spell_pet_intellect_spirit_resilience_scaling::HandleEffectApply(), spell_pet_spellhit_expertise_spellpen_scaling::HandleEffectApply(), spell_mage_pet_scaling::HandleEffectApply(), spell_pri_shadowfiend_scaling::HandleEffectApply(), spell_sha_feral_spirit_scaling::HandleEffectApply(), spell_sha_fire_elemental_scaling::HandleEffectApply(), spell_warl_infernal_scaling::HandleEffectApply(), HandleForceMoveForward(), HandleModCastingSpeed(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealAurasTick(), HandleProc(), Aura::IsAuraStronger(), PeriodicTick(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), ArenaSpectator::ShouldSendAura(), and UpdatePeriodic().

◆ GetBase()

Aura * AuraEffect::GetBase ( ) const
inline
49{ return m_base; }

References m_base.

Referenced by spell_rog_stealth_buff_tracker< RemoveSpellId >::AfterApply(), ApplySpellMod(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), CalculateSpellMod(), CheckEffectProc(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), spell_festergut_blighted_spores_aura::ExtraEffect(), GetApplicationList(), Unit::GetAuraEffect(), GetCaster(), GetCasterGUID(), GetTargetList(), GetTotalTicks(), HandleAuraDummy(), HandleAuraLinked(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), HandleEffect(), HandleEffect(), spell_pal_exorcism_and_holy_wrath_damage::HandleEffectCalcSpellMod(), spell_warl_improved_demonic_tactics::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), spell_brewfest_main_ram_buff::HandleEffectPeriodic(), spell_pos_glacial_strike_aura::HandleEffectPeriodic(), HandleObsModPowerAuraTick(), HandlePeriodicDamageAurasTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandleProc(), spell_sha_static_shock::HandleProc(), spell_sha_t10_elemental_4p_bonus::HandleProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_dk_glyph_of_scourge_strike_script::HandleScriptEffect(), spell_pal_seal_of_vengeance_aura::HandleSeal(), Unit::IsHighestExclusiveAuraEffect(), spell_hor_shared_suffering_aura::OnRemove(), PeriodicTick(), Spell::prepare(), Player::RestoreBaseRune(), Unit::SpellBaseDamageBonusTaken(), Update(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetBaseAmount()

◆ GetCaster()

◆ GetCasterGUID()

◆ GetCasterLevel()

uint8 AuraEffect::GetCasterLevel ( ) const
inline

◆ GetCritChance()

float AuraEffect::GetCritChance ( ) const
inline

◆ GetDieSides()

int32 AuraEffect::GetDieSides ( ) const
inline
58{ return m_dieSides; }

References m_dieSides.

Referenced by spell_warl_demonic_knowledge::CalculateAmount().

◆ GetEffIndex()

uint32 AuraEffect::GetEffIndex ( ) const
inline
56{ return m_effIndex; }

References m_effIndex.

Referenced by spell_dru_lifebloom::AfterRemove(), ApplySpellMod(), Unit::CalcAbsorbResist(), spell_pal_sacred_shield::CalculateAmount(), spell_sha_earth_shield::CalculateAmount(), spell_warl_improved_demonic_tactics::CalculateAmount(), spell_warr_rend::CalculateAmount(), CalculateAmount(), spell_warl_seed_of_corruption_dummy::CalculateBuffer(), spell_dru_treant_scaling::CalculateResistanceAmount(), spell_hun_generic_scaling::CalculateResistanceAmount(), spell_mage_pet_scaling::CalculateResistanceAmount(), spell_pri_shadowfiend_scaling::CalculateResistanceAmount(), spell_sha_feral_spirit_scaling::CalculateResistanceAmount(), spell_sha_fire_elemental_scaling::CalculateResistanceAmount(), spell_warl_generic_scaling::CalculateResistanceAmount(), spell_warl_infernal_scaling::CalculateResistanceAmount(), spell_mage_ice_barrier_aura::CalculateSpellAmount(), spell_mage_ice_barrier::CalculateSpellAmount(), CalculateSpellAmount(), CalculateSpellMod(), spell_dk_pet_scaling::CalculateStatAmount(), spell_dru_treant_scaling::CalculateStatAmount(), spell_hun_generic_scaling::CalculateStatAmount(), spell_mage_pet_scaling::CalculateStatAmount(), spell_pri_shadowfiend_scaling::CalculateStatAmount(), spell_sha_feral_spirit_scaling::CalculateStatAmount(), spell_sha_fire_elemental_scaling::CalculateStatAmount(), spell_warl_generic_scaling::CalculateStatAmount(), spell_warl_infernal_scaling::CalculateStatAmount(), Aura::CallScriptAfterEffectApplyHandlers(), Aura::CallScriptAfterEffectProcHandlers(), Aura::CallScriptAfterEffectRemoveHandlers(), Aura::CallScriptCheckEffectProcHandlers(), Aura::CallScriptEffectAbsorbHandlers(), Aura::CallScriptEffectAfterAbsorbHandlers(), Aura::CallScriptEffectAfterManaShieldHandlers(), Aura::CallScriptEffectApplyHandlers(), Aura::CallScriptEffectCalcAmountHandlers(), Aura::CallScriptEffectCalcPeriodicHandlers(), Aura::CallScriptEffectCalcSpellModHandlers(), Aura::CallScriptEffectManaShieldHandlers(), Aura::CallScriptEffectPeriodicHandlers(), Aura::CallScriptEffectProcHandlers(), Aura::CallScriptEffectRemoveHandlers(), Aura::CallScriptEffectSplitHandlers(), Aura::CallScriptEffectUpdatePeriodicHandlers(), SpellInfo::CanSpellCastOverrideAuraEffect(), Unit::CastDelayedSpellWithPeriodicAmount(), ChangeAmount(), CheckEffectProc(), CleanupTriggeredSpells(), GetApplicationList(), GetTargetList(), spell_muru_summon_blood_elves_periodic_aura::HandleApply(), spell_gen_baby_murloc_passive::HandleApply(), HandleAuraLinked(), HandleAuraModStat(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleEffect(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), spell_q12619_emblazon_runeblade::HandleEffectPeriodic(), spell_oculus_rider_aura::HandleOnEffectApply(), spell_transitus_shield_beam_aura::HandleOnEffectApply(), spell_kiljaeden_shadow_spike_aura::HandlePeriodic(), spell_kiljaeden_armageddon_periodic_aura::HandlePeriodic(), spell_halion_twilight_cutter_periodic_aura::HandlePeriodic(), spell_oculus_ride_ruby_emerald_amber_drake_que_aura::HandlePeriodic(), spell_dk_pet_scaling::HandlePeriodic(), spell_dk_army_of_the_dead_passive::HandlePeriodic(), spell_pet_hit_expertise_scalling::HandlePeriodic(), spell_pet_intellect_spirit_resilience_scaling::HandlePeriodic(), spell_pet_spellhit_expertise_spellpen_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_hun_sniper_training::HandlePeriodic(), spell_hun_rapid_recuperation::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_improved_demonic_tactics::HandlePeriodic(), spell_warl_demonic_knowledge::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_hun_cobra_strikes::HandleProc(), spell_rog_honor_among_thieves::HandleProc(), spell_karazhan_temptation::HandleProc(), spell_putricide_ooze_tank_protection::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_item_unsated_craving::HandleProc(), spell_sha_flametongue_weapon::HandleProc(), spell_sha_imp_water_shield::HandleProc(), HandleProcTriggerDamageAuraProc(), HandleProcTriggerSpellAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_putricide_mutated_plague_aura::HandleTriggerSpell(), spell_hun_sniper_training::HandleUpdatePeriodic(), TriggeredByAuraSpellData::Init(), spell_hadronox_summon_periodic_aura::OnApply(), spell_gruul_ground_slam_trigger::OnApply(), spell_kalecgos_curse_of_boundless_agony_aura::OnPeriodic(), spell_the_lich_king_vile_spirits_aura::OnPeriodic(), spell_tar_blaze_aura::OnPeriodic(), spell_thorim_lightning_pillar_P2_aura::OnPeriodic(), spell_karathress_power_of_tidalvess::OnPeriodic(), spell_karathress_power_of_caribdis::OnPeriodic(), spell_leotheras_demon_link::OnPeriodic(), spell_gen_periodic_knock_away::OnPeriodic(), spell_broggok_poison_cloud::PeriodicTick(), spell_pal_beacon_of_light::PeriodicTick(), spell_illidari_council_deadly_strike_aura::Update(), spell_mother_shahraz_beam_periodic_aura::Update(), spell_mother_shahraz_saber_lash_aura::Update(), spell_black_temple_charge_rage_aura::Update(), spell_black_temple_shadow_inferno_aura::Update(), spell_black_temple_spell_absorption_aura::Update(), Update(), and Player::UpdateAttackPowerAndDamage().

◆ GetForcedAmount()

int32 AuraEffect::GetForcedAmount ( ) const
inline
65{ return m_amount; }

References m_amount.

◆ GetId()

◆ GetMiscValue()

int32 AuraEffect::GetMiscValue ( ) const
443{
444 return m_spellInfo->Effects[m_effIndex].MiscValue;
445}

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by ApplySpellMod(), Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), CalculateSpellMod(), CheckEffectProc(), Unit::GetMaxNegativeAuraModifierByMiscMask(), Unit::GetMaxNegativeAuraModifierByMiscValue(), Unit::GetMaxPositiveAuraModifierByMiscMask(), Unit::GetMaxPositiveAuraModifierByMiscValue(), Unit::GetTotalAuraModifierByMiscMask(), Unit::GetTotalAuraModifierByMiscValue(), Unit::GetTotalAuraMultiplierByMiscMask(), Unit::GetTotalAuraMultiplierByMiscValue(), HandleAuraConvertRune(), HandleAuraDummy(), HandleAuraModBaseResistancePCT(), HandleAuraModEffectImmunity(), HandleAuraModFaction(), HandleAuraModIncreaseEnergy(), HandleAuraModIncreaseEnergyPercent(), HandleAuraModResistance(), HandleAuraModResistanceExclusive(), HandleAuraModResistenceOfStatPercent(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModSkill(), HandleAuraModStat(), HandleAuraModStateImmunity(), HandleAuraMounted(), HandleAuraOverrideSpells(), HandleAuraSetVehicle(), HandleAuraTrackCreatures(), HandleAuraTrackResources(), HandleAuraTransform(), HandleDetectAmore(), spell_warl_improved_demonic_tactics::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), HandleForceReaction(), HandleModBaseResistance(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModPercentStat(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModPowerRegen(), HandleModRating(), HandleModRatingFromStat(), HandleModResistancePercent(), HandleModSpellCritChanceShool(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModTotalPercentStat(), HandleObsModPowerAuraTick(), spell_illidan_shadow_prison_aura::HandleOnEffectApply(), spell_illidan_shadow_prison_aura::HandleOnEffectRemove(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandleShapeshiftBoosts(), Aura::IsAuraStronger(), Unit::MeleeDamageBonusTaken(), Unit::SendPeriodicAuraLog(), Unit::SpellBaseDamageBonusDone(), Unit::SpellBaseDamageBonusTaken(), Unit::SpellBaseHealingBonusDone(), Unit::SpellDamageBonusDone(), Unit::SpellPctDamageModsDone(), Unit::UpdateDamageDoneMods(), Unit::UpdateDamagePctDoneMods(), Unit::UpdateResistanceBuffModsMod(), and Unit::UpdateStatBuffMod().

◆ GetMiscValueB()

int32 AuraEffect::GetMiscValueB ( ) const
438{
439 return m_spellInfo->Effects[m_effIndex].MiscValueB;
440}

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by HandleAuraConvertRune(), and HandleModPowerRegen().

◆ GetOldAmount()

int32 AuraEffect::GetOldAmount ( ) const
inline
116{ return m_oldAmount; }

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

float AuraEffect::GetPctMods ( ) const
inline
113{ return m_pctMods; }

References m_pctMods.

Referenced by CalculateAmount().

◆ GetPeriodicTimer()

int32 AuraEffect::GetPeriodicTimer ( ) const
inline

◆ GetSpellInfo()

SpellInfo const * AuraEffect::GetSpellInfo ( ) const
inline
54{ return m_spellInfo; }

References m_spellInfo.

Referenced by spell_dragonblight_corrosive_spit::AfterApply(), Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), CalcPeriodicCritChance(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), spell_dru_treant_scaling::CalculateResistanceAmount(), spell_hun_generic_scaling::CalculateResistanceAmount(), spell_mage_pet_scaling::CalculateResistanceAmount(), spell_pri_shadowfiend_scaling::CalculateResistanceAmount(), spell_sha_feral_spirit_scaling::CalculateResistanceAmount(), spell_sha_fire_elemental_scaling::CalculateResistanceAmount(), spell_warl_generic_scaling::CalculateResistanceAmount(), spell_warl_infernal_scaling::CalculateResistanceAmount(), CalculateSpellMod(), spell_dk_pet_scaling::CalculateStatAmount(), spell_dru_treant_scaling::CalculateStatAmount(), spell_hun_generic_scaling::CalculateStatAmount(), spell_mage_pet_scaling::CalculateStatAmount(), spell_pri_shadowfiend_scaling::CalculateStatAmount(), spell_sha_feral_spirit_scaling::CalculateStatAmount(), spell_sha_fire_elemental_scaling::CalculateStatAmount(), spell_warl_generic_scaling::CalculateStatAmount(), spell_warl_infernal_scaling::CalculateStatAmount(), SpellInfo::CanSpellCastOverrideAuraEffect(), Player::CheckAttackFitToAuraRequirement(), CheckEffectProc(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), Unit::GetHighestExclusiveSameEffectSpellGroupValue(), HandleAuraDummy(), HandleAuraModEffectImmunity(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraTransform(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), spell_optic_link_aura::HandleEffectPeriodic(), HandleObsModPowerAuraTick(), spell_putricide_unbound_plague_dmg_aura::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_hun_cobra_strikes::HandleProc(), spell_dk_blood_caked_blade::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_pal_seal_of_command_aura::HandleProc(), spell_pal_illumination::HandleProc(), spell_pri_blessed_recovery::HandleProc(), spell_sha_imp_water_shield::HandleProc(), spell_sha_lightning_shield::HandleProc(), spell_sha_static_shock::HandleProc(), spell_warl_soul_leech::HandleProc(), HandleProcTriggerDamageAuraProc(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_dk_glyph_of_scourge_strike_script::HandleScriptEffect(), spell_pal_seal_of_vengeance_aura::HandleSeal(), TriggeredByAuraSpellData::Init(), Unit::IsHighestExclusiveAuraEffect(), spell_gen_sober_up::OnRemove(), Acore::AbsorbAuraOrderPred::operator()(), spell_entropius_negative_energy_periodic::PeriodicTick(), spell_dragonblight_corrosive_spit::PeriodicTick(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), Unit::SpellBaseDamageBonusDone(), Unit::SpellBaseDamageBonusTaken(), Unit::SpellPctDamageModsDone(), Player::UpdateAttackPowerAndDamage(), Player::UpdateExpertise(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetSpellModifier()

SpellModifier * AuraEffect::GetSpellModifier ( ) const
inline
52{ return m_spellmod; }

References m_spellmod.

◆ GetTargetList()

void AuraEffect::GetTargetList ( std::list< Unit * > &  targetList) const
412{
413 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
414 // remove all targets which were not added to new list - they no longer deserve area aura
415 for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
416 {
417 if (appIter->second->HasEffect(GetEffIndex()))
418 targetList.push_back(appIter->second->GetTarget());
419 }
420}

References Aura::GetApplicationMap(), GetBase(), and GetEffIndex().

◆ GetTickNumber()

uint32 AuraEffect::GetTickNumber ( ) const
inline
87{ return m_tickNumber; }

References m_tickNumber.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount(), spell_pos_blight_aura::HandleEffectPeriodic(), spell_icc_yh_volley_aura::HandleEffectPeriodic(), spell_hodir_biting_cold_main_aura::HandleEffectPeriodic(), spell_hodir_flash_freeze_aura::HandleEffectPeriodic(), spell_ignis_scorch_aura::HandleEffectPeriodic(), spell_mimiron_rapid_burst_aura::HandleEffectPeriodic(), spell_frost_tomb_aura::HandleEffectPeriodic(), spell_optic_link_aura::HandleEffectPeriodic(), spell_quest_test_flight_charging::HandleEffectPeriodicPlatform(), spell_quest_test_flight_charging::HandleEffectPeriodicSelf(), spell_hallows_end_base_fire::HandleEffectPeriodicUpdate(), spell_gen_burn_brutallus::HandleEffectPeriodicUpdate(), spell_warl_curse_of_agony::HandleEffectPeriodicUpdate(), spell_putricide_unbound_plague_dmg_aura::HandlePeriodic(), spell_shadow_bolt_whirl::HandlePeriodic(), spell_bronjahm_soulstorm_channel_ooc_aura::HandlePeriodicTick(), spell_bronjahm_soulstorm_visual_aura::HandlePeriodicTick(), spell_wailing_souls_periodic_aura::HandlePeriodicTick(), spell_exploding_orb_auto_grow_aura::HandlePeriodicTick(), spell_item_direbrew_remote_aura::HandlePeriodicTick(), HandlePeriodicTriggerSpellAuraTick(), spell_igb_rocket_pack_aura::HandleRemove(), spell_dru_wild_growth_aura::HandleTickUpdate(), spell_alert_drums::HandleTriggerSpell(), TriggeredByAuraSpellData::Init(), spell_eredar_twins_handle_touch_periodic::OnPeriodic(), spell_kalecgos_curse_of_boundless_agony_aura::OnPeriodic(), spell_muru_darkness_aura::OnPeriodic(), spell_the_lich_king_vile_spirits_aura::OnPeriodic(), spell_the_lich_king_soul_rip_aura::OnPeriodic(), spell_web_wrap_damage::OnPeriodic(), spell_assembly_rune_of_summoning_aura::OnPeriodic(), spell_illidan_demon_transform2_aura::OnPeriodic(), spell_the_lich_king_infest_aura::OnUpdate(), spell_karazhan_overload_aura::PeriodicTick(), spell_geddon_inferno_aura::PeriodicTick(), spell_entropius_negative_energy_periodic::PeriodicTick(), spell_doomfire::PeriodicTick(), spell_trollgore_corpse_explode_aura::PeriodicTick(), spell_blood_queen_pact_of_the_darkfallen_dmg_aura::PeriodicTick(), spell_igb_explosion_main_aura::PeriodicTick(), spell_dreamwalker_mana_void_aura::PeriodicTick(), spell_summoning_rhyme_aura::PeriodicTick(), spell_broggok_poison_cloud::PeriodicTick(), spell_gen_holiday_buff_food::TriggerFoodBuff(), spell_mother_shahraz_random_periodic_aura::Update(), and spell_gen_arena_drink::UpdatePeriodic().

◆ GetTotalTicks()

◆ HandleArenaPreparation()

void AuraEffect::HandleArenaPreparation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5097{
5098 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5099 return;
5100
5101 Unit* target = aurApp->GetTarget();
5102
5103 if (apply)
5105 else
5106 {
5107 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5108 if (target->HasAuraType(GetAuraType()))
5109 return;
5111 }
5112}
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
@ UNIT_FLAG_PREPARATION
Definition UnitDefines.h:262
Definition Unit.h:664
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:6006
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
ObjectGuid GetTarget() const
Definition Unit.h:861
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749

References AURA_EFFECT_HANDLE_REAL, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), and UNIT_FLAG_PREPARATION.

◆ HandleAuraAllowFlight()

void AuraEffect::HandleAuraAllowFlight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3429{
3431 return;
3432
3433 Unit* target = aurApp->GetTarget();
3434
3435 if (!apply)
3436 {
3437 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3438 if (target->HasAuraType(GetAuraType()) || target->HasIncreaseMountedFlightSpeedAura())
3439 return;
3440 }
3441
3442 target->SetCanFly(apply);
3443
3444 if (!apply && target->IsCreature() && !target->IsLevitating())
3445 target->GetMotionMaster()->MoveFall();
3446}
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
Definition SpellAuraDefines.h:48
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
The unit will fall. Used when in the air. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:688
bool IsCreature() const
Definition Object.h:205
MotionMaster * GetMotionMaster()
Definition Unit.h:1759
bool IsLevitating() const
Definition Unit.h:1707
void SetCanFly(bool enable)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:16555
bool HasIncreaseMountedFlightSpeedAura() const
Definition Unit.h:1831

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), Unit::GetMotionMaster(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::HasIncreaseMountedFlightSpeedAura(), Object::IsCreature(), Unit::IsLevitating(), MotionMaster::MoveFall(), and Unit::SetCanFly().

◆ HandleAuraAllowOnlyAbility()

void AuraEffect::HandleAuraAllowOnlyAbility ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3207{
3209 return;
3210
3211 Unit* target = aurApp->GetTarget();
3212
3213 if (target->IsPlayer())
3214 {
3215 if (apply)
3217 else
3218 {
3219 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3220 if (target->HasAllowOnlyAbilityAura())
3221 return;
3223 }
3224 }
3225}
@ PLAYER_ALLOW_ONLY_ABILITY
Definition Player.h:482
void SetPlayerFlag(PlayerFlags flags)
Definition Player.h:1124
void RemovePlayerFlag(PlayerFlags flags)
Definition Player.h:1125
bool HasAllowOnlyAbilityAura() const
Definition Unit.h:1819

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Unit::HasAllowOnlyAbilityAura(), Object::IsPlayer(), PLAYER_ALLOW_ONLY_ABILITY, Player::RemovePlayerFlag(), Player::SetPlayerFlag(), and Object::ToPlayer().

◆ HandleAuraCloneCaster()

void AuraEffect::HandleAuraCloneCaster ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2902{
2904 return;
2905
2906 Unit* target = aurApp->GetTarget();
2907
2908 if (apply)
2909 {
2910 Unit* caster = GetCaster();
2911 if (!caster || caster == target)
2912 return;
2913
2914 // What must be cloned? at least display and scale
2915 target->SetDisplayId(caster->GetDisplayId());
2917 }
2918 else
2919 {
2920 target->SetDisplayId(target->GetNativeDisplayId());
2922 }
2923}
@ UNIT_FLAG2_MIRROR_IMAGE
Definition UnitDefines.h:300
virtual void SetDisplayId(uint32 modelId, float displayScale=1.f)
Definition Unit.cpp:13149
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:754
uint32 GetDisplayId() const
Definition Unit.h:1975
uint32 GetNativeDisplayId() const
Definition Unit.h:1977
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:755

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetCaster(), Unit::GetDisplayId(), Unit::GetNativeDisplayId(), AuraApplication::GetTarget(), Unit::RemoveUnitFlag2(), Unit::SetDisplayId(), Unit::SetUnitFlag2(), and UNIT_FLAG2_MIRROR_IMAGE.

◆ 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

3779{
3781 return;
3782
3783 Unit* target = aurApp->GetTarget();
3784
3785 if (!target->IsVehicle())
3786 return;
3787
3788 Unit* caster = GetCaster();
3789
3790 if (!caster || caster == target)
3791 return;
3792
3793 if (apply)
3794 {
3795 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3796 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3797 // so this break such spells or most of them.
3798 // Current formula about m_amount: effect base points + dieside - 1
3799 // TO DO: Reasearch more about 0/0 and fix it.
3800 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3801 }
3802 else
3803 {
3804 caster->_ExitVehicle();
3805 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3806 caster->RemoveAurasDueToSpell(GetId());
3807 }
3808}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition SpellAuraDefines.h:49
bool IsVehicle() const
Definition Unit.h:800
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:15738
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:15620
Vehicle * GetVehicleKit() const
Definition Unit.h:1926

References Unit::_EnterVehicle(), Unit::_ExitVehicle(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetCaster(), GetId(), AuraApplication::GetTarget(), Unit::GetVehicleKit(), Unit::IsVehicle(), m_amount, and Unit::RemoveAurasDueToSpell().

◆ HandleAuraConvertRune()

void AuraEffect::HandleAuraConvertRune ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5765{
5766 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5767 return;
5768
5769 Unit* target = aurApp->GetTarget();
5770
5771 if (!target->IsPlayer())
5772 return;
5773
5774 Player* player = target->ToPlayer();
5775
5777 return;
5778
5779 uint32 runes = m_amount;
5780 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
5781 if (apply)
5782 {
5783 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
5784 {
5785 if (GetMiscValue() != player->GetCurrentRune(i))
5786 continue;
5787 if (!player->GetRuneCooldown(i))
5788 {
5789 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
5790 --runes;
5791 }
5792 }
5793 }
5794 else
5795 player->RemoveRunesByAuraEffect(this);
5796}
RuneType
Definition Player.h:395
#define MAX_RUNES
Definition Player.h:385
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:131
@ CLASS_CONTEXT_ABILITY
Definition UnitDefines.h:241
int32 GetMiscValueB() const
Definition SpellAuraEffects.cpp:437
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13425
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2544
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2555
bool IsClass(Classes playerClass, ClassContext context=CLASS_CONTEXT_NONE) const override
Definition Player.cpp:1301
RuneType GetCurrentRune(uint8 index) const
Definition Player.h:2543

References Player::AddRuneByAuraEffect(), AURA_EFFECT_HANDLE_REAL, CLASS_CONTEXT_ABILITY, CLASS_DEATH_KNIGHT, Player::GetCurrentRune(), GetMiscValue(), GetMiscValueB(), Player::GetRuneCooldown(), AuraApplication::GetTarget(), Player::IsClass(), Object::IsPlayer(), m_amount, MAX_RUNES, Player::RemoveRunesByAuraEffect(), and Object::ToPlayer().

◆ HandleAuraDummy()

void AuraEffect::HandleAuraDummy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5155{
5157 return;
5158
5159 Unit* target = aurApp->GetTarget();
5160
5161 Unit* caster = GetCaster();
5162
5163 if (mode & AURA_EFFECT_HANDLE_REAL)
5164 {
5165 // pet auras
5166 if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
5167 {
5168 if (apply)
5169 target->AddPetAura(petSpell);
5170 else
5171 target->RemovePetAura(petSpell);
5172 }
5173 }
5174
5176 {
5177 // AT APPLY
5178 if (apply)
5179 {
5180 switch (GetId())
5181 {
5182 case 1515: // Tame beast
5183 // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
5184 if (caster && target->CanHaveThreatList())
5185 target->AddThreat(caster, 10.0f);
5186 break;
5187 case 34026: // kill command
5188 {
5189 Unit* pet = target->GetGuardianPet();
5190 if (!pet)
5191 break;
5192
5193 target->CastSpell(target, 34027, true, nullptr, this);
5194
5195 // set 3 stacks and 3 charges (to make all auras not disappear at once)
5196 Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
5197 Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
5198 if (owner_aura)
5199 {
5200 owner_aura->SetCharges(0);
5201 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5202 if (pet_aura)
5203 {
5204 pet_aura->SetCharges(0);
5205 pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5206 }
5207 }
5208 break;
5209 }
5210 case 37096: // Blood Elf Illusion
5211 {
5212 if (caster)
5213 {
5214 switch (caster->getGender())
5215 {
5216 case GENDER_FEMALE:
5217 caster->CastSpell(target, 37095, true, nullptr, this); // Blood Elf Disguise
5218 break;
5219 case GENDER_MALE:
5220 caster->CastSpell(target, 37093, true, nullptr, this);
5221 break;
5222 default:
5223 break;
5224 }
5225 }
5226 break;
5227 }
5228 case 55198: // Tidal Force
5229 {
5230 target->CastSpell(target, 55166, true);
5231 if (Aura* owner_aura = target->GetAura(55166))
5232 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5233 return;
5234 }
5235 case 39850: // Rocket Blast
5236 if (roll_chance_i(20)) // backfire stun
5237 target->CastSpell(target, 51581, true, nullptr, this);
5238 break;
5239 case 43873: // Headless Horseman Laugh
5240 target->PlayDistanceSound(11965);
5241 break;
5242 case 46354: // Blood Elf Illusion
5243 if (caster)
5244 {
5245 switch (caster->getGender())
5246 {
5247 case GENDER_FEMALE:
5248 caster->CastSpell(target, 46356, true, nullptr, this);
5249 break;
5250 case GENDER_MALE:
5251 caster->CastSpell(target, 46355, true, nullptr, this);
5252 break;
5253 }
5254 }
5255 break;
5256 case 46361: // Reinforced Net
5257 if (caster)
5258 target->GetMotionMaster()->MoveFall();
5259 break;
5260 case 46699: // Requires No Ammo
5261 if (target->IsPlayer())
5262 target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use
5263 break;
5264 case 71563:
5265 {
5266 if (Aura* newAura = target->AddAura(71564, target))
5267 newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
5268 return;
5269 }
5270 }
5271 }
5272 // AT REMOVE
5273 else
5274 {
5275 if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive() && aurApp->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
5276 {
5277 uint32 finalSpelId = 0;
5278 switch (GetId())
5279 {
5280 case 19548:
5281 finalSpelId = 19597;
5282 break;
5283 case 19674:
5284 finalSpelId = 19677;
5285 break;
5286 case 19687:
5287 finalSpelId = 19676;
5288 break;
5289 case 19688:
5290 finalSpelId = 19678;
5291 break;
5292 case 19689:
5293 finalSpelId = 19679;
5294 break;
5295 case 19692:
5296 finalSpelId = 19680;
5297 break;
5298 case 19693:
5299 finalSpelId = 19684;
5300 break;
5301 case 19694:
5302 finalSpelId = 19681;
5303 break;
5304 case 19696:
5305 finalSpelId = 19682;
5306 break;
5307 case 19697:
5308 finalSpelId = 19683;
5309 break;
5310 case 19699:
5311 finalSpelId = 19685;
5312 break;
5313 case 19700:
5314 finalSpelId = 19686;
5315 break;
5316 case 30646:
5317 finalSpelId = 30647;
5318 break;
5319 case 30653:
5320 finalSpelId = 30648;
5321 break;
5322 case 30654:
5323 finalSpelId = 30652;
5324 break;
5325 case 30099:
5326 finalSpelId = 30100;
5327 break;
5328 case 30102:
5329 finalSpelId = 30103;
5330 break;
5331 case 30105:
5332 finalSpelId = 30104;
5333 break;
5334 }
5335
5336 if (finalSpelId)
5337 caster->CastSpell(target, finalSpelId, true, nullptr, this);
5338 }
5339
5341 {
5343 switch (GetId())
5344 {
5345 case 2584: // Waiting to Resurrect
5346 // Waiting to resurrect spell cancel, we must remove player from resurrect queue
5347 if (target->IsPlayer())
5348 {
5349 if (Battleground* bg = target->ToPlayer()->GetBattleground())
5350 bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
5351 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
5352 bf->RemovePlayerFromResurrectQueue(target->GetGUID());
5353 }
5354 break;
5355 case 43681: // Inactive
5356 {
5357 if (!target->IsPlayer() || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5358 return;
5359
5360 if (target->GetMap()->IsBattleground())
5361 target->ToPlayer()->LeaveBattleground();
5362 break;
5363 }
5364 case 52172: // Coyote Spirit Despawn Aura
5365 case 60244: // Blood Parrot Despawn Aura
5366 target->CastSpell((Unit*)nullptr, GetAmount(), true, nullptr, this);
5367 break;
5368 // Halls of Lightning, Arc Lightning
5369 case 52921:
5370 {
5371 if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
5372 return;
5373
5374 Player* player = nullptr;
5375 Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
5376 Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
5377 Cell::VisitObjects(target, searcher, 10.0f);
5378
5379 if (player && player->GetGUID() != target->GetGUID())
5380 target->CastSpell(player, 52921, true);
5381
5382 return;
5383 }
5384 case 58600: // Restricted Flight Area
5385 case 58730: // Restricted Flight Area
5386 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
5387 target->CastSpell(target, 58601, true);
5388 break;
5389 case 46374: // quest The Power of the Elements (11893)
5390 {
5391 if (target->isDead() && GetBase() && target->IsCreature() && target->GetEntry() == 24601)
5392 {
5393 auto caster2 = GetBase()->GetCaster();
5394 if (caster2 && caster2->IsPlayer())
5395 {
5396 caster2->ToPlayer()->KilledMonsterCredit(25987);
5397 }
5398 }
5399 return;
5400 }
5401 }
5402 break;
5403 default:
5404 break;
5405 }
5406 }
5407 }
5408
5409 // AT APPLY & REMOVE
5410
5412 {
5414 {
5415 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5416 break;
5417 switch (GetId())
5418 {
5419 // Recently Bandaged
5420 case 11196:
5422 break;
5423 // Unstable Power
5424 case 24658:
5425 {
5426 uint32 spellId = 24659;
5427 if (apply && caster)
5428 {
5429 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5430
5431 for (uint32 i = 0; i < spell->StackAmount; ++i)
5432 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5433 break;
5434 }
5435 target->RemoveAurasDueToSpell(spellId);
5436 break;
5437 }
5438 // Restless Strength
5439 case 24661:
5440 {
5441 uint32 spellId = 24662;
5442 if (apply && caster)
5443 {
5444 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5445 for (uint32 i = 0; i < spell->StackAmount; ++i)
5446 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5447 break;
5448 }
5449 target->RemoveAurasDueToSpell(spellId);
5450 break;
5451 }
5452 // Tag Murloc
5453 case 30877:
5454 {
5455 // Tag/untag Blacksilt Scout
5456 target->SetEntry(apply ? 17654 : 17326);
5457 break;
5458 }
5459 case 57819: // Argent Champion
5460 case 57820: // Ebon Champion
5461 case 57821: // Champion of the Kirin Tor
5462 case 57822: // Wyrmrest Champion
5463 {
5464 if (!caster || !caster->IsPlayer())
5465 break;
5466
5467 uint32 FactionID = 0;
5468
5469 if (apply)
5470 {
5471 switch (m_spellInfo->Id)
5472 {
5473 case 57819:
5474 FactionID = 1106;
5475 break; // Argent Crusade
5476 case 57820:
5477 FactionID = 1098;
5478 break; // Knights of the Ebon Blade
5479 case 57821:
5480 FactionID = 1090;
5481 break; // Kirin Tor
5482 case 57822:
5483 FactionID = 1091;
5484 break; // The Wyrmrest Accord
5485 }
5486 }
5487 caster->ToPlayer()->SetChampioningFaction(FactionID);
5488 break;
5489 }
5490 // LK Intro VO (1)
5491 case 58204:
5492 if (target->IsPlayer())
5493 {
5494 // Play part 1
5495 if (apply)
5496 target->PlayDirectSound(14970, target->ToPlayer());
5497 // continue in 58205
5498 else
5499 target->CastSpell(target, 58205, true);
5500 }
5501 break;
5502 // LK Intro VO (2)
5503 case 58205:
5504 if (target->IsPlayer())
5505 {
5506 // Play part 2
5507 if (apply)
5508 target->PlayDirectSound(14971, target->ToPlayer());
5509 // Play part 3
5510 else
5511 target->PlayDirectSound(14972, target->ToPlayer());
5512 }
5513 break;
5514 case 62061: // Festive Holiday Mount
5515 if (target->HasMountedAura())
5516 {
5517 uint32 creatureEntry = 0;
5518 if (apply)
5519 {
5521 creatureEntry = 24906;
5522 else
5523 creatureEntry = 15665;
5524 }
5525 else
5526 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5527
5528 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5529 {
5530 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5531 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5532
5534 }
5535 }
5536 break;
5537 case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount
5538 if (target->HasMountedAura() && !target->HasIncreaseMountedFlightSpeedAura())
5539 {
5540 uint32 creatureEntry = 0;
5541
5542 if (apply)
5543 {
5544 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
5545 {
5546 creatureEntry = GREAT_BREWFEST_KODO;
5547 }
5548 else
5549 {
5550 creatureEntry = BREWFEST_KODO;
5551 }
5552 }
5553 else
5554 {
5555 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5556 }
5557
5558 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5559 {
5560 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5561 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5562
5564 }
5565 }
5566 break;
5567 }
5568
5569 break;
5570 }
5571 case SPELLFAMILY_MAGE:
5572 {
5573 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5574 //break;
5575 break;
5576 }
5577 case SPELLFAMILY_PRIEST:
5578 {
5579 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5580 //break;
5581 break;
5582 }
5583 case SPELLFAMILY_DRUID:
5584 {
5585 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5586 // break;
5587 break;
5588 }
5589 case SPELLFAMILY_SHAMAN:
5590 {
5591 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5592 // break;
5593 break;
5594 }
5595 }
5596}
#define sBattlefieldMgr
Definition BattlefieldMgr.h:76
bool roll_chance_i(int chance)
Definition Random.h:63
@ GENDER_MALE
Definition SharedDefines.h:61
@ GENDER_FEMALE
Definition SharedDefines.h:62
@ IMMUNITY_MECHANIC
Definition SharedDefines.h:1403
@ SPELLFAMILY_PRIEST
Definition SharedDefines.h:3790
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3787
@ SPELLFAMILY_GENERIC
Definition SharedDefines.h:3784
@ SPELLFAMILY_SHAMAN
Definition SharedDefines.h:3795
@ SPELLFAMILY_DRUID
Definition SharedDefines.h:3791
@ SPELL_AURA_MOUNTED
Definition SpellAuraDefines.h:141
@ AURA_REMOVE_BY_CANCEL
Definition SpellAuraDefines.h:393
@ AURA_REMOVE_BY_EXPIRE
Definition SpellAuraDefines.h:395
@ FRESH_BREWFEST_HOPS
Definition SpellAuraEffects.h:35
@ GREAT_BREWFEST_KODO
Definition SpellAuraEffects.h:34
@ BREWFEST_KODO
Definition SpellAuraEffects.h:33
@ MOVE_RUN
Definition UnitDefines.h:357
@ UNIT_FIELD_MOUNTDISPLAYID
Definition UpdateFields.h:126
Definition GridNotifiers.h:1348
void SetStackAmount(uint8 num)
Definition SpellAuras.cpp:937
void SetCharges(uint8 charges)
Definition SpellAuras.cpp:894
Definition Battlefield.h:208
Definition Battleground.h:294
bool IsBattleground() const
Definition Map.h:303
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition ObjectMgr.cpp:1644
uint32 GetEntry() const
Definition Object.h:117
void SetEntry(uint32 entry)
Definition Object.h:118
Definition SpellMgr.h:460
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition PlayerQuest.cpp:1962
Battleground * GetBattleground(bool create=false) const
Definition Player.cpp:12172
void RemoveAmmo()
Definition PlayerStorage.cpp:2586
void SetChampioningFaction(uint32 faction)
Definition Player.h:2592
void LeaveBattleground(Battleground *bg=nullptr)
Definition Player.cpp:11258
uint32 StackAmount
Definition SpellInfo.h:395
uint8 getGender() const
Definition Unit.h:848
void RemovePetAura(PetAura const *petSpell)
Definition Unit.cpp:13708
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5859
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:10461
void AddPetAura(PetAura const *petSpell)
Definition Unit.cpp:13696
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11437
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:15115
bool HasMountedAura() const
Definition Unit.h:1800
bool IsAlive() const
Definition Unit.h:1794
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1375
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1742
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:17356
bool CanHaveThreatList(bool skipAliveCheck=false) const
Definition Unit.cpp:11418
Guardian * GetGuardianPet() const
Definition Unit.cpp:7750
bool isDead() const
Definition Unit.h:1796
Map * GetMap() const
Definition Object.h:625
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2956
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2948
uint32 GetZoneId() const
Definition Object.cpp:3111
Definition GridNotifiers.h:501
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165
Definition CreatureData.h:170
uint32 CreatureDisplayID
Definition CreatureData.h:180
Definition CreatureData.h:187

References Unit::AddAura(), Unit::AddPetAura(), Unit::AddThreat(), Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_REAPPLY, AURA_REMOVE_BY_CANCEL, AURA_REMOVE_BY_EXPIRE, BREWFEST_KODO, Unit::CanHaveThreatList(), Unit::CastSpell(), ObjectMgr::ChooseDisplayId(), CreatureModel::CreatureDisplayID, FRESH_BREWFEST_HOPS, GENDER_FEMALE, GENDER_MALE, GetAmount(), Unit::GetAura(), Unit::GetAuraEffectsByType(), GetBase(), Player::GetBattleground(), GetCaster(), Aura::GetCaster(), GetCasterGUID(), Object::GetEntry(), Unit::getGender(), Unit::GetGuardianPet(), Object::GetGUID(), GetId(), WorldObject::GetMap(), GetMiscValue(), Unit::GetMotionMaster(), AuraApplication::GetRemoveMode(), Unit::GetSpeedRate(), GetSpellInfo(), Aura::GetSpellInfo(), AuraApplication::GetTarget(), WorldObject::GetZoneId(), GREAT_BREWFEST_KODO, Unit::HasIncreaseMountedFlightSpeedAura(), Unit::HasMountedAura(), SpellInfo::Id, IMMUNITY_MECHANIC, Unit::IsAlive(), Map::IsBattleground(), Object::IsCreature(), Unit::isDead(), Object::IsPlayer(), Player::KilledMonsterCredit(), Player::LeaveBattleground(), m_effIndex, m_spellInfo, MOVE_RUN, MotionMaster::MoveFall(), WorldObject::PlayDirectSound(), WorldObject::PlayDistanceSound(), Player::RemoveAmmo(), Unit::RemoveAurasDueToSpell(), Unit::RemovePetAura(), roll_chance_i(), sBattlefieldMgr, Player::SetChampioningFaction(), Aura::SetCharges(), Object::SetEntry(), Aura::SetStackAmount(), Unit::SetUInt32Value(), sObjectMgr, SPELL_AURA_MOUNTED, SPELLFAMILY_DRUID, SPELLFAMILY_GENERIC, SPELLFAMILY_MAGE, SPELLFAMILY_PRIEST, SPELLFAMILY_SHAMAN, SpellInfo::SpellFamilyName, sSpellMgr, SpellInfo::StackAmount, Object::ToPlayer(), UNIT_FIELD_MOUNTDISPLAYID, and Cell::VisitObjects().

◆ HandleAuraEmpathy()

void AuraEffect::HandleAuraEmpathy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5708{
5709 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5710 return;
5711
5712 Unit* target = aurApp->GetTarget();
5713
5714 if (!apply)
5715 {
5716 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5717 if (target->HasAuraType(GetAuraType()))
5718 return;
5719 }
5720
5721 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5723}
@ CREATURE_TYPE_BEAST
Definition SharedDefines.h:2622
@ UNIT_DYNFLAG_SPECIALINFO
Definition SharedDefines.h:3358
@ UNIT_DYNAMIC_FLAGS
Definition UpdateFields.h:136
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:795
uint32 GetCreatureType() const
Definition Unit.cpp:11918

References Object::ApplyModUInt32Value(), AURA_EFFECT_HANDLE_REAL, CREATURE_TYPE_BEAST, GetAuraType(), Unit::GetCreatureType(), AuraApplication::GetTarget(), Unit::HasAuraType(), UNIT_DYNAMIC_FLAGS, and UNIT_DYNFLAG_SPECIALINFO.

◆ HandleAuraFeatherFall()

void AuraEffect::HandleAuraFeatherFall ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3471{
3473 return;
3474
3475 Unit* target = aurApp->GetTarget();
3476
3477 if (Player* targetPlayer = target->ToPlayer())
3478 {
3479 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3480 }
3481
3482 if (!apply)
3483 {
3484 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3485 if (target->HasAuraType(GetAuraType()))
3486 return;
3487 }
3488
3489 target->SetFeatherFall(apply);
3490
3491 // start fall from current height
3492 if (!apply && target->IsPlayer())
3493 target->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), target->GetPositionZ());
3494}
#define sScriptMgr
Definition ScriptMgr.h:736
void SetFallInformation(uint32 time, float z)
Definition Player.h:2371
void SetFeatherFall(bool enable)
Definition Unit.cpp:16591
Seconds GetGameTime()
Definition GameTime.cpp:38
float GetPositionZ() const
Definition Position.h:123

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), GameTime::GetGameTime(), Position::GetPositionZ(), AuraApplication::GetTarget(), Unit::HasAuraType(), Object::IsPlayer(), Player::SetFallInformation(), Unit::SetFeatherFall(), sScriptMgr, and Object::ToPlayer().

◆ HandleAuraGhost()

void AuraEffect::HandleAuraGhost ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1898{
1900 return;
1901
1902 Unit* target = aurApp->GetTarget();
1903
1904 if (!target->IsPlayer())
1905 return;
1906
1907 if (apply)
1908 {
1912 }
1913 else
1914 {
1915 if (target->HasGhostAura())
1916 return;
1917
1921 }
1922}
@ PLAYER_FLAGS_GHOST
Definition Player.h:463
@ SERVERSIDE_VISIBILITY_GHOST
Definition SharedDefines.h:1262
@ GHOST_VISIBILITY_ALIVE
Definition SharedDefines.h:1269
@ GHOST_VISIBILITY_GHOST
Definition SharedDefines.h:1270
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:398
bool HasGhostAura() const
Definition Unit.h:1799
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition Object.h:618
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition Object.h:617

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), GHOST_VISIBILITY_ALIVE, GHOST_VISIBILITY_GHOST, Unit::HasGhostAura(), Object::IsPlayer(), WorldObject::m_serverSideVisibility, WorldObject::m_serverSideVisibilityDetect, PLAYER_FLAGS_GHOST, Player::RemovePlayerFlag(), SERVERSIDE_VISIBILITY_GHOST, Player::SetPlayerFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::SetValue(), and Object::ToPlayer().

◆ HandleAuraHover()

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

Sets movementflags

3497{
3499 return;
3500
3501 Unit* target = aurApp->GetTarget();
3502
3503 if (Player* targetPlayer = target->ToPlayer())
3504 {
3505 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3506 }
3507
3508 if (!apply)
3509 {
3510 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3511 if (target->HasAuraType(GetAuraType()))
3512 return;
3513 }
3514
3515 target->SetHover(apply);
3516}
void SetHover(bool enable)
Definition Unit.cpp:16632

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::SetHover(), sScriptMgr, and Object::ToPlayer().

◆ HandleAuraIncreaseBaseHealthPercent()

void AuraEffect::HandleAuraIncreaseBaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4571{
4573 return;
4574
4575 Unit* target = aurApp->GetTarget();
4576
4577 if (apply)
4579 else
4580 {
4583 }
4584}
@ SPELL_AURA_MOD_BASE_HEALTH_PCT
Definition SpellAuraDefines.h:345
@ AURA_EFFECT_HANDLE_STAT
Definition SpellAuraDefines.h:46
@ UNIT_MOD_HEALTH
Definition Unit.h:154
@ BASE_PCT
Definition Unit.h:134
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition Unit.cpp:11998
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition Unit.cpp:11965
float GetTotalAuraMultiplier(AuraType auratype) const
Definition Unit.cpp:6290

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetAmount(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Unit::SetStatPctModifier(), SPELL_AURA_MOD_BASE_HEALTH_PCT, and UNIT_MOD_HEALTH.

◆ HandleAuraLinked()

void AuraEffect::HandleAuraLinked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5799{
5800 Unit* target = aurApp->GetTarget();
5801
5802 uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target);
5803 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
5804 if (!triggeredSpellInfo)
5805 return;
5806
5807 if (mode & AURA_EFFECT_HANDLE_REAL)
5808 {
5809 if (apply)
5810 {
5811 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCaster() : target;
5812
5813 if (!caster)
5814 return;
5815 // If amount avalible cast with basepoints (Crypt Fever for example)
5816 if (GetAmount())
5817 caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
5818 else
5819 caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
5820 }
5821 else
5822 {
5823 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
5824 target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
5825 }
5826 }
5827 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
5828 {
5829 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
5830 // change the stack amount to be equal to stack amount of our aura
5831 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
5832 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
5833 }
5834}
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell, uint8 effIndex=MAX_SPELL_EFFECTS) const
Definition SpellInfo.cpp:1070
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5038
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1432

References AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_REAPPLY, Unit::CastCustomSpell(), Unit::CastSpell(), SpellInfo::Effects, GetAmount(), Unit::GetAura(), GetBase(), GetCaster(), GetCasterGUID(), GetEffIndex(), Object::GetGUID(), AuraApplication::GetRemoveMode(), Aura::GetStackAmount(), AuraApplication::GetTarget(), m_amount, m_effIndex, m_spellInfo, SpellInfo::NeedsToBeTriggeredByCaster(), Unit::RemoveAura(), and sSpellMgr.

◆ HandleAuraModAttackPower()

void AuraEffect::HandleAuraModAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4886{
4888 return;
4889
4890 Unit* target = aurApp->GetTarget();
4891
4893}
@ TOTAL_VALUE
Definition Unit.h:128
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:169
bool HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition Unit.cpp:11939

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), TOTAL_VALUE, and UNIT_MOD_ATTACK_POWER.

◆ HandleAuraModAttackPowerOfArmor()

void AuraEffect::HandleAuraModAttackPowerOfArmor ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4963{
4965 return;
4966
4967 Unit* target = aurApp->GetTarget();
4968
4969 // Recalculate bonus
4970 if (target->IsPlayer())
4971 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
4972}
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition StatSystem.cpp:347

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateAttackPowerAndDamage().

Referenced by HandleAuraModAttackPowerOfStatPercent().

◆ HandleAuraModAttackPowerOfStatPercent()

void AuraEffect::HandleAuraModAttackPowerOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4958{
4959 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
4960}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4962

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4909{
4911 return;
4912
4913 Unit* target = aurApp->GetTarget();
4914
4915 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4916 if (apply)
4918 else
4919 {
4922 }
4923}
@ SPELL_AURA_MOD_ATTACK_POWER_PCT
Definition SpellAuraDefines.h:229
@ TOTAL_PCT
Definition Unit.h:135

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Unit::SetStatPctModifier(), SPELL_AURA_MOD_ATTACK_POWER_PCT, TOTAL_PCT, and UNIT_MOD_ATTACK_POWER.

◆ HandleAuraModBaseResistancePCT()

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4118{
4120 return;
4121
4122 Unit* target = aurApp->GetTarget();
4123 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4124 {
4125 if (GetMiscValue() & int32(1 << x))
4126 {
4127 if (apply)
4129 else
4130 {
4133 }
4134 }
4135 }
4136}
@ SPELL_SCHOOL_NORMAL
Definition SharedDefines.h:271
constexpr auto MAX_SPELL_SCHOOL
Definition SharedDefines.h:280
@ SPELL_AURA_MOD_BASE_RESISTANCE_PCT
Definition SpellAuraDefines.h:205
UnitMods
Definition Unit.h:148
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:178
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
Definition Unit.cpp:6315

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplierByMiscMask(), MAX_SPELL_SCHOOL, Unit::SetStatPctModifier(), SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELL_SCHOOL_NORMAL, and UNIT_MOD_RESISTANCE_START.

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4620{
4622 return;
4623
4624 Unit* target = aurApp->GetTarget();
4625
4626 if (!target->IsPlayer())
4627 return;
4628
4629 target->ToPlayer()->UpdateBlockPercentage();
4630}
void UpdateBlockPercentage()
Definition StatSystem.cpp:633

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateBlockPercentage().

◆ HandleAuraModCritPct()

void AuraEffect::HandleAuraModCritPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4711{
4713 return;
4714
4715 Unit* target = aurApp->GetTarget();
4716
4717 if (!target->IsPlayer())
4718 {
4719 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4720 return;
4721 }
4722
4724
4725 // included in Player::UpdateSpellCritChance calculation
4727}
void UpdateAllSpellCritChances()
Definition StatSystem.cpp:889
void UpdateAllWeaponDependentCritAuras()
Definition Player.cpp:7072
int32 m_baseSpellCritChance
Definition Unit.h:2085
void apply(T *val)
Definition ByteConverter.h:40

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Object::IsPlayer(), Unit::m_baseSpellCritChance, Object::ToPlayer(), Player::UpdateAllSpellCritChances(), and Player::UpdateAllWeaponDependentCritAuras().

◆ HandleAuraModDecreaseSpeed()

void AuraEffect::HandleAuraModDecreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3889{
3891 return;
3892
3893 Unit* target = aurApp->GetTarget();
3894
3895 target->UpdateSpeed(MOVE_WALK, true);
3896 target->UpdateSpeed(MOVE_RUN, true);
3897 target->UpdateSpeed(MOVE_SWIM, true);
3898 target->UpdateSpeed(MOVE_FLIGHT, true);
3899 target->UpdateSpeed(MOVE_RUN_BACK, true);
3900 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3901 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3902
3903 if (Player* targetPlayer = target->ToPlayer())
3904 {
3905 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3906 }
3907}
@ MOVE_FLIGHT
Definition UnitDefines.h:362
@ MOVE_SWIM
Definition UnitDefines.h:359
@ MOVE_FLIGHT_BACK
Definition UnitDefines.h:363
@ MOVE_SWIM_BACK
Definition UnitDefines.h:360
@ MOVE_RUN_BACK
Definition UnitDefines.h:358
@ MOVE_WALK
Definition UnitDefines.h:356
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition Unit.cpp:11114

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AuraApplication::GetTarget(), MOVE_FLIGHT, MOVE_FLIGHT_BACK, MOVE_RUN, MOVE_RUN_BACK, MOVE_SWIM, MOVE_SWIM_BACK, MOVE_WALK, sScriptMgr, Object::ToPlayer(), and Unit::UpdateSpeed().

◆ HandleAuraModDisarm()

void AuraEffect::HandleAuraModDisarm ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3071{
3072 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3073 return;
3074
3075 Unit* target = aurApp->GetTarget();
3076
3077 AuraType type = GetAuraType();
3078
3079 //Prevent handling aura twice
3080 if ((apply) ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
3081 return;
3082
3083 uint32 field, flag, slot;
3084 WeaponAttackType attType;
3085 switch (type)
3086 {
3088 field = UNIT_FIELD_FLAGS;
3089 flag = UNIT_FLAG_DISARMED;
3091 attType = BASE_ATTACK;
3092 break;
3094 field = UNIT_FIELD_FLAGS_2;
3097 attType = OFF_ATTACK;
3098 break;
3100 field = UNIT_FIELD_FLAGS_2;
3102 slot = EQUIPMENT_SLOT_RANGED;
3103 attType = RANGED_ATTACK;
3104 break;
3105 default:
3106 return;
3107 }
3108
3109 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
3110 if (!apply)
3111 target->RemoveFlag(field, flag);
3112
3113 // Handle damage modification, shapeshifted druids are not affected
3114 if (target->IsPlayer() && (!target->IsInFeralForm() || target->GetShapeshiftForm() == FORM_GHOSTWOLF))
3115 {
3116 Player* player = target->ToPlayer();
3117 if (Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
3118 {
3119 WeaponAttackType attackType = Player::GetAttackBySlot(slot);
3120
3121 player->ApplyItemDependentAuras(pItem, !apply);
3122 if (attackType < MAX_ATTACK)
3123 {
3124 player->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
3125 if (!apply) // apply case already handled on item dependent aura removal (if any)
3126 player->UpdateWeaponDependentAuras(attackType);
3127 }
3128 }
3129 }
3130
3131 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
3132 if (apply)
3133 target->SetFlag(field, flag);
3134
3135 if (target->IsCreature() && target->ToCreature()->GetCurrentEquipmentId())
3136 target->UpdateDamagePhysical(attType);
3137}
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:676
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:677
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:678
#define INVENTORY_SLOT_BAG_0
Definition Player.h:656
@ SPELL_AURA_MOD_DISARM_RANGED
Definition SpellAuraDefines.h:341
@ SPELL_AURA_MOD_DISARM
Definition SpellAuraDefines.h:130
@ SPELL_AURA_MOD_DISARM_OFFHAND
Definition SpellAuraDefines.h:317
@ UNIT_FLAG2_DISARM_OFFHAND
Definition UnitDefines.h:303
@ UNIT_FLAG2_DISARM_RANGED
Definition UnitDefines.h:305
@ FORM_GHOSTWOLF
Definition UnitDefines.h:88
@ UNIT_FLAG_DISARMED
Definition UnitDefines.h:278
WeaponAttackType
Definition Unit.h:214
@ MAX_ATTACK
Definition Unit.h:218
@ UNIT_FIELD_FLAGS_2
Definition UpdateFields.h:118
@ UNIT_FIELD_FLAGS
Definition UpdateFields.h:117
uint8 GetCurrentEquipmentId()
Definition Creature.h:198
void SetFlag(uint16 index, uint32 newFlag)
Definition Object.cpp:827
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:842
Creature * ToCreature()
Definition Object.h:206
void UpdateWeaponDependentAuras(WeaponAttackType attackType)
Definition Player.cpp:7078
void ApplyItemDependentAuras(Item *item, bool apply)
Definition Player.cpp:7085
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition Player.cpp:6897
Item * GetItemByPos(uint16 pos) const
Definition PlayerStorage.cpp:443
static WeaponAttackType GetAttackBySlot(uint8 slot)
Definition PlayerStorage.cpp:544
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:1958
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition StatSystem.cpp:60
bool IsInFeralForm() const
Definition Unit.h:1961

References Player::_ApplyWeaponDamage(), Player::ApplyItemDependentAuras(), AURA_EFFECT_HANDLE_REAL, BASE_ATTACK, EQUIPMENT_SLOT_MAINHAND, EQUIPMENT_SLOT_OFFHAND, EQUIPMENT_SLOT_RANGED, FORM_GHOSTWOLF, Player::GetAttackBySlot(), Unit::GetAuraEffectsByType(), GetAuraType(), Creature::GetCurrentEquipmentId(), Player::GetItemByPos(), Unit::GetShapeshiftForm(), AuraApplication::GetTarget(), Unit::HasAuraType(), INVENTORY_SLOT_BAG_0, Object::IsCreature(), Unit::IsInFeralForm(), Object::IsPlayer(), MAX_ATTACK, OFF_ATTACK, RANGED_ATTACK, Object::RemoveFlag(), Object::SetFlag(), SPELL_AURA_MOD_DISARM, SPELL_AURA_MOD_DISARM_OFFHAND, SPELL_AURA_MOD_DISARM_RANGED, Object::ToCreature(), Object::ToPlayer(), UNIT_FIELD_FLAGS, UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_OFFHAND, UNIT_FLAG2_DISARM_RANGED, UNIT_FLAG_DISARMED, Unit::UpdateDamagePhysical(), and Player::UpdateWeaponDependentAuras().

◆ HandleAuraModDispelImmunity()

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4060{
4061 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4062 return;
4063
4064 Unit* target = aurApp->GetTarget();
4066}
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const *effect, bool apply) const
Definition SpellInfo.cpp:2488

References SpellInfo::ApplyAllSpellImmunitiesTo(), AURA_EFFECT_HANDLE_REAL, SpellInfo::Effects, AuraApplication::GetTarget(), m_effIndex, and m_spellInfo.

◆ HandleAuraModDmgImmunity()

void AuraEffect::HandleAuraModDmgImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4047{
4048 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4049 return;
4050
4051 Unit* target = aurApp->GetTarget();
4052
4054
4055 if (apply)
4056 target->GetThreatMgr().EvaluateSuppressed();
4057}
void EvaluateSuppressed(bool canExpire=false)
Definition ThreatManager.cpp:370
ThreatManager & GetThreatMgr()
Definition Unit.h:951

References SpellInfo::ApplyAllSpellImmunitiesTo(), AURA_EFFECT_HANDLE_REAL, SpellInfo::Effects, ThreatManager::EvaluateSuppressed(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), m_effIndex, and m_spellInfo.

◆ HandleAuraModDodgePercent()

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4607{
4609 return;
4610
4611 Unit* target = aurApp->GetTarget();
4612
4613 if (!target->IsPlayer())
4614 return;
4615
4616 target->ToPlayer()->UpdateDodgePercentage();
4617}
void UpdateDodgePercentage()
Definition StatSystem.cpp:799

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateDodgePercentage().

◆ HandleAuraModEffectImmunity()

void AuraEffect::HandleAuraModEffectImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3949{
3950 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3951 return;
3952
3953 Unit* target = aurApp->GetTarget();
3954
3955 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
3956
3957 // when removing flag aura, handle flag drop
3958 Player* player = target->ToPlayer();
3959 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
3960 {
3961 if (player->InBattleground())
3962 {
3963 if (Battleground* bg = player->GetBattleground())
3964 bg->EventPlayerDroppedFlag(player);
3965 }
3966 else
3967 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3968 }
3969}
#define sOutdoorPvPMgr
Definition OutdoorPvPMgr.h:102
@ IMMUNITY_EFFECT
Definition SharedDefines.h:1398
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition SpellDefines.h:63
bool InBattleground() const
Definition Player.h:2287

References Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, Player::GetBattleground(), GetId(), GetMiscValue(), GetSpellInfo(), AuraApplication::GetTarget(), IMMUNITY_EFFECT, Player::InBattleground(), sOutdoorPvPMgr, and Object::ToPlayer().

◆ HandleAuraModExpertise()

void AuraEffect::HandleAuraModExpertise ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4397{
4399 return;
4400
4401 Unit* target = aurApp->GetTarget();
4402
4403 if (!target->IsPlayer())
4404 return;
4405
4408}
void UpdateExpertise(WeaponAttackType attType)
Definition StatSystem.cpp:895

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_ATTACK, AuraApplication::GetTarget(), Object::IsPlayer(), OFF_ATTACK, Object::ToPlayer(), and Player::UpdateExpertise().

◆ HandleAuraModFaction()

void AuraEffect::HandleAuraModFaction ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5726{
5727 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5728 return;
5729
5730 Unit* target = aurApp->GetTarget();
5731
5732 if (apply)
5733 {
5734 target->SetFaction(GetMiscValue());
5735 if (target->IsPlayer())
5737 }
5738 else
5739 {
5740 target->RestoreFaction();
5741 if (target->IsPlayer())
5743 }
5744}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition UnitDefines.h:260
void SetFaction(uint32 faction)
Definition Unit.cpp:7073
void RestoreFaction()
Definition Unit.cpp:14947

References AURA_EFFECT_HANDLE_REAL, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), Unit::RemoveUnitFlag(), Unit::RestoreFaction(), Unit::SetFaction(), Unit::SetUnitFlag(), and UNIT_FLAG_PLAYER_CONTROLLED.

◆ HandleAuraModFakeInebriation()

void AuraEffect::HandleAuraModFakeInebriation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5853{
5855 return;
5856
5857 Player* target = aurApp->GetTarget()->ToPlayer();
5858 if (!target)
5859 return;
5860
5863}
@ PLAYER_FAKE_INEBRIATION
Definition UpdateFields.h:325
void ApplyModInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:804
void UpdateInvisibilityDrunkDetect()
Definition Player.cpp:1012

References Object::ApplyModInt32Value(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), AuraApplication::GetTarget(), PLAYER_FAKE_INEBRIATION, Object::ToPlayer(), and Player::UpdateInvisibilityDrunkDetect().

◆ HandleAuraModIncreaseEnergy()

void AuraEffect::HandleAuraModIncreaseEnergy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4498{
4500 return;
4501
4502 Unit* target = aurApp->GetTarget();
4503
4505 // do not check power type, we can always modify the maximum
4506 // as the client will not see any difference
4507 // also, placing conditions that may change during the aura duration
4508 // inside effect handlers is not a good idea
4509 //if (int32(PowerType) != GetMiscValue())
4510 // return;
4511
4512 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4513
4514 target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4515}
std::uint16_t uint16
Definition Define.h:108
Powers
Definition SharedDefines.h:256
@ UNIT_MOD_POWER_START
Definition Unit.h:180
PowerType
Definition VehicleDefines.h:29

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), TOTAL_VALUE, and UNIT_MOD_POWER_START.

◆ HandleAuraModIncreaseEnergyPercent()

void AuraEffect::HandleAuraModIncreaseEnergyPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4518{
4520 return;
4521
4522 Unit* target = aurApp->GetTarget();
4523
4525 // do not check power type, we can always modify the maximum
4526 // as the client will not see any difference
4527 // also, placing conditions that may change during the aura duration
4528 // inside effect handlers is not a good idea
4529 //if (int32(PowerType) != GetMiscValue())
4530 // return;
4531
4532 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4533
4534 if (apply)
4535 {
4536 float amount = float(GetAmount());
4537 target->ApplyStatPctModifier(unitMod, TOTAL_PCT, amount);
4538 }
4539 else
4540 {
4542 target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
4543 }
4544}
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
Definition SpellAuraDefines.h:195
float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
Definition Unit.cpp:6355

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplierByMiscValue(), Unit::SetStatPctModifier(), SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, TOTAL_PCT, and UNIT_MOD_POWER_START.

◆ 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.

3834{
3836 return;
3837
3838 Unit* target = aurApp->GetTarget();
3840 target->UpdateSpeed(MOVE_FLIGHT, true);
3841
3844 {
3845 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3846 if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasIncreaseMountedFlightSpeedAura() && !target->HasFlyAura())))
3847 {
3848 target->SetCanFly(apply);
3849
3850 if (!apply && target->IsCreature() && !target->IsLevitating())
3851 target->GetMotionMaster()->MoveFall();
3852 }
3853
3855 if (mode & AURA_EFFECT_HANDLE_REAL)
3856 {
3857 //Players on flying mounts must be immune to polymorph
3858 if (target->IsPlayer())
3860
3861 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3862 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID())
3864 }
3865 }
3866
3867 if (Player* targetPlayer = target->ToPlayer())
3868 {
3869 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3870 }
3871}
@ MECHANIC_POLYMORPH
Definition SharedDefines.h:1330
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
Definition SpellAuraDefines.h:270
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK
Definition SpellAuraDefines.h:50
bool HasFlyAura() const
Definition Unit.h:1804
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition Unit.cpp:5946
uint32 GetMountID() const
Definition Unit.h:1888

References Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), GetId(), Unit::GetMotionMaster(), Unit::GetMountID(), AuraApplication::GetTarget(), Unit::HasAuraEffect(), Unit::HasFlyAura(), Unit::HasIncreaseMountedFlightSpeedAura(), IMMUNITY_MECHANIC, Object::IsCreature(), Unit::IsLevitating(), Object::IsPlayer(), MECHANIC_POLYMORPH, MOVE_FLIGHT, MotionMaster::MoveFall(), Unit::SetCanFly(), Unit::SetUInt32Value(), SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, sScriptMgr, Object::ToPlayer(), UNIT_FIELD_MOUNTDISPLAYID, and Unit::UpdateSpeed().

◆ HandleAuraModIncreaseHealth()

void AuraEffect::HandleAuraModIncreaseHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4453{
4455 return;
4456
4457 Unit* target = aurApp->GetTarget();
4458
4459 if (apply)
4460 {
4462 target->ModifyHealth(GetAmount());
4463 }
4464 else
4465 {
4466 if (int32(target->GetHealth()) > GetAmount())
4467 target->ModifyHealth(-GetAmount());
4468 else
4469 target->SetHealth(1);
4471 }
4472}
int32 ModifyHealth(int32 val)
Definition Unit.cpp:10964
void SetHealth(uint32 val)
Definition Unit.cpp:12339
uint32 GetHealth() const
Definition Unit.h:1108

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), Unit::GetHealth(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), Unit::ModifyHealth(), Unit::SetHealth(), TOTAL_VALUE, and UNIT_MOD_HEALTH.

◆ HandleAuraModIncreaseHealthPercent()

void AuraEffect::HandleAuraModIncreaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4547{
4549 return;
4550
4551 Unit* target = aurApp->GetTarget();
4552
4553 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4554 float percent = target->GetHealthPct();
4555
4556 if (apply)
4558 else
4559 {
4562 }
4563
4564 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4565 if (target->IsAlive())
4566 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4567 target->SetHealth(healthAmount);
4568}
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
Definition SpellAuraDefines.h:196
T CalculatePct(T base, U pct)
Definition Util.h:52
float GetHealthPct() const
Definition Unit.h:1110
uint32 GetMaxHealth() const
Definition Unit.h:1109

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CalculatePct(), GetAmount(), Unit::GetHealthPct(), Unit::GetMaxHealth(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Unit::IsAlive(), Unit::SetHealth(), Unit::SetStatPctModifier(), SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT, TOTAL_PCT, and UNIT_MOD_HEALTH.

◆ HandleAuraModIncreaseMaxHealth()

void AuraEffect::HandleAuraModIncreaseMaxHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4475{
4477 return;
4478
4479 Unit* target = aurApp->GetTarget();
4480
4481 uint32 oldhealth = target->GetHealth();
4482 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4483
4485
4486 // refresh percentage
4487 if (oldhealth > 0)
4488 {
4489 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4490 if (newhealth == 0)
4491 newhealth = 1;
4492
4493 target->SetHealth(newhealth);
4494 }
4495}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), Unit::GetHealth(), Unit::GetMaxHealth(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), Unit::SetHealth(), TOTAL_VALUE, and UNIT_MOD_HEALTH.

◆ HandleAuraModIncreaseMountedSpeed()

void AuraEffect::HandleAuraModIncreaseMountedSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3829{
3830 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3831}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3813

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3814{
3816 return;
3817
3818 Unit* target = aurApp->GetTarget();
3819
3820 target->UpdateSpeed(MOVE_RUN, true);
3821
3822 if (Player* targetPlayer = target->ToPlayer())
3823 {
3824 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3825 }
3826}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AuraApplication::GetTarget(), MOVE_RUN, sScriptMgr, Object::ToPlayer(), and Unit::UpdateSpeed().

Referenced by HandleAuraModIncreaseMountedSpeed().

◆ HandleAuraModIncreaseSwimSpeed()

void AuraEffect::HandleAuraModIncreaseSwimSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3874{
3876 return;
3877
3878 Unit* target = aurApp->GetTarget();
3879
3880 target->UpdateSpeed(MOVE_SWIM, true);
3881
3882 if (Player* targetPlayer = target->ToPlayer())
3883 {
3884 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3885 }
3886}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AuraApplication::GetTarget(), MOVE_SWIM, sScriptMgr, Object::ToPlayer(), and Unit::UpdateSpeed().

◆ HandleAuraModPacify()

void AuraEffect::HandleAuraModPacify ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3169{
3171 return;
3172
3173 Unit* target = aurApp->GetTarget();
3174
3175 if (apply)
3176 {
3178 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
3179 }
3180 else
3181 {
3182 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3183 if (target->HasPacifyAura() || target->HasPacifySilenceAura())
3184 return;
3186 }
3187}
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:274
bool HasPacifySilenceAura() const
Definition Unit.h:1824
bool HasPacifyAura() const
Definition Unit.h:1828

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Unit::HasPacifyAura(), Unit::HasPacifySilenceAura(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), and UNIT_FLAG_PACIFIED.

Referenced by HandleAuraModPacifyAndSilence().

◆ HandleAuraModPacifyAndSilence()

void AuraEffect::HandleAuraModPacifyAndSilence ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3190{
3192 return;
3193
3194 Unit* target = aurApp->GetTarget();
3195
3196 if (!(apply))
3197 {
3198 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3199 if (target->HasPacifySilenceAura())
3200 return;
3201 }
3202 HandleAuraModPacify(aurApp, mode, apply);
3203 HandleAuraModSilence(aurApp, mode, apply);
3204}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3139
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3168

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), HandleAuraModPacify(), HandleAuraModSilence(), and Unit::HasPacifySilenceAura().

◆ HandleAuraModParryPercent()

void AuraEffect::HandleAuraModParryPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4591{
4593 return;
4594
4595 Unit* target = aurApp->GetTarget();
4596
4597 if (!target->IsPlayer())
4598 return;
4599
4600 if (!target->ToPlayer()->CanParry())
4601 target->ToPlayer()->SetCanParry(true);
4602 else
4603 target->ToPlayer()->UpdateParryPercentage();
4604}
void UpdateParryPercentage()
Definition StatSystem.cpp:753
bool CanParry() const
Definition Player.h:2202
void SetCanParry(bool value)
Definition Player.cpp:13156

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, Player::CanParry(), AuraApplication::GetTarget(), Object::IsPlayer(), Player::SetCanParry(), Object::ToPlayer(), and Player::UpdateParryPercentage().

◆ HandleAuraModPetTalentsPoints()

void AuraEffect::HandleAuraModPetTalentsPoints ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3326{
3328 return;
3329
3330 Unit* target = aurApp->GetTarget();
3331
3332 if (!target->IsPlayer())
3333 return;
3334
3335 // Recalculate pet talent points
3336 if (Pet* pet = target->ToPlayer()->GetPet())
3337 pet->InitTalentForLevel();
3338}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, Player::GetPet(), AuraApplication::GetTarget(), Object::IsPlayer(), and Object::ToPlayer().

◆ HandleAuraModRangedAttackPower()

void AuraEffect::HandleAuraModRangedAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4896{
4898 return;
4899
4900 Unit* target = aurApp->GetTarget();
4901
4902 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4903 return;
4904
4906}
#define CLASSMASK_WAND_USERS
Definition SharedDefines.h:151
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:170
uint32 getClassMask() const
Definition Unit.h:845

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CLASSMASK_WAND_USERS, GetAmount(), Unit::getClassMask(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), TOTAL_VALUE, and UNIT_MOD_ATTACK_POWER_RANGED.

◆ HandleAuraModRangedAttackPowerOfStatPercent()

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

◆ HandleAuraModRangedAttackPowerPercent()

void AuraEffect::HandleAuraModRangedAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4926{
4928 return;
4929
4930 Unit* target = aurApp->GetTarget();
4931
4932 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4933 return;
4934
4935 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
4936 if (apply)
4938 else
4939 {
4942 }
4943}
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
Definition SpellAuraDefines.h:230

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CLASSMASK_WAND_USERS, GetAmount(), Unit::getClassMask(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Unit::SetStatPctModifier(), SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT, TOTAL_PCT, and UNIT_MOD_ATTACK_POWER_RANGED.

◆ HandleAuraModRangedHaste()

void AuraEffect::HandleAuraModRangedHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4824{
4826 return;
4827
4828 Unit* target = aurApp->GetTarget();
4829
4830 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4831}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition Unit.cpp:13446

References Unit::ApplyAttackTimePercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), and RANGED_ATTACK.

◆ HandleAuraModRegenInterrupt()

void AuraEffect::HandleAuraModRegenInterrupt ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4633{
4634 HandleModManaRegen(aurApp, mode, apply);
4635}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4438

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4100{
4102 return;
4103
4104 Unit* target = aurApp->GetTarget();
4105
4106 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4107 {
4108 if (GetMiscValue() & int32(1 << x))
4109 {
4111 if (target->IsPlayer() || target->IsPet())
4113 }
4114 }
4115}
std::int8_t int8
Definition Define.h:105
SpellSchools
Definition SharedDefines.h:270
bool IsPet() const
Definition Unit.h:797
void UpdateResistanceBuffModsMod(SpellSchools school)
Definition Unit.cpp:6425

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), Unit::IsPet(), Object::IsPlayer(), MAX_SPELL_SCHOOL, SPELL_SCHOOL_NORMAL, TOTAL_VALUE, UNIT_MOD_RESISTANCE_START, and Unit::UpdateResistanceBuffModsMod().

◆ HandleAuraModResistanceExclusive()

void AuraEffect::HandleAuraModResistanceExclusive ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4077{
4079 return;
4080
4081 Unit* target = aurApp->GetTarget();
4082
4083 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4084 {
4085 if (GetMiscValue() & int32(1 << x))
4086 {
4088 if (amount < GetAmount())
4089 {
4090 float value = float(GetAmount() - amount);
4092 if (target->IsPlayer() || target->IsPet())
4094 }
4095 }
4096 }
4097}
@ SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
Definition SpellAuraDefines.h:206
@ BASE_VALUE
Definition Unit.h:127
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect *except=nullptr) const
Definition Unit.cpp:6325

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_VALUE, GetAmount(), Unit::GetMaxPositiveAuraModifierByMiscMask(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), Unit::IsPet(), Object::IsPlayer(), MAX_SPELL_SCHOOL, SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE, SPELL_SCHOOL_NORMAL, UNIT_MOD_RESISTANCE_START, and Unit::UpdateResistanceBuffModsMod().

◆ HandleAuraModResistenceOfStatPercent()

void AuraEffect::HandleAuraModResistenceOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4375{
4377 return;
4378
4379 Unit* target = aurApp->GetTarget();
4380
4381 if (!target->IsPlayer())
4382 return;
4383
4385 {
4386 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4387 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4388 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4389 return;
4390 }
4391
4392 // Recalculate Armor
4393 target->UpdateArmor();
4394}
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
virtual void UpdateArmor()=0

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), LOG_ERROR, SPELL_SCHOOL_MASK_NORMAL, and Unit::UpdateArmor().

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3642{
3643 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3644 return;
3645
3646 Unit* target = aurApp->GetTarget();
3647
3648 target->SetControlled(apply, UNIT_STATE_ROOT);
3649}
@ UNIT_STATE_ROOT
Definition UnitDefines.h:183
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:14292

References AURA_EFFECT_HANDLE_REAL, AuraApplication::GetTarget(), Unit::SetControlled(), and UNIT_STATE_ROOT.

◆ HandleAuraModScale()

void AuraEffect::HandleAuraModScale ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2894{
2896 return;
2897
2898 aurApp->GetTarget()->RecalculateObjectScale();
2899}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), and Unit::RecalculateObjectScale().

◆ HandleAuraModSchoolImmunity()

void AuraEffect::HandleAuraModSchoolImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
Todo:
: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
3985{
3986 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3987 return;
3988
3989 Unit* target = aurApp->GetTarget();
3990
3991 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
3992
3993 if (apply)
3994 target->GetThreatMgr().EvaluateSuppressed();
3995
3996 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3997 {
3998 if (apply)
4000 else
4001 {
4002 bool banishFound = false;
4003 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
4004 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
4005 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4006 {
4007 banishFound = true;
4008 break;
4009 }
4010 if (!banishFound)
4012 }
4013 }
4014
4015 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
4017
4018 // remove all flag auras (they are positive, but they must be removed when you are immune)
4022
4024 if ((apply)
4026 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
4027 {
4028 uint32 school_mask = GetMiscValue();
4029 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
4030 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
4031 {
4032 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4033 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
4034 && GetSpellInfo()->CanDispelAura(spell)
4035 && !iter->second->IsPositive() //Don't remove positive spells
4036 && spell->Id != GetId()) //Don't remove self
4037 {
4038 target->RemoveAura(iter);
4039 }
4040 else
4041 ++iter;
4042 }
4043 }
4044}
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition SharedDefines.h:465
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition SharedDefines.h:422
@ MECHANIC_BANISH
Definition SharedDefines.h:1331
@ IMMUNITY_SCHOOL
Definition SharedDefines.h:1400
@ UNIT_STATE_ISOLATED
Definition UnitDefines.h:186
bool CanDispelAura(SpellInfo const *auraSpellInfo) const
Definition SpellInfo.cpp:1371
bool IsPositive() const
Definition SpellInfo.cpp:1269
void ClearUnitState(uint32 f)
Definition Unit.h:737
void AddUnitState(uint32 f)
Definition Unit.h:735
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition Unit.cpp:5450

References Unit::AddUnitState(), Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, SpellInfo::CanDispelAura(), Unit::ClearUnitState(), ThreatManager::EvaluateSuppressed(), Unit::GetAppliedAuras(), Unit::GetAuraEffectsByType(), GetAuraType(), GetId(), GetMiscValue(), SpellInfo::GetSchoolMask(), GetSpellInfo(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), SpellInfo::HasAttribute(), SpellInfo::Id, IMMUNITY_SCHOOL, SpellInfo::IsPositive(), MECHANIC_BANISH, Unit::RemoveAura(), Unit::RemoveAurasWithInterruptFlags(), SPELL_ATTR1_IMMUNITY_PURGES_EFFECT, SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE, SPELL_SCHOOL_MASK_NORMAL, and UNIT_STATE_ISOLATED.

◆ HandleAuraModShapeshift()

void AuraEffect::HandleAuraModShapeshift ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1985{
1987 return;
1988
1989 Unit* target = aurApp->GetTarget();
1990
1991 uint32 modelid = 0;
1994
1995 switch (form)
1996 {
1997 case FORM_CAT: // 0x01
1998 case FORM_GHOUL: // 0x07
2000 break;
2001
2002 case FORM_BEAR: // 0x05
2003 case FORM_DIREBEAR: // 0x08
2004
2005 case FORM_BATTLESTANCE: // 0x11
2006 case FORM_DEFENSIVESTANCE: // 0x12
2007 case FORM_BERSERKERSTANCE: // 0x13
2009 break;
2010
2011 case FORM_TREE: // 0x02
2012 case FORM_TRAVEL: // 0x03
2013 case FORM_AQUA: // 0x04
2014 case FORM_AMBIENT: // 0x06
2015
2016 case FORM_STEVES_GHOUL: // 0x09
2017 case FORM_THARONJA_SKELETON: // 0x0A
2018 case FORM_TEST_OF_STRENGTH: // 0x0B
2019 case FORM_BLB_PLAYER: // 0x0C
2020 case FORM_SHADOW_DANCE: // 0x0D
2021 case FORM_CREATUREBEAR: // 0x0E
2022 case FORM_CREATURECAT: // 0x0F
2023 case FORM_GHOSTWOLF: // 0x10
2024
2025 case FORM_TEST: // 0x14
2026 case FORM_ZOMBIE: // 0x15
2027 case FORM_METAMORPHOSIS: // 0x16
2028 case FORM_UNDEAD: // 0x19
2029 case FORM_MASTER_ANGLER: // 0x1A
2030 case FORM_FLIGHT_EPIC: // 0x1B
2031 case FORM_SHADOW: // 0x1C
2032 case FORM_FLIGHT: // 0x1D
2033 case FORM_STEALTH: // 0x1E
2034 case FORM_MOONKIN: // 0x1F
2035 case FORM_SPIRITOFREDEMPTION: // 0x20
2036 break;
2037 default:
2038 LOG_ERROR("spells.aura.effect", "Auras: Unknown Shapeshift Type: {}", GetMiscValue());
2039 }
2040
2041 modelid = target->GetModelForForm(form, GetId());
2042
2043 if (apply)
2044 {
2045 // remove polymorph before changing display id to keep new display id
2046 switch (form)
2047 {
2048 case FORM_CAT:
2049 case FORM_TREE:
2050 case FORM_TRAVEL:
2051 case FORM_AQUA:
2052 case FORM_BEAR:
2053 case FORM_DIREBEAR:
2054 case FORM_FLIGHT_EPIC:
2055 case FORM_FLIGHT:
2056 case FORM_MOONKIN:
2057 {
2058 if (Player* player = target->ToPlayer())
2059 {
2060 player->SetCanTeleport(true);
2061 }
2062 // remove movement affects
2063 target->RemoveAurasByShapeShift();
2064
2065 // and polymorphic affects
2066 if (target->IsPolymorphed())
2067 target->RemoveAurasDueToSpell(target->getTransForm());
2068 break;
2069 }
2070 default:
2071 break;
2072 }
2073
2074 // remove other shapeshift before applying a new one
2075 // xinef: rogue shouldnt be wrapped by this check (shadow dance vs stealth)
2076 if (GetSpellInfo()->SpellFamilyName != SPELLFAMILY_ROGUE)
2078
2079 // stop handling the effect if it was removed by linked event
2080 if (aurApp->GetRemoveMode())
2081 return;
2082
2083 if (PowerType != POWER_MANA)
2084 {
2085 uint32 oldPower = target->GetPower(PowerType);
2086 // reset power to default values only at power change
2087 if (target->getPowerType() != PowerType)
2088 target->setPowerType(PowerType);
2089
2090 switch (form)
2091 {
2092 case FORM_CAT:
2093 case FORM_BEAR:
2094 case FORM_DIREBEAR:
2095 {
2096 // get furor proc chance
2097 uint32 FurorChance = 0;
2098 if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0))
2099 FurorChance = std::max(dummy->GetAmount(), 0);
2100
2101 switch (GetMiscValue())
2102 {
2103 case FORM_CAT:
2104 {
2105 int32 basePoints = int32(std::min(oldPower, FurorChance));
2106 target->SetPower(POWER_ENERGY, 0);
2107 target->CastCustomSpell(target, 17099, &basePoints, nullptr, nullptr, true, nullptr, this);
2108 break;
2109 }
2110 case FORM_BEAR:
2111 case FORM_DIREBEAR:
2112 if (urand(0, 99) < FurorChance)
2113 target->CastSpell(target, 17057, true);
2114 break;
2115 default:
2116 {
2117 uint32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance);
2118 target->SetPower(POWER_ENERGY, newEnergy);
2119 break;
2120 }
2121 }
2122 break;
2123 }
2124 default:
2125 break;
2126 }
2127 }
2128 // stop handling the effect if it was removed by linked event
2129 if (aurApp->GetRemoveMode())
2130 return;
2131
2132 target->SetShapeshiftForm(form);
2133 // xinef: allow shapeshift to override model id if forced transform aura is not present!
2134 if (modelid > 0)
2135 {
2136 bool allow = true;
2137 if (target->getTransForm() && !(target->GetMapId() == MAP_THE_ESCAPE_FROM_DURNHOLDE))
2138 if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm()))
2139 if (transformSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !transformSpellInfo->IsPositive())
2140 allow = false;
2141
2142 if (allow)
2143 target->SetDisplayId(modelid);
2144 }
2145 }
2146 else
2147 {
2148 // reset model id if no other auras present
2149 // may happen when aura is applied on linked event on aura removal
2150 if (!target->HasShapeshiftAura())
2151 {
2154 {
2155 target->setPowerType(POWER_MANA);
2156 // Remove movement impairing effects also when shifting out
2157 target->RemoveAurasByShapeShift();
2158 }
2159 }
2160
2161 if (modelid > 0)
2162 target->RestoreDisplayId();
2163
2164 switch (form)
2165 {
2166 // Nordrassil Harness - bonus
2167 case FORM_BEAR:
2168 case FORM_DIREBEAR:
2169 case FORM_CAT:
2170 if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
2171 target->CastSpell(target, 37316, true, nullptr, dummy);
2172 break;
2173 // Nordrassil Regalia - bonus
2174 case FORM_MOONKIN:
2175 if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
2176 target->CastSpell(target, 37325, true, nullptr, dummy);
2177 break;
2178 case FORM_BATTLESTANCE:
2181 {
2182 uint32 Rage_val = 0;
2183 // Defensive Tactics
2184 if (form == FORM_DEFENSIVESTANCE)
2185 {
2186 if (AuraEffect const* aurEff = target->IsScriptOverriden(m_spellInfo, 831))
2187 Rage_val += aurEff->GetAmount() * 10;
2188 }
2189 // Stance mastery + Tactical mastery (both passive, and last have aura only in defense stance, but need apply at any stance switch)
2190 if (target->IsPlayer())
2191 {
2192 // Stance mastery - trainer spell
2193 PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap();
2194 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
2195 {
2196 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2197 continue;
2198
2199 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2200 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2201 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2202 }
2203
2204 // Tactical Mastery - talent
2205 PlayerTalentMap const& tp_list = target->ToPlayer()->GetTalentMap();
2206 for (PlayerTalentMap::const_iterator itr = tp_list.begin(); itr != tp_list.end(); ++itr)
2207 {
2208 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2209 continue;
2210
2211 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2212 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2213 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2214 }
2215 }
2216 if (target->GetPower(POWER_RAGE) > Rage_val)
2217 target->SetPower(POWER_RAGE, Rage_val);
2218 break;
2219 }
2220 default:
2221 break;
2222 }
2223 }
2224
2225 // adding/removing linked auras
2226 // add/remove the shapeshift aura's boosts
2227 HandleShapeshiftBoosts(target, apply);
2228
2229 if (target->IsPlayer())
2230 target->ToPlayer()->InitDataForForm();
2231
2233 {
2234 // Dash
2236 aurEff->RecalculateAmount();
2237
2238 // Disarm handling
2239 // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
2240 // and also HandleAuraModDisarm is not triggered
2241 if (!target->CanUseAttackType(BASE_ATTACK))
2242 {
2244 {
2245 target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), nullptr, apply);
2246 }
2247 }
2248
2249 // Update crit chance for feral forms
2250 switch (form)
2251 {
2252 case FORM_CAT:
2253 case FORM_BEAR:
2254 case FORM_DIREBEAR:
2255 case FORM_GHOSTWOLF:
2257 break;
2258 default:
2259 break;
2260 }
2261 }
2262
2263 // stop handling the effect if it was removed by linked event
2264 if (apply && aurApp->GetRemoveMode())
2265 return;
2266
2267 if (target->IsPlayer())
2268 {
2269 SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form);
2270 // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
2271 for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
2272 {
2273 if (!shapeInfo->stanceSpell[i])
2274 continue;
2275 if (apply)
2276 target->ToPlayer()->_addSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2277 else
2278 target->ToPlayer()->removeSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2279 }
2280 }
2281}
@ MAP_THE_ESCAPE_FROM_DURNHOLDE
Definition AreaDefines.h:238
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormEntryfmt)
#define MAX_SHAPESHIFT_SPELLS
Definition DBCStructure.h:1814
std::unordered_map< uint32, PlayerTalent * > PlayerTalentMap
Definition Player.h:193
std::unordered_map< uint32, PlayerSpell * > PlayerSpellMap
Definition Player.h:194
#define SPEC_MASK_ALL
Definition Player.h:178
@ PLAYERSPELL_REMOVED
Definition Player.h:123
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ POWER_RAGE
Definition SharedDefines.h:258
@ POWER_ENERGY
Definition SharedDefines.h:260
@ POWER_MANA
Definition SharedDefines.h:257
@ CLASS_DRUID
Definition SharedDefines.h:136
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3788
@ SPELL_ATTR0_NO_IMMUNITIES
Definition SharedDefines.h:399
@ SPELL_AURA_MOD_SHAPESHIFT
Definition SpellAuraDefines.h:99
@ SPELL_AURA_MOD_INCREASE_SPEED
Definition SpellAuraDefines.h:94
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
Definition SpellAuraDefines.h:51
ShapeshiftForm
Definition UnitDefines.h:71
@ FORM_DIREBEAR
Definition UnitDefines.h:80
@ FORM_UNDEAD
Definition UnitDefines.h:95
@ FORM_TEST
Definition UnitDefines.h:92
@ FORM_TRAVEL
Definition UnitDefines.h:75
@ FORM_CREATUREBEAR
Definition UnitDefines.h:86
@ FORM_SHADOW
Definition UnitDefines.h:98
@ FORM_SHADOW_DANCE
Definition UnitDefines.h:85
@ FORM_SPIRITOFREDEMPTION
Definition UnitDefines.h:102
@ FORM_BERSERKERSTANCE
Definition UnitDefines.h:91
@ FORM_MASTER_ANGLER
Definition UnitDefines.h:96
@ FORM_DEFENSIVESTANCE
Definition UnitDefines.h:90
@ FORM_THARONJA_SKELETON
Definition UnitDefines.h:82
@ FORM_FLIGHT_EPIC
Definition UnitDefines.h:97
@ FORM_STEVES_GHOUL
Definition UnitDefines.h:81
@ FORM_MOONKIN
Definition UnitDefines.h:101
@ FORM_NONE
Definition UnitDefines.h:72
@ FORM_CREATURECAT
Definition UnitDefines.h:87
@ FORM_CAT
Definition UnitDefines.h:73
@ FORM_FLIGHT
Definition UnitDefines.h:99
@ FORM_ZOMBIE
Definition UnitDefines.h:93
@ FORM_AMBIENT
Definition UnitDefines.h:78
@ FORM_AQUA
Definition UnitDefines.h:76
@ FORM_STEALTH
Definition UnitDefines.h:100
@ FORM_BATTLESTANCE
Definition UnitDefines.h:89
@ FORM_BLB_PLAYER
Definition UnitDefines.h:84
@ FORM_METAMORPHOSIS
Definition UnitDefines.h:94
@ FORM_GHOUL
Definition UnitDefines.h:79
@ FORM_TREE
Definition UnitDefines.h:74
@ FORM_TEST_OF_STRENGTH
Definition UnitDefines.h:83
@ FORM_BEAR
Definition UnitDefines.h:77
void HandleShapeshiftBoosts(Unit *target, bool apply) const
Definition SpellAuraEffects.cpp:1343
static ObjectGuid const Empty
Definition ObjectGuid.h:120
bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill=false)
Definition Player.cpp:3104
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary)
Definition Player.cpp:3323
const PlayerTalentMap & GetTalentMap() const
Definition Player.h:2645
PlayerSpellMap const & GetSpellMap() const
Definition Player.h:1787
void InitDataForForm(bool reapplyMods=false)
Definition Player.cpp:10509
uint8 GetActiveSpec() const
Definition Player.h:1755
void UpdateAllCritPercentages()
Definition StatSystem.cpp:698
uint32 SpellIconID
Definition SpellInfo.h:404
void RemoveAurasByShapeShift()
Definition Unit.cpp:5539
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
Definition Unit.cpp:11582
bool IsPolymorphed() const
Definition Unit.cpp:13128
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition Unit.cpp:12427
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5772
virtual bool IsClass(Classes unitClass, ClassContext context=CLASS_CONTEXT_NONE) const
Definition Unit.h:844
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
Definition Unit.cpp:6110
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId)
Definition Unit.cpp:15438
bool CanUseAttackType(WeaponAttackType attacktype) const
Definition Unit.h:992
bool HasShapeshiftAura() const
Definition Unit.h:1826
void RestoreDisplayId()
Definition Unit.cpp:13162
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
Definition Unit.h:1437
uint32 getTransForm() const
Definition Unit.h:1969
Powers getPowerType() const
Definition Unit.h:1131
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition Unit.cpp:5379
uint32 GetPower(Powers power) const
Definition Unit.h:1135
void setPowerType(Powers power)
Definition Unit.cpp:6996
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:17295
uint32 GetMapId() const
Definition Position.h:281
Definition DBCStructure.h:1817
uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]
Definition DBCStructure.h:1829

References Player::_addSpell(), Player::_ApplyWeaponDamage(), AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK, BASE_ATTACK, Unit::CalculateSpellDamage(), Unit::CanUseAttackType(), Unit::CastCustomSpell(), Unit::CastSpell(), CLASS_CONTEXT_ABILITY, CLASS_DRUID, ObjectGuid::Empty, EQUIPMENT_SLOT_MAINHAND, FORM_AMBIENT, FORM_AQUA, FORM_BATTLESTANCE, FORM_BEAR, FORM_BERSERKERSTANCE, FORM_BLB_PLAYER, FORM_CAT, FORM_CREATUREBEAR, FORM_CREATURECAT, FORM_DEFENSIVESTANCE, FORM_DIREBEAR, FORM_FLIGHT, FORM_FLIGHT_EPIC, FORM_GHOSTWOLF, FORM_GHOUL, FORM_MASTER_ANGLER, FORM_METAMORPHOSIS, FORM_MOONKIN, FORM_NONE, FORM_SHADOW, FORM_SHADOW_DANCE, FORM_SPIRITOFREDEMPTION, FORM_STEALTH, FORM_STEVES_GHOUL, FORM_TEST, FORM_TEST_OF_STRENGTH, FORM_THARONJA_SKELETON, FORM_TRAVEL, FORM_TREE, FORM_UNDEAD, FORM_ZOMBIE, Player::GetActiveSpec(), Unit::GetAuraEffect(), GetBase(), Unit::GetDummyAuraEffect(), GetId(), Player::GetItemByPos(), WorldLocation::GetMapId(), GetMiscValue(), Unit::GetModelForForm(), Unit::GetPower(), Unit::getPowerType(), AuraApplication::GetRemoveMode(), GetSpellInfo(), Player::GetSpellMap(), Player::GetTalentMap(), AuraApplication::GetTarget(), Unit::getTransForm(), HandleShapeshiftBoosts(), Unit::HasShapeshiftAura(), Player::InitDataForForm(), INVENTORY_SLOT_BAG_0, Unit::IsClass(), Object::IsPlayer(), Unit::IsPolymorphed(), Unit::IsScriptOverriden(), LOG_ERROR, m_spellInfo, MAP_THE_ESCAPE_FROM_DURNHOLDE, MAX_SHAPESHIFT_SPELLS, PLAYERSPELL_REMOVED, POWER_ENERGY, POWER_MANA, POWER_RAGE, Unit::RemoveAurasByShapeShift(), Unit::RemoveAurasByType(), Unit::RemoveAurasDueToSpell(), Player::removeSpell(), Unit::RestoreDisplayId(), Unit::SetDisplayId(), Unit::SetPower(), Unit::setPowerType(), Unit::SetShapeshiftForm(), SPEC_MASK_ALL, SPELL_ATTR0_NO_IMMUNITIES, SPELL_AURA_MOD_INCREASE_SPEED, SPELL_AURA_MOD_SHAPESHIFT, SPELLFAMILY_DRUID, SPELLFAMILY_ROGUE, SPELLFAMILY_WARRIOR, SpellInfo::SpellFamilyName, SpellInfo::SpellIconID, sSpellMgr, sSpellShapeshiftFormStore, SpellShapeshiftFormEntry::stanceSpell, Object::ToPlayer(), Player::UpdateAllCritPercentages(), and urand().

◆ HandleAuraModSilence()

void AuraEffect::HandleAuraModSilence ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3140{
3141 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3142 return;
3143
3144 Unit* target = aurApp->GetTarget();
3145
3146 if (apply)
3147 {
3149
3150 // call functions which may have additional effects after chainging state of unit
3151 // Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
3152 for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
3153 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
3154 if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
3155 // Stop spells on prepare or casting state
3156 target->InterruptSpell(CurrentSpellTypes(i), false);
3157 }
3158 else
3159 {
3160 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3161 if (target->HasSilenceAura() || target->HasPacifySilenceAura())
3162 return;
3163
3165 }
3166}
@ SPELL_PREVENTION_TYPE_SILENCE
Definition SharedDefines.h:1558
@ UNIT_FLAG_SILENCED
Definition UnitDefines.h:270
#define CURRENT_MAX_SPELL
Definition Unit.h:562
CurrentSpellTypes
Definition Unit.h:554
@ CURRENT_MELEE_SPELL
Definition Unit.h:555
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4244
bool HasSilenceAura() const
Definition Unit.h:1825

References AURA_EFFECT_HANDLE_REAL, CURRENT_MAX_SPELL, CURRENT_MELEE_SPELL, Unit::GetCurrentSpell(), AuraApplication::GetTarget(), Unit::HasPacifySilenceAura(), Unit::HasSilenceAura(), Unit::InterruptSpell(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), SPELL_PREVENTION_TYPE_SILENCE, and UNIT_FLAG_SILENCED.

Referenced by HandleAuraModPacifyAndSilence().

◆ HandleAuraModSkill()

void AuraEffect::HandleAuraModSkill ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3341{
3343 return;
3344 Unit* target = aurApp->GetTarget();
3345
3346 if (!target->IsPlayer())
3347 return;
3348
3349 uint32 prot = GetMiscValue();
3350 int32 points = GetAmount();
3351
3352 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
3353 if (prot == SKILL_DEFENSE)
3354 target->ToPlayer()->UpdateDefenseBonusesMod();
3355}
@ SKILL_DEFENSE
Definition SharedDefines.h:3114
@ SPELL_AURA_MOD_SKILL_TALENT
Definition SpellAuraDefines.h:161
@ AURA_EFFECT_HANDLE_SKILL
Definition SpellAuraDefines.h:47
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition Player.cpp:5295
void UpdateDefenseBonusesMod()
Definition StatSystem.cpp:626

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_SKILL, GetAmount(), GetAuraType(), GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), Player::ModifySkillBonus(), SKILL_DEFENSE, SPELL_AURA_MOD_SKILL_TALENT, Object::ToPlayer(), and Player::UpdateDefenseBonusesMod().

◆ HandleAuraModStalked()

void AuraEffect::HandleAuraModStalked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3283{
3285 return;
3286
3287 Unit* target = aurApp->GetTarget();
3288
3289 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
3290 if (apply)
3292 else
3293 {
3294 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3295 if (!target->HasAuraType(GetAuraType()))
3297 }
3298
3299 // call functions which may have additional effects after chainging state of unit
3300 target->UpdateObjectVisibility(target->IsPlayer());
3301}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition SharedDefines.h:3355
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:126
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:125
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition Unit.cpp:15370

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Object::IsPlayer(), Object::RemoveDynamicFlag(), Object::SetDynamicFlag(), UNIT_DYNFLAG_TRACK_UNIT, and Unit::UpdateObjectVisibility().

◆ HandleAuraModStat()

void AuraEffect::HandleAuraModStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4198{
4200 return;
4201
4202 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4203 {
4204 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4205 return;
4206 }
4207
4208 Unit* target = aurApp->GetTarget();
4210 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4211 return;
4212
4213 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4214 {
4215 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4216 if (GetMiscValue() < 0 || GetMiscValue() == i)
4217 {
4218 if (spellGroupVal)
4220
4222 if (target->IsPlayer() || target->IsPet())
4223 target->UpdateStatBuffMod(Stats(i));
4224 }
4225 }
4226}
#define MAX_STATS
Definition SharedDefines.h:253
Stats
Definition SharedDefines.h:245
@ STAT_STRENGTH
Definition SharedDefines.h:246
@ SPELL_AURA_MOD_STAT
Definition SpellAuraDefines.h:92
@ UNIT_MOD_STAT_START
Definition Unit.h:176
int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
Definition Unit.cpp:4550
void UpdateStatBuffMod(Stats stat)
Definition Unit.cpp:6454

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetEffIndex(), Unit::GetHighestExclusiveSameEffectSpellGroupValue(), GetId(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatFlatModifier(), Unit::IsPet(), Object::IsPlayer(), LOG_ERROR, MAX_STATS, SPELL_AURA_MOD_STAT, STAT_STRENGTH, TOTAL_VALUE, UNIT_MOD_STAT_START, and Unit::UpdateStatBuffMod().

◆ HandleAuraModStateImmunity()

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

◆ HandleAuraModStun()

void AuraEffect::HandleAuraModStun ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3630{
3631 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3632 return;
3633
3634 Unit* target = aurApp->GetTarget();
3635
3636 target->SetControlled(apply, UNIT_STATE_STUNNED);
3637 if (apply)
3638 target->GetThreatMgr().EvaluateSuppressed();
3639}
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:176

References AURA_EFFECT_HANDLE_REAL, ThreatManager::EvaluateSuppressed(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), Unit::SetControlled(), and UNIT_STATE_STUNNED.

◆ HandleAuraModTotalThreat()

void AuraEffect::HandleAuraModTotalThreat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3562{
3564 return;
3565
3566 Unit* target = aurApp->GetTarget();
3567
3568 if (!target->IsAlive() || !target->IsPlayer())
3569 return;
3570
3571 Unit* caster = GetCaster();
3572 if (caster && caster->IsAlive())
3574}
void UpdateMyTempModifiers()
Definition ThreatManager.cpp:803

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetCaster(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), Unit::IsAlive(), Object::IsPlayer(), and ThreatManager::UpdateMyTempModifiers().

◆ HandleAuraModUseNormalSpeed()

void AuraEffect::HandleAuraModUseNormalSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3910{
3911 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3912 return;
3913
3914 Unit* target = aurApp->GetTarget();
3915
3916 target->UpdateSpeed(MOVE_RUN, true);
3917 target->UpdateSpeed(MOVE_SWIM, true);
3918 target->UpdateSpeed(MOVE_FLIGHT, true);
3919
3920 if (Player* targetPlayer = target->ToPlayer())
3921 {
3922 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3923 }
3924}

References AURA_EFFECT_HANDLE_REAL, AuraApplication::GetTarget(), MOVE_FLIGHT, MOVE_RUN, MOVE_SWIM, sScriptMgr, Object::ToPlayer(), and Unit::UpdateSpeed().

◆ HandleAuraModWeaponCritPercent()

void AuraEffect::HandleAuraModWeaponCritPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4638{
4640 return;
4641
4642 Player* target = aurApp->GetTarget()->ToPlayer();
4643
4644 if (!target)
4645 return;
4646
4648}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::ToPlayer(), and Player::UpdateAllWeaponDependentCritAuras().

◆ HandleAuraMounted()

void AuraEffect::HandleAuraMounted ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3362{
3364 return;
3365
3366 Unit* target = aurApp->GetTarget();
3367 Unit* caster = GetCaster();
3368
3369 if (apply)
3370 {
3371 uint32 creatureEntry = GetMiscValue();
3372 uint32 displayId = 0;
3373 uint32 vehicleId = 0;
3374
3375 // Festive Holiday Mount
3376 if (target->HasAura(62061))
3377 {
3379 creatureEntry = 24906;
3380 else
3381 creatureEntry = 15665;
3382 }
3383
3384 // Festive Brewfest Mount
3386 {
3387 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
3388 {
3389 creatureEntry = GREAT_BREWFEST_KODO;
3390 }
3391 else
3392 {
3393 creatureEntry = BREWFEST_KODO;
3394 }
3395 }
3396
3397 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
3398 {
3399 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
3400 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
3401 displayId = model.CreatureDisplayID;
3402
3403 vehicleId = creatureInfo->VehicleId;
3404
3405 //some spell has one aura of mount and one of vehicle
3406 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3407 {
3408 if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue())
3409 {
3410 displayId = 0;
3411 }
3412 }
3413
3414 }
3415 target->Mount(displayId, vehicleId, GetMiscValue());
3416 }
3417 else
3418 {
3419 target->Dismount();
3420 //some mounts like Headless Horseman's Mount or broom stick are skill based spell
3421 // need to remove ALL arura related to mounts, this will stop client crash with broom stick
3422 // and never endless flying after using Headless Horseman's Mount
3423 if (mode & AURA_EFFECT_HANDLE_REAL)
3425 }
3426}
@ SPELL_EFFECT_SUMMON
Definition SharedDefines.h:794
void Dismount()
Definition Unit.cpp:10563
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5999
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:10503

References AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, BREWFEST_KODO, ObjectMgr::ChooseDisplayId(), CreatureModel::CreatureDisplayID, Unit::Dismount(), FRESH_BREWFEST_HOPS, GetBase(), GetCaster(), GetMiscValue(), Unit::GetSpeedRate(), GetSpellInfo(), AuraApplication::GetTarget(), GREAT_BREWFEST_KODO, Unit::HasAura(), MAX_SPELL_EFFECTS, Unit::Mount(), MOVE_RUN, Unit::RemoveAurasByType(), sObjectMgr, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_MOUNTED, and SPELL_EFFECT_SUMMON.

◆ HandleAuraOpenStable()

void AuraEffect::HandleAuraOpenStable ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5837{
5838 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5839 return;
5840
5841 Unit* target = aurApp->GetTarget();
5842
5843 if (!target->IsPlayer() || !target->IsInWorld())
5844 return;
5845
5846 if (apply)
5847 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
5848
5849 // client auto close stable dialog at !apply aura
5850}
bool IsInWorld() const
Definition Object.h:109
WorldSession * GetSession() const
Definition Player.h:2019
void SendStablePet(ObjectGuid guid)
Definition NPCHandler.cpp:354

References AURA_EFFECT_HANDLE_REAL, Object::GetGUID(), Player::GetSession(), AuraApplication::GetTarget(), Object::IsInWorld(), Object::IsPlayer(), WorldSession::SendStablePet(), and Object::ToPlayer().

◆ HandleAuraOverrideSpells()

void AuraEffect::HandleAuraOverrideSpells ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5866{
5867 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5868 return;
5869
5870 Player* target = aurApp->GetTarget()->ToPlayer();
5871
5872 if (!target || !target->IsInWorld())
5873 return;
5874
5875 uint32 overrideId = uint32(GetMiscValue());
5876
5877 if (apply)
5878 {
5880 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5881 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5882 if (uint32 spellId = overrideSpells->spellId[i])
5883 target->_addSpell(spellId, SPEC_MASK_ALL, true);
5884 }
5885 else
5886 {
5888 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5889 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5890 if (uint32 spellId = overrideSpells->spellId[i])
5891 target->removeSpell(spellId, SPEC_MASK_ALL, true);
5892 }
5893}
DBCStorage< OverrideSpellDataEntry > sOverrideSpellDataStore(OverrideSpellDatafmt)
#define MAX_OVERRIDE_SPELL
Definition DBCStructure.h:1411
#define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET
Definition Player.h:536
@ PLAYER_FIELD_BYTES2
Definition UpdateFields.h:378
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition Object.cpp:759
Definition DBCStructure.h:1414

References Player::_addSpell(), AURA_EFFECT_HANDLE_REAL, GetMiscValue(), AuraApplication::GetTarget(), Object::IsInWorld(), MAX_OVERRIDE_SPELL, PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET, PLAYER_FIELD_BYTES2, Player::removeSpell(), Object::SetUInt16Value(), sOverrideSpellDataStore, SPEC_MASK_ALL, and Object::ToPlayer().

◆ HandleAuraRetainComboPoints()

void AuraEffect::HandleAuraRetainComboPoints ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5135{
5136 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5137 return;
5138
5139 Unit* target = aurApp->GetTarget();
5140
5141 if (!target->IsPlayer())
5142 return;
5143
5144 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5145 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5146 if (!(apply) && GetBase()->GetDuration() == 0)
5147 target->AddComboPoints(-GetAmount());
5148}
void AddComboPoints(Unit *target, int8 count)
Definition Unit.cpp:13225

References Unit::AddComboPoints(), AURA_EFFECT_HANDLE_REAL, GetAmount(), GetBase(), AuraApplication::GetTarget(), and Object::IsPlayer().

◆ HandleAuraSetVehicle()

void AuraEffect::HandleAuraSetVehicle ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5896{
5897 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5898 return;
5899
5900 Unit* target = aurApp->GetTarget();
5901
5902 if (!target->IsPlayer() || !target->IsInWorld())
5903 return;
5904
5905 uint32 vehicleId = GetMiscValue();
5906
5907 if (apply)
5908 {
5909 if (!target->CreateVehicleKit(vehicleId, 0))
5910 return;
5911 }
5912 else if (target->GetVehicleKit())
5913 target->RemoveVehicleKit();
5914
5916 data << target->GetPackGUID();
5917 data << uint32(apply ? vehicleId : 0);
5918 target->SendMessageToSet(&data, true);
5919
5920 if (apply)
5921 {
5923 target->ToPlayer()->SendDirectMessage(&data);
5924 }
5925}
PackedGuid const & GetPackGUID() const
Definition Object.h:116
std::size_t size() const
Definition ObjectGuid.h:274
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5681
void RemoveVehicleKit()
Definition Unit.cpp:14979
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition Unit.cpp:14967
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition Object.cpp:2112
Definition WorldPacket.h:26
@ SMSG_PLAYER_VEHICLE_DATA
Definition Opcodes.h:1221
@ SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA
Definition Opcodes.h:1211

References AURA_EFFECT_HANDLE_REAL, Unit::CreateVehicleKit(), GetMiscValue(), Object::GetPackGUID(), AuraApplication::GetTarget(), Unit::GetVehicleKit(), WorldPacket::Initialize(), Object::IsInWorld(), Object::IsPlayer(), Unit::RemoveVehicleKit(), Player::SendDirectMessage(), WorldObject::SendMessageToSet(), PackedGuid::size(), SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, SMSG_PLAYER_VEHICLE_DATA, and Object::ToPlayer().

◆ HandleAuraTrackCreatures()

void AuraEffect::HandleAuraTrackCreatures ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3232{
3234 return;
3235
3236 Unit* target = aurApp->GetTarget();
3237
3238 if (!target->IsPlayer())
3239 return;
3240
3241 if (apply)
3242 target->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3243 else
3244 target->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3245}
@ PLAYER_TRACK_CREATURES
Definition UpdateFields.h:344

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), PLAYER_TRACK_CREATURES, Object::RemoveFlag(), and Object::SetFlag().

◆ HandleAuraTrackResources()

void AuraEffect::HandleAuraTrackResources ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3248{
3250 return;
3251
3252 Unit* target = aurApp->GetTarget();
3253
3254 if (!target->IsPlayer())
3255 return;
3256
3257 if (apply)
3258 target->SetFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3259 else
3260 target->RemoveFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3261}
@ PLAYER_TRACK_RESOURCES
Definition UpdateFields.h:345

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), PLAYER_TRACK_RESOURCES, Object::RemoveFlag(), and Object::SetFlag().

◆ HandleAuraTrackStealthed()

void AuraEffect::HandleAuraTrackStealthed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3264{
3266 return;
3267
3268 Unit* target = aurApp->GetTarget();
3269
3270 if (!target->IsPlayer())
3271 return;
3272
3273 if (!(apply))
3274 {
3275 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3276 if (target->HasAuraType(GetAuraType()))
3277 return;
3278 }
3280}
@ PLAYER_FIELD_BYTE_TRACK_STEALTHED
Definition Player.h:544
@ PLAYER_FIELD_BYTES
Definition UpdateFields.h:368
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition Object.cpp:881

References Object::ApplyModFlag(), AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Object::IsPlayer(), PLAYER_FIELD_BYTE_TRACK_STEALTHED, and PLAYER_FIELD_BYTES.

◆ HandleAuraTransform()

void AuraEffect::HandleAuraTransform ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2284{
2286 return;
2287
2288 Unit* target = aurApp->GetTarget();
2289
2290 if (apply)
2291 {
2292 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
2293 if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm(), GetId()) || !GetSpellInfo()->IsPositive())
2294 {
2295 // special case (spell specific functionality)
2296 if (GetMiscValue() == 0)
2297 {
2298 switch (GetId())
2299 {
2300 // Orb of Deception
2301 case 16739:
2302 {
2303 if (!target->IsPlayer())
2304 return;
2305
2306 switch (target->getRace())
2307 {
2308 // Blood Elf
2309 case RACE_BLOODELF:
2310 target->SetDisplayId(target->getGender() == GENDER_MALE ? 17829 : 17830);
2311 break;
2312 // Orc
2313 case RACE_ORC:
2314 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10139 : 10140);
2315 break;
2316 // Troll
2317 case RACE_TROLL:
2318 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10135 : 10134);
2319 break;
2320 // Tauren
2321 case RACE_TAUREN:
2322 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10136 : 10147);
2323 break;
2324 // Undead
2325 case RACE_UNDEAD_PLAYER:
2326 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10146 : 10145);
2327 break;
2328 // Draenei
2329 case RACE_DRAENEI:
2330 target->SetDisplayId(target->getGender() == GENDER_MALE ? 17827 : 17828);
2331 break;
2332 // Dwarf
2333 case RACE_DWARF:
2334 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10141 : 10142);
2335 break;
2336 // Gnome
2337 case RACE_GNOME:
2338 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10148 : 10149);
2339 break;
2340 // Human
2341 case RACE_HUMAN:
2342 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10137 : 10138);
2343 break;
2344 // Night Elf
2345 case RACE_NIGHTELF:
2346 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10143 : 10144);
2347 break;
2348 default:
2349 break;
2350 }
2351 break;
2352 }
2353 // Murloc costume
2354 case 42365:
2355 target->SetDisplayId(21723);
2356 break;
2357 // Dread Corsair
2358 case 50517:
2359 // Corsair Costume
2360 case 51926:
2361 {
2362 if (!target->IsPlayer())
2363 return;
2364
2365 switch (target->getRace())
2366 {
2367 // Blood Elf
2368 case RACE_BLOODELF:
2369 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25032 : 25043);
2370 break;
2371 // Orc
2372 case RACE_ORC:
2373 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25039 : 25050);
2374 break;
2375 // Troll
2376 case RACE_TROLL:
2377 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25041 : 25052);
2378 break;
2379 // Tauren
2380 case RACE_TAUREN:
2381 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25040 : 25051);
2382 break;
2383 // Undead
2384 case RACE_UNDEAD_PLAYER:
2385 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25042 : 25053);
2386 break;
2387 // Draenei
2388 case RACE_DRAENEI:
2389 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25033 : 25044);
2390 break;
2391 // Dwarf
2392 case RACE_DWARF:
2393 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25034 : 25045);
2394 break;
2395 // Gnome
2396 case RACE_GNOME:
2397 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25035 : 25046);
2398 break;
2399 // Human
2400 case RACE_HUMAN:
2401 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25037 : 25048);
2402 break;
2403 // Night Elf
2404 case RACE_NIGHTELF:
2405 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25038 : 25049);
2406 break;
2407 default:
2408 break;
2409 }
2410 break;
2411 }
2412 // Pygmy Oil
2413 case 53806:
2414 target->SetDisplayId(22512);
2415 break;
2416 // Honor the Dead
2417 case 65386:
2418 case 65495:
2419 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204);
2420 break;
2421 // Gossip NPC Appearance - Brewfest
2422 case 65511:
2423 {
2424 switch (target->GetDisplayRace())
2425 {
2427 if (urand(0, 1))
2428 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21839 : 21838);
2429 else
2430 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21841 : 21840);
2431 break;
2432 case DisplayRace::Orc:
2433 if (urand(0, 1))
2434 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21867 : 21866);
2435 else
2436 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21869 : 21868);
2437 break;
2438 case DisplayRace::Troll:
2439 if (urand(0, 1))
2440 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21875 : 21874);
2441 else
2442 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21877 : 21876);
2443 break;
2445 if (urand(0, 1))
2446 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21869 : 21871);
2447 else
2448 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21872 : 21873);
2449 break;
2451 if (urand(0, 1))
2452 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21879 : 21878);
2453 else
2454 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21881 : 21880);
2455 break;
2457 if (urand(0, 1))
2458 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21844 : 21842);
2459 else
2460 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21845 : 21843);
2461 break;
2462 case DisplayRace::Dwarf:
2463 if (urand(0, 1))
2464 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21846 : 21848);
2465 else
2466 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21847 : 21849);
2467 break;
2468 case DisplayRace::Gnome:
2469 if (urand(0, 1))
2470 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21851 : 21850);
2471 else
2472 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21853 : 21852);
2473 break;
2474 case DisplayRace::Human:
2475 if (urand(0, 1))
2476 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21859 : 21858);
2477 else
2478 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21861 : 21860);
2479 break;
2481 if (urand(0, 1))
2482 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21863 : 21862);
2483 else
2484 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21865 : 21864);
2485 break;
2487 if (urand(0, 1))
2488 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21854 : 21856);
2489 else
2490 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21855 : 21857);
2491 break;
2492 default:
2493 break;
2494 }
2495
2496 // equip random brewfest mug
2497 uint32 itemIds[5] = {
2498 2703, // Monster - Item, Tankard Wooden
2499 2704, // Monster - Item, Tankard Dirty
2500 2705, // Monster - Item, Tankard Metal
2501 13861, // Monster - Item, Tankard Gold
2502 33963 // NPC Equip 33963
2503 };
2504 if (target->ToCreature())
2505 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, itemIds[urand(0, 4)]);
2506
2507 break;
2508 }
2509 // Gossip NPC Appearance - Winter Veil
2510 case 65522:
2511 {
2512 switch (target->GetDisplayRace())
2513 {
2515 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18793 : 18785);
2516 break;
2517 case DisplayRace::Orc:
2518 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18805 : 18804);
2519 break;
2520 case DisplayRace::Troll:
2521 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18809 : 18808);
2522 break;
2524 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18807 : 18806);
2525 break;
2527 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18811 : 18810);
2528 break;
2530 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18795 : 18794);
2531 break;
2532 case DisplayRace::Dwarf:
2533 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18797 : 18796);
2534 break;
2535 case DisplayRace::Gnome:
2536 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18799 : 18798);
2537 break;
2538 case DisplayRace::Human:
2539 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18801 : 18800);
2540 break;
2542 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18803 : 18802);
2543 break;
2545 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19342 : 19339);
2546 default:
2547 break;
2548 }
2549 break;
2550 }
2551 // Gossip NPC Appearance - Default
2552 case 65523:
2553 {
2554 switch (target->GetDisplayRace())
2555 {
2557 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19170 : 19169);
2558 break;
2559 case DisplayRace::Orc:
2560 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19182 : 19181);
2561 break;
2562 case DisplayRace::Troll:
2563 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19186 : 19185);
2564 break;
2566 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19184 : 19183);
2567 break;
2569 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19188 : 19187);
2570 break;
2572 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19172 : 19171);
2573 break;
2574 case DisplayRace::Dwarf:
2575 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19174 : 19173);
2576 break;
2577 case DisplayRace::Gnome:
2578 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19176 : 19175);
2579 break;
2580 case DisplayRace::Human:
2581 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19178 : 19177);
2582 break;
2584 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19180 : 19179);
2585 break;
2587 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19343 : 19340);
2588 default:
2589 break;
2590 }
2591 break;
2592 }
2593 // Gossip NPC Appearance - Lunar Festival
2594 case 65524:
2595 {
2596 switch (target->GetDisplayRace())
2597 {
2599 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18841 : 18840);
2600 break;
2601 case DisplayRace::Orc:
2602 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18870 : 18869);
2603 break;
2604 case DisplayRace::Troll:
2605 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18874 : 18873);
2606 break;
2608 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18872 : 18871);
2609 break;
2611 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18876 : 18875);
2612 break;
2614 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18843 : 18842);
2615 break;
2616 case DisplayRace::Dwarf:
2617 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18845 : 18844);
2618 break;
2619 case DisplayRace::Gnome:
2620 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18847 : 18846);
2621 break;
2622 case DisplayRace::Human:
2623 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18860 : 18858);
2624 break;
2626 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18868 : 18867);
2627 break;
2629 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21067 : 19341);
2630 default:
2631 break;
2632 }
2633 break;
2634 }
2635 // Gossip NPC Appearance - Hallow's End
2636 case 65525:
2637 {
2638 switch (target->GetDisplayRace())
2639 {
2641 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22361 : 22360);
2642 break;
2643 case DisplayRace::Orc:
2644 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22375 : 22374);
2645 break;
2646 case DisplayRace::Troll:
2647 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22379 : 22378);
2648 break;
2650 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22377 : 22376);
2651 break;
2653 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22381 : 22380);
2654 break;
2656 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22363 : 22362);
2657 break;
2658 case DisplayRace::Dwarf:
2659 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22365 : 22364);
2660 break;
2661 case DisplayRace::Gnome:
2662 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22367 : 22366);
2663 break;
2664 case DisplayRace::Human:
2665 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22371 : 22370);
2666 break;
2668 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22373 : 22372);
2669 break;
2671 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22369 : 22368);
2672 default:
2673 break;
2674 }
2675 break;
2676 }
2677 // Gossip NPC Appearance - Midsummer
2678 case 65526:
2679 {
2680 switch (target->GetDisplayRace())
2681 {
2683 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21086 : 21085);
2684 break;
2685 case DisplayRace::Orc:
2686 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16438 : 16436);
2687 break;
2688 case DisplayRace::Troll:
2689 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16446 : 16445);
2690 break;
2692 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16432 : 16442);
2693 break;
2695 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16444 : 16443);
2696 break;
2698 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21083 : 21084);
2699 break;
2700 case DisplayRace::Dwarf:
2701 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16413 : 16434);
2702 break;
2703 case DisplayRace::Gnome:
2704 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16448 : 16447);
2705 break;
2706 case DisplayRace::Human:
2707 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16433 : 16412);
2708 break;
2710 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16435 : 16414);
2711 break;
2713 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29243 : 16431);
2714 default:
2715 break;
2716 }
2717 break;
2718 }
2719 // Gossip NPC Appearance - Spirit of Competition
2720 case 65527:
2721 {
2722 switch (target->GetDisplayRace())
2723 {
2725 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24508 : 24519);
2726 break;
2727 case DisplayRace::Orc:
2728 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24515 : 24526);
2729 break;
2730 case DisplayRace::Troll:
2731 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24517 : 24528);
2732 break;
2734 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24516 : 24527);
2735 break;
2737 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24518 : 24529);
2738 break;
2740 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24509 : 24520);
2741 break;
2742 case DisplayRace::Dwarf:
2743 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24510 : 24521);
2744 break;
2745 case DisplayRace::Gnome:
2746 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24511 : 24522);
2747 break;
2748 case DisplayRace::Human:
2749 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24513 : 24524);
2750 break;
2752 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24514 : 24525);
2753 break;
2755 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24512 : 24523);
2756 default:
2757 break;
2758 }
2759 break;
2760 }
2761 // Gossip NPC Appearance - Pirates' Day
2762 case 65528:
2763 {
2764 switch (target->GetDisplayRace())
2765 {
2767 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25032 : 25043);
2768 break;
2769 case DisplayRace::Orc:
2770 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25039 : 25050);
2771 break;
2772 case DisplayRace::Troll:
2773 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25041 : 25052);
2774 break;
2776 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25040 : 25051);
2777 break;
2779 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25042 : 25053);
2780 break;
2782 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25033 : 25044);
2783 break;
2784 case DisplayRace::Dwarf:
2785 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25034 : 25045);
2786 break;
2787 case DisplayRace::Gnome:
2788 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25035 : 25046);
2789 break;
2790 case DisplayRace::Human:
2791 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25037 : 25048);
2792 break;
2794 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25038 : 25049);
2795 break;
2797 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25036 : 25047);
2798 default:
2799 break;
2800 }
2801 break;
2802 }
2803 // Gossip NPC Appearance - Day of the Dead(DotD)
2804 case 65529:
2805 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204);
2806 break;
2807 // Darkspear Pride
2808 case 75532:
2809 target->SetDisplayId(target->getGender() == GENDER_MALE ? 31737 : 31738);
2810 break;
2811 // Gnomeregan Pride
2812 case 75531:
2813 target->SetDisplayId(target->getGender() == GENDER_MALE ? 31654 : 31655);
2814 break;
2815 default:
2816 break;
2817 }
2818 }
2819 else
2820 {
2821 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(GetMiscValue());
2822 if (!ci)
2823 {
2824 target->SetDisplayId(16358); // pig pink ^_^
2825 LOG_ERROR("spells.aura.effect", "Auras: unknown creature id = {} (only need its modelid) From Spell Aura Transform in Spell ID = {}", GetMiscValue(), GetId());
2826 }
2827 else
2828 {
2829 uint32 model_id = 0;
2830
2831 if (uint32 modelid = ObjectMgr::ChooseDisplayId(ci)->CreatureDisplayID)
2832 model_id = modelid; // Will use the default model here
2833
2834 // Polymorph (sheep)
2835 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978)
2836 if (Unit* caster = GetCaster())
2837 if (caster->HasAura(52648)) // Glyph of the Penguin
2838 model_id = 26452;
2839
2840 target->SetDisplayId(model_id);
2841
2842 // Dragonmaw Illusion (set mount model also)
2843 if (GetId() == 42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
2845 }
2846 }
2847 }
2848
2849 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
2850 SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm());
2851 if (!transformSpellInfo || GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !GetSpellInfo()->IsPositive() || transformSpellInfo->IsPositive())
2852 target->setTransForm(GetId());
2853
2854 // polymorph case
2855 if ((mode & AURA_EFFECT_HANDLE_REAL) && target->IsPlayer() && target->IsPolymorphed())
2856 {
2857 // for players, start regeneration after 1s (in polymorph fast regeneration case)
2858 // only if caster is Player (after patch 2.4.2)
2859 if (GetCasterGUID().IsPlayer())
2861
2862 //dismount polymorphed target (after patch 2.4.2)
2863 if (target->IsMounted())
2865 }
2866 }
2867 else
2868 {
2869 // HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
2870 if (target->getTransForm() == GetId())
2871 target->setTransForm(0);
2872
2873 target->RestoreDisplayId();
2874
2875 // Dragonmaw Illusion (restore mount model)
2876 if (GetId() == 42016 && target->GetMountID() == 16314)
2877 {
2878 if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
2879 {
2880 uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
2881 if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(cr_id))
2882 {
2884 sObjectMgr->GetCreatureModelRandomGender(&model, ci);
2885
2887 }
2888 }
2889 }
2890 }
2891}
@ RACE_TROLL
Definition SharedDefines.h:78
@ RACE_UNDEAD_PLAYER
Definition SharedDefines.h:75
@ RACE_ORC
Definition SharedDefines.h:72
@ RACE_DRAENEI
Definition SharedDefines.h:81
@ RACE_NIGHTELF
Definition SharedDefines.h:74
@ RACE_BLOODELF
Definition SharedDefines.h:80
@ RACE_DWARF
Definition SharedDefines.h:73
@ RACE_GNOME
Definition SharedDefines.h:77
@ RACE_HUMAN
Definition SharedDefines.h:71
@ RACE_TAUREN
Definition SharedDefines.h:76
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition UpdateFields.h:116
void setRegenTimerCount(uint32 time)
Definition Player.h:1620
uint8 getRace(bool original=false) const
Definition Unit.cpp:17046
DisplayRace GetDisplayRace() const
Definition Unit.h:840
void setTransForm(uint32 spellid)
Definition Unit.h:1968
bool IsMounted() const
Definition Unit.h:1887

References AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, BloodElf, ObjectMgr::ChooseDisplayId(), CreatureModel::CreatureDisplayID, Draenei, Dwarf, GENDER_MALE, Unit::GetAuraEffectsByType(), GetCaster(), GetCasterGUID(), Unit::GetDisplayRace(), Unit::getGender(), GetId(), GetMiscValue(), Unit::GetModelForForm(), Unit::GetMountID(), Unit::getRace(), Unit::GetShapeshiftForm(), GetSpellInfo(), AuraApplication::GetTarget(), Unit::getTransForm(), Gnome, Goblin, Human, IN_MILLISECONDS, Unit::IsMounted(), Object::IsPlayer(), Unit::IsPolymorphed(), SpellInfo::IsPositive(), LOG_ERROR, NightElf, Orc, RACE_BLOODELF, RACE_DRAENEI, RACE_DWARF, RACE_GNOME, RACE_HUMAN, RACE_NIGHTELF, RACE_ORC, RACE_TAUREN, RACE_TROLL, RACE_UNDEAD_PLAYER, Unit::RemoveAurasByType(), Unit::RestoreDisplayId(), Unit::SetDisplayId(), Player::setRegenTimerCount(), Unit::setTransForm(), Unit::SetUInt32Value(), sObjectMgr, SPELL_ATTR0_NO_IMMUNITIES, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_MOUNTED, SPELLFAMILY_MAGE, sSpellMgr, Tauren, Object::ToCreature(), Object::ToPlayer(), Troll, Undead, UNIT_FIELD_MOUNTDISPLAYID, UNIT_VIRTUAL_ITEM_SLOT_ID, and urand().

◆ HandleAuraUntrackable()

void AuraEffect::HandleAuraUntrackable ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3304{
3306 return;
3307
3308 Unit* target = aurApp->GetTarget();
3309
3310 if (apply)
3312 else
3313 {
3314 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3315 if (target->HasAuraType(GetAuraType()))
3316 return;
3318 }
3319}
@ UNIT_STAND_FLAGS_UNTRACKABLE
Definition UnitDefines.h:52
@ UNIT_BYTES_1_OFFSET_VIS_FLAG
Definition UnitDefines.h:28
@ UNIT_FIELD_BYTES_1
Definition UpdateFields.h:131
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:912
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:893

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Object::RemoveByteFlag(), Object::SetByteFlag(), UNIT_BYTES_1_OFFSET_VIS_FLAG, UNIT_FIELD_BYTES_1, and UNIT_STAND_FLAGS_UNTRACKABLE.

◆ HandleAuraWaterWalk()

void AuraEffect::HandleAuraWaterWalk ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3449{
3451 return;
3452
3453 Unit* target = aurApp->GetTarget();
3454
3455 if (Player* targetPlayer = target->ToPlayer())
3456 {
3457 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3458 }
3459
3460 if (!apply)
3461 {
3462 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3463 if (target->HasAuraType(GetAuraType()))
3464 return;
3465 }
3466
3467 target->SetWaterWalking(apply);
3468}
void SetWaterWalking(bool enable)
Definition Unit.cpp:16685

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::SetWaterWalking(), sScriptMgr, and Object::ToPlayer().

◆ HandleBindSight()

void AuraEffect::HandleBindSight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5644{
5645 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5646 return;
5647
5648 Unit* target = aurApp->GetTarget();
5649
5650 Unit* caster = GetCaster();
5651
5652 if (!caster || !caster->IsPlayer())
5653 return;
5654
5655 caster->ToPlayer()->SetViewpoint(target, apply);
5656}
void SetViewpoint(WorldObject *target, bool apply)
Definition Player.cpp:13200

References AURA_EFFECT_HANDLE_REAL, GetCaster(), AuraApplication::GetTarget(), Object::IsPlayer(), Player::SetViewpoint(), and Object::ToPlayer().

◆ HandleBreakableCCAuraProc()

void AuraEffect::HandleBreakableCCAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
6894{
6895 int32 const damageLeft = GetAmount() - static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage());
6896
6897 if (damageLeft <= 0)
6898 aurApp->GetTarget()->RemoveAura(aurApp);
6899 else
6900 SetAmount(damageLeft);
6901}
Unit * GetTarget() const
Definition SpellAuras.h:61

References GetAmount(), DamageInfo::GetDamage(), ProcEventInfo::GetDamageInfo(), AuraApplication::GetTarget(), Unit::RemoveAura(), and SetAmount().

Referenced by HandleProc().

◆ HandleChannelDeathItem()

void AuraEffect::HandleChannelDeathItem ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5599{
5600 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5601 return;
5602
5603 if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
5604 return;
5605
5606 Unit* caster = GetCaster();
5607
5608 if (!caster || !caster->IsPlayer())
5609 return;
5610
5611 Player* plCaster = caster->ToPlayer();
5612
5613 // Item amount
5614 if (GetAmount() <= 0)
5615 return;
5616
5617 if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0)
5618 return;
5619
5620 //Adding items
5621 uint32 noSpaceForCount = 0;
5622 uint32 count = m_amount;
5623
5624 ItemPosCountVec dest;
5625 InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount);
5626 if (msg != EQUIP_ERR_OK)
5627 {
5628 count -= noSpaceForCount;
5629 plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellInfo()->Effects[m_effIndex].ItemType);
5630 if (count == 0)
5631 return;
5632 }
5633
5634 Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true);
5635 if (!newitem)
5636 {
5637 plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
5638 return;
5639 }
5640 plCaster->SendNewItem(newitem, count, true, true);
5641}
InventoryResult
Definition Item.h:46
@ EQUIP_ERR_ITEM_NOT_FOUND
Definition Item.h:70
@ EQUIP_ERR_OK
Definition Item.h:47
@ NULL_BAG
Definition Item.h:40
@ NULL_SLOT
Definition Item.h:41
std::vector< ItemPosCount > ItemPosCountVec
Definition Player.h:757
@ AURA_REMOVE_BY_DEATH
Definition SpellAuraDefines.h:396
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast=false, bool sendChatMessage=true)
Definition PlayerStorage.cpp:4812
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0, bool refund=false)
Definition PlayerStorage.cpp:2596
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition PlayerStorage.cpp:4088
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition Player.h:1297

References AURA_EFFECT_HANDLE_REAL, AURA_REMOVE_BY_DEATH, Player::CanStoreNewItem(), EQUIP_ERR_ITEM_NOT_FOUND, EQUIP_ERR_OK, GetAmount(), GetCaster(), AuraApplication::GetRemoveMode(), GetSpellInfo(), Object::IsPlayer(), m_amount, m_effIndex, NULL_BAG, NULL_SLOT, Player::SendEquipError(), Player::SendNewItem(), Player::StoreNewItem(), and Object::ToPlayer().

◆ HandleCharmConvert()

void AuraEffect::HandleCharmConvert ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3760{
3761 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3762 return;
3763
3764 Unit* target = aurApp->GetTarget();
3765
3766 Unit* caster = GetCaster();
3767
3768 if (apply)
3769 target->SetCharmedBy(caster, CHARM_TYPE_CONVERT, aurApp);
3770 else
3771 target->RemoveCharmedBy(caster);
3772}
@ CHARM_TYPE_CONVERT
Definition CharmInfo.h:48
void RemoveCharmedBy(Unit *charmer)
Definition Unit.cpp:14797
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:14597

References AURA_EFFECT_HANDLE_REAL, CHARM_TYPE_CONVERT, GetCaster(), AuraApplication::GetTarget(), Unit::RemoveCharmedBy(), and Unit::SetCharmedBy().

◆ HandleComprehendLanguage()

void AuraEffect::HandleComprehendLanguage ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5747{
5749 return;
5750
5751 Unit* target = aurApp->GetTarget();
5752
5753 if (apply)
5755 else
5756 {
5757 if (target->HasAuraType(GetAuraType()))
5758 return;
5759
5761 }
5762}
@ UNIT_FLAG2_COMPREHEND_LANG
Definition UnitDefines.h:299

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::RemoveUnitFlag2(), Unit::SetUnitFlag2(), and UNIT_FLAG2_COMPREHEND_LANG.

◆ HandleDetectAmore()

void AuraEffect::HandleDetectAmore ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1830{
1832 {
1833 return;
1834 }
1835
1836 Unit* target = aurApp->GetTarget();
1837 if (!target->IsPlayer())
1838 {
1839 return;
1840 }
1841
1842 if (apply)
1843 {
1844 target->SetByteFlag(PLAYER_FIELD_BYTES2, 3, 1 << (GetMiscValue() - 1));
1845 }
1846 else
1847 {
1848 if (target->HasDetectAmoreAura())
1849 {
1851 for (AuraEffect const* aurEff : amoreAuras)
1852 if (GetMiscValue() == aurEff->GetMiscValue())
1853 {
1854 return;
1855 }
1856 }
1857
1858 target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 3, 1 << (GetMiscValue() - 1));
1859 }
1860}
@ SPELL_AURA_DETECT_AMORE
Definition SpellAuraDefines.h:233
bool HasDetectAmoreAura() const
Definition Unit.h:1818

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, Unit::GetAuraEffectsByType(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HasDetectAmoreAura(), Object::IsPlayer(), PLAYER_FIELD_BYTES2, Object::RemoveByteFlag(), Object::SetByteFlag(), and SPELL_AURA_DETECT_AMORE.

◆ HandleEffect() [1/2]

void AuraEffect::HandleEffect ( AuraApplication aurApp,
uint8  mode,
bool  apply 
)
756{
757 // check if call is correct, we really don't want using bitmasks here (with 1 exception)
761 || mode == AURA_EFFECT_HANDLE_STAT
762 || mode == AURA_EFFECT_HANDLE_SKILL
765
766 // register/unregister effect in lists in case of real AuraEffect apply/remove
767 // registration/unregistration is done always before real effect handling (some effect handlers code is depending on this)
768 if (mode & AURA_EFFECT_HANDLE_REAL)
769 aurApp->GetTarget()->_RegisterAuraEffect(this, apply);
770
771 // xinef: stacking system, force return if effect is disabled, prevents double apply / unapply
772 // xinef: placed here so above line can unregister effect from the list
773 // xinef: this condition works under assumption that effect handlers performs ALL necessery action with CHANGE_AMOUNT mode
774 // xinef: as far as i've checked, all grouped spells meet this condition
775 if (!aurApp->IsActive(GetEffIndex()))
776 return;
777
778 // real aura apply/remove, handle modifier
780 ApplySpellMod(aurApp->GetTarget(), apply);
781
782 // call scripts helping/replacing effect handlers
783 bool prevented = false;
784 if (apply)
785 prevented = GetBase()->CallScriptEffectApplyHandlers(this, const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode);
786 else
787 prevented = GetBase()->CallScriptEffectRemoveHandlers(this, const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode);
788
789 // check if script events have removed the aura or if default effect prevention was requested
790 if ((apply && aurApp->GetRemoveMode()) || prevented)
791 return;
792
793 (*this.*AuraEffectHandler [GetAuraType()])(aurApp, mode, apply);
794
795 // check if script events have removed the aura or if default effect prevention was requested
796 if (apply && aurApp->GetRemoveMode())
797 return;
798
799 // call scripts triggering additional events after apply/remove
800 if (apply)
802 else
804}
#define ASSERT
Definition Errors.h:68
AuraEffectHandleModes
Definition SpellAuraDefines.h:40
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
Definition SpellAuraDefines.h:43
pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]
Definition SpellAuraEffects.cpp:63
bool IsActive(uint8 effIdx)
Definition SpellAuras.h:81
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:73
void ApplySpellMod(Unit *target, bool apply)
Definition SpellAuraEffects.cpp:813
bool CallScriptEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2428
void CallScriptAfterEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2447
bool CallScriptEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2408
void CallScriptAfterEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2461
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
Definition Unit.cpp:4958

References Unit::_RegisterAuraEffect(), ApplySpellMod(), ASSERT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_REAPPLY, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, AURA_EFFECT_HANDLE_SKILL, AURA_EFFECT_HANDLE_STAT, AuraEffectHandler, Aura::CallScriptAfterEffectApplyHandlers(), Aura::CallScriptAfterEffectRemoveHandlers(), Aura::CallScriptEffectApplyHandlers(), Aura::CallScriptEffectRemoveHandlers(), GetAuraType(), GetBase(), GetEffIndex(), AuraApplication::GetRemoveMode(), AuraApplication::GetTarget(), and AuraApplication::IsActive().

Referenced by AuraApplication::_HandleEffect(), ChangeAmount(), Aura::HandleAllEffects(), HandleEffect(), and Unit::RestoreDisplayId().

◆ HandleEffect() [2/2]

void AuraEffect::HandleEffect ( Unit target,
uint8  mode,
bool  apply 
)
807{
809 ASSERT(aurApp);
810 HandleEffect(aurApp, mode, apply);
811}
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition SpellAuras.h:184

References ASSERT, Aura::GetApplicationOfTarget(), GetBase(), Object::GetGUID(), and HandleEffect().

◆ HandleFarSight()

void AuraEffect::HandleFarSight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5659{
5660 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5661 {
5662 return;
5663 }
5664
5665 Unit* caster = GetCaster();
5666 if (!caster || !caster->IsPlayer())
5667 {
5668 return;
5669 }
5670
5671 Player* player = caster->ToPlayer();
5672 if (apply)
5673 {
5675 }
5676 else
5677 {
5678 player->ResetFarSightDistance();
5679 }
5680
5681 caster->UpdateObjectVisibility(!apply);
5682}
void SetFarSightDistance(float radius)
Definition Player.cpp:16302
void ResetFarSightDistance()
Definition Player.cpp:16307
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2723

References AURA_EFFECT_HANDLE_REAL, GetCaster(), SpellInfo::GetMaxRange(), Object::IsPlayer(), m_spellInfo, Player::ResetFarSightDistance(), Player::SetFarSightDistance(), Object::ToPlayer(), and Unit::UpdateObjectVisibility().

◆ HandleFeignDeath()

void AuraEffect::HandleFeignDeath ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2930{
2931 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2932 return;
2933
2934 Unit* target = aurApp->GetTarget();
2935
2936 if (!target->IsPlayer())
2937 return;
2938
2939 if (Player* targetPlayer = target->ToPlayer())
2940 {
2941 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
2942 }
2943
2944 if (apply)
2945 {
2946 /*
2947 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
2948 data<<target->GetGUID();
2949 data<<uint8(0);
2950 target->SendMessageToSet(&data, true);
2951 */
2952
2953 UnitList targets;
2954 Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
2956 Cell::VisitObjects(target, searcher, target->GetMap()->GetVisibilityRange());
2957 for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
2958 {
2959 if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
2960 continue;
2961
2963 {
2964 if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
2965 {
2966 SpellInfo const* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
2967 if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->IsCreature())
2968 {
2969 Creature* c = (*iter)->ToCreature();
2970 if ((!c->IsPet() && c->GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS) || c->isWorldBoss() || c->IsDungeonBoss())
2971 continue;
2972 }
2973 bool interrupt = false; // pussywizard: skip spells that don't target units, but casted on unit (eg. TARGET_DEST_TARGET_ENEMY)
2974 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
2975 if (si->Effects[j].Effect && (si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT || si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT_AND_DEST))
2976 {
2977 // at least one effect truly targets an unit, interrupt the spell
2978 interrupt = true;
2979 break;
2980 }
2981 if (interrupt)
2982 (*iter)->InterruptSpell(CurrentSpellTypes(i), false);
2983 }
2984 }
2985 }
2986
2987 for (auto& pair : target->GetThreatMgr().GetThreatenedByMeList())
2988 pair.second->ScaleThreat(0.0f);
2989
2990 if (target->GetMap()->IsDungeon()) // feign death does not remove combat in dungeons
2991 {
2992 target->AttackStop();
2993 if (Player* targetPlayer = target->ToPlayer())
2994 targetPlayer->SendAttackSwingCancelAttack();
2995 }
2996 else
2997 target->CombatStop(false, false);
2998
3000
3001 // prevent interrupt message
3002 if (GetCasterGUID() == target->GetGUID())
3003 {
3005 target->FinishSpell(CURRENT_GENERIC_SPELL, true);
3006
3007 // interrupt autoshot
3009 {
3011 target->ToPlayer()->SendAutoRepeatCancel(target);
3012 }
3013 }
3014
3015 target->InterruptNonMeleeSpells(true);
3016
3017 // stop handling the effect if it was removed by linked event
3018 if (aurApp->GetRemoveMode())
3019 return;
3020 // blizz like 2.0.x
3022 // blizz like 2.0.x
3024 // blizz like 2.0.x
3026
3028 }
3029 else
3030 {
3031 /*
3032 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
3033 data<<target->GetGUID();
3034 data<<uint8(1);
3035 target->SendMessageToSet(&data, true);
3036 */
3037 // blizz like 2.0.x
3039 // blizz like 2.0.x
3041 // blizz like 2.0.x
3043
3045 }
3046}
@ UNIT_DYNFLAG_DEAD
Definition SharedDefines.h:3359
@ CREATURE_ELITE_WORLDBOSS
Definition SharedDefines.h:2967
@ SPELL_ATTR6_IGNORE_PHASE_SHIFT
Definition SharedDefines.h:605
@ TARGET_OBJECT_TYPE_UNIT
Definition SpellInfo.h:102
@ TARGET_OBJECT_TYPE_UNIT_AND_DEST
Definition SpellInfo.h:103
@ UNIT_FLAG2_FEIGN_DEATH
Definition UnitDefines.h:296
@ UNIT_STATE_DIED
Definition UnitDefines.h:173
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition UnitDefines.h:286
#define CURRENT_FIRST_NON_MELEE_SPELL
Definition Unit.h:561
@ CURRENT_GENERIC_SPELL
Definition Unit.h:556
@ CURRENT_AUTOREPEAT_SPELL
Definition Unit.h:558
std::list< Unit * > UnitList
Definition Unit.h:77
Definition GridNotifiers.h:852
Definition Creature.h:47
bool IsDungeonBoss() const
Definition Creature.cpp:3280
bool isWorldBoss() const
Definition Creature.h:124
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:207
bool IsDungeon() const
Definition Map.h:297
float GetVisibilityRange() const
Definition Map.h:198
void SendAutoRepeatCancel(Unit *target)
Definition PlayerMisc.cpp:153
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4316
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition Unit.cpp:4274
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7486
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7453
float GetVisibilityRange() const
Definition Object.cpp:1701
Definition GridNotifiers.h:414
uint32 rank
Definition CreatureData.h:206

References Unit::AddUnitState(), Unit::AttackStop(), AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, Unit::ClearUnitState(), Unit::CombatStop(), CREATURE_ELITE_WORLDBOSS, CURRENT_AUTOREPEAT_SPELL, CURRENT_FIRST_NON_MELEE_SPELL, CURRENT_GENERIC_SPELL, CURRENT_MAX_SPELL, SpellInfo::Effects, Unit::FinishSpell(), GetCasterGUID(), Creature::GetCreatureTemplate(), Unit::GetCurrentSpell(), Object::GetGUID(), WorldObject::GetMap(), AuraApplication::GetRemoveMode(), AuraApplication::GetTarget(), ThreatManager::GetThreatenedByMeList(), Unit::GetThreatMgr(), WorldObject::GetVisibilityRange(), Map::GetVisibilityRange(), SpellInfo::HasAttribute(), Unit::InterruptNonMeleeSpells(), Unit::InterruptSpell(), Map::IsDungeon(), Creature::IsDungeonBoss(), Unit::IsPet(), Object::IsPlayer(), Creature::isWorldBoss(), MAX_SPELL_EFFECTS, CreatureTemplate::rank, Unit::RemoveAurasWithInterruptFlags(), Object::RemoveDynamicFlag(), Unit::RemoveUnitFlag(), Unit::RemoveUnitFlag2(), Player::SendAutoRepeatCancel(), Object::SetDynamicFlag(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), SPELL_ATTR6_IGNORE_PHASE_SHIFT, sScriptMgr, TARGET_OBJECT_TYPE_UNIT, TARGET_OBJECT_TYPE_UNIT_AND_DEST, Object::ToCreature(), Object::ToPlayer(), UNIT_DYNFLAG_DEAD, UNIT_FLAG2_FEIGN_DEATH, UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT, UNIT_STATE_CASTING, UNIT_STATE_DIED, and Cell::VisitObjects().

◆ HandleForceMoveForward()

void AuraEffect::HandleForceMoveForward ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3531{
3533 return;
3534
3535 Unit* target = aurApp->GetTarget();
3536
3537 if (apply)
3539 else
3540 {
3541 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3542 if (target->HasAuraType(GetAuraType()))
3543 return;
3545 }
3546}
@ UNIT_FLAG2_FORCE_MOVEMENT
Definition UnitDefines.h:302

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::RemoveUnitFlag2(), Unit::SetUnitFlag2(), and UNIT_FLAG2_FORCE_MOVEMENT.

◆ HandleForceReaction()

void AuraEffect::HandleForceReaction ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5685{
5687 return;
5688
5689 Unit* target = aurApp->GetTarget();
5690
5691 if (!target->IsPlayer())
5692 return;
5693
5694 Player* player = target->ToPlayer();
5695
5696 uint32 faction_id = GetMiscValue();
5697 ReputationRank faction_rank = ReputationRank(m_amount);
5698
5699 player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply);
5701
5702 // stop fighting if at apply forced rank friendly or at remove real rank friendly
5703 if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
5704 player->StopAttackFaction(faction_id);
5705}
ReputationRank
Definition SharedDefines.h:156
@ REP_FRIENDLY
Definition SharedDefines.h:161
ReputationRank GetReputationRank(uint32 faction_id) const
Definition Player.cpp:5850
ReputationMgr & GetReputationMgr()
Definition Player.h:2144
void ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply)
Definition ReputationMgr.cpp:137
void SendForceReactions()
Definition ReputationMgr.cpp:165
void StopAttackFaction(uint32 faction_id)
Definition Unit.cpp:16080

References ReputationMgr::ApplyForceReaction(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetMiscValue(), Player::GetReputationMgr(), Player::GetReputationRank(), AuraApplication::GetTarget(), Object::IsPlayer(), m_amount, REP_FRIENDLY, ReputationMgr::SendForceReactions(), Unit::StopAttackFaction(), and Object::ToPlayer().

◆ HandleModAttackSpeed()

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

◆ HandleModBaseResistance()

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

◆ HandleModCastingSpeed()

void AuraEffect::HandleModCastingSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4734{
4736 return;
4737
4738 Unit* target = aurApp->GetTarget();
4739
4740 // Xinef: Do not apply such auras in normal way
4741 if (GetAmount() >= 1000)
4742 {
4743 target->SetInstantCast(apply);
4744 return;
4745 }
4746
4747 int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, GetAuraType());
4748 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4749 return;
4750
4751 if (spellGroupVal)
4752 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
4753
4754 target->ApplyCastTimePercentMod((float)GetAmount(), apply);
4755}
void SetInstantCast(bool set)
Definition Unit.h:1586
void ApplyCastTimePercentMod(float val, bool apply)
Definition Unit.cpp:13465

References Unit::ApplyCastTimePercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetAuraType(), Unit::GetHighestExclusiveSameEffectSpellGroupValue(), AuraApplication::GetTarget(), and Unit::SetInstantCast().

◆ HandleModCharm()

void AuraEffect::HandleModCharm ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3745{
3746 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3747 return;
3748
3749 Unit* target = aurApp->GetTarget();
3750
3751 Unit* caster = GetCaster();
3752
3753 if (apply)
3754 target->SetCharmedBy(caster, CHARM_TYPE_CHARM, aurApp);
3755 else
3756 target->RemoveCharmedBy(caster);
3757}
@ CHARM_TYPE_CHARM
Definition CharmInfo.h:45

References AURA_EFFECT_HANDLE_REAL, CHARM_TYPE_CHARM, GetCaster(), AuraApplication::GetTarget(), Unit::RemoveCharmedBy(), and Unit::SetCharmedBy().

Referenced by HandleModPossess().

◆ HandleModCombatSpeedPct()

void AuraEffect::HandleModCombatSpeedPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4770{
4772 return;
4773
4774 Unit* target = aurApp->GetTarget();
4776 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4777 return;
4778
4779 if (spellGroupVal)
4780 {
4781 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
4782 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
4783 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
4784 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(spellGroupVal), !apply);
4785 }
4786
4787 target->ApplyCastTimePercentMod(float(GetAmount()), apply);
4788 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
4789 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
4790 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(GetAmount()), apply);
4791}
@ SPELL_AURA_MELEE_SLOW
Definition SpellAuraDefines.h:256

References Unit::ApplyAttackTimePercentMod(), Unit::ApplyCastTimePercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_ATTACK, GetAmount(), Unit::GetHighestExclusiveSameEffectSpellGroupValue(), AuraApplication::GetTarget(), OFF_ATTACK, RANGED_ATTACK, and SPELL_AURA_MELEE_SLOW.

◆ HandleModConfuse()

void AuraEffect::HandleModConfuse ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3608{
3609 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3610 return;
3611
3612 Unit* target = aurApp->GetTarget();
3613
3614 target->SetControlled(apply, UNIT_STATE_CONFUSED);
3615 if (apply)
3616 target->GetThreatMgr().EvaluateSuppressed();
3617}
@ UNIT_STATE_CONFUSED
Definition UnitDefines.h:184

References AURA_EFFECT_HANDLE_REAL, ThreatManager::EvaluateSuppressed(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), Unit::SetControlled(), and UNIT_STATE_CONFUSED.

◆ HandleModDamageDone()

void AuraEffect::HandleModDamageDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4977{
4979 return;
4980
4981 Unit* target = aurApp->GetTarget();
4982
4984 target->UpdateAllDamageDoneMods();
4985
4986 // Magic damage modifiers implemented in Unit::SpellBaseDamageBonus
4987 // This information for client side use only
4988 if (target->IsPlayer())
4989 {
4991 for (uint16 i = 0; i < MAX_SPELL_SCHOOL; ++i)
4992 if (GetMiscValue() & (1 << i))
4993 target->ApplyModInt32Value(baseField + i, GetAmount(), apply);
4994
4995 if (Guardian* pet = target->ToPlayer()->GetGuardianPet())
4996 pet->UpdateAttackPowerAndDamage();
4997 }
4998}
@ PLAYER_FIELD_MOD_DAMAGE_DONE_POS
Definition UpdateFields.h:360
@ PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
Definition UpdateFields.h:361
Definition TemporarySummon.h:106
void UpdateAllDamageDoneMods()
Definition Unit.cpp:12122

References Object::ApplyModInt32Value(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), Unit::GetGuardianPet(), GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), MAX_SPELL_SCHOOL, PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, PLAYER_FIELD_MOD_DAMAGE_DONE_POS, SPELL_SCHOOL_MASK_NORMAL, Object::ToPlayer(), and Unit::UpdateAllDamageDoneMods().

◆ HandleModDamagePercentDone()

void AuraEffect::HandleModDamagePercentDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5001{
5003 return;
5004
5005 Unit* target = aurApp->GetTarget();
5006 if (!target)
5007 return;
5008
5011
5012 if (target->IsPlayer())
5013 {
5014 for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
5015 {
5016 if (GetMiscValue() & (1 << i))
5017 {
5018 // only aura type modifying PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
5021 }
5022 }
5023 }
5024}
@ PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
Definition UpdateFields.h:362
void SetFloatValue(uint16 index, float value)
Definition Object.cpp:726
void UpdateAllDamagePctDoneMods()
Definition Unit.cpp:12166

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplierByMiscMask(), Object::IsPlayer(), MAX_SPELL_SCHOOL, PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, Object::SetFloatValue(), SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, SPELL_SCHOOL_MASK_NORMAL, and Unit::UpdateAllDamagePctDoneMods().

◆ HandleModDetaunt()

void AuraEffect::HandleModDetaunt ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3590{
3591 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3592 return;
3593
3594 Unit* caster = GetCaster();
3595 Unit* target = aurApp->GetTarget();
3596
3597 if (!caster || !caster->IsAlive() || !target->IsAlive() || !caster->CanHaveThreatList())
3598 return;
3599
3600 caster->GetThreatMgr().TauntUpdate();
3601}
void TauntUpdate()
Definition ThreatManager.cpp:522

References AURA_EFFECT_HANDLE_REAL, Unit::CanHaveThreatList(), GetCaster(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), Unit::IsAlive(), and ThreatManager::TauntUpdate().

◆ HandleModFear()

void AuraEffect::HandleModFear ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3620{
3621 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3622 return;
3623
3624 Unit* target = aurApp->GetTarget();
3625
3626 target->SetControlled(apply, UNIT_STATE_FLEEING, GetCaster(), true);
3627}
@ UNIT_STATE_FLEEING
Definition UnitDefines.h:180

References AURA_EFFECT_HANDLE_REAL, GetCaster(), AuraApplication::GetTarget(), Unit::SetControlled(), and UNIT_STATE_FLEEING.

◆ HandleModHealingDone()

void AuraEffect::HandleModHealingDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4321{
4323 return;
4324
4325 Unit* target = aurApp->GetTarget();
4326
4327 if (!target->IsPlayer())
4328 return;
4329 // implemented in Unit::SpellHealingBonus
4330 // this information is for client side only
4332}
void UpdateSpellDamageAndHealingBonus()
Definition StatSystem.cpp:194

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateSpellDamageAndHealingBonus().

◆ HandleModHitChance()

void AuraEffect::HandleModHitChance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4651{
4653 return;
4654
4655 Unit* target = aurApp->GetTarget();
4656
4657 if (target->IsPlayer())
4658 {
4659 target->ToPlayer()->UpdateMeleeHitChances();
4660 target->ToPlayer()->UpdateRangedHitChances();
4661 }
4662 else
4663 {
4664 target->m_modMeleeHitChance += (apply) ? GetAmount() : (-GetAmount());
4665 target->m_modRangedHitChance += (apply) ? GetAmount() : (-GetAmount());
4666 }
4667}
void UpdateMeleeHitChances()
Definition StatSystem.cpp:871
void UpdateRangedHitChances()
Definition StatSystem.cpp:877
float m_modRangedHitChance
Definition Unit.h:2083
float m_modMeleeHitChance
Definition Unit.h:2082

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Object::IsPlayer(), Unit::m_modMeleeHitChance, Unit::m_modRangedHitChance, Object::ToPlayer(), Player::UpdateMeleeHitChances(), and Player::UpdateRangedHitChances().

◆ HandleModInvisibility()

void AuraEffect::HandleModInvisibility ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1672{
1674 return;
1675
1676 Unit* target = aurApp->GetTarget();
1678
1679 if (apply)
1680 {
1681 // apply glow vision
1682 if (target->IsPlayer() && (type == INVISIBILITY_GENERAL || type == INVISIBILITY_UNK10))
1684
1685 target->m_invisibility.AddFlag(type);
1686 target->m_invisibility.AddValue(type, GetAmount());
1687 }
1688 else
1689 {
1690 if (!target->HasInvisibilityAura())
1691 {
1692 // if not have different invisibility auras.
1693 // always remove glow vision
1694 if (target->IsPlayer())
1696
1697 target->m_invisibility.DelFlag(type);
1698 }
1699 else
1700 {
1701 bool found = false;
1703 for (Unit::AuraEffectList::const_iterator i = invisAuras.begin(); i != invisAuras.end(); ++i)
1704 {
1705 if (GetMiscValue() == (*i)->GetMiscValue())
1706 {
1707 found = true;
1708 break;
1709 }
1710 }
1711 if (!found)
1712 {
1713 target->m_invisibility.DelFlag(type);
1714
1715 // if not have invisibility auras of type INVISIBILITY_GENERAL
1716 // remove glow vision
1718 {
1720 }
1721 }
1722 }
1723
1724 target->m_invisibility.AddValue(type, -GetAmount());
1725 }
1726
1727 // call functions which may have additional effects after chainging state of unit
1728 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1729 {
1730 // drop flag at invisibiliy in bg
1732 }
1733
1734 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
1735 target->bRequestForcedVisibilityUpdate = false;
1736}
@ PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW
Definition Player.h:554
@ PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION
Definition Player.h:531
InvisibilityType
Definition SharedDefines.h:1242
@ INVISIBILITY_UNK10
Definition SharedDefines.h:1253
@ INVISIBILITY_GENERAL
Definition SharedDefines.h:1243
@ SPELL_AURA_MOD_INVISIBILITY
Definition SpellAuraDefines.h:81
bool HasFlag(FLAG_TYPE flag) const
Definition Object.h:393
void AddFlag(FLAG_TYPE flag)
Definition Object.h:394
void DelFlag(FLAG_TYPE flag)
Definition Object.h:395
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:399
bool Instanceable() const
Definition Map.h:296
bool IsPlayer() const
Definition ObjectGuid.h:168
bool bRequestForcedVisibilityUpdate
Definition Unit.h:2112
ObjectGuid GetOwnerGUID() const
Definition Unit.h:713
bool HasInvisibilityAura() const
Definition Unit.h:1844
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition Object.h:614

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, Unit::bRequestForcedVisibilityUpdate, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::DelFlag(), GetAmount(), Unit::GetAuraEffectsByType(), WorldObject::GetMap(), GetMiscValue(), Unit::GetOwnerGUID(), AuraApplication::GetTarget(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::HasFlag(), Unit::HasInvisibilityAura(), Map::Instanceable(), INVISIBILITY_GENERAL, INVISIBILITY_UNK10, Object::IsPlayer(), ObjectGuid::IsPlayer(), WorldObject::m_invisibility, PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW, PLAYER_FIELD_BYTES2, PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION, Unit::RemoveAurasWithInterruptFlags(), Object::RemoveByteFlag(), Object::SetByteFlag(), SPELL_AURA_MOD_INVISIBILITY, and Unit::UpdateObjectVisibility().

◆ HandleModInvisibilityDetect()

void AuraEffect::HandleModInvisibilityDetect ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1647{
1649 return;
1650
1651 Unit* target = aurApp->GetTarget();
1653
1654 if (apply)
1655 {
1656 target->m_invisibilityDetect.AddFlag(type);
1657 target->m_invisibilityDetect.AddValue(type, GetAmount());
1658 }
1659 else
1660 {
1661 if (!target->HasInvisibilityDetectAura())
1662 target->m_invisibilityDetect.DelFlag(type);
1663
1664 target->m_invisibilityDetect.AddValue(type, -GetAmount());
1665 }
1666
1667 // call functions which may have additional effects after chainging state of unit
1668 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1669}
bool HasInvisibilityDetectAura() const
Definition Unit.h:1845
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition Object.h:615

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::DelFlag(), GetAmount(), GetMiscValue(), Unit::GetOwnerGUID(), AuraApplication::GetTarget(), Unit::HasInvisibilityDetectAura(), Object::IsPlayer(), ObjectGuid::IsPlayer(), WorldObject::m_invisibilityDetect, and Unit::UpdateObjectVisibility().

◆ HandleModManaRegen()

void AuraEffect::HandleModManaRegen ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4439{
4441 return;
4442
4443 Unit* target = aurApp->GetTarget();
4444
4445 if (!target->IsPlayer())
4446 return;
4447
4448 //Note: an increase in regen does NOT cause threat.
4449 target->ToPlayer()->UpdateManaRegen();
4450}
void UpdateManaRegen()
Definition StatSystem.cpp:939

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateManaRegen().

Referenced by HandleAuraModRegenInterrupt().

◆ HandleModMechanicImmunity()

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

◆ HandleModMeleeRangedSpeedPct()

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

◆ HandleModMeleeSpeedPct()

void AuraEffect::HandleModMeleeSpeedPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4805{
4807 return;
4808
4809 Unit* target = aurApp->GetTarget();
4811 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4812 return;
4813
4814 if (spellGroupVal)
4815 {
4816 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
4817 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
4818 }
4819 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
4820 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
4821}
@ SPELL_AURA_MOD_MELEE_HASTE
Definition SpellAuraDefines.h:201

References Unit::ApplyAttackTimePercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_ATTACK, GetAmount(), Unit::GetHighestExclusiveSameEffectSpellGroupValue(), AuraApplication::GetTarget(), OFF_ATTACK, and SPELL_AURA_MOD_MELEE_HASTE.

◆ HandleModOffhandDamagePercent()

void AuraEffect::HandleModOffhandDamagePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5027{
5029 return;
5030
5031 Unit* target = aurApp->GetTarget();
5032
5033 // also handles spell group stacks
5035}
void UpdateDamagePctDoneMods(WeaponAttackType attackType)
Definition Unit.cpp:12128

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), OFF_ATTACK, and Unit::UpdateDamagePctDoneMods().

◆ HandleModPercentStat()

void AuraEffect::HandleModPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4229{
4231 return;
4232
4233 Unit* target = aurApp->GetTarget();
4234
4235 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4236 {
4237 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4238 return;
4239 }
4240
4241 // only players currently use base stats
4242 if (!target->IsPlayer())
4243 return;
4244
4245 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
4246 {
4247 if (apply)
4249 else
4250 {
4251 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_PERCENT_STAT, [i](AuraEffect const* aurEff)
4252 {
4253 return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
4254 });
4256 }
4257 }
4258}
@ SPELL_AURA_MOD_PERCENT_STAT
Definition SpellAuraDefines.h:143

References Unit::ApplyStatPctModifier(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Object::IsPlayer(), LOG_ERROR, MAX_STATS, Unit::SetStatPctModifier(), SPELL_AURA_MOD_PERCENT_STAT, STAT_STRENGTH, and UNIT_MOD_STAT_START.

◆ HandleModPossess()

void AuraEffect::HandleModPossess ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3670{
3671 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3672 return;
3673
3674 Unit* target = aurApp->GetTarget();
3675
3676 Unit* caster = GetCaster();
3677
3678 // no support for posession AI yet
3679 if (caster && caster->IsCreature())
3680 {
3681 HandleModCharm(aurApp, mode, apply);
3682 return;
3683 }
3684
3685 if (apply)
3686 target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3687 else
3688 target->RemoveCharmedBy(caster);
3689}
@ CHARM_TYPE_POSSESS
Definition CharmInfo.h:46
void HandleModCharm(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3744

References AURA_EFFECT_HANDLE_REAL, CHARM_TYPE_POSSESS, GetCaster(), AuraApplication::GetTarget(), HandleModCharm(), Object::IsCreature(), Unit::RemoveCharmedBy(), and Unit::SetCharmedBy().

◆ HandleModPossessPet()

void AuraEffect::HandleModPossessPet ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3692{
3693 // Used by spell "Eyes of the Beast"
3694
3695 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3696 return;
3697
3698 Unit* caster = GetCaster();
3699 if (!caster || !caster->IsPlayer())
3700 return;
3701
3702 //seems it may happen that when removing it is no longer owner's pet
3703 //if (caster->ToPlayer()->GetPet() != target)
3704 // return;
3705
3706 Unit* target = aurApp->GetTarget();
3707 if (!target->IsCreature() || !target->IsPet())
3708 return;
3709
3710 Pet* pet = target->ToPet();
3711
3712 if (apply)
3713 {
3714 if (caster->ToPlayer()->GetPet() != pet)
3715 return;
3716
3717 // Must clear current motion or pet leashes back to owner after a few yards
3718 // when under spell 'Eyes of the Beast'
3719 pet->GetMotionMaster()->Clear();
3720 pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3721 }
3722 else
3723 {
3724 pet->RemoveCharmedBy(caster);
3725
3726 if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
3727 pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
3728 else
3729 {
3730 // Reinitialize the pet bar or it will appear greyed out
3731 caster->ToPlayer()->PetSpellInitialize();
3732
3733 // Follow owner only if not fighting or owner didn't click "stay" at new location
3734 // This may be confusing because pet bar shows "stay" when under the spell but it retains
3735 // the "follow" flag. Player MUST click "stay" while under the spell.
3736 if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
3737 {
3739 }
3740 }
3741 }
3742}
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:46
constexpr float PET_FOLLOW_DIST
Definition PetDefines.h:206
@ COMMAND_STAY
Definition Unit.h:573
float GetFollowAngle() const override
Definition TemporarySummon.h:93
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true, bool inheritSpeed=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:447
void Clear(bool reset=true)
Definition MotionMaster.h:193
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition Pet.cpp:881
void PetSpellInitialize()
Definition Player.cpp:9502
Pet * ToPet()
Definition Unit.h:729
CharmInfo * GetCharmInfo()
Definition Unit.h:1281
Unit * GetVictim() const
Definition Unit.h:903
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1377
bool HasCommandState(CommandStates state) const
Definition CharmInfo.h:137

References AURA_EFFECT_HANDLE_REAL, CHARM_TYPE_POSSESS, MotionMaster::Clear(), COMMAND_STAY, GetCaster(), Unit::GetCharmInfo(), Minion::GetFollowAngle(), WorldObject::GetMap(), Unit::GetMotionMaster(), Player::GetPet(), AuraApplication::GetTarget(), Unit::GetVictim(), Map::GetVisibilityRange(), CharmInfo::HasCommandState(), Object::IsCreature(), Unit::IsPet(), Object::IsPlayer(), WorldObject::IsWithinDistInMap(), MotionMaster::MoveFollow(), PET_FOLLOW_DIST, PET_SAVE_NOT_IN_SLOT, Player::PetSpellInitialize(), Pet::Remove(), Unit::RemoveCharmedBy(), Unit::SetCharmedBy(), Unit::ToPet(), and Object::ToPlayer().

◆ HandleModPowerCost()

void AuraEffect::HandleModPowerCost ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5085{
5087 return;
5088
5089 Unit* target = aurApp->GetTarget();
5090
5091 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5092 if (GetMiscValue() & (1 << i))
5094}
@ UNIT_FIELD_POWER_COST_MODIFIER
Definition UpdateFields.h:170

References Object::ApplyModInt32Value(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), MAX_SPELL_SCHOOL, and UNIT_FIELD_POWER_COST_MODIFIER.

◆ HandleModPowerCostPCT()

void AuraEffect::HandleModPowerCostPCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5072{
5074 return;
5075
5076 Unit* target = aurApp->GetTarget();
5077
5078 float amount = CalculatePct(1.0f, GetAmount());
5079 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5080 if (GetMiscValue() & (1 << i))
5082}
@ UNIT_FIELD_POWER_COST_MULTIPLIER
Definition UpdateFields.h:171
void ApplyModSignedFloatValue(uint16 index, float val, bool apply)
Definition Object.cpp:811

References Object::ApplyModSignedFloatValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, CalculatePct(), GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), MAX_SPELL_SCHOOL, and UNIT_FIELD_POWER_COST_MULTIPLIER.

◆ HandleModPowerRegen()

void AuraEffect::HandleModPowerRegen ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4414{
4416 return;
4417
4418 Unit* target = aurApp->GetTarget();
4419
4420 if (!target->IsPlayer())
4421 return;
4422
4423 // Update manaregen value
4424 if (GetMiscValue() == POWER_MANA)
4425 target->ToPlayer()->UpdateManaRegen();
4426 else if (GetMiscValue() == POWER_ENERGY)
4427 target->ToPlayer()->UpdateEnergyRegen();
4428 else if (GetMiscValue() == POWER_RUNE)
4430 // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate
4431}
@ POWER_RUNE
Definition SharedDefines.h:262
void UpdateRuneRegen(RuneType rune)
Definition StatSystem.cpp:983
void UpdateEnergyRegen()
Definition StatSystem.cpp:973

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), GetMiscValueB(), AuraApplication::GetTarget(), Object::IsPlayer(), POWER_ENERGY, POWER_MANA, POWER_RUNE, Object::ToPlayer(), Player::UpdateEnergyRegen(), Player::UpdateManaRegen(), and Player::UpdateRuneRegen().

Referenced by HandleModPowerRegenPCT().

◆ HandleModPowerRegenPCT()

void AuraEffect::HandleModPowerRegenPCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4434{
4435 HandleModPowerRegen(aurApp, mode, apply);
4436}
void HandleModPowerRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4413

References HandleModPowerRegen().

◆ HandleModRating()

void AuraEffect::HandleModRating ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4851{
4853 return;
4854
4855 Unit* target = aurApp->GetTarget();
4856
4857 if (!target->IsPlayer())
4858 return;
4859
4860 for (uint8 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
4861 if (GetMiscValue() & (1 << rating))
4862 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), GetAmount(), apply);
4863}
#define MAX_COMBAT_RATING
Definition Unit.h:250
CombatRating
Definition Unit.h:222
void ApplyRatingMod(CombatRating cr, int32 value, bool apply)
Definition Player.cpp:5245

References Player::ApplyRatingMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), MAX_COMBAT_RATING, and Object::ToPlayer().

◆ HandleModRatingFromStat()

void AuraEffect::HandleModRatingFromStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4866{
4868 return;
4869
4870 Unit* target = aurApp->GetTarget();
4871
4872 if (!target->IsPlayer())
4873 return;
4874
4875 // Just recalculate ratings
4876 for (uint8 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
4877 if (GetMiscValue() & (1 << rating))
4878 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), 0, apply);
4879}

References Player::ApplyRatingMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), MAX_COMBAT_RATING, and Object::ToPlayer().

◆ HandleModResistancePercent()

void AuraEffect::HandleModResistancePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4139{
4141 return;
4142
4143 Unit* target = aurApp->GetTarget();
4144
4145 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
4146 {
4147 if (GetMiscValue() & int32(1 << i))
4148 {
4151 continue;
4152
4154 if (target->IsPlayer() || target->IsPet())
4156 }
4157 }
4158}
@ SPELL_AURA_MOD_RESISTANCE_PCT
Definition SpellAuraDefines.h:164
float GetPctModifierValue(UnitMods unitMod, UnitModifierPctType modifierType) const
Definition Unit.cpp:12018

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), Unit::GetPctModifierValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplierByMiscMask(), Unit::IsPet(), Object::IsPlayer(), MAX_SPELL_SCHOOL, Unit::SetStatPctModifier(), SPELL_AURA_MOD_RESISTANCE_PCT, SPELL_SCHOOL_NORMAL, TOTAL_PCT, UNIT_MOD_RESISTANCE_START, and Unit::UpdateResistanceBuffModsMod().

◆ HandleModSpellCritChance()

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

◆ HandleModSpellCritChanceShool()

void AuraEffect::HandleModSpellCritChanceShool ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4696{
4698 return;
4699
4700 Unit* target = aurApp->GetTarget();
4701
4702 if (!target->IsPlayer())
4703 return;
4704
4705 for (int school = SPELL_SCHOOL_NORMAL; school < MAX_SPELL_SCHOOL; ++school)
4706 if (GetMiscValue() & (1 << school))
4707 target->ToPlayer()->UpdateSpellCritChance(school);
4708}
void UpdateSpellCritChance(uint32 school)
Definition StatSystem.cpp:840

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), MAX_SPELL_SCHOOL, SPELL_SCHOOL_NORMAL, Object::ToPlayer(), and Player::UpdateSpellCritChance().

◆ HandleModSpellDamagePercentFromAttackPower()

void AuraEffect::HandleModSpellDamagePercentFromAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4291{
4293 return;
4294
4295 Unit* target = aurApp->GetTarget();
4296
4297 if (!target->IsPlayer())
4298 return;
4299
4300 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4301 // This information for client side use only
4302 // Recalculate bonus
4304}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateSpellDamageAndHealingBonus().

◆ HandleModSpellDamagePercentFromStat()

void AuraEffect::HandleModSpellDamagePercentFromStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4261{
4263 return;
4264
4265 Unit* target = aurApp->GetTarget();
4266
4267 if (!target->IsPlayer())
4268 return;
4269
4270 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4271 // This information for client side use only
4272 // Recalculate bonus
4274}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateSpellDamageAndHealingBonus().

◆ HandleModSpellHealingPercentFromAttackPower()

void AuraEffect::HandleModSpellHealingPercentFromAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4307{
4309 return;
4310
4311 Unit* target = aurApp->GetTarget();
4312
4313 if (!target->IsPlayer())
4314 return;
4315
4316 // Recalculate bonus
4318}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateSpellDamageAndHealingBonus().

◆ HandleModSpellHealingPercentFromStat()

void AuraEffect::HandleModSpellHealingPercentFromStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4277{
4279 return;
4280
4281 Unit* target = aurApp->GetTarget();
4282
4283 if (!target->IsPlayer())
4284 return;
4285
4286 // Recalculate bonus
4288}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateSpellDamageAndHealingBonus().

◆ HandleModSpellHitChance()

void AuraEffect::HandleModSpellHitChance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4670{
4672 return;
4673
4674 Unit* target = aurApp->GetTarget();
4675
4676 if (target->IsPlayer())
4677 target->ToPlayer()->UpdateSpellHitChances();
4678 else
4679 target->m_modSpellHitChance += (apply) ? GetAmount() : (-GetAmount());
4680}
void UpdateSpellHitChances()
Definition StatSystem.cpp:883
float m_modSpellHitChance
Definition Unit.h:2084

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Object::IsPlayer(), Unit::m_modSpellHitChance, Object::ToPlayer(), and Player::UpdateSpellHitChances().

◆ HandleModStateImmunityMask()

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

◆ HandleModStealth()

void AuraEffect::HandleModStealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1764{
1766 return;
1767
1768 Unit* target = aurApp->GetTarget();
1770
1771 if (apply)
1772 {
1773 target->m_stealth.AddFlag(type);
1774 target->m_stealth.AddValue(type, GetAmount());
1775
1777 if (target->IsPlayer())
1779
1780 // interrupt autoshot
1782 {
1784 target->ToPlayer()->SendAutoRepeatCancel(target);
1785 }
1786 }
1787 else
1788 {
1789 target->m_stealth.AddValue(type, -GetAmount());
1790
1791 if (!target->HasStealthAura()) // if last SPELL_AURA_MOD_STEALTH
1792 {
1793 target->m_stealth.DelFlag(type);
1794
1796 if (target->IsPlayer())
1798 }
1799 }
1800
1801 // call functions which may have additional effects after chainging state of unit
1802 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1803 {
1804 // drop flag at stealth in bg
1806 }
1807
1808 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
1809 target->bRequestForcedVisibilityUpdate = false;
1810}
@ PLAYER_FIELD_BYTE2_STEALTH
Definition Player.h:553
StealthType
Definition SharedDefines.h:1234
@ UNIT_STAND_FLAGS_CREEP
Definition UnitDefines.h:51
bool HasStealthAura() const
Definition Unit.h:1842
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1788
void SetStandFlags(uint8 flags)
Definition Unit.h:1787
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:611

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, Unit::bRequestForcedVisibilityUpdate, CURRENT_AUTOREPEAT_SPELL, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::DelFlag(), Unit::FinishSpell(), GetAmount(), Unit::GetCurrentSpell(), WorldObject::GetMap(), GetMiscValue(), Unit::GetOwnerGUID(), AuraApplication::GetTarget(), Unit::HasStealthAura(), Map::Instanceable(), Object::IsPlayer(), ObjectGuid::IsPlayer(), WorldObject::m_stealth, PLAYER_FIELD_BYTE2_STEALTH, PLAYER_FIELD_BYTES2, Unit::RemoveAurasWithInterruptFlags(), Object::RemoveByteFlag(), Unit::RemoveStandFlags(), Player::SendAutoRepeatCancel(), Object::SetByteFlag(), Unit::SetStandFlags(), Object::ToPlayer(), UNIT_STAND_FLAGS_CREEP, and Unit::UpdateObjectVisibility().

◆ HandleModStealthDetect()

void AuraEffect::HandleModStealthDetect ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1739{
1741 return;
1742
1743 Unit* target = aurApp->GetTarget();
1745
1746 if (apply)
1747 {
1748 target->m_stealthDetect.AddFlag(type);
1749 target->m_stealthDetect.AddValue(type, GetAmount());
1750 }
1751 else
1752 {
1753 if (!target->HasStealthDetectAura())
1754 target->m_stealthDetect.DelFlag(type);
1755
1756 target->m_stealthDetect.AddValue(type, -GetAmount());
1757 }
1758
1759 // call functions which may have additional effects after chainging state of unit
1760 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1761}
bool HasStealthDetectAura() const
Definition Unit.h:1843
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition Object.h:612

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::DelFlag(), GetAmount(), GetMiscValue(), Unit::GetOwnerGUID(), AuraApplication::GetTarget(), Unit::HasStealthDetectAura(), Object::IsPlayer(), ObjectGuid::IsPlayer(), WorldObject::m_stealthDetect, and Unit::UpdateObjectVisibility().

◆ HandleModStealthLevel()

void AuraEffect::HandleModStealthLevel ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1813{
1815 return;
1816
1817 Unit* target = aurApp->GetTarget();
1819
1820 if (apply)
1821 target->m_stealth.AddValue(type, GetAmount());
1822 else
1823 target->m_stealth.AddValue(type, -GetAmount());
1824
1825 // call functions which may have additional effects after chainging state of unit
1826 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1827}

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::AddValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), GetMiscValue(), Unit::GetOwnerGUID(), AuraApplication::GetTarget(), Object::IsPlayer(), ObjectGuid::IsPlayer(), WorldObject::m_stealth, and Unit::UpdateObjectVisibility().

◆ HandleModTargetResistance()

void AuraEffect::HandleModTargetResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4176{
4178 return;
4179
4180 Unit* target = aurApp->GetTarget();
4181
4182 // applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
4183
4184 // show armor penetration
4185 if (target->IsPlayer() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
4187
4188 // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
4191}
@ SPELL_SCHOOL_MASK_SPELL
Definition SharedDefines.h:296
@ PLAYER_FIELD_MOD_TARGET_RESISTANCE
Definition UpdateFields.h:366
@ PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE
Definition UpdateFields.h:367

References Object::ApplyModInt32Value(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Object::IsPlayer(), PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE, PLAYER_FIELD_MOD_TARGET_RESISTANCE, SPELL_SCHOOL_MASK_NORMAL, and SPELL_SCHOOL_MASK_SPELL.

◆ HandleModTaunt()

void AuraEffect::HandleModTaunt ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3577{
3578 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3579 return;
3580
3581 Unit* target = aurApp->GetTarget();
3582
3583 if (!target->IsAlive() || !target->CanHaveThreatList())
3584 return;
3585
3586 target->GetThreatMgr().TauntUpdate();
3587}

References AURA_EFFECT_HANDLE_REAL, Unit::CanHaveThreatList(), AuraApplication::GetTarget(), Unit::GetThreatMgr(), Unit::IsAlive(), and ThreatManager::TauntUpdate().

◆ HandleModThreat()

void AuraEffect::HandleModThreat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3553{
3555 return;
3556
3557 Unit* target = aurApp->GetTarget();
3559}
void UpdateMySpellSchoolModifiers()
Definition ThreatManager.cpp:824

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AuraApplication::GetTarget(), Unit::GetThreatMgr(), and ThreatManager::UpdateMySpellSchoolModifiers().

◆ HandleModTotalPercentStat()

void AuraEffect::HandleModTotalPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4335{
4337 return;
4338
4339 Unit* target = aurApp->GetTarget();
4340
4341 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4342 {
4343 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4344 return;
4345 }
4346
4347 // save current health state
4348 float healthPct = target->GetHealthPct();
4349 bool alive = target->IsAlive();
4350
4351 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4352 {
4353 if (GetMiscValue() == i || GetMiscValue() == -1)
4354 {
4355 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, [i](AuraEffect const* aurEff)
4356 {
4357 return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
4358 });
4359
4360 if (target->GetPctModifierValue(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT) == amount)
4361 continue;
4362
4364 if (target->IsPlayer() || target->IsPet())
4365 target->UpdateStatBuffMod(Stats(i));
4366 }
4367 }
4368
4369 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag)
4371 target->SetHealth(std::max<uint32>(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0)));
4372}
@ SPELL_ATTR0_IS_ABILITY
Definition SharedDefines.h:374
@ STAT_STAMINA
Definition SharedDefines.h:248
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
Definition SpellAuraDefines.h:200

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, Unit::GetHealthPct(), Unit::GetMaxHealth(), GetMiscValue(), Unit::GetPctModifierValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), SpellInfo::HasAttribute(), Unit::IsAlive(), Unit::IsPet(), Object::IsPlayer(), LOG_ERROR, m_spellInfo, MAX_STATS, Unit::SetHealth(), Unit::SetStatPctModifier(), SPELL_ATTR0_IS_ABILITY, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, STAT_STAMINA, STAT_STRENGTH, TOTAL_PCT, UNIT_MOD_STAT_START, and Unit::UpdateStatBuffMod().

◆ HandleModUnattackable()

void AuraEffect::HandleModUnattackable ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3049{
3051 return;
3052
3053 Unit* target = aurApp->GetTarget();
3054
3055 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3056 if (!apply && target->HasUnattackableAura())
3057 return;
3058
3060
3061 // call functions which may have additional effects after chainging state of unit
3062 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
3063 {
3064 // xinef: this aura should not stop combat (movie with sindragosa proves that)
3065 //target->CombatStop();
3067 }
3068}
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
bool HasUnattackableAura() const
Definition Unit.h:1834

References Object::ApplyModFlag(), AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, AuraApplication::GetTarget(), Unit::HasUnattackableAura(), Unit::RemoveAurasWithInterruptFlags(), UNIT_FIELD_FLAGS, and UNIT_FLAG_NON_ATTACKABLE.

◆ HandleNoImmediateEffect()

void AuraEffect::HandleNoImmediateEffect ( AuraApplication const *  ,
uint8  ,
bool   
) const
inline
162 {
163 // aura type not have immediate effect at add/remove and handled by ID in other code place
164 }

◆ HandleNoReagentUseAura()

void AuraEffect::HandleNoReagentUseAura ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5115{
5116 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5117 return;
5118
5119 Unit* target = aurApp->GetTarget();
5120
5121 if (!target->IsPlayer())
5122 return;
5123
5124 flag96 mask;
5126 for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
5127 mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
5128
5129 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1, mask[0]);
5130 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 1, mask[1]);
5131 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 2, mask[2]);
5132}
@ SPELL_AURA_NO_REAGENT_USE
Definition SpellAuraDefines.h:319
@ PLAYER_NO_REAGENT_COST_1
Definition UpdateFields.h:387
Definition Util.h:442

References AURA_EFFECT_HANDLE_REAL, Unit::GetAuraEffectsByType(), AuraApplication::GetTarget(), Object::IsPlayer(), PLAYER_NO_REAGENT_COST_1, Unit::SetUInt32Value(), and SPELL_AURA_NO_REAGENT_USE.

◆ HandleNULL()

void AuraEffect::HandleNULL ( AuraApplication const *  ,
uint8  ,
bool   
) const
inline
154 {
155 // not implemented
156 }

◆ HandleObsModPowerAuraTick()

void AuraEffect::HandleObsModPowerAuraTick ( Unit target,
Unit caster 
) const
6779{
6781 if (GetMiscValue() == POWER_ALL)
6782 PowerType = target->getPowerType();
6783 else
6785
6786 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
6787 return;
6788
6789 if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo()))
6790 {
6791 SendTickImmune(target, caster);
6792 return;
6793 }
6794
6795 // don't regen when permanent aura target has full power
6796 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
6797 return;
6798
6799 // ignore negative values (can be result apply spellmods to aura damage
6800 uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(PowerType) / 100;
6801 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
6802 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
6803 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
6804 target->SendPeriodicAuraLog(&pInfo);
6805
6806 int32 gain = target->ModifyPower(PowerType, amount);
6807
6808 if (caster)
6809 target->GetThreatMgr().ForwardThreatForAssistingMe(caster, float(gain) * 0.5f, GetSpellInfo(), true);
6810}
@ POWER_ALL
Definition SharedDefines.h:265
void SendTickImmune(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:1121
std::string ToString() const
Definition ObjectGuid.cpp:47
void ForwardThreatForAssistingMe(Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false)
== AFFECT OTHERS' THREAT LISTS ==
Definition ThreatManager.cpp:760
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:11022
bool IsImmunedToAuraPeriodicTick(Unit const *caster, SpellInfo const *spellInfo) const
Definition Unit.cpp:9980
uint32 GetMaxPower(Powers power) const
Definition Unit.h:1136
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:6797
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250
Definition Unit.h:531

References ThreatManager::ForwardThreatForAssistingMe(), GetBase(), GetCasterGUID(), Object::GetGUID(), GetId(), Unit::GetMaxPower(), GetMiscValue(), Unit::GetPower(), Unit::getPowerType(), GetSpellInfo(), Unit::GetThreatMgr(), Unit::IsAlive(), Unit::IsImmunedToAuraPeriodicTick(), LOG_DEBUG, m_amount, Unit::ModifyPower(), POWER_ALL, Unit::SendPeriodicAuraLog(), SendTickImmune(), and ObjectGuid::ToString().

Referenced by PeriodicTick().

◆ HandlePeriodicDamageAurasTick()

void AuraEffect::HandlePeriodicDamageAurasTick ( Unit target,
Unit caster 
) const
6276{
6277 if (!target->IsAlive())
6278 return;
6279
6280 if (target->IsImmunedToDamage(caster, GetSpellInfo()) || target->IsTotem())
6281 {
6282 SendTickImmune(target, caster);
6283 return;
6284 }
6285
6286 // Consecrate ticks can miss and will not show up in the combat log
6287 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6288 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6289 return;
6290
6291 // some auras remove at specific health level or more
6293 {
6294 switch (GetSpellInfo()->Id)
6295 {
6296 case 43093:
6297 case 31956:
6298 case 38801: // Grievous Wound
6299 case 35321:
6300 case 38363:
6301 case 39215: // Gushing Wound
6302 if (target->IsFullHealth())
6303 {
6304 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6305 return;
6306 }
6307 break;
6308 case 38772: // Grievous Wound
6309 {
6310 uint32 percent = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster);
6311 if (!target->HealthBelowPct(percent))
6312 {
6313 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6314 return;
6315 }
6316 break;
6317 }
6318 }
6319 }
6320
6322
6323 // ignore non positive values (can be result apply spellmods to aura damage
6324 uint32 damage = std::max(GetAmount(), 0);
6325
6326 // If the damage is percent-max-health based, calculate damage before the Modify hook
6328 {
6329 // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
6330 damage = uint32(std::ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
6331 }
6332
6333 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6334 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6335
6336 if (target->GetAI())
6337 {
6338 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6339 }
6340
6342 {
6343 // xinef: leave only target depending bonuses, rest is handled in calculate amount
6344 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE && caster)
6345 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6346 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6347
6348 // Calculate armor mitigation
6350 {
6351 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6352 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6353 damage = damageReductedArmor;
6354 }
6355
6356 }
6357
6358 // calculate crit chance
6359 bool crit = false;
6360 if ((crit = roll_chance_f(GetCritChance())))
6361 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6362
6363 // Auras reducing damage from AOE spells
6365 {
6366 if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() ||
6367 GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() ||
6368 GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || // some persistent area auras have targets like A=53 B=28
6371 {
6372 bool npcCaster = (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
6373 damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, npcCaster);
6374 }
6375 }
6376
6377 int32 dmg = damage;
6378 int32 mitigatedDamage = cleanDamage.mitigated_damage;
6379 if (CanApplyResilience())
6380 {
6381 int32 resilienceReduction = dmg;
6382 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6383
6384 resilienceReduction = dmg - resilienceReduction;
6385 dmg -= resilienceReduction;
6386 mitigatedDamage += resilienceReduction;
6387 }
6388
6389 damage = std::max(0, dmg);
6390 cleanDamage.mitigated_damage = std::max(0, mitigatedDamage);
6391
6392 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6393 Unit::CalcAbsorbResist(dmgInfo);
6394
6395 uint32 absorb = dmgInfo.GetAbsorb();
6396 uint32 resist = dmgInfo.GetResist();
6397 damage = dmgInfo.GetDamage();
6398
6399 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} attacked {} for {} dmg inflicted by {} abs is {}",
6400 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6401 Unit::DealDamageMods(target, damage, &absorb);
6402
6403 // Set trigger flag
6404 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6405 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6407 if (damage)
6408 procEx |= crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT;
6409 if (absorb > 0)
6410 procEx |= PROC_EX_ABSORB;
6411
6412 if (damage)
6413 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6414
6415 int32 overkill = damage - target->GetHealth();
6416 if (overkill < 0)
6417 overkill = 0;
6418
6419 SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit);
6420 target->SendPeriodicAuraLog(&pInfo);
6421
6422 Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
6423
6424 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6425}
bool roll_chance_f(float chance)
Definition Random.h:57
@ EFFECT_1
Definition SharedDefines.h:32
@ SPELL_ATTR7_TREAT_AS_NPC_AOE
Definition SharedDefines.h:655
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
Definition SharedDefines.h:793
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
Definition SharedDefines.h:570
@ SPELL_MISS_NONE
Definition SharedDefines.h:1523
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
Definition SharedDefines.h:526
@ DYNOBJ_AURA_TYPE
Definition SpellAuraDefines.h:386
@ PROC_EX_INTERNAL_DOT
Definition SpellMgr.h:224
@ PROC_EX_CRITICAL_HIT
Definition SpellMgr.h:200
@ PROC_EX_NORMAL_HIT
Definition SpellMgr.h:199
@ PROC_EX_ABSORB
Definition SpellMgr.h:209
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:137
@ PROC_FLAG_TAKEN_PERIODIC
Definition SpellMgr.h:138
@ PROC_FLAG_TAKEN_DAMAGE
Definition SpellMgr.h:140
@ CR_CRIT_TAKEN_SPELL
Definition Unit.h:239
@ MELEE_HIT_NORMAL
Definition Unit.h:292
bool CanApplyResilience() const
Definition SpellAuraEffects.h:112
float GetCritChance() const
Definition SpellAuraEffects.h:109
uint8 GetCasterLevel() const
Definition SpellAuraEffects.h:111
uint32 SchoolMask
Definition SpellInfo.h:416
virtual void OnCalculatePeriodicTickReceived(uint32 &, Unit *)
Called during calculation when receiving periodic healing or damage (DoT or HoT)
Definition UnitAI.h:387
static uint32 CalcArmorReducedDamage(Unit const *attacker, Unit const *victim, const uint32 damage, SpellInfo const *spellInfo, uint8 attackerLevel=0, WeaponAttackType attackType=MAX_ATTACK)
Definition Unit.cpp:2228
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, bool npcCaster) const
Definition Unit.cpp:16317
bool IsFullHealth() const
Definition Unit.h:1114
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spell, bool canReflect=false)
Definition Unit.cpp:3642
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:9372
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1116
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:8892
bool IsImmunedToDamage(SpellSchoolMask schoolMask) const
Definition Unit.cpp:9839
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition Unit.cpp:15179
static void ProcSkillsAndAuras(Unit *actor, Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellInfo const *procSpellInfo=nullptr, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr, uint32 procPhase=2)
Definition Unit.cpp:6763
UnitAI * GetAI()
Definition Unit.h:693
bool IsControlledByPlayer() const
Definition Unit.h:1307
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, uint8 effIndex=MAX_SPELL_EFFECTS)
Definition Unit.cpp:2205
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition Unit.cpp:2336
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition Unit.cpp:997
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false, Spell const *spell=nullptr)
Definition Unit.cpp:1007
Definition Unit.h:321
uint32 mitigated_damage
Definition Unit.h:326

References Unit::ApplyResilience(), BASE_ATTACK, Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), Unit::CalculateAOEDamageReduction(), CanApplyResilience(), CR_CRIT_TAKEN_SPELL, Unit::DealDamage(), Unit::DealDamageMods(), DOT, DYNOBJ_AURA_TYPE, EFFECT_1, SpellInfo::Effects, DamageInfo::GetAbsorb(), Unit::GetAI(), GetAmount(), GetAuraType(), GetBase(), GetCasterGUID(), GetCasterLevel(), GetCritChance(), DamageInfo::GetDamage(), GetEffIndex(), Object::GetGUID(), Unit::GetHealth(), GetId(), Unit::GetMaxHealth(), DamageInfo::GetResist(), GetSpellInfo(), SpellInfo::HasAttribute(), Unit::HealthBelowPct(), Unit::IsAlive(), Unit::IsControlledByPlayer(), Unit::IsDamageReducedByArmor(), Unit::IsFullHealth(), Unit::IsImmunedToDamage(), Unit::IsTotem(), LOG_DEBUG, m_spellInfo, MELEE_HIT_NORMAL, CleanDamage::mitigated_damage, UnitAI::OnCalculatePeriodicTickReceived(), PROC_EX_ABSORB, PROC_EX_CRITICAL_HIT, PROC_EX_INTERNAL_DOT, PROC_EX_NORMAL_HIT, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_DAMAGE, PROC_FLAG_TAKEN_PERIODIC, Unit::ProcSkillsAndAuras(), Unit::RemoveAurasDueToSpell(), roll_chance_f(), SpellInfo::SchoolMask, Unit::SendPeriodicAuraLog(), SendTickImmune(), SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS, SPELL_ATTR5_TREAT_AS_AREA_EFFECT, SPELL_ATTR7_TREAT_AS_NPC_AOE, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE_PERCENT, SPELL_EFFECT_PERSISTENT_AREA_AURA, SPELL_MISS_NONE, Unit::SpellCriticalDamageBonus(), Unit::SpellDamageBonusDone(), Unit::SpellDamageBonusTaken(), Unit::SpellHitResult(), sScriptMgr, and ObjectGuid::ToString().

Referenced by PeriodicTick().

◆ HandlePeriodicDummyAuraTick()

void AuraEffect::HandlePeriodicDummyAuraTick ( Unit target,
Unit caster 
) const
5942{
5943 switch (GetSpellInfo()->SpellFamilyName)
5944 {
5945 case SPELLFAMILY_HUNTER:
5946 {
5947 // Explosive Shot
5948 if (GetSpellInfo()->SpellFamilyFlags[1] & 0x80000000)
5949 {
5950 if (caster)
5951 caster->CastCustomSpell(53352, SPELLVALUE_BASE_POINT0, m_amount, target, true, nullptr, this);
5952 break;
5953 }
5954 switch (GetSpellInfo()->Id)
5955 {
5956 // Feeding Frenzy Rank 1
5957 case 53511:
5958 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
5959 target->CastSpell(target, 60096, true, 0, this);
5960 return;
5961 // Feeding Frenzy Rank 2
5962 case 53512:
5963 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
5964 target->CastSpell(target, 60097, true, 0, this);
5965 return;
5966 default:
5967 break;
5968 }
5969 break;
5970 }
5972 switch (GetId())
5973 {
5974 case 49016: // Hysteria
5975 uint32 damage = uint32(target->CountPctFromMaxHealth(1));
5976 Unit::DealDamage(target, target, damage, nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
5977 break;
5978 }
5979 // Blood of the North
5980 // Reaping
5981 // Death Rune Mastery
5982 if (GetSpellInfo()->SpellIconID == 3041 || GetSpellInfo()->SpellIconID == 22 || GetSpellInfo()->SpellIconID == 2622)
5983 {
5984 if (!target->IsPlayer())
5985 return;
5987 return;
5988
5989 // timer expired - remove death runes
5990 target->ToPlayer()->RemoveRunesByAuraEffect(this);
5991 }
5992 break;
5993 default:
5994 break;
5995 }
5996}
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3793
@ SPELLFAMILY_DEATHKNIGHT
Definition SharedDefines.h:3799
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
@ NODAMAGE
Definition Unit.h:258
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1121

References Unit::CastCustomSpell(), Unit::CastSpell(), CLASS_CONTEXT_ABILITY, CLASS_DEATH_KNIGHT, Unit::CountPctFromMaxHealth(), Unit::DealDamage(), GetId(), GetSpellInfo(), Unit::GetVictim(), Unit::HealthBelowPct(), Player::IsClass(), Object::IsPlayer(), m_amount, NODAMAGE, Player::RemoveRunesByAuraEffect(), SPELL_SCHOOL_MASK_NORMAL, SPELLFAMILY_DEATHKNIGHT, SPELLFAMILY_HUNTER, SPELLVALUE_BASE_POINT0, and Object::ToPlayer().

Referenced by PeriodicTick().

◆ HandlePeriodicEnergizeAuraTick()

void AuraEffect::HandlePeriodicEnergizeAuraTick ( Unit target,
Unit caster 
) const
6813{
6815
6817 return;
6818
6819 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
6820 return;
6821
6822 if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo()))
6823 {
6824 SendTickImmune(target, caster);
6825 return;
6826 }
6827
6828 // don't regen when permanent aura target has full power
6829 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
6830 return;
6831
6832 // ignore negative values (can be result apply spellmods to aura damage
6833 int32 amount = std::max(m_amount, 0);
6834
6835 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
6836 target->SendPeriodicAuraLog(&pInfo);
6837
6838 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
6839 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
6840 int32 gain = target->ModifyPower(PowerType, amount);
6841
6842 if (caster)
6843 target->GetThreatMgr().ForwardThreatForAssistingMe(caster, float(gain) * 0.5f, GetSpellInfo(), true);
6844}
@ SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED
Definition SharedDefines.h:645
virtual bool HasActivePowerType(Powers power)
Definition Unit.h:1132

References ThreatManager::ForwardThreatForAssistingMe(), GetBase(), GetCasterGUID(), Object::GetGUID(), GetId(), Unit::GetMaxPower(), GetMiscValue(), Unit::GetPower(), GetSpellInfo(), Unit::GetThreatMgr(), Unit::HasActivePowerType(), SpellInfo::HasAttribute(), Unit::IsAlive(), Unit::IsImmunedToAuraPeriodicTick(), Object::IsPlayer(), LOG_DEBUG, m_amount, m_spellInfo, Unit::ModifyPower(), Unit::SendPeriodicAuraLog(), SendTickImmune(), SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED, and ObjectGuid::ToString().

Referenced by PeriodicTick().

◆ HandlePeriodicHealAurasTick()

void AuraEffect::HandlePeriodicHealAurasTick ( Unit target,
Unit caster 
) const
6567{
6568 if (!target->IsAlive())
6569 return;
6570
6571 if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo()))
6572 {
6573 SendTickImmune(target, caster);
6574 return;
6575 }
6576
6577 // heal for caster damage (must be alive)
6578 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST) && (!caster || !caster->IsAlive()))
6579 return;
6580
6581 // don't regen when permanent aura target has full power
6582 if (GetBase()->IsPermanent() && target->IsFullHealth())
6583 return;
6584
6585 // ignore negative values (can be result apply spellmods to aura damage
6586 int32 damage = std::max(m_amount, 0);
6587
6589 {
6590 // Taken mods
6591 float TakenTotalMod = 1.0f;
6592
6593 // Tenacity increase healing % taken
6594 if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0))
6595 AddPct(TakenTotalMod, Tenacity->GetAmount());
6596
6597 // Healing taken percent
6598 float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6599 if (minval)
6600 AddPct(TakenTotalMod, minval);
6601
6602 float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6603 if (maxval)
6604 AddPct(TakenTotalMod, maxval);
6605
6606 // Healing over time taken percent
6607 float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6608 if (minval_hot)
6609 AddPct(TakenTotalMod, minval_hot);
6610
6611 float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6612 if (maxval_hot)
6613 AddPct(TakenTotalMod, maxval_hot);
6614
6615 // Arena / BG Dampening
6616 float minval_pct = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
6617 if (minval_pct)
6618 AddPct(TakenTotalMod, minval_pct);
6619
6620 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
6621
6622 // the most ugly hack i made :P the other option is to change all spellvalues to float...
6623 // demonic aegis
6624 if (caster && GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[1] & 0x20000000))
6626 AddPct(TakenTotalMod, aurEff->GetAmount());
6627
6628 damage = uint32(target->CountPctFromMaxHealth(damage));
6629 damage = uint32(damage * TakenTotalMod);
6630 }
6631 else
6632 {
6633 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6634 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6635
6636 if (caster && GetBase()->GetType() == UNIT_AURA_TYPE)
6637 damage = int32(float(damage) * caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT));
6638
6639 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6640 }
6641
6642 bool crit = false;
6643 if ((crit = roll_chance_f(GetCritChance())))
6644 damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target);
6645
6646 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} heal of {} for {} health inflicted by {}",
6647 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId());
6648
6649 uint32 heal = uint32(damage);
6650
6651 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6652 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal, GetSpellInfo());
6653 sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
6654
6655 if (target->GetAI())
6656 {
6657 target->GetAI()->OnCalculatePeriodicTickReceived(heal, caster);
6658 }
6659
6660 HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6661 Unit::CalcHealAbsorb(healInfo);
6662 int32 gain = Unit::DealHeal(caster, target, healInfo.GetHeal());
6663 healInfo.SetEffectiveHeal(gain);
6664
6665 SpellPeriodicAuraLogInfo pInfo(this, healInfo.GetHeal(), healInfo.GetHeal() - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit);
6666 target->SendPeriodicAuraLog(&pInfo);
6667
6668 if (caster)
6669 {
6670 float threat = float(gain) * 0.5f;
6671 if (caster->IsClass(CLASS_PALADIN))
6672 threat *= 0.5f;
6673 target->GetThreatMgr().ForwardThreatForAssistingMe(caster, threat, GetSpellInfo());
6674 }
6675
6676 bool haveCastItem = GetBase()->GetCastItemGUID();
6677
6678 // Health Funnel
6679 // damage caster for heal amount
6680 // xinef: caster is available, checked earlier
6681 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST))
6682 {
6683 uint32 manaPerSecond = GetSpellInfo()->ManaPerSecond;
6684 if ((int32)manaPerSecond > gain && gain > 0)
6685 {
6686 manaPerSecond = gain;
6687 }
6688
6689 uint32 absorb2 = 0;
6690 Unit::DealDamageMods(caster, manaPerSecond, &absorb2);
6691
6693 Unit::DealDamage(caster, caster, manaPerSecond, &cleanDamage, SELF_DAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
6694 }
6695
6696 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6697 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6699 if (healInfo.GetAbsorb() > 0)
6700 procEx |= PROC_EX_ABSORB;
6701
6702 // ignore item heals
6703 if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH) // xinef: dont allow obs_mod_health to proc spells, this is passive regeneration and not hot
6704 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo);
6705}
@ SPELL_ATTR2_NO_TARGET_PER_SECOND_COST
Definition SharedDefines.h:455
@ CLASS_PALADIN
Definition SharedDefines.h:127
@ SPELLFAMILY_WARLOCK
Definition SharedDefines.h:3789
@ SPELL_AURA_MOD_HEALING_DONE_PERCENT
Definition SpellAuraDefines.h:199
@ SPELL_AURA_MOD_HEALING_PCT
Definition SpellAuraDefines.h:181
@ SPELL_AURA_MOD_HOT_PCT
Definition SpellAuraDefines.h:322
@ PROC_EX_INTERNAL_HOT
Definition SpellMgr.h:225
@ SELF_DAMAGE
Definition Unit.h:259
ObjectGuid GetCastItemGUID() const
Definition SpellAuras.h:103
Definition Unit.h:383
uint32 ManaPerSecond
Definition SpellInfo.h:389
static void CalcHealAbsorb(HealInfo &healInfo)
Definition Unit.cpp:2682
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition Unit.cpp:8056
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
Definition Unit.cpp:6295
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:9412
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
Definition Unit.cpp:6300
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:9657

References AddPct(), BASE_ATTACK, Unit::CalcHealAbsorb(), CLASS_PALADIN, Unit::CountPctFromMaxHealth(), Unit::DealDamage(), Unit::DealDamageMods(), Unit::DealHeal(), DOT, DYNOBJ_AURA_TYPE, ThreatManager::ForwardThreatForAssistingMe(), HealInfo::GetAbsorb(), Unit::GetAI(), Unit::GetAuraEffect(), GetAuraType(), GetBase(), GetCasterGUID(), Aura::GetCastItemGUID(), GetCritChance(), HealInfo::GetEffectiveHeal(), GetEffIndex(), Object::GetGUID(), HealInfo::GetHeal(), GetId(), Unit::GetMaxNegativeAuraModifier(), Unit::GetMaxPositiveAuraModifier(), GetSpellInfo(), Unit::GetThreatMgr(), Unit::GetTotalAuraMultiplier(), Unit::IsAlive(), Unit::IsClass(), Unit::IsFullHealth(), Unit::IsImmunedToAuraPeriodicTick(), LOG_DEBUG, m_amount, SpellInfo::ManaPerSecond, MELEE_HIT_NORMAL, UnitAI::OnCalculatePeriodicTickReceived(), PROC_EX_ABSORB, PROC_EX_CRITICAL_HIT, PROC_EX_INTERNAL_HOT, PROC_EX_NORMAL_HIT, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_PERIODIC, Unit::ProcSkillsAndAuras(), roll_chance_f(), SELF_DAMAGE, Unit::SendPeriodicAuraLog(), SendTickImmune(), HealInfo::SetEffectiveHeal(), SPELL_ATTR2_NO_TARGET_PER_SECOND_COST, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELL_AURA_MOD_HEALING_PCT, SPELL_AURA_MOD_HOT_PCT, SPELL_AURA_OBS_MOD_HEALTH, Unit::SpellCriticalHealingBonus(), SPELLFAMILY_WARLOCK, Unit::SpellHealingBonusDone(), Unit::SpellHealingBonusTaken(), sScriptMgr, ObjectGuid::ToString(), and UNIT_AURA_TYPE.

Referenced by PeriodicTick().

◆ HandlePeriodicHealthFunnelAuraTick()

void AuraEffect::HandlePeriodicHealthFunnelAuraTick ( Unit target,
Unit caster 
) const
6538{
6539 if (!caster || !caster->IsAlive() || !target->IsAlive())
6540 return;
6541
6542 if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo()))
6543 {
6544 SendTickImmune(target, caster);
6545 return;
6546 }
6547
6548 uint32 damage = std::max(GetAmount(), 0);
6549 // do not kill health donator
6550 if (caster->GetHealth() < damage)
6551 damage = caster->GetHealth() - 1;
6552 if (!damage)
6553 return;
6554
6555 caster->ModifyHealth(-(int32)damage);
6556 LOG_DEBUG("spells.aura", "PeriodicTick: donator {} target {} damage {}.", caster->GetEntry(), target->GetEntry(), damage);
6557
6558 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6559
6560 damage = int32(damage * gainMultiplier);
6561
6562 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6563 caster->HealBySpell(healInfo);
6564}
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:8353

References SpellInfo::Effects, GetAmount(), GetEffIndex(), Object::GetEntry(), Unit::GetHealth(), GetSpellInfo(), Unit::HealBySpell(), Unit::IsAlive(), Unit::IsImmunedToAuraPeriodicTick(), LOG_DEBUG, Unit::ModifyHealth(), and SendTickImmune().

Referenced by PeriodicTick().

◆ HandlePeriodicHealthLeechAuraTick()

void AuraEffect::HandlePeriodicHealthLeechAuraTick ( Unit target,
Unit caster 
) const
6428{
6429 if (!target->IsAlive())
6430 return;
6431
6432 if (target->IsImmunedToDamage(caster, GetSpellInfo()))
6433 {
6434 SendTickImmune(target, caster);
6435 return;
6436 }
6437
6438 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6439 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6440 return;
6441
6443
6444 uint32 damage = std::max(GetAmount(), 0);
6445
6446 // Script Hook For HandlePeriodicHealthLeechAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6447 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6448
6449 if (target->GetAI())
6450 {
6451 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6452 }
6453
6454 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6455 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6456 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6457
6458 bool crit = false;
6459 if ((crit = roll_chance_f(GetCritChance())))
6460 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6461
6462 // Calculate armor mitigation
6464 {
6465 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6466 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6467 damage = damageReductedArmor;
6468 }
6469
6470 int32 dmg = damage;
6471 int32 cleanDamageAmount = cleanDamage.mitigated_damage;
6472 if (CanApplyResilience())
6473 {
6474 int32 resilienceReduction = dmg;
6475 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6476
6477 resilienceReduction = dmg - resilienceReduction;
6478 dmg -= resilienceReduction;
6479 cleanDamageAmount += resilienceReduction;
6480 }
6481
6482 damage = std::max(0, dmg);
6483 cleanDamage.mitigated_damage = std::max(0, cleanDamageAmount);
6484
6485 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6486 Unit::CalcAbsorbResist(dmgInfo);
6487
6488 uint32 absorb = dmgInfo.GetAbsorb();
6489 uint32 resist = dmgInfo.GetResist();
6490 damage = dmgInfo.GetDamage();
6491
6492 // Set trigger flag
6493 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6494 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6496 if (dmgInfo.GetDamage())
6497 procEx |= crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT;
6498 if (absorb > 0)
6499 procEx |= PROC_EX_ABSORB;
6500
6501 if (dmgInfo.GetDamage())
6502 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6503
6504 if (target->GetHealth() < dmgInfo.GetDamage())
6505 {
6506 dmgInfo.ModifyDamage(dmgInfo.GetDamage() - target->GetHealth());
6507 }
6508
6509 damage = dmgInfo.GetDamage();
6510
6511 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} health leech of {} for {} dmg inflicted by {} abs is {}",
6512 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6513 if (caster)
6514 caster->SendSpellNonMeleeDamageLog(target, GetSpellInfo(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
6515
6516 int32 new_damage;
6517
6518 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
6519
6520 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6521
6522 if (!caster || !caster->IsAlive())
6523 return;
6524
6525 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6526
6527 uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount()));
6528 heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
6529
6530 HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6531 float threat = float(caster->HealBySpell(healInfo)) * 0.5f;
6532 if (caster->IsClass(CLASS_PALADIN))
6533 threat *= 0.5f;
6534 caster->GetThreatMgr().ForwardThreatForAssistingMe(caster, threat, GetSpellInfo());
6535}
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:6696

References Unit::ApplyResilience(), BASE_ATTACK, Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), CanApplyResilience(), CLASS_PALADIN, CR_CRIT_TAKEN_SPELL, Unit::DealDamage(), DOT, DYNOBJ_AURA_TYPE, SpellInfo::Effects, ThreatManager::ForwardThreatForAssistingMe(), DamageInfo::GetAbsorb(), Unit::GetAI(), GetAmount(), GetBase(), GetCasterGUID(), GetCasterLevel(), GetCritChance(), DamageInfo::GetDamage(), GetEffIndex(), Object::GetGUID(), Unit::GetHealth(), GetId(), DamageInfo::GetResist(), GetSpellInfo(), Unit::GetThreatMgr(), Unit::HealBySpell(), Unit::IsAlive(), Unit::IsClass(), Unit::IsDamageReducedByArmor(), Unit::IsImmunedToDamage(), LOG_DEBUG, m_effIndex, m_spellInfo, MELEE_HIT_NORMAL, CleanDamage::mitigated_damage, DamageInfo::ModifyDamage(), UnitAI::OnCalculatePeriodicTickReceived(), PROC_EX_ABSORB, PROC_EX_CRITICAL_HIT, PROC_EX_INTERNAL_DOT, PROC_EX_NORMAL_HIT, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_DAMAGE, PROC_FLAG_TAKEN_PERIODIC, Unit::ProcSkillsAndAuras(), roll_chance_f(), Unit::SendSpellNonMeleeDamageLog(), SendTickImmune(), SPELL_EFFECT_PERSISTENT_AREA_AURA, SPELL_MISS_NONE, Unit::SpellCriticalDamageBonus(), Unit::SpellDamageBonusDone(), Unit::SpellDamageBonusTaken(), Unit::SpellHealingBonusDone(), Unit::SpellHealingBonusTaken(), Unit::SpellHitResult(), sScriptMgr, and ObjectGuid::ToString().

Referenced by PeriodicTick().

◆ HandlePeriodicManaLeechAuraTick()

void AuraEffect::HandlePeriodicManaLeechAuraTick ( Unit target,
Unit caster 
) const
6708{
6710
6711 if (!caster || !caster->IsAlive() || !target->IsAlive() || !target->HasActivePowerType(PowerType))
6712 return;
6713
6714 if (target->IsImmunedToAuraPeriodicTick(caster, GetSpellInfo()))
6715 {
6716 SendTickImmune(target, caster);
6717 return;
6718 }
6719
6720 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6721 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6722 return;
6723
6724 // ignore negative values (can be result apply spellmods to aura damage
6725 int32 drainAmount = std::max(m_amount, 0);
6726
6727 // Special case: draining x% of mana (up to a maximum of 2*x% of the caster's maximum mana)
6728 // It's mana percent cost spells, m_amount is percent drain from target
6730 {
6731 // max value
6732 int32 maxmana = CalculatePct(caster->GetMaxPower(PowerType), drainAmount * 2.0f);
6733 ApplyPct(drainAmount, target->GetMaxPower(PowerType));
6734 if (drainAmount > maxmana)
6735 drainAmount = maxmana;
6736 }
6737
6738 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} power leech of {} for {} dmg inflicted by {}",
6739 GetCasterGUID().ToString(), target->GetGUID().ToString(), drainAmount, GetId());
6740 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
6741 if (PowerType == POWER_MANA)
6742 drainAmount -= target->GetSpellCritDamageReduction(drainAmount);
6743
6744 int32 drainedAmount = -target->ModifyPower(PowerType, -drainAmount);
6745
6746 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6747
6748 SpellPeriodicAuraLogInfo pInfo(this, drainedAmount, 0, 0, 0, gainMultiplier, false);
6749 target->SendPeriodicAuraLog(&pInfo);
6750
6751 int32 gainAmount = int32(drainedAmount * gainMultiplier);
6752 int32 gainedAmount = 0;
6753 if (gainAmount)
6754 {
6755 gainedAmount = caster->ModifyPower(PowerType, gainAmount);
6756 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
6757 }
6758
6759 // remove CC auras
6761
6762 // Drain Mana
6764 && m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
6765 {
6766 int32 manaFeedVal = 0;
6767 if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
6768 manaFeedVal = aurEff->GetAmount();
6769 // Mana Feed - Drain Mana
6770 if (manaFeedVal > 0)
6771 {
6772 int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
6773 caster->CastCustomSpell(caster, 32554, &feedAmount, nullptr, nullptr, true, nullptr, this);
6774 }
6775 }
6776}
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
Definition SpellDefines.h:44
T ApplyPct(T &base, U pct)
Definition Util.h:64
uint32 GetSpellCritDamageReduction(uint32 damage) const
Definition Unit.h:1276

References Unit::AddThreat(), ApplyPct(), AURA_INTERRUPT_FLAG_TAKE_DAMAGE, CalculatePct(), Unit::CastCustomSpell(), SpellInfo::Effects, GetBase(), GetCasterGUID(), GetEffIndex(), Object::GetGUID(), GetId(), Unit::GetMaxPower(), GetMiscValue(), Unit::GetSpellCritDamageReduction(), GetSpellInfo(), Unit::HasActivePowerType(), Unit::IsAlive(), Unit::IsImmunedToAuraPeriodicTick(), LOG_DEBUG, m_amount, m_spellInfo, SpellInfo::ManaCostPercentage, Unit::ModifyPower(), POWER_MANA, Unit::RemoveAurasWithInterruptFlags(), Unit::SendPeriodicAuraLog(), SendTickImmune(), SPELL_EFFECT_PERSISTENT_AREA_AURA, SPELL_MISS_NONE, SPELLFAMILY_WARLOCK, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, Unit::SpellHitResult(), and ObjectGuid::ToString().

Referenced by PeriodicTick().

◆ HandlePeriodicPowerBurnAuraTick()

void AuraEffect::HandlePeriodicPowerBurnAuraTick ( Unit target,
Unit caster 
) const
6847{
6849
6850 if (!caster || !target->IsAlive() || !target->HasActivePowerType(PowerType))
6851 return;
6852
6853 if (target->IsImmunedToDamage(caster, GetSpellInfo()))
6854 {
6855 SendTickImmune(target, caster);
6856 return;
6857 }
6858
6859 // ignore negative values (can be result apply spellmods to aura damage
6860 int32 damage = std::max(m_amount, 0);
6861
6862 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
6863 if (PowerType == POWER_MANA)
6864 damage -= target->GetSpellCritDamageReduction(damage);
6865
6866 uint32 gain = uint32(-target->ModifyPower(PowerType, -damage));
6867
6868 float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6869
6870 SpellInfo const* spellProto = GetSpellInfo();
6871 // maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
6872 SpellNonMeleeDamage damageInfo(caster, target, spellProto, spellProto->SchoolMask);
6873 // no SpellDamageBonus for burn mana
6874 caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto);
6875
6876 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
6877
6878 caster->SendSpellNonMeleeDamageLog(&damageInfo);
6879
6880 // Set trigger flag
6881 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6882 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6883 if (damageInfo.damage)
6884 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6885
6886 caster->DealSpellDamage(&damageInfo, true);
6887
6888 DamageInfo dmgInfo(damageInfo, DOT, BASE_ATTACK, SPELL_MISS_NONE);
6889 uint32 hitMask = dmgInfo.GetHitMask() | PROC_EX_INTERNAL_DOT;
6890 Unit::ProcSkillsAndAuras(caster, damageInfo.target, procAttacker, procVictim, hitMask, damageInfo.damage, BASE_ATTACK, spellProto, nullptr, GetEffIndex(), nullptr, &dmgInfo);
6891}
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
Definition Unit.cpp:1651
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
Definition Unit.cpp:1508
Definition Unit.h:508

References SpellNonMeleeDamage::absorb, BASE_ATTACK, Unit::CalculateSpellDamageTaken(), SpellNonMeleeDamage::damage, Unit::DealDamageMods(), Unit::DealSpellDamage(), DOT, SpellInfo::Effects, GetEffIndex(), DamageInfo::GetHitMask(), GetMiscValue(), Unit::GetSpellCritDamageReduction(), GetSpellInfo(), Unit::HasActivePowerType(), Unit::IsAlive(), Unit::IsImmunedToDamage(), m_amount, Unit::ModifyPower(), POWER_MANA, PROC_EX_INTERNAL_DOT, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_DAMAGE, PROC_FLAG_TAKEN_PERIODIC, Unit::ProcSkillsAndAuras(), SpellInfo::SchoolMask, Unit::SendSpellNonMeleeDamageLog(), SendTickImmune(), SPELL_MISS_NONE, and SpellNonMeleeDamage::target.

Referenced by PeriodicTick().

◆ HandlePeriodicTriggerSpellAuraTick()

void AuraEffect::HandlePeriodicTriggerSpellAuraTick ( Unit target,
Unit caster 
) const
Todo:
: effect trigger spell may be independant on spell targets, and executed in spell finish phase
5999{
6000 // generic casting code with custom spells and target/caster customs
6001 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
6002
6003 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6004 SpellInfo const* auraSpellInfo = GetSpellInfo();
6005 uint32 auraId = auraSpellInfo->Id;
6006
6007 // specific code for cases with no trigger spell provided in field
6008 if (!triggeredSpellInfo)
6009 {
6010 switch (auraSpellInfo->SpellFamilyName)
6011 {
6013 {
6014 switch (auraId)
6015 {
6016 // Thaumaturgy Channel
6017 case 9712:
6018 triggerSpellId = 21029;
6019 if (caster)
6020 caster->CastSpell(caster, triggerSpellId, true);
6021 return;
6022 // Brood Affliction: Bronze
6023 case 23170:
6024 // Only 10% chance of triggering spell
6025 if (roll_chance_f(10.f))
6026 {
6027 triggerSpellId = 23171;
6028 }
6029 break;
6030 // Restoration
6031 case 24379:
6032 case 23493:
6033 {
6034 if (caster)
6035 {
6036 int32 heal = caster->CountPctFromMaxHealth(10);
6037 HealInfo healInfo(caster, target, heal, auraSpellInfo, auraSpellInfo->GetSchoolMask());
6038 caster->HealBySpell(healInfo);
6039
6040 if (int32 mana = caster->GetMaxPower(POWER_MANA))
6041 {
6042 mana /= 10;
6043 caster->EnergizeBySpell(caster, 23493, mana, POWER_MANA);
6044 }
6045 }
6046 return;
6047 }
6048 // Nitrous Boost
6049 case 27746:
6050 if (caster && target->GetPower(POWER_MANA) >= 10)
6051 {
6052 target->ModifyPower(POWER_MANA, -10);
6053 target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA);
6054 }
6055 else
6056 target->RemoveAurasDueToSpell(27746);
6057 return;
6058 // Frost Blast
6059 case 27808:
6060 if (caster)
6061 {
6062 caster->CastSpell(target, 29879, true, nullptr, this);
6063 if (GetTickNumber() == 1)
6064 caster->CastSpell(target, 27808, true);
6065 }
6066 return;
6067 // Inoculate Nestlewood Owlkin
6068 case 29528:
6069 if (!target->IsCreature()) // prevent error reports in case ignored player target
6070 return;
6071 break;
6072 // Feed Captured Animal
6073 case 29917:
6074 triggerSpellId = 29916;
6075 break;
6076 // Extract Gas
6077 case 30427:
6078 {
6079 // move loot to player inventory and despawn target
6080 if (caster && caster->IsPlayer() &&
6081 target->IsCreature() &&
6083 {
6084 Player* player = caster->ToPlayer();
6085 Creature* creature = target->ToCreature();
6086 // missing lootid has been reported on startup - just return
6087 if (!creature->GetCreatureTemplate()->SkinLootId)
6088 return;
6089
6091
6092 creature->DespawnOrUnsummon();
6093 }
6094 return;
6095 }
6096 // Quake
6097 case 30576:
6098 triggerSpellId = 30571;
6099 break;
6100 // Doom
6102 // so instakill will be naturally done before trigger spell
6103 case 31347:
6104 {
6105 target->CastSpell(target, 31350, true, nullptr, this);
6106 Unit::Kill(target, target);
6107 return;
6108 }
6109 // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam
6110 case 39857:
6111 triggerSpellId = 39856;
6112 break;
6113 // Personalized Weather
6114 case 46736:
6115 triggerSpellId = 46737;
6116 break;
6117 // Shield Level 1
6118 case 63130:
6119 // Shield Level 2
6120 case 63131:
6121 // Shield Level 3
6122 case 63132:
6123 // Ball of Flames Visual
6124 case 71706:
6125 return;
6126 // Oculus, Mage-Lord Urom, Time Bomb
6127 case 51121:
6128 case 59376:
6129 {
6130 const int32 dmg = target->GetMaxHealth() - target->GetHealth();
6131 target->CastCustomSpell(target, 51132, &dmg, 0, 0, true);
6132 return;
6133 }
6134 }
6135 break;
6136 }
6137 default:
6138 break;
6139 }
6140 }
6141 else
6142 {
6143 // Spell exist but require custom code
6144 switch (auraId)
6145 {
6146 // Poison (Grobbulus)
6147 case 28158:
6148 case 54362:
6149 // Slime Pool (Dreadscale & Acidmaw)
6150 case 66882:
6151 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), nullptr, true, nullptr, this);
6152 return;
6153 // Eye of Eternity, Malygos, Arcane Overload
6154 case 56432:
6155 if (triggerSpellId == 56438)
6156 {
6157 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)(10000 * (1.0f - 0.02f * (m_tickNumber + 1))), nullptr, true, nullptr, this);
6158 return;
6159 }
6160 break;
6161 // Beacon of Light
6162 case 53563:
6163 {
6164 // area aura owner casts the spell
6165 GetBase()->GetUnitOwner()->CastSpell(target, triggeredSpellInfo, true, 0, this, GetBase()->GetUnitOwner()->GetGUID());
6166 return;
6167 }
6168 // Trial of the Crusader, Jaraxxus, Spinning Pain Spike
6169 case 66283:
6170 {
6171 const int32 dmg = target->GetMaxHealth() / 2;
6172 target->CastCustomSpell(target, 66316, &dmg, nullptr, nullptr, true);
6173 return;
6174 }
6175 // Violet Hold, Moragg, Ray of Suffering, Ray of Pain
6176 case 54442:
6177 case 59524:
6178 case 54438:
6179 case 59523:
6180 {
6181 if (caster)
6182 if (Unit* victim = caster->GetVictim())
6183 if (victim->GetDistance(caster) < 45.0f)
6184 {
6185 target = victim;
6186 break;
6187 }
6188 return;
6189 }
6190 case 24745: // Summon Templar, Trigger
6191 case 24747: // Summon Templar Fire, Trigger
6192 case 24757: // Summon Templar Air, Trigger
6193 case 24759: // Summon Templar Earth, Trigger
6194 case 24761: // Summon Templar Water, Trigger
6195 case 24762: // Summon Duke, Trigger
6196 case 24766: // Summon Duke Fire, Trigger
6197 case 24769: // Summon Duke Air, Trigger
6198 case 24771: // Summon Duke Earth, Trigger
6199 case 24773: // Summon Duke Water, Trigger
6200 case 24785: // Summon Royal, Trigger
6201 case 24787: // Summon Royal Fire, Trigger
6202 case 24791: // Summon Royal Air, Trigger
6203 case 24792: // Summon Royal Earth, Trigger
6204 case 24793: // Summon Royal Water, Trigger
6205 {
6206 // All this spells trigger a spell that requires reagents; if the
6207 // triggered spell is cast as "triggered", reagents are not consumed
6208 if (caster)
6209 caster->CastSpell(target, triggerSpellId, false);
6210 return;
6211 }
6212 }
6213 }
6214
6215 // Reget trigger spell proto
6216 triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6217
6218 if (triggeredSpellInfo)
6219 {
6220 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6221 {
6222 SpellCastTargets targets;
6223 targets.SetUnitTarget(target);
6224 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6225 {
6228 }
6229
6230 // Xinef: do not skip reagent cost for entry casts
6232 if (GetSpellInfo()->Effects[GetEffIndex()].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || GetSpellInfo()->Effects[GetEffIndex()].TargetB.GetCheckType() == TARGET_CHECK_ENTRY)
6234
6235 triggerCaster->CastSpell(targets, triggeredSpellInfo, nullptr, triggerFlags, nullptr, this);
6236 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6237 }
6238 }
6239}
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
@ CREATURE_TYPE_GAS_CLOUD
Definition SharedDefines.h:2634
@ SPELLVALUE_RADIUS_MOD
Definition SpellDefines.h:116
TriggerCastFlags
Definition SpellDefines.h:132
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition SpellDefines.h:150
@ TRIGGERED_IGNORE_POWER_AND_REAGENT_COST
Will ignore Spell and Category cooldowns.
Definition SpellDefines.h:136
@ TARGET_CHECK_ENTRY
Definition SpellInfo.h:116
uint32 GetTickNumber() const
Definition SpellAuraEffects.h:87
Unit * GetUnitOwner() const
Definition SpellAuras.h:108
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2186
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
Definition Player.cpp:13528
Definition Spell.h:121
void SetUnitTarget(Unit *target)
Definition Spell.cpp:238
void SetObjectTargetChannel(ObjectGuid targetGUID)
Definition Spell.cpp:453
void SetDstChannel(SpellDestination const &spellDest)
Definition Spell.cpp:458
bool IsChannelCategorySpell() const
Definition SpellInfo.cpp:1115
void EnergizeBySpell(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:8380
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.cpp:13962
void SendEnergizeSpellLog(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:8369
SpellDestination spellDst
Definition Spell.h:262
ObjectGuid channelGUID
Definition Spell.h:261
uint32 type
Definition CreatureData.h:218
uint32 SkinLootId
Definition CreatureData.h:222

References Player::AutoStoreLoot(), Unit::CastCustomSpell(), Unit::CastSpell(), ChannelTargetData::channelGUID, Unit::CountPctFromMaxHealth(), CREATURE_TYPE_GAS_CLOUD, Creature::DespawnOrUnsummon(), SpellInfo::Effects, Unit::EnergizeBySpell(), GetBase(), Creature::GetCreatureTemplate(), GetEffIndex(), Unit::GetHealth(), GetId(), Unit::GetMaxHealth(), Unit::GetMaxPower(), Unit::GetPower(), SpellInfo::GetSchoolMask(), GetSpellInfo(), GetTickNumber(), Aura::GetUnitOwner(), Unit::GetVictim(), Unit::HealBySpell(), SpellInfo::Id, SpellInfo::IsChannelCategorySpell(), Object::IsCreature(), Object::IsPlayer(), Unit::Kill(), LOG_DEBUG, LootTemplates_Skinning, m_channelData, m_spellInfo, m_tickNumber, Unit::ModifyPower(), SpellInfo::NeedsToBeTriggeredByCaster(), POWER_MANA, Unit::RemoveAurasDueToSpell(), roll_chance_f(), Unit::SendEnergizeSpellLog(), SpellCastTargets::SetDstChannel(), SpellCastTargets::SetObjectTargetChannel(), SpellCastTargets::SetUnitTarget(), CreatureTemplate::SkinLootId, ChannelTargetData::spellDst, SPELLFAMILY_GENERIC, SpellInfo::SpellFamilyName, SPELLVALUE_RADIUS_MOD, sSpellMgr, TARGET_CHECK_ENTRY, Object::ToCreature(), Object::ToPlayer(), TRIGGERED_FULL_MASK, TRIGGERED_IGNORE_POWER_AND_REAGENT_COST, and CreatureTemplate::type.

Referenced by PeriodicTick().

◆ HandlePeriodicTriggerSpellWithValueAuraTick()

void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick ( Unit target,
Unit caster 
) const
6242{
6243 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
6244 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
6245 {
6246 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6247 {
6248 SpellCastTargets targets;
6249 targets.SetUnitTarget(target);
6250 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6251 {
6254 }
6255
6256 CustomSpellValues values;
6258
6259 triggerCaster->CastSpell(targets, triggeredSpellInfo, &values, TRIGGERED_FULL_MASK, nullptr, this);
6260 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6261 }
6262 }
6263 else
6264 {
6265 Creature* c = target->ToCreature();
6266 if (c && caster)
6267 {
6268 sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), target->ToCreature());
6269 }
6270
6271 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
6272 }
6273}
SpellEffIndex
Definition SharedDefines.h:30
Definition SpellDefines.h:165
void AddSpellMod(SpellValueMod mod, int32 value)
Definition SpellDefines.h:167

References CustomSpellValues::AddSpellMod(), ChannelTargetData::channelGUID, SpellInfo::Effects, GetAmount(), GetEffIndex(), GetId(), GetSpellInfo(), LOG_DEBUG, m_channelData, m_effIndex, m_spellInfo, SpellCastTargets::SetDstChannel(), SpellCastTargets::SetObjectTargetChannel(), SpellCastTargets::SetUnitTarget(), ChannelTargetData::spellDst, SPELLVALUE_BASE_POINT0, sScriptMgr, sSpellMgr, Object::ToCreature(), and TRIGGERED_FULL_MASK.

Referenced by PeriodicTick().

◆ HandlePhase()

void AuraEffect::HandlePhase ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1925{
1926 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1927 return;
1928
1929 Unit* target = aurApp->GetTarget();
1930
1931 // no-phase is also phase state so same code for apply and remove
1932 uint32 newPhase = target->GetPhaseByAuras();
1933
1934 if (Player* player = target->ToPlayer())
1935 {
1936 if (!newPhase)
1937 newPhase = PHASEMASK_NORMAL;
1938
1939 // do not change phase to GM with all phases enabled
1940 if (player->IsGameMaster())
1941 newPhase = PHASEMASK_ANYWHERE;
1942
1943 player->SetPhaseMask(newPhase, false);
1944 player->GetSession()->SendSetPhaseShift(newPhase);
1945 }
1946 else
1947 {
1948 if (!newPhase)
1949 {
1950 newPhase = PHASEMASK_NORMAL;
1951 if (Creature* creature = target->ToCreature())
1952 if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetSpawnId()))
1953 newPhase = data->phaseMask;
1954 }
1955
1956 target->SetPhaseMask(newPhase, false);
1957 }
1958
1959 // call functions which may have additional effects after chainging state of unit
1960 // phase auras normally not expected at BG but anyway better check
1961 if (apply)
1962 {
1963 // drop flag at invisibiliy in bg
1965 }
1966
1967 // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
1968 if (target->IsVisible())
1969 {
1970 if (!target->GetMap()->Instanceable())
1971 {
1972 target->UpdateObjectVisibility(false);
1973 target->m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f);
1974 }
1975 else
1976 target->UpdateObjectVisibility();
1977 }
1978}
@ PHASEMASK_ANYWHERE
Definition Object.h:64
@ PHASEMASK_NORMAL
Definition Object.h:63
uint32 GetPhaseByAuras() const
Definition Unit.cpp:15290
bool IsVisible() const
Definition Unit.h:2014
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Unit.cpp:15301
Position m_last_notify_position
Definition Unit.h:2108
Definition CreatureData.h:370
void Relocate(float x, float y)
Definition Position.h:77

References AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, WorldObject::GetMap(), Unit::GetPhaseByAuras(), AuraApplication::GetTarget(), Map::Instanceable(), Unit::IsVisible(), Unit::m_last_notify_position, PHASEMASK_ANYWHERE, PHASEMASK_NORMAL, Position::Relocate(), Unit::RemoveAurasWithInterruptFlags(), Unit::SetPhaseMask(), sObjectMgr, Object::ToCreature(), Object::ToPlayer(), and Unit::UpdateObjectVisibility().

◆ HandlePreventFleeing()

void AuraEffect::HandlePreventFleeing ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
Todo:
: find a way to cancel fleeing for assistance. Currently this will only stop creatures fleeing due to low health that could not find nearby allies to flee towards.
3652{
3653 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3654 return;
3655
3656 Unit* target = aurApp->GetTarget();
3657 // Since patch 3.0.2 this mechanic no longer affects fear effects. It will ONLY prevent humanoids from fleeing due to low health.
3658 if (target->IsPlayer() || !apply || target->HasFearAura())
3659 return;
3662 target->SetControlled(false, UNIT_STATE_FLEEING);
3663}
bool HasFearAura() const
Definition Unit.h:1837

References AURA_EFFECT_HANDLE_REAL, AuraApplication::GetTarget(), Unit::HasFearAura(), Object::IsPlayer(), Unit::SetControlled(), and UNIT_STATE_FLEEING.

◆ HandlePreventResurrection()

void AuraEffect::HandlePreventResurrection ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5928{
5929 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5930 return;
5931
5932 if (!aurApp->GetTarget()->IsPlayer())
5933 return;
5934
5935 if (apply)
5936 aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
5937 else if (!aurApp->GetTarget()->GetMap()->Instanceable())
5938 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
5939}
@ PLAYER_FIELD_BYTE_RELEASE_TIMER
Definition Player.h:545

References AURA_EFFECT_HANDLE_REAL, WorldObject::GetMap(), AuraApplication::GetTarget(), Map::Instanceable(), Object::IsPlayer(), PLAYER_FIELD_BYTE_RELEASE_TIMER, PLAYER_FIELD_BYTES, Object::RemoveByteFlag(), and Object::SetByteFlag().

◆ HandleProc()

void AuraEffect::HandleProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
1284{
1285 bool prevented = GetBase()->CallScriptEffectProcHandlers(this, aurApp, eventInfo);
1286 if (prevented)
1287 return;
1288
1289 switch (GetAuraType())
1290 {
1296 HandleBreakableCCAuraProc(aurApp, eventInfo);
1297 break;
1298 case SPELL_AURA_DUMMY:
1300 HandleProcTriggerSpellAuraProc(aurApp, eventInfo);
1301 break;
1303 HandleProcTriggerSpellWithValueAuraProc(aurApp, eventInfo);
1304 break;
1306 HandleProcTriggerDamageAuraProc(aurApp, eventInfo);
1307 break;
1309 HandleRaidProcFromChargeAuraProc(aurApp, eventInfo);
1310 break;
1313 break;
1314 default:
1315 break;
1316 }
1317
1318 GetBase()->CallScriptAfterEffectProcHandlers(this, aurApp, eventInfo);
1319}
@ SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE
Definition SpellAuraDefines.h:288
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
@ SPELL_AURA_RAID_PROC_FROM_CHARGE
Definition SpellAuraDefines.h:286
@ SPELL_AURA_PROC_TRIGGER_DAMAGE
Definition SpellAuraDefines.h:106
void HandleRaidProcFromChargeAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:6964
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:6920
void HandleProcTriggerDamageAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:6941
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7012
void HandleBreakableCCAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:6893
void HandleProcTriggerSpellAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:6903
bool CallScriptEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuras.cpp:2723
void CallScriptAfterEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuras.cpp:2742

References Aura::CallScriptAfterEffectProcHandlers(), Aura::CallScriptEffectProcHandlers(), GetAuraType(), GetBase(), HandleBreakableCCAuraProc(), HandleProcTriggerDamageAuraProc(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), SPELL_AURA_DUMMY, SPELL_AURA_MOD_CONFUSE, SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_PROC_TRIGGER_DAMAGE, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_RAID_PROC_FROM_CHARGE, SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE, and SPELL_AURA_TRANSFORM.

Referenced by Aura::TriggerProcOnEvent().

◆ HandleProcTriggerDamageAuraProc()

void AuraEffect::HandleProcTriggerDamageAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
6942{
6943 Unit* target = aurApp->GetTarget();
6944 Unit* triggerTarget = target == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
6945 if (!triggerTarget)
6946 return;
6947
6948 if (triggerTarget->IsImmunedToDamage(target, GetSpellInfo()))
6949 {
6950 SendTickImmune(triggerTarget, target);
6951 return;
6952 }
6953
6954 SpellNonMeleeDamage damageInfo(target, triggerTarget, GetSpellInfo(), GetSpellInfo()->SchoolMask);
6955 uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE, GetEffIndex());
6956 damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
6957 target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo());
6958 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
6959 target->SendSpellNonMeleeDamageLog(&damageInfo);
6960 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering {} spell damage from aura {} proc", damage, GetId());
6961 target->DealSpellDamage(&damageInfo, true);
6962}
Unit * GetActionTarget() const
Definition Unit.h:460

References SpellNonMeleeDamage::absorb, Unit::CalculateSpellDamageTaken(), SpellNonMeleeDamage::damage, Unit::DealDamageMods(), Unit::DealSpellDamage(), ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), GetAmount(), GetEffIndex(), GetId(), GetSpellInfo(), AuraApplication::GetTarget(), Unit::IsImmunedToDamage(), LOG_DEBUG, Unit::SendSpellNonMeleeDamageLog(), SendTickImmune(), SPELL_DIRECT_DAMAGE, Unit::SpellDamageBonusDone(), Unit::SpellDamageBonusTaken(), and SpellNonMeleeDamage::target.

Referenced by HandleProc().

◆ HandleProcTriggerSpellAuraProc()

void AuraEffect::HandleProcTriggerSpellAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
6904{
6905 Unit* triggerCaster = aurApp->GetTarget();
6906 Unit* triggerTarget = triggerCaster == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
6907
6908 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
6909 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
6910 {
6911 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell {} from aura {} proc", triggeredSpellInfo->Id, GetId());
6912 triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, nullptr, this);
6913 }
6914 else
6915 {
6916 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell {} from aura {} proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
6917 }
6918}

References Unit::CastSpell(), SpellInfo::Effects, ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), GetEffIndex(), GetId(), GetSpellInfo(), AuraApplication::GetTarget(), LOG_DEBUG, and sSpellMgr.

Referenced by HandleProc().

◆ HandleProcTriggerSpellWithValueAuraProc()

void AuraEffect::HandleProcTriggerSpellWithValueAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
6921{
6922 Unit* triggerCaster = aurApp->GetTarget();
6923 Unit* triggerTarget = triggerCaster == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
6924
6925 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
6926 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
6927 {
6928 // used only with EXTRA_LOGS
6929 (void)triggeredSpellInfo;
6930
6931 int32 basepoints0 = GetAmount();
6932 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell {} with value {} from aura {} proc", triggeredSpellInfo->Id, basepoints0, GetId());
6933 triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, nullptr, nullptr, true, nullptr, this);
6934 }
6935 else
6936 {
6937 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell {} from aura {} proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId());
6938 }
6939}

References Unit::CastCustomSpell(), SpellInfo::Effects, ProcEventInfo::GetActionTarget(), ProcEventInfo::GetActor(), GetAmount(), GetId(), GetSpellInfo(), AuraApplication::GetTarget(), LOG_DEBUG, m_effIndex, and sSpellMgr.

Referenced by HandleProc().

◆ HandleRaidProcFromChargeAuraProc()

void AuraEffect::HandleRaidProcFromChargeAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
6965{
6966 Unit* target = aurApp->GetTarget();
6967
6968 uint32 triggerSpellId;
6969 switch (GetId())
6970 {
6971 case 57949: // Shiver
6972 triggerSpellId = 57952;
6973 //animationSpellId = 57951; dummy effects for jump spell have unknown use (see also 41637)
6974 break;
6975 case 59978: // Shiver
6976 triggerSpellId = 59979;
6977 break;
6978 case 43593: // Cold Stare
6979 triggerSpellId = 43594;
6980 break;
6981 default:
6982 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: {}", GetId());
6983 return;
6984 }
6985
6986 int32 jumps = GetBase()->GetCharges();
6987
6988 // current aura expire on proc finish
6989 GetBase()->SetCharges(0);
6990 GetBase()->SetUsingCharges(true);
6991
6992 // next target selection
6993 if (jumps > 0)
6994 {
6995 if (Unit* caster = GetCaster())
6996 {
6997 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
6998
6999 if (Unit* triggerTarget = target->GetNextRandomRaidMemberOrPet(radius))
7000 {
7001 target->CastSpell(triggerTarget, GetSpellInfo(), true, nullptr, this, GetCasterGUID());
7002 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7003 aura->SetCharges(jumps);
7004 }
7005 }
7006 }
7007
7008 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7009 target->CastSpell(target, triggerSpellId, true, nullptr, this, GetCasterGUID());
7010}
void SetUsingCharges(bool val)
Definition SpellAuras.h:201
uint8 GetCharges() const
Definition SpellAuras.h:141
Unit * GetNextRandomRaidMemberOrPet(float radius)
Definition Unit.cpp:8226

References Unit::CastSpell(), SpellInfo::Effects, GetBase(), GetCaster(), GetCasterGUID(), Aura::GetCharges(), GetEffIndex(), GetId(), Unit::GetNextRandomRaidMemberOrPet(), GetSpellInfo(), AuraApplication::GetTarget(), LOG_DEBUG, Aura::SetCharges(), and Aura::SetUsingCharges().

Referenced by HandleProc().

◆ HandleRaidProcFromChargeWithValueAuraProc()

void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7013{
7014 enum
7015 {
7016 SPELL_PRAYER_OF_MENDING_HEAL = 33110,
7017 SPELL_PRAYER_OF_MENDING_VISUAL = 41637
7018 };
7019
7020 Unit* target = aurApp->GetTarget();
7021
7022 // Currently only Prayer of Mending
7023 if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20))
7024 {
7025 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: {}", GetId());
7026 return;
7027 }
7028
7029 int32 value = GetAmount();
7030
7031 int32 jumps = GetBase()->GetCharges();
7032
7033 // current aura expire on proc finish
7034 GetBase()->SetCharges(0);
7035 GetBase()->SetUsingCharges(true);
7036
7037 // next target selection
7038 if (jumps > 0)
7039 {
7040 if (Unit* caster = GetCaster())
7041 {
7042 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7043
7044 Unit* triggerTarget = nullptr;
7045 Acore::MostHPMissingGroupInRange u_check(target, radius, 0);
7046 Acore::UnitLastSearcher<Acore::MostHPMissingGroupInRange> searcher(target, triggerTarget, u_check);
7047 Cell::VisitObjects(target, searcher, radius);
7048
7049 if (triggerTarget)
7050 {
7051 target->CastSpell(triggerTarget, SPELL_PRAYER_OF_MENDING_VISUAL, true);
7052 target->CastCustomSpell(triggerTarget, GetId(), &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7053 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7054 aura->SetCharges(jumps);
7055 }
7056 }
7057 }
7058
7059 target->CastCustomSpell(target, SPELL_PRAYER_OF_MENDING_HEAL, &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7060}
Definition GridNotifiers.h:1509
Definition GridNotifiers.h:397

References Unit::CastCustomSpell(), Unit::CastSpell(), SpellInfo::Effects, GetAmount(), Unit::GetAura(), GetBase(), GetCaster(), GetCasterGUID(), Aura::GetCharges(), GetEffIndex(), GetId(), GetSpellInfo(), AuraApplication::GetTarget(), LOG_DEBUG, Aura::SetCharges(), Aura::SetUsingCharges(), SPELLFAMILY_PRIEST, and Cell::VisitObjects().

Referenced by HandleProc().

◆ HandleRangedAmmoHaste()

void AuraEffect::HandleRangedAmmoHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4834{
4836 return;
4837
4838 Unit* target = aurApp->GetTarget();
4839
4840 if (!target->IsPlayer())
4841 return;
4842
4843 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4844}

References Unit::ApplyAttackTimePercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Object::IsPlayer(), and RANGED_ATTACK.

◆ HandleShapeshiftBoosts()

void AuraEffect::HandleShapeshiftBoosts ( Unit target,
bool  apply 
) const
1344{
1345 uint32 spellId = 0;
1346 uint32 spellId2 = 0;
1347 //uint32 spellId3 = 0;
1348 uint32 HotWSpellId = 0;
1349
1350 switch (GetMiscValue())
1351 {
1352 case FORM_CAT:
1353 spellId = 3025;
1354 HotWSpellId = 24900;
1355 break;
1356 case FORM_TREE:
1357 spellId = 34123;
1358 break;
1359 case FORM_TRAVEL:
1360 spellId = 5419;
1361 break;
1362 case FORM_AQUA:
1363 spellId = 5421;
1364 break;
1365 case FORM_BEAR:
1366 spellId = 1178;
1367 spellId2 = 21178;
1368 HotWSpellId = 24899;
1369 break;
1370 case FORM_DIREBEAR:
1371 spellId = 9635;
1372 spellId2 = 21178;
1373 HotWSpellId = 24899;
1374 break;
1375 case FORM_BATTLESTANCE:
1376 spellId = 21156;
1377 break;
1379 spellId = 7376;
1380 break;
1382 spellId = 7381;
1383 break;
1384 case FORM_MOONKIN:
1385 spellId = 24905;
1386 spellId2 = 69366;
1387 break;
1388 case FORM_FLIGHT:
1389 spellId = 33948;
1390 spellId2 = 34764;
1391 break;
1392 case FORM_FLIGHT_EPIC:
1393 spellId = 40122;
1394 spellId2 = 40121;
1395 break;
1396 case FORM_METAMORPHOSIS:
1397 spellId = 54817;
1398 spellId2 = 54879;
1399 break;
1401 spellId = 27792;
1402 spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation.
1403 break;
1404 case FORM_SHADOW:
1405 spellId = 49868;
1406 spellId2 = 71167;
1407 break;
1408 case FORM_GHOSTWOLF:
1409 spellId = 67116;
1410 break;
1411 case FORM_GHOUL:
1412 case FORM_AMBIENT:
1413 case FORM_STEALTH:
1414 case FORM_CREATURECAT:
1415 case FORM_CREATUREBEAR:
1416 break;
1417 default:
1418 break;
1419 }
1420
1421 Player* player = target->ToPlayer();
1422 if (apply)
1423 {
1424 // Remove cooldown of spells triggered on stance change - they may share cooldown with stance spell
1425 if (spellId)
1426 {
1427 if (player)
1428 player->RemoveSpellCooldown(spellId);
1429 target->CastSpell(target, spellId, true, nullptr, this, target->GetGUID());
1430 }
1431
1432 if (spellId2)
1433 {
1434 if (player)
1435 player->RemoveSpellCooldown(spellId2);
1436 target->CastSpell(target, spellId2, true, nullptr, this, target->GetGUID());
1437 }
1438
1439 if (player)
1440 {
1441 const PlayerSpellMap& sp_list = player->GetSpellMap();
1442 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
1443 {
1444 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(player->GetActiveSpec()))
1445 continue;
1446
1447 if (itr->first == spellId || itr->first == spellId2)
1448 continue;
1449
1450 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
1452 continue;
1453
1454 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1455 target->CastSpell(target, itr->first, true, nullptr, this, target->GetGUID());
1456 }
1457
1458 // xinef: talent stance auras are not on m_spells map, so iterate talents
1459 const PlayerTalentMap& tl_list = player->GetTalentMap();
1460 for (PlayerTalentMap::const_iterator itr = tl_list.begin(); itr != tl_list.end(); ++itr)
1461 {
1462 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(player->GetActiveSpec()))
1463 continue;
1464
1465 if (itr->first == spellId || itr->first == spellId2)
1466 continue;
1467
1468 // Xinef: skip talents with effect learn spell
1469 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
1471 continue;
1472
1473 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1474 target->CastSpell(target, itr->first, true, nullptr, this, target->GetGUID());
1475 }
1476
1477 // Also do it for Glyphs
1478 for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
1479 {
1480 if (uint32 glyphId = player->GetGlyph(i))
1481 {
1482 if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId))
1483 {
1484 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId);
1486 continue;
1487 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1488 target->CastSpell(target, glyph->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)), nullptr, this, target->GetGUID());
1489 }
1490 }
1491 }
1492
1493 // Leader of the Pack
1494 if (player->HasTalent(17007, player->GetActiveSpec()))
1495 {
1496 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24932);
1497 if (spellInfo && spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1498 target->CastSpell(target, 24932, true, nullptr, this, target->GetGUID());
1499 }
1500 // Improved Barkskin - apply/remove armor bonus due to shapeshift
1501 if (player->HasTalent(63410, player->GetActiveSpec()) || player->HasTalent(63411, player->GetActiveSpec()))
1502 {
1503 target->RemoveAurasDueToSpell(66530);
1504 if (GetMiscValue() == FORM_TRAVEL || GetMiscValue() == FORM_NONE) // "while in Travel Form or while not shapeshifted"
1505 target->CastSpell(target, 66530, true);
1506 }
1507 // Heart of the Wild
1508 if (HotWSpellId)
1509 {
1510 // hacky, but the only way as spell family is not SPELLFAMILY_DRUID
1512 for (Unit::AuraEffectList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
1513 {
1514 // Heart of the Wild
1515 if ((*i)->GetSpellInfo()->SpellIconID == 240 && (*i)->GetMiscValue() == STAT_INTELLECT)
1516 {
1517 int32 HotWMod = (*i)->GetAmount() / 2; // For each 2% Intelligence, you get 1% stamina and 1% attack power.
1518
1519 target->CastCustomSpell(target, HotWSpellId, &HotWMod, nullptr, nullptr, true, nullptr, this, target->GetGUID());
1520 break;
1521 }
1522 }
1523 }
1524 switch (GetMiscValue())
1525 {
1526 case FORM_CAT:
1527 // Savage Roar
1528 if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0, 0x10000000, 0))
1529 target->CastSpell(target, 62071, true);
1530 // Nurturing Instinct
1532 {
1533 uint32 spellId3 = 0;
1534 switch (aurEff->GetId())
1535 {
1536 case 33872:
1537 spellId3 = 47179;
1538 break;
1539 case 33873:
1540 spellId3 = 47180;
1541 break;
1542 }
1543 target->CastSpell(target, spellId3, true, nullptr, this, target->GetGUID());
1544 }
1545 // Master Shapeshifter - Cat
1546 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1547 {
1548 int32 bp = aurEff->GetAmount();
1549 target->CastCustomSpell(target, 48420, &bp, nullptr, nullptr, true);
1550 }
1551 break;
1552 case FORM_DIREBEAR:
1553 case FORM_BEAR:
1554 // Master Shapeshifter - Bear
1555 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1556 {
1557 int32 bp = aurEff->GetAmount();
1558 target->CastCustomSpell(target, 48418, &bp, nullptr, nullptr, true);
1559 }
1560 // Survival of the Fittest
1562 {
1563 int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
1564 target->CastCustomSpell(target, 62069, &bp, nullptr, nullptr, true, 0, this, target->GetGUID());
1565 }
1566 break;
1567 case FORM_MOONKIN:
1568 // Master Shapeshifter - Moonkin
1569 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1570 {
1571 int32 bp = aurEff->GetAmount();
1572 target->CastCustomSpell(target, 48421, &bp, nullptr, nullptr, true);
1573 }
1574 // Always cast Moonkin Aura
1575 target->CastSpell(target, 24907, true, nullptr, this, target->GetGUID());
1576 break;
1577 // Master Shapeshifter - Tree of Life
1578 case FORM_TREE:
1579 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1580 {
1581 int32 bp = aurEff->GetAmount();
1582 target->CastCustomSpell(target, 48422, &bp, nullptr, nullptr, true);
1583 }
1584 break;
1585 }
1586 }
1587 }
1588 else
1589 {
1590 if (spellId)
1591 target->RemoveOwnedAura(spellId);
1592 if (spellId2)
1593 target->RemoveOwnedAura(spellId2);
1594
1595 // Improved Barkskin - apply/remove armor bonus due to shapeshift
1596 if (player)
1597 {
1598 if (player->HasTalent(63410, player->GetActiveSpec()) || player->HasTalent(63411, player->GetActiveSpec()))
1599 {
1600 target->RemoveAurasDueToSpell(66530);
1601 target->CastSpell(target, 66530, true);
1602 }
1603 }
1604
1606 AuraEffect* newAura = nullptr;
1607 // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied
1608 for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr)
1609 {
1610 if ((*itr) != this)
1611 {
1612 newAura = *itr;
1613 break;
1614 }
1615 }
1616
1617 // Use the new aura to see on what stance the target will be
1618 uint32 newStance = (1 << ((newAura ? newAura->GetMiscValue() : 0) - 1));
1619
1620 Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras();
1621 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
1622 {
1623 // If the stances are not compatible with the spell, remove it
1624 // Xinef: Remove all passive auras, they will be added if needed
1625 if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && (!(itr->second->GetBase()->GetSpellInfo()->Stances & newStance) || itr->second->GetBase()->IsPassive()))
1626 target->RemoveAura(itr);
1627 else
1628 ++itr;
1629 }
1630
1631 // Xinef: Remove autoattack spells
1632 if (Spell* spell = target->GetCurrentSpell(CURRENT_MELEE_SPELL))
1633 if (spell->GetSpellInfo()->CheckShapeshift(newAura ? newAura->GetMiscValue() : 0) != SPELL_CAST_OK)
1634 spell->cancel(true);
1635 }
1636}
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
@ EFFECT_2
Definition SharedDefines.h:33
@ SPELL_EFFECT_LEARN_SPELL
Definition SharedDefines.h:802
#define MAX_GLYPH_SLOT_INDEX
Definition SharedDefines.h:664
SpellAttr0
Definition SharedDefines.h:369
@ SPELL_ATTR0_PASSIVE
Definition SharedDefines.h:376
@ SPELL_ATTR0_DO_NOT_DISPLAY
Definition SharedDefines.h:377
@ STAT_INTELLECT
Definition SharedDefines.h:249
@ SPELL_CAST_OK
Definition SharedDefines.h:1126
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
Definition SpellAuraDefines.h:238
@ TRIGGERED_IGNORE_CASTER_AURASTATE
Will ignore shapeshift checks.
Definition SpellDefines.h:145
@ TRIGGERED_IGNORE_SHAPESHIFT
Will not adjust facing to target (if any)
Definition SpellDefines.h:144
uint32 GetGlyph(uint8 slot) const
Definition Player.h:1781
bool HasTalent(uint32 spell_id, uint8 spec) const
Definition Player.cpp:3876
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3514
uint32 Stances
Definition SpellInfo.h:357
bool HasEffect(SpellEffects effect) const
Definition SpellInfo.cpp:885
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4967
Definition DBCStructure.h:1024

References Unit::CastCustomSpell(), Unit::CastSpell(), CURRENT_MELEE_SPELL, EFFECT_2, FORM_AMBIENT, FORM_AQUA, FORM_BATTLESTANCE, FORM_BEAR, FORM_BERSERKERSTANCE, FORM_CAT, FORM_CREATUREBEAR, FORM_CREATURECAT, FORM_DEFENSIVESTANCE, FORM_DIREBEAR, FORM_FLIGHT, FORM_FLIGHT_EPIC, FORM_GHOSTWOLF, FORM_GHOUL, FORM_METAMORPHOSIS, FORM_MOONKIN, FORM_NONE, FORM_SHADOW, FORM_SPIRITOFREDEMPTION, FORM_STEALTH, FORM_TRAVEL, FORM_TREE, Player::GetActiveSpec(), Unit::GetAppliedAuras(), Unit::GetAuraEffect(), Unit::GetAuraEffectsByType(), Unit::GetCurrentSpell(), Unit::GetDummyAuraEffect(), Player::GetGlyph(), Object::GetGUID(), GetMiscValue(), Player::GetSpellMap(), Player::GetTalentMap(), SpellInfo::HasAttribute(), SpellInfo::HasEffect(), Player::HasTalent(), MAX_GLYPH_SLOT_INDEX, PLAYERSPELL_REMOVED, Unit::RemoveAura(), Unit::RemoveAurasDueToSpell(), Unit::RemoveOwnedAura(), Player::RemoveSpellCooldown(), sGlyphPropertiesStore, SPELL_ATTR0_DO_NOT_DISPLAY, SPELL_ATTR0_PASSIVE, SPELL_AURA_DUMMY, SPELL_AURA_MOD_SHAPESHIFT, SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELL_CAST_OK, SPELL_EFFECT_LEARN_SPELL, SPELLFAMILY_DRUID, SPELLFAMILY_GENERIC, sSpellMgr, SpellInfo::Stances, STAT_INTELLECT, Object::ToPlayer(), TRIGGERED_FULL_MASK, TRIGGERED_IGNORE_CASTER_AURASTATE, and TRIGGERED_IGNORE_SHAPESHIFT.

Referenced by HandleAuraModShapeshift().

◆ HandleShieldBlockValue()

void AuraEffect::HandleShieldBlockValue ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5038{
5040 return;
5041
5042 Player* target = aurApp->GetTarget()->ToPlayer();
5043 if (!target)
5044 return;
5045
5046 target->HandleBaseModFlatValue(SHIELD_BLOCK_VALUE, float(GetAmount()), apply);
5047}
@ SHIELD_BLOCK_VALUE
Definition Unit.h:189
void HandleBaseModFlatValue(BaseModGroup modGroup, float amount, bool apply)
Definition Player.cpp:4924

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Player::HandleBaseModFlatValue(), SHIELD_BLOCK_VALUE, and Object::ToPlayer().

◆ HandleShieldBlockValuePercent()

void AuraEffect::HandleShieldBlockValuePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5050{
5052 return;
5053
5054 Player* target = aurApp->GetTarget()->ToPlayer();
5055 if (!target)
5056 return;
5057
5058 if (apply)
5060 else
5061 {
5063 target->SetBaseModPctValue(SHIELD_BLOCK_VALUE, amount);
5064 }
5065}
@ SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
Definition SpellAuraDefines.h:213
void SetBaseModPctValue(BaseModGroup modGroup, float val)
Definition Player.cpp:4959
void ApplyBaseModPctValue(BaseModGroup modGroup, float pct)
Definition Player.cpp:4937

References Player::ApplyBaseModPctValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplier(), Player::SetBaseModPctValue(), SHIELD_BLOCK_VALUE, SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT, and Object::ToPlayer().

◆ HandleSpiritOfRedemption()

void AuraEffect::HandleSpiritOfRedemption ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1863{
1864 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1865 return;
1866
1867 Unit* target = aurApp->GetTarget();
1868
1869 if (!target->IsPlayer())
1870 return;
1871
1872 // prepare spirit state
1873 if (apply)
1874 {
1875 // disable breath/etc timers
1876 target->ToPlayer()->StopMirrorTimers();
1877
1878 // set stand state (expected in this form)
1879 if (!target->IsStandState())
1881
1882 target->SetHealth(1);
1883 }
1884 // die at aura end
1885 else if (target->IsAlive())
1886 // call functions which may have additional effects after chainging state of unit
1888
1889 // xinef: damage immunity spell, not needed because of 93 aura (adds non_attackable state)
1890 // xinef: probably blizzard added it just in case in wotlk (id > 46000)
1891 if (apply)
1892 target->CastSpell(target, 62371, true);
1893 else
1894 target->RemoveAurasDueToSpell(62371);
1895}
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:35
void StopMirrorTimers()
Definition Player.h:2075
virtual void setDeathState(DeathState s, bool despawn=false)
Definition Unit.cpp:11359
bool IsStandState() const
Definition Unit.cpp:13098
void SetStandState(uint8 state)
Definition Unit.cpp:13113

References AURA_EFFECT_HANDLE_REAL, Unit::CastSpell(), AuraApplication::GetTarget(), Unit::IsAlive(), Object::IsPlayer(), Unit::IsStandState(), JustDied, Unit::RemoveAurasDueToSpell(), Unit::setDeathState(), Unit::SetHealth(), Unit::SetStandState(), Player::StopMirrorTimers(), Object::ToPlayer(), and UNIT_STAND_STATE_STAND.

◆ HandleUnused()

void AuraEffect::HandleUnused ( AuraApplication const *  ,
uint8  ,
bool   
) const
inline
158 {
159 // useless
160 }

◆ HandleWaterBreathing()

void AuraEffect::HandleWaterBreathing ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3519{
3521 return;
3522
3523 Unit* target = aurApp->GetTarget();
3524
3525 // update timers in client
3526 if (target->IsPlayer())
3527 target->ToPlayer()->UpdateMirrorTimers();
3528}
void UpdateMirrorTimers()
Definition PlayerUpdates.cpp:427

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Object::IsPlayer(), Object::ToPlayer(), and Player::UpdateMirrorTimers().

◆ HasSpellClassMask()

bool AuraEffect::HasSpellClassMask ( ) const
1117{
1118 return m_spellInfo->Effects[m_effIndex].SpellClassMask;
1119}

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by Unit::CalcArmorReducedDamage().

◆ IsAffectedOnSpell()

◆ IsPeriodic()

bool AuraEffect::IsPeriodic ( ) const
inline
92{ return m_isPeriodic; }

References m_isPeriodic.

Referenced by Spell::prepare().

◆ PeriodicTick()

void AuraEffect::PeriodicTick ( AuraApplication aurApp,
Unit caster 
) const
1128{
1129 bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp);
1130 if (prevented)
1131 return;
1132
1133 Unit* target = aurApp->GetTarget();
1134
1135 // Update serverside orientation of tracking channeled auras on periodic update ticks
1136 // exclude players because can turn during channeling and shouldn't desync orientation client/server
1138 {
1139 ObjectGuid const channelGuid = caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT);
1140 if (!channelGuid.IsEmpty() && channelGuid != caster->GetGUID())
1141 {
1142 if (WorldObject const* objectTarget = ObjectAccessor::GetWorldObject(*caster, channelGuid))
1143 {
1144 caster->SetInFront(objectTarget);
1145 }
1146 }
1147 }
1148
1149 switch (GetAuraType())
1150 {
1152 HandlePeriodicDummyAuraTick(target, caster);
1153 break;
1155 HandlePeriodicTriggerSpellAuraTick(target, caster);
1156 break;
1158 // Don't actually do anything - client will trigger casts of these spells by itself
1159 break;
1162 break;
1165 HandlePeriodicDamageAurasTick(target, caster);
1166 break;
1168 HandlePeriodicHealthLeechAuraTick(target, caster);
1169 break;
1171 HandlePeriodicHealthFunnelAuraTick(target, caster);
1172 break;
1175 HandlePeriodicHealAurasTick(target, caster);
1176 break;
1178 HandlePeriodicManaLeechAuraTick(target, caster);
1179 break;
1181 HandleObsModPowerAuraTick(target, caster);
1182 break;
1184 HandlePeriodicEnergizeAuraTick(target, caster);
1185 break;
1187 HandlePeriodicPowerBurnAuraTick(target, caster);
1188 break;
1189 default:
1190 break;
1191 }
1192}
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
Definition SharedDefines.h:421
void HandlePeriodicPowerBurnAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6846
void HandlePeriodicManaLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6707
void HandleObsModPowerAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6778
void HandlePeriodicHealthFunnelAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6537
void HandlePeriodicHealAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6566
void HandlePeriodicEnergizeAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6812
void HandlePeriodicTriggerSpellAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:5998
void HandlePeriodicDummyAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:5941
void HandlePeriodicHealthLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6427
void HandlePeriodicDamageAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6275
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6241
bool CallScriptEffectPeriodicHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp)
Definition SpellAuras.cpp:2475
bool IsEmpty() const
Definition ObjectGuid.h:161
bool IsChanneled() const
Definition SpellInfo.cpp:1288
void SetInFront(WorldObject const *target)
Definition Unit.cpp:16438
Definition Object.h:475
WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:115

References Aura::CallScriptEffectPeriodicHandlers(), GetAuraType(), GetBase(), Object::GetGUID(), Object::GetGuidValue(), AuraApplication::GetTarget(), ObjectAccessor::GetWorldObject(), HandleObsModPowerAuraTick(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), SpellInfo::HasAttribute(), SpellInfo::IsChanneled(), ObjectGuid::IsEmpty(), Object::IsPlayer(), m_spellInfo, Unit::SetInFront(), SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL, SPELL_AURA_OBS_MOD_HEALTH, SPELL_AURA_OBS_MOD_POWER, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE_PERCENT, SPELL_AURA_PERIODIC_DUMMY, SPELL_AURA_PERIODIC_ENERGIZE, SPELL_AURA_PERIODIC_HEAL, SPELL_AURA_PERIODIC_HEALTH_FUNNEL, SPELL_AURA_PERIODIC_LEECH, SPELL_AURA_PERIODIC_MANA_LEECH, SPELL_AURA_PERIODIC_TRIGGER_SPELL, SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_POWER_BURN, and UNIT_FIELD_CHANNEL_OBJECT.

Referenced by Update().

◆ RecalculateAmount() [1/2]

◆ RecalculateAmount() [2/2]

void AuraEffect::RecalculateAmount ( Unit caster)
inline
77{ if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }

References CalculateAmount(), CanBeRecalculated(), and ChangeAmount().

◆ ResetPeriodic()

void AuraEffect::ResetPeriodic ( bool  resetPeriodicTimer = false)
inline
89{ if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;}

References m_amplitude, m_periodicTimer, and m_tickNumber.

Referenced by spell_dk_death_rune::HandleProc().

◆ ResetTicks()

void AuraEffect::ResetTicks ( )
inline
90{ m_tickNumber = 0; }

References m_tickNumber.

◆ SendTickImmune()

◆ SetAmount()

◆ SetCanBeRecalculated()

void AuraEffect::SetCanBeRecalculated ( bool  val)
inline
79{ m_canBeRecalculated = val; }

References m_canBeRecalculated.

Referenced by Aura::SetLoadedState().

◆ SetCritChance()

void AuraEffect::SetCritChance ( float  crit)
inline
110{ m_critChance = crit; }

References m_critChance.

Referenced by CalculatePeriodicData().

◆ SetEnabled()

void AuraEffect::SetEnabled ( bool  enabled)
inline
118{ m_isAuraEnabled = enabled; }

References m_isAuraEnabled.

◆ SetOldAmount()

void AuraEffect::SetOldAmount ( int32  amount)
inline
117{ m_oldAmount = amount; }

References m_oldAmount.

Referenced by CalculateAmount().

◆ SetPctMods()

void AuraEffect::SetPctMods ( float  pctMods)
inline
114{ m_pctMods = pctMods; }

References m_pctMods.

◆ SetPeriodic()

void AuraEffect::SetPeriodic ( bool  isPeriodic)
inline
93{ m_isPeriodic = isPeriodic; }

References m_isPeriodic.

Referenced by spell_gen_arena_drink::UpdatePeriodic().

◆ SetPeriodicTimer()

◆ Update()

void AuraEffect::Update ( uint32  diff,
Unit caster 
)
925{
926 if (m_isPeriodic && (GetBase()->GetDuration() >= 0 || GetBase()->IsPassive() || GetBase()->IsPermanent()))
927 {
928 uint32 totalTicks = GetTotalTicks();
929
930 m_periodicTimer -= int32(diff);
931 while (m_periodicTimer <= 0)
932 {
933 if (!GetBase()->IsPermanent() && (m_tickNumber + 1) > totalTicks)
934 {
935 break;
936 }
937
938 ++m_tickNumber;
939
940 // update before tick (aura can be removed in TriggerSpell or PeriodicTick calls)
942 UpdatePeriodic(caster);
943
944 std::list<AuraApplication*> effectApplications;
945 GetApplicationList(effectApplications);
946 // tick on targets of effects
947 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
948 if ((*apptItr)->HasEffect(GetEffIndex()))
949 PeriodicTick(*apptItr, caster);
950 }
951 }
952}
int32 GetTotalTicks() const
Definition SpellAuraEffects.cpp:7062
void PeriodicTick(AuraApplication *aurApp, Unit *caster) const
Definition SpellAuraEffects.cpp:1127
void UpdatePeriodic(Unit *caster)
Definition SpellAuraEffects.cpp:954

References GetApplicationList(), GetBase(), GetEffIndex(), GetTotalTicks(), m_amplitude, m_isPeriodic, m_periodicTimer, m_tickNumber, PeriodicTick(), and UpdatePeriodic().

Referenced by Aura::UpdateOwner().

◆ UpdatePeriodic()

void AuraEffect::UpdatePeriodic ( Unit caster)
955{
956 switch (GetAuraType())
957 {
959 switch (GetSpellInfo()->SpellFamilyName)
960 {
962 switch (GetId())
963 {
964 // Drink
965 case 430:
966 case 431:
967 case 432:
968 case 1133:
969 case 1135:
970 case 1137:
971 case 10250:
972 case 22734:
973 case 27089:
974 case 34291:
975 case 43182:
976 case 43183:
977 case 46755:
978 case 49472: // Drink Coffee
979 case 57073:
980 case 61830:
981 if (!caster || !caster->IsPlayer())
982 return;
983 // Get SPELL_AURA_MOD_POWER_REGEN aura from spell
984 if (AuraEffect* aurEff = GetBase()->GetEffect(0))
985 {
986 if (aurEff->GetAuraType() != SPELL_AURA_MOD_POWER_REGEN)
987 {
988 m_isPeriodic = false;
989 LOG_ERROR("spells.aura.effect", "Aura {} structure has been changed - first aura is no longer SPELL_AURA_MOD_POWER_REGEN", GetId());
990 }
991 else
992 {
993 // default case - not in arena
994 if (!caster->ToPlayer()->InArena())
995 {
996 aurEff->ChangeAmount(GetAmount());
997 m_isPeriodic = false;
998 }
999 else
1000 {
1001 // **********************************************
1002 // This feature uses only in arenas
1003 // **********************************************
1004 // Here need increase mana regen per tick (6 second rule)
1005 // on 0 tick - 0 (handled in 2 second)
1006 // on 1 tick - 166% (handled in 4 second)
1007 // on 2 tick - 133% (handled in 6 second)
1008
1009 // Apply bonus for 1 - 4 tick
1010 switch (m_tickNumber)
1011 {
1012 case 1: // 0%
1013 aurEff->ChangeAmount(0);
1014 break;
1015 case 2: // 166%
1016 aurEff->ChangeAmount(GetAmount() * 5 / 3);
1017 break;
1018 case 3: // 133%
1019 aurEff->ChangeAmount(GetAmount() * 4 / 3);
1020 break;
1021 default: // 100% - normal regen
1022 aurEff->ChangeAmount(GetAmount());
1023 // No need to update after 4th tick
1024 m_isPeriodic = false;
1025 break;
1026 }
1027 }
1028 }
1029 }
1030 break;
1031 case 58549: // Tenacity
1032 case 59911: // Tenacity (vehicle)
1034 break;
1035 case 66823:
1036 case 67618:
1037 case 67619:
1038 case 67620: // Paralytic Toxin
1039 // Get 0 effect aura
1040 if (AuraEffect* slow = GetBase()->GetEffect(0))
1041 {
1042 int32 newAmount = slow->GetAmount() - 10;
1043 if (newAmount < -100)
1044 newAmount = -100;
1045 slow->ChangeAmount(newAmount);
1046 }
1047 break;
1048 case 66020:
1049 // Get 0 effect aura
1050 if (AuraEffect* slow = GetBase()->GetEffect(0))
1051 {
1052 int32 newAmount = slow->GetAmount() + GetAmount();
1053 if (newAmount > 0)
1054 newAmount = 0;
1055 slow->ChangeAmount(newAmount);
1056 }
1057 break;
1058 default:
1059 break;
1060 }
1061 break;
1062 default:
1063 break;
1064 }
1065 default:
1066 break;
1067 }
1069}
@ SPELL_AURA_MOD_POWER_REGEN
Definition SpellAuraDefines.h:148
void RefreshDuration(bool withMods=false)
Definition SpellAuras.cpp:822
void CallScriptEffectUpdatePeriodicHandlers(AuraEffect *aurEff)
Definition SpellAuras.cpp:2495
bool InArena() const
Definition Player.cpp:12273

References Aura::CallScriptEffectUpdatePeriodicHandlers(), GetAmount(), GetAuraType(), GetBase(), GetId(), GetSpellInfo(), Player::InArena(), Object::IsPlayer(), LOG_ERROR, m_isPeriodic, m_tickNumber, Aura::RefreshDuration(), SPELL_AURA_MOD_POWER_REGEN, SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_GENERIC, and Object::ToPlayer().

Referenced by Update().

Friends And Related Symbol Documentation

◆ Aura::_InitEffects

void Aura::_InitEffects ( uint8  effMask,
Unit caster,
int32 baseAmount 
)
friend

◆ Unit::_TryStackingOrRefreshingExistingAura

Aura * Unit::_TryStackingOrRefreshingExistingAura ( SpellInfo const *  newAura,
uint8  effMask,
Unit caster,
int32 baseAmount,
Item castItem,
ObjectGuid  casterGUID,
bool  noPeriodicReset 
)
friend

Member Data Documentation

◆ m_amount

◆ m_amplitude

int32 AuraEffect::m_amplitude
private

◆ m_applyResilience

bool AuraEffect::m_applyResilience
private

Referenced by AuraEffect(), and CanApplyResilience().

◆ m_base

Aura* const AuraEffect::m_base
private

Referenced by GetBase().

◆ m_baseAmount

int32 const AuraEffect::m_baseAmount
private

Referenced by CalculateAmount(), and GetBaseAmount().

◆ m_canBeRecalculated

bool AuraEffect::m_canBeRecalculated
private

◆ m_casterLevel

uint8 AuraEffect::m_casterLevel
private

Referenced by AuraEffect(), and GetCasterLevel().

◆ m_channelData

◆ m_critChance

float AuraEffect::m_critChance
private

Referenced by GetCritChance(), and SetCritChance().

◆ m_dieSides

int32 const AuraEffect::m_dieSides
private

Referenced by GetDieSides().

◆ m_effIndex

◆ m_isAuraEnabled

bool AuraEffect::m_isAuraEnabled
private

Referenced by GetAmount(), and SetEnabled().

◆ m_isPeriodic

bool AuraEffect::m_isPeriodic
private

◆ m_isRecalculatingPassiveAuras

bool AuraEffect::m_isRecalculatingPassiveAuras = false
private

Referenced by ApplySpellMod().

◆ m_oldAmount

int32 AuraEffect::m_oldAmount
private

Referenced by GetOldAmount(), and SetOldAmount().

◆ m_pctMods

float AuraEffect::m_pctMods
private

◆ m_periodicTimer

int32 AuraEffect::m_periodicTimer
private

◆ m_spellInfo

◆ m_spellmod

SpellModifier* AuraEffect::m_spellmod
private

◆ m_tickNumber


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