unction selected takes nothing returns integer
local integer p = 0
loop
exitwhen p > 17
if IsUnitSelected( gg_unit_Hpal_0000, Player(p))
return p
endif
set p = p + 1
endloop
return 18
endfunction
function unitSelectedActions takes nothing returns nothing
local integer p = call selected()
call SelectUnitForPlayerSingle( gg_unit_Hamg_0001, Player(p) )
endfunction
//===========================================================================
function InitTrig_Untitled_Trigger_001_Copy takes nothing returns nothing
set gg_trg_Untitled_Trigger_001_Copy = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_Untitled_Trigger_001_Copy, gg_unit_Hpal_0000, EVENT_UNIT_SELECTED )
call TriggerAddAction( gg_trg_Untitled_Trigger_001_Copy, function unitSelectedActions )
endfunction