AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
NonTankLKTargetSelector Struct Reference

Public Member Functions

 NonTankLKTargetSelector (Creature *source, bool playerOnly=true, bool reqLOS=false, float maxDist=0.0f, uint32 exclude1=0, uint32 exclude2=0)
 
bool operator() (Unit const *target) const
 

Private Attributes

Creature const * _source
 
bool _playerOnly
 
bool _reqLOS
 
float _maxDist
 
uint32 _exclude1
 
uint32 _exclude2
 

Detailed Description

Constructor & Destructor Documentation

◆ NonTankLKTargetSelector()

NonTankLKTargetSelector::NonTankLKTargetSelector ( Creature source,
bool  playerOnly = true,
bool  reqLOS = false,
float  maxDist = 0.0f,
uint32  exclude1 = 0,
uint32  exclude2 = 0 
)
inline
410: _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist), _exclude1(exclude1), _exclude2(exclude2) { }
bool _playerOnly
Definition boss_the_lich_king.cpp:434
bool _reqLOS
Definition boss_the_lich_king.cpp:435
uint32 _exclude2
Definition boss_the_lich_king.cpp:438
Creature const * _source
Definition boss_the_lich_king.cpp:433
uint32 _exclude1
Definition boss_the_lich_king.cpp:437
float _maxDist
Definition boss_the_lich_king.cpp:436

Member Function Documentation

◆ operator()()

bool NonTankLKTargetSelector::operator() ( Unit const *  target) const
inline
412 {
413 if (!target)
414 return false;
415 if (!target->IsAlive())
416 return false;
417 if (_playerOnly && !target->IsPlayer())
418 return false;
419 if (target == _source->GetVictim())
420 return false;
421 if (target->HasAura(SPELL_BOSS_HITTIN_YA_AURA))
422 return false;
423 if (_maxDist && _source->GetExactDist(target) > _maxDist)
424 return false;
425 if ((_exclude1 && target->HasAura(_exclude1)) || (_exclude2 && target->HasAura(_exclude2)))
426 return false;
427 if (_reqLOS && !_source->IsWithinLOSInMap(target))
428 return false;
429 return true;
430 }
@ SPELL_BOSS_HITTIN_YA_AURA
Definition boss_the_lich_king.cpp:86
Unit * GetVictim() const
Definition Unit.h:846
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1358
float GetExactDist(float x, float y, float z) const
Definition Position.h:182

References _exclude1, _exclude2, _maxDist, _playerOnly, _reqLOS, _source, Position::GetExactDist(), Unit::GetVictim(), Unit::HasAura(), Unit::IsAlive(), Object::IsPlayer(), WorldObject::IsWithinLOSInMap(), and SPELL_BOSS_HITTIN_YA_AURA.

Member Data Documentation

◆ _exclude1

uint32 NonTankLKTargetSelector::_exclude1
private

Referenced by operator()().

◆ _exclude2

uint32 NonTankLKTargetSelector::_exclude2
private

Referenced by operator()().

◆ _maxDist

float NonTankLKTargetSelector::_maxDist
private

Referenced by operator()().

◆ _playerOnly

bool NonTankLKTargetSelector::_playerOnly
private

Referenced by operator()().

◆ _reqLOS

bool NonTankLKTargetSelector::_reqLOS
private

Referenced by operator()().

◆ _source

Creature const* NonTankLKTargetSelector::_source
private

Referenced by operator()().


The documentation for this struct was generated from the following file: