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

Public Member Functions

 DefileTargetSelector (Creature *source)
 
bool operator() (Unit const *target) const
 

Private Attributes

Creature const * _source
 

Detailed Description

Constructor & Destructor Documentation

◆ DefileTargetSelector()

DefileTargetSelector::DefileTargetSelector ( Creature source)
inline
443: _source(source) { }
Creature const * _source
Definition: boss_the_lich_king.cpp:462

Member Function Documentation

◆ operator()()

bool DefileTargetSelector::operator() ( Unit const *  target) const
inline
445 {
446 if (!target)
447 return false;
448 if (!target->IsAlive())
449 return false;
450 if (!target->IsPlayer())
451 return false;
452 if (_source->GetExactDist(target) > 100.0f)
453 return false;
454 if (target->HasAura(SPELL_HARVEST_SOUL_VALKYR) || target->HasAura(SPELL_VALKYR_TARGET_SEARCH))
455 return false;
456 if (!_source->IsWithinLOSInMap(target))
457 return false;
458 return true;
459 }
@ SPELL_VALKYR_TARGET_SEARCH
Definition: boss_the_lich_king.cpp:145
@ SPELL_HARVEST_SOUL_VALKYR
Definition: boss_the_lich_king.cpp:146
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

References _source, Position::GetExactDist(), Unit::HasAura(), Unit::IsAlive(), Object::IsPlayer(), WorldObject::IsWithinLOSInMap(), SPELL_HARVEST_SOUL_VALKYR, and SPELL_VALKYR_TARGET_SEARCH.

Member Data Documentation

◆ _source

Creature const* DefileTargetSelector::_source
private

Referenced by operator()().