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

#include "SpellAuraEffects.h"

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

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

References m_channelData, and m_spellmod.

◆ AuraEffect()

AuraEffect::AuraEffect ( Aura base,
uint8  effIndex,
int32 baseAmount,
Unit caster 
)
explicitprivate
384 :
385 m_base(base), m_spellInfo(base->GetSpellInfo()),
386 m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_dieSides(m_spellInfo->Effects[effIndex].DieSides),
387 m_critChance(0), m_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
398
399 // Xinef: channel data structure
400 if (caster)
401 if (Spell* spell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
402 m_channelData = new ChannelTargetData(caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : nullptr);
403}
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:557
@ UNIT_FIELD_CHANNEL_OBJECT
Definition UpdateFields.h:93
int32 m_periodicTimer
Definition SpellAuraEffects.h:140
bool m_canBeRecalculated
Definition SpellAuraEffects.h:145
uint8 const m_effIndex
Definition SpellAuraEffects.h:144
uint8 m_casterLevel
Definition SpellAuraEffects.h:128
bool m_applyResilience
Definition SpellAuraEffects.h:127
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition SpellAuraEffects.cpp:599
void CalculateSpellMod()
Definition SpellAuraEffects.cpp:690
int32 m_oldAmount
Definition SpellAuraEffects.h:133
int32 CalculateAmount(Unit *caster)
Definition SpellAuraEffects.cpp:452
int32 m_amount
Definition SpellAuraEffects.h:129
void CalculatePeriodicData()
Definition SpellAuraEffects.cpp:584
uint32 m_tickNumber
Definition SpellAuraEffects.h:142
int32 const m_baseAmount
Definition SpellAuraEffects.h:124
SpellInfo const *const m_spellInfo
Definition SpellAuraEffects.h:123
bool m_isAuraEnabled
Definition SpellAuraEffects.h:134
bool m_isPeriodic
Definition SpellAuraEffects.h:146
int32 const m_dieSides
Definition SpellAuraEffects.h:125
float m_critChance
Definition SpellAuraEffects.h:130
Aura *const m_base
Definition SpellAuraEffects.h:121
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:100
ObjectGuid GetGuidValue(uint16 index) const
Definition Object.cpp:326
Definition Spell.h:289
bool CanApplyResilience() const
Definition Unit.h:1166
uint8 GetLevel() const
Definition Unit.h:1098
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1571
Definition Spell.h:245

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

Member Function Documentation

◆ ApplySpellMod()

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

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

Referenced by HandleEffect().

◆ CalcPeriodicCritChance()

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

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

Referenced by CalculatePeriodicData().

◆ CalculateAmount()

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

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

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

◆ CalculatePeriodic()

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

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

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

◆ CalculatePeriodicData()

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

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

Referenced by AuraEffect().

◆ CalculateSpellMod()

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

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

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

◆ CanApplyResilience()

bool AuraEffect::CanApplyResilience ( ) const
inline

◆ CanBeRecalculated()

bool AuraEffect::CanBeRecalculated ( ) const
inline

◆ ChangeAmount()

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

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

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

◆ CheckEffectProc()

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

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

◆ CleanupTriggeredSpells()

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

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

Referenced by AuraApplication::_HandleEffect().

◆ GetAmount()

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

References m_amount, and m_isAuraEnabled.

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

◆ GetAmplitude()

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

References m_amplitude.

Referenced by spell_igb_rocket_pack_aura::HandleRemove().

◆ GetApplicationList()

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

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

Referenced by ChangeAmount(), and Update().

◆ GetAuraType()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

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

◆ GetBase()

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

References m_base.

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

◆ GetBaseAmount()

◆ GetCaster()

◆ GetCasterGUID()

◆ GetCasterLevel()

uint8 AuraEffect::GetCasterLevel ( ) const
inline

◆ GetCritChance()

float AuraEffect::GetCritChance ( ) const
inline

◆ GetDieSides()

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

References m_dieSides.

Referenced by spell_warl_demonic_knowledge::CalculateAmount().

◆ GetEffIndex()

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

References m_effIndex.

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

◆ GetForcedAmount()

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

References m_amount.

◆ GetId()

◆ GetMiscValue()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by ApplySpellMod(), Unit::CalcAbsorbResist(), Unit::CalcArmorReducedDamage(), CalculateSpellMod(), CheckEffectProc(), Unit::GetMaxNegativeAuraModifierByMiscMask(), Unit::GetMaxNegativeAuraModifierByMiscValue(), Unit::GetMaxPositiveAuraModifierByMiscMask(), Unit::GetMaxPositiveAuraModifierByMiscValue(), Unit::GetTotalAuraModifierByMiscMask(), Unit::GetTotalAuraModifierByMiscValue(), Unit::GetTotalAuraMultiplierByMiscMask(), Unit::GetTotalAuraMultiplierByMiscValue(), HandleAuraConvertRune(), HandleAuraDummy(), HandleAuraModBaseResistancePCT(), 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(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandleShapeshiftBoosts(), Aura::IsAuraStronger(), Unit::MeleeDamageBonusTaken(), Unit::SendPeriodicAuraLog(), Unit::SpellBaseDamageBonusDone(), Unit::SpellBaseDamageBonusTaken(), Unit::SpellBaseHealingBonusDone(), Unit::SpellDamageBonusDone(), Unit::SpellPctDamageModsDone(), Unit::UpdateDamageDoneMods(), Unit::UpdateDamagePctDoneMods(), Unit::UpdateResistanceBuffModsMod(), and Unit::UpdateStatBuffMod().

◆ GetMiscValueB()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by HandleAuraConvertRune(), and HandleModPowerRegen().

◆ GetOldAmount()

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

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

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

References m_pctMods.

Referenced by CalculateAmount().

◆ GetPeriodicTimer()

int32 AuraEffect::GetPeriodicTimer ( ) const
inline

◆ GetSpellInfo()

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

References m_spellInfo.

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

◆ GetSpellModifier()

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

References m_spellmod.

◆ GetTargetList()

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

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

◆ GetTickNumber()

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

References m_tickNumber.

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

◆ GetTotalTicks()

◆ HandleArenaPreparation()

void AuraEffect::HandleArenaPreparation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5461{
5462 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5463 return;
5464
5465 Unit* target = aurApp->GetTarget();
5466
5467 if (apply)
5469 else
5470 {
5471 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5472 if (target->HasAuraType(GetAuraType()))
5473 return;
5475 }
5476}
@ AURA_EFFECT_HANDLE_REAL
Definition SpellAuraDefines.h:42
@ UNIT_FLAG_PREPARATION
Definition UnitDefines.h:259
Definition Unit.h:664
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:5946
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
ObjectGuid GetTarget() const
Definition Unit.h:861
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749

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

◆ HandleAuraAllowFlight()

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

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
3209{
3211 return;
3212
3213 Unit* target = aurApp->GetTarget();
3214
3215 if (target->IsPlayer())
3216 {
3217 if (apply)
3219 else
3220 {
3221 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3222 if (target->HasAllowOnlyAbilityAura())
3223 return;
3225 }
3226 }
3227}
@ PLAYER_ALLOW_ONLY_ABILITY
Definition Player.h:482
void SetPlayerFlag(PlayerFlags flags)
Definition Player.h:1124
void RemovePlayerFlag(PlayerFlags flags)
Definition Player.h:1125
bool HasAllowOnlyAbilityAura() const
Definition Unit.h:1808

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

◆ HandleAuraCloneCaster()

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

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

◆ HandleAuraControlVehicle()

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

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

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

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

◆ HandleAuraConvertRune()

void AuraEffect::HandleAuraConvertRune ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6129{
6130 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6131 return;
6132
6133 Unit* target = aurApp->GetTarget();
6134
6135 if (!target->IsPlayer())
6136 return;
6137
6138 Player* player = target->ToPlayer();
6139
6141 return;
6142
6143 uint32 runes = m_amount;
6144 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
6145 if (apply)
6146 {
6147 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
6148 {
6149 if (GetMiscValue() != player->GetCurrentRune(i))
6150 continue;
6151 if (!player->GetRuneCooldown(i))
6152 {
6153 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
6154 --runes;
6155 }
6156 }
6157 }
6158 else
6159 player->RemoveRunesByAuraEffect(this);
6160}
RuneType
Definition Player.h:395
#define MAX_RUNES
Definition Player.h:385
@ CLASS_DEATH_KNIGHT
Definition SharedDefines.h:131
@ CLASS_CONTEXT_ABILITY
Definition UnitDefines.h:238
int32 GetMiscValueB() const
Definition SpellAuraEffects.cpp:437
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition Player.cpp:13379
uint32 GetRuneCooldown(uint8 index) const
Definition Player.h:2541
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition Player.h:2552
bool IsClass(Classes playerClass, ClassContext context=CLASS_CONTEXT_NONE) const override
Definition Player.cpp:1302
RuneType GetCurrentRune(uint8 index) const
Definition Player.h:2540

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
5519{
5521 return;
5522
5523 Unit* target = aurApp->GetTarget();
5524
5525 Unit* caster = GetCaster();
5526
5527 if (mode & AURA_EFFECT_HANDLE_REAL)
5528 {
5529 // pet auras
5530 if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
5531 {
5532 if (apply)
5533 target->AddPetAura(petSpell);
5534 else
5535 target->RemovePetAura(petSpell);
5536 }
5537 }
5538
5540 {
5541 // AT APPLY
5542 if (apply)
5543 {
5544 switch (GetId())
5545 {
5546 case 1515: // Tame beast
5547 // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
5548 if (caster && target->CanHaveThreatList())
5549 target->AddThreat(caster, 10.0f);
5550 break;
5551 case 34026: // kill command
5552 {
5553 Unit* pet = target->GetGuardianPet();
5554 if (!pet)
5555 break;
5556
5557 target->CastSpell(target, 34027, true, nullptr, this);
5558
5559 // set 3 stacks and 3 charges (to make all auras not disappear at once)
5560 Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
5561 Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
5562 if (owner_aura)
5563 {
5564 owner_aura->SetCharges(0);
5565 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5566 if (pet_aura)
5567 {
5568 pet_aura->SetCharges(0);
5569 pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5570 }
5571 }
5572 break;
5573 }
5574 case 37096: // Blood Elf Illusion
5575 {
5576 if (caster)
5577 {
5578 switch (caster->getGender())
5579 {
5580 case GENDER_FEMALE:
5581 caster->CastSpell(target, 37095, true, nullptr, this); // Blood Elf Disguise
5582 break;
5583 case GENDER_MALE:
5584 caster->CastSpell(target, 37093, true, nullptr, this);
5585 break;
5586 default:
5587 break;
5588 }
5589 }
5590 break;
5591 }
5592 case 55198: // Tidal Force
5593 {
5594 target->CastSpell(target, 55166, true);
5595 if (Aura* owner_aura = target->GetAura(55166))
5596 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5597 return;
5598 }
5599 case 39850: // Rocket Blast
5600 if (roll_chance_i(20)) // backfire stun
5601 target->CastSpell(target, 51581, true, nullptr, this);
5602 break;
5603 case 43873: // Headless Horseman Laugh
5604 target->PlayDistanceSound(11965);
5605 break;
5606 case 46354: // Blood Elf Illusion
5607 if (caster)
5608 {
5609 switch (caster->getGender())
5610 {
5611 case GENDER_FEMALE:
5612 caster->CastSpell(target, 46356, true, nullptr, this);
5613 break;
5614 case GENDER_MALE:
5615 caster->CastSpell(target, 46355, true, nullptr, this);
5616 break;
5617 }
5618 }
5619 break;
5620 case 46361: // Reinforced Net
5621 if (caster)
5622 target->GetMotionMaster()->MoveFall();
5623 break;
5624 case 46699: // Requires No Ammo
5625 if (target->IsPlayer())
5626 target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use
5627 break;
5628 case 71563:
5629 {
5630 if (Aura* newAura = target->AddAura(71564, target))
5631 newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
5632 return;
5633 }
5634 }
5635 }
5636 // AT REMOVE
5637 else
5638 {
5639 if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive() && aurApp->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
5640 {
5641 uint32 finalSpelId = 0;
5642 switch (GetId())
5643 {
5644 case 19548:
5645 finalSpelId = 19597;
5646 break;
5647 case 19674:
5648 finalSpelId = 19677;
5649 break;
5650 case 19687:
5651 finalSpelId = 19676;
5652 break;
5653 case 19688:
5654 finalSpelId = 19678;
5655 break;
5656 case 19689:
5657 finalSpelId = 19679;
5658 break;
5659 case 19692:
5660 finalSpelId = 19680;
5661 break;
5662 case 19693:
5663 finalSpelId = 19684;
5664 break;
5665 case 19694:
5666 finalSpelId = 19681;
5667 break;
5668 case 19696:
5669 finalSpelId = 19682;
5670 break;
5671 case 19697:
5672 finalSpelId = 19683;
5673 break;
5674 case 19699:
5675 finalSpelId = 19685;
5676 break;
5677 case 19700:
5678 finalSpelId = 19686;
5679 break;
5680 case 30646:
5681 finalSpelId = 30647;
5682 break;
5683 case 30653:
5684 finalSpelId = 30648;
5685 break;
5686 case 30654:
5687 finalSpelId = 30652;
5688 break;
5689 case 30099:
5690 finalSpelId = 30100;
5691 break;
5692 case 30102:
5693 finalSpelId = 30103;
5694 break;
5695 case 30105:
5696 finalSpelId = 30104;
5697 break;
5698 }
5699
5700 if (finalSpelId)
5701 caster->CastSpell(target, finalSpelId, true, nullptr, this);
5702 }
5703
5705 {
5707 switch (GetId())
5708 {
5709 case 2584: // Waiting to Resurrect
5710 // Waiting to resurrect spell cancel, we must remove player from resurrect queue
5711 if (target->IsPlayer())
5712 {
5713 if (Battleground* bg = target->ToPlayer()->GetBattleground())
5714 bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
5715 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
5716 bf->RemovePlayerFromResurrectQueue(target->GetGUID());
5717 }
5718 break;
5719 case 43681: // Inactive
5720 {
5721 if (!target->IsPlayer() || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5722 return;
5723
5724 if (target->GetMap()->IsBattleground())
5725 target->ToPlayer()->LeaveBattleground();
5726 break;
5727 }
5728 case 52172: // Coyote Spirit Despawn Aura
5729 case 60244: // Blood Parrot Despawn Aura
5730 target->CastSpell((Unit*)nullptr, GetAmount(), true, nullptr, this);
5731 break;
5732 // Halls of Lightning, Arc Lightning
5733 case 52921:
5734 {
5735 if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
5736 return;
5737
5738 Player* player = nullptr;
5739 Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
5740 Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
5741 Cell::VisitObjects(target, searcher, 10.0f);
5742
5743 if (player && player->GetGUID() != target->GetGUID())
5744 target->CastSpell(player, 52921, true);
5745
5746 return;
5747 }
5748 case 58600: // Restricted Flight Area
5749 case 58730: // Restricted Flight Area
5750 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
5751 target->CastSpell(target, 58601, true);
5752 break;
5753 case 46374: // quest The Power of the Elements (11893)
5754 {
5755 if (target->isDead() && GetBase() && target->IsCreature() && target->GetEntry() == 24601)
5756 {
5757 auto caster2 = GetBase()->GetCaster();
5758 if (caster2 && caster2->IsPlayer())
5759 {
5760 caster2->ToPlayer()->KilledMonsterCredit(25987);
5761 }
5762 }
5763 return;
5764 }
5765 }
5766 break;
5767 default:
5768 break;
5769 }
5770 }
5771 }
5772
5773 // AT APPLY & REMOVE
5774
5776 {
5778 {
5779 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5780 break;
5781 switch (GetId())
5782 {
5783 // Recently Bandaged
5784 case 11196:
5786 break;
5787 // Unstable Power
5788 case 24658:
5789 {
5790 uint32 spellId = 24659;
5791 if (apply && caster)
5792 {
5793 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5794
5795 for (uint32 i = 0; i < spell->StackAmount; ++i)
5796 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5797 break;
5798 }
5799 target->RemoveAurasDueToSpell(spellId);
5800 break;
5801 }
5802 // Restless Strength
5803 case 24661:
5804 {
5805 uint32 spellId = 24662;
5806 if (apply && caster)
5807 {
5808 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5809 for (uint32 i = 0; i < spell->StackAmount; ++i)
5810 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5811 break;
5812 }
5813 target->RemoveAurasDueToSpell(spellId);
5814 break;
5815 }
5816 // Tag Murloc
5817 case 30877:
5818 {
5819 // Tag/untag Blacksilt Scout
5820 target->SetEntry(apply ? 17654 : 17326);
5821 break;
5822 }
5823 case 57819: // Argent Champion
5824 case 57820: // Ebon Champion
5825 case 57821: // Champion of the Kirin Tor
5826 case 57822: // Wyrmrest Champion
5827 {
5828 if (!caster || !caster->IsPlayer())
5829 break;
5830
5831 uint32 FactionID = 0;
5832
5833 if (apply)
5834 {
5835 switch (m_spellInfo->Id)
5836 {
5837 case 57819:
5838 FactionID = 1106;
5839 break; // Argent Crusade
5840 case 57820:
5841 FactionID = 1098;
5842 break; // Knights of the Ebon Blade
5843 case 57821:
5844 FactionID = 1090;
5845 break; // Kirin Tor
5846 case 57822:
5847 FactionID = 1091;
5848 break; // The Wyrmrest Accord
5849 }
5850 }
5851 caster->ToPlayer()->SetChampioningFaction(FactionID);
5852 break;
5853 }
5854 // LK Intro VO (1)
5855 case 58204:
5856 if (target->IsPlayer())
5857 {
5858 // Play part 1
5859 if (apply)
5860 target->PlayDirectSound(14970, target->ToPlayer());
5861 // continue in 58205
5862 else
5863 target->CastSpell(target, 58205, true);
5864 }
5865 break;
5866 // LK Intro VO (2)
5867 case 58205:
5868 if (target->IsPlayer())
5869 {
5870 // Play part 2
5871 if (apply)
5872 target->PlayDirectSound(14971, target->ToPlayer());
5873 // Play part 3
5874 else
5875 target->PlayDirectSound(14972, target->ToPlayer());
5876 }
5877 break;
5878 case 62061: // Festive Holiday Mount
5879 if (target->HasMountedAura())
5880 {
5881 uint32 creatureEntry = 0;
5882 if (apply)
5883 {
5885 creatureEntry = 24906;
5886 else
5887 creatureEntry = 15665;
5888 }
5889 else
5890 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5891
5892 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5893 {
5894 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5895 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5896
5898 }
5899 }
5900 break;
5901 case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount
5902 if (target->HasMountedAura() && !target->HasIncreaseMountedFlightSpeedAura())
5903 {
5904 uint32 creatureEntry = 0;
5905
5906 if (apply)
5907 {
5908 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
5909 {
5910 creatureEntry = GREAT_BREWFEST_KODO;
5911 }
5912 else
5913 {
5914 creatureEntry = BREWFEST_KODO;
5915 }
5916 }
5917 else
5918 {
5919 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5920 }
5921
5922 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5923 {
5924 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
5925 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
5926
5928 }
5929 }
5930 break;
5931 }
5932
5933 break;
5934 }
5935 case SPELLFAMILY_MAGE:
5936 {
5937 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5938 //break;
5939 break;
5940 }
5941 case SPELLFAMILY_PRIEST:
5942 {
5943 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5944 //break;
5945 break;
5946 }
5947 case SPELLFAMILY_DRUID:
5948 {
5949 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5950 // break;
5951 break;
5952 }
5953 case SPELLFAMILY_SHAMAN:
5954 {
5955 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5956 // break;
5957 break;
5958 }
5959 }
5960}
#define sBattlefieldMgr
Definition BattlefieldMgr.h:77
bool roll_chance_i(int chance)
Definition Random.h:63
@ GENDER_MALE
Definition SharedDefines.h:61
@ GENDER_FEMALE
Definition SharedDefines.h:62
@ IMMUNITY_MECHANIC
Definition SharedDefines.h:1387
@ SPELLFAMILY_PRIEST
Definition SharedDefines.h:3774
@ SPELLFAMILY_MAGE
Definition SharedDefines.h:3771
@ SPELLFAMILY_GENERIC
Definition SharedDefines.h:3768
@ SPELLFAMILY_SHAMAN
Definition SharedDefines.h:3779
@ SPELLFAMILY_DRUID
Definition SharedDefines.h:3775
@ 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:354
@ UNIT_FIELD_MOUNTDISPLAYID
Definition UpdateFields.h:126
Definition GridNotifiers.h:1351
void SetStackAmount(uint8 num)
Definition SpellAuras.cpp:937
void SetCharges(uint8 charges)
Definition SpellAuras.cpp:894
Definition Battlefield.h:205
Definition Battleground.h:294
bool IsBattleground() const
Definition Map.h:302
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition ObjectMgr.cpp:1634
uint32 GetEntry() const
Definition Object.h:116
void SetEntry(uint32 entry)
Definition Object.h:117
Definition SpellMgr.h:457
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition PlayerQuest.cpp:1959
Battleground * GetBattleground(bool create=false) const
Definition Player.cpp:12166
void RemoveAmmo()
Definition PlayerStorage.cpp:2586
void SetChampioningFaction(uint32 faction)
Definition Player.h:2588
void LeaveBattleground(Battleground *bg=nullptr)
Definition Player.cpp:11252
uint32 StackAmount
Definition SpellInfo.h:371
uint8 getGender() const
Definition Unit.h:848
void RemovePetAura(PetAura const *petSpell)
Definition Unit.cpp:13867
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5799
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition Unit.cpp:10321
void AddPetAura(PetAura const *petSpell)
Definition Unit.cpp:13855
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11541
Aura * AddAura(uint32 spellId, Unit *target)
Definition Unit.cpp:15274
bool HasMountedAura() const
Definition Unit.h:1789
bool IsAlive() const
Definition Unit.h:1783
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:1302
float GetSpeedRate(UnitMoveType mtype) const
Definition Unit.h:1731
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:17578
bool CanHaveThreatList(bool skipAliveCheck=false) const
Definition Unit.cpp:11502
Guardian * GetGuardianPet() const
Definition Unit.cpp:7633
bool isDead() const
Definition Unit.h:1785
Map * GetMap() const
Definition Object.h:620
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2928
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2920
uint32 GetZoneId() const
Definition Object.cpp:3083
Definition GridNotifiers.h:501
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165
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::VisitObjects().

◆ HandleAuraEmpathy()

void AuraEffect::HandleAuraEmpathy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6072{
6073 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6074 return;
6075
6076 Unit* target = aurApp->GetTarget();
6077
6078 if (!apply)
6079 {
6080 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
6081 if (target->HasAuraType(GetAuraType()))
6082 return;
6083 }
6084
6085 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
6087}
@ CREATURE_TYPE_BEAST
Definition SharedDefines.h:2606
@ UNIT_DYNFLAG_SPECIALINFO
Definition SharedDefines.h:3342
@ UNIT_DYNAMIC_FLAGS
Definition UpdateFields.h:136
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:795
uint32 GetCreatureType() const
Definition Unit.cpp:12075

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

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

◆ HandleAuraGhost()

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

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

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

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
4935{
4937 return;
4938
4939 Unit* target = aurApp->GetTarget();
4940
4941 if (apply)
4943 else
4944 {
4947 }
4948}
@ SPELL_AURA_MOD_BASE_HEALTH_PCT
Definition SpellAuraDefines.h:345
@ AURA_EFFECT_HANDLE_STAT
Definition SpellAuraDefines.h:46
@ UNIT_MOD_HEALTH
Definition Unit.h:154
@ BASE_PCT
Definition Unit.h:134
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition Unit.cpp:12155
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition Unit.cpp:12122
float GetTotalAuraMultiplier(AuraType auratype) const
Definition Unit.cpp:6230

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

◆ HandleAuraLinked()

void AuraEffect::HandleAuraLinked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6163{
6164 Unit* target = aurApp->GetTarget();
6165
6166 uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target);
6167 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
6168 if (!triggeredSpellInfo)
6169 return;
6170
6171 if (mode & AURA_EFFECT_HANDLE_REAL)
6172 {
6173 if (apply)
6174 {
6175 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCaster() : target;
6176
6177 if (!caster)
6178 return;
6179 // If amount avalible cast with basepoints (Crypt Fever for example)
6180 if (GetAmount())
6181 caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
6182 else
6183 caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
6184 }
6185 else
6186 {
6187 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6188 target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
6189 }
6190 }
6191 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
6192 {
6193 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
6194 // change the stack amount to be equal to stack amount of our aura
6195 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
6196 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
6197 }
6198}
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell, uint8 effIndex=MAX_SPELL_EFFECTS) const
Definition SpellInfo.cpp:1039
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4981
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:1359

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
5250{
5252 return;
5253
5254 Unit* target = aurApp->GetTarget();
5255
5257}
@ TOTAL_VALUE
Definition Unit.h:128
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:169
bool HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition Unit.cpp:12096

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

◆ HandleAuraModAttackPowerOfArmor()

void AuraEffect::HandleAuraModAttackPowerOfArmor ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5327{
5329 return;
5330
5331 Unit* target = aurApp->GetTarget();
5332
5333 // Recalculate bonus
5334 if (target->IsPlayer())
5335 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
5336}
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition StatSystem.cpp:347

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

Referenced by HandleAuraModAttackPowerOfStatPercent().

◆ HandleAuraModAttackPowerOfStatPercent()

void AuraEffect::HandleAuraModAttackPowerOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5322{
5323 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
5324}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:5326

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5273{
5275 return;
5276
5277 Unit* target = aurApp->GetTarget();
5278
5279 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
5280 if (apply)
5282 else
5283 {
5286 }
5287}
@ SPELL_AURA_MOD_ATTACK_POWER_PCT
Definition SpellAuraDefines.h:229
@ TOTAL_PCT
Definition Unit.h:135

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

◆ HandleAuraModBaseResistancePCT()

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4482{
4484 return;
4485
4486 Unit* target = aurApp->GetTarget();
4487 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4488 {
4489 if (GetMiscValue() & int32(1 << x))
4490 {
4491 if (apply)
4493 else
4494 {
4497 }
4498 }
4499 }
4500}
@ SPELL_SCHOOL_NORMAL
Definition SharedDefines.h:271
constexpr auto MAX_SPELL_SCHOOL
Definition SharedDefines.h:280
@ SPELL_AURA_MOD_BASE_RESISTANCE_PCT
Definition SpellAuraDefines.h:205
UnitMods
Definition Unit.h:148
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:178
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
Definition Unit.cpp:6255

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

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4984{
4986 return;
4987
4988 Unit* target = aurApp->GetTarget();
4989
4990 if (!target->IsPlayer())
4991 return;
4992
4993 target->ToPlayer()->UpdateBlockPercentage();
4994}
void UpdateBlockPercentage()
Definition StatSystem.cpp:633

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

◆ HandleAuraModCritPct()

void AuraEffect::HandleAuraModCritPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5075{
5077 return;
5078
5079 Unit* target = aurApp->GetTarget();
5080
5081 if (!target->IsPlayer())
5082 {
5083 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
5084 return;
5085 }
5086
5088
5089 // included in Player::UpdateSpellCritChance calculation
5091}
void UpdateAllSpellCritChances()
Definition StatSystem.cpp:889
void UpdateAllWeaponDependentCritAuras()
Definition Player.cpp:7080
int32 m_baseSpellCritChance
Definition Unit.h:2078
void apply(T *val)
Definition ByteConverter.h:40

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

◆ HandleAuraModDecreaseSpeed()

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

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

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

◆ HandleAuraModDispelImmunity()

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4423{
4424 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4425 return;
4426
4427 Unit* target = aurApp->GetTarget();
4428
4430}
DispelType
Definition SharedDefines.h:1359
void ApplySpellDispelImmunity(SpellInfo const *spellProto, DispelType type, bool apply)
Definition Unit.cpp:10348

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
4413{
4414 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4415 return;
4416
4417 Unit* target = aurApp->GetTarget();
4418
4419 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
4420}
@ IMMUNITY_DAMAGE
Definition SharedDefines.h:1385

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
4971{
4973 return;
4974
4975 Unit* target = aurApp->GetTarget();
4976
4977 if (!target->IsPlayer())
4978 return;
4979
4980 target->ToPlayer()->UpdateDodgePercentage();
4981}
void UpdateDodgePercentage()
Definition StatSystem.cpp:799

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

◆ HandleAuraModEffectImmunity()

void AuraEffect::HandleAuraModEffectImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4318{
4319 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4320 return;
4321
4322 Unit* target = aurApp->GetTarget();
4323
4324 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
4325
4326 // when removing flag aura, handle flag drop
4327 Player* player = target->ToPlayer();
4328 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
4329 {
4330 if (player->InBattleground())
4331 {
4332 if (Battleground* bg = player->GetBattleground())
4333 bg->EventPlayerDroppedFlag(player);
4334 }
4335 else
4336 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
4337 }
4338}
#define sOutdoorPvPMgr
Definition OutdoorPvPMgr.h:102
@ IMMUNITY_EFFECT
Definition SharedDefines.h:1382
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition SpellDefines.h:63
bool InBattleground() const
Definition Player.h:2285

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
4761{
4763 return;
4764
4765 Unit* target = aurApp->GetTarget();
4766
4767 if (!target->IsPlayer())
4768 return;
4769
4772}
void UpdateExpertise(WeaponAttackType attType)
Definition StatSystem.cpp:895

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

◆ HandleAuraModFaction()

void AuraEffect::HandleAuraModFaction ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6090{
6091 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6092 return;
6093
6094 Unit* target = aurApp->GetTarget();
6095
6096 if (apply)
6097 {
6098 target->SetFaction(GetMiscValue());
6099 if (target->IsPlayer())
6101 }
6102 else
6103 {
6104 target->RestoreFaction();
6105 if (target->IsPlayer())
6107 }
6108}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition UnitDefines.h:257
void SetFaction(uint32 faction)
Definition Unit.cpp:7013
void RestoreFaction()
Definition Unit.cpp:15106

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
6217{
6219 return;
6220
6221 Player* target = aurApp->GetTarget()->ToPlayer();
6222 if (!target)
6223 return;
6224
6227}
@ PLAYER_FAKE_INEBRIATION
Definition UpdateFields.h:325
void ApplyModInt32Value(uint16 index, int32 val, bool apply)
Definition Object.cpp:804
void UpdateInvisibilityDrunkDetect()
Definition Player.cpp:1013

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
4862{
4864 return;
4865
4866 Unit* target = aurApp->GetTarget();
4867
4869 // do not check power type, we can always modify the maximum
4870 // as the client will not see any difference
4871 // also, placing conditions that may change during the aura duration
4872 // inside effect handlers is not a good idea
4873 //if (int32(PowerType) != GetMiscValue())
4874 // return;
4875
4876 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4877
4878 target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4879}
std::uint16_t uint16
Definition Define.h:108
Powers
Definition SharedDefines.h:256
@ UNIT_MOD_POWER_START
Definition Unit.h:180
PowerType
Definition VehicleDefines.h:29

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

◆ HandleAuraModIncreaseEnergyPercent()

void AuraEffect::HandleAuraModIncreaseEnergyPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4882{
4884 return;
4885
4886 Unit* target = aurApp->GetTarget();
4887
4889 // do not check power type, we can always modify the maximum
4890 // as the client will not see any difference
4891 // also, placing conditions that may change during the aura duration
4892 // inside effect handlers is not a good idea
4893 //if (int32(PowerType) != GetMiscValue())
4894 // return;
4895
4896 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4897
4898 if (apply)
4899 {
4900 float amount = float(GetAmount());
4901 target->ApplyStatPctModifier(unitMod, TOTAL_PCT, amount);
4902 }
4903 else
4904 {
4906 target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
4907 }
4908}
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
Definition SpellAuraDefines.h:195
float GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const
Definition Unit.cpp:6295

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

◆ HandleAuraModIncreaseFlightSpeed()

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

Update ability to fly

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

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

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
4817{
4819 return;
4820
4821 Unit* target = aurApp->GetTarget();
4822
4823 if (apply)
4824 {
4826 target->ModifyHealth(GetAmount());
4827 }
4828 else
4829 {
4830 if (int32(target->GetHealth()) > GetAmount())
4831 target->ModifyHealth(-GetAmount());
4832 else
4833 target->SetHealth(1);
4835 }
4836}
int32 ModifyHealth(int32 val)
Definition Unit.cpp:11047
void SetHealth(uint32 val)
Definition Unit.cpp:12496
uint32 GetHealth() const
Definition Unit.h:1103

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

◆ HandleAuraModIncreaseHealthPercent()

void AuraEffect::HandleAuraModIncreaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4911{
4913 return;
4914
4915 Unit* target = aurApp->GetTarget();
4916
4917 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4918 float percent = target->GetHealthPct();
4919
4920 if (apply)
4922 else
4923 {
4926 }
4927
4928 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4929 if (target->IsAlive())
4930 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4931 target->SetHealth(healthAmount);
4932}
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
Definition SpellAuraDefines.h:196
T CalculatePct(T base, U pct)
Definition Util.h:52
float GetHealthPct() const
Definition Unit.h:1105
uint32 GetMaxHealth() const
Definition Unit.h:1104

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

◆ HandleAuraModIncreaseMaxHealth()

void AuraEffect::HandleAuraModIncreaseMaxHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4839{
4841 return;
4842
4843 Unit* target = aurApp->GetTarget();
4844
4845 uint32 oldhealth = target->GetHealth();
4846 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4847
4849
4850 // refresh percentage
4851 if (oldhealth > 0)
4852 {
4853 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4854 if (newhealth == 0)
4855 newhealth = 1;
4856
4857 target->SetHealth(newhealth);
4858 }
4859}

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

◆ HandleAuraModIncreaseMountedSpeed()

void AuraEffect::HandleAuraModIncreaseMountedSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3833{
3834 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3835}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3817

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

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

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
3878{
3880 return;
3881
3882 Unit* target = aurApp->GetTarget();
3883
3884 target->UpdateSpeed(MOVE_SWIM, true);
3885
3886 if (Player* targetPlayer = target->ToPlayer())
3887 {
3888 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3889 }
3890}

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
3171{
3173 return;
3174
3175 Unit* target = aurApp->GetTarget();
3176
3177 if (apply)
3178 {
3180 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
3181 }
3182 else
3183 {
3184 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3185 if (target->HasPacifyAura() || target->HasPacifySilenceAura())
3186 return;
3188 }
3189}
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:271
bool HasPacifySilenceAura() const
Definition Unit.h:1813
bool HasPacifyAura() const
Definition Unit.h:1817

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
3192{
3194 return;
3195
3196 Unit* target = aurApp->GetTarget();
3197
3198 if (!(apply))
3199 {
3200 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3201 if (target->HasPacifySilenceAura())
3202 return;
3203 }
3204 HandleAuraModPacify(aurApp, mode, apply);
3205 HandleAuraModSilence(aurApp, mode, apply);
3206}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3141
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:3170

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
4955{
4957 return;
4958
4959 Unit* target = aurApp->GetTarget();
4960
4961 if (!target->IsPlayer())
4962 return;
4963
4964 if (!target->ToPlayer()->CanParry())
4965 target->ToPlayer()->SetCanParry(true);
4966 else
4967 target->ToPlayer()->UpdateParryPercentage();
4968}
void UpdateParryPercentage()
Definition StatSystem.cpp:753
bool CanParry() const
Definition Player.h:2200
void SetCanParry(bool value)
Definition Player.cpp:13118

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
3328{
3330 return;
3331
3332 Unit* target = aurApp->GetTarget();
3333
3334 if (!target->IsPlayer())
3335 return;
3336
3337 // Recalculate pet talent points
3338 if (Pet* pet = target->ToPlayer()->GetPet())
3339 pet->InitTalentForLevel();
3340}

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
5260{
5262 return;
5263
5264 Unit* target = aurApp->GetTarget();
5265
5266 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5267 return;
5268
5270}
#define CLASSMASK_WAND_USERS
Definition SharedDefines.h:151
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:170
uint32 getClassMask() const
Definition Unit.h:845

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

◆ HandleAuraModRangedAttackPowerOfStatPercent()

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

◆ HandleAuraModRangedAttackPowerPercent()

void AuraEffect::HandleAuraModRangedAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5290{
5292 return;
5293
5294 Unit* target = aurApp->GetTarget();
5295
5296 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
5297 return;
5298
5299 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
5300 if (apply)
5302 else
5303 {
5306 }
5307}
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
Definition SpellAuraDefines.h:230

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

◆ HandleAuraModRangedHaste()

void AuraEffect::HandleAuraModRangedHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5188{
5190 return;
5191
5192 Unit* target = aurApp->GetTarget();
5193
5194 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5195}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition Unit.cpp:13605

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
4997{
4998 HandleModManaRegen(aurApp, mode, apply);
4999}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4802

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4464{
4466 return;
4467
4468 Unit* target = aurApp->GetTarget();
4469
4470 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4471 {
4472 if (GetMiscValue() & int32(1 << x))
4473 {
4475 if (target->IsPlayer() || target->IsPet())
4477 }
4478 }
4479}
std::int8_t int8
Definition Define.h:105
SpellSchools
Definition SharedDefines.h:270
bool IsPet() const
Definition Unit.h:797
void UpdateResistanceBuffModsMod(SpellSchools school)
Definition Unit.cpp:6365

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

◆ HandleAuraModResistanceExclusive()

void AuraEffect::HandleAuraModResistanceExclusive ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4441{
4443 return;
4444
4445 Unit* target = aurApp->GetTarget();
4446
4447 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4448 {
4449 if (GetMiscValue() & int32(1 << x))
4450 {
4452 if (amount < GetAmount())
4453 {
4454 float value = float(GetAmount() - amount);
4456 if (target->IsPlayer() || target->IsPet())
4458 }
4459 }
4460 }
4461}
@ SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
Definition SpellAuraDefines.h:206
@ BASE_VALUE
Definition Unit.h:127
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect *except=nullptr) const
Definition Unit.cpp:6265

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

◆ HandleAuraModResistenceOfStatPercent()

void AuraEffect::HandleAuraModResistenceOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4739{
4741 return;
4742
4743 Unit* target = aurApp->GetTarget();
4744
4745 if (!target->IsPlayer())
4746 return;
4747
4749 {
4750 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4751 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4752 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4753 return;
4754 }
4755
4756 // Recalculate Armor
4757 target->UpdateArmor();
4758}
#define LOG_ERROR(filterType__,...)
Definition Log.h:158
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
virtual void UpdateArmor()=0

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

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3646{
3647 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3648 return;
3649
3650 Unit* target = aurApp->GetTarget();
3651
3652 target->SetControlled(apply, UNIT_STATE_ROOT);
3653}
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:14454

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

◆ HandleAuraModScale()

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

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

◆ HandleAuraModSchoolImmunity()

void AuraEffect::HandleAuraModSchoolImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
Todo:
: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
4354{
4355 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4356 return;
4357
4358 Unit* target = aurApp->GetTarget();
4359
4360 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
4361
4362 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4363 {
4364 if (apply)
4366 else
4367 {
4368 bool banishFound = false;
4369 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
4370 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
4371 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4372 {
4373 banishFound = true;
4374 break;
4375 }
4376 if (!banishFound)
4378 }
4379 }
4380
4381 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
4383
4384 // remove all flag auras (they are positive, but they must be removed when you are immune)
4388
4390 if ((apply)
4392 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
4393 {
4394 uint32 school_mask = GetMiscValue();
4395 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
4396 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
4397 {
4398 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4399 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
4400 && GetSpellInfo()->CanDispelAura(spell)
4401 && !iter->second->IsPositive() //Don't remove positive spells
4402 && spell->Id != GetId()) //Don't remove self
4403 {
4404 target->RemoveAura(iter);
4405 }
4406 else
4407 ++iter;
4408 }
4409 }
4410}
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition SharedDefines.h:465
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition SharedDefines.h:422
@ MECHANIC_BANISH
Definition SharedDefines.h:1331
@ IMMUNITY_SCHOOL
Definition SharedDefines.h:1384
@ UNIT_STATE_ISOLATED
Definition UnitDefines.h:183
bool IsPositive() const
Definition SpellInfo.cpp:1238
bool CanDispelAura(SpellInfo const *aura) const
Definition SpellInfo.cpp:1353
void ClearUnitState(uint32 f)
Definition Unit.h:737
void AddUnitState(uint32 f)
Definition Unit.h:735
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition Unit.cpp:5393

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

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

◆ HandleAuraModSilence()

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

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
3343{
3345 return;
3346 Unit* target = aurApp->GetTarget();
3347
3348 if (!target->IsPlayer())
3349 return;
3350
3351 uint32 prot = GetMiscValue();
3352 int32 points = GetAmount();
3353
3354 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
3355 if (prot == SKILL_DEFENSE)
3356 target->ToPlayer()->UpdateDefenseBonusesMod();
3357}
@ SKILL_DEFENSE
Definition SharedDefines.h:3098
@ 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:5302
void UpdateDefenseBonusesMod()
Definition StatSystem.cpp:626

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

◆ HandleAuraModStalked()

void AuraEffect::HandleAuraModStalked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3285{
3287 return;
3288
3289 Unit* target = aurApp->GetTarget();
3290
3291 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
3292 if (apply)
3294 else
3295 {
3296 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3297 if (!target->HasAuraType(GetAuraType()))
3299 }
3300
3301 // call functions which may have additional effects after chainging state of unit
3302 target->UpdateObjectVisibility(target->IsPlayer());
3303}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition SharedDefines.h:3339
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:15541

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
4562{
4564 return;
4565
4566 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4567 {
4568 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4569 return;
4570 }
4571
4572 Unit* target = aurApp->GetTarget();
4574 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4575 return;
4576
4577 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4578 {
4579 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4580 if (GetMiscValue() < 0 || GetMiscValue() == i)
4581 {
4582 if (spellGroupVal)
4584
4586 if (target->IsPlayer() || target->IsPet())
4587 target->UpdateStatBuffMod(Stats(i));
4588 }
4589 }
4590}
#define MAX_STATS
Definition SharedDefines.h:253
Stats
Definition SharedDefines.h:245
@ STAT_STRENGTH
Definition SharedDefines.h:246
@ SPELL_AURA_MOD_STAT
Definition SpellAuraDefines.h:92
@ UNIT_MOD_STAT_START
Definition Unit.h:176
int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
Definition Unit.cpp:4493
void UpdateStatBuffMod(Stats stat)
Definition Unit.cpp:6394

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

◆ HandleAuraModStateImmunity()

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

◆ HandleAuraModStun()

void AuraEffect::HandleAuraModStun ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3636{
3637 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3638 return;
3639
3640 Unit* target = aurApp->GetTarget();
3641
3642 target->SetControlled(apply, UNIT_STATE_STUNNED);
3643}
@ 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
3574{
3576 return;
3577
3578 Unit* target = aurApp->GetTarget();
3579
3580 if (!target->IsAlive() || !target->IsPlayer())
3581 return;
3582
3583 Unit* caster = GetCaster();
3584 if (caster && caster->IsAlive())
3585 target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
3586}
void addTempThreat(float threat, bool apply)
Definition HostileRefMgr.cpp:65
HostileRefMgr & getHostileRefMgr()
Definition Unit.h:957

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
3914{
3915 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3916 return;
3917
3918 Unit* target = aurApp->GetTarget();
3919
3920 target->UpdateSpeed(MOVE_RUN, true);
3921 target->UpdateSpeed(MOVE_SWIM, true);
3922 target->UpdateSpeed(MOVE_FLIGHT, true);
3923
3924 if (Player* targetPlayer = target->ToPlayer())
3925 {
3926 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3927 }
3928}

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
5002{
5004 return;
5005
5006 Player* target = aurApp->GetTarget()->ToPlayer();
5007
5008 if (!target)
5009 return;
5010
5012}

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

◆ HandleAuraMounted()

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

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
6201{
6202 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6203 return;
6204
6205 Unit* target = aurApp->GetTarget();
6206
6207 if (!target->IsPlayer() || !target->IsInWorld())
6208 return;
6209
6210 if (apply)
6211 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
6212
6213 // client auto close stable dialog at !apply aura
6214}
bool IsInWorld() const
Definition Object.h:108
WorldSession * GetSession() const
Definition Player.h:2017
void SendStablePet(ObjectGuid guid)
Definition NPCHandler.cpp:344

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
6230{
6231 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6232 return;
6233
6234 Player* target = aurApp->GetTarget()->ToPlayer();
6235
6236 if (!target || !target->IsInWorld())
6237 return;
6238
6239 uint32 overrideId = uint32(GetMiscValue());
6240
6241 if (apply)
6242 {
6244 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6245 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6246 if (uint32 spellId = overrideSpells->spellId[i])
6247 target->_addSpell(spellId, SPEC_MASK_ALL, true);
6248 }
6249 else
6250 {
6252 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6253 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6254 if (uint32 spellId = overrideSpells->spellId[i])
6255 target->removeSpell(spellId, SPEC_MASK_ALL, true);
6256 }
6257}
DBCStorage< OverrideSpellDataEntry > sOverrideSpellDataStore(OverrideSpellDatafmt)
#define MAX_OVERRIDE_SPELL
Definition DBCStructure.h:1411
#define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET
Definition Player.h:536
@ PLAYER_FIELD_BYTES2
Definition UpdateFields.h:378
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition Object.cpp:759
Definition DBCStructure.h:1414

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

◆ HandleAuraRetainComboPoints()

void AuraEffect::HandleAuraRetainComboPoints ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5499{
5500 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5501 return;
5502
5503 Unit* target = aurApp->GetTarget();
5504
5505 if (!target->IsPlayer())
5506 return;
5507
5508 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5509 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5510 if (!(apply) && GetBase()->GetDuration() == 0)
5511 target->AddComboPoints(-GetAmount());
5512}
void AddComboPoints(Unit *target, int8 count)
Definition Unit.cpp:13384

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
6260{
6261 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6262 return;
6263
6264 Unit* target = aurApp->GetTarget();
6265
6266 if (!target->IsPlayer() || !target->IsInWorld())
6267 return;
6268
6269 uint32 vehicleId = GetMiscValue();
6270
6271 if (apply)
6272 {
6273 if (!target->CreateVehicleKit(vehicleId, 0))
6274 return;
6275 }
6276 else if (target->GetVehicleKit())
6277 target->RemoveVehicleKit();
6278
6280 data << target->GetPackGUID();
6281 data << uint32(apply ? vehicleId : 0);
6282 target->SendMessageToSet(&data, true);
6283
6284 if (apply)
6285 {
6287 target->ToPlayer()->SendDirectMessage(&data);
6288 }
6289}
PackedGuid const & GetPackGUID() const
Definition Object.h:115
std::size_t size() const
Definition ObjectGuid.h:274
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5688
void RemoveVehicleKit()
Definition Unit.cpp:15138
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
Definition Unit.cpp:15126
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition Object.cpp:2084
Definition WorldPacket.h:26
@ SMSG_PLAYER_VEHICLE_DATA
Definition Opcodes.h:1221
@ SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA
Definition Opcodes.h:1211

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

◆ HandleAuraTrackCreatures()

void AuraEffect::HandleAuraTrackCreatures ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3234{
3236 return;
3237
3238 Unit* target = aurApp->GetTarget();
3239
3240 if (!target->IsPlayer())
3241 return;
3242
3243 if (apply)
3244 target->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3245 else
3246 target->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
3247}
@ 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
3250{
3252 return;
3253
3254 Unit* target = aurApp->GetTarget();
3255
3256 if (!target->IsPlayer())
3257 return;
3258
3259 if (apply)
3260 target->SetFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3261 else
3262 target->RemoveFlag(PLAYER_TRACK_RESOURCES, uint32(1) << (GetMiscValue() - 1));
3263}
@ 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
3266{
3268 return;
3269
3270 Unit* target = aurApp->GetTarget();
3271
3272 if (!target->IsPlayer())
3273 return;
3274
3275 if (!(apply))
3276 {
3277 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3278 if (target->HasAuraType(GetAuraType()))
3279 return;
3280 }
3282}
@ PLAYER_FIELD_BYTE_TRACK_STEALTHED
Definition Player.h:544
@ PLAYER_FIELD_BYTES
Definition UpdateFields.h:368
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition Object.cpp:881

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

◆ HandleAuraTransform()

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

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
3306{
3308 return;
3309
3310 Unit* target = aurApp->GetTarget();
3311
3312 if (apply)
3314 else
3315 {
3316 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3317 if (target->HasAuraType(GetAuraType()))
3318 return;
3320 }
3321}
@ 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:912
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
Definition Object.cpp:893

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

◆ HandleAuraWaterWalk()

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

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
6008{
6009 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6010 return;
6011
6012 Unit* target = aurApp->GetTarget();
6013
6014 Unit* caster = GetCaster();
6015
6016 if (!caster || !caster->IsPlayer())
6017 return;
6018
6019 caster->ToPlayer()->SetViewpoint(target, apply);
6020}
void SetViewpoint(WorldObject *target, bool apply)
Definition Player.cpp:13162

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

◆ HandleBreakableCCAuraProc()

void AuraEffect::HandleBreakableCCAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7257{
7258 int32 const damageLeft = GetAmount() - static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage());
7259
7260 if (damageLeft <= 0)
7261 aurApp->GetTarget()->RemoveAura(aurApp);
7262 else
7263 SetAmount(damageLeft);
7264}
Unit * GetTarget() const
Definition SpellAuras.h:61

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

Referenced by HandleProc().

◆ HandleChannelDeathItem()

void AuraEffect::HandleChannelDeathItem ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5963{
5964 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5965 return;
5966
5967 if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
5968 return;
5969
5970 Unit* caster = GetCaster();
5971
5972 if (!caster || !caster->IsPlayer())
5973 return;
5974
5975 Player* plCaster = caster->ToPlayer();
5976
5977 // Item amount
5978 if (GetAmount() <= 0)
5979 return;
5980
5981 if (GetSpellInfo()->Effects[m_effIndex].ItemType == 0)
5982 return;
5983
5984 //Adding items
5985 uint32 noSpaceForCount = 0;
5986 uint32 count = m_amount;
5987
5988 ItemPosCountVec dest;
5989 InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellInfo()->Effects[m_effIndex].ItemType, count, &noSpaceForCount);
5990 if (msg != EQUIP_ERR_OK)
5991 {
5992 count -= noSpaceForCount;
5993 plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellInfo()->Effects[m_effIndex].ItemType);
5994 if (count == 0)
5995 return;
5996 }
5997
5998 Item* newitem = plCaster->StoreNewItem(dest, GetSpellInfo()->Effects[m_effIndex].ItemType, true);
5999 if (!newitem)
6000 {
6001 plCaster->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
6002 return;
6003 }
6004 plCaster->SendNewItem(newitem, count, true, true);
6005}
InventoryResult
Definition Item.h:46
@ EQUIP_ERR_ITEM_NOT_FOUND
Definition Item.h:70
@ EQUIP_ERR_OK
Definition Item.h:47
@ NULL_BAG
Definition Item.h:40
@ NULL_SLOT
Definition Item.h:41
std::vector< ItemPosCount > ItemPosCountVec
Definition Player.h:757
@ AURA_REMOVE_BY_DEATH
Definition SpellAuraDefines.h:396
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast=false, bool sendChatMessage=true)
Definition PlayerStorage.cpp:4812
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 item, bool update, int32 randomPropertyId=0, bool refund=false)
Definition PlayerStorage.cpp:2596
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0)
Definition PlayerStorage.cpp:4088
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition Player.h:1297

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

◆ HandleCharmConvert()

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

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
6111{
6113 return;
6114
6115 Unit* target = aurApp->GetTarget();
6116
6117 if (apply)
6119 else
6120 {
6121 if (target->HasAuraType(GetAuraType()))
6122 return;
6123
6125 }
6126}
@ UNIT_FLAG2_COMPREHEND_LANG
Definition UnitDefines.h:296

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

◆ HandleDetectAmore()

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

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

◆ HandleEffect() [1/2]

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

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

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

◆ HandleEffect() [2/2]

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

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

◆ HandleFarSight()

void AuraEffect::HandleFarSight ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
6023{
6024 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6025 {
6026 return;
6027 }
6028
6029 Unit* caster = GetCaster();
6030 if (!caster || !caster->IsPlayer())
6031 {
6032 return;
6033 }
6034
6035 Player* player = caster->ToPlayer();
6036 if (apply)
6037 {
6039 }
6040 else
6041 {
6042 player->ResetFarSightDistance();
6043 }
6044
6045 caster->UpdateObjectVisibility(!apply);
6046}
void SetFarSightDistance(float radius)
Definition Player.cpp:16243
void ResetFarSightDistance()
Definition Player.cpp:16248
float GetMaxRange(bool positive=false, Unit *caster=nullptr, Spell *spell=nullptr) const
Definition SpellInfo.cpp:2220

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

◆ HandleFeignDeath()

void AuraEffect::HandleFeignDeath ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2930{
2931 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2932 return;
2933
2934 Unit* target = aurApp->GetTarget();
2935
2936 if (!target->IsPlayer())
2937 return;
2938
2939 if (Player* targetPlayer = target->ToPlayer())
2940 {
2941 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
2942 }
2943
2944 if (apply)
2945 {
2946 /*
2947 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
2948 data<<target->GetGUID();
2949 data<<uint8(0);
2950 target->SendMessageToSet(&data, true);
2951 */
2952
2953 UnitList targets;
2954 Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
2956 Cell::VisitObjects(target, searcher, target->GetMap()->GetVisibilityRange());
2957 for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
2958 {
2959 if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
2960 continue;
2961
2963 {
2964 if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
2965 {
2966 SpellInfo const* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
2967 if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->IsCreature())
2968 {
2969 Creature* c = (*iter)->ToCreature();
2970 if ((!c->IsPet() && c->GetCreatureTemplate()->rank == CREATURE_ELITE_WORLDBOSS) || c->isWorldBoss() || c->IsDungeonBoss())
2971 continue;
2972 }
2973 bool interrupt = false; // pussywizard: skip spells that don't target units, but casted on unit (eg. TARGET_DEST_TARGET_ENEMY)
2974 for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
2975 if (si->Effects[j].Effect && (si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT || si->Effects[j].GetUsedTargetObjectType() == TARGET_OBJECT_TYPE_UNIT_AND_DEST))
2976 {
2977 // at least one effect truly targets an unit, interrupt the spell
2978 interrupt = true;
2979 break;
2980 }
2981 if (interrupt)
2982 (*iter)->InterruptSpell(CurrentSpellTypes(i), false);
2983 }
2984 }
2985 }
2986
2987 if (target->GetInstanceScript() && target->GetInstanceScript()->IsEncounterInProgress())
2988 {
2989 // Xinef: replaced with CombatStop(false)
2990 target->AttackStop();
2991 target->RemoveAllAttackers();
2992 target->getHostileRefMgr().addThreatPercent(-100);
2993 target->ToPlayer()->SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
2994 }
2995 else
2996 {
2997 target->CombatStop();
2999 }
3000
3002
3003 // prevent interrupt message
3004 if (GetCasterGUID() == target->GetGUID())
3005 {
3007 target->FinishSpell(CURRENT_GENERIC_SPELL, true);
3008
3009 // interrupt autoshot
3011 {
3013 target->ToPlayer()->SendAutoRepeatCancel(target);
3014 }
3015 }
3016
3017 target->InterruptNonMeleeSpells(true);
3018
3019 // stop handling the effect if it was removed by linked event
3020 if (aurApp->GetRemoveMode())
3021 return;
3022 // blizz like 2.0.x
3024 // blizz like 2.0.x
3026 // blizz like 2.0.x
3028
3030 }
3031 else
3032 {
3033 /*
3034 WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9);
3035 data<<target->GetGUID();
3036 data<<uint8(1);
3037 target->SendMessageToSet(&data, true);
3038 */
3039 // blizz like 2.0.x
3041 // blizz like 2.0.x
3043 // blizz like 2.0.x
3045
3047 }
3048}
@ UNIT_DYNFLAG_DEAD
Definition SharedDefines.h:3343
@ CREATURE_ELITE_WORLDBOSS
Definition SharedDefines.h:2951
@ SPELL_ATTR6_IGNORE_PHASE_SHIFT
Definition SharedDefines.h:605
@ 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:293
@ UNIT_STATE_DIED
Definition UnitDefines.h:170
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
Definition UnitDefines.h:283
#define CURRENT_FIRST_NON_MELEE_SPELL
Definition Unit.h:561
@ CURRENT_GENERIC_SPELL
Definition Unit.h:556
@ CURRENT_AUTOREPEAT_SPELL
Definition Unit.h:558
std::list< Unit * > UnitList
Definition Unit.h:77
Definition GridNotifiers.h:852
Definition Creature.h:47
bool IsDungeonBoss() const
Definition Creature.cpp:3135
bool isWorldBoss() const
Definition Creature.h:124
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:205
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:141
void SendAutoRepeatCancel(Unit *target)
Definition PlayerMisc.cpp:153
void CombatStop(bool includingCast=false)
Definition Unit.cpp:7418
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4259
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
Definition Unit.cpp:4217
void RemoveAllAttackers()
Remove all units in m_attackers list and send them AttackStop()
Definition Unit.cpp:7466
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7385
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1214
float GetVisibilityRange() const
Definition Object.cpp:1671
Definition GridNotifiers.h:414
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::VisitObjects().

◆ HandleForceMoveForward()

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

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
6049{
6051 return;
6052
6053 Unit* target = aurApp->GetTarget();
6054
6055 if (!target->IsPlayer())
6056 return;
6057
6058 Player* player = target->ToPlayer();
6059
6060 uint32 faction_id = GetMiscValue();
6061 ReputationRank faction_rank = ReputationRank(m_amount);
6062
6063 player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply);
6065
6066 // stop fighting if at apply forced rank friendly or at remove real rank friendly
6067 if ((apply && faction_rank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY))
6068 player->StopAttackFaction(faction_id);
6069}
ReputationRank
Definition SharedDefines.h:156
@ REP_FRIENDLY
Definition SharedDefines.h:161
ReputationRank GetReputationRank(uint32 faction_id) const
Definition Player.cpp:5858
ReputationMgr & GetReputationMgr()
Definition Player.h:2142
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:16308

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
5098{
5100 return;
5101
5102 Unit* target = aurApp->GetTarget();
5103
5104 // Xinef: Do not apply such auras in normal way
5105 if (GetAmount() >= 1000)
5106 {
5107 target->SetInstantCast(apply);
5108 return;
5109 }
5110
5111 int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, GetAuraType());
5112 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
5113 return;
5114
5115 if (spellGroupVal)
5116 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
5117
5118 target->ApplyCastTimePercentMod((float)GetAmount(), apply);
5119}
void SetInstantCast(bool set)
Definition Unit.h:1581
void ApplyCastTimePercentMod(float val, bool apply)
Definition Unit.cpp:13624

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

◆ HandleModCharm()

void AuraEffect::HandleModCharm ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3749{
3750 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3751 return;
3752
3753 Unit* target = aurApp->GetTarget();
3754
3755 Unit* caster = GetCaster();
3756
3757 if (apply)
3758 target->SetCharmedBy(caster, CHARM_TYPE_CHARM, aurApp);
3759 else
3760 target->RemoveCharmedBy(caster);
3761}
@ 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
5134{
5136 return;
5137
5138 Unit* target = aurApp->GetTarget();
5140 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
5141 return;
5142
5143 if (spellGroupVal)
5144 {
5145 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
5146 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
5147 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
5148 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(spellGroupVal), !apply);
5149 }
5150
5151 target->ApplyCastTimePercentMod(float(GetAmount()), apply);
5152 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
5153 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
5154 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(GetAmount()), apply);
5155}
@ SPELL_AURA_MELEE_SLOW
Definition SpellAuraDefines.h:256

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

◆ HandleModConfuse()

void AuraEffect::HandleModConfuse ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3616{
3617 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3618 return;
3619
3620 Unit* target = aurApp->GetTarget();
3621
3622 target->SetControlled(apply, UNIT_STATE_CONFUSED);
3623}
@ 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
5341{
5343 return;
5344
5345 Unit* target = aurApp->GetTarget();
5346
5348 target->UpdateAllDamageDoneMods();
5349
5350 // Magic damage modifiers implemented in Unit::SpellBaseDamageBonus
5351 // This information for client side use only
5352 if (target->IsPlayer())
5353 {
5355 for (uint16 i = 0; i < MAX_SPELL_SCHOOL; ++i)
5356 if (GetMiscValue() & (1 << i))
5357 target->ApplyModInt32Value(baseField + i, GetAmount(), apply);
5358
5359 if (Guardian* pet = target->ToPlayer()->GetGuardianPet())
5360 pet->UpdateAttackPowerAndDamage();
5361 }
5362}
@ PLAYER_FIELD_MOD_DAMAGE_DONE_POS
Definition UpdateFields.h:360
@ PLAYER_FIELD_MOD_DAMAGE_DONE_NEG
Definition UpdateFields.h:361
Definition TemporarySummon.h:106
void UpdateAllDamageDoneMods()
Definition Unit.cpp:12279

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

◆ HandleModDamagePercentDone()

void AuraEffect::HandleModDamagePercentDone ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5365{
5367 return;
5368
5369 Unit* target = aurApp->GetTarget();
5370 if (!target)
5371 return;
5372
5375
5376 if (target->IsPlayer())
5377 {
5378 for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
5379 {
5380 if (GetMiscValue() & (1 << i))
5381 {
5382 // only aura type modifying PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
5385 }
5386 }
5387 }
5388}
@ PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
Definition UpdateFields.h:362
void SetFloatValue(uint16 index, float value)
Definition Object.cpp:726
void UpdateAllDamagePctDoneMods()
Definition Unit.cpp:12323

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

◆ HandleModFear()

void AuraEffect::HandleModFear ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3626{
3627 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3628 return;
3629
3630 Unit* target = aurApp->GetTarget();
3631
3632 target->SetControlled(apply, UNIT_STATE_FLEEING, GetCaster(), true);
3633}
@ 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
4685{
4687 return;
4688
4689 Unit* target = aurApp->GetTarget();
4690
4691 if (!target->IsPlayer())
4692 return;
4693 // implemented in Unit::SpellHealingBonus
4694 // this information is for client side only
4696}
void UpdateSpellDamageAndHealingBonus()
Definition StatSystem.cpp:194

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

◆ HandleModHitChance()

void AuraEffect::HandleModHitChance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5015{
5017 return;
5018
5019 Unit* target = aurApp->GetTarget();
5020
5021 if (target->IsPlayer())
5022 {
5023 target->ToPlayer()->UpdateMeleeHitChances();
5024 target->ToPlayer()->UpdateRangedHitChances();
5025 }
5026 else
5027 {
5028 target->m_modMeleeHitChance += (apply) ? GetAmount() : (-GetAmount());
5029 target->m_modRangedHitChance += (apply) ? GetAmount() : (-GetAmount());
5030 }
5031}
void UpdateMeleeHitChances()
Definition StatSystem.cpp:871
void UpdateRangedHitChances()
Definition StatSystem.cpp:877
float m_modRangedHitChance
Definition Unit.h:2076
float m_modMeleeHitChance
Definition Unit.h:2075

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

◆ HandleModInvisibility()

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

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

◆ HandleModInvisibilityDetect()

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

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
4803{
4805 return;
4806
4807 Unit* target = aurApp->GetTarget();
4808
4809 if (!target->IsPlayer())
4810 return;
4811
4812 //Note: an increase in regen does NOT cause threat.
4813 target->ToPlayer()->UpdateManaRegen();
4814}
void UpdateManaRegen()
Definition StatSystem.cpp:939

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

Referenced by HandleAuraModRegenInterrupt().

◆ HandleModMechanicImmunity()

void AuraEffect::HandleModMechanicImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4249{
4250 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4251 return;
4252
4253 Unit* target = aurApp->GetTarget();
4254 uint32 mechanic = 0;
4255
4256 switch (GetId())
4257 {
4258 case 46924: // BladeStorm
4260 break;
4261 case 34471: // The Beast Within
4262 case 19574: // Bestial Wrath
4263 case 38484: // Bestial Wrath
4264 case 40081: // Free friend (Black Temple)
4282 break;
4283 case 42292: // PvP trinket
4284 case 59752: // Every Man for Himself
4285 case 65547: // PvP trinket for Faction Champions (ToC 25)
4286 case 53490: // Bullheaded
4287 case 46227: // Medalion of Immunity
4289 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.
4290 // Actually we should apply immunities here, too, but the aura has only 100 ms duration, so there is practically no point
4291 break;
4292 case 54508: // Demonic Empowerment
4293 mechanic = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
4298 break;
4299 default:
4300 if (GetMiscValue() < 1)
4301 return;
4302 mechanic = 1 << GetMiscValue();
4304 break;
4305 }
4306
4307 if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
4308 {
4309 // Xinef: exception for purely snare mechanic (eg. hands of freedom)!
4310 if (mechanic == (1 << MECHANIC_SNARE))
4311 target->RemoveMovementImpairingAuras(false);
4312 else
4314 }
4315}
@ MECHANIC_FEAR
Definition SharedDefines.h:1318
@ MECHANIC_DISORIENTED
Definition SharedDefines.h:1315
@ MECHANIC_KNOCKOUT
Definition SharedDefines.h:1327
@ MECHANIC_CHARM
Definition SharedDefines.h:1314
@ MECHANIC_TURN
Definition SharedDefines.h:1336
@ MECHANIC_STUN
Definition SharedDefines.h:1325
@ MECHANIC_FREEZE
Definition SharedDefines.h:1326
@ MECHANIC_ROOT
Definition SharedDefines.h:1320
@ MECHANIC_SLEEP
Definition SharedDefines.h:1323
@ MECHANIC_DAZE
Definition SharedDefines.h:1340
@ MECHANIC_SNARE
Definition SharedDefines.h:1324
@ MECHANIC_SHACKLE
Definition SharedDefines.h:1333
@ MECHANIC_SAPPED
Definition SharedDefines.h:1343
@ MECHANIC_HORROR
Definition SharedDefines.h:1337
#define IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK
Definition SharedDefines.h:1349
@ 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:5465
void RemoveMovementImpairingAuras(bool withRoot)
Definition Unit.cpp:5446

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
5169{
5171 return;
5172
5173 Unit* target = aurApp->GetTarget();
5175 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
5176 return;
5177
5178 if (spellGroupVal)
5179 {
5180 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
5181 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
5182 }
5183 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
5184 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
5185}
@ SPELL_AURA_MOD_MELEE_HASTE
Definition SpellAuraDefines.h:201

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

◆ HandleModOffhandDamagePercent()

void AuraEffect::HandleModOffhandDamagePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5391{
5393 return;
5394
5395 Unit* target = aurApp->GetTarget();
5396
5397 // also handles spell group stacks
5399}
void UpdateDamagePctDoneMods(WeaponAttackType attackType)
Definition Unit.cpp:12285

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

◆ HandleModPercentStat()

void AuraEffect::HandleModPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4593{
4595 return;
4596
4597 Unit* target = aurApp->GetTarget();
4598
4599 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4600 {
4601 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4602 return;
4603 }
4604
4605 // only players currently use base stats
4606 if (!target->IsPlayer())
4607 return;
4608
4609 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
4610 {
4611 if (apply)
4613 else
4614 {
4615 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_PERCENT_STAT, [i](AuraEffect const* aurEff)
4616 {
4617 return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
4618 });
4620 }
4621 }
4622}
@ SPELL_AURA_MOD_PERCENT_STAT
Definition SpellAuraDefines.h:143

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

◆ HandleModPossess()

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

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
3696{
3697 // Used by spell "Eyes of the Beast"
3698
3699 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3700 return;
3701
3702 Unit* caster = GetCaster();
3703 if (!caster || !caster->IsPlayer())
3704 return;
3705
3706 //seems it may happen that when removing it is no longer owner's pet
3707 //if (caster->ToPlayer()->GetPet() != target)
3708 // return;
3709
3710 Unit* target = aurApp->GetTarget();
3711 if (!target->IsCreature() || !target->IsPet())
3712 return;
3713
3714 Pet* pet = target->ToPet();
3715
3716 if (apply)
3717 {
3718 if (caster->ToPlayer()->GetPet() != pet)
3719 return;
3720
3721 // Must clear current motion or pet leashes back to owner after a few yards
3722 // when under spell 'Eyes of the Beast'
3723 pet->GetMotionMaster()->Clear();
3724 pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3725 }
3726 else
3727 {
3728 pet->RemoveCharmedBy(caster);
3729
3730 if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
3731 pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
3732 else
3733 {
3734 // Reinitialize the pet bar or it will appear greyed out
3735 caster->ToPlayer()->PetSpellInitialize();
3736
3737 // Follow owner only if not fighting or owner didn't click "stay" at new location
3738 // This may be confusing because pet bar shows "stay" when under the spell but it retains
3739 // the "follow" flag. Player MUST click "stay" while under the spell.
3740 if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
3741 {
3743 }
3744 }
3745 }
3746}
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:46
constexpr float PET_FOLLOW_DIST
Definition PetDefines.h:206
@ COMMAND_STAY
Definition Unit.h:573
float GetFollowAngle() const override
Definition TemporarySummon.h:93
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE, bool inheritWalkState=true, bool inheritSpeed=true)
The unit will follow this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:447
void Clear(bool reset=true)
Definition MotionMaster.h:193
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition Pet.cpp:881
void PetSpellInitialize()
Definition Player.cpp:9510
Pet * ToPet()
Definition Unit.h:729
CharmInfo * GetCharmInfo()
Definition Unit.h:1276
Unit * GetVictim() const
Definition Unit.h:903
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1347
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
5449{
5451 return;
5452
5453 Unit* target = aurApp->GetTarget();
5454
5455 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5456 if (GetMiscValue() & (1 << i))
5458}
@ 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
5436{
5438 return;
5439
5440 Unit* target = aurApp->GetTarget();
5441
5442 float amount = CalculatePct(1.0f, GetAmount());
5443 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
5444 if (GetMiscValue() & (1 << i))
5446}
@ UNIT_FIELD_POWER_COST_MULTIPLIER
Definition UpdateFields.h:171
void ApplyModSignedFloatValue(uint16 index, float val, bool apply)
Definition Object.cpp:811

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

◆ HandleModPowerRegen()

void AuraEffect::HandleModPowerRegen ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4778{
4780 return;
4781
4782 Unit* target = aurApp->GetTarget();
4783
4784 if (!target->IsPlayer())
4785 return;
4786
4787 // Update manaregen value
4788 if (GetMiscValue() == POWER_MANA)
4789 target->ToPlayer()->UpdateManaRegen();
4790 else if (GetMiscValue() == POWER_ENERGY)
4791 target->ToPlayer()->UpdateEnergyRegen();
4792 else if (GetMiscValue() == POWER_RUNE)
4794 // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate
4795}
@ POWER_RUNE
Definition SharedDefines.h:262
void UpdateRuneRegen(RuneType rune)
Definition StatSystem.cpp:983
void UpdateEnergyRegen()
Definition StatSystem.cpp:973

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

Referenced by HandleModPowerRegenPCT().

◆ HandleModPowerRegenPCT()

void AuraEffect::HandleModPowerRegenPCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4798{
4799 HandleModPowerRegen(aurApp, mode, apply);
4800}
void HandleModPowerRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition SpellAuraEffects.cpp:4777

References HandleModPowerRegen().

◆ HandleModRating()

void AuraEffect::HandleModRating ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5215{
5217 return;
5218
5219 Unit* target = aurApp->GetTarget();
5220
5221 if (!target->IsPlayer())
5222 return;
5223
5224 for (uint8 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5225 if (GetMiscValue() & (1 << rating))
5226 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), GetAmount(), apply);
5227}
#define MAX_COMBAT_RATING
Definition Unit.h:250
CombatRating
Definition Unit.h:222
void ApplyRatingMod(CombatRating cr, int32 value, bool apply)
Definition Player.cpp:5252

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
5230{
5232 return;
5233
5234 Unit* target = aurApp->GetTarget();
5235
5236 if (!target->IsPlayer())
5237 return;
5238
5239 // Just recalculate ratings
5240 for (uint8 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
5241 if (GetMiscValue() & (1 << rating))
5242 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), 0, apply);
5243}

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
4503{
4505 return;
4506
4507 Unit* target = aurApp->GetTarget();
4508
4509 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; i++)
4510 {
4511 if (GetMiscValue() & int32(1 << i))
4512 {
4515 continue;
4516
4518 if (target->IsPlayer() || target->IsPet())
4520 }
4521 }
4522}
@ SPELL_AURA_MOD_RESISTANCE_PCT
Definition SpellAuraDefines.h:164
float GetPctModifierValue(UnitMods unitMod, UnitModifierPctType modifierType) const
Definition Unit.cpp:12175

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

◆ HandleModSpellCritChance()

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

◆ HandleModSpellCritChanceShool()

void AuraEffect::HandleModSpellCritChanceShool ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5060{
5062 return;
5063
5064 Unit* target = aurApp->GetTarget();
5065
5066 if (!target->IsPlayer())
5067 return;
5068
5069 for (int school = SPELL_SCHOOL_NORMAL; school < MAX_SPELL_SCHOOL; ++school)
5070 if (GetMiscValue() & (1 << school))
5071 target->ToPlayer()->UpdateSpellCritChance(school);
5072}
void UpdateSpellCritChance(uint32 school)
Definition StatSystem.cpp:840

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

◆ HandleModSpellDamagePercentFromAttackPower()

void AuraEffect::HandleModSpellDamagePercentFromAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4655{
4657 return;
4658
4659 Unit* target = aurApp->GetTarget();
4660
4661 if (!target->IsPlayer())
4662 return;
4663
4664 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4665 // This information for client side use only
4666 // Recalculate bonus
4668}

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
4625{
4627 return;
4628
4629 Unit* target = aurApp->GetTarget();
4630
4631 if (!target->IsPlayer())
4632 return;
4633
4634 // Magic damage modifiers implemented in Unit::SpellDamageBonus
4635 // This information for client side use only
4636 // Recalculate bonus
4638}

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
4671{
4673 return;
4674
4675 Unit* target = aurApp->GetTarget();
4676
4677 if (!target->IsPlayer())
4678 return;
4679
4680 // Recalculate bonus
4682}

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
4641{
4643 return;
4644
4645 Unit* target = aurApp->GetTarget();
4646
4647 if (!target->IsPlayer())
4648 return;
4649
4650 // Recalculate bonus
4652}

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
5034{
5036 return;
5037
5038 Unit* target = aurApp->GetTarget();
5039
5040 if (target->IsPlayer())
5041 target->ToPlayer()->UpdateSpellHitChances();
5042 else
5043 target->m_modSpellHitChance += (apply) ? GetAmount() : (-GetAmount());
5044}
void UpdateSpellHitChances()
Definition StatSystem.cpp:883
float m_modSpellHitChance
Definition Unit.h:2077

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
3935{
3936 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3937 return;
3938
3939 Unit* target = aurApp->GetTarget();
3940 std::list <AuraType> aura_immunity_list;
3941 uint32 mechanic_immunity_list = 0;
3942 int32 miscVal = GetMiscValue();
3943
3944 switch (miscVal)
3945 {
3946 case 96:
3947 case 1615:
3948 {
3949 if (!GetAmount())
3950 {
3951 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3952 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3953 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3954 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3956 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3957
3970 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
3971 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
3972 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
3973 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
3974 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
3975 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
3976 }
3977 break;
3978 }
3979 case 679:
3980 {
3981 if (GetId() == 57742)
3982 {
3983 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
3984 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
3985 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
3986 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
3988 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
3989
4002 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4003 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4004 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4005 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4006 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4007 }
4008 break;
4009 }
4010 case 1557:
4011 {
4012 if (GetId() == 64187)
4013 {
4014 mechanic_immunity_list = (1 << MECHANIC_STUN);
4016 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4017 }
4018 else
4019 {
4020 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
4021 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
4022 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
4023 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
4025 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
4026
4039 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4040 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4041 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4042 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4043 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4044 }
4045 break;
4046 }
4047 case 1614:
4048 case 1694:
4049 {
4051 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
4052 break;
4053 }
4054 case 1630:
4055 {
4056 if (!GetAmount())
4057 {
4059 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
4060 }
4061 else
4062 {
4063 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
4064 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
4065 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
4066 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
4068 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
4069
4082 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4083 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4084 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4085 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4086 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4087 }
4088 break;
4089 }
4090 case 477:
4091 case 1733:
4092 case 1632:
4093 {
4094 if (!GetAmount())
4095 {
4096 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
4097 | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
4098 | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
4099 | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
4101 | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN) | (1 << MECHANIC_BANISH);
4102
4118 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4119
4120 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4121 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4122 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4123 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4124 }
4125 break;
4126 }
4127 case 878:
4128 {
4129 if (GetAmount() == 1)
4130 {
4131 mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
4132 | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
4133
4138 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4139 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4140 }
4141 break;
4142 }
4143 default:
4144 break;
4145 }
4146
4147 if (aura_immunity_list.empty())
4148 {
4149 // Roots, OK
4150 if (GetMiscValue() & (1 << 0))
4151 {
4152 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4153
4155 aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
4156 }
4157 // Taunt, OK
4158 if (GetMiscValue() & (1 << 1))
4159 {
4160 aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
4161 }
4162 // Crowd-Control auras?
4163 if (GetMiscValue() & (1 << 2))
4164 {
4165 mechanic_immunity_list = (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED);
4166
4169 aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
4170 }
4171 // Interrupt, OK
4172 if (GetMiscValue() & (1 << 3))
4173 {
4174 mechanic_immunity_list = (1 << MECHANIC_INTERRUPT);
4175
4177 }
4178 // Transform?
4179 if (GetMiscValue() & (1 << 4))
4180 {
4181 aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
4182 }
4183 // Stun auras breakable by damage (Incapacitate effects), OK
4184 if (GetMiscValue() & (1 << 5))
4185 {
4186 mechanic_immunity_list = (1 << MECHANIC_KNOCKOUT);
4187
4189 }
4190 // // Slowing effects
4191 if (GetMiscValue() & (1 << 6))
4192 {
4193 mechanic_immunity_list = (1 << MECHANIC_SNARE);
4194
4196 aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
4197 }
4198 // Charm auras?, 90%
4199 if ((GetMiscValue() & (1 << 7)))
4200 {
4201 mechanic_immunity_list = (1 << MECHANIC_CHARM);
4202
4204 aura_immunity_list.push_back(SPELL_AURA_MOD_CHARM);
4205 aura_immunity_list.push_back(SPELL_AURA_MOD_POSSESS);
4206 }
4207 // UNK
4208 // if ((GetMiscValue() & (1 << 8)))
4209 // {
4210 // }
4211 // Fear, OK
4212 if (GetMiscValue() & (1 << 9))
4213 {
4214 mechanic_immunity_list = (1 << MECHANIC_FEAR);
4215
4217 aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
4218 }
4219 // Stuns, OK
4220 if (GetMiscValue() & (1 << 10))
4221 {
4222 mechanic_immunity_list = (1 << MECHANIC_STUN);
4223
4225 aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
4226 }
4227 }
4228
4229 // apply immunities
4230 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4231 target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply);
4232
4233 // Patch 3.0.3 Bladestorm now breaks all snares and roots on the warrior when activated.
4234 if (GetId() == 46924)
4235 {
4236 // Knockback and hex
4238 }
4239
4241 {
4242 target->RemoveAurasWithMechanic(mechanic_immunity_list, AURA_REMOVE_BY_DEFAULT, GetId());
4243 for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
4244 target->RemoveAurasByType(*iter);
4245 }
4246}
@ SPELL_EFFECT_ATTACK_ME
Definition SharedDefines.h:880
@ SPELL_EFFECT_KNOCK_BACK_DEST
Definition SharedDefines.h:910
@ SPELL_EFFECT_KNOCK_BACK
Definition SharedDefines.h:864
@ MECHANIC_INTERRUPT
Definition SharedDefines.h:1339
@ 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
1764{
1766 return;
1767
1768 Unit* target = aurApp->GetTarget();
1770
1771 if (apply)
1772 {
1773 target->m_stealth.AddFlag(type);
1774 target->m_stealth.AddValue(type, GetAmount());
1775
1777 if (target->IsPlayer())
1779
1780 // interrupt autoshot
1782 {
1784 target->ToPlayer()->SendAutoRepeatCancel(target);
1785 }
1786 }
1787 else
1788 {
1789 target->m_stealth.AddValue(type, -GetAmount());
1790
1791 if (!target->HasStealthAura()) // if last SPELL_AURA_MOD_STEALTH
1792 {
1793 target->m_stealth.DelFlag(type);
1794
1796 if (target->IsPlayer())
1798 }
1799 }
1800
1801 // call functions which may have additional effects after chainging state of unit
1802 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1803 {
1804 // drop flag at stealth in bg
1806 }
1807
1808 target->UpdateObjectVisibility(target->IsPlayer() || target->GetOwnerGUID().IsPlayer() || target->GetMap()->Instanceable(), true);
1809 target->bRequestForcedVisibilityUpdate = false;
1810}
@ PLAYER_FIELD_BYTE2_STEALTH
Definition Player.h:553
StealthType
Definition SharedDefines.h:1234
@ UNIT_STAND_FLAGS_CREEP
Definition UnitDefines.h:48
bool HasStealthAura() const
Definition Unit.h:1831
void RemoveStandFlags(uint8 flags)
Definition Unit.h:1777
void SetStandFlags(uint8 flags)
Definition Unit.h:1776
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:606

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

◆ HandleModStealthDetect()

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

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

◆ HandleModStealthLevel()

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

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

◆ HandleModTargetResistance()

void AuraEffect::HandleModTargetResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4540{
4542 return;
4543
4544 Unit* target = aurApp->GetTarget();
4545
4546 // applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
4547
4548 // show armor penetration
4549 if (target->IsPlayer() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
4551
4552 // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
4555}
@ SPELL_SCHOOL_MASK_SPELL
Definition SharedDefines.h:296
@ PLAYER_FIELD_MOD_TARGET_RESISTANCE
Definition UpdateFields.h:366
@ PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE
Definition UpdateFields.h:367

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

◆ HandleModTaunt()

void AuraEffect::HandleModTaunt ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3589{
3590 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3591 return;
3592
3593 Unit* target = aurApp->GetTarget();
3594
3595 if (!target->IsAlive() || !target->CanHaveThreatList())
3596 return;
3597
3598 Unit* caster = GetCaster();
3599 if (!caster || !caster->IsAlive())
3600 return;
3601
3602 if (apply)
3603 target->TauntApply(caster);
3604 else
3605 {
3606 // When taunt aura fades out, mob will switch to previous target if current has less than 1.1 * secondthreat
3607 target->TauntFadeOut(caster);
3608 }
3609}
void TauntApply(Unit *victim)
Definition Unit.cpp:11552
void TauntFadeOut(Unit *taunter)
Definition Unit.cpp:11582

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
3555{
3557 return;
3558
3559 Unit* target = aurApp->GetTarget();
3560 for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
3561 if (GetMiscValue() & (1 << i))
3562 {
3563 if (apply)
3564 AddPct(target->m_threatModifier[i], GetAmount());
3565 else
3566 {
3567 float amount = target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_THREAT, 1 << i);
3568 target->m_threatModifier[i] = amount;
3569 }
3570 }
3571}
@ SPELL_AURA_MOD_THREAT
Definition SpellAuraDefines.h:73
float m_threatModifier[MAX_SPELL_SCHOOL]
Definition Unit.h:2080

References AddPct(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, GetAmount(), GetMiscValue(), AuraApplication::GetTarget(), Unit::GetTotalAuraMultiplierByMiscMask(), Unit::m_threatModifier, MAX_SPELL_SCHOOL, and SPELL_AURA_MOD_THREAT.

◆ HandleModTotalPercentStat()

void AuraEffect::HandleModTotalPercentStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4699{
4701 return;
4702
4703 Unit* target = aurApp->GetTarget();
4704
4705 if (GetMiscValue() < -1 || GetMiscValue() > 4)
4706 {
4707 LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
4708 return;
4709 }
4710
4711 // save current health state
4712 float healthPct = target->GetHealthPct();
4713 bool alive = target->IsAlive();
4714
4715 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4716 {
4717 if (GetMiscValue() == i || GetMiscValue() == -1)
4718 {
4719 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, [i](AuraEffect const* aurEff)
4720 {
4721 return (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1);
4722 });
4723
4724 if (target->GetPctModifierValue(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT) == amount)
4725 continue;
4726
4728 if (target->IsPlayer() || target->IsPet())
4729 target->UpdateStatBuffMod(Stats(i));
4730 }
4731 }
4732
4733 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_UNK4 0x00000010 flag)
4735 target->SetHealth(std::max<uint32>(uint32(healthPct * target->GetMaxHealth() * 0.01f), (alive ? 1 : 0)));
4736}
@ SPELL_ATTR0_IS_ABILITY
Definition SharedDefines.h:374
@ STAT_STAMINA
Definition SharedDefines.h:248
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
Definition SpellAuraDefines.h:200

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

◆ HandleModUnattackable()

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

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

◆ HandleNoImmediateEffect()

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

◆ HandleNoReagentUseAura()

void AuraEffect::HandleNoReagentUseAura ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5479{
5480 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5481 return;
5482
5483 Unit* target = aurApp->GetTarget();
5484
5485 if (!target->IsPlayer())
5486 return;
5487
5488 flag96 mask;
5490 for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
5491 mask |= (*i)->m_spellInfo->Effects[(*i)->m_effIndex].SpellClassMask;
5492
5493 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1, mask[0]);
5494 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 1, mask[1]);
5495 target->SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + 2, mask[2]);
5496}
@ SPELL_AURA_NO_REAGENT_USE
Definition SpellAuraDefines.h:319
@ PLAYER_NO_REAGENT_COST_1
Definition UpdateFields.h:387
Definition Util.h:442

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

◆ HandleNULL()

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

◆ HandleObsModPowerAuraTick()

void AuraEffect::HandleObsModPowerAuraTick ( Unit target,
Unit caster 
) const
7142{
7144 if (GetMiscValue() == POWER_ALL)
7145 PowerType = target->getPowerType();
7146 else
7148
7149 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7150 return;
7151
7152 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7153 {
7154 SendTickImmune(target, caster);
7155 return;
7156 }
7157
7158 // don't regen when permanent aura target has full power
7159 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7160 return;
7161
7162 // ignore negative values (can be result apply spellmods to aura damage
7163 uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(PowerType) / 100;
7164 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7165 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7166 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7167 target->SendPeriodicAuraLog(&pInfo);
7168
7169 int32 gain = target->ModifyPower(PowerType, amount);
7170
7171 if (caster)
7172 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7173}
@ POWER_ALL
Definition SharedDefines.h:265
void SendTickImmune(Unit *target, Unit *caster) const
Definition SpellAuraEffects.cpp:1121
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:11105
uint32 GetMaxPower(Powers power) const
Definition Unit.h:1131
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:6737
std::string ToString(Type &&val, Params &&... params)
Definition StringConvert.h:250
Definition Unit.h:531

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
6640{
6641 if (!target->IsAlive())
6642 return;
6643
6644 if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamageOrSchool(GetSpellInfo()) || target->IsTotem())
6645 {
6646 SendTickImmune(target, caster);
6647 return;
6648 }
6649
6650 // Consecrate ticks can miss and will not show up in the combat log
6651 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6652 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6653 return;
6654
6655 // some auras remove at specific health level or more
6657 {
6658 switch (GetSpellInfo()->Id)
6659 {
6660 case 43093:
6661 case 31956:
6662 case 38801: // Grievous Wound
6663 case 35321:
6664 case 38363:
6665 case 39215: // Gushing Wound
6666 if (target->IsFullHealth())
6667 {
6668 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6669 return;
6670 }
6671 break;
6672 case 38772: // Grievous Wound
6673 {
6674 uint32 percent = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster);
6675 if (!target->HealthBelowPct(percent))
6676 {
6677 target->RemoveAurasDueToSpell(GetSpellInfo()->Id);
6678 return;
6679 }
6680 break;
6681 }
6682 }
6683 }
6684
6686
6687 // ignore non positive values (can be result apply spellmods to aura damage
6688 uint32 damage = std::max(GetAmount(), 0);
6689
6690 // If the damage is percent-max-health based, calculate damage before the Modify hook
6692 {
6693 // xinef: ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
6694 damage = uint32(std::ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
6695 }
6696
6697 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6698 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6699
6700 if (target->GetAI())
6701 {
6702 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6703 }
6704
6706 {
6707 // xinef: leave only target depending bonuses, rest is handled in calculate amount
6708 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE && caster)
6709 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6710 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6711
6712 // Calculate armor mitigation
6714 {
6715 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6716 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6717 damage = damageReductedArmor;
6718 }
6719
6720 }
6721
6722 // calculate crit chance
6723 bool crit = false;
6724 if ((crit = roll_chance_f(GetCritChance())))
6725 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6726
6727 // Auras reducing damage from AOE spells
6729 {
6730 if (GetSpellInfo()->Effects[GetEffIndex()].IsAreaAuraEffect() ||
6731 GetSpellInfo()->Effects[GetEffIndex()].IsTargetingArea() ||
6732 GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA || // some persistent area auras have targets like A=53 B=28
6735 {
6736 bool npcCaster = (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE);
6737 damage = target->CalculateAOEDamageReduction(damage, GetSpellInfo()->SchoolMask, npcCaster);
6738 }
6739 }
6740
6741 int32 dmg = damage;
6742 int32 mitigatedDamage = cleanDamage.mitigated_damage;
6743 if (CanApplyResilience())
6744 {
6745 int32 resilienceReduction = dmg;
6746 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6747
6748 resilienceReduction = dmg - resilienceReduction;
6749 dmg -= resilienceReduction;
6750 mitigatedDamage += resilienceReduction;
6751 }
6752
6753 damage = std::max(0, dmg);
6754 cleanDamage.mitigated_damage = std::max(0, mitigatedDamage);
6755
6756 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6757 Unit::CalcAbsorbResist(dmgInfo);
6758
6759 uint32 absorb = dmgInfo.GetAbsorb();
6760 uint32 resist = dmgInfo.GetResist();
6761 damage = dmgInfo.GetDamage();
6762
6763 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} attacked {} for {} dmg inflicted by {} abs is {}",
6764 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6765 Unit::DealDamageMods(target, damage, &absorb);
6766
6767 // Set trigger flag
6768 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6769 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6771 if (damage)
6772 procEx |= crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT;
6773 if (absorb > 0)
6774 procEx |= PROC_EX_ABSORB;
6775
6776 if (damage)
6777 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6778
6779 int32 overkill = damage - target->GetHealth();
6780 if (overkill < 0)
6781 overkill = 0;
6782
6783 SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit);
6784 target->SendPeriodicAuraLog(&pInfo);
6785
6786 Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
6787
6788 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6789}
bool roll_chance_f(float chance)
Definition Random.h:57
@ EFFECT_1
Definition SharedDefines.h:32
@ SPELL_ATTR7_TREAT_AS_NPC_AOE
Definition SharedDefines.h:655
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
Definition SharedDefines.h:793
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
Definition SharedDefines.h:570
@ SPELL_MISS_NONE
Definition SharedDefines.h:1507
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
Definition SharedDefines.h:526
@ DYNOBJ_AURA_TYPE
Definition SpellAuraDefines.h:386
@ PROC_EX_INTERNAL_DOT
Definition SpellMgr.h:221
@ PROC_EX_CRITICAL_HIT
Definition SpellMgr.h:197
@ PROC_EX_NORMAL_HIT
Definition SpellMgr.h:196
@ PROC_EX_ABSORB
Definition SpellMgr.h:206
@ 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:239
@ MELEE_HIT_NORMAL
Definition Unit.h:292
bool CanApplyResilience() const
Definition SpellAuraEffects.h:112
float GetCritChance() const
Definition SpellAuraEffects.h:109
uint8 GetCasterLevel() const
Definition SpellAuraEffects.h:111
uint32 SchoolMask
Definition SpellInfo.h:392
virtual void OnCalculatePeriodicTickReceived(uint32 &, Unit *)
Called during calculation when receiving periodic healing or damage (DoT or HoT)
Definition UnitAI.h:384
static uint32 CalcArmorReducedDamage(Unit const *attacker, Unit const *victim, const uint32 damage, SpellInfo const *spellInfo, uint8 attackerLevel=0, WeaponAttackType attackType=MAX_ATTACK)
Definition Unit.cpp:2155
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, bool npcCaster) const
Definition Unit.cpp:16533
bool IsFullHealth() const
Definition Unit.h:1109
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spell, bool canReflect=false)
Definition Unit.cpp:3587
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:9251
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1111
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:8765
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
Definition Unit.cpp:15338
static void ProcSkillsAndAuras(Unit *actor, Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellInfo const *procSpellInfo=nullptr, SpellInfo const *procAura=nullptr, int8 procAuraEffectIndex=-1, Spell const *procSpell=nullptr, DamageInfo *damageInfo=nullptr, HealInfo *healInfo=nullptr, uint32 procPhase=2)
Definition Unit.cpp:6703
UnitAI * GetAI()
Definition Unit.h:693
bool IsControlledByPlayer() const
Definition Unit.h:1302
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr, uint8 effIndex=MAX_SPELL_EFFECTS)
Definition Unit.cpp:2132
bool IsImmunedToDamageOrSchool(SpellSchoolMask meleeSchoolMask) const
Definition Unit.cpp:9850
static void CalcAbsorbResist(DamageInfo &dmgInfo, bool Splited=false)
Definition Unit.cpp:2272
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
Definition Unit.cpp:922
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:932
Definition Unit.h:321
uint32 mitigated_damage
Definition Unit.h:326

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

Referenced by PeriodicTick().

◆ HandlePeriodicDummyAuraTick()

void AuraEffect::HandlePeriodicDummyAuraTick ( Unit target,
Unit caster 
) const
6306{
6307 switch (GetSpellInfo()->SpellFamilyName)
6308 {
6309 case SPELLFAMILY_HUNTER:
6310 {
6311 // Explosive Shot
6312 if (GetSpellInfo()->SpellFamilyFlags[1] & 0x80000000)
6313 {
6314 if (caster)
6315 caster->CastCustomSpell(53352, SPELLVALUE_BASE_POINT0, m_amount, target, true, nullptr, this);
6316 break;
6317 }
6318 switch (GetSpellInfo()->Id)
6319 {
6320 // Feeding Frenzy Rank 1
6321 case 53511:
6322 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
6323 target->CastSpell(target, 60096, true, 0, this);
6324 return;
6325 // Feeding Frenzy Rank 2
6326 case 53512:
6327 if (target->GetVictim() && target->GetVictim()->HealthBelowPct(35))
6328 target->CastSpell(target, 60097, true, 0, this);
6329 return;
6330 default:
6331 break;
6332 }
6333 break;
6334 }
6336 switch (GetId())
6337 {
6338 case 49016: // Hysteria
6339 uint32 damage = uint32(target->CountPctFromMaxHealth(1));
6340 Unit::DealDamage(target, target, damage, nullptr, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
6341 break;
6342 }
6343 // Blood of the North
6344 // Reaping
6345 // Death Rune Mastery
6346 if (GetSpellInfo()->SpellIconID == 3041 || GetSpellInfo()->SpellIconID == 22 || GetSpellInfo()->SpellIconID == 2622)
6347 {
6348 if (!target->IsPlayer())
6349 return;
6351 return;
6352
6353 // timer expired - remove death runes
6354 target->ToPlayer()->RemoveRunesByAuraEffect(this);
6355 }
6356 break;
6357 default:
6358 break;
6359 }
6360}
@ SPELLFAMILY_HUNTER
Definition SharedDefines.h:3777
@ SPELLFAMILY_DEATHKNIGHT
Definition SharedDefines.h:3783
@ SPELLVALUE_BASE_POINT0
Definition SpellDefines.h:113
@ NODAMAGE
Definition Unit.h:258
uint32 CountPctFromMaxHealth(int32 pct) const
Definition Unit.h:1116

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

Referenced by PeriodicTick().

◆ HandlePeriodicEnergizeAuraTick()

void AuraEffect::HandlePeriodicEnergizeAuraTick ( Unit target,
Unit caster 
) const
7176{
7178
7180 return;
7181
7182 if (!target->IsAlive() || !target->GetMaxPower(PowerType))
7183 return;
7184
7185 if (target->HasUnitState(UNIT_STATE_ISOLATED))
7186 {
7187 SendTickImmune(target, caster);
7188 return;
7189 }
7190
7191 // don't regen when permanent aura target has full power
7192 if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
7193 return;
7194
7195 // ignore negative values (can be result apply spellmods to aura damage
7196 int32 amount = std::max(m_amount, 0);
7197
7198 SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
7199 target->SendPeriodicAuraLog(&pInfo);
7200
7201 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
7202 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
7203 int32 gain = target->ModifyPower(PowerType, amount);
7204
7205 if (caster)
7206 target->getHostileRefMgr().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
7207}
@ SPELL_ATTR7_ONLY_IN_SPELLBOOK_UNTIL_LEARNED
Definition SharedDefines.h:645
virtual bool HasActivePowerType(Powers power)
Definition Unit.h:1127

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
6931{
6932 if (!target->IsAlive())
6933 return;
6934
6935 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6936 {
6937 SendTickImmune(target, caster);
6938 return;
6939 }
6940
6941 // heal for caster damage (must be alive)
6942 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST) && (!caster || !caster->IsAlive()))
6943 return;
6944
6945 // don't regen when permanent aura target has full power
6946 if (GetBase()->IsPermanent() && target->IsFullHealth())
6947 return;
6948
6949 // ignore negative values (can be result apply spellmods to aura damage
6950 int32 damage = std::max(m_amount, 0);
6951
6953 {
6954 // Taken mods
6955 float TakenTotalMod = 1.0f;
6956
6957 // Tenacity increase healing % taken
6958 if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0))
6959 AddPct(TakenTotalMod, Tenacity->GetAmount());
6960
6961 // Healing taken percent
6962 float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6963 if (minval)
6964 AddPct(TakenTotalMod, minval);
6965
6966 float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT);
6967 if (maxval)
6968 AddPct(TakenTotalMod, maxval);
6969
6970 // Healing over time taken percent
6971 float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6972 if (minval_hot)
6973 AddPct(TakenTotalMod, minval_hot);
6974
6975 float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT);
6976 if (maxval_hot)
6977 AddPct(TakenTotalMod, maxval_hot);
6978
6979 // Arena / BG Dampening
6980 float minval_pct = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
6981 if (minval_pct)
6982 AddPct(TakenTotalMod, minval_pct);
6983
6984 TakenTotalMod = std::max(TakenTotalMod, 0.0f);
6985
6986 // the most ugly hack i made :P the other option is to change all spellvalues to float...
6987 // demonic aegis
6988 if (caster && GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARLOCK && (GetSpellInfo()->SpellFamilyFlags[1] & 0x20000000))
6990 AddPct(TakenTotalMod, aurEff->GetAmount());
6991
6992 damage = uint32(target->CountPctFromMaxHealth(damage));
6993 damage = uint32(damage * TakenTotalMod);
6994 }
6995 else
6996 {
6997 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6998 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6999 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
7000 }
7001
7002 bool crit = false;
7003 if ((crit = roll_chance_f(GetCritChance())))
7004 damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target);
7005
7006 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} heal of {} for {} health inflicted by {}",
7007 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId());
7008
7009 uint32 heal = uint32(damage);
7010
7011 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
7012 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, heal, GetSpellInfo());
7013 sScriptMgr->ModifyHealReceived(target, caster, heal, GetSpellInfo());
7014
7015 if (target->GetAI())
7016 {
7017 target->GetAI()->OnCalculatePeriodicTickReceived(heal, caster);
7018 }
7019
7020 HealInfo healInfo(caster, target, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
7021 Unit::CalcHealAbsorb(healInfo);
7022 int32 gain = Unit::DealHeal(caster, target, healInfo.GetHeal());
7023 healInfo.SetEffectiveHeal(gain);
7024
7025 SpellPeriodicAuraLogInfo pInfo(this, healInfo.GetHeal(), healInfo.GetHeal() - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit);
7026 target->SendPeriodicAuraLog(&pInfo);
7027
7028 if (caster)
7029 {
7030 float threat = float(gain) * 0.5f;
7031 if (caster->IsClass(CLASS_PALADIN))
7032 threat *= 0.5f;
7033
7034 target->getHostileRefMgr().threatAssist(caster, threat, GetSpellInfo());
7035 }
7036
7037 bool haveCastItem = GetBase()->GetCastItemGUID();
7038
7039 // Health Funnel
7040 // damage caster for heal amount
7041 // xinef: caster is available, checked earlier
7042 if (target != caster && GetSpellInfo()->HasAttribute(SPELL_ATTR2_NO_TARGET_PER_SECOND_COST))
7043 {
7044 uint32 manaPerSecond = GetSpellInfo()->ManaPerSecond;
7045 if ((int32)manaPerSecond > gain && gain > 0)
7046 {
7047 manaPerSecond = gain;
7048 }
7049
7050 uint32 absorb2 = 0;
7051 Unit::DealDamageMods(caster, manaPerSecond, &absorb2);
7052
7054 Unit::DealDamage(caster, caster, manaPerSecond, &cleanDamage, SELF_DAMAGE, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
7055 }
7056
7057 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
7058 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
7060 if (healInfo.GetAbsorb() > 0)
7061 procEx |= PROC_EX_ABSORB;
7062
7063 // ignore item heals
7064 if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH) // xinef: dont allow obs_mod_health to proc spells, this is passive regeneration and not hot
7065 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, heal, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, nullptr, &healInfo);
7066}
@ SPELL_ATTR2_NO_TARGET_PER_SECOND_COST
Definition SharedDefines.h:455
@ CLASS_PALADIN
Definition SharedDefines.h:127
@ SPELLFAMILY_WARLOCK
Definition SharedDefines.h:3773
@ 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:222
@ SELF_DAMAGE
Definition Unit.h:259
ObjectGuid GetCastItemGUID() const
Definition SpellAuras.h:103
Definition Unit.h:383
uint32 ManaPerSecond
Definition SpellInfo.h:365
static void CalcHealAbsorb(HealInfo &healInfo)
Definition Unit.cpp:2620
static int32 DealHeal(Unit *healer, Unit *victim, uint32 addhealth)
Definition Unit.cpp:7939
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
Definition Unit.cpp:6235
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit const *victim)
Definition Unit.cpp:9291
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
Definition Unit.cpp:6240
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack=1)
Definition Unit.cpp:9535

References AddPct(), BASE_ATTACK, Unit::CalcHealAbsorb(), CLASS_PALADIN, Unit::CountPctFromMaxHealth(), Unit::DealDamage(), Unit::DealDamageMods(), Unit::DealHeal(), DOT, DYNOBJ_AURA_TYPE, 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(), Unit::HasUnitState(), Unit::IsAlive(), Unit::IsClass(), Unit::IsFullHealth(), LOG_DEBUG, m_amount, SpellInfo::ManaPerSecond, MELEE_HIT_NORMAL, UnitAI::OnCalculatePeriodicTickReceived(), PROC_EX_ABSORB, PROC_EX_CRITICAL_HIT, PROC_EX_INTERNAL_HOT, PROC_EX_NORMAL_HIT, PROC_FLAG_DONE_PERIODIC, PROC_FLAG_TAKEN_PERIODIC, Unit::ProcSkillsAndAuras(), roll_chance_f(), SELF_DAMAGE, Unit::SendPeriodicAuraLog(), SendTickImmune(), HealInfo::SetEffectiveHeal(), SPELL_ATTR2_NO_TARGET_PER_SECOND_COST, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_MOD_HEALING_DONE_PERCENT, SPELL_AURA_MOD_HEALING_PCT, SPELL_AURA_MOD_HOT_PCT, SPELL_AURA_OBS_MOD_HEALTH, Unit::SpellCriticalHealingBonus(), SPELLFAMILY_WARLOCK, Unit::SpellHealingBonusDone(), Unit::SpellHealingBonusTaken(), sScriptMgr, HostileRefMgr::threatAssist(), ObjectGuid::ToString(), and UNIT_STATE_ISOLATED.

Referenced by PeriodicTick().

◆ HandlePeriodicHealthFunnelAuraTick()

void AuraEffect::HandlePeriodicHealthFunnelAuraTick ( Unit target,
Unit caster 
) const
6902{
6903 if (!caster || !caster->IsAlive() || !target->IsAlive())
6904 return;
6905
6906 if (target->HasUnitState(UNIT_STATE_ISOLATED))
6907 {
6908 SendTickImmune(target, caster);
6909 return;
6910 }
6911
6912 uint32 damage = std::max(GetAmount(), 0);
6913 // do not kill health donator
6914 if (caster->GetHealth() < damage)
6915 damage = caster->GetHealth() - 1;
6916 if (!damage)
6917 return;
6918
6919 caster->ModifyHealth(-(int32)damage);
6920 LOG_DEBUG("spells.aura", "PeriodicTick: donator {} target {} damage {}.", caster->GetEntry(), target->GetEntry(), damage);
6921
6922 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6923
6924 damage = int32(damage * gainMultiplier);
6925
6926 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6927 caster->HealBySpell(healInfo);
6928}
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:8229

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
6792{
6793 if (!target->IsAlive())
6794 return;
6795
6797 {
6798 SendTickImmune(target, caster);
6799 return;
6800 }
6801
6802 if (caster && GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
6803 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
6804 return;
6805
6807
6808 uint32 damage = std::max(GetAmount(), 0);
6809
6810 // Script Hook For HandlePeriodicHealthLeechAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
6811 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage, GetSpellInfo());
6812
6813 if (target->GetAI())
6814 {
6815 target->GetAI()->OnCalculatePeriodicTickReceived(damage, caster);
6816 }
6817
6818 if (GetBase()->GetType() == DYNOBJ_AURA_TYPE)
6819 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount());
6820 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
6821
6822 bool crit = false;
6823 if ((crit = roll_chance_f(GetCritChance())))
6824 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
6825
6826 // Calculate armor mitigation
6828 {
6829 uint32 damageReductedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetCasterLevel());
6830 cleanDamage.mitigated_damage += damage - damageReductedArmor;
6831 damage = damageReductedArmor;
6832 }
6833
6834 int32 dmg = damage;
6835 int32 cleanDamageAmount = cleanDamage.mitigated_damage;
6836 if (CanApplyResilience())
6837 {
6838 int32 resilienceReduction = dmg;
6839 Unit::ApplyResilience(target, nullptr, &resilienceReduction, crit, CR_CRIT_TAKEN_SPELL);
6840
6841 resilienceReduction = dmg - resilienceReduction;
6842 dmg -= resilienceReduction;
6843 cleanDamageAmount += resilienceReduction;
6844 }
6845
6846 damage = std::max(0, dmg);
6847 cleanDamage.mitigated_damage = std::max(0, cleanDamageAmount);
6848
6849 DamageInfo dmgInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, cleanDamage.mitigated_damage);
6850 Unit::CalcAbsorbResist(dmgInfo);
6851
6852 uint32 absorb = dmgInfo.GetAbsorb();
6853 uint32 resist = dmgInfo.GetResist();
6854 damage = dmgInfo.GetDamage();
6855
6856 // Set trigger flag
6857 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
6858 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
6860 if (dmgInfo.GetDamage())
6861 procEx |= crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT;
6862 if (absorb > 0)
6863 procEx |= PROC_EX_ABSORB;
6864
6865 if (dmgInfo.GetDamage())
6866 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
6867
6868 if (target->GetHealth() < dmgInfo.GetDamage())
6869 {
6870 dmgInfo.ModifyDamage(dmgInfo.GetDamage() - target->GetHealth());
6871 }
6872
6873 damage = dmgInfo.GetDamage();
6874
6875 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} health leech of {} for {} dmg inflicted by {} abs is {}",
6876 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
6877 if (caster)
6878 caster->SendSpellNonMeleeDamageLog(target, GetSpellInfo(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
6879
6880 int32 new_damage;
6881
6882 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
6883
6884 Unit::ProcSkillsAndAuras(caster, target, caster ? procAttacker : 0, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo(), nullptr, GetEffIndex(), nullptr, &dmgInfo);
6885
6886 if (!caster || !caster->IsAlive())
6887 return;
6888
6889 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
6890
6891 uint32 heal = uint32(caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetEffIndex(), 0.0f, GetBase()->GetStackAmount()));
6892 heal = uint32(caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT, GetBase()->GetStackAmount()));
6893
6894 HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
6895 float threat = float(caster->HealBySpell(healInfo)) * 0.5f;
6896 if (caster->IsClass(CLASS_PALADIN))
6897 threat *= 0.5f;
6898 caster->getHostileRefMgr().threatAssist(caster, threat, GetSpellInfo());
6899}
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
Definition Unit.cpp:6636

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

Referenced by PeriodicTick().

◆ HandlePeriodicManaLeechAuraTick()

void AuraEffect::HandlePeriodicManaLeechAuraTick ( Unit target,
Unit caster 
) const
7069{
7071
7072 if (!caster || !caster->IsAlive() || !target->IsAlive() || !target->HasActivePowerType(PowerType))
7073 return;
7074
7076 {
7077 SendTickImmune(target, caster);
7078 return;
7079 }
7080
7081 if (GetSpellInfo()->Effects[GetEffIndex()].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA &&
7082 caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
7083 return;
7084
7085 // ignore negative values (can be result apply spellmods to aura damage
7086 int32 drainAmount = std::max(m_amount, 0);
7087
7088 // Special case: draining x% of mana (up to a maximum of 2*x% of the caster's maximum mana)
7089 // It's mana percent cost spells, m_amount is percent drain from target
7091 {
7092 // max value
7093 int32 maxmana = CalculatePct(caster->GetMaxPower(PowerType), drainAmount * 2.0f);
7094 ApplyPct(drainAmount, target->GetMaxPower(PowerType));
7095 if (drainAmount > maxmana)
7096 drainAmount = maxmana;
7097 }
7098
7099 LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} power leech of {} for {} dmg inflicted by {}",
7100 GetCasterGUID().ToString(), target->GetGUID().ToString(), drainAmount, GetId());
7101 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
7102 if (PowerType == POWER_MANA)
7103 drainAmount -= target->GetSpellCritDamageReduction(drainAmount);
7104
7105 int32 drainedAmount = -target->ModifyPower(PowerType, -drainAmount);
7106
7107 float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
7108
7109 SpellPeriodicAuraLogInfo pInfo(this, drainedAmount, 0, 0, 0, gainMultiplier, false);
7110 target->SendPeriodicAuraLog(&pInfo);
7111
7112 int32 gainAmount = int32(drainedAmount * gainMultiplier);
7113 int32 gainedAmount = 0;
7114 if (gainAmount)
7115 {
7116 gainedAmount = caster->ModifyPower(PowerType, gainAmount);
7117 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
7118 }
7119
7120 target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
7121
7122 // remove CC auras
7124
7125 // Drain Mana
7127 && m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
7128 {
7129 int32 manaFeedVal = 0;
7130 if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
7131 manaFeedVal = aurEff->GetAmount();
7132 // Mana Feed - Drain Mana
7133 if (manaFeedVal > 0)
7134 {
7135 int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
7136 caster->CastCustomSpell(caster, 32554, &feedAmount, nullptr, nullptr, true, nullptr, this);
7137 }
7138 }
7139}
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
Definition SpellDefines.h:44
T ApplyPct(T &base, U pct)
Definition Util.h:64
uint32 GetSpellCritDamageReduction(uint32 damage) const
Definition Unit.h:1271

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
7210{
7212
7213 if (!caster || !target->IsAlive() || !target->HasActivePowerType(PowerType))
7214 return;
7215
7217 {
7218 SendTickImmune(target, caster);
7219 return;
7220 }
7221
7222 // ignore negative values (can be result apply spellmods to aura damage
7223 int32 damage = std::max(m_amount, 0);
7224
7225 // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
7226 if (PowerType == POWER_MANA)
7227 damage -= target->GetSpellCritDamageReduction(damage);
7228
7229 uint32 gain = uint32(-target->ModifyPower(PowerType, -damage));
7230
7231 float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
7232
7233 SpellInfo const* spellProto = GetSpellInfo();
7234 // maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
7235 SpellNonMeleeDamage damageInfo(caster, target, spellProto, spellProto->SchoolMask);
7236 // no SpellDamageBonus for burn mana
7237 caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto);
7238
7239 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
7240
7241 caster->SendSpellNonMeleeDamageLog(&damageInfo);
7242
7243 // Set trigger flag
7244 uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
7245 uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
7246 if (damageInfo.damage)
7247 procVictim |= PROC_FLAG_TAKEN_DAMAGE;
7248
7249 caster->DealSpellDamage(&damageInfo, true);
7250
7251 DamageInfo dmgInfo(damageInfo, DOT, BASE_ATTACK, SPELL_MISS_NONE);
7252 uint32 hitMask = dmgInfo.GetHitMask() | PROC_EX_INTERNAL_DOT;
7253 Unit::ProcSkillsAndAuras(caster, damageInfo.target, procAttacker, procVictim, hitMask, damageInfo.damage, BASE_ATTACK, spellProto, nullptr, GetEffIndex(), nullptr, &dmgInfo);
7254}
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss, Spell const *spell=nullptr)
Definition Unit.cpp:1578
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
Definition Unit.cpp:1435
Definition Unit.h:508

References SpellNonMeleeDamage::absorb, BASE_ATTACK, Unit::CalculateSpellDamageTaken(), SpellNonMeleeDamage::damage, Unit::DealDamageMods(), Unit::DealSpellDamage(), DOT, SpellInfo::Effects, GetEffIndex(), DamageInfo::GetHitMask(), GetMiscValue(), Unit::GetSpellCritDamageReduction(), GetSpellInfo(), Unit::HasActivePowerType(), Unit::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::ProcSkillsAndAuras(), 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
6363{
6364 // generic casting code with custom spells and target/caster customs
6365 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
6366
6367 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6368 SpellInfo const* auraSpellInfo = GetSpellInfo();
6369 uint32 auraId = auraSpellInfo->Id;
6370
6371 // specific code for cases with no trigger spell provided in field
6372 if (!triggeredSpellInfo)
6373 {
6374 switch (auraSpellInfo->SpellFamilyName)
6375 {
6377 {
6378 switch (auraId)
6379 {
6380 // Thaumaturgy Channel
6381 case 9712:
6382 triggerSpellId = 21029;
6383 if (caster)
6384 caster->CastSpell(caster, triggerSpellId, true);
6385 return;
6386 // Brood Affliction: Bronze
6387 case 23170:
6388 // Only 10% chance of triggering spell
6389 if (roll_chance_f(10.f))
6390 {
6391 triggerSpellId = 23171;
6392 }
6393 break;
6394 // Restoration
6395 case 24379:
6396 case 23493:
6397 {
6398 if (caster)
6399 {
6400 int32 heal = caster->CountPctFromMaxHealth(10);
6401 HealInfo healInfo(caster, target, heal, auraSpellInfo, auraSpellInfo->GetSchoolMask());
6402 caster->HealBySpell(healInfo);
6403
6404 if (int32 mana = caster->GetMaxPower(POWER_MANA))
6405 {
6406 mana /= 10;
6407 caster->EnergizeBySpell(caster, 23493, mana, POWER_MANA);
6408 }
6409 }
6410 return;
6411 }
6412 // Nitrous Boost
6413 case 27746:
6414 if (caster && target->GetPower(POWER_MANA) >= 10)
6415 {
6416 target->ModifyPower(POWER_MANA, -10);
6417 target->SendEnergizeSpellLog(caster, 27746, 10, POWER_MANA);
6418 }
6419 else
6420 target->RemoveAurasDueToSpell(27746);
6421 return;
6422 // Frost Blast
6423 case 27808:
6424 if (caster)
6425 {
6426 caster->CastSpell(target, 29879, true, nullptr, this);
6427 if (GetTickNumber() == 1)
6428 caster->CastSpell(target, 27808, true);
6429 }
6430 return;
6431 // Inoculate Nestlewood Owlkin
6432 case 29528:
6433 if (!target->IsCreature()) // prevent error reports in case ignored player target
6434 return;
6435 break;
6436 // Feed Captured Animal
6437 case 29917:
6438 triggerSpellId = 29916;
6439 break;
6440 // Extract Gas
6441 case 30427:
6442 {
6443 // move loot to player inventory and despawn target
6444 if (caster && caster->IsPlayer() &&
6445 target->IsCreature() &&
6447 {
6448 Player* player = caster->ToPlayer();
6449 Creature* creature = target->ToCreature();
6450 // missing lootid has been reported on startup - just return
6451 if (!creature->GetCreatureTemplate()->SkinLootId)
6452 return;
6453
6455
6456 creature->DespawnOrUnsummon();
6457 }
6458 return;
6459 }
6460 // Quake
6461 case 30576:
6462 triggerSpellId = 30571;
6463 break;
6464 // Doom
6466 // so instakill will be naturally done before trigger spell
6467 case 31347:
6468 {
6469 target->CastSpell(target, 31350, true, nullptr, this);
6470 Unit::Kill(target, target);
6471 return;
6472 }
6473 // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam
6474 case 39857:
6475 triggerSpellId = 39856;
6476 break;
6477 // Personalized Weather
6478 case 46736:
6479 triggerSpellId = 46737;
6480 break;
6481 // Shield Level 1
6482 case 63130:
6483 // Shield Level 2
6484 case 63131:
6485 // Shield Level 3
6486 case 63132:
6487 // Ball of Flames Visual
6488 case 71706:
6489 return;
6490 // Oculus, Mage-Lord Urom, Time Bomb
6491 case 51121:
6492 case 59376:
6493 {
6494 const int32 dmg = target->GetMaxHealth() - target->GetHealth();
6495 target->CastCustomSpell(target, 51132, &dmg, 0, 0, true);
6496 return;
6497 }
6498 }
6499 break;
6500 }
6501 default:
6502 break;
6503 }
6504 }
6505 else
6506 {
6507 // Spell exist but require custom code
6508 switch (auraId)
6509 {
6510 // Poison (Grobbulus)
6511 case 28158:
6512 case 54362:
6513 // Slime Pool (Dreadscale & Acidmaw)
6514 case 66882:
6515 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)((((float)m_tickNumber / 60) * 0.9f + 0.1f) * 10000 * 2 / 3), nullptr, true, nullptr, this);
6516 return;
6517 // Eye of Eternity, Malygos, Arcane Overload
6518 case 56432:
6519 if (triggerSpellId == 56438)
6520 {
6521 target->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, (int32)(10000 * (1.0f - 0.02f * (m_tickNumber + 1))), nullptr, true, nullptr, this);
6522 return;
6523 }
6524 break;
6525 // Beacon of Light
6526 case 53563:
6527 {
6528 // area aura owner casts the spell
6529 GetBase()->GetUnitOwner()->CastSpell(target, triggeredSpellInfo, true, 0, this, GetBase()->GetUnitOwner()->GetGUID());
6530 return;
6531 }
6532 // Trial of the Crusader, Jaraxxus, Spinning Pain Spike
6533 case 66283:
6534 {
6535 const int32 dmg = target->GetMaxHealth() / 2;
6536 target->CastCustomSpell(target, 66316, &dmg, nullptr, nullptr, true);
6537 return;
6538 }
6539 // Violet Hold, Moragg, Ray of Suffering, Ray of Pain
6540 case 54442:
6541 case 59524:
6542 case 54438:
6543 case 59523:
6544 {
6545 if (caster)
6546 if (Unit* victim = caster->GetVictim())
6547 if (victim->GetDistance(caster) < 45.0f)
6548 {
6549 target = victim;
6550 break;
6551 }
6552 return;
6553 }
6554 case 24745: // Summon Templar, Trigger
6555 case 24747: // Summon Templar Fire, Trigger
6556 case 24757: // Summon Templar Air, Trigger
6557 case 24759: // Summon Templar Earth, Trigger
6558 case 24761: // Summon Templar Water, Trigger
6559 case 24762: // Summon Duke, Trigger
6560 case 24766: // Summon Duke Fire, Trigger
6561 case 24769: // Summon Duke Air, Trigger
6562 case 24771: // Summon Duke Earth, Trigger
6563 case 24773: // Summon Duke Water, Trigger
6564 case 24785: // Summon Royal, Trigger
6565 case 24787: // Summon Royal Fire, Trigger
6566 case 24791: // Summon Royal Air, Trigger
6567 case 24792: // Summon Royal Earth, Trigger
6568 case 24793: // Summon Royal Water, Trigger
6569 {
6570 // All this spells trigger a spell that requires reagents; if the
6571 // triggered spell is cast as "triggered", reagents are not consumed
6572 if (caster)
6573 caster->CastSpell(target, triggerSpellId, false);
6574 return;
6575 }
6576 }
6577 }
6578
6579 // Reget trigger spell proto
6580 triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId);
6581
6582 if (triggeredSpellInfo)
6583 {
6584 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6585 {
6586 SpellCastTargets targets;
6587 targets.SetUnitTarget(target);
6588 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6589 {
6592 }
6593
6594 // Xinef: do not skip reagent cost for entry casts
6596 if (GetSpellInfo()->Effects[GetEffIndex()].TargetA.GetCheckType() == TARGET_CHECK_ENTRY || GetSpellInfo()->Effects[GetEffIndex()].TargetB.GetCheckType() == TARGET_CHECK_ENTRY)
6598
6599 triggerCaster->CastSpell(targets, triggeredSpellInfo, nullptr, triggerFlags, nullptr, this);
6600 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6601 }
6602 }
6603}
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
@ CREATURE_TYPE_GAS_CLOUD
Definition SharedDefines.h:2618
@ 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
uint32 GetTickNumber() const
Definition SpellAuraEffects.h:87
Unit * GetUnitOwner() const
Definition SpellAuras.h:108
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2142
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const &store, bool broadcast=false)
Definition Player.cpp:13482
Definition Spell.h:112
void SetUnitTarget(Unit *target)
Definition Spell.cpp:238
void SetObjectTargetChannel(ObjectGuid targetGUID)
Definition Spell.cpp:453
void SetDstChannel(SpellDestination const &spellDest)
Definition Spell.cpp:458
bool IsChannelCategorySpell() const
Definition SpellInfo.cpp:1084
void EnergizeBySpell(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:8256
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:14121
void SendEnergizeSpellLog(Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
Definition Unit.cpp:8245
SpellDestination spellDst
Definition Spell.h:253
ObjectGuid channelGUID
Definition Spell.h:252
uint32 type
Definition CreatureData.h:218
uint32 SkinLootId
Definition CreatureData.h:222

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

Referenced by PeriodicTick().

◆ HandlePeriodicTriggerSpellWithValueAuraTick()

void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick ( Unit target,
Unit caster 
) const
6606{
6607 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
6608 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
6609 {
6610 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? caster : target)
6611 {
6612 SpellCastTargets targets;
6613 targets.SetUnitTarget(target);
6614 if (triggeredSpellInfo->IsChannelCategorySpell() && m_channelData)
6615 {
6618 }
6619
6620 CustomSpellValues values;
6622
6623 triggerCaster->CastSpell(targets, triggeredSpellInfo, &values, TRIGGERED_FULL_MASK, nullptr, this);
6624 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
6625 }
6626 }
6627 else
6628 {
6629 Creature* c = target->ToCreature();
6630 if (c && caster)
6631 {
6632 sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), target->ToCreature());
6633 }
6634
6635 LOG_DEBUG("spells.aura", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex());
6636 }
6637}
SpellEffIndex
Definition SharedDefines.h:30
Definition SpellDefines.h:165
void AddSpellMod(SpellValueMod mod, int32 value)
Definition SpellDefines.h:167

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

Referenced by PeriodicTick().

◆ HandlePhase()

void AuraEffect::HandlePhase ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1925{
1926 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1927 return;
1928
1929 Unit* target = aurApp->GetTarget();
1930
1931 // no-phase is also phase state so same code for apply and remove
1932 uint32 newPhase = target->GetPhaseByAuras();
1933
1934 if (Player* player = target->ToPlayer())
1935 {
1936 if (!newPhase)
1937 newPhase = PHASEMASK_NORMAL;
1938
1939 // do not change phase to GM with all phases enabled
1940 if (player->IsGameMaster())
1941 newPhase = PHASEMASK_ANYWHERE;
1942
1943 player->SetPhaseMask(newPhase, false);
1944 player->GetSession()->SendSetPhaseShift(newPhase);
1945 }
1946 else
1947 {
1948 if (!newPhase)
1949 {
1950 newPhase = PHASEMASK_NORMAL;
1951 if (Creature* creature = target->ToCreature())
1952 if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetSpawnId()))
1953 newPhase = data->phaseMask;
1954 }
1955
1956 target->SetPhaseMask(newPhase, false);
1957 }
1958
1959 // call functions which may have additional effects after chainging state of unit
1960 // phase auras normally not expected at BG but anyway better check
1961 if (apply)
1962 {
1963 // drop flag at invisibiliy in bg
1965 }
1966
1967 // need triggering visibility update base at phase update of not GM invisible (other GMs anyway see in any phases)
1968 if (target->IsVisible())
1969 {
1970 if (!target->GetMap()->Instanceable())
1971 {
1972 target->UpdateObjectVisibility(false);
1973 target->m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f);
1974 }
1975 else
1976 target->UpdateObjectVisibility();
1977 }
1978}
@ PHASEMASK_ANYWHERE
Definition Object.h:63
@ PHASEMASK_NORMAL
Definition Object.h:62
uint32 GetPhaseByAuras() const
Definition Unit.cpp:15449
bool IsVisible() const
Definition Unit.h:2003
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Unit.cpp:15460
Position m_last_notify_position
Definition Unit.h:2100
Definition CreatureData.h:371
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.
3656{
3657 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3658 return;
3659
3660 Unit* target = aurApp->GetTarget();
3661 // Since patch 3.0.2 this mechanic no longer affects fear effects. It will ONLY prevent humanoids from fleeing due to low health.
3662 if (target->IsPlayer() || !apply || target->HasFearAura())
3663 return;
3666 target->SetControlled(false, UNIT_STATE_FLEEING);
3667}
bool HasFearAura() const
Definition Unit.h:1826

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
6292{
6293 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6294 return;
6295
6296 if (!aurApp->GetTarget()->IsPlayer())
6297 return;
6298
6299 if (apply)
6300 aurApp->GetTarget()->RemoveByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6301 else if (!aurApp->GetTarget()->GetMap()->Instanceable())
6302 aurApp->GetTarget()->SetByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER);
6303}
@ PLAYER_FIELD_BYTE_RELEASE_TIMER
Definition Player.h:545

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

◆ HandleProc()

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

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

Referenced by Aura::TriggerProcOnEvent().

◆ HandleProcTriggerDamageAuraProc()

void AuraEffect::HandleProcTriggerDamageAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7305{
7306 Unit* target = aurApp->GetTarget();
7307 Unit* triggerTarget = target == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
7308 if (!triggerTarget)
7309 return;
7310 if (triggerTarget->HasUnitState(UNIT_STATE_ISOLATED) || triggerTarget->IsImmunedToDamageOrSchool(GetSpellInfo()))
7311 {
7312 SendTickImmune(triggerTarget, target);
7313 return;
7314 }
7315
7316 SpellNonMeleeDamage damageInfo(target, triggerTarget, GetSpellInfo(), GetSpellInfo()->SchoolMask);
7317 uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE, GetEffIndex());
7318 damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
7319 target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo());
7320 Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
7321 target->SendSpellNonMeleeDamageLog(&damageInfo);
7322 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering {} spell damage from aura {} proc", damage, GetId());
7323 target->DealSpellDamage(&damageInfo, true);
7324}
Unit * GetActionTarget() const
Definition Unit.h:460

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

Referenced by HandleProc().

◆ HandleProcTriggerSpellAuraProc()

void AuraEffect::HandleProcTriggerSpellAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7267{
7268 Unit* triggerCaster = aurApp->GetTarget();
7269 Unit* triggerTarget = triggerCaster == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
7270
7271 uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell;
7272 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
7273 {
7274 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell {} from aura {} proc", triggeredSpellInfo->Id, GetId());
7275 triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, nullptr, this);
7276 }
7277 else
7278 {
7279 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());
7280 }
7281}

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

Referenced by HandleProc().

◆ HandleProcTriggerSpellWithValueAuraProc()

void AuraEffect::HandleProcTriggerSpellWithValueAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7284{
7285 Unit* triggerCaster = aurApp->GetTarget();
7286 Unit* triggerTarget = triggerCaster == eventInfo.GetActor() ? eventInfo.GetActionTarget() : eventInfo.GetActor();
7287
7288 uint32 triggerSpellId = GetSpellInfo()->Effects[m_effIndex].TriggerSpell;
7289 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId))
7290 {
7291 // used only with EXTRA_LOGS
7292 (void)triggeredSpellInfo;
7293
7294 int32 basepoints0 = GetAmount();
7295 LOG_DEBUG("spells.aura", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell {} with value {} from aura {} proc", triggeredSpellInfo->Id, basepoints0, GetId());
7296 triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, nullptr, nullptr, true, nullptr, this);
7297 }
7298 else
7299 {
7300 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());
7301 }
7302}

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

Referenced by HandleProc().

◆ HandleRaidProcFromChargeAuraProc()

void AuraEffect::HandleRaidProcFromChargeAuraProc ( AuraApplication aurApp,
ProcEventInfo eventInfo 
)
7327{
7328 Unit* target = aurApp->GetTarget();
7329
7330 uint32 triggerSpellId;
7331 switch (GetId())
7332 {
7333 case 57949: // Shiver
7334 triggerSpellId = 57952;
7335 //animationSpellId = 57951; dummy effects for jump spell have unknown use (see also 41637)
7336 break;
7337 case 59978: // Shiver
7338 triggerSpellId = 59979;
7339 break;
7340 case 43593: // Cold Stare
7341 triggerSpellId = 43594;
7342 break;
7343 default:
7344 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: {}", GetId());
7345 return;
7346 }
7347
7348 int32 jumps = GetBase()->GetCharges();
7349
7350 // current aura expire on proc finish
7351 GetBase()->SetCharges(0);
7352 GetBase()->SetUsingCharges(true);
7353
7354 // next target selection
7355 if (jumps > 0)
7356 {
7357 if (Unit* caster = GetCaster())
7358 {
7359 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7360
7361 if (Unit* triggerTarget = target->GetNextRandomRaidMemberOrPet(radius))
7362 {
7363 target->CastSpell(triggerTarget, GetSpellInfo(), true, nullptr, this, GetCasterGUID());
7364 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7365 aura->SetCharges(jumps);
7366 }
7367 }
7368 }
7369
7370 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell {} from aura {} proc", triggerSpellId, GetId());
7371 target->CastSpell(target, triggerSpellId, true, nullptr, this, GetCasterGUID());
7372}
void SetUsingCharges(bool val)
Definition SpellAuras.h:201
uint8 GetCharges() const
Definition SpellAuras.h:141
Unit * GetNextRandomRaidMemberOrPet(float radius)
Definition Unit.cpp:8102

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 
)
7375{
7376 enum
7377 {
7378 SPELL_PRAYER_OF_MENDING_HEAL = 33110,
7379 SPELL_PRAYER_OF_MENDING_VISUAL = 41637
7380 };
7381
7382 Unit* target = aurApp->GetTarget();
7383
7384 // Currently only Prayer of Mending
7385 if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20))
7386 {
7387 LOG_DEBUG("spells.aura", "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: {}", GetId());
7388 return;
7389 }
7390
7391 int32 value = GetAmount();
7392
7393 int32 jumps = GetBase()->GetCharges();
7394
7395 // current aura expire on proc finish
7396 GetBase()->SetCharges(0);
7397 GetBase()->SetUsingCharges(true);
7398
7399 // next target selection
7400 if (jumps > 0)
7401 {
7402 if (Unit* caster = GetCaster())
7403 {
7404 float radius = GetSpellInfo()->Effects[GetEffIndex()].CalcRadius(caster);
7405
7406 Unit* triggerTarget = nullptr;
7407 Acore::MostHPMissingGroupInRange u_check(target, radius, 0);
7408 Acore::UnitLastSearcher<Acore::MostHPMissingGroupInRange> searcher(target, triggerTarget, u_check);
7409 Cell::VisitObjects(target, searcher, radius);
7410
7411 if (triggerTarget)
7412 {
7413 target->CastSpell(triggerTarget, SPELL_PRAYER_OF_MENDING_VISUAL, true);
7414 target->CastCustomSpell(triggerTarget, GetId(), &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7415 if (Aura* aura = triggerTarget->GetAura(GetId(), GetCasterGUID()))
7416 aura->SetCharges(jumps);
7417 }
7418 }
7419 }
7420
7421 target->CastCustomSpell(target, SPELL_PRAYER_OF_MENDING_HEAL, &value, nullptr, nullptr, true, nullptr, this, GetCasterGUID());
7422}
Definition GridNotifiers.h:1512
Definition GridNotifiers.h:397

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

Referenced by HandleProc().

◆ HandleRangedAmmoHaste()

void AuraEffect::HandleRangedAmmoHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5198{
5200 return;
5201
5202 Unit* target = aurApp->GetTarget();
5203
5204 if (!target->IsPlayer())
5205 return;
5206
5207 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5208}

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

◆ HandleShapeshiftBoosts()

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

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

Referenced by HandleAuraModShapeshift().

◆ HandleShieldBlockValue()

void AuraEffect::HandleShieldBlockValue ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5402{
5404 return;
5405
5406 Player* target = aurApp->GetTarget()->ToPlayer();
5407 if (!target)
5408 return;
5409
5410 target->HandleBaseModFlatValue(SHIELD_BLOCK_VALUE, float(GetAmount()), apply);
5411}
@ SHIELD_BLOCK_VALUE
Definition Unit.h:189
void HandleBaseModFlatValue(BaseModGroup modGroup, float amount, bool apply)
Definition Player.cpp:4931

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

◆ HandleShieldBlockValuePercent()

void AuraEffect::HandleShieldBlockValuePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5414{
5416 return;
5417
5418 Player* target = aurApp->GetTarget()->ToPlayer();
5419 if (!target)
5420 return;
5421
5422 if (apply)
5424 else
5425 {
5427 target->SetBaseModPctValue(SHIELD_BLOCK_VALUE, amount);
5428 }
5429}
@ SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
Definition SpellAuraDefines.h:213
void SetBaseModPctValue(BaseModGroup modGroup, float val)
Definition Player.cpp:4966
void ApplyBaseModPctValue(BaseModGroup modGroup, float pct)
Definition Player.cpp:4944

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

◆ HandleSpiritOfRedemption()

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

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

◆ HandleUnused()

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

◆ HandleWaterBreathing()

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

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

◆ HasSpellClassMask()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

Referenced by Unit::CalcArmorReducedDamage().

◆ IsAffectedOnSpell()

◆ IsPeriodic()

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

References m_isPeriodic.

Referenced by Spell::prepare().

◆ PeriodicTick()

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

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

Referenced by Update().

◆ RecalculateAmount() [1/2]

◆ RecalculateAmount() [2/2]

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

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

◆ ResetPeriodic()

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

References m_amplitude, m_periodicTimer, and m_tickNumber.

Referenced by spell_dk_death_rune::HandleProc().

◆ ResetTicks()

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

References m_tickNumber.

◆ SendTickImmune()

◆ SetAmount()

◆ SetCanBeRecalculated()

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

References m_canBeRecalculated.

Referenced by Aura::SetLoadedState().

◆ SetCritChance()

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

References m_critChance.

Referenced by CalculatePeriodicData().

◆ SetEnabled()

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

References m_isAuraEnabled.

◆ SetOldAmount()

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

References m_oldAmount.

Referenced by CalculateAmount().

◆ SetPctMods()

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

References m_pctMods.

◆ SetPeriodic()

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

References m_isPeriodic.

Referenced by spell_gen_arena_drink::UpdatePeriodic().

◆ SetPeriodicTimer()

◆ Update()

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

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

Referenced by Aura::UpdateOwner().

◆ UpdatePeriodic()

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

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

Referenced by Update().

Friends And Related Symbol Documentation

◆ Aura::_InitEffects

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

◆ Unit::_TryStackingOrRefreshingExistingAura

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

Member Data Documentation

◆ m_amount

◆ m_amplitude

int32 AuraEffect::m_amplitude
private

◆ m_applyResilience

bool AuraEffect::m_applyResilience
private

Referenced by AuraEffect(), and CanApplyResilience().

◆ m_base

Aura* const AuraEffect::m_base
private

Referenced by GetBase().

◆ m_baseAmount

int32 const AuraEffect::m_baseAmount
private

Referenced by CalculateAmount(), and GetBaseAmount().

◆ m_canBeRecalculated

bool AuraEffect::m_canBeRecalculated
private

◆ m_casterLevel

uint8 AuraEffect::m_casterLevel
private

Referenced by AuraEffect(), and GetCasterLevel().

◆ m_channelData

◆ m_critChance

float AuraEffect::m_critChance
private

Referenced by GetCritChance(), and SetCritChance().

◆ m_dieSides

int32 const AuraEffect::m_dieSides
private

Referenced by GetDieSides().

◆ m_effIndex

◆ m_isAuraEnabled

bool AuraEffect::m_isAuraEnabled
private

Referenced by GetAmount(), and SetEnabled().

◆ m_isPeriodic

bool AuraEffect::m_isPeriodic
private

◆ m_isRecalculatingPassiveAuras

bool AuraEffect::m_isRecalculatingPassiveAuras = false
private

Referenced by ApplySpellMod().

◆ m_oldAmount

int32 AuraEffect::m_oldAmount
private

Referenced by GetOldAmount(), and SetOldAmount().

◆ m_pctMods

float AuraEffect::m_pctMods
private

◆ m_periodicTimer

int32 AuraEffect::m_periodicTimer
private

◆ m_spellInfo

◆ m_spellmod

SpellModifier* AuraEffect::m_spellmod
private

◆ m_tickNumber


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