74{
75 if (!target)
76 return false;
77
79 return false;
80
81
82 float minRange = 0.0f;
83 float maxRange = 0.0f;
84 float rangeMod = 0.0f;
86 {
88 {
90 rangeMod += target->GetCombatReach();
91
93 }
94 else
95 {
96 float meleeRange = 0.0f;
98 {
100 meleeRange += target->GetCombatReach();
101
103 }
104
107
109 rangeMod += target->GetCombatReach();
110
112 minRange += rangeMod;
113 }
114
117 rangeMod += 8.0f / 3.0f;
118 }
119
120 maxRange += rangeMod;
121
122 minRange *= minRange;
123 maxRange *= maxRange;
124
126 {
128 return false;
129
131 return false;
132 }
133
134 return true;
135}
#define NOMINAL_MELEE_RANGE
Definition: ObjectDefines.h:42
@ TYPEID_PLAYER
Definition: ObjectGuid.h:39
@ SPELL_CAST_OK
Definition: SharedDefines.h:1762
@ SPELL_RANGE_MELEE
Definition: Spell.h:151
@ SPELL_RANGE_RANGED
Definition: Spell.h:152
SpellRangeEntry const * RangeEntry
Definition: SpellInfo.h:388
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
Definition: SpellInfo.cpp:2136
float GetCombatReach() const override
Definition: Unit.h:804
bool isMoving() const
Definition: Unit.h:1825
bool IsWalking() const
Definition: Unit.h:1225
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition: Object.cpp:2274
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
Definition: Object.cpp:2260
float GetExactDistSq(float x, float y, float z) const
Definition: Position.h:111
uint8 Flags
Definition: DB2Structure.h:3657