//SpeederChaseA //Manages spawning of troopers in the lock in sections. state Base { Conditions { if PlayerInTriggerArea "End_Bit" == 0 and if Message "Phase" == 2 goto StartSpawning } Actions { } } state StartSpawning { Conditions { if Message "Stage" == 0 goto Stage1_StartSpawning if Message "Stage" == 1 goto Stage1_StartSpawning if Message "Stage" == 2 goto Stage2_StartSpawning if Message "Stage" == 3 goto Stage3_StartSpawning if Message "Stage" == 4 goto Stage4_StartSpawning } Actions { } } //==Stage 1== state Stage1_StartSpawning { Conditions { } Actions { SetMessage "name=NumTroopers" "value=10" SetState "Stage1_Update" } } state Stage1_Update { Conditions { if Message "Phase" != 2 goto Base if Timer > 0 and if NumInSetAlive "4" < 5 and if Message "NumTroopers" > 0 goto Stage1_Spawn if NumInSetAlive "4" == 0 and if Message "NumTroopers" == 0 goto Stage1_WaitBeforeNextWave } Actions { } } state Stage1_Spawn { Conditions { } Actions { CreateCreatures "locator_group=LockIn1Spawn" "type=Stormtrooper" "script=melee_trooper" "yoffset=4" "dont_set_on_surface" "zipdown" "fall_chance=0.2" "AddToSet=4" SetMessage "name=NumTroopers" "decrement=1" ResetTimer "mintime=-1" "maxtime=-0.5" SetState "Stage1_Update" } } state Stage1_WaitBeforeNextWave { Conditions { } Actions { Idle "mintime=10" "maxtime=20" SetMessage "name=NumTroopers" "value=5" SetState "Stage1_Update" } } //==Stage 2== state Stage2_StartSpawning { Conditions { } Actions { SetMessage "name=NumTroopers" "value=10" SetState "Stage2_Update" } } state Stage2_Update { Conditions { if Message "Phase" != 2 goto Base if Timer > 0 and if NumInSetAlive "4" < 5 and if Message "NumTroopers" > 0 goto Stage2_Spawn if NumInSetAlive "4" == 0 and if Message "NumTroopers" == 0 goto Stage2_WaitBeforeNextWave } Actions { } } state Stage2_Spawn { Conditions { } Actions { CreateCreatures "locator_group=LockIn2Spawn" "type=Stormtrooper" "script=melee_trooper" "yoffset=4" "dont_set_on_surface" "zipdown" "fall_chance=0.2" "AddToSet=4" SetMessage "name=NumTroopers" "decrement=1" ResetTimer "mintime=-1" "maxtime=-0.5" SetState "Stage2_Update" } } state Stage2_WaitBeforeNextWave { Conditions { } Actions { Idle "mintime=10" "maxtime=20" SetMessage "name=NumTroopers" "value=5" SetState "Stage2_Update" } } //==Stage 3== state Stage3_StartSpawning { Conditions { } Actions { SetMessage "name=NumTroopers" "value=10" SetState "Stage3_Update" } } state Stage3_Update { Conditions { if Message "Phase" != 2 goto Base if Timer > 0 and if NumInSetAlive "4" < 5 and if Message "NumTroopers" > 0 goto Stage3_Spawn if NumInSetAlive "4" == 0 and if Message "NumTroopers" == 0 goto Stage3_WaitBeforeNextWave } Actions { } } state Stage3_Spawn { Conditions { } Actions { CreateCreatures "locator_group=LockIn3Spawn" "type=Stormtrooper" "script=melee_trooper" "yoffset=4" "dont_set_on_surface" "zipdown" "fall_chance=0.2" "AddToSet=4" SetMessage "name=NumTroopers" "decrement=1" ResetTimer "mintime=-1" "maxtime=-0.5" SetState "Stage3_Update" } } state Stage3_WaitBeforeNextWave { Conditions { } Actions { Idle "mintime=10" "maxtime=20" SetMessage "name=NumTroopers" "value=5" SetState "Stage3_Update" } } //==Stage 4== state Stage4_StartSpawning { Conditions { } Actions { SetMessage "name=NumTroopers" "value=10" SetState "Stage4_Update" } } state Stage4_Update { Conditions { if PlayerInTriggerArea "End_Bit" == 1 goto Base if Message "Phase" != 2 goto Base if Timer > 0 and if NumInSetAlive "4" < 5 and if Message "NumTroopers" > 0 goto Stage4_Spawn if NumInSetAlive "4" == 0 and if Message "NumTroopers" == 0 goto Stage4_WaitBeforeNextWave } Actions { } } state Stage4_Spawn { Conditions { } Actions { CreateCreatures "locator_group=LockIn4Spawn" "type=Stormtrooper" "script=melee_trooper" "yoffset=4" "dont_set_on_surface" "zipdown" "fall_chance=0.2" "AddToSet=4" SetMessage "name=NumTroopers" "decrement=1" ResetTimer "mintime=-1" "maxtime=-0.5" SetState "Stage4_Update" } } state Stage4_WaitBeforeNextWave { Conditions { } Actions { Idle "mintime=10" "maxtime=20" SetMessage "name=NumTroopers" "value=5" SetState "Stage4_Update" } }