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
408: _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist), _exclude1(exclude1), _exclude2(exclude2) { }
bool _playerOnly
Definition: boss_the_lich_king.cpp:432
bool _reqLOS
Definition: boss_the_lich_king.cpp:433
uint32 _exclude2
Definition: boss_the_lich_king.cpp:436
Creature const * _source
Definition: boss_the_lich_king.cpp:431
uint32 _exclude1
Definition: boss_the_lich_king.cpp:435
float _maxDist
Definition: boss_the_lich_king.cpp:434

Member Function Documentation

◆ operator()()

bool NonTankLKTargetSelector::operator() ( Unit const *  target) const
inline
410 {
411 if (!target)
412 return false;
413 if (!target->IsAlive())
414 return false;
415 if (_playerOnly && !target->IsPlayer())
416 return false;
417 if (target == _source->GetVictim())
418 return false;
419 if (target->HasAura(SPELL_BOSS_HITTIN_YA_AURA))
420 return false;
421 if (_maxDist && _source->GetExactDist(target) > _maxDist)
422 return false;
423 if ((_exclude1 && target->HasAura(_exclude1)) || (_exclude2 && target->HasAura(_exclude2)))
424 return false;
425 if (_reqLOS && !_source->IsWithinLOSInMap(target))
426 return false;
427 return true;
428 }
@ SPELL_BOSS_HITTIN_YA_AURA
Definition: boss_the_lich_king.cpp:84
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:1347
float GetExactDist(float x, float y, float z) const
Definition: Position.h:178
Unit * GetVictim() const
Definition: Unit.h:789

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()().