26 : _me(unit), _dist(dist), _playerOnly(playerOnly), _exception(!withTank ? unit->GetThreatManager().GetLastVictim() : nullptr), _aura(aura)
47 if (_dist < 0.0f && _me->IsWithinCombatRange(target, -
_dist))
68 _caster(caster), _spellInfo(
sSpellMgr->GetSpellInfo(spellId, caster->GetMap()->GetDifficultyID()))
82 float minRange = 0.0f;
83 float maxRange = 0.0f;
84 float rangeMod = 0.0f;
96 float meleeRange = 0.0f;
112 minRange += rangeMod;
117 rangeMod += 8.0f / 3.0f;
120 maxRange += rangeMod;
122 minRange *= minRange;
123 maxRange *= maxRange;
146 return target != currentVictim;
165 if (_dist < 0.0f && _me->IsWithinCombatRange(target, -
_dist))
#define NOMINAL_MELEE_RANGE
SpellRangeEntry const * RangeEntry
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
Unit * GetCurrentVictim()
ThreatManager & GetThreatManager()
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
Powers GetPowerType() const
float GetCombatReach() const override
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
DefaultTargetSelector(Unit const *unit, float dist, bool playerOnly, bool withMainTank, int32 aura)
bool operator()(Unit const *target) const
bool operator()(Unit const *target) const
bool operator()(Unit const *target) const
constexpr float GetExactDistSq(float x, float y, float z) const
SpellInfo const * _spellInfo
bool operator()(Unit const *target) const
SpellTargetSelector(Unit *caster, uint32 spellId)