TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellAuraEffects.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef TRINITY_SPELLAURAEFFECTS_H
20 #define TRINITY_SPELLAURAEFFECTS_H
21 
22 class Unit;
23 class AuraEffect;
24 class Aura;
25 
26 #include "SpellAuras.h"
27 
28 typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uint8 mode, bool apply) const;
29 
31 {
32  friend void Aura::_InitEffects(uint32 effMask, Unit* caster, int32 *baseAmount);
33  friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
34  friend Aura::~Aura();
35 
36  public:
37  ~AuraEffect();
38  AuraEffect(Aura* base, uint32 effIndex, int32 *baseAmount, Unit* caster);
39  Unit* GetCaster() const { return GetBase()->GetCaster(); }
40  ObjectGuid GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
41  Aura* GetBase() const { return m_base; }
42  void GetTargetList(std::list<Unit*> & targetList) const;
43  void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
44  SpellModifier* GetSpellModifier() const { return m_spellmod; }
45 
46  SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
47  uint32 GetId() const { return m_spellInfo->Id; }
48  uint32 GetEffIndex() const { return m_effIndex; }
49  int32 GetBaseAmount() const { return m_baseAmount; }
50  int32 GetPeriod() const { return m_period; }
51 
52  int32 GetMiscValueB() const { return GetSpellEffectInfo()->MiscValueB; }
53  int32 GetMiscValue() const { return GetSpellEffectInfo()->MiscValue; }
54  AuraType GetAuraType() const { return (AuraType)GetSpellEffectInfo()->ApplyAuraName; }
55  int32 GetAmount() const { return m_amount; }
56  void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
57 
58  int32 GetPeriodicTimer() const { return m_periodicTimer; }
59  void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; }
60 
61  int32 CalculateAmount(Unit* caster);
62  void CalculatePeriodic(Unit* caster, bool resetPeriodicTimer = true, bool load = false);
63  void CalculateSpellMod();
64  void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false);
65  void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); }
66  void RecalculateAmount(Unit* caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
67  bool CanBeRecalculated() const { return m_canBeRecalculated; }
68  void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
69  void HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply);
70  void HandleEffect(Unit* target, uint8 mode, bool apply);
71  void ApplySpellMod(Unit* target, bool apply);
72 
73  void SetDamage(int32 val) { m_damage = val; }
74  int32 GetDamage() const { return m_damage; }
75  void SetCritChance(float val) { m_critChance = val; }
76  float GetCritChance() const { return m_critChance; }
77  void SetDonePct(float val) { m_donePct = val; }
78  float GetDonePct() const { return m_donePct; }
79 
80  void Update(uint32 diff, Unit* caster);
81  void UpdatePeriodic(Unit* caster);
82 
83  uint32 GetTickNumber() const { return m_tickNumber; }
84  int32 GetTotalTicks() const { return m_period ? (GetBase()->GetMaxDuration() / m_period) : 1;}
85  void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_period; m_tickNumber = 0;}
86 
87  bool IsPeriodic() const { return m_isPeriodic; }
88  void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
89  bool IsAffectingSpell(SpellInfo const* spell) const;
90  bool HasSpellClassMask() const { return GetSpellEffectInfo()->SpellClassMask; }
91 
92  void SendTickImmune(Unit* target, Unit* caster) const;
93  void PeriodicTick(AuraApplication * aurApp, Unit* caster) const;
94 
95  void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
96 
97  void CleanupTriggeredSpells(Unit* target);
98 
99  // add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
100  void HandleShapeshiftBoosts(Unit* target, bool apply) const;
101 
102  SpellEffectInfo const* GetSpellEffectInfo() const { return _effectInfo; }
103 
104  bool IsEffect() const { return _effectInfo->Effect != 0; }
105  bool IsEffect(SpellEffectName effectName) const { return _effectInfo->Effect == uint32(effectName); }
106  bool IsAreaAuraEffect() const;
107 
108  private:
109  Aura* const m_base;
110 
111  SpellInfo const* const m_spellInfo;
114 
118  float m_donePct;
119 
121 
125 
129  private:
130  bool CanPeriodicTickCrit(Unit const* caster) const;
131 
132  public:
133  // aura effect apply/remove handlers
134  void HandleNULL(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
135  {
136  // not implemented
137  }
138  void HandleUnused(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
139  {
140  // useless
141  }
142  void HandleNoImmediateEffect(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
143  {
144  // aura type not have immediate effect at add/remove and handled by ID in other code place
145  }
146  // visibility & phases
147  void HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
148  void HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
149  void HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
150  void HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const;
151  void HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
152  void HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const;
153  void HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
154  void HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const;
155  void HandlePhaseGroup(AuraApplication const* aurApp, uint8 mode, bool apply) const;
156 
157  // unit model
158  void HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const;
159  void HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const;
160  void HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool apply) const;
161  void HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const;
162  // fight
163  void HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const;
164  void HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
165  void HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
166  void HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
167  void HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const;
168  void HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
169  void HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
170  // tracking
171  void HandleAuraTrackResources(AuraApplication const* aurApp, uint8 mode, bool apply) const;
172  void HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const;
173  void HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
174  void HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
175  void HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
176  // skills & talents
177  void HandleAuraModPetTalentsPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
178  void HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const;
179  // movement
180  void HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const;
181  void HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
182  void HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const;
183  void HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const;
184  void HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const;
185  void HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
186  void HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const;
187  // threat
188  void HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
189  void HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
190  void HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
191  // control
192  void HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const;
193  void HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const;
194  void HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const;
195  void HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const;
196  void HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
197  // charm
198  void HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const;
199  void HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const;
200  void HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
201  void HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const;
202  void HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
203  // modify speed
204  void HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
205  void HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
206  void HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
207  void HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
208  void HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
209  void HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
210  // immunity
211  void HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
212  void HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
213  void HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
214  void HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
215  void HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
216  void HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
217  void HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
218  // modify stats
219  // resistance
220  void HandleAuraModResistanceExclusive(AuraApplication const* aurApp, uint8 mode, bool apply) const;
221  void HandleAuraModResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
222  void HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
223  void HandleModResistancePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
224  void HandleModBaseResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
225  void HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
226  // stat
227  void HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
228  void HandleModPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
229  void HandleModSpellDamagePercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
230  void HandleModSpellHealingPercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
231  void HandleModSpellDamagePercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
232  void HandleModSpellHealingPercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
233  void HandleModHealingDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
234  void HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
235  void HandleAuraModResistenceOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
236  void HandleAuraModExpertise(AuraApplication const* aurApp, uint8 mode, bool apply) const;
237  void HandleModStatBonusPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
238  void HandleOverrideSpellPowerByAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
239  void HandleOverrideAttackPowerBySpellPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
240  // heal and energize
241  void HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
242  void HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
243  void HandleModManaRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
244  void HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
245  void HandleAuraModIncreaseMaxHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
246  void HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
247  void HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
248  void HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
249  void HandleAuraIncreaseBaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
250  void HandleAuraModIncreaseBaseManaPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
251  // fight
252  void HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
253  void HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
254  void HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
255  void HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
256  void HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
257  void HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
258  void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
259  void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
260  void HandleModSpellCritChanceShool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
261  void HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
262  // attack speed
263  void HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
264  void HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
265  void HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
266  void HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
267  void HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
268  void HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
269  // combat rating
270  void HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const;
271  void HandleModRatingFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
272  // attack power
273  void HandleAuraModAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
274  void HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
275  void HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
276  void HandleAuraModRangedAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
277  void HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const;
278  // damage bonus
279  void HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
280  void HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
281  void HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
282  void HandleShieldBlockValue(AuraApplication const* aurApp, uint8 mode, bool apply) const;
283  // power cost
284  void HandleModPowerCostPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
285  void HandleModPowerCost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
286  void HandleArenaPreparation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
287  void HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mode, bool apply) const;
288  void HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
289  // others
290  void HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
291  void HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mode, bool apply) const;
292  void HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
293  void HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
294  void HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
295  void HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
296  void HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const;
297  void HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode, bool apply) const;
298  void HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
299  void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
300  void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
301  void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
302  void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
303  void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
304  void HandleMastery(AuraApplication const* aurApp, uint8 mode, bool apply) const;
305  void HandleAuraForceWeather(AuraApplication const* aurApp, uint8 mode, bool apply) const;
306  void HandleEnableAltPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
307  void HandleModSpellCategoryCooldown(AuraApplication const* aurApp, uint8 mode, bool apply) const;
308 
309  // aura effect periodic tick handlers
310  void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;
311  void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const;
312  void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const;
313  void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const;
314  void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const;
315  void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const;
316  void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const;
317  void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const;
318  void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const;
319  void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const;
320  void HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const;
321 
322  // aura effect proc handlers
323  void HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
324  void HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
325  void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
326  void HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
327  void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
328  void HandleProcTriggerSpellOnPowerAmountAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
329 };
330 
331 namespace Trinity
332 {
333  // Binary predicate for sorting the priority of absorption aura effects
335  {
336  public:
338  bool operator() (AuraEffect* aurEffA, AuraEffect* aurEffB) const
339  {
340  SpellInfo const* spellProtoA = aurEffA->GetSpellInfo();
341  SpellInfo const* spellProtoB = aurEffB->GetSpellInfo();
342 
343  // Wards
344  if ((spellProtoA->SpellFamilyName == SPELLFAMILY_MAGE) ||
345  (spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK))
346  if (spellProtoA->GetCategory() == 56)
347  return true;
348  if ((spellProtoB->SpellFamilyName == SPELLFAMILY_MAGE) ||
349  (spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK))
350  if (spellProtoB->GetCategory() == 56)
351  return false;
352 
353  // Sacred Shield
354  if (spellProtoA->Id == 58597)
355  return true;
356  if (spellProtoB->Id == 58597)
357  return false;
358 
359  // Fel Blossom
360  if (spellProtoA->Id == 28527)
361  return true;
362  if (spellProtoB->Id == 28527)
363  return false;
364 
365  // Divine Aegis
366  if (spellProtoA->Id == 47753)
367  return true;
368  if (spellProtoB->Id == 47753)
369  return false;
370 
371  // Ice Barrier
372  if (spellProtoA->GetCategory() == 471)
373  return true;
374  if (spellProtoB->GetCategory() == 471)
375  return false;
376 
377  // Sacrifice
378  if ((spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
379  (spellProtoA->SpellIconID == 693))
380  return true;
381  if ((spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
382  (spellProtoB->SpellIconID == 693))
383  return false;
384 
385  return false;
386  }
387  };
388 }
389 #endif
AuraType
Definition: SpellAuraDefines.h:58
bool IsEffect(SpellEffectName effectName) const
Definition: SpellAuraEffects.h:105
Definition: SpellAuraEffects.h:30
void RecalculateAmount(Unit *caster)
Definition: SpellAuraEffects.h:66
void SetDonePct(float val)
Definition: SpellAuraEffects.h:77
uint32 Id
Definition: SpellInfo.h:329
AbsorbAuraOrderPred()
Definition: SpellAuraEffects.h:337
SpellInfo const * GetSpellInfo() const
Definition: SpellAuraEffects.h:46
int32 GetTotalTicks() const
Definition: SpellAuraEffects.h:84
SpellEffectInfo const * GetSpellEffectInfo() const
Definition: SpellAuraEffects.h:102
uint32 GetCategory() const
Definition: SpellInfo.cpp:1164
uint32 GetTickNumber() const
Definition: SpellAuraEffects.h:83
ObjectGuid GetCasterGUID() const
Definition: SpellAuraEffects.h:40
bool IsEffect() const
Definition: SpellAuraEffects.h:104
bool CanBeRecalculated() const
Definition: SpellAuraEffects.h:67
virtual ~Aura()
Definition: SpellAuras.cpp:420
uint32 GetEffIndex() const
Definition: SpellAuraEffects.h:48
void SetCanBeRecalculated(bool val)
Definition: SpellAuraEffects.h:68
float GetDonePct() const
Definition: SpellAuraEffects.h:78
int32 GetMiscValue() const
Definition: SpellAuraEffects.h:53
SpellModifier * GetSpellModifier() const
Definition: SpellAuraEffects.h:44
void _InitEffects(uint32 effMask, Unit *caster, int32 *baseAmount)
Definition: SpellAuras.cpp:404
Definition: Player.h:167
void SetPeriodicTimer(int32 periodicTimer)
Definition: SpellAuraEffects.h:59
Definition: SpellInfo.h:326
uint32 GetId() const
Definition: SpellAuraEffects.h:47
bool operator()(AuraEffect *aurEffA, AuraEffect *aurEffB) const
Definition: SpellAuraEffects.h:338
int32 m_amount
Definition: SpellAuraEffects.h:115
void ResetPeriodic(bool resetPeriodicTimer=false)
Definition: SpellAuraEffects.h:85
int32 GetPeriodicTimer() const
Definition: SpellAuraEffects.h:58
Definition: SpellAuras.h:50
SpellEffectName
Definition: SharedDefines.h:1009
SpellModifier * m_spellmod
Definition: SpellAuraEffects.h:120
Aura * GetBase() const
Definition: SpellAuraEffects.h:41
int32 GetPeriod() const
Definition: SpellAuraEffects.h:50
int32 GetMiscValueB() const
Definition: SpellAuraEffects.h:52
int32 m_periodicTimer
Definition: SpellAuraEffects.h:122
bool HasSpellClassMask() const
Definition: SpellAuraEffects.h:90
Unit * GetCaster() const
Definition: SpellAuraEffects.h:39
Definition: SharedDefines.h:4628
Aura * _TryStackingOrRefreshingExistingAura(SpellInfo const *newAura, uint32 effMask, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, ObjectGuid casterGUID=ObjectGuid::Empty, int32 castItemLevel=-1)
Definition: Unit.cpp:3024
void apply(T *val)
Definition: ByteConverter.h:41
SpellEffectInfo const * _effectInfo
Definition: SpellAuraEffects.h:112
AuraType GetAuraType() const
Definition: SpellAuraEffects.h:54
void SetPeriodic(bool isPeriodic)
Definition: SpellAuraEffects.h:88
void(AuraEffect::* pAuraEffectHandler)(AuraApplication const *aurApp, uint8 mode, bool apply) const
Definition: SpellAuraEffects.h:28
bool m_canBeRecalculated
Definition: SpellAuraEffects.h:127
int32 m_damage
Definition: SpellAuraEffects.h:116
void HandleNoImmediateEffect(AuraApplication const *, uint8, bool) const
Definition: SpellAuraEffects.h:142
Definition: Unit.h:984
bool m_isPeriodic
Definition: SpellAuraEffects.h:128
Definition: SharedDefines.h:4626
uint32 m_tickNumber
Definition: SpellAuraEffects.h:124
int32 GetBaseAmount() const
Definition: SpellAuraEffects.h:49
void SetCritChance(float val)
Definition: SpellAuraEffects.h:75
uint32 SpellFamilyName
Definition: SpellInfo.h:396
float m_critChance
Definition: SpellAuraEffects.h:117
int32 m_period
Definition: SpellAuraEffects.h:123
Aura *const m_base
Definition: SpellAuraEffects.h:109
Definition: Item.h:259
int32 GetDamage() const
Definition: SpellAuraEffects.h:74
int32 GetAmount() const
Definition: SpellAuraEffects.h:55
Definition: SpellInfo.h:238
void RecalculateAmount()
Definition: SpellAuraEffects.h:65
int32_t int32
Definition: Define.h:146
void HandleUnused(AuraApplication const *, uint8, bool) const
Definition: SpellAuraEffects.h:138
uint32_t uint32
Definition: Define.h:150
void HandleNULL(AuraApplication const *, uint8, bool) const
Definition: SpellAuraEffects.h:134
bool IsPeriodic() const
Definition: SpellAuraEffects.h:87
float m_donePct
Definition: SpellAuraEffects.h:118
Definition: SpellAuraEffects.h:334
void SetAmount(int32 amount)
Definition: SpellAuraEffects.h:56
void SetDamage(int32 val)
Definition: SpellAuraEffects.h:73
#define TC_GAME_API
Definition: Define.h:134
uint8 const m_effIndex
Definition: SpellAuraEffects.h:126
SpellInfo const *const m_spellInfo
Definition: SpellAuraEffects.h:111
uint32 SpellIconID
Definition: SpellInfo.h:390
uint8_t uint8
Definition: Define.h:152
Definition: ObjectGuid.h:189
uint32_t uint32
Definition: g3dmath.h:168
Definition: Common.h:172
Definition: SpellAuras.h:116
Definition: Unit.h:1305
int32 const m_baseAmount
Definition: SpellAuraEffects.h:113
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
float GetCritChance() const
Definition: SpellAuraEffects.h:76