WoW:API CheckInteractDistance: Difference between revisions
Jump to navigation
Jump to search
CheckInteractDistance
No edit summary |
(Updated ranges to reflect actual values used in client) |
||
| Line 10: | Line 10: | ||
:;unit : The unit to query (e.g. "target", "party1", "pet", "player") | :;unit : The unit to query (e.g. "target", "party1", "pet", "player") | ||
:;distIndex : A value 1-4 | :;distIndex : A value 1-4 | ||
:1 = Inspect, 5 yards | :1 = Inspect, 5.55 yards | ||
:2 = Trade, | :2 = Trade, 11.11 yards | ||
:3 = Duel, | :3 = Duel, 10 yards | ||
:4 = Follow, | :4 = Follow, 30 yards | ||
---- | ---- | ||
Revision as of 16:20, 23 February 2006
Returns true if you are in range of the specified unit to perform the action specified by distIndex. Otherwise, returns false.
- Arguments
- (String unit, Int distIndex)
- unit
- The unit to query (e.g. "target", "party1", "pet", "player")
- distIndex
- A value 1-4
- 1 = Inspect, 5.55 yards
- 2 = Trade, 11.11 yards
- 3 = Duel, 10 yards
- 4 = Follow, 30 yards
- Returns
- Boolean canInteract
- canInteract
- True if in range to perform the action. Otherwise, false.
- 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.
- There may also be more values for distIndex that we don't know about.
- Example
if ( CheckInteractDistance("target", 4) ) then
FollowUnit("target");
else
-- we're too far away to follow the target
end;