AzerothCore 3.3.5a
OpenSource WoW Emulator
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
 
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:138
SpellModifier * m_spellmod
Definition SpellAuraEffects.h:140

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:539
@ UNIT_FIELD_CHANNEL_OBJECT
Definition UpdateFields.h:93
int32 m_periodicTimer
Definition SpellAuraEffects.h:142
bool m_canBeRecalculated
Definition SpellAuraEffects.h:147
uint8 const m_effIndex
Definition SpellAuraEffects.h:146
uint8 m_casterLevel
Definition SpellAuraEffects.h:128
bool m_applyResilience
Definition SpellAuraEffects.h:127
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition SpellAuraEffects.cpp:599
void CalculateSpellMod()
Definition SpellAuraEffects.cpp:690
int32 m_oldAmount
Definition SpellAuraEffects.h:135
uint32 GetId() const
Definition SpellAuraEffects.cpp:433
int32 CalculateAmount(Unit *caster)
Definition SpellAuraEffects.cpp:453
int32 m_amount
Definition SpellAuraEffects.h:129
void CalculatePeriodicData()
Definition SpellAuraEffects.cpp:584
uint32 m_tickNumber
Definition SpellAuraEffects.h:144
int32 const m_baseAmount
Definition SpellAuraEffects.h:124
SpellInfo const *const m_spellInfo
Definition SpellAuraEffects.h:123
bool m_isAuraEnabled
Definition SpellAuraEffects.h:136
bool m_isPeriodic
Definition SpellAuraEffects.h:148
uint32 m_auraGroup
Definition SpellAuraEffects.h:134
int32 const m_dieSides
Definition SpellAuraEffects.h:125
float m_critChance
Definition SpellAuraEffects.h:130
Aura *const m_base
Definition SpellAuraEffects.h:121
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:337
Definition Spell.h:287
bool CanApplyResilience() const
Definition Unit.h:1109
uint8 GetLevel() const
Definition Unit.h:1040
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1509
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:8948
void AddSpellMod(SpellModifier *mod, bool apply)
Definition Player.cpp:9867
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition SpellInfo.cpp:1293
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:645
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1320

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:3536
@ SPELL_AURA_ABILITY_PERIODIC_CRIT
Definition SpellAuraDefines.h:349
@ BASE_ATTACK
Definition Unit.h:209
@ RANGED_ATTACK
Definition Unit.h:211
SpellInfo const * GetSpellInfo() const
Definition SpellAuraEffects.h:54
Definition Player.h:1082
flag96 SpellFamilyFlags
Definition SpellInfo.h:388
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1987
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:652

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:1636
@ 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:210
@ DOT
Definition Unit.h:250
@ SPELL_DIRECT_DAMAGE
Definition Unit.h:249
T AddPct(T &base, U pct)
Definition Util.h:67
void SetOldAmount(int32 amount)
Definition SpellAuraEffects.h:117
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:1365
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:143
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:9770
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:765

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:131
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:2338
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
115{ 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
116{ 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
5361{
5362 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5363 return;
5364
5365 Unit* target = aurApp->GetTarget();
5366
5367 if (apply)
5369 else
5370 {
5371 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5372 if (target->HasAuraType(GetAuraType()))
5373 return;
5375 }
5376}
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
@ UNIT_FLAG_PREPARATION
Definition UnitDefines.h:255
Definition Unit.h:636
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:5761
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:719
ObjectGuid GetTarget() const
Definition Unit.h:827
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:720

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:1680
bool IsLevitating() const
Definition Unit.h:1633
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:20642
bool HasIncreaseMountedFlightSpeedAura() const
Definition Unit.h:1751

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:1127
void RemovePlayerFlag(PlayerFlags flags)
Definition Player.h:1128
bool HasAllowOnlyAbilityAura() const
Definition Unit.h:1739

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:725
uint32 GetDisplayId() const
Definition Unit.h:1894
uint32 GetNativeDisplayId() const
Definition Unit.h:1896
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:726

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 if (GetId() == 53111) // Devour Humanoid
3683 {
3684 Unit::Kill(target, caster);
3685 if (caster->IsCreature())
3686 caster->ToCreature()->RemoveCorpse();
3687 }
3688
3689 caster->_ExitVehicle();
3690 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3691 caster->RemoveAurasDueToSpell(GetId());
3692 }
3693}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition SpellAuraDefines.h:49
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition Creature.cpp:403
Creature * ToCreature()
Definition Object.h:206
bool IsVehicle() const
Definition Unit.h:766
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:17735
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:19805
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:19687
Vehicle * GetVehicleKit() const
Definition Unit.h:1845

References Unit::_EnterVehicle(), Unit::_ExitVehicle(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetCaster(), GetId(), AuraApplication::GetTarget(), Unit::GetVehicleKit(), Object::IsCreature(), Unit::IsVehicle(), Unit::Kill(), m_amount, Unit::RemoveAurasDueToSpell(), Creature::RemoveCorpse(), and Object::ToCreature().

◆ HandleAuraConvertRune()

void AuraEffect::HandleAuraConvertRune ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6029{
6030 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6031 return;
6032
6033 Unit* target = aurApp->GetTarget();
6034
6035 if (!target->IsPlayer())
6036 return;
6037
6038 Player* player = target->ToPlayer();
6039
6041 return;
6042
6043 uint32 runes = m_amount;
6044 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
6045 if (apply)
6046 {
6047 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
6048 {
6049 if (GetMiscValue() != player->GetCurrentRune(i))
6050 continue;
6051 if (!player->GetRuneCooldown(i))
6052 {
6053 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
6054 --runes;
6055 }
6056 }
6057 }
6058 else
6059 player->RemoveRunesByAuraEffect(this);
6060}
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:13360
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2518
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2529
bool IsClass(Classes playerClass, ClassContext context=CLASS_CONTEXT_NONE) const override
Definition Player.cpp:1289
RuneType GetCurrentRune(uint8 index) const
Definition Player.h:2517

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

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
4807{
4809 return;
4810
4811 Unit* target = aurApp->GetTarget();
4812
4813 target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(GetAmount()), apply);
4814}
@ AURA_EFFECT_HANDLE_STAT
Definition SpellAuraDefines.h:46
@ UNIT_MOD_HEALTH
Definition Unit.h:148
@ BASE_PCT
Definition Unit.h:127
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
6063{
6064 Unit* target = aurApp->GetTarget();
6065
6066 uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target);
6067 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
6068 if (!triggeredSpellInfo)
6069 return;
6070
6071 if (mode & AURA_EFFECT_HANDLE_REAL)
6072 {
6073 if (apply)
6074 {
6075 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCaster() : target;
6076
6077 if (!caster)
6078 return;
6079 // If amount avalible cast with basepoints (Crypt Fever for example)
6080 if (GetAmount())
6081 caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
6082 else
6083 caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
6084 }
6085 else
6086 {
6087 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6088 target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
6089 }
6090 }
6091 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
6092 {
6093 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6094 // change the stack amount to be equal to stack amount of our aura
6095 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
6096 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
6097 }
6098}
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
5109{
5111 return;
5112
5113 Unit* target = aurApp->GetTarget();
5114
5116}
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:163
@ TOTAL_VALUE
Definition Unit.h:128

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
5174{
5176 return;
5177
5178 Unit* target = aurApp->GetTarget();
5179
5180 // Recalculate bonus
5181 if (target->IsPlayer())
5182 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
5183}
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
5169{
5170 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
5171}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:5173

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5132{
5134 return;
5135
5136 Unit* target = aurApp->GetTarget();
5137
5138 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
5140}
@ TOTAL_PCT
Definition Unit.h:129

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
4363{
4365 return;
4366
4367 Unit* target = aurApp->GetTarget();
4368 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4369 {
4370 if (GetMiscValue() & int32(1 << x))
4371 {
4373 }
4374 }
4375}
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:142
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:172

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
4850{
4852 return;
4853
4854 Unit* target = aurApp->GetTarget();
4855
4856 if (!target->IsPlayer())
4857 return;
4858
4859 target->ToPlayer()->UpdateBlockPercentage();
4860}
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
4958{
4960 return;
4961
4962 Unit* target = aurApp->GetTarget();
4963
4964 if (!target->IsPlayer())
4965 {
4966 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4967 return;
4968 }
4969
4970 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4973
4974 // included in Player::UpdateSpellCritChance calculation
4976}
@ FLAT_MOD
Definition Unit.h:189
@ OFFHAND_CRIT_PERCENTAGE
Definition Unit.h:182
@ CRIT_PERCENTAGE
Definition Unit.h:180
@ RANGED_CRIT_PERCENTAGE
Definition Unit.h:181
void UpdateAllSpellCritChances()
Definition StatSystem.cpp:871
void HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply)
Definition Player.cpp:5026
int32 m_baseSpellCritChance
Definition Unit.h:2007
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
3774{
3776 return;
3777
3778 Unit* target = aurApp->GetTarget();
3779
3780 target->UpdateSpeed(MOVE_WALK, true);
3781 target->UpdateSpeed(MOVE_RUN, true);
3782 target->UpdateSpeed(MOVE_SWIM, true);
3783 target->UpdateSpeed(MOVE_FLIGHT, true);
3784 target->UpdateSpeed(MOVE_RUN_BACK, true);
3785 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3786 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3787
3788 if (Player* targetPlayer = target->ToPlayer())
3789 {
3790 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3791 }
3792}
@ 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:696
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:697
@ EQUIPMENT_SLOT_RANGED
Definition Player.h:698
#define INVENTORY_SLOT_BAG_0
Definition Player.h:676
@ 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:208
@ MAX_ATTACK
Definition Unit.h:212
@ 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
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition Player.cpp:6908
Item * GetItemByPos(uint16 pos) const
Definition PlayerStorage.cpp:441
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition Player.cpp:7015
static uint8 GetAttackBySlot(uint8 slot)
Definition PlayerStorage.cpp:542
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:1877
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition StatSystem.cpp:60
bool IsInFeralForm() const
Definition Unit.h:1880

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
4304{
4305 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4306 return;
4307
4308 Unit* target = aurApp->GetTarget();
4309
4311}
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
4294{
4295 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4296 return;
4297
4298 Unit* target = aurApp->GetTarget();
4299
4300 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
4301}
@ 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
4837{
4839 return;
4840
4841 Unit* target = aurApp->GetTarget();
4842
4843 if (!target->IsPlayer())
4844 return;
4845
4846 target->ToPlayer()->UpdateDodgePercentage();
4847}
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
4199{
4200 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4201 return;
4202
4203 Unit* target = aurApp->GetTarget();
4204
4205 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
4206
4207 // when removing flag aura, handle flag drop
4208 Player* player = target->ToPlayer();
4209 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
4210 {
4211 if (player->InBattleground())
4212 {
4213 if (Battleground* bg = player->GetBattleground())
4214 bg->EventPlayerDroppedFlag(player);
4215 }
4216 else
4217 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
4218 }
4219}
#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:2262

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
4639{
4641 return;
4642
4643 Unit* target = aurApp->GetTarget();
4644
4645 if (!target->IsPlayer())
4646 return;
4647
4650}
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
5990{
5991 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5992 return;
5993
5994 Unit* target = aurApp->GetTarget();
5995
5996 if (apply)
5997 {
5998 target->SetFaction(GetMiscValue());
5999 if (target->IsPlayer())
6001 }
6002 else
6003 {
6004 target->RestoreFaction();
6005 if (target->IsPlayer())
6007 }
6008}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition UnitDefines.h:253
void SetFaction(uint32 faction)
Definition Unit.cpp:10096
void RestoreFaction()
Definition Unit.cpp:18728

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
6117{
6119 return;
6120
6121 Player* target = aurApp->GetTarget()->ToPlayer();
6122 if (!target)
6123 return;
6124
6127}
@ PLAYER_FAKE_INEBRIATION
Definition UpdateFields.h:325
void ApplyModInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:815
void UpdateInvisibilityDrunkDetect()
Definition Player.cpp:1002

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
4740{
4742 return;
4743
4744 Unit* target = aurApp->GetTarget();
4745
4747 // do not check power type, we can always modify the maximum
4748 // as the client will not see any difference
4749 // also, placing conditions that may change during the aura duration
4750 // inside effect handlers is not a good idea
4751 //if (int32(PowerType) != GetMiscValue())
4752 // return;
4753
4754 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4755
4756 target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4757}
std::uint16_t uint16
Definition Define.h:108
Powers
Definition SharedDefines.h:268
@ UNIT_MOD_POWER_START
Definition Unit.h:174
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
4760{
4762 return;
4763
4764 Unit* target = aurApp->GetTarget();
4765
4767 // do not check power type, we can always modify the maximum
4768 // as the client will not see any difference
4769 // also, placing conditions that may change during the aura duration
4770 // inside effect handlers is not a good idea
4771 //if (int32(PowerType) != GetMiscValue())
4772 // return;
4773
4774 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4775 float amount = float(GetAmount());
4776
4777 if (apply)
4778 {
4779 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4780 target->ModifyPowerPct(PowerType, amount, apply);
4781 }
4782 else
4783 {
4784 target->ModifyPowerPct(PowerType, amount, apply);
4785 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4786 }
4787}
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.

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

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
4695{
4697 return;
4698
4699 Unit* target = aurApp->GetTarget();
4700
4701 if (apply)
4702 {
4703 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4704 target->ModifyHealth(GetAmount());
4705 }
4706 else
4707 {
4708 if (int32(target->GetHealth()) > GetAmount())
4709 target->ModifyHealth(-GetAmount());
4710 else
4711 target->SetHealth(1);
4712 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4713 }
4714}
int32 ModifyHealth(int32 val)
Definition Unit.cpp:14142
void SetHealth(uint32 val)
Definition Unit.cpp:15529
uint32 GetHealth() const
Definition Unit.h:1045

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
4790{
4792 return;
4793
4794 Unit* target = aurApp->GetTarget();
4795
4796 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4797 float percent = target->GetHealthPct();
4798 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply);
4799
4800 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4801 if (target->IsAlive())
4802 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4803 target->SetHealth(healthAmount);
4804}
T CalculatePct(T base, U pct)
Definition Util.h:61
float GetHealthPct() const
Definition Unit.h:1047
uint32 GetMaxHealth() const
Definition Unit.h:1046

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
4717{
4719 return;
4720
4721 Unit* target = aurApp->GetTarget();
4722
4723 uint32 oldhealth = target->GetHealth();
4724 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4725
4727
4728 // refresh percentage
4729 if (oldhealth > 0)
4730 {
4731 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4732 if (newhealth == 0)
4733 newhealth = 1;
4734
4735 target->SetHealth(newhealth);
4736 }
4737}

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
3714{
3715 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3716}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3698

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3699{
3701 return;
3702
3703 Unit* target = aurApp->GetTarget();
3704
3705 target->UpdateSpeed(MOVE_RUN, true);
3706
3707 if (Player* targetPlayer = target->ToPlayer())
3708 {
3709 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3710 }
3711}

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
3759{
3761 return;
3762
3763 Unit* target = aurApp->GetTarget();
3764
3765 target->UpdateSpeed(MOVE_SWIM, true);
3766
3767 if (Player* targetPlayer = target->ToPlayer())
3768 {
3769 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3770 }
3771}

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:1744
bool HasPacifyAura() const
Definition Unit.h:1748

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
4821{
4823 return;
4824
4825 Unit* target = aurApp->GetTarget();
4826
4827 if (!target->IsPlayer())
4828 return;
4829
4830 if (!target->ToPlayer()->CanParry())
4831 target->ToPlayer()->SetCanParry(true);
4832 else
4833 target->ToPlayer()->UpdateParryPercentage();
4834}
void UpdateParryPercentage()
Definition StatSystem.cpp:735
bool CanParry() const
Definition Player.h:2193
void SetCanParry(bool value)
Definition Player.cpp:13099

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
5119{
5121 return;
5122
5123 Unit* target = aurApp->GetTarget();
5124
5125 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5126 return;
5127
5129}
#define CLASSMASK_WAND_USERS
Definition SharedDefines.h:174
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:164
uint32 getClassMask() const
Definition Unit.h:811

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
5143{
5145 return;
5146
5147 Unit* target = aurApp->GetTarget();
5148
5149 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5150 return;
5151
5152 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
5154}

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
5047{
5049 return;
5050
5051 Unit* target = aurApp->GetTarget();
5052
5053 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5054}
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
4863{
4864 HandleModManaRegen(aurApp, mode, apply);
4865}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4680

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4345{
4347 return;
4348
4349 Unit* target = aurApp->GetTarget();
4350
4351 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4352 {
4353 if (GetMiscValue() & int32(1 << x))
4354 {
4356 if (target->IsPlayer() || target->IsPet())
4357 target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
4358 }
4359 }
4360}
SpellSchools
Definition SharedDefines.h:282
bool IsPet() const
Definition Unit.h:763
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.h:1142

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
4322{
4324 return;
4325
4326 Unit* target = aurApp->GetTarget();
4327
4328 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4329 {
4330 if (GetMiscValue() & int32(1 << x))
4331 {
4333 if (amount < GetAmount())
4334 {
4335 float value = float(GetAmount() - amount);
4337 if (target->IsPlayer())
4338 target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), value, apply);
4339 }
4340 }
4341 }
4342}
@ SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
Definition SpellAuraDefines.h:206
@ BASE_VALUE
Definition Unit.h:126
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
4617{
4619 return;
4620
4621 Unit* target = aurApp->GetTarget();
4622
4623 if (!target->IsPlayer())
4624 return;
4625
4627 {
4628 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4629 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4630 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4631 return;
4632 }
4633
4634 // Recalculate Armor
4635 target->UpdateArmor();
4636}
#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:18067

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
4235{
4236 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4237 return;
4238
4239 Unit* target = aurApp->GetTarget();
4240
4241 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
4242
4243 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4244 {
4245 if (apply)
4247 else
4248 {
4249 bool banishFound = false;
4250 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
4251 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
4252 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4253 {
4254 banishFound = true;
4255 break;
4256 }
4257 if (!banishFound)
4259 }
4260 }
4261
4262 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
4264
4265 // remove all flag auras (they are positive, but they must be removed when you are immune)
4269
4271 if ((apply)
4273 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
4274 {
4275 uint32 school_mask = GetMiscValue();
4276 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
4277 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
4278 {
4279 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4280 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
4281 && GetSpellInfo()->CanDispelAura(spell)
4282 && !iter->second->IsPositive() //Don't remove positive spells
4283 && spell->Id != GetId()) //Don't remove self
4284 {
4285 target->RemoveAura(iter);
4286 }
4287 else
4288 ++iter;
4289 }
4290 }
4291}
@ 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:708
void AddUnitState(uint32 f)
Definition Unit.h:706
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:3532
@ 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:3103
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary)
Definition Player.cpp:3332
const PlayerTalentMap & GetTalentMap() const
Definition Player.h:2620
PlayerSpellMap const & GetSpellMap() const
Definition Player.h:1781
void InitDataForForm(bool reapplyMods=false)
Definition Player.cpp:10549
uint8 GetActiveSpec() const
Definition Player.h:1749
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:945
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:810
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
Definition Unit.cpp:5865
bool HasShapeshiftAura() const
Definition Unit.h:1746
void RestoreDisplayId()
Definition Unit.cpp:16808
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
Definition Unit.h:1374
uint32 getTransForm() const
Definition Unit.h:1888
Powers getPowerType() const
Definition Unit.h:1068
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:1072
void setPowerType(Powers power)
Definition Unit.cpp:10019
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:21292
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
Definition Unit.cpp:19233
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:544
CurrentSpellTypes
Definition Unit.h:536
@ CURRENT_MELEE_SPELL
Definition Unit.h:537
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4093
bool HasSilenceAura() const
Definition Unit.h:1745

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:5317
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:19163

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
4436{
4438 return;
4439
4440 Unit* target = aurApp->GetTarget();
4441
4442 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4443 {
4444 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4445 return;
4446 }
4447
4448 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4449 {
4450 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4451 if (GetMiscValue() < 0 || GetMiscValue() == i)
4452 {
4453 //target->ApplyStatMod(Stats(i), m_amount, apply);
4455 if (target->IsPlayer() || target->IsPet())
4456 target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
4457 }
4458 }
4459}
#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:170
void ApplyStatBuffMod(Stats stat, float val, bool apply)
Definition Unit.h:1036

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:916

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
3795{
3796 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3797 return;
3798
3799 Unit* target = aurApp->GetTarget();
3800
3801 target->UpdateSpeed(MOVE_RUN, true);
3802 target->UpdateSpeed(MOVE_SWIM, true);
3803 target->UpdateSpeed(MOVE_FLIGHT, true);
3804
3805 if (Player* targetPlayer = target->ToPlayer())
3806 {
3807 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3808 }
3809}

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

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
6101{
6102 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6103 return;
6104
6105 Unit* target = aurApp->GetTarget();
6106
6107 if (!target->IsPlayer() || !target->IsInWorld())
6108 return;
6109
6110 if (apply)
6111 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
6112
6113 // client auto close stable dialog at !apply aura
6114}
bool IsInWorld() const
Definition Object.h:108
WorldSession * GetSession() const
Definition Player.h:2007
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
6130{
6131 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6132 return;
6133
6134 Player* target = aurApp->GetTarget()->ToPlayer();
6135
6136 if (!target || !target->IsInWorld())
6137 return;
6138
6139 uint32 overrideId = uint32(GetMiscValue());
6140
6141 if (apply)
6142 {
6144 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6145 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6146 if (uint32 spellId = overrideSpells->spellId[i])
6147 target->_addSpell(spellId, SPEC_MASK_ALL, true);
6148 }
6149 else
6150 {
6152 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6153 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6154 if (uint32 spellId = overrideSpells->spellId[i])
6155 target->removeSpell(spellId, SPEC_MASK_ALL, true);
6156 }
6157}
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
5399{
5400 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5401 return;
5402
5403 Unit* target = aurApp->GetTarget();
5404
5405 if (!target->IsPlayer())
5406 return;
5407
5408 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5409 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5410 if (!(apply) && GetBase()->GetDuration() == 0)
5411 target->AddComboPoints(-GetAmount());
5412}
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
6160{
6161 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6162 return;
6163
6164 Unit* target = aurApp->GetTarget();
6165
6166 if (!target->IsPlayer() || !target->IsInWorld())
6167 return;
6168
6169 uint32 vehicleId = GetMiscValue();
6170
6171 if (apply)
6172 {
6173 if (!target->CreateVehicleKit(vehicleId, 0))
6174 return;
6175 }
6176 else if (target->GetVehicleKit())
6177 target->RemoveVehicleKit();
6178
6180 data << target->GetPackGUID();
6181 data << uint32(apply ? vehicleId : 0);
6182 target->SendMessageToSet(&data, true);
6183
6184 if (apply)
6185 {
6187 target->ToPlayer()->GetSession()->SendPacket(&data);
6188 }
6189}
PackedGuid const & GetPackGUID() const
Definition Object.h:115
std::size_t size() const
Definition ObjectGuid.h:274
void RemoveVehicleKit()
Definition Unit.cpp:18760
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition Unit.cpp:18748
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:1614
uint8 getRace(bool original=false) const
Definition Unit.cpp:21037
DisplayRace GetDisplayRace() const
Definition Unit.h:806
void setTransForm(uint32 spellid)
Definition Unit.h:1887
bool IsMounted() const
Definition Unit.h:1807

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:20664

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
5908{
5909 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5910 return;
5911
5912 Unit* target = aurApp->GetTarget();
5913
5914 Unit* caster = GetCaster();
5915
5916 if (!caster || !caster->IsPlayer())
5917 return;
5918
5919 caster->ToPlayer()->SetViewpoint(target, apply);
5920}
void SetViewpoint(WorldObject *target, bool apply)
Definition Player.cpp:13143

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
5863{
5864 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5865 return;
5866
5867 if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
5868 return;
5869
5870 Unit* caster = GetCaster();
5871
5872 if (!caster || !caster->IsPlayer())
5873 return;
5874
5875 Player* plCaster = caster->ToPlayer();
5876
5877 // Item amount
5878 if (GetAmount() <= 0)
5879 return;
5880
5881 if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0)
5882 return;
5883
5884 //Adding items
5885 uint32 noSpaceForCount = 0;
5886 uint32 count = m_amount;
5887
5888 ItemPosCountVec dest;
5889 InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount);
5890 if (msg != EQUIP_ERR_OK)
5891 {
5892 count -= noSpaceForCount;
5893 plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellInfo()->Effects[m_effIndex].ItemType);
5894 if (count == 0)
5895 return;
5896 }
5897
5898 Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true);
5899 if (!newitem)
5900 {
5901 plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
5902 return;
5903 }
5904 plCaster->SendNewItem(newitem, count, true, true);
5905}
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:777
@ 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:1292

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:18585
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:18383

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
6011{
6013 return;
6014
6015 Unit* target = aurApp->GetTarget();
6016
6017 if (apply)
6019 else
6020 {
6021 if (target->HasAuraType(GetAuraType()))
6022 return;
6023
6025 }
6026}
@ 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:1738

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
5923{
5924 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5925 {
5926 return;
5927 }
5928
5929 Unit* caster = GetCaster();
5930 if (!caster || !caster->IsPlayer())
5931 {
5932 return;
5933 }
5934
5935 Player* player = caster->ToPlayer();
5936 if (apply)
5937 {
5939 }
5940 else
5941 {
5942 player->ResetFarSightDistance();
5943 }
5944
5945 caster->UpdateObjectVisibility(!apply);
5946}
void SetFarSightDistance(float radius)
Definition Player.cpp:16240
void ResetFarSightDistance()
Definition Player.cpp:16245
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2323

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:543
@ CURRENT_GENERIC_SPELL
Definition Unit.h:538
@ CURRENT_AUTOREPEAT_SPELL
Definition Unit.h:540
std::list< Unit * > UnitList
Definition Unit.h:76
Definition GridNotifiers.h:861
Definition Creature.h:43
bool IsDungeonBoss() const
Definition Creature.cpp:3176
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
5949{
5951 return;
5952
5953 Unit* target = aurApp->GetTarget();
5954
5955 if (!target->IsPlayer())
5956 return;
5957
5958 Player* player = target->ToPlayer();
5959
5960 uint32 faction_id = GetMiscValue();
5961 ReputationRank faction_rank = ReputationRank(m_amount);
5962
5963 player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply);
5965
5966 // stop fighting if at apply forced rank friendly or at remove real rank friendly
5967 if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
5968 player->StopAttackFaction(faction_id);
5969}
ReputationRank
Definition SharedDefines.h:179
@ REP_FRIENDLY
Definition SharedDefines.h:184
ReputationRank GetReputationRank(uint32 faction_id) const
Definition Player.cpp:5883
ReputationMgr & GetReputationMgr()
Definition Player.h:2135
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:20202

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
4983{
4985 return;
4986
4987 Unit* target = aurApp->GetTarget();
4988
4989 // Xinef: Do not apply such auras in normal way
4990 if (GetAmount() >= 1000)
4991 {
4992 target->SetInstantCast(apply);
4993 return;
4994 }
4995
4996 target->ApplyCastTimePercentMod((float)GetAmount(), apply);
4997}
void SetInstantCast(bool set)
Definition Unit.h:1518
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
5188{
5190 return;
5191
5192 Unit* target = aurApp->GetTarget();
5193
5194 // apply item specific bonuses for already equipped weapon
5195 if (target->IsPlayer())
5196 {
5197 for (int i = 0; i < MAX_ATTACK; ++i)
5198 if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
5199 target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply);
5200 }
5201
5202 // GetMiscValue() is bitmask of spell schools
5203 // 1 (0-bit) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)
5204 // 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wands
5205 // 127 - full bitmask any damages
5206 //
5207 // mods must be applied base at equipped weapon class and subclass comparison
5208 // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
5209 // GetMiscValue() comparison with item generated damage types
5210
5211 if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) != 0 && sScriptMgr->CanModAuraEffectDamageDone(this, target, aurApp, mode, apply))
5212 {
5213 // apply generic physical damage bonuses including wand case
5214 if (GetSpellInfo()->EquippedItemClass == -1 || !target->IsPlayer())
5215 {
5219
5220 if (target->IsPlayer())
5221 {
5222 if (GetAmount() > 0)
5224 else
5226 }
5227 }
5228 else
5229 {
5230 // done in Player::_ApplyWeaponDependentAuraMods
5231 }
5232 }
5233
5234 // Skip non magic case for Speedup
5236 return;
5237
5238 if (GetSpellInfo()->EquippedItemClass != -1 || GetSpellInfo()->EquippedItemInventoryTypeMask != 0)
5239 {
5240 // wand magic case (skip generic to all item spell bonuses)
5241 // done in Player::_ApplyWeaponDependentAuraMods
5242
5243 // Skip item specific requirements for not wand magic damage
5244 return;
5245 }
5246
5247 // Magic damage modifiers implemented in Unit::SpellDamageBonus
5248 // This information for client side use only
5249 if (target->IsPlayer())
5250 {
5251 if (GetAmount() > 0)
5252 {
5253 for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
5254 {
5255 if ((GetMiscValue() & (1 << i)) != 0)
5257 }
5258 }
5259 else
5260 {
5261 for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
5262 {
5263 if ((GetMiscValue() & (1 << i)) != 0)
5265 }
5266 }
5267 if (Guardian* pet = target->ToPlayer()->GetGuardianPet())
5268 pet->UpdateAttackPowerAndDamage();
5269 }
5270}
@ SPELL_SCHOOL_HOLY
Definition SharedDefines.h:284
@ SPELL_SCHOOL_MASK_MAGIC
Definition SharedDefines.h:312
@ UNIT_MOD_DAMAGE_OFFHAND
Definition Unit.h:166
@ UNIT_MOD_DAMAGE_RANGED
Definition Unit.h:167
@ UNIT_MOD_DAMAGE_MAINHAND
Definition Unit.h:165
@ 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:7063

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
5273{
5275 return;
5276
5277 Unit* target = aurApp->GetTarget();
5278 if (!target)
5279 return;
5280
5281 if (!sScriptMgr->CanModAuraEffectModDamagePercentDone(this, target, aurApp, mode, apply))
5282 return;
5283
5284 if (target->IsPlayer())
5285 {
5286 for (int i = 0; i < MAX_ATTACK; ++i)
5287 if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
5288 target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
5289 }
5290
5291 if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || !target->IsPlayer()))
5292 {
5296
5297 if (target->IsPlayer())
5299 }
5300 else
5301 {
5302 // done in Player::_ApplyWeaponDependentAuraMods for SPELL_SCHOOL_MASK_NORMAL && EquippedItemClass != -1 and also for wand case
5303 }
5304}
@ 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
4546{
4548 return;
4549
4550 Unit* target = aurApp->GetTarget();
4551
4552 if (!target->IsPlayer())
4553 return;
4554 // implemented in Unit::SpellHealingBonus
4555 // this information is for client side only
4557}
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
4898{
4900 return;
4901
4902 Unit* target = aurApp->GetTarget();
4903
4904 if (target->IsPlayer())
4905 {
4906 target->ToPlayer()->UpdateMeleeHitChances();
4907 target->ToPlayer()->UpdateRangedHitChances();
4908 }
4909 else
4910 {
4911 target->m_modMeleeHitChance += (apply) ? GetAmount() : (-GetAmount());
4912 target->m_modRangedHitChance += (apply) ? GetAmount() : (-GetAmount());
4913 }
4914}
void UpdateMeleeHitChances()
Definition StatSystem.cpp:853
void UpdateRangedHitChances()
Definition StatSystem.cpp:859
float m_modRangedHitChance
Definition Unit.h:2005
float m_modMeleeHitChance
Definition Unit.h:2004

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:2033
ObjectGuid GetOwnerGUID() const
Definition Unit.h:684
bool HasInvisibilityAura() const
Definition Unit.h:1764
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:1765
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
4681{
4683 return;
4684
4685 Unit* target = aurApp->GetTarget();
4686
4687 if (!target->IsPlayer())
4688 return;
4689
4690 //Note: an increase in regen does NOT cause threat.
4691 target->ToPlayer()->UpdateManaRegen();
4692}
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
4130{
4131 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4132 return;
4133
4134 Unit* target = aurApp->GetTarget();
4135 uint32 mechanic = 0;
4136
4137 switch (GetId())
4138 {
4139 case 46924: // BladeStorm
4141 break;
4142 case 34471: // The Beast Within
4143 case 19574: // Bestial Wrath
4144 case 38484: // Bestial Wrath
4145 case 40081: // Free friend (Black Temple)
4163 break;
4164 case 42292: // PvP trinket
4165 case 59752: // Every Man for Himself
4166 case 65547: // PvP trinket for Faction Champions (ToC 25)
4167 case 53490: // Bullheaded
4168 case 46227: // Medalion of Immunity
4170 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.
4171 // Actually we should apply immunities here, too, but the aura has only 100 ms duration, so there is practically no point
4172 break;
4173 case 54508: // Demonic Empowerment
4174 mechanic = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
4179 break;
4180 default:
4181 if (GetMiscValue() < 1)
4182 return;
4183 mechanic = 1 << GetMiscValue();
4185 break;
4186 }
4187
4188 if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
4189 {
4190 // Xinef: exception for purely snare mechanic (eg. hands of freedom)!
4191 if (mechanic == (1 << MECHANIC_SNARE))
4192 target->RemoveMovementImpairingAuras(false);
4193 else
4195 }
4196}
@ 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
4462{
4464 return;
4465
4466 Unit* target = aurApp->GetTarget();
4467
4468 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4469 {
4470 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4471 return;
4472 }
4473
4474 // only players currently use base stats
4475 if (!target->IsPlayer())
4476 return;
4477
4478 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
4479 {
4480 if (GetMiscValue() == i || GetMiscValue() == -1)
4481 target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_amount), apply);
4482 }
4483}

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:555
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:9509
Pet * ToPet()
Definition Unit.h:700
CharmInfo * GetCharmInfo()
Definition Unit.h:1222
Unit * GetVictim() const
Definition Unit.h:862
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
5349{
5351 return;
5352
5353 Unit* target = aurApp->GetTarget();
5354
5355 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5356 if (GetMiscValue() & (1 << i))
5358}
@ 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
5336{
5338 return;
5339
5340 Unit* target = aurApp->GetTarget();
5341
5342 float amount = CalculatePct(1.0f, GetAmount());
5343 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5344 if (GetMiscValue() & (1 << i))
5346}
@ 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
4656{
4658 return;
4659
4660 Unit* target = aurApp->GetTarget();
4661
4662 if (!target->IsPlayer())
4663 return;
4664
4665 // Update manaregen value
4666 if (GetMiscValue() == POWER_MANA)
4667 target->ToPlayer()->UpdateManaRegen();
4668 else if (GetMiscValue() == POWER_ENERGY)
4669 target->ToPlayer()->UpdateEnergyRegen();
4670 else if (GetMiscValue() == POWER_RUNE)
4672 // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate
4673}
@ 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
4676{
4677 HandleModPowerRegen(aurApp, mode, apply);
4678}
void HandleModPowerRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4655

References HandleModPowerRegen().

◆ HandleModRating()

void AuraEffect::HandleModRating ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5074{
5076 return;
5077
5078 Unit* target = aurApp->GetTarget();
5079
5080 if (!target->IsPlayer())
5081 return;
5082
5083 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5084 if (GetMiscValue() & (1 << rating))
5085 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), GetAmount(), apply);
5086}
#define MAX_COMBAT_RATING
Definition Unit.h:244
CombatRating
Definition Unit.h:216
void ApplyRatingMod(CombatRating cr, int32 value, bool apply)
Definition Player.cpp:5267

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
5089{
5091 return;
5092
5093 Unit* target = aurApp->GetTarget();
5094
5095 if (!target->IsPlayer())
5096 return;
5097
5098 // Just recalculate ratings
5099 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5100 if (GetMiscValue() & (1 << rating))
5101 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), 0, apply);
5102}

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
4378{
4380 return;
4381
4382 Unit* target = aurApp->GetTarget();
4383
4384 for (int8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
4385 {
4386 if (GetMiscValue() & int32(1 << i))
4387 {
4389 if (target->IsPlayer() || target->IsPet())
4390 {
4391 target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, (float)GetAmount(), apply);
4392 target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, (float)GetAmount(), apply);
4393 }
4394 }
4395 }
4396}
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
Definition Unit.h:1143

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
4943{
4945 return;
4946
4947 Unit* target = aurApp->GetTarget();
4948
4949 if (!target->IsPlayer())
4950 return;
4951
4952 for (int school = SPELL_SCHOOL_NORMAL; school < MAX_SPELL_SCHOOL; ++school)
4953 if (GetMiscValue() & (1 << school))
4954 target->ToPlayer()->UpdateSpellCritChance(school);
4955}
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
4516{
4518 return;
4519
4520 Unit* target = aurApp->GetTarget();
4521
4522 if (!target->IsPlayer())
4523 return;
4524
4525 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4526 // This information for client side use only
4527 // Recalculate bonus
4529}

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
4486{
4488 return;
4489
4490 Unit* target = aurApp->GetTarget();
4491
4492 if (!target->IsPlayer())
4493 return;
4494
4495 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4496 // This information for client side use only
4497 // Recalculate bonus
4499}

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
4532{
4534 return;
4535
4536 Unit* target = aurApp->GetTarget();
4537
4538 if (!target->IsPlayer())
4539 return;
4540
4541 // Recalculate bonus
4543}

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
4502{
4504 return;
4505
4506 Unit* target = aurApp->GetTarget();
4507
4508 if (!target->IsPlayer())
4509 return;
4510
4511 // Recalculate bonus
4513}

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
4917{
4919 return;
4920
4921 Unit* target = aurApp->GetTarget();
4922
4923 if (target->IsPlayer())
4924 target->ToPlayer()->UpdateSpellHitChances();
4925 else
4926 target->m_modSpellHitChance += (apply) ? GetAmount() : (-GetAmount());
4927}
void UpdateSpellHitChances()
Definition StatSystem.cpp:865
float m_modSpellHitChance
Definition Unit.h:2006

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
3816{
3817 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3818 return;
3819
3820 Unit* target = aurApp->GetTarget();
3821 std::list <AuraType> aura_immunity_list;
3822 uint32 mechanic_immunity_list = 0;
3823 int32 miscVal = GetMiscValue();
3824
3825 switch (miscVal)
3826 {
3827 case 96:
3828 case 1615:
3829 {
3830 if (!GetAmount())
3831 {
3832 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3833 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3834 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3835 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3837 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3838
3851 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
3852 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3853 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3854 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3855 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3856 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3857 }
3858 break;
3859 }
3860 case 679:
3861 {
3862 if (GetId() == 57742)
3863 {
3864 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3865 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3866 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3867 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3869 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3870
3883 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3884 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3885 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3886 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3887 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3888 }
3889 break;
3890 }
3891 case 1557:
3892 {
3893 if (GetId() == 64187)
3894 {
3895 mechanic_immunity_list = (1 << MECHANIC_STUN);
3897 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3898 }
3899 else
3900 {
3901 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3902 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3903 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3904 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3906 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3907
3920 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3921 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3922 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3923 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3924 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3925 }
3926 break;
3927 }
3928 case 1614:
3929 case 1694:
3930 {
3932 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
3933 break;
3934 }
3935 case 1630:
3936 {
3937 if (!GetAmount())
3938 {
3940 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
3941 }
3942 else
3943 {
3944 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3945 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3946 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3947 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3949 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3950
3963 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3964 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3965 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3966 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3967 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3968 }
3969 break;
3970 }
3971 case 477:
3972 case 1733:
3973 case 1632:
3974 {
3975 if (!GetAmount())
3976 {
3977 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3978 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3979 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3980 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3982 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH);
3983
3999 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4000
4001 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4002 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4003 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4004 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4005 }
4006 break;
4007 }
4008 case 878:
4009 {
4010 if (GetAmount() == 1)
4011 {
4012 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
4013 | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
4014
4019 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4020 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4021 }
4022 break;
4023 }
4024 default:
4025 break;
4026 }
4027
4028 if (aura_immunity_list.empty())
4029 {
4030 // Roots, OK
4031 if (GetMiscValue() & (1 << 0))
4032 {
4033 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4034
4036 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4037 }
4038 // Taunt, OK
4039 if (GetMiscValue() & (1 << 1))
4040 {
4041 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
4042 }
4043 // Crowd-Control auras?
4044 if (GetMiscValue() & (1 << 2))
4045 {
4046 mechanic_immunity_list = (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED);
4047
4050 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4051 }
4052 // Interrupt, OK
4053 if (GetMiscValue() & (1 << 3))
4054 {
4055 mechanic_immunity_list = (1 << MECHANIC_INTERRUPT);
4056
4058 }
4059 // Transform?
4060 if (GetMiscValue() & (1 << 4))
4061 {
4062 aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
4063 }
4064 // Stun auras breakable by damage (Incapacitate effects), OK
4065 if (GetMiscValue() & (1 << 5))
4066 {
4067 mechanic_immunity_list = (1 << MECHANIC_KNOCKOUT);
4068
4070 }
4071 // // Slowing effects
4072 if (GetMiscValue() & (1 << 6))
4073 {
4074 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4075
4077 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4078 }
4079 // Charm auras?, 90%
4080 if ((GetMiscValue() & (1 << 7)))
4081 {
4082 mechanic_immunity_list = (1 << MECHANIC_CHARM);
4083
4085 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
4086 aura_immunity_list.push_back(SPELL_AURA_MOD_POSSESS);
4087 }
4088 // UNK
4089 // if ((GetMiscValue() & (1 << 8)))
4090 // {
4091 // }
4092 // Fear, OK
4093 if (GetMiscValue() & (1 << 9))
4094 {
4095 mechanic_immunity_list = (1 << MECHANIC_FEAR);
4096
4098 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4099 }
4100 // Stuns, OK
4101 if (GetMiscValue() & (1 << 10))
4102 {
4103 mechanic_immunity_list = (1 << MECHANIC_STUN);
4104
4106 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4107 }
4108 }
4109
4110 // apply immunities
4111 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4112 target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply);
4113
4114 // Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated.
4115 if (GetId() == 46924)
4116 {
4117 // Knockback and hex
4119 }
4120
4122 {
4123 target->RemoveAurasWithMechanic(mechanic_immunity_list, AURA_REMOVE_BY_DEFAULT, GetId());
4124 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4125 target->RemoveAurasByType(*iter);
4126 }
4127}
@ 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:1762
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1708
void SetStandFlags(uint8 flags)
Definition Unit.h:1707
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:1763
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
4414{
4416 return;
4417
4418 Unit* target = aurApp->GetTarget();
4419
4420 // applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
4421
4422 // show armor penetration
4423 if (target->IsPlayer() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
4425
4426 // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
4429}
@ 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:2009

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

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

◆ HandleNoReagentUseAura()

void AuraEffect::HandleNoReagentUseAura ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5379{
5380 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5381 return;
5382
5383 Unit* target = aurApp->GetTarget();
5384
5385 if (!target->IsPlayer())
5386 return;
5387
5388 flag96 mask;
5390 for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
5391 mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
5392
5393 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1, mask[0]);
5394 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 1, mask[1]);
5395 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 2, mask[2]);
5396}
@ 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
155 {
156 // not implemented
157 }

◆ HandleObsModPowerAuraTick()

void AuraEffect::HandleObsModPowerAuraTick ( Unit target,
Unit caster 
) const
7117{
7119 if (GetMiscValue() == POWER_ALL)
7120 PowerType = target->getPowerType();
7121 else
7123
7124 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7125 return;
7126
7127 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7128 {
7129 SendTickImmune(target, caster);
7130 return;
7131 }
7132
7133 // don't regen when permanent aura target has full power
7134 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7135 return;
7136
7137 // ignore negative values (can be result apply spellmods to aura damage
7138 uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(PowerType) / 100;
7139 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7140 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7141 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7142 target->SendPeriodicAuraLog(&pInfo);
7143
7144 int32 gain = target->ModifyPower(PowerType, amount);
7145
7146 if (caster)
7147 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7148}
#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:1073
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:6445
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250
Definition Unit.h:512

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
6599{
6600 if (!target->IsAlive())
6601 return;
6602
6603 if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamageOrSchool(GetSpellInfo()) || target->IsTotem())
6604 {
6605 SendTickImmune(target, caster);
6606 return;
6607 }
6608
6609 // Consecrate ticks can miss and will not show up in the combat log
6610 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6611 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6612 return;
6613
6614 // some auras remove at specific health level or more
6616 {
6617 switch (GetSpellInfo()->Id)
6618 {
6619 case 43093:
6620 case 31956:
6621 case 38801: // Grievous Wound
6622 case 35321:
6623 case 38363:
6624 case 39215: // Gushing Wound
6625 if (target->IsFullHealth())
6626 {
6627 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6628 return;
6629 }
6630 break;
6631 case 38772: // Grievous Wound
6632 {
6633 uint32 percent = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster);
6634 if (!target->HealthBelowPct(percent))
6635 {
6636 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6637 return;
6638 }
6639 break;
6640 }
6641 }
6642 }
6643
6645
6646 // ignore non positive values (can be result apply spellmods to aura damage
6647 uint32 damage = std::max(GetAmount(), 0);
6648
6649 // If the damage is percent-max-health based, calculate damage before the Modify hook
6651 {
6652 // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
6653 damage = uint32(std::ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
6654 }
6655
6656 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6657 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6658
6659 if (target->GetAI())
6660 {
6661 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6662 }
6663
6665 {
6666 // xinef: leave only target depending bonuses, rest is handled in calculate amount
6667 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE && caster)
6668 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6669 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6670
6671 // Calculate armor mitigation
6673 {
6674 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6675 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6676 damage = damageReductedArmor;
6677 }
6678
6679 // Curse of Agony damage-per-tick calculation
6680 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[0] & 0x400) && GetSpellInfo()->SpellIconID == 544)
6681 {
6682 uint32 totalTick = GetTotalTicks();
6683 // 1..4 ticks, 1/2 from normal tick damage
6684 if (m_tickNumber <= totalTick / 3)
6685 damage = damage / 2;
6686 // 9..12 ticks, 3/2 from normal tick damage
6687 else if (m_tickNumber > totalTick * 2 / 3)
6688 damage += (damage + 1) / 2; // +1 prevent 0.5 damage possible lost at 1..4 ticks
6689 // 5..8 ticks have normal tick damage
6690 }
6691 }
6692
6693 // calculate crit chance
6694 bool crit = false;
6695 if ((crit = roll_chance_f(GetCritChance())))
6696 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6697
6698 // Auras reducing damage from AOE spells
6700 {
6701 if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() ||
6702 GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() ||
6703 GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || // some persistent area auras have targets like A=53 B=28
6706 {
6707 bool npcCaster = (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
6708 damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, npcCaster);
6709 }
6710 }
6711
6712 int32 dmg = damage;
6713 int32 mitigatedDamage = cleanDamage.mitigated_damage;
6714 if (CanApplyResilience())
6715 {
6716 int32 resilienceReduction = dmg;
6717 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6718
6719 resilienceReduction = dmg - resilienceReduction;
6720 dmg -= resilienceReduction;
6721 mitigatedDamage += resilienceReduction;
6722 }
6723
6724 damage = std::max(0, dmg);
6725 cleanDamage.mitigated_damage = std::max(0, mitigatedDamage);
6726
6727 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6728 Unit::CalcAbsorbResist(dmgInfo);
6729
6730 uint32 absorb = dmgInfo.GetAbsorb();
6731 uint32 resist = dmgInfo.GetResist();
6732 damage = dmgInfo.GetDamage();
6733
6734 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} attacked {} for {} dmg inflicted by {} abs is {}",
6735 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6736 Unit::DealDamageMods(target, damage, &absorb);
6737
6738 // Set trigger flag
6739 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6740 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6742 if (absorb > 0)
6743 procEx |= PROC_EX_ABSORB;
6744
6745 if (damage)
6746 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6747
6748 int32 overkill = damage - target->GetHealth();
6749 if (overkill < 0)
6750 overkill = 0;
6751
6752 SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit);
6753 target->SendPeriodicAuraLog(&pInfo);
6754
6755 Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
6756
6757 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6758}
bool roll_chance_f(float chance)
Definition Random.h:54
@ 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:3533
@ 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:233
@ MELEE_HIT_NORMAL
Definition Unit.h:286
bool CanApplyResilience() const
Definition SpellAuraEffects.h:111
float GetCritChance() const
Definition SpellAuraEffects.h:108
int32 GetTotalTicks() const
Definition SpellAuraEffects.cpp:7382
uint8 GetCasterLevel() const
Definition SpellAuraEffects.h:110
Definition Unit.h:330
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:383
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:20427
bool IsFullHealth() const
Definition Unit.h:1051
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:1053
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:18960
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:664
bool IsControlledByPlayer() const
Definition Unit.h:1248
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:315
uint32 mitigated_damage
Definition Unit.h:320

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

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
7151{
7153
7155 return;
7156
7157 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7158 return;
7159
7160 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7161 {
7162 SendTickImmune(target, caster);
7163 return;
7164 }
7165
7166 // don't regen when permanent aura target has full power
7167 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7168 return;
7169
7170 // ignore negative values (can be result apply spellmods to aura damage
7171 int32 amount = std::max(m_amount, 0);
7172
7173 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7174 target->SendPeriodicAuraLog(&pInfo);
7175
7176 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7177 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7178 int32 gain = target->ModifyPower(PowerType, amount);
7179
7180 if (caster)
7181 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7182}
@ 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
6896{
6897 if (!target->IsAlive())
6898 return;
6899
6900 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6901 {
6902 SendTickImmune(target, caster);
6903 return;
6904 }
6905
6906 // heal for caster damage (must be alive)
6907 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST) && (!caster || !caster->IsAlive()))
6908 return;
6909
6910 // don't regen when permanent aura target has full power
6911 if (GetBase()->IsPermanent() && target->IsFullHealth())
6912 return;
6913
6914 // ignore negative values (can be result apply spellmods to aura damage
6915 int32 damage = std::max(m_amount, 0);
6916
6918 {
6919 // Taken mods
6920 float TakenTotalMod = 1.0f;
6921
6922 // Tenacity increase healing % taken
6923 if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0))
6924 AddPct(TakenTotalMod, Tenacity->GetAmount());
6925
6926 // Healing taken percent
6927 float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6928 if (minval)
6929 AddPct(TakenTotalMod, minval);
6930
6931 float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6932 if (maxval)
6933 AddPct(TakenTotalMod, maxval);
6934
6935 // Healing over time taken percent
6936 float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6937 if (minval_hot)
6938 AddPct(TakenTotalMod, minval_hot);
6939
6940 float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6941 if (maxval_hot)
6942 AddPct(TakenTotalMod, maxval_hot);
6943
6944 // Arena / BG Dampening
6945 float minval_pct = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
6946 if (minval_pct)
6947 AddPct(TakenTotalMod, minval_pct);
6948
6949 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
6950
6951 // the most ugly hack i made :P the other option is to change all spellvalues to float...
6952 // demonic aegis
6953 if (caster && GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[1] & 0x20000000))
6955 AddPct(TakenTotalMod, aurEff->GetAmount());
6956
6957 damage = uint32(target->CountPctFromMaxHealth(damage));
6958 damage = uint32(damage * TakenTotalMod);
6959 }
6960 else
6961 {
6962 // Wild Growth = amount + (6 - 2*doneTicks) * ticks* amount / 100
6963 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellInfo()->SpellIconID == 2864)
6964 {
6965 uint32 tickNumber = GetTickNumber() - 1;
6966 int32 tempAmount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
6967
6968 float drop = 2.0f;
6969
6970 // Item - Druid T10 Restoration 2P Bonus
6971 if (caster)
6972 if (AuraEffect* aurEff = caster->GetAuraEffect(70658, 0))
6973 AddPct(drop, -aurEff->GetAmount());
6974
6975 damage += GetTotalTicks() * tempAmount * (6 - (drop * tickNumber)) * 0.01f;
6976 }
6977
6978 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6979 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6980 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6981 }
6982
6983 bool crit = false;
6984 if ((crit = roll_chance_f(GetCritChance())))
6985 damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target);
6986
6987 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} heal of {} for {} health inflicted by {}",
6988 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId());
6989
6990 uint32 heal = uint32(damage);
6991
6992 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6993 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal, GetSpellInfo());
6994 sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
6995
6996 if (target->GetAI())
6997 {
6998 target->GetAI()->OnCalculatePeriodicTickReceived(heal, caster);
6999 }
7000
7001 HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
7002 Unit::CalcHealAbsorb(healInfo);
7003 int32 gain = Unit::DealHeal(caster, target, healInfo.GetHeal());
7004 healInfo.SetEffectiveHeal(gain);
7005
7006 SpellPeriodicAuraLogInfo pInfo(this, healInfo.GetHeal(), healInfo.GetHeal() - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit);
7007 target->SendPeriodicAuraLog(&pInfo);
7008
7009 if (caster)
7010 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7011
7012 bool haveCastItem = GetBase()->GetCastItemGUID();
7013
7014 // Health Funnel
7015 // damage caster for heal amount
7016 // xinef: caster is available, checked earlier
7017 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST))
7018 {
7019 uint32 manaPerSecond = GetSpellInfo()->ManaPerSecond;
7020 if ((int32)manaPerSecond > gain && gain > 0)
7021 {
7022 manaPerSecond = gain;
7023 }
7024
7025 uint32 absorb2 = 0;
7026 Unit::DealDamageMods(caster, manaPerSecond, &absorb2);
7027
7029 Unit::DealDamage(caster, caster, manaPerSecond, &cleanDamage, SELF_DAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
7030 }
7031
7032 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
7033 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
7035 if (healInfo.GetAbsorb() > 0)
7036 procEx |= PROC_EX_ABSORB;
7037
7038 // ignore item heals
7039 if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH) // xinef: dont allow obs_mod_health to proc spells, this is passive regeneration and not hot
7040 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo);
7041}
@ SPELL_ATTR2_NO_TARGET_PER_SECOND_COST
Definition SharedDefines.h:467
@ 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:253
uint32 GetTickNumber() const
Definition SpellAuraEffects.h:87
AuraObjectType GetType() const
Definition SpellAuras.cpp:481
ObjectGuid GetCastItemGUID() const
Definition SpellAuras.h:103
Definition Unit.h:373
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(), 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::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
6867{
6868 if (!caster || !caster->IsAlive() || !target->IsAlive())
6869 return;
6870
6871 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6872 {
6873 SendTickImmune(target, caster);
6874 return;
6875 }
6876
6877 uint32 damage = std::max(GetAmount(), 0);
6878 // do not kill health donator
6879 if (caster->GetHealth() < damage)
6880 damage = caster->GetHealth() - 1;
6881 if (!damage)
6882 return;
6883
6884 caster->ModifyHealth(-(int32)damage);
6885 LOG_DEBUG("spells.aura", "PeriodicTick: donator {} target {} damage {}.", caster->GetEntry(), target->GetEntry(), damage);
6886
6887 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6888
6889 damage = int32(damage * gainMultiplier);
6890
6891 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6892 caster->HealBySpell(healInfo);
6893}
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
6761{
6762 if (!target->IsAlive())
6763 return;
6764
6766 {
6767 SendTickImmune(target, caster);
6768 return;
6769 }
6770
6771 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6772 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6773 return;
6774
6776
6777 uint32 damage = std::max(GetAmount(), 0);
6778
6779 // Script Hook For HandlePeriodicHealthLeechAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6780 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6781
6782 if (target->GetAI())
6783 {
6784 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6785 }
6786
6787 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6788 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6789 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6790
6791 bool crit = false;
6792 if ((crit = roll_chance_f(GetCritChance())))
6793 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6794
6795 // Calculate armor mitigation
6797 {
6798 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6799 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6800 damage = damageReductedArmor;
6801 }
6802
6803 int32 dmg = damage;
6804 int32 cleanDamageAmount = cleanDamage.mitigated_damage;
6805 if (CanApplyResilience())
6806 {
6807 int32 resilienceReduction = dmg;
6808 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6809
6810 resilienceReduction = dmg - resilienceReduction;
6811 dmg -= resilienceReduction;
6812 cleanDamageAmount += resilienceReduction;
6813 }
6814
6815 damage = std::max(0, dmg);
6816 cleanDamage.mitigated_damage = std::max(0, cleanDamageAmount);
6817
6818 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6819 Unit::CalcAbsorbResist(dmgInfo);
6820
6821 uint32 absorb = dmgInfo.GetAbsorb();
6822 uint32 resist = dmgInfo.GetResist();
6823 damage = dmgInfo.GetDamage();
6824
6825 // Set trigger flag
6826 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6827 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6829 if (absorb > 0)
6830 procEx |= PROC_EX_ABSORB;
6831
6832 if (dmgInfo.GetDamage())
6833 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6834
6835 if (target->GetHealth() < dmgInfo.GetDamage())
6836 {
6837 dmgInfo.ModifyDamage(dmgInfo.GetDamage() - target->GetHealth());
6838 }
6839
6840 damage = dmgInfo.GetDamage();
6841
6842 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} health leech of {} for {} dmg inflicted by {} abs is {}",
6843 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6844 if (caster)
6845 caster->SendSpellNonMeleeDamageLog(target, GetSpellInfo(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
6846
6847 int32 new_damage;
6848
6849 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
6850
6851 Unit::ProcDamageAndSpell(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6852
6853 if (!caster || !caster->IsAlive())
6854 return;
6855
6856 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6857
6858 uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount()));
6859 heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
6860
6861 HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6862 int32 gain = caster->HealBySpell(healInfo);
6863 caster->getHostileRefMgr().threatAssist(caster, gain * 0.5f, GetSpellInfo());
6864}
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:6366

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

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

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

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
6192{
6193 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6194 return;
6195
6196 if (!aurApp->GetTarget()->IsPlayer())
6197 return;
6198
6199 if (apply)
6200 aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6201 else if (!aurApp->GetTarget()->GetMap()->Instanceable())
6202 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6203}
@ 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:7289
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7248
void HandleProcTriggerDamageAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7269
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7337
void HandleProcTriggerSpellAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
Definition SpellAuraEffects.cpp:7231
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 
)
7270{
7271 Unit* target = aurApp->GetTarget();
7272 Unit* triggerTarget = eventInfo.GetProcTarget();
7273 if (triggerTarget->HasUnitState(UNIT_STATE_ISOLATED) || triggerTarget->IsImmunedToDamageOrSchool(GetSpellInfo()))
7274 {
7275 SendTickImmune(triggerTarget, target);
7276 return;
7277 }
7278
7279 SpellNonMeleeDamage damageInfo(target, triggerTarget, GetSpellInfo(), GetSpellInfo()->SchoolMask);
7280 uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE, GetEffIndex());
7281 damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
7282 target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo());
7283 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
7284 target->SendSpellNonMeleeDamageLog(&damageInfo);
7285 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering {} spell damage from aura {} proc", damage, GetId());
7286 target->DealSpellDamage(&damageInfo, true);
7287}
Unit * GetProcTarget() const
Definition Unit.h:441

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

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

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 
)
7290{
7291 Unit* target = aurApp->GetTarget();
7292
7293 uint32 triggerSpellId;
7294 switch (GetId())
7295 {
7296 case 57949: // Shiver
7297 triggerSpellId = 57952;
7298 //animationSpellId = 57951; dummy effects for jump spell have unknown use (see also 41637)
7299 break;
7300 case 59978: // Shiver
7301 triggerSpellId = 59979;
7302 break;
7303 case 43593: // Cold Stare
7304 triggerSpellId = 43594;
7305 break;
7306 default:
7307 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: {}", GetId());
7308 return;
7309 }
7310
7311 int32 jumps = GetBase()->GetCharges();
7312
7313 // current aura expire on proc finish
7314 GetBase()->SetCharges(0);
7315 GetBase()->SetUsingCharges(true);
7316
7317 // next target selection
7318 if (jumps > 0)
7319 {
7320 if (Unit* caster = GetCaster())
7321 {
7322 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7323
7324 if (Unit* triggerTarget = target->GetNextRandomRaidMemberOrPet(radius))
7325 {
7326 target->CastSpell(triggerTarget, GetSpellInfo(), true, nullptr, this, GetCasterGUID());
7327 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7328 aura->SetCharges(jumps);
7329 }
7330 }
7331 }
7332
7333 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7334 target->CastSpell(target, triggerSpellId, true, nullptr, this, GetCasterGUID());
7335}
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 
)
7338{
7339 Unit* target = aurApp->GetTarget();
7340
7341 // Currently only Prayer of Mending
7342 if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20))
7343 {
7344 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: {}", GetId());
7345 return;
7346 }
7347 uint32 triggerSpellId = 33110;
7348
7349 int32 value = GetAmount();
7350
7351 int32 jumps = GetBase()->GetCharges();
7352
7353 // current aura expire on proc finish
7354 GetBase()->SetCharges(0);
7355 GetBase()->SetUsingCharges(true);
7356
7357 // next target selection
7358 if (jumps > 0)
7359 {
7360 if (Unit* caster = GetCaster())
7361 {
7362 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7363
7364 Unit* triggerTarget = nullptr;
7365 Acore::MostHPMissingGroupInRange u_check(target, radius, 0);
7366 Acore::UnitLastSearcher<Acore::MostHPMissingGroupInRange> searcher(target, triggerTarget, u_check);
7367 Cell::VisitAllObjects(target, searcher, radius);
7368
7369 if (triggerTarget)
7370 {
7371 target->CastCustomSpell(triggerTarget, GetId(), &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7372 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7373 aura->SetCharges(jumps);
7374 }
7375 }
7376 }
7377
7378 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7379 target->CastCustomSpell(target, triggerSpellId, &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7380}
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
5057{
5059 return;
5060
5061 Unit* target = aurApp->GetTarget();
5062
5063 if (!target->IsPlayer())
5064 return;
5065
5066 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5067}

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:1775
bool HasTalent(uint32 spell_id, uint8 spec) const
Definition Player.cpp:3885
void RemoveSpellCooldown(uint32 spell_id, bool update=false)
Definition Player.cpp:3523
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
5317{
5319 return;
5320
5321 Unit* target = aurApp->GetTarget();
5322
5323 BaseModType modType = FLAT_MOD;
5325 modType = PCT_MOD;
5326
5327 if (target->IsPlayer())
5328 target->ToPlayer()->HandleBaseModValue(SHIELD_BLOCK_VALUE, modType, float(GetAmount()), apply);
5329}
@ SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
Definition SpellAuraDefines.h:213
BaseModType
Definition Unit.h:188
@ PCT_MOD
Definition Unit.h:190
@ SHIELD_BLOCK_VALUE
Definition Unit.h:183

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:2064
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
159 {
160 // useless
161 }

◆ 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:7184
void HandlePeriodicManaLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7043
void HandleObsModPowerAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7116
void HandlePeriodicHealthFunnelAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6866
void HandlePeriodicHealAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6895
void HandlePeriodicEnergizeAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:7150
void HandlePeriodicTriggerSpellAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6296
void HandlePeriodicDummyAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6205
void HandlePeriodicHealthLeechAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6760
void HandlePeriodicDamageAurasTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6598
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:6564
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:20556
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
118{ m_isAuraEnabled = enabled; }

References m_isAuraEnabled.

Referenced by AuraApplication::_HandleEffect().

◆ SetOldAmount()

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

References m_oldAmount.

Referenced by CalculateAmount().

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

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: