//CloudCityTrap_A state Base { Conditions { if EitherPlayerInTriggerArea "ZipSpawn" == 1 goto StartSpawning } Actions { } } state StartSpawning { Conditions { } Actions { SetMessage "name=NumATroopers" "value=10" SetState "Update" } } state Update { Conditions { if ForceComplete "blowup_exit" == 1 goto Finished if Timer > 0 and if NumInSetAlive "2" < 3 and if EitherPlayerInTriggerArea "ZipSpawn" == 1 and if Message "NumATroopers" > 0 goto SpawnTrooper if NumInSetAlive "2" == 0 and if Message "NumATroopers" == 0 goto WaitBeforeNextWave } Actions { } } state WaitBeforeNextWave { Conditions { if ForceComplete "blowup_exit" == 1 goto Finished } Actions { Idle "20" SetState "StartSpawning" } } state SpawnTrooper { Conditions { } Actions { CreateCreatures "locator_group=zipspawn" "type=Stormtrooper" "script=SpawnAttack" "yoffset=4" "dont_set_on_surface" "zipdown" "fall_chance=0.2" "AddToSet=2" SetMessage "name=NumATroopers" "decrement=1" ResetTimer "mintime=-1" "maxtime=-0.5" SetState "Update" } } state Finished { Conditions { } Actions { } }