UnitUseItemTarget

Parameters
whichUnit unit

Target unit.

whichItem item

Handle to item instance.

target widget

Target unit or widget.

comment

Issues an immediate order for the unit to use item pointed target (widget or unit).

This is the similar to left-clicking and using an item in inventory. Units that cannot use items will not do anything.

Returns:

  • true if item was successfully used / an order was issued
  • false otherwise, because an order was not issued: unit doesn't have item, item on cooldown, invalid unit/item/target etc.

Examples:

  • Dagger of Escape 'desc': does not cast. Explanation: when you click a dagger on a building in game, the target is not actually the building, but the map position you're pointing at, even though you see the building being highlighted on cursor hover.

  • Inferno Stone 'infs': does not cast, same as above.

note

See: UnitUseItem, UnitUseItemPoint.

patch

1.00

return type
boolean
Source code
native          UnitUseItemTarget       takes unit whichUnit, item whichItem, widget target returns boolean
Source
common.j
wc3modding.com
UnitUseItemTarget