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
402: _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist), _exclude1(exclude1), _exclude2(exclude2) { }
bool _playerOnly
Definition boss_the_lich_king.cpp:426
bool _reqLOS
Definition boss_the_lich_king.cpp:427
uint32 _exclude2
Definition boss_the_lich_king.cpp:430
Creature const * _source
Definition boss_the_lich_king.cpp:425
uint32 _exclude1
Definition boss_the_lich_king.cpp:429
float _maxDist
Definition boss_the_lich_king.cpp:428

Member Function Documentation

◆ operator()()

bool NonTankLKTargetSelector::operator() ( Unit const *  target) const
inline
404 {
405 if (!target)
406 return false;
407 if (!target->IsAlive())
408 return false;
409 if (_playerOnly && !target->IsPlayer())
410 return false;
411 if (target == _source->GetVictim())
412 return false;
413 if (target->HasAura(SPELL_BOSS_HITTIN_YA_AURA))
414 return false;
415 if (_maxDist && _source->GetExactDist(target) > _maxDist)
416 return false;
417 if ((_exclude1 && target->HasAura(_exclude1)) || (_exclude2 && target->HasAura(_exclude2)))
418 return false;
419 if (_reqLOS && !_source->IsWithinLOSInMap(target))
420 return false;
421 return true;
422 }
@ SPELL_BOSS_HITTIN_YA_AURA
Definition boss_the_lich_king.cpp:86
Unit * GetVictim() const
Definition Unit.h:893
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:1373
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: