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

Private Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

AuraEffect::~AuraEffect ( )
private
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
383 :
384 m_base(base), m_spellInfo(base->GetSpellInfo()),
385 m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_critChance(0),
386 m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
388{
389 CalculatePeriodic(caster, true, false);
391
392 m_amount = CalculateAmount(caster);
393 m_casterLevel = caster ? caster->GetLevel() : 0;
394 m_applyResilience = caster && caster->CanApplyResilience();
395 m_auraGroup = sSpellMgr->GetSpellGroup(GetId());
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}
@ UNIT_FIELD_CHANNEL_OBJECT
Definition: UpdateFields.h:93
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:980
#define sSpellMgr
Definition: SpellMgr.h:818
ObjectGuid GetGuidValue(uint16 index) const
Definition: Object.cpp:337
bool CanApplyResilience() const
Definition: Unit.h:2427
uint8 GetLevel() const
Definition: Unit.h:1420
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:2061
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:126
bool m_applyResilience
Definition: SpellAuraEffects.h:125
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition: SpellAuraEffects.cpp:587
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:678
int32 m_oldAmount
Definition: SpellAuraEffects.h:133
uint32 GetId() const
Definition: SpellAuraEffects.cpp:432
int32 CalculateAmount(Unit *caster)
Definition: SpellAuraEffects.cpp:452
int32 m_amount
Definition: SpellAuraEffects.h:127
void CalculatePeriodicData()
Definition: SpellAuraEffects.cpp:572
uint32 m_tickNumber
Definition: SpellAuraEffects.h:142
int32 const m_baseAmount
Definition: SpellAuraEffects.h:123
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:122
bool m_isAuraEnabled
Definition: SpellAuraEffects.h:134
bool m_isPeriodic
Definition: SpellAuraEffects.h:146
uint32 m_auraGroup
Definition: SpellAuraEffects.h:132
float m_critChance
Definition: SpellAuraEffects.h:128
Aura *const m_base
Definition: SpellAuraEffects.h:120
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:100
Definition: Spell.h:241
Definition: Spell.h:284
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:391

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

Member Function Documentation

◆ ApplySpellMod()

void AuraEffect::ApplySpellMod ( Unit target,
bool  apply 
)
794{
795 if (!m_spellmod || target->GetTypeId() != TYPEID_PLAYER)
796 return;
797
798 target->ToPlayer()->AddSpellMod(m_spellmod, apply);
799
800 // Auras with charges do not mod amount of passive auras
801 if (GetBase()->IsUsingCharges())
802 return;
803 // reapply some passive spells after add/remove related spellmods
804 // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
805 switch (GetMiscValue())
806 {
808 case SPELLMOD_EFFECT1:
809 case SPELLMOD_EFFECT2:
810 case SPELLMOD_EFFECT3:
811 {
812 ObjectGuid guid = target->GetGUID();
813 Unit::AuraApplicationMap& auras = target->GetAppliedAuras();
814 for (Unit::AuraApplicationMap::iterator iter = auras.begin(); iter != auras.end(); ++iter)
815 {
816 Aura* aura = iter->second->GetBase();
817 // only passive and permament auras-active auras should have amount set on spellcast and not be affected
818 // if aura is casted by others, it will not be affected
819 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
820 {
822 {
823 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
824 {
825 if (AuraEffect* aurEff = aura->GetEffect(i))
826 aurEff->RecalculateAmount();
827 }
828 }
829 else if (GetMiscValue() == SPELLMOD_EFFECT1)
830 {
831 if (AuraEffect* aurEff = aura->GetEffect(0))
832 aurEff->RecalculateAmount();
833 }
834 else if (GetMiscValue() == SPELLMOD_EFFECT2)
835 {
836 if (AuraEffect* aurEff = aura->GetEffect(1))
837 aurEff->RecalculateAmount();
838 }
839 else //if (modOp == SPELLMOD_EFFECT3)
840 {
841 if (AuraEffect* aurEff = aura->GetEffect(2))
842 aurEff->RecalculateAmount();
843 }
844 }
845 }
846
847 Pet* pet = target->ToPlayer()->GetPet();
848 if (!pet)
849 break;
850
851 ObjectGuid petguid = pet->GetGUID();
852 Unit::AuraApplicationMap& petauras = pet->GetAppliedAuras();
853 for (Unit::AuraApplicationMap::iterator iter = petauras.begin(); iter != petauras.end(); ++iter)
854 {
855 Aura* aura = iter->second->GetBase();
856 // only passive auras-active auras should have amount set on spellcast and not be affected
857 // if aura is casted by others, it will not be affected
858 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == petguid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
859 {
861 {
862 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
863 {
864 if (AuraEffect* aurEff = aura->GetEffect(i))
865 aurEff->RecalculateAmount();
866 }
867 }
868 else if (GetMiscValue() == SPELLMOD_EFFECT1)
869 {
870 if (AuraEffect* aurEff = aura->GetEffect(0))
871 aurEff->RecalculateAmount();
872 }
873 else if (GetMiscValue() == SPELLMOD_EFFECT2)
874 {
875 if (AuraEffect* aurEff = aura->GetEffect(1))
876 aurEff->RecalculateAmount();
877 }
878 else //if (modOp == SPELLMOD_EFFECT3)
879 {
880 if (AuraEffect* aurEff = aura->GetEffect(2))
881 aurEff->RecalculateAmount();
882 }
883 }
884 }
885 }
886 default:
887 break;
888 }
889}
std::uint8_t uint8
Definition: Define.h:110
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SPELLMOD_EFFECT2
Definition: SpellDefines.h:89
@ SPELLMOD_ALL_EFFECTS
Definition: SpellDefines.h:85
@ SPELLMOD_EFFECT3
Definition: SpellDefines.h:100
@ SPELLMOD_EFFECT1
Definition: SpellDefines.h:80
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1610
Player * ToPlayer()
Definition: Object.h:195
TypeID GetTypeId() const
Definition: Object.h:121
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
Definition: ObjectGuid.h:120
Definition: Pet.h:40
Pet * GetPet() const
Definition: Player.cpp:8784
void AddSpellMod(SpellModifier *mod, bool apply)
Definition: Player.cpp:9785
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:1299
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1924
Definition: SpellAuraEffects.h:39
int32 GetMiscValue() const
Definition: SpellAuraEffects.cpp:442
Aura * GetBase() const
Definition: SpellAuraEffects.h:49
Definition: SpellAuras.h:87
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:105
AuraEffect * GetEffect(uint8 effIndex) const
Definition: SpellAuras.h:175
bool IsPassive() const
Definition: SpellAuras.cpp:1096
bool IsPermanent() const
Definition: SpellAuras.h:139
bool IsAffectedBySpellMod(SpellModifier const *mod) const
Definition: SpellInfo.cpp:1277

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

Referenced by HandleEffect().

◆ CalcPeriodicCritChance()

float AuraEffect::CalcPeriodicCritChance ( Unit const *  caster,
Unit const *  target 
) const
private
1039{
1040 float critChance = 0.0f;
1041 if (caster)
1042 {
1043 if (Player* modOwner = caster->GetSpellModOwner())
1044 {
1045 Unit::AuraEffectList const& mPeriodicCritAuras = modOwner->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
1046 for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
1047 {
1048 if ((*itr)->IsAffectedOnSpell(GetSpellInfo()))
1049 {
1050 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
1051 break;
1052 }
1053 }
1054
1055 switch(GetSpellInfo()->SpellFamilyName)
1056 {
1057 // Rupture - since 3.3.3 can crit
1058 case SPELLFAMILY_ROGUE:
1059 if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100000)
1060 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
1061 break;
1062 }
1063 }
1064 }
1065 if (target && critChance > 0.0f)
1066 critChance = target->SpellTakenCritChance(caster, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), critChance, BASE_ATTACK, true);
1067
1068 return std::max(0.0f, critChance);
1069}
@ BASE_ATTACK
Definition: Unit.h:396
@ RANGED_ATTACK
Definition: Unit.h:398
@ SPELL_AURA_ABILITY_PERIODIC_CRIT
Definition: SpellAuraDefines.h:349
@ SPELL_DAMAGE_CLASS_RANGED
Definition: SharedDefines.h:1520
@ SPELLFAMILY_ROGUE
Definition: SharedDefines.h:3508
Definition: Player.h:1046
Player * GetSpellModOwner() const
Definition: Unit.cpp:16751
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1306
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:54

References BASE_ATTACK, GetSpellInfo(), Unit::GetSpellModOwner(), RANGED_ATTACK, SPELL_AURA_ABILITY_PERIODIC_CRIT, SPELL_DAMAGE_CLASS_RANGED, SPELLFAMILY_ROGUE, 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 m_canBeRecalculated = false;
498 if (!m_spellInfo->ProcFlags || m_spellInfo->HasAura(SPELL_AURA_PROC_TRIGGER_SPELL)) // xinef: skip auras with proctriggerspell, they must have procflags...
499 break;
500 amount = int32(GetBase()->GetUnitOwner()->CountPctFromMaxHealth(10));
501 if (caster)
502 {
503 // Glyphs increasing damage cap
505 for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
506 {
507 if ((*itr)->IsAffectedOnSpell(m_spellInfo))
508 {
509 // Glyph of Fear, Glyph of Frost nova and similar auras
510 if ((*itr)->GetMiscValue() == 7801)
511 {
512 AddPct(amount, (*itr)->GetAmount());
513 break;
514 }
515 }
516 }
517 }
518 break;
521 m_canBeRecalculated = false;
522 break;
524 // Titan's Grip
525 if (!caster)
526 break;
527 if (GetId() == 49152 && caster->ToPlayer())
528 {
529 Item* item1 = caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
530 Item* item2 = caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
531
532 if (item1 && item2 && (item1->GetTemplate()->InventoryType == INVTYPE_2HWEAPON || item2->GetTemplate()->InventoryType == INVTYPE_2HWEAPON))
533 amount = -10;
534 else
535 amount = 0;
536 }
537 break;
538 default:
539 break;
540 }
541
542 // xinef: save base amount, before calculating sp etc. Used for Unit::CastDelayedSpellWithPeriodicAmount
543 SetOldAmount(amount * GetBase()->GetStackAmount());
545
546 // Xinef: Periodic auras
547 if (caster)
548 switch (GetAuraType())
549 {
552 // xinef: save caster depending auras, always pass 1 as stack amount, effect will be multiplicated at the end of the function by correct value!
553 if (GetBase()->GetType() == UNIT_AURA_TYPE)
554 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
555 break;
557 if (GetBase()->GetType() == UNIT_AURA_TYPE)
558 amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
559 break;
561 if (GetBase()->GetType() == UNIT_AURA_TYPE)
562 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE, 0.0f, 1);
563 break;
564 default:
565 break;
566 }
567
568 amount *= GetBase()->GetStackAmount();
569 return amount;
570}
std::int32_t int32
Definition: Define.h:104
std::uint32_t uint32
Definition: Define.h:108
T AddPct(T &base, U pct)
Definition: Util.h:67
DBCStorage< SpellItemEnchantmentEntry > sSpellItemEnchantmentStore(SpellItemEnchantmentfmt)
DBCStorage< ItemRandomSuffixEntry > sItemRandomSuffixStore(ItemRandomSuffixfmt)
@ INVTYPE_2HWEAPON
Definition: ItemTemplate.h:282
@ OFF_ATTACK
Definition: Unit.h:397
@ DOT
Definition: Unit.h:437
@ SPELL_DIRECT_DAMAGE
Definition: Unit.h:436
@ 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
#define MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS
Definition: DBCStructure.h:1814
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition: DBCStructure.h:1183
Definition: Item.h:214
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:546
uint32 InventoryType
Definition: ItemTemplate.h:641
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition: PlayerStorage.cpp:519
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1967
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:12370
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:11566
void SetOldAmount(int32 amount)
Definition: SpellAuraEffects.h:116
AuraType GetAuraType() const
Definition: SpellAuraEffects.cpp:447
float GetPctMods() const
Definition: SpellAuraEffects.h:111
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:56
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: SpellAuras.cpp:2521
uint8 GetStackAmount() const
Definition: SpellAuras.h:148
uint32 Id
Definition: SpellInfo.h:318
uint32 ProcFlags
Definition: SpellInfo.h:353
bool HasAura(AuraType aura) const
Definition: SpellInfo.cpp:877
Definition: DBCStructure.h:1196
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > AllocationPct
Definition: DBCStructure.h:1203
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition: DBCStructure.h:1201
Definition: DBCStructure.h:1817
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition: DBCStructure.h:1823

References AddPct(), ItemRandomSuffixEntry::AllocationPct, BASE_ATTACK, Aura::CallScriptEffectCalcAmountHandlers(), DOT, SpellInfo::Effects, ItemRandomSuffixEntry::Enchantment, Unit::GetAuraEffectsByType(), GetAuraType(), GetBase(), GetEffIndex(), GetId(), GetPctMods(), 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, 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(), 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.
588{
590
591 // prepare periodics
592 switch (GetAuraType())
593 {
595 // 3 spells have no amplitude set
596 if (!m_amplitude)
598 [[fallthrough]];
612 m_isPeriodic = true;
613 break;
614 default:
615 break;
616 }
617
619
620 if (!m_isPeriodic)
621 return;
622
623 // Xinef: fix broken data in dbc
624 if (m_amplitude <= 0)
625 m_amplitude = 1000;
626
627 Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
628
629 // Apply casting time mods
630 if (m_amplitude)
631 {
632 // Apply periodic time mod
633 if (modOwner)
635
636 if (caster)
637 {
640 }
641 }
642
643 if (load) // aura loaded from db
644 {
648 ++m_tickNumber;
649 }
650 else // aura just created or reapplied
651 {
652 m_tickNumber = 0;
653 // reset periodic timer on aura create or on reapply when aura isn't dot
654 // possibly we should not reset periodic timers only when aura is triggered by proc
655 // or maybe there's a spell attribute somewhere
656 bool resetPeriodicTimer = create
658
659 if (resetPeriodicTimer)
660 {
661 m_periodicTimer = 0;
662 // Start periodic on next tick or at aura apply
663 if (m_amplitude)
664 {
667 else if (caster && caster->IsTotem()) // for totems only ;d
668 {
669 m_periodicTimer = 100; // make it ALMOST instant
670 if (!GetBase()->IsPassive())
671 GetBase()->SetDuration(GetBase()->GetDuration() + 100);
672 }
673 }
674 }
675 }
676}
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
@ UNIT_MOD_CAST_SPEED
Definition: UpdateFields.h:137
@ 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:96
@ SPELL_ATTR5_EXTRA_INITIAL_PERIOD
Definition: SharedDefines.h:548
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition: SharedDefines.h:552
float GetFloatValue(uint16 index) const
Definition: Object.cpp:317
void ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell *spell=nullptr, bool temporaryPet=false)
Definition: Player.cpp:9627
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition: Unit.cpp:5650
bool IsTotem() const
Definition: Unit.h:1415
int32 m_amplitude
Definition: SpellAuraEffects.h:141
int32 GetDuration() const
Definition: SpellAuras.h:133
void SetDuration(int32 duration, bool withMods=false)
Definition: SpellAuras.cpp:882
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition: SpellAuras.cpp:2535
bool HasAttribute(SpellAttr0 attribute) const
Definition: SpellInfo.h:412

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::spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic(), and Aura::SetLoadedState().

◆ CalculatePeriodicData()

void AuraEffect::CalculatePeriodicData ( )
573{
574 // xinef: save caster depending auras with pct mods
575 if (GetBase()->GetType() == UNIT_AURA_TYPE && GetCaster())
576 {
581 }
582
583 if (GetCaster())
584 SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : nullptr)));
585}
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:12278
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:11235
float CalcPeriodicCritChance(Unit const *caster, Unit const *target) const
Definition: SpellAuraEffects.cpp:1038
float m_pctMods
Definition: SpellAuraEffects.h:129
Unit * GetCaster() const
Definition: SpellAuraEffects.h:47
void SetCritChance(float crit)
Definition: SpellAuraEffects.h:108

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 ( )
679{
680 switch (GetAuraType())
681 {
684 if (!m_spellmod)
685 {
688
689 m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
691 m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
693 }
695 break;
696 default:
697 break;
698 }
700}
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:76
Definition: Player.h:182
int16 charges
Definition: Player.h:186
SpellModOp op
Definition: Player.h:184
SpellModType type
Definition: Player.h:185
int32 value
Definition: Player.h:187
uint32 spellId
Definition: Player.h:189
flag96 mask
Definition: Player.h:188
int32 GetAmount() const
Definition: SpellAuraEffects.h:63
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition: SpellAuras.cpp:2549
uint8 GetCharges() const
Definition: SpellAuras.h:141

References Aura::CallScriptEffectCalcSpellModHandlers(), SpellModifier::charges, SpellInfo::Effects, GetAmount(), GetAuraType(), GetBase(), Aura::GetCharges(), 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 
)
703{
704 // Reapply if amount change
705 uint8 handleMask = 0;
706 if (newAmount != GetAmount())
708 if (onStackOrReapply)
709 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
710
711 if (!handleMask)
712 return;
713
714 std::list<AuraApplication*> effectApplications;
715 GetApplicationList(effectApplications);
716
717 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
718 if ((*apptItr)->HasEffect(GetEffIndex()))
719 HandleEffect(*apptItr, handleMask, false);
720
721 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
722 {
723 if (!mark)
724 m_amount = newAmount;
725 else
726 SetAmount(newAmount);
728 }
729
730 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
731 if ((*apptItr)->HasEffect(GetEffIndex()))
732 HandleEffect(*apptItr, handleMask, true);
733}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
Definition: SpellAuraDefines.h:44
@ AURA_EFFECT_HANDLE_REAPPLY
Definition: SpellAuraDefines.h:45
void GetApplicationList(std::list< AuraApplication * > &applicationList) const
Definition: SpellAuraEffects.cpp:422
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition: SpellAuraEffects.cpp:735
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:65

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

Referenced by spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), RecalculateAmount(), Unit::RemoveMovementImpairingAuras(), and Aura::SetStackAmount().

◆ CleanupTriggeredSpells()

void AuraEffect::CleanupTriggeredSpells ( Unit target)
Todo:
: is there a spell flag, which can solve this in a more sophisticated way?
1180{
1181 uint32 tSpellId = m_spellInfo->Effects[GetEffIndex()].TriggerSpell;
1182 if (!tSpellId)
1183 return;
1184
1185 SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
1186 if (!tProto)
1187 return;
1188
1189 if (tProto->GetDuration() != -1)
1190 return;
1191
1192 // needed for spell 43680, maybe others
1196 return;
1197
1198 target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
1199}
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4835
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:48
Definition: SpellInfo.h:314
int32 GetDuration() const
Definition: SpellInfo.cpp:2321

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
63{ return m_isAuraEnabled ? m_amount : 0; }

References m_amount, and m_isAuraEnabled.

Referenced by Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), Pet::_SaveAuras(), spell_dru_survival_instincts_aura::AfterApply(), spell_the_lich_king_necrotic_plague_jump::spell_the_lich_king_necrotic_plague_AuraScript::AfterDispel(), spell_dru_lifebloom::AfterRemove(), spell_mage_living_bomb::AfterRemove(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), spell_sha_earth_shield::CalculateAmount(), CalculateSpellMod(), ChangeAmount(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), spell_nether_portal_perseverence::HandleApply(), spell_warl_glyph_of_felguard::HandleApply(), spell_pri_renew::HandleApplyEffect(), HandleAuraDummy(), HandleAuraIncreaseBaseHealthPercent(), HandleAuraLinked(), HandleAuraModAttackPower(), HandleAuraModAttackPowerPercent(), HandleAuraModBaseResistancePCT(), HandleAuraModCritPct(), HandleAuraModFakeInebriation(), HandleAuraModIncreaseEnergy(), HandleAuraModIncreaseEnergyPercent(), HandleAuraModIncreaseHealth(), HandleAuraModIncreaseHealthPercent(), HandleAuraModIncreaseMaxHealth(), HandleAuraModRangedAttackPower(), HandleAuraModRangedAttackPowerPercent(), HandleAuraModRangedHaste(), HandleAuraModResistance(), HandleAuraModResistanceExclusive(), HandleAuraModSkill(), HandleAuraModStat(), HandleAuraModTotalThreat(), HandleAuraModWeaponCritPercent(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), Aura::HandleAuraSpecificMods(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), spell_shadowfang_keep_haunting_spirits::spell_shadowfang_keep_haunting_spirits_AuraScript::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::spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic(), spell_hallows_end_base_fire::HandleEffectPeriodicUpdate(), spell_gen_burn_brutallus::HandleEffectPeriodicUpdate(), spell_sha_item_t10_elemental_2p_bonus::HandleEffectProc(), HandleModAttackSpeed(), HandleModBaseResistance(), HandleModCastingSpeed(), HandleModCombatSpeedPct(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModHitChance(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModMeleeRangedSpeedPct(), HandleModMeleeSpeedPct(), HandleModOffhandDamagePercent(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModRating(), HandleModResistancePercent(), HandleModSpellCritChance(), HandleModSpellHitChance(), HandleModStateImmunityMask(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModThreat(), HandleModTotalPercentStat(), Unit::HandleOverrideClassScriptAuraProc(), spell_dk_chains_of_ice_aura::HandlePeriodic(), spell_ragin_flames_inferno::spell_ragin_flames_inferno_AuraScript::HandlePeriodic(), spell_dk_death_and_decay_aura::HandlePeriodic(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_hun_sniper_training::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dru_living_seed_proc::HandleProc(), spell_sha_earth_shield::HandleProc(), spell_oculus_temporal_rift::spell_oculus_temporal_rift_AuraScript::HandleProc(), spell_dk_wandering_plague_aura::HandleProc(), spell_dru_t10_balance_4p_bonus::HandleProc(), spell_dru_living_seed::HandleProc(), spell_hun_glyph_of_arcane_shot::HandleProc(), spell_item_necrotic_touch::HandleProc(), spell_mage_burnout::HandleProc(), spell_mage_master_of_elements::HandleProc(), spell_pal_sacred_shield_base::HandleProc(), spell_pri_divine_aegis::HandleProc(), spell_pri_glyph_of_prayer_of_healing::HandleProc(), spell_sha_t10_restoration_4p_bonus::HandleProc(), spell_hun_lock_and_load::HandleProcs(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), HandleRangedAmmoHaste(), spell_warl_haunt_aura::HandleRemove(), spell_warl_glyph_of_felguard::HandleRemove(), HandleShieldBlockValue(), spell_hun_sniper_training::HandleUpdatePeriodic(), Aura::IsAuraStronger(), spell_valanar_kinetic_bomb_absorb::spell_valanar_kinetic_bomb_absorb_AuraScript::OnAbsorb(), spell_alar_ember_blast_death::spell_alar_ember_blast_death_AuraScript::OnApply(), spell_the_lich_king_necrotic_plague_jump::spell_the_lich_king_necrotic_plague_AuraScript::OnDispel(), spell_kalecgos_curse_of_boundless_agony::spell_kalecgos_curse_of_boundless_agony_AuraScript::OnPeriodic(), spell_xt002_gravity_bomb_aura::spell_xt002_gravity_bomb_aura_AuraScript::OnPeriodic(), spell_lurker_below_spout::spell_lurker_below_spout_AuraScript::OnPeriodic(), spell_blood_queen_essence_of_the_blood_queen::spell_blood_queen_essence_of_the_blood_queen_AuraScript::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::spell_sindragosa_instability_AuraScript::OnRemove(), spell_the_lich_king_necrotic_plague_jump::spell_the_lich_king_necrotic_plague_AuraScript::OnRemove(), spell_shield_of_runes::spell_shield_of_runes_AuraScript::OnRemove(), spell_xt002_gravity_bomb_aura::spell_xt002_gravity_bomb_aura_AuraScript::OnRemove(), spell_xt002_searing_light_spawn_life_spark::spell_xt002_searing_light_spawn_life_spark_AuraScript::OnRemove(), spell_ulduar_stone_grip::spell_ulduar_stone_grip_AuraScript::OnRemoveStun(), spell_the_lich_king_infest::spell_the_lich_king_infest_AuraScript::OnUpdate(), spell_karazhan_overload::spell_karazhan_overload_AuraScript::PeriodicTick(), spell_icc_yh_volley::spell_icc_yh_volley_AuraScript::PrepareAuraScript(), spell_serpentshrine_cavern_infection::spell_serpentshrine_cavern_infection_AuraScript::PrepareAuraScript(), Unit::ProcDamageAndSpellFor(), Unit::RemoveAurasDueToSpellBySteal(), ArenaSpectator::ShouldSendAura(), spell_mother_shahraz_fatal_attraction_aura::spell_mother_shahraz_fatal_attraction_aura_AuraScript::Update(), spell_black_temple_shadow_inferno::spell_black_temple_shadow_inferno_AuraScript::Update(), spell_black_temple_spell_absorption::spell_black_temple_spell_absorption_AuraScript::Update(), Player::UpdateAttackPowerAndDamage(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetAmplitude()

int32 AuraEffect::GetAmplitude ( ) const
inline

◆ 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:181
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:90

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

Referenced by ChangeAmount(), and Update().

◆ GetAuraGroup()

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

References m_auraGroup.

Referenced by AuraApplication::_HandleEffect().

◆ 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 Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), Unit::_RegisterAuraEffect(), CalculateAmount(), CalculatePeriodic(), CalculateSpellMod(), HandleArenaPreparation(), HandleAuraAllowFlight(), HandleAuraEmpathy(), HandleAuraFeatherFall(), HandleAuraHover(), HandleAuraModDisarm(), HandleAuraModIncreaseFlightSpeed(), HandleAuraModSchoolImmunity(), HandleAuraModSkill(), HandleAuraModStalked(), HandleAuraTrackStealthed(), HandleAuraUntrackable(), HandleAuraWaterWalk(), HandleComprehendLanguage(), HandleEffect(), spell_dk_pet_scaling::HandleEffectApply(), spell_dru_treant_scaling::HandleEffectApply(), spell_pet_hit_expertise_scalling::HandleEffectApply(), spell_mage_pet_scaling::HandleEffectApply(), spell_pri_shadowfiend_scaling::HandleEffectApply(), spell_sha_feral_spirit_scaling::HandleEffectApply(), spell_sha_fire_elemental_scaling::HandleEffectApply(), spell_warl_infernal_scaling::HandleEffectApply(), HandleForceMoveForward(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealAurasTick(), HandleProc(), Unit::HandleProcTriggerSpell(), HandleShieldBlockValue(), Aura::IsAuraStronger(), PeriodicTick(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), ArenaSpectator::ShouldSendAura(), and UpdatePeriodic().

◆ GetBase()

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

References m_base.

Referenced by AuraApplication::_HandleEffect(), ApplySpellMod(), Unit::CalcAbsorbResist(), Unit::CalcHealAbsorb(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), CalculateSpellMod(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), spell_festergut_blighted_spores::spell_festergut_blighted_spores_AuraScript::ExtraEffect(), GetApplicationList(), GetCaster(), GetCasterGUID(), GetTargetList(), GetTotalTicks(), HandleAuraDummy(), HandleAuraLinked(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), Unit::HandleDummyAuraProc(), 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(), HandleObsModPowerAuraTick(), Unit::HandleOverrideClassScriptAuraProc(), HandlePeriodicDamageAurasTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandleProc(), Unit::HandleProcTriggerSpell(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_hor_shared_suffering::spell_hor_shared_sufferingAuraScript::OnRemove(), PeriodicTick(), Spell::prepare(), spell_pos_glacial_strike::spell_pos_glacial_strikeAuraScript::PrepareAuraScript(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), Update(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetBaseAmount()

◆ GetCaster()

◆ GetCasterGUID()

◆ GetCasterLevel()

uint8 AuraEffect::GetCasterLevel ( ) const
inline

◆ GetCritChance()

float AuraEffect::GetCritChance ( ) const
inline

◆ GetEffIndex()

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

References m_effIndex.

Referenced by AuraApplication::_HandleEffect(), spell_dru_lifebloom::AfterRemove(), Unit::CalcAbsorbResist(), spell_pal_sacred_shield_base::CalculateAmount(), spell_sha_earth_shield::CalculateAmount(), spell_warl_improved_demonic_tactics::CalculateAmount(), spell_warr_rend::CalculateAmount(), CalculateAmount(), spell_dru_treant_scaling::CalculateResistanceAmount(), spell_hun_generic_scaling::CalculateResistanceAmount(), spell_mage_pet_scaling::CalculateResistanceAmount(), spell_pri_shadowfiend_scaling::CalculateResistanceAmount(), spell_sha_feral_spirit_scaling::CalculateResistanceAmount(), spell_sha_fire_elemental_scaling::CalculateResistanceAmount(), spell_warl_generic_scaling::CalculateResistanceAmount(), spell_warl_infernal_scaling::CalculateResistanceAmount(), spell_mage_ice_barrier_aura::CalculateSpellAmount(), spell_mage_ice_barrier::CalculateSpellAmount(), CalculateSpellAmount(), CalculateSpellMod(), spell_dk_pet_scaling::CalculateStatAmount(), spell_dru_treant_scaling::CalculateStatAmount(), spell_hun_generic_scaling::CalculateStatAmount(), spell_mage_pet_scaling::CalculateStatAmount(), spell_pri_shadowfiend_scaling::CalculateStatAmount(), spell_sha_feral_spirit_scaling::CalculateStatAmount(), spell_sha_fire_elemental_scaling::CalculateStatAmount(), spell_warl_generic_scaling::CalculateStatAmount(), spell_warl_infernal_scaling::CalculateStatAmount(), Aura::CallScriptAfterEffectApplyHandlers(), Aura::CallScriptAfterEffectProcHandlers(), Aura::CallScriptAfterEffectRemoveHandlers(), Aura::CallScriptEffectAbsorbHandlers(), Aura::CallScriptEffectAfterAbsorbHandlers(), Aura::CallScriptEffectAfterManaShieldHandlers(), Aura::CallScriptEffectApplyHandlers(), Aura::CallScriptEffectCalcAmountHandlers(), Aura::CallScriptEffectCalcPeriodicHandlers(), Aura::CallScriptEffectCalcSpellModHandlers(), Aura::CallScriptEffectManaShieldHandlers(), Aura::CallScriptEffectPeriodicHandlers(), Aura::CallScriptEffectProcHandlers(), Aura::CallScriptEffectRemoveHandlers(), Aura::CallScriptEffectSplitHandlers(), Aura::CallScriptEffectUpdatePeriodicHandlers(), Unit::CastDelayedSpellWithPeriodicAmount(), ChangeAmount(), CleanupTriggeredSpells(), GetApplicationList(), GetTargetList(), spell_muru_summon_blood_elves_periodic::spell_muru_summon_blood_elves_periodic_AuraScript::HandleApply(), spell_gen_baby_murloc_passive::HandleApply(), HandleAuraLinked(), HandleAuraModStat(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), Unit::HandleDummyAuraProc(), HandleEffect(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), spell_q12619_emblazon_runeblade::HandleEffectPeriodic(), spell_oculus_rider_aura::spell_oculus_rider_auraAuraScript::HandleOnEffectApply(), spell_transitus_shield_beam::spell_transitus_shield_beam_AuraScript::HandleOnEffectApply(), spell_kiljaeden_shadow_spike::spell_kiljaeden_shadow_spike_AuraScript::HandlePeriodic(), spell_kiljaeden_armageddon_periodic::spell_kiljaeden_armageddon_periodic_AuraScript::HandlePeriodic(), spell_halion_twilight_cutter_periodic::spell_halion_twilight_cutter_periodic_AuraScript::HandlePeriodic(), spell_oculus_ride_ruby_emerald_amber_drake_que::spell_oculus_ride_ruby_emerald_amber_drake_que_AuraScript::HandlePeriodic(), spell_dk_pet_scaling::HandlePeriodic(), spell_pet_hit_expertise_scalling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_improved_demonic_tactics::HandlePeriodic(), spell_warl_demonic_knowledge::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_gen_proc_not_self::HandleProc(), spell_item_unsated_craving::HandleProc(), spell_pal_sacred_shield_base::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_putricide_mutated_plague::spell_putricide_mutated_plague_AuraScript::HandleTriggerSpell(), spell_hun_sniper_training::HandleUpdatePeriodic(), TriggeredByAuraSpellData::Init(), spell_hadronox_summon_periodic::spell_hadronox_summon_periodic_AuraScript::OnApply(), spell_gruul_ground_slam_trigger::OnApply(), spell_kalecgos_curse_of_boundless_agony::spell_kalecgos_curse_of_boundless_agony_AuraScript::OnPeriodic(), spell_the_lich_king_vile_spirits::spell_the_lich_king_vile_spirits_AuraScript::OnPeriodic(), spell_tar_blaze::spell_tar_blaze_AuraScript::OnPeriodic(), spell_thorim_lightning_pillar_P2::spell_thorim_lightning_pillar_P2_AuraScript::OnPeriodic(), spell_karathress_power_of_caribdis::spell_karathress_power_of_caribdis_AuraScript::OnPeriodic(), spell_leotheras_demon_link::spell_leotheras_demon_link_AuraScript::OnPeriodic(), spell_gen_periodic_knock_away::OnPeriodic(), spell_broggok_poison_cloud::PeriodicTick(), spell_mother_shahraz_beam_periodic::spell_mother_shahraz_beam_periodic_AuraScript::Update(), spell_mother_shahraz_saber_lash::spell_mother_shahraz_saber_lash_AuraScript::Update(), spell_illidari_council_deadly_strike::spell_illidari_council_deadly_strike_AuraScript::Update(), spell_black_temple_charge_rage::spell_black_temple_charge_rage_AuraScript::Update(), spell_black_temple_shadow_inferno::spell_black_temple_shadow_inferno_AuraScript::Update(), spell_black_temple_spell_absorption::spell_black_temple_spell_absorption_AuraScript::Update(), Update(), and Player::UpdateAttackPowerAndDamage().

◆ GetForcedAmount()

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

References m_amount.

◆ GetId()

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

References SpellInfo::Id, and m_spellInfo.

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

◆ 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 Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), ApplySpellMod(), Unit::CalcAbsorbResist(), CalculateSpellMod(), Unit::GetMaxPositiveAuraModifierByMiscMask(), HandleAuraConvertRune(), HandleAuraDummy(), HandleAuraModBaseResistancePCT(), HandleAuraModDispelImmunity(), HandleAuraModDmgImmunity(), HandleAuraModEffectImmunity(), HandleAuraModFaction(), HandleAuraModIncreaseEnergy(), HandleAuraModIncreaseEnergyPercent(), HandleAuraModResistance(), HandleAuraModResistanceExclusive(), HandleAuraModResistenceOfStatPercent(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModSkill(), HandleAuraModStat(), HandleAuraModStateImmunity(), HandleAuraMounted(), HandleAuraOverrideSpells(), HandleAuraSetVehicle(), HandleAuraTrackCreatures(), HandleAuraTrackResources(), HandleAuraTransform(), HandleDetectAmore(), spell_warl_improved_demonic_tactics::HandleEffectCalcSpellMod(), spell_warr_glyph_of_sunder_armor::HandleEffectCalcSpellMod(), HandleForceReaction(), HandleModBaseResistance(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModMechanicImmunity(), HandleModPercentStat(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModPowerRegen(), HandleModRating(), HandleModRatingFromStat(), HandleModResistancePercent(), HandleModSpellCritChanceShool(), HandleModStateImmunityMask(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModThreat(), HandleModTotalPercentStat(), HandleObsModPowerAuraTick(), Unit::HandleOverrideClassScriptAuraProc(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandleShapeshiftBoosts(), Aura::IsAuraStronger(), spell_alar_ember_blast_death::spell_alar_ember_blast_death_AuraScript::OnApply(), Unit::ProcDamageAndSpellFor(), and Unit::SendPeriodicAuraLog().

◆ GetMiscValueB()

int32 AuraEffect::GetMiscValueB ( ) const

◆ GetOldAmount()

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

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

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

References m_pctMods.

Referenced by CalculateAmount().

◆ GetPeriodicTimer()

◆ GetSpellInfo()

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

References m_spellInfo.

Referenced by Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), spell_dragonblight_corrosive_spit::AfterApply(), Unit::CalcAbsorbResist(), CalcPeriodicCritChance(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), spell_dru_treant_scaling::CalculateResistanceAmount(), spell_hun_generic_scaling::CalculateResistanceAmount(), spell_mage_pet_scaling::CalculateResistanceAmount(), spell_pri_shadowfiend_scaling::CalculateResistanceAmount(), spell_sha_feral_spirit_scaling::CalculateResistanceAmount(), spell_sha_fire_elemental_scaling::CalculateResistanceAmount(), spell_warl_generic_scaling::CalculateResistanceAmount(), spell_warl_infernal_scaling::CalculateResistanceAmount(), CalculateSpellMod(), spell_dk_pet_scaling::CalculateStatAmount(), spell_dru_treant_scaling::CalculateStatAmount(), spell_hun_generic_scaling::CalculateStatAmount(), spell_mage_pet_scaling::CalculateStatAmount(), spell_pri_shadowfiend_scaling::CalculateStatAmount(), spell_sha_feral_spirit_scaling::CalculateStatAmount(), spell_sha_fire_elemental_scaling::CalculateStatAmount(), spell_warl_generic_scaling::CalculateStatAmount(), spell_warl_infernal_scaling::CalculateStatAmount(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), HandleAuraDummy(), HandleAuraModEffectImmunity(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraModWeaponCritPercent(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraTransform(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModMechanicImmunity(), HandleModStateImmunityMask(), HandleObsModPowerAuraTick(), spell_putricide_unbound_plague_dmg::spell_putricide_unbound_plague_dmg_AuraScript::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dk_blood_caked_blade::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_pal_seal_of_command_aura::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), TriggeredByAuraSpellData::Init(), Acore::AbsorbAuraOrderPred::operator()(), spell_dragonblight_corrosive_spit::PeriodicTick(), spell_optic_link::spell_optic_linkAuraScript::PrepareAuraScript(), Unit::ProcDamageAndSpellFor(), Player::RestoreBaseRune(), Unit::SendPeriodicAuraLog(), Player::UpdateAttackPowerAndDamage(), UpdatePeriodic(), and SpellInfo::ValidateAttribute6SpellDamageMods().

◆ GetSpellModifier()

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

References m_spellmod.

Referenced by Unit::ProcDamageAndSpellFor().

◆ GetTargetList()

void AuraEffect::GetTargetList ( std::list< Unit * > &  targetList) const
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
86{ return m_tickNumber; }

References m_tickNumber.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount(), spell_frost_tomb::spell_frost_tombAuraScript::HandleEffectPeriodic(), spell_quest_test_flight_charging::HandleEffectPeriodicPlatform(), spell_quest_test_flight_charging::HandleEffectPeriodicSelf(), spell_hallows_end_base_fire::HandleEffectPeriodicUpdate(), spell_gen_burn_brutallus::HandleEffectPeriodicUpdate(), spell_putricide_unbound_plague_dmg::spell_putricide_unbound_plague_dmg_AuraScript::HandlePeriodic(), spell_shadow_bolt_whirl::HandlePeriodic(), HandlePeriodicHealAurasTick(), spell_bronjahm_soulstorm_channel_ooc::spell_bronjahm_soulstorm_channel_ooc_AuraScript::HandlePeriodicTick(), spell_bronjahm_soulstorm_visual::spell_bronjahm_soulstorm_visual_AuraScript::HandlePeriodicTick(), spell_wailing_souls_periodic::spell_wailing_souls_periodic_AuraScript::HandlePeriodicTick(), spell_exploding_orb_auto_grow::spell_exploding_orb_auto_grow_AuraScript::HandlePeriodicTick(), spell_item_direbrew_remote_aura::HandlePeriodicTick(), HandlePeriodicTriggerSpellAuraTick(), spell_igb_rocket_pack::spell_igb_rocket_pack_AuraScript::HandleRemove(), TriggeredByAuraSpellData::Init(), spell_kalecgos_curse_of_boundless_agony::spell_kalecgos_curse_of_boundless_agony_AuraScript::OnPeriodic(), spell_muru_darkness::spell_muru_darkness_AuraScript::OnPeriodic(), spell_the_lich_king_vile_spirits::spell_the_lich_king_vile_spirits_AuraScript::OnPeriodic(), spell_the_lich_king_soul_rip::spell_the_lich_king_soul_rip_AuraScript::OnPeriodic(), spell_assembly_rune_of_summoning::spell_assembly_rune_of_summoning_AuraScript::OnPeriodic(), spell_illidan_demon_transform2::spell_illidan_demon_transform2_AuraScript::OnPeriodic(), spell_the_lich_king_infest::spell_the_lich_king_infest_AuraScript::OnUpdate(), spell_karazhan_overload::spell_karazhan_overload_AuraScript::PeriodicTick(), spell_geddon_inferno::spell_geddon_inferno_AuraScript::PeriodicTick(), spell_trollgore_corpse_explode::spell_trollgore_corpse_explode_AuraScript::PeriodicTick(), spell_blood_queen_pact_of_the_darkfallen_dmg::spell_blood_queen_pact_of_the_darkfallen_dmg_AuraScript::PeriodicTick(), spell_igb_explosion_main::spell_igb_explosion_main_AuraScript::PeriodicTick(), spell_dreamwalker_mana_void::spell_dreamwalker_mana_void_AuraScript::PeriodicTick(), spell_broggok_poison_cloud::PeriodicTick(), spell_hodir_biting_cold_main_aura::spell_hodir_biting_cold_main_aura_AuraScript::PrepareAuraScript(), spell_hodir_flash_freeze::spell_hodir_flash_freeze_AuraScript::PrepareAuraScript(), spell_icc_yh_volley::spell_icc_yh_volley_AuraScript::PrepareAuraScript(), spell_ignis_scorch::spell_ignis_scorch_AuraScript::PrepareAuraScript(), spell_mimiron_rapid_burst::spell_mimiron_rapid_burst_AuraScript::PrepareAuraScript(), spell_optic_link::spell_optic_linkAuraScript::PrepareAuraScript(), spell_pos_blight::spell_pos_blightAuraScript::PrepareAuraScript(), spell_gen_holiday_buff_food::TriggerFoodBuff(), spell_mother_shahraz_random_periodic::spell_mother_shahraz_random_periodic_AuraScript::Update(), and spell_mother_shahraz_fatal_attraction_aura::spell_mother_shahraz_fatal_attraction_aura_AuraScript::Update().

◆ GetTotalTicks()

◆ HandleArenaPreparation()

void AuraEffect::HandleArenaPreparation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4956{
4957 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4958 return;
4959
4960 Unit* target = aurApp->GetTarget();
4961
4962 if (apply)
4964 else
4965 {
4966 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4967 if (target->HasAuraType(GetAuraType()))
4968 return;
4970 }
4971}
@ UNIT_FLAG_PREPARATION
Definition: Unit.h:453
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
Definition: Unit.h:1290
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:5617
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1481
ObjectGuid GetTarget() const
Definition: Unit.h:2433
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1482

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
2906{
2908 return;
2909
2910 Unit* target = aurApp->GetTarget();
2911
2912 if (!apply)
2913 {
2914 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2916 return;
2917 }
2918
2919 target->SetCanFly(apply);
2920
2921 if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
2922 target->GetMotionMaster()->MoveFall();
2923}
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
Definition: SpellAuraDefines.h:270
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
Definition: SpellAuraDefines.h:48
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
bool IsLevitating() const
Definition: Unit.h:2378
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20856
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:545

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetAuraType(), Unit::GetMotionMaster(), AuraApplication::GetTarget(), Object::GetTypeId(), Unit::HasAuraType(), Unit::IsLevitating(), MotionMaster::MoveFall(), Unit::SetCanFly(), SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, and TYPEID_UNIT.

◆ HandleAuraAllowOnlyAbility()

void AuraEffect::HandleAuraAllowOnlyAbility ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2678{
2680 return;
2681
2682 Unit* target = aurApp->GetTarget();
2683
2684 if (target->GetTypeId() == TYPEID_PLAYER)
2685 {
2686 if (apply)
2688 else
2689 {
2690 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2692 return;
2694 }
2695 }
2696}
@ PLAYER_ALLOW_ONLY_ABILITY
Definition: Player.h:498
@ SPELL_AURA_ALLOW_ONLY_ABILITY
Definition: SpellAuraDefines.h:326
void SetPlayerFlag(PlayerFlags flags)
Definition: Player.h:1091
void RemovePlayerFlag(PlayerFlags flags)
Definition: Player.h:1092

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Object::GetTypeId(), Unit::HasAuraType(), PLAYER_ALLOW_ONLY_ABILITY, Player::RemovePlayerFlag(), Player::SetPlayerFlag(), SPELL_AURA_ALLOW_ONLY_ABILITY, Object::ToPlayer(), and TYPEID_PLAYER.

◆ HandleAuraCloneCaster()

void AuraEffect::HandleAuraCloneCaster ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2374{
2376 return;
2377
2378 Unit* target = aurApp->GetTarget();
2379
2380 if (apply)
2381 {
2382 Unit* caster = GetCaster();
2383 if (!caster || caster == target)
2384 return;
2385
2386 // What must be cloned? at least display and scale
2387 target->SetDisplayId(caster->GetDisplayId());
2389 }
2390 else
2391 {
2392 target->SetDisplayId(target->GetNativeDisplayId());
2394 }
2395}
@ UNIT_FLAG2_MIRROR_IMAGE
Definition: Unit.h:492
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1487
uint32 GetDisplayId() const
Definition: Unit.h:2168
uint32 GetNativeDisplayId() const
Definition: Unit.h:2170
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1488
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:16936

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

3250{
3252 return;
3253
3254 Unit* target = aurApp->GetTarget();
3255
3256 if (!target->IsVehicle())
3257 return;
3258
3259 Unit* caster = GetCaster();
3260
3261 if (!caster || caster == target)
3262 return;
3263
3264 if (apply)
3265 {
3266 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3267 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3268 // so this break such spells or most of them.
3269 // Current formula about m_amount: effect base points + dieside - 1
3270 // TO DO: Reasearch more about 0/0 and fix it.
3271 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3272 }
3273 else
3274 {
3275 if (GetId() == 53111) // Devour Humanoid
3276 {
3277 Unit::Kill(target, caster);
3278 if (caster->GetTypeId() == TYPEID_UNIT)
3279 caster->ToCreature()->RemoveCorpse();
3280 }
3281
3282 caster->_ExitVehicle();
3283 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3284 caster->RemoveAurasDueToSpell(GetId());
3285 }
3286}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition: SpellAuraDefines.h:49
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:347
Creature * ToCreature()
Definition: Object.h:197
bool IsVehicle() const
Definition: Unit.h:1416
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:17862
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:19934
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition: Unit.cpp:19814
Vehicle * GetVehicleKit() const
Definition: Unit.h:2353

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

◆ HandleAuraConvertRune()

void AuraEffect::HandleAuraConvertRune ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5629{
5630 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5631 return;
5632
5633 Unit* target = aurApp->GetTarget();
5634
5635 if (target->GetTypeId() != TYPEID_PLAYER)
5636 return;
5637
5638 Player* player = target->ToPlayer();
5639
5640 if (player->getClass() != CLASS_DEATH_KNIGHT)
5641 return;
5642
5643 uint32 runes = m_amount;
5644 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
5645 if (apply)
5646 {
5647 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
5648 {
5649 if (GetMiscValue() != player->GetCurrentRune(i))
5650 continue;
5651 if (!player->GetRuneCooldown(i))
5652 {
5653 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
5654 --runes;
5655 }
5656 }
5657 }
5658 else
5659 player->RemoveRunesByAuraEffect(this);
5660}
RuneType
Definition: Player.h:409
#define MAX_RUNES
Definition: Player.h:399
@ CLASS_DEATH_KNIGHT
Definition: SharedDefines.h:118
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition: Player.cpp:13277
uint32 GetRuneCooldown(uint8 index) const
Definition: Player.h:2458
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition: Player.h:2469
RuneType GetCurrentRune(uint8 index) const
Definition: Player.h:2457
uint8 getClass() const
Definition: Unit.h:1426
int32 GetMiscValueB() const
Definition: SpellAuraEffects.cpp:437

References Player::AddRuneByAuraEffect(), AURA_EFFECT_HANDLE_REAL, CLASS_DEATH_KNIGHT, Unit::getClass(), Player::GetCurrentRune(), GetMiscValue(), GetMiscValueB(), Player::GetRuneCooldown(), AuraApplication::GetTarget(), Object::GetTypeId(), m_amount, MAX_RUNES, Player::RemoveRunesByAuraEffect(), Object::ToPlayer(), and TYPEID_PLAYER.

◆ HandleAuraDummy()

void AuraEffect::HandleAuraDummy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5014{
5016 return;
5017
5018 Unit* target = aurApp->GetTarget();
5019
5020 Unit* caster = GetCaster();
5021
5022 if (mode & AURA_EFFECT_HANDLE_REAL)
5023 {
5024 // pet auras
5025 if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
5026 {
5027 if (apply)
5028 target->AddPetAura(petSpell);
5029 else
5030 target->RemovePetAura(petSpell);
5031 }
5032 }
5033
5035 {
5036 // AT APPLY
5037 if (apply)
5038 {
5039 switch (GetId())
5040 {
5041 case 1515: // Tame beast
5042 // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
5043 if (caster && target->CanHaveThreatList())
5044 target->AddThreat(caster, 10.0f);
5045 break;
5046 case 13139: // net-o-matic
5047 // root to self part of (root_target->charge->root_self sequence
5048 if (caster)
5049 caster->CastSpell(caster, 13138, true, nullptr, this);
5050 break;
5051 case 34026: // kill command
5052 {
5053 Unit* pet = target->GetGuardianPet();
5054 if (!pet)
5055 break;
5056
5057 target->CastSpell(target, 34027, true, nullptr, this);
5058
5059 // set 3 stacks and 3 charges (to make all auras not disappear at once)
5060 Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
5061 Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
5062 if (owner_aura)
5063 {
5064 owner_aura->SetCharges(0);
5065 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5066 if (pet_aura)
5067 {
5068 pet_aura->SetCharges(0);
5069 pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5070 }
5071 }
5072 break;
5073 }
5074 case 37096: // Blood Elf Illusion
5075 {
5076 if (caster)
5077 {
5078 switch (caster->getGender())
5079 {
5080 case GENDER_FEMALE:
5081 caster->CastSpell(target, 37095, true, nullptr, this); // Blood Elf Disguise
5082 break;
5083 case GENDER_MALE:
5084 caster->CastSpell(target, 37093, true, nullptr, this);
5085 break;
5086 default:
5087 break;
5088 }
5089 }
5090 break;
5091 }
5092 case 55198: // Tidal Force
5093 {
5094 target->CastSpell(target, 55166, true);
5095 if (Aura* owner_aura = target->GetAura(55166))
5096 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
5097 return;
5098 }
5099 case 39850: // Rocket Blast
5100 if (roll_chance_i(20)) // backfire stun
5101 target->CastSpell(target, 51581, true, nullptr, this);
5102 break;
5103 case 43873: // Headless Horseman Laugh
5104 target->PlayDistanceSound(11965);
5105 break;
5106 case 46354: // Blood Elf Illusion
5107 if (caster)
5108 {
5109 switch (caster->getGender())
5110 {
5111 case GENDER_FEMALE:
5112 caster->CastSpell(target, 46356, true, nullptr, this);
5113 break;
5114 case GENDER_MALE:
5115 caster->CastSpell(target, 46355, true, nullptr, this);
5116 break;
5117 }
5118 }
5119 break;
5120 case 46361: // Reinforced Net
5121 if (caster)
5122 target->GetMotionMaster()->MoveFall();
5123 break;
5124 case 46699: // Requires No Ammo
5125 if (target->GetTypeId() == TYPEID_PLAYER)
5126 target->ToPlayer()->RemoveAmmo(); // not use ammo and not allow use
5127 break;
5128 case 71563:
5129 {
5130 if (Aura* newAura = target->AddAura(71564, target))
5131 newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
5132 return;
5133 }
5134 }
5135 }
5136 // AT REMOVE
5137 else
5138 {
5139 if ((GetSpellInfo()->IsQuestTame()) && caster && caster->IsAlive() && target->IsAlive() && aurApp->GetRemoveMode() != AURA_REMOVE_BY_CANCEL)
5140 {
5141 uint32 finalSpelId = 0;
5142 switch (GetId())
5143 {
5144 case 19548:
5145 finalSpelId = 19597;
5146 break;
5147 case 19674:
5148 finalSpelId = 19677;
5149 break;
5150 case 19687:
5151 finalSpelId = 19676;
5152 break;
5153 case 19688:
5154 finalSpelId = 19678;
5155 break;
5156 case 19689:
5157 finalSpelId = 19679;
5158 break;
5159 case 19692:
5160 finalSpelId = 19680;
5161 break;
5162 case 19693:
5163 finalSpelId = 19684;
5164 break;
5165 case 19694:
5166 finalSpelId = 19681;
5167 break;
5168 case 19696:
5169 finalSpelId = 19682;
5170 break;
5171 case 19697:
5172 finalSpelId = 19683;
5173 break;
5174 case 19699:
5175 finalSpelId = 19685;
5176 break;
5177 case 19700:
5178 finalSpelId = 19686;
5179 break;
5180 case 30646:
5181 finalSpelId = 30647;
5182 break;
5183 case 30653:
5184 finalSpelId = 30648;
5185 break;
5186 case 30654:
5187 finalSpelId = 30652;
5188 break;
5189 case 30099:
5190 finalSpelId = 30100;
5191 break;
5192 case 30102:
5193 finalSpelId = 30103;
5194 break;
5195 case 30105:
5196 finalSpelId = 30104;
5197 break;
5198 }
5199
5200 if (finalSpelId)
5201 caster->CastSpell(target, finalSpelId, true, nullptr, this);
5202 }
5203
5205 {
5207 switch (GetId())
5208 {
5209 case 2584: // Waiting to Resurrect
5210 // Waiting to resurrect spell cancel, we must remove player from resurrect queue
5211 if (target->GetTypeId() == TYPEID_PLAYER)
5212 {
5213 if (Battleground* bg = target->ToPlayer()->GetBattleground())
5214 bg->RemovePlayerFromResurrectQueue(target->ToPlayer());
5215 if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(target->GetZoneId()))
5216 bf->RemovePlayerFromResurrectQueue(target->GetGUID());
5217 }
5218 break;
5219 case 43681: // Inactive
5220 {
5221 if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5222 return;
5223
5224 if (target->GetMap()->IsBattleground())
5225 target->ToPlayer()->LeaveBattleground();
5226 break;
5227 }
5228 case 52172: // Coyote Spirit Despawn Aura
5229 case 60244: // Blood Parrot Despawn Aura
5230 target->CastSpell((Unit*)nullptr, GetAmount(), true, nullptr, this);
5231 break;
5232 // Halls of Lightning, Arc Lightning
5233 case 52921:
5234 {
5235 if( aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE )
5236 return;
5237
5238 Player* player = nullptr;
5239 Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
5240 Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
5241 Cell::VisitWorldObjects(target, searcher, 10.0f);
5242
5243 if( player && player->GetGUID() != target->GetGUID() )
5244 target->CastSpell(player, 52921, true);
5245
5246 return;
5247 }
5248 case 58600: // Restricted Flight Area
5249 case 58730: // Restricted Flight Area
5250 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
5251 target->CastSpell(target, 58601, true);
5252 break;
5253 case 46374: // quest The Power of the Elements (11893)
5254 {
5255 if (target->isDead() && GetBase() && target->GetTypeId() == TYPEID_UNIT && target->GetEntry() == 24601)
5256 {
5257 auto caster2 = GetBase()->GetCaster();
5258 if (caster2 && caster2->GetTypeId() == TYPEID_PLAYER)
5259 {
5260 caster2->ToPlayer()->KilledMonsterCredit(25987);
5261 }
5262 }
5263 return;
5264 }
5265 }
5266 break;
5267 default:
5268 break;
5269 }
5270 }
5271 }
5272
5273 // AT APPLY & REMOVE
5274
5276 {
5278 {
5279 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5280 break;
5281 switch (GetId())
5282 {
5283 // Recently Bandaged
5284 case 11196:
5286 break;
5287 // Unstable Power
5288 case 24658:
5289 {
5290 uint32 spellId = 24659;
5291 if (apply && caster)
5292 {
5293 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5294
5295 for (uint32 i = 0; i < spell->StackAmount; ++i)
5296 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5297 break;
5298 }
5299 target->RemoveAurasDueToSpell(spellId);
5300 break;
5301 }
5302 // Restless Strength
5303 case 24661:
5304 {
5305 uint32 spellId = 24662;
5306 if (apply && caster)
5307 {
5308 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId);
5309 for (uint32 i = 0; i < spell->StackAmount; ++i)
5310 caster->CastSpell(target, spell->Id, true, nullptr, nullptr, GetCasterGUID());
5311 break;
5312 }
5313 target->RemoveAurasDueToSpell(spellId);
5314 break;
5315 }
5316 // Tag Murloc
5317 case 30877:
5318 {
5319 // Tag/untag Blacksilt Scout
5320 target->SetEntry(apply ? 17654 : 17326);
5321 break;
5322 }
5323 case 57819: // Argent Champion
5324 case 57820: // Ebon Champion
5325 case 57821: // Champion of the Kirin Tor
5326 case 57822: // Wyrmrest Champion
5327 {
5328 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
5329 break;
5330
5331 uint32 FactionID = 0;
5332
5333 if (apply)
5334 {
5335 switch (m_spellInfo->Id)
5336 {
5337 case 57819:
5338 FactionID = 1106;
5339 break; // Argent Crusade
5340 case 57820:
5341 FactionID = 1098;
5342 break; // Knights of the Ebon Blade
5343 case 57821:
5344 FactionID = 1090;
5345 break; // Kirin Tor
5346 case 57822:
5347 FactionID = 1091;
5348 break; // The Wyrmrest Accord
5349 }
5350 }
5351 caster->ToPlayer()->SetChampioningFaction(FactionID);
5352 break;
5353 }
5354 // LK Intro VO (1)
5355 case 58204:
5356 if (target->GetTypeId() == TYPEID_PLAYER)
5357 {
5358 // Play part 1
5359 if (apply)
5360 target->PlayDirectSound(14970, target->ToPlayer());
5361 // continue in 58205
5362 else
5363 target->CastSpell(target, 58205, true);
5364 }
5365 break;
5366 // LK Intro VO (2)
5367 case 58205:
5368 if (target->GetTypeId() == TYPEID_PLAYER)
5369 {
5370 // Play part 2
5371 if (apply)
5372 target->PlayDirectSound(14971, target->ToPlayer());
5373 // Play part 3
5374 else
5375 target->PlayDirectSound(14972, target->ToPlayer());
5376 }
5377 break;
5378 case 62061: // Festive Holiday Mount
5379 if (target->HasAuraType(SPELL_AURA_MOUNTED))
5380 {
5381 uint32 creatureEntry = 0;
5382 if (apply)
5383 {
5385 creatureEntry = 24906;
5386 else
5387 creatureEntry = 15665;
5388 }
5389 else
5390 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5391
5392 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5393 {
5394 uint32 displayID = ObjectMgr::ChooseDisplayId(creatureInfo);
5395 sObjectMgr->GetCreatureModelRandomGender(&displayID);
5396
5397 target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID);
5398 }
5399 }
5400 break;
5401 case FRESH_BREWFEST_HOPS: // Festive Brewfest Mount
5403 {
5404 uint32 creatureEntry = 0;
5405
5406 if (apply)
5407 {
5408 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
5409 {
5410 creatureEntry = GREAT_BREWFEST_KODO;
5411 }
5412 else
5413 {
5414 creatureEntry = BREWFEST_KODO;
5415 }
5416 }
5417 else
5418 {
5419 creatureEntry = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
5420 }
5421
5422 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
5423 {
5424 uint32 displayID = ObjectMgr::ChooseDisplayId(creatureInfo);
5425 sObjectMgr->GetCreatureModelRandomGender(&displayID);
5426
5427 target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID);
5428 }
5429 }
5430 break;
5431 }
5432
5433 break;
5434 }
5435 case SPELLFAMILY_MAGE:
5436 {
5437 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5438 //break;
5439 break;
5440 }
5441 case SPELLFAMILY_PRIEST:
5442 {
5443 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5444 //break;
5445 break;
5446 }
5447 case SPELLFAMILY_DRUID:
5448 {
5449 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5450 // break;
5451 break;
5452 }
5453 case SPELLFAMILY_SHAMAN:
5454 {
5455 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5456 // break;
5457 break;
5458 }
5459 }
5460}
bool roll_chance_i(int chance)
Definition: Random.h:59
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:77
@ UNIT_FIELD_MOUNTDISPLAYID
Definition: UpdateFields.h:126
@ MOVE_RUN
Definition: Unit.h:379
#define sObjectMgr
Definition: ObjectMgr.h:1640
@ 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
@ GENDER_MALE
Definition: SharedDefines.h:60
@ GENDER_FEMALE
Definition: SharedDefines.h:61
@ IMMUNITY_MECHANIC
Definition: SharedDefines.h:1371
@ SPELLFAMILY_PRIEST
Definition: SharedDefines.h:3506
@ SPELLFAMILY_MAGE
Definition: SharedDefines.h:3503
@ SPELLFAMILY_GENERIC
Definition: SharedDefines.h:3500
@ SPELLFAMILY_SHAMAN
Definition: SharedDefines.h:3511
@ SPELLFAMILY_DRUID
Definition: SharedDefines.h:3507
Definition: Battlefield.h:205
Definition: Battleground.h:293
Definition: CreatureData.h:176
uint32 GetEntry() const
Definition: Object.h:109
void SetEntry(uint32 entry)
Definition: Object.h:110
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:650
Map * GetMap() const
Definition: Object.h:517
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition: Object.cpp:2853
void PlayDistanceSound(uint32 sound_id, Player *target=nullptr)
Definition: Object.cpp:2845
uint32 GetZoneId() const
Definition: Object.cpp:3075
void KilledMonsterCredit(uint32 entry, ObjectGuid guid=ObjectGuid::Empty)
Definition: PlayerQuest.cpp:1911
Battleground * GetBattleground(bool create=false) const
Definition: Player.cpp:12097
void RemoveAmmo()
Definition: PlayerStorage.cpp:2542
void SetChampioningFaction(uint32 faction)
Definition: Player.h:2498
void LeaveBattleground(Battleground *bg=nullptr)
Definition: Player.cpp:11216
uint8 getGender() const
Definition: Unit.h:1428
void RemovePetAura(PetAura const *petSpell)
Definition: Unit.cpp:17469
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5499
bool CanHaveThreatList() const
Definition: Unit.cpp:14509
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13300
void AddPetAura(PetAura const *petSpell)
Definition: Unit.cpp:17457
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14548
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:19031
bool IsAlive() const
Definition: Unit.h:1808
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:1169
float GetSpeedRate(UnitMoveType mtype) const
Definition: Unit.h:2248
Guardian * GetGuardianPet() const
Definition: Unit.cpp:10611
bool isDead() const
Definition: Unit.h:1810
static uint32 ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
Definition: ObjectMgr.cpp:1717
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:193
Definition: GridNotifiers.h:507
Definition: GridNotifiers.h:1350
bool IsBattleground() const
Definition: Map.h:453
void SetStackAmount(uint8 num)
Definition: SpellAuras.cpp:1009
void SetCharges(uint8 charges)
Definition: SpellAuras.cpp:966
uint32 StackAmount
Definition: SpellInfo.h:369
uint32 SpellFamilyName
Definition: SpellInfo.h:385
Definition: SpellMgr.h:463

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(), 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(), Object::GetTypeId(), WorldObject::GetZoneId(), GREAT_BREWFEST_KODO, Unit::HasAuraType(), SpellInfo::Id, IMMUNITY_MECHANIC, Unit::IsAlive(), Map::IsBattleground(), Unit::isDead(), 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(), Object::SetUInt32Value(), sObjectMgr, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_MOUNTED, SPELLFAMILY_DRUID, SPELLFAMILY_GENERIC, SPELLFAMILY_MAGE, SPELLFAMILY_PRIEST, SPELLFAMILY_SHAMAN, SpellInfo::SpellFamilyName, sSpellMgr, SpellInfo::StackAmount, Object::ToPlayer(), TYPEID_PLAYER, TYPEID_UNIT, UNIT_FIELD_MOUNTDISPLAYID, and Cell::VisitWorldObjects().

◆ HandleAuraEmpathy()

void AuraEffect::HandleAuraEmpathy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5572{
5573 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5574 return;
5575
5576 Unit* target = aurApp->GetTarget();
5577
5578 if (!apply)
5579 {
5580 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5581 if (target->HasAuraType(GetAuraType()))
5582 return;
5583 }
5584
5585 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5587}
@ UNIT_DYNAMIC_FLAGS
Definition: UpdateFields.h:136
@ CREATURE_TYPE_BEAST
Definition: SharedDefines.h:2600
@ UNIT_DYNFLAG_SPECIALINFO
Definition: SharedDefines.h:3097
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition: Object.cpp:806
uint32 GetCreatureType() const
Definition: Unit.cpp:15074

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
2948{
2950 return;
2951
2952 Unit* target = aurApp->GetTarget();
2953
2954 if (Player* targetPlayer = target->ToPlayer())
2955 {
2956 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
2957 }
2958
2959 if (!apply)
2960 {
2961 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2962 if (target->HasAuraType(GetAuraType()))
2963 return;
2964 }
2965
2966 target->SetFeatherFall(apply);
2967
2968 // start fall from current height
2969 if (!apply && target->GetTypeId() == TYPEID_PLAYER)
2970 target->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), target->GetPositionZ());
2971}
#define sScriptMgr
Definition: ScriptMgr.h:2702
Seconds GetGameTime()
Definition: GameTime.cpp:38
float GetPositionZ() const
Definition: Position.h:119
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2285
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20896

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

◆ HandleAuraGhost()

void AuraEffect::HandleAuraGhost ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
1756{
1758 return;
1759
1760 Unit* target = aurApp->GetTarget();
1761
1762 if (target->GetTypeId() != TYPEID_PLAYER)
1763 return;
1764
1765 if (apply)
1766 {
1770 }
1771 else
1772 {
1773 if (target->HasAuraType(SPELL_AURA_GHOST))
1774 return;
1775
1779 }
1780}
@ PLAYER_FLAGS_GHOST
Definition: Player.h:479
@ SPELL_AURA_GHOST
Definition: SpellAuraDefines.h:158
@ SERVERSIDE_VISIBILITY_GHOST
Definition: SharedDefines.h:1246
@ GHOST_VISIBILITY_ALIVE
Definition: SharedDefines.h:1253
@ GHOST_VISIBILITY_GHOST
Definition: SharedDefines.h:1254
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:360
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:510
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:509

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Object::GetTypeId(), GHOST_VISIBILITY_ALIVE, GHOST_VISIBILITY_GHOST, Unit::HasAuraType(), 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(), SPELL_AURA_GHOST, Object::ToPlayer(), and TYPEID_PLAYER.

◆ HandleAuraHover()

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

Sets movementflags

2974{
2976 return;
2977
2978 Unit* target = aurApp->GetTarget();
2979
2980 if (Player* targetPlayer = target->ToPlayer())
2981 {
2982 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
2983 }
2984
2985 if (!apply)
2986 {
2987 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2988 if (target->HasAuraType(GetAuraType()))
2989 return;
2990 }
2991
2992 target->SetHover(apply);
2993}
virtual bool SetHover(bool enable, bool packetOnly=false, bool updateAnimationTier=true)
Definition: Unit.cpp:20918

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
4402{
4404 return;
4405
4406 Unit* target = aurApp->GetTarget();
4407
4408 target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(GetAmount()), apply);
4409}
@ UNIT_MOD_HEALTH
Definition: Unit.h:267
@ BASE_PCT
Definition: Unit.h:246
@ AURA_EFFECT_HANDLE_STAT
Definition: SpellAuraDefines.h:46
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
Definition: Unit.cpp:15095

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

◆ HandleAuraLinked()

void AuraEffect::HandleAuraLinked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5663{
5664 Unit* target = aurApp->GetTarget();
5665
5666 uint32 triggeredSpellId = sSpellMgr->GetSpellIdForDifficulty(m_spellInfo->Effects[m_effIndex].TriggerSpell, target);
5667 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId);
5668 if (!triggeredSpellInfo)
5669 return;
5670
5671 if (mode & AURA_EFFECT_HANDLE_REAL)
5672 {
5673 if (apply)
5674 {
5675 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCaster() : target;
5676
5677 if (!caster)
5678 return;
5679 // If amount avalible cast with basepoints (Crypt Fever for example)
5680 if (GetAmount())
5681 caster->CastCustomSpell(target, triggeredSpellId, &m_amount, nullptr, nullptr, true, nullptr, this);
5682 else
5683 caster->CastSpell(target, triggeredSpellId, true, nullptr, this);
5684 }
5685 else
5686 {
5687 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
5688 target->RemoveAura(triggeredSpellId, casterGUID, 0, aurApp->GetRemoveMode());
5689 }
5690 }
5691 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
5692 {
5693 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo, GetEffIndex()) ? GetCasterGUID() : target->GetGUID();
5694 // change the stack amount to be equal to stack amount of our aura
5695 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
5696 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
5697 }
5698}
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4708
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:1226
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell, uint8 effIndex=MAX_SPELL_EFFECTS) const
Definition: SpellInfo.cpp:1022

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
4704{
4706 return;
4707
4708 Unit* target = aurApp->GetTarget();
4709
4711}
@ UNIT_MOD_ATTACK_POWER
Definition: Unit.h:282
@ TOTAL_VALUE
Definition: Unit.h:247

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

◆ HandleAuraModAttackPowerOfArmor()

void AuraEffect::HandleAuraModAttackPowerOfArmor ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4769{
4771 return;
4772
4773 Unit* target = aurApp->GetTarget();
4774
4775 // Recalculate bonus
4776 if (target->GetTypeId() == TYPEID_PLAYER)
4777 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
4778}
void UpdateAttackPowerAndDamage(bool ranged=false) override
Definition: StatSystem.cpp:330

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

Referenced by HandleAuraModAttackPowerOfStatPercent().

◆ HandleAuraModAttackPowerOfStatPercent()

void AuraEffect::HandleAuraModAttackPowerOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4764{
4765 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
4766}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:4768

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4727{
4729 return;
4730
4731 Unit* target = aurApp->GetTarget();
4732
4733 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4735}
@ TOTAL_PCT
Definition: Unit.h:248

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

◆ HandleAuraModBaseResistancePCT()

void AuraEffect::HandleAuraModBaseResistancePCT ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3960{
3962 return;
3963
3964 Unit* target = aurApp->GetTarget();
3965 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3966 {
3967 if (GetMiscValue() & int32(1 << x))
3968 {
3970 }
3971 }
3972}
std::int8_t int8
Definition: Define.h:106
UnitMods
Definition: Unit.h:261
@ UNIT_MOD_RESISTANCE_START
Definition: Unit.h:291
@ SPELL_SCHOOL_NORMAL
Definition: SharedDefines.h:255
constexpr auto MAX_SPELL_SCHOOL
Definition: SharedDefines.h:264

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

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4445{
4447 return;
4448
4449 Unit* target = aurApp->GetTarget();
4450
4451 if (target->GetTypeId() != TYPEID_PLAYER)
4452 return;
4453
4454 target->ToPlayer()->UpdateBlockPercentage();
4455}
void UpdateBlockPercentage()
Definition: StatSystem.cpp:623

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

◆ HandleAuraModCritPct()

void AuraEffect::HandleAuraModCritPct ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4553{
4555 return;
4556
4557 Unit* target = aurApp->GetTarget();
4558
4559 if (target->GetTypeId() != TYPEID_PLAYER)
4560 {
4561 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4562 return;
4563 }
4564
4565 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4568
4569 // included in Player::UpdateSpellCritChance calculation
4571}
@ FLAT_MOD
Definition: Unit.h:308
@ OFFHAND_CRIT_PERCENTAGE
Definition: Unit.h:301
@ CRIT_PERCENTAGE
Definition: Unit.h:299
@ RANGED_CRIT_PERCENTAGE
Definition: Unit.h:300
void apply(T *val)
Definition: ByteConverter.h:40
void UpdateAllSpellCritChances()
Definition: StatSystem.cpp:878
void HandleBaseModValue(BaseModGroup modGroup, BaseModType modType, float amount, bool apply)
Definition: Player.cpp:4920
int32 m_baseSpellCritChance
Definition: Unit.h:2088

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

◆ HandleAuraModDecreaseSpeed()

void AuraEffect::HandleAuraModDecreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3367{
3369 return;
3370
3371 Unit* target = aurApp->GetTarget();
3372
3373 target->UpdateSpeed(MOVE_WALK, true);
3374 target->UpdateSpeed(MOVE_RUN, true);
3375 target->UpdateSpeed(MOVE_SWIM, true);
3376 target->UpdateSpeed(MOVE_FLIGHT, true);
3377 target->UpdateSpeed(MOVE_RUN_BACK, true);
3378 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3379 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3380
3381 if (Player* targetPlayer = target->ToPlayer())
3382 {
3383 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3384 }
3385}
@ MOVE_FLIGHT
Definition: Unit.h:384
@ MOVE_SWIM
Definition: Unit.h:381
@ MOVE_FLIGHT_BACK
Definition: Unit.h:385
@ MOVE_SWIM_BACK
Definition: Unit.h:382
@ MOVE_RUN_BACK
Definition: Unit.h:380
@ MOVE_WALK
Definition: Unit.h:378
void UpdateSpeed(UnitMoveType mtype, bool forced)
Definition: Unit.cpp:14147

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
2545{
2546 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2547 return;
2548
2549 Unit* target = aurApp->GetTarget();
2550
2551 AuraType type = GetAuraType();
2552
2553 //Prevent handling aura twice
2554 if ((apply) ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2555 return;
2556
2557 uint32 field, flag, slot;
2558 WeaponAttackType attType;
2559 switch (type)
2560 {
2562 field = UNIT_FIELD_FLAGS;
2563 flag = UNIT_FLAG_DISARMED;
2565 attType = BASE_ATTACK;
2566 break;
2568 field = UNIT_FIELD_FLAGS_2;
2571 attType = OFF_ATTACK;
2572 break;
2574 field = UNIT_FIELD_FLAGS_2;
2576 slot = EQUIPMENT_SLOT_RANGED;
2577 attType = RANGED_ATTACK;
2578 break;
2579 default:
2580 return;
2581 }
2582
2583 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
2584 if (!apply)
2585 target->RemoveFlag(field, flag);
2586
2587 // Handle damage modification, shapeshifted druids are not affected
2588 if (target->GetTypeId() == TYPEID_PLAYER && (!target->IsInFeralForm() || target->GetShapeshiftForm() == FORM_GHOSTWOLF))
2589 {
2590 if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2591 {
2592 uint8 attacktype = Player::GetAttackBySlot(slot);
2593
2594 if (attacktype < MAX_ATTACK)
2595 {
2596 target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
2597 target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
2598 }
2599 }
2600 }
2601
2602 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
2603 if (apply)
2604 target->SetFlag(field, flag);
2605
2606 if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
2607 target->UpdateDamagePhysical(attType);
2608}
@ UNIT_FIELD_FLAGS_2
Definition: UpdateFields.h:118
@ UNIT_FIELD_FLAGS
Definition: UpdateFields.h:117
@ EQUIPMENT_SLOT_MAINHAND
Definition: Player.h:691
@ EQUIPMENT_SLOT_OFFHAND
Definition: Player.h:692
@ EQUIPMENT_SLOT_RANGED
Definition: Player.h:693
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:671
WeaponAttackType
Definition: Unit.h:395
@ MAX_ATTACK
Definition: Unit.h:399
@ UNIT_FLAG2_DISARM_OFFHAND
Definition: Unit.h:495
@ UNIT_FLAG2_DISARM_RANGED
Definition: Unit.h:497
@ FORM_GHOSTWOLF
Definition: Unit.h:106
@ UNIT_FLAG_DISARMED
Definition: Unit.h:469
@ 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
uint8 GetCurrentEquipmentId()
Definition: Creature.h:186
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:845
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:860
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition: Player.cpp:6784
Item * GetItemByPos(uint16 pos) const
Definition: PlayerStorage.cpp:472
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition: Player.cpp:6887
static uint8 GetAttackBySlot(uint8 slot)
Definition: PlayerStorage.cpp:573
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:2071
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition: StatSystem.cpp:60
bool IsInFeralForm() const
Definition: Unit.h:2077

References Player::_ApplyWeaponDamage(), Player::_ApplyWeaponDependentAuraMods(), AURA_EFFECT_HANDLE_REAL, BASE_ATTACK, EQUIPMENT_SLOT_MAINHAND, EQUIPMENT_SLOT_OFFHAND, EQUIPMENT_SLOT_RANGED, FORM_GHOSTWOLF, Player::GetAttackBySlot(), Unit::GetAuraEffectsByType(), GetAuraType(), Creature::GetCurrentEquipmentId(), Player::GetItemByPos(), Unit::GetShapeshiftForm(), AuraApplication::GetTarget(), Object::GetTypeId(), Unit::HasAuraType(), INVENTORY_SLOT_BAG_0, Unit::IsInFeralForm(), 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(), TYPEID_PLAYER, TYPEID_UNIT, UNIT_FIELD_FLAGS, UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_OFFHAND, UNIT_FLAG2_DISARM_RANGED, UNIT_FLAG_DISARMED, and Unit::UpdateDamagePhysical().

◆ HandleAuraModDispelImmunity()

void AuraEffect::HandleAuraModDispelImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3901{
3902 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3903 return;
3904
3905 Unit* target = aurApp->GetTarget();
3906
3908}
DispelType
Definition: SharedDefines.h:1343
void ApplySpellDispelImmunity(SpellInfo const *spellProto, DispelType type, bool apply)
Definition: Unit.cpp:13327

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
3891{
3892 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3893 return;
3894
3895 Unit* target = aurApp->GetTarget();
3896
3897 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
3898}
@ IMMUNITY_DAMAGE
Definition: SharedDefines.h:1369

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
4432{
4434 return;
4435
4436 Unit* target = aurApp->GetTarget();
4437
4438 if (target->GetTypeId() != TYPEID_PLAYER)
4439 return;
4440
4441 target->ToPlayer()->UpdateDodgePercentage();
4442}
void UpdateDodgePercentage()
Definition: StatSystem.cpp:788

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

◆ HandleAuraModEffectImmunity()

void AuraEffect::HandleAuraModEffectImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3796{
3797 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3798 return;
3799
3800 Unit* target = aurApp->GetTarget();
3801
3802 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
3803
3804 // when removing flag aura, handle flag drop
3805 Player* player = target->ToPlayer();
3806 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
3807 {
3808 if (player->InBattleground())
3809 {
3810 if (Battleground* bg = player->GetBattleground())
3811 bg->EventPlayerDroppedFlag(player);
3812 }
3813 else
3814 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3815 }
3816}
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:106
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition: SpellDefines.h:64
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1366
bool InBattleground() const
Definition: Player.h:2201

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
4236{
4238 return;
4239
4240 Unit* target = aurApp->GetTarget();
4241
4242 if (target->GetTypeId() != TYPEID_PLAYER)
4243 return;
4244
4247}
void UpdateExpertise(WeaponAttackType attType)
Definition: StatSystem.cpp:884

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

◆ HandleAuraModFaction()

void AuraEffect::HandleAuraModFaction ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5590{
5591 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5592 return;
5593
5594 Unit* target = aurApp->GetTarget();
5595
5596 if (apply)
5597 {
5598 target->SetFaction(GetMiscValue());
5599 if (target->GetTypeId() == TYPEID_PLAYER)
5601 }
5602 else
5603 {
5604 target->RestoreFaction();
5605 if (target->GetTypeId() == TYPEID_PLAYER)
5607 }
5608}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition: Unit.h:451
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
void RestoreFaction()
Definition: Unit.cpp:18863

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

◆ HandleAuraModFakeInebriation()

void AuraEffect::HandleAuraModFakeInebriation ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5717{
5719 return;
5720
5721 Unit* target = aurApp->GetTarget();
5722
5723 if (apply)
5724 {
5727
5728 if (target->GetTypeId() == TYPEID_PLAYER)
5729 {
5732 }
5733 }
5734 else
5735 {
5736 bool removeDetect = !target->HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE);
5737
5739
5740 if (target->GetTypeId() == TYPEID_PLAYER)
5741 {
5744
5745 if (removeDetect)
5746 removeDetect = !target->ToPlayer()->GetDrunkValue();
5747 }
5748
5749 if (removeDetect)
5751 }
5752
5753 // call functions which may have additional effects after chainging state of unit
5754 target->UpdateObjectVisibility(false);
5755}
@ PLAYER_FAKE_INEBRIATION
Definition: UpdateFields.h:325
@ SPELL_AURA_MOD_FAKE_INEBRIATE
Definition: SpellAuraDefines.h:367
@ INVISIBILITY_DRUNK
Definition: SharedDefines.h:1233
int32 GetInt32Value(uint16 index) const
Definition: Object.cpp:299
void SetInt32Value(uint16 index, int32 value)
Definition: Object.cpp:637
void AddFlag(FLAG_TYPE flag)
Definition: Object.h:356
void DelFlag(FLAG_TYPE flag)
Definition: Object.h:357
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:361
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition: Object.h:507
uint8 GetDrunkValue() const
Definition: Player.h:2122
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition: Unit.cpp:19298

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(), Player::GetDrunkValue(), Object::GetInt32Value(), AuraApplication::GetTarget(), Object::GetTypeId(), Unit::HasAuraType(), INVISIBILITY_DRUNK, WorldObject::m_invisibilityDetect, PLAYER_FAKE_INEBRIATION, Object::SetInt32Value(), SPELL_AURA_MOD_FAKE_INEBRIATE, Object::ToPlayer(), TYPEID_PLAYER, and Unit::UpdateObjectVisibility().

◆ HandleAuraModIncreaseEnergy()

void AuraEffect::HandleAuraModIncreaseEnergy ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4335{
4337 return;
4338
4339 Unit* target = aurApp->GetTarget();
4340
4342 // do not check power type, we can always modify the maximum
4343 // as the client will not see any difference
4344 // also, placing conditions that may change during the aura duration
4345 // inside effect handlers is not a good idea
4346 //if (int32(PowerType) != GetMiscValue())
4347 // return;
4348
4349 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4350
4351 target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4352}
std::uint16_t uint16
Definition: Define.h:109
@ UNIT_MOD_POWER_START
Definition: Unit.h:293
PowerType
Definition: VehicleDefines.h:30
Powers
Definition: SharedDefines.h:240

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

◆ HandleAuraModIncreaseEnergyPercent()

void AuraEffect::HandleAuraModIncreaseEnergyPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4355{
4357 return;
4358
4359 Unit* target = aurApp->GetTarget();
4360
4362 // do not check power type, we can always modify the maximum
4363 // as the client will not see any difference
4364 // also, placing conditions that may change during the aura duration
4365 // inside effect handlers is not a good idea
4366 //if (int32(PowerType) != GetMiscValue())
4367 // return;
4368
4369 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4370 float amount = float(GetAmount());
4371
4372 if (apply)
4373 {
4374 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4375 target->ModifyPowerPct(PowerType, amount, apply);
4376 }
4377 else
4378 {
4379 target->ModifyPowerPct(PowerType, amount, apply);
4380 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4381 }
4382}
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
Definition: Unit.cpp:14084

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

◆ HandleAuraModIncreaseFlightSpeed()

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

Update ability to fly

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

3312{
3314 return;
3315
3316 Unit* target = aurApp->GetTarget();
3318 target->UpdateSpeed(MOVE_FLIGHT, true);
3319
3322 {
3323 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3325 {
3326 target->SetCanFly(apply);
3327
3328 if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
3329 target->GetMotionMaster()->MoveFall();
3330 }
3331
3333 if (mode & AURA_EFFECT_HANDLE_REAL)
3334 {
3335 //Players on flying mounts must be immune to polymorph
3336 if (target->GetTypeId() == TYPEID_PLAYER)
3338
3339 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3340 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID())
3342 }
3343 }
3344
3345 if (Player* targetPlayer = target->ToPlayer())
3346 {
3347 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3348 }
3349}
@ SPELL_AURA_FLY
Definition: SpellAuraDefines.h:264
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK
Definition: SpellAuraDefines.h:50
@ MECHANIC_POLYMORPH
Definition: SharedDefines.h:1314
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:5580
uint32 GetMountID() const
Definition: Unit.h:1543

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(), Object::GetTypeId(), Unit::HasAuraEffect(), Unit::HasAuraType(), IMMUNITY_MECHANIC, Unit::IsLevitating(), MECHANIC_POLYMORPH, MOVE_FLIGHT, MotionMaster::MoveFall(), Unit::SetCanFly(), Object::SetUInt32Value(), SPELL_AURA_FLY, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, sScriptMgr, Object::ToPlayer(), TYPEID_PLAYER, TYPEID_UNIT, UNIT_FIELD_MOUNTDISPLAYID, and Unit::UpdateSpeed().

◆ HandleAuraModIncreaseHealth()

void AuraEffect::HandleAuraModIncreaseHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4290{
4292 return;
4293
4294 Unit* target = aurApp->GetTarget();
4295
4296 if (apply)
4297 {
4298 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4299 target->ModifyHealth(GetAmount());
4300 }
4301 else
4302 {
4303 if (int32(target->GetHealth()) > GetAmount())
4304 target->ModifyHealth(-GetAmount());
4305 else
4306 target->SetHealth(1);
4307 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4308 }
4309}
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:13993
void SetHealth(uint32 val)
Definition: Unit.cpp:15370
uint32 GetHealth() const
Definition: Unit.h:1440

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

◆ HandleAuraModIncreaseHealthPercent()

void AuraEffect::HandleAuraModIncreaseHealthPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4385{
4387 return;
4388
4389 Unit* target = aurApp->GetTarget();
4390
4391 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4392 float percent = target->GetHealthPct();
4393 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply);
4394
4395 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4396 if (target->IsAlive())
4397 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4398 target->SetHealth(healthAmount);
4399}
T CalculatePct(T base, U pct)
Definition: Util.h:61
float GetHealthPct() const
Definition: Unit.h:1448
uint32 GetMaxHealth() const
Definition: Unit.h:1441

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

◆ HandleAuraModIncreaseMaxHealth()

void AuraEffect::HandleAuraModIncreaseMaxHealth ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4312{
4314 return;
4315
4316 Unit* target = aurApp->GetTarget();
4317
4318 uint32 oldhealth = target->GetHealth();
4319 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4320
4322
4323 // refresh percentage
4324 if (oldhealth > 0)
4325 {
4326 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4327 if (newhealth == 0)
4328 newhealth = 1;
4329
4330 target->SetHealth(newhealth);
4331 }
4332}

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

◆ HandleAuraModIncreaseMountedSpeed()

void AuraEffect::HandleAuraModIncreaseMountedSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3307{
3308 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3309}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:3291

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3292{
3294 return;
3295
3296 Unit* target = aurApp->GetTarget();
3297
3298 target->UpdateSpeed(MOVE_RUN, true);
3299
3300 if (Player* targetPlayer = target->ToPlayer())
3301 {
3302 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3303 }
3304}

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
3352{
3354 return;
3355
3356 Unit* target = aurApp->GetTarget();
3357
3358 target->UpdateSpeed(MOVE_SWIM, true);
3359
3360 if (Player* targetPlayer = target->ToPlayer())
3361 {
3362 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3363 }
3364}

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
2640{
2642 return;
2643
2644 Unit* target = aurApp->GetTarget();
2645
2646 if (apply)
2647 {
2649 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
2650 }
2651 else
2652 {
2653 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2655 return;
2657 }
2658}
@ UNIT_FLAG_PACIFIED
Definition: Unit.h:465
@ SPELL_AURA_MOD_PACIFY
Definition: SpellAuraDefines.h:88
@ SPELL_AURA_MOD_PACIFY_SILENCE
Definition: SpellAuraDefines.h:123

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), SPELL_AURA_MOD_PACIFY, SPELL_AURA_MOD_PACIFY_SILENCE, and UNIT_FLAG_PACIFIED.

Referenced by HandleAuraModPacifyAndSilence().

◆ HandleAuraModPacifyAndSilence()

void AuraEffect::HandleAuraModPacifyAndSilence ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2661{
2663 return;
2664
2665 Unit* target = aurApp->GetTarget();
2666
2667 if (!(apply))
2668 {
2669 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2671 return;
2672 }
2673 HandleAuraModPacify(aurApp, mode, apply);
2674 HandleAuraModSilence(aurApp, mode, apply);
2675}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2610
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2639

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

◆ HandleAuraModParryPercent()

void AuraEffect::HandleAuraModParryPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4416{
4418 return;
4419
4420 Unit* target = aurApp->GetTarget();
4421
4422 if (target->GetTypeId() != TYPEID_PLAYER)
4423 return;
4424
4425 if (!target->ToPlayer()->CanParry())
4426 target->ToPlayer()->SetCanParry(true);
4427 else
4428 target->ToPlayer()->UpdateParryPercentage();
4429}
void UpdateParryPercentage()
Definition: StatSystem.cpp:742
bool CanParry() const
Definition: Player.h:2132
void SetCanParry(bool value)
Definition: Player.cpp:13018

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

◆ HandleAuraModPetTalentsPoints()

void AuraEffect::HandleAuraModPetTalentsPoints ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2797{
2799 return;
2800
2801 Unit* target = aurApp->GetTarget();
2802
2803 if (target->GetTypeId() != TYPEID_PLAYER)
2804 return;
2805
2806 // Recalculate pet talent points
2807 if (Pet* pet = target->ToPlayer()->GetPet())
2808 pet->InitTalentForLevel();
2809}

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

◆ HandleAuraModRangedAttackPower()

void AuraEffect::HandleAuraModRangedAttackPower ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4714{
4716 return;
4717
4718 Unit* target = aurApp->GetTarget();
4719
4720 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4721 return;
4722
4724}
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition: Unit.h:283
#define CLASSMASK_WAND_USERS
Definition: SharedDefines.h:146
uint32 getClassMask() const
Definition: Unit.h:1427

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

◆ HandleAuraModRangedAttackPowerOfStatPercent()

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

◆ HandleAuraModRangedAttackPowerPercent()

void AuraEffect::HandleAuraModRangedAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4738{
4740 return;
4741
4742 Unit* target = aurApp->GetTarget();
4743
4744 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4745 return;
4746
4747 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
4749}

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

◆ HandleAuraModRangedHaste()

void AuraEffect::HandleAuraModRangedHaste ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4642{
4644 return;
4645
4646 Unit* target = aurApp->GetTarget();
4647
4648 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4649}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition: Unit.cpp:17225

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
4458{
4459 HandleModManaRegen(aurApp, mode, apply);
4460}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:4275

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3942{
3944 return;
3945
3946 Unit* target = aurApp->GetTarget();
3947
3948 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3949 {
3950 if (GetMiscValue() & int32(1 << x))
3951 {
3953 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
3954 target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
3955 }
3956 }
3957}
SpellSchools
Definition: SharedDefines.h:254
bool IsPet() const
Definition: Unit.h:1413
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
Definition: Unit.h:2027

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

◆ HandleAuraModResistanceExclusive()

void AuraEffect::HandleAuraModResistanceExclusive ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3919{
3921 return;
3922
3923 Unit* target = aurApp->GetTarget();
3924
3925 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3926 {
3927 if (GetMiscValue() & int32(1 << x))
3928 {
3930 if (amount < GetAmount())
3931 {
3932 float value = float(GetAmount() - amount);
3934 if (target->GetTypeId() == TYPEID_PLAYER)
3935 target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), value, apply);
3936 }
3937 }
3938 }
3939}
@ BASE_VALUE
Definition: Unit.h:245
@ SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE
Definition: SpellAuraDefines.h:206
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect *except=nullptr) const
Definition: Unit.cpp:5898

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

◆ HandleAuraModResistenceOfStatPercent()

void AuraEffect::HandleAuraModResistenceOfStatPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4214{
4216 return;
4217
4218 Unit* target = aurApp->GetTarget();
4219
4220 if (target->GetTypeId() != TYPEID_PLAYER)
4221 return;
4222
4224 {
4225 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4226 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4227 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4228 return;
4229 }
4230
4231 // Recalculate Armor
4232 target->UpdateArmor();
4233}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:269
virtual void UpdateArmor()=0

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

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3113{
3114 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3115 return;
3116
3117 Unit* target = aurApp->GetTarget();
3118
3119 target->SetControlled(apply, UNIT_STATE_ROOT);
3120}
@ UNIT_STATE_ROOT
Definition: Unit.h:335
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18192

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
2366{
2368 return;
2369
2370 aurApp->GetTarget()->RecalculateObjectScale();
2371}

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
3832{
3833 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3834 return;
3835
3836 Unit* target = aurApp->GetTarget();
3837
3838 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
3839
3840 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3841 {
3842 if (apply)
3844 else
3845 {
3846 bool banishFound = false;
3847 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
3848 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
3849 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3850 {
3851 banishFound = true;
3852 break;
3853 }
3854 if (!banishFound)
3856 }
3857 }
3858
3859 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
3861
3862 // remove all flag auras (they are positive, but they must be removed when you are immune)
3866
3868 if ((apply)
3870 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
3871 {
3872 uint32 school_mask = GetMiscValue();
3873 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
3874 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
3875 {
3876 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
3877 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
3878 && GetSpellInfo()->CanDispelAura(spell)
3879 && !iter->second->IsPositive() //Don't remove positive spells
3880 && spell->Id != GetId()) //Don't remove self
3881 {
3882 target->RemoveAura(iter);
3883 }
3884 else
3885 ++iter;
3886 }
3887 }
3888}
@ UNIT_STATE_ISOLATED
Definition: Unit.h:338
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition: SharedDefines.h:449
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition: SharedDefines.h:406
@ MECHANIC_BANISH
Definition: SharedDefines.h:1315
@ IMMUNITY_SCHOOL
Definition: SharedDefines.h:1368
void ClearUnitState(uint32 f)
Definition: Unit.h:1399
void AddUnitState(uint32 f)
Definition: Unit.h:1397
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5096
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1972
bool IsPositive() const
Definition: SpellInfo.cpp:1221

References Unit::AddUnitState(), Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_REAL, AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION, Unit::ClearUnitState(), Unit::GetAppliedAuras(), Unit::GetAuraEffectsByType(), GetAuraType(), GetId(), GetMiscValue(), SpellInfo::GetSchoolMask(), GetSpellInfo(), AuraApplication::GetTarget(), 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
1843{
1845 return;
1846
1847 Unit* target = aurApp->GetTarget();
1848
1849 uint32 modelid = 0;
1852
1853 switch (form)
1854 {
1855 case FORM_CAT: // 0x01
1856 case FORM_GHOUL: // 0x07
1858 break;
1859
1860 case FORM_BEAR: // 0x05
1861 case FORM_DIREBEAR: // 0x08
1862
1863 case FORM_BATTLESTANCE: // 0x11
1864 case FORM_DEFENSIVESTANCE: // 0x12
1865 case FORM_BERSERKERSTANCE: // 0x13
1867 break;
1868
1869 case FORM_TREE: // 0x02
1870 case FORM_TRAVEL: // 0x03
1871 case FORM_AQUA: // 0x04
1872 case FORM_AMBIENT: // 0x06
1873
1874 case FORM_STEVES_GHOUL: // 0x09
1875 case FORM_THARONJA_SKELETON: // 0x0A
1876 case FORM_TEST_OF_STRENGTH: // 0x0B
1877 case FORM_BLB_PLAYER: // 0x0C
1878 case FORM_SHADOW_DANCE: // 0x0D
1879 case FORM_CREATUREBEAR: // 0x0E
1880 case FORM_CREATURECAT: // 0x0F
1881 case FORM_GHOSTWOLF: // 0x10
1882
1883 case FORM_TEST: // 0x14
1884 case FORM_ZOMBIE: // 0x15
1885 case FORM_METAMORPHOSIS: // 0x16
1886 case FORM_UNDEAD: // 0x19
1887 case FORM_MASTER_ANGLER: // 0x1A
1888 case FORM_FLIGHT_EPIC: // 0x1B
1889 case FORM_SHADOW: // 0x1C
1890 case FORM_FLIGHT: // 0x1D
1891 case FORM_STEALTH: // 0x1E
1892 case FORM_MOONKIN: // 0x1F
1893 case FORM_SPIRITOFREDEMPTION: // 0x20
1894 break;
1895 default:
1896 LOG_ERROR("spells.aura.effect", "Auras: Unknown Shapeshift Type: {}", GetMiscValue());
1897 }
1898
1899 modelid = target->GetModelForForm(form, GetId());
1900
1901 if (apply)
1902 {
1903 // remove polymorph before changing display id to keep new display id
1904 switch (form)
1905 {
1906 case FORM_CAT:
1907 case FORM_TREE:
1908 case FORM_TRAVEL:
1909 case FORM_AQUA:
1910 case FORM_BEAR:
1911 case FORM_DIREBEAR:
1912 case FORM_FLIGHT_EPIC:
1913 case FORM_FLIGHT:
1914 case FORM_MOONKIN:
1915 {
1916 if (Player* player = target->ToPlayer())
1917 {
1918 player->SetCanTeleport(true);
1919 }
1920 // remove movement affects
1921 target->RemoveAurasByShapeShift();
1922
1923 // and polymorphic affects
1924 if (target->IsPolymorphed())
1925 target->RemoveAurasDueToSpell(target->getTransForm());
1926 break;
1927 }
1928 default:
1929 break;
1930 }
1931
1932 // remove other shapeshift before applying a new one
1933 // xinef: rogue shouldnt be wrapped by this check (shadow dance vs stealth)
1934 if (GetSpellInfo()->SpellFamilyName != SPELLFAMILY_ROGUE)
1936
1937 // stop handling the effect if it was removed by linked event
1938 if (aurApp->GetRemoveMode())
1939 return;
1940
1941 if (PowerType != POWER_MANA)
1942 {
1943 uint32 oldPower = target->GetPower(PowerType);
1944 // reset power to default values only at power change
1945 if (target->getPowerType() != PowerType)
1946 target->setPowerType(PowerType);
1947
1948 switch (form)
1949 {
1950 case FORM_CAT:
1951 case FORM_BEAR:
1952 case FORM_DIREBEAR:
1953 {
1954 // get furor proc chance
1955 uint32 FurorChance = 0;
1956 if (AuraEffect const* dummy = target->GetDummyAuraEffect(SPELLFAMILY_DRUID, 238, 0))
1957 FurorChance = std::max(dummy->GetAmount(), 0);
1958
1959 switch (GetMiscValue())
1960 {
1961 case FORM_CAT:
1962 {
1963 int32 basePoints = int32(std::min(oldPower, FurorChance));
1964 target->SetPower(POWER_ENERGY, 0);
1965 target->CastCustomSpell(target, 17099, &basePoints, nullptr, nullptr, true, nullptr, this);
1966 break;
1967 }
1968 case FORM_BEAR:
1969 case FORM_DIREBEAR:
1970 if (urand(0, 99) < FurorChance)
1971 target->CastSpell(target, 17057, true);
1972 break;
1973 default:
1974 {
1975 uint32 newEnergy = std::min(target->GetPower(POWER_ENERGY), FurorChance);
1976 target->SetPower(POWER_ENERGY, newEnergy);
1977 break;
1978 }
1979 }
1980 break;
1981 }
1982 default:
1983 break;
1984 }
1985 }
1986 // stop handling the effect if it was removed by linked event
1987 if (aurApp->GetRemoveMode())
1988 return;
1989
1990 target->SetShapeshiftForm(form);
1991 // xinef: allow shapeshift to override model id if forced transform aura is not present!
1992 if (modelid > 0)
1993 {
1994 bool allow = true;
1995 if (target->getTransForm())
1996 if (SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm()))
1997 if (transformSpellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) || !transformSpellInfo->IsPositive())
1998 allow = false;
1999
2000 if (allow)
2001 target->SetDisplayId(modelid);
2002 }
2003 }
2004 else
2005 {
2006 // reset model id if no other auras present
2007 // may happen when aura is applied on linked event on aura removal
2009 {
2011 if (target->getClass() == CLASS_DRUID)
2012 {
2013 target->setPowerType(POWER_MANA);
2014 // Remove movement impairing effects also when shifting out
2015 target->RemoveAurasByShapeShift();
2016 }
2017 }
2018
2019 if (modelid > 0)
2020 target->RestoreDisplayId();
2021
2022 switch (form)
2023 {
2024 // Nordrassil Harness - bonus
2025 case FORM_BEAR:
2026 case FORM_DIREBEAR:
2027 case FORM_CAT:
2028 if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
2029 target->CastSpell(target, 37316, true, nullptr, dummy);
2030 break;
2031 // Nordrassil Regalia - bonus
2032 case FORM_MOONKIN:
2033 if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
2034 target->CastSpell(target, 37325, true, nullptr, dummy);
2035 break;
2036 case FORM_BATTLESTANCE:
2039 {
2040 uint32 Rage_val = 0;
2041 // Defensive Tactics
2042 if (form == FORM_DEFENSIVESTANCE)
2043 {
2044 if (AuraEffect const* aurEff = target->IsScriptOverriden(m_spellInfo, 831))
2045 Rage_val += aurEff->GetAmount() * 10;
2046 }
2047 // Stance mastery + Tactical mastery (both passive, and last have aura only in defense stance, but need apply at any stance switch)
2048 if (target->GetTypeId() == TYPEID_PLAYER)
2049 {
2050 // Stance mastery - trainer spell
2051 PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap();
2052 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
2053 {
2054 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2055 continue;
2056
2057 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2058 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2059 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2060 }
2061
2062 // Tactical Mastery - talent
2063 PlayerTalentMap const& tp_list = target->ToPlayer()->GetTalentMap();
2064 for (PlayerTalentMap::const_iterator itr = tp_list.begin(); itr != tp_list.end(); ++itr)
2065 {
2066 if (itr->second->State == PLAYERSPELL_REMOVED || !itr->second->IsInSpec(target->ToPlayer()->GetActiveSpec()))
2067 continue;
2068
2069 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
2070 if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139)
2071 Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10;
2072 }
2073 }
2074 if (target->GetPower(POWER_RAGE) > Rage_val)
2075 target->SetPower(POWER_RAGE, Rage_val);
2076 break;
2077 }
2078 default:
2079 break;
2080 }
2081 }
2082
2083 // adding/removing linked auras
2084 // add/remove the shapeshift aura's boosts
2085 HandleShapeshiftBoosts(target, apply);
2086
2087 if (target->GetTypeId() == TYPEID_PLAYER)
2088 target->ToPlayer()->InitDataForForm();
2089
2090 if (target->getClass() == CLASS_DRUID)
2091 {
2092 // Dash
2094 aurEff->RecalculateAmount();
2095
2096 // Disarm handling
2097 // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
2098 // and also HandleAuraModDisarm is not triggered
2099 if (!target->CanUseAttackType(BASE_ATTACK))
2100 {
2102 {
2103 target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem->GetTemplate(), nullptr, apply);
2104 }
2105 }
2106
2107 // Update crit chance for feral forms
2108 switch (form)
2109 {
2110 case FORM_CAT:
2111 case FORM_BEAR:
2112 case FORM_DIREBEAR:
2113 case FORM_GHOSTWOLF:
2115 break;
2116 default:
2117 break;
2118 }
2119 }
2120
2121 // stop handling the effect if it was removed by linked event
2122 if (apply && aurApp->GetRemoveMode())
2123 return;
2124
2125 if (target->GetTypeId() == TYPEID_PLAYER)
2126 {
2127 SpellShapeshiftEntry const* shapeInfo = sSpellShapeshiftStore.LookupEntry(form);
2128 // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
2129 for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
2130 {
2131 if (!shapeInfo->stanceSpell[i])
2132 continue;
2133 if (apply)
2134 target->ToPlayer()->_addSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2135 else
2136 target->ToPlayer()->removeSpell(shapeInfo->stanceSpell[i], SPEC_MASK_ALL, true);
2137 }
2138 }
2139}
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
DBCStorage< SpellShapeshiftEntry > sSpellShapeshiftStore(SpellShapeshiftfmt)
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
ShapeshiftForm
Definition: Unit.h:89
@ FORM_DIREBEAR
Definition: Unit.h:98
@ FORM_UNDEAD
Definition: Unit.h:113
@ FORM_TEST
Definition: Unit.h:110
@ FORM_TRAVEL
Definition: Unit.h:93
@ FORM_CREATUREBEAR
Definition: Unit.h:104
@ FORM_SHADOW
Definition: Unit.h:116
@ FORM_SHADOW_DANCE
Definition: Unit.h:103
@ FORM_SPIRITOFREDEMPTION
Definition: Unit.h:120
@ FORM_BERSERKERSTANCE
Definition: Unit.h:109
@ FORM_MASTER_ANGLER
Definition: Unit.h:114
@ FORM_DEFENSIVESTANCE
Definition: Unit.h:108
@ FORM_THARONJA_SKELETON
Definition: Unit.h:100
@ FORM_FLIGHT_EPIC
Definition: Unit.h:115
@ FORM_STEVES_GHOUL
Definition: Unit.h:99
@ FORM_MOONKIN
Definition: Unit.h:119
@ FORM_NONE
Definition: Unit.h:90
@ FORM_CREATURECAT
Definition: Unit.h:105
@ FORM_CAT
Definition: Unit.h:91
@ FORM_FLIGHT
Definition: Unit.h:117
@ FORM_ZOMBIE
Definition: Unit.h:111
@ FORM_AMBIENT
Definition: Unit.h:96
@ FORM_AQUA
Definition: Unit.h:94
@ FORM_STEALTH
Definition: Unit.h:118
@ FORM_BATTLESTANCE
Definition: Unit.h:107
@ FORM_BLB_PLAYER
Definition: Unit.h:102
@ FORM_METAMORPHOSIS
Definition: Unit.h:112
@ FORM_GHOUL
Definition: Unit.h:97
@ FORM_TREE
Definition: Unit.h:92
@ FORM_TEST_OF_STRENGTH
Definition: Unit.h:101
@ FORM_BEAR
Definition: Unit.h:95
@ 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
#define MAX_SHAPESHIFT_SPELLS
Definition: DBCStructure.h:1789
@ POWER_RAGE
Definition: SharedDefines.h:242
@ POWER_ENERGY
Definition: SharedDefines.h:244
@ POWER_MANA
Definition: SharedDefines.h:241
@ CLASS_DRUID
Definition: SharedDefines.h:123
@ SPELLFAMILY_WARRIOR
Definition: SharedDefines.h:3504
@ SPELL_ATTR0_NO_IMMUNITIES
Definition: SharedDefines.h:383
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
bool _addSpell(uint32 spellId, uint8 addSpecMask, bool temporary, bool learnFromSkill=false)
Definition: Player.cpp:3042
void removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporary)
Definition: Player.cpp:3271
const PlayerTalentMap & GetTalentMap() const
Definition: Player.h:2557
PlayerSpellMap const & GetSpellMap() const
Definition: Player.h:1726
void InitDataForForm(bool reapplyMods=false)
Definition: Player.cpp:10467
uint8 GetActiveSpec() const
Definition: Player.h:1694
void UpdateAllCritPercentages()
Definition: StatSystem.cpp:687
void RemoveAurasByShapeShift()
Definition: Unit.cpp:5190
bool CanUseAttackType(uint8 attacktype) const
Definition: Unit.h:1607
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
Definition: Unit.cpp:14743
bool IsPolymorphed() const
Definition: Unit.cpp:16915
void SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool fromRegenerate=false)
Definition: Unit.cpp:15458
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition: Unit.cpp:5412
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
Definition: Unit.cpp:5721
void RestoreDisplayId()
Definition: Unit.cpp:16946
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
Definition: Unit.h:1976
uint32 getTransForm() const
Definition: Unit.h:2174
Powers getPowerType() const
Definition: Unit.h:1459
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition: Unit.cpp:5025
uint32 GetPower(Powers power) const
Definition: Unit.h:1461
void setPowerType(Powers power)
Definition: Unit.cpp:9952
void SetShapeshiftForm(ShapeshiftForm form)
Definition: Unit.h:2072
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
Definition: Unit.cpp:19369
void HandleShapeshiftBoosts(Unit *target, bool apply) const
Definition: SpellAuraEffects.cpp:1201
uint32 SpellIconID
Definition: SpellInfo.h:378
Definition: DBCStructure.h:1792
uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]
Definition: DBCStructure.h:1805

References Player::_addSpell(), Player::_ApplyWeaponDamage(), AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK, BASE_ATTACK, Unit::CalculateSpellDamage(), Unit::CanUseAttackType(), Unit::CastCustomSpell(), Unit::CastSpell(), 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::getClass(), Unit::GetDummyAuraEffect(), GetId(), Player::GetItemByPos(), GetMiscValue(), Unit::GetModelForForm(), Unit::GetPower(), Unit::getPowerType(), AuraApplication::GetRemoveMode(), GetSpellInfo(), Player::GetSpellMap(), Player::GetTalentMap(), AuraApplication::GetTarget(), Unit::getTransForm(), Object::GetTypeId(), HandleShapeshiftBoosts(), Unit::HasAuraType(), Player::InitDataForForm(), INVENTORY_SLOT_BAG_0, Unit::IsPolymorphed(), Unit::IsScriptOverriden(), LOG_ERROR, m_spellInfo, 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, sSpellShapeshiftStore, SpellShapeshiftEntry::stanceSpell, Object::ToPlayer(), TYPEID_PLAYER, Player::UpdateAllCritPercentages(), and urand().

◆ HandleAuraModSilence()

void AuraEffect::HandleAuraModSilence ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2611{
2612 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2613 return;
2614
2615 Unit* target = aurApp->GetTarget();
2616
2617 if (apply)
2618 {
2620
2621 // call functions which may have additional effects after chainging state of unit
2622 // Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
2623 for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
2624 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
2625 if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
2626 // Stop spells on prepare or casting state
2627 target->InterruptSpell(CurrentSpellTypes(i), false);
2628 }
2629 else
2630 {
2631 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2633 return;
2634
2636 }
2637}
#define CURRENT_MAX_SPELL
Definition: Unit.h:985
CurrentSpellTypes
Definition: Unit.h:977
@ CURRENT_MELEE_SPELL
Definition: Unit.h:978
@ UNIT_FLAG_SILENCED
Definition: Unit.h:461
@ SPELL_AURA_MOD_SILENCE
Definition: SpellAuraDefines.h:90
@ SPELL_PREVENTION_TYPE_SILENCE
Definition: SharedDefines.h:1526
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4002

References AURA_EFFECT_HANDLE_REAL, CURRENT_MAX_SPELL, CURRENT_MELEE_SPELL, Unit::GetCurrentSpell(), AuraApplication::GetTarget(), Unit::HasAuraType(), Unit::InterruptSpell(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), SPELL_AURA_MOD_PACIFY_SILENCE, SPELL_AURA_MOD_SILENCE, SPELL_PREVENTION_TYPE_SILENCE, and UNIT_FLAG_SILENCED.

Referenced by HandleAuraModPacifyAndSilence().

◆ HandleAuraModSkill()

void AuraEffect::HandleAuraModSkill ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2812{
2814 return;
2815 Unit* target = aurApp->GetTarget();
2816
2817 if (target->GetTypeId() != TYPEID_PLAYER)
2818 return;
2819
2820 uint32 prot = GetMiscValue();
2821 int32 points = GetAmount();
2822
2823 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
2824 if (prot == SKILL_DEFENSE)
2825 target->ToPlayer()->UpdateDefenseBonusesMod();
2826}
@ SPELL_AURA_MOD_SKILL_TALENT
Definition: SpellAuraDefines.h:161
@ AURA_EFFECT_HANDLE_SKILL
Definition: SpellAuraDefines.h:47
@ SKILL_DEFENSE
Definition: SharedDefines.h:2853
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition: Player.cpp:5211
void UpdateDefenseBonusesMod()
Definition: StatSystem.cpp:616

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

◆ HandleAuraModStalked()

void AuraEffect::HandleAuraModStalked ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2754{
2756 return;
2757
2758 Unit* target = aurApp->GetTarget();
2759
2760 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
2761 if (apply)
2763 else
2764 {
2765 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2766 if (!target->HasAuraType(GetAuraType()))
2768 }
2769
2770 // call functions which may have additional effects after chainging state of unit
2771 target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER);
2772}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition: SharedDefines.h:3094
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:118
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:117

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

◆ HandleAuraModStat()

void AuraEffect::HandleAuraModStat ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4033{
4035 return;
4036
4037 Unit* target = aurApp->GetTarget();
4038
4039 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4040 {
4041 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4042 return;
4043 }
4044
4045 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4046 {
4047 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4048 if (GetMiscValue() < 0 || GetMiscValue() == i)
4049 {
4050 //target->ApplyStatMod(Stats(i), m_amount, apply);
4052 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
4053 target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
4054 }
4055 }
4056}
@ UNIT_MOD_STAT_START
Definition: Unit.h:289
#define MAX_STATS
Definition: SharedDefines.h:237
Stats
Definition: SharedDefines.h:229
@ STAT_STRENGTH
Definition: SharedDefines.h:230
void ApplyStatBuffMod(Stats stat, float val, bool apply)
Definition: Unit.h:2034

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

◆ HandleAuraModStateImmunity()

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

◆ HandleAuraModStun()

void AuraEffect::HandleAuraModStun ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3103{
3104 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3105 return;
3106
3107 Unit* target = aurApp->GetTarget();
3108
3109 target->SetControlled(apply, UNIT_STATE_STUNNED);
3110}
@ UNIT_STATE_STUNNED
Definition: Unit.h:328

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
3041{
3043 return;
3044
3045 Unit* target = aurApp->GetTarget();
3046
3047 if (!target->IsAlive() || target->GetTypeId() != TYPEID_PLAYER)
3048 return;
3049
3050 Unit* caster = GetCaster();
3051 if (caster && caster->IsAlive())
3052 target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
3053}
void addTempThreat(float threat, bool apply)
Definition: HostileRefMgr.cpp:65
HostileRefMgr & getHostileRefMgr()
Definition: Unit.h:2149

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

◆ HandleAuraModUseNormalSpeed()

void AuraEffect::HandleAuraModUseNormalSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3388{
3389 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3390 return;
3391
3392 Unit* target = aurApp->GetTarget();
3393
3394 target->UpdateSpeed(MOVE_RUN, true);
3395 target->UpdateSpeed(MOVE_SWIM, true);
3396 target->UpdateSpeed(MOVE_FLIGHT, true);
3397
3398 if (Player* targetPlayer = target->ToPlayer())
3399 {
3400 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3401 }
3402}

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
4463{
4465 return;
4466
4467 Unit* target = aurApp->GetTarget();
4468
4469 if (target->GetTypeId() != TYPEID_PLAYER)
4470 return;
4471
4472 for (int i = 0; i < MAX_ATTACK; ++i)
4473 if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
4474 target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply);
4475
4476 // mods must be applied base at equipped weapon class and subclass comparison
4477 // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
4478 // GetMiscValue() comparison with item generated damage types
4479
4480 if (GetSpellInfo()->EquippedItemClass == -1)
4481 {
4482 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4485 }
4486 else
4487 {
4488 // done in Player::_ApplyWeaponDependentAuraMods
4489 }
4490}
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const *aura, bool apply)
Definition: Player.cpp:6902

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

◆ HandleAuraMounted()

void AuraEffect::HandleAuraMounted ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2833{
2835 return;
2836
2837 Unit* target = aurApp->GetTarget();
2838 Unit* caster = GetCaster();
2839
2840 if (apply)
2841 {
2842 uint32 creatureEntry = GetMiscValue();
2843 uint32 displayId = 0;
2844 uint32 vehicleId = 0;
2845
2846 // Festive Holiday Mount
2847 if (target->HasAura(62061))
2848 {
2850 creatureEntry = 24906;
2851 else
2852 creatureEntry = 15665;
2853 }
2854
2855 // Festive Brewfest Mount
2857 {
2858 if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
2859 {
2860 creatureEntry = GREAT_BREWFEST_KODO;
2861 }
2862 else
2863 {
2864 creatureEntry = BREWFEST_KODO;
2865 }
2866 }
2867
2868 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
2869 {
2870 if (GetMiscValueB() > 0) // Choose proper modelid
2871 {
2872 displayId = GetMiscValueB() == 2 && creatureInfo->Modelid2 > 0 ? creatureInfo->Modelid2 : creatureInfo->Modelid1;
2873 }
2874 else // Should we choose random modelid in this case?
2875 {
2876 displayId = ObjectMgr::ChooseDisplayId(creatureInfo);
2877 }
2878 sObjectMgr->GetCreatureModelRandomGender(&displayId);
2879
2880 vehicleId = creatureInfo->VehicleId;
2881
2882 //some spell has one aura of mount and one of vehicle
2883 for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
2884 {
2885 if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue())
2886 {
2887 displayId = 0;
2888 }
2889 }
2890
2891 }
2892 target->Mount(displayId, vehicleId, GetMiscValue());
2893 }
2894 else
2895 {
2896 target->Dismount();
2897 //some mounts like Headless Horseman's Mount or broom stick are skill based spell
2898 // need to remove ALL arura related to mounts, this will stop client crash with broom stick
2899 // and never endless flying after using Headless Horseman's Mount
2900 if (mode & AURA_EFFECT_HANDLE_REAL)
2902 }
2903}
@ SPELL_EFFECT_SUMMON
Definition: SharedDefines.h:778
void Dismount()
Definition: Unit.cpp:13435
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5610
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:13376

References AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, BREWFEST_KODO, ObjectMgr::ChooseDisplayId(), Unit::Dismount(), FRESH_BREWFEST_HOPS, GetBase(), GetCaster(), GetMiscValue(), GetMiscValueB(), 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
5701{
5702 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5703 return;
5704
5705 Unit* target = aurApp->GetTarget();
5706
5707 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
5708 return;
5709
5710 if (apply)
5711 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
5712
5713 // client auto close stable dialog at !apply aura
5714}
bool IsInWorld() const
Definition: Object.h:101
WorldSession * GetSession() const
Definition: Player.h:1948
void SendStablePet(ObjectGuid guid)
Definition: NPCHandler.cpp:483

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

◆ HandleAuraOverrideSpells()

void AuraEffect::HandleAuraOverrideSpells ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5758{
5759 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5760 return;
5761
5762 Player* target = aurApp->GetTarget()->ToPlayer();
5763
5764 if (!target || !target->IsInWorld())
5765 return;
5766
5767 uint32 overrideId = uint32(GetMiscValue());
5768
5769 if (apply)
5770 {
5772 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5773 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5774 if (uint32 spellId = overrideSpells->spellId[i])
5775 target->_addSpell(spellId, SPEC_MASK_ALL, true);
5776 }
5777 else
5778 {
5780 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5781 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5782 if (uint32 spellId = overrideSpells->spellId[i])
5783 target->removeSpell(spellId, SPEC_MASK_ALL, true);
5784 }
5785}
DBCStorage< OverrideSpellDataEntry > sOverrideSpellDataStore(OverrideSpellDatafmt)
@ PLAYER_FIELD_BYTES2
Definition: UpdateFields.h:378
#define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET
Definition: Player.h:552
#define MAX_OVERRIDE_SPELL
Definition: DBCStructure.h:1394
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition: Object.cpp:770
Definition: DBCStructure.h:1397

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
4994{
4995 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4996 return;
4997
4998 Unit* target = aurApp->GetTarget();
4999
5000 if (target->GetTypeId() != TYPEID_PLAYER)
5001 return;
5002
5003 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5004 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5005 if (!(apply) && GetBase()->GetDuration() == 0)
5006 target->AddComboPoints(-GetAmount());
5007}
void AddComboPoints(Unit *target, int8 count)
Definition: Unit.cpp:17009

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

◆ HandleAuraSetVehicle()

void AuraEffect::HandleAuraSetVehicle ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5788{
5789 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5790 return;
5791
5792 Unit* target = aurApp->GetTarget();
5793
5794 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
5795 return;
5796
5797 uint32 vehicleId = GetMiscValue();
5798
5799 if (apply)
5800 {
5801 if (!target->CreateVehicleKit(vehicleId, 0))
5802 return;
5803 }
5804 else if (target->GetVehicleKit())
5805 target->RemoveVehicleKit();
5806
5808 data << target->GetPackGUID();
5809 data << uint32(apply ? vehicleId : 0);
5810 target->SendMessageToSet(&data, true);
5811
5812 if (apply)
5813 {
5815 target->ToPlayer()->GetSession()->SendPacket(&data);
5816 }
5817}
@ SMSG_PLAYER_VEHICLE_DATA
Definition: Opcodes.h:1221
@ SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA
Definition: Opcodes.h:1211
PackedGuid const & GetPackGUID() const
Definition: Object.h:108
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition: Object.h:482
std::size_t size() const
Definition: ObjectGuid.h:276
void RemoveVehicleKit()
Definition: Unit.cpp:18895
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Definition: Unit.cpp:18883
Definition: WorldPacket.h:27
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:207

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

◆ HandleAuraTrackCreatures()

void AuraEffect::HandleAuraTrackCreatures ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2703{
2705 return;
2706
2707 Unit* target = aurApp->GetTarget();
2708
2709 if (target->GetTypeId() != TYPEID_PLAYER)
2710 return;
2711
2712 if (apply)
2713 target->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
2714 else
2715 target->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
2716}