19 #ifndef TRINITY_SPELLAURAS_H
20 #define TRINITY_SPELLAURAS_H
28 struct ProcTriggerSpell;
48 #define UPDATE_TARGET_MAP_INTERVAL 500
64 bool _needClientUpdate:1;
71 void _HandleEffect(
uint8 effIndex,
bool apply);
91 void ClientUpdate(
bool remove =
false);
105 return memcmp(
this, &right,
sizeof(*
this)) < 0;
136 Unit* GetCaster()
const;
148 virtual void FillTargetMap(std::map<Unit*, uint32> & targets,
Unit* caster) = 0;
149 void UpdateTargetMap(
Unit* caster,
bool apply =
true);
153 void _ApplyEffectForTargets(
uint8 effIndex);
162 int32 CalcMaxDuration(
Unit* caster)
const;
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; }
171 void SetCharges(
uint8 charges);
172 uint8 CalcMaxCharges(
Unit* caster)
const;
180 void SetStackAmount(
uint8 num);
183 void RefreshSpellMods();
187 bool HasMoreThanOneEffectForType(
AuraType auraType)
const;
189 bool IsPassive()
const;
190 bool IsDeathPersistent()
const;
194 return GetCasterGUID() == target->
GetGUID()
195 && m_spellInfo->Stances
200 bool CanBeSaved()
const;
202 bool CanBeSentToClient()
const;
205 bool IsSingleTargetWith(
Aura const* aura)
const;
207 void UnregisterSingleTarget();
208 int32 CalcDispelChance(
Unit* auraTarget,
bool offensive)
const;
224 bool HasEffectType(
AuraType type)
const;
226 uint32 GetEffectMask()
const;
227 void RecalculateAmountOfEffects();
237 void SetNeedClientUpdateForTargets()
const;
240 bool CanBeAppliedOn(
Unit* target);
241 bool CheckAreaTarget(
Unit* target);
242 bool CanStackWith(
Aura const* existingAura)
const;
248 bool IsProcOnCooldown()
const;
249 void AddProcCooldown(
uint32 msec);
259 bool CallScriptCheckAreaTargetHandlers(
Unit* target);
260 void CallScriptDispel(
DispelInfo* dispelInfo);
261 void CallScriptAfterDispel(
DispelInfo* dispelInfo);
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);
284 AuraScript* GetScriptByName(std::string
const& scriptName)
const;
294 void _DeleteRemovedApplications();
317 bool m_isSingleTarget:1;
318 bool m_isUsingCharges:1;
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
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
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
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: 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
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
AuraRemoveMode GetRemoveMode() const
Definition: SpellAuras.h:86
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: SharedDefines.h:447