AzerothCore 3.3.5a
OpenSource WoW Emulator
No Matches
MysticBuffetTargetFilter Class Reference

Public Member Functions

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

Private Attributes


Detailed Description

Constructor & Destructor Documentation

◆ MysticBuffetTargetFilter()

MysticBuffetTargetFilter::MysticBuffetTargetFilter ( Unit caster)
1272: _caster(caster) { }
Unit * _caster
Definition: boss_sindragosa.cpp:1292

Member Function Documentation

◆ operator()()

bool MysticBuffetTargetFilter::operator() ( WorldObject unit) const
1275 {
1276 if (!unit->IsInMap(_caster))
1277 return true;
1279 // for standard creatures check full LOS
1280 if (Creature* c = unit->ToCreature())
1281 if (!c->IsPet() && c->GetSpawnId())
1282 return !_caster->IsWithinLOSInMap(unit);
1284 // for players and pets check only dynamic los (ice block gameobjects)
1285 float ox, oy, oz;
1286 _caster->GetPosition(ox, oy, oz);
1287 DynamicMapTree const& dTree = unit->GetMap()->GetDynamicMapTree();
1288 return !dTree.isInLineOfSight(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ() + 2.f, ox, oy, oz + 2.f, unit->GetPhaseMask(), VMAP::ModelIgnoreFlags::Nothing);
1289 }
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:46
Creature * ToCreature()
Definition: Object.h:197
uint32 GetPhaseMask() const
Definition: Object.h:434
Map * GetMap() const
Definition: Object.h:517
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
bool IsInMap(WorldObject const *obj) const
Definition: Object.cpp:1285
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
void GetPosition(float &x, float &y) const
Definition: Position.h:122
float GetPositionY() const
Definition: Position.h:118
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

Referenced by operator()().