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

#include "GridNotifiers.h"

Public Member Functions

 FriendlyCCedInRange (Unit const *obj, float range)
 
bool operator() (Unit *u)
 

Private Attributes

Unit const * i_obj
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ FriendlyCCedInRange()

Acore::FriendlyCCedInRange::FriendlyCCedInRange ( Unit const *  obj,
float  range 
)
inline
820: i_obj(obj), i_range(range) {}
float i_range
Definition: GridNotifiers.h:832
Unit const * i_obj
Definition: GridNotifiers.h:831

Member Function Documentation

◆ operator()()

bool Acore::FriendlyCCedInRange::operator() ( Unit u)
inline
822 {
823 if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
825 {
826 return true;
827 }
828 return false;
829 }
@ UNIT_STATE_CONFUSED
Definition: UnitDefines.h:160
@ UNIT_STATE_STUNNED
Definition: UnitDefines.h:152
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
bool IsCharmed() const
Definition: Unit.h:1235
bool isFrozen() const
Definition: Unit.cpp:15829
bool IsAlive() const
Definition: Unit.h:1654
bool HasFearAura() const
Definition: Unit.h:1697
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:10236
bool IsInCombat() const
Definition: Unit.h:884

References Unit::HasFearAura(), Unit::HasUnitState(), i_obj, i_range, Unit::IsAlive(), Unit::IsCharmed(), Unit::isFrozen(), Unit::IsHostileTo(), Unit::IsInCombat(), WorldObject::IsWithinDistInMap(), UNIT_STATE_CONFUSED, and UNIT_STATE_STUNNED.

Member Data Documentation

◆ i_obj

Unit const* Acore::FriendlyCCedInRange::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::FriendlyCCedInRange::i_range
private

Referenced by operator()().