Warcraft III resources & community, 2003–2006 · archived

UnitGiveAllItemsToUnit

not rated
Submitted by StarcraftfreakFunctions0 downloads
Transfers all items from one unit to another without taking care of the distance between the units

Source

function UnitGiveAllItemsToUnit takes unit fromUnit, unit toUnit returns integer
    local integer given = 0
    local integer itemSlot = 0
    loop
        exitwhen itemSlot > 6
        if (UnitAddItem(toUnit,UnitRemoveItemFromSlot(fromUnit, itemSlot)) == true) then
            set given = given + 1
        endif
        set itemSlot = itemSlot + 1
    endloop
    return given
endfunction

Comments

0

No comments.