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

#include "GridNotifiers.h"

Public Member Functions

 FriendlyMissingBuffInRange (Unit const *obj, float range, uint32 spellid)
 
bool operator() (Unit *u)
 

Private Attributes

Unit const * i_obj
 
float i_range
 
uint32 i_spell
 

Detailed Description

Constructor & Destructor Documentation

◆ FriendlyMissingBuffInRange()

Acore::FriendlyMissingBuffInRange::FriendlyMissingBuffInRange ( Unit const *  obj,
float  range,
uint32  spellid 
)
inline
838 : i_obj(obj), i_range(range)
839 {
840 i_spell = spellid;
841 if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellid))
842 if (SpellInfo const* newSpell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, const_cast<Unit*>(obj)))
843 i_spell = newSpell->Id;
844 }
#define sSpellMgr
Definition: SpellMgr.h:825
Definition: Unit.h:630
float i_range
Definition: GridNotifiers.h:856
uint32 i_spell
Definition: GridNotifiers.h:857
Unit const * i_obj
Definition: GridNotifiers.h:855
Definition: SpellInfo.h:316

References i_spell, and sSpellMgr.

Member Function Documentation

◆ operator()()

bool Acore::FriendlyMissingBuffInRange::operator() ( Unit u)
inline
846 {
847 if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
848 !(u->HasAura(i_spell)))
849 {
850 return true;
851 }
852 return false;
853 }
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
bool IsAlive() const
Definition: Unit.h:1204
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:10198
bool IsInCombat() const
Definition: Unit.h:820

References Unit::HasAura(), i_obj, i_range, i_spell, Unit::IsAlive(), Unit::IsHostileTo(), Unit::IsInCombat(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_obj

Unit const* Acore::FriendlyMissingBuffInRange::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::FriendlyMissingBuffInRange::i_range
private

Referenced by operator()().

◆ i_spell

uint32 Acore::FriendlyMissingBuffInRange::i_spell
private