TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellAuras.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_SPELLAURAS_H
20 #define TRINITY_SPELLAURAS_H
21 
22 #include "SpellAuraDefines.h"
23 #include "SpellInfo.h"
24 #include "Unit.h"
25 
26 class SpellInfo;
27 struct SpellModifier;
28 struct ProcTriggerSpell;
29 struct SpellProcEntry;
30 
31 namespace WorldPackets
32 {
33  namespace Spells
34  {
35  struct AuraInfo;
36  }
37 }
38 
39 // forward decl
40 class AuraEffect;
41 class Aura;
42 class DynamicObject;
43 class AuraScript;
44 class ProcInfo;
45 class ChargeDropEvent;
46 
47 // update aura target map every 500 ms instead of every update - reduce amount of grid searcher calls
48 #define UPDATE_TARGET_MAP_INTERVAL 500
49 
51 {
52  friend void Unit::_ApplyAura(AuraApplication * aurApp, uint32 effMask);
53  friend void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
54  friend void Unit::_ApplyAuraEffect(Aura* aura, uint8 effIndex);
55  friend void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode);
57  private:
58  Unit* const _target;
59  Aura* const _base;
60  AuraRemoveMode _removeMode:8; // Store info for know remove aura reason
61  uint8 _slot; // Aura slot on unit
62  uint8 _flags; // Aura info flag
63  uint32 _effectsToApply; // Used only at spell hit to determine which effect should be applied
64  bool _needClientUpdate:1;
66 
67  explicit AuraApplication(Unit* target, Unit* caster, Aura* base, uint32 effMask);
68  void _Remove();
69  private:
70  void _InitFlags(Unit* caster, uint32 effMask);
71  void _HandleEffect(uint8 effIndex, bool apply);
72  public:
73 
74  Unit* GetTarget() const { return _target; }
75  Aura* GetBase() const { return _base; }
76 
77  uint8 GetSlot() const { return _slot; }
78  uint8 GetFlags() const { return _flags; }
79  uint32 GetEffectMask() const { return _effectMask; }
80  bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return (_effectMask & (1 << effect)) != 0; }
81  bool IsPositive() const { return (_flags & AFLAG_POSITIVE) != 0; }
82  bool IsSelfcast() const { return (_flags & AFLAG_NOCASTER) != 0; }
83  uint32 GetEffectsToApply() const { return _effectsToApply; }
84 
85  void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; }
86  AuraRemoveMode GetRemoveMode() const {return _removeMode;}
87 
88  void SetNeedClientUpdate() { _needClientUpdate = true;}
89  bool IsNeedClientUpdate() const { return _needClientUpdate;}
90  void BuildUpdatePacket(WorldPackets::Spells::AuraInfo& data, bool remove) const;
91  void ClientUpdate(bool remove = false);
92 };
93 
94 #pragma pack(push, 1)
95 // Structure representing database aura primary key fields
96 struct AuraKey
97 {
102 
103  bool operator<(AuraKey const& right) const
104  {
105  return memcmp(this, &right, sizeof(*this)) < 0;
106  }
107 };
108 
110 {
111  std::array<int32, MAX_SPELL_EFFECTS> Amounts;
112  std::array<int32, MAX_SPELL_EFFECTS> BaseAmounts;
113 };
114 #pragma pack(pop)
115 
117 {
118  friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint32 effMask, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
119  public:
120  typedef std::map<ObjectGuid, AuraApplication*> ApplicationMap;
121 
122  static uint32 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint32 avalibleEffectMask, WorldObject* owner);
123  static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint32 tryEffMask, WorldObject* owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty, bool* refresh = NULL, int32 castItemLevel = -1);
124  static Aura* TryCreate(SpellInfo const* spellproto, uint32 tryEffMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem = NULL, ObjectGuid casterGUID = ObjectGuid::Empty, int32 castItemLevel = -1);
125  static Aura* Create(SpellInfo const* spellproto, uint32 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
126  Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
127  void _InitEffects(uint32 effMask, Unit* caster, int32 *baseAmount);
128  virtual ~Aura();
129 
130  SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
131  uint32 GetId() const{ return GetSpellInfo()->Id; }
132 
133  ObjectGuid GetCastItemGUID() const { return m_castItemGuid; }
134  int32 GetCastItemLevel() const { return m_castItemLevel; }
135  ObjectGuid GetCasterGUID() const { return m_casterGuid; }
136  Unit* GetCaster() const;
137  WorldObject* GetOwner() const { return m_owner; }
138  Unit* GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
139  DynamicObject* GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; }
140 
141  AuraObjectType GetType() const;
142 
143  virtual void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
144  virtual void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
145  void _Remove(AuraRemoveMode removeMode);
146  virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0;
147 
148  virtual void FillTargetMap(std::map<Unit*, uint32> & targets, Unit* caster) = 0;
149  void UpdateTargetMap(Unit* caster, bool apply = true);
150 
151  void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
152  void ApplyForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, true);}
153  void _ApplyEffectForTargets(uint8 effIndex);
154 
155  void UpdateOwner(uint32 diff, WorldObject* owner);
156  void Update(uint32 diff, Unit* caster);
157 
158  time_t GetApplyTime() const { return m_applyTime; }
159  int32 GetMaxDuration() const { return m_maxDuration; }
160  void SetMaxDuration(int32 duration) { m_maxDuration = duration; }
161  int32 CalcMaxDuration() const { return CalcMaxDuration(GetCaster()); }
162  int32 CalcMaxDuration(Unit* caster) const;
163  int32 GetDuration() const { return m_duration; }
164  void SetDuration(int32 duration, bool withMods = false);
165  void RefreshDuration(bool withMods = false);
166  void RefreshTimers();
167  bool IsExpired() const { return !GetDuration() && !m_dropEvent; }
168  bool IsPermanent() const { return GetMaxDuration() == -1; }
169 
170  uint8 GetCharges() const { return m_procCharges; }
171  void SetCharges(uint8 charges);
172  uint8 CalcMaxCharges(Unit* caster) const;
173  uint8 CalcMaxCharges() const { return CalcMaxCharges(GetCaster()); }
174  bool ModCharges(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
175  bool DropCharge(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) { return ModCharges(-1, removeMode); }
176  void ModChargesDelayed(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
177  void DropChargeDelayed(uint32 delay, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
178 
179  uint8 GetStackAmount() const { return m_stackAmount; }
180  void SetStackAmount(uint8 num);
181  bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
182 
183  void RefreshSpellMods();
184 
185  uint8 GetCasterLevel() const { return m_casterLevel; }
186 
187  bool HasMoreThanOneEffectForType(AuraType auraType) const;
188  bool IsArea() const;
189  bool IsPassive() const;
190  bool IsDeathPersistent() const;
191 
192  bool IsRemovedOnShapeLost(Unit* target) const
193  {
194  return GetCasterGUID() == target->GetGUID()
195  && m_spellInfo->Stances
196  && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT)
197  && !(m_spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT);
198  }
199 
200  bool CanBeSaved() const;
201  bool IsRemoved() const { return m_isRemoved; }
202  bool CanBeSentToClient() const;
203  // Single cast aura helpers
204  bool IsSingleTarget() const {return m_isSingleTarget; }
205  bool IsSingleTargetWith(Aura const* aura) const;
206  void SetIsSingleTarget(bool val) { m_isSingleTarget = val; }
207  void UnregisterSingleTarget();
208  int32 CalcDispelChance(Unit* auraTarget, bool offensive) const;
209 
219  AuraKey GenerateKey(uint32& recalculateMask) const;
220  void SetLoadedState(int32 maxDuration, int32 duration, int32 charges, uint8 stackAmount, uint32 recalculateMask, int32* amount);
221 
222  // helpers for aura effects
223  bool HasEffect(uint8 effIndex) const { return GetEffect(effIndex) != NULL; }
224  bool HasEffectType(AuraType type) const;
225  AuraEffect* GetEffect(uint32 index) const;
226  uint32 GetEffectMask() const;
227  void RecalculateAmountOfEffects();
228  void HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply);
229 
230  // Helpers for targets
231  ApplicationMap const& GetApplicationMap() { return m_applications; }
232  void GetApplicationList(Unit::AuraApplicationList& applicationList) const;
233  const AuraApplication* GetApplicationOfTarget(ObjectGuid guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
234  AuraApplication* GetApplicationOfTarget(ObjectGuid guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
235  bool IsAppliedOnTarget(ObjectGuid guid) const { return m_applications.find(guid) != m_applications.end(); }
236 
237  void SetNeedClientUpdateForTargets() const;
238  void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
239  void HandleAuraSpecificPeriodics(AuraApplication const* aurApp, Unit* caster);
240  bool CanBeAppliedOn(Unit* target);
241  bool CheckAreaTarget(Unit* target);
242  bool CanStackWith(Aura const* existingAura) const;
243 
244  // Proc system
245  // this subsystem is not yet in use - the core of it is functional, but still some research has to be done
246  // and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
247  // currently proc system functionality is implemented in Unit::ProcDamageAndSpell
248  bool IsProcOnCooldown() const;
249  void AddProcCooldown(uint32 msec);
250  bool IsUsingCharges() const { return m_isUsingCharges; }
251  void SetUsingCharges(bool val) { m_isUsingCharges = val; }
252  void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo);
253  bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const;
254  float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
255  void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
256 
257  // AuraScript
258  void LoadScripts();
259  bool CallScriptCheckAreaTargetHandlers(Unit* target);
260  void CallScriptDispel(DispelInfo* dispelInfo);
261  void CallScriptAfterDispel(DispelInfo* dispelInfo);
262  bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
263  bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
264  void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
265  void CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
266  bool CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp);
267  void CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff);
268  void CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated);
269  void CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude);
270  void CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod);
271  void CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
272  void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
273  void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
274  void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
275  void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount);
276  // Spell Proc Hooks
277  bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
278  bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
279  bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
280  void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
281  bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
282  void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
283 
284  AuraScript* GetScriptByName(std::string const& scriptName) const;
285 
286  std::list<AuraScript*> m_loadedScripts;
287 
288  AuraEffectVector GetAuraEffects() const { return _effects; }
289 
290  SpellEffectInfoVector GetSpellEffectInfos() const { return _spelEffectInfos; }
291  SpellEffectInfo const* GetSpellEffectInfo(uint32 index) const;
292 
293  private:
294  void _DeleteRemovedApplications();
295  protected:
296  SpellInfo const* const m_spellInfo;
298  ObjectGuid const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
300  time_t const m_applyTime;
302 
303  int32 m_maxDuration; // Max aura duration
304  int32 m_duration; // Current time
305  int32 m_timeCla; // Timer for power per sec calcultion
306  std::vector<SpellPowerEntry const*> m_periodicCosts;// Periodic costs
307  int32 m_updateTargetMapInterval; // Timer for UpdateTargetMapOfEffect
308 
309  uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
310  uint8 m_procCharges; // Aura charges (0 for infinite)
311  uint8 m_stackAmount; // Aura stack amount
312 
313  //AuraEffect* m_effects[3];
314  ApplicationMap m_applications;
315 
316  bool m_isRemoved:1;
317  bool m_isSingleTarget:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
318  bool m_isUsingCharges:1;
319 
321 
322  private:
324 
327 };
328 
329 class TC_GAME_API UnitAura : public Aura
330 {
331  friend Aura* Aura::Create(SpellInfo const* spellproto, uint32 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
332  public:
333  UnitAura(SpellInfo const* spellproto, uint32 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
334 
335  void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp) override;
336  void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp) override;
337 
338  void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) override;
339 
340  void FillTargetMap(std::map<Unit*, uint32> & targets, Unit* caster) override;
341 
342  // Allow Apply Aura Handler to modify and access m_AuraDRGroup
343  void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
344  DiminishingGroup GetDiminishGroup() const { return m_AuraDRGroup; }
345 
346  private:
347  DiminishingGroup m_AuraDRGroup:8; // Diminishing
348 };
349 
351 {
352  friend Aura* Aura::Create(SpellInfo const* spellproto, uint32 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
353  public:
354  DynObjAura(SpellInfo const* spellproto, uint32 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, ObjectGuid casterGUID, int32 castItemLevel);
355 
356  void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) override;
357 
358  void FillTargetMap(std::map<Unit*, uint32> & targets, Unit* caster) override;
359 };
360 
362 {
363  friend class Aura;
364  protected:
365  ChargeDropEvent(Aura* base, AuraRemoveMode mode) : _base(base), _mode(mode) { }
366  bool Execute(uint64 /*e_time*/, uint32 /*p_time*/) override;
367 
368  private:
371 };
372 
373 #endif
AuraType
Definition: SpellAuraDefines.h:58
ObjectGuid Item
Definition: SpellAuras.h:99
bool Remove(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:104
Definition: SpellAuraEffects.h:30
SpellInfo const * GetSpellInfo() const
Definition: SpellAuras.h:130
uint8 const m_casterLevel
Definition: SpellAuras.h:309
time_t const m_applyTime
Definition: SpellAuras.h:300
time_t GetApplyTime() const
Definition: SpellAuras.h:158
Definition: SpellAuras.h:350
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
int32 CalcMaxDuration() const
Definition: SpellAuras.h:161
AuraEffectHandleModes
Definition: SpellAuraDefines.h:36
SpellInfo const *const m_spellInfo
Definition: SpellAuras.h:296
uint8 m_stackAmount
Definition: SpellAuras.h:311
Aura *const _base
Definition: SpellAuras.h:59
Definition: Player.h:167
Unit * GetTarget() const
Definition: SpellAuras.h:74
int32 GetMaxDuration() const
Definition: SpellAuras.h:159
Aura * _base
Definition: SpellAuras.h:369
AuraApplication * _CreateAuraApplication(Aura *aura, uint32 effMask)
Definition: Unit.cpp:3130
Definition: SpellInfo.h:326
AuraObjectType
Definition: SpellAuraDefines.h:546
void SetIsSingleTarget(bool val)
Definition: SpellAuras.h:206
bool IsPermanent() const
Definition: SpellAuras.h:168
ObjectGuid GetCastItemGUID() const
Definition: SpellAuras.h:133
Aura * GetBase() const
Definition: SpellAuras.h:75
bool IsNeedClientUpdate() const
Definition: SpellAuras.h:89
Definition: SpellAuraDefines.h:27
uint32 EffectMask
Definition: SpellAuras.h:101
uint8 _flags
Definition: SpellAuras.h:62
void SetMaxDuration(int32 duration)
Definition: SpellAuras.h:160
Spells
Definition: BattlegroundIC.h:707
bool IsRemovedOnShapeLost(Unit *target) const
Definition: SpellAuras.h:192
Definition: SpellAuras.h:50
Definition: SpellPackets.h:199
uint32 GetEffectsToApply() const
Definition: SpellAuras.h:83
DiminishingGroup
Definition: SharedDefines.h:4369
Unit * GetUnitOwner() const
Definition: SpellAuras.h:138
AuraRemoveMode _mode
Definition: SpellAuras.h:370
void ApplyForTargets()
Definition: SpellAuras.h:152
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 GetEffectMask() const
Definition: SpellAuras.h:79
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
Definition: Unit.cpp:3166
bool IsSingleTarget() const
Definition: SpellAuras.h:204
uint8 CalcMaxCharges() const
Definition: SpellAuras.h:173
bool operator<(AuraKey const &right) const
Definition: SpellAuras.h:103
Definition: SpellAuras.h:109
Definition: Object.h:423
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3442
Definition: SpellAuraDefines.h:549
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
uint8 GetSlot() const
Definition: SpellAuras.h:77
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
Definition: SpellAuras.h:329
const AuraApplication * GetApplicationOfTarget(ObjectGuid guid) const
Definition: SpellAuras.h:233
AuraEffectVector _effects
Definition: SpellAuras.h:325
uint8 GetFlags() const
Definition: SpellAuras.h:78
ChargeDropEvent * m_dropEvent
Definition: SpellAuras.h:320
ObjectGuid const m_casterGuid
Definition: SpellAuras.h:297
void SetNeedClientUpdate()
Definition: SpellAuras.h:88
Definition: DynamicObject.h:35
AuraEffectVector GetAuraEffects() const
Definition: SpellAuras.h:288
bool IsPositive() const
Definition: SpellAuras.h:81
Definition: Unit.h:984
void _ApplyAura(AuraApplication *aurApp, uint32 effMask)
Definition: Unit.cpp:3180
std::vector< SpellPowerEntry const * > m_periodicCosts
Definition: SpellAuras.h:306
std::vector< SpellEffectInfo const * > SpellEffectInfoVector
Definition: SpellInfo.h:315
uint8 _slot
Definition: SpellAuras.h:61
Definition: SpellMgr.h:290
Unit::AuraApplicationList m_removedApplications
Definition: SpellAuras.h:323
void SetDiminishGroup(DiminishingGroup group)
Definition: SpellAuras.h:343
void SetUsingCharges(bool val)
Definition: SpellAuras.h:251
bool HasEffect(uint8 effect) const
Definition: SpellAuras.h:80
Definition: SpellAuras.h:361
bool IsRemoved() const
Definition: SpellAuras.h:201
Definition: Item.h:259
Definition: SpellAuraDefines.h:26
Definition: SpellInfo.h:238
int32_t int32
Definition: Define.h:146
ApplicationMap m_applications
Definition: SpellAuras.h:314
WorldObject * GetOwner() const
Definition: SpellAuras.h:137
uint32 _effectMask
Definition: SpellAuras.h:65
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
Unit *const _target
Definition: SpellAuras.h:58
DiminishingGroup GetDiminishGroup() const
Definition: SpellAuras.h:344
bool HasEffect(uint8 effIndex) const
Definition: SpellAuras.h:223
ObjectGuid Caster
Definition: SpellAuras.h:98
bool IsUsingCharges() const
Definition: SpellAuras.h:250
int32 GetDuration() const
Definition: SpellAuras.h:163
virtual void FillTargetMap(std::map< Unit *, uint32 > &targets, Unit *caster)=0
bool IsSelfcast() const
Definition: SpellAuras.h:82
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
Definition: SpellAuras.cpp:481
WorldObject *const m_owner
Definition: SpellAuras.h:301
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
Definition: SpellAuras.cpp:461
bool IsExpired() const
Definition: SpellAuras.h:167
virtual bool Execute(uint64, uint32)
Definition: EventProcessor.h:42
Definition: BattlegroundMgr.h:57
DynamicObject * GetDynobjOwner() const
Definition: SpellAuras.h:139
ApplicationMap const & GetApplicationMap()
Definition: SpellAuras.h:231
uint8 GetCasterLevel() const
Definition: SpellAuras.h:185
std::list< AuraApplication * > AuraApplicationList
Definition: Unit.h:1324
uint32 _effectsToApply
Definition: SpellAuras.h:63
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: EventProcessor.h:28
SpellEffectInfoVector _spelEffectInfos
Definition: SpellAuras.h:326
std::array< int32, MAX_SPELL_EFFECTS > Amounts
Definition: SpellAuras.h:111
int32 m_maxDuration
Definition: SpellAuras.h:303
uint8 m_procCharges
Definition: SpellAuras.h:310
void SetRemoveMode(AuraRemoveMode mode)
Definition: SpellAuras.h:85
ChargeDropEvent(Aura *base, AuraRemoveMode mode)
Definition: SpellAuras.h:365
uint32 SpellId
Definition: SpellAuras.h:100
Definition: Unit.h:888
uint8 GetStackAmount() const
Definition: SpellAuras.h:179
#define TC_GAME_API
Definition: Define.h:134
AuraRemoveMode
Definition: Unit.h:448
std::map< ObjectGuid, AuraApplication * > ApplicationMap
Definition: SpellAuras.h:120
AuraApplication * GetApplicationOfTarget(ObjectGuid guid)
Definition: SpellAuras.h:234
int32 m_duration
Definition: SpellAuras.h:304
int32 m_updateTargetMapInterval
Definition: SpellAuras.h:307
uint8 GetCharges() const
Definition: SpellAuras.h:170
int32 m_timeCla
Definition: SpellAuras.h:305
uint8_t uint8
Definition: Define.h:152
bool IsAppliedOnTarget(ObjectGuid guid) const
Definition: SpellAuras.h:235
#define ASSERT
Definition: Errors.h:55
void _RegisterForTargets()
Definition: SpellAuras.h:151
#define MAX_SPELL_EFFECTS
Definition: DBCStructure.h:1026
int32 GetCastItemLevel() const
Definition: SpellAuras.h:134
std::array< int32, MAX_SPELL_EFFECTS > BaseAmounts
Definition: SpellAuras.h:112
Definition: SpellAuras.h:96
Definition: SharedDefines.h:372
static Aura * Create(SpellInfo const *spellproto, uint32 effMask, WorldObject *owner, Unit *caster, int32 *baseAmount, Item *castItem, ObjectGuid casterGUID, int32 castItemLevel)
Definition: SpellAuras.cpp:321
Definition: ObjectGuid.h:189
Definition: SpellAuraDefines.h:548
Definition: SpellScript.h:475
Definition: SpellAuras.h:116
ObjectGuid GetCasterGUID() const
Definition: SpellAuras.h:135
Definition: Unit.h:1305
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:86
Definition: Unit.h:451
SpellEffectInfoVector GetSpellEffectInfos() const
Definition: SpellAuras.h:290
int32 m_castItemLevel
Definition: SpellAuras.h:299
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
Definition: Unit.cpp:3217
ObjectGuid const m_castItemGuid
Definition: SpellAuras.h:298
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
std::list< AuraScript * > m_loadedScripts
Definition: SpellAuras.h:286
bool DropCharge(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: SpellAuras.h:175
std::vector< AuraEffect * > AuraEffectVector
Definition: SpellInfo.h:324
uint32 GetId() const
Definition: SpellAuras.h:131
Definition: Unit.h:921
Definition: SharedDefines.h:447