AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
RedirectSpellEvent Class Reference

#include "Unit.h"

Inheritance diagram for RedirectSpellEvent:
BasicEvent

Public Member Functions

 RedirectSpellEvent (Unit &self, ObjectGuid auraOwnerGUID, AuraEffect *auraEffect)
 
bool Execute (uint64 e_time, uint32 p_time) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Protected Attributes

Unit & _self
 
ObjectGuid _auraOwnerGUID
 
AuraEffect * _auraEffect
 

Detailed Description

Constructor & Destructor Documentation

◆ RedirectSpellEvent()

RedirectSpellEvent::RedirectSpellEvent ( Unit &  self,
ObjectGuid  auraOwnerGUID,
AuraEffect *  auraEffect 
)
inline
2351: _self(self), _auraOwnerGUID(auraOwnerGUID), _auraEffect(auraEffect) { }
AuraEffect * _auraEffect
Definition Unit.h:2357
ObjectGuid _auraOwnerGUID
Definition Unit.h:2356
Unit & _self
Definition Unit.h:2355

Member Function Documentation

◆ Execute()

bool RedirectSpellEvent::Execute ( uint64  e_time,
uint32  p_time 
)
overridevirtual

Reimplemented from BasicEvent.

7893{
7895 {
7896 // Xinef: already removed
7897 if (!auraOwner->HasSpellMagnetAura())
7898 return true;
7899
7900 Unit::AuraEffectList const& magnetAuras = auraOwner->GetAuraEffectsByType(SPELL_AURA_SPELL_MAGNET);
7901 for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
7902 if (*itr == _auraEffect)
7903 {
7904 (*itr)->GetBase()->DropCharge(AURA_REMOVE_BY_DEFAULT);
7905 return true;
7906 }
7907 }
7908
7909 return true;
7910}
@ SPELL_AURA_SPELL_MAGNET
Definition SpellAuraDefines.h:159
@ AURA_REMOVE_BY_DEFAULT
Definition SpellAuraDefines.h:392
Definition Unit.h:665
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:681
Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:223

References _auraEffect, _auraOwnerGUID, _self, AURA_REMOVE_BY_DEFAULT, Unit::GetAuraEffectsByType(), ObjectAccessor::GetUnit(), and SPELL_AURA_SPELL_MAGNET.

Member Data Documentation

◆ _auraEffect

AuraEffect* RedirectSpellEvent::_auraEffect
protected

Referenced by Execute().

◆ _auraOwnerGUID

ObjectGuid RedirectSpellEvent::_auraOwnerGUID
protected

Referenced by Execute().

◆ _self

Unit& RedirectSpellEvent::_self
protected

Referenced by Execute().


The documentation for this class was generated from the following files: