globals
unit UNITP=null
endglobals
scope TrigCreate_unit initializer IntCreate_unit
function Create_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'hfoo', Player(2), GetRectCenter(gg_rct_unit_create), bj_UNIT_FACING )
set UNITP = GetLastCreatedUnit()
endfunction
function IntCreate_unit takes nothing returns nothing
set Create = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( Create, 5.00 )
call TriggerAddAction( Create, function Create_Actions )
endfunction
endscope
scope TrigKillP1 initializer IntKill_unit1
function Kill_unit1_Conditions takes nothing returns boolean
if ( not ( UNITP == GetDyingUnit() ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetKillingUnitBJ()) == Player(0) ) ) then
return false
endif
return true
endfunction
function Kill_unit1_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "nod..." )
endfunction
//===========================================================================
function IntKill_unit1 takes nothing returns nothing
set Kill_unit1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( Kill_unit1, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( Kill_unit1, Condition( function Kill_unit1_Conditions ) )
call TriggerAddAction( Kill_unit1, function Kill_unit1_Actions )
endfunction
endscope