Warcraft III resources & community, 2003–2006 · archived

UnitRemoveItemsById

not rated
Submitted by StarcraftfreakFunctions0 downloads
Drops all items of the specified type to the position, where the unit resides.
Returns the number of dropped items.

Source

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
endfunction

Comments

0

No comments.