Name | Type | is_array | initial_value |
GGroup | group | Yes | |
GInteger | integer | No | 1 |
GLeader | unit | Yes | |
GNumber | integer | No | |
GPlayerGroup | force | No | |
GPoint | location | Yes | |
GRandomReg | integer | No | |
GSelected | boolean | Yes |
function Trig_respawning_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_respawning_Actions takes nothing returns nothing
local unit dying = GetDyingUnit()
local real facing = GetUnitFacing(dying)
local location loc = GetUnitLoc(dying)
call TriggerSleepAction( 5.00 )
call CreateNUnitsAtLoc( 1, GetUnitTypeId(dying), Player(PLAYER_NEUTRAL_AGGRESSIVE), loc, facing )
set dying = null
set loc = null
endfunction
//===========================================================================
function InitTrig_respawning takes nothing returns nothing
set gg_trg_respawning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_respawning, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_respawning, Condition( function Trig_respawning_Conditions ) )
call TriggerAddAction( gg_trg_respawning, function Trig_respawning_Actions )
endfunction