AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
AuraMunchingQueue Class Reference
Inheritance diagram for AuraMunchingQueue:
BasicEvent

Public Member Functions

 AuraMunchingQueue (Unit &owner, ObjectGuid targetGUID, int32 basePoints, uint32 spellId, AuraEffect *aurEff, AuraType auraType)
 
bool Execute (uint64, uint32) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Private Attributes

Unit_owner
 
ObjectGuid _targetGUID
 
int32 _basePoints
 
uint32 _spellId
 
AuraEffect_aurEff
 
AuraType _auraType
 

Detailed Description

Constructor & Destructor Documentation

◆ AuraMunchingQueue()

AuraMunchingQueue::AuraMunchingQueue ( Unit owner,
ObjectGuid  targetGUID,
int32  basePoints,
uint32  spellId,
AuraEffect aurEff,
AuraType  auraType 
)
inline
20231: _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId), _aurEff(aurEff), _auraType(auraType) { }
ObjectGuid _targetGUID
Definition: Unit.cpp:20255
Unit & _owner
Definition: Unit.cpp:20254
uint32 _spellId
Definition: Unit.cpp:20257
AuraEffect * _aurEff
Definition: Unit.cpp:20258
int32 _basePoints
Definition: Unit.cpp:20256
AuraType _auraType
Definition: Unit.cpp:20259

Member Function Documentation

◆ Execute()

bool AuraMunchingQueue::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

20234 {
20235 if (_owner.IsInWorld() && _owner.FindMap())
20237 {
20238 bool auraFound = false; // Used to ensure _aurEff exists to avoid wild pointer access/crash
20239 Unit::AuraEffectList const& auraEffects = target->GetAuraEffectsByType(_auraType);
20240 for (Unit::AuraEffectList::const_iterator j = auraEffects.begin(); j != auraEffects.end(); ++j)
20241 if ((*j) == _aurEff)
20242 auraFound = true;
20243
20244 if (!auraFound)
20245 _aurEff = nullptr;
20246
20248 }
20249
20250 return true;
20251 }
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:114
TriggerCastFlags
Definition: SpellDefines.h:130
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:148
@ TRIGGERED_NO_PERIODIC_RESET
Will ignore equipped item requirements.
Definition: SpellDefines.h:150
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
bool IsInWorld() const
Definition: Object.h:104
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
Map * FindMap() const
Definition: Object.h:532
Definition: Unit.h:630
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1225
std::list< AuraEffect * > AuraEffectList
Definition: Unit.h:646

References _auraType, _aurEff, _basePoints, _owner, _spellId, _targetGUID, Unit::CastCustomSpell(), WorldObject::FindMap(), Object::GetGUID(), ObjectAccessor::GetUnit(), Object::IsInWorld(), SPELLVALUE_BASE_POINT0, TRIGGERED_FULL_MASK, and TRIGGERED_NO_PERIODIC_RESET.

Member Data Documentation

◆ _auraType

AuraType AuraMunchingQueue::_auraType
private

Referenced by Execute().

◆ _aurEff

AuraEffect* AuraMunchingQueue::_aurEff
private

Referenced by Execute().

◆ _basePoints

int32 AuraMunchingQueue::_basePoints
private

Referenced by Execute().

◆ _owner

Unit& AuraMunchingQueue::_owner
private

Referenced by Execute().

◆ _spellId

uint32 AuraMunchingQueue::_spellId
private

Referenced by Execute().

◆ _targetGUID

ObjectGuid AuraMunchingQueue::_targetGUID
private

Referenced by Execute().