library RandomHero initializer init
globals
// this is the array of raw-codes for the heroes you want
public integer array HERO_ID
endglobals
// returns the integer ID of the hero to be used to create the unit
public function ChooseHeroRandom takes nothing returns integer
local integer index = GetRandomInt(0, 3)
return HERO_ID[index]
endfunction
public function init takes nothing returns nothing
// setup hero ID array
set HERO_ID[0] = 'Hpal' // this should be the Paladin raw-code
set HERO_ID[1] = 'Oblm' // this should be the Blademaster raw-code
set HERO_ID[2] = 'Hmkg' // this should be the Mountain King raw-code
set HERO_ID[3] = 'Otch' // this should be the Tauren Chieftain raw-code
endfunction
endlibrary