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

#include "SpellAuraEffects.h"

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

Constructor & Destructor Documentation

◆ Aura::~Aura()

AuraEffect::Aura::~Aura ( )
private

◆ ~AuraEffect()

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

References m_channelData, and m_spellmod.

◆ AuraEffect()

AuraEffect::AuraEffect ( Aura base,
uint8  effIndex,
int32 baseAmount,
Unit caster 
)
explicitprivate
385 :
386 m_base(base), m_spellInfo(base->GetSpellInfo()),
387 m_baseAmount(baseAmount ? * baseAmount : m_spellInfo->Effects[effIndex].BasePoints), m_critChance(0),
388 m_oldAmount(0), m_isAuraEnabled(true), m_channelData(nullptr), m_spellmod(nullptr), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
390{
391 CalculatePeriodic(caster, true, false);
393
394 m_amount = CalculateAmount(caster);
395 m_casterLevel = caster ? caster->getLevel() : 0;
396 m_applyResilience = caster && caster->CanApplyResilience();
397 m_auraGroup = sSpellMgr->GetSpellGroup(GetId());
398
400
401 // Xinef: channel data structure
402 if (caster)
403 if (Spell* spell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
404 m_channelData = new ChannelTargetData(caster->GetGuidValue(UNIT_FIELD_CHANNEL_OBJECT), spell->m_targets.HasDst() ? spell->m_targets.GetDst() : nullptr);
405}
@ UNIT_FIELD_CHANNEL_OBJECT
Definition: UpdateFields.h:93
@ CURRENT_CHANNELED_SPELL
Definition: Unit.h:980
#define sSpellMgr
Definition: SpellMgr.h:803
ObjectGuid GetGuidValue(uint16 index) const
Definition: Object.cpp:339
bool CanApplyResilience() const
Definition: Unit.h:2695
uint8 getLevel() const
Definition: Unit.h:1418
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:2311
int32 m_periodicTimer
Definition: SpellAuraEffects.h:140
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:145
uint8 const m_effIndex
Definition: SpellAuraEffects.h:144
uint8 m_casterLevel
Definition: SpellAuraEffects.h:126
bool m_applyResilience
Definition: SpellAuraEffects.h:125
void CalculatePeriodic(Unit *caster, bool create=false, bool load=false)
Definition: SpellAuraEffects.cpp:589
void CalculateSpellMod()
Definition: SpellAuraEffects.cpp:680
int32 m_oldAmount
Definition: SpellAuraEffects.h:133
uint32 GetId() const
Definition: SpellAuraEffects.cpp:434
int32 CalculateAmount(Unit *caster)
Definition: SpellAuraEffects.cpp:454
int32 m_amount
Definition: SpellAuraEffects.h:127
void CalculatePeriodicData()
Definition: SpellAuraEffects.cpp:574
uint32 m_tickNumber
Definition: SpellAuraEffects.h:142
int32 const m_baseAmount
Definition: SpellAuraEffects.h:123
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:122
bool m_isAuraEnabled
Definition: SpellAuraEffects.h:134
bool m_isPeriodic
Definition: SpellAuraEffects.h:146
uint32 m_auraGroup
Definition: SpellAuraEffects.h:132
float m_critChance
Definition: SpellAuraEffects.h:128
Aura *const m_base
Definition: SpellAuraEffects.h:120
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:100
Definition: Spell.h:241
Definition: Spell.h:284
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition: SpellInfo.h:391

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

Member Function Documentation

◆ ApplySpellMod()

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

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

References BASE_ATTACK, GetSpellInfo(), Unit::GetSpellModOwner(), RANGED_ATTACK, SPELL_AURA_ABILITY_PERIODIC_CRIT, SPELL_DAMAGE_CLASS_RANGED, SPELLFAMILY_ROGUE, and Unit::SpellTakenCritChance().

Referenced by CalculatePeriodicData().

◆ CalculateAmount()

int32 AuraEffect::CalculateAmount ( Unit caster)
455{
456 int32 amount;
457 // default amount calculation
458 amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, nullptr);
459
460 // check item enchant aura cast
461 if (!amount && caster)
462 if (ObjectGuid itemGUID = GetBase()->GetCastItemGUID())
463 if (Player* playerCaster = caster->ToPlayer())
464 if (Item* castItem = playerCaster->GetItemByGuid(itemGUID))
465 if (castItem->GetItemSuffixFactor())
466 {
467 ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(std::abs(castItem->GetItemRandomPropertyId()));
468 if (item_rand_suffix)
469 {
470 for (uint8 k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; k++)
471 {
472 SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(item_rand_suffix->Enchantment[k]);
473 if (pEnchant)
474 {
475 for (uint8 t = 0; t < MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS; t++)
476 if (pEnchant->spellid[t] == m_spellInfo->Id)
477 {
478 amount = uint32((item_rand_suffix->AllocationPct[k] * castItem->GetItemSuffixFactor()) / 10000);
479 break;
480 }
481 }
482
483 if (amount)
484 break;
485 }
486 }
487 }
488
489 // custom amount calculations go here
490 // xinef: normal auras
491 switch (GetAuraType())
492 {
493 // crowd control auras
499 m_canBeRecalculated = false;
500 if (!m_spellInfo->ProcFlags || m_spellInfo->HasAura(SPELL_AURA_PROC_TRIGGER_SPELL)) // xinef: skip auras with proctriggerspell, they must have procflags...
501 break;
502 amount = int32(GetBase()->GetUnitOwner()->CountPctFromMaxHealth(10));
503 if (caster)
504 {
505 // Glyphs increasing damage cap
507 for (Unit::AuraEffectList::const_iterator itr = overrideClassScripts.begin(); itr != overrideClassScripts.end(); ++itr)
508 {
509 if ((*itr)->IsAffectedOnSpell(m_spellInfo))
510 {
511 // Glyph of Fear, Glyph of Frost nova and similar auras
512 if ((*itr)->GetMiscValue() == 7801)
513 {
514 AddPct(amount, (*itr)->GetAmount());
515 break;
516 }
517 }
518 }
519 }
520 break;
523 m_canBeRecalculated = false;
524 break;
526 // Titan's Grip
527 if (!caster)
528 break;
529 if (GetId() == 49152 && caster->ToPlayer())
530 {
531 Item* item1 = caster->ToPlayer()->GetWeaponForAttack(BASE_ATTACK);
532 Item* item2 = caster->ToPlayer()->GetWeaponForAttack(OFF_ATTACK);
533
534 if (item1 && item2 && (item1->GetTemplate()->InventoryType == INVTYPE_2HWEAPON || item2->GetTemplate()->InventoryType == INVTYPE_2HWEAPON))
535 amount = -10;
536 else
537 amount = 0;
538 }
539 break;
540 default:
541 break;
542 }
543
544 // xinef: save base amount, before calculating sp etc. Used for Unit::CastDelayedSpellWithPeriodicAmount
545 SetOldAmount(amount * GetBase()->GetStackAmount());
547
548 // Xinef: Periodic auras
549 if (caster)
550 switch (GetAuraType())
551 {
554 // xinef: save caster depending auras, always pass 1 as stack amount, effect will be multiplicated at the end of the function by correct value!
555 if (GetBase()->GetType() == UNIT_AURA_TYPE)
556 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
557 break;
559 if (GetBase()->GetType() == UNIT_AURA_TYPE)
560 amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, DOT, GetEffIndex(), GetPctMods(), 1);
561 break;
563 if (GetBase()->GetType() == UNIT_AURA_TYPE)
564 amount = caster->SpellDamageBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE, 0.0f, 1);
565 break;
566 default:
567 break;
568 }
569
570 amount *= GetBase()->GetStackAmount();
571 return amount;
572}
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:1800
#define MAX_ITEM_ENCHANTMENT_EFFECTS
Definition: DBCStructure.h:1183
Definition: Item.h:214
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:546
uint32 InventoryType
Definition: ItemTemplate.h:641
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Definition: PlayerStorage.cpp:521
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition: Unit.h:2211
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:13219
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint8 effIndex, float TotalMod=0.0f, uint32 stack=1)
Definition: Unit.cpp:12415
void SetOldAmount(int32 amount)
Definition: SpellAuraEffects.h:116
AuraType GetAuraType() const
Definition: SpellAuraEffects.cpp:449
float GetPctMods() const
Definition: SpellAuraEffects.h:111
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:56
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, int32 &amount, bool &canBeRecalculated)
Definition: SpellAuras.cpp:2523
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:876
Definition: DBCStructure.h:1196
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > AllocationPct
Definition: DBCStructure.h:1203
std::array< uint32, MAX_ITEM_ENCHANTMENT_EFFECTS > Enchantment
Definition: DBCStructure.h:1201
Definition: DBCStructure.h:1803
uint32 spellid[MAX_SPELL_ITEM_ENCHANTMENT_EFFECTS]
Definition: DBCStructure.h:1809

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

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

◆ CalculatePeriodic()

void AuraEffect::CalculatePeriodic ( Unit caster,
bool  create = false,
bool  load = false 
)
Todo:
: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
590{
592
593 // prepare periodics
594 switch (GetAuraType())
595 {
597 // 3 spells have no amplitude set
598 if (!m_amplitude)
600 [[fallthrough]];
614 m_isPeriodic = true;
615 break;
616 default:
617 break;
618 }
619
621
622 if (!m_isPeriodic)
623 return;
624
625 // Xinef: fix broken data in dbc
626 if (m_amplitude <= 0)
627 m_amplitude = 1000;
628
629 Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
630
631 // Apply casting time mods
632 if (m_amplitude)
633 {
634 // Apply periodic time mod
635 if (modOwner)
637
638 if (caster)
639 {
642 }
643 }
644
645 if (load) // aura loaded from db
646 {
650 ++m_tickNumber;
651 }
652 else // aura just created or reapplied
653 {
654 m_tickNumber = 0;
655 // reset periodic timer on aura create or on reapply when aura isn't dot
656 // possibly we should not reset periodic timers only when aura is triggered by proc
657 // or maybe there's a spell attribute somewhere
658 bool resetPeriodicTimer = create
660
661 if (resetPeriodicTimer)
662 {
663 m_periodicTimer = 0;
664 // Start periodic on next tick or at aura apply
665 if (m_amplitude)
666 {
669 else if (caster && caster->IsTotem()) // for totems only ;d
670 {
671 m_periodicTimer = 100; // make it ALMOST instant
672 if (!GetBase()->IsPassive())
673 GetBase()->SetDuration(GetBase()->GetDuration() + 100);
674 }
675 }
676 }
677 }
678}
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
@ UNIT_MOD_CAST_SPEED
Definition: UpdateFields.h:137
@ SPELL_AURA_PERIODIC_HASTE
Definition: SpellAuraDefines.h:379
@ SPELL_AURA_OBS_MOD_HEALTH
Definition: SpellAuraDefines.h:83
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
Definition: SpellAuraDefines.h:125
@ SPELL_AURA_PERIODIC_MANA_LEECH
Definition: SpellAuraDefines.h:127
@ SPELL_AURA_OBS_MOD_POWER
Definition: SpellAuraDefines.h:84
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
Definition: SpellAuraDefines.h:152
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
Definition: SpellAuraDefines.h:290
@ SPELL_AURA_PERIODIC_ENERGIZE
Definition: SpellAuraDefines.h:87
@ SPELL_AURA_POWER_BURN
Definition: SpellAuraDefines.h:225
@ SPELL_AURA_PERIODIC_DUMMY
Definition: SpellAuraDefines.h:289
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
Definition: SpellAuraDefines.h:111
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
Definition: SpellAuraDefines.h:86
@ SPELLMOD_ACTIVATION_TIME
Definition: SpellDefines.h:96
@ SPELL_ATTR5_EXTRA_INITIAL_PERIOD
Definition: SharedDefines.h:548
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition: SharedDefines.h:552
float GetFloatValue(uint16 index) const
Definition: Object.cpp:319
T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell *spell=nullptr, bool temporaryPet=false)
Definition: Player.h:2946
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
Definition: Unit.cpp:6494
bool IsTotem() const
Definition: Unit.h:1415
int32 m_amplitude
Definition: SpellAuraEffects.h:141
int32 GetDuration() const
Definition: SpellAuras.h:133
void SetDuration(int32 duration, bool withMods=false)
Definition: SpellAuras.cpp:884
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
Definition: SpellAuras.cpp:2537
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 ( )
575{
576 // xinef: save caster depending auras with pct mods
577 if (GetBase()->GetType() == UNIT_AURA_TYPE && GetCaster())
578 {
583 }
584
585 if (GetCaster())
586 SetCritChance(CalcPeriodicCritChance(GetCaster(), (GetBase()->GetType() == UNIT_AURA_TYPE ? GetBase()->GetUnitOwner() : nullptr)));
587}
float SpellPctHealingModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:13127
float SpellPctDamageModsDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype)
Definition: Unit.cpp:12084
float CalcPeriodicCritChance(Unit const *caster, Unit const *target) const
Definition: SpellAuraEffects.cpp:1040
float m_pctMods
Definition: SpellAuraEffects.h:129
Unit * GetCaster() const
Definition: SpellAuraEffects.h:47
void SetCritChance(float crit)
Definition: SpellAuraEffects.h:108

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

Referenced by AuraEffect().

◆ CalculateSpellMod()

void AuraEffect::CalculateSpellMod ( )
681{
682 switch (GetAuraType())
683 {
686 if (!m_spellmod)
687 {
690
691 m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
693 m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
695 }
697 break;
698 default:
699 break;
700 }
702}
SpellModType
Definition: Player.h:93
@ SPELL_AURA_ADD_PCT_MODIFIER
Definition: SpellAuraDefines.h:171
@ SPELL_AURA_ADD_FLAT_MODIFIER
Definition: SpellAuraDefines.h:170
SpellModOp
Definition: SpellDefines.h:76
Definition: Player.h:182
int16 charges
Definition: Player.h:186
SpellModOp op
Definition: Player.h:184
SpellModType type
Definition: Player.h:185
int32 value
Definition: Player.h:187
uint32 spellId
Definition: Player.h:189
flag96 mask
Definition: Player.h:188
int32 GetAmount() const
Definition: SpellAuraEffects.h:63
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Definition: SpellAuras.cpp:2551
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 
)
705{
706 // Reapply if amount change
707 uint8 handleMask = 0;
708 if (newAmount != GetAmount())
710 if (onStackOrReapply)
711 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
712
713 if (!handleMask)
714 return;
715
716 std::list<AuraApplication*> effectApplications;
717 GetApplicationList(effectApplications);
718
719 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
720 if ((*apptItr)->HasEffect(GetEffIndex()))
721 HandleEffect(*apptItr, handleMask, false);
722
723 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
724 {
725 if (!mark)
726 m_amount = newAmount;
727 else
728 SetAmount(newAmount);
730 }
731
732 for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
733 if ((*apptItr)->HasEffect(GetEffIndex()))
734 HandleEffect(*apptItr, handleMask, true);
735}
@ 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:424
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
Definition: SpellAuraEffects.cpp:737
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:65

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

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

◆ CleanupTriggeredSpells()

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

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

Referenced by AuraApplication::_HandleEffect().

◆ GetAmount()

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

References m_amount, and m_isAuraEnabled.

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

◆ GetAmplitude()

int32 AuraEffect::GetAmplitude ( ) const
inline

◆ GetApplicationList()

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

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

Referenced by ChangeAmount(), and Update().

◆ GetAuraGroup()

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

References m_auraGroup.

Referenced by AuraApplication::_HandleEffect().

◆ GetAuraType()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

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

◆ GetBase()

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

References m_base.

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

◆ GetBaseAmount()

◆ GetCaster()

◆ GetCasterGUID()

◆ GetCasterLevel()

uint8 AuraEffect::GetCasterLevel ( ) const
inline

◆ GetCritChance()

float AuraEffect::GetCritChance ( ) const
inline

◆ GetEffIndex()

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

References m_effIndex.

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

◆ GetForcedAmount()

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

References m_amount.

◆ GetId()

uint32 AuraEffect::GetId ( ) const

◆ GetMiscValue()

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

References SpellInfo::Effects, m_effIndex, and m_spellInfo.

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

◆ GetMiscValueB()

int32 AuraEffect::GetMiscValueB ( ) const

◆ GetOldAmount()

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

References m_oldAmount.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount().

◆ GetPctMods()

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

References m_pctMods.

Referenced by CalculateAmount().

◆ GetPeriodicTimer()

◆ GetSpellInfo()

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

References m_spellInfo.

Referenced by Player::_ApplyWeaponDependentAuraCritMod(), Player::_ApplyWeaponDependentAuraDamageMod(), AuraApplication::_HandleEffect(), Unit::CalcAbsorbResist(), CalcPeriodicCritChance(), CalculateAmount(), CalculatePeriodic(), CalculatePeriodicData(), spell_dru_treant_scaling::CalculateResistanceAmount(), spell_hun_generic_scaling::CalculateResistanceAmount(), spell_mage_pet_scaling::CalculateResistanceAmount(), spell_pri_shadowfiend_scaling::CalculateResistanceAmount(), spell_sha_feral_spirit_scaling::CalculateResistanceAmount(), spell_sha_fire_elemental_scaling::CalculateResistanceAmount(), spell_warl_generic_scaling::CalculateResistanceAmount(), spell_warl_infernal_scaling::CalculateResistanceAmount(), CalculateSpellMod(), spell_dk_pet_scaling::CalculateStatAmount(), spell_dru_treant_scaling::CalculateStatAmount(), spell_hun_generic_scaling::CalculateStatAmount(), spell_mage_pet_scaling::CalculateStatAmount(), spell_pri_shadowfiend_scaling::CalculateStatAmount(), spell_sha_feral_spirit_scaling::CalculateStatAmount(), spell_sha_fire_elemental_scaling::CalculateStatAmount(), spell_warl_generic_scaling::CalculateStatAmount(), spell_warl_infernal_scaling::CalculateStatAmount(), Spell::EffectHeal(), Spell::EffectSchoolDMG(), HandleAuraDummy(), HandleAuraModEffectImmunity(), HandleAuraModSchoolImmunity(), HandleAuraModShapeshift(), HandleAuraModStateImmunity(), HandleAuraModWeaponCritPercent(), HandleAuraMounted(), Unit::HandleAuraRaidProcFromCharge(), Unit::HandleAuraRaidProcFromChargeWithValue(), HandleAuraTransform(), HandleChannelDeathItem(), spell_dk_raise_ally::HandleDummy(), Unit::HandleDummyAuraProc(), HandleModDamageDone(), HandleModDamagePercentDone(), HandleModMechanicImmunity(), HandleModStateImmunityMask(), HandleObsModPowerAuraTick(), spell_putricide_unbound_plague_dmg::spell_putricide_unbound_plague_dmg_AuraScript::HandlePeriodic(), HandlePeriodicDamageAurasTick(), HandlePeriodicDummyAuraTick(), HandlePeriodicEnergizeAuraTick(), HandlePeriodicHealAurasTick(), HandlePeriodicHealthFunnelAuraTick(), HandlePeriodicHealthLeechAuraTick(), HandlePeriodicManaLeechAuraTick(), HandlePeriodicPowerBurnAuraTick(), HandlePeriodicTriggerSpellAuraTick(), HandlePeriodicTriggerSpellWithValueAuraTick(), spell_dk_blood_caked_blade::HandleProc(), spell_pal_seal_of_command_aura::HandleProc(), HandleProcTriggerDamageAuraProc(), Unit::HandleProcTriggerSpell(), HandleProcTriggerSpellAuraProc(), HandleProcTriggerSpellWithValueAuraProc(), HandleRaidProcFromChargeAuraProc(), HandleRaidProcFromChargeWithValueAuraProc(), TriggeredByAuraSpellData::Init(), Acore::AbsorbAuraOrderPred::operator()(), 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
414{
415 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
416 // remove all targets which were not added to new list - they no longer deserve area aura
417 for (Aura::ApplicationMap::const_iterator appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
418 {
419 if (appIter->second->HasEffect(GetEffIndex()))
420 targetList.push_back(appIter->second->GetTarget());
421 }
422}

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

◆ GetTickNumber()

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

References m_tickNumber.

Referenced by Unit::CastDelayedSpellWithPeriodicAmount(), spell_frost_tomb::spell_frost_tombAuraScript::HandleEffectPeriodic(), spell_quest_test_flight_charging::HandleEffectPeriodicPlatform(), spell_quest_test_flight_charging::HandleEffectPeriodicSelf(), spell_hallows_end_base_fire::HandleEffectPeriodicUpdate(), spell_gen_burn_brutallus::HandleEffectPeriodicUpdate(), spell_putricide_unbound_plague_dmg::spell_putricide_unbound_plague_dmg_AuraScript::HandlePeriodic(), spell_shadow_bolt_whirl::HandlePeriodic(), HandlePeriodicHealAurasTick(), spell_bronjahm_soulstorm_channel_ooc::spell_bronjahm_soulstorm_channel_ooc_AuraScript::HandlePeriodicTick(), spell_bronjahm_soulstorm_visual::spell_bronjahm_soulstorm_visual_AuraScript::HandlePeriodicTick(), spell_wailing_souls_periodic::spell_wailing_souls_periodic_AuraScript::HandlePeriodicTick(), spell_exploding_orb_auto_grow::spell_exploding_orb_auto_grow_AuraScript::HandlePeriodicTick(), spell_item_direbrew_remote_aura::HandlePeriodicTick(), HandlePeriodicTriggerSpellAuraTick(), spell_igb_rocket_pack::spell_igb_rocket_pack_AuraScript::HandleRemove(), TriggeredByAuraSpellData::Init(), spell_kalecgos_curse_of_boundless_agony::spell_kalecgos_curse_of_boundless_agony_AuraScript::OnPeriodic(), spell_muru_darkness::spell_muru_darkness_AuraScript::OnPeriodic(), spell_the_lich_king_vile_spirits::spell_the_lich_king_vile_spirits_AuraScript::OnPeriodic(), spell_the_lich_king_soul_rip::spell_the_lich_king_soul_rip_AuraScript::OnPeriodic(), spell_assembly_rune_of_summoning::spell_assembly_rune_of_summoning_AuraScript::OnPeriodic(), spell_illidan_demon_transform2::spell_illidan_demon_transform2_AuraScript::OnPeriodic(), spell_the_lich_king_infest::spell_the_lich_king_infest_AuraScript::OnUpdate(), spell_karazhan_overload::spell_karazhan_overload_AuraScript::PeriodicTick(), spell_geddon_inferno::spell_geddon_inferno_AuraScript::PeriodicTick(), spell_trollgore_corpse_explode::spell_trollgore_corpse_explode_AuraScript::PeriodicTick(), spell_blood_queen_pact_of_the_darkfallen_dmg::spell_blood_queen_pact_of_the_darkfallen_dmg_AuraScript::PeriodicTick(), spell_igb_explosion_main::spell_igb_explosion_main_AuraScript::PeriodicTick(), spell_dreamwalker_mana_void::spell_dreamwalker_mana_void_AuraScript::PeriodicTick(), spell_broggok_poison_cloud::spell_broggok_poison_cloud_AuraScript::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
4949{
4950 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4951 return;
4952
4953 Unit* target = aurApp->GetTarget();
4954
4955 if (apply)
4957 else
4958 {
4959 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4960 if (target->HasAuraType(GetAuraType()))
4961 return;
4963 }
4964}
@ UNIT_FLAG_PREPARATION
Definition: Unit.h:453
@ AURA_EFFECT_HANDLE_REAL
Definition: SpellAuraDefines.h:42
Definition: Unit.h:1290
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:6461
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1479
ObjectGuid GetTarget() const
Definition: Unit.h:2701
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1480

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
2899{
2901 return;
2902
2903 Unit* target = aurApp->GetTarget();
2904
2905 if (!apply)
2906 {
2907 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2909 return;
2910 }
2911
2912 target->SetCanFly(apply);
2913
2914 if (!apply && target->GetTypeId() == TYPEID_UNIT && !target->IsLevitating())
2915 target->GetMotionMaster()->MoveFall();
2916}
@ 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:2530
bool IsLevitating() const
Definition: Unit.h:2646
virtual bool SetCanFly(bool enable, bool packetOnly=false)
Definition: Unit.cpp:21549
void MoveFall(uint32 id=0, bool addFlagForNPC=false)
Definition: MotionMaster.cpp:545

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

◆ HandleAuraAllowOnlyAbility()

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

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

◆ HandleAuraCloneCaster()

void AuraEffect::HandleAuraCloneCaster ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2367{
2369 return;
2370
2371 Unit* target = aurApp->GetTarget();
2372
2373 if (apply)
2374 {
2375 Unit* caster = GetCaster();
2376 if (!caster || caster == target)
2377 return;
2378
2379 // What must be cloned? at least display and scale
2380 target->SetDisplayId(caster->GetDisplayId());
2382 }
2383 else
2384 {
2385 target->SetDisplayId(target->GetNativeDisplayId());
2387 }
2388}
@ UNIT_FLAG2_MIRROR_IMAGE
Definition: Unit.h:492
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1485
uint32 GetDisplayId() const
Definition: Unit.h:2425
uint32 GetNativeDisplayId() const
Definition: Unit.h:2427
void RemoveUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1486
virtual void SetDisplayId(uint32 modelId)
Definition: Unit.cpp:17696

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

3243{
3245 return;
3246
3247 Unit* target = aurApp->GetTarget();
3248
3249 if (!target->IsVehicle())
3250 return;
3251
3252 Unit* caster = GetCaster();
3253
3254 if (!caster || caster == target)
3255 return;
3256
3257 if (apply)
3258 {
3259 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3260 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3261 // so this break such spells or most of them.
3262 // Current formula about m_amount: effect base points + dieside - 1
3263 // TO DO: Reasearch more about 0/0 and fix it.
3264 caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
3265 }
3266 else
3267 {
3268 if (GetId() == 53111) // Devour Humanoid
3269 {
3270 Unit::Kill(target, caster);
3271 if (caster->GetTypeId() == TYPEID_UNIT)
3272 caster->ToCreature()->RemoveCorpse();
3273 }
3274
3275 caster->_ExitVehicle();
3276 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3277 caster->RemoveAurasDueToSpell(GetId());
3278 }
3279}
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
Definition: SpellAuraDefines.h:49
void RemoveCorpse(bool setSpawnTime=true, bool skipVisibility=false)
Definition: Creature.cpp:349
Creature * ToCreature()
Definition: Object.h:197
bool IsVehicle() const
Definition: Unit.h:1416
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:18608
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition: Unit.cpp:20643
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition: Unit.cpp:20523
Vehicle * GetVehicleKit() const
Definition: Unit.h:2621

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
5622{
5623 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5624 return;
5625
5626 Unit* target = aurApp->GetTarget();
5627
5628 if (target->GetTypeId() != TYPEID_PLAYER)
5629 return;
5630
5631 Player* player = target->ToPlayer();
5632
5633 if (player->getClass() != CLASS_DEATH_KNIGHT)
5634 return;
5635
5636 uint32 runes = m_amount;
5637 // convert number of runes specified in aura amount of rune type in miscvalue to runetype in miscvalueb
5638 if (apply)
5639 {
5640 for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
5641 {
5642 if (GetMiscValue() != player->GetCurrentRune(i))
5643 continue;
5644 if (!player->GetRuneCooldown(i))
5645 {
5646 player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
5647 --runes;
5648 }
5649 }
5650 }
5651 else
5652 player->RemoveRunesByAuraEffect(this);
5653}
RuneType
Definition: Player.h:409
#define MAX_RUNES
Definition: Player.h:399
@ CLASS_DEATH_KNIGHT
Definition: SharedDefines.h:118
void RemoveRunesByAuraEffect(AuraEffect const *aura)
Definition: Player.cpp:13092
uint32 GetRuneCooldown(uint8 index) const
Definition: Player.h:2457
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const *aura)
Definition: Player.h:2468
RuneType GetCurrentRune(uint8 index) const
Definition: Player.h:2456
uint8 getClass() const
Definition: Unit.h:1424
int32 GetMiscValueB() const
Definition: SpellAuraEffects.cpp:439

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

References Unit::AddAura(), Unit::AddPetAura(), Unit::AddThreat(), Unit::ApplySpellImmune(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK, AURA_EFFECT_HANDLE_REAL, AURA_EFFECT_HANDLE_REAPPLY, AURA_REMOVE_BY_CANCEL, AURA_REMOVE_BY_EXPIRE, BREWFEST_KODO, Unit::CanHaveThreatList(), Unit::CastSpell(), ObjectMgr::ChooseDisplayId(), FRESH_BREWFEST_HOPS, GENDER_FEMALE, GENDER_MALE, GetAmount(), Unit::GetAura(), Unit::GetAuraEffectsByType(), GetBase(), Player::GetBattleground(), GetCaster(), Aura::GetCaster(), GetCasterGUID(), Object::GetEntry(), Unit::getGender(), Unit::GetGuardianPet(), Object::GetGUID(), GetId(), WorldObject::GetMap(), GetMiscValue(), Unit::GetMotionMaster(), AuraApplication::GetRemoveMode(), Unit::GetSpeedRate(), GetSpellInfo(), Aura::GetSpellInfo(), AuraApplication::GetTarget(), Object::GetTypeId(), WorldObject::GetZoneId(), GREAT_BREWFEST_KODO, Unit::HasAuraType(), SpellInfo::Id, IMMUNITY_MECHANIC, Unit::IsAlive(), Map::IsBattleground(), Unit::isDead(), Player::KilledMonsterCredit(), Player::LeaveBattleground(), m_effIndex, m_spellInfo, MOVE_RUN, MotionMaster::MoveFall(), WorldObject::PlayDirectSound(), WorldObject::PlayDistanceSound(), Player::RemoveAmmo(), Unit::RemoveAurasDueToSpell(), Unit::RemovePetAura(), roll_chance_i(), sBattlefieldMgr, Player::SetChampioningFaction(), Aura::SetCharges(), Object::SetEntry(), Aura::SetStackAmount(), Object::SetUInt32Value(), sObjectMgr, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_MOUNTED, SPELLFAMILY_DRUID, SPELLFAMILY_GENERIC, SPELLFAMILY_MAGE, SPELLFAMILY_PRIEST, SPELLFAMILY_SHAMAN, SpellInfo::SpellFamilyName, sSpellMgr, SpellInfo::StackAmount, Object::ToPlayer(), TYPEID_PLAYER, TYPEID_UNIT, UNIT_FIELD_MOUNTDISPLAYID, and Cell::VisitWorldObjects().

◆ HandleAuraEmpathy()

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

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

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
1758{
1760 return;
1761
1762 Unit* target = aurApp->GetTarget();
1763
1764 if (target->GetTypeId() != TYPEID_PLAYER)
1765 return;
1766
1767 if (apply)
1768 {
1772 }
1773 else
1774 {
1775 if (target->HasAuraType(SPELL_AURA_GHOST))
1776 return;
1777
1781 }
1782}
@ PLAYER_FLAGS_GHOST
Definition: Player.h:479
@ SPELL_AURA_GHOST
Definition: SpellAuraDefines.h:158
@ SERVERSIDE_VISIBILITY_GHOST
Definition: SharedDefines.h:1246
@ GHOST_VISIBILITY_ALIVE
Definition: SharedDefines.h:1253
@ GHOST_VISIBILITY_GHOST
Definition: SharedDefines.h:1254
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:360
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:510
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:509

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, AuraApplication::GetTarget(), Object::GetTypeId(), GHOST_VISIBILITY_ALIVE, GHOST_VISIBILITY_GHOST, Unit::HasAuraType(), WorldObject::m_serverSideVisibility, WorldObject::m_serverSideVisibilityDetect, PLAYER_FLAGS_GHOST, Player::RemovePlayerFlag(), SERVERSIDE_VISIBILITY_GHOST, Player::SetPlayerFlag(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::SetValue(), SPELL_AURA_GHOST, Object::ToPlayer(), and TYPEID_PLAYER.

◆ HandleAuraHover()

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

Sets movementflags

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

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
4395{
4397 return;
4398
4399 Unit* target = aurApp->GetTarget();
4400
4401 target->HandleStatModifier(UNIT_MOD_HEALTH, BASE_PCT, float(GetAmount()), apply);
4402}
@ 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:15916

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

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
4697{
4699 return;
4700
4701 Unit* target = aurApp->GetTarget();
4702
4704}
@ 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
4762{
4764 return;
4765
4766 Unit* target = aurApp->GetTarget();
4767
4768 // Recalculate bonus
4769 if (target->GetTypeId() == TYPEID_PLAYER)
4770 target->ToPlayer()->UpdateAttackPowerAndDamage(false);
4771}
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
4757{
4758 HandleAuraModAttackPowerOfArmor(aurApp, mode, apply);
4759}
void HandleAuraModAttackPowerOfArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:4761

References HandleAuraModAttackPowerOfArmor().

◆ HandleAuraModAttackPowerPercent()

void AuraEffect::HandleAuraModAttackPowerPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4720{
4722 return;
4723
4724 Unit* target = aurApp->GetTarget();
4725
4726 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4728}
@ 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
3953{
3955 return;
3956
3957 Unit* target = aurApp->GetTarget();
3958 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3959 {
3960 if (GetMiscValue() & int32(1 << x))
3961 {
3963 }
3964 }
3965}
std::int8_t int8
Definition: Define.h:106
UnitMods
Definition: Unit.h:261
@ UNIT_MOD_RESISTANCE_START
Definition: Unit.h:291
@ SPELL_SCHOOL_NORMAL
Definition: SharedDefines.h:255
constexpr auto MAX_SPELL_SCHOOL
Definition: SharedDefines.h:264

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

◆ HandleAuraModBlockPercent()

void AuraEffect::HandleAuraModBlockPercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4438{
4440 return;
4441
4442 Unit* target = aurApp->GetTarget();
4443
4444 if (target->GetTypeId() != TYPEID_PLAYER)
4445 return;
4446
4447 target->ToPlayer()->UpdateBlockPercentage();
4448}
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
4546{
4548 return;
4549
4550 Unit* target = aurApp->GetTarget();
4551
4552 if (target->GetTypeId() != TYPEID_PLAYER)
4553 {
4554 target->m_baseSpellCritChance += (apply) ? GetAmount() : -GetAmount();
4555 return;
4556 }
4557
4558 target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
4561
4562 // included in Player::UpdateSpellCritChance calculation
4564}
@ 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:4906
int32 m_baseSpellCritChance
Definition: Unit.h:2338

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
3360{
3362 return;
3363
3364 Unit* target = aurApp->GetTarget();
3365
3366 target->UpdateSpeed(MOVE_WALK, true);
3367 target->UpdateSpeed(MOVE_RUN, true);
3368 target->UpdateSpeed(MOVE_SWIM, true);
3369 target->UpdateSpeed(MOVE_FLIGHT, true);
3370 target->UpdateSpeed(MOVE_RUN_BACK, true);
3371 target->UpdateSpeed(MOVE_SWIM_BACK, true);
3372 target->UpdateSpeed(MOVE_FLIGHT_BACK, true);
3373
3374 if (Player* targetPlayer = target->ToPlayer())
3375 {
3376 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3377 }
3378}
@ 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:14991

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
2538{
2539 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2540 return;
2541
2542 Unit* target = aurApp->GetTarget();
2543
2544 AuraType type = GetAuraType();
2545
2546 //Prevent handling aura twice
2547 if ((apply) ? target->GetAuraEffectsByType(type).size() > 1 : target->HasAuraType(type))
2548 return;
2549
2550 uint32 field, flag, slot;
2551 WeaponAttackType attType;
2552 switch (type)
2553 {
2555 field = UNIT_FIELD_FLAGS;
2556 flag = UNIT_FLAG_DISARMED;
2558 attType = BASE_ATTACK;
2559 break;
2561 field = UNIT_FIELD_FLAGS_2;
2564 attType = OFF_ATTACK;
2565 break;
2567 field = UNIT_FIELD_FLAGS_2;
2569 slot = EQUIPMENT_SLOT_RANGED;
2570 attType = RANGED_ATTACK;
2571 break;
2572 default:
2573 return;
2574 }
2575
2576 // if disarm aura is to be removed, remove the flag first to reapply damage/aura mods
2577 if (!apply)
2578 target->RemoveFlag(field, flag);
2579
2580 // Handle damage modification, shapeshifted druids are not affected
2581 if (target->GetTypeId() == TYPEID_PLAYER && (!target->IsInFeralForm() || target->GetShapeshiftForm() == FORM_GHOSTWOLF))
2582 {
2583 if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2584 {
2585 uint8 attacktype = Player::GetAttackBySlot(slot);
2586
2587 if (attacktype < MAX_ATTACK)
2588 {
2589 target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), nullptr, !apply);
2590 target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
2591 }
2592 }
2593 }
2594
2595 // if disarm effects should be applied, wait to set flag until damage mods are unapplied
2596 if (apply)
2597 target->SetFlag(field, flag);
2598
2599 if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
2600 target->UpdateDamagePhysical(attType);
2601}
@ UNIT_FIELD_FLAGS_2
Definition: UpdateFields.h:118
@ UNIT_FIELD_FLAGS
Definition: UpdateFields.h:117
@ EQUIPMENT_SLOT_MAINHAND
Definition: Player.h:691
@ EQUIPMENT_SLOT_OFFHAND
Definition: Player.h:692
@ EQUIPMENT_SLOT_RANGED
Definition: Player.h:693
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:671
WeaponAttackType
Definition: Unit.h:395
@ MAX_ATTACK
Definition: Unit.h:399
@ UNIT_FLAG2_DISARM_OFFHAND
Definition: Unit.h:495
@ UNIT_FLAG2_DISARM_RANGED
Definition: Unit.h:497
@ FORM_GHOSTWOLF
Definition: Unit.h:106
@ UNIT_FLAG_DISARMED
Definition: Unit.h:469
@ SPELL_AURA_MOD_DISARM_RANGED
Definition: SpellAuraDefines.h:341
@ SPELL_AURA_MOD_DISARM
Definition: SpellAuraDefines.h:130
@ SPELL_AURA_MOD_DISARM_OFFHAND
Definition: SpellAuraDefines.h:317
uint8 GetCurrentEquipmentId()
Definition: Creature.h:185
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:847
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:862
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply)
Definition: Player.cpp:6770
Item * GetItemByPos(uint16 pos) const
Definition: PlayerStorage.cpp:474
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply)
Definition: Player.cpp:6873
static uint8 GetAttackBySlot(uint8 slot)
Definition: PlayerStorage.cpp:575
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:2321
virtual void UpdateDamagePhysical(WeaponAttackType attType)
Definition: StatSystem.cpp:60
bool IsInFeralForm() const
Definition: Unit.h:2327

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
3894{
3895 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3896 return;
3897
3898 Unit* target = aurApp->GetTarget();
3899
3901}
DispelType
Definition: SharedDefines.h:1343
void ApplySpellDispelImmunity(SpellInfo const *spellProto, DispelType type, bool apply)
Definition: Unit.cpp:14176

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
3884{
3885 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3886 return;
3887
3888 Unit* target = aurApp->GetTarget();
3889
3890 target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
3891}
@ IMMUNITY_DAMAGE
Definition: SharedDefines.h:1369

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

◆ HandleAuraModDodgePercent()

void AuraEffect::HandleAuraModDodgePercent ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
4425{
4427 return;
4428
4429 Unit* target = aurApp->GetTarget();
4430
4431 if (target->GetTypeId() != TYPEID_PLAYER)
4432 return;
4433
4434 target->ToPlayer()->UpdateDodgePercentage();
4435}
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
3789{
3790 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3791 return;
3792
3793 Unit* target = aurApp->GetTarget();
3794
3795 target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
3796
3797 // when removing flag aura, handle flag drop
3798 Player* player = target->ToPlayer();
3799 if (!apply && player && (GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION))
3800 {
3801 if (player->InBattleground())
3802 {
3803 if (Battleground* bg = player->GetBattleground())
3804 bg->EventPlayerDroppedFlag(player);
3805 }
3806 else
3807 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3808 }
3809}
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:106
@ AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION
Definition: SpellDefines.h:64
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1366
bool InBattleground() const
Definition: Player.h:2200

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
4229{
4231 return;
4232
4233 Unit* target = aurApp->GetTarget();
4234
4235 if (target->GetTypeId() != TYPEID_PLAYER)
4236 return;
4237
4240}
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
5583{
5584 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5585 return;
5586
5587 Unit* target = aurApp->GetTarget();
5588
5589 if (apply)
5590 {
5591 target->SetFaction(GetMiscValue());
5592 if (target->GetTypeId() == TYPEID_PLAYER)
5594 }
5595 else
5596 {
5597 target->RestoreFaction();
5598 if (target->GetTypeId() == TYPEID_PLAYER)
5600 }
5601}
@ UNIT_FLAG_PLAYER_CONTROLLED
Definition: Unit.h:451
void SetFaction(uint32 faction)
Definition: Unit.cpp:10873
void RestoreFaction()
Definition: Unit.cpp:19583

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
5710{
5712 return;
5713
5714 Unit* target = aurApp->GetTarget();
5715
5716 if (apply)
5717 {
5720
5721 if (target->GetTypeId() == TYPEID_PLAYER)
5722 {
5725 }
5726 }
5727 else
5728 {
5729 bool removeDetect = !target->HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE);
5730
5732
5733 if (target->GetTypeId() == TYPEID_PLAYER)
5734 {
5737
5738 if (removeDetect)
5739 removeDetect = !target->ToPlayer()->GetDrunkValue();
5740 }
5741
5742 if (removeDetect)
5744 }
5745
5746 // call functions which may have additional effects after chainging state of unit
5747 target->UpdateObjectVisibility(false);
5748}
@ PLAYER_FAKE_INEBRIATION
Definition: UpdateFields.h:325
@ SPELL_AURA_MOD_FAKE_INEBRIATE
Definition: SpellAuraDefines.h:367
@ INVISIBILITY_DRUNK
Definition: SharedDefines.h:1233
int32 GetInt32Value(uint16 index) const
Definition: Object.cpp:301
void SetInt32Value(uint16 index, int32 value)
Definition: Object.cpp:639
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:2121
void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false) override
Definition: Unit.cpp:20018

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
4328{
4330 return;
4331
4332 Unit* target = aurApp->GetTarget();
4333
4335 // do not check power type, we can always modify the maximum
4336 // as the client will not see any difference
4337 // also, placing conditions that may change during the aura duration
4338 // inside effect handlers is not a good idea
4339 //if (int32(PowerType) != GetMiscValue())
4340 // return;
4341
4342 UnitMods unitMod = UnitMods(static_cast<uint16>(UNIT_MOD_POWER_START) + PowerType);
4343
4344 target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4345}
std::uint16_t uint16
Definition: Define.h:109
@ UNIT_MOD_POWER_START
Definition: Unit.h:293
PowerType
Definition: VehicleDefines.h:30
Powers
Definition: SharedDefines.h:240

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

◆ HandleAuraModIncreaseEnergyPercent()

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

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.

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

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
4283{
4285 return;
4286
4287 Unit* target = aurApp->GetTarget();
4288
4289 if (apply)
4290 {
4291 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4292 target->ModifyHealth(GetAmount());
4293 }
4294 else
4295 {
4296 if (int32(target->GetHealth()) > GetAmount())
4297 target->ModifyHealth(-GetAmount());
4298 else
4299 target->SetHealth(1);
4300 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
4301 }
4302}
int32 ModifyHealth(int32 val)
Definition: Unit.cpp:14837
void SetHealth(uint32 val)
Definition: Unit.cpp:16191
uint32 GetHealth() const
Definition: Unit.h:1438

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
4378{
4380 return;
4381
4382 Unit* target = aurApp->GetTarget();
4383
4384 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4385 float percent = target->GetHealthPct();
4386 target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(GetAmount()), apply);
4387
4388 // Xinef: pct was rounded down and could "kill" creature by setting its health to 0 making npc zombie
4389 if (target->IsAlive())
4390 if (uint32 healthAmount = CalculatePct(target->GetMaxHealth(), percent))
4391 target->SetHealth(healthAmount);
4392}
T CalculatePct(T base, U pct)
Definition: Util.h:61
float GetHealthPct() const
Definition: Unit.h:1446
uint32 GetMaxHealth() const
Definition: Unit.h:1439

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
4305{
4307 return;
4308
4309 Unit* target = aurApp->GetTarget();
4310
4311 uint32 oldhealth = target->GetHealth();
4312 double healthPercentage = (double)oldhealth / (double)target->GetMaxHealth();
4313
4315
4316 // refresh percentage
4317 if (oldhealth > 0)
4318 {
4319 uint32 newhealth = uint32(std::ceil((double)target->GetMaxHealth() * healthPercentage));
4320 if (newhealth == 0)
4321 newhealth = 1;
4322
4323 target->SetHealth(newhealth);
4324 }
4325}

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
3300{
3301 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3302}
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:3284

References HandleAuraModIncreaseSpeed().

◆ HandleAuraModIncreaseSpeed()

void AuraEffect::HandleAuraModIncreaseSpeed ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3285{
3287 return;
3288
3289 Unit* target = aurApp->GetTarget();
3290
3291 target->UpdateSpeed(MOVE_RUN, true);
3292
3293 if (Player* targetPlayer = target->ToPlayer())
3294 {
3295 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3296 }
3297}

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
3345{
3347 return;
3348
3349 Unit* target = aurApp->GetTarget();
3350
3351 target->UpdateSpeed(MOVE_SWIM, true);
3352
3353 if (Player* targetPlayer = target->ToPlayer())
3354 {
3355 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3356 }
3357}

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
2633{
2635 return;
2636
2637 Unit* target = aurApp->GetTarget();
2638
2639 if (apply)
2640 {
2642 //target->AttackStop(); // pussywizard: why having this flag prevents from being in combat? it should just prevent melee attack
2643 }
2644 else
2645 {
2646 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2648 return;
2650 }
2651}
@ 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
2654{
2656 return;
2657
2658 Unit* target = aurApp->GetTarget();
2659
2660 if (!(apply))
2661 {
2662 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2664 return;
2665 }
2666 HandleAuraModPacify(aurApp, mode, apply);
2667 HandleAuraModSilence(aurApp, mode, apply);
2668}
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2603
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:2632

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
4409{
4411 return;
4412
4413 Unit* target = aurApp->GetTarget();
4414
4415 if (target->GetTypeId() != TYPEID_PLAYER)
4416 return;
4417
4418 if (!target->ToPlayer()->CanParry())
4419 target->ToPlayer()->SetCanParry(true);
4420 else
4421 target->ToPlayer()->UpdateParryPercentage();
4422}
void UpdateParryPercentage()
Definition: StatSystem.cpp:742
bool CanParry() const
Definition: Player.h:2131
void SetCanParry(bool value)
Definition: Player.cpp:12836

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
2790{
2792 return;
2793
2794 Unit* target = aurApp->GetTarget();
2795
2796 if (target->GetTypeId() != TYPEID_PLAYER)
2797 return;
2798
2799 // Recalculate pet talent points
2800 if (Pet* pet = target->ToPlayer()->GetPet())
2801 pet->InitTalentForLevel();
2802}

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
4707{
4709 return;
4710
4711 Unit* target = aurApp->GetTarget();
4712
4713 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4714 return;
4715
4717}
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition: Unit.h:283
#define CLASSMASK_WAND_USERS
Definition: SharedDefines.h:146
uint32 getClassMask() const
Definition: Unit.h:1425

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
4731{
4733 return;
4734
4735 Unit* target = aurApp->GetTarget();
4736
4737 if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
4738 return;
4739
4740 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
4742}

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
4635{
4637 return;
4638
4639 Unit* target = aurApp->GetTarget();
4640
4641 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4642}
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition: Unit.cpp:17971

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
4451{
4452 HandleModManaRegen(aurApp, mode, apply);
4453}
void HandleModManaRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.cpp:4268

References HandleModManaRegen().

◆ HandleAuraModResistance()

void AuraEffect::HandleAuraModResistance ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3935{
3937 return;
3938
3939 Unit* target = aurApp->GetTarget();
3940
3941 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3942 {
3943 if (GetMiscValue() & int32(1 << x))
3944 {
3946 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
3947 target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
3948 }
3949 }
3950}
SpellSchools
Definition: SharedDefines.h:254
bool IsPet() const
Definition: Unit.h:1413
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
Definition: Unit.h:2271

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
3912{
3914 return;
3915
3916 Unit* target = aurApp->GetTarget();
3917
3918 for (int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; x++)
3919 {
3920 if (GetMiscValue() & int32(1 << x))
3921 {
3923 if (amount < GetAmount())
3924 {
3925 float value = float(GetAmount() - amount);
3927 if (target->GetTypeId() == TYPEID_PLAYER)
3928 target->ApplyResistanceBuffModsMod(SpellSchools(x), aurApp->IsPositive(), value, apply);
3929 }
3930 }
3931 }
3932}
@ 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:6742

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
4207{
4209 return;
4210
4211 Unit* target = aurApp->GetTarget();
4212
4213 if (target->GetTypeId() != TYPEID_PLAYER)
4214 return;
4215
4217 {
4218 // support required adding replace UpdateArmor by loop by UpdateResistence at intellect update
4219 // and include in UpdateResistence same code as in UpdateArmor for aura mod apply.
4220 LOG_ERROR("spells.aura.effect", "Aura SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT(182) does not work for non-armor type resistances!");
4221 return;
4222 }
4223
4224 // Recalculate Armor
4225 target->UpdateArmor();
4226}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
@ SPELL_SCHOOL_MASK_NORMAL
Definition: SharedDefines.h:269
virtual void UpdateArmor()=0

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

◆ HandleAuraModRoot()

void AuraEffect::HandleAuraModRoot ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
3106{
3107 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3108 return;
3109
3110 Unit* target = aurApp->GetTarget();
3111
3112 target->SetControlled(apply, UNIT_STATE_ROOT);
3113}
@ UNIT_STATE_ROOT
Definition: Unit.h:335
void SetControlled(bool apply, UnitState state)
Definition: Unit.cpp:18927

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
2355{
2357 return;
2358
2359 Unit* target = aurApp->GetTarget();
2360
2361 float scale = target->GetObjectScale();
2362 ApplyPercentModFloatVar(scale, float(GetAmount()), apply);
2363 target->SetObjectScale(scale);
2364}
void ApplyPercentModFloatVar(float &var, float val, bool apply)
Definition: Util.h:50
float GetObjectScale() const
Definition: Object.h:112
virtual void SetObjectScale(float scale)
Definition: Object.h:113

References ApplyPercentModFloatVar(), AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK, GetAmount(), Object::GetObjectScale(), AuraApplication::GetTarget(), and Object::SetObjectScale().

◆ HandleAuraModSchoolImmunity()

void AuraEffect::HandleAuraModSchoolImmunity ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
Todo:
: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
3825{
3826 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3827 return;
3828
3829 Unit* target = aurApp->GetTarget();
3830
3831 target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
3832
3833 if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3834 {
3835 if (apply)
3837 else
3838 {
3839 bool banishFound = false;
3840 Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
3841 for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
3842 if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
3843 {
3844 banishFound = true;
3845 break;
3846 }
3847 if (!banishFound)
3849 }
3850 }
3851
3852 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
3854
3855 // remove all flag auras (they are positive, but they must be removed when you are immune)
3859
3861 if ((apply)
3863 && GetSpellInfo()->IsPositive()) //Only positive immunity removes auras
3864 {
3865 uint32 school_mask = GetMiscValue();
3866 Unit::AuraApplicationMap& Auras = target->GetAppliedAuras();
3867 for (Unit::AuraApplicationMap::iterator iter = Auras.begin(); iter != Auras.end();)
3868 {
3869 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
3870 if ((spell->GetSchoolMask() & school_mask)//Check for school mask
3871 && GetSpellInfo()->CanDispelAura(spell)
3872 && !iter->second->IsPositive() //Don't remove positive spells
3873 && spell->Id != GetId()) //Don't remove self
3874 {
3875 target->RemoveAura(iter);
3876 }
3877 else
3878 ++iter;
3879 }
3880 }
3881}
@ UNIT_STATE_ISOLATED
Definition: Unit.h:338
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
Definition: SharedDefines.h:449
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
Definition: SharedDefines.h:406
@ MECHANIC_BANISH
Definition: SharedDefines.h:1315
@ IMMUNITY_SCHOOL
Definition: SharedDefines.h:1368
void ClearUnitState(uint32 f)
Definition: Unit.h:1399
void AddUnitState(uint32 f)
Definition: Unit.h:1397
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5919
SpellSchoolMask GetSchoolMask() const
Definition: SpellInfo.cpp:1969
bool IsPositive() const
Definition: SpellInfo.cpp:1220

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

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(), 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, and urand().

◆ HandleAuraModSilence()

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

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
2805{
2807 return;
2808 Unit* target = aurApp->GetTarget();
2809
2810 if (target->GetTypeId() != TYPEID_PLAYER)
2811 return;
2812
2813 uint32 prot = GetMiscValue();
2814 int32 points = GetAmount();
2815
2816 target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
2817 if (prot == SKILL_DEFENSE)
2818 target->ToPlayer()->UpdateDefenseBonusesMod();
2819}
@ SPELL_AURA_MOD_SKILL_TALENT
Definition: SpellAuraDefines.h:161
@ AURA_EFFECT_HANDLE_SKILL
Definition: SpellAuraDefines.h:47
@ SKILL_DEFENSE
Definition: SharedDefines.h:2853
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition: Player.cpp:5197
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
2747{
2749 return;
2750
2751 Unit* target = aurApp->GetTarget();
2752
2753 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
2754 if (apply)
2756 else
2757 {
2758 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2759 if (!target->HasAuraType(GetAuraType()))
2761 }
2762
2763 // call functions which may have additional effects after chainging state of unit
2764 target->UpdateObjectVisibility(target->GetTypeId() == TYPEID_PLAYER);
2765}
@ UNIT_DYNFLAG_TRACK_UNIT
Definition: SharedDefines.h:3094
virtual void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:118
virtual void SetDynamicFlag(uint32 flag)
Definition: Object.h:117

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

◆ HandleAuraModStat()

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

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
3096{
3097 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3098 return;
3099
3100 Unit* target = aurApp->GetTarget();
3101
3102 target->SetControlled(apply, UNIT_STATE_STUNNED);
3103}
@ 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
3034{
3036 return;
3037
3038 Unit* target = aurApp->GetTarget();
3039
3040 if (!target->IsAlive() || target->GetTypeId() != TYPEID_PLAYER)
3041 return;
3042
3043 Unit* caster = GetCaster();
3044 if (caster && caster->IsAlive())
3045 target->getHostileRefMgr().addTempThreat((float)GetAmount(), apply);
3046}
void addTempThreat(float threat, bool apply)
Definition: HostileRefMgr.cpp:65
HostileRefMgr & getHostileRefMgr()
Definition: Unit.h:2408

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
3381{
3382 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3383 return;
3384
3385 Unit* target = aurApp->GetTarget();
3386
3387 target->UpdateSpeed(MOVE_RUN, true);
3388 target->UpdateSpeed(MOVE_SWIM, true);
3389 target->UpdateSpeed(MOVE_FLIGHT, true);
3390
3391 if (Player* targetPlayer = target->ToPlayer())
3392 {
3393 sScriptMgr->AnticheatSetUnderACKmount(targetPlayer);
3394 }
3395}

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

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

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
5694{
5695 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5696 return;
5697
5698 Unit* target = aurApp->GetTarget();
5699
5700 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
5701 return;
5702
5703 if (apply)
5704 target->ToPlayer()->GetSession()->SendStablePet(target->GetGUID());
5705
5706 // client auto close stable dialog at !apply aura
5707}
bool IsInWorld() const
Definition: Object.h:101
WorldSession * GetSession() const
Definition: Player.h:1947
void SendStablePet(ObjectGuid guid)
Definition: NPCHandler.cpp:487

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
5751{
5752 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5753 return;
5754
5755 Player* target = aurApp->GetTarget()->ToPlayer();
5756
5757 if (!target || !target->IsInWorld())
5758 return;
5759
5760 uint32 overrideId = uint32(GetMiscValue());
5761
5762 if (apply)
5763 {
5765 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5766 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5767 if (uint32 spellId = overrideSpells->spellId[i])
5768 target->_addSpell(spellId, SPEC_MASK_ALL, true);
5769 }
5770 else
5771 {
5773 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5774 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5775 if (uint32 spellId = overrideSpells->spellId[i])
5776 target->removeSpell(spellId, SPEC_MASK_ALL, true);
5777 }
5778}
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:1380
void SetUInt16Value(uint16 index, uint8 offset, uint16 value)
Definition: Object.cpp:772
Definition: DBCStructure.h:1383

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

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
5781{
5782 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5783 return;
5784
5785 Unit* target = aurApp->GetTarget();
5786
5787 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
5788 return;
5789
5790 uint32 vehicleId = GetMiscValue();
5791
5792 if (apply)
5793 {
5794 if (!target->CreateVehicleKit(vehicleId, 0))
5795 return;
5796 }
5797 else if (target->GetVehicleKit())
5798 target->RemoveVehicleKit();
5799
5801 data << target->GetPackGUID();
5802 data << uint32(apply ? vehicleId : 0);
5803 target->SendMessageToSet(&data, true);
5804
5805 if (apply)
5806 {
5808 target->ToPlayer()->GetSession()->SendPacket(&data);
5809 }
5810}
@ 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:19615
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
Definition: Unit.cpp:19603
Definition: WorldPacket.h:27
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:208

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

◆ HandleAuraTrackCreatures()

void AuraEffect::HandleAuraTrackCreatures ( AuraApplication const *  aurApp,
uint8  mode,
bool  apply 
) const
2696{
2698 return;
2699
2700 Unit* target = aurApp->GetTarget();
2701
2702 if (target->GetTypeId() != TYPEID_PLAYER)
2703 return;
2704
2705 if (apply)
2706 target->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
2707 else
2708 target->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (GetMiscValue() - 1));
2709}
@ PLAYER_TRACK_CREATURES
Definition: UpdateFields.h:344

References AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK, GetMiscValue(), AuraApplication::GetTarget(), Object::GetTypeId(), PLAYER_TRACK_CREATURES, Object::RemoveFlag(), Object::SetFlag(), and TYPEID_PLAYER.