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

#include "SpellAuraEffects.h"

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

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

References m_channelData, and m_spellmod.

◆ AuraEffect()

AuraEffect::AuraEffect ( Aura base,
uint8  effIndex,
int32 baseAmount,
Unit caster 
)
explicitprivate
383 :
384 m_base(base), m_spellInfo(base->GetSpellInfo()),
385 m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_dieSides(m_spellInfo->Effects[effIndex].DieSides),
386 m_critChance(0), 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:992
#define sSpellMgr
Definition: SpellMgr.h:825
ObjectGuid GetGuidValue(uint16 index) const
Definition: Object.cpp:337
bool CanApplyResilience() const
Definition: Unit.h:2441
uint8 GetLevel() const
Definition: Unit.h:1432
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:2075
int32 m_periodicTimer
Definition: SpellAuraEffects.h:142
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:147
uint8 const m_effIndex
Definition: SpellAuraEffects.h:146
uint8 m_casterLevel
Definition: SpellAuraEffects.h:128
bool m_applyResilience
Definition: SpellAuraEffects.h:127
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition: SpellAuraEffects.cpp:593
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:684
int32 m_oldAmount
Definition: SpellAuraEffects.h:135
uint32 GetId() const
Definition: SpellAuraEffects.cpp:432
int32 CalculateAmount(Unit *caster)
Definition: SpellAuraEffects.cpp:452
int32 m_amount
Definition: SpellAuraEffects.h:129
void CalculatePeriodicData()
Definition: SpellAuraEffects.cpp:578
uint32 m_tickNumber
Definition: SpellAuraEffects.h:144
int32 const m_baseAmount
Definition: SpellAuraEffects.h:124
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:123
bool m_isAuraEnabled
Definition: SpellAuraEffects.h:136
bool m_isPeriodic
Definition: SpellAuraEffects.h:148
uint32 m_auraGroup
Definition: SpellAuraEffects.h:134
int32 const m_dieSides
Definition: SpellAuraEffects.h:125
float m_critChance
Definition: SpellAuraEffects.h:130
Aura *const m_base
Definition: SpellAuraEffects.h:121
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:100
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 
)
800{
801 if (!m_spellmod || target->GetTypeId() != TYPEID_PLAYER)
802 return;
803
804 target->ToPlayer()->AddSpellMod(m_spellmod, apply);
805
806 // Auras with charges do not mod amount of passive auras
807 if (GetBase()->IsUsingCharges())
808 return;
809 // reapply some passive spells after add/remove related spellmods
810 // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
811 switch (GetMiscValue())
812 {
814 case SPELLMOD_EFFECT1:
815 case SPELLMOD_EFFECT2:
816 case SPELLMOD_EFFECT3:
817 {
818 ObjectGuid guid = target->GetGUID();
819 Unit::AuraApplicationMap& auras = target->GetAppliedAuras();
820 for (Unit::AuraApplicationMap::iterator iter = auras.begin(); iter != auras.end(); ++iter)
821 {
822 Aura* aura = iter->second->GetBase();
823 // only passive and permament auras-active auras should have amount set on spellcast and not be affected
824 // if aura is casted by others, it will not be affected
825 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == guid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
826 {
828 {
829 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
830 {
831 if (AuraEffect* aurEff = aura->GetEffect(i))
832 aurEff->RecalculateAmount();
833 }
834 }
835 else if (GetMiscValue() == SPELLMOD_EFFECT1)
836 {
837 if (AuraEffect* aurEff = aura->GetEffect(0))
838 aurEff->RecalculateAmount();
839 }
840 else if (GetMiscValue() == SPELLMOD_EFFECT2)
841 {
842 if (AuraEffect* aurEff = aura->GetEffect(1))
843 aurEff->RecalculateAmount();
844 }
845 else //if (modOp == SPELLMOD_EFFECT3)
846 {
847 if (AuraEffect* aurEff = aura->GetEffect(2))
848 aurEff->RecalculateAmount();
849 }
850 }
851 }
852
853 Pet* pet = target->ToPlayer()->GetPet();
854 if (!pet)
855 break;
856
857 ObjectGuid petguid = pet->GetGUID();
858 Unit::AuraApplicationMap& petauras = pet->GetAppliedAuras();
859 for (Unit::AuraApplicationMap::iterator iter = petauras.begin(); iter != petauras.end(); ++iter)
860 {
861 Aura* aura = iter->second->GetBase();
862 // only passive auras-active auras should have amount set on spellcast and not be affected
863 // if aura is casted by others, it will not be affected
864 if ((aura->IsPassive() || aura->IsPermanent()) && aura->GetCasterGUID() == petguid && aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
865 {
867 {
868 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
869 {
870 if (AuraEffect* aurEff = aura->GetEffect(i))
871 aurEff->RecalculateAmount();
872 }
873 }
874 else if (GetMiscValue() == SPELLMOD_EFFECT1)
875 {
876 if (AuraEffect* aurEff = aura->GetEffect(0))
877 aurEff->RecalculateAmount();
878 }
879 else if (GetMiscValue() == SPELLMOD_EFFECT2)
880 {
881 if (AuraEffect* aurEff = aura->GetEffect(1))
882 aurEff->RecalculateAmount();
883 }
884 else //if (modOp == SPELLMOD_EFFECT3)
885 {
886 if (AuraEffect* aurEff = aura->GetEffect(2))
887 aurEff->RecalculateAmount();
888 }
889 }
890 }
891 }
892 default:
893 break;
894 }
895}
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:1635
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:8819
void AddSpellMod(SpellModifier *mod, bool apply)
Definition: Player.cpp:9806
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition: Unit.h:1311
AuraApplicationMap & GetAppliedAuras()
Definition: Unit.h:1938
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:1280

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
1045{
1046 float critChance = 0.0f;
1047 if (caster)
1048 {
1049 if (Player* modOwner = caster->GetSpellModOwner())
1050 {
1051 Unit::AuraEffectList const& mPeriodicCritAuras = modOwner->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
1052 for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
1053 {
1054 if ((*itr)->IsAffectedOnSpell(GetSpellInfo()))
1055 {
1056 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), (GetSpellInfo()->DmgClass == SPELL_DAMAGE_CLASS_RANGED ? RANGED_ATTACK : BASE_ATTACK), true);
1057 break;
1058 }
1059 }
1060
1061 switch(GetSpellInfo()->SpellFamilyName)
1062 {
1063 // Rupture - since 3.3.3 can crit
1064 case SPELLFAMILY_ROGUE:
1065 if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100000)
1066 critChance = modOwner->SpellDoneCritChance(nullptr, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), BASE_ATTACK, true);
1067 break;
1068 }
1069 }
1070 }
1071 if (target && critChance > 0.0f)
1072 critChance = target->SpellTakenCritChance(caster, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), critChance, BASE_ATTACK, true);
1073
1074 return std::max(0.0f, critChance);
1075}
@ 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:1548
@ SPELLFAMILY_ROGUE
Definition: SharedDefines.h:3536
Definition: Player.h:1056
Player * GetSpellModOwner() const
Definition: Unit.cpp:16845
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:1318
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 (!item2)
533 item2 = caster->ToPlayer()->GetShield();
534
535 if (item1 && item2
537 {
538 amount = -10;
539 }
540 else
541 amount = 0;
542 }
543 break;
544 default:
545 break;
546 }
547
548 // xinef: save base amount, before calculating sp etc. Used for Unit::CastDelayedSpellWithPeriodicAmount
549 SetOldAmount(amount * GetBase()->GetStackAmount());
551
552 // Xinef: Periodic auras
553 if (caster)
554 switch (GetAuraType())
555 {
558 // xinef: save caster depending auras, always pass 1 as stack amount, effect will be multiplicated at the end of the function by correct value!
559 if (GetBase()->GetType() == UNIT_AURA_TYPE)
560 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
561 break;
563 if (GetBase()->GetType() == UNIT_AURA_TYPE)
564 amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
565 break;
567 if (GetBase()->GetType() == UNIT_AURA_TYPE)
568 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE, 0.0f, 1);
569 break;
570 default:
571 break;
572 }
573
574 amount *= GetBase()->GetStackAmount();
575 return amount;
576}
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:1839
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition: DBCStructure.h:1195
Definition: Item.h:214
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:545
uint32 InventoryType
Definition: ItemTemplate.h:641
Item * GetShield(bool useable=false) const
Definition: PlayerStorage.cpp:551
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition: PlayerStorage.cpp:516
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:1981
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:12446
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:11609
void SetOldAmount(int32 amount)
Definition: SpellAuraEffects.h:117
AuraType GetAuraType() const
Definition: SpellAuraEffects.cpp:447
float GetPctMods() const
Definition: SpellAuraEffects.h:112
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:56
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: SpellAuras.cpp:2531
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:880
Definition: DBCStructure.h:1208
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > AllocationPct
Definition: DBCStructure.h:1215
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition: DBCStructure.h:1213
Definition: DBCStructure.h:1842
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition: DBCStructure.h:1848

References AddPct(), ItemRandomSuffixEntry::AllocationPct, BASE_ATTACK, Aura::CallScriptEffectCalcAmountHandlers(), DOT, SpellInfo::Effects, ItemRandomSuffixEntry::Enchantment, Unit::GetAuraEffectsByType(), GetAuraType(), GetBase(), GetEffIndex(), GetId(), GetPctMods(), Player::GetShield(), GetSpellInfo(), Aura::GetStackAmount(), Item::GetTemplate(), Player::GetWeaponForAttack(), SpellInfo::HasAura(), SpellInfo::Id, ItemTemplate::InventoryType, INVTYPE_2HWEAPON, m_baseAmount, m_canBeRecalculated, m_effIndex, m_spellInfo, MAX_ITEM_ENCHANTMENT_EFFECTS, MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS, OFF_ATTACK, SpellInfo::ProcFlags, SetOldAmount(), sItemRandomSuffixStore, 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.
594{
596
597 // prepare periodics
598 switch (GetAuraType())
599 {
601 // 3 spells have no amplitude set
602 if (!m_amplitude)
604 [[fallthrough]];
618 m_isPeriodic = true;
619 break;
620 default:
621 break;
622 }
623
625
626 if (!m_isPeriodic)
627 return;
628
629 // Xinef: fix broken data in dbc
630 if (m_amplitude <= 0)
631 m_amplitude = 1000;
632
633 Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
634
635 // Apply casting time mods
636 if (m_amplitude)
637 {
638 // Apply periodic time mod
639 if (modOwner)
641
642 if (caster)
643 {
646 }
647 }
648
649 if (load) // aura loaded from db
650 {
654 ++m_tickNumber;
655 }
656 else // aura just created or reapplied
657 {
658 m_tickNumber = 0;
659 // reset periodic timer on aura create or on reapply when aura isn't dot
660 // possibly we should not reset periodic timers only when aura is triggered by proc
661 // or maybe there's a spell attribute somewhere
662 bool resetPeriodicTimer = create
664
665 if (resetPeriodicTimer)
666 {
667 m_periodicTimer = 0;
668 // Start periodic on next tick or at aura apply
669 if (m_amplitude)
670 {
673 else if (caster && caster->IsTotem()) // for totems only ;d
674 {
675 m_periodicTimer = 100; // make it ALMOST instant
676 if (!GetBase()->IsPassive())
677 GetBase()->SetDuration(GetBase()->GetDuration() + 100);
678 }
679 }
680 }
681 }
682}
constexpr auto IN_MILLISECONDS
Definition: Common.h:55
@ 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:576
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition: SharedDefines.h:580
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:9648
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition: Unit.cpp:5676
bool IsTotem() const
Definition: Unit.h:1427
int32 m_amplitude
Definition: SpellAuraEffects.h:143
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:2545
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 ( )
579{
580 // xinef: save caster depending auras with pct mods
581 if (GetBase()->GetType() == UNIT_AURA_TYPE && GetCaster())
582 {
587 }
588
589 if (GetCaster())
590 SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : nullptr)));
591}
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:12354
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:11278
float CalcPeriodicCritChance(Unit const *caster, Unit const *target) const
Definition: SpellAuraEffects.cpp:1044
float m_pctMods
Definition: SpellAuraEffects.h:131
Unit * GetCaster() const
Definition: SpellAuraEffects.h:47
void SetCritChance(float crit)
Definition: SpellAuraEffects.h:109

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 ( )
685{
686 switch (GetAuraType())
687 {
690 if (!m_spellmod)
691 {
694
695 m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
697 m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
699 }
701 break;
702 default:
703 break;
704 }
706}
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:64
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition: SpellAuras.cpp:2559
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 
)
709{
710 // Reapply if amount change
711 uint8 handleMask = 0;
712 if (newAmount != GetAmount())
714 if (onStackOrReapply)
715 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
716
717 if (!handleMask)
718 return;
719
720 std::list<AuraApplication*> effectApplications;
721 GetApplicationList(effectApplications);
722
723 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
724 if ((*apptItr)->HasEffect(GetEffIndex()))
725 HandleEffect(*apptItr, handleMask, false);
726
727 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
728 {
729 if (!mark)
730 m_amount = newAmount;
731 else
732 SetAmount(newAmount);
734 }
735
736 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
737 if ((*apptItr)->HasEffect(GetEffIndex()))
738 HandleEffect(*apptItr, handleMask, true);
739}
@ 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:741
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:66

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

Referenced by spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), RecalculateAmount(), 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?
1200{
1201 uint32 tSpellId = m_spellInfo->Effects[GetEffIndex()].TriggerSpell;
1202 if (!tSpellId)
1203 return;
1204
1205 SpellInfo const* tProto = sSpellMgr->GetSpellInfo(tSpellId);
1206 if (!tProto)
1207 return;
1208
1209 if (tProto->GetDuration() != -1)
1210 return;
1211
1212 // needed for spell 43680, maybe others
1216 return;
1217
1218 target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());
1219}
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:48
Definition: SpellInfo.h:314
int32 GetDuration() const
Definition: SpellInfo.cpp:2324

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

Referenced by AuraApplication::_HandleEffect().

◆ GetAmount()

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

References m_amount, and m_isAuraEnabled.

Referenced by Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), Pet::_SaveAuras(), spell_dru_survival_instincts_aura::AfterApply(), spell_the_lich_king_necrotic_plague_jump::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_warl_glyph_of_voidwalker::HandleApply(), spell_pri_renew::HandleApplyEffect(), HandleAuraDummy(), HandleAuraIncreaseBaseHealthPercent(), HandleAuraLinked(), HandleAuraModAttackPower(), HandleAuraModAttackPowerPercent(), HandleAuraModBaseResistancePCT(), HandleAuraModCritPct(), HandleAuraModFakeInebriation(), HandleAuraModIncreaseEnergy(), HandleAuraModIncreaseEnergyPercent(), HandleAuraModIncreaseHealth(), HandleAuraModIncreaseHealthPercent(), HandleAuraModIncreaseMaxHealth(), HandleAuraModRangedAttackPower(), HandleAuraModRangedAttackPowerPercent(), HandleAuraModRangedHaste(), HandleAuraModResistance(), HandleAuraModResistanceExclusive(), HandleAuraModSkill(), HandleAuraModStat(), HandleAuraModTotalThreat(), HandleAuraModWeaponCritPercent(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraRetainComboPoints(), Aura::HandleAuraSpecificMods(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), spell_shadowfang_keep_haunting_spirits::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(), spell_serpentshrine_cavern_infection::HandleEffectRemove(), HandleModAttackSpeed(), HandleModBaseResistance(), HandleModCastingSpeed(), HandleModCombatSpeedPct(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModHitChance(), HandleModInvisibility(), HandleModInvisibilityDetect(), HandleModMeleeRangedSpeedPct(), HandleModMeleeSpeedPct(), HandleModOffhandDamagePercent(), HandleModPowerCost(), HandleModPowerCostPCT(), HandleModRating(), HandleModResistancePercent(), HandleModSpellCritChance(), HandleModSpellHitChance(), HandleModStateImmunityMask(), HandleModStealth(), HandleModStealthDetect(), HandleModStealthLevel(), HandleModTargetResistance(), HandleModThreat(), HandleModTotalPercentStat(), Unit::HandleOverrideClassScriptAuraProc(), spell_dk_chains_of_ice_aura::HandlePeriodic(), spell_ragin_flames_inferno::HandlePeriodic(), spell_dk_death_and_decay_aura::HandlePeriodic(), spell_dk_pet_scaling::HandlePeriodic(), spell_hun_generic_scaling::HandlePeriodic(), spell_hun_sniper_training::HandlePeriodic(), spell_mage_pet_scaling::HandlePeriodic(), spell_sha_feral_spirit_scaling::HandlePeriodic(), spell_warl_generic_scaling::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dru_living_seed_proc::HandleProc(), spell_sha_earth_shield::HandleProc(), spell_oculus_temporal_rift::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_sha_t8_electrified::HandleProc(), spell_hun_lock_and_load::HandleProcs(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), HandleRangedAmmoHaste(), spell_warl_haunt_aura::HandleRemove(), spell_warl_glyph_of_felguard::HandleRemove(), spell_warl_glyph_of_voidwalker::HandleRemove(), HandleShieldBlockValue(), spell_hun_sniper_training::HandleUpdatePeriodic(), Aura::IsAuraStronger(), spell_valanar_kinetic_bomb_absorb::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::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(), 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
115{ 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

◆ GetDieSides()

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

References m_dieSides.

Referenced by spell_warl_demonic_knowledge::CalculateAmount().

◆ GetEffIndex()

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

References m_effIndex.

Referenced by AuraApplication::_HandleEffect(), spell_dru_lifebloom::AfterRemove(), Unit::CalcAbsorbResist(), spell_pal_sacred_shield_base::CalculateAmount(), spell_sha_earth_shield::CalculateAmount(), spell_warl_improved_demonic_tactics::CalculateAmount(), spell_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_karazhan_temptation::HandleProc(), spell_gen_proc_not_self::HandleProc(), spell_item_unsated_craving::HandleProc(), spell_pal_sacred_shield_base::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), spell_putricide_mutated_plague::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_tidalvess::OnPeriodic(), spell_karathress_power_of_caribdis::OnPeriodic(), spell_leotheras_demon_link::OnPeriodic(), spell_gen_periodic_knock_away::OnPeriodic(), spell_broggok_poison_cloud::PeriodicTick(), spell_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
65{ 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
116{ return m_oldAmount; }

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

float AuraEffect::GetPctMods ( ) const
inline
112{ 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(), spell_dru_idol_lifebloom::HandleEffectCalcSpellMod(), 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
87{ 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
5362{
5363 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5364 return;
5365
5366 Unit* target = aurApp->GetTarget();
5367
5368 if (apply)
5370 else
5371 {
5372 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5373 if (target->HasAuraType(GetAuraType()))
5374 return;
5376 }
5377}
@ UNIT_FLAG_PREPARATION
Definition: Unit.h:453
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
Definition: Unit.h:1302
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:5643
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
ObjectGuid GetTarget() const
Definition: Unit.h:2447
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1496

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
3312{
3314 return;
3315
3316 Unit* target = aurApp->GetTarget();
3317
3318 if (!apply)
3319 {
3320 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3322 return;
3323 }
3324
3325 target->SetCanFly(apply);
3326
3327 if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
3328 target->GetMotionMaster()->MoveFall();
3329}
@ 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:2276
bool IsLevitating() const
Definition: Unit.h:2392
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20958
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:587

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
3084{
3086 return;
3087
3088 Unit* target = aurApp->GetTarget();
3089
3090 if (target->GetTypeId() == TYPEID_PLAYER)
3091 {
3092 if (apply)
3094 else
3095 {
3096 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3098 return;
3100 }
3101 }
3102}
@ PLAYER_ALLOW_ONLY_ABILITY
Definition: Player.h:498
@ SPELL_AURA_ALLOW_ONLY_ABILITY
Definition: SpellAuraDefines.h:326
void SetPlayerFlag(PlayerFlags flags)
Definition: Player.h:1101
void RemovePlayerFlag(PlayerFlags flags)
Definition: Player.h:1102

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
2780{
2782 return;
2783
2784 Unit* target = aurApp->GetTarget();
2785
2786 if (apply)
2787 {
2788 Unit* caster = GetCaster();
2789 if (!caster || caster == target)
2790 return;
2791
2792 // What must be cloned? at least display and scale
2793 target->SetDisplayId(caster->GetDisplayId());
2795 }
2796 else
2797 {
2798 target->SetDisplayId(target->GetNativeDisplayId());
2800 }
2801}
@ UNIT_FLAG2_MIRROR_IMAGE
Definition: Unit.h:492
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1501
uint32 GetDisplayId() const
Definition: Unit.h:2182
uint32 GetNativeDisplayId() const
Definition: Unit.h:2184
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1502
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:17030

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

3656{
3658 return;
3659
3660 Unit* target = aurApp->GetTarget();
3661
3662 if (!target->IsVehicle())
3663 return;
3664
3665 Unit* caster = GetCaster();
3666
3667 if (!caster || caster == target)
3668 return;
3669
3670 if (apply)
3671 {
3672 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3673 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3674 // so this break such spells or most of them.
3675 // Current formula about m_amount: effect base points + dieside - 1
3676 // TO DO: Reasearch more about 0/0 and fix it.
3677 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3678 }
3679 else
3680 {
3681 if (GetId() == 53111) // Devour Humanoid
3682 {
3683 Unit::Kill(target, caster);
3684 if (caster->GetTypeId() == TYPEID_UNIT)
3685 caster->ToCreature()->RemoveCorpse();
3686 }
3687
3688 caster->_ExitVehicle();
3689 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3690 caster->RemoveAurasDueToSpell(GetId());
3691 }
3692}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition: SpellAuraDefines.h:49
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:346
Creature * ToCreature()
Definition: Object.h:197
bool IsVehicle() const
Definition: Unit.h:1428
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:17956
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:20030
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition: Unit.cpp:19910
Vehicle * GetVehicleKit() const
Definition: Unit.h:2367

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

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
5973{
5974 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5975 return;
5976
5977 Unit* target = aurApp->GetTarget();
5978
5979 if (!apply)
5980 {
5981 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5982 if (target->HasAuraType(GetAuraType()))
5983 return;
5984 }
5985
5986 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5988}
@ UNIT_DYNAMIC_FLAGS
Definition: UpdateFields.h:136
@ CREATURE_TYPE_BEAST
Definition: SharedDefines.h:2628
@ UNIT_DYNFLAG_SPECIALINFO
Definition: SharedDefines.h:3125
void ApplyModUInt32Value(uint16 index, int32 val, bool apply)
Definition: Object.cpp:806
uint32 GetCreatureType() const
Definition: Unit.cpp:15168

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
3354{
3356 return;
3357
3358 Unit* target = aurApp->GetTarget();
3359
3360 if (Player* targetPlayer = target->ToPlayer())
3361 {
3362 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3363 }
3364
3365 if (!apply)
3366 {
3367 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3368 if (target->HasAuraType(GetAuraType()))
3369 return;
3370 }
3371
3372 target->SetFeatherFall(apply);
3373
3374 // start fall from current height
3375 if (!apply && target->GetTypeId() == TYPEID_PLAYER)
3376 target->ToPlayer()->SetFallInformation(GameTime::GetGameTime().count(), target->GetPositionZ());
3377}
#define sScriptMgr
Definition: ScriptMgr.h:698
Seconds GetGameTime()
Definition: GameTime.cpp:38
float GetPositionZ() const
Definition: Position.h:119
void SetFallInformation(uint32 time, float z)
Definition: Player.h:2298
virtual bool SetFeatherFall(bool enable, bool packetOnly=false)
Definition: Unit.cpp:20998

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
1776{
1778 return;
1779
1780 Unit* target = aurApp->GetTarget();
1781
1782 if (target->GetTypeId() != TYPEID_PLAYER)
1783 return;
1784
1785 if (apply)
1786 {
1790 }
1791 else
1792 {
1793 if (target->HasAuraType(SPELL_AURA_GHOST))
1794 return;
1795
1799 }
1800}
@ PLAYER_FLAGS_GHOST
Definition: Player.h:479
@ SPELL_AURA_GHOST
Definition: SpellAuraDefines.h:158
@ SERVERSIDE_VISIBILITY_GHOST
Definition: SharedDefines.h:1274
@ GHOST_VISIBILITY_ALIVE
Definition: SharedDefines.h:1281
@ GHOST_VISIBILITY_GHOST
Definition: SharedDefines.h:1282
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h: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

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

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
4808{
4810 return;
4811
4812 Unit* target = aurApp->GetTarget();
4813
4814 target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(GetAmount()), apply);
4815}
@ 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:15189

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

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
5110{
5112 return;
5113
5114 Unit* target = aurApp->GetTarget();
5115
5117}
@ 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
5175{
5177 return;
5178
5179 Unit* target = aurApp->GetTarget();
5180
5181 // Recalculate bonus
5182 if (target->GetTypeId() == TYPEID_PLAYER)
5183 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
5184}
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
5170{
5171 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
5172}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:5174

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
5133{
5135 return;
5136
5137 Unit* target = aurApp->GetTarget();
5138
5139 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
5141}
@ 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
4366{
4368 return;
4369
4370 Unit* target = aurApp->GetTarget();
4371 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4372 {
4373 if (GetMiscValue() & int32(1 << x))
4374 {
4376 }
4377 }
4378}
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:283
constexpr auto MAX_SPELL_SCHOOL
Definition: SharedDefines.h:292

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
4851{
4853 return;
4854
4855 Unit* target = aurApp->GetTarget();
4856
4857 if (target->GetTypeId() != TYPEID_PLAYER)
4858 return;
4859
4860 target->ToPlayer()->UpdateBlockPercentage();
4861}
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
4959{
4961 return;
4962
4963 Unit* target = aurApp->GetTarget();
4964
4965 if (target->GetTypeId() != TYPEID_PLAYER)
4966 {
4967 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4968 return;
4969 }
4970
4971 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4974
4975 // included in Player::UpdateSpellCritChance calculation
4977}
@ 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:4933
int32 m_baseSpellCritChance
Definition: Unit.h:2102

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
3773{
3775 return;
3776
3777 Unit* target = aurApp->GetTarget();
3778
3779 target->UpdateSpeed(MOVE_WALK, true);
3780 target->UpdateSpeed(MOVE_RUN, true);
3781 target->UpdateSpeed(MOVE_SWIM, true);
3782 target->UpdateSpeed(MOVE_FLIGHT, true);
3783 target->UpdateSpeed(MOVE_RUN_BACK, true);
3784 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3785 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3786
3787 if (Player* targetPlayer = target->ToPlayer())
3788 {
3789 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3790 }
3791}
@ 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:14238

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
2951{
2952 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2953 return;
2954
2955 Unit* target = aurApp->GetTarget();
2956
2957 AuraType type = GetAuraType();
2958
2959 //Prevent handling aura twice
2960 if ((apply) ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2961 return;
2962
2963 uint32 field, flag, slot;
2964 WeaponAttackType attType;
2965 switch (type)
2966 {
2968 field = UNIT_FIELD_FLAGS;
2969 flag = UNIT_FLAG_DISARMED;
2971 attType = BASE_ATTACK;
2972 break;
2974 field = UNIT_FIELD_FLAGS_2;
2977 attType = OFF_ATTACK;
2978 break;
2980 field = UNIT_FIELD_FLAGS_2;
2982 slot = EQUIPMENT_SLOT_RANGED;
2983 attType = RANGED_ATTACK;
2984 break;
2985 default:
2986 return;
2987 }
2988
2989 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
2990 if (!apply)
2991 target->RemoveFlag(field, flag);
2992
2993 // Handle damage modification, shapeshifted druids are not affected
2994 if (target->GetTypeId() == TYPEID_PLAYER && (!target->IsInFeralForm() || target->GetShapeshiftForm() == FORM_GHOSTWOLF))
2995 {
2996 if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2997 {
2998 uint8 attacktype = Player::GetAttackBySlot(slot);
2999
3000 if (attacktype < MAX_ATTACK)
3001 {
3002 target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
3003 target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
3004 }
3005 }
3006 }
3007
3008 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
3009 if (apply)
3010 target->SetFlag(field, flag);
3011
3012 if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
3013 target->UpdateDamagePhysical(attType);
3014}
@ 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
@ UNIT_FLAG2_DISARM_OFFHAND
Definition: Unit.h:495
@ UNIT_FLAG2_DISARM_RANGED
Definition: Unit.h:497
WeaponAttackType
Definition: Unit.h:395
@ MAX_ATTACK
Definition: Unit.h:399
@ 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:188
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:6800
Item * GetItemByPos(uint16 pos) const
Definition: PlayerStorage.cpp:469
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition: Player.cpp:6905
static uint8 GetAttackBySlot(uint8 slot)
Definition: PlayerStorage.cpp:570
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:2085
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition: StatSystem.cpp:60
bool IsInFeralForm() const
Definition: Unit.h:2091

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
4307{
4308 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4309 return;
4310
4311 Unit* target = aurApp->GetTarget();
4312
4314}
DispelType
Definition: SharedDefines.h:1371
void ApplySpellDispelImmunity(SpellInfo const *spellProto, DispelType type, bool apply)
Definition: Unit.cpp:13410

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
4297{
4298 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4299 return;
4300
4301 Unit* target = aurApp->GetTarget();
4302
4303 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
4304}
@ IMMUNITY_DAMAGE
Definition: SharedDefines.h:1397

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

◆ HandleAuraModDodgePercent()

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4838{
4840 return;
4841
4842 Unit* target = aurApp->GetTarget();
4843
4844 if (target->GetTypeId() != TYPEID_PLAYER)
4845 return;
4846
4847 target->ToPlayer()->UpdateDodgePercentage();
4848}
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
4202{
4203 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4204 return;
4205
4206 Unit* target = aurApp->GetTarget();
4207
4208 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
4209
4210 // when removing flag aura, handle flag drop
4211 Player* player = target->ToPlayer();
4212 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
4213 {
4214 if (player->InBattleground())
4215 {
4216 if (Battleground* bg = player->GetBattleground())
4217 bg->EventPlayerDroppedFlag(player);
4218 }
4219 else
4220 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
4221 }
4222}
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:103
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition: SpellDefines.h:64
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1394
bool InBattleground() const
Definition: Player.h:2214

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
4642{
4644 return;
4645
4646 Unit* target = aurApp->GetTarget();
4647
4648 if (target->GetTypeId() != TYPEID_PLAYER)
4649 return;
4650
4653}
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
5991{
5992 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5993 return;
5994
5995 Unit* target = aurApp->GetTarget();
5996
5997 if (apply)
5998 {
5999 target->SetFaction(GetMiscValue());
6000 if (target->GetTypeId() == TYPEID_PLAYER)
6002 }
6003 else
6004 {
6005 target->RestoreFaction();
6006 if (target->GetTypeId() == TYPEID_PLAYER)
6008 }
6009}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition: Unit.h:451
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
void RestoreFaction()
Definition: Unit.cpp:18959

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
6118{
6120 return;
6121
6122 Unit* target = aurApp->GetTarget();
6123
6124 if (apply)
6125 {
6128
6129 if (target->GetTypeId() == TYPEID_PLAYER)
6130 {
6133 }
6134 }
6135 else
6136 {
6137 bool removeDetect = !target->HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE);
6138
6140
6141 if (target->GetTypeId() == TYPEID_PLAYER)
6142 {
6145
6146 if (removeDetect)
6147 removeDetect = !target->ToPlayer()->GetDrunkValue();
6148 }
6149
6150 if (removeDetect)
6152 }
6153
6154 // call functions which may have additional effects after chainging state of unit
6155 target->UpdateObjectVisibility(false);
6156}
@ PLAYER_FAKE_INEBRIATION
Definition: UpdateFields.h:325
@ SPELL_AURA_MOD_FAKE_INEBRIATE
Definition: SpellAuraDefines.h:367
@ INVISIBILITY_DRUNK
Definition: SharedDefines.h:1261
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:2135
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition: Unit.cpp:19394

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
4741{
4743 return;
4744
4745 Unit* target = aurApp->GetTarget();
4746
4748 // do not check power type, we can always modify the maximum
4749 // as the client will not see any difference
4750 // also, placing conditions that may change during the aura duration
4751 // inside effect handlers is not a good idea
4752 //if (int32(PowerType) != GetMiscValue())
4753 // return;
4754
4755 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4756
4757 target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4758}
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:268

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
4761{
4763 return;
4764
4765 Unit* target = aurApp->GetTarget();
4766
4768 // do not check power type, we can always modify the maximum
4769 // as the client will not see any difference
4770 // also, placing conditions that may change during the aura duration
4771 // inside effect handlers is not a good idea
4772 //if (int32(PowerType) != GetMiscValue())
4773 // return;
4774
4775 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4776 float amount = float(GetAmount());
4777
4778 if (apply)
4779 {
4780 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4781 target->ModifyPowerPct(PowerType, amount, apply);
4782 }
4783 else
4784 {
4785 target->ModifyPowerPct(PowerType, amount, apply);
4786 target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
4787 }
4788}
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
Definition: Unit.cpp:14175

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.

3718{
3720 return;
3721
3722 Unit* target = aurApp->GetTarget();
3724 target->UpdateSpeed(MOVE_FLIGHT, true);
3725
3728 {
3729 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3731 {
3732 target->SetCanFly(apply);
3733
3734 if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
3735 target->GetMotionMaster()->MoveFall();
3736 }
3737
3739 if (mode & AURA_EFFECT_HANDLE_REAL)
3740 {
3741 //Players on flying mounts must be immune to polymorph
3742 if (target->GetTypeId() == TYPEID_PLAYER)
3744
3745 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3746 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID())
3748 }
3749 }
3750
3751 if (Player* targetPlayer = target->ToPlayer())
3752 {
3753 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3754 }
3755}
@ 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:1342
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition: Unit.cpp:5606
uint32 GetMountID() const
Definition: Unit.h:1557

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

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

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

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

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

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

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

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
3046{
3048 return;
3049
3050 Unit* target = aurApp->GetTarget();
3051
3052 if (apply)
3053 {
3055 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
3056 }
3057 else
3058 {
3059 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3061 return;
3063 }
3064}
@ 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
3067{
3069 return;
3070
3071 Unit* target = aurApp->GetTarget();
3072
3073 if (!(apply))
3074 {
3075 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3077 return;
3078 }
3079 HandleAuraModPacify(aurApp, mode, apply);
3080 HandleAuraModSilence(aurApp, mode, apply);
3081}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:3016
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:3045

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
4822{
4824 return;
4825
4826 Unit* target = aurApp->GetTarget();
4827
4828 if (target->GetTypeId() != TYPEID_PLAYER)
4829 return;
4830
4831 if (!target->ToPlayer()->CanParry())
4832 target->ToPlayer()->SetCanParry(true);
4833 else
4834 target->ToPlayer()->UpdateParryPercentage();
4835}
void UpdateParryPercentage()
Definition: StatSystem.cpp:742
bool CanParry() const
Definition: Player.h:2145
void SetCanParry(bool value)
Definition: Player.cpp:13041

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
3203{
3205 return;
3206
3207 Unit* target = aurApp->GetTarget();
3208
3209 if (target->GetTypeId() != TYPEID_PLAYER)
3210 return;
3211
3212 // Recalculate pet talent points
3213 if (Pet* pet = target->ToPlayer()->GetPet())
3214 pet->InitTalentForLevel();
3215}

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

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

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
5048{
5050 return;
5051
5052 Unit* target = aurApp->GetTarget();
5053
5054 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
5055}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition: Unit.cpp:17319

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
4864{
4865 HandleModManaRegen(aurApp, mode, apply);
4866}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:4681

References HandleModManaRegen().

◆ HandleAuraModResistance()

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

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
4325{
4327 return;
4328
4329 Unit* target = aurApp->GetTarget();
4330
4331 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
4332 {
4333 if (GetMiscValue() & int32(1 << x))
4334 {
4336 if (amount < GetAmount())
4337 {
4338 float value = float(GetAmount() - amount);
4340 if (target->GetTypeId() == TYPEID_PLAYER)
4341 target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), value, apply);
4342 }
4343 }
4344 }
4345}
@ 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:5924

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
4620{
4622 return;
4623
4624 Unit* target = aurApp->GetTarget();
4625
4626 if (target->GetTypeId() != TYPEID_PLAYER)
4627 return;
4628
4630 {
4631 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4632 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4633 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4634 return;
4635 }
4636
4637 // Recalculate Armor
4638 target->UpdateArmor();
4639}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:297
virtual void UpdateArmor()=0

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

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3519{
3520 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3521 return;
3522
3523 Unit* target = aurApp->GetTarget();
3524
3525 target->SetControlled(apply, UNIT_STATE_ROOT);
3526}
@ UNIT_STATE_ROOT
Definition: Unit.h:335
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18288

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
2772{
2774 return;
2775
2776 aurApp->GetTarget()->RecalculateObjectScale();
2777}

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
4238{
4239 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4240 return;
4241
4242 Unit* target = aurApp->GetTarget();
4243
4244 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
4245
4246 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4247 {
4248 if (apply)
4250 else
4251 {
4252 bool banishFound = false;
4253 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
4254 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
4255 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
4256 {
4257 banishFound = true;
4258 break;
4259 }
4260 if (!banishFound)
4262 }
4263 }
4264
4265 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
4267
4268 // remove all flag auras (they are positive, but they must be removed when you are immune)
4272
4274 if ((apply)
4276 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
4277 {
4278 uint32 school_mask = GetMiscValue();
4279 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
4280 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
4281 {
4282 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4283 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
4284 && GetSpellInfo()->CanDispelAura(spell)
4285 && !iter->second->IsPositive() //Don't remove positive spells
4286 && spell->Id != GetId()) //Don't remove self
4287 {
4288 target->RemoveAura(iter);
4289 }
4290 else
4291 ++iter;
4292 }
4293 }
4294}
@ UNIT_STATE_ISOLATED
Definition: Unit.h:338
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition: SharedDefines.h:477
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition: SharedDefines.h:434
@ MECHANIC_BANISH
Definition: SharedDefines.h:1343
@ IMMUNITY_SCHOOL
Definition: SharedDefines.h:1396
void ClearUnitState(uint32 f)
Definition: Unit.h:1411
void AddUnitState(uint32 f)
Definition: Unit.h:1409
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5116
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1974
bool IsPositive() const
Definition: SpellInfo.cpp:1224

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

References Player::_addSpell(), Player::_ApplyWeaponDamage(), AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK, BASE_ATTACK, Unit::CalculateSpellDamage(), Unit::CanUseAttackType(), Unit::CastCustomSpell(), Unit::CastSpell(), CLASS_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
3017{
3018 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3019 return;
3020
3021 Unit* target = aurApp->GetTarget();
3022
3023 if (apply)
3024 {
3026
3027 // call functions which may have additional effects after chainging state of unit
3028 // Stop cast only spells vs PreventionType == SPELL_PREVENTION_TYPE_SILENCE
3029 for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
3030 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
3031 if (spell->m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
3032 // Stop spells on prepare or casting state
3033 target->InterruptSpell(CurrentSpellTypes(i), false);
3034 }
3035 else
3036 {
3037 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3039 return;
3040
3042 }
3043}
#define CURRENT_MAX_SPELL
Definition: Unit.h:997
CurrentSpellTypes
Definition: Unit.h:989
@ CURRENT_MELEE_SPELL
Definition: Unit.h:990
@ UNIT_FLAG_SILENCED
Definition: Unit.h:461
@ SPELL_AURA_MOD_SILENCE
Definition: SpellAuraDefines.h:90
@ SPELL_PREVENTION_TYPE_SILENCE
Definition: SharedDefines.h:1554
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4014

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
3218{
3220 return;
3221 Unit* target = aurApp->GetTarget();
3222
3223 if (target->GetTypeId() != TYPEID_PLAYER)
3224 return;
3225
3226 uint32 prot = GetMiscValue();
3227 int32 points = GetAmount();
3228
3229 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
3230 if (prot == SKILL_DEFENSE)
3231 target->ToPlayer()->UpdateDefenseBonusesMod();
3232}
@ SPELL_AURA_MOD_SKILL_TALENT
Definition: SpellAuraDefines.h:161
@ AURA_EFFECT_HANDLE_SKILL
Definition: SpellAuraDefines.h:47
@ SKILL_DEFENSE
Definition: SharedDefines.h:2881
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition: Player.cpp:5224
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
3160{
3162 return;
3163
3164 Unit* target = aurApp->GetTarget();
3165
3166 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
3167 if (apply)
3169 else
3170 {
3171 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3172 if (!target->HasAuraType(GetAuraType()))
3174 }
3175
3176 // call functions which may have additional effects after chainging state of unit
3177 target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER);
3178}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition: SharedDefines.h:3122
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
4439{
4441 return;
4442
4443 Unit* target = aurApp->GetTarget();
4444
4445 if (GetMiscValue() < -2 || GetMiscValue() > 4)
4446 {
4447 LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
4448 return;
4449 }
4450
4451 for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
4452 {
4453 // -1 or -2 is all stats (misc < -2 checked in function beginning)
4454 if (GetMiscValue() < 0 || GetMiscValue() == i)
4455 {
4456 //target->ApplyStatMod(Stats(i), m_amount, apply);
4458 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
4459 target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
4460 }
4461 }
4462}
@ UNIT_MOD_STAT_START
Definition: Unit.h:289
#define MAX_STATS
Definition: SharedDefines.h:265
Stats
Definition: SharedDefines.h:257
@ STAT_STRENGTH
Definition: SharedDefines.h:258
void ApplyStatBuffMod(Stats stat, float val, bool apply)
Definition: Unit.h:2048

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
3509{
3510 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3511 return;
3512
3513 Unit* target = aurApp->GetTarget();
3514
3515 target->SetControlled(apply, UNIT_STATE_STUNNED);
3516}
@ 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
3447{
3449 return;
3450
3451 Unit* target = aurApp->GetTarget();
3452
3453 if (!target->IsAlive() || target->GetTypeId() != TYPEID_PLAYER)
3454 return;
3455
3456 Unit* caster = GetCaster();
3457 if (caster && caster->IsAlive())
3458 target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
3459}
void addTempThreat(float threat, bool apply)
Definition: HostileRefMgr.cpp:65
HostileRefMgr & getHostileRefMgr()
Definition: Unit.h:2163

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

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

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

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
6102{
6103 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6104 return;
6105
6106 Unit* target = aurApp->GetTarget();
6107
6108 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
6109 return;
6110
6111 if (apply)
6112 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
6113
6114 // client auto close stable dialog at !apply aura
6115}
bool IsInWorld() const
Definition: Object.h:101
WorldSession * GetSession() const
Definition: Player.h:1961
void SendStablePet(ObjectGuid guid)
Definition: NPCHandler.cpp:480

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
6159{
6160 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6161 return;
6162
6163 Player* target = aurApp->GetTarget()->ToPlayer();
6164
6165 if (!target || !target->IsInWorld())
6166 return;
6167
6168 uint32 overrideId = uint32(GetMiscValue());
6169
6170 if (apply)
6171 {
6173 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6174 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6175 if (uint32 spellId = overrideSpells->spellId[i])
6176 target->_addSpell(spellId, SPEC_MASK_ALL, true);
6177 }
6178 else
6179 {
6181 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
6182 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
6183 if (uint32 spellId = overrideSpells->spellId[i])
6184 target->removeSpell(spellId, SPEC_MASK_ALL, true);
6185 }
6186}
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:1409
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition: Object.cpp:770
Definition: DBCStructure.h:1412

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
5400{
5401 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5402 return;
5403
5404 Unit* target = aurApp->GetTarget();
5405
5406 if (target->GetTypeId() != TYPEID_PLAYER)
5407 return;
5408
5409 // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler
5410 // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost)
5411 if (!(apply) && GetBase()->GetDuration() == 0)
5412 target->AddComboPoints(-GetAmount());
5413}
void AddComboPoints(Unit *target, int8 count)
Definition: Unit.cpp:17103

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
6189{
6190 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6191 return;
6192
6193 Unit* target = aurApp->GetTarget();
6194
6195 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
6196 return;
6197
6198 uint32 vehicleId = GetMiscValue();
6199
6200 if (apply)
6201 {
6202 if (!target->CreateVehicleKit(vehicleId, 0))
6203 return;
6204 }
6205 else if (target->GetVehicleKit())
6206 target->RemoveVehicleKit();
6207
6209 data << target->GetPackGUID();
6210 data << uint32(apply ? vehicleId : 0);
6211 target->SendMessageToSet(&data, true);
6212
6213 if (apply)
6214 {
6216 target->ToPlayer()->GetSession()->SendPacket(&data);
6217 }
6218}
@ 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:18991
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Definition: Unit.cpp:18979
Definition: WorldPacket.h:27
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:212

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,