//CloudCityEscape_A state Base { Conditions { if MissionMode == 1 goto Start } Actions { } } state Start { Conditions { } Actions { SetMessage "name=NumMissionBaddies" "value=8" AddLocatorGroup "name=MissionSpawn" AddLocatorGroup "name=Citizen" "addtogroup=MissionSpawn" LockDoor "door_pad" CloseDoor "door_pad" //Create target CreateCreatures "locator=MissionTarget" "type=C3PO" "script=MissionTarget" SetState "Update" } } state Update { Conditions { if NumInSetAlive "1" < 4 goto SpawnCitizen if Timer > 0 and if Message "NumMissionBaddies" > 0 and if NumInSetAlive "2" < 6 goto SpawnTrooper if Message "NumMissionBaddies" < 1 and if NumInSetAlive "2" == 0 goto ResetTrooperSpawn } Actions { } } state SpawnCitizen { 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 SpawnTrooper { 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 ResetTrooperSpawn { Conditions { } Actions { SetMessage "name=NumMissionBaddies" "value=8" ResetTimer "mintime=-17" "maxtime=-12" SetState "Update" } }