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)
 
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)
 
uint32 GetAuraGroup () const
 
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 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 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 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
 
uint32 m_auraGroup
 
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
 

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
407{
408 delete m_spellmod;
409 delete m_channelData;
410}
ChannelTargetData * m_channelData
Definition SpellAuraEffects.h:139
SpellModifier * m_spellmod
Definition SpellAuraEffects.h:141

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_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(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 m_auraGroup = sSpellMgr->GetSpellGroup(GetId());
397
399
400 // Xinef: channel data structure
401 if (caster)
402 if (Spell* spell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
403 m_channelData = new ChannelTargetData(caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : nullptr);
404}
#define sSpellMgr
Definition SpellMgr.h:825
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:540
@ UNIT_FIELD_CHANNEL_OBJECT
Definition UpdateFields.h:93
int32 m_periodicTimer
Definition SpellAuraEffects.h:143
bool m_canBeRecalculated
Definition SpellAuraEffects.h:148
uint8 const m_effIndex
Definition SpellAuraEffects.h:147
uint8 m_casterLevel
Definition SpellAuraEffects.h:129
bool m_applyResilience
Definition SpellAuraEffects.h:128
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:136
uint32 GetId() const
Definition SpellAuraEffects.cpp:433
int32 CalculateAmount(Unit *caster)
Definition SpellAuraEffects.cpp:453
int32 m_amount
Definition SpellAuraEffects.h:130
void CalculatePeriodicData()
Definition SpellAuraEffects.cpp:584
uint32 m_tickNumber
Definition SpellAuraEffects.h:145
int32 const m_baseAmount
Definition SpellAuraEffects.h:125
SpellInfo const *const m_spellInfo
Definition SpellAuraEffects.h:124
bool m_isAuraEnabled
Definition SpellAuraEffects.h:137
bool m_isPeriodic
Definition SpellAuraEffects.h:149
uint32 m_auraGroup
Definition SpellAuraEffects.h:135
int32 const m_dieSides
Definition SpellAuraEffects.h:126
float m_critChance
Definition SpellAuraEffects.h:131
Aura *const m_base
Definition SpellAuraEffects.h:122
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:337
Definition Spell.h:287
bool CanApplyResilience() const
Definition Unit.h:1093
uint8 GetLevel() const
Definition Unit.h:1024
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1493
Definition Spell.h:244

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

Member Function Documentation

◆ ApplySpellMod()

void AuraEffect::ApplySpellMod ( Unit target,
bool  apply 
)
807{
808 if (!m_spellmod || !target->IsPlayer())
809 return;
810
811 target->ToPlayer()->AddSpellMod(m_spellmod, apply);
812
813 // Auras with charges do not mod amount of passive auras
814 if (GetBase()->IsUsingCharges())
815 return;
816 // reapply some passive spells after add/remove related spellmods
817 // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
818 switch (GetMiscValue())
819 {
821 case SPELLMOD_EFFECT1:
822 case SPELLMOD_EFFECT2:
823 case SPELLMOD_EFFECT3:
824 {
825 ObjectGuid guid = target->GetGUID();
826 Unit::AuraApplicationMap& auras = target->GetAppliedAuras();
827 for (Unit::AuraApplicationMap::iterator iter = auras.begin(); iter != auras.end(); ++iter)
828 {
829 Aura* aura = iter->second->GetBase();
830 // only passive and permament auras-active auras should have amount set on spellcast and not be affected
831 // if aura is casted by others, it will not be affected
832 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
833 {
835 {
836 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
837 {
838 if (AuraEffect* aurEff = aura->GetEffect(i))
839 aurEff->RecalculateAmount();
840 }
841 }
842 else if (GetMiscValue() == SPELLMOD_EFFECT1)
843 {
844 if (AuraEffect* aurEff = aura->GetEffect(0))
845 aurEff->RecalculateAmount();
846 }
847 else if (GetMiscValue() == SPELLMOD_EFFECT2)
848 {
849 if (AuraEffect* aurEff = aura->GetEffect(1))
850 aurEff->RecalculateAmount();
851 }
852 else //if (modOp == SPELLMOD_EFFECT3)
853 {
854 if (AuraEffect* aurEff = aura->GetEffect(2))
855 aurEff->RecalculateAmount();
856 }
857 }
858 }
859
860 Pet* pet = target->ToPlayer()->GetPet();
861 if (!pet)
862 break;
863
864 ObjectGuid petguid = pet->GetGUID();
865 Unit::AuraApplicationMap& petauras = pet->GetAppliedAuras();
866 for (Unit::AuraApplicationMap::iterator iter = petauras.begin(); iter != petauras.end(); ++iter)
867 {
868 Aura* aura = iter->second->GetBase();
869 // only passive auras-active auras should have amount set on spellcast and not be affected
870 // if aura is casted by others, it will not be affected
871 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == petguid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
872 {
874 {
875 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
876 {
877 if (AuraEffect* aurEff = aura->GetEffect(i))
878 aurEff->RecalculateAmount();
879 }
880 }
881 else if (GetMiscValue() == SPELLMOD_EFFECT1)
882 {
883 if (AuraEffect* aurEff = aura->GetEffect(0))
884 aurEff->RecalculateAmount();
885 }
886 else if (GetMiscValue() == SPELLMOD_EFFECT2)
887 {
888 if (AuraEffect* aurEff = aura->GetEffect(1))
889 aurEff->RecalculateAmount();
890 }
891 else //if (modOp == SPELLMOD_EFFECT3)
892 {
893 if (AuraEffect* aurEff = aura->GetEffect(2))
894 aurEff->RecalculateAmount();
895 }
896 }
897 }
898 }
899 default:
900 break;
901 }
902}
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1638
std::uint8_t uint8
Definition Define.h:109
@ 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
int32 GetMiscValue() const
Definition SpellAuraEffects.cpp:443
Aura * GetBase() const
Definition SpellAuraEffects.h:49
Definition SpellAuras.h:87
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:105
AuraEffect * GetEffect(uint8 effIndex) const
Definition SpellAuras.h:175
bool IsPassive() const
Definition SpellAuras.cpp:1082
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:113
Definition Pet.h:41
Pet * GetPet() const
Definition Player.cpp:8917
void AddSpellMod(SpellModifier *mod, bool apply)
Definition Player.cpp:9836
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition SpellInfo.cpp:1293
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:629
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1304

References Player::AddSpellMod(), Unit::GetAppliedAuras(), GetBase(), Aura::GetCasterGUID(), Aura::GetEffect(), Object::GetGUID(), GetMiscValue(), Player::GetPet(), Aura::GetSpellInfo(), SpellInfo::IsAffectedBySpellMod(), Aura::IsPassive(), Aura::IsPermanent(), Object::IsPlayer(), 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
1052{
1053 float critChance = 0.0f;
1054 if (caster)
1055 {
1056 if (Player* modOwner = caster->GetSpellModOwner())
1057 {
1058 Unit::AuraEffectList const& mPeriodicCritAuras = modOwner->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
1059 for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
1060 {
1061 if ((*itr)->IsAffectedOnSpell(GetSpellInfo()))
1062 {
1063 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
1064 break;
1065 }
1066 }
1067
1068 switch (GetSpellInfo()->SpellFamilyName)
1069 {
1070 // Rupture - since 3.3.3 can crit
1071 case SPELLFAMILY_ROGUE:
1072 if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100000)
1073 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
1074 break;
1075 }
1076 }
1077 }
1078 if (target && critChance > 0.0f)
1079 critChance = target->SpellTakenCritChance(caster, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), critChance, BASE_ATTACK, true);
1080
1081 return std::max(0.0f, critChance);
1082}
@ SPELL_DAMAGE_CLASS_RANGED
Definition SharedDefines.h:1548
@ SPELLFAMILY_ROGUE
Definition SharedDefines.h:3552
@ SPELL_AURA_ABILITY_PERIODIC_CRIT
Definition SpellAuraDefines.h:349
@ BASE_ATTACK
Definition Unit.h:210
@ RANGED_ATTACK
Definition Unit.h:212
SpellInfo const * GetSpellInfo() const
Definition SpellAuraEffects.h:54
Definition Player.h:1083
flag96 SpellFamilyFlags
Definition SpellInfo.h:388
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1998
uint32 DmgClass
Definition SpellInfo.h:389
uint32 SpellFamilyName
Definition SpellInfo.h:387
Player * GetSpellModOwner() const
Definition Unit.cpp:16610
std::list< AuraEffect * > AuraEffectList
Definition Unit.h:636

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)
454{
455 int32 amount;
456 // default amount calculation
457 amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
458
459 // check item enchant aura cast
460 if (!amount && caster)
461 if (ObjectGuid itemGUID = GetBase()->GetCastItemGUID())
462 if (Player* playerCaster = caster->ToPlayer())
463 if (Item* castItem = playerCaster->GetItemByGuid(itemGUID))
464 if (castItem->GetItemSuffixFactor())
465 {
466 ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(std::abs(castItem->GetItemRandomPropertyId()));
467 if (item_rand_suffix)
468 {
469 for (uint8 k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++)
470 {
471 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]);
472 if (pEnchant)
473 {
474 for (uint8 t = 0; t < MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS; t++)
475 if (pEnchant->spellid[t] == m_spellInfo->Id)
476 {
477 amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
478 break;
479 }
480 }
481
482 if (amount)
483 break;
484 }
485 }
486 }
487
488 // custom amount calculations go here
489 // xinef: normal auras
490 switch (GetAuraType())
491 {
492 // crowd control auras
498 {
499 m_canBeRecalculated = false;
500 if (!m_spellInfo->ProcFlags || m_spellInfo->HasAura(SPELL_AURA_PROC_TRIGGER_SPELL)) // xinef: skip auras with proctriggerspell, they must have procflags...
501 break;
502 if (!caster)
503 break;
504 // not impacted by gear
505 // not impacted by target level
506 // not impacted by rank
507 // asumption - depends on caster level
508 amount = sObjectMgr->GetCreatureBaseStats(caster->GetLevel(), Classes::CLASS_WARRIOR)->BaseHealth[EXPANSION_WRATH_OF_THE_LICH_KING] / 4.75f;
509 // Glyphs increasing damage cap
511 for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
512 {
513 if ((*itr)->IsAffectedOnSpell(m_spellInfo))
514 {
515 // Glyph of Fear, Glyph of Frost nova and similar auras
516 if ((*itr)->GetMiscValue() == 7801)
517 {
518 AddPct(amount, (*itr)->GetAmount());
519 break;
520 }
521 }
522 }
523 break;
524 }
527 m_canBeRecalculated = false;
528 break;
530 // Titan's Grip
531 if (!caster)
532 break;
533 if (GetId() == 49152 && caster->ToPlayer())
534 {
535 Item* item1 = caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
536 Item* item2 = caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
537
538 if (!item2)
539 item2 = caster->ToPlayer()->GetShield();
540
541 if (item1 && item2
543 {
544 amount = -10;
545 }
546 else
547 amount = 0;
548 }
549 break;
550 default:
551 break;
552 }
553
554 // xinef: save base amount, before calculating sp etc. Used for Unit::CastDelayedSpellWithPeriodicAmount
555 SetOldAmount(amount * GetBase()->GetStackAmount());
557
558 // Xinef: Periodic auras
559 if (caster)
560 switch (GetAuraType())
561 {
564 // xinef: save caster depending auras, always pass 1 as stack amount, effect will be multiplicated at the end of the function by correct value!
565 if (GetBase()->GetType() == UNIT_AURA_TYPE)
566 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
567 break;
569 if (GetBase()->GetType() == UNIT_AURA_TYPE)
570 amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
571 break;
573 if (GetBase()->GetType() == UNIT_AURA_TYPE)
574 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE, 0.0f, 1);
575 break;
576 default:
577 break;
578 }
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:1839
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition DBCStructure.h:1205
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:1650
@ CLASS_WARRIOR
Definition SharedDefines.h:141
@ 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:211
@ DOT
Definition Unit.h:251
@ SPELL_DIRECT_DAMAGE
Definition Unit.h:250
T AddPct(T &base, U pct)
Definition Util.h:67
void SetOldAmount(int32 amount)
Definition SpellAuraEffects.h:118
AuraType GetAuraType() const
Definition SpellAuraEffects.cpp:448
float GetPctMods() const
Definition SpellAuraEffects.h:112
uint32 GetEffIndex() const
Definition SpellAuraEffects.h:56
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition SpellAuras.cpp:2517
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:523
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition PlayerStorage.cpp:488
uint32 Id
Definition SpellInfo.h:320
uint32 ProcFlags
Definition SpellInfo.h:355
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:393
bool HasAura(AuraType aura) const
Definition SpellInfo.cpp:893
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1349
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition Unit.cpp:12496
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition Unit.cpp:11659
Definition DBCStructure.h:1218
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > AllocationPct
Definition DBCStructure.h:1225
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition DBCStructure.h:1223
uint32 InventoryType
Definition ItemTemplate.h:632
Definition DBCStructure.h:1842
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition DBCStructure.h:1848

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:576
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition SharedDefines.h:580
@ 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 m_amplitude
Definition SpellAuraEffects.h:144
int32 GetDuration() const
Definition SpellAuras.h:133
void SetDuration(int32 duration, bool withMods=false)
Definition SpellAuras.cpp:868
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition SpellAuras.cpp:2531
float GetFloatValue(uint16 index) const
Definition Object.cpp:317
void ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell *spell=nullptr, bool temporaryPet=false)
Definition Player.cpp:9739
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:415
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition Unit.cpp:5794
bool IsTotem() const
Definition Unit.h:749

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 {
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:1051
float m_pctMods
Definition SpellAuraEffects.h:132
Unit * GetCaster() const
Definition SpellAuraEffects.h:47
void SetCritChance(float crit)
Definition SpellAuraEffects.h:109
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition Unit.cpp:12404
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition Unit.cpp:11328

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;
706 }
708 break;
709 default:
710 break;
711 }
713}
SpellModType
Definition Player.h:92
@ 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:2545
uint8 GetCharges() const
Definition SpellAuras.h:141
uint32 SpellPriority
Definition SpellInfo.h:382
Definition Player.h:181
uint32 priority
Definition Player.h:190
int16 charges
Definition Player.h:185
SpellModOp op
Definition Player.h:183
SpellModType type
Definition Player.h:184
int32 value
Definition Player.h:186
uint32 spellId
Definition Player.h:188
flag96 mask
Definition Player.h:187

References Aura::CallScriptEffectCalcSpellModHandlers(), SpellModifier::charges, SpellInfo::Effects, GetAmount(), GetAuraType(), GetBase(), Aura::GetCharges(), GetEffIndex(), GetId(), GetMiscValue(), GetSpellInfo(), m_spellmod, SpellModifier::mask, SpellModifier::op, SpellModifier::priority, SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SpellModifier::spellId, SpellInfo::SpellPriority, 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 
)
716{
717 // Reapply if amount change
718 uint8 handleMask = 0;
719 if (newAmount != GetAmount())
721 if (onStackOrReapply)
722 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
723
724 if (!handleMask)
725 return;
726
727 std::list<AuraApplication*> effectApplications;
728 GetApplicationList(effectApplications);
729
730 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
731 if ((*apptItr)->HasEffect(GetEffIndex()))
732 HandleEffect(*apptItr, handleMask, false);
733
734 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
735 {
736 if (!mark)
737 m_amount = newAmount;
738 else
739 SetAmount(newAmount);
741 }
742
743 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
744 if ((*apptItr)->HasEffect(GetEffIndex()))
745 HandleEffect(*apptItr, handleMask, true);
746}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
Definition SpellAuraDefines.h:44
@ AURA_EFFECT_HANDLE_REAPPLY
Definition SpellAuraDefines.h:45
void GetApplicationList(std::list< AuraApplication * > &applicationList) const
Definition SpellAuraEffects.cpp:423
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition SpellAuraEffects.cpp:748
void SetAmount(int32 amount)
Definition SpellAuraEffects.h:66

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

Referenced by 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().

◆ CleanupTriggeredSpells()

void AuraEffect::CleanupTriggeredSpells ( Unit target)
Todo:
: is there a spell flag, which can solve this in a more sophisticated way?
1207{
1208 uint32 tSpellId = m_spellInfo->Effects[GetEffIndex()].TriggerSpell;
1209 if (!tSpellId)
1210 return;
1211
1212 SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
1213 if (!tProto)
1214 return;
1215
1216 if (tProto->GetDuration() != -1)
1217 return;
1218
1219 // needed for spell 43680, maybe others
1223 return;
1224
1225 target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
1226}
ObjectGuid GetCasterGUID() const
Definition SpellAuraEffects.h:48
Definition SpellInfo.h:316
int32 GetDuration() const
Definition SpellInfo.cpp:2350
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4942

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 Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), 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(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), spell_sha_earth_shield::CalculateAmount(), CalculateSpellMod(), ChangeAmount(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), spell_nether_portal_perseverence::HandleApply(), spell_warl_glyph_of_felguard::HandleApply(), spell_warl_glyph_of_voidwalker::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(), HandleAuraModTotalThreat(), HandleAuraModWeaponCritPercent(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), Aura::HandleAuraSpecificMods(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), 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(), HandleModDamagePercentDone(), HandleModHitChance(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModMeleeRangedSpeedPct(), HandleModMeleeSpeedPct(), HandleModOffhandDamagePercent(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModRating(), HandleModResistancePercent(), HandleModSpellCritChance(), HandleModSpellHitChance(), HandleModStateImmunityMask(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModThreat(), HandleModTotalPercentStat(), Unit::HandleOverrideClassScriptAuraProc(), 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_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dru_living_seed_proc::HandleProc(), spell_sha_earth_shield::HandleProc(), spell_oculus_temporal_rift_aura::HandleProc(), spell_dk_wandering_plague_aura::HandleProc(), spell_dru_t10_balance_4p_bonus::HandleProc(), spell_dru_living_seed::HandleProc(), spell_hun_glyph_of_arcane_shot::HandleProc(), spell_item_necrotic_touch::HandleProc(), spell_mage_burnout::HandleProc(), spell_mage_master_of_elements::HandleProc(), spell_pal_sacred_shield_base::HandleProc(), spell_pri_divine_aegis::HandleProc(), spell_pri_glyph_of_prayer_of_healing::HandleProc(), spell_sha_t10_restoration_4p_bonus::HandleProc(), spell_sha_t8_electrified::HandleProc(), spell_warl_seed_of_corruption_aura::HandleProc(), spell_warl_seed_of_corruption_generic_aura::HandleProc(), spell_hun_lock_and_load::HandleProcs(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), HandleRangedAmmoHaste(), spell_warl_haunt_aura::HandleRemove(), spell_warl_glyph_of_felguard::HandleRemove(), spell_warl_glyph_of_voidwalker::HandleRemove(), HandleShieldBlockValue(), spell_hun_sniper_training::HandleUpdatePeriodic(), Aura::IsAuraStronger(), 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_ulduar_stone_grip_aura::OnRemoveStun(), spell_the_lich_king_infest_aura::OnUpdate(), spell_karazhan_overload_aura::PeriodicTick(), Unit::ProcDamageAndSpellFor(), Unit::RemoveAurasDueToSpellBySteal(), ArenaSpectator::ShouldSendAura(), spell_black_temple_shadow_inferno_aura::Update(), spell_black_temple_spell_absorption_aura::Update(), Player::UpdateAttackPowerAndDamage(), UpdatePeriodic(), 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
424{
425 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
426 for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
427 {
428 if (appIter->second->HasEffect(GetEffIndex()))
429 applicationList.push_back(appIter->second);
430 }
431}
ApplicationMap const & GetApplicationMap()
Definition SpellAuras.h:181
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition SpellAuras.h:90

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

Referenced by ChangeAmount(), and Update().

◆ GetAuraGroup()

uint32 AuraEffect::GetAuraGroup ( ) const
inline
116{ return m_auraGroup; }

References m_auraGroup.

Referenced by AuraApplication::_HandleEffect().

◆ GetAuraType()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), Unit::_RegisterAuraEffect(), CalculateAmount(), CalculatePeriodic(), CalculateSpellMod(), 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_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(), 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(), Unit::HandleProcTriggerSpell(), HandleShieldBlockValue(), Aura::IsAuraStronger(), PeriodicTick(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), ArenaSpectator::ShouldSendAura(), and UpdatePeriodic().

◆ GetBase()

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

References m_base.

Referenced by AuraApplication::_HandleEffect(), ApplySpellMod(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), CalculateSpellMod(), 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(), Unit::HandleDummyAuraProc(), 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(), Unit::HandleOverrideClassScriptAuraProc(), HandlePeriodicDamageAurasTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandleProc(), Unit::HandleProcTriggerSpell(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_hor_shared_suffering_aura::OnRemove(), PeriodicTick(), Spell::prepare(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), 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 AuraApplication::_HandleEffect(), spell_dru_lifebloom::AfterRemove(), Unit::CalcAbsorbResist(), spell_pal_sacred_shield_base::CalculateAmount(), spell_sha_earth_shield::CalculateAmount(), spell_warl_improved_demonic_tactics::CalculateAmount(), spell_warl_seed_of_corruption_aura::CalculateAmount(), spell_warr_rend::CalculateAmount(), CalculateAmount(), 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::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(), Unit::CastDelayedSpellWithPeriodicAmount(), ChangeAmount(), CleanupTriggeredSpells(), GetApplicationList(), GetTargetList(), spell_muru_summon_blood_elves_periodic_aura::HandleApply(), spell_gen_baby_murloc_passive::HandleApply(), HandleAuraLinked(), HandleAuraModStat(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), Unit::HandleDummyAuraProc(), 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_spellhit_expertise_spellpen_scaling::HandlePeriodic(), spell_hun_generic_scaling::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_karazhan_temptation::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_item_unsated_craving::HandleProc(), spell_pal_sacred_shield_base::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), 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_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()

uint32 AuraEffect::GetId ( ) const
434{
435 return m_spellInfo->Id;
436}

References SpellInfo::Id, and m_spellInfo.

Referenced by AuraEffect(), CalculateAmount(), CalculatePeriodic(), CalculateSpellMod(), Unit::CastDelayedSpellWithPeriodicAmount(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), HandleAuraControlVehicle(), HandleAuraDummy(), HandleAuraModDmgImmunity(), HandleAuraModEffectImmunity(), HandleAuraModIncreaseFlightSpeed(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModStat(), HandleAuraModStateImmunity(), Aura::HandleAuraSpecificMods(), HandleAuraTransform(), spell_ignis_scorch_aura::HandleEffectPeriodic(), spell_ulduar_energy_sap_aura::HandleEffectPeriodic(), HandleModMechanicImmunity(), HandleModStateImmunityMask(), HandleModTotalPercentStat(), HandleObsModPowerAuraTick(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_warl_demonic_pact_aura::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_eredar_twins_handle_touch_periodic::OnPeriodic(), spell_brewfest_ram_fatigue::PrepareAuraScript(), Unit::ProcDamageAndSpellFor(), Unit::SendPeriodicAuraLog(), and UpdatePeriodic().

◆ GetMiscValue()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), ApplySpellMod(), Unit::CalcAbsorbResist(), CalculateSpellMod(), Unit::GetMaxPositiveAuraModifierByMiscMask(), HandleAuraConvertRune(), HandleAuraDummy(), HandleAuraModBaseResistancePCT(), HandleAuraModDispelImmunity(), HandleAuraModDmgImmunity(), 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(), HandleModMechanicImmunity(), HandleModPercentStat(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModPowerRegen(), HandleModRating(), HandleModRatingFromStat(), HandleModResistancePercent(), HandleModSpellCritChanceShool(), HandleModStateImmunityMask(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModThreat(), HandleModTotalPercentStat(), HandleObsModPowerAuraTick(), spell_illidan_shadow_prison_aura::HandleOnEffectApply(), spell_illidan_shadow_prison_aura::HandleOnEffectRemove(), Unit::HandleOverrideClassScriptAuraProc(), 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::ProcDamageAndSpellFor(), and Unit::SendPeriodicAuraLog().

◆ GetMiscValueB()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by HandleAuraConvertRune(), and HandleModPowerRegen().

◆ GetOldAmount()

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

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

float AuraEffect::GetPctMods ( ) const
inline

◆ GetPeriodicTimer()

int32 AuraEffect::GetPeriodicTimer ( ) const
inline

◆ GetSpellInfo()

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

References m_spellInfo.

Referenced by Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), spell_dragonblight_corrosive_spit::AfterApply(), Unit::CalcAbsorbResist(), 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(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), HandleAuraDummy(), HandleAuraModEffectImmunity(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraModWeaponCritPercent(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraTransform(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), spell_optic_link_aura::HandleEffectPeriodic(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModMechanicImmunity(), HandleModStateImmunityMask(), HandleObsModPowerAuraTick(), spell_putricide_unbound_plague_dmg_aura::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dk_blood_caked_blade::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_pal_seal_of_command_aura::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), TriggeredByAuraSpellData::Init(), spell_gen_sober_up::OnRemove(), Acore::AbsorbAuraOrderPred::operator()(), spell_entropius_negative_energy_periodic::PeriodicTick(), spell_dragonblight_corrosive_spit::PeriodicTick(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), Player::UpdateAttackPowerAndDamage(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetSpellModifier()

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

References m_spellmod.

Referenced by Unit::ProcDamageAndSpellFor().

◆ GetTargetList()

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

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_putricide_unbound_plague_dmg_aura::HandlePeriodic(), spell_shadow_bolt_whirl::HandlePeriodic(), HandlePeriodicHealAurasTick(), 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_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(), and spell_mother_shahraz_random_periodic_aura::Update().

◆ GetTotalTicks()

◆ HandleArenaPreparation()

void AuraEffect::HandleArenaPreparation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5354{
5355 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5356 return;
5357
5358 Unit* target = aurApp->GetTarget();
5359
5360 if (apply)
5362 else
5363 {
5364 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5365 if (target->HasAuraType(GetAuraType()))
5366 return;
5368 }
5369}
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
@ UNIT_FLAG_PREPARATION
Definition UnitDefines.h:255
Definition Unit.h:620
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:5761
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:703
ObjectGuid GetTarget() const
Definition Unit.h:811
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:704

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
3313{
3315 return;
3316
3317 Unit* target = aurApp->GetTarget();
3318
3319 if (!apply)
3320 {
3321 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3322 if (target->HasAuraType(GetAuraType()) || target->HasIncreaseMountedFlightSpeedAura())
3323 return;
3324 }
3325
3326 target->SetCanFly(apply);
3327
3328 if (!apply && target->IsCreature() && !target->IsLevitating())
3329 target->GetMotionMaster()->MoveFall();
3330}
@ 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:627
bool IsCreature() const
Definition Object.h:205
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
bool IsLevitating() const
Definition Unit.h:1617
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Add the movement flag: MOVEMENTFLAGCAN_FLY. Generaly only use by players, allowing them to fly by pre...
Definition Unit.cpp:20425
bool HasIncreaseMountedFlightSpeedAura() const
Definition Unit.h:1735

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
3091{
3093 return;
3094
3095 Unit* target = aurApp->GetTarget();
3096
3097 if (target->IsPlayer())
3098 {
3099 if (apply)
3101 else
3102 {
3103 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3104 if (target->HasAllowOnlyAbilityAura())
3105 return;
3107 }
3108 }
3109}
@ PLAYER_ALLOW_ONLY_ABILITY
Definition Player.h:503
void SetPlayerFlag(PlayerFlags flags)
Definition Player.h:1128
void RemovePlayerFlag(PlayerFlags flags)
Definition Player.h:1129
bool HasAllowOnlyAbilityAura() const
Definition Unit.h:1723

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
2787{
2789 return;
2790
2791 Unit* target = aurApp->GetTarget();
2792
2793 if (apply)
2794 {
2795 Unit* caster = GetCaster();
2796 if (!caster || caster == target)
2797 return;
2798
2799 // What must be cloned? at least display and scale
2800 target->SetDisplayId(caster->GetDisplayId());
2802 }
2803 else
2804 {
2805 target->SetDisplayId(target->GetNativeDisplayId());
2807 }
2808}
@ UNIT_FLAG2_MIRROR_IMAGE
Definition UnitDefines.h:293
virtual void SetDisplayId(uint32 modelId, float displayScale=1.f)
Definition Unit.cpp:16795
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:709
uint32 GetDisplayId() const
Definition Unit.h:1878
uint32 GetNativeDisplayId() const
Definition Unit.h:1880
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:710

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

3657{
3659 return;
3660
3661 Unit* target = aurApp->GetTarget();
3662
3663 if (!target->IsVehicle())
3664 return;
3665
3666 Unit* caster = GetCaster();
3667
3668 if (!caster || caster == target)
3669 return;
3670
3671 if (apply)
3672 {
3673 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3674 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3675 // so this break such spells or most of them.
3676 // Current formula about m_amount: effect base points + dieside - 1
3677 // TO DO: Reasearch more about 0/0 and fix it.
3678 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3679 }
3680 else
3681 {
3682 caster->_ExitVehicle();
3683 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3684 caster->RemoveAurasDueToSpell(GetId());
3685 }
3686}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition SpellAuraDefines.h:49
bool IsVehicle() const
Definition Unit.h:750
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:19552
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:19434
Vehicle * GetVehicleKit() const
Definition Unit.h:1829

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
6022{
6023 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6024 return;
6025
6026 Unit* target = aurApp->GetTarget();
6027
6028 if (!target->IsPlayer())
6029 return;
6030
6031 Player* player = target->ToPlayer();
6032
6034 return;
6035
6036 uint32 runes = m_amount;
6037 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
6038 if (apply)
6039 {
6040 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
6041 {
6042 if (GetMiscValue() != player->GetCurrentRune(i))
6043 continue;
6044 if (!player->GetRuneCooldown(i))
6045 {
6046 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
6047 --runes;
6048 }
6049 }
6050 }
6051 else
6052 player->RemoveRunesByAuraEffect(this);
6053}
RuneType
Definition Player.h:414
#define MAX_RUNES
Definition Player.h:404
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:146
@ CLASS_CONTEXT_ABILITY
Definition UnitDefines.h:234
int32 GetMiscValueB() const
Definition SpellAuraEffects.cpp:438
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13339
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2522
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2533
bool IsClass(Classes playerClass, ClassContext context=CLASS_CONTEXT_NONE) const override
Definition Player.cpp:1288
RuneType GetCurrentRune(uint8 index) const
Definition Player.h:2521

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
5412{
5414 return;
5415
5416 Unit* target = aurApp->GetTarget();
5417
5418 Unit* caster = GetCaster();
5419
5420 if (mode & AURA_EFFECT_HANDLE_REAL)
5421 {
5422 // pet auras
5423 if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
5424 {
5425 if (apply)
5426 target->AddPetAura(petSpell);
5427 else
5428 target->RemovePetAura(petSpell);
5429 }
5430 }
5431
5433 {
5434 // AT APPLY
5435 if (apply)
5436 {
5437 switch (GetId())
5438 {
5439 case 1515: // Tame beast
5440 // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
5441 if (caster && target->CanHaveThreatList())
5442 target->AddThreat(caster, 10.0f);
5443 break;
5444 case 34026: // kill command
5445 {
5446 Unit* pet = target->GetGuardianPet();
5447 if (!pet)
5448 break;
5449
5450 target->CastSpell(target, 34027, true, nullptr, this);
5451
5452 // set 3 stacks and 3 charges (to make all auras not disappear at once)
5453 Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
5454 Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
5455 if (owner_aura)
5456 {
5457 owner_aura->SetCharges(0);
5458 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5459 if (pet_aura)
5460 {
5461 pet_aura->SetCharges(0);
5462 pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5463 }
5464 }
5465 break;
5466 }
5467 case 37096: // Blood Elf Illusion
5468 {
5469 if (caster)
5470 {
5471 switch (caster->getGender())
5472 {
5473 case GENDER_FEMALE:
5474 caster->CastSpell(target, 37095, true, nullptr, this); // Blood Elf Disguise
5475 break;
5476 case GENDER_MALE:
5477 caster->CastSpell(target, 37093, true, nullptr, this);
5478 break;
5479 default:
5480 break;
5481 }
5482 }
5483 break;
5484 }
5485 case 55198: // Tidal Force
5486 {
5487 target->CastSpell(target, 55166, true);
5488 if (Aura* owner_aura = target->GetAura(55166))
5489 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5490 return;
5491 }
5492 case 39850: // Rocket Blast
5493 if (roll_chance_i(20)) // backfire stun
5494 target->CastSpell(target, 51581, true, nullptr, this);
5495 break;
5496 case 43873: // Headless Horseman Laugh
5497 target->PlayDistanceSound(11965);
5498 break;
5499 case 46354: // Blood Elf Illusion
5500 if (caster)
5501 {
5502 switch (caster->getGender())
5503 {
5504 case GENDER_FEMALE:
5505 caster->CastSpell(target, 46356, true, nullptr, this);
5506 break;
5507 case GENDER_MALE:
5508 caster->CastSpell(target, 46355, true, nullptr, this);
5509 break;
5510 }
5511 }
5512 break;
5513 case 46361: // Reinforced Net
5514 if (caster)
5515 target->GetMotionMaster()->MoveFall();
5516 break;
5517 case 46699: // Requires No Ammo
5518 if (target->IsPlayer())
5519 target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use
5520 break;
5521 case 71563:
5522 {
5523 if (Aura* newAura = target->AddAura(71564, target))
5524 newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
5525 return;
5526 }
5527 }
5528 }
5529 // AT REMOVE
5530 else
5531 {
5532 if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive() && aurApp->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
5533 {
5534 uint32 finalSpelId = 0;
5535 switch (GetId())
5536 {
5537 case 19548:
5538 finalSpelId = 19597;
5539 break;
5540 case 19674:
5541 finalSpelId = 19677;
5542 break;
5543 case 19687:
5544 finalSpelId = 19676;
5545 break;
5546 case 19688:
5547 finalSpelId = 19678;
5548 break;
5549 case 19689:
5550 finalSpelId = 19679;
5551 break;
5552 case 19692:
5553 finalSpelId = 19680;
5554 break;
5555 case 19693:
5556 finalSpelId = 19684;
5557 break;
5558 case 19694:
5559 finalSpelId = 19681;
5560 break;
5561 case 19696:
5562 finalSpelId = 19682;
5563 break;
5564 case 19697:
5565 finalSpelId = 19683;
5566 break;
5567 case 19699:
5568 finalSpelId = 19685;
5569 break;
5570 case 19700:
5571 finalSpelId = 19686;
5572 break;
5573 case 30646:
5574 finalSpelId = 30647;
5575 break;
5576 case 30653:
5577 finalSpelId = 30648;
5578 break;
5579 case 30654:
5580 finalSpelId = 30652;
5581 break;
5582 case 30099:
5583 finalSpelId = 30100;
5584 break;
5585 case 30102:
5586 finalSpelId = 30103;
5587 break;
5588 case 30105:
5589 finalSpelId = 30104;
5590 break;
5591 }
5592
5593 if (finalSpelId)
5594 caster->CastSpell(target, finalSpelId, true, nullptr, this);
5595 }
5596
5598 {
5600 switch (GetId())
5601 {
5602 case 2584: // Waiting to Resurrect
5603 // Waiting to resurrect spell cancel, we must remove player from resurrect queue
5604 if (target->IsPlayer())
5605 {
5606 if (Battleground* bg = target->ToPlayer()->GetBattleground())
5607 bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
5608 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
5609 bf->RemovePlayerFromResurrectQueue(target->GetGUID());
5610 }
5611 break;
5612 case 43681: // Inactive
5613 {
5614 if (!target->IsPlayer() || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5615 return;
5616
5617 if (target->GetMap()->IsBattleground())
5618 target->ToPlayer()->LeaveBattleground();
5619 break;
5620 }
5621 case 52172: // Coyote Spirit Despawn Aura
5622 case 60244: // Blood Parrot Despawn Aura
5623 target->CastSpell((Unit*)nullptr, GetAmount(), true, nullptr, this);
5624 break;
5625 // Halls of Lightning, Arc Lightning
5626 case 52921:
5627 {
5628 if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
5629 return;
5630
5631 Player* player = nullptr;
5632 Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
5633 Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
5634 Cell::VisitWorldObjects(target, searcher, 10.0f);
5635
5636 if (player && player->GetGUID() != target->GetGUID())
5637 target->CastSpell(player, 52921, true);
5638
5639 return;
5640 }
5641 case 58600: // Restricted Flight Area
5642 case 58730: // Restricted Flight Area
5643 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
5644 target->CastSpell(target, 58601, true);
5645 break;
5646 case 46374: // quest The Power of the Elements (11893)
5647 {
5648 if (target->isDead() && GetBase() && target->IsCreature() && target->GetEntry() == 24601)
5649 {
5650 auto caster2 = GetBase()->GetCaster();
5651 if (caster2 && caster2->IsPlayer())
5652 {
5653 caster2->ToPlayer()->KilledMonsterCredit(25987);
5654 }
5655 }
5656 return;
5657 }
5658 }
5659 break;
5660 default:
5661 break;
5662 }
5663 }
5664 }
5665
5666 // AT APPLY & REMOVE
5667
5669 {
5671 {
5672 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5673 break;
5674 switch (GetId())
5675 {
5676 // Recently Bandaged
5677 case 11196:
5679 break;
5680 // Unstable Power
5681 case 24658:
5682 {
5683 uint32 spellId = 24659;
5684 if (apply && caster)
5685 {
5686 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5687
5688 for (uint32 i = 0; i < spell->StackAmount; ++i)
5689 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5690 break;
5691 }
5692 target->RemoveAurasDueToSpell(spellId);
5693 break;
5694 }
5695 // Restless Strength
5696 case 24661:
5697 {
5698 uint32 spellId = 24662;
5699 if (apply && caster)
5700 {
5701 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5702 for (uint32 i = 0; i < spell->StackAmount; ++i)
5703 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5704 break;
5705 }
5706 target->RemoveAurasDueToSpell(spellId);
5707 break;
5708 }
5709 // Tag Murloc
5710 case 30877:
5711 {
5712 // Tag/untag Blacksilt Scout
5713 target->SetEntry(apply ? 17654 : 17326);
5714 break;
5715 }
5716 case 57819: // Argent Champion
5717 case 57820: // Ebon Champion
5718 case 57821: // Champion of the Kirin Tor
5719 case 57822: // Wyrmrest Champion
5720 {
5721 if (!caster || !caster->IsPlayer())
5722 break;
5723
5724 uint32 FactionID = 0;
5725
5726 if (apply)
5727 {
5728 switch (m_spellInfo->Id)
5729 {
5730 case 57819:
5731 FactionID = 1106;
5732 break; // Argent Crusade
5733 case 57820:
5734 FactionID = 1098;
5735 break; // Knights of the Ebon Blade
5736 case 57821:
5737 FactionID = 1090;
5738 break; // Kirin Tor
5739 case 57822:
5740 FactionID = 1091;
5741 break; // The Wyrmrest Accord
5742 }
5743 }
5744 caster->ToPlayer()->SetChampioningFaction(FactionID);
5745 break;
5746 }
5747 // LK Intro VO (1)
5748 case 58204:
5749 if (target->IsPlayer())
5750 {
5751 // Play part 1
5752 if (apply)
5753 target->PlayDirectSound(14970, target->ToPlayer());
5754 // continue in 58205
5755 else
5756 target->CastSpell(target, 58205, true);
5757 }
5758 break;
5759 // LK Intro VO (2)
5760 case 58205:
5761 if (target->IsPlayer())
5762 {
5763 // Play part 2
5764 if (apply)
5765 target->PlayDirectSound(14971, target->ToPlayer());
5766 // Play part 3
5767 else
5768 target->PlayDirectSound(14972, target->ToPlayer());
5769 }
5770 break;
5771 case 62061: // Festive Holiday Mount
5772 if (target->HasMountedAura())
5773 {
5774 uint32 creatureEntry = 0;
5775 if (apply)
5776 {
5778 creatureEntry = 24906;
5779 else
5780 creatureEntry = 15665;
5781 }
5782 else
5783 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5784
5785 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5786 {
5787 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5788 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5789
5791 }
5792 }
5793 break;
5794 case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount
5795 if (target->HasMountedAura() && !target->HasIncreaseMountedFlightSpeedAura())
5796 {
5797 uint32 creatureEntry = 0;
5798
5799 if (apply)
5800 {
5801 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
5802 {
5803 creatureEntry = GREAT_BREWFEST_KODO;
5804 }
5805 else
5806 {
5807 creatureEntry = BREWFEST_KODO;
5808 }
5809 }
5810 else
5811 {
5812 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5813 }
5814
5815 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5816 {
5817 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5818 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5819
5821 }
5822 }
5823 break;
5824 }
5825
5826 break;
5827 }
5828 case SPELLFAMILY_MAGE:
5829 {
5830 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5831 //break;
5832 break;
5833 }
5834 case SPELLFAMILY_PRIEST:
5835 {
5836 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5837 //break;
5838 break;
5839 }
5840 case SPELLFAMILY_DRUID:
5841 {
5842 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5843 // break;
5844 break;
5845 }
5846 case SPELLFAMILY_SHAMAN:
5847 {
5848 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5849 // break;
5850 break;
5851 }
5852 }
5853}
#define sBattlefieldMgr
Definition BattlefieldMgr.h:77
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:1399
@ SPELLFAMILY_PRIEST
Definition SharedDefines.h:3550
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3547
@ SPELLFAMILY_GENERIC
Definition SharedDefines.h:3544
@ SPELLFAMILY_SHAMAN
Definition SharedDefines.h:3555
@ SPELLFAMILY_DRUID
Definition SharedDefines.h:3551
@ 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:350
@ UNIT_FIELD_MOUNTDISPLAYID
Definition UpdateFields.h:126
Definition GridNotifiers.h:1354
void SetStackAmount(uint8 num)
Definition SpellAuras.cpp:995
void SetCharges(uint8 charges)
Definition SpellAuras.cpp:952
Definition Battlefield.h:204
Definition Battleground.h:294
bool IsBattleground() const
Definition Map.h:301
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition ObjectMgr.cpp:1647
uint32 GetEntry() const
Definition Object.h:116
void SetEntry(uint32 entry)
Definition Object.h:117
Definition SpellMgr.h:470
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition PlayerQuest.cpp:1927
Battleground * GetBattleground(bool create=false) const
Definition Player.cpp:12152
void RemoveAmmo()
Definition PlayerStorage.cpp:2514
void SetChampioningFaction(uint32 faction)
Definition Player.h:2565
void LeaveBattleground(Battleground *bg=nullptr)
Definition Player.cpp:11277
uint32 StackAmount
Definition SpellInfo.h:371
uint8 getGender() const
Definition Unit.h:798
void RemovePetAura(PetAura const *petSpell)
Definition Unit.cpp:17342
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5614
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:13433
void AddPetAura(PetAura const *petSpell)
Definition Unit.cpp:17330
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:14704
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:18910
bool HasMountedAura() const
Definition Unit.h:1704
bool IsAlive() const
Definition Unit.h:1698
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:1179
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1645
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21140
bool CanHaveThreatList(bool skipAliveCheck=false) const
Definition Unit.cpp:14665
Guardian * GetGuardianPet() const
Definition Unit.cpp:10695
bool isDead() const
Definition Unit.h:1700
Map * GetMap() const
Definition Object.h:537
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2903
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2895
uint32 GetZoneId() const
Definition Object.cpp:3148
Definition GridNotifiers.h:510
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:175
Definition CreatureData.h:169
uint32 CreatureDisplayID
Definition CreatureData.h:179
Definition CreatureData.h:186

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::VisitWorldObjects().

◆ HandleAuraEmpathy()

void AuraEffect::HandleAuraEmpathy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5965{
5966 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5967 return;
5968
5969 Unit* target = aurApp->GetTarget();
5970
5971 if (!apply)
5972 {
5973 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5974 if (target->HasAuraType(GetAuraType()))
5975 return;
5976 }
5977
5978 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5980}
@ CREATURE_TYPE_BEAST
Definition SharedDefines.h:2628
@ UNIT_DYNFLAG_SPECIALINFO
Definition SharedDefines.h:3125
@ UNIT_DYNAMIC_FLAGS
Definition UpdateFields.h:136
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:806
uint32 GetCreatureType() const
Definition Unit.cpp:15233

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
3355{
3357 return;
3358
3359 Unit* target = aurApp->GetTarget();
3360
3361 if (Player* targetPlayer = target->ToPlayer())
3362 {
3363 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3364 }
3365
3366 if (!apply)
3367 {
3368 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3369 if (target->HasAuraType(GetAuraType()))
3370 return;
3371 }
3372
3373 target->SetFeatherFall(apply);
3374
3375 // start fall from current height
3376 if (!apply && target->IsPlayer())
3377 target->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), target->GetPositionZ());
3378}
#define sScriptMgr
Definition ScriptMgr.h:727
void SetFallInformation(uint32 time, float z)
Definition Player.h:2350
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition Unit.cpp:20469
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
1783{
1785 return;
1786
1787 Unit* target = aurApp->GetTarget();
1788
1789 if (!target->IsPlayer())
1790 return;
1791
1792 if (apply)
1793 {
1797 }
1798 else
1799 {
1800 if (target->HasGhostAura())
1801 return;
1802
1806 }
1807}
@ PLAYER_FLAGS_GHOST
Definition Player.h:484
@ SERVERSIDE_VISIBILITY_GHOST
Definition SharedDefines.h:1274
@ GHOST_VISIBILITY_ALIVE
Definition SharedDefines.h:1281
@ GHOST_VISIBILITY_GHOST
Definition SharedDefines.h:1282
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:378
bool HasGhostAura() const
Definition Unit.h:1703
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition Object.h:530
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition Object.h:529

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

3381{
3383 return;
3384
3385 Unit* target = aurApp->GetTarget();
3386
3387 if (Player* targetPlayer = target->ToPlayer())
3388 {
3389 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3390 }
3391
3392 if (!apply)
3393 {
3394 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3395 if (target->HasAuraType(GetAuraType()))
3396 return;
3397 }
3398
3399 target->SetHover(apply);
3400}
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition Unit.cpp:20491

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
4800{
4802 return;
4803
4804 Unit* target = aurApp->GetTarget();
4805
4806 target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(GetAmount()), apply);
4807}
@ AURA_EFFECT_HANDLE_STAT
Definition SpellAuraDefines.h:46
@ UNIT_MOD_HEALTH
Definition Unit.h:149
@ BASE_PCT
Definition Unit.h:128
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition Unit.cpp:15254

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetAmount(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), and UNIT_MOD_HEALTH.

◆ HandleAuraLinked()

void AuraEffect::HandleAuraLinked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6056{
6057 Unit* target = aurApp->GetTarget();
6058
6059 uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target);
6060 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
6061 if (!triggeredSpellInfo)
6062 return;
6063
6064 if (mode & AURA_EFFECT_HANDLE_REAL)
6065 {
6066 if (apply)
6067 {
6068 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCaster() : target;
6069
6070 if (!caster)
6071 return;
6072 // If amount avalible cast with basepoints (Crypt Fever for example)
6073 if (GetAmount())
6074 caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
6075 else
6076 caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
6077 }
6078 else
6079 {
6080 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6081 target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
6082 }
6083 }
6084 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
6085 {
6086 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6087 // change the stack amount to be equal to stack amount of our aura
6088 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
6089 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
6090 }
6091}
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell, uint8 effIndex=MAX_SPELL_EFFECTS) const
Definition SpellInfo.cpp:1038
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4809
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:1236

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
5102{
5104 return;
5105
5106 Unit* target = aurApp->GetTarget();
5107
5109}
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:164
@ TOTAL_VALUE
Definition Unit.h:129

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

◆ HandleAuraModAttackPowerOfArmor()

void AuraEffect::HandleAuraModAttackPowerOfArmor ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5167{
5169 return;
5170
5171 Unit* target = aurApp->GetTarget();
5172
5173 // Recalculate bonus
5174 if (target->IsPlayer())
5175 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
5176}
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition StatSystem.cpp:330

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
5162{
5163 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
5164}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:5166

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5125{
5127 return;
5128
5129 Unit* target = aurApp->GetTarget();
5130
5131 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
5133}
@ TOTAL_PCT
Definition Unit.h:130

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), TOTAL_PCT, and UNIT_MOD_ATTACK_POWER.

◆ HandleAuraModBaseResistancePCT()

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4356{
4358 return;
4359
4360 Unit* target = aurApp->GetTarget();
4361 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4362 {
4363 if (GetMiscValue() & int32(1 << x))
4364 {
4366 }
4367 }
4368}
std::int8_t int8
Definition Define.h:105
@ SPELL_SCHOOL_NORMAL
Definition SharedDefines.h:283
constexpr auto MAX_SPELL_SCHOOL
Definition SharedDefines.h:292
UnitMods
Definition Unit.h:143
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:173

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), MAX_SPELL_SCHOOL, SPELL_SCHOOL_NORMAL, and UNIT_MOD_RESISTANCE_START.

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4843{
4845 return;
4846
4847 Unit* target = aurApp->GetTarget();
4848
4849 if (!target->IsPlayer())
4850 return;
4851
4852 target->ToPlayer()->UpdateBlockPercentage();
4853}
void UpdateBlockPercentage()
Definition StatSystem.cpp:616

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
4951{
4953 return;
4954
4955 Unit* target = aurApp->GetTarget();
4956
4957 if (!target->IsPlayer())
4958 {
4959 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4960 return;
4961 }
4962
4963 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4966
4967 // included in Player::UpdateSpellCritChance calculation
4969}
@ FLAT_MOD
Definition Unit.h:190
@ OFFHAND_CRIT_PERCENTAGE
Definition Unit.h:183
@ CRIT_PERCENTAGE
Definition Unit.h:181
@ RANGED_CRIT_PERCENTAGE
Definition Unit.h:182
void UpdateAllSpellCritChances()
Definition StatSystem.cpp:871
void HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply)
Definition Player.cpp:5025
int32 m_baseSpellCritChance
Definition Unit.h:1991
void apply(T *val)
Definition ByteConverter.h:40

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CRIT_PERCENTAGE, FLAT_MOD, GetAmount(), AuraApplication::GetTarget(), Player::HandleBaseModValue(), Object::IsPlayer(), Unit::m_baseSpellCritChance, OFFHAND_CRIT_PERCENTAGE, RANGED_CRIT_PERCENTAGE, Object::ToPlayer(), and Player::UpdateAllSpellCritChances().

◆ HandleAuraModDecreaseSpeed()

void AuraEffect::HandleAuraModDecreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3767{
3769 return;
3770
3771 Unit* target = aurApp->GetTarget();
3772
3773 target->UpdateSpeed(MOVE_WALK, true);
3774 target->UpdateSpeed(MOVE_RUN, true);
3775 target->UpdateSpeed(MOVE_SWIM, true);
3776 target->UpdateSpeed(MOVE_FLIGHT, true);
3777 target->UpdateSpeed(MOVE_RUN_BACK, true);
3778 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3779 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3780
3781 if (Player* targetPlayer = target->ToPlayer())
3782 {
3783 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3784 }
3785}
@ MOVE_FLIGHT
Definition UnitDefines.h:355
@ MOVE_SWIM
Definition UnitDefines.h:352
@ MOVE_FLIGHT_BACK
Definition UnitDefines.h:356
@ MOVE_SWIM_BACK
Definition UnitDefines.h:353
@ MOVE_RUN_BACK
Definition UnitDefines.h:351
@ MOVE_WALK
Definition UnitDefines.h:349
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition Unit.cpp:14301

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
2958{
2959 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2960 return;
2961
2962 Unit* target = aurApp->GetTarget();
2963
2964 AuraType type = GetAuraType();
2965
2966 //Prevent handling aura twice
2967 if ((apply) ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2968 return;
2969
2970 uint32 field, flag, slot;
2971 WeaponAttackType attType;
2972 switch (type)
2973 {
2975 field = UNIT_FIELD_FLAGS;
2976 flag = UNIT_FLAG_DISARMED;
2978 attType = BASE_ATTACK;
2979 break;
2981 field = UNIT_FIELD_FLAGS_2;
2984 attType = OFF_ATTACK;
2985 break;
2987 field = UNIT_FIELD_FLAGS_2;
2989 slot = EQUIPMENT_SLOT_RANGED;
2990 attType = RANGED_ATTACK;
2991 break;
2992 default:
2993 return;
2994 }
2995
2996 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
2997 if (!apply)
2998 target->RemoveFlag(field, flag);
2999
3000 // Handle damage modification, shapeshifted druids are not affected
3001 if (target->IsPlayer() && (!target->IsInFeralForm() || target->GetShapeshiftForm() == FORM_GHOSTWOLF))
3002 {
3003 if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
3004 {
3005 uint8 attacktype = Player::GetAttackBySlot(slot);
3006
3007 if (attacktype < MAX_ATTACK)
3008 {
3009 target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
3010 target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
3011 }
3012 }
3013 }
3014
3015 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
3016 if (apply)
3017 target->SetFlag(field, flag);
3018
3019 if (target->IsCreature() && target->ToCreature()->GetCurrentEquipmentId())
3020 target->UpdateDamagePhysical(attType);
3021}
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:697
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:698
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:699
#define INVENTORY_SLOT_BAG_0
Definition Player.h:677
@ 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:296
@ UNIT_FLAG2_DISARM_RANGED
Definition UnitDefines.h:298
@ FORM_GHOSTWOLF
Definition UnitDefines.h:85
@ UNIT_FLAG_DISARMED
Definition UnitDefines.h:271
WeaponAttackType
Definition Unit.h:209
@ MAX_ATTACK
Definition Unit.h:213
@ 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:845
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition Object.cpp:860
Creature * ToCreature()
Definition Object.h:206
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition Player.cpp:6907
Item * GetItemByPos(uint16 pos) const
Definition PlayerStorage.cpp:441
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition Player.cpp:7014
static uint8 GetAttackBySlot(uint8 slot)
Definition PlayerStorage.cpp:542
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:1861
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition StatSystem.cpp:60
bool IsInFeralForm() const
Definition Unit.h:1864

References Player::_ApplyWeaponDamage(), Player::_ApplyWeaponDependentAuraMods(), 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, and Unit::UpdateDamagePhysical().

◆ HandleAuraModDispelImmunity()

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4297{
4298 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4299 return;
4300
4301 Unit* target = aurApp->GetTarget();
4302
4304}
DispelType
Definition SharedDefines.h:1371
void ApplySpellDispelImmunity(SpellInfo const *spellProto, DispelType type, bool apply)
Definition Unit.cpp:13460

References Unit::ApplySpellDispelImmunity(), AURA_EFFECT_HANDLE_REAL, GetMiscValue(), AuraApplication::GetTarget(), and m_spellInfo.

◆ HandleAuraModDmgImmunity()

void AuraEffect::HandleAuraModDmgImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4287{
4288 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4289 return;
4290
4291 Unit* target = aurApp->GetTarget();
4292
4293 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
4294}
@ IMMUNITY_DAMAGE
Definition SharedDefines.h:1397

References Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, GetId(), GetMiscValue(), AuraApplication::GetTarget(), and IMMUNITY_DAMAGE.

◆ HandleAuraModDodgePercent()

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4830{
4832 return;
4833
4834 Unit* target = aurApp->GetTarget();
4835
4836 if (!target->IsPlayer())
4837 return;
4838
4839 target->ToPlayer()->UpdateDodgePercentage();
4840}
void UpdateDodgePercentage()
Definition StatSystem.cpp:781

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
4192{
4193 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4194 return;
4195
4196 Unit* target = aurApp->GetTarget();
4197
4198 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
4199
4200 // when removing flag aura, handle flag drop
4201 Player* player = target->ToPlayer();
4202 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
4203 {
4204 if (player->InBattleground())
4205 {
4206 if (Battleground* bg = player->GetBattleground())
4207 bg->EventPlayerDroppedFlag(player);
4208 }
4209 else
4210 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
4211 }
4212}
#define sOutdoorPvPMgr
Definition OutdoorPvPMgr.h:102
@ IMMUNITY_EFFECT
Definition SharedDefines.h:1394
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition SpellDefines.h:63
bool InBattleground() const
Definition Player.h:2266

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
4632{
4634 return;
4635
4636 Unit* target = aurApp->GetTarget();
4637
4638 if (!target->IsPlayer())
4639 return;
4640
4643}
void UpdateExpertise(WeaponAttackType attType)
Definition StatSystem.cpp:877

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
5983{
5984 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5985 return;
5986
5987 Unit* target = aurApp->GetTarget();
5988
5989 if (apply)
5990 {
5991 target->SetFaction(GetMiscValue());
5992 if (target->IsPlayer())
5994 }
5995 else
5996 {
5997 target->RestoreFaction();
5998 if (target->IsPlayer())
6000 }
6001}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition UnitDefines.h:253
void SetFaction(uint32 faction)
Definition Unit.cpp:10096
void RestoreFaction()
Definition Unit.cpp:18742

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
6110{
6112 return;
6113
6114 Player* target = aurApp->GetTarget()->ToPlayer();
6115 if (!target)
6116 return;
6117
6120}
@ PLAYER_FAKE_INEBRIATION
Definition UpdateFields.h:325
void ApplyModInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:815
void UpdateInvisibilityDrunkDetect()
Definition Player.cpp:1001

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
4733{
4735 return;
4736
4737 Unit* target = aurApp->GetTarget();
4738
4740 // do not check power type, we can always modify the maximum
4741 // as the client will not see any difference
4742 // also, placing conditions that may change during the aura duration
4743 // inside effect handlers is not a good idea
4744 //if (int32(PowerType) != GetMiscValue())
4745 // return;
4746
4747 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4748
4749 target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4750}
std::uint16_t uint16
Definition Define.h:108
Powers
Definition SharedDefines.h:268
@ UNIT_MOD_POWER_START
Definition Unit.h:175
PowerType
Definition VehicleDefines.h:29

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

◆ HandleAuraModIncreaseEnergyPercent()

void AuraEffect::HandleAuraModIncreaseEnergyPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4753{
4755 return;
4756
4757 Unit* target = aurApp->GetTarget();
4758
4760 // do not check power type, we can always modify the maximum
4761 // as the client will not see any difference
4762 // also, placing conditions that may change during the aura duration
4763 // inside effect handlers is not a good idea
4764 //if (int32(PowerType) != GetMiscValue())
4765 // return;
4766
4767 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4768 float amount = float(GetAmount());
4769
4770 if (apply)
4771 {
4772 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4773 target->ModifyPowerPct(PowerType, amount, apply);
4774 }
4775 else
4776 {
4777 target->ModifyPowerPct(PowerType, amount, apply);
4778 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4779 }
4780}
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
Definition Unit.cpp:14238

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), Unit::ModifyPowerPct(), 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.

3712{
3714 return;
3715
3716 Unit* target = aurApp->GetTarget();
3718 target->UpdateSpeed(MOVE_FLIGHT, true);
3719
3722 {
3723 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3724 if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasIncreaseMountedFlightSpeedAura() && !target->HasFlyAura())))
3725 {
3726 target->SetCanFly(apply);
3727
3728 if (!apply && target->IsCreature() && !target->IsLevitating())
3729 target->GetMotionMaster()->MoveFall();
3730 }
3731
3733 if (mode & AURA_EFFECT_HANDLE_REAL)
3734 {
3735 //Players on flying mounts must be immune to polymorph
3736 if (target->IsPlayer())
3738
3739 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3740 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID())
3742 }
3743 }
3744
3745 if (Player* targetPlayer = target->ToPlayer())
3746 {
3747 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3748 }
3749}
@ MECHANIC_POLYMORPH
Definition SharedDefines.h:1342
@ 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:1708
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition Unit.cpp:5701
uint32 GetMountID() const
Definition Unit.h:1792

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
4688{
4690 return;
4691
4692 Unit* target = aurApp->GetTarget();
4693
4694 if (apply)
4695 {
4696 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4697 target->ModifyHealth(GetAmount());
4698 }
4699 else
4700 {
4701 if (int32(target->GetHealth()) > GetAmount())
4702 target->ModifyHealth(-GetAmount());
4703 else
4704 target->SetHealth(1);
4705 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4706 }
4707}
int32 ModifyHealth(int32 val)
Definition Unit.cpp:14142
void SetHealth(uint32 val)
Definition Unit.cpp:15529
uint32 GetHealth() const
Definition Unit.h:1029

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

◆ HandleAuraModIncreaseHealthPercent()

void AuraEffect::HandleAuraModIncreaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4783{
4785 return;
4786
4787 Unit* target = aurApp->GetTarget();
4788
4789 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4790 float percent = target->GetHealthPct();
4791 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply);
4792
4793 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4794 if (target->IsAlive())
4795 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4796 target->SetHealth(healthAmount);
4797}
T CalculatePct(T base, U pct)
Definition Util.h:61
float GetHealthPct() const
Definition Unit.h:1031
uint32 GetMaxHealth() const
Definition Unit.h:1030

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

◆ HandleAuraModIncreaseMaxHealth()

void AuraEffect::HandleAuraModIncreaseMaxHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4710{
4712 return;
4713
4714 Unit* target = aurApp->GetTarget();
4715
4716 uint32 oldhealth = target->GetHealth();
4717 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4718
4720
4721 // refresh percentage
4722 if (oldhealth > 0)
4723 {
4724 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4725 if (newhealth == 0)
4726 newhealth = 1;
4727
4728 target->SetHealth(newhealth);
4729 }
4730}

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

◆ HandleAuraModIncreaseMountedSpeed()

void AuraEffect::HandleAuraModIncreaseMountedSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3707{
3708 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3709}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3691

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3692{
3694 return;
3695
3696 Unit* target = aurApp->GetTarget();
3697
3698 target->UpdateSpeed(MOVE_RUN, true);
3699
3700 if (Player* targetPlayer = target->ToPlayer())
3701 {
3702 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3703 }
3704}

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
3752{
3754 return;
3755
3756 Unit* target = aurApp->GetTarget();
3757
3758 target->UpdateSpeed(MOVE_SWIM, true);
3759
3760 if (Player* targetPlayer = target->ToPlayer())
3761 {
3762 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3763 }
3764}

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
3053{
3055 return;
3056
3057 Unit* target = aurApp->GetTarget();
3058
3059 if (apply)
3060 {
3062 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
3063 }
3064 else
3065 {
3066 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3067 if (target->HasPacifyAura() || target->HasPacifySilenceAura())
3068 return;
3070 }
3071}
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:267
bool HasPacifySilenceAura() const
Definition Unit.h:1728
bool HasPacifyAura() const
Definition Unit.h:1732

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
3074{
3076 return;
3077
3078 Unit* target = aurApp->GetTarget();
3079
3080 if (!(apply))
3081 {
3082 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3083 if (target->HasPacifySilenceAura())
3084 return;
3085 }
3086 HandleAuraModPacify(aurApp, mode, apply);
3087 HandleAuraModSilence(aurApp, mode, apply);
3088}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3023
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3052

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
4814{
4816 return;
4817
4818 Unit* target = aurApp->GetTarget();
4819
4820 if (!target->IsPlayer())
4821 return;
4822
4823 if (!target->ToPlayer()->CanParry())
4824 target->ToPlayer()->SetCanParry(true);
4825 else
4826 target->ToPlayer()->UpdateParryPercentage();
4827}
void UpdateParryPercentage()
Definition StatSystem.cpp:735
bool CanParry() const
Definition Player.h:2197
void SetCanParry(bool value)
Definition Player.cpp:13078

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
3210{
3212 return;
3213
3214 Unit* target = aurApp->GetTarget();
3215
3216 if (!target->IsPlayer())
3217 return;
3218
3219 // Recalculate pet talent points
3220 if (Pet* pet = target->ToPlayer()->GetPet())
3221 pet->InitTalentForLevel();
3222}

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
5112{
5114 return;
5115
5116 Unit* target = aurApp->GetTarget();
5117
5118 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5119 return;
5120
5122}
#define CLASSMASK_WAND_USERS
Definition SharedDefines.h:174
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:165
uint32 getClassMask() const
Definition Unit.h:795

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CLASSMASK_WAND_USERS, GetAmount(), Unit::getClassMask(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), 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
5136{
5138 return;
5139
5140 Unit* target = aurApp->GetTarget();
5141
5142 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5143 return;
5144
5145 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
5147}

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

◆ HandleAuraModRangedHaste()

void AuraEffect::HandleAuraModRangedHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5040{
5042 return;
5043
5044 Unit* target = aurApp->GetTarget();
5045
5046 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5047}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition Unit.cpp:17087

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
4856{
4857 HandleModManaRegen(aurApp, mode, apply);
4858}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4673

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4338{
4340 return;
4341
4342 Unit* target = aurApp->GetTarget();
4343
4344 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4345 {
4346 if (GetMiscValue() & int32(1 << x))
4347 {
4349 if (target->IsPlayer() || target->IsPet())
4350 target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
4351 }
4352 }
4353}
SpellSchools
Definition SharedDefines.h:282
bool IsPet() const
Definition Unit.h:747
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.h:1126

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

◆ HandleAuraModResistanceExclusive()

void AuraEffect::HandleAuraModResistanceExclusive ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4315{
4317 return;
4318
4319 Unit* target = aurApp->GetTarget();
4320
4321 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4322 {
4323 if (GetMiscValue() & int32(1 << x))
4324 {
4326 if (amount < GetAmount())
4327 {
4328 float value = float(GetAmount() - amount);
4330 if (target->IsPlayer())
4331 target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), value, apply);
4332 }
4333 }
4334 }
4335}
@ 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:6042

References Unit::ApplyResistanceBuffModsMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_VALUE, GetAmount(), Unit::GetMaxPositiveAuraModifierByMiscMask(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), Object::IsPlayer(), AuraApplication::IsPositive(), MAX_SPELL_SCHOOL, SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE, SPELL_SCHOOL_NORMAL, and UNIT_MOD_RESISTANCE_START.

◆ HandleAuraModResistenceOfStatPercent()

void AuraEffect::HandleAuraModResistenceOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4610{
4612 return;
4613
4614 Unit* target = aurApp->GetTarget();
4615
4616 if (!target->IsPlayer())
4617 return;
4618
4620 {
4621 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4622 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4623 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4624 return;
4625 }
4626
4627 // Recalculate Armor
4628 target->UpdateArmor();
4629}
#define LOG_ERROR(filterType__,...)
Definition Log.h:157
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:297
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
3520{
3521 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3522 return;
3523
3524 Unit* target = aurApp->GetTarget();
3525
3526 target->SetControlled(apply, UNIT_STATE_ROOT);
3527}
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18081

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
2779{
2781 return;
2782
2783 aurApp->GetTarget()->RecalculateObjectScale();
2784}

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
4228{
4229 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4230 return;
4231
4232 Unit* target = aurApp->GetTarget();
4233
4234 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
4235
4236 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4237 {
4238 if (apply)
4240 else
4241 {
4242 bool banishFound = false;
4243 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
4244 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
4245 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4246 {
4247 banishFound = true;
4248 break;
4249 }
4250 if (!banishFound)
4252 }
4253 }
4254
4255 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
4257
4258 // remove all flag auras (they are positive, but they must be removed when you are immune)
4262
4264 if ((apply)
4266 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
4267 {
4268 uint32 school_mask = GetMiscValue();
4269 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
4270 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
4271 {
4272 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4273 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
4274 && GetSpellInfo()->CanDispelAura(spell)
4275 && !iter->second->IsPositive() //Don't remove positive spells
4276 && spell->Id != GetId()) //Don't remove self
4277 {
4278 target->RemoveAura(iter);
4279 }
4280 else
4281 ++iter;
4282 }
4283 }
4284}
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition SharedDefines.h:477
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition SharedDefines.h:434
@ MECHANIC_BANISH
Definition SharedDefines.h:1343
@ IMMUNITY_SCHOOL
Definition SharedDefines.h:1396
@ UNIT_STATE_ISOLATED
Definition UnitDefines.h:183
bool IsPositive() const
Definition SpellInfo.cpp:1237
bool CanDispelAura(SpellInfo const *aura) const
Definition SpellInfo.cpp:1350
void ClearUnitState(uint32 f)
Definition Unit.h:692
void AddUnitState(uint32 f)
Definition Unit.h:690
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition Unit.cpp:5214

References Unit::AddUnitState(), Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, SpellInfo::CanDispelAura(), Unit::ClearUnitState(), Unit::GetAppliedAuras(), Unit::GetAuraEffectsByType(), GetAuraType(), GetId(), GetMiscValue(), SpellInfo::GetSchoolMask(), GetSpellInfo(), AuraApplication::GetTarget(), 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
1870{
1872 return;
1873
1874 Unit* target = aurApp->GetTarget();
1875
1876 uint32 modelid = 0;
1879
1880 switch (form)
1881 {
1882 case FORM_CAT: // 0x01
1883 case FORM_GHOUL: // 0x07
1885 break;
1886
1887 case FORM_BEAR: // 0x05
1888 case FORM_DIREBEAR: // 0x08
1889
1890 case FORM_BATTLESTANCE: // 0x11
1891 case FORM_DEFENSIVESTANCE: // 0x12
1892 case FORM_BERSERKERSTANCE: // 0x13
1894 break;
1895
1896 case FORM_TREE: // 0x02
1897 case FORM_TRAVEL: // 0x03
1898 case FORM_AQUA: // 0x04
1899 case FORM_AMBIENT: // 0x06
1900
1901 case FORM_STEVES_GHOUL: // 0x09
1902 case FORM_THARONJA_SKELETON: // 0x0A
1903 case FORM_TEST_OF_STRENGTH: // 0x0B
1904 case FORM_BLB_PLAYER: // 0x0C
1905 case FORM_SHADOW_DANCE: // 0x0D
1906 case FORM_CREATUREBEAR: // 0x0E
1907 case FORM_CREATURECAT: // 0x0F
1908 case FORM_GHOSTWOLF: // 0x10
1909
1910 case FORM_TEST: // 0x14
1911 case FORM_ZOMBIE: // 0x15
1912 case FORM_METAMORPHOSIS: // 0x16
1913 case FORM_UNDEAD: // 0x19
1914 case FORM_MASTER_ANGLER: // 0x1A
1915 case FORM_FLIGHT_EPIC: // 0x1B
1916 case FORM_SHADOW: // 0x1C
1917 case FORM_FLIGHT: // 0x1D
1918 case FORM_STEALTH: // 0x1E
1919 case FORM_MOONKIN: // 0x1F
1920 case FORM_SPIRITOFREDEMPTION: // 0x20
1921 break;
1922 default:
1923 LOG_ERROR("spells.aura.effect", "Auras: Unknown Shapeshift Type: {}", GetMiscValue());
1924 }
1925
1926 modelid = target->GetModelForForm(form, GetId());
1927
1928 if (apply)
1929 {
1930 // remove polymorph before changing display id to keep new display id
1931 switch (form)
1932 {
1933 case FORM_CAT:
1934 case FORM_TREE:
1935 case FORM_TRAVEL:
1936 case FORM_AQUA:
1937 case FORM_BEAR:
1938 case FORM_DIREBEAR:
1939 case FORM_FLIGHT_EPIC:
1940 case FORM_FLIGHT:
1941 case FORM_MOONKIN:
1942 {
1943 if (Player* player = target->ToPlayer())
1944 {
1945 player->SetCanTeleport(true);
1946 }
1947 // remove movement affects
1948 target->RemoveAurasByShapeShift();
1949
1950 // and polymorphic affects
1951 if (target->IsPolymorphed())
1952 target->RemoveAurasDueToSpell(target->getTransForm());
1953 break;
1954 }
1955 default:
1956 break;
1957 }
1958
1959 // remove other shapeshift before applying a new one
1960 // xinef: rogue shouldnt be wrapped by this check (shadow dance vs stealth)
1961 if (GetSpellInfo()->SpellFamilyName != SPELLFAMILY_ROGUE)
1963
1964 // stop handling the effect if it was removed by linked event
1965 if (aurApp->GetRemoveMode())
1966 return;
1967
1968 if (PowerType != POWER_MANA)
1969 {
1970 uint32 oldPower = target->GetPower(PowerType);
1971 // reset power to default values only at power change
1972 if (target->getPowerType() != PowerType)
1973 target->setPowerType(PowerType);
1974
1975 switch (form)
1976 {
1977 case FORM_CAT:
1978 case FORM_BEAR:
1979 case FORM_DIREBEAR:
1980 {
1981 // get furor proc chance
1982 uint32 FurorChance = 0;
1983 if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0))
1984 FurorChance = std::max(dummy->GetAmount(), 0);
1985
1986 switch (GetMiscValue())
1987 {
1988 case FORM_CAT:
1989 {
1990 int32 basePoints = int32(std::min(oldPower, FurorChance));
1991 target->SetPower(POWER_ENERGY, 0);
1992 target->CastCustomSpell(target, 17099, &basePoints, nullptr, nullptr, true, nullptr, this);
1993 break;
1994 }
1995 case FORM_BEAR:
1996 case FORM_DIREBEAR:
1997 if (urand(0, 99) < FurorChance)
1998 target->CastSpell(target, 17057, true);
1999 break;
2000 default:
2001 {
2002 uint32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance);
2003 target->SetPower(POWER_ENERGY, newEnergy);
2004 break;
2005 }
2006 }
2007 break;
2008 }
2009 default:
2010 break;
2011 }
2012 }
2013 // stop handling the effect if it was removed by linked event
2014 if (aurApp->GetRemoveMode())
2015 return;
2016
2017 target->SetShapeshiftForm(form);
2018 // xinef: allow shapeshift to override model id if forced transform aura is not present!
2019 if (modelid > 0)
2020 {
2021 bool allow = true;
2022 if (target->getTransForm() && !(target->GetMapId() == MAP_THE_ESCAPE_FROM_DURNHOLDE))
2023 if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm()))
2024 if (transformSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !transformSpellInfo->IsPositive())
2025 allow = false;
2026
2027 if (allow)
2028 target->SetDisplayId(modelid);
2029 }
2030 }
2031 else
2032 {
2033 // reset model id if no other auras present
2034 // may happen when aura is applied on linked event on aura removal
2035 if (!target->HasShapeshiftAura())
2036 {
2039 {
2040 target->setPowerType(POWER_MANA);
2041 // Remove movement impairing effects also when shifting out
2042 target->RemoveAurasByShapeShift();
2043 }
2044 }
2045
2046 if (modelid > 0)
2047 target->RestoreDisplayId();
2048
2049 switch (form)
2050 {
2051 // Nordrassil Harness - bonus
2052 case FORM_BEAR:
2053 case FORM_DIREBEAR:
2054 case FORM_CAT:
2055 if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
2056 target->CastSpell(target, 37316, true, nullptr, dummy);
2057 break;
2058 // Nordrassil Regalia - bonus
2059 case FORM_MOONKIN:
2060 if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
2061 target->CastSpell(target, 37325, true, nullptr, dummy);
2062 break;
2063 case FORM_BATTLESTANCE:
2066 {
2067 uint32 Rage_val = 0;
2068 // Defensive Tactics
2069 if (form == FORM_DEFENSIVESTANCE)
2070 {
2071 if (AuraEffect const* aurEff = target->IsScriptOverriden(m_spellInfo, 831))
2072 Rage_val += aurEff->GetAmount() * 10;
2073 }
2074 // Stance mastery + Tactical mastery (both passive, and last have aura only in defense stance, but need apply at any stance switch)
2075 if (target->IsPlayer())
2076 {
2077 // Stance mastery - trainer spell
2078 PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap();
2079 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
2080 {
2081 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2082 continue;
2083
2084 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2085 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2086 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2087 }
2088
2089 // Tactical Mastery - talent
2090 PlayerTalentMap const& tp_list = target->ToPlayer()->GetTalentMap();
2091 for (PlayerTalentMap::const_iterator itr = tp_list.begin(); itr != tp_list.end(); ++itr)
2092 {
2093 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2094 continue;
2095
2096 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2097 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2098 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2099 }
2100 }
2101 if (target->GetPower(POWER_RAGE) > Rage_val)
2102 target->SetPower(POWER_RAGE, Rage_val);
2103 break;
2104 }
2105 default:
2106 break;
2107 }
2108 }
2109
2110 // adding/removing linked auras
2111 // add/remove the shapeshift aura's boosts
2112 HandleShapeshiftBoosts(target, apply);
2113
2114 if (target->IsPlayer())
2115 target->ToPlayer()->InitDataForForm();
2116
2118 {
2119 // Dash
2121 aurEff->RecalculateAmount();
2122
2123 // Disarm handling
2124 // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
2125 // and also HandleAuraModDisarm is not triggered
2126 if (!target->CanUseAttackType(BASE_ATTACK))
2127 {
2129 {
2130 target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), nullptr, apply);
2131 }
2132 }
2133
2134 // Update crit chance for feral forms
2135 switch (form)
2136 {
2137 case FORM_CAT:
2138 case FORM_BEAR:
2139 case FORM_DIREBEAR:
2140 case FORM_GHOSTWOLF:
2142 break;
2143 default:
2144 break;
2145 }
2146 }
2147
2148 // stop handling the effect if it was removed by linked event
2149 if (apply && aurApp->GetRemoveMode())
2150 return;
2151
2152 if (target->IsPlayer())
2153 {
2154 SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(form);
2155 // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
2156 for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
2157 {
2158 if (!shapeInfo->stanceSpell[i])
2159 continue;
2160 if (apply)
2161 target->ToPlayer()->_addSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2162 else
2163 target->ToPlayer()->removeSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2164 }
2165 }
2166}
@ MAP_THE_ESCAPE_FROM_DURNHOLDE
Definition AreaDefines.h:236
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormEntryfmt)
#define MAX_SHAPESHIFT_SPELLS
Definition DBCStructure.h:1815
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:177
@ PLAYERSPELL_REMOVED
Definition Player.h:122
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ POWER_RAGE
Definition SharedDefines.h:270
@ POWER_ENERGY
Definition SharedDefines.h:272
@ POWER_MANA
Definition SharedDefines.h:269
@ CLASS_DRUID
Definition SharedDefines.h:151
@ SPELLFAMILY_WARRIOR
Definition SharedDefines.h:3548
@ SPELL_ATTR0_NO_IMMUNITIES
Definition SharedDefines.h:411
@ 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:68
@ FORM_DIREBEAR
Definition UnitDefines.h:77
@ FORM_UNDEAD
Definition UnitDefines.h:92
@ FORM_TEST
Definition UnitDefines.h:89
@ FORM_TRAVEL
Definition UnitDefines.h:72
@ FORM_CREATUREBEAR
Definition UnitDefines.h:83
@ FORM_SHADOW
Definition UnitDefines.h:95
@ FORM_SHADOW_DANCE
Definition UnitDefines.h:82
@ FORM_SPIRITOFREDEMPTION
Definition UnitDefines.h:99
@ FORM_BERSERKERSTANCE
Definition UnitDefines.h:88
@ FORM_MASTER_ANGLER
Definition UnitDefines.h:93
@ FORM_DEFENSIVESTANCE
Definition UnitDefines.h:87
@ FORM_THARONJA_SKELETON
Definition UnitDefines.h:79
@ FORM_FLIGHT_EPIC
Definition UnitDefines.h:94
@ FORM_STEVES_GHOUL
Definition UnitDefines.h:78
@ FORM_MOONKIN
Definition UnitDefines.h:98
@ FORM_NONE
Definition UnitDefines.h:69
@ FORM_CREATURECAT
Definition UnitDefines.h:84
@ FORM_CAT
Definition UnitDefines.h:70
@ FORM_FLIGHT
Definition UnitDefines.h:96
@ FORM_ZOMBIE
Definition UnitDefines.h:90
@ FORM_AMBIENT
Definition UnitDefines.h:75
@ FORM_AQUA
Definition UnitDefines.h:73
@ FORM_STEALTH
Definition UnitDefines.h:97
@ FORM_BATTLESTANCE
Definition UnitDefines.h:86
@ FORM_BLB_PLAYER
Definition UnitDefines.h:81
@ FORM_METAMORPHOSIS
Definition UnitDefines.h:91
@ FORM_GHOUL
Definition UnitDefines.h:76
@ FORM_TREE
Definition UnitDefines.h:71
@ FORM_TEST_OF_STRENGTH
Definition UnitDefines.h:80
@ FORM_BEAR
Definition UnitDefines.h:74
void HandleShapeshiftBoosts(Unit *target, bool apply) const
Definition SpellAuraEffects.cpp:1228
static ObjectGuid const Empty
Definition ObjectGuid.h:120
bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill=false)
Definition Player.cpp:3102
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary)
Definition Player.cpp:3331
const PlayerTalentMap & GetTalentMap() const
Definition Player.h:2623
PlayerSpellMap const & GetSpellMap() const
Definition Player.h:1785
void InitDataForForm(bool reapplyMods=false)
Definition Player.cpp:10528
uint8 GetActiveSpec() const
Definition Player.h:1753
void UpdateAllCritPercentages()
Definition StatSystem.cpp:680
uint32 SpellIconID
Definition SpellInfo.h:380
void RemoveAurasByShapeShift()
Definition Unit.cpp:5303
bool CanUseAttackType(uint8 attacktype) const
Definition Unit.h:929
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
Definition Unit.cpp:14902
bool IsPolymorphed() const
Definition Unit.cpp:16774
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition Unit.cpp:15617
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:5527
virtual bool IsClass(Classes unitClass, ClassContext context=CLASS_CONTEXT_NONE) const
Definition Unit.h:794
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
Definition Unit.cpp:5865
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId)
Definition Unit.cpp:19247
bool HasShapeshiftAura() const
Definition Unit.h:1730
void RestoreDisplayId()
Definition Unit.cpp:16808
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
Definition Unit.h:1358
uint32 getTransForm() const
Definition Unit.h:1872
Powers getPowerType() const
Definition Unit.h:1052
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition Unit.cpp:5143
uint32 GetPower(Powers power) const
Definition Unit.h:1056
void setPowerType(Powers power)
Definition Unit.cpp:10019
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:21079
uint32 GetMapId() const
Definition Position.h:280
Definition DBCStructure.h:1818
uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]
Definition DBCStructure.h:1830

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
3024{
3025 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3026 return;
3027
3028 Unit* target = aurApp->GetTarget();
3029
3030 if (apply)
3031 {
3033
3034 // call functions which may have additional effects after chainging state of unit
3035 // Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
3036 for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
3037 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
3038 if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
3039 // Stop spells on prepare or casting state
3040 target->InterruptSpell(CurrentSpellTypes(i), false);
3041 }
3042 else
3043 {
3044 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3045 if (target->HasSilenceAura() || target->HasPacifySilenceAura())
3046 return;
3047
3049 }
3050}
@ SPELL_PREVENTION_TYPE_SILENCE
Definition SharedDefines.h:1554
@ UNIT_FLAG_SILENCED
Definition UnitDefines.h:263
#define CURRENT_MAX_SPELL
Definition Unit.h:545
CurrentSpellTypes
Definition Unit.h:537
@ CURRENT_MELEE_SPELL
Definition Unit.h:538
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4093
bool HasSilenceAura() const
Definition Unit.h:1729

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
3225{
3227 return;
3228 Unit* target = aurApp->GetTarget();
3229
3230 if (!target->IsPlayer())
3231 return;
3232
3233 uint32 prot = GetMiscValue();
3234 int32 points = GetAmount();
3235
3236 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
3237 if (prot == SKILL_DEFENSE)
3238 target->ToPlayer()->UpdateDefenseBonusesMod();
3239}
@ SKILL_DEFENSE
Definition SharedDefines.h:2881
@ 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:5316
void UpdateDefenseBonusesMod()
Definition StatSystem.cpp:609

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
3167{
3169 return;
3170
3171 Unit* target = aurApp->GetTarget();
3172
3173 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
3174 if (apply)
3176 else
3177 {
3178 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3179 if (!target->HasAuraType(GetAuraType()))
3181 }
3182
3183 // call functions which may have additional effects after chainging state of unit
3184 target->UpdateObjectVisibility(target->IsPlayer());
3185}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition SharedDefines.h:3122
virtual void RemoveDynamicFlag(uint32 flag)
Definition Object.h:125
virtual void SetDynamicFlag(uint32 flag)
Definition Object.h:124
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition Unit.cpp:19177

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
4429{
4431 return;
4432
4433 Unit* target = aurApp->GetTarget();
4434
4435 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4436 {
4437 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4438 return;
4439 }
4440
4441 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4442 {
4443 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4444 if (GetMiscValue() < 0 || GetMiscValue() == i)
4445 {
4446 //target->ApplyStatMod(Stats(i), m_amount, apply);
4448 if (target->IsPlayer() || target->IsPet())
4449 target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
4450 }
4451 }
4452}
#define MAX_STATS
Definition SharedDefines.h:265
Stats
Definition SharedDefines.h:257
@ STAT_STRENGTH
Definition SharedDefines.h:258
@ UNIT_MOD_STAT_START
Definition Unit.h:171
void ApplyStatBuffMod(Stats stat, float val, bool apply)
Definition Unit.h:1020

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

◆ HandleAuraModStateImmunity()

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

◆ HandleAuraModStun()

void AuraEffect::HandleAuraModStun ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3510{
3511 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3512 return;
3513
3514 Unit* target = aurApp->GetTarget();
3515
3516 target->SetControlled(apply, UNIT_STATE_STUNNED);
3517}
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173

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

◆ HandleAuraModTotalThreat()

void AuraEffect::HandleAuraModTotalThreat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3448{
3450 return;
3451
3452 Unit* target = aurApp->GetTarget();
3453
3454 if (!target->IsAlive() || !target->IsPlayer())
3455 return;
3456
3457 Unit* caster = GetCaster();
3458 if (caster && caster->IsAlive())
3459 target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
3460}
void addTempThreat(float threat, bool apply)
Definition HostileRefMgr.cpp:65
HostileRefMgr & getHostileRefMgr()
Definition Unit.h:900

References HostileRefMgr::addTempThreat(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), GetCaster(), Unit::getHostileRefMgr(), AuraApplication::GetTarget(), Unit::IsAlive(), and Object::IsPlayer().

◆ HandleAuraModUseNormalSpeed()

void AuraEffect::HandleAuraModUseNormalSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3788{
3789 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3790 return;
3791
3792 Unit* target = aurApp->GetTarget();
3793
3794 target->UpdateSpeed(MOVE_RUN, true);
3795 target->UpdateSpeed(MOVE_SWIM, true);
3796 target->UpdateSpeed(MOVE_FLIGHT, true);
3797
3798 if (Player* targetPlayer = target->ToPlayer())
3799 {
3800 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3801 }
3802}

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
4861{
4863 return;
4864
4865 Unit* target = aurApp->GetTarget();
4866
4867 if (!target->IsPlayer())
4868 return;
4869
4870 for (int i = 0; i < MAX_ATTACK; ++i)
4871 if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
4872 target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply);
4873
4874 // mods must be applied base at equipped weapon class and subclass comparison
4875 // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
4876 // GetMiscValue() comparison with item generated damage types
4877
4878 if (GetSpellInfo()->EquippedItemClass == -1)
4879 {
4880 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4883 }
4884 else
4885 {
4886 // done in Player::_ApplyWeaponDependentAuraMods
4887 }
4888}
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const *aura, bool apply)
Definition Player.cpp:7029

References Player::_ApplyWeaponDependentAuraCritMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, CRIT_PERCENTAGE, FLAT_MOD, GetAmount(), GetSpellInfo(), AuraApplication::GetTarget(), Player::GetWeaponForAttack(), Player::HandleBaseModValue(), Object::IsPlayer(), MAX_ATTACK, OFFHAND_CRIT_PERCENTAGE, RANGED_CRIT_PERCENTAGE, and Object::ToPlayer().

◆ HandleAuraMounted()

void AuraEffect::HandleAuraMounted ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3246{
3248 return;
3249
3250 Unit* target = aurApp->GetTarget();
3251 Unit* caster = GetCaster();
3252
3253 if (apply)
3254 {
3255 uint32 creatureEntry = GetMiscValue();
3256 uint32 displayId = 0;
3257 uint32 vehicleId = 0;
3258
3259 // Festive Holiday Mount
3260 if (target->HasAura(62061))
3261 {
3263 creatureEntry = 24906;
3264 else
3265 creatureEntry = 15665;
3266 }
3267
3268 // Festive Brewfest Mount
3270 {
3271 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
3272 {
3273 creatureEntry = GREAT_BREWFEST_KODO;
3274 }
3275 else
3276 {
3277 creatureEntry = BREWFEST_KODO;
3278 }
3279 }
3280
3281 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
3282 {
3283 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
3284 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
3285 displayId = model.CreatureDisplayID;
3286
3287 vehicleId = creatureInfo->VehicleId;
3288
3289 //some spell has one aura of mount and one of vehicle
3290 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3291 {
3292 if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue())
3293 {
3294 displayId = 0;
3295 }
3296 }
3297
3298 }
3299 target->Mount(displayId, vehicleId, GetMiscValue());
3300 }
3301 else
3302 {
3303 target->Dismount();
3304 //some mounts like Headless Horseman's Mount or broom stick are skill based spell
3305 // need to remove ALL arura related to mounts, this will stop client crash with broom stick
3306 // and never endless flying after using Headless Horseman's Mount
3307 if (mode & AURA_EFFECT_HANDLE_REAL)
3309 }
3310}
@ SPELL_EFFECT_SUMMON
Definition SharedDefines.h:806
void Dismount()
Definition Unit.cpp:13568
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5754
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:13509

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
6094{
6095 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6096 return;
6097
6098 Unit* target = aurApp->GetTarget();
6099
6100 if (!target->IsPlayer() || !target->IsInWorld())
6101 return;
6102
6103 if (apply)
6104 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
6105
6106 // client auto close stable dialog at !apply aura
6107}
bool IsInWorld() const
Definition Object.h:108
WorldSession * GetSession() const
Definition Player.h:2011
void SendStablePet(ObjectGuid guid)
Definition NPCHandler.cpp:480

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
6123{
6124 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6125 return;
6126
6127 Player* target = aurApp->GetTarget()->ToPlayer();
6128
6129 if (!target || !target->IsInWorld())
6130 return;
6131
6132 uint32 overrideId = uint32(GetMiscValue());
6133
6134 if (apply)
6135 {
6137 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6138 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6139 if (uint32 spellId = overrideSpells->spellId[i])
6140 target->_addSpell(spellId, SPEC_MASK_ALL, true);
6141 }
6142 else
6143 {
6145 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6146 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6147 if (uint32 spellId = overrideSpells->spellId[i])
6148 target->removeSpell(spellId, SPEC_MASK_ALL, true);
6149 }
6150}
DBCStorage< OverrideSpellDataEntry > sOverrideSpellDataStore(OverrideSpellDatafmt)
#define MAX_OVERRIDE_SPELL
Definition DBCStructure.h:1412
#define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET
Definition Player.h:557
@ PLAYER_FIELD_BYTES2
Definition UpdateFields.h:378
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition Object.cpp:770
Definition DBCStructure.h:1415

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
5392{
5393 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5394 return;
5395
5396 Unit* target = aurApp->GetTarget();
5397
5398 if (!target->IsPlayer())
5399 return;
5400
5401 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5402 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5403 if (!(apply) && GetBase()->GetDuration() == 0)
5404 target->AddComboPoints(-GetAmount());
5405}
void AddComboPoints(Unit *target, int8 count)
Definition Unit.cpp:16871

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
6153{
6154 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6155 return;
6156
6157 Unit* target = aurApp->GetTarget();
6158
6159 if (!target->IsPlayer() || !target->IsInWorld())
6160 return;
6161
6162 uint32 vehicleId = GetMiscValue();
6163
6164 if (apply)
6165 {
6166 if (!target->CreateVehicleKit(vehicleId, 0))
6167 return;
6168 }
6169 else if (target->GetVehicleKit())
6170 target->RemoveVehicleKit();
6171
6173 data << target->GetPackGUID();
6174 data << uint32(apply ? vehicleId : 0);
6175 target->SendMessageToSet(&data, true);
6176
6177 if (apply)
6178 {
6180 target->ToPlayer()->GetSession()->SendPacket(&data);
6181 }
6182}
PackedGuid const & GetPackGUID() const
Definition Object.h:115
std::size_t size() const
Definition ObjectGuid.h:274
void RemoveVehicleKit()
Definition Unit.cpp:18774
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition Unit.cpp:18762
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition Object.cpp:2091
Definition WorldPacket.h:26
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition WorldSession.cpp:226
@ 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(), Player::GetSession(), AuraApplication::GetTarget(), Unit::GetVehicleKit(), WorldPacket::Initialize(), Object::IsInWorld(), Object::IsPlayer(), Unit::RemoveVehicleKit(), WorldObject::SendMessageToSet(), WorldSession::SendPacket(), 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
3116{
3118 return;
3119
3120 Unit* target = aurApp->GetTarget();
3121
3122 if (!target->IsPlayer())
3123 return;
3124
3125 if (apply)
3126 target->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3127 else
3128 target->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3129}
@ 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
3132{
3134 return;
3135
3136 Unit* target = aurApp->GetTarget();
3137
3138 if (!target->IsPlayer())
3139 return;
3140
3141 if (apply)
3142 target->SetFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3143 else
3144 target->RemoveFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3145}
@ 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
3148{
3150 return;
3151
3152 Unit* target = aurApp->GetTarget();
3153
3154 if (!target->IsPlayer())
3155 return;
3156
3157 if (!(apply))
3158 {
3159 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3160 if (target->HasAuraType(GetAuraType()))
3161 return;
3162 }
3164}
@ PLAYER_FIELD_BYTE_TRACK_STEALTHED
Definition Player.h:565
@ PLAYER_FIELD_BYTES
Definition UpdateFields.h:368
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition Object.cpp:899

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
2169{
2171 return;
2172
2173 Unit* target = aurApp->GetTarget();
2174
2175 if (apply)
2176 {
2177 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
2178 if (GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !target->GetModelForForm(target->GetShapeshiftForm(), GetId()) || !GetSpellInfo()->IsPositive())
2179 {
2180 // special case (spell specific functionality)
2181 if (GetMiscValue() == 0)
2182 {
2183 switch (GetId())
2184 {
2185 // Orb of Deception
2186 case 16739:
2187 {
2188 if (!target->IsPlayer())
2189 return;
2190
2191 switch (target->getRace())
2192 {
2193 // Blood Elf
2194 case RACE_BLOODELF:
2195 target->SetDisplayId(target->getGender() == GENDER_MALE ? 17829 : 17830);
2196 break;
2197 // Orc
2198 case RACE_ORC:
2199 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10139 : 10140);
2200 break;
2201 // Troll
2202 case RACE_TROLL:
2203 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10135 : 10134);
2204 break;
2205 // Tauren
2206 case RACE_TAUREN:
2207 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10136 : 10147);
2208 break;
2209 // Undead
2210 case RACE_UNDEAD_PLAYER:
2211 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10146 : 10145);
2212 break;
2213 // Draenei
2214 case RACE_DRAENEI:
2215 target->SetDisplayId(target->getGender() == GENDER_MALE ? 17827 : 17828);
2216 break;
2217 // Dwarf
2218 case RACE_DWARF:
2219 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10141 : 10142);
2220 break;
2221 // Gnome
2222 case RACE_GNOME:
2223 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10148 : 10149);
2224 break;
2225 // Human
2226 case RACE_HUMAN:
2227 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10137 : 10138);
2228 break;
2229 // Night Elf
2230 case RACE_NIGHTELF:
2231 target->SetDisplayId(target->getGender() == GENDER_MALE ? 10143 : 10144);
2232 break;
2233 default:
2234 break;
2235 }
2236 break;
2237 }
2238 // Murloc costume
2239 case 42365:
2240 target->SetDisplayId(21723);
2241 break;
2242 // Dread Corsair
2243 case 50517:
2244 // Corsair Costume
2245 case 51926:
2246 {
2247 if (!target->IsPlayer())
2248 return;
2249
2250 switch (target->getRace())
2251 {
2252 // Blood Elf
2253 case RACE_BLOODELF:
2254 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25032 : 25043);
2255 break;
2256 // Orc
2257 case RACE_ORC:
2258 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25039 : 25050);
2259 break;
2260 // Troll
2261 case RACE_TROLL:
2262 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25041 : 25052);
2263 break;
2264 // Tauren
2265 case RACE_TAUREN:
2266 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25040 : 25051);
2267 break;
2268 // Undead
2269 case RACE_UNDEAD_PLAYER:
2270 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25042 : 25053);
2271 break;
2272 // Draenei
2273 case RACE_DRAENEI:
2274 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25033 : 25044);
2275 break;
2276 // Dwarf
2277 case RACE_DWARF:
2278 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25034 : 25045);
2279 break;
2280 // Gnome
2281 case RACE_GNOME:
2282 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25035 : 25046);
2283 break;
2284 // Human
2285 case RACE_HUMAN:
2286 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25037 : 25048);
2287 break;
2288 // Night Elf
2289 case RACE_NIGHTELF:
2290 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25038 : 25049);
2291 break;
2292 default:
2293 break;
2294 }
2295 break;
2296 }
2297 // Pygmy Oil
2298 case 53806:
2299 target->SetDisplayId(22512);
2300 break;
2301 // Honor the Dead
2302 case 65386:
2303 case 65495:
2304 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204);
2305 break;
2306 // Gossip NPC Appearance - Brewfest
2307 case 65511:
2308 {
2309 switch (target->GetDisplayRace())
2310 {
2312 if (urand(0, 1))
2313 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21839 : 21838);
2314 else
2315 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21841 : 21840);
2316 break;
2317 case DisplayRace::Orc:
2318 if (urand(0, 1))
2319 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21867 : 21866);
2320 else
2321 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21869 : 21868);
2322 break;
2323 case DisplayRace::Troll:
2324 if (urand(0, 1))
2325 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21875 : 21874);
2326 else
2327 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21877 : 21876);
2328 break;
2330 if (urand(0, 1))
2331 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21869 : 21871);
2332 else
2333 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21872 : 21873);
2334 break;
2336 if (urand(0, 1))
2337 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21879 : 21878);
2338 else
2339 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21881 : 21880);
2340 break;
2342 if (urand(0, 1))
2343 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21844 : 21842);
2344 else
2345 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21845 : 21843);
2346 break;
2347 case DisplayRace::Dwarf:
2348 if (urand(0, 1))
2349 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21846 : 21848);
2350 else
2351 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21847 : 21849);
2352 break;
2353 case DisplayRace::Gnome:
2354 if (urand(0, 1))
2355 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21851 : 21850);
2356 else
2357 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21853 : 21852);
2358 break;
2359 case DisplayRace::Human:
2360 if (urand(0, 1))
2361 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21859 : 21858);
2362 else
2363 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21861 : 21860);
2364 break;
2366 if (urand(0, 1))
2367 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21863 : 21862);
2368 else
2369 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21865 : 21864);
2370 break;
2372 if (urand(0, 1))
2373 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21854 : 21856);
2374 else
2375 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21855 : 21857);
2376 break;
2377 default:
2378 break;
2379 }
2380
2381 // equip random brewfest mug
2382 uint32 itemIds[5] = {
2383 2703, // Monster - Item, Tankard Wooden
2384 2704, // Monster - Item, Tankard Dirty
2385 2705, // Monster - Item, Tankard Metal
2386 13861, // Monster - Item, Tankard Gold
2387 33963 // NPC Equip 33963
2388 };
2389 if (target->ToCreature())
2390 target->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, itemIds[urand(0, 4)]);
2391
2392 break;
2393 }
2394 // Gossip NPC Appearance - Winter Veil
2395 case 65522:
2396 {
2397 switch (target->GetDisplayRace())
2398 {
2400 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18793 : 18785);
2401 break;
2402 case DisplayRace::Orc:
2403 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18805 : 18804);
2404 break;
2405 case DisplayRace::Troll:
2406 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18809 : 18808);
2407 break;
2409 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18807 : 18806);
2410 break;
2412 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18811 : 18810);
2413 break;
2415 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18795 : 18794);
2416 break;
2417 case DisplayRace::Dwarf:
2418 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18797 : 18796);
2419 break;
2420 case DisplayRace::Gnome:
2421 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18799 : 18798);
2422 break;
2423 case DisplayRace::Human:
2424 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18801 : 18800);
2425 break;
2427 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18803 : 18802);
2428 break;
2430 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19342 : 19339);
2431 default:
2432 break;
2433 }
2434 break;
2435 }
2436 // Gossip NPC Appearance - Default
2437 case 65523:
2438 {
2439 switch (target->GetDisplayRace())
2440 {
2442 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19170 : 19169);
2443 break;
2444 case DisplayRace::Orc:
2445 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19182 : 19181);
2446 break;
2447 case DisplayRace::Troll:
2448 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19186 : 19185);
2449 break;
2451 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19184 : 19183);
2452 break;
2454 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19188 : 19187);
2455 break;
2457 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19172 : 19171);
2458 break;
2459 case DisplayRace::Dwarf:
2460 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19174 : 19173);
2461 break;
2462 case DisplayRace::Gnome:
2463 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19176 : 19175);
2464 break;
2465 case DisplayRace::Human:
2466 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19178 : 19177);
2467 break;
2469 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19180 : 19179);
2470 break;
2472 target->SetDisplayId(target->getGender() == GENDER_MALE ? 19343 : 19340);
2473 default:
2474 break;
2475 }
2476 break;
2477 }
2478 // Gossip NPC Appearance - Lunar Festival
2479 case 65524:
2480 {
2481 switch (target->GetDisplayRace())
2482 {
2484 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18841 : 18840);
2485 break;
2486 case DisplayRace::Orc:
2487 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18870 : 18869);
2488 break;
2489 case DisplayRace::Troll:
2490 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18874 : 18873);
2491 break;
2493 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18872 : 18871);
2494 break;
2496 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18876 : 18875);
2497 break;
2499 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18843 : 18842);
2500 break;
2501 case DisplayRace::Dwarf:
2502 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18845 : 18844);
2503 break;
2504 case DisplayRace::Gnome:
2505 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18847 : 18846);
2506 break;
2507 case DisplayRace::Human:
2508 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18860 : 18858);
2509 break;
2511 target->SetDisplayId(target->getGender() == GENDER_MALE ? 18868 : 18867);
2512 break;
2514 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21067 : 19341);
2515 default:
2516 break;
2517 }
2518 break;
2519 }
2520 // Gossip NPC Appearance - Hallow's End
2521 case 65525:
2522 {
2523 switch (target->GetDisplayRace())
2524 {
2526 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22361 : 22360);
2527 break;
2528 case DisplayRace::Orc:
2529 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22375 : 22374);
2530 break;
2531 case DisplayRace::Troll:
2532 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22379 : 22378);
2533 break;
2535 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22377 : 22376);
2536 break;
2538 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22381 : 22380);
2539 break;
2541 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22363 : 22362);
2542 break;
2543 case DisplayRace::Dwarf:
2544 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22365 : 22364);
2545 break;
2546 case DisplayRace::Gnome:
2547 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22367 : 22366);
2548 break;
2549 case DisplayRace::Human:
2550 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22371 : 22370);
2551 break;
2553 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22373 : 22372);
2554 break;
2556 target->SetDisplayId(target->getGender() == GENDER_MALE ? 22369 : 22368);
2557 default:
2558 break;
2559 }
2560 break;
2561 }
2562 // Gossip NPC Appearance - Midsummer
2563 case 65526:
2564 {
2565 switch (target->GetDisplayRace())
2566 {
2568 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21086 : 21085);
2569 break;
2570 case DisplayRace::Orc:
2571 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16438 : 16436);
2572 break;
2573 case DisplayRace::Troll:
2574 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16446 : 16445);
2575 break;
2577 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16432 : 16442);
2578 break;
2580 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16444 : 16443);
2581 break;
2583 target->SetDisplayId(target->getGender() == GENDER_MALE ? 21083 : 21084);
2584 break;
2585 case DisplayRace::Dwarf:
2586 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16413 : 16434);
2587 break;
2588 case DisplayRace::Gnome:
2589 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16448 : 16447);
2590 break;
2591 case DisplayRace::Human:
2592 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16433 : 16412);
2593 break;
2595 target->SetDisplayId(target->getGender() == GENDER_MALE ? 16435 : 16414);
2596 break;
2598 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29243 : 16431);
2599 default:
2600 break;
2601 }
2602 break;
2603 }
2604 // Gossip NPC Appearance - Spirit of Competition
2605 case 65527:
2606 {
2607 switch (target->GetDisplayRace())
2608 {
2610 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24508 : 24519);
2611 break;
2612 case DisplayRace::Orc:
2613 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24515 : 24526);
2614 break;
2615 case DisplayRace::Troll:
2616 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24517 : 24528);
2617 break;
2619 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24516 : 24527);
2620 break;
2622 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24518 : 24529);
2623 break;
2625 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24509 : 24520);
2626 break;
2627 case DisplayRace::Dwarf:
2628 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24510 : 24521);
2629 break;
2630 case DisplayRace::Gnome:
2631 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24511 : 24522);
2632 break;
2633 case DisplayRace::Human:
2634 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24513 : 24524);
2635 break;
2637 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24514 : 24525);
2638 break;
2640 target->SetDisplayId(target->getGender() == GENDER_MALE ? 24512 : 24523);
2641 default:
2642 break;
2643 }
2644 break;
2645 }
2646 // Gossip NPC Appearance - Pirates' Day
2647 case 65528:
2648 {
2649 switch (target->GetDisplayRace())
2650 {
2652 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25032 : 25043);
2653 break;
2654 case DisplayRace::Orc:
2655 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25039 : 25050);
2656 break;
2657 case DisplayRace::Troll:
2658 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25041 : 25052);
2659 break;
2661 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25040 : 25051);
2662 break;
2664 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25042 : 25053);
2665 break;
2667 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25033 : 25044);
2668 break;
2669 case DisplayRace::Dwarf:
2670 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25034 : 25045);
2671 break;
2672 case DisplayRace::Gnome:
2673 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25035 : 25046);
2674 break;
2675 case DisplayRace::Human:
2676 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25037 : 25048);
2677 break;
2679 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25038 : 25049);
2680 break;
2682 target->SetDisplayId(target->getGender() == GENDER_MALE ? 25036 : 25047);
2683 default:
2684 break;
2685 }
2686 break;
2687 }
2688 // Gossip NPC Appearance - Day of the Dead(DotD)
2689 case 65529:
2690 target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204);
2691 break;
2692 // Darkspear Pride
2693 case 75532:
2694 target->SetDisplayId(target->getGender() == GENDER_MALE ? 31737 : 31738);
2695 break;
2696 // Gnomeregan Pride
2697 case 75531:
2698 target->SetDisplayId(target->getGender() == GENDER_MALE ? 31654 : 31655);
2699 break;
2700 default:
2701 break;
2702 }
2703 }
2704 else
2705 {
2706 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(GetMiscValue());
2707 if (!ci)
2708 {
2709 target->SetDisplayId(16358); // pig pink ^_^
2710 LOG_ERROR("spells.aura.effect", "Auras: unknown creature id = {} (only need its modelid) From Spell Aura Transform in Spell ID = {}", GetMiscValue(), GetId());
2711 }
2712 else
2713 {
2714 uint32 model_id = 0;
2715
2716 if (uint32 modelid = ObjectMgr::ChooseDisplayId(ci)->CreatureDisplayID)
2717 model_id = modelid; // Will use the default model here
2718
2719 // Polymorph (sheep)
2720 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellIconID == 82 && GetSpellInfo()->SpellVisual[0] == 12978)
2721 if (Unit* caster = GetCaster())
2722 if (caster->HasAura(52648)) // Glyph of the Penguin
2723 model_id = 26452;
2724
2725 target->SetDisplayId(model_id);
2726
2727 // Dragonmaw Illusion (set mount model also)
2728 if (GetId() == 42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
2730 }
2731 }
2732 }
2733
2734 // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
2735 SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm());
2736 if (!transformSpellInfo || GetSpellInfo()->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !GetSpellInfo()->IsPositive() || transformSpellInfo->IsPositive())
2737 target->setTransForm(GetId());
2738
2739 // polymorph case
2740 if ((mode & AURA_EFFECT_HANDLE_REAL) && target->IsPlayer() && target->IsPolymorphed())
2741 {
2742 // for players, start regeneration after 1s (in polymorph fast regeneration case)
2743 // only if caster is Player (after patch 2.4.2)
2744 if (GetCasterGUID().IsPlayer())
2746
2747 //dismount polymorphed target (after patch 2.4.2)
2748 if (target->IsMounted())
2750 }
2751 }
2752 else
2753 {
2754 // HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
2755 if (target->getTransForm() == GetId())
2756 target->setTransForm(0);
2757
2758 target->RestoreDisplayId();
2759
2760 // Dragonmaw Illusion (restore mount model)
2761 if (GetId() == 42016 && target->GetMountID() == 16314)
2762 {
2763 if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
2764 {
2765 uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
2766 if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(cr_id))
2767 {
2769 sObjectMgr->GetCreatureModelRandomGender(&model, ci);
2770
2772 }
2773 }
2774 }
2775 }
2776}
@ 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:1618
uint8 getRace(bool original=false) const
Definition Unit.cpp:20824
DisplayRace GetDisplayRace() const
Definition Unit.h:790
void setTransForm(uint32 spellid)
Definition Unit.h:1871
bool IsMounted() const
Definition Unit.h:1791

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
3188{
3190 return;
3191
3192 Unit* target = aurApp->GetTarget();
3193
3194 if (apply)
3196 else
3197 {
3198 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3199 if (target->HasAuraType(GetAuraType()))
3200 return;
3202 }
3203}
@ UNIT_STAND_FLAGS_UNTRACKABLE
Definition UnitDefines.h:49
@ UNIT_BYTES_1_OFFSET_VIS_FLAG
Definition UnitDefines.h:25
@ UNIT_FIELD_BYTES_1
Definition UpdateFields.h:131
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:930
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:911

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
3333{
3335 return;
3336
3337 Unit* target = aurApp->GetTarget();
3338
3339 if (Player* targetPlayer = target->ToPlayer())
3340 {
3341 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3342 }
3343
3344 if (!apply)
3345 {
3346 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3347 if (target->HasAuraType(GetAuraType()))
3348 return;
3349 }
3350
3351 target->SetWaterWalking(apply);
3352}
virtual bool SetWaterWalking(bool enable, bool packetOnly=false)
Allow to walk on water. Doesn't inform the client. Need to use SendMovementWaterWalking() if it's for...
Definition Unit.cpp:20447

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
5901{
5902 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5903 return;
5904
5905 Unit* target = aurApp->GetTarget();
5906
5907 Unit* caster = GetCaster();
5908
5909 if (!caster || !caster->IsPlayer())
5910 return;
5911
5912 caster->ToPlayer()->SetViewpoint(target, apply);
5913}
void SetViewpoint(WorldObject *target, bool apply)
Definition Player.cpp:13122

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

◆ HandleChannelDeathItem()

void AuraEffect::HandleChannelDeathItem ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5856{
5857 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5858 return;
5859
5860 if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
5861 return;
5862
5863 Unit* caster = GetCaster();
5864
5865 if (!caster || !caster->IsPlayer())
5866 return;
5867
5868 Player* plCaster = caster->ToPlayer();
5869
5870 // Item amount
5871 if (GetAmount() <= 0)
5872 return;
5873
5874 if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0)
5875 return;
5876
5877 //Adding items
5878 uint32 noSpaceForCount = 0;
5879 uint32 count = m_amount;
5880
5881 ItemPosCountVec dest;
5882 InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount);
5883 if (msg != EQUIP_ERR_OK)
5884 {
5885 count -= noSpaceForCount;
5886 plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellInfo()->Effects[m_effIndex].ItemType);
5887 if (count == 0)
5888 return;
5889 }
5890
5891 Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true);
5892 if (!newitem)
5893 {
5894 plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
5895 return;
5896 }
5897 plCaster->SendNewItem(newitem, count, true, true);
5898}
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:778
@ 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:4750
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0)
Definition PlayerStorage.cpp:2524
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition PlayerStorage.cpp:4021
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition Player.h:1296

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
3638{
3639 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3640 return;
3641
3642 Unit* target = aurApp->GetTarget();
3643
3644 Unit* caster = GetCaster();
3645
3646 if (apply)
3647 target->SetCharmedBy(caster, CHARM_TYPE_CONVERT, aurApp);
3648 else
3649 target->RemoveCharmedBy(caster);
3650}
@ CHARM_TYPE_CONVERT
Definition CharmInfo.h:48
void RemoveCharmedBy(Unit *charmer)
Definition Unit.cpp:18599
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:18397

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
6004{
6006 return;
6007
6008 Unit* target = aurApp->GetTarget();
6009
6010 if (apply)
6012 else
6013 {
6014 if (target->HasAuraType(GetAuraType()))
6015 return;
6016
6018 }
6019}
@ UNIT_FLAG2_COMPREHEND_LANG
Definition UnitDefines.h:292

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
1715{
1717 {
1718 return;
1719 }
1720
1721 Unit* target = aurApp->GetTarget();
1722 if (!target->IsPlayer())
1723 {
1724 return;
1725 }
1726
1727 if (apply)
1728 {
1729 target->SetByteFlag(PLAYER_FIELD_BYTES2, 3, 1 << (GetMiscValue() - 1));
1730 }
1731 else
1732 {
1733 if (target->HasDetectAmoreAura())
1734 {
1736 for (AuraEffect const* aurEff : amoreAuras)
1737 if (GetMiscValue() == aurEff->GetMiscValue())
1738 {
1739 return;
1740 }
1741 }
1742
1743 target->RemoveByteFlag(PLAYER_FIELD_BYTES2, 3, 1 << (GetMiscValue() - 1));
1744 }
1745}
@ SPELL_AURA_DETECT_AMORE
Definition SpellAuraDefines.h:233
bool HasDetectAmoreAura() const
Definition Unit.h:1722

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 
)
749{
750 // check if call is correct, we really don't want using bitmasks here (with 1 exception)
754 || mode == AURA_EFFECT_HANDLE_STAT
755 || mode == AURA_EFFECT_HANDLE_SKILL
758
759 // register/unregister effect in lists in case of real AuraEffect apply/remove
760 // registration/unregistration is done always before real effect handling (some effect handlers code is depending on this)
761 if (mode & AURA_EFFECT_HANDLE_REAL)
762 aurApp->GetTarget()->_RegisterAuraEffect(this, apply);
763
764 // xinef: stacking system, force return if effect is disabled, prevents double apply / unapply
765 // xinef: placed here so above line can unregister effect from the list
766 // xinef: this condition works under assumption that effect handlers performs ALL necessery action with CHANGE_AMOUNT mode
767 // xinef: as far as i've checked, all grouped spells meet this condition
768 if (!aurApp->IsActive(GetEffIndex()))
769 return;
770
771 // real aura apply/remove, handle modifier
773 ApplySpellMod(aurApp->GetTarget(), apply);
774
775 // call scripts helping/replacing effect handlers
776 bool prevented = false;
777 if (apply)
778 prevented = GetBase()->CallScriptEffectApplyHandlers(this, const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode);
779 else
780 prevented = GetBase()->CallScriptEffectRemoveHandlers(this, const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode);
781
782 // check if script events have removed the aura or if default effect prevention was requested
783 if ((apply && aurApp->GetRemoveMode()) || prevented)
784 return;
785
786 (*this.*AuraEffectHandler [GetAuraType()])(aurApp, mode, apply);
787
788 // check if script events have removed the aura or if default effect prevention was requested
789 if (apply && aurApp->GetRemoveMode())
790 return;
791
792 // call scripts triggering additional events after apply/remove
793 if (apply)
795 else
797}
#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
Definition SpellAuras.h:37
Unit * GetTarget() const
Definition SpellAuras.h:61
bool IsActive(uint8 effIdx)
Definition SpellAuras.h:81
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:73
void ApplySpellMod(Unit *target, bool apply)
Definition SpellAuraEffects.cpp:806
bool CallScriptEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2436
void CallScriptAfterEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2455
bool CallScriptEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2416
void CallScriptAfterEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
Definition SpellAuras.cpp:2469
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
Definition Unit.cpp:4729

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 
)
800{
802 ASSERT(aurApp);
803 HandleEffect(aurApp, mode, apply);
804}
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition SpellAuras.h:183

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

◆ HandleFarSight()

void AuraEffect::HandleFarSight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5916{
5917 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5918 {
5919 return;
5920 }
5921
5922 Unit* caster = GetCaster();
5923 if (!caster || !caster->IsPlayer())
5924 {
5925 return;
5926 }
5927
5928 Player* player = caster->ToPlayer();
5929 if (apply)
5930 {
5932 }
5933 else
5934 {
5935 player->ResetFarSightDistance();
5936 }
5937
5938 caster->UpdateObjectVisibility(!apply);
5939}
void SetFarSightDistance(float radius)
Definition Player.cpp:16224
void ResetFarSightDistance()
Definition Player.cpp:16229
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2335

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
2815{
2816 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2817 return;
2818
2819 Unit* target = aurApp->GetTarget();
2820
2821 if (!target->IsPlayer())
2822 return;
2823
2824 if (Player* targetPlayer = target->ToPlayer())
2825 {
2826 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
2827 }
2828
2829 if (apply)
2830 {
2831 /*
2832 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
2833 data<<target->GetGUID();
2834 data<<uint8(0);
2835 target->SendMessageToSet(&data, true);
2836 */
2837
2838 UnitList targets;
2839 Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
2841 Cell::VisitAllObjects(target, searcher, target->GetMap()->GetVisibilityRange());
2842 for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
2843 {
2844 if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
2845 continue;
2846
2848 {
2849 if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
2850 {
2851 SpellInfo const* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
2852 if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->IsCreature())
2853 {
2854 Creature* c = (*iter)->ToCreature();
2855 if ((!c->IsPet() && c->GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS) || c->isWorldBoss() || c->IsDungeonBoss())
2856 continue;
2857 }
2858 bool interrupt = false; // pussywizard: skip spells that don't target units, but casted on unit (eg. TARGET_DEST_TARGET_ENEMY)
2859 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
2860 if (si->Effects[j].Effect && (si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT || si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT_AND_DEST))
2861 {
2862 // at least one effect truly targets an unit, interrupt the spell
2863 interrupt = true;
2864 break;
2865 }
2866 if (interrupt)
2867 (*iter)->InterruptSpell(CurrentSpellTypes(i), false);
2868 }
2869 }
2870 }
2871
2872 if (target->GetInstanceScript() && target->GetInstanceScript()->IsEncounterInProgress())
2873 {
2874 // Xinef: replaced with CombatStop(false)
2875 target->AttackStop();
2876 target->RemoveAllAttackers();
2877 target->getHostileRefMgr().addThreatPercent(-100);
2878 target->ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
2879 }
2880 else
2881 {
2882 target->CombatStop();
2884 }
2885
2887
2888 // prevent interrupt message
2889 if (GetCasterGUID() == target->GetGUID())
2890 {
2892 target->FinishSpell(CURRENT_GENERIC_SPELL, true);
2893
2894 // interrupt autoshot
2896 {
2898 target->ToPlayer()->SendAutoRepeatCancel(target);
2899 }
2900 }
2901
2902 target->InterruptNonMeleeSpells(true);
2903
2904 // stop handling the effect if it was removed by linked event
2905 if (aurApp->GetRemoveMode())
2906 return;
2907 // blizz like 2.0.x
2909 // blizz like 2.0.x
2911 // blizz like 2.0.x
2913
2915 }
2916 else
2917 {
2918 /*
2919 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
2920 data<<target->GetGUID();
2921 data<<uint8(1);
2922 target->SendMessageToSet(&data, true);
2923 */
2924 // blizz like 2.0.x
2926 // blizz like 2.0.x
2928 // blizz like 2.0.x
2930
2932 }
2933}
@ UNIT_DYNFLAG_DEAD
Definition SharedDefines.h:3126
@ CREATURE_ELITE_WORLDBOSS
Definition SharedDefines.h:2734
@ SPELL_ATTR6_IGNORE_PHASE_SHIFT
Definition SharedDefines.h:617
@ TARGET_OBJECT_TYPE_UNIT
Definition SpellInfo.h:101
@ TARGET_OBJECT_TYPE_UNIT_AND_DEST
Definition SpellInfo.h:102
@ UNIT_FLAG2_FEIGN_DEATH
Definition UnitDefines.h:289
@ UNIT_STATE_DIED
Definition UnitDefines.h:170
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition UnitDefines.h:279
#define CURRENT_FIRST_NON_MELEE_SPELL
Definition Unit.h:544
@ CURRENT_GENERIC_SPELL
Definition Unit.h:539
@ CURRENT_AUTOREPEAT_SPELL
Definition Unit.h:541
std::list< Unit * > UnitList
Definition Unit.h:77
Definition GridNotifiers.h:861
Definition Creature.h:43
bool IsDungeonBoss() const
Definition Creature.cpp:3183
bool isWorldBoss() const
Definition Creature.h:121
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:209
void deleteReferences(bool removeFromMap=false)
Definition HostileRefMgr.cpp:125
void addThreatPercent(int32 percent)
Definition HostileRefMgr.cpp:85
virtual bool IsEncounterInProgress() const
Definition InstanceScript.cpp:137
float GetVisibilityRange() const
Definition Map.h:195
void SendAttackSwingCancelAttack()
Definition PlayerMisc.cpp:140
void SendAutoRepeatCancel(Unit *target)
Definition PlayerMisc.cpp:152
void CombatStop(bool includingCast=false)
Definition Unit.cpp:10480
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4162
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition Unit.cpp:4120
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition Unit.cpp:10528
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:10447
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1203
float GetVisibilityRange() const
Definition Object.cpp:1656
Definition GridNotifiers.h:423
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:185
uint32 rank
Definition CreatureData.h:206

References HostileRefMgr::addThreatPercent(), 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, HostileRefMgr::deleteReferences(), SpellInfo::Effects, Unit::FinishSpell(), GetCasterGUID(), Creature::GetCreatureTemplate(), Unit::GetCurrentSpell(), Object::GetGUID(), Unit::getHostileRefMgr(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), AuraApplication::GetRemoveMode(), AuraApplication::GetTarget(), WorldObject::GetVisibilityRange(), Map::GetVisibilityRange(), SpellInfo::HasAttribute(), Unit::InterruptNonMeleeSpells(), Unit::InterruptSpell(), Creature::IsDungeonBoss(), InstanceScript::IsEncounterInProgress(), Unit::IsPet(), Object::IsPlayer(), Creature::isWorldBoss(), MAX_SPELL_EFFECTS, CreatureTemplate::rank, Unit::RemoveAllAttackers(), Unit::RemoveAurasWithInterruptFlags(), Object::RemoveDynamicFlag(), Unit::RemoveUnitFlag(), Unit::RemoveUnitFlag2(), Player::SendAttackSwingCancelAttack(), 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::VisitAllObjects().

◆ HandleForceMoveForward()

void AuraEffect::HandleForceMoveForward ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3415{
3417 return;
3418
3419 Unit* target = aurApp->GetTarget();
3420
3421 if (apply)
3423 else
3424 {
3425 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3426 if (target->HasAuraType(GetAuraType()))
3427 return;
3429 }
3430}
@ UNIT_FLAG2_FORCE_MOVEMENT
Definition UnitDefines.h:295

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
5942{
5944 return;
5945
5946 Unit* target = aurApp->GetTarget();
5947
5948 if (!target->IsPlayer())
5949 return;
5950
5951 Player* player = target->ToPlayer();
5952
5953 uint32 faction_id = GetMiscValue();
5954 ReputationRank faction_rank = ReputationRank(m_amount);
5955
5956 player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply);
5958
5959 // stop fighting if at apply forced rank friendly or at remove real rank friendly
5960 if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
5961 player->StopAttackFaction(faction_id);
5962}
ReputationRank
Definition SharedDefines.h:179
@ REP_FRIENDLY
Definition SharedDefines.h:184
ReputationRank GetReputationRank(uint32 faction_id) const
Definition Player.cpp:5882
ReputationMgr & GetReputationMgr()
Definition Player.h:2139
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:19949

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
4976{
4978 return;
4979
4980 Unit* target = aurApp->GetTarget();
4981
4982 // Xinef: Do not apply such auras in normal way
4983 if (GetAmount() >= 1000)
4984 {
4985 target->SetInstantCast(apply);
4986 return;
4987 }
4988
4989 target->ApplyCastTimePercentMod((float)GetAmount(), apply);
4990}
void SetInstantCast(bool set)
Definition Unit.h:1502
void ApplyCastTimePercentMod(float val, bool apply)
Definition Unit.cpp:17103

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

◆ HandleModCharm()

void AuraEffect::HandleModCharm ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3623{
3624 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3625 return;
3626
3627 Unit* target = aurApp->GetTarget();
3628
3629 Unit* caster = GetCaster();
3630
3631 if (apply)
3632 target->SetCharmedBy(caster, CHARM_TYPE_CHARM, aurApp);
3633 else
3634 target->RemoveCharmedBy(caster);
3635}
@ 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

◆ HandleModConfuse()

void AuraEffect::HandleModConfuse ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3490{
3491 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3492 return;
3493
3494 Unit* target = aurApp->GetTarget();
3495
3496 target->SetControlled(apply, UNIT_STATE_CONFUSED);
3497}
@ UNIT_STATE_CONFUSED
Definition UnitDefines.h:181

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

◆ HandleModDamageDone()

void AuraEffect::HandleModDamageDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5181{
5183 return;
5184
5185 Unit* target = aurApp->GetTarget();
5186
5187 // apply item specific bonuses for already equipped weapon
5188 if (target->IsPlayer())
5189 {
5190 for (int i = 0; i < MAX_ATTACK; ++i)
5191 if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
5192 target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply);
5193 }
5194
5195 // GetMiscValue() is bitmask of spell schools
5196 // 1 (0-bit) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)
5197 // 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wands
5198 // 127 - full bitmask any damages
5199 //
5200 // mods must be applied base at equipped weapon class and subclass comparison
5201 // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
5202 // GetMiscValue() comparison with item generated damage types
5203
5204 if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) != 0 && sScriptMgr->CanModAuraEffectDamageDone(this, target, aurApp, mode, apply))
5205 {
5206 // apply generic physical damage bonuses including wand case
5207 if (GetSpellInfo()->EquippedItemClass == -1 || !target->IsPlayer())
5208 {
5212
5213 if (target->IsPlayer())
5214 {
5215 if (GetAmount() > 0)
5217 else
5219 }
5220 }
5221 else
5222 {
5223 // done in Player::_ApplyWeaponDependentAuraMods
5224 }
5225 }
5226
5227 // Skip non magic case for Speedup
5229 return;
5230
5231 if (GetSpellInfo()->EquippedItemClass != -1 || GetSpellInfo()->EquippedItemInventoryTypeMask != 0)
5232 {
5233 // wand magic case (skip generic to all item spell bonuses)
5234 // done in Player::_ApplyWeaponDependentAuraMods
5235
5236 // Skip item specific requirements for not wand magic damage
5237 return;
5238 }
5239
5240 // Magic damage modifiers implemented in Unit::SpellDamageBonus
5241 // This information for client side use only
5242 if (target->IsPlayer())
5243 {
5244 if (GetAmount() > 0)
5245 {
5246 for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
5247 {
5248 if ((GetMiscValue() & (1 << i)) != 0)
5250 }
5251 }
5252 else
5253 {
5254 for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
5255 {
5256 if ((GetMiscValue() & (1 << i)) != 0)
5258 }
5259 }
5260 if (Guardian* pet = target->ToPlayer()->GetGuardianPet())
5261 pet->UpdateAttackPowerAndDamage();
5262 }
5263}
@ SPELL_SCHOOL_HOLY
Definition SharedDefines.h:284
@ SPELL_SCHOOL_MASK_MAGIC
Definition SharedDefines.h:312
@ UNIT_MOD_DAMAGE_OFFHAND
Definition Unit.h:167
@ UNIT_MOD_DAMAGE_RANGED
Definition Unit.h:168
@ UNIT_MOD_DAMAGE_MAINHAND
Definition Unit.h:166
@ PLAYER_FIELD_MOD_DAMAGE_DONE_POS
Definition UpdateFields.h:360
@ PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
Definition UpdateFields.h:361
Definition TemporarySummon.h:96
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect const *aura, bool apply)
Definition Player.cpp:7062

References Player::_ApplyWeaponDependentAuraDamageMod(), Object::ApplyModInt32Value(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), Unit::GetGuardianPet(), GetMiscValue(), GetSpellInfo(), AuraApplication::GetTarget(), Player::GetWeaponForAttack(), Unit::HandleStatModifier(), Object::IsPlayer(), MAX_ATTACK, MAX_SPELL_SCHOOL, PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, PLAYER_FIELD_MOD_DAMAGE_DONE_POS, SPELL_SCHOOL_HOLY, SPELL_SCHOOL_MASK_MAGIC, SPELL_SCHOOL_MASK_NORMAL, sScriptMgr, Object::ToPlayer(), TOTAL_VALUE, UNIT_MOD_DAMAGE_MAINHAND, UNIT_MOD_DAMAGE_OFFHAND, and UNIT_MOD_DAMAGE_RANGED.

◆ HandleModDamagePercentDone()

void AuraEffect::HandleModDamagePercentDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5266{
5268 return;
5269
5270 Unit* target = aurApp->GetTarget();
5271 if (!target)
5272 return;
5273
5274 if (!sScriptMgr->CanModAuraEffectModDamagePercentDone(this, target, aurApp, mode, apply))
5275 return;
5276
5277 if (target->IsPlayer())
5278 {
5279 for (int i = 0; i < MAX_ATTACK; ++i)
5280 if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
5281 target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
5282 }
5283
5284 if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || !target->IsPlayer()))
5285 {
5289
5290 if (target->IsPlayer())
5292 }
5293 else
5294 {
5295 // done in Player::_ApplyWeaponDependentAuraMods for SPELL_SCHOOL_MASK_NORMAL && EquippedItemClass != -1 and also for wand case
5296 }
5297}
@ PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
Definition UpdateFields.h:362
void ApplyPercentModFloatValue(uint16 index, float val, bool apply)
Definition Object.cpp:829

References Player::_ApplyWeaponDependentAuraDamageMod(), Object::ApplyPercentModFloatValue(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), GetSpellInfo(), AuraApplication::GetTarget(), Player::GetWeaponForAttack(), Unit::HandleStatModifier(), Object::IsPlayer(), MAX_ATTACK, PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, SPELL_SCHOOL_MASK_NORMAL, sScriptMgr, Object::ToPlayer(), TOTAL_PCT, UNIT_MOD_DAMAGE_MAINHAND, UNIT_MOD_DAMAGE_OFFHAND, and UNIT_MOD_DAMAGE_RANGED.

◆ HandleModFear()

void AuraEffect::HandleModFear ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3500{
3501 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3502 return;
3503
3504 Unit* target = aurApp->GetTarget();
3505
3506 target->SetControlled(apply, UNIT_STATE_FLEEING, GetCaster(), true);
3507}
@ UNIT_STATE_FLEEING
Definition UnitDefines.h:177

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
4539{
4541 return;
4542
4543 Unit* target = aurApp->GetTarget();
4544
4545 if (!target->IsPlayer())
4546 return;
4547 // implemented in Unit::SpellHealingBonus
4548 // this information is for client side only
4550}
void UpdateSpellDamageAndHealingBonus()
Definition StatSystem.cpp:177

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
4891{
4893 return;
4894
4895 Unit* target = aurApp->GetTarget();
4896
4897 if (target->IsPlayer())
4898 {
4899 target->ToPlayer()->UpdateMeleeHitChances();
4900 target->ToPlayer()->UpdateRangedHitChances();
4901 }
4902 else
4903 {
4904 target->m_modMeleeHitChance += (apply) ? GetAmount() : (-GetAmount());
4905 target->m_modRangedHitChance += (apply) ? GetAmount() : (-GetAmount());
4906 }
4907}
void UpdateMeleeHitChances()
Definition StatSystem.cpp:853
void UpdateRangedHitChances()
Definition StatSystem.cpp:859
float m_modRangedHitChance
Definition Unit.h:1989
float m_modMeleeHitChance
Definition Unit.h:1988

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
1557{
1559 return;
1560
1561 Unit* target = aurApp->GetTarget();
1563
1564 if (apply)
1565 {
1566 // apply glow vision
1567 if (target->IsPlayer() && (type == INVISIBILITY_GENERAL || type == INVISIBILITY_UNK10))
1569
1570 target->m_invisibility.AddFlag(type);
1571 target->m_invisibility.AddValue(type, GetAmount());
1572 }
1573 else
1574 {
1575 if (!target->HasInvisibilityAura())
1576 {
1577 // if not have different invisibility auras.
1578 // always remove glow vision
1579 if (target->IsPlayer())
1581
1582 target->m_invisibility.DelFlag(type);
1583 }
1584 else
1585 {
1586 bool found = false;
1588 for (Unit::AuraEffectList::const_iterator i = invisAuras.begin(); i != invisAuras.end(); ++i)
1589 {
1590 if (GetMiscValue() == (*i)->GetMiscValue())
1591 {
1592 found = true;
1593 break;
1594 }
1595 }
1596 if (!found)
1597 {
1598 target->m_invisibility.DelFlag(type);
1599
1600 // if not have invisibility auras of type INVISIBILITY_GENERAL
1601 // remove glow vision
1603 {
1605 }
1606 }
1607 }
1608
1609 target->m_invisibility.AddValue(type, -GetAmount());
1610 }
1611
1612 // call functions which may have additional effects after chainging state of unit
1613 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1614 {
1615 // drop flag at invisibiliy in bg
1617 }
1618
1619 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
1620 target->bRequestForcedVisibilityUpdate = false;
1621}
@ PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW
Definition Player.h:575
@ PLAYER_FIELD_BYTES_2_OFFSET_AURA_VISION
Definition Player.h:552
InvisibilityType
Definition SharedDefines.h:1254
@ INVISIBILITY_UNK10
Definition SharedDefines.h:1265
@ INVISIBILITY_GENERAL
Definition SharedDefines.h:1255
@ SPELL_AURA_MOD_INVISIBILITY
Definition SpellAuraDefines.h:81
bool HasFlag(FLAG_TYPE flag) const
Definition Object.h:373
void AddFlag(FLAG_TYPE flag)
Definition Object.h:374
void DelFlag(FLAG_TYPE flag)
Definition Object.h:375
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:379
bool Instanceable() const
Definition Map.h:294
bool IsPlayer() const
Definition ObjectGuid.h:168
bool bRequestForcedVisibilityUpdate
Definition Unit.h:2017
ObjectGuid GetOwnerGUID() const
Definition Unit.h:668
bool HasInvisibilityAura() const
Definition Unit.h:1748
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition Object.h:526

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
1532{
1534 return;
1535
1536 Unit* target = aurApp->GetTarget();
1538
1539 if (apply)
1540 {
1541 target->m_invisibilityDetect.AddFlag(type);
1542 target->m_invisibilityDetect.AddValue(type, GetAmount());
1543 }
1544 else
1545 {
1546 if (!target->HasInvisibilityDetectAura())
1547 target->m_invisibilityDetect.DelFlag(type);
1548
1549 target->m_invisibilityDetect.AddValue(type, -GetAmount());
1550 }
1551
1552 // call functions which may have additional effects after chainging state of unit
1553 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1554}
bool HasInvisibilityDetectAura() const
Definition Unit.h:1749
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition Object.h:527

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
4674{
4676 return;
4677
4678 Unit* target = aurApp->GetTarget();
4679
4680 if (!target->IsPlayer())
4681 return;
4682
4683 //Note: an increase in regen does NOT cause threat.
4684 target->ToPlayer()->UpdateManaRegen();
4685}
void UpdateManaRegen()
Definition StatSystem.cpp:926

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
4123{
4124 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4125 return;
4126
4127 Unit* target = aurApp->GetTarget();
4128 uint32 mechanic = 0;
4129
4130 switch (GetId())
4131 {
4132 case 46924: // BladeStorm
4134 break;
4135 case 34471: // The Beast Within
4136 case 19574: // Bestial Wrath
4137 case 38484: // Bestial Wrath
4138 case 40081: // Free friend (Black Temple)
4156 break;
4157 case 42292: // PvP trinket
4158 case 59752: // Every Man for Himself
4159 case 65547: // PvP trinket for Faction Champions (ToC 25)
4160 case 53490: // Bullheaded
4161 case 46227: // Medalion of Immunity
4163 target->RemoveAurasByType(SPELL_AURA_PREVENTS_FLEEING); // xinef: Patch 2.3.0 PvP Trinkets: Insignia of the Alliance, Insignia of the Horde, Medallion of the Alliance, and Medallion of the Horde now clear the debuff from Judgement of Justice.
4164 // Actually we should apply immunities here, too, but the aura has only 100 ms duration, so there is practically no point
4165 break;
4166 case 54508: // Demonic Empowerment
4167 mechanic = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
4172 break;
4173 default:
4174 if (GetMiscValue() < 1)
4175 return;
4176 mechanic = 1 << GetMiscValue();
4178 break;
4179 }
4180
4181 if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
4182 {
4183 // Xinef: exception for purely snare mechanic (eg. hands of freedom)!
4184 if (mechanic == (1 << MECHANIC_SNARE))
4185 target->RemoveMovementImpairingAuras(false);
4186 else
4188 }
4189}
@ MECHANIC_FEAR
Definition SharedDefines.h:1330
@ MECHANIC_DISORIENTED
Definition SharedDefines.h:1327
@ MECHANIC_KNOCKOUT
Definition SharedDefines.h:1339
@ MECHANIC_CHARM
Definition SharedDefines.h:1326
@ MECHANIC_TURN
Definition SharedDefines.h:1348
@ MECHANIC_STUN
Definition SharedDefines.h:1337
@ MECHANIC_FREEZE
Definition SharedDefines.h:1338
@ MECHANIC_ROOT
Definition SharedDefines.h:1332
@ MECHANIC_SLEEP
Definition SharedDefines.h:1335
@ MECHANIC_DAZE
Definition SharedDefines.h:1352
@ MECHANIC_SNARE
Definition SharedDefines.h:1336
@ MECHANIC_SHACKLE
Definition SharedDefines.h:1345
@ MECHANIC_SAPPED
Definition SharedDefines.h:1355
@ MECHANIC_HORROR
Definition SharedDefines.h:1349
#define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK
Definition SharedDefines.h:1361
@ SPELL_AURA_PREVENTS_FLEEING
Definition SpellAuraDefines.h:155
@ AURA_REMOVE_BY_DEFAULT
Definition SpellAuraDefines.h:392
void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode=AURA_REMOVE_BY_DEFAULT, uint32 except=0)
Definition Unit.cpp:5286
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:5267

References Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_REMOVE_BY_DEFAULT, GetId(), GetMiscValue(), GetSpellInfo(), AuraApplication::GetTarget(), IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK, IMMUNITY_MECHANIC, MECHANIC_BANISH, MECHANIC_CHARM, MECHANIC_DAZE, MECHANIC_DISORIENTED, MECHANIC_FEAR, MECHANIC_FREEZE, MECHANIC_HORROR, MECHANIC_KNOCKOUT, MECHANIC_POLYMORPH, MECHANIC_ROOT, MECHANIC_SAPPED, MECHANIC_SHACKLE, MECHANIC_SLEEP, MECHANIC_SNARE, MECHANIC_STUN, MECHANIC_TURN, Unit::RemoveAurasByType(), Unit::RemoveAurasWithMechanic(), Unit::RemoveMovementImpairingAuras(), SPELL_ATTR1_IMMUNITY_PURGES_EFFECT, SPELL_AURA_MOD_STUN, and SPELL_AURA_PREVENTS_FLEEING.

◆ HandleModMeleeRangedSpeedPct()

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

◆ HandleModMeleeSpeedPct()

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

◆ HandleModOffhandDamagePercent()

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

◆ HandleModPercentStat()

void AuraEffect::HandleModPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4455{
4457 return;
4458
4459 Unit* target = aurApp->GetTarget();
4460
4461 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4462 {
4463 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4464 return;
4465 }
4466
4467 // only players currently use base stats
4468 if (!target->IsPlayer())
4469 return;
4470
4471 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
4472 {
4473 if (GetMiscValue() == i || GetMiscValue() == -1)
4474 target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_amount), apply);
4475 }
4476}

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, BASE_PCT, GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), Object::IsPlayer(), LOG_ERROR, m_amount, MAX_STATS, STAT_STRENGTH, and UNIT_MOD_STAT_START.

◆ HandleModPossess()

void AuraEffect::HandleModPossess ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3548{
3549 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3550 return;
3551
3552 Unit* target = aurApp->GetTarget();
3553
3554 Unit* caster = GetCaster();
3555
3556 // no support for posession AI yet
3557 if (caster && caster->IsCreature())
3558 {
3559 HandleModCharm(aurApp, mode, apply);
3560 return;
3561 }
3562
3563 if (apply)
3564 target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3565 else
3566 target->RemoveCharmedBy(caster);
3567}
@ CHARM_TYPE_POSSESS
Definition CharmInfo.h:46
void HandleModCharm(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3622

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
3570{
3571 // Used by spell "Eyes of the Beast"
3572
3573 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3574 return;
3575
3576 Unit* caster = GetCaster();
3577 if (!caster || !caster->IsPlayer())
3578 return;
3579
3580 //seems it may happen that when removing it is no longer owner's pet
3581 //if (caster->ToPlayer()->GetPet() != target)
3582 // return;
3583
3584 Unit* target = aurApp->GetTarget();
3585 if (!target->IsCreature() || !target->IsPet())
3586 return;
3587
3588 Pet* pet = target->ToPet();
3589
3590 if (apply)
3591 {
3592 if (caster->ToPlayer()->GetPet() != pet)
3593 return;
3594
3595 // Must clear current motion or pet leashes back to owner after a few yards
3596 // when under spell 'Eyes of the Beast'
3597 pet->GetMotionMaster()->Clear();
3598 pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3599 }
3600 else
3601 {
3602 pet->RemoveCharmedBy(caster);
3603
3604 if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
3605 pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
3606 else
3607 {
3608 // Reinitialize the pet bar or it will appear greyed out
3609 caster->ToPlayer()->PetSpellInitialize();
3610
3611 // Follow owner only if not fighting or owner didn't click "stay" at new location
3612 // This may be confusing because pet bar shows "stay" when under the spell but it retains
3613 // the "follow" flag. Player MUST click "stay" while under the spell.
3614 if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
3615 {
3617 }
3618 }
3619 }
3620}
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:45
#define PET_FOLLOW_DIST
Definition PetDefines.h:202
@ COMMAND_STAY
Definition Unit.h:556
float GetFollowAngle() const override
Definition TemporarySummon.h:83
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:409
void Clear(bool reset=true)
Definition MotionMaster.h:167
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition Pet.cpp:881
void PetSpellInitialize()
Definition Player.cpp:9478
Pet * ToPet()
Definition Unit.h:684
CharmInfo * GetCharmInfo()
Definition Unit.h:1206
Unit * GetVictim() const
Definition Unit.h:846
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition Object.cpp:1332
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
5342{
5344 return;
5345
5346 Unit* target = aurApp->GetTarget();
5347
5348 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5349 if (GetMiscValue() & (1 << i))
5351}
@ 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
5329{
5331 return;
5332
5333 Unit* target = aurApp->GetTarget();
5334
5335 float amount = CalculatePct(1.0f, GetAmount());
5336 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5337 if (GetMiscValue() & (1 << i))
5339}
@ UNIT_FIELD_POWER_COST_MULTIPLIER
Definition UpdateFields.h:171
void ApplyModSignedFloatValue(uint16 index, float val, bool apply)
Definition Object.cpp:822

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
4649{
4651 return;
4652
4653 Unit* target = aurApp->GetTarget();
4654
4655 if (!target->IsPlayer())
4656 return;
4657
4658 // Update manaregen value
4659 if (GetMiscValue() == POWER_MANA)
4660 target->ToPlayer()->UpdateManaRegen();
4661 else if (GetMiscValue() == POWER_ENERGY)
4662 target->ToPlayer()->UpdateEnergyRegen();
4663 else if (GetMiscValue() == POWER_RUNE)
4665 // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate
4666}
@ POWER_RUNE
Definition SharedDefines.h:274
void UpdateRuneRegen(RuneType rune)
Definition StatSystem.cpp:970
void UpdateEnergyRegen()
Definition StatSystem.cpp:960

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
4669{
4670 HandleModPowerRegen(aurApp, mode, apply);
4671}
void HandleModPowerRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4648

References HandleModPowerRegen().

◆ HandleModRating()

void AuraEffect::HandleModRating ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5067{
5069 return;
5070
5071 Unit* target = aurApp->GetTarget();
5072
5073 if (!target->IsPlayer())
5074 return;
5075
5076 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5077 if (GetMiscValue() & (1 << rating))
5078 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), GetAmount(), apply);
5079}
#define MAX_COMBAT_RATING
Definition Unit.h:245
CombatRating
Definition Unit.h:217
void ApplyRatingMod(CombatRating cr, int32 value, bool apply)
Definition Player.cpp:5266

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
5082{
5084 return;
5085
5086 Unit* target = aurApp->GetTarget();
5087
5088 if (!target->IsPlayer())
5089 return;
5090
5091 // Just recalculate ratings
5092 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5093 if (GetMiscValue() & (1 << rating))
5094 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), 0, apply);
5095}

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
4371{
4373 return;
4374
4375 Unit* target = aurApp->GetTarget();
4376
4377 for (int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
4378 {
4379 if (GetMiscValue() & int32(1 << i))
4380 {
4382 if (target->IsPlayer() || target->IsPet())
4383 {
4384 target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, (float)GetAmount(), apply);
4385 target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, (float)GetAmount(), apply);
4386 }
4387 }
4388 }
4389}
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.h:1127

References Unit::ApplyResistanceBuffModsPercentMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), Unit::IsPet(), Object::IsPlayer(), MAX_SPELL_SCHOOL, SPELL_SCHOOL_NORMAL, TOTAL_PCT, and UNIT_MOD_RESISTANCE_START.

◆ HandleModSpellCritChance()

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

◆ HandleModSpellCritChanceShool()

void AuraEffect::HandleModSpellCritChanceShool ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4936{
4938 return;
4939
4940 Unit* target = aurApp->GetTarget();
4941
4942 if (!target->IsPlayer())
4943 return;
4944
4945 for (int school = SPELL_SCHOOL_NORMAL; school < MAX_SPELL_SCHOOL; ++school)
4946 if (GetMiscValue() & (1 << school))
4947 target->ToPlayer()->UpdateSpellCritChance(school);
4948}
void UpdateSpellCritChance(uint32 school)
Definition StatSystem.cpp:822

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
4509{
4511 return;
4512
4513 Unit* target = aurApp->GetTarget();
4514
4515 if (!target->IsPlayer())
4516 return;
4517
4518 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4519 // This information for client side use only
4520 // Recalculate bonus
4522}

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
4479{
4481 return;
4482
4483 Unit* target = aurApp->GetTarget();
4484
4485 if (!target->IsPlayer())
4486 return;
4487
4488 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4489 // This information for client side use only
4490 // Recalculate bonus
4492}

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
4525{
4527 return;
4528
4529 Unit* target = aurApp->GetTarget();
4530
4531 if (!target->IsPlayer())
4532 return;
4533
4534 // Recalculate bonus
4536}

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
4495{
4497 return;
4498
4499 Unit* target = aurApp->GetTarget();
4500
4501 if (!target->IsPlayer())
4502 return;
4503
4504 // Recalculate bonus
4506}

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
4910{
4912 return;
4913
4914 Unit* target = aurApp->GetTarget();
4915
4916 if (target->IsPlayer())
4917 target->ToPlayer()->UpdateSpellHitChances();
4918 else
4919 target->m_modSpellHitChance += (apply) ? GetAmount() : (-GetAmount());
4920}
void UpdateSpellHitChances()
Definition StatSystem.cpp:865
float m_modSpellHitChance
Definition Unit.h:1990

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
3809{
3810 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3811 return;
3812
3813 Unit* target = aurApp->GetTarget();
3814 std::list <AuraType> aura_immunity_list;
3815 uint32 mechanic_immunity_list = 0;
3816 int32 miscVal = GetMiscValue();
3817
3818 switch (miscVal)
3819 {
3820 case 96:
3821 case 1615:
3822 {
3823 if (!GetAmount())
3824 {
3825 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3826 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3827 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3828 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3830 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3831
3844 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
3845 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3846 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3847 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3848 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3849 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3850 }
3851 break;
3852 }
3853 case 679:
3854 {
3855 if (GetId() == 57742)
3856 {
3857 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3858 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3859 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3860 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3862 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3863
3876 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3877 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3878 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3879 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3880 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3881 }
3882 break;
3883 }
3884 case 1557:
3885 {
3886 if (GetId() == 64187)
3887 {
3888 mechanic_immunity_list = (1 << MECHANIC_STUN);
3890 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3891 }
3892 else
3893 {
3894 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3895 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3896 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3897 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3899 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3900
3913 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3914 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3915 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3916 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3917 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3918 }
3919 break;
3920 }
3921 case 1614:
3922 case 1694:
3923 {
3925 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
3926 break;
3927 }
3928 case 1630:
3929 {
3930 if (!GetAmount())
3931 {
3933 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
3934 }
3935 else
3936 {
3937 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3938 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3939 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3940 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3942 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3943
3956 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3957 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3958 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3959 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3960 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3961 }
3962 break;
3963 }
3964 case 477:
3965 case 1733:
3966 case 1632:
3967 {
3968 if (!GetAmount())
3969 {
3970 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3971 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3972 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3973 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3975 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH);
3976
3992 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3993
3994 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3995 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3996 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3997 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3998 }
3999 break;
4000 }
4001 case 878:
4002 {
4003 if (GetAmount() == 1)
4004 {
4005 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
4006 | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
4007
4012 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4013 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4014 }
4015 break;
4016 }
4017 default:
4018 break;
4019 }
4020
4021 if (aura_immunity_list.empty())
4022 {
4023 // Roots, OK
4024 if (GetMiscValue() & (1 << 0))
4025 {
4026 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4027
4029 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4030 }
4031 // Taunt, OK
4032 if (GetMiscValue() & (1 << 1))
4033 {
4034 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
4035 }
4036 // Crowd-Control auras?
4037 if (GetMiscValue() & (1 << 2))
4038 {
4039 mechanic_immunity_list = (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED);
4040
4043 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4044 }
4045 // Interrupt, OK
4046 if (GetMiscValue() & (1 << 3))
4047 {
4048 mechanic_immunity_list = (1 << MECHANIC_INTERRUPT);
4049
4051 }
4052 // Transform?
4053 if (GetMiscValue() & (1 << 4))
4054 {
4055 aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
4056 }
4057 // Stun auras breakable by damage (Incapacitate effects), OK
4058 if (GetMiscValue() & (1 << 5))
4059 {
4060 mechanic_immunity_list = (1 << MECHANIC_KNOCKOUT);
4061
4063 }
4064 // // Slowing effects
4065 if (GetMiscValue() & (1 << 6))
4066 {
4067 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4068
4070 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4071 }
4072 // Charm auras?, 90%
4073 if ((GetMiscValue() & (1 << 7)))
4074 {
4075 mechanic_immunity_list = (1 << MECHANIC_CHARM);
4076
4078 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
4079 aura_immunity_list.push_back(SPELL_AURA_MOD_POSSESS);
4080 }
4081 // UNK
4082 // if ((GetMiscValue() & (1 << 8)))
4083 // {
4084 // }
4085 // Fear, OK
4086 if (GetMiscValue() & (1 << 9))
4087 {
4088 mechanic_immunity_list = (1 << MECHANIC_FEAR);
4089
4091 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4092 }
4093 // Stuns, OK
4094 if (GetMiscValue() & (1 << 10))
4095 {
4096 mechanic_immunity_list = (1 << MECHANIC_STUN);
4097
4099 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4100 }
4101 }
4102
4103 // apply immunities
4104 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4105 target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply);
4106
4107 // Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated.
4108 if (GetId() == 46924)
4109 {
4110 // Knockback and hex
4112 }
4113
4115 {
4116 target->RemoveAurasWithMechanic(mechanic_immunity_list, AURA_REMOVE_BY_DEFAULT, GetId());
4117 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4118 target->RemoveAurasByType(*iter);
4119 }
4120}
@ SPELL_EFFECT_ATTACK_ME
Definition SharedDefines.h:892
@ SPELL_EFFECT_KNOCK_BACK_DEST
Definition SharedDefines.h:922
@ SPELL_EFFECT_KNOCK_BACK
Definition SharedDefines.h:876
@ MECHANIC_INTERRUPT
Definition SharedDefines.h:1351
@ SPELL_AURA_MOD_CHARM
Definition SpellAuraDefines.h:69
@ SPELL_AURA_MOD_TAUNT
Definition SpellAuraDefines.h:74
@ SPELL_AURA_MOD_DECREASE_SPEED
Definition SpellAuraDefines.h:96
@ SPELL_AURA_MOD_POSSESS
Definition SpellAuraDefines.h:65

References Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_REMOVE_BY_DEFAULT, GetAmount(), GetId(), GetMiscValue(), GetSpellInfo(), AuraApplication::GetTarget(), SpellInfo::HasAttribute(), IMMUNITY_EFFECT, IMMUNITY_MECHANIC, IMMUNITY_STATE, MECHANIC_BANISH, MECHANIC_CHARM, MECHANIC_DISORIENTED, MECHANIC_FEAR, MECHANIC_FREEZE, MECHANIC_HORROR, MECHANIC_INTERRUPT, MECHANIC_KNOCKOUT, MECHANIC_POLYMORPH, MECHANIC_ROOT, MECHANIC_SAPPED, MECHANIC_SLEEP, MECHANIC_SNARE, MECHANIC_STUN, MECHANIC_TURN, Unit::RemoveAurasByType(), Unit::RemoveAurasWithMechanic(), SPELL_ATTR1_IMMUNITY_PURGES_EFFECT, SPELL_AURA_MOD_CHARM, SPELL_AURA_MOD_CONFUSE, SPELL_AURA_MOD_DECREASE_SPEED, SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_POSSESS, SPELL_AURA_MOD_ROOT, SPELL_AURA_MOD_STUN, SPELL_AURA_MOD_TAUNT, SPELL_AURA_TRANSFORM, SPELL_EFFECT_ATTACK_ME, SPELL_EFFECT_KNOCK_BACK, and SPELL_EFFECT_KNOCK_BACK_DEST.

◆ HandleModStealth()

void AuraEffect::HandleModStealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1649{
1651 return;
1652
1653 Unit* target = aurApp->GetTarget();
1655
1656 if (apply)
1657 {
1658 target->m_stealth.AddFlag(type);
1659 target->m_stealth.AddValue(type, GetAmount());
1660
1662 if (target->IsPlayer())
1664
1665 // interrupt autoshot
1667 {
1669 target->ToPlayer()->SendAutoRepeatCancel(target);
1670 }
1671 }
1672 else
1673 {
1674 target->m_stealth.AddValue(type, -GetAmount());
1675
1676 if (!target->HasStealthAura()) // if last SPELL_AURA_MOD_STEALTH
1677 {
1678 target->m_stealth.DelFlag(type);
1679
1681 if (target->IsPlayer())
1683 }
1684 }
1685
1686 // call functions which may have additional effects after chainging state of unit
1687 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1688 {
1689 // drop flag at stealth in bg
1691 }
1692
1693 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
1694 target->bRequestForcedVisibilityUpdate = false;
1695}
@ PLAYER_FIELD_BYTE2_STEALTH
Definition Player.h:574
StealthType
Definition SharedDefines.h:1246
@ UNIT_STAND_FLAGS_CREEP
Definition UnitDefines.h:48
bool HasStealthAura() const
Definition Unit.h:1746
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1692
void SetStandFlags(uint8 flags)
Definition Unit.h:1691
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:523

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
1624{
1626 return;
1627
1628 Unit* target = aurApp->GetTarget();
1630
1631 if (apply)
1632 {
1633 target->m_stealthDetect.AddFlag(type);
1634 target->m_stealthDetect.AddValue(type, GetAmount());
1635 }
1636 else
1637 {
1638 if (!target->HasStealthDetectAura())
1639 target->m_stealthDetect.DelFlag(type);
1640
1641 target->m_stealthDetect.AddValue(type, -GetAmount());
1642 }
1643
1644 // call functions which may have additional effects after chainging state of unit
1645 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1646}
bool HasStealthDetectAura() const
Definition Unit.h:1747
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition Object.h:524

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
1698{
1700 return;
1701
1702 Unit* target = aurApp->GetTarget();
1704
1705 if (apply)
1706 target->m_stealth.AddValue(type, GetAmount());
1707 else
1708 target->m_stealth.AddValue(type, -GetAmount());
1709
1710 // call functions which may have additional effects after chainging state of unit
1711 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer());
1712}

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
4407{
4409 return;
4410
4411 Unit* target = aurApp->GetTarget();
4412
4413 // applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
4414
4415 // show armor penetration
4416 if (target->IsPlayer() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
4418
4419 // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
4422}
@ SPELL_SCHOOL_MASK_SPELL
Definition SharedDefines.h:308
@ 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
3463{
3464 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3465 return;
3466
3467 Unit* target = aurApp->GetTarget();
3468
3469 if (!target->IsAlive() || !target->CanHaveThreatList())
3470 return;
3471
3472 Unit* caster = GetCaster();
3473 if (!caster || !caster->IsAlive())
3474 return;
3475
3476 if (apply)
3477 target->TauntApply(caster);
3478 else
3479 {
3480 // When taunt aura fades out, mob will switch to previous target if current has less than 1.1 * secondthreat
3481 target->TauntFadeOut(caster);
3482 }
3483}
void TauntApply(Unit *victim)
Definition Unit.cpp:14715
void TauntFadeOut(Unit *taunter)
Definition Unit.cpp:14745

References AURA_EFFECT_HANDLE_REAL, Unit::CanHaveThreatList(), GetCaster(), AuraApplication::GetTarget(), Unit::IsAlive(), Unit::TauntApply(), and Unit::TauntFadeOut().

◆ HandleModThreat()

void AuraEffect::HandleModThreat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3437{
3439 return;
3440
3441 Unit* target = aurApp->GetTarget();
3442 for (int8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
3443 if (GetMiscValue() & (1 << i))
3444 ApplyPercentModFloatVar(target->m_threatModifier[i], float(GetAmount()), apply);
3445}
void ApplyPercentModFloatVar(float &var, float val, bool apply)
Definition Util.h:50
float m_threatModifier[MAX_SPELL_SCHOOL]
Definition Unit.h:1993

References ApplyPercentModFloatVar(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::m_threatModifier, and MAX_SPELL_SCHOOL.

◆ HandleModTotalPercentStat()

void AuraEffect::HandleModTotalPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4553{
4555 return;
4556
4557 Unit* target = aurApp->GetTarget();
4558
4559 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4560 {
4561 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4562 return;
4563 }
4564
4565 // save current health state
4566 float healthPct = target->GetHealthPct();
4567 bool alive = target->IsAlive();
4568 float value = GetAmount();
4569
4570 if (GetId() == 67480) // xinef: hack fix for blessing of sanctuary stats stack with blessing of kings...
4571 {
4572 if (value) // not turned off
4573 value = 10.0f;
4574 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4575 {
4576 if (i == STAT_STRENGTH || i == STAT_STAMINA)
4577 {
4578 if (apply && (target->IsPlayer() || target->IsPet()))
4579 target->ApplyStatPercentBuffMod(Stats(i), value, apply);
4580
4581 target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, value, apply);
4582
4583 if (!apply && (target->IsPlayer() || target->IsPet()))
4584 target->ApplyStatPercentBuffMod(Stats(i), value, apply);
4585 }
4586 }
4587 return;
4588 }
4589
4590 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4591 {
4592 if (GetMiscValue() == i || GetMiscValue() == -1)
4593 {
4594 if (apply && (target->IsPlayer() || target->IsPet()))
4595 target->ApplyStatPercentBuffMod(Stats(i), value, apply);
4596
4597 target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, value, apply);
4598
4599 if (!apply && (target->IsPlayer() || target->IsPet()))
4600 target->ApplyStatPercentBuffMod(Stats(i), value, apply);
4601 }
4602 }
4603
4604 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag)
4606 target->SetHealth(std::max<uint32>(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0)));
4607}
@ SPELL_ATTR0_IS_ABILITY
Definition SharedDefines.h:386
@ STAT_STAMINA
Definition SharedDefines.h:260
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply)
Definition Unit.cpp:15388

References Unit::ApplyStatPercentBuffMod(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, GetAmount(), Unit::GetHealthPct(), GetId(), Unit::GetMaxHealth(), GetMiscValue(), AuraApplication::GetTarget(), Unit::HandleStatModifier(), SpellInfo::HasAttribute(), Unit::IsAlive(), Unit::IsPet(), Object::IsPlayer(), LOG_ERROR, m_spellInfo, MAX_STATS, Unit::SetHealth(), SPELL_ATTR0_IS_ABILITY, STAT_STAMINA, STAT_STRENGTH, TOTAL_PCT, and UNIT_MOD_STAT_START.

◆ HandleModUnattackable()

void AuraEffect::HandleModUnattackable ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2936{
2938 return;
2939
2940 Unit* target = aurApp->GetTarget();
2941
2942 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2943 if (!apply && target->HasUnattackableAura())
2944 return;
2945
2947
2948 // call functions which may have additional effects after chainging state of unit
2949 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
2950 {
2951 // xinef: this aura should not stop combat (movie with sindragosa proves that)
2952 //target->CombatStop();
2954 }
2955}
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:251
bool HasUnattackableAura() const
Definition Unit.h:1738

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
164 {
165 // aura type not have immediate effect at add/remove and handled by ID in other code place
166 }

◆ HandleNoReagentUseAura()

void AuraEffect::HandleNoReagentUseAura ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5372{
5373 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5374 return;
5375
5376 Unit* target = aurApp->GetTarget();
5377
5378 if (!target->IsPlayer())
5379 return;
5380
5381 flag96 mask;
5383 for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
5384 mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
5385
5386 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1, mask[0]);
5387 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 1, mask[1]);
5388 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 2, mask[2]);
5389}
@ SPELL_AURA_NO_REAGENT_USE
Definition SpellAuraDefines.h:319
@ PLAYER_NO_REAGENT_COST_1
Definition UpdateFields.h:387
Definition Util.h:451

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
156 {
157 // not implemented
158 }

◆ HandleObsModPowerAuraTick()

void AuraEffect::HandleObsModPowerAuraTick ( Unit target,
Unit caster 
) const
7118{
7120 if (GetMiscValue() == POWER_ALL)
7121 PowerType = target->getPowerType();
7122 else
7124
7125 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7126 return;
7127
7128 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7129 {
7130 SendTickImmune(target, caster);
7131 return;
7132 }
7133
7134 // don't regen when permanent aura target has full power
7135 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7136 return;
7137
7138 // ignore negative values (can be result apply spellmods to aura damage
7139 uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(PowerType) / 100;
7140 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7141 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7142 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7143 target->SendPeriodicAuraLog(&pInfo);
7144
7145 int32 gain = target->ModifyPower(PowerType, amount);
7146
7147 if (caster)
7148 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7149}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:169
@ POWER_ALL
Definition SharedDefines.h:277
void SendTickImmune(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:1103
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=nullptr)
Definition HostileRefMgr.cpp:35
std::string ToString() const
Definition ObjectGuid.cpp:47
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:14200
uint32 GetMaxPower(Powers power) const
Definition Unit.h:1057
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:6445
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250
Definition Unit.h:513

References GetBase(), GetCasterGUID(), Object::GetGUID(), Unit::getHostileRefMgr(), GetId(), Unit::GetMaxPower(), GetMiscValue(), Unit::GetPower(), Unit::getPowerType(), GetSpellInfo(), Unit::HasUnitState(), Unit::IsAlive(), LOG_DEBUG, m_amount, Unit::ModifyPower(), POWER_ALL, Unit::SendPeriodicAuraLog(), SendTickImmune(), HostileRefMgr::threatAssist(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicDamageAurasTick()

void AuraEffect::HandlePeriodicDamageAurasTick ( Unit target,
Unit caster 
) const
6592{
6593 if (!target->IsAlive())
6594 return;
6595
6596 if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamageOrSchool(GetSpellInfo()) || target->IsTotem())
6597 {
6598 SendTickImmune(target, caster);
6599 return;
6600 }
6601
6602 // Consecrate ticks can miss and will not show up in the combat log
6603 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6604 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6605 return;
6606
6607 // some auras remove at specific health level or more
6609 {
6610 switch (GetSpellInfo()->Id)
6611 {
6612 case 43093:
6613 case 31956:
6614 case 38801: // Grievous Wound
6615 case 35321:
6616 case 38363:
6617 case 39215: // Gushing Wound
6618 if (target->IsFullHealth())
6619 {
6620 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6621 return;
6622 }
6623 break;
6624 case 38772: // Grievous Wound
6625 {
6626 uint32 percent = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster);
6627 if (!target->HealthBelowPct(percent))
6628 {
6629 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6630 return;
6631 }
6632 break;
6633 }
6634 }
6635 }
6636
6638
6639 // ignore non positive values (can be result apply spellmods to aura damage
6640 uint32 damage = std::max(GetAmount(), 0);
6641
6642 // If the damage is percent-max-health based, calculate damage before the Modify hook
6644 {
6645 // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
6646 damage = uint32(std::ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
6647 }
6648
6649 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6650 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6651
6652 if (target->GetAI())
6653 {
6654 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6655 }
6656
6658 {
6659 // xinef: leave only target depending bonuses, rest is handled in calculate amount
6660 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE && caster)
6661 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6662 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6663
6664 // Calculate armor mitigation
6666 {
6667 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6668 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6669 damage = damageReductedArmor;
6670 }
6671
6672 // Curse of Agony damage-per-tick calculation
6673 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x400) && GetSpellInfo()->SpellIconID == 544)
6674 {
6675 uint32 totalTick = GetTotalTicks();
6676 // 1..4 ticks, 1/2 from normal tick damage
6677 if (m_tickNumber <= totalTick / 3)
6678 damage = damage / 2;
6679 // 9..12 ticks, 3/2 from normal tick damage
6680 else if (m_tickNumber > totalTick * 2 / 3)
6681 damage += (damage + 1) / 2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
6682 // 5..8 ticks have normal tick damage
6683 }
6684 }
6685
6686 // calculate crit chance
6687 bool crit = false;
6688 if ((crit = roll_chance_f(GetCritChance())))
6689 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6690
6691 // Auras reducing damage from AOE spells
6693 {
6694 if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() ||
6695 GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() ||
6696 GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || // some persistent area auras have targets like A=53 B=28
6699 {
6700 bool npcCaster = (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
6701 damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, npcCaster);
6702 }
6703 }
6704
6705 int32 dmg = damage;
6706 int32 mitigatedDamage = cleanDamage.mitigated_damage;
6707 if (CanApplyResilience())
6708 {
6709 int32 resilienceReduction = dmg;
6710 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6711
6712 resilienceReduction = dmg - resilienceReduction;
6713 dmg -= resilienceReduction;
6714 mitigatedDamage += resilienceReduction;
6715 }
6716
6717 damage = std::max(0, dmg);
6718 cleanDamage.mitigated_damage = std::max(0, mitigatedDamage);
6719
6720 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6721 Unit::CalcAbsorbResist(dmgInfo);
6722
6723 uint32 absorb = dmgInfo.GetAbsorb();
6724 uint32 resist = dmgInfo.GetResist();
6725 damage = dmgInfo.GetDamage();
6726
6727 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} attacked {} for {} dmg inflicted by {} abs is {}",
6728 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6729 Unit::DealDamageMods(target, damage, &absorb);
6730
6731 // Set trigger flag
6732 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6733 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6735 if (absorb > 0)
6736 procEx |= PROC_EX_ABSORB;
6737
6738 if (damage)
6739 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6740
6741 int32 overkill = damage - target->GetHealth();
6742 if (overkill < 0)
6743 overkill = 0;
6744
6745 SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit);
6746 target->SendPeriodicAuraLog(&pInfo);
6747
6748 Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
6749
6750 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6751}
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:667
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
Definition SharedDefines.h:805
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
Definition SharedDefines.h:582
@ SPELLFAMILY_WARLOCK
Definition SharedDefines.h:3549
@ SPELL_MISS_NONE
Definition SharedDefines.h:1519
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
Definition SharedDefines.h:538
@ DYNOBJ_AURA_TYPE
Definition SpellAuraDefines.h:386
@ PROC_EX_INTERNAL_DOT
Definition SpellMgr.h:219
@ PROC_EX_CRITICAL_HIT
Definition SpellMgr.h:195
@ PROC_EX_NORMAL_HIT
Definition SpellMgr.h:194
@ PROC_EX_ABSORB
Definition SpellMgr.h:204
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:134
@ PROC_FLAG_TAKEN_PERIODIC
Definition SpellMgr.h:135
@ PROC_FLAG_TAKEN_DAMAGE
Definition SpellMgr.h:137
@ CR_CRIT_TAKEN_SPELL
Definition Unit.h:234
@ MELEE_HIT_NORMAL
Definition Unit.h:287
bool CanApplyResilience() const
Definition SpellAuraEffects.h:111
float GetCritChance() const
Definition SpellAuraEffects.h:108
int32 GetTotalTicks() const
Definition SpellAuraEffects.cpp:7383
uint8 GetCasterLevel() const
Definition SpellAuraEffects.h:110
Definition Unit.h:331
uint32 SchoolMask
Definition SpellInfo.h:392
virtual void OnCalculatePeriodicTickReceived(uint32 &, Unit *)
Called during calculation when receiving periodic healing or damage (DoT or HoT)
Definition UnitAI.h:384
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:2043
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, bool npcCaster) const
Definition Unit.cpp:20192
bool IsFullHealth() const
Definition Unit.h:1035
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spell, bool canReflect=false)
Definition Unit.cpp:3484
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:12325
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1037
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:11835
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition Unit.cpp:18974
static void ProcDamageAndSpell(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:6434
UnitAI * GetAI()
Definition Unit.h:648
bool IsControlledByPlayer() const
Definition Unit.h:1232
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, uint8 effIndex=MAX_SPELL_EFFECTS)
Definition Unit.cpp:2020
bool IsImmunedToDamageOrSchool(SpellSchoolMask meleeSchoolMask) const
Definition Unit.cpp:12945
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition Unit.cpp:2159
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition Unit.cpp:801
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:811
Definition Unit.h:316
uint32 mitigated_damage
Definition Unit.h:321

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(), GetTotalTicks(), SpellInfo::HasAttribute(), Unit::HasUnitState(), Unit::HealthBelowPct(), Unit::IsAlive(), Unit::IsControlledByPlayer(), Unit::IsDamageReducedByArmor(), Unit::IsFullHealth(), Unit::IsImmunedToDamageOrSchool(), Unit::IsTotem(), LOG_DEBUG, m_spellInfo, m_tickNumber, 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::ProcDamageAndSpell(), 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(), SPELLFAMILY_WARLOCK, Unit::SpellHitResult(), sScriptMgr, ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicDummyAuraTick()

void AuraEffect::HandlePeriodicDummyAuraTick ( Unit target,
Unit caster 
) const
6199{
6200 switch (GetSpellInfo()->SpellFamilyName)
6201 {
6202 case SPELLFAMILY_DRUID:
6203 {
6204 switch (GetSpellInfo()->Id)
6205 {
6206 // Frenzied Regeneration
6207 case 22842:
6208 {
6209 // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
6210 // Should be manauser
6211 if (!target->HasActivePowerType(POWER_RAGE))
6212 break;
6213 uint32 rage = target->GetPower(POWER_RAGE);
6214 // Nothing todo
6215 if (rage == 0)
6216 break;
6217 int32 mod = (rage < 100) ? rage : 100;
6218 int32 points = target->CalculateSpellDamage(target, GetSpellInfo(), 1);
6219 int32 regen = target->GetMaxHealth() * (mod * points / 10) / 1000;
6220 target->CastCustomSpell(target, 22845, &regen, 0, 0, true, 0, this);
6221 target->SetPower(POWER_RAGE, rage - mod);
6222 break;
6223 }
6224 }
6225 break;
6226 }
6227 case SPELLFAMILY_HUNTER:
6228 {
6229 // Explosive Shot
6230 if (GetSpellInfo()->SpellFamilyFlags[1] & 0x80000000)
6231 {
6232 if (caster)
6233 caster->CastCustomSpell(53352, SPELLVALUE_BASE_POINT0, m_amount, target, true, nullptr, this);
6234 break;
6235 }
6236 switch (GetSpellInfo()->Id)
6237 {
6238 // Feeding Frenzy Rank 1
6239 case 53511:
6240 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
6241 target->CastSpell(target, 60096, true, 0, this);
6242 return;
6243 // Feeding Frenzy Rank 2
6244 case 53512:
6245 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
6246 target->CastSpell(target, 60097, true, 0, this);
6247 return;
6248 default:
6249 break;
6250 }
6251 break;
6252 }
6253 case SPELLFAMILY_SHAMAN:
6254 if (GetId() == 52179) // Astral Shift
6255 {
6256 // Periodic need for remove visual on stun/fear/silence lost
6258 target->RemoveAurasDueToSpell(52179);
6259 break;
6260 }
6261 break;
6263 switch (GetId())
6264 {
6265 case 49016: // Hysteria
6266 uint32 damage = uint32(target->CountPctFromMaxHealth(1));
6267 Unit::DealDamage(target, target, damage, nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
6268 break;
6269 }
6270 // Blood of the North
6271 // Reaping
6272 // Death Rune Mastery
6273 if (GetSpellInfo()->SpellIconID == 3041 || GetSpellInfo()->SpellIconID == 22 || GetSpellInfo()->SpellIconID == 2622)
6274 {
6275 if (!target->IsPlayer())
6276 return;
6278 return;
6279
6280 // timer expired - remove death runes
6281 target->ToPlayer()->RemoveRunesByAuraEffect(this);
6282 }
6283 break;
6284 default:
6285 break;
6286 }
6287}
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3553
@ SPELLFAMILY_DEATHKNIGHT
Definition SharedDefines.h:3559
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
@ UNIT_FLAG_STUNNED
Definition UnitDefines.h:268
@ UNIT_FLAG_FLEEING
Definition UnitDefines.h:273
@ NODAMAGE
Definition Unit.h:253
UnitFlags GetUnitFlags() const
Definition Unit.h:701
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1042
virtual bool HasActivePowerType(Powers power)
Definition Unit.h:1053

References Unit::CalculateSpellDamage(), Unit::CastCustomSpell(), Unit::CastSpell(), CLASS_CONTEXT_ABILITY, CLASS_DEATH_KNIGHT, Unit::CountPctFromMaxHealth(), Unit::DealDamage(), GetId(), Unit::GetMaxHealth(), Unit::GetPower(), GetSpellInfo(), Unit::GetUnitFlags(), Unit::GetVictim(), Unit::HasActivePowerType(), Unit::HealthBelowPct(), SpellInfo::Id, Player::IsClass(), Object::IsPlayer(), m_amount, NODAMAGE, POWER_RAGE, Unit::RemoveAurasDueToSpell(), Player::RemoveRunesByAuraEffect(), Unit::SetPower(), SPELL_SCHOOL_MASK_NORMAL, SPELLFAMILY_DEATHKNIGHT, SPELLFAMILY_DRUID, SPELLFAMILY_HUNTER, SPELLFAMILY_SHAMAN, SpellInfo::SpellFamilyFlags, SPELLVALUE_BASE_POINT0, Object::ToPlayer(), UNIT_FLAG_FLEEING, UNIT_FLAG_SILENCED, and UNIT_FLAG_STUNNED.

Referenced by PeriodicTick().

◆ HandlePeriodicEnergizeAuraTick()

void AuraEffect::HandlePeriodicEnergizeAuraTick ( Unit target,
Unit caster 
) const
7152{
7154
7156 return;
7157
7158 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7159 return;
7160
7161 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7162 {
7163 SendTickImmune(target, caster);
7164 return;
7165 }
7166
7167 // don't regen when permanent aura target has full power
7168 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7169 return;
7170
7171 // ignore negative values (can be result apply spellmods to aura damage
7172 int32 amount = std::max(m_amount, 0);
7173
7174 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7175 target->SendPeriodicAuraLog(&pInfo);
7176
7177 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7178 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7179 int32 gain = target->ModifyPower(PowerType, amount);
7180
7181 if (caster)
7182 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7183}
@ SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED
Definition SharedDefines.h:657

References GetBase(), GetCasterGUID(), Object::GetGUID(), Unit::getHostileRefMgr(), GetId(), Unit::GetMaxPower(), GetMiscValue(), Unit::GetPower(), GetSpellInfo(), Unit::HasActivePowerType(), SpellInfo::HasAttribute(), Unit::HasUnitState(), Unit::IsAlive(), Object::IsPlayer(), LOG_DEBUG, m_amount, m_spellInfo, Unit::ModifyPower(), Unit::SendPeriodicAuraLog(), SendTickImmune(), SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED, HostileRefMgr::threatAssist(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicHealAurasTick()

void AuraEffect::HandlePeriodicHealAurasTick ( Unit target,
Unit caster 
) const
6891{
6892 if (!target->IsAlive())
6893 return;
6894
6895 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6896 {
6897 SendTickImmune(target, caster);
6898 return;
6899 }
6900
6901 // heal for caster damage (must be alive)
6902 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST) && (!caster || !caster->IsAlive()))
6903 return;
6904
6905 // don't regen when permanent aura target has full power
6906 if (GetBase()->IsPermanent() && target->IsFullHealth())
6907 return;
6908
6909 // ignore negative values (can be result apply spellmods to aura damage
6910 int32 damage = std::max(m_amount, 0);
6911
6913 {
6914 // Taken mods
6915 float TakenTotalMod = 1.0f;
6916
6917 // Tenacity increase healing % taken
6918 if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0))
6919 AddPct(TakenTotalMod, Tenacity->GetAmount());
6920
6921 // Healing taken percent
6922 float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6923 if (minval)
6924 AddPct(TakenTotalMod, minval);
6925
6926 float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6927 if (maxval)
6928 AddPct(TakenTotalMod, maxval);
6929
6930 // Healing over time taken percent
6931 float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6932 if (minval_hot)
6933 AddPct(TakenTotalMod, minval_hot);
6934
6935 float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6936 if (maxval_hot)
6937 AddPct(TakenTotalMod, maxval_hot);
6938
6939 // Arena / BG Dampening
6940 float minval_pct = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
6941 if (minval_pct)
6942 AddPct(TakenTotalMod, minval_pct);
6943
6944 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
6945
6946 // the most ugly hack i made :P the other option is to change all spellvalues to float...
6947 // demonic aegis
6948 if (caster && GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[1] & 0x20000000))
6950 AddPct(TakenTotalMod, aurEff->GetAmount());
6951
6952 damage = uint32(target->CountPctFromMaxHealth(damage));
6953 damage = uint32(damage * TakenTotalMod);
6954 }
6955 else
6956 {
6957 // Wild Growth = amount + (6 - 2*doneTicks) * ticks* amount / 100
6958 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellInfo()->SpellIconID == 2864)
6959 {
6960 uint32 tickNumber = GetTickNumber() - 1;
6961 int32 tempAmount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
6962
6963 float drop = 2.0f;
6964
6965 // Item - Druid T10 Restoration 2P Bonus
6966 if (caster)
6967 if (AuraEffect* aurEff = caster->GetAuraEffect(70658, 0))
6968 AddPct(drop, -aurEff->GetAmount());
6969
6970 damage += GetTotalTicks() * tempAmount * (6 - (drop * tickNumber)) * 0.01f;
6971 }
6972
6973 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6974 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6975 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6976 }
6977
6978 bool crit = false;
6979 if ((crit = roll_chance_f(GetCritChance())))
6980 damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target);
6981
6982 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} heal of {} for {} health inflicted by {}",
6983 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId());
6984
6985 uint32 heal = uint32(damage);
6986
6987 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6988 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal, GetSpellInfo());
6989 sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
6990
6991 if (target->GetAI())
6992 {
6993 target->GetAI()->OnCalculatePeriodicTickReceived(heal, caster);
6994 }
6995
6996 HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6997 Unit::CalcHealAbsorb(healInfo);
6998 int32 gain = Unit::DealHeal(caster, target, healInfo.GetHeal());
6999 healInfo.SetEffectiveHeal(gain);
7000
7001 SpellPeriodicAuraLogInfo pInfo(this, healInfo.GetHeal(), healInfo.GetHeal() - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit);
7002 target->SendPeriodicAuraLog(&pInfo);
7003
7004 if (caster)
7005 {
7006 float threat = float(gain) * 0.5f;
7007 if (caster->IsClass(CLASS_PALADIN))
7008 threat *= 0.5f;
7009
7010 target->getHostileRefMgr().threatAssist(caster, threat, GetSpellInfo());
7011 }
7012
7013 bool haveCastItem = GetBase()->GetCastItemGUID();
7014
7015 // Health Funnel
7016 // damage caster for heal amount
7017 // xinef: caster is available, checked earlier
7018 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST))
7019 {
7020 uint32 manaPerSecond = GetSpellInfo()->ManaPerSecond;
7021 if ((int32)manaPerSecond > gain && gain > 0)
7022 {
7023 manaPerSecond = gain;
7024 }
7025
7026 uint32 absorb2 = 0;
7027 Unit::DealDamageMods(caster, manaPerSecond, &absorb2);
7028
7030 Unit::DealDamage(caster, caster, manaPerSecond, &cleanDamage, SELF_DAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
7031 }
7032
7033 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
7034 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
7036 if (healInfo.GetAbsorb() > 0)
7037 procEx |= PROC_EX_ABSORB;
7038
7039 // ignore item heals
7040 if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH) // xinef: dont allow obs_mod_health to proc spells, this is passive regeneration and not hot
7041 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo);
7042}
@ SPELL_ATTR2_NO_TARGET_PER_SECOND_COST
Definition SharedDefines.h:467
@ CLASS_PALADIN
Definition SharedDefines.h:142
@ 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:220
@ SELF_DAMAGE
Definition Unit.h:254
uint32 GetTickNumber() const
Definition SpellAuraEffects.h:87
AuraObjectType GetType() const
Definition SpellAuras.cpp:481
ObjectGuid GetCastItemGUID() const
Definition SpellAuras.h:103
Definition Unit.h:374
uint32 ManaPerSecond
Definition SpellInfo.h:365
static void CalcHealAbsorb(HealInfo &healInfo)
Definition Unit.cpp:2514
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition Unit.cpp:10995
int32 GetMaxPositiveAuraModifier(AuraType auratype)
Definition Unit.cpp:5991
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:12365
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
Definition Unit.cpp:6005
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:12614

References AddPct(), BASE_ATTACK, Unit::CalcHealAbsorb(), CLASS_PALADIN, Unit::CountPctFromMaxHealth(), Unit::DealDamage(), Unit::DealDamageMods(), Unit::DealHeal(), DOT, DYNOBJ_AURA_TYPE, SpellInfo::Effects, HealInfo::GetAbsorb(), Unit::GetAI(), Unit::GetAuraEffect(), GetAuraType(), GetBase(), GetCasterGUID(), Aura::GetCastItemGUID(), GetCritChance(), HealInfo::GetEffectiveHeal(), GetEffIndex(), Object::GetGUID(), HealInfo::GetHeal(), Unit::getHostileRefMgr(), GetId(), Unit::GetMaxNegativeAuraModifier(), Unit::GetMaxPositiveAuraModifier(), GetSpellInfo(), Aura::GetStackAmount(), GetTickNumber(), GetTotalTicks(), Aura::GetType(), Unit::HasUnitState(), Unit::IsAlive(), Unit::IsClass(), Unit::IsFullHealth(), LOG_DEBUG, m_amount, m_baseAmount, m_effIndex, m_spellInfo, 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::ProcDamageAndSpell(), 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_DRUID, SPELLFAMILY_WARLOCK, Unit::SpellHealingBonusDone(), Unit::SpellHealingBonusTaken(), sScriptMgr, HostileRefMgr::threatAssist(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicHealthFunnelAuraTick()

void AuraEffect::HandlePeriodicHealthFunnelAuraTick ( Unit target,
Unit caster 
) const
6862{
6863 if (!caster || !caster->IsAlive() || !target->IsAlive())
6864 return;
6865
6866 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6867 {
6868 SendTickImmune(target, caster);
6869 return;
6870 }
6871
6872 uint32 damage = std::max(GetAmount(), 0);
6873 // do not kill health donator
6874 if (caster->GetHealth() < damage)
6875 damage = caster->GetHealth() - 1;
6876 if (!damage)
6877 return;
6878
6879 caster->ModifyHealth(-(int32)damage);
6880 LOG_DEBUG("spells.aura", "PeriodicTick: donator {} target {} damage {}.", caster->GetEntry(), target->GetEntry(), damage);
6881
6882 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6883
6884 damage = int32(damage * gainMultiplier);
6885
6886 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6887 caster->HealBySpell(healInfo);
6888}
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:11288

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

Referenced by PeriodicTick().

◆ HandlePeriodicHealthLeechAuraTick()

void AuraEffect::HandlePeriodicHealthLeechAuraTick ( Unit target,
Unit caster 
) const
6754{
6755 if (!target->IsAlive())
6756 return;
6757
6759 {
6760 SendTickImmune(target, caster);
6761 return;
6762 }
6763
6764 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6765 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6766 return;
6767
6769
6770 uint32 damage = std::max(GetAmount(), 0);
6771
6772 // Script Hook For HandlePeriodicHealthLeechAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6773 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6774
6775 if (target->GetAI())
6776 {
6777 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6778 }
6779
6780 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6781 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6782 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6783
6784 bool crit = false;
6785 if ((crit = roll_chance_f(GetCritChance())))
6786 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6787
6788 // Calculate armor mitigation
6790 {
6791 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6792 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6793 damage = damageReductedArmor;
6794 }
6795
6796 int32 dmg = damage;
6797 int32 cleanDamageAmount = cleanDamage.mitigated_damage;
6798 if (CanApplyResilience())
6799 {
6800 int32 resilienceReduction = dmg;
6801 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6802
6803 resilienceReduction = dmg - resilienceReduction;
6804 dmg -= resilienceReduction;
6805 cleanDamageAmount += resilienceReduction;
6806 }
6807
6808 damage = std::max(0, dmg);
6809 cleanDamage.mitigated_damage = std::max(0, cleanDamageAmount);
6810
6811 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6812 Unit::CalcAbsorbResist(dmgInfo);
6813
6814 uint32 absorb = dmgInfo.GetAbsorb();
6815 uint32 resist = dmgInfo.GetResist();
6816 damage = dmgInfo.GetDamage();
6817
6818 // Set trigger flag
6819 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6820 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6822 if (absorb > 0)
6823 procEx |= PROC_EX_ABSORB;
6824
6825 if (dmgInfo.GetDamage())
6826 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6827
6828 if (target->GetHealth() < dmgInfo.GetDamage())
6829 {
6830 dmgInfo.ModifyDamage(dmgInfo.GetDamage() - target->GetHealth());
6831 }
6832
6833 damage = dmgInfo.GetDamage();
6834
6835 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} health leech of {} for {} dmg inflicted by {} abs is {}",
6836 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6837 if (caster)
6838 caster->SendSpellNonMeleeDamageLog(target, GetSpellInfo(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
6839
6840 int32 new_damage;
6841
6842 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
6843
6844 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6845
6846 if (!caster || !caster->IsAlive())
6847 return;
6848
6849 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6850
6851 uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount()));
6852 heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
6853
6854 HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6855 float threat = float(caster->HealBySpell(healInfo)) * 0.5f;
6856 if (caster->IsClass(CLASS_PALADIN))
6857 threat *= 0.5f;
6858 caster->getHostileRefMgr().threatAssist(caster, threat, GetSpellInfo());
6859}
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:6366

References Unit::ApplyResilience(), BASE_ATTACK, Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), CanApplyResilience(), CLASS_PALADIN, CR_CRIT_TAKEN_SPELL, Unit::DealDamage(), DOT, DYNOBJ_AURA_TYPE, SpellInfo::Effects, DamageInfo::GetAbsorb(), Unit::GetAI(), GetAmount(), GetBase(), GetCasterGUID(), GetCasterLevel(), GetCritChance(), DamageInfo::GetDamage(), GetEffIndex(), Object::GetGUID(), Unit::GetHealth(), Unit::getHostileRefMgr(), GetId(), DamageInfo::GetResist(), GetSpellInfo(), Unit::HasUnitState(), Unit::HealBySpell(), Unit::IsAlive(), Unit::IsClass(), Unit::IsDamageReducedByArmor(), Unit::IsImmunedToDamageOrSchool(), 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::ProcDamageAndSpell(), 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, HostileRefMgr::threatAssist(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicManaLeechAuraTick()

void AuraEffect::HandlePeriodicManaLeechAuraTick ( Unit target,
Unit caster 
) const
7045{
7047
7048 if (!caster || !caster->IsAlive() || !target->IsAlive() || !target->HasActivePowerType(PowerType))
7049 return;
7050
7052 {
7053 SendTickImmune(target, caster);
7054 return;
7055 }
7056
7057 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
7058 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
7059 return;
7060
7061 // ignore negative values (can be result apply spellmods to aura damage
7062 int32 drainAmount = std::max(m_amount, 0);
7063
7064 // Special case: draining x% of mana (up to a maximum of 2*x% of the caster's maximum mana)
7065 // It's mana percent cost spells, m_amount is percent drain from target
7067 {
7068 // max value
7069 int32 maxmana = CalculatePct(caster->GetMaxPower(PowerType), drainAmount * 2.0f);
7070 ApplyPct(drainAmount, target->GetMaxPower(PowerType));
7071 if (drainAmount > maxmana)
7072 drainAmount = maxmana;
7073 }
7074
7075 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} power leech of {} for {} dmg inflicted by {}",
7076 GetCasterGUID().ToString(), target->GetGUID().ToString(), drainAmount, GetId());
7077 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
7078 if (PowerType == POWER_MANA)
7079 drainAmount -= target->GetSpellCritDamageReduction(drainAmount);
7080
7081 int32 drainedAmount = -target->ModifyPower(PowerType, -drainAmount);
7082
7083 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
7084
7085 SpellPeriodicAuraLogInfo pInfo(this, drainedAmount, 0, 0, 0, gainMultiplier, false);
7086 target->SendPeriodicAuraLog(&pInfo);
7087
7088 int32 gainAmount = int32(drainedAmount * gainMultiplier);
7089 int32 gainedAmount = 0;
7090 if (gainAmount)
7091 {
7092 gainedAmount = caster->ModifyPower(PowerType, gainAmount);
7093 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
7094 }
7095
7096 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
7097
7098 // remove CC auras
7100
7101 // Drain Mana
7103 && m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
7104 {
7105 int32 manaFeedVal = 0;
7106 if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
7107 manaFeedVal = aurEff->GetAmount();
7108 // Mana Feed - Drain Mana
7109 if (manaFeedVal > 0)
7110 {
7111 int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
7112 caster->CastCustomSpell(caster, 32554, &feedAmount, nullptr, nullptr, true, nullptr, this);
7113 }
7114 }
7115}
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
Definition SpellDefines.h:44
T ApplyPct(T &base, U pct)
Definition Util.h:73
uint32 ManaCostPercentage
Definition SpellInfo.h:367
uint32 GetSpellCritDamageReduction(uint32 damage) const
Definition Unit.h:1201

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::HasUnitState(), Unit::IsAlive(), Unit::IsImmunedToDamageOrSchool(), 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(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicPowerBurnAuraTick()

void AuraEffect::HandlePeriodicPowerBurnAuraTick ( Unit target,
Unit caster 
) const
7186{
7188
7189 if (!caster || !target->IsAlive() || !target->HasActivePowerType(PowerType))
7190 return;
7191
7193 {
7194 SendTickImmune(target, caster);
7195 return;
7196 }
7197
7198 // ignore negative values (can be result apply spellmods to aura damage
7199 int32 damage = std::max(m_amount, 0);
7200
7201 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
7202 if (PowerType == POWER_MANA)
7203 damage -= target->GetSpellCritDamageReduction(damage);
7204
7205 uint32 gain = uint32(-target->ModifyPower(PowerType, -damage));
7206
7207 float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
7208
7209 SpellInfo const* spellProto = GetSpellInfo();
7210 // maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
7211 SpellNonMeleeDamage damageInfo(caster, target, spellProto, spellProto->SchoolMask);
7212 // no SpellDamageBonus for burn mana
7213 caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto);
7214
7215 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
7216
7217 caster->SendSpellNonMeleeDamageLog(&damageInfo);
7218
7219 // Set trigger flag
7220 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
7221 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
7223 if (damageInfo.damage)
7224 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
7225
7226 caster->DealSpellDamage(&damageInfo, true);
7227
7228 DamageInfo dmgInfo(damageInfo, DOT);
7229 Unit::ProcDamageAndSpell(caster, damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, BASE_ATTACK, spellProto, nullptr, GetEffIndex(), nullptr, &dmgInfo);
7230}
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
Definition Unit.cpp:16031
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
Definition Unit.cpp:1450
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
Definition Unit.cpp:1307
Definition Unit.h:490

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

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
6290{
6291 // generic casting code with custom spells and target/caster customs
6292 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
6293
6294 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6295 SpellInfo const* auraSpellInfo = GetSpellInfo();
6296 uint32 auraId = auraSpellInfo->Id;
6297
6298 // specific code for cases with no trigger spell provided in field
6299 if (!triggeredSpellInfo)
6300 {
6301 switch (auraSpellInfo->SpellFamilyName)
6302 {
6304 {
6305 switch (auraId)
6306 {
6307 // Thaumaturgy Channel
6308 case 9712:
6309 triggerSpellId = 21029;
6310 if (caster)
6311 caster->CastSpell(caster, triggerSpellId, true);
6312 return;
6313 // Brood Affliction: Bronze
6314 case 23170:
6315 // Only 10% chance of triggering spell
6316 if (roll_chance_f(10.f))
6317 {
6318 triggerSpellId = 23171;
6319 }
6320 break;
6321 // Restoration
6322 case 24379:
6323 case 23493:
6324 {
6325 if (caster)
6326 {
6327 int32 heal = caster->CountPctFromMaxHealth(10);
6328 HealInfo healInfo(caster, target, heal, auraSpellInfo, auraSpellInfo->GetSchoolMask());
6329 caster->HealBySpell(healInfo);
6330
6331 if (int32 mana = caster->GetMaxPower(POWER_MANA))
6332 {
6333 mana /= 10;
6334 caster->EnergizeBySpell(caster, 23493, mana, POWER_MANA);
6335 }
6336 }
6337 return;
6338 }
6339 // Nitrous Boost
6340 case 27746:
6341 if (caster && target->GetPower(POWER_MANA) >= 10)
6342 {
6343 target->ModifyPower(POWER_MANA, -10);
6344 target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA);
6345 }
6346 else
6347 target->RemoveAurasDueToSpell(27746);
6348 return;
6349 // Frost Blast
6350 case 27808:
6351 if (caster)
6352 {
6353 caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, nullptr, this);
6354 if (GetTickNumber() == 1)
6355 caster->CastSpell(target, 27808, true);
6356 }
6357 return;
6358 // Inoculate Nestlewood Owlkin
6359 case 29528:
6360 if (!target->IsCreature()) // prevent error reports in case ignored player target
6361 return;
6362 break;
6363 // Feed Captured Animal
6364 case 29917:
6365 triggerSpellId = 29916;
6366 break;
6367 // Extract Gas
6368 case 30427:
6369 {
6370 // move loot to player inventory and despawn target
6371 if (caster && caster->IsPlayer() &&
6372 target->IsCreature() &&
6374 {
6375 Player* player = caster->ToPlayer();
6376 Creature* creature = target->ToCreature();
6377 // missing lootid has been reported on startup - just return
6378 if (!creature->GetCreatureTemplate()->SkinLootId)
6379 return;
6380
6382
6383 creature->DespawnOrUnsummon();
6384 }
6385 return;
6386 }
6387 // Quake
6388 case 30576:
6389 triggerSpellId = 30571;
6390 break;
6391 // Doom
6393 // so instakill will be naturally done before trigger spell
6394 case 31347:
6395 {
6396 target->CastSpell(target, 31350, true, nullptr, this);
6397 Unit::Kill(target, target);
6398 return;
6399 }
6400 // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam
6401 case 39857:
6402 triggerSpellId = 39856;
6403 break;
6404 // Personalized Weather
6405 case 46736:
6406 triggerSpellId = 46737;
6407 break;
6408 // Shield Level 1
6409 case 63130:
6410 // Shield Level 2
6411 case 63131:
6412 // Shield Level 3
6413 case 63132:
6414 // Ball of Flames Visual
6415 case 71706:
6416 return;
6417 // Oculus, Mage-Lord Urom, Time Bomb
6418 case 51121:
6419 case 59376:
6420 {
6421 const int32 dmg = target->GetMaxHealth() - target->GetHealth();
6422 target->CastCustomSpell(target, 51132, &dmg, 0, 0, true);
6423 return;
6424 }
6425 }
6426 break;
6427 }
6428 case SPELLFAMILY_SHAMAN:
6429 {
6430 switch (auraId)
6431 {
6432 // Lightning Shield (The Earthshatterer set trigger after cast Lighting Shield)
6433 case 28820:
6434 {
6435 // Need remove self if Lightning Shield not active
6437 target->RemoveAurasDueToSpell(28820);
6438 return;
6439 }
6440 }
6441 break;
6442 }
6443 default:
6444 break;
6445 }
6446 }
6447 else
6448 {
6449 // Spell exist but require custom code
6450 switch (auraId)
6451 {
6452 // Mana Tide
6453 case 16191:
6454 target->CastCustomSpell(target, triggerSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
6455 return;
6456 // Poison (Grobbulus)
6457 case 28158:
6458 case 54362:
6459 // Slime Pool (Dreadscale & Acidmaw)
6460 case 66882:
6461 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), nullptr, true, nullptr, this);
6462 return;
6463 // Eye of Eternity, Malygos, Arcane Overload
6464 case 56432:
6465 if (triggerSpellId == 56438)
6466 {
6467 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)(10000 * (1.0f - 0.02f * (m_tickNumber + 1))), nullptr, true, nullptr, this);
6468 return;
6469 }
6470 break;
6471 // Beacon of Light
6472 case 53563:
6473 {
6474 // area aura owner casts the spell
6475 GetBase()->GetUnitOwner()->CastSpell(target, triggeredSpellInfo, true, 0, this, GetBase()->GetUnitOwner()->GetGUID());
6476 return;
6477 }
6478 // Trial of the Crusader, Jaraxxus, Spinning Pain Spike
6479 case 66283:
6480 {
6481 const int32 dmg = target->GetMaxHealth() / 2;
6482 target->CastCustomSpell(target, 66316, &dmg, nullptr, nullptr, true);
6483 return;
6484 }
6485 // Violet Hold, Moragg, Ray of Suffering, Ray of Pain
6486 case 54442:
6487 case 59524:
6488 case 54438:
6489 case 59523:
6490 {
6491 if (caster)
6492 if (Unit* victim = caster->GetVictim())
6493 if (victim->GetDistance(caster) < 45.0f)
6494 {
6495 target = victim;
6496 break;
6497 }
6498 return;
6499 }
6500 case 24745: // Summon Templar, Trigger
6501 case 24747: // Summon Templar Fire, Trigger
6502 case 24757: // Summon Templar Air, Trigger
6503 case 24759: // Summon Templar Earth, Trigger
6504 case 24761: // Summon Templar Water, Trigger
6505 case 24762: // Summon Duke, Trigger
6506 case 24766: // Summon Duke Fire, Trigger
6507 case 24769: // Summon Duke Air, Trigger
6508 case 24771: // Summon Duke Earth, Trigger
6509 case 24773: // Summon Duke Water, Trigger
6510 case 24785: // Summon Royal, Trigger
6511 case 24787: // Summon Royal Fire, Trigger
6512 case 24791: // Summon Royal Air, Trigger
6513 case 24792: // Summon Royal Earth, Trigger
6514 case 24793: // Summon Royal Water, Trigger
6515 {
6516 // All this spells trigger a spell that requires reagents; if the
6517 // triggered spell is cast as "triggered", reagents are not consumed
6518 if (caster)
6519 caster->CastSpell(target, triggerSpellId, false);
6520 return;
6521 }
6522 // Hunter - Rapid Recuperation
6523 case 56654:
6524 case 58882:
6525 int32 amount = int32(target->GetMaxPower(POWER_MANA) * GetAmount() / 100.0f);
6526 target->CastCustomSpell(target, triggerSpellId, &amount, nullptr, nullptr, true, nullptr, this);
6527 return;
6528 }
6529 }
6530
6531 // Reget trigger spell proto
6532 triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6533
6534 if (triggeredSpellInfo)
6535 {
6536 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6537 {
6538 SpellCastTargets targets;
6539 targets.SetUnitTarget(target);
6540 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6541 {
6544 }
6545
6546 // Xinef: do not skip reagent cost for entry casts
6548 if (GetSpellInfo()->Effects[GetEffIndex()].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || GetSpellInfo()->Effects[GetEffIndex()].TargetB.GetCheckType() == TARGET_CHECK_ENTRY)
6550
6551 triggerCaster->CastSpell(targets, triggeredSpellInfo, nullptr, triggerFlags, nullptr, this);
6552 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6553 }
6554 }
6555}
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
@ CREATURE_TYPE_GAS_CLOUD
Definition SharedDefines.h:2640
@ 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:115
Unit * GetUnitOwner() const
Definition SpellAuras.h:108
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition Creature.cpp:2183
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
Definition Player.cpp:13442
Definition Spell.h:111
void SetUnitTarget(Unit *target)
Definition Spell.cpp:239
void SetObjectTargetChannel(ObjectGuid targetGUID)
Definition Spell.cpp:454
void SetDstChannel(SpellDestination const &spellDest)
Definition Spell.cpp:459
bool IsChannelCategorySpell() const
Definition SpellInfo.cpp:1083
void EnergizeBySpell(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:11315
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:17749
void SendEnergizeSpellLog(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:11304
SpellDestination spellDst
Definition Spell.h:252
ObjectGuid channelGUID
Definition Spell.h:251
uint32 type
Definition CreatureData.h:222
uint32 SkinLootId
Definition CreatureData.h:226

References Player::AutoStoreLoot(), Unit::CastCustomSpell(), Unit::CastSpell(), ChannelTargetData::channelGUID, Unit::CountPctFromMaxHealth(), CREATURE_TYPE_GAS_CLOUD, Creature::DespawnOrUnsummon(), SpellInfo::Effects, Unit::EnergizeBySpell(), GetAmount(), Unit::GetAuraEffect(), 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_amount, 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, SPELL_AURA_PROC_TRIGGER_SPELL, ChannelTargetData::spellDst, SPELLFAMILY_GENERIC, SPELLFAMILY_SHAMAN, SpellInfo::SpellFamilyName, SPELLVALUE_BASE_POINT0, 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
6558{
6559 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
6560 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
6561 {
6562 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6563 {
6564 SpellCastTargets targets;
6565 targets.SetUnitTarget(target);
6566 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6567 {
6570 }
6571
6572 CustomSpellValues values;
6574
6575 triggerCaster->CastSpell(targets, triggeredSpellInfo, &values, TRIGGERED_FULL_MASK, nullptr, this);
6576 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6577 }
6578 }
6579 else
6580 {
6581 Creature* c = target->ToCreature();
6582 if (c && caster)
6583 {
6584 sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), target->ToCreature());
6585 }
6586
6587 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
6588 }
6589}
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
1810{
1811 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1812 return;
1813
1814 Unit* target = aurApp->GetTarget();
1815
1816 // no-phase is also phase state so same code for apply and remove
1817 uint32 newPhase = target->GetPhaseByAuras();
1818
1819 if (Player* player = target->ToPlayer())
1820 {
1821 if (!newPhase)
1822 newPhase = PHASEMASK_NORMAL;
1823
1824 // do not change phase to GM with all phases enabled
1825 if (player->IsGameMaster())
1826 newPhase = PHASEMASK_ANYWHERE;
1827
1828 player->SetPhaseMask(newPhase, false);
1829 player->GetSession()->SendSetPhaseShift(newPhase);
1830 }
1831 else
1832 {
1833 if (!newPhase)
1834 {
1835 newPhase = PHASEMASK_NORMAL;
1836 if (Creature* creature = target->ToCreature())
1837 if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetSpawnId()))
1838 newPhase = data->phaseMask;
1839 }
1840
1841 target->SetPhaseMask(newPhase, false);
1842 }
1843
1844 // call functions which may have additional effects after chainging state of unit
1845 // phase auras normally not expected at BG but anyway better check
1846 if (apply)
1847 {
1848 // drop flag at invisibiliy in bg
1850 }
1851
1852 // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
1853 if (target->IsVisible())
1854 {
1855 if (!target->GetMap()->Instanceable())
1856 {
1857 target->UpdateObjectVisibility(false);
1858 target->m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f);
1859 }
1860 else
1861 target->UpdateObjectVisibility();
1862 }
1863}
@ PHASEMASK_ANYWHERE
Definition Object.h:62
@ PHASEMASK_NORMAL
Definition Object.h:61
uint32 GetPhaseByAuras() const
Definition Unit.cpp:19085
bool IsVisible() const
Definition Unit.h:1917
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Unit.cpp:19096
Position m_last_notify_position
Definition Unit.h:2013
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.
3530{
3531 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3532 return;
3533
3534 Unit* target = aurApp->GetTarget();
3535 // Since patch 3.0.2 this mechanic no longer affects fear effects. It will ONLY prevent humanoids from fleeing due to low health.
3536 if (target->IsPlayer() || !apply || target->HasFearAura())
3537 return;
3540 target->SetControlled(false, UNIT_STATE_FLEEING);
3541}
bool HasFearAura() const
Definition Unit.h:1741

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
6185{
6186 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6187 return;
6188
6189 if (!aurApp->GetTarget()->IsPlayer())
6190 return;
6191
6192 if (apply)
6193 aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6194 else if (!aurApp->GetTarget()->GetMap()->Instanceable())
6195 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6196}
@ PLAYER_FIELD_BYTE_RELEASE_TIMER
Definition Player.h:566

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 
)
1177{
1178 bool prevented = GetBase()->CallScriptEffectProcHandlers(this, aurApp, eventInfo);
1179 if (prevented)
1180 return;
1181
1182 switch (GetAuraType())
1183 {
1185 HandleProcTriggerSpellAuraProc(aurApp, eventInfo);
1186 break;
1188 HandleProcTriggerSpellWithValueAuraProc(aurApp, eventInfo);
1189 break;
1191 HandleProcTriggerDamageAuraProc(aurApp, eventInfo);
1192 break;
1194 HandleRaidProcFromChargeAuraProc(aurApp, eventInfo);
1195 break;
1198 break;
1199 default:
1200 break;
1201 }
1202
1203 GetBase()->CallScriptAfterEffectProcHandlers(this, aurApp, eventInfo);
1204}
@ SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE
Definition SpellAuraDefines.h:288
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
Definition SpellAuraDefines.h:294
@ 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:7290
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7249
void HandleProcTriggerDamageAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7270
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7338
void HandleProcTriggerSpellAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7232
bool CallScriptEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuras.cpp:2714
void CallScriptAfterEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuras.cpp:2733

References Aura::CallScriptAfterEffectProcHandlers(), Aura::CallScriptEffectProcHandlers(), GetAuraType(), GetBase(), HandleProcTriggerDamageAuraProc(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), SPELL_AURA_PROC_TRIGGER_DAMAGE, SPELL_AURA_PROC_TRIGGER_SPELL, SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE, SPELL_AURA_RAID_PROC_FROM_CHARGE, and SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE.

Referenced by Aura::TriggerProcOnEvent().

◆ HandleProcTriggerDamageAuraProc()

void AuraEffect::HandleProcTriggerDamageAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7271{
7272 Unit* target = aurApp->GetTarget();
7273 Unit* triggerTarget = eventInfo.GetProcTarget();
7274 if (triggerTarget->HasUnitState(UNIT_STATE_ISOLATED) || triggerTarget->IsImmunedToDamageOrSchool(GetSpellInfo()))
7275 {
7276 SendTickImmune(triggerTarget, target);
7277 return;
7278 }
7279
7280 SpellNonMeleeDamage damageInfo(target, triggerTarget, GetSpellInfo(), GetSpellInfo()->SchoolMask);
7281 uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE, GetEffIndex());
7282 damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
7283 target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo());
7284 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
7285 target->SendSpellNonMeleeDamageLog(&damageInfo);
7286 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering {} spell damage from aura {} proc", damage, GetId());
7287 target->DealSpellDamage(&damageInfo, true);
7288}
Unit * GetProcTarget() const
Definition Unit.h:442

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

Referenced by HandleProc(), and Unit::ProcDamageAndSpellFor().

◆ HandleProcTriggerSpellAuraProc()

void AuraEffect::HandleProcTriggerSpellAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7233{
7234 Unit* triggerCaster = aurApp->GetTarget();
7235 Unit* triggerTarget = eventInfo.GetProcTarget();
7236
7237 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
7238 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
7239 {
7240 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell {} from aura {} proc", triggeredSpellInfo->Id, GetId());
7241 triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, nullptr, this);
7242 }
7243 else
7244 {
7245 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());
7246 }
7247}

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

Referenced by HandleProc().

◆ HandleProcTriggerSpellWithValueAuraProc()

void AuraEffect::HandleProcTriggerSpellWithValueAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7250{
7251 Unit* triggerCaster = aurApp->GetTarget();
7252 Unit* triggerTarget = eventInfo.GetProcTarget();
7253
7254 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
7255 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
7256 {
7257 // used only with EXTRA_LOGS
7258 (void)triggeredSpellInfo;
7259
7260 int32 basepoints0 = GetAmount();
7261 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell {} with value {} from aura {} proc", triggeredSpellInfo->Id, basepoints0, GetId());
7262 triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, nullptr, nullptr, true, nullptr, this);
7263 }
7264 else
7265 {
7266 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());
7267 }
7268}

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

Referenced by HandleProc().

◆ HandleRaidProcFromChargeAuraProc()

void AuraEffect::HandleRaidProcFromChargeAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7291{
7292 Unit* target = aurApp->GetTarget();
7293
7294 uint32 triggerSpellId;
7295 switch (GetId())
7296 {
7297 case 57949: // Shiver
7298 triggerSpellId = 57952;
7299 //animationSpellId = 57951; dummy effects for jump spell have unknown use (see also 41637)
7300 break;
7301 case 59978: // Shiver
7302 triggerSpellId = 59979;
7303 break;
7304 case 43593: // Cold Stare
7305 triggerSpellId = 43594;
7306 break;
7307 default:
7308 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: {}", GetId());
7309 return;
7310 }
7311
7312 int32 jumps = GetBase()->GetCharges();
7313
7314 // current aura expire on proc finish
7315 GetBase()->SetCharges(0);
7316 GetBase()->SetUsingCharges(true);
7317
7318 // next target selection
7319 if (jumps > 0)
7320 {
7321 if (Unit* caster = GetCaster())
7322 {
7323 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7324
7325 if (Unit* triggerTarget = target->GetNextRandomRaidMemberOrPet(radius))
7326 {
7327 target->CastSpell(triggerTarget, GetSpellInfo(), true, nullptr, this, GetCasterGUID());
7328 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7329 aura->SetCharges(jumps);
7330 }
7331 }
7332 }
7333
7334 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7335 target->CastSpell(target, triggerSpellId, true, nullptr, this, GetCasterGUID());
7336}
void SetUsingCharges(bool val)
Definition SpellAuras.h:201
Unit * GetNextRandomRaidMemberOrPet(float radius)
Definition Unit.cpp:11158

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 
)
7339{
7340 Unit* target = aurApp->GetTarget();
7341
7342 // Currently only Prayer of Mending
7343 if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20))
7344 {
7345 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: {}", GetId());
7346 return;
7347 }
7348 uint32 triggerSpellId = 33110;
7349
7350 int32 value = GetAmount();
7351
7352 int32 jumps = GetBase()->GetCharges();
7353
7354 // current aura expire on proc finish
7355 GetBase()->SetCharges(0);
7356 GetBase()->SetUsingCharges(true);
7357
7358 // next target selection
7359 if (jumps > 0)
7360 {
7361 if (Unit* caster = GetCaster())
7362 {
7363 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7364
7365 Unit* triggerTarget = nullptr;
7366 Acore::MostHPMissingGroupInRange u_check(target, radius, 0);
7367 Acore::UnitLastSearcher<Acore::MostHPMissingGroupInRange> searcher(target, triggerTarget, u_check);
7368 Cell::VisitAllObjects(target, searcher, radius);
7369
7370 if (triggerTarget)
7371 {
7372 target->CastCustomSpell(triggerTarget, GetId(), &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7373 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7374 aura->SetCharges(jumps);
7375 }
7376 }
7377 }
7378
7379 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7380 target->CastCustomSpell(target, triggerSpellId, &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7381}
Definition GridNotifiers.h:1479
Definition GridNotifiers.h:406

References Unit::CastCustomSpell(), 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::VisitAllObjects().

Referenced by HandleProc().

◆ HandleRangedAmmoHaste()

void AuraEffect::HandleRangedAmmoHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5050{
5052 return;
5053
5054 Unit* target = aurApp->GetTarget();
5055
5056 if (!target->IsPlayer())
5057 return;
5058
5059 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5060}

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
1229{
1230 uint32 spellId = 0;
1231 uint32 spellId2 = 0;
1232 //uint32 spellId3 = 0;
1233 uint32 HotWSpellId = 0;
1234
1235 switch (GetMiscValue())
1236 {
1237 case FORM_CAT:
1238 spellId = 3025;
1239 HotWSpellId = 24900;
1240 break;
1241 case FORM_TREE:
1242 spellId = 34123;
1243 break;
1244 case FORM_TRAVEL:
1245 spellId = 5419;
1246 break;
1247 case FORM_AQUA:
1248 spellId = 5421;
1249 break;
1250 case FORM_BEAR:
1251 spellId = 1178;
1252 spellId2 = 21178;
1253 HotWSpellId = 24899;
1254 break;
1255 case FORM_DIREBEAR:
1256 spellId = 9635;
1257 spellId2 = 21178;
1258 HotWSpellId = 24899;
1259 break;
1260 case FORM_BATTLESTANCE:
1261 spellId = 21156;
1262 break;
1264 spellId = 7376;
1265 break;
1267 spellId = 7381;
1268 break;
1269 case FORM_MOONKIN:
1270 spellId = 24905;
1271 spellId2 = 69366;
1272 break;
1273 case FORM_FLIGHT:
1274 spellId = 33948;
1275 spellId2 = 34764;
1276 break;
1277 case FORM_FLIGHT_EPIC:
1278 spellId = 40122;
1279 spellId2 = 40121;
1280 break;
1281 case FORM_METAMORPHOSIS:
1282 spellId = 54817;
1283 spellId2 = 54879;
1284 break;
1286 spellId = 27792;
1287 spellId2 = 27795; // must be second, this important at aura remove to prevent to early iterator invalidation.
1288 break;
1289 case FORM_SHADOW:
1290 spellId = 49868;
1291 spellId2 = 71167;
1292 break;
1293 case FORM_GHOSTWOLF:
1294 spellId = 67116;
1295 break;
1296 case FORM_GHOUL:
1297 case FORM_AMBIENT:
1298 case FORM_STEALTH:
1299 case FORM_CREATURECAT:
1300 case FORM_CREATUREBEAR:
1301 break;
1302 default:
1303 break;
1304 }
1305
1306 Player* player = target->ToPlayer();
1307 if (apply)
1308 {
1309 // Remove cooldown of spells triggered on stance change - they may share cooldown with stance spell
1310 if (spellId)
1311 {
1312 if (player)
1313 player->RemoveSpellCooldown(spellId);
1314 target->CastSpell(target, spellId, true, nullptr, this, target->GetGUID());
1315 }
1316
1317 if (spellId2)
1318 {
1319 if (player)
1320 player->RemoveSpellCooldown(spellId2);
1321 target->CastSpell(target, spellId2, true, nullptr, this, target->GetGUID());
1322 }
1323
1324 if (player)
1325 {
1326 const PlayerSpellMap& sp_list = player->GetSpellMap();
1327 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
1328 {
1329 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(player->GetActiveSpec()))
1330 continue;
1331
1332 if (itr->first == spellId || itr->first == spellId2)
1333 continue;
1334
1335 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
1337 continue;
1338
1339 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1340 target->CastSpell(target, itr->first, true, nullptr, this, target->GetGUID());
1341 }
1342
1343 // xinef: talent stance auras are not on m_spells map, so iterate talents
1344 const PlayerTalentMap& tl_list = player->GetTalentMap();
1345 for (PlayerTalentMap::const_iterator itr = tl_list.begin(); itr != tl_list.end(); ++itr)
1346 {
1347 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(player->GetActiveSpec()))
1348 continue;
1349
1350 if (itr->first == spellId || itr->first == spellId2)
1351 continue;
1352
1353 // Xinef: skip talents with effect learn spell
1354 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
1356 continue;
1357
1358 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1359 target->CastSpell(target, itr->first, true, nullptr, this, target->GetGUID());
1360 }
1361
1362 // Also do it for Glyphs
1363 for (uint32 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
1364 {
1365 if (uint32 glyphId = player->GetGlyph(i))
1366 {
1367 if (GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId))
1368 {
1369 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(glyph->SpellId);
1371 continue;
1372 if (spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1373 target->CastSpell(target, glyph->SpellId, TriggerCastFlags(TRIGGERED_FULL_MASK & ~(TRIGGERED_IGNORE_SHAPESHIFT | TRIGGERED_IGNORE_CASTER_AURASTATE)), nullptr, this, target->GetGUID());
1374 }
1375 }
1376 }
1377
1378 // Leader of the Pack
1379 if (player->HasTalent(17007, player->GetActiveSpec()))
1380 {
1381 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24932);
1382 if (spellInfo && spellInfo->Stances & (1 << (GetMiscValue() - 1)))
1383 target->CastSpell(target, 24932, true, nullptr, this, target->GetGUID());
1384 }
1385 // Improved Barkskin - apply/remove armor bonus due to shapeshift
1386 if (player->HasTalent(63410, player->GetActiveSpec()) || player->HasTalent(63411, player->GetActiveSpec()))
1387 {
1388 target->RemoveAurasDueToSpell(66530);
1389 if (GetMiscValue() == FORM_TRAVEL || GetMiscValue() == FORM_NONE) // "while in Travel Form or while not shapeshifted"
1390 target->CastSpell(target, 66530, true);
1391 }
1392 // Heart of the Wild
1393 if (HotWSpellId)
1394 {
1395 // hacky, but the only way as spell family is not SPELLFAMILY_DRUID
1397 for (Unit::AuraEffectList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
1398 {
1399 // Heart of the Wild
1400 if ((*i)->GetSpellInfo()->SpellIconID == 240 && (*i)->GetMiscValue() == STAT_INTELLECT)
1401 {
1402 int32 HotWMod = (*i)->GetAmount() / 2; // For each 2% Intelligence, you get 1% stamina and 1% attack power.
1403
1404 target->CastCustomSpell(target, HotWSpellId, &HotWMod, nullptr, nullptr, true, nullptr, this, target->GetGUID());
1405 break;
1406 }
1407 }
1408 }
1409 switch (GetMiscValue())
1410 {
1411 case FORM_CAT:
1412 // Savage Roar
1413 if (target->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_DRUID, 0, 0x10000000, 0))
1414 target->CastSpell(target, 62071, true);
1415 // Nurturing Instinct
1417 {
1418 uint32 spellId3 = 0;
1419 switch (aurEff->GetId())
1420 {
1421 case 33872:
1422 spellId3 = 47179;
1423 break;
1424 case 33873:
1425 spellId3 = 47180;
1426 break;
1427 }
1428 target->CastSpell(target, spellId3, true, nullptr, this, target->GetGUID());
1429 }
1430 // Master Shapeshifter - Cat
1431 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1432 {
1433 int32 bp = aurEff->GetAmount();
1434 target->CastCustomSpell(target, 48420, &bp, nullptr, nullptr, true);
1435 }
1436 break;
1437 case FORM_DIREBEAR:
1438 case FORM_BEAR:
1439 // Master Shapeshifter - Bear
1440 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1441 {
1442 int32 bp = aurEff->GetAmount();
1443 target->CastCustomSpell(target, 48418, &bp, nullptr, nullptr, true);
1444 }
1445 // Survival of the Fittest
1447 {
1448 int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
1449 target->CastCustomSpell(target, 62069, &bp, nullptr, nullptr, true, 0, this, target->GetGUID());
1450 }
1451 break;
1452 case FORM_MOONKIN:
1453 // Master Shapeshifter - Moonkin
1454 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1455 {
1456 int32 bp = aurEff->GetAmount();
1457 target->CastCustomSpell(target, 48421, &bp, nullptr, nullptr, true);
1458 }
1459 // Always cast Moonkin Aura
1460 target->CastSpell(target, 24907, true, nullptr, this, target->GetGUID());
1461 break;
1462 // Master Shapeshifter - Tree of Life
1463 case FORM_TREE:
1464 if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
1465 {
1466 int32 bp = aurEff->GetAmount();
1467 target->CastCustomSpell(target, 48422, &bp, nullptr, nullptr, true);
1468 }
1469 break;
1470 }
1471 }
1472 }
1473 else
1474 {
1475 if (spellId)
1476 target->RemoveOwnedAura(spellId);
1477 if (spellId2)
1478 target->RemoveOwnedAura(spellId2);
1479
1480 // Improved Barkskin - apply/remove armor bonus due to shapeshift
1481 if (player)
1482 {
1483 if (player->HasTalent(63410, player->GetActiveSpec()) || player->HasTalent(63411, player->GetActiveSpec()))
1484 {
1485 target->RemoveAurasDueToSpell(66530);
1486 target->CastSpell(target, 66530, true);
1487 }
1488 }
1489
1491 AuraEffect* newAura = nullptr;
1492 // 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
1493 for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr)
1494 {
1495 if ((*itr) != this)
1496 {
1497 newAura = *itr;
1498 break;
1499 }
1500 }
1501
1502 // Use the new aura to see on what stance the target will be
1503 uint32 newStance = (1 << ((newAura ? newAura->GetMiscValue() : 0) - 1));
1504
1505 Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras();
1506 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
1507 {
1508 // If the stances are not compatible with the spell, remove it
1509 // Xinef: Remove all passive auras, they will be added if needed
1510 if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && (!(itr->second->GetBase()->GetSpellInfo()->Stances & newStance) || itr->second->GetBase()->IsPassive()))
1511 target->RemoveAura(itr);
1512 else
1513 ++itr;
1514 }
1515
1516 // Xinef: Remove autoattack spells
1517 if (Spell* spell = target->GetCurrentSpell(CURRENT_MELEE_SPELL))
1518 if (spell->GetSpellInfo()->CheckShapeshift(newAura ? newAura->GetMiscValue() : 0) != SPELL_CAST_OK)
1519 spell->cancel(true);
1520 }
1521}
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
@ EFFECT_2
Definition SharedDefines.h:33
@ SPELL_EFFECT_LEARN_SPELL
Definition SharedDefines.h:814
#define MAX_GLYPH_SLOT_INDEX
Definition SharedDefines.h:676
SpellAttr0
Definition SharedDefines.h:381
@ SPELL_ATTR0_PASSIVE
Definition SharedDefines.h:388
@ SPELL_ATTR0_DO_NOT_DISPLAY
Definition SharedDefines.h:389
@ STAT_INTELLECT
Definition SharedDefines.h:261
@ SPELL_CAST_OK
Definition SharedDefines.h:1138
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
Definition SpellAuraDefines.h:200
@ SPELL_AURA_DUMMY
Definition SpellAuraDefines.h:67
@ 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:1779
bool HasTalent(uint32 spell_id, uint8 spec) const
Definition Player.cpp:3884
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3522
uint32 Stances
Definition SpellInfo.h:333
bool HasEffect(SpellEffects effect) const
Definition SpellInfo.cpp:876
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4738
Definition DBCStructure.h:1022

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
5310{
5312 return;
5313
5314 Unit* target = aurApp->GetTarget();
5315
5316 BaseModType modType = FLAT_MOD;
5318 modType = PCT_MOD;
5319
5320 if (target->IsPlayer())
5321 target->ToPlayer()->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(GetAmount()), apply);
5322}
@ SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
Definition SpellAuraDefines.h:213
BaseModType
Definition Unit.h:189
@ PCT_MOD
Definition Unit.h:191
@ SHIELD_BLOCK_VALUE
Definition Unit.h:184

References AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_STAT, FLAT_MOD, GetAmount(), GetAuraType(), AuraApplication::GetTarget(), Player::HandleBaseModValue(), Object::IsPlayer(), PCT_MOD, SHIELD_BLOCK_VALUE, SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT, and Object::ToPlayer().

◆ HandleSpiritOfRedemption()

void AuraEffect::HandleSpiritOfRedemption ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1748{
1749 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1750 return;
1751
1752 Unit* target = aurApp->GetTarget();
1753
1754 if (!target->IsPlayer())
1755 return;
1756
1757 // prepare spirit state
1758 if (apply)
1759 {
1760 // disable breath/etc timers
1761 target->ToPlayer()->StopMirrorTimers();
1762
1763 // set stand state (expected in this form)
1764 if (!target->IsStandState())
1766
1767 target->SetHealth(1);
1768 }
1769 // die at aura end
1770 else if (target->IsAlive())
1771 // call functions which may have additional effects after chainging state of unit
1773
1774 // xinef: damage immunity spell, not needed because of 93 aura (adds non_attackable state)
1775 // xinef: probably blizzard added it just in case in wotlk (id > 46000)
1776 if (apply)
1777 target->CastSpell(target, 62371, true);
1778 else
1779 target->RemoveAurasDueToSpell(62371);
1780}
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:32
void StopMirrorTimers()
Definition Player.h:2068
virtual void setDeathState(DeathState s, bool despawn=false)
Definition Unit.cpp:14604
bool IsStandState() const
Definition Unit.cpp:16753
void SetStandState(uint8 state)
Definition Unit.cpp:16759

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
160 {
161 // useless
162 }

◆ HandleWaterBreathing()

void AuraEffect::HandleWaterBreathing ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3403{
3405 return;
3406
3407 Unit* target = aurApp->GetTarget();
3408
3409 // update timers in client
3410 if (target->IsPlayer())
3411 target->ToPlayer()->UpdateMirrorTimers();
3412}
void UpdateMirrorTimers()
Definition PlayerUpdates.cpp:429

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

◆ HasSpellClassMask()

bool AuraEffect::HasSpellClassMask ( ) const
1099{
1100 return m_spellInfo->Effects[m_effIndex].SpellClassMask;
1101}

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

◆ IsAffectedOnSpell()

bool AuraEffect::IsAffectedOnSpell ( SpellInfo const *  spell) const
1085{
1086 if (!spell)
1087 return false;
1088 // Check family name
1089 if (spell->SpellFamilyName != m_spellInfo->SpellFamilyName)
1090 return false;
1091
1092 // Check EffectClassMask
1093 if (m_spellInfo->Effects[m_effIndex].SpellClassMask & spell->SpellFamilyFlags)
1094 return true;
1095 return false;
1096}

References SpellInfo::Effects, m_effIndex, m_spellInfo, SpellInfo::SpellFamilyFlags, and SpellInfo::SpellFamilyName.

◆ IsPeriodic()

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

References m_isPeriodic.

Referenced by AuraApplication::_HandleEffect(), and Spell::prepare().

◆ PeriodicTick()

void AuraEffect::PeriodicTick ( AuraApplication aurApp,
Unit caster 
) const
1110{
1111 bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp);
1112 if (prevented)
1113 return;
1114
1115 Unit* target = aurApp->GetTarget();
1116
1117 // Update serverside orientation of tracking channeled auras on periodic update ticks
1118 // exclude players because can turn during channeling and shouldn't desync orientation client/server
1120 {
1121 ObjectGuid const channelGuid = caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT);
1122 if (!channelGuid.IsEmpty() && channelGuid != caster->GetGUID())
1123 {
1124 if (WorldObject const* objectTarget = ObjectAccessor::GetWorldObject(*caster, channelGuid))
1125 {
1126 caster->SetInFront(objectTarget);
1127 }
1128 }
1129 }
1130
1131 switch (GetAuraType())
1132 {
1134 HandlePeriodicDummyAuraTick(target, caster);
1135 break;
1137 HandlePeriodicTriggerSpellAuraTick(target, caster);
1138 break;
1140 // Don't actually do anything - client will trigger casts of these spells by itself
1141 break;
1144 break;
1147 HandlePeriodicDamageAurasTick(target, caster);
1148 break;
1150 HandlePeriodicHealthLeechAuraTick(target, caster);
1151 break;
1153 HandlePeriodicHealthFunnelAuraTick(target, caster);
1154 break;
1157 HandlePeriodicHealAurasTick(target, caster);
1158 break;
1160 HandlePeriodicManaLeechAuraTick(target, caster);
1161 break;
1163 HandleObsModPowerAuraTick(target, caster);
1164 break;
1166 HandlePeriodicEnergizeAuraTick(target, caster);
1167 break;
1169 HandlePeriodicPowerBurnAuraTick(target, caster);
1170 break;
1171 default:
1172 break;
1173 }
1174}
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
Definition SharedDefines.h:433
void HandlePeriodicPowerBurnAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7185
void HandlePeriodicManaLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7044
void HandleObsModPowerAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7117
void HandlePeriodicHealthFunnelAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6861
void HandlePeriodicHealAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6890
void HandlePeriodicEnergizeAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7151
void HandlePeriodicTriggerSpellAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6289
void HandlePeriodicDummyAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6198
void HandlePeriodicHealthLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6753
void HandlePeriodicDamageAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6591
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6557
bool CallScriptEffectPeriodicHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp)
Definition SpellAuras.cpp:2483
bool IsEmpty() const
Definition ObjectGuid.h:161
bool IsChanneled() const
Definition SpellInfo.cpp:1256
void SetInFront(WorldObject const *target)
Definition Unit.cpp:20321
Definition Object.h:411
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 Unit::HandleAuraProc().

◆ 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
109{ m_critChance = crit; }

References m_critChance.

Referenced by CalculatePeriodicData().

◆ SetEnabled()

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

References m_isAuraEnabled.

Referenced by AuraApplication::_HandleEffect().

◆ SetOldAmount()

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

References m_oldAmount.

Referenced by CalculateAmount().

◆ SetPctMods()

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

References m_pctMods.

◆ SetPeriodic()

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

References m_isPeriodic.

◆ SetPeriodicTimer()

◆ Update()

void AuraEffect::Update ( uint32  diff,
Unit caster 
)
905{
906 if (m_isPeriodic && (GetBase()->GetDuration() >= 0 || GetBase()->IsPassive() || GetBase()->IsPermanent()))
907 {
908 uint32 totalTicks = GetTotalTicks();
909
910 m_periodicTimer -= int32(diff);
911 while (m_periodicTimer <= 0)
912 {
913 if (!GetBase()->IsPermanent() && (m_tickNumber + 1) > totalTicks)
914 {
915 break;
916 }
917
918 ++m_tickNumber;
919
920 // update before tick (aura can be removed in TriggerSpell or PeriodicTick calls)
922 UpdatePeriodic(caster);
923
924 std::list<AuraApplication*> effectApplications;
925 GetApplicationList(effectApplications);
926 // tick on targets of effects
927 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
928 if ((*apptItr)->HasEffect(GetEffIndex()))
929 PeriodicTick(*apptItr, caster);
930 }
931 }
932}
void PeriodicTick(AuraApplication *aurApp, Unit *caster) const
Definition SpellAuraEffects.cpp:1109
void UpdatePeriodic(Unit *caster)
Definition SpellAuraEffects.cpp:934

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

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_auraGroup

uint32 AuraEffect::m_auraGroup
private

Referenced by AuraEffect(), and GetAuraGroup().

◆ m_base

Aura* const AuraEffect::m_base
private

Referenced by GetBase().

◆ m_baseAmount

int32 const AuraEffect::m_baseAmount
private

◆ 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_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: