AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

 AnyUnfriendlyNoTotemUnitInObjectRangeCheck (WorldObject const *obj, Unit const *funit, float range)
 
bool operator() (Unit *u)
 

Private Attributes

WorldObject const * i_obj
 
Unit const * i_funit
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyUnfriendlyNoTotemUnitInObjectRangeCheck()

Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::AnyUnfriendlyNoTotemUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range 
)
inline
881: i_obj(obj), i_funit(funit), i_range(range) {}
float i_range
Definition: GridNotifiers.h:901
Unit const * i_funit
Definition: GridNotifiers.h:900
WorldObject const * i_obj
Definition: GridNotifiers.h:899

Member Function Documentation

◆ operator()()

bool Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::operator() ( Unit u)
inline
883 {
884 if (!u->IsAlive())
885 return false;
886
888 return false;
889
890 if (u->IsCreature() && (u->ToCreature()->IsTotem() || u->ToCreature()->IsTrigger() || u->ToCreature()->IsAvoidingAOE())) // pussywizard: added IsAvoidingAOE()
891 return false;
892
893 if (!u->isTargetableForAttack(false, i_funit))
894 return false;
895
897 }
@ CREATURE_TYPE_NON_COMBAT_PET
Definition: SharedDefines.h:2639
bool IsTrigger() const
Definition: Creature.h:75
bool IsAvoidingAOE() const
Definition: Creature.h:130
bool IsCreature() const
Definition: Object.h:204
Creature * ToCreature()
Definition: Object.h:205
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
bool IsAlive() const
Definition: Unit.h:1654
uint32 GetCreatureType() const
Definition: Unit.cpp:15182
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10241
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition: Unit.cpp:13854
bool IsTotem() const
Definition: Unit.h:756

References CREATURE_TYPE_NON_COMBAT_PET, Unit::GetCreatureType(), i_funit, i_obj, i_range, Unit::IsAlive(), Creature::IsAvoidingAOE(), Object::IsCreature(), Unit::IsFriendlyTo(), Unit::isTargetableForAttack(), Unit::IsTotem(), Creature::IsTrigger(), WorldObject::IsWithinDistInMap(), and Object::ToCreature().

Member Data Documentation

◆ i_funit

Unit const* Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_funit
private

Referenced by operator()().

◆ i_obj

WorldObject const* Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_range
private

Referenced by operator()().