beginscript; SetGlobalVar(2,0); SetGlobalVar(7,0); SetVar(0,0); WaitForTime(20); label Trig: if (OtherUnitDead(MainTrain) && OtherUnitDead(EndTrain) && GetGlobalVar(2) == 0) { SetGlobalVar(2,1); } if ((OtherUnitDead(MainTrain) || OtherUnitDead(EndTrain)) && GetGlobalVar(7) == 0) { SetGlobalVar(7,1); TriggerMessage(12,0xffff,0xffff); } // Carrage check SetVar(0,0); if (OtherUnitIsAttached (Fir_G1_1) !=1 && GetVar(1) != 1) { TriggerUnit(Fir_G1_1); AddRadarEdgeObj(Fir_G1_1, 166, 0, 55); SetVar(1,1); } if (OtherUnitIsAttached (Fir_G1_2) !=1 && GetVar(2) != 1) { TriggerUnit(Fir_G1_2); AddRadarEdgeObj(Fir_G1_2, 166, 0, 55); SetVar(2,1); } if (OtherUnitIsAttached (Fir_G1_3) !=1 && GetVar(3) != 1) { TriggerUnit(Fir_G1_3); AddRadarEdgeObj(Fir_G1_3, 166, 0, 55); SetVar(3,1); } if (OtherUnitIsAttached (Fir_G1_1) !=1 ) { IncVar(5); } if (OtherUnitIsAttached (Fir_G1_2) !=1 ) { IncVar(5); } if (OtherUnitIsAttached (Fir_G1_3) !=1 ) { IncVar(5); } if (OtherUnitDead (Fir_G1_1)) { IncVar(6); } if (OtherUnitDead (Fir_G1_2)) { IncVar(6); } if (OtherUnitDead (Fir_G1_3)) { IncVar(6); } if (GetVar(5) == 3 && GetVar(4) != 1 && GetVar(6) == 0) { if (OtherUnitDead(MainTrain) != 1 || OtherUnitDead(EndTrain) != 1 || OtherUnitDead(Car1) != 1 || OtherUnitDead(Car2) != 1 || OtherUnitDead(Car3) != 1 || OtherUnitDead(Car4) != 1 || OtherUnitDead(Car5) != 1 || OtherUnitDead(Miss2) != 1 || OtherUnitDead(Miss1) != 1) TriggerMessage(5,0xffff,0xffff); SetVar(4,1); } else if (GetVar(5) == 2 && GetVar(4) != 1 && GetVar(6) == 1) { if (OtherUnitDead(MainTrain) != 1 || OtherUnitDead(EndTrain) != 1 || OtherUnitDead(Car1) != 1 || OtherUnitDead(Car2) != 1 || OtherUnitDead(Car3) != 1 || OtherUnitDead(Car4) != 1 || OtherUnitDead(Car5) != 1 || OtherUnitDead(Miss2) != 1 || OtherUnitDead(Miss1) != 1) TriggerMessage(5,0xffff,0xffff); SetVar(4,1); } else if (GetVar(5) == 1 && GetVar(4) != 1 && GetVar(6) == 2) { if (OtherUnitDead(MainTrain) != 1 || OtherUnitDead(EndTrain) != 1 || OtherUnitDead(Car1) != 1 || OtherUnitDead(Car2) != 1 || OtherUnitDead(Car3) != 1 || OtherUnitDead(Car4) != 1 || OtherUnitDead(Car5) != 1 || OtherUnitDead(Miss2) != 1 || OtherUnitDead(Miss1) != 1) TriggerMessage(5,0xffff,0xffff); SetVar(4,1); } else if (GetVar(6) >= 3) { WaitForTime(2); PausePlayer(); KillOtherUnit(MainTrain); KillOtherUnit(EndTrain); ChangeCamera(0x806,50,50); TriggerMessage(10,0xffff,0xffff); SetButtonJump(); if (HasJumped()) { goto skipcs1; } WaitForTime(40); JumpOnButton(false); label skipcs1: EndLevel(0); } else if (GetVar(6) >= 1 && GetVar(7) != 1) { SetVar(7,1); TriggerMessage(9,0xffff,0xffff); } SetVar(5,0); SetVar(6,0); // End Carrage check if (OtherUnitInRange(MainTrain,50)) { WaitForTime(100); ChangeCamera(0x805,20,20); TriggerMessage(6,0xffff,0xffff); SetButtonJump(); if (HasJumped()) { goto skipcs2; } WaitForTime(60); JumpOnButton(false); label skipcs2: EndLevel(0); } if (OtherUnitDead(MainTrain) && OtherUnitDead(EndTrain) && OtherUnitDead(Car1) && OtherUnitDead(Car2) && OtherUnitDead(Car3) && OtherUnitDead(Car4) && OtherUnitDead(Car5) && OtherUnitDead(Miss2) && OtherUnitDead(Miss1) && GetVar(4) == 1) { WaitForTime(30); PausePlayer(); if (OtherUnitDead(Fir_G1_1) != 1) { ChangeCamera(0x808,20,20); } else if (OtherUnitDead(Fir_G1_2) != 1) { ChangeCamera(0x809,20,20); } else if (OtherUnitDead(Fir_G1_3) != 1) { ChangeCamera(0x80a,20,20); } TriggerMessage(11,0xffff,0xffff); SetButtonJump(); if (HasJumped()) { goto skipcs3; } WaitForTime(50); JumpOnButton(false); label skipcs3: EndLevel(1); } EndFrame(); goto Trig; label End: EndFrame(); goto End; endscript; $