Name | Type | is_array | initial_value |
GnorfCourier | unit | Yes | |
GnorfCourierAIOffset | integer | No | |
GnorfCourierCount | integer | No | |
GnorfCourierStops | location | Yes | |
GnorfFliers | itemcode | Yes | |
GnorfHeroIndex | integer | No | |
GnorfHeros | unitcode | Yes | |
GnorfOffScreenPosition | location | Yes | |
GnorfRootPosition | location | Yes |
function Trig_GnorfAfterEndOfDay_Func001Func001C takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_GnorfCourier[( GetForLoopIndexA() - 1 )]) == true ) ) then
return false
endif
return true
endfunction
function Trig_GnorfAfterEndOfDay_Actions takes nothing returns nothing
local location unitLoc
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_GnorfCourierCount
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_GnorfAfterEndOfDay_Func001Func001C() ) then
call SetUnitAnimation( udg_GnorfCourier[( GetForLoopIndexA() - 1 )], "spell" )
call QueueUnitAnimation( udg_GnorfCourier[( GetForLoopIndexA() - 1 )], "stand" )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call PolledWait(1.00)
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_GnorfCourierCount
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_GnorfAfterEndOfDay_Func001Func001C() ) then
set unitLoc = GetUnitLoc(udg_GnorfCourier[( GetForLoopIndexA() - 1 )])
call CreateItemLoc( udg_GnorfFliers[udg_GnorfHeroIndex], unitLoc )
call RemoveLocation( unitLoc )
call IssuePointOrderLoc( udg_GnorfCourier[( GetForLoopIndexA() - 1 )], "move", udg_GnorfRootPosition[GetRandomInt(0,3)] )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_GnorfAfterEndOfDay takes nothing returns nothing
set gg_trg_GnorfAfterEndOfDay = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( gg_trg_GnorfAfterEndOfDay, EQUAL, 20.00 )
call TriggerAddAction( gg_trg_GnorfAfterEndOfDay, function Trig_GnorfAfterEndOfDay_Actions )
endfunction