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

Member Function Documentation

◆ operator()()

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

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