Name | Type | is_array | initial_value |
Abilities | abilcode | Yes | |
Index_Variable_A | integer | No | |
Index_Variable_B | integer | No | |
Index_Variable_C | integer | No | |
Number_Of_Spawn_Area | integer | Yes | |
Number_Of_Spawn_Types | integer | No | |
Playable_map_region | rect | No | |
Rally_Point | location | No | |
Spawn_Picked_Unit | unit | Yes | |
Spawn_Points | location | Yes | |
Spawn_Unit_Ability_Type | integer | Yes | |
Spawn_Unit_Count | integer | Yes | |
Spawn_Unit_Group | group | No | |
Spawn_Unit_ID | integer | Yes | |
Spawn_Unit_Time_Interval | integer | Yes | |
Spawn_Unit_Type | unitcode | Yes | |
Unit_Variable_A | unit | No |
function Trig_Update_Variables_Func001Func003Func002C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped(udg_Abilities[udg_Index_Variable_A], udg_Unit_Variable_A) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Update_Variables_Func001Func003A takes nothing returns nothing
set udg_Unit_Variable_A = GetEnumUnit()
if ( Trig_Update_Variables_Func001Func003Func002C() ) then
set udg_Number_Of_Spawn_Area[udg_Index_Variable_A] = ( udg_Number_Of_Spawn_Area[udg_Index_Variable_A] + 1 )
call EnableTrigger( gg_trg_Check_for_ID )
call ConditionalTriggerExecute( gg_trg_Check_for_ID )
call DisableTrigger( gg_trg_Check_for_ID )
else
endif
endfunction
function Trig_Update_Variables_Actions takes nothing returns nothing
set udg_Index_Variable_A = 0
loop
exitwhen udg_Index_Variable_A > ( udg_Number_Of_Spawn_Types - 1 )
set udg_Number_Of_Spawn_Area[udg_Index_Variable_A] = 0
set udg_Spawn_Unit_Group = GetUnitsInRectAll(udg_Playable_map_region)
call ForGroupBJ( udg_Spawn_Unit_Group, function Trig_Update_Variables_Func001Func003A )
call DestroyGroup(udg_Spawn_Unit_Group)
set udg_Index_Variable_A = udg_Index_Variable_A + 1
endloop
endfunction
//===========================================================================
function InitTrig_Update_Variables takes nothing returns nothing
set gg_trg_Update_Variables = CreateTrigger( )
call DisableTrigger( gg_trg_Update_Variables )
call TriggerRegisterTimerEventPeriodic( gg_trg_Update_Variables, 1.00 )
call TriggerAddAction( gg_trg_Update_Variables, function Trig_Update_Variables_Actions )
endfunction
function Trig_Check_for_ID_Actions takes nothing returns nothing
set udg_Index_Variable_B = 0
loop
exitwhen udg_Index_Variable_B > 999
if (( udg_Unit_Variable_A == udg_Spawn_Picked_Unit[udg_Index_Variable_B] ) ) then
set udg_Spawn_Unit_Count[udg_Index_Variable_B] = ( udg_Spawn_Unit_Count[udg_Index_Variable_B] + 1 )
if (( IsUnitAliveBJ(udg_Spawn_Picked_Unit[udg_Index_Variable_B]) == true ) ) then
if (( GetPlayerState(GetOwningPlayer(udg_Spawn_Picked_Unit[udg_Index_Variable_B]), PLAYER_STATE_RESOURCE_FOOD_CAP) >= ( GetPlayerState(GetOwningPlayer(udg_Spawn_Picked_Unit[udg_Index_Variable_B]), PLAYER_STATE_RESOURCE_FOOD_USED) + GetFoodUsed(udg_Spawn_Unit_Type[udg_Spawn_Unit_Ability_Type[udg_Index_Variable_B]]) ) ) ) then
if (( udg_Spawn_Unit_Count[udg_Index_Variable_B] >= udg_Spawn_Unit_Time_Interval[udg_Spawn_Unit_Ability_Type[udg_Index_Variable_B]] ) ) then
call CreateNUnitsAtLoc( 1, udg_Spawn_Unit_Type[udg_Spawn_Unit_Ability_Type[udg_Index_Variable_B]], GetOwningPlayer(udg_Spawn_Picked_Unit[udg_Index_Variable_B]), udg_Spawn_Points[udg_Index_Variable_B], bj_UNIT_FACING )
if (( GetUnitAbilityLevelSwapped('ARal', udg_Spawn_Picked_Unit[udg_Index_Variable_B]) > 0 ) ) then
set udg_Rally_Point = GetUnitRallyPoint(udg_Spawn_Picked_Unit[udg_Index_Variable_B])
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attack", udg_Rally_Point )
call RemoveLocation(udg_Rally_Point)
else
endif
set udg_Spawn_Unit_Count[udg_Index_Variable_B] = 0
set udg_Index_Variable_B = 1000
else
endif
else
endif
else
set udg_Spawn_Unit_ID[udg_Index_Variable_B] = 0
call RemoveLocation(udg_Spawn_Points[udg_Index_Variable_B])
endif
else
if (( udg_Index_Variable_B == 999 ) ) then
call EnableTrigger( gg_trg_Set_Unit_ID )
call ConditionalTriggerExecute( gg_trg_Set_Unit_ID )
call DisableTrigger( gg_trg_Set_Unit_ID )
else
endif
endif
set udg_Index_Variable_B = udg_Index_Variable_B + 1
endloop
endfunction
//===========================================================================
function InitTrig_Check_for_ID takes nothing returns nothing
set gg_trg_Check_for_ID = CreateTrigger( )
call DisableTrigger( gg_trg_Check_for_ID )
call TriggerAddAction( gg_trg_Check_for_ID, function Trig_Check_for_ID_Actions )
endfunction
function Trig_Set_Unit_ID_Func001Func001Func001Func002Func001C takes nothing returns boolean
if ( not ( udg_Unit_Variable_A == udg_Spawn_Picked_Unit[udg_Index_Variable_C] ) ) then
return false
endif
if ( not ( udg_Spawn_Unit_ID[udg_Index_Variable_C] == ( 10000 + udg_Index_Variable_C ) ) ) then
return false
endif
return true
endfunction
function Trig_Set_Unit_ID_Actions takes nothing returns nothing
set udg_Index_Variable_C = 0
loop
exitwhen udg_Index_Variable_C > 999
if (( udg_Spawn_Unit_ID[udg_Index_Variable_C] == 0 )) then
set udg_Spawn_Unit_ID[udg_Index_Variable_C] = ( 10000 + udg_Index_Variable_C )
set udg_Spawn_Picked_Unit[udg_Index_Variable_C] = udg_Unit_Variable_A
set udg_Spawn_Points[udg_Index_Variable_C] = GetUnitLoc(udg_Unit_Variable_A)
set udg_Spawn_Unit_Ability_Type[udg_Index_Variable_C] = udg_Index_Variable_A
set udg_Spawn_Unit_Count[udg_Index_Variable_C] = 0
set udg_Index_Variable_C = 1000
else
if (( udg_Index_Variable_C == 999 ) ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_008" )
else
if (Trig_Set_Unit_ID_Func001Func001Func001Func002Func001C() ) then
set udg_Index_Variable_C = 1000
else
endif
endif
endif
set udg_Index_Variable_C = udg_Index_Variable_C + 1
endloop
endfunction
//===========================================================================
function InitTrig_Set_Unit_ID takes nothing returns nothing
set gg_trg_Set_Unit_ID = CreateTrigger( )
call DisableTrigger( gg_trg_Set_Unit_ID )
call TriggerAddAction( gg_trg_Set_Unit_ID, function Trig_Set_Unit_ID_Actions )
endfunction