TrinityCore
Loading...
Searching...
No Matches
SpellAuraEffects.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "SpellAuraEffects.h"
19#include "Battlefield.h"
20#include "BattlefieldMgr.h"
21#include "Battleground.h"
22#include "BattlegroundPackets.h"
23#include "CellImpl.h"
24#include "CharmInfo.h"
25#include "Common.h"
26#include "Containers.h"
27#include "DB2Stores.h"
28#include "GridNotifiersImpl.h"
29#include "Item.h"
30#include "Log.h"
31#include "MiscPackets.h"
32#include "MotionMaster.h"
33#include "MovementPackets.h"
34#include "ObjectAccessor.h"
35#include "ObjectMgr.h"
36#include "OutdoorPvPMgr.h"
37#include "Pet.h"
38#include "PhasingHandler.h"
39#include "Player.h"
40#include "ReputationMgr.h"
41#include "ScriptMgr.h"
42#include "Spell.h"
43#include "SpellHistory.h"
44#include "SpellMgr.h"
45#include "SpellScript.h"
46#include "ThreatManager.h"
47#include "Unit.h"
48#include "Util.h"
49#include "Vehicle.h"
50#include "Weather.h"
51#include "WorldPacket.h"
52#include "WorldSession.h"
53#include <G3D/g3dmath.h>
54#include <numeric>
55
56class Aura;
57//
58// EFFECT HANDLER NOTES
59//
60// in aura handler there should be check for modes:
61// AURA_EFFECT_HANDLE_REAL set
62// AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK set
63// AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK set - aura is recalculated or is just applied/removed - need to redo all things related to m_amount
64// AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK - logical or of above conditions
65// AURA_EFFECT_HANDLE_STAT - set when stats are reapplied
66// such checks will speedup trinity change amount/send for client operations
67// because for change amount operation packets will not be send
68// aura effect handlers shouldn't contain any AuraEffect or Aura object modifications
69
71{
72 &AuraEffect::HandleNULL, // 0 SPELL_AURA_NONE
73 &AuraEffect::HandleBindSight, // 1 SPELL_AURA_BIND_SIGHT
74 &AuraEffect::HandleModPossess, // 2 SPELL_AURA_MOD_POSSESS
75 &AuraEffect::HandleNoImmediateEffect, // 3 SPELL_AURA_PERIODIC_DAMAGE implemented in AuraEffect::PeriodicTick
76 &AuraEffect::HandleAuraDummy, // 4 SPELL_AURA_DUMMY
77 &AuraEffect::HandleModConfuse, // 5 SPELL_AURA_MOD_CONFUSE
78 &AuraEffect::HandleModCharm, // 6 SPELL_AURA_MOD_CHARM
79 &AuraEffect::HandleModFear, // 7 SPELL_AURA_MOD_FEAR
80 &AuraEffect::HandleNoImmediateEffect, // 8 SPELL_AURA_PERIODIC_HEAL implemented in AuraEffect::PeriodicTick
81 &AuraEffect::HandleModAttackSpeed, // 9 SPELL_AURA_MOD_ATTACKSPEED
82 &AuraEffect::HandleModThreat, // 10 SPELL_AURA_MOD_THREAT
83 &AuraEffect::HandleModTaunt, // 11 SPELL_AURA_MOD_TAUNT
84 &AuraEffect::HandleAuraModStun, // 12 SPELL_AURA_MOD_STUN
85 &AuraEffect::HandleModDamageDone, // 13 SPELL_AURA_MOD_DAMAGE_DONE
86 &AuraEffect::HandleNoImmediateEffect, // 14 SPELL_AURA_MOD_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
87 &AuraEffect::HandleNoImmediateEffect, // 15 SPELL_AURA_DAMAGE_SHIELD implemented in Unit::DoAttackDamage
88 &AuraEffect::HandleModStealth, // 16 SPELL_AURA_MOD_STEALTH
89 &AuraEffect::HandleModStealthDetect, // 17 SPELL_AURA_MOD_DETECT
90 &AuraEffect::HandleModInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY
91 &AuraEffect::HandleModInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECT
92 &AuraEffect::HandleNoImmediateEffect, // 20 SPELL_AURA_OBS_MOD_HEALTH implemented in AuraEffect::PeriodicTick
93 &AuraEffect::HandleNoImmediateEffect, // 21 SPELL_AURA_OBS_MOD_POWER implemented in AuraEffect::PeriodicTick
94 &AuraEffect::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE
95 &AuraEffect::HandleNoImmediateEffect, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL implemented in AuraEffect::PeriodicTick
96 &AuraEffect::HandleNoImmediateEffect, // 24 SPELL_AURA_PERIODIC_ENERGIZE implemented in AuraEffect::PeriodicTick
97 &AuraEffect::HandleAuraModPacify, // 25 SPELL_AURA_MOD_PACIFY
98 &AuraEffect::HandleAuraModRoot, // 26 SPELL_AURA_MOD_ROOT
99 &AuraEffect::HandleAuraModSilence, // 27 SPELL_AURA_MOD_SILENCE
100 &AuraEffect::HandleNoImmediateEffect, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
101 &AuraEffect::HandleAuraModStat, // 29 SPELL_AURA_MOD_STAT
102 &AuraEffect::HandleAuraModSkill, // 30 SPELL_AURA_MOD_SKILL
103 &AuraEffect::HandleAuraModIncreaseSpeed, // 31 SPELL_AURA_MOD_INCREASE_SPEED
104 &AuraEffect::HandleAuraModIncreaseMountedSpeed, // 32 SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
105 &AuraEffect::HandleAuraModDecreaseSpeed, // 33 SPELL_AURA_MOD_DECREASE_SPEED
106 &AuraEffect::HandleAuraModIncreaseHealth, // 34 SPELL_AURA_MOD_INCREASE_HEALTH
107 &AuraEffect::HandleAuraModIncreaseEnergy, // 35 SPELL_AURA_MOD_INCREASE_ENERGY
108 &AuraEffect::HandleAuraModShapeshift, // 36 SPELL_AURA_MOD_SHAPESHIFT
109 &AuraEffect::HandleAuraModEffectImmunity, // 37 SPELL_AURA_EFFECT_IMMUNITY
110 &AuraEffect::HandleAuraModStateImmunity, // 38 SPELL_AURA_STATE_IMMUNITY
111 &AuraEffect::HandleAuraModSchoolImmunity, // 39 SPELL_AURA_SCHOOL_IMMUNITY
112 &AuraEffect::HandleAuraModDmgImmunity, // 40 SPELL_AURA_DAMAGE_IMMUNITY
113 &AuraEffect::HandleAuraModDispelImmunity, // 41 SPELL_AURA_DISPEL_IMMUNITY
114 &AuraEffect::HandleNoImmediateEffect, // 42 SPELL_AURA_PROC_TRIGGER_SPELL implemented in AuraEffect::HandleProc
115 &AuraEffect::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in AuraEffect::HandleProc
116 &AuraEffect::HandleAuraTrackCreatures, // 44 SPELL_AURA_TRACK_CREATURES
117 &AuraEffect::HandleNULL, // 45 SPELL_AURA_TRACK_RESOURCES implemented clientside
118 &AuraEffect::HandleNULL, // 46 SPELL_AURA_46 (used in test spells 54054 and 54058, and spell 48050) (3.0.8a)
119 &AuraEffect::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
120 &AuraEffect::HandleNoImmediateEffect, // 48 SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
121 &AuraEffect::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
122 &AuraEffect::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT implemented in Unit::SpellCriticalHealingBonus
123 &AuraEffect::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
124 &AuraEffect::HandleAuraModWeaponCritPercent, // 52 SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
125 &AuraEffect::HandleNoImmediateEffect, // 53 SPELL_AURA_PERIODIC_LEECH implemented in AuraEffect::PeriodicTick
126 &AuraEffect::HandleNoImmediateEffect, // 54 SPELL_AURA_MOD_HIT_CHANCE implemented in Unit::MeleeSpellMissChance
127 &AuraEffect::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE
128 &AuraEffect::HandleAuraTransform, // 56 SPELL_AURA_TRANSFORM
129 &AuraEffect::HandleModSpellCritChance, // 57 SPELL_AURA_MOD_SPELL_CRIT_CHANCE
130 &AuraEffect::HandleAuraModIncreaseSwimSpeed, // 58 SPELL_AURA_MOD_INCREASE_SWIM_SPEED
131 &AuraEffect::HandleNoImmediateEffect, // 59 SPELL_AURA_MOD_DAMAGE_DONE_CREATURE implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
132 &AuraEffect::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
133 &AuraEffect::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE
134 &AuraEffect::HandleNoImmediateEffect, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL implemented in AuraEffect::PeriodicTick
135 &AuraEffect::HandleNoImmediateEffect, // 63 SPELL_AURA_MOD_ADDITIONAL_POWER_COST implemented in SpellInfo::CalcPowerCost
136 &AuraEffect::HandleNoImmediateEffect, // 64 SPELL_AURA_PERIODIC_MANA_LEECH implemented in AuraEffect::PeriodicTick
137 &AuraEffect::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
138 &AuraEffect::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH
139 &AuraEffect::HandleAuraModDisarm, // 67 SPELL_AURA_MOD_DISARM
140 &AuraEffect::HandleAuraModStalked, // 68 SPELL_AURA_MOD_STALKED
141 &AuraEffect::HandleNoImmediateEffect, // 69 SPELL_AURA_SCHOOL_ABSORB implemented in Unit::CalcAbsorbResist
142 &AuraEffect::HandleNoImmediateEffect, // 70 SPELL_AURA_PERIODIC_WEAPON_PERCENT_DAMAGE implemented in AuraEffect::PeriodicTick
143 &AuraEffect::HandleStoreTeleportReturnPoint, // 71 SPELL_AURA_STORE_TELEPORT_RETURN_POINT
144 &AuraEffect::HandleNoImmediateEffect, // 72 SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
145 &AuraEffect::HandleModPowerCost, // 73 SPELL_AURA_MOD_POWER_COST_SCHOOL
146 &AuraEffect::HandleNoImmediateEffect, // 74 SPELL_AURA_REFLECT_SPELLS_SCHOOL implemented in Unit::SpellHitResult
147 &AuraEffect::HandleNoImmediateEffect, // 75 SPELL_AURA_MOD_LANGUAGE
148 &AuraEffect::HandleNoImmediateEffect, // 76 SPELL_AURA_FAR_SIGHT
149 &AuraEffect::HandleModMechanicImmunity, // 77 SPELL_AURA_MECHANIC_IMMUNITY
150 &AuraEffect::HandleAuraMounted, // 78 SPELL_AURA_MOUNTED
151 &AuraEffect::HandleModDamagePercentDone, // 79 SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
152 &AuraEffect::HandleModPercentStat, // 80 SPELL_AURA_MOD_PERCENT_STAT
153 &AuraEffect::HandleNoImmediateEffect, // 81 SPELL_AURA_SPLIT_DAMAGE_PCT implemented in Unit::CalcAbsorbResist
154 &AuraEffect::HandleWaterBreathing, // 82 SPELL_AURA_WATER_BREATHING
155 &AuraEffect::HandleModBaseResistance, // 83 SPELL_AURA_MOD_BASE_RESISTANCE
156 &AuraEffect::HandleNoImmediateEffect, // 84 SPELL_AURA_MOD_REGEN implemented in Player::RegenerateHealth
157 &AuraEffect::HandleModPowerRegen, // 85 SPELL_AURA_MOD_POWER_REGEN implemented in Player::Regenerate
158 &AuraEffect::HandleChannelDeathItem, // 86 SPELL_AURA_CHANNEL_DEATH_ITEM
159 &AuraEffect::HandleNoImmediateEffect, // 87 SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN implemented in Unit::MeleeDamageBonus and Unit::SpellDamageBonus
160 &AuraEffect::HandleNoImmediateEffect, // 88 SPELL_AURA_MOD_HEALTH_REGEN_PERCENT implemented in Player::RegenerateHealth
161 &AuraEffect::HandleNoImmediateEffect, // 89 SPELL_AURA_PERIODIC_DAMAGE_PERCENT
162 &AuraEffect::HandleUnused, // 90 unused (4.3.4) old SPELL_AURA_MOD_RESIST_CHANCE
163 &AuraEffect::HandleNoImmediateEffect, // 91 SPELL_AURA_MOD_DETECT_RANGE implemented in Creature::GetAttackDistance
164 &AuraEffect::HandlePreventFleeing, // 92 SPELL_AURA_PREVENTS_FLEEING
165 &AuraEffect::HandleModUnattackable, // 93 SPELL_AURA_MOD_UNATTACKABLE
166 &AuraEffect::HandleNoImmediateEffect, // 94 SPELL_AURA_INTERRUPT_REGEN implemented in Player::Regenerate
167 &AuraEffect::HandleAuraGhost, // 95 SPELL_AURA_GHOST
168 &AuraEffect::HandleNoImmediateEffect, // 96 SPELL_AURA_SPELL_MAGNET implemented in Unit::GetMagicHitRedirectTarget
169 &AuraEffect::HandleNoImmediateEffect, // 97 SPELL_AURA_MANA_SHIELD implemented in Unit::CalcAbsorbResist
170 &AuraEffect::HandleAuraModSkill, // 98 SPELL_AURA_MOD_SKILL_TALENT
171 &AuraEffect::HandleAuraModAttackPower, // 99 SPELL_AURA_MOD_ATTACK_POWER
172 &AuraEffect::HandleUnused, //100 SPELL_AURA_AURAS_VISIBLE obsolete? all player can see all auras now, but still have spells including GM-spell
173 &AuraEffect::HandleModResistancePercent, //101 SPELL_AURA_MOD_RESISTANCE_PCT
174 &AuraEffect::HandleNoImmediateEffect, //102 SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
175 &AuraEffect::HandleAuraModTotalThreat, //103 SPELL_AURA_MOD_TOTAL_THREAT
176 &AuraEffect::HandleAuraWaterWalk, //104 SPELL_AURA_WATER_WALK
177 &AuraEffect::HandleAuraFeatherFall, //105 SPELL_AURA_FEATHER_FALL
178 &AuraEffect::HandleAuraHover, //106 SPELL_AURA_HOVER
179 &AuraEffect::HandleNoImmediateEffect, //107 SPELL_AURA_ADD_FLAT_MODIFIER implemented in AuraEffect::CalculateSpellMod()
180 &AuraEffect::HandleNoImmediateEffect, //108 SPELL_AURA_ADD_PCT_MODIFIER implemented in AuraEffect::CalculateSpellMod()
181 &AuraEffect::HandleNoImmediateEffect, //109 SPELL_AURA_ADD_TARGET_TRIGGER
182 &AuraEffect::HandleModPowerRegenPCT, //110 SPELL_AURA_MOD_POWER_REGEN_PERCENT implemented in Player::Regenerate, Creature::Regenerate
183 &AuraEffect::HandleNoImmediateEffect, //111 SPELL_AURA_INTERCEPT_MELEE_RANGED_ATTACKS implemented in Unit::GetMeleeHitRedirectTarget
184 &AuraEffect::HandleNoImmediateEffect, //112 SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
185 &AuraEffect::HandleNoImmediateEffect, //113 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
186 &AuraEffect::HandleNoImmediateEffect, //114 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
187 &AuraEffect::HandleNoImmediateEffect, //115 SPELL_AURA_MOD_HEALING implemented in Unit::SpellBaseHealingBonusForVictim
188 &AuraEffect::HandleNoImmediateEffect, //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT
189 &AuraEffect::HandleNoImmediateEffect, //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE implemented in Unit::MagicSpellHitResult
190 &AuraEffect::HandleNoImmediateEffect, //118 SPELL_AURA_MOD_HEALING_PCT implemented in Unit::SpellHealingBonus
191 &AuraEffect::HandleAuraPvpTalents, //119 SPELL_AURA_PVP_TALENTS
192 &AuraEffect::HandleAuraUntrackable, //120 SPELL_AURA_UNTRACKABLE
193 &AuraEffect::HandleAuraEmpathy, //121 SPELL_AURA_EMPATHY
194 &AuraEffect::HandleModOffhandDamagePercent, //122 SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT
195 &AuraEffect::HandleModTargetResistance, //123 SPELL_AURA_MOD_TARGET_RESISTANCE
196 &AuraEffect::HandleAuraModRangedAttackPower, //124 SPELL_AURA_MOD_RANGED_ATTACK_POWER
197 &AuraEffect::HandleNoImmediateEffect, //125 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus
198 &AuraEffect::HandleNoImmediateEffect, //126 SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus
199 &AuraEffect::HandleNoImmediateEffect, //127 SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
200 &AuraEffect::HandleAuraModFixate, //128 SPELL_AURA_MOD_FIXATE
201 &AuraEffect::HandleAuraModIncreaseSpeed, //129 SPELL_AURA_MOD_SPEED_ALWAYS
202 &AuraEffect::HandleAuraModIncreaseMountedSpeed, //130 SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
203 &AuraEffect::HandleNoImmediateEffect, //131 SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS implemented in Unit::MeleeDamageBonus
204 &AuraEffect::HandleAuraModIncreaseEnergyPercent, //132 SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
205 &AuraEffect::HandleAuraModIncreaseHealthPercent, //133 SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
206 &AuraEffect::HandleAuraModRegenInterrupt, //134 SPELL_AURA_MOD_MANA_REGEN_INTERRUPT
207 &AuraEffect::HandleModHealingDone, //135 SPELL_AURA_MOD_HEALING_DONE
208 &AuraEffect::HandleModHealingDonePct, //136 SPELL_AURA_MOD_HEALING_DONE_PERCENT
209 &AuraEffect::HandleModTotalPercentStat, //137 SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
210 &AuraEffect::HandleModMeleeSpeedPct, //138 SPELL_AURA_MOD_MELEE_HASTE
211 &AuraEffect::HandleForceReaction, //139 SPELL_AURA_FORCE_REACTION
212 &AuraEffect::HandleAuraModRangedHaste, //140 SPELL_AURA_MOD_RANGED_HASTE
213 &AuraEffect::HandleUnused, //141 SPELL_AURA_141
214 &AuraEffect::HandleAuraModBaseResistancePCT, //142 SPELL_AURA_MOD_BASE_RESISTANCE_PCT
215 &AuraEffect::HandleModRecoveryRateBySpellLabel, //143 SPELL_AURA_MOD_RECOVERY_RATE_BY_SPELL_LABEL also implemented in SpellHistory::StartCooldown
216 &AuraEffect::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes
217 &AuraEffect::HandleAuraModIncreaseHealthPercent, //145 SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT2
218 &AuraEffect::HandleNoImmediateEffect, //146 SPELL_AURA_ALLOW_TAME_PET_TYPE
219 &AuraEffect::HandleModMechanicImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK
220 &AuraEffect::HandleModChargeRecoveryRate, //148 SPELL_AURA_MOD_CHARGE_RECOVERY_RATE also implemented in SpellHistory::GetChargeRecoveryTime
221 &AuraEffect::HandleNoImmediateEffect, //149 SPELL_AURA_REDUCE_PUSHBACK
222 &AuraEffect::HandleShieldBlockValuePercent, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
223 &AuraEffect::HandleAuraTrackStealthed, //151 SPELL_AURA_TRACK_STEALTHED
224 &AuraEffect::HandleNoImmediateEffect, //152 SPELL_AURA_MOD_DETECTED_RANGE implemented in Creature::GetAttackDistance
225 &AuraEffect::HandleNoImmediateEffect, //153 SPELL_AURA_MOD_AUTOATTACK_RANGE implemented in Unit::IsWithinMeleeRange
226 &AuraEffect::HandleModStealthLevel, //154 SPELL_AURA_MOD_STEALTH_LEVEL
227 &AuraEffect::HandleNoImmediateEffect, //155 SPELL_AURA_MOD_WATER_BREATHING
228 &AuraEffect::HandleNoImmediateEffect, //156 SPELL_AURA_MOD_REPUTATION_GAIN
229 &AuraEffect::HandleNULL, //157 SPELL_AURA_PET_DAMAGE_MULTI
230 &AuraEffect::HandleAuraAllowTalentSwapping, //158 SPELL_AURA_ALLOW_TALENT_SWAPPING
231 &AuraEffect::HandleNoImmediateEffect, //159 SPELL_AURA_NO_PVP_CREDIT only for Honorless Target spell
232 &AuraEffect::HandleUnused, //160 Unused (4.3.4) old SPELL_AURA_MOD_AOE_AVOIDANCE
233 &AuraEffect::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT
234 &AuraEffect::HandleNoImmediateEffect, //162 SPELL_AURA_POWER_BURN implemented in AuraEffect::PeriodicTick
235 &AuraEffect::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS
236 &AuraEffect::HandleForceBreathBar, //164 SPELL_AURA_FORCE_BREATH_BAR
237 &AuraEffect::HandleNoImmediateEffect, //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus
238 &AuraEffect::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT
239 &AuraEffect::HandleAuraModRangedAttackPowerPercent, //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
240 &AuraEffect::HandleNoImmediateEffect, //168 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus
241 &AuraEffect::HandleSetFFAPvP, //169 SPELL_AURA_SET_FFA_PVP implemented in Player::UpdatePvPState
242 &AuraEffect::HandleDetectAmore, //170 SPELL_AURA_DETECT_AMORE used to detect various spells that change visual of units for aura target
243 &AuraEffect::HandleAuraModIncreaseSpeed, //171 SPELL_AURA_MOD_SPEED_NOT_STACK
244 &AuraEffect::HandleAuraModIncreaseMountedSpeed, //172 SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
245 &AuraEffect::HandleNoImmediateEffect, //173 SPELL_AURA_MOD_CHARGE_RECOVERY_RATE_BY_TYPE_MASK implemented in SpellHistory::GetChargeRecoveryTime
246 &AuraEffect::HandleModSpellDamagePercentFromStat, //174 SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT implemented in Unit::SpellBaseDamageBonus
247 &AuraEffect::HandleModSpellHealingPercentFromStat, //175 SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT implemented in Unit::SpellBaseHealingBonus
248 &AuraEffect::HandleSpiritOfRedemption, //176 SPELL_AURA_SPIRIT_OF_REDEMPTION only for Spirit of Redemption spell, die at aura end
249 &AuraEffect::HandleCharmConvert, //177 SPELL_AURA_AOE_CHARM
250 &AuraEffect::HandleAuraModMaxPowerPct, //178 SPELL_AURA_MOD_MAX_POWER_PCT
251 &AuraEffect::HandleAuraModPowerDisplay, //179 SPELL_AURA_MOD_POWER_DISPLAY
252 &AuraEffect::HandleNoImmediateEffect, //180 SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS implemented in Unit::SpellDamageBonus
253 &AuraEffect::HandleNULL, //181 SPELL_AURA_MOD_SPELL_CURRENCY_REAGENTS_COUNT_PCT
254 &AuraEffect::HandleSuppressItemPassiveEffectBySpellLabel, //182 SPELL_AURA_SUPPRESS_ITEM_PASSIVE_EFFECT_BY_SPELL_LABEL
255 &AuraEffect::HandleNoImmediateEffect, //183 SPELL_AURA_MOD_CRIT_CHANCE_VERSUS_TARGET_HEALTH implemented in Unit::GetUnitCriticalChance, Unit::GetUnitSpellCriticalChance
256 &AuraEffect::HandleNoImmediateEffect, //184 SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
257 &AuraEffect::HandleNoImmediateEffect, //185 SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
258 &AuraEffect::HandleNoImmediateEffect, //186 SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE implemented in Unit::MagicSpellHitResult
259 &AuraEffect::HandleNoImmediateEffect, //187 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE implemented in Unit::GetUnitCriticalChance
260 &AuraEffect::HandleNULL, //188 SPELL_AURA_MOD_UI_HEALING_RANGE handled clientside - affects UnitInRange lua function only
261 &AuraEffect::HandleModRating, //189 SPELL_AURA_MOD_RATING
262 &AuraEffect::HandleNoImmediateEffect, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN implemented in Player::CalculateReputationGain
263 &AuraEffect::HandleAuraModUseNormalSpeed, //191 SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
264 &AuraEffect::HandleModMeleeRangedSpeedPct, //192 SPELL_AURA_MOD_MELEE_RANGED_HASTE
265 &AuraEffect::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) speed pct)
266 &AuraEffect::HandleNoImmediateEffect, //194 SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
267 &AuraEffect::HandleLearnSpell, //195 SPELL_AURA_LEARN_SPELL
268 &AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns
269 &AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
270 &AuraEffect::HandleNoImmediateEffect, //198 SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING implemented in Player::UpdateRating
271 &AuraEffect::HandleUnused, //199 unused (4.3.4) old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
272 &AuraEffect::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill
273 &AuraEffect::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...
274 &AuraEffect::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst
275 &AuraEffect::HandleNoImmediateEffect, //203 SPELL_AURA_PREVENT_INTERRUPT implemented in SpellInfo::CanBeInterrupted
276 &AuraEffect::HandleNULL, //204 SPELL_AURA_PREVENT_CORPSE_RELEASE
277 &AuraEffect::HandleNoImmediateEffect, //205 SPELL_AURA_MOD_CHARGE_RECOVERY_BY_TYPE_MASK implemented in SpellHistory::GetChargeRecoveryTime
278 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //206 SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
279 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //207 SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
280 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //208 SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
281 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //209 SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS
282 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //210 SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS
283 &AuraEffect::HandleAuraModIncreaseFlightSpeed, //211 SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
284 &AuraEffect::HandleNoImmediateEffect, //212 SPELL_AURA_MOD_HONOR_GAIN_PCT_FROM_SOURCE implemented in Player::RewardHonor
285 &AuraEffect::HandleNoImmediateEffect, //213 SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT implemented in Player::RewardRage
286 &AuraEffect::HandleNULL, //214 Tamed Pet Passive
287 &AuraEffect::HandleArenaPreparation, //215 SPELL_AURA_ARENA_PREPARATION
288 &AuraEffect::HandleModCastingSpeed, //216 SPELL_AURA_HASTE_SPELLS
289 &AuraEffect::HandleModMeleeSpeedPct, //217 SPELL_AURA_MOD_MELEE_HASTE_2
290 &AuraEffect::HandleNoImmediateEffect, //218 SPELL_AURA_ADD_PCT_MODIFIER_BY_SPELL_LABEL implemented in AuraEffect::CalculateSpellMod()
291 &AuraEffect::HandleNoImmediateEffect, //219 SPELL_AURA_ADD_FLAT_MODIFIER_BY_SPELL_LABEL implemented in AuraEffect::CalculateSpellMod()
292 &AuraEffect::HandleNULL, //220 SPELL_AURA_MOD_ABILITY_SCHOOL_MASK
293 &AuraEffect::HandleModDetaunt, //221 SPELL_AURA_MOD_DETAUNT
294 &AuraEffect::HandleNoImmediateEffect, //222 SPELL_AURA_REMOVE_TRANSMOG_COST implemented in WorldSession::HandleTransmogrifyItems
295 &AuraEffect::HandleNoImmediateEffect, //223 SPELL_AURA_REMOVE_BARBER_SHOP_COST implemented in Player::GetBarberShopCost
296 &AuraEffect::HandleNULL, //224 SPELL_AURA_MOD_TRAIT_NODE_ENTRY_RANK
297 &AuraEffect::HandleNULL, //225 SPELL_AURA_MOD_VISIBILITY_RANGE
298 &AuraEffect::HandleNoImmediateEffect, //226 SPELL_AURA_PERIODIC_DUMMY implemented in AuraEffect::PeriodicTick
299 &AuraEffect::HandleNoImmediateEffect, //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE implemented in AuraEffect::PeriodicTick
300 &AuraEffect::HandleNoImmediateEffect, //228 SPELL_AURA_DETECT_STEALTH stealth detection
301 &AuraEffect::HandleNoImmediateEffect, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
302 &AuraEffect::HandleAuraModIncreaseHealth, //230 SPELL_AURA_MOD_INCREASE_HEALTH_2
303 &AuraEffect::HandleNoImmediateEffect, //231 SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
304 &AuraEffect::HandleNoImmediateEffect, //232 SPELL_AURA_MECHANIC_DURATION_MOD implement in Unit::CalculateSpellDuration
305 &AuraEffect::HandleUnused, //233 set model id to the one of the creature with id GetMiscValue() - clientside
306 &AuraEffect::HandleNoImmediateEffect, //234 SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK implement in Unit::CalculateSpellDuration
307 &AuraEffect::HandleNULL, //235 SPELL_AURA_MOD_HOVER_NO_HEIGHT_OFFSET handled clientside
308 &AuraEffect::HandleAuraControlVehicle, //236 SPELL_AURA_CONTROL_VEHICLE
309 &AuraEffect::HandleNULL, //237 SPELL_AURA_237
310 &AuraEffect::HandleNULL, //238 SPELL_AURA_238
311 &AuraEffect::HandleAuraModScale, //239 SPELL_AURA_MOD_SCALE_2 only in Noggenfogger Elixir (16595) before 2.3.0 aura 61
312 &AuraEffect::HandleAuraModExpertise, //240 SPELL_AURA_MOD_EXPERTISE
313 &AuraEffect::HandleForceMoveForward, //241 SPELL_AURA_FORCE_MOVE_FORWARD Forces the caster to move forward
314 &AuraEffect::HandleNULL, //242 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_HEALING - 2 test spells: 44183 and 44182
315 &AuraEffect::HandleAuraModFaction, //243 SPELL_AURA_MOD_FACTION
316 &AuraEffect::HandleComprehendLanguage, //244 SPELL_AURA_COMPREHEND_LANGUAGE
317 &AuraEffect::HandleNoImmediateEffect, //245 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
318 &AuraEffect::HandleNoImmediateEffect, //246 SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK implemented in Spell::EffectApplyAura
319 &AuraEffect::HandleAuraCloneCaster, //247 SPELL_AURA_CLONE_CASTER
320 &AuraEffect::HandleNoImmediateEffect, //248 SPELL_AURA_MOD_COMBAT_RESULT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
321 &AuraEffect::HandleNoImmediateEffect, //249 SPELL_AURA_MOD_DAMAGE_PERCENT_DONE_BY_TARGET_AURA_MECHANIC implemented in Unit::SpellDamagePctDone and Unit::MeleeDamagePctDone
322 &AuraEffect::HandleAuraModIncreaseHealth, //250 SPELL_AURA_MOD_INCREASE_HEALTH_2
323 &AuraEffect::HandleNoImmediateEffect, //251 SPELL_AURA_MOD_ENEMY_DODGE implemented in Unit::GetUnitDodgeChance
324 &AuraEffect::HandleModCombatSpeedPct, //252 SPELL_AURA_252 Is there any difference between this and SPELL_AURA_MELEE_SLOW ? maybe not stacking mod?
325 &AuraEffect::HandleNoImmediateEffect, //253 SPELL_AURA_MOD_BLOCK_CRIT_CHANCE implemented in Unit::isBlockCritical
326 &AuraEffect::HandleAuraModDisarm, //254 SPELL_AURA_MOD_DISARM_OFFHAND
327 &AuraEffect::HandleNoImmediateEffect, //255 SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT implemented in Unit::SpellDamageBonus
328 &AuraEffect::HandleNoReagentUseAura, //256 SPELL_AURA_NO_REAGENT_USE Use SpellClassMask for spell select
329 &AuraEffect::HandleNULL, //257 SPELL_AURA_MOD_TARGET_RESIST_BY_SPELL_CLASS Use SpellClassMask for spell select
330 &AuraEffect::HandleNoImmediateEffect, //258 SPELL_AURA_OVERRIDE_SUMMONED_OBJECT implemented in Spell::EffectTransmitted
331 &AuraEffect::HandleNoImmediateEffect, //259 SPELL_AURA_MOD_HOT_PCT implemented in Unit::SpellHealingBonusTaken
332 &AuraEffect::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code
333 &AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE
334 &AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in Spell::CheckCast
335 &AuraEffect::HandleNoImmediateEffect, //263 SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES implemented in Spell::CheckCast
336 &AuraEffect::HandleNoImmediateEffect, //264 SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES implemented in Spell::CheckCast, Unit::AttackerStateUpdate
337 &AuraEffect::HandleUnused, //265 unused (4.3.4)
338 &AuraEffect::HandleSetVignette, //266 SPELL_AURA_SET_VIGNETTE
339 &AuraEffect::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmunedToSpellEffect
340 &AuraEffect::HandleModArmorPctFromStat, //268 SPELL_AURA_MOD_ARMOR_PCT_FROM_STAT also implemented in Player::UpdateArmor()
341 &AuraEffect::HandleNoImmediateEffect, //269 SPELL_AURA_MOD_IGNORE_TARGET_RESIST implemented in Unit::CalcAbsorbResist and CalcArmorReducedDamage
342 &AuraEffect::HandleNoImmediateEffect, //270 SPELL_AURA_MOD_SCHOOL_MASK_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonusTaken and Unit::MeleeDamageBonusTaken
343 &AuraEffect::HandleNoImmediateEffect, //271 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonusTaken and Unit::MeleeDamageBonusTaken
344 &AuraEffect::HandleNULL, //272 SPELL_AURA_MOD_BLOCK_VALUE_PCT
345 &AuraEffect::HandleUnused, //273 clientside
346 &AuraEffect::HandleNULL, //274 SPELL_AURA_MOD_BLOCK_VALUE_FLAT
347 &AuraEffect::HandleNoImmediateEffect, //275 SPELL_AURA_MOD_IGNORE_SHAPESHIFT Use SpellClassMask for spell select
348 &AuraEffect::HandleNULL, //276 mod damage % mechanic?
349 &AuraEffect::HandleUnused, //277 unused (4.3.4) old SPELL_AURA_MOD_MAX_AFFECTED_TARGETS
350 &AuraEffect::HandleAuraModDisarm, //278 SPELL_AURA_MOD_DISARM_RANGED disarm ranged weapon
351 &AuraEffect::HandleNoImmediateEffect, //279 SPELL_AURA_INITIALIZE_IMAGES
352 &AuraEffect::HandleNoImmediateEffect, //280 SPELL_AURA_MOD_ARMOR_PENETRATION_PCT implemented in Unit::CalcArmorReducedDamage
353 &AuraEffect::HandleNoImmediateEffect, //281 SPELL_AURA_PROVIDE_SPELL_FOCUS implemented in Spell::CheckCast
354 &AuraEffect::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_MOD_BASE_HEALTH_PCT
355 &AuraEffect::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus
356 &AuraEffect::HandleAuraLinked, //284 SPELL_AURA_LINKED
357 &AuraEffect::HandleAuraLinked, //285 SPELL_AURA_LINKED_2
358 &AuraEffect::HandleModRecoveryRate, //286 SPELL_AURA_MOD_RECOVERY_RATE also implemented in SpellHistory::StartCooldown
359 &AuraEffect::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult
360 &AuraEffect::HandleNoImmediateEffect, //288 SPELL_AURA_IGNORE_HIT_DIRECTION implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult Unit::RollMeleeOutcomeAgainst
361 &AuraEffect::HandleNoImmediateEffect, //289 SPELL_AURA_PREVENT_DURABILITY_LOSS implemented in Player::DurabilityPointsLoss
362 &AuraEffect::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
363 &AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
364 &AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE
365 &AuraEffect::HandleAuraOverrideSpells, //293 SPELL_AURA_OVERRIDE_SPELLS auras which probably add set of abilities to their target based on it's miscvalue
366 &AuraEffect::HandleNoImmediateEffect, //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power)
367 &AuraEffect::HandleNoImmediateEffect, //295 SPELL_AURA_MOD_PERIODIC_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonusTaken, Unit::SpellDamageBonusTaken
368 &AuraEffect::HandleAuraSetVehicle, //296 SPELL_AURA_SET_VEHICLE_ID sets vehicle on target
369 &AuraEffect::HandleAuraModRootAndDisableGravity, //297 SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY
370 &AuraEffect::HandleAuraModStunAndDisableGravity, //298 SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
371 &AuraEffect::HandleUnused, //299 unused (4.3.4)
372 &AuraEffect::HandleNoImmediateEffect, //300 SPELL_AURA_SHARE_DAMAGE_PCT implemented in Unit::DealDamage
373 &AuraEffect::HandleNoImmediateEffect, //301 SPELL_AURA_SCHOOL_HEAL_ABSORB implemented in Unit::CalcHealAbsorb
374 &AuraEffect::HandleUnused, //302 unused (4.3.4)
375 &AuraEffect::HandleNoImmediateEffect, //303 SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE implemented in Unit::SpellDamageBonus, Unit::MeleeDamageBonus
376 &AuraEffect::HandleAuraModFakeInebriation, //304 SPELL_AURA_MOD_DRUNK
377 &AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED
378 &AuraEffect::HandleNoImmediateEffect, //306 SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER implemented in Unit::GetUnitCriticalChance and Unit::GetUnitSpellCriticalChance
379 &AuraEffect::HandleNoImmediateEffect, //307 SPELL_AURA_CAST_WHILE_WALKING_BY_SPELL_LABEL implemented in Unit::CanCastSpellWhileMoving
380 &AuraEffect::HandleNoImmediateEffect, //308 SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER_WITH_ABILITIES implemented in Unit::GetUnitSpellCriticalChance
381 &AuraEffect::HandleNULL, //309 SPELL_AURA_MOD_RESILIENCE
382 &AuraEffect::HandleNoImmediateEffect, //310 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE implemented in Spell::CalculateDamageDone
383 &AuraEffect::HandleNULL, //311 SPELL_AURA_IGNORE_COMBAT
384 &AuraEffect::HandleNULL, //312 SPELL_AURA_ANIM_REPLACEMENT_SET implemented clientside
385 &AuraEffect::HandleNULL, //313 SPELL_AURA_MOUNT_ANIM_REPLACEMENT_SET implemented clientside
386 &AuraEffect::HandlePreventResurrection, //314 SPELL_AURA_PREVENT_RESURRECTION todo
387 &AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo
388 &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_SCHOOL_ABSORB_OVERKILL implemented in Unit::DealDamage()
389 &AuraEffect::HandleNULL, //317 SPELL_AURA_MOD_SPELL_POWER_PCT
390 &AuraEffect::HandleMastery, //318 SPELL_AURA_MASTERY
391 &AuraEffect::HandleModMeleeSpeedPct, //319 SPELL_AURA_MOD_MELEE_HASTE_3
392 &AuraEffect::HandleNULL, //320 SPELL_AURA_320
393 &AuraEffect::HandleAuraModNoActions, //321 SPELL_AURA_MOD_NO_ACTIONS
394 &AuraEffect::HandleNoImmediateEffect, //322 SPELL_AURA_INTERFERE_ENEMY_TARGETING implemented in Spell::CheckCast
395 &AuraEffect::HandleUnused, //323 unused (4.3.4)
396 &AuraEffect::HandleNULL, //324 SPELL_AURA_OVERRIDE_UNLOCKED_AZERITE_ESSENCE_RANK
397 &AuraEffect::HandleUnused, //325 SPELL_AURA_LEARN_PVP_TALENT
398 &AuraEffect::HandlePhaseGroup, //326 SPELL_AURA_PHASE_GROUP
399 &AuraEffect::HandlePhaseAlwaysVisible, //327 SPELL_AURA_PHASE_ALWAYS_VISIBLE
400 &AuraEffect::HandleTriggerSpellOnPowerPercent, //328 SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT
401 &AuraEffect::HandleNULL, //329 SPELL_AURA_MOD_POWER_GAIN_PCT
402 &AuraEffect::HandleNoImmediateEffect, //330 SPELL_AURA_CAST_WHILE_WALKING implemented in Unit::CanCastSpellWhileMoving
403 &AuraEffect::HandleAuraForceWeather, //331 SPELL_AURA_FORCE_WEATHER
404 &AuraEffect::HandleNoImmediateEffect, //332 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS implemented in Unit::GetCastSpellInfo
405 &AuraEffect::HandleNoImmediateEffect, //333 SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED implemented in Unit::GetCastSpellInfo
406 &AuraEffect::HandleNoImmediateEffect, //334 SPELL_AURA_MOD_AUTOATTACK_CRIT_CHANCE implemented in Unit::RollMeleeOutcomeAgainst
407 &AuraEffect::HandleNULL, //335 SPELL_AURA_335
408 &AuraEffect::HandleMountRestrictions, //336 SPELL_AURA_MOUNT_RESTRICTIONS implemented in Unit::GetMountCapability
409 &AuraEffect::HandleNoImmediateEffect, //337 SPELL_AURA_MOD_VENDOR_ITEMS_PRICES
410 &AuraEffect::HandleNoImmediateEffect, //338 SPELL_AURA_MOD_DURABILITY_LOSS
411 &AuraEffect::HandleNoImmediateEffect, //339 SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER_PET implemented in Unit::GetUnitCriticalChance and Unit::GetUnitSpellCriticalChance
412 &AuraEffect::HandleNULL, //340 SPELL_AURA_MOD_RESURRECTED_HEALTH_BY_GUILD_MEMBER
413 &AuraEffect::HandleModSpellCategoryCooldown, //341 SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN
414 &AuraEffect::HandleModMeleeRangedSpeedPct, //342 SPELL_AURA_MOD_MELEE_RANGED_HASTE_2
415 &AuraEffect::HandleNoImmediateEffect, //343 SPELL_AURA_MOD_MELEE_DAMAGE_FROM_CASTER - Implemented in Unit::MeleeDamageBonusTaken
416 &AuraEffect::HandleNoImmediateEffect, //344 SPELL_AURA_MOD_AUTOATTACK_DAMAGE - Implemented in Unit::MeleeDamageBonusDone
417 &AuraEffect::HandleNoImmediateEffect, //345 SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
418 &AuraEffect::HandleEnableAltPower, //346 SPELL_AURA_ENABLE_ALT_POWER
419 &AuraEffect::HandleNoImmediateEffect, //347 SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE implemented in SpellHistory::StartCooldown
420 &AuraEffect::HandleNoImmediateEffect, //348 SPELL_AURA_MOD_MONEY_GAIN implemented in WorldSession::HandleLootMoneyOpcode
421 &AuraEffect::HandleNoImmediateEffect, //349 SPELL_AURA_MOD_CURRENCY_GAIN implemented in Player::ModifyCurrency
422 &AuraEffect::HandleNULL, //350 SPELL_AURA_350
423 &AuraEffect::HandleNULL, //351 SPELL_AURA_MOD_CURRENCY_CATEGORY_GAIN_PCT
424 &AuraEffect::HandleNULL, //352 SPELL_AURA_352
425 &AuraEffect::HandleNULL, //353 SPELL_AURA_MOD_CAMOUFLAGE
426 &AuraEffect::HandleNoImmediateEffect, //354 SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH implemented in Unit::SpellHealingPctDone
427 &AuraEffect::HandleNULL, //355 SPELL_AURA_MOD_CASTING_SPEED
428 &AuraEffect::HandleNoImmediateEffect, //356 SPELL_AURA_PROVIDE_TOTEM_CATEGORY implemented in Player::HasItemTotemCategory
429 &AuraEffect::HandleNULL, //357 SPELL_AURA_ENABLE_BOSS1_UNIT_FRAME
430 &AuraEffect::HandleNULL, //358 SPELL_AURA_358
431 &AuraEffect::HandleNoImmediateEffect, //359 SPELL_AURA_MOD_HEALING_DONE_VERSUS_AURASTATE implemented in Unit::SpellHealingPctDone
432 &AuraEffect::HandleNULL, //360 SPELL_AURA_PROC_TRIGGER_SPELL_COPY
433 &AuraEffect::HandleNoImmediateEffect, //361 SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_MELEE_SPELL implemented in Unit::AttackerStateUpdate
434 &AuraEffect::HandleUnused, //362 unused (4.3.4)
435 &AuraEffect::HandleNULL, //363 SPELL_AURA_MOD_NEXT_SPELL
436 &AuraEffect::HandleUnused, //364 unused (4.3.4)
437 &AuraEffect::HandleNULL, //365 SPELL_AURA_MAX_FAR_CLIP_PLANE
438 &AuraEffect::HandleOverrideSpellPowerByAttackPower, //366 SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT
439 &AuraEffect::HandleNULL, //367 SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_RANGED_SPELL
440 &AuraEffect::HandleUnused, //368 unused (4.3.4)
441 &AuraEffect::HandleNULL, //369 SPELL_AURA_ENABLE_POWER_BAR_TIMER
442 &AuraEffect::HandleNULL, //370 SPELL_AURA_SPELL_OVERRIDE_NAME_GROUP
443 &AuraEffect::HandleNoImmediateEffect, //371 SPELL_AURA_DISABLE_AUTOATTACK implemented in Unit::_UpdateAutoRepeatSpell and Unit::AttackerStateUpdate
444 &AuraEffect::HandleNULL, //372 SPELL_AURA_OVERRIDE_MOUNT_FROM_SET
445 &AuraEffect::HandleNULL, //373 SPELL_AURA_MOD_SPEED_NO_CONTROL
446 &AuraEffect::HandleNoImmediateEffect, //374 SPELL_AURA_MODIFY_FALL_DAMAGE_PCT implemented in Player::HandleFall
447 &AuraEffect::HandleNULL, //375 SPELL_AURA_HIDE_MODEL_AND_EQUIPEMENT_SLOTS implemented clientside
448 &AuraEffect::HandleNULL, //376 SPELL_AURA_MOD_CURRENCY_GAIN_FROM_SOURCE
449 &AuraEffect::HandleNoImmediateEffect, //377 SPELL_AURA_CAST_WHILE_WALKING_ALL implemented in Unit::CanCastSpellWhileMoving
450 &AuraEffect::HandleModPossessPet, //378 SPELL_AURA_MOD_POSSESS_PET
451 &AuraEffect::HandleModManaRegenPct, //379 SPELL_AURA_MOD_MANA_REGEN_PCT implemented in Player::UpdateManaRegen
453 &AuraEffect::HandleNULL, //381 SPELL_AURA_MOD_DAMAGE_TAKEN_FROM_CASTER_PET
454 &AuraEffect::HandleNULL, //382 SPELL_AURA_MOD_PET_STAT_PCT
455 &AuraEffect::HandleNoImmediateEffect, //383 SPELL_AURA_IGNORE_SPELL_COOLDOWN implemented in SpellHistory::HasCooldown
460 &AuraEffect::HandleNULL, //388 SPELL_AURA_MOD_TAXI_FLIGHT_SPEED
465 &AuraEffect::HandleNULL, //393 SPELL_AURA_BLOCK_SPELLS_IN_FRONT
466 &AuraEffect::HandleShowConfirmationPrompt, //394 SPELL_AURA_SHOW_CONFIRMATION_PROMPT
467 &AuraEffect::HandleCreateAreaTrigger, //395 SPELL_AURA_AREA_TRIGGER
468 &AuraEffect::HandleTriggerSpellOnPowerAmount, //396 SPELL_AURA_TRIGGER_SPELL_ON_POWER_AMOUNT
469 &AuraEffect::HandleBattlegroundPlayerPosition, //397 SPELL_AURA_BATTLEGROUND_PLAYER_POSITION_FACTIONAL
470 &AuraEffect::HandleBattlegroundPlayerPosition, //398 SPELL_AURA_BATTLEGROUND_PLAYER_POSITION
471 &AuraEffect::HandleNULL, //399 SPELL_AURA_MOD_TIME_RATE
472 &AuraEffect::HandleAuraModSkill, //400 SPELL_AURA_MOD_SKILL_2
473 &AuraEffect::HandleAuraActAsControlZone, //401 SPELL_AURA_ACT_AS_CONTROL_ZONE
474 &AuraEffect::HandleAuraModOverridePowerDisplay, //402 SPELL_AURA_MOD_OVERRIDE_POWER_DISPLAY
475 &AuraEffect::HandleNoImmediateEffect, //403 SPELL_AURA_OVERRIDE_SPELL_VISUAL implemented in Unit::GetCastSpellXSpellVisualId
476 &AuraEffect::HandleOverrideAttackPowerBySpellPower, //404 SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT
477 &AuraEffect::HandleModRatingPct, //405 SPELL_AURA_MOD_RATING_PCT
478 &AuraEffect::HandleNoImmediateEffect, //406 SPELL_AURA_KEYBOUND_OVERRIDE implemented in WorldSession::HandleKeyboundOverride
479 &AuraEffect::HandleNULL, //407 SPELL_AURA_MOD_FEAR_2
480 &AuraEffect::HandleUnused, //408 SPELL_AURA_SET_ACTION_BUTTON_SPELL_COUNT clientside
481 &AuraEffect::HandleAuraCanTurnWhileFalling, //409 SPELL_AURA_CAN_TURN_WHILE_FALLING
483 &AuraEffect::HandleNoImmediateEffect, //411 SPELL_AURA_MOD_MAX_CHARGES implemented in SpellHistory::GetMaxCharges
485 &AuraEffect::HandleNULL, //413 SPELL_AURA_MOD_RANGED_ATTACK_DEFLECT_CHANCE
486 &AuraEffect::HandleNULL, //414 SPELL_AURA_MOD_RANGED_ATTACK_BLOCK_CHANCE_IN_FRONT
488 &AuraEffect::HandleNoImmediateEffect, //416 SPELL_AURA_MOD_COOLDOWN_BY_HASTE_REGEN implemented in SpellHistory::StartCooldown
489 &AuraEffect::HandleNoImmediateEffect, //417 SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE_REGEN implemented in Spell::TriggerGlobalCooldown
490 &AuraEffect::HandleAuraModMaxPower, //418 SPELL_AURA_MOD_MAX_POWER
491 &AuraEffect::HandleAuraModIncreaseBaseManaPercent, //419 SPELL_AURA_MOD_BASE_MANA_PCT
492 &AuraEffect::HandleNoImmediateEffect, //420 SPELL_AURA_MOD_BATTLE_PET_XP_PCT - Implemented in BattlePetMgr::GrantBattlePetExperience
493 &AuraEffect::HandleNoImmediateEffect, //421 SPELL_AURA_MOD_ABSORB_DONE_PCT implemented in Unit::SpellAbsorbPctDone
494 &AuraEffect::HandleNoImmediateEffect, //422 SPELL_AURA_MOD_ABSORB_TAKEN_PCT implemented in Unit::SpellAbsorbBonusTaken
495 &AuraEffect::HandleModManaCostPct, //423 SPELL_AURA_MOD_MANA_COST_PCT
496 &AuraEffect::HandleNULL, //424 SPELL_AURA_CASTER_IGNORE_LOS
499 &AuraEffect::HandleNULL, //427 SPELL_AURA_SCALE_PLAYER_LEVEL
500 &AuraEffect::HandleLinkedSummon, //428 SPELL_AURA_LINKED_SUMMON
501 &AuraEffect::HandleNULL, //429 SPELL_AURA_MOD_SUMMON_DAMAGE
502 &AuraEffect::HandlePlayScene, //430 SPELL_AURA_PLAY_SCENE
503 &AuraEffect::HandleModOverrideZonePVPType, //431 SPELL_AURA_MOD_OVERRIDE_ZONE_PVP_TYPE
508 &AuraEffect::HandleNoImmediateEffect, //436 SPELL_AURA_MOD_ENVIRONMENTAL_DAMAGE_TAKEN implemented in Player::EnvironmentalDamage
509 &AuraEffect::HandleAuraModMinimumSpeedRate, //437 SPELL_AURA_MOD_MINIMUM_SPEED_RATE
510 &AuraEffect::HandleNULL, //438 SPELL_AURA_PRELOAD_PHASE
512 &AuraEffect::HandleNULL, //440 SPELL_AURA_MOD_MULTISTRIKE_DAMAGE
513 &AuraEffect::HandleNULL, //441 SPELL_AURA_MOD_MULTISTRIKE_CHANCE
514 &AuraEffect::HandleNULL, //442 SPELL_AURA_MOD_READINESS
515 &AuraEffect::HandleNULL, //443 SPELL_AURA_MOD_LEECH
518 &AuraEffect::HandleModAdvFlying, //446 SPELL_AURA_ADV_FLYING
519 &AuraEffect::HandleNoImmediateEffect, //447 SPELL_AURA_MOD_XP_FROM_CREATURE_TYPE implemented in KillRewarder::_RewardXP
523 &AuraEffect::HandleOverridePetSpecs, //451 SPELL_AURA_OVERRIDE_PET_SPECS
525 &AuraEffect::HandleNoImmediateEffect, //453 SPELL_AURA_CHARGE_RECOVERY_MOD implemented in SpellHistory::GetChargeRecoveryTime
526 &AuraEffect::HandleNoImmediateEffect, //454 SPELL_AURA_CHARGE_RECOVERY_MULTIPLIER implemented in SpellHistory::GetChargeRecoveryTime
527 &AuraEffect::HandleAuraModRoot, //455 SPELL_AURA_MOD_ROOT_2
528 &AuraEffect::HandleNoImmediateEffect, //456 SPELL_AURA_CHARGE_RECOVERY_AFFECTED_BY_HASTE implemented in SpellHistory::GetChargeRecoveryTime
529 &AuraEffect::HandleNoImmediateEffect, //457 SPELL_AURA_CHARGE_RECOVERY_AFFECTED_BY_HASTE_REGEN implemented in SpellHistory::GetChargeRecoveryTime
530 &AuraEffect::HandleNoImmediateEffect, //458 SPELL_AURA_IGNORE_DUAL_WIELD_HIT_PENALTY implemented in Unit::MeleeSpellMissChance
531 &AuraEffect::HandleIgnoreMovementForces, //459 SPELL_AURA_IGNORE_MOVEMENT_FORCES
532 &AuraEffect::HandleNULL, //460 SPELL_AURA_RESET_COOLDOWNS_ON_DUEL_START
534 &AuraEffect::HandleNULL, //462 SPELL_AURA_MOD_HEALING_AND_ABSORB_FROM_CASTER
535 &AuraEffect::HandleConvertCritToParry, //463 SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING used by Riposte
536 &AuraEffect::HandleNULL, //464 SPELL_AURA_MOD_ATTACK_POWER_OF_BONUS_ARMOR
537 &AuraEffect::HandleModBonusArmor, //465 SPELL_AURA_MOD_BONUS_ARMOR
538 &AuraEffect::HandleModBonusArmorPercent, //466 SPELL_AURA_MOD_BONUS_ARMOR_PCT
539 &AuraEffect::HandleModStatBonusPercent, //467 SPELL_AURA_MOD_STAT_BONUS_PCT
540 &AuraEffect::HandleTriggerSpellOnHealthPercent, //468 SPELL_AURA_TRIGGER_SPELL_ON_HEALTH_PCT
541 &AuraEffect::HandleShowConfirmationPrompt, //469 SPELL_AURA_SHOW_CONFIRMATION_PROMPT_WITH_DIFFICULTY
542 &AuraEffect::HandleNULL, //470 SPELL_AURA_MOD_AURA_TIME_RATE_BY_SPELL_LABEL
543 &AuraEffect::HandleModVersatilityByPct, //471 SPELL_AURA_MOD_VERSATILITY
545 &AuraEffect::HandleNoImmediateEffect, //473 SPELL_AURA_PREVENT_DURABILITY_LOSS_FROM_COMBAT implemented in Player::DurabilityPointLossForEquipSlot
546 &AuraEffect::HandleNULL, //474 SPELL_AURA_REPLACE_ITEM_BONUS_TREE
547 &AuraEffect::HandleAllowUsingGameobjectsWhileMounted, //475 SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED
548 &AuraEffect::HandleNULL, //476 SPELL_AURA_MOD_CURRENCY_GAIN_LOOTED
552 &AuraEffect::HandleNULL, //480 SPELL_AURA_MOD_ARTIFACT_ITEM_LEVEL
553 &AuraEffect::HandleNoImmediateEffect, //481 SPELL_AURA_CONVERT_CONSUMED_RUNE implemented in Spell::TakeRunePower
555 &AuraEffect::HandleNULL, //483 SPELL_AURA_SUPPRESS_TRANSFORMS
556 &AuraEffect::HandleNoImmediateEffect, //484 SPELL_AURA_ALLOW_INTERRUPT_SPELL implemented in SpellInfo::CanBeInterrupted
557 &AuraEffect::HandleModMovementForceMagnitude, //485 SPELL_AURA_MOD_MOVEMENT_FORCE_MAGNITUDE
558 &AuraEffect::HandleNoImmediateEffect, //486 SPELL_AURA_INTERFERE_ALL_TARGETING implemented in Spell::CheckCast
559 &AuraEffect::HandleCosmeticMounted, //487 SPELL_AURA_COSMETIC_MOUNTED
560 &AuraEffect::HandleAuraDisableGravity, //488 SPELL_AURA_DISABLE_GRAVITY
561 &AuraEffect::HandleModAlternativeDefaultLanguage, //489 SPELL_AURA_MOD_ALTERNATIVE_DEFAULT_LANGUAGE
563 &AuraEffect::HandleNoImmediateEffect, //491 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor
566 &AuraEffect::HandleNULL, //494 SPELL_AURA_SET_POWER_POINT_CHARGE
567 &AuraEffect::HandleTriggerSpellOnExpire, //495 SPELL_AURA_TRIGGER_SPELL_ON_EXPIRE
568 &AuraEffect::HandleNULL, //496 SPELL_AURA_ALLOW_CHANGING_EQUIPMENT_IN_TORGHAST
569 &AuraEffect::HandleNULL, //497 SPELL_AURA_MOD_ANIMA_GAIN
570 &AuraEffect::HandleNULL, //498 SPELL_AURA_CURRENCY_LOSS_PCT_ON_DEATH
571 &AuraEffect::HandleNULL, //499 SPELL_AURA_MOD_RESTED_XP_CONSUMPTION
572 &AuraEffect::HandleNoImmediateEffect, //500 SPELL_AURA_IGNORE_SPELL_CHARGE_COOLDOWN implemented in SpellHistory::ConsumeCharge
573 &AuraEffect::HandleNULL, //501 SPELL_AURA_MOD_CRITICAL_DAMAGE_TAKEN_FROM_CASTER
574 &AuraEffect::HandleNULL, //502 SPELL_AURA_MOD_VERSATILITY_DAMAGE_DONE_BENEFIT
575 &AuraEffect::HandleNULL, //503 SPELL_AURA_MOD_VERSATILITY_HEALING_DONE_BENEFIT
576 &AuraEffect::HandleNoImmediateEffect, //504 SPELL_AURA_MOD_HEALING_TAKEN_FROM_CASTER implemented in Unit::SpellHealingBonusTaken
577 &AuraEffect::HandleNULL, //505 SPELL_AURA_MOD_PLAYER_CHOICE_REROLLS
578 &AuraEffect::HandleDisableInertia, //506 SPELL_AURA_DISABLE_INERTIA
579 &AuraEffect::HandleNoImmediateEffect, //507 SPELL_AURA_MOD_DAMAGE_TAKEN_BY_LABEL implemented in Unit::SpellDamageBonusTaken
582 &AuraEffect::HandleNULL, //510 SPELL_AURA_MODIFIED_RAID_INSTANCE
583 &AuraEffect::HandleNULL, //511 SPELL_AURA_APPLY_PROFESSION_EFFECT
585 &AuraEffect::HandleAuraModAdvFlyingSpeed, //513 SPELL_AURA_MOD_ADV_FLYING_AIR_FRICTION
586 &AuraEffect::HandleAuraModAdvFlyingSpeed, //514 SPELL_AURA_MOD_ADV_FLYING_MAX_VEL
587 &AuraEffect::HandleAuraModAdvFlyingSpeed, //515 SPELL_AURA_MOD_ADV_FLYING_LIFT_COEF
590 &AuraEffect::HandleAuraModAdvFlyingSpeed, //518 SPELL_AURA_MOD_ADV_FLYING_ADD_IMPULSE_MAX_SPEED
591 &AuraEffect::HandleNULL, //519 SPELL_AURA_MOD_COOLDOWN_RECOVERY_RATE_ALL
592 &AuraEffect::HandleAuraModAdvFlyingSpeed, //520 SPELL_AURA_MOD_ADV_FLYING_BANKING_RATE
593 &AuraEffect::HandleAuraModAdvFlyingSpeed, //521 SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_DOWN
594 &AuraEffect::HandleAuraModAdvFlyingSpeed, //522 SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_UP
596 &AuraEffect::HandleAuraModAdvFlyingSpeed, //524 SPELL_AURA_MOD_ADV_FLYING_OVER_MAX_DECELERATION
597 &AuraEffect::HandleNULL, //525 SPELL_AURA_DISPLAY_PROFESSION_EQUIPMENT
600 &AuraEffect::HandleNULL, //528 SPELL_AURA_ALLOW_BLOCKING_SPELLS
601 &AuraEffect::HandleNULL, //529 SPELL_AURA_MOD_SPELL_BLOCK_CHANCE
605 &AuraEffect::HandleNULL, //533 SPELL_AURA_DISABLE_NAVIGATION
608 &AuraEffect::HandleNoImmediateEffect, //536 SPELL_AURA_IGNORE_SPELL_CREATURE_TYPE_REQUIREMENTS implemented in SpellInfo::CheckTargetCreatureType
609 &AuraEffect::HandleNoImmediateEffect, //537 SPELL_AURA_MOD_SPELL_DAMAGE_FROM_CASTER_BY_LABEL implemented in Unit::SpellDamageBonusTaken
610 &AuraEffect::HandleUnused, //538 SPELL_AURA_MOD_FAKE_INEBRIATION_MOVEMENT_ONLY handled clientside
611 &AuraEffect::HandleNoImmediateEffect, //539 SPELL_AURA_ALLOW_MOUNT_IN_COMBAT implemented in SpellInfo::CanBeUsedInCombat
612 &AuraEffect::HandleNULL, //540 SPELL_AURA_MOD_SUPPORT_STAT
613 &AuraEffect::HandleModRequiredMountCapabilityFlags, //541 SPELL_AURA_MOD_REQUIRED_MOUNT_CAPABILITY_FLAGS
614 &AuraEffect::HandleNULL, //542 SPELL_AURA_TRIGGER_SPELL_ON_STACK_AMOUNT
617 &AuraEffect::HandleSetCantSwim, //545 SPELL_AURA_MOVE_SET_CANT_SWIM
709 &AuraEffect::HandleNoImmediateEffect, //637 SPELL_AURA_MOD_EXPLORATION_EXPERIENCE implemented in Player::CheckAreaExplore
710 &AuraEffect::HandleNoImmediateEffect, //638 SPELL_AURA_MOD_CRITICAL_BLOCK_AMOUNT implemented in Unit::CalculateMeleeDamage andUnit::CalculateSpellDamageTaken
715 &AuraEffect::HandleNULL, //643 SPELL_AURA_MOD_RANGED_ATTACK_SPEED_FLAT
716 &AuraEffect::HandleNULL, //644 SPELL_AURA_MOD_GRAVITY
718 &AuraEffect::HandleNULL, //646 SPELL_AURA_ADD_FLAT_PVP_MODIFIER
719 &AuraEffect::HandleNULL, //647 SPELL_AURA_ADD_PCT_PVP_MODIFIER
720 &AuraEffect::HandleNULL, //648 SPELL_AURA_ADD_FLAT_PVP_MODIFIER_BY_SPELL_LABEL
721 &AuraEffect::HandleNULL, //649 SPELL_AURA_ADD_PCT_PVP_MODIFIER_BY_SPELL_LABEL
723 &AuraEffect::HandleNULL, //651 SPELL_AURA_ENABLE_EVENT_TRANSMOG_OUTFIT
727 &AuraEffect::HandleNULL, //655 SPELL_AURA_MOD_TRANSMOG_OUTFIT_UPDATE_COST
733 &AuraEffect::HandleNULL, //661 SPELL_AURA_ALTERED_FORM_IN_COMBAT
734};
735
736AuraEffect::AuraEffect(Aura* base, SpellEffectInfo const& spellEfffectInfo, SpellEffectValue const* baseAmount, Unit* caster) :
737m_base(base), m_spellInfo(base->GetSpellInfo()), m_effectInfo(spellEfffectInfo), m_spellmod(nullptr),
738m_baseAmount(baseAmount ? *baseAmount : spellEfffectInfo.CalcBaseValue(caster, base->GetType() == UNIT_AURA_TYPE ? base->GetOwner()->ToUnit() : nullptr, base->GetCastItemId(), base->GetCastItemLevel())),
739_amount(), _periodicTimer(0), _period(0), _ticksDone(0),
740m_canBeRecalculated(true), m_isPeriodic(false)
741{
742 CalculatePeriodic(caster, true, false);
743
744 _amount = CalculateAmount(caster);
745
747}
748
750{
751 delete m_spellmod;
752}
753
754template <typename Container>
755void AuraEffect::GetTargetList(Container& targetContainer) const
756{
757 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
758 // remove all targets which were not added to new list - they no longer deserve area aura
759 for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
760 {
761 if (appIter->second->HasEffect(GetEffIndex()))
762 targetContainer.push_back(appIter->second->GetTarget());
763 }
764}
765
766template <typename Container>
767void AuraEffect::GetApplicationList(Container& applicationContainer) const
768{
769 Aura::ApplicationMap const& targetMap = GetBase()->GetApplicationMap();
770 for (auto appIter = targetMap.begin(); appIter != targetMap.end(); ++appIter)
771 {
772 if (appIter->second->HasEffect(GetEffIndex()))
773 applicationContainer.push_back(appIter->second);
774 }
775}
776
778{
779 Unit* unitOwner = GetBase()->GetOwner()->ToUnit();
780
781 // default amount calculation
782 SpellEffectValue amount = GetSpellEffectInfo().CalcValue(caster, &m_baseAmount, unitOwner, nullptr, GetBase()->GetCastItemId(), GetBase()->GetCastItemLevel());
783
784 // custom amount calculations go here
785 switch (GetAuraType())
786 {
787 // crowd control auras
794 m_canBeRecalculated = false;
796 break;
797 amount = int32(unitOwner->CountPctFromMaxHealth(10));
798 break;
800 m_canBeRecalculated = false;
801 if (!caster || !unitOwner)
802 break;
803
804 amount = caster->SpellAbsorbBonusDone(unitOwner, m_spellInfo, amount, m_effectInfo, 1, this);
805 amount = unitOwner->SpellAbsorbBonusTaken(caster, m_spellInfo, amount);
806 break;
808 m_canBeRecalculated = false;
809 break;
811 {
812 uint32 mountType = uint32(GetMiscValueB());
813 if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId()))
814 mountType = mountEntry->MountTypeID;
815
816 if (MountCapabilityEntry const* mountCapability = unitOwner->GetMountCapability(mountType))
817 amount = mountCapability->ID;
818 break;
819 }
821 if (caster)
822 amount = caster->GetMap()->GetDifficultyID();
823 m_canBeRecalculated = false;
824 break;
825 default:
826 break;
827 }
828
829 if (GetSpellInfo()->HasAttribute(SPELL_ATTR10_ROLLING_PERIODIC))
830 {
831 Unit::AuraEffectList const& periodicAuras = unitOwner->GetAuraEffectsByType(GetAuraType());
832 if (uint32 totalTicks = GetTotalTicks())
833 {
834 amount = std::accumulate(std::begin(periodicAuras), std::end(periodicAuras), amount, [&](SpellEffectValue val, AuraEffect const* aurEff)
835 {
836 if (aurEff->GetCasterGUID() == GetCasterGUID() && aurEff->GetId() == GetId() && aurEff->GetEffIndex() == GetEffIndex())
837 val += aurEff->GetEstimatedAmount().value_or(aurEff->GetAmount()) * static_cast<float>(aurEff->GetRemainingTicks()) / static_cast<float>(totalTicks);
838 return val;
839 });
840 }
841 }
842
845 amount *= GetBase()->GetStackAmount();
846
847 switch (GetAuraType())
848 {
862 amount = std::round(amount);
863 break;
864 default:
865 break;
866 }
867
868 amount = std::clamp(amount, SpellEffectInfo::MinValue, SpellEffectInfo::MaxValue);
869
873
874 return amount;
875}
876
877Optional<SpellEffectValue> AuraEffect::CalculateEstimatedAmount(Unit const* caster, Unit* target, SpellInfo const* spellInfo, SpellEffectInfo const& spellEffectInfo,
878 SpellEffectValue amount, uint8 stack, AuraEffect const* aurEff)
879{
880 uint32 stackAmountForBonuses = !spellEffectInfo.EffectAttributes.HasFlag(SpellEffectAttributes::SuppressPointsStacking) ? stack : 1;
881
882 switch (spellEffectInfo.ApplyAuraName)
883 {
886 return caster->SpellDamageBonusDone(target, spellInfo, amount, DOT, spellEffectInfo, stackAmountForBonuses, nullptr, aurEff);
888 return caster->SpellHealingBonusDone(target, spellInfo, amount, DOT, spellEffectInfo, stackAmountForBonuses, nullptr, aurEff);
889 default:
890 break;
891 }
892
893 return {};
894}
895
897{
898 if (!caster || GetBase()->GetType() != UNIT_AURA_TYPE)
899 return {};
900
901 return CalculateEstimatedAmount(caster, GetBase()->GetUnitOwner(), GetSpellInfo(), GetSpellEffectInfo(), amount, GetBase()->GetStackAmount(), this);
902}
903
904SpellEffectValue AuraEffect::CalculateEstimatedfTotalPeriodicAmount(Unit const* caster, Unit* target, SpellInfo const* spellInfo, SpellEffectInfo const& spellEffectInfo,
905 SpellEffectValue amount, uint8 stack)
906{
907 int32 maxDuration = Aura::CalcMaxDuration(spellInfo, caster, nullptr);
908 if (maxDuration <= 0)
909 return 0.0;
910
911 int32 period = spellEffectInfo.ApplyAuraPeriod;
912 if (!period)
913 return 0.0;
914
915 if (Player* modOwner = caster->GetSpellModOwner())
916 modOwner->ApplySpellMod(spellInfo, SpellModOp::Period, period);
917
918 // Haste modifies periodic time of channeled spells
919 if (spellInfo->IsChanneled())
920 caster->ModSpellDurationTime(spellInfo, period);
922 period = int32(period * caster->m_unitData->ModCastingSpeed);
924 period = int32(period * caster->m_unitData->ModHaste);
925
926 if (!period)
927 return 0.0;
928
929 float totalTicks = float(maxDuration) / period;
931 totalTicks += 1.0f;
932
933 return totalTicks * CalculateEstimatedAmount(caster, target, spellInfo, spellEffectInfo, amount, stack, nullptr).value_or(amount);
934}
935
937{
938 uint32 totalTicks = 0;
939 if (_period && !GetBase()->IsPermanent())
940 {
941 totalTicks = static_cast<uint32>(GetBase()->GetMaxDuration() / _period);
943 ++totalTicks;
944 }
945
946 return totalTicks;
947}
948
949void AuraEffect::ResetPeriodic(bool resetPeriodicTimer /*= false*/)
950{
951 _ticksDone = 0;
952 if (resetPeriodicTimer)
953 {
954 _periodicTimer = 0;
955 // Start periodic on next tick or at aura apply
958 }
959}
960
961void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/)
962{
964
965 // prepare periodics
966 switch (GetAuraType())
967 {
982 m_isPeriodic = true;
983 break;
984 default:
985 break;
986 }
987
989
990 if (!m_isPeriodic)
991 return;
992
993 Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
994 // Apply casting time mods
995 if (_period)
996 {
997 // Apply periodic time mod
998 if (modOwner)
1000
1001 if (caster)
1002 {
1003 // Haste modifies periodic time of channeled spells
1004 if (m_spellInfo->IsChanneled())
1007 _period = int32(_period * caster->m_unitData->ModCastingSpeed);
1009 _period = int32(_period * caster->m_unitData->ModHaste);
1010 }
1011 }
1012 else // prevent infinite loop on Update
1013 m_isPeriodic = false;
1014
1015 if (load) // aura loaded from db
1016 {
1017 if (_period && !GetBase()->IsPermanent())
1018 {
1019 uint32 elapsedTime = GetBase()->GetMaxDuration() - GetBase()->GetDuration();
1020 _ticksDone = elapsedTime / uint32(_period);
1021 _periodicTimer = elapsedTime % uint32(_period);
1022 }
1023
1025 ++_ticksDone;
1026 }
1027 else // aura just created or reapplied
1028 {
1029 // reset periodic timer on aura create or reapply
1030 // we don't reset periodic timers when aura is triggered by proc
1031 ResetPeriodic(resetPeriodicTimer);
1032 }
1033}
1034
1036{
1037 switch (GetAuraType())
1038 {
1040 if (!m_spellmod)
1042 static_cast<SpellFlatModifierByClassMask*>(m_spellmod)->value = GetAmountAsInt();
1043 break;
1045 if (!m_spellmod)
1047 static_cast<SpellPctModifierByClassMask*>(m_spellmod)->value = GetAmount();
1048 break;
1050 if (!m_spellmod)
1052 static_cast<SpellFlatModifierByLabel*>(m_spellmod)->value.ModifierValue = GetAmountAsInt();
1053 break;
1055 if (!m_spellmod)
1057 static_cast<SpellPctModifierByLabel*>(m_spellmod)->value.ModifierValue = 1.0f + CalculatePct(1.0f, GetAmount());
1058 break;
1059 default:
1060 break;
1061 }
1063
1064 // validate modifier
1065 if (m_spellmod)
1066 {
1067 bool isValid = true;
1068 auto logErrors = [&] { return std::ranges::any_of(GetBase()->m_loadedScripts, [](AuraScript const* script) { return script->DoEffectCalcSpellMod.size() > 0; }); };
1070 {
1071 isValid = false;
1072 if (logErrors())
1073 TC_LOG_ERROR("spells.aura.effect", "Aura script for spell id {} created invalid spell modifier op {}", GetId(), AsUnderlyingType(m_spellmod->op));
1074 }
1075
1077 {
1078 isValid = false;
1079 if (logErrors())
1080 TC_LOG_ERROR("spells.aura.effect", "Aura script for spell id {} created invalid spell modifier type {}", GetId(), AsUnderlyingType(m_spellmod->type));
1081 }
1082
1083 if (!isValid)
1084 {
1085 delete m_spellmod;
1086 m_spellmod = nullptr;
1087 }
1088 }
1089}
1090
1091void AuraEffect::ChangeAmount(SpellEffectValue newAmount, bool mark, bool onStackOrReapply, AuraEffect const* triggeredBy /* = nullptr */)
1092{
1093 // Reapply if amount change
1094 uint8 handleMask = 0;
1095 if (newAmount != GetAmount())
1097 if (onStackOrReapply)
1098 handleMask |= AURA_EFFECT_HANDLE_REAPPLY;
1099
1100 if (!handleMask)
1101 return;
1102
1103 std::vector<AuraApplication*> effectApplications;
1104 GetApplicationList(effectApplications);
1105
1106 for (AuraApplication* aurApp : effectApplications)
1107 {
1108 aurApp->GetTarget()->_RegisterAuraEffect(this, false);
1109 HandleEffect(aurApp, handleMask, false, triggeredBy);
1110 }
1111
1112 if (handleMask & AURA_EFFECT_HANDLE_CHANGE_AMOUNT)
1113 {
1114 if (!mark)
1115 _amount = newAmount;
1116 else
1117 SetAmount(newAmount);
1119 }
1120
1121 for (AuraApplication* aurApp : effectApplications)
1122 {
1123 if (aurApp->GetRemoveMode() != AURA_REMOVE_NONE)
1124 continue;
1125
1126 aurApp->GetTarget()->_RegisterAuraEffect(this, true);
1127 HandleEffect(aurApp, handleMask, true, triggeredBy);
1128 }
1129
1132}
1133
1134void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply, AuraEffect const* triggeredBy /*= nullptr*/)
1135{
1136 // check if call is correct, we really don't want using bitmasks here (with 1 exception)
1140 || mode == AURA_EFFECT_HANDLE_STAT
1141 || mode == AURA_EFFECT_HANDLE_SKILL
1144
1145 // register/unregister effect in lists in case of real AuraEffect apply/remove
1146 // registration/unregistration is done always before real effect handling (some effect handlers code is depending on this)
1147 if (mode & AURA_EFFECT_HANDLE_REAL)
1148 aurApp->GetTarget()->_RegisterAuraEffect(this, apply);
1149
1150 // real aura apply/remove, handle modifier
1152 ApplySpellMod(aurApp->GetTarget(), apply, triggeredBy);
1153
1154 // call scripts helping/replacing effect handlers
1155 bool prevented = false;
1156 if (apply)
1157 prevented = GetBase()->CallScriptEffectApplyHandlers(this, aurApp, (AuraEffectHandleModes)mode);
1158 else
1159 prevented = GetBase()->CallScriptEffectRemoveHandlers(this, aurApp, (AuraEffectHandleModes)mode);
1160
1161 // check if script events have removed the aura already
1162 if (apply && aurApp->GetRemoveMode())
1163 return;
1164
1165 // call default effect handler if it wasn't prevented
1166 if (!prevented)
1167 (*this.*AuraEffectHandler[GetAuraType()].Value)(aurApp, mode, apply);
1168
1169 // check if the default handler reemoved the aura
1170 if (apply && aurApp->GetRemoveMode())
1171 return;
1172
1173 // call scripts triggering additional events after apply/remove
1174 if (apply)
1176 else
1178}
1179
1180void AuraEffect::HandleEffect(Unit* target, uint8 mode, bool apply, AuraEffect const* triggeredBy /*= nullptr*/)
1181{
1182 AuraApplication* aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
1183 ASSERT(aurApp);
1184 HandleEffect(aurApp, mode, apply, triggeredBy);
1185}
1186
1187void AuraEffect::ApplySpellMod(Unit* target, bool apply, AuraEffect const* triggeredBy /*= nullptr*/)
1188{
1189 if (!m_spellmod || target->GetTypeId() != TYPEID_PLAYER)
1190 return;
1191
1192 target->ToPlayer()->AddSpellMod(m_spellmod, apply);
1193
1194 // Auras with charges do not mod amount of passive auras
1195 if (GetBase()->IsUsingCharges())
1196 return;
1197
1198 // reapply some passive spells after add/remove related spellmods
1199 // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
1200 Optional<SpellEffIndex> recalculateEffectIndex;
1201 switch (SpellModOp(GetMiscValue()))
1202 {
1203 case SpellModOp::Points:
1204 break;
1206 recalculateEffectIndex = EFFECT_0;
1207 break;
1209 recalculateEffectIndex = EFFECT_1;
1210 break;
1212 recalculateEffectIndex = EFFECT_2;
1213 break;
1215 recalculateEffectIndex = EFFECT_3;
1216 break;
1218 recalculateEffectIndex = EFFECT_4;
1219 break;
1220 default:
1221 return;
1222 }
1223
1224 if (!triggeredBy)
1225 triggeredBy = this;
1226
1227 ObjectGuid guid = target->GetGUID();
1228 for (auto& [_, aurApp] : target->GetAppliedAuras())
1229 {
1230 Aura* aura = aurApp->GetBase();
1231 // only passive and permament auras-active auras should have amount set on spellcast and not be affected
1232 // if aura is cast by others, it will not be affected
1233 if ((!aura->IsPassive() && !aura->IsPermanent() && !GetSpellInfo()->IsUpdatingTemporaryAuraValuesBySpellMod())
1234 || aura->GetCasterGUID() != guid || !aura->GetSpellInfo()->IsAffectedBySpellMods() || !aura->GetSpellInfo()->IsAffectedBySpellMod(m_spellmod))
1235 continue;
1236
1237 if (recalculateEffectIndex)
1238 {
1239 if (AuraEffect* aurEff = aura->GetEffect(*recalculateEffectIndex))
1240 if (aurEff != triggeredBy)
1241 aurEff->RecalculateAmount(triggeredBy);
1242 }
1243 else
1244 for (AuraEffect* aurEff : aura->GetAuraEffects())
1245 if (aurEff != triggeredBy)
1246 aurEff->RecalculateAmount(triggeredBy);
1247 }
1248}
1249
1250void AuraEffect::Update(uint32 diff, Unit* caster)
1251{
1252 if (!m_isPeriodic || (GetBase()->GetDuration() < 0 && !GetBase()->IsPassive() && !GetBase()->IsPermanent()))
1253 return;
1254
1255 uint32 totalTicks = GetTotalTicks();
1256
1257 _periodicTimer += diff;
1258 while (_periodicTimer >= _period)
1259 {
1261
1262 if (!GetBase()->IsPermanent() && (_ticksDone + 1) > totalTicks)
1263 break;
1264
1265 ++_ticksDone;
1266
1268
1269 std::vector<AuraApplication*> effectApplications;
1270 GetApplicationList(effectApplications);
1271
1272 // tick on targets of effects
1273 for (AuraApplication* aurApp : effectApplications)
1274 PeriodicTick(aurApp, caster);
1275 }
1276}
1277
1278float AuraEffect::GetCritChanceFor(Unit const* caster, Unit const* target) const
1279{
1280 return target->SpellCritChanceTaken(caster, nullptr, this, GetSpellInfo()->GetSchoolMask(), CalcPeriodicCritChance(caster), GetSpellInfo()->GetAttackType());
1281}
1282
1284{
1285 if (!spell)
1286 return false;
1287
1288 // Check family name and EffectClassMask
1289 if (!spell->IsAffected(m_spellInfo->SpellFamilyName, GetSpellEffectInfo().SpellClassMask))
1290 return false;
1291
1292 return true;
1293}
1294
1295void AuraEffect::SendTickImmune(Unit* target, Unit* caster) const
1296{
1297 if (caster)
1298 caster->SendSpellDamageImmune(target, m_spellInfo->Id, true);
1299}
1300
1302{
1303 bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp);
1304 if (prevented)
1305 return;
1306
1307 Unit* target = aurApp->GetTarget();
1308
1309 // Update serverside orientation of tracking channeled auras on periodic update ticks
1310 // exclude players because can turn during channeling and shouldn't desync orientation client/server
1311 if (caster && !caster->IsPlayer() && m_spellInfo->IsChanneled() && m_spellInfo->HasAttribute(SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL) && caster->m_unitData->ChannelObjects.size())
1312 {
1313 ObjectGuid const channelGuid = caster->m_unitData->ChannelObjects[0];
1314 if (channelGuid != caster->GetGUID())
1315 if (WorldObject const* objectTarget = ObjectAccessor::GetWorldObject(*caster, channelGuid))
1316 caster->SetInFront(objectTarget);
1317 }
1318
1319 switch (GetAuraType())
1320 {
1322 // handled via scripts
1323 break;
1325 HandlePeriodicTriggerSpellAuraTick(target, caster);
1326 break;
1328 // Don't actually do anything - client will trigger casts of these spells by itself
1329 break;
1332 break;
1336 HandlePeriodicDamageAurasTick(target, caster);
1337 break;
1339 HandlePeriodicHealthLeechAuraTick(target, caster);
1340 break;
1342 HandlePeriodicHealthFunnelAuraTick(target, caster);
1343 break;
1346 HandlePeriodicHealAurasTick(target, caster);
1347 break;
1349 HandlePeriodicManaLeechAuraTick(target, caster);
1350 break;
1352 HandleObsModPowerAuraTick(target, caster);
1353 break;
1355 HandlePeriodicEnergizeAuraTick(target, caster);
1356 break;
1358 HandlePeriodicPowerBurnAuraTick(target, caster);
1359 break;
1360 default:
1361 break;
1362 }
1363}
1364
1366{
1367 bool result = GetBase()->CallScriptCheckEffectProcHandlers(this, aurApp, eventInfo);
1368 if (!result)
1369 return false;
1370
1371 SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
1372 switch (GetAuraType())
1373 {
1379 {
1380 DamageInfo* damageInfo = eventInfo.GetDamageInfo();
1381 if (!damageInfo || !damageInfo->GetDamage())
1382 return false;
1383
1384 // Spell own damage at apply won't break CC
1385 if (spellInfo && spellInfo == GetSpellInfo())
1386 {
1387 Aura* aura = GetBase();
1388 // called from spellcast, should not have ticked yet
1389 if (aura->GetDuration() == aura->GetMaxDuration())
1390 return false;
1391 }
1392 break;
1393 }
1396 // compare mechanic
1397 if (!spellInfo || !(spellInfo->GetAllEffectsMechanicMask() & (UI64LIT(1) << GetMiscValue())))
1398 return false;
1399 break;
1401 // skip melee hits and instant cast spells
1402 if (!eventInfo.GetProcSpell() || !eventInfo.GetProcSpell()->GetCastTime())
1403 return false;
1404 break;
1407 // Compare casters
1408 if (GetCasterGUID() != eventInfo.GetActor()->GetGUID())
1409 return false;
1410 break;
1413 {
1414 // Skip melee hits and spells with wrong school or zero cost
1415 if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue()) // School Check
1416 || !eventInfo.GetProcSpell())
1417 return false;
1418
1419 // Costs Check
1420 std::vector<SpellPowerCost> const& costs = eventInfo.GetProcSpell()->GetPowerCost();
1421 if (std::ranges::none_of(costs, [](SpellPowerCost const& cost) { return cost.Amount > 0; }))
1422 return false;
1423 break;
1424 }
1426 // Skip melee hits and spells with wrong school
1427 if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue()))
1428 return false;
1429 break;
1432 {
1433 // Don't proc extra attacks while already processing extra attack spell
1434 uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
1435 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
1436 {
1437 if (triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
1438 {
1439 uint32 lastExtraAttackSpell = eventInfo.GetActor()->GetLastExtraAttackSpell();
1440
1441 // Patch 1.12.0(?) extra attack abilities can no longer chain proc themselves
1442 if (lastExtraAttackSpell == triggerSpellId)
1443 return false;
1444 }
1445 }
1446 break;
1447 }
1449 // skip spells that can't crit
1450 if (!spellInfo || !spellInfo->HasAttribute(SPELL_ATTR0_CU_CAN_CRIT))
1451 return false;
1452 break;
1453 default:
1454 break;
1455 }
1456
1457 return result;
1458}
1459
1461{
1462 bool prevented = GetBase()->CallScriptEffectProcHandlers(this, aurApp, eventInfo);
1463 if (prevented)
1464 return;
1465
1466 switch (GetAuraType())
1467 {
1468 // CC Auras which use their amount to drop
1469 // Are there any more auras which need this?
1476 HandleBreakableCCAuraProc(aurApp, eventInfo);
1477 break;
1478 case SPELL_AURA_DUMMY:
1480 HandleProcTriggerSpellAuraProc(aurApp, eventInfo);
1481 break;
1483 HandleProcTriggerSpellWithValueAuraProc(aurApp, eventInfo);
1484 break;
1486 HandleProcTriggerDamageAuraProc(aurApp, eventInfo);
1487 break;
1488 default:
1489 break;
1490 }
1491
1492 GetBase()->CallScriptAfterEffectProcHandlers(this, aurApp, eventInfo);
1493}
1494
1495void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
1496{
1497 uint32 spellId = 0;
1498 uint32 spellId2 = 0;
1499 uint32 spellId3 = 0;
1500 uint32 spellId4 = 0;
1501
1502 switch (GetMiscValue())
1503 {
1504 case FORM_CAT_FORM:
1505 spellId = 3025;
1506 spellId2 = 48629;
1507 spellId3 = 106840;
1508 spellId4 = 113636;
1509 break;
1510 case FORM_TREE_OF_LIFE:
1511 spellId = 5420;
1512 spellId2 = 81097;
1513 break;
1514 case FORM_TRAVEL_FORM:
1515 spellId = 5419;
1516 break;
1517 case FORM_AQUATIC_FORM:
1518 spellId = 5421;
1519 break;
1520 case FORM_BEAR_FORM:
1522 spellId = 1178;
1523 spellId2 = 21178;
1524 spellId3 = 106829;
1525 spellId4 = 106899;
1526 break;
1527 case FORM_FLIGHT_FORM:
1528 spellId = 33948;
1529 spellId2 = 34764;
1530 break;
1532 spellId = 40122;
1533 spellId2 = 40121;
1534 break;
1536 spellId = 27792;
1537 spellId2 = 27795;
1538 spellId3 = 62371;
1539 break;
1540 case FORM_SHADOWFORM:
1541 if (target->HasAura(107906)) // Glyph of Shadow
1542 spellId = 107904;
1543 else if (target->HasAura(126745)) // Glyph of Shadowy Friends
1544 spellId = 142024;
1545 else
1546 spellId = 107903;
1547 break;
1548 case FORM_GHOST_WOLF:
1549 if (target->HasAura(58135)) // Glyph of Spectral Wolf
1550 spellId = 160942;
1551 break;
1552 case FORM_GHOUL:
1553 case FORM_AMBIENT:
1554 case FORM_STEALTH:
1555 case FORM_BATTLE_STANCE:
1558 case FORM_MOONKIN_FORM:
1559 case FORM_METAMORPHOSIS:
1560 break;
1561 default:
1562 break;
1563 }
1564
1565 if (apply)
1566 {
1567 if (spellId)
1568 target->CastSpell(target, spellId, this);
1569
1570 if (spellId2)
1571 target->CastSpell(target, spellId2, this);
1572
1573 if (spellId3)
1574 target->CastSpell(target, spellId3, this);
1575
1576 if (spellId4)
1577 target->CastSpell(target, spellId4, this);
1578
1579 if (target->GetTypeId() == TYPEID_PLAYER)
1580 {
1581 Player* plrTarget = target->ToPlayer();
1582
1583 PlayerSpellMap const& sp_list = plrTarget->GetSpellMap();
1584 for (auto itr = sp_list.begin(); itr != sp_list.end(); ++itr)
1585 {
1586 if (itr->second.state == PLAYERSPELL_REMOVED || itr->second.disabled)
1587 continue;
1588
1589 if (itr->first == spellId || itr->first == spellId2 || itr->first == spellId3 || itr->first == spellId4)
1590 continue;
1591
1592 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first, DIFFICULTY_NONE);
1593 if (!spellInfo || !(spellInfo->IsPassive() || spellInfo->HasAttribute(SPELL_ATTR0_DO_NOT_DISPLAY_SPELLBOOK_AURA_ICON_COMBAT_LOG)))
1594 continue;
1595
1596 if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
1597 target->CastSpell(target, itr->first, this);
1598 }
1599 }
1600 }
1601 else
1602 {
1603 if (spellId)
1604 target->RemoveOwnedAura(spellId, target->GetGUID());
1605 if (spellId2)
1606 target->RemoveOwnedAura(spellId2, target->GetGUID());
1607 if (spellId3)
1608 target->RemoveOwnedAura(spellId3, target->GetGUID());
1609 if (spellId4)
1610 target->RemoveOwnedAura(spellId4, target->GetGUID());
1611
1613 AuraEffect const* newAura = nullptr;
1614 // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied
1615 for (AuraEffect const* aurEff : shapeshifts)
1616 {
1617 if (aurEff != this)
1618 {
1619 newAura = aurEff;
1620 break;
1621 }
1622 }
1623
1624 Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras();
1625 for (auto itr = tAuras.begin(); itr != tAuras.end();)
1626 {
1627 // Use the new aura to see on what stance the target will be
1628 uint64 newStance = newAura ? (UI64LIT(1) << (newAura->GetMiscValue() - 1)) : 0;
1629
1630 // If the stances are not compatible with the spell, remove it
1631 if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance))
1632 target->RemoveAura(itr);
1633 else
1634 ++itr;
1635 }
1636 }
1637}
1638
1639/*********************************************************/
1640/*** AURA EFFECT HANDLERS ***/
1641/*********************************************************/
1642
1643/**************************************/
1644/*** VISIBILITY & PHASES ***/
1645/**************************************/
1646
1647void AuraEffect::HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const
1648{
1650 return;
1651
1652 Unit* target = aurApp->GetTarget();
1654
1655 if (apply)
1656 {
1657 target->m_invisibilityDetect.AddFlag(type);
1659 }
1660 else
1661 {
1663 target->m_invisibilityDetect.DelFlag(type);
1664
1666 }
1667
1668 // call functions which may have additional effects after changing state of unit
1669 if (target->IsInWorld())
1670 target->UpdateObjectVisibility();
1671}
1672
1673void AuraEffect::HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const
1674{
1676 return;
1677
1678 Unit* target = aurApp->GetTarget();
1680
1681 if (apply)
1682 {
1683 // apply glow vision
1684 if (type == INVISIBILITY_GENERAL)
1685 if (Player* playerTarget = target->ToPlayer())
1686 playerTarget->AddAuraVision(PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
1687
1688 target->m_invisibility.AddFlag(type);
1689 target->m_invisibility.AddValue(type, GetAmountAsInt());
1690
1692 }
1693 else
1694 {
1696 {
1697 // if not have invisibility auras of type INVISIBILITY_GENERAL
1698 // remove glow vision
1699 if (type == INVISIBILITY_GENERAL)
1700 if (Player* playerTarget = target->ToPlayer())
1701 playerTarget->RemoveAuraVision(PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW);
1702
1703 target->m_invisibility.DelFlag(type);
1704 }
1705
1708
1709 target->m_invisibility.AddValue(type, -GetAmountAsInt());
1710 }
1711
1712 // call functions which may have additional effects after changing state of unit
1713 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1714 {
1715 // drop flag at invisibiliy in bg
1717 }
1718
1719 if (target->IsInWorld())
1720 target->UpdateObjectVisibility();
1721}
1722
1723void AuraEffect::HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const
1724{
1726 return;
1727
1728 Unit* target = aurApp->GetTarget();
1730
1731 if (apply)
1732 {
1733 target->m_stealthDetect.AddFlag(type);
1734 target->m_stealthDetect.AddValue(type, GetAmountAsInt());
1735 }
1736 else
1737 {
1739 target->m_stealthDetect.DelFlag(type);
1740
1741 target->m_stealthDetect.AddValue(type, -GetAmountAsInt());
1742 }
1743
1744 // call functions which may have additional effects after changing state of unit
1745 if (target->IsInWorld())
1746 target->UpdateObjectVisibility();
1747}
1748
1749void AuraEffect::HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const
1750{
1752 return;
1753
1754 Unit* target = aurApp->GetTarget();
1756
1757 if (apply)
1758 {
1759 target->m_stealth.AddFlag(type);
1760 target->m_stealth.AddValue(type, GetAmountAsInt());
1761
1763 if (Player * playerTarget = target->ToPlayer())
1764 playerTarget->AddAuraVision(PLAYER_FIELD_BYTE2_STEALTH);
1765 }
1766 else
1767 {
1768 target->m_stealth.AddValue(type, -GetAmountAsInt());
1769
1770 if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH)) // if last SPELL_AURA_MOD_STEALTH
1771 {
1772 target->m_stealth.DelFlag(type);
1773
1775 if (Player * playerTarget = target->ToPlayer())
1776 playerTarget->RemoveAuraVision(PLAYER_FIELD_BYTE2_STEALTH);
1777 }
1778 }
1779
1780 // call functions which may have additional effects after changing state of unit
1781 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
1782 {
1783 // drop flag at stealth in bg
1785 }
1786
1787 if (target->IsInWorld())
1788 target->UpdateObjectVisibility();
1789}
1790
1791void AuraEffect::HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const
1792{
1794 return;
1795
1796 Unit* target = aurApp->GetTarget();
1798
1799 if (apply)
1800 target->m_stealth.AddValue(type, GetAmountAsInt());
1801 else
1802 target->m_stealth.AddValue(type, -GetAmountAsInt());
1803
1804 // call functions which may have additional effects after changing state of unit
1805 if (target->IsInWorld())
1806 target->UpdateObjectVisibility();
1807}
1808
1809void AuraEffect::HandleDetectAmore(AuraApplication const* aurApp, uint8 mode, bool apply) const
1810{
1812 return;
1813
1814 Unit* target = aurApp->GetTarget();
1815
1816 if (target->GetTypeId() != TYPEID_PLAYER)
1817 return;
1818
1819 if (apply)
1820 {
1821 if (Player* playerTarget = target->ToPlayer())
1822 {
1823 playerTarget->AddAuraVision(PlayerFieldByte2Flags(1 << (GetMiscValue() - 1)));
1824 }
1825 }
1826 else
1827 {
1829 {
1831 for (Unit::AuraEffectList::const_iterator i = amoreAuras.begin(); i != amoreAuras.end(); ++i)
1832 {
1833 if (GetMiscValue() == (*i)->GetMiscValue())
1834 return;
1835 }
1836 }
1837
1838 if (Player* playerTarget = target->ToPlayer())
1839 playerTarget->RemoveAuraVision(PlayerFieldByte2Flags(1 << (GetMiscValue() - 1)));
1840 }
1841}
1842
1843void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const
1844{
1845 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1846 return;
1847
1848 Unit* target = aurApp->GetTarget();
1849
1850 if (target->GetTypeId() != TYPEID_PLAYER)
1851 return;
1852
1853 // prepare spirit state
1854 if (apply)
1855 {
1856 if (target->GetTypeId() == TYPEID_PLAYER)
1857 {
1858 // set stand state (expected in this form)
1859 if (!target->IsStandState())
1861 }
1862 }
1863 // die at aura end
1864 else if (target->IsAlive())
1865 // call functions which may have additional effects after changing state of unit
1866 target->setDeathState(JUST_DIED);
1867}
1868
1869void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const
1870{
1872 return;
1873
1874 Player* target = aurApp->GetTarget()->ToPlayer();
1875 if (!target)
1876 return;
1877
1878 if (apply)
1879 {
1883 }
1884 else
1885 {
1886 if (target->HasAuraType(SPELL_AURA_GHOST))
1887 return;
1888
1892 }
1893}
1894
1895void AuraEffect::HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const
1896{
1897 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1898 return;
1899
1900 Unit* target = aurApp->GetTarget();
1901
1902 if (apply)
1904 else
1906}
1907
1908void AuraEffect::HandlePhaseGroup(AuraApplication const* aurApp, uint8 mode, bool apply) const
1909{
1910 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1911 return;
1912
1913 Unit* target = aurApp->GetTarget();
1914
1915 if (apply)
1917 else
1919}
1920
1921void AuraEffect::HandlePhaseAlwaysVisible(AuraApplication const* aurApp, uint8 mode, bool apply) const
1922{
1923 if (!(mode & AURA_EFFECT_HANDLE_REAL))
1924 return;
1925
1926 Unit* target = aurApp->GetTarget();
1927
1928 if (!apply)
1929 PhasingHandler::SetAlwaysVisible(target, true, true);
1930 else
1931 {
1932 if (target->HasAuraType(SPELL_AURA_PHASE_ALWAYS_VISIBLE) || (target->IsPlayer() && target->ToPlayer()->IsGameMaster()))
1933 return;
1934
1935 PhasingHandler::SetAlwaysVisible(target, false, true);
1936 }
1937}
1938
1939/**********************/
1940/*** UNIT MODEL ***/
1941/**********************/
1942
1943void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const
1944{
1946 return;
1947
1948 SpellShapeshiftFormEntry const* shapeInfo = sSpellShapeshiftFormStore.LookupEntry(GetMiscValue());
1949 ASSERT(shapeInfo, "Spell %u uses unknown ShapeshiftForm (%u).", GetId(), GetMiscValue());
1950
1951 Unit* target = aurApp->GetTarget();
1952
1954 uint32 modelid = target->GetModelForForm(form, GetId());
1955
1956 if (apply)
1957 {
1958 // remove polymorph before changing display id to keep new display id
1959 switch (form)
1960 {
1961 case FORM_CAT_FORM:
1962 case FORM_TREE_OF_LIFE:
1963 case FORM_TRAVEL_FORM:
1964 case FORM_AQUATIC_FORM:
1965 case FORM_BEAR_FORM:
1968 case FORM_FLIGHT_FORM:
1969 case FORM_MOONKIN_FORM:
1970 {
1971 // remove movement affects
1972 target->RemoveAurasByShapeShift();
1973
1974 // and polymorphic affects
1975 if (target->IsPolymorphed())
1976 target->RemoveAurasDueToSpell(target->GetTransformSpell());
1977 break;
1978 }
1979 default:
1980 break;
1981 }
1982
1983 // remove other shapeshift before applying a new one
1985
1986 // stop handling the effect if it was removed by linked event
1987 if (aurApp->GetRemoveMode())
1988 return;
1989
1990 ShapeshiftForm prevForm = target->GetShapeshiftForm();
1991 target->SetShapeshiftForm(form);
1992 // add the shapeshift aura's boosts
1993 if (prevForm != form)
1994 HandleShapeshiftBoosts(target, true);
1995
1996 if (modelid > 0)
1997 {
1998 SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->GetTransformSpell(), GetBase()->GetCastDifficulty());
1999 if (!transformSpellInfo || !GetSpellInfo()->IsPositive())
2000 target->SetDisplayId(modelid);
2001 }
2002
2003 if (!shapeInfo->GetFlags().HasFlag(SpellShapeshiftFormFlags::Stance))
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 // Remove movement impairing effects also when shifting out
2016 target->RemoveAurasByShapeShift();
2017 }
2018 }
2019
2020 if (modelid > 0)
2021 target->RestoreDisplayId(target->IsMounted());
2022
2023 switch (form)
2024 {
2025 // Nordrassil Harness - bonus
2026 case FORM_BEAR_FORM:
2028 case FORM_CAT_FORM:
2029 if (AuraEffect* dummy = target->GetAuraEffect(37315, 0))
2030 target->CastSpell(target, 37316, dummy);
2031 break;
2032 // Nordrassil Regalia - bonus
2033 case FORM_MOONKIN_FORM:
2034 if (AuraEffect* dummy = target->GetAuraEffect(37324, 0))
2035 target->CastSpell(target, 37325, dummy);
2036 break;
2037 default:
2038 break;
2039 }
2040
2041 // remove the shapeshift aura's boosts
2042 HandleShapeshiftBoosts(target, false);
2043 }
2044
2045 if (Player* playerTarget = target->ToPlayer())
2046 {
2047 playerTarget->SendMovementSetCollisionHeight(playerTarget->GetCollisionHeight(), WorldPackets::Movement::UpdateCollisionHeightReason::Force);
2048 playerTarget->InitDataForForm();
2049 }
2050 else
2051 target->UpdateDisplayPower();
2052
2053 if (target->GetClass() == CLASS_DRUID)
2054 {
2055 // Dash
2057 aurEff->RecalculateAmount();
2058
2059 // Disarm handling
2060 // If druid shifts while being disarmed we need to deal with that since forms aren't affected by disarm
2061 // and also HandleAuraModDisarm is not triggered
2062 if (!target->CanUseAttackType(BASE_ATTACK))
2063 {
2065 target->ToPlayer()->_ApplyWeaponDamage(EQUIPMENT_SLOT_MAINHAND, pItem, apply);
2066 }
2067 }
2068
2069 // stop handling the effect if it was removed by linked event
2070 if (apply && aurApp->GetRemoveMode())
2071 return;
2072
2073 if (target->GetTypeId() == TYPEID_PLAYER)
2074 {
2075 // Learn spells for shapeshift form - no need to send action bars or add spells to spellbook
2076 for (uint8 i = 0; i < MAX_SHAPESHIFT_SPELLS; ++i)
2077 {
2078 if (!shapeInfo->PresetSpellID[i])
2079 continue;
2080 if (apply)
2081 target->ToPlayer()->AddTemporarySpell(shapeInfo->PresetSpellID[i]);
2082 else
2083 target->ToPlayer()->RemoveTemporarySpell(shapeInfo->PresetSpellID[i]);
2084 }
2085 }
2086}
2087
2088void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const
2089{
2091 return;
2092
2093 Unit* target = aurApp->GetTarget();
2094
2095 if (apply)
2096 {
2097 // update active transform spell only when transform not set or not overwriting negative by positive case
2098 SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->GetTransformSpell(), GetBase()->GetCastDifficulty());
2099 if (!transformSpellInfo || !GetSpellInfo()->IsPositive() || transformSpellInfo->IsPositive())
2100 {
2101 target->SetTransformSpell(GetId());
2102 // special case (spell specific functionality)
2103 if (GetMiscValue() == 0)
2104 {
2105 Gender gender = target->GetNativeGender();
2106 switch (GetId())
2107 {
2108 // Orb of Deception
2109 case 16739:
2110 {
2111 if (target->GetTypeId() != TYPEID_PLAYER)
2112 return;
2113
2114 switch (target->GetRace())
2115 {
2116 // Blood Elf
2117 case RACE_BLOODELF:
2118 target->SetDisplayId(gender == GENDER_FEMALE ? 17830 : 17829);
2119 break;
2120 // Orc
2121 case RACE_ORC:
2122 target->SetDisplayId(gender == GENDER_FEMALE ? 10140 : 10139);
2123 break;
2124 // Troll
2125 case RACE_TROLL:
2126 target->SetDisplayId(gender == GENDER_FEMALE ? 10134 : 10135);
2127 break;
2128 // Tauren
2129 case RACE_TAUREN:
2130 target->SetDisplayId(gender == GENDER_FEMALE ? 10147 : 10136);
2131 break;
2132 // Undead
2133 case RACE_UNDEAD_PLAYER:
2134 target->SetDisplayId(gender == GENDER_FEMALE ? 10145 : 10146);
2135 break;
2136 // Draenei
2137 case RACE_DRAENEI:
2138 target->SetDisplayId(gender == GENDER_FEMALE ? 17828 : 17827);
2139 break;
2140 // Dwarf
2141 case RACE_DWARF:
2142 target->SetDisplayId(gender == GENDER_FEMALE ? 10142 : 10141);
2143 break;
2144 // Gnome
2145 case RACE_GNOME:
2146 target->SetDisplayId(gender == GENDER_FEMALE ? 10149 : 10148);
2147 break;
2148 // Human
2149 case RACE_HUMAN:
2150 target->SetDisplayId(gender == GENDER_FEMALE ? 10138 : 10137);
2151 break;
2152 // Night Elf
2153 case RACE_NIGHTELF:
2154 target->SetDisplayId(gender == GENDER_FEMALE ? 10144 : 10143);
2155 break;
2156 default:
2157 break;
2158 }
2159 break;
2160 }
2161 // Murloc costume
2162 case 42365:
2163 target->SetDisplayId(21723);
2164 break;
2165 // Dread Corsair
2166 case 50517:
2167 // Corsair Costume
2168 case 51926:
2169 {
2170 if (target->GetTypeId() != TYPEID_PLAYER)
2171 return;
2172
2173 switch (target->GetRace())
2174 {
2175 // Blood Elf
2176 case RACE_BLOODELF:
2177 target->SetDisplayId(gender == GENDER_MALE ? 25032 : 25043);
2178 break;
2179 // Orc
2180 case RACE_ORC:
2181 target->SetDisplayId(gender == GENDER_MALE ? 25039 : 25050);
2182 break;
2183 // Troll
2184 case RACE_TROLL:
2185 target->SetDisplayId(gender == GENDER_MALE ? 25041 : 25052);
2186 break;
2187 // Tauren
2188 case RACE_TAUREN:
2189 target->SetDisplayId(gender == GENDER_MALE ? 25040 : 25051);
2190 break;
2191 // Undead
2192 case RACE_UNDEAD_PLAYER:
2193 target->SetDisplayId(gender == GENDER_MALE ? 25042 : 25053);
2194 break;
2195 // Draenei
2196 case RACE_DRAENEI:
2197 target->SetDisplayId(gender == GENDER_MALE ? 25033 : 25044);
2198 break;
2199 // Dwarf
2200 case RACE_DWARF:
2201 target->SetDisplayId(gender == GENDER_MALE ? 25034 : 25045);
2202 break;
2203 // Gnome
2204 case RACE_GNOME:
2205 target->SetDisplayId(gender == GENDER_MALE ? 25035 : 25046);
2206 break;
2207 // Human
2208 case RACE_HUMAN:
2209 target->SetDisplayId(gender == GENDER_MALE ? 25037 : 25048);
2210 break;
2211 // Night Elf
2212 case RACE_NIGHTELF:
2213 target->SetDisplayId(gender == GENDER_MALE ? 25038 : 25049);
2214 break;
2215 default:
2216 break;
2217 }
2218 break;
2219 }
2220 // Pygmy Oil
2221 case 53806:
2222 target->SetDisplayId(22512);
2223 break;
2224 // Honor the Dead
2225 case 65386:
2226 case 65495:
2227 target->SetDisplayId(gender == GENDER_MALE ? 29203 : 29204);
2228 break;
2229 // Darkspear Pride
2230 case 75532:
2231 target->SetDisplayId(gender == GENDER_MALE ? 31737 : 31738);
2232 break;
2233 // Gnomeregan Pride
2234 case 75531:
2235 target->SetDisplayId(gender == GENDER_MALE ? 31654 : 31655);
2236 break;
2237 default:
2238 break;
2239 }
2240 }
2241 else
2242 {
2243 CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(GetMiscValue());
2244 if (!ci)
2245 {
2246 target->SetDisplayId(16358); // pig pink ^_^
2247 TC_LOG_ERROR("spells.aura.effect", "Auras: unknown creature id = {} (only need its modelid) From Spell Aura Transform in Spell ID = {}", GetMiscValue(), GetId());
2248 }
2249 else
2250 {
2251 uint32 model_id = 0;
2252
2253 // choose a model, based on trigger flag
2254 if (uint32 modelid = ObjectMgr::ChooseDisplayId(ci)->CreatureDisplayID)
2255 model_id = modelid;
2256
2257 target->SetDisplayId(model_id);
2258
2259 // Dragonmaw Illusion (set mount model also)
2260 if (GetId() == 42016 && target->GetMountDisplayId() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty())
2261 target->SetMountDisplayId(16314);
2262 }
2263 }
2264 }
2265
2266 // polymorph case
2267 if ((mode & AURA_EFFECT_HANDLE_REAL) && target->GetTypeId() == TYPEID_PLAYER && target->IsPolymorphed())
2268 {
2269 // for players, start regeneration after 1s (in polymorph fast regeneration case)
2270 // only if caster is Player (after patch 2.4.2)
2271 if (GetCasterGUID().IsPlayer())
2273
2274 //dismount polymorphed target (after patch 2.4.2)
2275 if (target->IsMounted())
2277 }
2278
2280 }
2281 else
2282 {
2283 // HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
2284 if (target->GetTransformSpell() == GetId())
2285 target->SetTransformSpell(0);
2286
2287 target->RestoreDisplayId(target->IsMounted());
2288
2289 // Dragonmaw Illusion (restore mount model)
2290 if (GetId() == 42016 && target->GetMountDisplayId() == 16314)
2291 {
2292 if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
2293 {
2294 uint32 cr_id = target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).front()->GetMiscValue();
2295 if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(cr_id))
2296 {
2298 sObjectMgr->GetCreatureModelRandomGender(&model, ci);
2299
2300 target->SetMountDisplayId(model.CreatureDisplayID);
2301 }
2302 }
2303 }
2304 }
2305}
2306
2307void AuraEffect::HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
2308{
2310 return;
2311
2312 aurApp->GetTarget()->RecalculateObjectScale();
2313}
2314
2315void AuraEffect::HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const
2316{
2318 return;
2319
2320 Unit* target = aurApp->GetTarget();
2321
2322 if (apply)
2323 {
2324 Unit* caster = GetCaster();
2325 if (!caster || caster == target)
2326 return;
2327
2328 // What must be cloned? at least display and scale
2329 target->SetDisplayId(caster->GetDisplayId());
2330 //target->SetObjectScale(caster->GetObjectScale()); // we need retail info about how scaling is handled (aura maybe?)
2332 }
2333 else
2334 {
2335 target->SetDisplayId(target->GetNativeDisplayId());
2337 }
2338}
2339
2340/************************/
2341/*** FIGHT ***/
2342/************************/
2343
2344void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const
2345{
2346 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2347 return;
2348
2349 Unit* target = aurApp->GetTarget();
2350
2351 if (apply)
2352 {
2353 auto isAffectedByFeignDeath = [](Unit const* attacker)
2354 {
2355 Creature const* attackerCreature = attacker->ToCreature();
2356 return !attackerCreature || !attackerCreature->IsIgnoringFeignDeath();
2357 };
2358
2359 std::vector<Unit*> targets;
2360 Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetMap()->GetVisibilityRange());
2361 Trinity::UnitListSearcher searcher(target, targets, u_check);
2362 Cell::VisitAllObjects(target, searcher, target->GetMap()->GetVisibilityRange());
2363 for (Unit* unit : targets)
2364 {
2365 if (!unit->HasUnitState(UNIT_STATE_CASTING))
2366 continue;
2367
2368 if (!isAffectedByFeignDeath(unit))
2369 continue;
2370
2372 {
2373 if (unit->GetCurrentSpell(i)
2374 && unit->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
2375 {
2376 unit->InterruptSpell(CurrentSpellTypes(i), false);
2377 }
2378 }
2379 }
2380
2381 for (auto const& [guid, ref] : target->GetThreatManager().GetThreatenedByMeList())
2382 if (isAffectedByFeignDeath(ref->GetOwner()))
2383 ref->ScaleThreat(0.0f);
2384
2385 if (target->GetMap()->IsDungeon()) // feign death does not remove combat in dungeons
2386 {
2387 target->AttackStop();
2388 if (Player* targetPlayer = target->ToPlayer())
2389 targetPlayer->SendAttackSwingCancelAttack();
2390 }
2391 else
2392 target->CombatStop(false, false, isAffectedByFeignDeath);
2393
2394 // prevent interrupt message
2395 if (GetCasterGUID() == target->GetGUID() && target->GetCurrentSpell(CURRENT_GENERIC_SPELL))
2397 target->InterruptNonMeleeSpells(true);
2398
2399 // stop handling the effect if it was removed by linked event
2400 if (aurApp->GetRemoveMode())
2401 return;
2402
2407
2408 if (Creature* creature = target->ToCreature())
2409 creature->SetReactState(REACT_PASSIVE);
2410 }
2411 else
2412 {
2417
2418 if (Creature* creature = target->ToCreature())
2419 creature->InitializeReactState();
2420 }
2421}
2422
2423void AuraEffect::HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const
2424{
2426 return;
2427
2428 Unit* target = aurApp->GetTarget();
2429
2430 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2431 if (!apply && target->HasAuraType(SPELL_AURA_MOD_UNATTACKABLE))
2432 return;
2433
2434 if (apply)
2436 else
2438
2439 // call functions which may have additional effects after changing state of unit
2440 if (apply && (mode & AURA_EFFECT_HANDLE_REAL))
2441 {
2442 if (target->GetMap()->IsDungeon())
2443 {
2444 target->AttackStop();
2445 if (Player* targetPlayer = target->ToPlayer())
2446 targetPlayer->SendAttackSwingCancelAttack();
2447 }
2448 else
2449 target->CombatStop();
2450 }
2451}
2452
2453void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const
2454{
2455 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2456 return;
2457
2458 Unit* target = aurApp->GetTarget();
2459
2460 AuraType type = GetAuraType();
2461
2462 bool(*flagChangeFunc)(Unit* u) = nullptr;
2463
2464 uint32 slot;
2465 WeaponAttackType attType;
2466 switch (type)
2467 {
2469 if (apply)
2470 flagChangeFunc = [](Unit* u) { if (u->HasUnitFlag(UNIT_FLAG_DISARMED)) { return false; } u->SetUnitFlag(UNIT_FLAG_DISARMED); return true; };
2471 else
2472 flagChangeFunc = [](Unit* u) { if (u->HasAuraType(SPELL_AURA_MOD_DISARM)) { return false; } u->RemoveUnitFlag(UNIT_FLAG_DISARMED); return true; };
2474 attType = BASE_ATTACK;
2475 break;
2477 if (apply)
2478 flagChangeFunc = [](Unit* u) { if (u->HasUnitFlag2(UNIT_FLAG2_DISARM_OFFHAND)) { return false; } u->SetUnitFlag2(UNIT_FLAG2_DISARM_OFFHAND); return true; };
2479 else
2480 flagChangeFunc = [](Unit* u) { if (u->HasAuraType(SPELL_AURA_MOD_DISARM_OFFHAND)) { return false; } u->RemoveUnitFlag2(UNIT_FLAG2_DISARM_OFFHAND); return true; };
2482 attType = OFF_ATTACK;
2483 break;
2485 if (apply)
2486 flagChangeFunc = [](Unit* u) { if (u->HasUnitFlag2(UNIT_FLAG2_DISARM_RANGED)) { return false; } u->SetUnitFlag2(UNIT_FLAG2_DISARM_RANGED); return true; };
2487 else
2488 flagChangeFunc = [](Unit* u) { if (u->HasAuraType(SPELL_AURA_MOD_DISARM_RANGED)) { return false; } u->RemoveUnitFlag2(UNIT_FLAG2_DISARM_RANGED); return true; };
2490 attType = RANGED_ATTACK;
2491 break;
2492 default:
2493 return;
2494 }
2495
2496 // set/remove flag before weapon bonuses so it's properly reflected in CanUseAttackType
2497 if (flagChangeFunc)
2498 if (!flagChangeFunc(target)) //Prevent handling aura twice
2499 return;
2500
2501 // Handle damage modification, shapeshifted druids are not affected
2502 if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
2503 {
2504 Player* player = target->ToPlayer();
2505 if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
2506 {
2507 WeaponAttackType const attackType = Player::GetAttackBySlot(slot, item->GetTemplate()->GetInventoryType());
2508
2509 player->ApplyItemDependentAuras(item, !apply);
2510 if (attackType != MAX_ATTACK)
2511 {
2512 player->_ApplyWeaponDamage(slot, item, !apply);
2513 if (!apply) // apply case already handled on item dependent aura removal (if any)
2514 player->UpdateWeaponDependentAuras(attackType);
2515 }
2516 }
2517 }
2518
2519 if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->GetCurrentEquipmentId())
2520 target->UpdateDamagePhysical(attType);
2521}
2522
2524{
2525 // Stop cast only spells vs PreventionType
2526 for (uint32 i = CURRENT_MELEE_SPELL; i < CURRENT_MAX_SPELL; ++i)
2527 if (Spell* spell = target->GetCurrentSpell(CurrentSpellTypes(i)))
2528 if (spell->m_spellInfo->PreventionType & preventionType)
2529 // Stop spells on prepare or casting state
2530 target->InterruptSpell(CurrentSpellTypes(i), false);
2531}
2532
2533void AuraEffect::HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const
2534{
2535 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2536 return;
2537
2538 Unit* target = aurApp->GetTarget();
2539
2540 if (apply)
2541 {
2543
2544 // call functions which may have additional effects after changing state of unit
2546 }
2547 else
2548 {
2549 int32 silencedSchoolMask = 0;
2550 for (AuraEffect const* auraEffect : target->GetAuraEffectsByType(SPELL_AURA_MOD_SILENCE))
2551 silencedSchoolMask |= auraEffect->GetMiscValue();
2552
2553 for (AuraEffect const* auraEffect : target->GetAuraEffectsByType(SPELL_AURA_MOD_PACIFY_SILENCE))
2554 silencedSchoolMask |= auraEffect->GetMiscValue();
2555
2556 target->ReplaceAllSilencedSchoolMask(SpellSchoolMask(silencedSchoolMask));
2557 }
2558}
2559
2560void AuraEffect::HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const
2561{
2563 return;
2564
2565 Unit* target = aurApp->GetTarget();
2566
2567 if (apply)
2568 {
2570
2571 // call functions which may have additional effects after changing state of unit
2573 }
2574 else
2575 {
2576 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2578 return;
2580 }
2581}
2582
2583void AuraEffect::HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const
2584{
2586 return;
2587
2588 Unit* target = aurApp->GetTarget();
2589
2590 // Vengeance of the Blue Flight (@todo REMOVE THIS!)
2592 if (m_spellInfo->Id == 45839)
2593 {
2594 if (apply)
2596 else
2598 }
2599 if (!(apply))
2600 {
2601 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2603 return;
2604 }
2605 HandleAuraModPacify(aurApp, mode, apply);
2606 HandleAuraModSilence(aurApp, mode, apply);
2607}
2608
2609void AuraEffect::HandleAuraModNoActions(AuraApplication const* aurApp, uint8 mode, bool apply) const
2610{
2611 if (!(mode & AURA_EFFECT_HANDLE_REAL))
2612 return;
2613
2614 Unit* target = aurApp->GetTarget();
2615
2616 if (apply)
2617 {
2619
2620 // call functions which may have additional effects after chainging state of unit
2622 }
2623 else
2624 {
2625 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2627 return;
2628
2630 }
2631}
2632
2633/****************************/
2634/*** TRACKING ***/
2635/****************************/
2636
2637void AuraEffect::HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const
2638{
2640 return;
2641
2642 Player* target = aurApp->GetTarget()->ToPlayer();
2643 if (!target)
2644 return;
2645
2646 if (apply)
2647 target->SetTrackCreatureFlag(uint32(1) << (GetMiscValue() - 1));
2648 else
2649 target->RemoveTrackCreatureFlag(uint32(1) << (GetMiscValue() - 1));
2650}
2651
2652void AuraEffect::HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const
2653{
2655 return;
2656
2657 Player* target = aurApp->GetTarget()->ToPlayer();
2658 if (!target)
2659 return;
2660
2661 if (!(apply))
2662 {
2663 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2664 if (target->HasAuraType(GetAuraType()))
2665 return;
2666 }
2667 if (apply)
2669 else
2671}
2672
2673void AuraEffect::HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const
2674{
2676 return;
2677
2678 Unit* target = aurApp->GetTarget();
2679
2680 // used by spells: Hunter's Mark, Mind Vision, Syndicate Tracker (MURP) DND
2681 if (apply)
2683 else
2684 {
2685 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2686 if (!target->HasAuraType(GetAuraType()))
2688 }
2689
2690 // call functions which may have additional effects after changing state of unit
2691 if (target->IsInWorld())
2692 target->UpdateObjectVisibility();
2693}
2694
2695void AuraEffect::HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const
2696{
2698 return;
2699
2700 Unit* target = aurApp->GetTarget();
2701
2702 if (apply)
2704 else
2705 {
2706 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2707 if (target->HasAuraType(GetAuraType()))
2708 return;
2710 }
2711}
2712
2713/****************************/
2714/*** SKILLS & TALENTS ***/
2715/****************************/
2716
2717void AuraEffect::HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const
2718{
2720 return;
2721
2722 Player* target = aurApp->GetTarget()->ToPlayer();
2723 if (!target)
2724 return;
2725
2726 uint32 prot = GetMiscValue();
2727 int32 points = GetAmountAsInt();
2728
2729 if (prot == SKILL_DEFENSE)
2730 return;
2731
2732 target->ModifySkillBonus(prot, (apply ? points : -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT);
2733}
2734
2735void AuraEffect::HandleAuraAllowTalentSwapping(AuraApplication const* aurApp, uint8 mode, bool apply) const
2736{
2737 if (!(mode & (AURA_EFFECT_HANDLE_REAL)))
2738 return;
2739
2740 Player* target = aurApp->GetTarget()->ToPlayer();
2741 if (!target)
2742 return;
2743
2744 if (apply)
2746 else if (!target->HasAuraType(GetAuraType()))
2748}
2749
2750/****************************/
2751/*** MOVEMENT ***/
2752/****************************/
2753
2754void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const
2755{
2757 return;
2758
2759 Unit* target = aurApp->GetTarget();
2760
2761 if (apply)
2762 {
2764 {
2765 uint32 creatureEntry = GetMiscValue();
2766 uint32 displayId = 0;
2767 uint32 vehicleId = 0;
2768
2769 if (MountEntry const* mountEntry = sDB2Manager.GetMount(GetId()))
2770 {
2771 if (DB2Manager::MountXDisplayContainer const* mountDisplays = sDB2Manager.GetMountDisplays(mountEntry->ID))
2772 {
2773 if (mountEntry->GetFlags().HasFlag(MountFlags::IsSelfMount))
2774 {
2775 displayId = DISPLAYID_HIDDEN_MOUNT;
2776 }
2777 else
2778 {
2780 std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [target](MountXDisplayEntry const* mountDisplay)
2781 {
2782 if (Player* playerTarget = target->ToPlayer())
2783 return ConditionMgr::IsPlayerMeetingCondition(playerTarget, mountDisplay->PlayerConditionID);
2784
2785 return true;
2786 });
2787
2788 if (!usableDisplays.empty())
2789 displayId = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->CreatureDisplayInfoID;
2790 }
2791 }
2792 // TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue)
2793 //if (MountVehicle const* mountVehicle = sObjectMgr->GetMountVehicle(mountEntry->Id))
2794 // creatureEntry = mountVehicle->VehicleCreatureId;
2795
2796 if (mode & AURA_EFFECT_HANDLE_REAL && !mountEntry->GetFlags().HasFlag(MountFlags::MountEquipmentEffectsSuppressed))
2797 {
2798 if (Player* playerTarget = target->ToPlayer())
2799 {
2800 auto mountEquipmentItr = std::ranges::find_if(sMountEquipmentStore,
2801 [&](int32 equipmentSpell) { return playerTarget->HasSpell(equipmentSpell); },
2803 if (mountEquipmentItr != sMountEquipmentStore.end())
2804 playerTarget->CastSpell(playerTarget, mountEquipmentItr->BuffSpell, this);
2805 }
2806 }
2807 }
2808
2809 if (CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(creatureEntry))
2810 {
2811 vehicleId = creatureInfo->VehicleId;
2812
2813 if (!displayId)
2814 {
2815 CreatureModel model = *ObjectMgr::ChooseDisplayId(creatureInfo);
2816 sObjectMgr->GetCreatureModelRandomGender(&model, creatureInfo);
2817 displayId = model.CreatureDisplayID;
2818 }
2819
2820 //some spell has one aura of mount and one of vehicle
2821 for (SpellEffectInfo const& effect : GetSpellInfo()->GetEffects())
2822 if (effect.IsEffect(SPELL_EFFECT_SUMMON) && effect.MiscValue == GetMiscValue())
2823 displayId = 0;
2824 }
2825
2826 target->Mount(displayId, vehicleId, creatureEntry);
2827 }
2828
2829 // cast speed aura
2831 {
2832 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmountAsInt()))
2833 {
2834 target->SetFlightCapabilityID(mountCapability->FlightCapabilityID, true);
2835 target->CastSpell(target, mountCapability->ModSpellAuraID, this);
2836 }
2837 }
2838 }
2839 else
2840 {
2842 target->Dismount();
2843
2844 //some mounts like Headless Horseman's Mount or broom stick are skill based spell
2845 // need to remove ALL arura related to mounts, this will stop client crash with broom stick
2846 // and never endless flying after using Headless Horseman's Mount
2847 if (mode & AURA_EFFECT_HANDLE_REAL)
2848 {
2850 for (MountEquipmentEntry const* mountEquipmentStore : sMountEquipmentStore)
2851 target->RemoveOwnedAura(mountEquipmentStore->BuffSpell);
2852 }
2853
2855 // remove speed aura
2856 if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmountAsInt()))
2857 target->RemoveAurasDueToSpell(mountCapability->ModSpellAuraID, target->GetGUID());
2858
2859 target->SetFlightCapabilityID(0, true);
2860 }
2861}
2862
2863void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const
2864{
2866 return;
2867
2868 Unit* target = aurApp->GetTarget();
2869
2870 if (!apply)
2871 {
2872 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2874 return;
2875 }
2876
2877 target->SetCanTransitionBetweenSwimAndFly(apply);
2878
2879 if (target->SetCanFly(apply))
2880 {
2881 if (!apply && !target->IsGravityDisabled())
2882 target->GetMotionMaster()->MoveFall();
2883 }
2884}
2885
2886void AuraEffect::HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const
2887{
2889 return;
2890
2891 Unit* target = aurApp->GetTarget();
2892
2893 if (!apply)
2894 {
2895 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2896 if (target->HasAuraType(GetAuraType()))
2897 return;
2898 }
2899
2900 target->SetWaterWalking(apply);
2901}
2902
2903void AuraEffect::HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const
2904{
2906 return;
2907
2908 Unit* target = aurApp->GetTarget();
2909
2910 if (!apply)
2911 {
2912 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2913 if (target->HasAuraType(GetAuraType()))
2914 return;
2915 }
2916
2917 target->SetFeatherFall(apply);
2918
2919 // start fall from current height
2920 if (!apply && target->GetTypeId() == TYPEID_PLAYER)
2921 target->ToPlayer()->SetFallInformation(0, target->GetPositionZ());
2922}
2923
2924void AuraEffect::HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const
2925{
2927 return;
2928
2929 Unit* target = aurApp->GetTarget();
2930
2931 if (!apply)
2932 {
2933 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2934 if (target->HasAuraType(GetAuraType()))
2935 return;
2936 }
2937
2938 target->SetHover(apply);
2939}
2940
2941void AuraEffect::HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
2942{
2944 return;
2945
2946 Unit* target = aurApp->GetTarget();
2947
2948 // update timers in client
2949 if (target->GetTypeId() == TYPEID_PLAYER)
2950 target->ToPlayer()->UpdateMirrorTimers();
2951}
2952
2953void AuraEffect::HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const
2954{
2956 return;
2957
2958 Unit* target = aurApp->GetTarget();
2959
2960 if (apply)
2962 else
2963 {
2964 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
2965 if (target->HasAuraType(GetAuraType()))
2966 return;
2968 }
2969}
2970
2971void AuraEffect::HandleAuraCanTurnWhileFalling(AuraApplication const* aurApp, uint8 mode, bool apply) const
2972{
2974 return;
2975
2976 Unit* target = aurApp->GetTarget();
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->SetCanTurnWhileFalling(apply);
2986}
2987
2988void AuraEffect::HandleModAdvFlying(AuraApplication const* aurApp, uint8 mode, bool apply) const
2989{
2991 return;
2992
2993 Unit* target = aurApp->GetTarget();
2994 target->SetCanDoubleJump(apply || target->HasAura(SPELL_DH_DOUBLE_JUMP));
2995 target->SetCanFly(apply);
2996 target->SetCanAdvFly(apply);
2997}
2998
2999void AuraEffect::HandleIgnoreMovementForces(AuraApplication const* aurApp, uint8 mode, bool apply) const
3000{
3002 return;
3003
3004 Unit* target = aurApp->GetTarget();
3005
3006 if (!apply)
3007 {
3008 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3009 if (target->HasAuraType(GetAuraType()))
3010 return;
3011 }
3012
3013 target->SetIgnoreMovementForces(apply);
3014}
3015
3016void AuraEffect::HandleDisableInertia(AuraApplication const* aurApp, uint8 mode, bool apply) const
3017{
3019 return;
3020
3021 Unit* target = aurApp->GetTarget();
3022
3023 if (!apply)
3024 {
3025 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3026 if (target->HasAuraType(GetAuraType()))
3027 return;
3028 }
3029
3030 target->SetDisableInertia(apply);
3031}
3032
3033void AuraEffect::HandleSetCantSwim(AuraApplication const* aurApp, uint8 mode, bool apply) const
3034{
3036 return;
3037
3038 Unit* target = aurApp->GetTarget();
3039
3040 if (!apply)
3041 {
3042 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3043 if (target->HasAuraType(GetAuraType()))
3044 return;
3045 }
3046
3047 target->SetMoveCantSwim(apply);
3048}
3049
3050/****************************/
3051/*** THREAT ***/
3052/****************************/
3053
3054void AuraEffect::HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3055{
3057 return;
3058
3060}
3061
3062void AuraEffect::HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3063{
3065 return;
3066
3067 Unit* target = aurApp->GetTarget();
3068
3069 if (!target->IsAlive() || target->GetTypeId() != TYPEID_PLAYER)
3070 return;
3071
3072 Unit* caster = GetCaster();
3073 if (caster && caster->IsAlive())
3075}
3076
3077void AuraEffect::HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3078{
3079 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3080 return;
3081
3082 Unit* target = aurApp->GetTarget();
3083
3084 if (!target->IsAlive() || !target->CanHaveThreatList())
3085 return;
3086
3087 target->GetThreatManager().TauntUpdate();
3088}
3089
3090void AuraEffect::HandleModDetaunt(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3091{
3092 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3093 return;
3094
3095 Unit* caster = GetCaster();
3096 Unit* target = aurApp->GetTarget();
3097
3098 if (!caster || !caster->IsAlive() || !target->IsAlive() || !caster->CanHaveThreatList())
3099 return;
3100
3101 caster->GetThreatManager().TauntUpdate();
3102}
3103
3104void AuraEffect::HandleAuraModFixate(AuraApplication const* aurApp, uint8 mode, bool apply) const
3105{
3106 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3107 return;
3108
3109 Unit* caster = GetCaster();
3110 Unit* target = aurApp->GetTarget();
3111
3112 if (!caster || !caster->IsAlive() || !target->IsAlive() || !caster->CanHaveThreatList())
3113 return;
3114
3115 if (apply)
3116 caster->GetThreatManager().FixateTarget(target);
3117 else
3118 caster->GetThreatManager().ClearFixate();
3119}
3120
3121/*****************************/
3122/*** CONTROL ***/
3123/*****************************/
3124
3125void AuraEffect::HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const
3126{
3127 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3128 return;
3129
3130 Unit* target = aurApp->GetTarget();
3131
3132 target->SetControlled(apply, UNIT_STATE_CONFUSED);
3133 if (apply)
3135}
3136
3137void AuraEffect::HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const
3138{
3139 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3140 return;
3141
3142 Unit* target = aurApp->GetTarget();
3143
3144 target->SetControlled(apply, UNIT_STATE_FLEEING);
3145}
3146
3147void AuraEffect::HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const
3148{
3149 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3150 return;
3151
3152 Unit* target = aurApp->GetTarget();
3153
3154 target->SetControlled(apply, UNIT_STATE_STUNNED);
3155 if (apply)
3157}
3158
3159void AuraEffect::HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const
3160{
3161 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3162 return;
3163
3164 Unit* target = aurApp->GetTarget();
3165
3166 target->SetControlled(apply, UNIT_STATE_ROOT);
3167}
3168
3169void AuraEffect::HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const
3170{
3171 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3172 return;
3173
3174 Unit* target = aurApp->GetTarget();
3175
3176 // Since patch 3.0.2 this mechanic no longer affects fear effects. It will ONLY prevent humanoids from fleeing due to low health.
3177 if (!apply || target->HasAuraType(SPELL_AURA_MOD_FEAR))
3178 return;
3181 target->SetControlled(false, UNIT_STATE_FLEEING);
3182}
3183
3184static void HandleAuraDisableGravity(Unit* target, bool apply)
3185{
3186 // Do not remove DisableGravity if there are more than this auraEffect of that kind on the unit or if it's a creature with DisableGravity on its movement template.
3187 if (!apply)
3191 || (target->IsCreature() && target->ToCreature()->IsFloating()))
3192 return;
3193
3194 if (target->SetDisableGravity(apply))
3195 if (!apply && !target->IsFlying())
3196 target->GetMotionMaster()->MoveFall();
3197}
3198
3200{
3201 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3202 return;
3203
3204 Unit* target = aurApp->GetTarget();
3205
3206 target->SetControlled(apply, UNIT_STATE_ROOT);
3207
3208 ::HandleAuraDisableGravity(target, apply);
3209}
3210
3212{
3213 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3214 return;
3215
3216 Unit* target = aurApp->GetTarget();
3217
3218 target->SetControlled(apply, UNIT_STATE_STUNNED);
3219
3220 if (apply)
3222
3223 ::HandleAuraDisableGravity(target, apply);
3224}
3225
3226void AuraEffect::HandleAuraDisableGravity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3227{
3228 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3229 return;
3230
3231 Unit* target = aurApp->GetTarget();
3232
3233 ::HandleAuraDisableGravity(target, apply);
3234}
3235
3236/***************************/
3237/*** CHARM ***/
3238/***************************/
3239
3240void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const
3241{
3242 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3243 return;
3244
3245 Unit* target = aurApp->GetTarget();
3246
3247 Unit* caster = GetCaster();
3248
3249 // no support for posession AI yet
3250 if (caster && caster->GetTypeId() == TYPEID_UNIT)
3251 {
3252 HandleModCharm(aurApp, mode, apply);
3253 return;
3254 }
3255
3256 if (apply)
3257 target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3258 else
3259 target->RemoveCharmedBy(caster);
3260}
3261
3262void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const
3263{
3264 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3265 return;
3266
3267 Unit* caster = GetCaster();
3268 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
3269 return;
3270
3271 // seems it may happen that when removing it is no longer owner's pet
3272 //if (caster->ToPlayer()->GetPet() != target)
3273 // return;
3274
3275 Unit* target = aurApp->GetTarget();
3276 if (target->GetTypeId() != TYPEID_UNIT || !target->IsPet())
3277 return;
3278
3279 Pet* pet = target->ToPet();
3280 if (apply)
3281 {
3282 if (caster->ToPlayer()->GetPet() != pet)
3283 return;
3284
3285 pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
3286 }
3287 else
3288 {
3289 pet->RemoveCharmedBy(caster);
3290
3291 if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
3292 pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
3293 else
3294 {
3295 // Reinitialize the pet bar or it will appear greyed out
3296 caster->ToPlayer()->PetSpellInitialize();
3297
3298 // TODO: remove this
3299 if (!pet->GetVictim() && !pet->GetCharmInfo()->HasCommandState(COMMAND_STAY))
3301 }
3302 }
3303}
3304
3305void AuraEffect::HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const
3306{
3307 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3308 return;
3309
3310 Unit* target = aurApp->GetTarget();
3311
3312 Unit* caster = GetCaster();
3313
3314 if (apply)
3315 target->SetCharmedBy(caster, CHARM_TYPE_CHARM, aurApp);
3316 else
3317 target->RemoveCharmedBy(caster);
3318}
3319
3320void AuraEffect::HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const
3321{
3322 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3323 return;
3324
3325 Unit* target = aurApp->GetTarget();
3326
3327 Unit* caster = GetCaster();
3328
3329 if (apply)
3330 target->SetCharmedBy(caster, CHARM_TYPE_CONVERT, aurApp);
3331 else
3332 target->RemoveCharmedBy(caster);
3333}
3334
3339void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const
3340{
3342 return;
3343
3344 Unit* target = aurApp->GetTarget();
3345 if (!target->IsVehicle())
3346 return;
3347
3348 Unit* caster = GetCaster();
3349 if (!caster || caster == target)
3350 return;
3351
3352 if (apply)
3353 {
3354 // Currently spells that have base points 0 and DieSides 0 = "0/0" exception are pushed to -1,
3355 // however the idea of 0/0 is to ingore flag VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT and -1 checks for it,
3356 // so this break such spells or most of them.
3357 // Current formula about m_amount: effect base points + dieside - 1
3358 // TO DO: Reasearch more about 0/0 and fix it.
3359 caster->_EnterVehicle(target->GetVehicleKit(), GetAmountAsInt() - 1, aurApp);
3360 }
3361 else
3362 {
3363 // Remove pending passengers before exiting vehicle - might cause an Uninstall
3365
3366 if (GetId() == 53111) // Devour Humanoid
3367 {
3368 Unit::Kill(target, caster);
3369 if (caster->GetTypeId() == TYPEID_UNIT)
3370 caster->ToCreature()->DespawnOrUnsummon();
3371 }
3372
3373 bool seatChange = (mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT) // Seat change on the same direct vehicle
3374 || target->HasAuraTypeWithCaster(SPELL_AURA_CONTROL_VEHICLE, caster->GetGUID()); // Seat change to a proxy vehicle (for example turret mounted on a siege engine)
3375
3376 if (!seatChange)
3377 caster->_ExitVehicle();
3378 else
3379 target->GetVehicleKit()->RemovePassenger(caster); // Only remove passenger from vehicle without launching exit movement or despawning the vehicle
3380
3381 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them
3382 caster->RemoveAurasDueToSpell(GetId());
3383 }
3384}
3385
3386/*********************************************************/
3387/*** MODIFY SPEED ***/
3388/*********************************************************/
3389void AuraEffect::HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3390{
3392 return;
3393
3394 Unit* target = aurApp->GetTarget();
3395
3396 target->UpdateSpeed(MOVE_RUN);
3397}
3398
3400{
3401 HandleAuraModIncreaseSpeed(aurApp, mode, apply);
3402}
3403
3404void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
3405{
3407 return;
3408
3409 Unit* target = aurApp->GetTarget();
3411 target->UpdateSpeed(MOVE_FLIGHT);
3412
3415 {
3416 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
3418 {
3419 target->SetCanTransitionBetweenSwimAndFly(apply);
3420
3421 if (target->SetCanFly(apply))
3422 if (!apply && !target->IsGravityDisabled())
3423 target->GetMotionMaster()->MoveFall();
3424 }
3425
3427 if (mode & AURA_EFFECT_HANDLE_REAL)
3428 {
3429 //Players on flying mounts must be immune to polymorph
3430 if (target->GetTypeId() == TYPEID_PLAYER)
3432
3433 // Dragonmaw Illusion (overwrite mount model, mounted aura already applied)
3434 if (apply && target->HasAuraEffect(42016, 0) && target->GetMountDisplayId())
3435 target->SetMountDisplayId(16314);
3436 }
3437 }
3438}
3439
3440void AuraEffect::HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3441{
3443 return;
3444
3445 Unit* target = aurApp->GetTarget();
3446
3447 target->UpdateSpeed(MOVE_SWIM);
3448}
3449
3450void AuraEffect::HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3451{
3453 return;
3454
3455 Unit* target = aurApp->GetTarget();
3456
3457 target->UpdateSpeed(MOVE_RUN);
3458 target->UpdateSpeed(MOVE_SWIM);
3459 target->UpdateSpeed(MOVE_FLIGHT);
3460 target->UpdateSpeed(MOVE_RUN_BACK);
3461 target->UpdateSpeed(MOVE_SWIM_BACK);
3463}
3464
3465void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3466{
3467 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3468 return;
3469
3470 Unit* target = aurApp->GetTarget();
3471
3472 target->UpdateSpeed(MOVE_RUN);
3473 target->UpdateSpeed(MOVE_SWIM);
3474 target->UpdateSpeed(MOVE_FLIGHT);
3475}
3476
3477void AuraEffect::HandleAuraModMinimumSpeedRate(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3478{
3479 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3480 return;
3481
3482 Unit* target = aurApp->GetTarget();
3483
3484 target->UpdateSpeed(MOVE_RUN);
3485}
3486
3487void AuraEffect::HandleModMovementForceMagnitude(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3488{
3490 return;
3491
3493}
3494
3495void AuraEffect::HandleAuraModAdvFlyingSpeed(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3496{
3498 return;
3499
3500 Unit* target = aurApp->GetTarget();
3501 switch (GetAuraType())
3502 {
3505 break;
3508 break;
3511 break;
3514 break;
3517 break;
3520 break;
3523 break;
3526 break;
3527 default:
3528 break;
3529 }
3530}
3531
3532/*********************************************************/
3533/*** IMMUNITY ***/
3534/*********************************************************/
3535
3536void AuraEffect::HandleModMechanicImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const
3537{
3538 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3539 return;
3540
3541 Unit* target = aurApp->GetTarget();
3543}
3544
3545void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3546{
3547 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3548 return;
3549
3550 Unit* target = aurApp->GetTarget();
3552}
3553
3554void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3555{
3556 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3557 return;
3558
3559 Unit* target = aurApp->GetTarget();
3561
3562 // when removing flag aura, handle flag drop
3563 // TODO: this should be handled in aura script for flag spells using AfterEffectRemove hook
3564 Player* player = target->ToPlayer();
3565 if (!apply && player && GetSpellInfo()->HasAuraInterruptFlag(SpellAuraInterruptFlags::StealthOrInvis))
3566 {
3567 if (!player->InBattleground())
3568 sOutdoorPvPMgr->HandleDropFlag(player, GetSpellInfo()->Id);
3569 }
3570}
3571
3572void AuraEffect::HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3573{
3574 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3575 return;
3576
3577 Unit* target = aurApp->GetTarget();
3579}
3580
3581void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3582{
3583 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3584 return;
3585
3586 Unit* target = aurApp->GetTarget();
3588
3589 // TODO: should be changed to a proc script on flag spell (they have "Taken positive" proc flags in db2)
3590 {
3591 if (apply && GetMiscValue() == SPELL_SCHOOL_MASK_NORMAL)
3593
3594 // remove all flag auras (they are positive, but they must be removed when you are immune)
3598 }
3599
3600 if (apply)
3601 {
3604 }
3605 else
3606 {
3607 // do not remove unit flag if there are more than this auraEffect of that kind on unit
3609 return;
3611 }
3612}
3613
3614void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3615{
3616 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3617 return;
3618
3619 Unit* target = aurApp->GetTarget();
3621
3622 if (apply)
3623 {
3626 }
3627 else
3628 {
3629 // do not remove unit flag if there are more than this auraEffect of that kind on unit
3631 return;
3633 }
3634}
3635
3636void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
3637{
3638 if (!(mode & AURA_EFFECT_HANDLE_REAL))
3639 return;
3640
3641 Unit* target = aurApp->GetTarget();
3643}
3644
3645/*********************************************************/
3646/*** MODIFY STATS ***/
3647/*********************************************************/
3648
3649/********************************/
3650/*** RESISTANCE ***/
3651/********************************/
3652
3653void AuraEffect::HandleAuraModResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const
3654{
3656 return;
3657
3658 Unit* target = aurApp->GetTarget();
3659
3660 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; ++x)
3661 if (GetMiscValue() & (1 << x))
3663}
3664
3665void AuraEffect::HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, uint8 mode, bool apply) const
3666{
3668 return;
3669
3670 Unit* target = aurApp->GetTarget();
3671
3672 // only players have base stats
3673 if (target->GetTypeId() != TYPEID_PLAYER)
3674 {
3675 //pets only have base armor
3676 if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
3677 {
3678 if (apply)
3680 else
3681 {
3683 target->SetStatPctModifier(UNIT_MOD_ARMOR, BASE_PCT, amount);
3684 }
3685 }
3686 }
3687 else
3688 {
3689 for (uint8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL; ++x)
3690 {
3691 if (GetMiscValue() & (1 << x))
3692 {
3693 if (apply)
3695 else
3696 {
3699 }
3700 }
3701 }
3702 }
3703}
3704
3705void AuraEffect::HandleModResistancePercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3706{
3708 return;
3709
3710 Unit* target = aurApp->GetTarget();
3711
3712 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
3713 {
3714 if (GetMiscValue() & (1 << i))
3715 {
3718 continue;
3719
3721 }
3722 }
3723}
3724
3725void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const
3726{
3728 return;
3729
3730 Unit* target = aurApp->GetTarget();
3731
3732 // only players have base stats
3733 if (target->GetTypeId() != TYPEID_PLAYER)
3734 {
3735 //pets only have base armor
3736 if (target->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
3738 }
3739 else
3740 {
3741 for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
3742 if (GetMiscValue() & (1 << i))
3744 }
3745}
3746
3747void AuraEffect::HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const
3748{
3750 return;
3751
3752 Player* target = aurApp->GetTarget()->ToPlayer();
3753 if (!target)
3754 return;
3755
3756 // applied to damage as HandleNoImmediateEffect in Unit::CalcAbsorbResist and Unit::CalcArmorReducedDamage
3757
3758 // show armor penetration
3761
3762 // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy
3764 target->ApplyModTargetResistance(GetAmountAsInt(), apply);
3765}
3766
3767/********************************/
3768/*** STAT ***/
3769/********************************/
3770
3771void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bool apply) const
3772{
3774 return;
3775
3776 if (GetMiscValue() < -2 || GetMiscValue() > 4)
3777 {
3778 TC_LOG_ERROR("spells.aura.effect", "WARNING: Spell {} effect {} has an unsupported misc value ({}) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue());
3779 return;
3780 }
3781
3782 Unit* target = aurApp->GetTarget();
3784 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
3785 return;
3786
3787 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
3788 {
3789 // -1 or -2 is all stats (misc < -2 checked in function beginning)
3790 if (GetMiscValue() < 0 || GetMiscValue() == i)
3791 {
3792 if (spellGroupVal)
3793 {
3794 target->HandleStatFlatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(spellGroupVal), !apply);
3795 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
3796 target->UpdateStatBuffMod(Stats(i));
3797 }
3798
3800 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
3801 target->UpdateStatBuffMod(Stats(i));
3802 }
3803 }
3804}
3805
3806void AuraEffect::HandleModPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const
3807{
3809 return;
3810
3811 Unit* target = aurApp->GetTarget();
3812
3813 if (GetMiscValue() < -1 || GetMiscValue() > 4)
3814 {
3815 TC_LOG_ERROR("spells.aura.effect", "WARNING: Misc Value for SPELL_AURA_MOD_PERCENT_STAT not valid");
3816 return;
3817 }
3818
3819 // only players have base stats
3820 if (target->GetTypeId() != TYPEID_PLAYER)
3821 return;
3822
3823 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
3824 {
3825 if (GetMiscValue() == i || GetMiscValue() == -1)
3826 {
3827 if (apply)
3829 else
3830 {
3831 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_PERCENT_STAT, [i](AuraEffect const* aurEff) -> bool
3832 {
3833 if (aurEff->GetMiscValue() == i || aurEff->GetMiscValue() == -1)
3834 return true;
3835 return false;
3836 });
3838 }
3839 }
3840 }
3841}
3842
3843void AuraEffect::HandleModSpellDamagePercentFromStat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3844{
3846 return;
3847
3848 Unit* target = aurApp->GetTarget();
3849
3850 if (target->GetTypeId() != TYPEID_PLAYER)
3851 return;
3852
3853 // Magic damage modifiers implemented in Unit::SpellDamageBonus
3854 // This information for client side use only
3855 // Recalculate bonus
3857}
3858
3859void AuraEffect::HandleModSpellHealingPercentFromStat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3860{
3862 return;
3863
3864 Unit* target = aurApp->GetTarget();
3865
3866 if (target->GetTypeId() != TYPEID_PLAYER)
3867 return;
3868
3869 // Recalculate bonus
3871}
3872
3873void AuraEffect::HandleModHealingDone(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3874{
3876 return;
3877
3878 Unit* target = aurApp->GetTarget();
3879
3880 if (target->GetTypeId() != TYPEID_PLAYER)
3881 return;
3882 // implemented in Unit::SpellHealingBonus
3883 // this information is for client side only
3885}
3886
3887void AuraEffect::HandleModHealingDonePct(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3888{
3890 return;
3891
3892 if (Player* player = aurApp->GetTarget()->ToPlayer())
3893 player->UpdateHealingDonePercentMod();
3894}
3895
3896void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3897{
3899 return;
3900
3901 Unit* target = aurApp->GetTarget();
3902
3903 // save current health state
3904 float healthPct = target->GetHealthPct();
3905 bool zeroHealth = !target->IsAlive();
3906
3907 // players in corpse state may mean two different states:
3910 if (target->getDeathState() == CORPSE)
3911 zeroHealth = (target->GetHealth() == 0);
3912
3913 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
3914 {
3915 if (GetMiscValueB() & 1 << i || !GetMiscValueB()) // 0 is also used for all stats
3916 {
3917 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, [i](AuraEffect const* aurEff) -> bool
3918 {
3919 if (aurEff->GetMiscValueB() & 1 << i || !aurEff->GetMiscValueB())
3920 return true;
3921 return false;
3922 });
3923
3924 if (target->GetPctModifierValue(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT) == amount)
3925 continue;
3926
3928 if (target->GetTypeId() == TYPEID_PLAYER || target->IsPet())
3929 target->UpdateStatBuffMod(Stats(i));
3930 }
3931 }
3932
3933 // recalculate current HP/MP after applying aura modifications (only for spells with SPELL_ATTR0_ABILITY 0x00000010 flag)
3934 // this check is total bullshit i think
3936 target->SetHealth(std::max<uint32>(CalculatePct(target->GetMaxHealth(), healthPct), (zeroHealth ? 0 : 1)));
3937}
3938
3939void AuraEffect::HandleAuraModExpertise(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3940{
3942 return;
3943
3944 Unit* target = aurApp->GetTarget();
3945
3946 if (target->GetTypeId() != TYPEID_PLAYER)
3947 return;
3948
3951}
3952
3953// Increase armor by <AuraEffect.BasePoints> % of your <primary stat>
3954void AuraEffect::HandleModArmorPctFromStat(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3955{
3957 return;
3958
3959 // only players have primary stats
3960 Player* player = aurApp->GetTarget()->ToPlayer();
3961 if (!player)
3962 return;
3963
3964 player->UpdateArmor();
3965}
3966
3967void AuraEffect::HandleModBonusArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const
3968{
3970 return;
3971
3973}
3974
3975void AuraEffect::HandleModBonusArmorPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
3976{
3978 return;
3979
3980 aurApp->GetTarget()->UpdateArmor();
3981}
3982
3983void AuraEffect::HandleModStatBonusPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
3984{
3986 return;
3987
3988 Unit* target = aurApp->GetTarget();
3989
3990 if (GetMiscValue() < -1 || GetMiscValue() > 4)
3991 {
3992 TC_LOG_ERROR("spells", "WARNING: Misc Value for SPELL_AURA_MOD_STAT_BONUS_PCT not valid");
3993 return;
3994 }
3995
3996 // only players have base stats
3997 if (target->GetTypeId() != TYPEID_PLAYER)
3998 return;
3999
4000 for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i)
4001 {
4002 if (GetMiscValue() == i || GetMiscValue() == -1)
4003 {
4005 target->UpdateStatBuffMod(Stats(i));
4006 }
4007 }
4008}
4009
4011{
4013 return;
4014
4015 Player* target = aurApp->GetTarget()->ToPlayer();
4016 if (!target)
4017 return;
4018
4019 target->ApplyModOverrideSpellPowerByAPPercent(float(GetAmount()), apply);
4021}
4022
4024{
4026 return;
4027
4028 Player* target = aurApp->GetTarget()->ToPlayer();
4029 if (!target)
4030 return;
4031
4032 target->ApplyModOverrideAPBySpellPowerPercent(float(GetAmount()), apply);
4034 target->UpdateAttackPowerAndDamage(true);
4035}
4036
4037void AuraEffect::HandleModVersatilityByPct(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4038{
4040 return;
4041
4042 if (Player* target = aurApp->GetTarget()->ToPlayer())
4043 {
4044 target->SetVersatilityBonus(target->GetTotalAuraModifier(SPELL_AURA_MOD_VERSATILITY));
4045 target->UpdateHealingDonePercentMod();
4046 target->UpdateVersatilityDamageDone();
4047 }
4048}
4049
4050void AuraEffect::HandleAuraModMaxPower(AuraApplication const* aurApp, uint8 mode, bool apply) const
4051{
4053 return;
4054
4055 Unit* target = aurApp->GetTarget();
4056
4058
4059 target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4060}
4061
4062void AuraEffect::HandleConvertCritToParry(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4063{
4065 return;
4066
4067 Player* target = aurApp->GetTarget()->ToPlayer();
4068 if (!target)
4069 return;
4070
4071 target->UpdateRating(CR_PARRY);
4072}
4073
4074/********************************/
4075/*** HEAL & ENERGIZE ***/
4076/********************************/
4077void AuraEffect::HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4078{
4080 return;
4081
4082 Unit* target = aurApp->GetTarget();
4083
4084 if (target->GetTypeId() != TYPEID_PLAYER)
4085 return;
4086
4087 // Update manaregen value
4088 if (GetMiscValue() == POWER_MANA)
4089 target->ToPlayer()->UpdateManaRegen();
4090 else if (GetMiscValue() == POWER_RUNES)
4091 target->ToPlayer()->UpdateAllRunesRegen();
4092 // other powers are not immediate effects - implemented in Player::Regenerate, Creature::Regenerate
4093}
4094
4095void AuraEffect::HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const
4096{
4097 HandleModPowerRegen(aurApp, mode, apply);
4098}
4099
4100void AuraEffect::HandleModManaRegenPct(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4101{
4103 return;
4104
4105 Unit* target = aurApp->GetTarget();
4106
4107 if (!target->IsPlayer())
4108 return;
4109
4110 target->ToPlayer()->UpdateManaRegen();
4111}
4112
4113void AuraEffect::HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const
4114{
4116 return;
4117
4118 Unit* target = aurApp->GetTarget();
4119
4120 int32 const amt = apply ? GetAmountAsInt() : -GetAmountAsInt();
4121 if (amt < 0)
4122 target->ModifyHealth(std::max<int32>(1 - target->GetHealth(), amt));
4123
4125
4126 if (amt > 0)
4127 target->ModifyHealth(amt);
4128}
4129
4130void AuraEffect::HandleAuraModIncreaseMaxHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const
4131{
4133 return;
4134
4135 Unit* target = aurApp->GetTarget();
4136
4137 float percent = target->GetHealthPct();
4138
4140
4141 // refresh percentage
4142 if (target->GetHealth() > 0)
4143 {
4144 uint32 newHealth = std::max<uint32>(target->CountPctFromMaxHealth(int32(percent)), 1);
4145 target->SetHealth(newHealth);
4146 }
4147}
4148
4149void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint8 mode, bool apply) const
4150{
4152 return;
4153
4154 Unit* target = aurApp->GetTarget();
4156
4157 target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
4158}
4159
4161{
4163 return;
4164
4165 Unit* target = aurApp->GetTarget();
4166
4167 Powers powerType = Powers(GetMiscValue());
4169
4170 // Save old powers for further calculation
4171 int32 oldPower = target->GetPower(powerType);
4172 int32 oldMaxPower = target->GetMaxPower(powerType);
4173
4174 // Handle aura effect for max power
4175 if (apply)
4176 target->ApplyStatPctModifier(unitMod, TOTAL_PCT, float(GetAmount()));
4177 else
4178 {
4179 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, [powerType](AuraEffect const* aurEff) -> bool
4180 {
4181 if (aurEff->GetMiscValue() == powerType)
4182 return true;
4183 return false;
4184 });
4185
4186 amount *= target->GetTotalAuraMultiplier(SPELL_AURA_MOD_MAX_POWER_PCT, [powerType](AuraEffect const* aurEff) -> bool
4187 {
4188 if (aurEff->GetMiscValue() == powerType)
4189 return true;
4190 return false;
4191 });
4192
4193 target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
4194 }
4195
4196 // Calculate the current power change
4197 int32 change = target->GetMaxPower(powerType) - oldMaxPower;
4198 change = (oldPower + change) - target->GetPower(powerType);
4199 target->ModifyPower(powerType, change);
4200}
4201
4203{
4205 return;
4206
4207 Unit* target = aurApp->GetTarget();
4208
4209 // Unit will keep hp% after MaxHealth being modified if unit is alive.
4210 float percent = target->GetHealthPct();
4211 if (apply)
4213 else
4214 {
4218 }
4219
4220 if (target->GetHealth() > 0)
4221 {
4222 uint32 newHealth = std::max<uint32>(CalculatePct(target->GetMaxHealth(), percent), 1);
4223 target->SetHealth(newHealth);
4224 }
4225}
4226
4228{
4230 return;
4231
4232 Unit* target = aurApp->GetTarget();
4233
4234 if (apply)
4236 else
4237 {
4240 }
4241}
4242
4244{
4246 return;
4247
4248 Unit* target = aurApp->GetTarget();
4249
4250 if (apply)
4252 else
4253 {
4255 target->SetStatPctModifier(UNIT_MOD_MANA, BASE_PCT, amount);
4256 }
4257}
4258
4259void AuraEffect::HandleModManaCostPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4260{
4262 return;
4263
4264 aurApp->GetTarget()->ApplyModManaCostMultiplier(GetAmount() / 100.0f, apply);
4265}
4266
4267void AuraEffect::HandleAuraModPowerDisplay(AuraApplication const* aurApp, uint8 mode, bool apply) const
4268{
4270 return;
4271
4272 if (GetMiscValue() >= MAX_POWERS)
4273 return;
4274
4275 if (apply)
4277
4278 aurApp->GetTarget()->UpdateDisplayPower();
4279}
4280
4282{
4283 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4284 return;
4285
4286 PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(GetMiscValue());
4287 if (!powerDisplay)
4288 return;
4289
4290 Unit* target = aurApp->GetTarget();
4291 if (target->GetPowerIndex(Powers(powerDisplay->ActualType)) == MAX_POWERS)
4292 return;
4293
4294 if (apply)
4295 {
4297 target->SetOverrideDisplayPowerId(powerDisplay->ID);
4298 }
4299 else
4300 target->SetOverrideDisplayPowerId(0);
4301}
4302
4303void AuraEffect::HandleAuraModMaxPowerPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4304{
4306 return;
4307
4308 Unit * target = aurApp->GetTarget();
4309 if (!target->IsPlayer())
4310 return;
4311
4312 Powers powerType = Powers(GetMiscValue());
4314
4315 // Save old powers for further calculation
4316 int32 oldPower = target->GetPower(powerType);
4317 int32 oldMaxPower = target->GetMaxPower(powerType);
4318
4319 // Handle aura effect for max power
4320 if (apply)
4321 target->ApplyStatPctModifier(unitMod, TOTAL_PCT, float(GetAmount()));
4322 else
4323 {
4324 float amount = target->GetTotalAuraMultiplier(SPELL_AURA_MOD_MAX_POWER_PCT, [powerType](AuraEffect const* aurEff) -> bool
4325 {
4326 if (aurEff->GetMiscValue() == powerType)
4327 return true;
4328 return false;
4329 });
4330
4331 amount *= target->GetTotalAuraMultiplier(SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT, [powerType](AuraEffect const* aurEff) -> bool
4332 {
4333 if (aurEff->GetMiscValue() == powerType)
4334 return true;
4335 return false;
4336 });
4337
4338 target->SetStatPctModifier(unitMod, TOTAL_PCT, amount);
4339 }
4340
4341 // Calculate the current power change
4342 int32 change = target->GetMaxPower(powerType) - oldMaxPower;
4343 change = (oldPower + change) - target->GetPower(powerType);
4344 target->ModifyPower(powerType, change);
4345}
4346
4348{
4349 if (!(mode & AURA_EFFECT_HANDLE_REAL) || !apply)
4350 return;
4351
4352 Unit* target = aurApp->GetTarget();
4353 SpellEffectValue thresholdPct = GetAmount();
4354 uint32 triggerSpell = GetSpellEffectInfo().TriggerSpell;
4355
4357 {
4359 if (!target->HealthAbovePct(thresholdPct))
4360 return;
4361 break;
4363 if (!target->HealthBelowPct(thresholdPct))
4364 return;
4365 break;
4366 default:
4367 break;
4368 }
4369
4370 target->CastSpell(target, triggerSpell, this);
4371}
4372
4373/********************************/
4374/*** FIGHT ***/
4375/********************************/
4376
4377void AuraEffect::HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4378{
4380 return;
4381
4382 Unit* target = aurApp->GetTarget();
4383
4384 if (target->GetTypeId() != TYPEID_PLAYER)
4385 return;
4386
4387 target->ToPlayer()->UpdateParryPercentage();
4388}
4389
4390void AuraEffect::HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4391{
4393 return;
4394
4395 Unit* target = aurApp->GetTarget();
4396
4397 if (target->GetTypeId() != TYPEID_PLAYER)
4398 return;
4399
4400 target->ToPlayer()->UpdateDodgePercentage();
4401}
4402
4403void AuraEffect::HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4404{
4406 return;
4407
4408 Unit* target = aurApp->GetTarget();
4409
4410 if (target->GetTypeId() != TYPEID_PLAYER)
4411 return;
4412
4413 target->ToPlayer()->UpdateBlockPercentage();
4414}
4415
4416void AuraEffect::HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4417{
4419 return;
4420
4421 Unit* target = aurApp->GetTarget();
4422
4423 if (!target->IsPlayer())
4424 return;
4425
4426 target->ToPlayer()->UpdateManaRegen();
4427}
4428
4429void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4430{
4432 return;
4433
4434 Player* target = aurApp->GetTarget()->ToPlayer();
4435 if (!target)
4436 return;
4437
4439}
4440
4441void AuraEffect::HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const
4442{
4444 return;
4445
4446 Unit* target = aurApp->GetTarget();
4447
4448 if (target->GetTypeId() == TYPEID_PLAYER)
4449 target->ToPlayer()->UpdateSpellHitChances();
4450 else
4451 target->m_modSpellHitChance += (apply) ? GetAmount() : (-GetAmount());
4452}
4453
4454void AuraEffect::HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const
4455{
4457 return;
4458
4459 Unit* target = aurApp->GetTarget();
4460
4461 if (target->GetTypeId() == TYPEID_PLAYER)
4462 target->ToPlayer()->UpdateSpellCritChance();
4463 else
4464 target->m_baseSpellCritChance += apply ? GetAmount() : -GetAmount();
4465}
4466
4467void AuraEffect::HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4468{
4470 return;
4471
4472 Unit* target = aurApp->GetTarget();
4473
4474 if (target->GetTypeId() != TYPEID_PLAYER)
4475 {
4476 target->m_baseSpellCritChance += apply ? GetAmount() : -GetAmount();
4477 return;
4478 }
4479
4481
4482 // included in Player::UpdateSpellCritChance calculation
4483 target->ToPlayer()->UpdateSpellCritChance();
4484}
4485
4486/********************************/
4487/*** ATTACK SPEED ***/
4488/********************************/
4489
4490void AuraEffect::HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
4491{
4493 return;
4494
4495 Unit* target = aurApp->GetTarget();
4496
4497 // Do not apply such auras in normal way
4498 if (GetAmount() >= 1000)
4499 {
4500 if (apply)
4501 target->SetInstantCast(true);
4502 else
4503 {
4504 // only SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK can have this high amount
4505 // it's some rare case that you have 2 auras like that, but just in case ;)
4506
4507 bool remove = true;
4509 for (AuraEffect const* aurEff : castingSpeedNotStack)
4510 {
4511 if (aurEff != this && aurEff->GetAmount() >= 1000)
4512 {
4513 remove = false;
4514 break;
4515 }
4516 }
4517
4518 if (remove)
4519 target->SetInstantCast(false);
4520 }
4521
4522 return;
4523 }
4524
4526 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4527 return;
4528
4529 if (spellGroupVal)
4530 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
4531
4532 target->ApplyCastTimePercentMod((float)GetAmount(), apply);
4533}
4534
4535void AuraEffect::HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4536{
4538 return;
4539
4541 Unit* target = aurApp->GetTarget();
4542
4543 target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply);
4544 target->ApplyAttackTimePercentMod(OFF_ATTACK, (float)GetAmount(), apply);
4545 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4546}
4547
4548void AuraEffect::HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4549{
4551 return;
4552
4553 Unit* target = aurApp->GetTarget();
4555 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4556 return;
4557
4558 if (spellGroupVal)
4559 {
4560 target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
4561 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
4562 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
4563 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(spellGroupVal), !apply);
4564 }
4565 target->ApplyCastTimePercentMod(float(GetAmount()), apply);
4566 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
4567 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
4568 target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(GetAmount()), apply);
4569}
4570
4571void AuraEffect::HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const
4572{
4574 return;
4575
4576 Unit* target = aurApp->GetTarget();
4577
4578 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
4580}
4581
4582void AuraEffect::HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const
4583{
4585 return;
4586
4588 Unit* target = aurApp->GetTarget();
4590 if (std::abs(spellGroupVal) >= std::abs(GetAmount()))
4591 return;
4592
4593 if (spellGroupVal)
4594 {
4595 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(spellGroupVal), !apply);
4596 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(spellGroupVal), !apply);
4597 }
4598 target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply);
4599 target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply);
4600}
4601
4602void AuraEffect::HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const
4603{
4605 return;
4606
4608 Unit* target = aurApp->GetTarget();
4609
4610 target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply);
4611}
4612
4613/********************************/
4614/*** COMBAT RATING ***/
4615/********************************/
4616
4617void AuraEffect::HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const
4618{
4620 return;
4621
4622 Unit* target = aurApp->GetTarget();
4623
4624 if (target->GetTypeId() != TYPEID_PLAYER)
4625 return;
4626
4627 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
4628 if (GetMiscValue() & (1 << rating))
4629 target->ToPlayer()->ApplyRatingMod(CombatRating(rating), GetAmountAsInt(), apply);
4630}
4631
4632void AuraEffect::HandleModRatingPct(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4633{
4635 return;
4636
4637 Unit* target = aurApp->GetTarget();
4638
4639 if (target->GetTypeId() != TYPEID_PLAYER)
4640 return;
4641
4642 // Just recalculate ratings
4643 for (uint32 rating = 0; rating < MAX_COMBAT_RATING; ++rating)
4644 if (GetMiscValue() & (1 << rating))
4645 target->ToPlayer()->UpdateRating(CombatRating(rating));
4646}
4647
4648/********************************/
4649/*** ATTACK POWER ***/
4650/********************************/
4651
4652void AuraEffect::HandleAuraModAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const
4653{
4655 return;
4656
4657 Unit* target = aurApp->GetTarget();
4658
4660}
4661
4662void AuraEffect::HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const
4663{
4665 return;
4666
4667 Unit* target = aurApp->GetTarget();
4668
4669 if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0)
4670 return;
4671
4673}
4674
4675void AuraEffect::HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
4676{
4678 return;
4679
4680 Unit* target = aurApp->GetTarget();
4681
4682 //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1
4683 if (apply)
4685 else
4686 {
4689 }
4690}
4691
4693{
4695 return;
4696
4697 Unit* target = aurApp->GetTarget();
4698
4699 if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0)
4700 return;
4701
4702 //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
4703 if (apply)
4705 else
4706 {
4709 }
4710}
4711
4712/********************************/
4713/*** DAMAGE BONUS ***/
4714/********************************/
4715void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const
4716{
4718 return;
4719
4720 Unit* target = aurApp->GetTarget();
4721
4723 target->UpdateAllDamageDoneMods();
4724
4725 // Magic damage modifiers implemented in Unit::SpellBaseDamageBonusDone
4726 // This information for client side use only
4727 if (Player* playerTarget = target->ToPlayer())
4728 {
4729 for (uint16 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
4730 if (GetMiscValue() & (1 << i))
4731 {
4732 if (GetAmountAsInt() >= 0)
4733 playerTarget->ApplyModDamageDonePos(SpellSchools(i), GetAmountAsInt(), apply);
4734 else
4735 playerTarget->ApplyModDamageDoneNeg(SpellSchools(i), GetAmountAsInt(), apply);
4736 }
4737
4738 if (Guardian* pet = playerTarget->GetGuardianPet())
4739 pet->UpdateAttackPowerAndDamage();
4740 }
4741}
4742
4743void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4744{
4746 return;
4747
4748 Unit* target = aurApp->GetTarget();
4749
4750 // also handles spell group stacks
4753
4754 if (Player* thisPlayer = target->ToPlayer())
4755 {
4756 for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
4757 {
4758 if (GetMiscValue() & (1 << i))
4759 {
4760 // only aura type modifying PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
4761 float amount = thisPlayer->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, 1 << i);
4762 thisPlayer->SetModDamageDonePercent(i, amount);
4763 }
4764 }
4765 }
4766}
4767
4768void AuraEffect::HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4769{
4771 return;
4772
4773 Unit* target = aurApp->GetTarget();
4774
4775 // also handles spell group stacks
4777}
4778
4779void AuraEffect::HandleShieldBlockValue(AuraApplication const* aurApp, uint8 mode, bool apply) const
4780{
4782 return;
4783
4784 if (Player* player = aurApp->GetTarget()->ToPlayer())
4785 player->HandleBaseModFlatValue(SHIELD_BLOCK_VALUE, float(GetAmount()), apply);
4786}
4787
4788void AuraEffect::HandleShieldBlockValuePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
4789{
4791 return;
4792
4793 Player* target = aurApp->GetTarget()->ToPlayer();
4794 if (!target)
4795 return;
4796
4797 if (apply)
4799 else
4800 {
4802 target->SetBaseModPctValue(SHIELD_BLOCK_VALUE, amount);
4803 }
4804}
4805
4806/********************************/
4807/*** POWER COST ***/
4808/********************************/
4809
4810void AuraEffect::HandleModPowerCost(AuraApplication const* aurApp, uint8 mode, bool apply) const
4811{
4813 return;
4814
4815 // handled in SpellInfo::CalcPowerCost, this is only for client UI
4816 if (!(GetMiscValueB() & (1 << POWER_MANA)))
4817 return;
4818
4819 Unit* target = aurApp->GetTarget();
4820
4821 for (int i = 0; i < MAX_SPELL_SCHOOL; ++i)
4822 if (GetMiscValue() & (1 << i))
4824}
4825
4826void AuraEffect::HandleArenaPreparation(AuraApplication const* aurApp, uint8 mode, bool apply) const
4827{
4828 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4829 return;
4830
4831 Unit* target = aurApp->GetTarget();
4832
4833 if (apply)
4835 else
4836 {
4837 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
4838 if (target->HasAuraType(GetAuraType()))
4839 return;
4841 }
4842
4844}
4845
4846void AuraEffect::HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
4847{
4848 if (!(mode & AURA_EFFECT_HANDLE_REAL))
4849 return;
4850
4851 Unit* target = aurApp->GetTarget();
4852
4853 if (target->GetTypeId() != TYPEID_PLAYER)
4854 return;
4855
4856 flag128 mask;
4858 for (Unit::AuraEffectList::const_iterator i = noReagent.begin(); i != noReagent.end(); ++i)
4859 mask |= (*i)->GetSpellEffectInfo().SpellClassMask;
4860
4861 target->ToPlayer()->SetNoRegentCostMask(mask);
4862}
4863
4864/*********************************************************/
4865/*** OTHERS ***/
4866/*********************************************************/
4867
4868void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool apply) const
4869{
4871 return;
4872
4873 Unit* target = aurApp->GetTarget();
4874
4875 Unit* caster = GetCaster();
4876
4877 // pet auras
4878 if (target->GetTypeId() == TYPEID_PLAYER && (mode & AURA_EFFECT_HANDLE_REAL))
4879 {
4880 if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), GetEffIndex()))
4881 {
4882 if (apply)
4883 target->ToPlayer()->AddPetAura(petSpell);
4884 else
4885 target->ToPlayer()->RemovePetAura(petSpell);
4886 }
4887 }
4888
4890 {
4891 // AT APPLY
4892 if (apply)
4893 {
4894 switch (GetId())
4895 {
4896 case 1515: // Tame beast
4897 // FIX_ME: this is 2.0.12 threat effect replaced in 2.1.x by dummy aura, must be checked for correctness
4898 if (caster && target->CanHaveThreatList())
4899 target->GetThreatManager().AddThreat(caster, 10.0f);
4900 break;
4901 case 13139: // net-o-matic
4902 // root to self part of (root_target->charge->root_self sequence
4903 if (caster)
4904 caster->CastSpell(caster, 13138, this);
4905 break;
4906 case 34026: // kill command
4907 {
4908 Unit* pet = target->GetGuardianPet();
4909 if (!pet)
4910 break;
4911
4912 target->CastSpell(target, 34027, this);
4913
4914 // set 3 stacks and 3 charges (to make all auras not disappear at once)
4915 Aura* owner_aura = target->GetAura(34027, GetCasterGUID());
4916 Aura* pet_aura = pet->GetAura(58914, GetCasterGUID());
4917 if (owner_aura)
4918 {
4919 owner_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4920 if (pet_aura)
4921 {
4922 pet_aura->SetCharges(0);
4923 pet_aura->SetStackAmount(owner_aura->GetSpellInfo()->StackAmount);
4924 }
4925 }
4926 break;
4927 }
4928 case 37096: // Blood Elf Illusion
4929 {
4930 if (caster)
4931 {
4932 if (caster->GetGender() == GENDER_FEMALE)
4933 caster->CastSpell(target, 37095, this); // Blood Elf Disguise
4934 else
4935 caster->CastSpell(target, 37093, this);
4936 }
4937 break;
4938 }
4939 case 39850: // Rocket Blast
4940 if (roll_chance(20)) // backfire stun
4941 target->CastSpell(target, 51581, this);
4942 break;
4943 case 43873: // Headless Horseman Laugh
4944 target->PlayDistanceSound(11965);
4945 break;
4946 case 46354: // Blood Elf Illusion
4947 if (caster)
4948 {
4949 if (caster->GetGender() == GENDER_FEMALE)
4950 caster->CastSpell(target, 46356, this);
4951 else
4952 caster->CastSpell(target, 46355, this);
4953 }
4954 break;
4955 case 46361: // Reinforced Net
4956 if (caster)
4957 target->GetMotionMaster()->MoveFall();
4958 break;
4959 }
4960 }
4961 // AT REMOVE
4962 else
4963 {
4965 {
4967 switch (GetId())
4968 {
4969 case 43681: // Inactive
4970 {
4971 if (target->GetTypeId() != TYPEID_PLAYER || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
4972 return;
4973
4974 if (target->GetMap()->IsBattleground())
4975 target->ToPlayer()->LeaveBattleground();
4976 break;
4977 }
4978 case 46308: // Burning Winds cast only at creatures at spawn
4979 target->CastSpell(target, 47287, this);
4980 break;
4981 case 52172: // Coyote Spirit Despawn Aura
4982 case 60244: // Blood Parrot Despawn Aura
4983 target->CastSpell(nullptr, GetAmountAsInt(), this);
4984 break;
4985 case 91604: // Restricted Flight Area
4986 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
4987 target->CastSpell(target, 58601, this);
4988 break;
4989 }
4990 break;
4992 // Summon Gargoyle (Dismiss Gargoyle at remove)
4993 if (GetId() == 61777)
4994 target->CastSpell(target, GetAmountAsInt(), this);
4995 break;
4996 default:
4997 break;
4998 }
4999 }
5000 }
5001
5002 // AT APPLY & REMOVE
5003
5005 {
5007 {
5008 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5009 break;
5010 switch (GetId())
5011 {
5012 // Recently Bandaged
5013 case 11196:
5015 break;
5016 // Unstable Power
5017 case 24658:
5018 {
5019 uint32 spellId = 24659;
5020 if (apply && caster)
5021 {
5022 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
5023 CastSpellExtraArgs args;
5026 args.OriginalCastId = GetBase()->GetCastId();
5028
5029 for (uint32 i = 0; i < spell->StackAmount; ++i)
5030 caster->CastSpell(target, spell->Id, args);
5031 break;
5032 }
5033 target->RemoveAurasDueToSpell(spellId);
5034 break;
5035 }
5036 // Restless Strength
5037 case 24661:
5038 {
5039 uint32 spellId = 24662;
5040 if (apply && caster)
5041 {
5042 SpellInfo const* spell = sSpellMgr->AssertSpellInfo(spellId, GetBase()->GetCastDifficulty());
5043 CastSpellExtraArgs args;
5046 args.OriginalCastId = GetBase()->GetCastId();
5048
5049 for (uint32 i = 0; i < spell->StackAmount; ++i)
5050 caster->CastSpell(target, spell->Id, args);
5051 break;
5052 }
5053 target->RemoveAurasDueToSpell(spellId);
5054 break;
5055 }
5056 // Tag Murloc
5057 case 30877:
5058 {
5059 // Tag/untag Blacksilt Scout
5060 target->SetEntry(apply ? 17654 : 17326);
5061 break;
5062 }
5063 case 57819: // Argent Champion
5064 case 57820: // Ebon Champion
5065 case 57821: // Champion of the Kirin Tor
5066 case 57822: // Wyrmrest Champion
5067 {
5068 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
5069 break;
5070
5071 uint32 FactionID = 0;
5072
5073 if (apply)
5074 {
5075 switch (m_spellInfo->Id)
5076 {
5077 case 57819: FactionID = 1106; break; // Argent Crusade
5078 case 57820: FactionID = 1098; break; // Knights of the Ebon Blade
5079 case 57821: FactionID = 1090; break; // Kirin Tor
5080 case 57822: FactionID = 1091; break; // The Wyrmrest Accord
5081 }
5082 }
5083 caster->ToPlayer()->SetChampioningFaction(FactionID);
5084 break;
5085 }
5086 // LK Intro VO (1)
5087 case 58204:
5088 if (target->GetTypeId() == TYPEID_PLAYER)
5089 {
5090 // Play part 1
5091 if (apply)
5092 target->PlayDirectSound(14970, target->ToPlayer());
5093 // continue in 58205
5094 else
5095 target->CastSpell(target, 58205, this);
5096 }
5097 break;
5098 // LK Intro VO (2)
5099 case 58205:
5100 if (target->GetTypeId() == TYPEID_PLAYER)
5101 {
5102 // Play part 2
5103 if (apply)
5104 target->PlayDirectSound(14971, target->ToPlayer());
5105 // Play part 3
5106 else
5107 target->PlayDirectSound(14972, target->ToPlayer());
5108 }
5109 break;
5110 }
5111
5112 break;
5113 }
5114 case SPELLFAMILY_MAGE:
5115 {
5116 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5117 //break;
5118 break;
5119 }
5120 case SPELLFAMILY_PRIEST:
5121 {
5122 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5123 //break;
5124 break;
5125 }
5126 case SPELLFAMILY_DRUID:
5127 {
5128 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5129 //break;
5130 break;
5131 }
5132 case SPELLFAMILY_SHAMAN:
5133 {
5134 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5135 //break;
5136 break;
5137 }
5139 // if (!(mode & AURA_EFFECT_HANDLE_REAL))
5140 // break;
5141 break;
5143 {
5144 //if (!(mode & AURA_EFFECT_HANDLE_REAL))
5145 // break;
5146 break;
5147 }
5148 }
5149}
5150
5151void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mode, bool apply) const
5152{
5153 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5154 return;
5155
5156 if (apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEATH)
5157 return;
5158
5159 Unit* caster = GetCaster();
5160
5161 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
5162 return;
5163
5164 Player* plCaster = caster->ToPlayer();
5165 Unit* target = aurApp->GetTarget();
5166
5167 // Item amount
5168 if (GetAmountAsInt() <= 0)
5169 return;
5170
5171 if (GetSpellEffectInfo().ItemType == 0)
5172 return;
5173
5174 // Soul Shard
5175 if (GetSpellEffectInfo().ItemType == 6265)
5176 {
5177 // Soul Shard only from units that grant XP or honor
5178 if (!plCaster->isHonorOrXPTarget(target) ||
5179 (target->GetTypeId() == TYPEID_UNIT && !target->ToCreature()->isTappedBy(plCaster)))
5180 return;
5181 }
5182
5183 //Adding items
5184 uint32 noSpaceForCount = 0;
5185 uint32 count = GetAmountAsInt();
5186
5187 ItemPosCountVec dest;
5188 InventoryResult msg = plCaster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, GetSpellEffectInfo().ItemType, count, &noSpaceForCount);
5189 if (msg != EQUIP_ERR_OK)
5190 {
5191 count -= noSpaceForCount;
5192 plCaster->SendEquipError(msg, nullptr, nullptr, GetSpellEffectInfo().ItemType);
5193 if (count == 0)
5194 return;
5195 }
5196
5197 if (Item* newitem = plCaster->StoreNewItem(dest, GetSpellEffectInfo().ItemType, true))
5198 plCaster->SendNewItem(newitem, count, true, true);
5199}
5200
5201void AuraEffect::HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const
5202{
5203 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5204 return;
5205
5206 Unit* target = aurApp->GetTarget();
5207
5208 Unit* caster = GetCaster();
5209
5210 if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
5211 return;
5212
5213 caster->ToPlayer()->SetViewpoint(target, apply);
5214}
5215
5216void AuraEffect::HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const
5217{
5219 return;
5220
5221 Unit* target = aurApp->GetTarget();
5222
5223 Player* player = target->ToPlayer();
5224 if (!player)
5225 return;
5226
5227 uint32 factionId = GetMiscValue();
5229
5230 player->GetReputationMgr().ApplyForceReaction(factionId, factionRank, apply);
5231
5232 // stop fighting at apply (if forced rank friendly) or at remove (if real rank friendly)
5233 if ((apply && factionRank >= REP_FRIENDLY) || (!apply && player->GetReputationRank(factionId) >= REP_FRIENDLY))
5234 player->StopAttackFaction(factionId);
5235}
5236
5237void AuraEffect::HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const
5238{
5239 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5240 return;
5241
5242 Unit* target = aurApp->GetTarget();
5243 if (!apply)
5244 {
5245 // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
5246 if (target->HasAuraType(GetAuraType()))
5247 return;
5248 }
5249
5250 if (target->GetCreatureType() == CREATURE_TYPE_BEAST)
5251 {
5252 if (apply)
5254 else
5256 }
5257}
5258
5259void AuraEffect::HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const
5260{
5261 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5262 return;
5263
5264 Unit* target = aurApp->GetTarget();
5265
5266 if (apply)
5267 {
5268 target->SetFaction(GetMiscValue());
5269 if (target->GetTypeId() == TYPEID_PLAYER)
5271 }
5272 else
5273 {
5274 target->RestoreFaction();
5275 if (target->GetTypeId() == TYPEID_PLAYER)
5277 }
5278}
5279
5280void AuraEffect::HandleLearnSpell(AuraApplication const* aurApp, uint8 mode, bool apply) const
5281{
5282 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5283 return;
5284
5285 Player* player = aurApp->GetTarget()->ToPlayer();
5286 if (!player)
5287 return;
5288
5289 if (apply)
5290 player->LearnSpell(GetMiscValue(), true, 0, true);
5291 else
5292 player->RemoveSpell(GetMiscValue(), false, false, true);
5293}
5294
5295void AuraEffect::HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const
5296{
5298 return;
5299
5300 Unit* target = aurApp->GetTarget();
5301
5302 if (apply)
5304 else
5305 {
5306 if (target->HasAuraType(GetAuraType()))
5307 return;
5308
5310 }
5311}
5312
5314{
5316 return;
5317
5318 Unit* target = aurApp->GetTarget();
5319
5320 if (apply)
5322 else
5323 {
5324 if (target->HasAuraType(GetAuraType()))
5325 return;
5326
5328 }
5329}
5330
5331void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const
5332{
5333 Unit* target = aurApp->GetTarget();
5334
5335 uint32 triggeredSpellId = GetSpellEffectInfo().TriggerSpell;
5336 SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggeredSpellId, GetBase()->GetCastDifficulty());
5337 if (!triggeredSpellInfo)
5338 return;
5339
5340 Unit* caster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCaster() : target;
5341 if (!caster)
5342 return;
5343
5344 if (mode & AURA_EFFECT_HANDLE_REAL)
5345 {
5346 if (apply)
5347 {
5348 CastSpellExtraArgs args(this);
5349 if (GetAmount()) // If amount avalible cast with basepoints (Crypt Fever for example)
5351
5352 caster->CastSpell(target, triggeredSpellId, args);
5353 }
5354 else
5355 {
5356 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID();
5357 target->RemoveAura(triggeredSpellId, casterGUID);
5358 }
5359 }
5360 else if (mode & AURA_EFFECT_HANDLE_REAPPLY && apply)
5361 {
5362 ObjectGuid casterGUID = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? GetCasterGUID() : target->GetGUID();
5363 // change the stack amount to be equal to stack amount of our aura
5364 if (Aura* triggeredAura = target->GetAura(triggeredSpellId, casterGUID))
5365 triggeredAura->ModStackAmount(GetBase()->GetStackAmount() - triggeredAura->GetStackAmount());
5366 }
5367}
5368
5369void AuraEffect::HandleTriggerSpellOnPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
5370{
5371 if (!(mode & AURA_EFFECT_HANDLE_REAL) || !apply)
5372 return;
5373
5374 Unit* target = aurApp->GetTarget();
5375
5376 SpellEffectValue effectAmount = GetAmount();
5377 uint32 triggerSpell = GetSpellEffectInfo().TriggerSpell;
5378 int32 maxPower = target->GetMaxPower(Powers(GetMiscValue()));
5379 if (!maxPower)
5380 return;
5381
5382 float powerAmountPct = GetPctOf(target->GetPower(Powers(GetMiscValue())), maxPower);
5383
5385 {
5387 if (powerAmountPct < effectAmount)
5388 return;
5389 break;
5391 if (powerAmountPct > effectAmount)
5392 return;
5393 break;
5394 default:
5395 break;
5396 }
5397
5398 target->CastSpell(target, triggerSpell, this);
5399}
5400
5401void AuraEffect::HandleTriggerSpellOnPowerAmount(AuraApplication const* aurApp, uint8 mode, bool apply) const
5402{
5403 if (!(mode & AURA_EFFECT_HANDLE_REAL) || !apply)
5404 return;
5405
5406 Unit* target = aurApp->GetTarget();
5407
5408 SpellEffectValue effectAmount = GetAmount();
5409 uint32 triggerSpell = GetSpellEffectInfo().TriggerSpell;
5410 float powerAmount = target->GetPower(Powers(GetMiscValue()));
5411
5413 {
5415 if (powerAmount < effectAmount)
5416 return;
5417 break;
5419 if (powerAmount > effectAmount)
5420 return;
5421 break;
5422 default:
5423 break;
5424 }
5425
5426 target->CastSpell(target, triggerSpell, this);
5427}
5428
5429void AuraEffect::HandleTriggerSpellOnExpire(AuraApplication const* aurApp, uint8 mode, bool apply) const
5430{
5431 if (!(mode & AURA_EFFECT_HANDLE_REAL) || apply || aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
5432 return;
5433
5434 Unit* caster = aurApp->GetTarget();
5435
5436 // MiscValue (Caster):
5437 // 0 - Aura target
5438 // 1 - Aura caster
5439 // 2 - ? Aura target is always TARGET_UNIT_CASTER so we consider the same behavior as MiscValue 1
5440 uint32 casterType = uint32(GetMiscValue());
5441 if (casterType > 0)
5442 caster = GetCaster();
5443
5444 if (caster)
5445 caster->CastSpell(aurApp->GetTarget(), GetSpellEffectInfo().TriggerSpell, this);
5446}
5447
5448void AuraEffect::HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const
5449{
5450 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5451 return;
5452
5453 Unit* target = aurApp->GetTarget();
5454
5455 if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld())
5456 return;
5457
5458 if (apply)
5459 target->ToPlayer()->SetStableMaster(target->GetGUID());
5460
5461 // client auto close stable dialog at !apply aura
5462}
5463
5464void AuraEffect::HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const
5465{
5467 return;
5468
5469 Unit* target = aurApp->GetTarget();
5470
5471 if (apply)
5472 {
5475
5476 if (Player* playerTarget = target->ToPlayer())
5477 playerTarget->ApplyModFakeInebriation(GetAmountAsInt(), true);
5478 }
5479 else
5480 {
5481 bool removeDetect = !target->HasAuraType(SPELL_AURA_MOD_FAKE_INEBRIATE);
5482
5484
5485 if (Player* playerTarget = target->ToPlayer())
5486 {
5487 playerTarget->ApplyModFakeInebriation(GetAmountAsInt(), false);
5488
5489 if (removeDetect)
5490 removeDetect = !playerTarget->GetDrunkValue();
5491 }
5492
5493 if (removeDetect)
5495 }
5496
5497 // call functions which may have additional effects after changing state of unit
5498 if (target->IsInWorld())
5499 target->UpdateObjectVisibility();
5500}
5501
5502void AuraEffect::HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const
5503{
5504 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5505 return;
5506
5507 Player* target = aurApp->GetTarget()->ToPlayer();
5508
5509 if (!target || !target->IsInWorld())
5510 return;
5511
5512 uint32 overrideId = uint32(GetMiscValue());
5513
5514 if (apply)
5515 {
5516 target->SetOverrideSpellsId(overrideId);
5517 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5518 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5519 if (uint32 spellId = overrideSpells->Spells[i])
5520 target->AddTemporarySpell(spellId);
5521 }
5522 else
5523 {
5524 target->SetOverrideSpellsId(0);
5525 if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
5526 for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
5527 if (uint32 spellId = overrideSpells->Spells[i])
5528 target->RemoveTemporarySpell(spellId);
5529 }
5530}
5531
5532void AuraEffect::HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const
5533{
5534 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5535 return;
5536
5537 Unit* target = aurApp->GetTarget();
5538
5539 if (!target->IsInWorld())
5540 return;
5541
5542 uint32 vehicleId = GetMiscValue();
5543
5544 target->RemoveVehicleKit();
5545
5546 if (apply)
5547 {
5548 if (!target->CreateVehicleKit(vehicleId, 0))
5549 return;
5550 }
5551 else
5552 {
5553 if (Creature* creature = target->ToCreature())
5554 if (uint32 originalVehicleId = creature->GetCreatureTemplate()->VehicleId)
5555 creature->CreateVehicleKit(originalVehicleId, creature->GetEntry());
5556 }
5557
5558 if (target->GetTypeId() != TYPEID_PLAYER)
5559 return;
5560
5561 if (apply)
5563}
5564
5565void AuraEffect::HandleSetVignette(AuraApplication const* aurApp, uint8 mode, bool apply) const
5566{
5567 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5568 return;
5569
5570 aurApp->GetTarget()->SetVignette(apply ? GetMiscValue() : 0);
5571}
5572
5573void AuraEffect::HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const
5574{
5575 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5576 return;
5577
5578 Player* target = aurApp->GetTarget()->ToPlayer();
5579 if (!target)
5580 return;
5581
5582 if (apply)
5584 else if (!target->GetMap()->Instanceable())
5586}
5587
5588void AuraEffect::HandleMastery(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
5589{
5590 if (!(mode & AURA_EFFECT_HANDLE_REAL))
5591 return;
5592
5593 Player* target = aurApp->GetTarget()->ToPlayer();
5594 if (!target)
5595 return;
5596
5597 target->UpdateMastery();
5598}
5599
5601{
5602 uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
5603 if (triggerSpellId == 0)
5604 {
5605 TC_LOG_WARN("spells.aura.effect.nospell", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} [EffectIndex: {}] does not have triggered spell.", GetId(), GetEffIndex());
5606 return;
5607 }
5608
5609 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
5610 {
5611 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
5612 {
5613 triggerCaster->CastSpell(target, triggerSpellId, CastSpellExtraArgsInit{
5615 .TriggeringAura = this
5616 });
5617 TC_LOG_DEBUG("spells.aura.effect", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
5618 }
5619 }
5620 else
5621 TC_LOG_ERROR("spells.aura.effect.nospell", "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
5622}
5623
5625{
5626 uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
5627 if (triggerSpellId == 0)
5628 {
5629 TC_LOG_WARN("spells.aura.effect.nospell", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} [EffectIndex: {}] does not have triggered spell.", GetId(), GetEffIndex());
5630 return;
5631 }
5632
5633 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
5634 {
5635 if (Unit* triggerCaster = triggeredSpellInfo->NeedsToBeTriggeredByCaster(m_spellInfo) ? caster : target)
5636 {
5637 CastSpellExtraArgs args(this);
5639 for (std::size_t i = 0; i < triggeredSpellInfo->GetEffects().size(); ++i)
5641 triggerCaster->CastSpell(target, triggerSpellId, args);
5642 TC_LOG_DEBUG("spells.aura.effect", "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} Trigger {}", GetId(), triggeredSpellInfo->Id);
5643 }
5644 }
5645 else
5646 TC_LOG_ERROR("spells.aura.effect.nospell","AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
5647}
5648
5650{
5651 if (!target->IsAlive())
5652 return;
5653
5654 if (target->IsImmunedToDamage(caster, GetSpellInfo(), &GetSpellEffectInfo()))
5655 {
5656 SendTickImmune(target, caster);
5657 return;
5658 }
5659
5660 // Consecrate ticks can miss and will not show up in the combat log
5661 // dynobj auras must always have a caster
5663 ASSERT_NOTNULL(caster)->SpellHitResult(target, GetSpellInfo(), false, true) != SPELL_MISS_NONE)
5664 return;
5665
5667
5669
5670 // ignore negative values (can be result apply spellmods to aura damage
5671 uint32 damage = std::max(GetAmountAsInt(), 0);
5672
5673 // Script Hook For HandlePeriodicDamageAurasTick -- Allow scripts to change the Damage pre class mitigation calculations
5674 sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);
5675
5676 switch (GetAuraType())
5677 {
5679 {
5680 if (caster)
5681 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetSpellEffectInfo(), stackAmountForBonuses, nullptr, this);
5682 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT);
5683
5684 if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_GENERIC)
5685 {
5686 switch (GetId())
5687 {
5688 case 70911: // Unbound Plague
5689 case 72854: // Unbound Plague
5690 case 72855: // Unbound Plague
5691 case 72856: // Unbound Plague
5692 damage *= uint32(pow(1.25f, int32(_ticksDone)));
5693 break;
5694 default:
5695 break;
5696 }
5697 }
5698 break;
5699 }
5701 {
5703
5704 damage = CalculatePct(caster->CalculateDamage(attackType, false, true), GetAmount());
5705
5706 // Add melee damage bonuses (also check for negative)
5707 if (caster)
5708 damage = caster->MeleeDamageBonusDone(target, damage, attackType, DOT, GetSpellInfo(), &GetSpellEffectInfo(), GetSpellEffectInfo().Mechanic, GetSpellInfo()->GetSchoolMask(), nullptr, this);
5709
5710 damage = target->MeleeDamageBonusTaken(caster, damage, attackType, DOT, GetSpellInfo());
5711 break;
5712 }
5714 // ceil obtained value, it may happen that 10 ticks for 10% damage may not kill owner
5715 damage = uint32(ceil(CalculatePct<float, float>(target->GetMaxHealth(), damage)));
5716 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT);
5717 break;
5718 default:
5719 break;
5720 }
5721
5722 bool crit = roll_chance(GetCritChanceFor(caster, target));
5723 if (crit)
5724 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
5725
5726 // Calculate armor mitigation
5727 if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo()))
5728 {
5729 uint32 damageReducedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetAttackType(), GetBase()->GetCasterLevel());
5730 cleanDamage.mitigated_damage += damage - damageReducedArmor;
5731 damage = damageReducedArmor;
5732 }
5733
5735 {
5737 damage = target->CalculateAOEAvoidance(damage, m_spellInfo->SchoolMask, (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE));
5738 }
5739
5740 int32 dmg = damage;
5741 if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS) && caster && caster->CanApplyResilience())
5742 Unit::ApplyResilience(target, &dmg);
5743 damage = dmg;
5744
5745 DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK);
5746 Unit::CalcAbsorbResist(damageInfo);
5747 damage = damageInfo.GetDamage();
5748
5749 uint32 absorb = damageInfo.GetAbsorb();
5750 uint32 resist = damageInfo.GetResist();
5751 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} attacked {} for {} dmg inflicted by {} absorb is {}",
5752 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
5753
5754 Unit::DealDamageMods(caster, target, damage, &absorb);
5755
5756 // Set trigger flag
5759 ProcFlagsHit hitMask = damageInfo.GetHitMask();
5760 if (damage)
5761 {
5762 hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
5763 procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
5764 }
5765
5766 int32 overkill = damage - target->GetHealth();
5767 if (overkill < 0)
5768 overkill = 0;
5769
5770 SpellPeriodicAuraLogInfo pInfo(this, damage, dmg, overkill, absorb, resist, 0.0f, crit);
5771
5772 Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
5773
5774 Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, hitMask, nullptr, &damageInfo, nullptr);
5775
5776 target->SendPeriodicAuraLog(&pInfo);
5777}
5778
5780{
5782}
5783
5785{
5786 if (!target->IsAlive())
5787 return;
5788
5789 if (target->IsImmunedToDamage(caster, GetSpellInfo(), &GetSpellEffectInfo()))
5790 {
5791 SendTickImmune(target, caster);
5792 return;
5793 }
5794
5795 // dynobj auras must always have a caster
5797 ASSERT_NOTNULL(caster)->SpellHitResult(target, GetSpellInfo(), false, true) != SPELL_MISS_NONE)
5798 return;
5799
5800 CleanDamage cleanDamage = CleanDamage(0, 0, GetSpellInfo()->GetAttackType(), MELEE_HIT_NORMAL);
5801
5803
5804 // ignore negative values (can be result apply spellmods to aura damage
5805 uint32 damage = std::max(GetAmountAsInt(), 0);
5806
5807 if (caster)
5808 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, DOT, GetSpellEffectInfo(), stackAmountForBonuses, nullptr, this);
5809 damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT);
5810
5811 bool crit = roll_chance(GetCritChanceFor(caster, target));
5812 if (crit)
5813 damage = Unit::SpellCriticalDamageBonus(caster, m_spellInfo, damage, target);
5814
5815 // Calculate armor mitigation
5816 if (Unit::IsDamageReducedByArmor(GetSpellInfo()->GetSchoolMask(), GetSpellInfo()))
5817 {
5818 uint32 damageReducedArmor = Unit::CalcArmorReducedDamage(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetAttackType(), GetBase()->GetCasterLevel());
5819 cleanDamage.mitigated_damage += damage - damageReducedArmor;
5820 damage = damageReducedArmor;
5821 }
5822
5824 {
5826 damage = target->CalculateAOEAvoidance(damage, m_spellInfo->SchoolMask, (caster && !caster->IsControlledByPlayer()) || GetSpellInfo()->HasAttribute(SPELL_ATTR7_TREAT_AS_NPC_AOE));
5827 }
5828
5829 int32 dmg = damage;
5830 if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS) && caster && caster->CanApplyResilience())
5831 Unit::ApplyResilience(target, &dmg);
5832 damage = dmg;
5833
5834 DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, GetSpellInfo()->GetAttackType());
5835 Unit::CalcAbsorbResist(damageInfo);
5836
5837 uint32 absorb = damageInfo.GetAbsorb();
5838 uint32 resist = damageInfo.GetResist();
5839 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} health leech of {} for {} dmg inflicted by {} abs is {}",
5840 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId(), absorb);
5841
5842 Unit::DealDamageMods(caster, target, damage, &absorb);
5843
5844 // SendSpellNonMeleeDamageLog expects non-absorbed/non-resisted damage
5845 SpellNonMeleeDamage log(caster, target, GetSpellInfo(), GetBase()->GetSpellVisual(), GetSpellInfo()->GetSchoolMask(), GetBase()->GetCastId());
5846 log.damage = damage;
5847 log.originalDamage = dmg;
5848 log.absorb = absorb;
5849 log.resist = resist;
5850 log.periodicLog = true;
5851 if (crit)
5853
5854 // Set trigger flag
5857 ProcFlagsHit hitMask = damageInfo.GetHitMask();
5858 if (damage)
5859 {
5860 hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
5861 procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
5862 }
5863
5864 int32 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
5865 Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, hitMask, nullptr, &damageInfo, nullptr);
5866
5867 // process caster heal from now on (must be in world)
5868 if (!caster || !caster->IsAlive())
5869 return;
5870
5871 float gainMultiplier = GetSpellEffectInfo().CalcValueMultiplier(caster);
5872
5873 uint32 heal = caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetSpellEffectInfo(), stackAmountForBonuses, nullptr, this);
5874 heal = caster->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
5875
5876 HealInfo healInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
5877 caster->HealBySpell(healInfo);
5878
5879 caster->GetThreatManager().ForwardThreatForAssistingMe(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo());
5881
5882 caster->SendSpellNonMeleeDamageLog(&log);
5883}
5884
5886{
5887 if (!caster || !caster->IsAlive() || !target->IsAlive())
5888 return;
5889
5890 if (target->IsImmunedToAuraPeriodicTick(caster, this))
5891 {
5892 SendTickImmune(target, caster);
5893 return;
5894 }
5895
5896 uint32 damage = std::max(GetAmountAsInt(), 0);
5897 // do not kill health donator
5898 if (caster->GetHealth() < damage)
5899 damage = caster->GetHealth() - 1;
5900 if (!damage)
5901 return;
5902
5903 caster->ModifyHealth(-(int32)damage);
5904 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: donator {} target {} damage {}.", caster->GetEntry(), target->GetEntry(), damage);
5905
5906 float gainMultiplier = GetSpellEffectInfo().CalcValueMultiplier(caster);
5907
5908 damage = int32(damage * gainMultiplier);
5909
5910 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
5911 caster->HealBySpell(healInfo);
5913}
5914
5916{
5917 if (!target->IsAlive())
5918 return;
5919
5920 if (target->IsImmunedToAuraPeriodicTick(caster, this))
5921 {
5922 SendTickImmune(target, caster);
5923 return;
5924 }
5925
5926 // don't regen when permanent aura target has full power
5927 if (GetBase()->IsPermanent() && target->IsFullHealth())
5928 return;
5929
5931
5932 // ignore negative values (can be result apply spellmods to aura damage
5933 uint32 damage = std::max(GetAmountAsInt(), 0);
5934
5936 damage = uint32(target->CountPctFromMaxHealth(damage));
5937 else if (caster)
5938 damage = caster->SpellHealingBonusDone(target, GetSpellInfo(), damage, DOT, GetSpellEffectInfo(), stackAmountForBonuses, nullptr, this);
5939
5940 damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT);
5941
5942 bool crit = roll_chance(GetCritChanceFor(caster, target));
5943 if (crit)
5944 damage = Unit::SpellCriticalHealingBonus(caster, m_spellInfo, damage, target);
5945
5946 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} heal of {} for {} health inflicted by {}",
5947 GetCasterGUID().ToString(), target->GetGUID().ToString(), damage, GetId());
5948
5949 uint32 heal = damage;
5950
5951 HealInfo healInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask());
5952 Unit::CalcHealAbsorb(healInfo);
5953 Unit::DealHeal(healInfo);
5954
5955 SpellPeriodicAuraLogInfo pInfo(this, heal, damage, heal - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit);
5956 target->SendPeriodicAuraLog(&pInfo);
5957
5958 if (caster)
5959 target->GetThreatManager().ForwardThreatForAssistingMe(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo());
5960
5961 // %-based heal - does not proc auras
5963 return;
5964
5968 // ignore item heals
5969 if (GetBase()->GetCastItemGUID().IsEmpty())
5970 Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, PROC_SPELL_TYPE_HEAL, PROC_SPELL_PHASE_HIT, hitMask, nullptr, nullptr, &healInfo);
5971}
5972
5974{
5975 Powers powerType = Powers(GetMiscValue());
5976
5977 if (!caster || !caster->IsAlive() || !target->IsAlive() || target->GetPowerType() != powerType)
5978 return;
5979
5980 if (target->IsImmunedToAuraPeriodicTick(caster, this))
5981 {
5982 SendTickImmune(target, caster);
5983 return;
5984 }
5985
5987 caster->SpellHitResult(target, GetSpellInfo(), false, true) != SPELL_MISS_NONE)
5988 return;
5989
5990 // ignore negative values (can be result apply spellmods to aura damage
5991 int32 drainAmount = std::max(GetAmountAsInt(), 0);
5992
5993 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} power leech of {} for {} dmg inflicted by {}",
5994 GetCasterGUID().ToString(), target->GetGUID().ToString(), drainAmount, GetId());
5995
5996 int32 drainedAmount = -target->ModifyPower(powerType, -drainAmount);
5997
5998 float gainMultiplier = GetSpellEffectInfo().CalcValueMultiplier(caster);
5999
6000 SpellPeriodicAuraLogInfo pInfo(this, drainedAmount, drainAmount, 0, 0, 0, gainMultiplier, false);
6001
6002 int32 gainAmount = int32(drainedAmount * gainMultiplier);
6003 int32 gainedAmount = 0;
6004 if (gainAmount)
6005 {
6006 gainedAmount = caster->ModifyPower(powerType, gainAmount);
6007 // energize is not modified by threat modifiers
6008 if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_NO_HELPFUL_THREAT))
6009 target->GetThreatManager().AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo(), true);
6010 }
6011
6012 // Drain Mana - Mana Feed effect
6014 {
6015 SpellEffectValue manaFeedVal = 0;
6016 if (AuraEffect const* aurEff = GetBase()->GetEffect(EFFECT_1))
6017 manaFeedVal = aurEff->GetAmount();
6018
6019 if (manaFeedVal > 0)
6020 {
6021 int32 feedAmount = CalculatePct(gainedAmount, manaFeedVal);
6022
6023 CastSpellExtraArgs args(this);
6024 args.AddSpellMod(SPELLVALUE_BASE_POINT0, feedAmount);
6025 caster->CastSpell(caster, 32554, args);
6026 }
6027 }
6028
6029 target->SendPeriodicAuraLog(&pInfo);
6030}
6031
6033{
6034 Powers powerType;
6035 if (GetMiscValue() == POWER_ALL)
6036 powerType = target->GetPowerType();
6037 else
6038 powerType = Powers(GetMiscValue());
6039
6040 if (!target->IsAlive() || !target->GetMaxPower(powerType))
6041 return;
6042
6043 if (target->IsImmunedToAuraPeriodicTick(caster, this))
6044 {
6045 SendTickImmune(target, caster);
6046 return;
6047 }
6048
6049 // don't regen when permanent aura and limit is already reached
6050 if (GetBase()->IsPermanent())
6051 {
6052 if (GetAmount() >= 0)
6053 {
6054 if (target->GetPower(powerType) >= target->GetMaxPower(powerType))
6055 return;
6056 }
6057 else
6058 if (target->GetPower(powerType) <= target->GetMinPower(powerType))
6059 return;
6060 }
6061
6062 int32 amount = CalculatePct(target->GetMaxPower(powerType), GetAmount());
6063 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
6064 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
6065
6066 SpellPeriodicAuraLogInfo pInfo(this, amount, amount, 0, 0, 0, 0.0f, false);
6067 int32 gain = target->ModifyPower(powerType, amount);
6068
6069 if (caster)
6070 target->GetThreatManager().ForwardThreatForAssistingMe(caster, std::abs(float(gain) * 0.5f), GetSpellInfo(), true);
6071
6072 target->SendPeriodicAuraLog(&pInfo);
6073}
6074
6076{
6077 Powers powerType = Powers(GetMiscValue());
6078 if (!target->IsAlive() || !target->GetMaxPower(powerType))
6079 return;
6080
6081 if (target->IsImmunedToAuraPeriodicTick(caster, this))
6082 {
6083 SendTickImmune(target, caster);
6084 return;
6085 }
6086
6087 // don't regen when permanent aura target has full power
6088 if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
6089 return;
6090
6091 // ignore negative values (can be result apply spellmods to aura damage
6092 int32 amount = std::max(GetAmountAsInt(), 0);
6093
6094 SpellPeriodicAuraLogInfo pInfo(this, amount, amount, 0, 0, 0, 0.0f, false);
6095
6096 TC_LOG_DEBUG("spells.aura.effect", "PeriodicTick: {} energize {} for {} dmg inflicted by {}",
6097 GetCasterGUID().ToString(), target->GetGUID().ToString(), amount, GetId());
6098
6099 int32 gain = target->ModifyPower(powerType, amount);
6100 target->SendPeriodicAuraLog(&pInfo);
6101
6102 if (caster)
6103 target->GetThreatManager().ForwardThreatForAssistingMe(caster, float(gain)*0.5f, GetSpellInfo(), true);
6104}
6105
6107{
6108 Powers powerType = Powers(GetMiscValue());
6109
6110 if (!caster || !target->IsAlive() || target->GetPowerType() != powerType)
6111 return;
6112
6113 if (target->IsImmunedToDamage(caster, GetSpellInfo(), &GetSpellEffectInfo()))
6114 {
6115 SendTickImmune(target, caster);
6116 return;
6117 }
6118
6119 // ignore negative values (can be result apply spellmods to aura damage
6120 int32 damage = std::max(GetAmountAsInt(), 0);
6121
6122 uint32 gain = uint32(-target->ModifyPower(powerType, -damage));
6123
6124 float dmgMultiplier = GetSpellEffectInfo().CalcValueMultiplier(caster);
6125
6126 SpellInfo const* spellProto = GetSpellInfo();
6127 // maybe has to be sent different to client, but not by SMSG_PERIODICAURALOG
6128 SpellNonMeleeDamage damageInfo(caster, target, spellProto, GetBase()->GetSpellVisual(), spellProto->SchoolMask, GetBase()->GetCastId());
6129 damageInfo.periodicLog = true;
6130 // no SpellDamageBonus for burn mana
6131 caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto);
6132
6133 Unit::DealDamageMods(damageInfo.attacker, damageInfo.target, damageInfo.damage, &damageInfo.absorb);
6134
6135 // Set trigger flag
6138 ProcFlagsHit hitMask = createProcHitMask(&damageInfo, SPELL_MISS_NONE);
6140 if (damageInfo.damage)
6141 {
6142 procVictim |= PROC_FLAG_TAKE_ANY_DAMAGE;
6143 spellTypeMask |= PROC_SPELL_TYPE_DAMAGE;
6144 }
6145
6146 caster->DealSpellDamage(&damageInfo, true);
6147
6148 DamageInfo dotDamageInfo(damageInfo, DOT, BASE_ATTACK, hitMask);
6149 Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, spellTypeMask, PROC_SPELL_PHASE_HIT, hitMask, nullptr, &dotDamageInfo, nullptr);
6150
6151 caster->SendSpellNonMeleeDamageLog(&damageInfo);
6152}
6153
6155{
6156 if (!caster || !GetBase()->CanPeriodicTickCrit())
6157 return 0.0f;
6158
6159 Player* modOwner = caster->GetSpellModOwner();
6160 if (!modOwner)
6161 return 0.0f;
6162
6163 float critChance = modOwner->SpellCritChanceDone(nullptr, this, GetSpellInfo()->GetSchoolMask(), GetSpellInfo()->GetAttackType());
6164 return std::max(0.0f, critChance);
6165}
6166
6168{
6169 SpellEffectValue const damageLeft = GetAmount() - static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage());
6170
6171 if (damageLeft <= 0)
6172 aurApp->GetTarget()->RemoveAura(aurApp);
6173 else
6174 ChangeAmount(damageLeft);
6175}
6176
6178{
6179 Unit* triggerCaster = aurApp->GetTarget();
6180 Unit* triggerTarget = eventInfo.GetProcTarget();
6182 triggerTarget = eventInfo.GetActor();
6183
6184 uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
6185 if (triggerSpellId == 0)
6186 {
6187 TC_LOG_WARN("spells.aura.effect.nospell", "AuraEffect::HandleProcTriggerSpellAuraProc: Spell {} [EffectIndex: {}] does not have triggered spell.", GetId(), GetEffIndex());
6188 return;
6189 }
6190
6191 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
6192 {
6193 TC_LOG_DEBUG("spells.aura.effect", "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell {} from aura {} proc", triggeredSpellInfo->Id, GetId());
6194 triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo->Id, CastSpellExtraArgs(this)
6195 .SetTriggeringSpell(eventInfo.GetProcSpell())
6197 }
6198 else if (triggerSpellId && GetAuraType() != SPELL_AURA_DUMMY)
6199 TC_LOG_ERROR("spells.aura.effect.nospell","AuraEffect::HandleProcTriggerSpellAuraProc: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
6200}
6201
6203{
6204 Unit* triggerCaster = aurApp->GetTarget();
6205 Unit* triggerTarget = eventInfo.GetProcTarget();
6207 triggerTarget = eventInfo.GetActor();
6208
6209 uint32 triggerSpellId = GetSpellEffectInfo().TriggerSpell;
6210 if (triggerSpellId == 0)
6211 {
6212 TC_LOG_WARN("spells.aura.effect.nospell", "AuraEffect::HandleProcTriggerSpellAuraProc: Spell {} [EffectIndex: {}] does not have triggered spell.", GetId(), GetEffIndex());
6213 return;
6214 }
6215
6216 if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId, GetBase()->GetCastDifficulty()))
6217 {
6218 CastSpellExtraArgs args(this);
6220 args.SetTriggeringSpell(eventInfo.GetProcSpell());
6222 triggerCaster->CastSpell(triggerTarget, triggerSpellId, args);
6223 TC_LOG_DEBUG("spells.aura.effect", "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell {} with value {} from aura {} proc", triggeredSpellInfo->Id, GetAmount(), GetId());
6224 }
6225 else
6226 TC_LOG_ERROR("spells.aura.effect.nospell","AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Spell {} has non-existent spell {} in EffectTriggered[{}] and is therefore not triggered.", GetId(), triggerSpellId, GetEffIndex());
6227}
6228
6230{
6231 Unit* target = aurApp->GetTarget();
6232 Unit* triggerTarget = eventInfo.GetProcTarget();
6233 if (triggerTarget->IsImmunedToDamage(target, GetSpellInfo(), &GetSpellEffectInfo()))
6234 {
6235 SendTickImmune(triggerTarget, target);
6236 return;
6237 }
6238
6239 SpellNonMeleeDamage damageInfo(target, triggerTarget, GetSpellInfo(), GetBase()->GetSpellVisual(), GetSpellInfo()->SchoolMask, GetBase()->GetCastId());
6240 uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmountAsInt(), SPELL_DIRECT_DAMAGE, GetSpellEffectInfo(), 1, nullptr, this);
6241 damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
6242 target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo());
6243 Unit::DealDamageMods(damageInfo.attacker, damageInfo.target, damageInfo.damage, &damageInfo.absorb);
6244 TC_LOG_DEBUG("spells.aura.effect", "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering {} spell damage from aura {} proc", damage, GetId());
6245 target->DealSpellDamage(&damageInfo, true);
6246 target->SendSpellNonMeleeDamageLog(&damageInfo);
6247}
6248
6249void AuraEffect::HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const
6250{
6251 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6252 return;
6253
6254 Player* target = aurApp->GetTarget()->ToPlayer();
6255
6256 if (!target)
6257 return;
6258
6259 if (apply)
6261 else
6262 target->GetMap()->SendZoneWeather(target->GetZoneId(), target);
6263}
6264
6265void AuraEffect::HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode, bool apply) const
6266{
6267 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6268 return;
6269
6270 uint32 altPowerId = GetMiscValue();
6271 UnitPowerBarEntry const* powerEntry = sUnitPowerBarStore.LookupEntry(altPowerId);
6272 if (!powerEntry)
6273 return;
6274
6275 if (apply)
6276 aurApp->GetTarget()->SetMaxPower(POWER_ALTERNATE_POWER, powerEntry->MaxPower);
6277 else
6279}
6280
6281void AuraEffect::HandleModSpellCategoryCooldown(AuraApplication const* aurApp, uint8 mode, bool apply) const
6282{
6283 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6284 return;
6285
6286 Player* target = aurApp->GetTarget()->ToPlayer();
6287 if (!target)
6288 return;
6289
6290 if (apply)
6292 else
6294}
6295
6296void AuraEffect::HandleModRecoveryRate(AuraApplication const* aurApp, uint8 mode, bool apply) const
6297{
6299 return;
6300
6301 float rate = 100.0f / (std::max<float>(GetAmount(), -99.0f) + 100.0f);
6302
6304 {
6305 return IsAffectingSpell(sSpellMgr->GetSpellInfo(cooldown.SpellId, DIFFICULTY_NONE));
6306 }, rate, apply);
6307}
6308
6310{
6312 return;
6313
6314 float rate = 100.0f / (std::max<float>(GetAmount(), -99.0f) + 100.0f);
6315
6317 {
6318 SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(cooldown.SpellId, DIFFICULTY_NONE);
6319 return spellInfo->HasLabel(GetMiscValue()) || (GetMiscValueB() && spellInfo->HasLabel(GetMiscValueB()));
6320 }, rate, apply);
6321}
6322
6323void AuraEffect::HandleModChargeRecoveryRate(AuraApplication const* aurApp, uint8 mode, bool apply) const
6324{
6326 return;
6327
6328 float rate = 100.0f / (std::max<float>(GetAmount(), -99.0f) + 100.0f);
6329 aurApp->GetTarget()->GetSpellHistory()->UpdateChargeRecoveryRate(GetMiscValue(), rate, apply);
6330}
6331
6332void AuraEffect::HandleShowConfirmationPrompt(AuraApplication const* aurApp, uint8 mode, bool apply) const
6333{
6334 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6335 return;
6336
6337 Player* player = aurApp->GetTarget()->ToPlayer();
6338 if (!player)
6339 return;
6340
6341 if (apply)
6342 player->AddTemporarySpell(GetSpellEffectInfo().TriggerSpell);
6343 else
6344 player->RemoveTemporarySpell(GetSpellEffectInfo().TriggerSpell);
6345}
6346
6347void AuraEffect::HandleOverridePetSpecs(AuraApplication const* aurApp, uint8 mode, bool apply) const
6348{
6349 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6350 return;
6351
6352 Player* player = aurApp->GetTarget()->ToPlayer();
6353 if (!player)
6354 return;
6355
6356 if (player->GetClass() != CLASS_HUNTER)
6357 return;
6358
6359 Pet* pet = player->GetPet();
6360 if (!pet)
6361 return;
6362
6363 ChrSpecializationEntry const* currSpec = sChrSpecializationStore.LookupEntry(pet->GetSpecialization());
6364 if (!currSpec)
6365 return;
6366
6367 pet->SetSpecialization(sDB2Manager.GetChrSpecializationByIndex(apply ? PET_SPEC_OVERRIDE_CLASS_INDEX : 0, currSpec->OrderIndex)->ID);
6368}
6369
6371{
6372 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6373 return;
6374
6375 Player* target = aurApp->GetTarget()->ToPlayer();
6376 if (!target)
6377 return;
6378
6379 if (apply)
6383}
6384
6385void AuraEffect::HandlePlayScene(AuraApplication const* aurApp, uint8 mode, bool apply) const
6386{
6387 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6388 return;
6389
6390 Player* player = aurApp->GetTarget()->ToPlayer();
6391 if (!player)
6392 return;
6393
6394 if (apply)
6395 player->GetSceneMgr().PlayScene(GetMiscValue());
6396 else
6397 {
6398 if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
6399 {
6400 if (Optional<uint32> sceneInstanceId = player->GetSceneMgr().GetInstanceIdBySceneId(GetMiscValue()))
6401 player->GetSceneMgr().OnSceneComplete(*sceneInstanceId);
6402 }
6404 }
6405}
6406
6407void AuraEffect::HandleCreateAreaTrigger(AuraApplication const* aurApp, uint8 mode, bool apply) const
6408{
6409 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6410 return;
6411
6412 Unit* target = aurApp->GetTarget();
6413
6414 if (apply)
6415 {
6416 AreaTriggerCreatePropertiesId createPropertiesId = { uint32(GetMiscValue()), false };
6417 Position pos = { target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() }; // drop orientation for attached areatrigger
6418 AreaTrigger::CreateAreaTrigger(createPropertiesId, pos, GetBase()->GetDuration(), GetCaster(), target, GetBase()->GetSpellVisual(), GetSpellInfo(), nullptr, this);
6419 }
6420 else
6421 {
6422 if (Unit* caster = GetCaster())
6423 caster->RemoveAreaTrigger(this);
6424 }
6425}
6426
6427void AuraEffect::HandleAuraPvpTalents(AuraApplication const* auraApp, uint8 mode, bool apply) const
6428{
6429 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6430 return;
6431
6432 if (Player* target = auraApp->GetTarget()->ToPlayer())
6433 {
6434 if (apply)
6435 target->TogglePvpTalents(true);
6436 else if (!target->HasAuraType(SPELL_AURA_PVP_TALENTS))
6437 target->TogglePvpTalents(false);
6438 }
6439}
6440
6441void AuraEffect::HandleLinkedSummon(AuraApplication const* aurApp, uint8 mode, bool apply) const
6442{
6443 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6444 return;
6445
6446 Unit* target = aurApp->GetTarget();
6447 SpellInfo const* triggerSpellInfo = sSpellMgr->GetSpellInfo(GetSpellEffectInfo().TriggerSpell, GetBase()->GetCastDifficulty());
6448 if (!triggerSpellInfo)
6449 return;
6450
6451 // on apply cast summon spell
6452 if (apply)
6453 {
6454 CastSpellExtraArgs args(this);
6455 args.CastDifficulty = triggerSpellInfo->Difficulty;
6456 target->CastSpell(target, triggerSpellInfo->Id, args);
6457 }
6458 // on unapply we need to search for and remove the summoned creature
6459 else
6460 {
6461 std::vector<uint32> summonedEntries;
6462 for (SpellEffectInfo const& spellEffect : triggerSpellInfo->GetEffects())
6463 if (spellEffect.IsEffect(SPELL_EFFECT_SUMMON))
6464 if (uint32 summonEntry = spellEffect.MiscValue)
6465 summonedEntries.push_back(summonEntry);
6466
6467 // we don't know if there can be multiple summons for the same effect, so consider only 1 summon for each effect
6468 // most of the spells have multiple effects with the same summon spell id for multiple spawns, so right now it's safe to assume there's only 1 spawn per effect
6469 for (uint32 summonEntry : summonedEntries)
6470 {
6471 std::list<Creature*> nearbyEntries;
6472 target->GetCreatureListWithEntryInGrid(nearbyEntries, summonEntry);
6473 for (auto creature : nearbyEntries)
6474 {
6475 if (creature->GetOwnerGUID() == target->GetGUID())
6476 {
6477 creature->DespawnOrUnsummon();
6478 break;
6479 }
6480 else if (TempSummon* tempSummon = creature->ToTempSummon())
6481 {
6482 if (tempSummon->GetSummonerGUID() == target->GetGUID())
6483 {
6484 tempSummon->DespawnOrUnsummon();
6485 break;
6486 }
6487 }
6488 }
6489 }
6490 }
6491}
6492
6493void AuraEffect::HandleSetFFAPvP(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
6494{
6495 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6496 return;
6497
6498 Player* target = aurApp->GetTarget()->ToPlayer();
6499 if (!target)
6500 return;
6501
6502 target->UpdatePvPState(true);
6503}
6504
6505void AuraEffect::HandleModOverrideZonePVPType(AuraApplication const* aurApp, uint8 mode, bool apply) const
6506{
6507 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6508 return;
6509
6510 Player* target = aurApp->GetTarget()->ToPlayer();
6511 if (!target)
6512 return;
6513
6514 if (apply)
6518 else
6520
6521 target->UpdateHostileAreaState(sAreaTableStore.LookupEntry(target->GetZoneId()));
6522 target->UpdatePvPState();
6523}
6524
6525void AuraEffect::HandleBattlegroundPlayerPosition(AuraApplication const* aurApp, uint8 mode, bool apply) const
6526{
6527 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6528 return;
6529
6530 Player* target = aurApp->GetTarget()->ToPlayer();
6531 if (!target)
6532 return;
6533
6534 if (!apply && aurApp->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT)
6535 {
6536 if (GetCasterGUID().IsGameObject())
6537 {
6538 if (GameObjectTemplate const* gobTemplate = sObjectMgr->GetGameObjectTemplate(GetCasterGUID().GetEntry()))
6539 {
6540 if (gobTemplate->type == GAMEOBJECT_TYPE_NEW_FLAG)
6541 {
6542 if (GameObject* gameObjectCaster = target->GetMap()->GetGameObject(GetCasterGUID()))
6543 {
6544 gameObjectCaster->HandleCustomTypeCommand(GameObjectType::SetNewFlagState(FlagState::Dropped, target));
6545 if (GameObject* droppedFlag = gameObjectCaster->SummonGameObject(gameObjectCaster->GetGOInfo()->newflag.FlagDrop, target->GetPosition(), QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.f, 0.f), Seconds(gameObjectCaster->GetGOInfo()->newflag.ExpireDuration / 1000), GO_SUMMON_TIMED_DESPAWN))
6546 droppedFlag->SetOwnerGUID(gameObjectCaster->GetGUID());
6547 }
6548 }
6549 else if (gobTemplate->type == GAMEOBJECT_TYPE_FLAGSTAND)
6550 {
6551 if (ZoneScript* zonescript = target->FindZoneScript())
6552 zonescript->OnFlagDropped(GetCasterGUID(), target);
6553 }
6554 }
6555 }
6556 }
6557
6558 BattlegroundMap* battlegroundMap = target->GetMap()->ToBattlegroundMap();
6559 if (!battlegroundMap)
6560 return;
6561
6562 Battleground* bg = battlegroundMap->GetBG();
6563 if (!bg)
6564 return;
6565
6566 if (apply)
6567 {
6569 playerPosition.Guid = target->GetGUID();
6570 playerPosition.ArenaSlot = static_cast<int8>(GetMiscValue());
6571 playerPosition.Pos = target->GetPosition();
6572
6577 else
6578 TC_LOG_WARN("spell.auras", "Unknown aura effect {} handled by HandleBattlegroundPlayerPosition.", GetAuraType());
6579
6580 bg->AddPlayerPosition(playerPosition);
6581 }
6582 else
6583 bg->RemovePlayerPosition(target->GetGUID());
6584}
6585
6586void AuraEffect::HandleStoreTeleportReturnPoint(AuraApplication const* aurApp, uint8 mode, bool apply) const
6587{
6588 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6589 return;
6590
6591 Player* playerTarget = aurApp->GetTarget()->ToPlayer();
6592 if (!playerTarget)
6593 return;
6594
6595 if (apply)
6596 playerTarget->AddStoredAuraTeleportLocation(GetSpellInfo()->Id);
6597 else if (!playerTarget->GetSession()->isLogingOut())
6599}
6600
6601void AuraEffect::HandleMountRestrictions(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
6602{
6603 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6604 return;
6605
6606 aurApp->GetTarget()->UpdateMountCapability();
6607}
6608
6609void AuraEffect::HandleCosmeticMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const
6610{
6611 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6612 return;
6613
6614 if (apply)
6616 else
6617 aurApp->GetTarget()->SetCosmeticMountDisplayId(0); // set cosmetic mount to 0, even if multiple auras are active; tested with zandalari racial + divine steed
6618
6619 Player* playerTarget = aurApp->GetTarget()->ToPlayer();
6620 if (!playerTarget)
6621 return;
6622
6624}
6625
6627{
6628 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6629 return;
6630
6631 Player* playerTarget = aurApp->GetTarget()->ToPlayer();
6632 if (!playerTarget)
6633 return;
6634
6635 if (apply)
6637 else
6638 {
6639 int32 mountCapabilityFlags = 0;
6640 for (AuraEffect* otherAura : playerTarget->GetAuraEffectsByType(GetAuraType()))
6641 mountCapabilityFlags |= otherAura->GetMiscValue();
6642
6643 playerTarget->ReplaceAllRequiredMountCapabilityFlags(mountCapabilityFlags);
6644 }
6645}
6646
6648{
6649 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6650 return;
6651
6652 std::vector<Aura*> suppressedAuras;
6653 for (Unit::AuraMap::value_type const& appliedAura : aurApp->GetTarget()->GetOwnedAuras())
6654 if (appliedAura.second->GetSpellInfo()->HasLabel(GetMiscValue()))
6655 suppressedAuras.push_back(appliedAura.second);
6656
6657 // Refresh applications
6658 for (Aura* aura : suppressedAuras)
6659 aura->ApplyForTargets();
6660}
6661
6662void AuraEffect::HandleForceBreathBar(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
6663{
6664 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6665 return;
6666
6667 Player* playerTarget = aurApp->GetTarget()->ToPlayer();
6668 if (!playerTarget)
6669 return;
6670
6671 playerTarget->UpdatePositionData();
6672}
6673
6674void AuraEffect::HandleAuraActAsControlZone(AuraApplication const* aurApp, uint8 mode, bool apply) const
6675{
6676 if (!(mode & AURA_EFFECT_HANDLE_REAL))
6677 return;
6678
6679 Unit* auraOwner = aurApp->GetTarget();
6680 if (!apply)
6681 {
6682 auraOwner->RemoveGameObject(GetSpellInfo()->Id, true);
6683 return;
6684 }
6685
6686 GameObjectTemplate const* gameobjectTemplate = sObjectMgr->GetGameObjectTemplate(GetMiscValue());
6687 if (!gameobjectTemplate)
6688 {
6689 TC_LOG_WARN("spells.aura.effect", "AuraEffect::HanldeAuraActAsControlZone: Spell {} [EffectIndex: {}] does not have an existing gameobject template.", GetId(), GetEffIndex());
6690 return;
6691 }
6692
6693 if (gameobjectTemplate->type != GAMEOBJECT_TYPE_CONTROL_ZONE)
6694 {
6695 TC_LOG_WARN("spells.aura.effect", "AuraEffect::HanldeAuraActAsControlZone: Spell {} [EffectIndex: {}] has a gameobject template ({}) that is not a control zone.", GetId(), GetEffIndex(), gameobjectTemplate->entry);
6696 return;
6697 }
6698
6699 if (gameobjectTemplate->displayId)
6700 {
6701 TC_LOG_WARN("spell.aura.effect", "AuraEffect::HanldeAuraActAsControlZone: Spell {} [EffectIndex: {}] has a gameobject template ({}) that has a display id. Only invisible gameobjects are supported.", GetId(), GetEffIndex(), gameobjectTemplate->entry);
6702 return;
6703 }
6704
6705 if (GameObject* controlZone = auraOwner->SummonGameObject(gameobjectTemplate->entry, auraOwner->GetPosition(), QuaternionData::fromEulerAnglesZYX(aurApp->GetTarget()->GetOrientation(), 0.f, 0.f), 24h, GO_SUMMON_TIMED_OR_CORPSE_DESPAWN))
6706 controlZone->SetSpellId(GetSpellInfo()->Id);
6707}
6708
6709template TC_GAME_API void AuraEffect::GetTargetList(std::list<Unit*>&) const;
6710template TC_GAME_API void AuraEffect::GetTargetList(std::deque<Unit*>&) const;
6711template TC_GAME_API void AuraEffect::GetTargetList(std::vector<Unit*>&) const;
6712
6713template TC_GAME_API void AuraEffect::GetApplicationList(std::list<AuraApplication*>&) const;
6714template TC_GAME_API void AuraEffect::GetApplicationList(std::deque<AuraApplication*>&) const;
6715template TC_GAME_API void AuraEffect::GetApplicationList(std::vector<AuraApplication*>&) const;
@ PLAYER_POSITION_ICON_ALLIANCE_FLAG
@ PLAYER_POSITION_ICON_HORDE_FLAG
@ CHARM_TYPE_CHARM
Definition CharmInfo.h:69
@ CHARM_TYPE_POSSESS
Definition CharmInfo.h:70
@ CHARM_TYPE_CONVERT
Definition CharmInfo.h:72
@ IN_MILLISECONDS
Definition Common.h:38
T GetEntry(std::unordered_map< uint32, T > const &map, CriteriaTreeEntry const *tree)
DB2Storage< OverrideSpellDataEntry > sOverrideSpellDataStore("OverrideSpellData.db2", &OverrideSpellDataLoadInfo::Instance)
DB2Storage< UnitPowerBarEntry > sUnitPowerBarStore("UnitPowerBar.db2", &UnitPowerBarLoadInfo::Instance)
DB2Storage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore("SpellShapeshiftForm.db2", &SpellShapeshiftFormLoadInfo::Instance)
DB2Storage< MountEquipmentEntry > sMountEquipmentStore("MountEquipment.db2", &MountEquipmentLoadInfo::Instance)
DB2Storage< ChrSpecializationEntry > sChrSpecializationStore("ChrSpecialization.db2", &ChrSpecializationLoadInfo::Instance)
DB2Storage< PowerDisplayEntry > sPowerDisplayStore("PowerDisplay.db2", &PowerDisplayLoadInfo::Instance)
DB2Storage< MountCapabilityEntry > sMountCapabilityStore("MountCapability.db2", &MountCapabilityLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
#define sDB2Manager
Definition DB2Stores.h:569
#define MAX_SHAPESHIFT_SPELLS
#define MAX_OVERRIDE_SPELL
@ MountEquipmentEffectsSuppressed
@ DIFFICULTY_NONE
Definition DBCEnums.h:933
#define TC_GAME_API
Definition Define.h:129
uint8_t uint8
Definition Define.h:156
int8_t int8
Definition Define.h:152
int32_t int32
Definition Define.h:150
uint64_t uint64
Definition Define.h:153
#define UI64LIT(N)
Definition Define.h:139
uint16_t uint16
Definition Define.h:155
uint32_t uint32
Definition Define.h:154
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:28
#define ASSERT_NOTNULL(pointer)
Definition Errors.h:82
#define ASSERT
Definition Errors.h:80
InventoryResult
Definition ItemDefines.h:25
@ EQUIP_ERR_OK
Definition ItemDefines.h:26
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:181
#define TC_LOG_ERROR(filterType__, message__,...)
Definition Log.h:190
#define TC_LOG_WARN(filterType__, message__,...)
Definition Log.h:187
@ GO_SUMMON_TIMED_DESPAWN
@ GO_SUMMON_TIMED_OR_CORPSE_DESPAWN
@ TYPEID_UNIT
Definition ObjectGuid.h:43
@ TYPEID_PLAYER
Definition ObjectGuid.h:44
#define sObjectMgr
Definition ObjectMgr.h:1885
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
#define sOutdoorPvPMgr
#define PET_FOLLOW_DIST
Definition PetDefines.h:98
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:48
@ EQUIPMENT_SLOT_MAINHAND
Definition Player.h:744
@ EQUIPMENT_SLOT_OFFHAND
Definition Player.h:745
std::vector< ItemPosCount > ItemPosCountVec
Definition Player.h:841
PlayerFieldByte2Flags
Definition Player.h:598
@ PLAYER_FIELD_BYTE2_STEALTH
Definition Player.h:600
@ PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW
Definition Player.h:601
std::unordered_map< uint32, PlayerSpell > PlayerSpellMap
Definition Player.h:352
@ PLAYER_FLAGS_GHOST
Definition Player.h:524
@ SPELLMOD_END
Definition Player.h:181
@ PLAYERSPELL_REMOVED
Definition Player.h:209
@ PLAYER_LOCAL_FLAG_CAN_USE_OBJECTS_MOUNTED
Definition Player.h:581
@ PLAYER_LOCAL_FLAG_TRACK_STEALTHED
Definition Player.h:574
@ PLAYER_LOCAL_FLAG_RELEASE_TIMER
Definition Player.h:575
#define INVENTORY_SLOT_BAG_0
Definition Player.h:723
ZonePVPTypeOverride
Definition Player.h:1214
@ RACE_TROLL
Definition RaceMask.h:36
@ RACE_UNDEAD_PLAYER
Definition RaceMask.h:33
@ RACE_ORC
Definition RaceMask.h:30
@ RACE_DRAENEI
Definition RaceMask.h:39
@ RACE_NIGHTELF
Definition RaceMask.h:32
@ RACE_BLOODELF
Definition RaceMask.h:38
@ RACE_DWARF
Definition RaceMask.h:31
@ RACE_GNOME
Definition RaceMask.h:35
@ RACE_HUMAN
Definition RaceMask.h:29
@ RACE_TAUREN
Definition RaceMask.h:34
bool roll_chance(T chance)
Definition Random.h:55
#define sScriptMgr
Definition ScriptMgr.h:1449
@ SERVERSIDE_VISIBILITY_GHOST
@ EFFECT_3
@ EFFECT_1
@ EFFECT_0
@ EFFECT_4
@ EFFECT_2
@ SPELL_ATTR10_ROLLING_PERIODIC
#define MAX_STATS
@ SPELL_ATTR7_TREAT_AS_NPC_AOE
StealthType
@ CLASS_HUNTER
@ CLASS_DRUID
#define CLASSMASK_WAND_USERS
SpellPreventionType
@ SPELL_PREVENTION_TYPE_SILENCE
@ SPELL_PREVENTION_TYPE_NO_ACTIONS
@ SPELL_PREVENTION_TYPE_PACIFY
@ GAMEOBJECT_TYPE_CONTROL_ZONE
@ GAMEOBJECT_TYPE_FLAGSTAND
@ GAMEOBJECT_TYPE_NEW_FLAG
Gender
@ GENDER_MALE
@ GENDER_FEMALE
@ SPELL_ATTR5_EXTRA_INITIAL_PERIOD
@ SPELL_ATTR5_TREAT_AS_AREA_EFFECT
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
@ SPELL_MISS_NONE
SpellSchoolMask
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_SPELL
@ SPELL_ATTR2_FAIL_ON_ALL_TARGETS_IMMUNE
@ CREATURE_TYPE_BEAST
InvisibilityType
@ INVISIBILITY_DRUNK
@ INVISIBILITY_GENERAL
@ SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
@ UNIT_DYNFLAG_SPECIALINFO
@ UNIT_DYNFLAG_TRACK_UNIT
@ SPELL_EFFECT_ADD_EXTRA_ATTACKS
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_SUMMON
WeaponAttackType
@ OFF_ATTACK
@ MAX_ATTACK
@ BASE_ATTACK
@ RANGED_ATTACK
@ MECHANIC_POLYMORPH
@ IMMUNITY_MECHANIC
#define PET_SPEC_OVERRIDE_CLASS_INDEX
@ ALLIANCE
Powers
@ MAX_POWERS
@ POWER_ALTERNATE_POWER
@ POWER_ALL
@ POWER_RUNES
@ POWER_MANA
@ SPELL_ATTR0_IS_ABILITY
@ SPELL_ATTR0_DO_NOT_DISPLAY_SPELLBOOK_AURA_ICON_COMBAT_LOG
ReputationRank
@ REP_FRIENDLY
@ SPELL_FAILED_INTERRUPTED
@ GHOST_VISIBILITY_ALIVE
@ GHOST_VISIBILITY_GHOST
@ SPELL_HIT_TYPE_CRIT
Stats
@ STAT_STRENGTH
@ STAT_STAMINA
@ AURA_STATE_ARENA_PREPARATION
@ SPELLFAMILY_PRIEST
@ SPELLFAMILY_WARLOCK
@ SPELLFAMILY_MAGE
@ SPELLFAMILY_GENERIC
@ SPELLFAMILY_PALADIN
@ SPELLFAMILY_SHAMAN
@ SPELLFAMILY_DRUID
@ SPELLFAMILY_DEATHKNIGHT
SpellSchools
@ SPELL_SCHOOL_NORMAL
@ MAX_SPELL_SCHOOL
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
@ SPELL_ATTR4_NO_HELPFUL_THREAT
@ SPELL_ATTR8_AURA_POINTS_ON_CLIENT
@ SPELL_ATTR8_MELEE_HASTE_AFFECTS_PERIODIC
@ SPELL_ATTR8_TARGET_PROCS_ON_CASTER
@ SKILL_DEFENSE
AuraTriggerOnHealthChangeDirection
AuraEffectHandleModes
@ AURA_EFFECT_HANDLE_STAT
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK
@ AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK
@ AURA_EFFECT_HANDLE_REAPPLY
@ AURA_EFFECT_HANDLE_REAL
@ AURA_EFFECT_HANDLE_SKILL
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
@ AURA_REMOVE_NONE
@ AURA_REMOVE_BY_DEFAULT
@ AURA_REMOVE_BY_DEATH
@ AURA_REMOVE_BY_EXPIRE
@ SPELL_AURA_MANA_SHIELD
@ SPELL_AURA_MOD_SCHOOL_MASK_DAMAGE_FROM_CASTER
@ SPELL_AURA_MOD_ADV_FLYING_LIFT_COEF
@ SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE
@ SPELL_AURA_MOD_DISARM_RANGED
@ SPELL_AURA_PERIODIC_WEAPON_PERCENT_DAMAGE
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_ADV_FLYING_ADD_IMPULSE_MAX_SPEED
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_MOD_DISARM
@ SPELL_AURA_DAMAGE_SHIELD
@ SPELL_AURA_MOD_ADV_FLYING_MAX_VEL
@ SPELL_AURA_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_MELEE_SLOW
@ SPELL_AURA_SHOW_CONFIRMATION_PROMPT_WITH_DIFFICULTY
@ SPELL_AURA_ADD_PCT_MODIFIER
@ TOTAL_AURAS
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT
@ SPELL_AURA_PROC_TRIGGER_SPELL
@ SPELL_AURA_MOD_FEAR
@ SPELL_AURA_MOD_NO_ACTIONS
@ SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_DOWN
@ SPELL_AURA_OBS_MOD_POWER
@ SPELL_AURA_ADD_FLAT_MODIFIER
@ SPELL_AURA_MOD_STEALTH_DETECT
@ SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_MOD_MELEE_HASTE
@ SPELL_AURA_MOD_ROOT_2
@ SPELL_AURA_MOD_SPELL_CRIT_CHANCE
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_DISABLE_GRAVITY
@ SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_DUMMY
@ SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
@ SPELL_AURA_FLY
@ SPELL_AURA_MOD_PACIFY
@ SPELL_AURA_MOD_SILENCE
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT2
@ SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT
@ SPELL_AURA_MOD_DISARM_OFFHAND
@ SPELL_AURA_MOD_STAT
@ SPELL_AURA_MOD_FAKE_INEBRIATE
@ SPELL_AURA_ADD_FLAT_MODIFIER_BY_SPELL_LABEL
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_GHOST
@ SPELL_AURA_DETECT_AMORE
@ SPELL_AURA_MOD_ROOT
@ SPELL_AURA_SCHOOL_IMMUNITY
@ SPELL_AURA_MOUNTED
@ SPELL_AURA_MOD_POWER_COST_SCHOOL
@ SPELL_AURA_MECHANIC_IMMUNITY
@ SPELL_AURA_MOD_BASE_MANA_PCT
@ SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT
@ SPELL_AURA_MOD_SPELL_DAMAGE_FROM_CASTER
@ SPELL_AURA_MOD_OVERRIDE_ZONE_PVP_TYPE
@ SPELL_AURA_MOD_PACIFY_SILENCE
@ SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY
@ SPELL_AURA_MOD_MAX_POWER_PCT
@ SPELL_AURA_MOD_VERSATILITY
@ SPELL_AURA_TRANSFORM
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_MOD_RESISTANCE_PCT
@ SPELL_AURA_BATTLEGROUND_PLAYER_POSITION_FACTIONAL
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_MOD_INVISIBILITY_DETECT
@ SPELL_AURA_MOD_BASE_RESISTANCE_PCT
@ SPELL_AURA_MOD_ADV_FLYING_AIR_FRICTION
@ SPELL_AURA_MOD_ADV_FLYING_OVER_MAX_DECELERATION
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_PROC_TRIGGER_DAMAGE
@ SPELL_AURA_DAMAGE_IMMUNITY
@ SPELL_AURA_POWER_BURN
@ SPELL_AURA_MOD_PERCENT_STAT
@ SPELL_AURA_MOD_ADV_FLYING_BANKING_RATE
@ SPELL_AURA_MOD_CONFUSE
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
@ SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_UP
@ SPELL_AURA_PERIODIC_DUMMY
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
@ SPELL_AURA_MOD_BASE_HEALTH_PCT
@ SPELL_AURA_PVP_TALENTS
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
@ SPELL_AURA_NO_REAGENT_USE
@ SPELL_AURA_MOD_UNATTACKABLE
@ SPELL_AURA_ADD_PCT_MODIFIER_BY_SPELL_LABEL
@ SPELL_AURA_MOD_STEALTH
@ SPELL_AURA_ALLOW_USING_GAMEOBJECTS_WHILE_MOUNTED
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_BATTLEGROUND_PLAYER_POSITION
@ SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL
@ SPELL_AURA_MOD_ATTACK_POWER_PCT
@ SPELL_AURA_MOD_SKILL_TALENT
@ SPELL_AURA_PHASE_ALWAYS_VISIBLE
@ SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT
@ SPELL_AURA_MOD_STUN
ShapeshiftForm
@ FORM_SHADOWFORM
@ FORM_BEAR_FORM
@ FORM_BERSERKER_STANCE
@ FORM_BATTLE_STANCE
@ FORM_DIRE_BEAR_FORM
@ FORM_MOONKIN_FORM
@ FORM_TREE_OF_LIFE
@ FORM_GHOST_WOLF
@ FORM_FLIGHT_FORM_EPIC
@ FORM_CAT_FORM
@ FORM_AQUATIC_FORM
@ FORM_NONE
@ FORM_TRAVEL_FORM
@ FORM_AMBIENT
@ FORM_STEALTH
@ FORM_FLIGHT_FORM
@ FORM_SPIRIT_OF_REDEMPTION
@ FORM_DEFENSIVE_STANCE
@ FORM_METAMORPHOSIS
@ FORM_GHOUL
@ UNIT_AURA_TYPE
AuraTriggerOnPowerChangeDirection
NonDefaultConstructible< pAuraEffectHandler > AuraEffectHandler[TOTAL_AURAS]
static void InterruptSpellsWithPreventionTypeOnAuraApply(Unit *target, SpellPreventionType preventionType)
static void HandleAuraDisableGravity(Unit *target, bool apply)
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
SpellModOp
@ TRIGGERED_FULL_MASK
Used when doing CastSpell with triggered == true.
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_REAGENT_COST
Will ignore reagent cost.
SpellValueModFloat
@ SPELLVALUE_BASE_POINT0
#define MAX_SPELLMOD
@ SPELL_ATTR0_CU_CAN_CRIT
Definition SpellInfo.h:151
@ PROC_SPELL_PHASE_HIT
Definition SpellMgr.h:225
#define sSpellMgr
Definition SpellMgr.h:812
ProcFlagsSpellType
Definition SpellMgr.h:211
@ PROC_SPELL_TYPE_HEAL
Definition SpellMgr.h:214
@ PROC_SPELL_TYPE_DAMAGE
Definition SpellMgr.h:213
@ PROC_SPELL_TYPE_NO_DMG_HEAL
Definition SpellMgr.h:215
@ PROC_FLAG_TAKE_HARMFUL_PERIODIC
Definition SpellMgr.h:122
@ PROC_FLAG_TAKE_ANY_DAMAGE
Definition SpellMgr.h:124
@ TAKEN_HIT_PROC_FLAG_MASK
Definition SpellMgr.h:175
@ PROC_FLAG_DEAL_HARMFUL_PERIODIC
Definition SpellMgr.h:121
@ PROC_FLAG_DEAL_HELPFUL_PERIODIC
Definition SpellMgr.h:126
@ PROC_FLAG_TAKE_HELPFUL_PERIODIC
Definition SpellMgr.h:145
ProcFlagsHit
Definition SpellMgr.h:233
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:236
@ PROC_HIT_NORMAL
Definition SpellMgr.h:235
@ MOVE_FLIGHT
@ MOVE_SWIM
@ MOVE_FLIGHT_BACK
@ MOVE_SWIM_BACK
@ MOVE_RUN
@ MOVE_RUN_BACK
@ UNIT_FLAG2_MIRROR_IMAGE
@ UNIT_FLAG2_COMPREHEND_LANG
@ UNIT_FLAG2_FORCE_MOVEMENT
@ UNIT_FLAG2_FEIGN_DEATH
@ UNIT_FLAG2_NO_ACTIONS
@ UNIT_FLAG2_ALLOW_CHANGING_TALENTS
@ UNIT_FLAG2_DISARM_OFFHAND
@ UNIT_FLAG2_DISARM_RANGED
@ REACT_PASSIVE
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:42
@ ADV_FLYING_OVER_MAX_DECELERATION
@ ADV_FLYING_LIFT_COEFFICIENT
@ ADV_FLYING_ADD_IMPULSE_MAX_SPEED
@ ADV_FLYING_AIR_FRICTION
@ ADV_FLYING_MAX_VEL
@ ADV_FLYING_PITCHING_RATE_DOWN
@ ADV_FLYING_PITCHING_RATE_UP
@ ADV_FLYING_BANKING_RATE
@ DOT
@ SPELL_DIRECT_DAMAGE
@ UNIT_FLAG3_FAKE_DEAD
@ UNIT_FLAG3_ALTERNATIVE_DEFAULT_LANGUAGE
@ UNIT_VIS_FLAGS_UNTRACKABLE
Definition UnitDefines.h:61
@ UNIT_VIS_FLAGS_STEALTHED
Definition UnitDefines.h:60
@ UNIT_VIS_FLAGS_INVISIBLE
Definition UnitDefines.h:59
@ COMMAND_STAY
@ UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_PREPARATION
@ UNIT_FLAG_NON_ATTACKABLE_2
@ UNIT_FLAG_IMMUNE
@ UNIT_FLAG_DISARMED
@ UNIT_FLAG_PACIFIED
@ UNIT_FLAG_PLAYER_CONTROLLED
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
Definition Unit.cpp:10407
@ BASE_VALUE
Definition Unit.h:156
@ TOTAL_VALUE
Definition Unit.h:158
@ BASE_PCT_EXCLUDE_CREATE
Definition Unit.h:157
UnitMods
Definition Unit.h:176
@ UNIT_MOD_ARMOR
Definition Unit.h:209
@ UNIT_MOD_ATTACK_POWER
Definition Unit.h:216
@ UNIT_MOD_RESISTANCE_START
Definition Unit.h:225
@ UNIT_MOD_HEALTH
Definition Unit.h:182
@ UNIT_MOD_POWER_START
Definition Unit.h:227
@ UNIT_MOD_MANA
Definition Unit.h:183
@ UNIT_MOD_STAT_START
Definition Unit.h:223
@ UNIT_MOD_ATTACK_POWER_RANGED
Definition Unit.h:217
@ CORPSE
Definition Unit.h:254
@ JUST_DIED
Definition Unit.h:253
#define CURRENT_FIRST_NON_MELEE_SPELL
Definition Unit.h:603
CurrentSpellTypes
Definition Unit.h:596
@ CURRENT_GENERIC_SPELL
Definition Unit.h:598
@ CURRENT_MELEE_SPELL
Definition Unit.h:597
@ UNIT_STATE_DIED
Definition Unit.h:261
@ UNIT_STATE_CONFUSED
Definition Unit.h:272
@ UNIT_STATE_ROOT
Definition Unit.h:271
@ UNIT_STATE_FLEEING
Definition Unit.h:268
@ UNIT_STATE_CASTING
Definition Unit.h:276
@ UNIT_STATE_STUNNED
Definition Unit.h:264
@ MELEE_HIT_NORMAL
Definition Unit.h:387
#define MAX_COMBAT_RATING
Definition Unit.h:351
@ SHIELD_BLOCK_VALUE
Definition Unit.h:239
#define CURRENT_MAX_SPELL
Definition Unit.h:604
CombatRating
Definition Unit.h:316
@ CR_PARRY
Definition Unit.h:320
@ NULL_BAG
Definition Unit.h:63
@ NULL_SLOT
Definition Unit.h:64
#define DISPLAYID_HIDDEN_MOUNT
Definition Unit.h:40
#define SPELL_DH_DOUBLE_JUMP
Definition Unit.h:39
@ TOTAL_PCT
Definition Unit.h:165
@ BASE_PCT
Definition Unit.h:164
float GetPctOf(T value, T max)
Definition Util.h:78
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
Definition Util.h:565
T CalculatePct(T base, U pct)
Definition Util.h:72
static AreaTrigger * CreateAreaTrigger(AreaTriggerCreatePropertiesId areaTriggerCreatePropertiesId, Position const &pos, int32 duration, Unit *caster, Unit *target, SpellCastVisual spellVisual={ 0, 0 }, SpellInfo const *spellInfo=nullptr, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr)
Unit * GetTarget() const
Definition SpellAuras.h:81
AuraRemoveMode GetRemoveMode() const
Definition SpellAuras.h:96
void HandleAuraModDecreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModBlockPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePreventFleeing(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModShapeshift(AuraApplication const *aurApp, uint8 mode, bool apply) const
void GetApplicationList(Container &applicationContainer) const
void ChangeAmount(SpellEffectValue newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
void HandleModRecoveryRateBySpellLabel(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleEnableAltPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModArmorPctFromStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModStun(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModHealingDone(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModDispelImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModChargeRecoveryRate(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicPowerBurnAuraTick(Unit *target, Unit *caster) const
void HandleModMovementForceMagnitude(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
SpellEffIndex GetEffIndex() const
void HandleTriggerSpellOnExpire(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModDamagePercentDone(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModEffectImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModThreat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraPvpTalents(AuraApplication const *auraApp, uint8 mode, bool apply) const
void HandleAuraEmpathy(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
void HandleAuraCloneCaster(AuraApplication const *aurApp, uint8 mode, bool apply) const
void Update(uint32 diff, Unit *caster)
void HandleAuraFeatherFall(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleOverrideAttackPowerBySpellPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicManaLeechAuraTick(Unit *target, Unit *caster) const
void HandleNULL(AuraApplication const *, uint8, bool) const
void HandleModCombatSpeedPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellModifier * m_spellmod
void HandleModFear(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModFaction(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModRangedAttackPowerPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellEffectInfo const & GetSpellEffectInfo() const
void HandleObsModPowerAuraTick(Unit *target, Unit *caster) const
void HandleAuraSetVehicle(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraActAsControlZone(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModRequiredMountCapabilityFlags(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModRootAndDisableGravity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseHealthPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleDetectAmore(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicHealthFunnelAuraTick(Unit *target, Unit *caster) const
void HandleAuraModRangedAttackPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPossessPet(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleForceReaction(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModDodgePercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicHealAurasTick(Unit *target, Unit *caster) const
void HandleSetVignette(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModBonusArmorPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModDmgImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModDamageDone(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModAttackPowerPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleSpiritOfRedemption(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModAdvFlying(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModTaunt(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModManaRegenPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseMountedSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseHealth(AuraApplication const *aurApp, uint8 mode, bool apply) const
void SetAmount(SpellEffectValue amount)
void HandleArenaPreparation(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModSchoolImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModMeleeSpeedPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleUnused(AuraApplication const *, uint8, bool) const
void HandlePeriodicEnergizeAuraTick(Unit *target, Unit *caster) const
void HandleSetCantSwim(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPowerRegen(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModInvisibilityDetect(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleLinkedSummon(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetAmountAsInt() const
void HandlePeriodicTriggerSpellAuraTick(Unit *target, Unit *caster) const
void HandleNoImmediateEffect(AuraApplication const *, uint8, bool) const
void HandleAuraModMinimumSpeedRate(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModWeaponCritPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModTotalThreat(AuraApplication const *aurApp, uint8 mode, bool apply) const
bool IsAreaAuraEffect() const
void HandleModRating(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraIncreaseBaseHealthPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleCosmeticMounted(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleMountRestrictions(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraMounted(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModNoActions(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint32 GetRemainingTicks() const
uint32 GetId() const
void HandleAuraModRangedHaste(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleConvertCritToParry(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraControlVehicle(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModBaseResistance(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleShapeshiftBoosts(Unit *target, bool apply) const
void HandlePreventResurrection(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModMechanicImmunityMask(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleTriggerSpellOnPowerAmount(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraAllowFlight(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModPowerDisplay(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPowerCost(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModSkill(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModFakeInebriation(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePlayScene(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicHealthLeechAuraTick(Unit *target, Unit *caster) const
void HandleAuraModStunAndDisableGravity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModFixate(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModMaxPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModRatingPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
Optional< SpellEffectValue > GetEstimatedAmount() const
bool IsAffectingSpell(SpellInfo const *spell) const
static Optional< SpellEffectValue > CalculateEstimatedAmount(Unit const *caster, Unit *target, SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, SpellEffectValue amount, uint8 stack, AuraEffect const *aurEff)
void HandleAuraGhost(AuraApplication const *aurApp, uint8 mode, bool apply) const
void ApplySpellMod(Unit *target, bool apply, AuraEffect const *triggeredBy=nullptr)
void HandleModPercentStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
SpellEffectValue _amount
void HandleModOverrideZonePVPType(AuraApplication const *aurApp, uint8 mode, bool apply) const
void CalculatePeriodic(Unit *caster, bool resetPeriodicTimer=true, bool load=false)
Optional< SpellEffectValue > _estimatedAmount
void HandleAuraModStateImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetMiscValueB() const
void HandleAuraModExpertise(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraTransform(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModDisarm(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModOffhandDamagePercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
static SpellEffectValue CalculateEstimatedfTotalPeriodicAmount(Unit const *caster, Unit *target, SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, SpellEffectValue amount, uint8 stack)
void HandleModSpellCategoryCooldown(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePeriodicDamageAurasTick(Unit *target, Unit *caster) const
void HandleAuraTrackStealthed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModUnattackable(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModMeleeRangedSpeedPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModBonusArmor(AuraApplication const *aurApp, uint8 mode, bool apply) const
void SendTickImmune(Unit *target, Unit *caster) const
void HandleNoReagentUseAura(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleComprehendLanguage(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleOverrideSpellPowerByAttackPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleOverridePetSpecs(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleCharmConvert(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseSwimSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModCastingSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseMaxHealth(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAllowUsingGameobjectsWhileMounted(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleLearnSpell(AuraApplication const *aurApp, uint8 mode, bool apply) const
Unit * GetCaster() const
void HandleModStatBonusPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModStealthLevel(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModTargetResistance(AuraApplication const *aurApp, uint8 mode, bool apply) const
int32 GetMiscValue() const
void GetTargetList(Container &targetContainer) const
void HandleModConfuse(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModTotalPercentStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellEffectInfo const & m_effectInfo
SpellEffectValue const m_baseAmount
void HandleDisableInertia(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModStealthDetect(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModSpellCritChance(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModHealingDonePct(AuraApplication const *aurApp, uint8 mode, bool apply) const
uint32 GetTotalTicks() const
void HandleShowConfirmationPrompt(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModScale(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModOverridePowerDisplay(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseBaseManaPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleChannelDeathItem(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseEnergy(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleTriggerSpellOnHealthPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModRoot(AuraApplication const *aurApp, uint8 mode, bool apply) const
Aura * GetBase() const
void HandleAuraAllowTalentSwapping(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModStalked(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraDummy(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleFeignDeath(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleBattlegroundPlayerPosition(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleSuppressItemPassiveEffectBySpellLabel(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleIgnoreMovementForces(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellEffectValue CalculateAmount(Unit *caster)
void HandleTriggerSpellOnPowerPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePhaseAlwaysVisible(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModRecoveryRate(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModParryPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleProcTriggerDamageAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
void HandleModSpellDamagePercentFromStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModAdvFlyingSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleShieldBlockValue(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModCharm(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellInfo const *const m_spellInfo
void HandleAuraModAttackPower(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleForceBreathBar(AuraApplication const *aurApp, uint8 mode, bool apply) const
void ResetPeriodic(bool resetPeriodicTimer=false)
void HandleAuraModBaseResistancePCT(AuraApplication const *aurApp, uint8 mode, bool apply) const
SpellEffectValue GetAmount() const
void HandleShieldBlockValuePercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleCreateAreaTrigger(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModSpellHealingPercentFromStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModSpellHitChance(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraCanTurnWhileFalling(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
void HandleBreakableCCAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
ObjectGuid GetCasterGUID() const
void HandleAuraModStat(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraDisableGravity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleForceMoveForward(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModRegenInterrupt(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraUntrackable(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModResistance(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModManaCostPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleWaterBreathing(AuraApplication const *aurApp, uint8 mode, bool apply) const
bool CheckEffectProc(AuraApplication *aurApp, ProcEventInfo &eventInfo) const
void HandleAuraModUseNormalSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
float GetCritChanceFor(Unit const *caster, Unit const *target) const
void HandleModResistancePercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModVersatilityByPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
float CalcPeriodicCritChance(Unit const *caster) const
void HandleAuraModPacifyAndSilence(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePhase(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModMechanicImmunity(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraOpenStable(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModStealth(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraForceWeather(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraHover(AuraApplication const *aurApp, uint8 mode, bool apply) const
AuraEffect(Aura *base, SpellEffectInfo const &spellEfffectInfo, SpellEffectValue const *baseAmount, Unit *caster)
void HandleSetFFAPvP(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleBindSight(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModMaxPowerPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseFlightSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModAlternativeDefaultLanguage(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPowerRegenPCT(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModAttackSpeed(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModPacify(AuraApplication const *aurApp, uint8 mode, bool apply) const
void PeriodicTick(AuraApplication *aurApp, Unit *caster) const
void HandleStoreTeleportReturnPoint(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraOverrideSpells(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraWaterWalk(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraTrackCreatures(AuraApplication const *aurApp, uint8 mode, bool apply) const
bool IsEffect() const
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit *target, Unit *caster) const
void HandleAuraModCritPct(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraLinked(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleProcTriggerSpellAuraProc(AuraApplication *aurApp, ProcEventInfo &eventInfo)
void HandleMastery(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleAuraModIncreaseEnergyPercent(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModDetaunt(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandlePhaseGroup(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModInvisibility(AuraApplication const *aurApp, uint8 mode, bool apply) const
void HandleModPossess(AuraApplication const *aurApp, uint8 mode, bool apply) const
HookList< EffectCalcSpellModHandler > DoEffectCalcSpellMod
ObjectGuid GetCastId() const
Definition SpellAuras.h:186
int32 GetMaxDuration() const
Definition SpellAuras.h:217
ApplicationMap const & GetApplicationMap()
Definition SpellAuras.h:286
void SetStackAmount(uint8 num)
int32 GetCastItemLevel() const
Definition SpellAuras.h:190
void CallScriptEffectCalcSpellModHandlers(AuraEffect const *aurEff, SpellModifier *&spellMod)
Trinity::IteratorPair< DBStorageIterator< AuraEffect * > > GetAuraEffects()
Definition SpellAuras.h:362
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
bool CallScriptEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
bool CallScriptEffectPeriodicHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp)
ObjectGuid GetCasterGUID() const
Definition SpellAuras.h:187
WorldObject * GetOwner() const
Definition SpellAuras.h:195
void CallScriptAfterEffectProcHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
int32 GetDuration() const
Definition SpellAuras.h:222
void CallScriptEffectCalcAmountHandlers(AuraEffect const *aurEff, SpellEffectValue &amount, bool &canBeRecalculated)
uint32 GetCastItemId() const
Definition SpellAuras.h:189
AuraEffect * GetEffect(uint32 index) const
void CallScriptAfterEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
void SetCharges(uint8 charges)
bool CallScriptEffectApplyHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
void CallScriptAfterEffectRemoveHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, AuraEffectHandleModes mode)
void SetNeedClientUpdateForTargets() const
int32 CalcMaxDuration() const
Definition SpellAuras.h:219
SpellInfo const *const m_spellInfo
Definition SpellAuras.h:392
AuraObjectType GetType() const
uint8 GetStackAmount() const
Definition SpellAuras.h:238
SpellInfo const * GetSpellInfo() const
Definition SpellAuras.h:182
bool CallScriptEffectProcHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const *aurEff, bool &isPeriodic, int32 &amplitude)
static bool EffectTypeNeedsSendingAmount(AuraType type)
Difficulty GetCastDifficulty() const
Definition SpellAuras.h:184
bool CallScriptCheckEffectProcHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, ProcEventInfo &eventInfo)
void CallScriptEffectUpdatePeriodicHandlers(AuraEffect *aurEff)
bool IsPassive() const
std::unordered_map< ObjectGuid, AuraApplication * > ApplicationMap
Definition SpellAuras.h:172
bool IsPermanent() const
Definition SpellAuras.h:227
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
bool IsInWorld() const
Definition BaseEntity.h:158
bool IsCreature() const
Definition BaseEntity.h:172
bool IsPlayer() const
Definition BaseEntity.h:173
TypeID GetTypeId() const
Definition BaseEntity.h:166
Battleground * GetBG() const
Definition Map.h:937
void RemovePlayerPosition(ObjectGuid guid)
void AddPlayerPosition(WorldPackets::Battleground::BattlegroundPlayerPosition const &position)
bool IsIgnoringFeignDeath() const
Definition Creature.h:344
bool IsFloating() const
Definition Creature.h:142
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
bool isTappedBy(Player const *player) const
uint8 GetCurrentEquipmentId() const
Definition Creature.h:255
std::vector< MountXDisplayEntry const * > MountXDisplayContainer
Definition DB2Stores.h:442
uint32 GetResist() const
Definition Unit.h:455
ProcFlagsHit GetHitMask() const
Definition Unit.cpp:245
uint32 GetDamage() const
Definition Unit.h:452
uint32 GetAbsorb() const
Definition Unit.h:454
constexpr bool HasFlag(T flag) const
Definition EnumFlag.h:106
void AddFlag(FLAG_TYPE flag)
Definition Object.h:209
void DelFlag(FLAG_TYPE flag)
Definition Object.h:210
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:214
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:213
uint32 GetAbsorb() const
Definition Unit.h:485
uint32 GetEffectiveHeal() const
Definition Unit.h:484
Definition Item.h:179
bool IsDungeon() const
Definition Map.cpp:3267
void SendZoneWeather(uint32 zoneId, Player *player) const
Definition Map.cpp:3949
bool IsBattleground() const
Definition Map.cpp:3359
BattlegroundMap * ToBattlegroundMap()
Definition Map.h:493
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:3552
Difficulty GetDifficultyID() const
Definition Map.h:360
bool Instanceable() const
Definition Map.cpp:3262
float GetVisibilityRange() const
Definition Map.h:255
float GetFollowAngle() const override
void MoveFall(uint32 id=0, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void MoveFollow(Unit *target, float dist, Optional< ChaseAngle > angle={}, Optional< Milliseconds > duration={}, bool ignoreTargetWalk=false, MovementSlot slot=MOTION_SLOT_ACTIVE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
static ObjectGuid const Empty
Definition ObjectGuid.h:314
std::string ToString() const
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
void SetDynamicFlag(uint32 flag)
Definition Object.h:97
Player * ToPlayer()
Definition Object.h:126
uint32 GetEntry() const
Definition Object.h:89
Creature * ToCreature()
Definition Object.h:121
void RemoveDynamicFlag(uint32 flag)
Definition Object.h:98
void SetEntry(uint32 entry)
Definition Object.h:90
Unit * ToUnit()
Definition Object.h:116
Definition Pet.h:40
uint16 GetSpecialization() const
Definition Pet.h:132
void SetSpecialization(uint16 spec)
Definition Pet.cpp:1905
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition Pet.cpp:711
static void AddPhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
static void AddPhaseGroup(WorldObject *object, uint32 phaseGroupId, bool updateVisibility)
static void RemovePhaseGroup(WorldObject *object, uint32 phaseGroupId, bool updateVisibility)
static void RemovePhase(WorldObject *object, uint32 phaseId, bool updateVisibility)
static void SetAlwaysVisible(WorldObject *object, bool apply, bool updateVisibility)
void ApplyModOverrideSpellPowerByAPPercent(float mod, bool apply)
Definition Player.h:3003
void UpdateParryPercentage()
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
Definition Player.cpp:13130
void UpdateMastery()
void RemoveSpellCategoryCooldownMod(int32 spellCategoryId, int32 mod)
Definition Player.cpp:30783
Item * StoreNewItem(ItemPosCountVec const &pos, uint32 itemId, bool update, ItemRandomBonusListId randomBonusListId=0, GuidSet const &allowedLooters=GuidSet(), ItemContext context=ItemContext::NONE, std::vector< int32 > const *bonusListIDs=nullptr, bool addToCollection=true)
Definition Player.cpp:11370
void SetPlayerFlag(PlayerFlags flags)
Definition Player.h:2911
void UpdateDodgePercentage()
void ApplyModTargetResistance(int32 mod, bool apply)
Definition Player.h:2205
void SetPlayerLocalFlag(PlayerLocalFlags flags)
Definition Player.h:3008
void RemovePlayerFlag(PlayerFlags flags)
Definition Player.h:2912
void UpdateWeaponDependentAuras(WeaponAttackType attackType)
Definition Player.cpp:8344
void ApplyRatingMod(CombatRating cr, int32 value, bool apply)
Definition Player.cpp:5316
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:6283
void AddTemporarySpell(uint32 spellId)
Definition Player.cpp:3126
void ApplySpellMod(SpellInfo const *spellInfo, SpellModOp op, T &basevalue, Spell *spell=nullptr) const
Definition Player.cpp:22893
void SetNoRegentCostMask(flag128 mask)
Definition Player.h:1537
void UpdatePvPState(bool onlyFFA=false)
Definition Player.cpp:24066
void UpdateBlockPercentage()
void _ApplyWeaponDamage(uint8 slot, Item *item, bool apply)
Definition Player.cpp:8206
bool InBattleground() const
Definition Player.h:2584
void UpdateArmor() override
void PetSpellInitialize()
Definition Player.cpp:22471
SceneMgr & GetSceneMgr()
Definition Player.h:2888
void LeaveBattleground(bool teleportToEntryPoint=true)
Definition Player.cpp:24363
void SetFallInformation(uint32 time, float z)
Definition Player.cpp:27493
void RemovePlayerLocalFlag(PlayerLocalFlags flags)
Definition Player.h:3009
void setRegenTimerCount(uint32 time)
Definition Player.h:1902
void UpdateManaRegen()
void SetStableMaster(ObjectGuid stableMaster)
Definition Player.cpp:29855
Pet * GetPet() const
Definition Player.cpp:22060
void RemoveTemporarySpell(uint32 spellId)
Definition Player.cpp:3139
void ApplyItemDependentAuras(Item *item, bool apply)
Definition Player.cpp:8351
void ReplaceAllRequiredMountCapabilityFlags(uint8 flags)
Definition Player.h:3023
WorldSession * GetSession() const
Definition Player.h:2272
void UpdateSpellHitChances()
void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill=0, bool suppressMessaging=false, Optional< PlayerSpellTrait > trait={})
Definition Player.cpp:3178
Item * GetItemByPos(uint16 pos) const
Definition Player.cpp:9630
void UpdateExpertise(WeaponAttackType attType)
void SetViewpoint(WorldObject *target, bool apply)
Definition Player.cpp:26923
PlayerSpellMap const & GetSpellMap() const
Definition Player.h:2070
void AddSpellCategoryCooldownMod(int32 spellCategoryId, int32 mod)
Definition Player.cpp:30758
void RemoveTrackCreatureFlag(uint32 flags)
Definition Player.h:2999
void ApplyModOverrideAPBySpellPowerPercent(float mod, bool apply)
Definition Player.h:3005
void ApplyModTargetPhysicalResistance(int32 mod, bool apply)
Definition Player.h:2206
void SetBaseModPctValue(BaseModGroup modGroup, float val)
Definition Player.cpp:4997
void UpdateAllWeaponDependentCritAuras()
Definition Player.cpp:8338
void SetChampioningFaction(uint32 faction)
Definition Player.h:2861
void UpdateSpellDamageAndHealingBonus()
bool IsGameMaster() const
Definition Player.h:1309
void SetOverrideZonePVPType(ZonePVPTypeOverride type)
Definition Player.h:2001
void AddStoredAuraTeleportLocation(uint32 spellId)
Definition Player.cpp:2741
void UpdateMirrorTimers()
Definition Player.cpp:710
void ModifySkillBonus(uint32 skillid, int32 val, bool talent)
Definition Player.cpp:5679
void UpdateAllRunesRegen()
static WeaponAttackType GetAttackBySlot(uint8 slot, InventoryType inventoryType)
Definition Player.cpp:9736
void SendOnCancelExpectedVehicleRideAura() const
Definition Player.cpp:22466
void ApplyBaseModPctValue(BaseModGroup modGroup, float pct)
Definition Player.cpp:4975
void UpdateHostileAreaState(AreaTableEntry const *area)
Definition Player.cpp:7701
void RemoveSpell(uint32 spell_id, bool disabled=false, bool learn_low_rank=true, bool suppressMessaging=false)
Definition Player.cpp:3223
void SetTrackCreatureFlag(uint32 flags)
Definition Player.h:2998
void SetOverrideSpellsId(int32 overrideSpellsId)
Definition Player.h:1979
void UpdateRating(CombatRating cr)
Definition Player.cpp:5322
ReputationRank GetReputationRank(uint32 faction_id) const
Definition Player.cpp:6505
void RemovePetAura(PetAura const *petSpell)
Definition Player.cpp:22235
bool isHonorOrXPTarget(Unit const *victim) const
Definition Player.cpp:26354
Team GetEffectiveTeam() const
Definition Player.h:2427
void AddSpellMod(SpellModifier *mod, bool apply)
Definition Player.cpp:22908
void UpdateSpellCritChance()
void SetRequiredMountCapabilityFlag(uint8 flag)
Definition Player.h:3022
void SendMovementSetCollisionHeight(float height, WorldPackets::Movement::UpdateCollisionHeightReason reason)
Definition Player.cpp:30165
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 item, uint32 count, uint32 *no_space_count=nullptr) const
Definition Player.cpp:10050
void UpdateAttackPowerAndDamage(bool ranged=false) override
ReputationMgr & GetReputationMgr()
Definition Player.h:2439
void RemoveStoredAuraTeleportLocation(uint32 spellId)
Definition Player.cpp:2748
void AddPetAura(PetAura const *petSpell)
Definition Player.cpp:22228
void SendNewItem(Item *item, uint32 quantity, bool received, bool created, bool broadcast=false, uint32 dungeonEncounterId=0)
Definition Player.cpp:13878
Spell const * GetProcSpell() const
Definition Unit.h:514
SpellInfo const * GetSpellInfo() const
Definition Unit.cpp:281
ProcFlagsInit GetTypeMask() const
Definition Unit.h:503
DamageInfo * GetDamageInfo() const
Definition Unit.h:511
Unit * GetProcTarget() const
Definition Unit.h:501
Unit * GetActor() const
Definition Unit.h:499
void ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply)
void CancelSceneBySceneId(uint32 sceneId)
Definition SceneMgr.cpp:178
Optional< uint32 > GetInstanceIdBySceneId(uint32 sceneId) const
Definition SceneMgr.cpp:241
void OnSceneComplete(uint32 sceneInstanceID)
Definition SceneMgr.cpp:141
uint32 PlayScene(uint32 sceneId, Position const *position=nullptr)
Definition SceneMgr.cpp:36
SpellEffectValue CalcValue(WorldObject const *caster=nullptr, SpellEffectValue const *basePoints=nullptr, Unit const *target=nullptr, float *variance=nullptr, uint32 castItemId=0, int32 itemLevel=-1) const
AuraType ApplyAuraName
Definition SpellInfo.h:216
float CalcValueMultiplier(WorldObject *caster, Spell *spell=nullptr) const
uint32 TriggerSpell
Definition SpellInfo.h:234
bool IsAreaAuraEffect() const
static constexpr SpellEffectValue MaxValue
Definition SpellInfo.h:267
uint32 ApplyAuraPeriod
Definition SpellInfo.h:217
static constexpr SpellEffectValue MinValue
Definition SpellInfo.h:266
EnumFlag< SpellEffectAttributes > EffectAttributes
Definition SpellInfo.h:238
void UpdateCooldownRecoveryRate(Predicate &&predicate, float modChange, bool apply)
void UpdateChargeRecoveryRate(uint32 chargeCategoryId, float modChange, bool apply)
bool IsAffected(uint32 familyName, flag128 const &familyFlags) const
uint64 GetAllEffectsMechanicMask() const
uint32 const Id
Definition SpellInfo.h:328
int32 IsAffectedBySpellMod(SpellModifier const *mod) const
uint64 Stances
Definition SpellInfo.h:352
bool IsPassive() const
uint32 StackAmount
Definition SpellInfo.h:396
::Difficulty const Difficulty
Definition SpellInfo.h:329
bool NeedsToBeTriggeredByCaster(SpellInfo const *triggeringSpell) const
uint32 SchoolMask
Definition SpellInfo.h:419
flag128 SpellFamilyFlags
Definition SpellInfo.h:415
ProcFlagsInit ProcFlags
Definition SpellInfo.h:381
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
void ApplyAllSpellImmunitiesTo(Unit *target, SpellEffectInfo const &spellEffectInfo, bool apply) const
bool IsChanneled() const
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:456
bool IsAffectedBySpellMods() const
std::vector< SpellEffectInfo > const & GetEffects() const
Definition SpellInfo.h:587
bool IsPositive() const
bool HasLabel(uint32 labelId) const
uint32 SpellFamilyName
Definition SpellInfo.h:414
Definition Spell.h:277
int32 GetCastTime() const
Definition Spell.h:659
std::vector< SpellPowerCost > const & GetPowerCost() const
Definition Spell.h:704
void EvaluateSuppressed(bool canExpire=false)
void ForwardThreatForAssistingMe(Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false)
== AFFECT OTHERS' THREAT LISTS ==
void UpdateMySpellSchoolModifiers()
auto const & GetThreatenedByMeList() const
void FixateTarget(Unit *target)
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
void UpdateMyTempModifiers()
Definition Unit.h:635
bool SetCanDoubleJump(bool enable)
Definition Unit.cpp:13908
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
Definition Unit.cpp:820
float GetPctModifierValue(UnitMods unitMod, UnitModifierPctType modifierType) const
Definition Unit.cpp:9664
void ClearUnitState(uint32 f)
Definition Unit.h:744
void SetFlightCapabilityID(int32 flightCapabilityId, bool clientUpdate)
Definition Unit.cpp:9003
bool IsVehicle() const
Definition Unit.h:754
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
Definition Unit.cpp:8242
void SetOverrideDisplayPowerId(uint32 powerDisplayId)
Definition Unit.h:814
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
Definition Unit.cpp:8697
int32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, int32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
Definition Unit.cpp:6811
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3751
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3955
int32 SpellAbsorbBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 absorbamount) const
Definition Unit.cpp:7708
void RemoveGameObject(GameObject *gameObj, bool del)
Definition Unit.cpp:5378
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Definition Unit.h:1342
void SetSilencedSchoolMask(SpellSchoolMask schoolMask)
Definition Unit.h:1495
float GetHealthPct() const
Definition Unit.h:796
float m_baseSpellCritChance
Definition Unit.h:1517
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
Definition Unit.cpp:6012
int32 MeleeDamageBonusTaken(Unit *attacker, int32 pdamage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
Definition Unit.cpp:8133
virtual void RecalculateObjectScale()
Definition Unit.cpp:10771
void SetHealth(uint64 val)
Definition Unit.cpp:9973
bool SetCanAdvFly(bool enable)
Definition Unit.cpp:13970
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:7310
uint64 CountPctFromMaxHealth(float pct) const
Definition Unit.h:797
int32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype) const
Definition Unit.cpp:7495
Pet * ToPet()
Definition Unit.h:1822
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
Definition Unit.h:1030
void RemoveAurasByShapeShift()
Definition Unit.cpp:4334
void SetUnitFlag3(UnitFlags3 flags)
Definition Unit.h:856
void UpdateDamagePctDoneMods(WeaponAttackType attackType)
Definition Unit.cpp:9774
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3828
void UpdateObjectVisibility(bool forced=true) override
Definition Unit.cpp:12467
int64 ModifyHealth(int64 val)
Definition Unit.cpp:8599
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting=false)
Definition Unit.cpp:10803
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition Unit.cpp:10731
void FinishSpell(CurrentSpellTypes spellType, SpellCastResult result=SPELL_CAST_OK)
Definition Unit.cpp:3189
ThreatManager & GetThreatManager()
Definition Unit.h:1078
void ApplyModManaCostModifier(SpellSchools school, int32 mod, bool apply)
Definition Unit.h:830
void RestoreFaction()
Definition Unit.cpp:12048
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const
Definition Unit.cpp:4827
void SetControlled(bool apply, UnitState state)
Definition Unit.cpp:11545
uint8 GetClass() const
Definition Unit.h:764
void SetVisFlag(UnitVisFlags flags)
Definition Unit.h:905
bool CanUseAttackType(uint8 attacktype) const
Definition Unit.cpp:2607
uint32 GetClassMask() const
Definition Unit.h:766
bool HasAuraTypeWithCaster(AuraType auraType, ObjectGuid caster) const
Definition Unit.cpp:4819
uint32 GetLastExtraAttackSpell() const
Definition Unit.h:959
uint32 GetMountDisplayId() const
Definition Unit.h:913
void UpdateAllDamageDoneMods()
Definition Unit.cpp:9768
void UpdateDisplayPower()
Definition Unit.cpp:5808
float GetCollisionHeight() const override
Definition Unit.cpp:14533
static void DealHeal(HealInfo &healInfo)
Definition Unit.cpp:6524
std::multimap< uint32, AuraApplication * > AuraApplicationMap
Definition Unit.h:645
void UpdateSpeed(UnitMoveType mtype)
Definition Unit.cpp:8778
static void DealDamageMods(Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
Definition Unit.cpp:799
bool IsPolymorphed() const
Definition Unit.cpp:10758
ShapeshiftForm GetShapeshiftForm() const
Definition Unit.h:1504
void SetFaction(uint32 faction) override
Definition Unit.h:872
SpellEffectValue GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
Definition Unit.cpp:14250
void SetCosmeticMountDisplayId(uint32 mountDisplayId)
Definition Unit.h:916
static void CalcHealAbsorb(HealInfo &healInfo)
Definition Unit.cpp:2107
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
Definition Unit.cpp:1193
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Definition Unit.cpp:9644
std::forward_list< AuraEffect * > AuraEffectList
Definition Unit.h:652
void UpdateAdvFlyingSpeed(AdvFlyingRateTypeSingle speedType, bool clientUpdate)
Definition Unit.cpp:9025
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition Unit.cpp:9611
uint32 GetTransformSpell() const
Definition Unit.h:1617
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
Definition Unit.cpp:1303
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct) const
Definition Unit.cpp:2499
static void CalcAbsorbResist(DamageInfo &damageInfo, Spell *spell=nullptr)
Definition Unit.cpp:1876
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition Unit.cpp:3231
MotionMaster * GetMotionMaster()
Definition Unit.h:1723
bool SetFeatherFall(bool enable)
Definition Unit.cpp:13539
bool IsPet() const
Definition Unit.h:751
Powers GetPowerType() const
Definition Unit.h:811
static uint32 CalcArmorReducedDamage(Unit const *attacker, Unit *victim, uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK, uint8 attackerLevel=0)
Definition Unit.cpp:1684
void Dismount()
Definition Unit.cpp:8317
bool SetHover(bool enable, bool updateAnimTier=true)
Definition Unit.cpp:13577
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
Definition Unit.cpp:4604
bool IsFullHealth() const
Definition Unit.h:791
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:851
bool IsAlive() const
Definition Unit.h:1185
virtual bool CanApplyResilience() const
Definition Unit.cpp:12390
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
Definition Unit.cpp:10966
int32 GetMaxPower(Powers power) const
Definition Unit.cpp:10037
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
Definition Unit.cpp:6776
void _ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:12854
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
Definition Unit.cpp:5540
bool IsStandState() const
Definition Unit.cpp:10725
TempSummon * ToTempSummon()
Definition Unit.h:1828
bool IsGravityDisabled() const
Definition Unit.h:1149
CharmInfo * GetCharmInfo()
Definition Unit.h:1242
bool SetCanTransitionBetweenSwimAndFly(bool enable)
Definition Unit.cpp:13842
bool SetDisableInertia(bool disable)
Definition Unit.cpp:13939
void RemoveVisFlag(UnitVisFlags flags)
Definition Unit.h:906
void RemoveUnitFlag3(UnitFlags3 flags)
Definition Unit.h:857
float SpellCritChanceDone(Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
Definition Unit.cpp:7121
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
Definition Unit.cpp:13361
void UpdateMountCapability()
Definition Unit.cpp:8459
void AddUnitState(uint32 f)
Definition Unit.h:742
static void ApplyResilience(Unit const *victim, int32 *damage)
Definition Unit.cpp:12395
float GetTotalAuraMultiplier(AuraType auraType) const
Definition Unit.cpp:5074
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition Unit.cpp:8284
Gender GetGender() const
Definition Unit.h:767
int32 GetMinPower(Powers power) const
Definition Unit.h:818
virtual void UpdateDamagePhysical(WeaponAttackType attType)
virtual Gender GetNativeGender() const
Definition Unit.h:769
bool SetMoveCantSwim(bool cantSwim)
Definition Unit.cpp:14001
uint32 GetCreatureType() const
Definition Unit.cpp:9451
void SetInstantCast(bool set)
Definition Unit.h:1834
uint32 GetDisplayId() const
Definition Unit.h:1610
void SendSpellDamageImmune(Unit *target, uint32 spellId, bool isPeriodic)
Definition Unit.cpp:5639
void ModifyAuraState(AuraStateType flag, bool apply)
Definition Unit.cpp:6079
uint32 GetNativeDisplayId() const
Definition Unit.h:1613
float SpellCritChanceTaken(Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
Definition Unit.cpp:7175
virtual void UpdateArmor()=0
uint64 GetMaxHealth() const
Definition Unit.h:789
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, bool npcCaster) const
Definition Unit.cpp:12417
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Definition Unit.cpp:4774
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4700
bool SetCanFly(bool enable)
Definition Unit.cpp:13459
uint64 GetHealth() const
Definition Unit.h:788
void RemoveUnitFlag2(UnitFlags2 flags)
Definition Unit.h:852
bool SetCanTurnWhileFalling(bool enable)
Definition Unit.cpp:13876
bool HasAuraType(AuraType auraType) const
Definition Unit.cpp:4814
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
Definition Unit.cpp:4241
void StopAttackFaction(uint32 faction_id)
Definition Unit.cpp:13111
void RemoveCharmedBy(Unit *charmer)
Definition Unit.cpp:11946
bool IsMounted() const
Definition Unit.h:912
virtual uint32 GetPowerIndex(Powers power) const =0
Unit * GetVictim() const
Definition Unit.h:726
UF::UpdateField< UF::UnitData, int32(WowCS::EntityFragment::CGObject), TYPEID_UNIT > m_unitData
Definition Unit.h:1881
int32 GetPower(Powers power) const
Definition Unit.cpp:10028
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
Definition Unit.cpp:7855
bool IsImmunedToAuraPeriodicTick(WorldObject const *caster, AuraEffect const *auraEffect) const
Definition Unit.cpp:7986
void SetOwnerGUID(ObjectGuid owner)
Definition Unit.cpp:6171
DeathState getDeathState() const
Definition Unit.h:1188
bool SetIgnoreMovementForces(bool ignore)
Definition Unit.cpp:14112
float GetTotalAuraMultiplierByMiscMask(AuraType auraType, uint32 misc_mask) const
Definition Unit.cpp:5099
void ApplyCastTimePercentMod(float val, bool apply)
Definition Unit.cpp:10992
bool HealthAbovePct(float pct) const
Definition Unit.h:794
bool HealthBelowPct(float pct) const
Definition Unit.h:792
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading=false)
Definition Unit.cpp:12074
int32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 pdamage, DamageEffectType damagetype) const
Definition Unit.cpp:6994
bool IsInFeralForm() const
Definition Unit.cpp:9532
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
Definition Unit.cpp:7280
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
Definition Unit.cpp:3735
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
Definition Unit.cpp:5602
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:12756
int32 SpellAbsorbBonusDone(Unit *victim, SpellInfo const *spellProto, int32 absorbamount, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, AuraEffect const *aurEff=nullptr) const
Definition Unit.cpp:7626
int32 MeleeDamageBonusDone(Unit *pVictim, int32 damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellEffectInfo const *spellEffectInfo=nullptr, Mechanics mechanic=MECHANIC_NONE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr)
Definition Unit.cpp:8021
SpellHistory * GetSpellHistory()
Definition Unit.h:1498
bool IsControlledByPlayer() const
Definition Unit.h:1214
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
Definition Unit.cpp:11773
bool SetWaterWalking(bool enable)
Definition Unit.cpp:13502
void SetMaxPower(Powers power, int32 val)
Definition Unit.cpp:10083
virtual void setDeathState(DeathState s)
Definition Unit.cpp:9161
void RemoveVehicleKit(bool onRemoveFromWorld=false)
Definition Unit.cpp:12090
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr)
Definition Unit.cpp:1675
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
Definition Unit.cpp:9586
void SetUnitFlag(UnitFlags flags)
Definition Unit.h:846
void UpdateMovementForcesModMagnitude()
Definition Unit.cpp:14143
bool IsFlying() const
Definition Unit.h:1807
AuraApplicationMap & GetAppliedAuras()
Definition Unit.h:1295
void SetVignette(uint32 vignetteId)
Definition Unit.cpp:14576
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
Definition Unit.cpp:8362
void SetInFront(WorldObject const *target)
Definition Unit.cpp:13283
Vehicle * GetVehicleKit() const
Definition Unit.h:1782
float m_modSpellHitChance
Definition Unit.h:1516
Guardian * GetGuardianPet() const
Definition Unit.cpp:6231
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
Definition Unit.cpp:5570
void ReplaceAllSilencedSchoolMask(SpellSchoolMask schoolMask)
Definition Unit.h:1496
AuraMap & GetOwnedAuras()
Definition Unit.h:1285
void UpdateAllDamagePctDoneMods()
Definition Unit.cpp:9815
bool AttackStop()
Definition Unit.cpp:5965
void SetTransformSpell(uint32 spellid)
Definition Unit.h:1616
void ApplyModManaCostMultiplier(float manaCostMultiplier, bool apply)
Definition Unit.h:829
void SetShapeshiftForm(ShapeshiftForm form)
Definition Unit.cpp:9494
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:3974
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
Definition Unit.cpp:11225
int32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
Definition Unit.cpp:7328
void SetMountDisplayId(uint32 mountDisplayId)
Definition Unit.h:914
uint8 GetRace() const
Definition Unit.h:761
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
Definition Unit.cpp:10779
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition Unit.cpp:3159
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
Definition Unit.cpp:12539
void RemoveUnitFlag(UnitFlags flags)
Definition Unit.h:847
void UpdateStatBuffMod(Stats stat)
Definition Unit.cpp:5219
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition Unit.h:1466
Vehicle * RemovePassenger(WorldObject *passenger) override
Removes the passenger from the vehicle.
Definition Vehicle.cpp:513
void RemovePendingEventsForPassenger(Unit *passenger)
Definition Vehicle.cpp:784
void PlayDirectSound(uint32 soundId, Player const *target=nullptr, uint32 broadcastTextId=0) const
Definition Object.cpp:2938
Map * GetMap() const
Definition Object.h:411
ZoneScript * FindZoneScript() const
Definition Object.cpp:1365
void GetCreatureListWithEntryInGrid(Container &creatureContainer, uint32 entry, float maxSearchRange=250.0f) const
Definition Object.cpp:2658
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition Object.cpp:2217
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition Object.h:403
FlaggedValuesArray32< int32, uint64, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition Object.h:404
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect, bool canImmune) const
Definition Object.cpp:1942
GameObject * SummonGameObject(uint32 entry, Position const &pos, QuaternionData const &rot, Seconds respawnTime, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition Object.cpp:1441
void PlayDistanceSound(uint32 soundId, Player const *target=nullptr) const
Definition Object.cpp:2922
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition Object.h:401
void UpdatePositionData()
Definition Object.cpp:346
Player * GetSpellModOwner() const
Definition Object.cpp:1641
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:501
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:400
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition Object.h:407
uint32 GetZoneId() const
Definition Object.h:332
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition Object.h:406
void ModSpellDurationTime(SpellInfo const *spellInfo, int32 &durationTime, Spell *spell=nullptr) const
Definition Object.cpp:1811
bool isLogingOut() const
Is the user engaged in a log out process?
WeatherState
Definition Weather.h:46
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
Definition Containers.h:110
TriggerCastFlags TriggerFlags
CastSpellExtraArgs & SetTriggeringSpell(Spell const *triggeringSpell)
Definition Spell.cpp:9707
CastSpellExtraArgs & SetTriggerFlags(TriggerCastFlags flag)
CastSpellExtraArgs & AddSpellMod(SpellValueMod mod, int32 val)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition CellImpl.h:203
bool HasCommandState(CommandStates state) const
Definition CharmInfo.h:98
uint32 mitigated_damage
Definition Unit.h:412
uint32 CreatureDisplayID
constexpr float GetPositionX() const
Definition Position.h:87
constexpr float GetPositionY() const
Definition Position.h:88
constexpr void GetPosition(float &x, float &y) const
Definition Position.h:92
constexpr float GetOrientation() const
Definition Position.h:90
constexpr float GetPositionZ() const
Definition Position.h:89
static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X)
SpellModOp op
Definition Player.h:258
SpellModType type
Definition Player.h:259
Unit * attacker
Definition Unit.h:559
uint32 originalDamage
Definition Unit.h:564
std::array< uint32, MAX_SHAPESHIFT_SPELLS > PresetSpellID
EnumFlag< SpellShapeshiftFormFlags > GetFlags() const