//HothEscape_c state Base { Conditions { if MissionMode == 1 goto MissionMode if Message "InitOnce_D" == 0 goto InitOnce if Message "InitOnce_D" == 1 goto Update } Actions { ObstacleTriggerSet "trigger=door_pad_1" "trigger=door_pad_2" "trigger=door_pad_3" "trigger=door_pad_4" "obstacle=pad_door" CnxController "from=door1_a" "to=door1_b" "off_flag=BLOCK" "obj=door_2" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door2_a" "to=door2_b" "off_flag=BLOCK" "obj=door_4" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door3_a" "to=door3_b" "off_flag=BLOCK" "obj=door_3" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door4_a" "to=door4_b" "off_flag=BLOCK" "obj=door_12" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door5_a" "to=door5_b" "off_flag=BLOCK" "obj=door_11" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=door13_a" "to=door13_b" "off_flag=BLOCK" "obj=door_13" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" CnxController "from=blockage_a" "to=blockage_b" "on_flag=BLOCK" "obj=med_big_blow1" "checkvisible" "on_frames=1TOlastframe" "bothways" CnxController "from=tauntaun_a" "to=tauntaun_b" "off_flag=BLOCK" "obj=shutter_4" "checkvisible" "on_frames=lastframeTOlastframe" "bothways" AddLocatorGroup "name=final" } } state InitOnce { Conditions { } Actions { SetMessage "name=InitOnce" "value=1" SetMessage "name=FinalBattle" "value=0" SetMessage "name=FinalBattleWave" "value=4" SetMessage "name=L_CannonKilled" "value=0" SetMessage "name=R_CannonKilled" "value=0" SetState Update } } state Update { Conditions { ;Dont set off the trooper cannons until they have been killed at least once if BuildItComplete "trooper_cannon1" == 0 and if Message "L_CannonKilled" == 0 goto L_Killed if BuildItComplete "trooper_cannon2" == 0 and if Message "R_CannonKilled" == 0 goto R_Killed ;Dont understand why the char are the wrong way round, but hay! ;Anyway, dont set off wave until its been build and someone hasa taken it over if BuildItComplete "trooper_cannon1" == 1 and if TakenOver "TrooperCannon_2" == 1 and if EitherPlayerInTriggerArea "Final" == 1 and if Message "L_CannonKilled" == 1 and if Message "FinalBattleWave" > 0 and if TakenOver "TrooperCannon_2" == 1 and if Message "FinalBattle" == 0 goto SpawnFinalInit if BuildItComplete "trooper_cannon2" == 1 and if TakenOver "TrooperCannon_1" == 1 and if EitherPlayerInTriggerArea "Final" == 1 and if Message "R_CannonKilled" == 1 and if Message "FinalBattleWave" > 0 and if TakenOver "TrooperCannon_1" == 1 and if Message "FinalBattle" == 0 goto SpawnFinalInit if EitherPlayerInTriggerArea "Final_Spawn" == 1 and if Message "FinalBattleWave" > 0 and if Message "FinalBattle" == 0 goto SpawnFinalInit if Message "FinalBattle" > 0 and if EitherPlayerInTriggerArea "Final" == 1 and if NumInSetAlive "5" < 3 goto SpawnFinal } Actions { } } state L_Killed { Conditions { } Actions { SetMessage "name=L_CannonKilled" "value=1" SetState "Update" } } state R_Killed { Conditions { } Actions { SetMessage "name=R_CannonKilled" "value=1" SetState "Update" } } //Hold before the fight begins state SpawnFinalInit { Conditions { } Actions { Idle "10" SetMessage "name=FinalBattle" "value=10" SetMessage "name=FinalBattleWave" "decrement=1" SetState SpawnFinal } } state SpawnFinal { Conditions { } Actions { CreateCreatures "locator_group=final" "type=SnowTrooper" "script=SpawnAttack" "addtoset=5" "yoffset=2" "dont_set_on_surface" "zipdown" SetMessage "name=FinalBattle" "decrement=1" SetState "Update" } } state MissionMode { Conditions { } Actions { } }