//CloudCityEscape_C state Base { Conditions { if MissionMode == 1 goto Start } Actions { } } state Start { Conditions { } Actions { SetMessage "name=NumMissionBaddies" "value=8" AddLocatorGroup "name=MissionOutSpawn" AddLocatorGroup "name=MissionSpawn" PlayObstacle "name=bits_fall" LockDoor "r2_pan3" CloseDoor "r2_pan3" PlayObstacle "name=R2_gap" //Create target CreateCreatures "locator=MissionTarget" "type=LandoCalrissian" "script=MissionTarget" SetState "Update" } } state Update { Conditions { //Outside if Timer > 0 and if Message "NumMissionBaddies" > 0 and if EitherPlayerInTriggerArea "Start" == 1 and if NumInSetAlive "2" < 6 goto SpawnTrooperOutside //Inside if EitherPlayerInTriggerArea "Start" == 0 and if NumInSetAlive "1" < 4 goto SpawnCitizenInside if Timer > 0 and if Message "NumMissionBaddies" > 0 and if EitherPlayerInTriggerArea "Start" == 0 and if NumInSetAlive "2" < 6 goto SpawnTrooperInside if Message "NumMissionBaddies" < 1 and if NumInSetAlive "2" == 0 goto ResetTrooperSpawn } Actions { } } state SpawnCitizenInside { Conditions { } Actions { CreateCreatures "mingroupsize 1" "maxgroupsize 3" "locator_group=MissionSpawn" "max_range_to_player=6" "type=cloudcitycitizen" "script=MissionNeutral" "addtoset=1" "off_screen" SetState "Update" } } state SpawnTrooperInside { Conditions { } Actions { CreateCreatures "locator_group=MissionSpawn" "max_range_to_player=6" "type=stormtrooper" "script=MissionBaddie" "addtoset=2" "off_screen" SetMessage "name=NumMissionBaddies" "decrement=1" SetState "Update" } } state SpawnTrooperOutside { Conditions { } Actions { CreateCreatures "locator_group=LandingSpawn" "max_range_to_player=6" "type=stormtrooper" "script=MissionBaddie" "addtoset=2" "yoffset=2" "dont_set_on_surface" "zipdown" SetMessage "name=NumMissionBaddies" "decrement=1" Idle "mintime=0.5" "maxtime=1" SetState "Update" } } state ResetTrooperSpawn { Conditions { } Actions { SetMessage "name=NumMissionBaddies" "value=8" ResetTimer "mintime=-17" "maxtime=-12" SetState "Update" } }