//=========================================
function FlushBlotData takes integer index returns nothing
set SYS_Blot[index] = null
set SYS_BlotCode[index] = 0
set SYS_BlotData_I00[index] = 0
set SYS_BlotData_I01[index] = 0
set SYS_BlotData_I02[index] = 0
set SYS_BlotData_I03[index] = 0
set SYS_BlotData_I04[index] = 0
endfunction
function ReleaseBlot takes unit b returns nothing
local integer bIndex = GetUnitUserData(b)
set SYS_BlotStack[SYS_BlotTop] = bIndex
set SYS_BlotTop = SYS_BlotTop + 1
call FlushBlotData(bIndex)
endfunction
function InitBlot takes unit u,real tInv returns integer
local integer bIndex
if(SYS_BlotStack[SYS_BlotTop]==null)then
set SYS_BlotStack[SYS_BlotTop] = SYS_BlotTop
set bIndex = SYS_BlotTop
else
set bIndex = SYS_BlotStack[SYS_BlotTop]
endif
set SYS_BlotTop = SYS_BlotTop - 1
call FlushBlotData(bIndex)
set SYS_Blot[bIndex] = u
return bIndex
endfunction[/jass]