boilerplate
(Trade distance is definitely greater than Duel distance... not sure why this note was added) |
(boilerplate) |
||
| Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Checks whether you are in range to perform a specific interaction with a specified unit. | |||
inRange = CheckInteractDistance("unit", distIndex); | |||
-- | ==Arguments== | ||
;unit : String - [[UnitId|Unit]] to compare distance to. | |||
;distIndex : Number - A value from 1 to 4: | |||
::1 = Inspect, 28 yards | |||
::2 = Trade, 11.11 yards | |||
::3 = Duel, 9.9 yards | |||
::4 = Follow, 28 yards | |||
: | ==Returns== | ||
;inRange : Boolean flag - 1 if you are in range to perform the interaction, nil otherwise. | |||
==Example== | |||
if ( CheckInteractDistance("target", 4) ) then | if ( CheckInteractDistance("target", 4) ) then | ||
FollowUnit("target"); | FollowUnit("target"); | ||
| Line 34: | Line 21: | ||
-- we're too far away to follow the target | -- we're too far away to follow the target | ||
end | end | ||
==Notes== | |||
* If "unit" is a hostile unit, the return values are the same. But you obviously won't be able to do things like Trade. | |||