function Id2String takes integer i returns string
local string s=""
local integer start=0
local integer stop=3
local integer m
loop
set m=ModuloInteger(i, 256)
set s=SubString(udg_maxAlphabet, m-32, m-31)+s
set start=start+1
exitwhen start>stop
set i=(i-m)/256
endloop
return s
endfunction
function countID_LoopD takes nothing returns nothing
set udg_iD=0
loop
exitwhen udg_iD>94
if ( GetUnitAbilityLevel( udg_currentlySelected, udg_i) < 1 ) then
else
set udg_abilitiesFound = udg_abilitiesFound + 1
set udg_abilitiesFoundInfo[udg_abilitiesFound] = GetObjectName(udg_i) + " (" + I2S(udg_i) + ") " + Id2String(udg_i)
endif
set udg_i=udg_i+1
set udg_iD=udg_iD+1
endloop
endfunction
function countID_LoopC takes nothing returns nothing
set udg_iC=0
loop
exitwhen udg_iC>94
call TriggerEvaluate(udg_trigC)
set udg_i=udg_i+161
set udg_iC=udg_iC+1
endloop
endfunction
function countID_LoopB takes nothing returns nothing
set udg_iB=0
loop
exitwhen udg_iB>94
//===========================================================================
call TriggerEvaluate(udg_trigB)
//===========================================================================
set udg_i=udg_i+41216
set udg_iB=udg_iB+1
endloop
endfunction
function countID_LoopA takes nothing returns nothing
set udg_iA=0
set udg_abilitiesFound = 0
set udg_i=538976288
loop
exitwhen udg_iA>94
//===========================================================================
call TriggerEvaluate(udg_trigA)
//===========================================================================
set udg_i=udg_i+10551296
set udg_iA=udg_iA+1
endloop
endfunction
function InitTrig_countID takes nothing returns nothing
set gg_trg_countID = CreateTrigger( )
set udg_trigA = CreateTrigger( )
set udg_trigB = CreateTrigger( )
set udg_trigC = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_countID, Player(0), "countID", true )
call TriggerAddCondition( gg_trg_countID, Condition(function countID_LoopA) )
call TriggerAddCondition( udg_trigA, Condition(function countID_LoopB) )
call TriggerAddCondition( udg_trigB, Condition(function countID_LoopC) )
call TriggerAddCondition( udg_trigC, Condition(function countID_LoopD) )
endfunction