Warcraft III resources & community, 2003–2006 · archived

GetSlotsFreeOnHero

not rated
Submitted by AIAndyFunctions0 downloads
Returns the amount of free item slots on a hero.

Source

function GetSlotsFreeOnHero takes unit u returns integer
  local integer i = 0
  local integer sum = 0
  loop
    exitwhen i > 5
    if UnitItemInSlot(u, i) == null then
      set sum = sum + 1
    endif
    set i = i + 1
  endloop
  return sum
endfunction

Comments

0

No comments.