AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
MysticBuffetTargetFilter Class Reference

Public Member Functions

 MysticBuffetTargetFilter (Unit *caster)
 
bool operator() (WorldObject *unit) const
 

Private Attributes

Unit_caster
 

Detailed Description

Constructor & Destructor Documentation

◆ MysticBuffetTargetFilter()

MysticBuffetTargetFilter::MysticBuffetTargetFilter ( Unit caster)
inlineexplicit
1104: _caster(caster) { }
Unit * _caster
Definition: boss_sindragosa.cpp:1124

Member Function Documentation

◆ operator()()

bool MysticBuffetTargetFilter::operator() ( WorldObject unit) const
inline
1107 {
1108 if (!unit->IsInMap(_caster))
1109 return true;
1110
1111 // for standard creatures check full LOS
1112 if (Creature* c = unit->ToCreature())
1113 if (!c->IsPet() && c->GetSpawnId())
1114 return !_caster->IsWithinLOSInMap(unit);
1115
1116 // for players and pets check only dynamic los (ice block gameobjects)
1117 float ox, oy, oz;
1118 _caster->GetPosition(ox, oy, oz);
1119 DynamicMapTree const& dTree = unit->GetMap()->GetDynamicMapTree();
1120 return !dTree.isInLineOfSight(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ() + 2.f, ox, oy, oz + 2.f, unit->GetPhaseMask(), VMAP::ModelIgnoreFlags::Nothing);
1121 }
Definition: DynamicTree.h:39
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, VMAP::ModelIgnoreFlags ignoreFlags) const
Definition: DynamicTree.cpp:276
Definition: Creature.h:43
Creature * ToCreature()
Definition: Object.h:205
uint32 GetPhaseMask() const
Definition: Object.h:451
Map * GetMap() const
Definition: Object.h:536
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
bool IsInMap(WorldObject const *obj) const
Definition: Object.cpp:1296
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
void GetPosition(float &x, float &y) const
Definition: Position.h:121
float GetPositionY() const
Definition: Position.h:117
DynamicMapTree const & GetDynamicMapTree() const
Definition: Map.h:561

References _caster, Map::GetDynamicMapTree(), WorldObject::GetMap(), WorldObject::GetPhaseMask(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), DynamicMapTree::isInLineOfSight(), WorldObject::IsInMap(), WorldObject::IsWithinLOSInMap(), VMAP::Nothing, and Object::ToCreature().

Member Data Documentation

◆ _caster

Unit* MysticBuffetTargetFilter::_caster
private

Referenced by operator()().