UnitRemoveItemsById
not ratedDrops all items of the specified type to the position, where the unit resides.
Returns the number of dropped items.
Returns the number of dropped items.
function UnitRemoveItemsById takes unit whichUnit, integer itemId returns integer
local integer removed = 0
local integer itemSlot
loop
set itemSlot = GetInventoryIndexOfItemType(whichUnit,itemId)
exitwhen itemSlot == -1
call UnitRemoveItemFromSlot(whichUnit, itemSlot)
set removed = removed + 1
endloop
return removed
endfunctionNo comments.