GetSlotsFreeOnHero
not ratedReturns the amount of free item slots on a hero.
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
endfunctionNo comments.