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
20275: _owner(owner), _targetGUID(targetGUID), _basePoints(basePoints), _spellId(spellId), _aurEff(aurEff), _auraType(auraType) { }
ObjectGuid _targetGUID
Definition: Unit.cpp:20299
Unit & _owner
Definition: Unit.cpp:20298
uint32 _spellId
Definition: Unit.cpp:20301
AuraEffect * _aurEff
Definition: Unit.cpp:20302
int32 _basePoints
Definition: Unit.cpp:20300
AuraType _auraType
Definition: Unit.cpp:20303

Member Function Documentation

◆ Execute()

bool AuraMunchingQueue::Execute ( uint64  ,
uint32   
)
inlineoverridevirtual

Reimplemented from BasicEvent.

20278 {
20279 if (_owner.IsInWorld() && _owner.FindMap())
20281 {
20282 bool auraFound = false; // Used to ensure _aurEff exists to avoid wild pointer access/crash
20283 Unit::AuraEffectList const& auraEffects = target->GetAuraEffectsByType(_auraType);
20284 for (Unit::AuraEffectList::const_iterator j = auraEffects.begin(); j != auraEffects.end(); ++j)
20285 if ((*j) == _aurEff)
20286 auraFound = true;
20287
20288 if (!auraFound)
20289 _aurEff = nullptr;
20290
20292 }
20293
20294 return true;
20295 }
@ SPELLVALUE_BASE_POINT0
Definition: SpellDefines.h:113
TriggerCastFlags
Definition: SpellDefines.h:132
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:150
@ TRIGGERED_NO_PERIODIC_RESET
Will ignore equipped item requirements.
Definition: SpellDefines.h:152
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:199
bool IsInWorld() const
Definition: Object.h:107
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
Map * FindMap() const
Definition: Object.h:537
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:1224
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().