Returns whether the player is in range to use an item on a unit


See also Item functions.

Signature:

inRange = IsItemInRange(itemID, "unit") or IsItemInRange("itemName", "unit") or IsItemInRange("itemLink", "unit")

Arguments:

  • itemID - An item's ID (number)
  • itemName - An item's name (string)
  • itemLink - An item's hyperlink, or any string containing the itemString portion of an item link (string)
  • unit - A unit on which to use the item (string, unitID)

Returns:

  • inRange - 1 if the player is near enough to use the item on the unit; 0 if not in range; nil if the unit is not a valid target for the item (1nil)