//Endor Battle C //Sets: // 1: spawing through trees stormtroopers // 2: spawning at the start troopers State Base { Conditions { if Message "InitOnce_C" == 0 goto InitOnce if AlwaysTrue == 1 goto Update } Actions { //initial junk piles CnxController "from=junk1_1" "to=junk1_2" "on_flag=BLOCK" "obj=catjunk_03" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=junk2_1" "to=junk2_2" "on_flag=BLOCK" "obj=at_junk_03" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=mini_bridge_a" "to=mini_bridge_b" "off_flag=BLOCK" "obj=buildramp_06_01b" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" ObstacleTriggerSet "trigger=ziphook_pad" "trigger=drop_build" "obstacle=dropzip_02a" AddLocatorGroup "name=spawnstart" AddLocatorGroup "name=spawn" AddLocatorGroup "name=atstFight" AddLocatorGroup "name=ewok" AddLocatorGroup "name=caravan_end" } } //Base State InitOnce { Conditions { } Actions { SetMessage "name=InitOnce_C" "value=1" SetMessage "name=startTroops" "value=5" SetMessage "name=takeOverTroops" "value=10" SetState "Update" } } State Update { Conditions { if ForceFinished "caravan_lid" == 1 goto SpawnTrailerTrash if NumInSetAlive "2" < 2 and if Message "startTroops" > 0 and if Timer > 3 goto SpawnStart if NumInSetAlive "1" < 6 and if Message "takeOverTroops" > 0 and if Random < 0.4 and if EitherPlayerInTriggerArea "Spawn" == 1 goto SpawnTrooperTakeOver if NumInSetAlive "1" < 6 and if Message "takeOverTroops" > 0 and if EitherPlayerInTriggerArea "Spawn" == 1 goto SpawnTrooper } Actions { ResetTimer } } State SpawnTrooper { Conditions { } Actions { //CreateCreatures "locator_group=spawn" "mingroupsize=2" "maxgroupsize=4" "type=scouttrooper" "type=stormtrooper" "script=Takeover" "addtoset=1" CreateCreatures "locator_group=spawn" "mingroupsize=2" "maxgroupsize=4" "type=scouttrooper" "type=stormtrooper" "script=spawnAttack" "addtoset=1" SetMessage "name=takeOverTroops" "decrement=1" SetState "Update" } } State SpawnTrooperTakeOver { Conditions { } Actions { CreateCreatures "locator_group=spawn" "mingroupsize=1" "maxgroupsize=3" "type=scouttrooper" "type=stormtrooper" "script=Takeover" "addtoset=1" //CreateCreatures "locator_group=spawn" "mingroupsize=2" "maxgroupsize=4" "type=scouttrooper" "script=spawnAttack" "addtoset=1" SetMessage "name=takeOverTroops" "decrement=1" SetState "Update" } } State SpawnStart { Conditions { } Actions { CreateCreatures "locator_group=spawnStart" "mingroupsize=3" "maxgroupsize=5" "type=scouttrooper" "type=stormtrooper" "script=spawnAttack" "addtoset=2" SetMessage "name=startTroops" "decrement=1" SetState "Update" } } State SpawnTrailerTrash { Conditions { if Random < 0.8 goto SpawnTrailerTrash_Ewok if AlwaysTrue == 1 goto SpawnTrailerTrash_Random } Actions { } } State SpawnTrailerTrash_Ewok { Conditions { if ForceFinished "caravan_lid" == 0 goto Update } Actions { CreateCreatures "locator=caravanspawn" "type=ewok" "script=trailertrash" } } State SpawnTrailerTrash_Random { Conditions { if ForceFinished "caravan_lid" == 0 goto Update } Actions { CreateCreatures "locator=caravanspawn" "type=womprat" "type=Skeleton" "type=RebelScum" "type=Jawa" "type=GamorreanGuard" "script=trailertrash" } }