public MyAlienGateMission()
        {
            ID = MyMissionID.ALIEN_GATE;
            DebugName = new StringBuilder("22-Alien artifact");
            Name = MyTextsWrapperEnum.ALIEN_GATE;
            Description = MyTextsWrapperEnum.ALIEN_GATE_Description;
            Flags = MyMissionFlags.Story;
            AchievementName = MySteamAchievementNames.Mission31_AlienGate;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(-1202900, 0, -112652); // Story sector of the script - i.e. (-2465,0,6541)

            Location = new MyMissionLocation(baseSector, (uint)EntityID.FollowCoordinatesDummy); // Starting dummy point - must by typecasted to uint and referenced from EntityID enum

            RequiredMissions = new MyMissionID[] { MyMissionID.EAC_TRANSMITTER }; // IDs of missions required to make this mission available
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.ALIEN_GATE_23 };
            RequiredActors = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN, MyActorEnum.TARJA, MyActorEnum.VALENTIN };

            #region Objectives
            m_objectives = new List<MyObjective>();


            var keepFormation = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_RIGHT_WING_Name),
                MyMissionID.ALIEN_GATE_RIGHT_WING,
                (MyTextsWrapperEnum.ALIEN_GATE_RIGHT_WING_Description),
                null,
                this,
                new MyMissionID[] { },
                new MyMissionLocation(baseSector, (uint)EntityID.MadelynSRightWingPosition)) { HudName = MyTextsWrapperEnum.HudLeftWing };
            m_objectives.Add(keepFormation);


            m_followCords = new MyDestroyWavesObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_FOLLOW_COORDINATES_Name),
                MyMissionID.ALIEN_GATE_FOLLOW_COORDINATES,
                (MyTextsWrapperEnum.ALIEN_GATE_FOLLOW_COORDINATES_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_RIGHT_WING, },
                new List<uint>() { },
                new MyMissionLocation(baseSector, (uint)EntityID.FollowCoordinatesDummy),
                radiusOverride: 150) { StartDialogId = MyDialogueEnum.ALIEN_GATE_0100, SuccessDialogId = MyDialogueEnum.ALIEN_GATE_0300 };
            m_followCords.AddWave(new List<uint>() { (uint)EntityID.FollowCoordinatesSpawnPoint });
            m_followCords.OnMissionLoaded += M01FollowCordsOnOnMissionLoaded;
            m_followCords.OnMissionSuccess += M01FollowCordsOnOnMissionSuccess;
            m_followCords.Components.Add(new MyMovingEntity("Madelyn", (uint)EntityID.FollowCoordinatesDummy, FollowCoordinatesMadelynTime));
            m_objectives.Add(m_followCords);


            var continueSearching = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_CONTINUE_SEARCHING_Name),
                MyMissionID.ALIEN_GATE_CONTINUE_SEARCHING,
                (MyTextsWrapperEnum.ALIEN_GATE_CONTINUE_SEARCHING_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_FOLLOW_COORDINATES },
                new MyMissionLocation(baseSector, (uint)EntityID.ContinueSearchingDummy)
                ) { SaveOnSuccess = false, SuccessDialogId = MyDialogueEnum.ALIEN_GATE_0400, HudName = MyTextsWrapperEnum.HudSearch };
            continueSearching.Components.Add(new MyMovingEntity("Madelyn", (uint)EntityID.ContinueSearchingDummy, ContinueSearchingMadelynTime));
            m_objectives.Add(continueSearching);


            var followDirection = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_FOLLOW_DIRECTION_Name),
                MyMissionID.ALIEN_GATE_FOLLOW_DIRECTION,
                (MyTextsWrapperEnum.ALIEN_GATE_FOLLOW_DIRECTION_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_CONTINUE_SEARCHING },
                new MyMissionLocation(baseSector, (uint)EntityID.FollowDirectionDummy)) { HudName = MyTextsWrapperEnum.HudFollow };
            followDirection.OnMissionLoaded += M03FollowDirectionOnOnMissionLoaded;
            followDirection.OnMissionCleanUp += M03FollowDirectionOnOnMissionCleanUp;
            m_objectives.Add(followDirection);


            m_coughtInTrap = new MyObjectiveDialog
                (MyTextsWrapperEnum.ALIEN_GATE_COUGHT_IN_TRAP_Name,
                 MyMissionID.ALIEN_GATE_COUGHT_IN_TRAP,
                 MyTextsWrapperEnum.ALIEN_GATE_COUGHT_IN_TRAP_Description,
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_FOLLOW_DIRECTION },
                 MyDialogueEnum.ALIEN_GATE_0500
                 ) { Location = new MyMissionLocation(baseSector, (uint)EntityID.CoughtInTrapDummy), SaveOnSuccess = true };
            m_coughtInTrap.OnMissionLoaded += M04CoughtInTrapOnOnMissionLoaded;
            m_coughtInTrap.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip1, (uint)EntityID.CoughtInTrapShip1Target, CoughtInTrapMoveTime));
            m_coughtInTrap.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip2, (uint)EntityID.CoughtInTrapShip2Target, CoughtInTrapMoveTime));
            m_coughtInTrap.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip3, (uint)EntityID.CoughtInTrapShip3Target, CoughtInTrapMoveTime));
            m_objectives.Add(m_coughtInTrap);
            



            m_runForYourLife = new MyTimedObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_RUN_FOR_LIFE_Name),
                 MyMissionID.ALIEN_GATE_RUN_FOR_LIFE,
                 (MyTextsWrapperEnum.ALIEN_GATE_RUN_FOR_LIFE_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_COUGHT_IN_TRAP },
                 TimeSpan.FromMilliseconds(RunForYourLifeObjectiveTime),
                 startDialogId: MyDialogueEnum.ALIEN_GATE_0600
                ) { DisplayCounter = false, Location = new MyMissionLocation(baseSector, (uint)EntityID.RunForYourLifeDummy), HudName = MyTextsWrapperEnum.HudRun };
            m_runForYourLife.OnMissionLoaded += M05RunForYourLifeOnOnMissionLoaded;
            m_runForYourLife.Components.Add(new MyMovingEntity(MyActorConstants.GetActorName(MyActorEnum.MADELYN), (uint)EntityID.RunForYourLifeShipTarget, RunForYourLifeShipMoveTime));
            m_objectives.Add(m_runForYourLife);
            
            m_regroupWithMadelyn = new MyTimedObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_REGROUP_WITH_MADELYN_Name),
                MyMissionID.ALIEN_GATE_REGROUP_WITH_MADELYN,
                (MyTextsWrapperEnum.ALIEN_GATE_REGROUP_WITH_MADELYN_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_RUN_FOR_LIFE, },
                TimeSpan.FromMilliseconds(RegroupWithMadelynMissionTime)
            ) { DisplayCounter = false, Location = new MyMissionLocation(baseSector, (uint)EntityID.RegroupWithMadelynShip1Target), HudName = MyTextsWrapperEnum.HudRegroup, SaveOnSuccess = true };
            m_regroupWithMadelyn.OnMissionLoaded += M06RegroupWithMadelynOnOnMissionLoaded;
            m_regroupWithMadelyn.Components.Add(new MySpawnpointWaves((uint)EntityID.RegroupWithMadelynDetector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.RegroupWithMadelynSpawn1},
                                                                                                             new uint[]{(uint)EntityID.RegroupWithMadelynSpawn2}
                                                                                                         }));
            m_regroupWithMadelyn.Components.Add(new MySpawnpointWaves((uint)EntityID.RegroupWithMadelynDetector2, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.RegroupWithMadelynSpawn3, (uint)EntityID.RegroupWithMadelynSpawn4}
                                                                                                         }));

            m_regroupWithMadelyn.Components.Add(new MyMovingEntity(MyActorConstants.GetActorName(MyActorEnum.MADELYN), (uint)EntityID.RegroupWithMadelynShip1Target, RegroupWithMadelynMissionTime));
            m_regroupWithMadelyn.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip1, (uint)EntityID.RegroupWithMadelynShip2Target, RegroupWithMadelynMissionTime));
            m_regroupWithMadelyn.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip2, (uint)EntityID.RegroupWithMadelynShip3Target, RegroupWithMadelynMissionTime));
            m_regroupWithMadelyn.Components.Add(new MyMovingEntity((uint)EntityID.CoughtInTrapShip3, (uint)EntityID.RegroupWithMadelynShip4Target, RegroupWithMadelynMissionTime));
            m_regroupWithMadelyn.Components.Add(new MyTimedDialogue(new TimeSpan(0, 0, 50), MyDialogueEnum.ALIEN_GATE_0900));
            m_regroupWithMadelyn.Components.Add(new MyDetectorDialogue((uint)EntityID.RegroupWithMadelynShip1Target, MyDialogueEnum.ALIEN_GATE_0800B));
            m_objectives.Add(m_regroupWithMadelyn);
            


            m_boardMotherShip = new MyObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_BOARD_MOTHER_SHIP_Name),
                 MyMissionID.ALIEN_GATE_BOARD_MOTHER_SHIP,
                 (MyTextsWrapperEnum.ALIEN_GATE_BOARD_MOTHER_SHIP_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_REGROUP_WITH_MADELYN, },
                 new MyMissionLocation(baseSector, (uint)EntityID.BoardmotherShipDummy)
                ) { SuccessDialogId = MyDialogueEnum.ALIEN_GATE_1100, HudName = MyTextsWrapperEnum.HudMothership };
            m_boardMotherShip.Components.Add(new MySpawnpointWaves((uint)EntityID.BoardmotherShipDetector1, 1, (uint)EntityID.BoardmotherShipSpawn1));
            m_boardMotherShip.Components.Add(new MySpawnpointWaves((uint)EntityID.BoardmotherShipDetector2, 1, (uint)EntityID.BoardmotherShipSpawn2));
            m_boardMotherShip.Components.Add(new MySpawnpointWaves((uint)EntityID.BoardmotherShipDetector3, 1, (uint)EntityID.BoardmotherShipSpawn3));
            m_boardMotherShip.Components.Add(new MyDetectorDialogue((uint)EntityID.RussianGeneralSpeak, MyDialogueEnum.ALIEN_GATE_1000));
            m_boardMotherShip.OnMissionLoaded += BoardMotherShipOnOnMissionLoaded;
            m_objectives.Add(m_boardMotherShip);

            m_hackGenerator = new MyUseObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_HACK_GENERATOR_Name),
                 MyMissionID.ALIEN_GATE_HACK_GENERATOR,
                 (MyTextsWrapperEnum.ALIEN_GATE_HACK_GENERATOR_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_BOARD_MOTHER_SHIP },
                 new MyMissionLocation(baseSector, (uint)EntityID.HackGeneratorDummy),
                 MyTextsWrapperEnum.PressToHack,
                 MyTextsWrapperEnum.Generator,
                 MyTextsWrapperEnum.StartingProgress,
                 5000
                );
            m_hackGenerator.SaveOnSuccess = true;
            m_hackGenerator.OnMissionLoaded += M08HackGeneratorOnOnMissionLoaded;
            m_hackGenerator.Components.Add(new MyTimedDialogue(new TimeSpan(0, 0, 2), MyDialogueEnum.ALIEN_GATE_1200));
            m_hackGenerator.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn11},
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn12}
                                                                                                         }));
            m_hackGenerator.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector2, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn21},
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn22}
                                                                                                         }));
            m_hackGenerator.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn31,(uint)EntityID.HackGeneratorSpawn32,(uint)EntityID.HackGeneratorSpawn33},
                                                                                                         }));
            m_hackGenerator.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector4, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn41,(uint)EntityID.HackGeneratorSpawn42},
                                                                                                         }));
            m_hackGenerator.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector5, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn5},
                                                                                                         }));
            m_objectives.Add(m_hackGenerator);


            m_hackEngine = new MyUseObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_HACK_ENGINE_Name),
                 MyMissionID.ALIEN_GATE_HACK_ENGINE,
                 (MyTextsWrapperEnum.ALIEN_GATE_HACK_ENGINE_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_HACK_GENERATOR },
                 new MyMissionLocation(baseSector, (uint)EntityID.HackEngineDummy),
                 MyTextsWrapperEnum.PressToHack,
                 MyTextsWrapperEnum.Generator,
                 MyTextsWrapperEnum.StartingProgress,
                 5000,
                 MyUseObjectiveType.Hacking,
                 startDialogId: MyDialogueEnum.ALIEN_GATE_1300
                ) { SuccessDialogId = MyDialogueEnum.ALIEN_GATE_1500, SaveOnSuccess = true };
            m_hackEngine.OnMissionLoaded += M09HackEngineOnOnMissionLoaded;
            m_hackEngine.Components.Add(new MyDetectorDialogue((uint)EntityID.HackEngineDummy, MyDialogueEnum.ALIEN_GATE_1400));
            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector5, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGeneratorSpawn5},
                                                                                                        }));

            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector4, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn2},
                                                                                                         }));
            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackEngineDetector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn3},
                                                                                                         }));
            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackEngineDetector4, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn4},
                                                                                                         }));
            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackEngineDetector5, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn51},
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn52},
                                                                                                         }));
            m_hackEngine.Components.Add(new MySpawnpointWaves((uint)EntityID.HackEngineDetector6, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn6},
                                                                                                         }));
            m_objectives.Add(m_hackEngine);


            m_leaveShip1 = new MyTimedReachLocationObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_LEAVE_SHIP_Name),
                 MyMissionID.ALIEN_GATE_LEAVE_SHIP,
                 (MyTextsWrapperEnum.ALIEN_GATE_LEAVE_SHIP_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_HACK_ENGINE, },
                 TimeSpan.FromMilliseconds((double)m_10ObjectiveTime),
                 new MyMissionLocation(baseSector, (uint)EntityID._10Dummy)
                ) { HudName = MyTextsWrapperEnum.Nothing };

            m_leaveShip1.OnMissionLoaded += M10LeaveShip1OnOnMissionLoaded;
            m_leaveShip1.OnMissionFailed += M10LeaveShip1OnOnMissionFailed;
            m_leaveShip1.Components.Add(new MySpawnpointWaves((uint)EntityID.HackEngineDetector4, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackEngineSpawn4},
                                                                                                        }));

            m_leaveShip1.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGeneratorDetector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._10Spawn2},
                                                                                                         }));
            m_objectives.Add(m_leaveShip1);


            m_regroupWithMadelyn2 = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_REGROPUP_WITH_MADELYN_Name),
                MyMissionID.ALIEN_GATE_REGROPUP_WITH_MADELYN,
                (MyTextsWrapperEnum.ALIEN_GATE_REGROPUP_WITH_MADELYN_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_LEAVE_SHIP, },
                new MyMissionLocation(baseSector, (uint)EntityID.RegroupWithMadelynShip1Target),
                startDialogId: MyDialogueEnum.ALIEN_GATE_1700
            ) { HudName = MyTextsWrapperEnum.HudRegroup, SaveOnSuccess = true };
            m_regroupWithMadelyn2.OnMissionLoaded += M11RegroupWithMadelyn2OnOnMissionLoaded;
            m_objectives.Add(m_regroupWithMadelyn2);

            m_shipbBoard2 = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_BOARD_SECOND_Name),
                MyMissionID.ALIEN_GATE_BOARD_SECOND,
                (MyTextsWrapperEnum.ALIEN_GATE_BOARD_SECOND_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_REGROPUP_WITH_MADELYN, },
                new MyMissionLocation(baseSector, (uint)EntityID.BoardSecondShipbDummy)
                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_1900, HudName = MyTextsWrapperEnum.HudMothership };
            m_shipbBoard2.Components.Add(new MySpawnpointWaves((uint)EntityID.RegroupWithMadelynDetector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.BoardSecondShipbSpawn1, (uint)EntityID.BoardSecondShipbSpawn2},
                                                                                                        }));
            m_shipbBoard2.OnMissionLoaded += M11BBoard2OnOnMissionLoaded;
            m_objectives.Add(m_shipbBoard2);


            m_hackGenerator2 = new MyUseObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_HACK_GENERATOR2_Name),
                 MyMissionID.ALIEN_GATE_HACK_GENERATOR2,
                 (MyTextsWrapperEnum.ALIEN_GATE_HACK_GENERATOR2_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_BOARD_SECOND },
                 new MyMissionLocation(baseSector, (uint)EntityID.HackGenerator2Dummy),
                 MyTextsWrapperEnum.PressToHack,
                 MyTextsWrapperEnum.Generator,
                 MyTextsWrapperEnum.StartingProgress,
                 5000,
                 MyUseObjectiveType.Hacking
                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2000, SaveOnSuccess = true };
            m_hackGenerator2.OnMissionLoaded += M12HackGenerator2OnOnMissionLoaded;

            m_hackGenerator2.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGenerator2Detector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGenerator2Spawn11, (uint)EntityID.HackGenerator2Spawn12},
                                                                                                        }));
            m_hackGenerator2.Components.Add(new MySpawnpointWaves((uint)EntityID.HackGenerator2Detector2, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.HackGenerator2Spawn2},
                                                                                                        }));
            m_objectives.Add(m_hackGenerator2);


            m_hackEngine2 = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_HACK_ENGINE_2_Name),
                MyMissionID.ALIEN_GATE_HACK_ENGINE_2,
                (MyTextsWrapperEnum.ALIEN_GATE_HACK_ENGINE_2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_HACK_GENERATOR2 },
                new MyMissionLocation(baseSector, (uint)EntityID._13Dummy)/*,
                startDialogId: MyDialogueEnum.ALIEN_GATE_2100*/
                );
            m_hackEngine2.OnMissionLoaded += M13HackEngine2OnOnMissionLoaded;
            m_hackEngine2.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._13Spawn11, (uint)EntityID._13Spawn12,(uint)EntityID._13Spawn13},
                                                                                                        }));
            m_hackEngine2.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector2, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._13Spawn2}
                                                                                                        }));
            m_hackEngine2.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._13Spawn3}
                                                                                                        }));
            m_hackEngine2.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector4, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._13Spawn41},
                                                                                                            new uint[]{(uint)EntityID._13Spawn42}
                                                                                                        }));
            m_hackEngine2.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector5, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._13Spawn51},
                                                                                                            new uint[]{(uint)EntityID._13Spawn52}
                                                                                                        }));
            m_objectives.Add(m_hackEngine2);


            m_enableDoors = new MyObjectiveEnablePrefabs(
                (MyTextsWrapperEnum.ALIEN_GATE_ENABLE_DOORS_Name),
                MyMissionID.ALIEN_GATE_ENABLE_DOORS,
                (MyTextsWrapperEnum.ALIEN_GATE_ENABLE_DOORS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_HACK_ENGINE_2 },
                null,
                new List<uint> { (uint)EntityID.EnableDoorsHUB },
                new List<uint> { (uint)EntityID.EnableDoorsDoors, }


                ) { HudName = MyTextsWrapperEnum.HudHub };
            m_enableDoors.Components.Add(new MySpawnpointWaves((uint)EntityID.EnableDoorsDetector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.EnableDoorsSpawnPoint}
                                                                                                        }));

            m_enableDoors.Components.Add(new MyDetectorDialogue((uint)EntityID.DoorsDialogue, MyDialogueEnum.ALIEN_GATE_2200));
            m_objectives.Add(m_enableDoors);

            m_enterlaboratory = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_ENTER_LAB_Name),
                MyMissionID.ALIEN_GATE_ENTER_LAB,
                (MyTextsWrapperEnum.ALIEN_GATE_ENTER_LAB_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_ENABLE_DOORS },
                new MyMissionLocation(baseSector, (uint)EntityID.EnterLaboratoryDummy)
                // startDialogId: m_dialog12
                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2300, HudName = MyTextsWrapperEnum.HudLab };
            m_enterlaboratory.Components.Add(new MySpawnpointWaves((uint)EntityID.EnterLaboratoryDetector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID.EnterLaboratorySpawn}
                                                                                                        }));
            m_objectives.Add(m_enterlaboratory);

            m_downloadData = new MyUseObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_16_Name),
                 MyMissionID.ALIEN_GATE_16,
                 (MyTextsWrapperEnum.ALIEN_GATE_16_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_ENTER_LAB },
                 new MyMissionLocation(baseSector, (uint)EntityID._16Dummy),
                 MyTextsWrapperEnum.PressToDownloadData,
                 MyTextsWrapperEnum.DataTransfer,
                 MyTextsWrapperEnum.DownloadingData,
                 3000,
                 MyUseObjectiveType.Taking
                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2400, SaveOnSuccess = true };
            m_objectives.Add(m_downloadData);


            m_hackGenerator3 = new MyUseObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_17_Name),
                 MyMissionID.ALIEN_GATE_17,
                 (MyTextsWrapperEnum.ALIEN_GATE_17_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_16 },
                 new MyMissionLocation(baseSector, (uint)EntityID._17Dummy),
                 MyTextsWrapperEnum.PressToHack,
                 MyTextsWrapperEnum.Generator,
                 MyTextsWrapperEnum.StartingProgress,
                 5000,
                 MyUseObjectiveType.Hacking,
                 startDialogId: MyDialogueEnum.ALIEN_GATE_2500
                );
            m_objectives.Add(m_hackGenerator3);
            m_hackGenerator3.OnMissionLoaded += M17HackGenerator3OnOnMissionLoaded;

            m_hackGenerator3.Components.Add(new MySpawnpointWaves((uint)EntityID._17Detector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._17Spawn1,(uint)EntityID.EnterLaboratorySpawn}
                                                                                                        }));

            m_leaveShip = new MyTimedReachLocationObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_18_Name),
                 MyMissionID.ALIEN_GATE_18,
                 (MyTextsWrapperEnum.ALIEN_GATE_18_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_17, },
                 TimeSpan.FromMilliseconds((double)m_18ObjectiveTime),
                 new MyMissionLocation(baseSector, (uint)EntityID._18Dummy)

                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2600, HudName = MyTextsWrapperEnum.Nothing, SaveOnSuccess = true };
            m_leaveShip.OnMissionLoaded += M18LeaveShipOnOnMissionLoaded;
            m_leaveShip.OnMissionFailed += M18LeaveShipOnOnMissionFailed;
            m_leaveShip.Components.Add(new MySpawnpointWaves((uint)EntityID._13Detector5, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._18Spawn1}
                                                                                                        }));
            m_objectives.Add(m_leaveShip);

            m_killReef = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_19_Name),
                MyMissionID.ALIEN_GATE_19,
                (MyTextsWrapperEnum.ALIEN_GATE_19_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_18 },
                new MyMissionLocation(baseSector, (uint)EntityID._19Dummy)

                ) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2800 };
            m_killReef.OnMissionLoaded += M19KilReefOnOnMissionLoaded;
            m_objectives.Add(m_killReef);


            m_20ReefEscape = new MyTimedObjective
                ((MyTextsWrapperEnum.ALIEN_GATE_20_Name),
                 MyMissionID.ALIEN_GATE_20,
                 (MyTextsWrapperEnum.ALIEN_GATE_20_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.ALIEN_GATE_19, },
                 TimeSpan.FromMilliseconds(m_20ObjectiveTime)
                ) { HudName = MyTextsWrapperEnum.HudFrancisReef };
            m_20ReefEscape.Location = new MyMissionLocation(baseSector, (uint)EntityID._20Prefab);
            m_20ReefEscape.Components.Add(new MyMovingEntity((uint)EntityID._19Ship, (uint)EntityID._20ShipTarget, m_20ObjectiveTime));
            m_20ReefEscape.OnMissionLoaded += M20ReefEscapeOnOnMissionLoaded;
            m_20ReefEscape.OnMissionSuccess += ReefEscapeOnOnMissionSuccess;
            m_objectives.Add(m_20ReefEscape);

            m_21DestroyReef = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.ALIEN_GATE_21_Name),
                MyMissionID.ALIEN_GATE_21,
                (MyTextsWrapperEnum.ALIEN_GATE_21_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_20 },
                new List<uint>() { (uint)EntityID._21ToDesroy }) { StartDialogId = MyDialogueEnum.ALIEN_GATE_2900, HudName = MyTextsWrapperEnum.HudFrancisReef, SaveOnSuccess = true };
            m_21DestroyReef.OnMissionLoaded += M21DestroyReefOnOnMissionLoaded;
            m_21DestroyReef.OnMissionSuccess += M21DestroyReefOnOnMissionSuccess;
            m_21DestroyReef.Components.Add(new MySpawnpointWaves((uint)EntityID._21Detector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityID._21SpawnPoint11},
                                                                                                             new uint[]{(uint)EntityID._21SpawnPoint12}
                                                                                                        }));
            m_21DestroyReef.Components.Add(new MyMovingEntity((uint)EntityID._21Ship2, (uint)EntityID._21Ship2Target, m_21ObjectiveMovingTime));
            m_21DestroyReef.Components.Add(new MyMovingEntity((uint)EntityID._21Particle1, (uint)EntityID._21Particle1Target, m_21ObjectiveMovingTime, false));
            m_21DestroyReef.Components.Add(new MyMovingEntity((uint)EntityID._21Particle2, (uint)EntityID._21Particle2Target, m_21ObjectiveMovingTime, false));
            //m_21DestroyReef.Components.Add(new MyTimedDialogue(TimeSpan.FromMilliseconds(m_21ObjectiveMovingTime), MyDialogueEnum.ALIEN_GATE_3100));
            m_21DestroyReef.Components.Add(new MyTimedDialogue(TimeSpan.FromMilliseconds(5000), MyDialogueEnum.ALIEN_GATE_3000));
            m_objectives.Add(m_21DestroyReef);


            m_22FlyBackTomadelyn = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_22_Name),
                MyMissionID.ALIEN_GATE_22,
                (MyTextsWrapperEnum.ALIEN_GATE_22_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_21 },
                new MyMissionLocation(baseSector, (uint)EntityID._22Dummy),
                startDialogId: MyDialogueEnum.ALIEN_GATE_3200
                ) { HudName = MyTextsWrapperEnum.HudMeetingPoint };
            m_22FlyBackTomadelyn.OnMissionLoaded += M22FlyBackTomadelynOnOnMissionLoaded;
            m_objectives.Add(m_22FlyBackTomadelyn);

            m_23ExploreAliengate = new MyObjective(
                (MyTextsWrapperEnum.ALIEN_GATE_23_Name),
                MyMissionID.ALIEN_GATE_23,
                (MyTextsWrapperEnum.ALIEN_GATE_23_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.ALIEN_GATE_22 },
                new MyMissionLocation(baseSector, (uint)EntityID._23Dummy),
                startDialogId: MyDialogueEnum.ALIEN_GATE_3300
                ) { HudName = MyTextsWrapperEnum.Nothing };
            m_23ExploreAliengate.Components.Add(new MyMovingEntity(MyActorConstants.GetActorName(MyActorEnum.MADELYN), (uint)EntityID._23Shiptarget, 50000));
            m_23ExploreAliengate.OnMissionLoaded += M23ExploreAliengateOnOnMissionLoaded;
            m_objectives.Add(m_23ExploreAliengate);
            #endregion
        }
        public MyJunkyardEACAmbushMission()
        {
            ID = MyMissionID.JUNKYARD_EAC_AMBUSH; /* ID must be added to MyMissions.cs */
            DebugName = new StringBuilder("13-EAC ambush"); // Name of mission
            Name = MyTextsWrapperEnum.JUNKYARD_EAC_AMBUSH;
            Description = MyTextsWrapperEnum.JUNKYARD_EAC_AMBUSH_Description;
            Flags = MyMissionFlags.Story;
            RequiredActors = new MyActorEnum[] { MyActorEnum.MADELYN, MyActorEnum.MARCUS, MyActorEnum.TARJA, MyActorEnum.VALENTIN };
            MyMwcVector3Int baseSector = new MyMwcVector3Int(2567538, 0, -172727); // Story sector of the script - i.e. (-2465,0,6541)

            Location = new MyMissionLocation(baseSector, (uint)EntityID.PlayerStart); // Starting dummy point - must by typecasted to uint and referenced from EntityID enum

            RequiredMissions = new MyMissionID[] { MyMissionID.RESEARCH_VESSEL }; // IDs of missions required to make this mission available
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN };

            Components.Add(new MySpawnpointLimiter(m_spawns, 7));

            #region Objectives
            m_objectives = new List<MyObjective>(); // Creating of list of submissions
            var flyToManjeet = new MyMeetObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_FLY_TO_MANJEET,
                MyMissionID.JUNKYARD_EAC_AMBUSH_FLY_MANJEET,
                MyTextsWrapperEnum.EAC_AMBUSH_FLY_TO_MANJEET_DESC,
                this,
                new MyMissionID[] { },
                null,
                (uint)EntityID.FlyToManjeet,
                100,
                0.25f,
                null,
                MyDialogueEnum.EAC_AMBUSH_0100_INTRO
                ) { SaveOnSuccess = false, FollowMe = false };
            flyToManjeet.OnMissionLoaded += FlyToManjeet_Loaded;
            m_objectives.Add(flyToManjeet);

            var speakToManjeet = new MyObjectiveDialog(
                MyMissionID.JUNKYARD_EAC_AMBUSH_TALK_RANIJT,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_FLY_MANJEET },
                MyDialogueEnum.EAC_AMBUSH_0200_MANJEET
                ) { SaveOnSuccess = false };
            speakToManjeet.OnMissionLoaded += SpeakToManjeet_Loaded;
            m_objectives.Add(speakToManjeet);

            m_backToMadelyn = new MyObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_GO_BACK_TO_MADELYN,
                MyMissionID.JUNKYARD_EAC_AMBUSH_GO_BACK_TO_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_GO_BACK_TO_MADELYN_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_TALK_RANIJT },
                new MyMissionLocation(baseSector, (uint)EntityID.GoBackToMadelyn),
                startDialogId: MyDialogueEnum.EAC_AMBUSH_0300_GUYS_HURRY_UP
            ) { HudName = MyTextsWrapperEnum.Nothing };
            m_backToMadelyn.OnMissionLoaded += BackToMadelyn_Loaded;
            m_objectives.Add(m_backToMadelyn);

            m_speakWithPolice = new MyObjective(
                MyTextsWrapperEnum.Null,
                MyMissionID.JUNKYARD_EAC_AMBUSH_SPEAK_POLICE,
                MyTextsWrapperEnum.Null,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_GO_BACK_TO_MADELYN },
                null
            );
            m_speakWithPolice.OnMissionLoaded += SpeakWithPolice_Loaded;
            m_objectives.Add(m_speakWithPolice);

            m_defendMadelyn = new MyObjectiveDialog(
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN1,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN_1,
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN1_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_SPEAK_POLICE },
                MyDialogueEnum.EAC_AMBUSH_0500_ONE_LITTLE_ISSUE
                ) { SaveOnSuccess = true };
            m_defendMadelyn.OnMissionLoaded += DefendMadelyn_Loaded;
            m_objectives.Add(m_defendMadelyn);

            var destroyGenerator  = new MyObjectiveDestroy(
                MyTextsWrapperEnum.EAC_AMBUSH_DESTROY_GENERATOR,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DESTROY_GENERATOR,
                MyTextsWrapperEnum.EAC_AMBUSH_DESTROY_GENERATOR_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN_1 },
                new List<uint> {  (uint)EntityID.DestroyGenerator}
                ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_AMBUSH_0700_SPLIT_TO_DESTROY_GENERATORS, HudName = MyTextsWrapperEnum.HudDisruptor };
            destroyGenerator.OnMissionLoaded += DestroyGenerator_Loaded;
            destroyGenerator.OnMissionSuccess += DestroyGenerator_Success;
            m_objectives.Add(destroyGenerator);

            var returnToMadelyn = new MyTimedReachLocationObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_RETURN_TO_MADELYN,
                MyMissionID.JUNKYARD_EAC_AMBUSH_RETUR_TO_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_RETURN_TO_MADELYN_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DESTROY_GENERATOR },
                new TimeSpan(0, 0, 45),
                new MyMissionLocation(baseSector, (uint)EntityID.ReturnToMadelyn)
                ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_AMBUSH_1000, HudName = MyTextsWrapperEnum.HudMadelynsSapho };
            returnToMadelyn.OnMissionLoaded += ReturnToMadelyn_Loaded;
            m_objectives.Add(returnToMadelyn);

            m_defendMadelyn2 = new MyObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN2,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN2_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_RETUR_TO_MADELYN },
                null
            ) { StartDialogId = MyDialogueEnum.EAC_AMBUSH_1200_1300 };
            m_defendMadelyn2.OnMissionLoaded += DefendMadelyn2_Loaded;
            m_defendMadelyn2.OnMissionUpdate += DefendMadelyn2_Update;
            m_objectives.Add(m_defendMadelyn2);

            #endregion
        }
        public MyEACPrisonMission()
        {
            ID              = MyMissionID.EAC_PRISON; /* ID must be added to MyMissions.cs */
            DebugName       = new StringBuilder("20-EAC prison");
            Name            = MyTextsWrapperEnum.EAC_PRISON;
            Description     = MyTextsWrapperEnum.EAC_PRISON_Description;
            Flags           = MyMissionFlags.Story;
            AchievementName = MySteamAchievementNames.Mission29_EacPrison;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(5480055, 0, -5077310);

            /* sector where the mission is located */
            Location = new MyMissionLocation(baseSector, (uint)EntityID.StartLocation); //posledne cislo - ID dummy pointu kde prijimam misiu

            RequiredMissions           = new MyMissionID[] { MyMissionID.TWIN_TOWERS };
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.EAC_PRISON_MEETINGPOINT };
            RequiredActors             = new MyActorEnum[] { MyActorEnum.TARJA, MyActorEnum.VALENTIN, MyActorEnum.MADELYN, MyActorEnum.MARCUS };

            m_objectives = new List <MyObjective>();

            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeStorage, 0, (uint)EntityID.SpawnpointAtStorage));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeIndustry, 0, (uint)EntityID.SpawnpointAtIndustry1));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeIndustry, 0, (uint)EntityID.SpawnpointAtIndustry2));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeParking, 0, (uint)EntityID.SpawnpointAtParking));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMines, 0, (uint)EntityID.SpawnpointAtMines));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMinesEntrance, 0, (uint)EntityID.SpawnpointAtMinesEntrance));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMarcusCell, 0, (uint)EntityID.SpawnpointAtMarcusCell));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck7, 0, (uint)EntityID.SpawnpointAtSecurityCheck7));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck6, 0, (uint)EntityID.SpawnpointAtSecurityCheck6));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck8, 0, (uint)EntityID.SpawnpointAtSecurityCheck8));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck4, 0, (uint)EntityID.SpawnpointAtSecurityCheck4));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCellAfterSecurityCheck4, 0, (uint)EntityID.SpawnpointAtCellAfterSecurityCheck4));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck5, 0, (uint)EntityID.SpawnpointAtSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell1AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell1AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell2AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell2AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell3AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell3AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck3, 0, (uint)EntityID.SpawnpointAtSecurityCheck3));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell1AfterSecurityCheck3, 0, (uint)EntityID.SpawnpointAtCell1AfterSecurityCheck3));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell2AfterSecurityCheck3, 0, (uint)EntityID.SpawnpointAtCell2AfterSecurityCheck3));

            //Components.Add(new MySpawnpointWaves(detectorId, 3, new List<uint[]> {
            //    new uint[] { spawnpointId1, spawnpointId2, spawnpointId3 },
            //    new uint[] { spawnpointId4, spawnpointId5 }}));

            //01
            var mothershipBattle = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_THRUSWARM_Name),
                MyMissionID.EAC_PRISON_THRUSWARM,
                (MyTextsWrapperEnum.EAC_PRISON_THRUSWARM_Description),
                null,
                this,
                new MyMissionID[] {},
                new MyMissionLocation(baseSector, (uint)EntityID.MotherShiBattleLocationDummy)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0100, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0200
            };

            m_objectives.Add(mothershipBattle);
            //mothershipBattle.Components.Add(new MySpawnpointWaves(77073, 0, 76625));
            mothershipBattle.OnMissionLoaded += mothershipBattle_OnMissionLoaded;

            //02

            var destroySolarDefence = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_SOLARDEF_Name),
                MyMissionID.EAC_PRISON_SOLARDEF,
                (MyTextsWrapperEnum.EAC_PRISON_SOLARDEF_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_THRUSWARM },
                m_02toKill
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0300
            };

            destroySolarDefence.OnMissionSuccess += DestroySolarDefenceOnOnMissionSuccess;
            m_objectives.Add(destroySolarDefence);
            destroySolarDefence.OnMissionLoaded += destroySolarDefence_OnMissionLoaded;

            //03
            m_destroySolarPanelsFirst = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF1_Name),
                MyMissionID.EAC_PRISON_SOLAROFF1,
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_SOLARDEF },
                null
                )
            {
                SaveOnSuccess = false
            };
            m_destroySolarPanelsFirst.OnMissionLoaded  += DestroySolarPanelsFirstSubmissionLoaded;
            m_destroySolarPanelsFirst.OnMissionSuccess += DestroySolarPanelsFirstSubmissionSuccess;
            m_objectives.Add(m_destroySolarPanelsFirst);
            m_destroySolarPanelsFirst.SaveOnSuccess = true;

            //04
            var motherShipHelp = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_MOTHERSHIPHELP_Name),
                MyMissionID.EAC_PRISON_MOTHERSHIPHELP,
                (MyTextsWrapperEnum.EAC_PRISON_MOTHERSHIPHELP_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_SOLAROFF1 },
                m_04toKill
                )
            {
                SaveOnSuccess = false, StartDialogId = MyDialogueEnum.EAC_PRISON_0400, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0500
            };

            m_objectives.Add(motherShipHelp);
            motherShipHelp.OnMissionLoaded += new MissionHandler(motherShipHelp_OnMissionLoaded);

            //05
            m_destroySolarPanelsSecond = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF2_Name),
                MyMissionID.EAC_PRISON_SOLAROFF2,
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MOTHERSHIPHELP },
                null
                )
            {
                SaveOnSuccess = true,
            };
            m_destroySolarPanelsSecond.OnMissionLoaded  += DestroySolarPanelsSecondSubmissionLoaded;
            m_destroySolarPanelsSecond.OnMissionSuccess += DestroySolarPanelsSecondSubmissionSuccess;
            m_objectives.Add(m_destroySolarPanelsSecond);

            //06
            var breakInsideStation = new MyTimedReachLocationObjective(
                (MyTextsWrapperEnum.EAC_PRISON_BREAKIN_Name),
                MyMissionID.EAC_PRISON_BREAKIN,
                (MyTextsWrapperEnum.EAC_PRISON_BREAKIN_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_SOLAROFF2 },
                new System.TimeSpan(0, 1, 0),
                new MyMissionLocation(baseSector, (uint)EntityID.BreakInsideStationLocationDummy)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0600, HudName = MyTextsWrapperEnum.HudCargoBay
            };

            breakInsideStation.OnMissionSuccess += BreakInsideStationSubmissionSuccess;
            breakInsideStation.OnMissionLoaded  += BreakInsideStationOnOnMissionLoaded;
            m_objectives.Add(breakInsideStation);

            //07
            var marcusLocationIntel = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL_Name),
                MyMissionID.EAC_PRISON_LOCINTEL,
                (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_BREAKIN },
                new MyMissionLocation(baseSector, (uint)EntityID._MarcusIntelLocation),
                MyTextsWrapperEnum.PressToDownloadData,
                MyTextsWrapperEnum.Console,
                MyTextsWrapperEnum.DownloadingData,
                5000,
                MyUseObjectiveType.Hacking
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudSecurityHub
            };

            m_objectives.Add(marcusLocationIntel);
            marcusLocationIntel.OnMissionLoaded  += new MissionHandler(marcusLocationIntel_OnMissionLoaded);
            marcusLocationIntel.OnMissionSuccess += MarcusLocationIntelOnOnMissionSuccess;
            marcusLocationIntel.Components.Add(new MySpawnpointLimiter(m_spawns, 6));

            //08
            m_findCircoutPart = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_ACQUIREIDCARD_Name),
                MyMissionID.EAC_PRISON_ACQUIREIDCARD,
                (MyTextsWrapperEnum.EAC_PRISON_ACQUIREIDCARD_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_LOCINTEL },
                new MyMissionLocation(baseSector, (uint)EntityID.CargoIDCard),
                MyTextsWrapperEnum.PressToTakeCargo,
                MyTextsWrapperEnum.TakeAll,
                MyTextsWrapperEnum.TakeAll,
                2000,
                MyUseObjectiveType.Taking,
                radiusOverride: 50
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0700, HudName = MyTextsWrapperEnum.HudIdCard
            };

            m_findCircoutPart.OnMissionLoaded  += OnFindCircuitLoaded;
            m_findCircoutPart.OnMissionSuccess += new MissionHandler(m_findCircoutPart_OnMissionSuccess);
            m_objectives.Add(m_findCircoutPart);


            var marcusLocationIntel2 = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL2_Name),
                MyMissionID.EAC_PRISON_LOCINTEL2,
                (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_ACQUIREIDCARD },
                new MyMissionLocation(baseSector, (uint)EntityID._MarcusIntelLocation),
                MyTextsWrapperEnum.PressToDownloadData,
                MyTextsWrapperEnum.Console,
                MyTextsWrapperEnum.DownloadingData,
                5000,
                MyUseObjectiveType.Hacking
                )
            {
                SaveOnSuccess = true, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0900, StartDialogId = MyDialogueEnum.EAC_PRISON_0800, HudName = MyTextsWrapperEnum.HudSecurityHub
            };

            m_objectives.Add(marcusLocationIntel2);

            //09
            var openDoors = new MyObjectiveEnablePrefabs(
                (MyTextsWrapperEnum.EAC_PRISON_OPENACCESS_Name),
                MyMissionID.EAC_PRISON_OPENACCESS,
                (MyTextsWrapperEnum.EAC_PRISON_OPENACCESS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_LOCINTEL2 },
                null,
                new List <uint> {
                (int)EntityID.SecurityHub
            },
                m_09toEnablePrefabs
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudSecurityHub
            };

            m_objectives.Add(openDoors);

            openDoors.OnMissionLoaded += OnOpenDoorsLoaded;

            //10
            var takeOffSecurityCircuit = new MyObjectiveDisablePrefabs(
                (MyTextsWrapperEnum.EAC_PRISON_SECURITYOFF_Name),
                MyMissionID.EAC_PRISON_SECURITYOFF,
                (MyTextsWrapperEnum.EAC_PRISON_SECURITYOFF_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_OPENACCESS },
                new List <uint> {
                (uint)EntityID.HubHack
            },
                new List <uint> {
                (uint)EntityID.HubHackGenerator
            },
                false,
                false
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1000, HudName = MyTextsWrapperEnum.HudHub
            };

            takeOffSecurityCircuit.OnMissionLoaded += OntakeOffSecuritypartLoaded;//zapne svetlo
            m_objectives.Add(takeOffSecurityCircuit);

            //11
            var approachMarcusCell = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_MARCUSCELL_Name),
                MyMissionID.EAC_PRISON_MARCUSCELL,
                (MyTextsWrapperEnum.EAC_PRISON_MARCUSCELL_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_SECURITYOFF },
                new MyMissionLocation(baseSector, (uint)EntityID.MarcusCellLocation),
                MyTextsWrapperEnum.HoldToMoveMarcus,
                MyTextsWrapperEnum.Actor_Marcus,
                MyTextsWrapperEnum.Moving,
                4000,
                MyUseObjectiveType.Taking
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudMarcus
            };

            approachMarcusCell.OnMissionLoaded += OnapproachMarcusLoaded;
            m_objectives.Add(approachMarcusCell);

            var marcusLoaded = new MyObjectiveDialog(
                MyMissionID.EAC_PRISON_MARCUSDIALOG,
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MARCUSCELL },
                MyDialogueEnum.EAC_PRISON_1200
                )
            {
                SaveOnSuccess = true
            };

            marcusLoaded.OnMissionLoaded += OnMarcusLoadedLoaded;
            m_objectives.Add(marcusLoaded);

            var weHaveCompany = new MyObjectiveDialog(
                MyMissionID.EAC_PRISON_WE_HAVE_COMPANY,
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MARCUSDIALOG },
                MyDialogueEnum.EAC_PRISON_1250
                )
            {
                SaveOnSuccess = false
            };

            weHaveCompany.OnMissionLoaded += OnWeHaveCompanyLoaded;
            m_objectives.Add(weHaveCompany);

            //12
            var findMarcusSmallShip = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_COVERMARCUS_Name),
                MyMissionID.EAC_PRISON_COVERMARCUS,
                (MyTextsWrapperEnum.EAC_PRISON_COVERMARCUS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_WE_HAVE_COMPANY },
                new MyMissionLocation(baseSector, (uint)EntityID.MarcusShipDetector),
                MyTextsWrapperEnum.HoldToMoveMarcus,
                MyTextsWrapperEnum.Actor_Marcus,
                MyTextsWrapperEnum.Moving,
                4000,
                MyUseObjectiveType.Putting
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudShip
            };

            // destroySolarDefence.OnMissionSuccess += ToHangarSubmissionSuccess;
            m_objectives.Add(findMarcusSmallShip);
            findMarcusSmallShip.OnMissionSuccess += OnSuccesfindMarcusSmallShip;

            //13
            var equipMarcus = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_GETARMS_Name),
                MyMissionID.EAC_PRISON_GETARMS,
                (MyTextsWrapperEnum.EAC_PRISON_GETARMS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_COVERMARCUS },
                new MyMissionLocation(baseSector, (uint)EntityID.CargoForMarcus),
                MyTextsWrapperEnum.HoldToMoveWeapons,
                MyTextsWrapperEnum.Actor_Marcus,
                MyTextsWrapperEnum.Moving,
                4000
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudEquipment
            };

            // destroySolarDefence.OnMissionSuccess += ToHangarSubmissionSuccess;
            m_objectives.Add(equipMarcus);
            equipMarcus.OnMissionSuccess += OnEquipMarcussSucces;
            equipMarcus.OnMissionLoaded  += EquipMarcusOnOnMissionLoaded;

            //14
            var fightOutStation = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_FIGHTOUT_Name),
                MyMissionID.EAC_PRISON_FIGHTOUT,
                (MyTextsWrapperEnum.EAC_PRISON_FIGHTOUT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_GETARMS },
                new MyMissionLocation(baseSector, (uint)EntityID.StationDummy)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1300, SuccessDialogId = MyDialogueEnum.EAC_PRISON_1400, HudName = MyTextsWrapperEnum.Nothing
            };

            fightOutStation.OnMissionLoaded  += fightOutStation_OnMissionLoaded;
            fightOutStation.OnMissionSuccess += fightOutStation_OnMissionSuccess;
            m_objectives.Add(fightOutStation);

            //15
            var CrushRemainingShips = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_CRUSHREINFORCEMENTS_Name),
                MyMissionID.EAC_PRISON_CRUSHREINFORCEMENTS,
                (MyTextsWrapperEnum.EAC_PRISON_CRUSHREINFORCEMENTS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_FIGHTOUT },
                new List <uint> {
            },                          // entities needed to kill
                m_15toKillSpawnpoints,  // spawnpoint from which bots must be killed
                false                   // don't show marks on entities (not from spawnpoint)
                )
            {
                SaveOnSuccess = true,
            };

            m_objectives.Add(CrushRemainingShips);

            //16
            var GetToMeetingPoint = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_MEETINGPOINT_Name),
                MyMissionID.EAC_PRISON_MEETINGPOINT,
                (MyTextsWrapperEnum.EAC_PRISON_MEETINGPOINT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_CRUSHREINFORCEMENTS },
                new MyMissionLocation(baseSector, MyMissionLocation.MADELYN_HANGAR),
                radiusOverride: MyMissionLocation.MADELYN_HANGAR_RADIUS
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1500, SuccessDialogId = MyDialogueEnum.EAC_PRISON_1600, HudName = MyTextsWrapperEnum.HudMeetingPoint
            };

            m_objectives.Add(GetToMeetingPoint);
        }
        public MyJunkyardEACAmbushMission()
        {
            ID             = MyMissionID.JUNKYARD_EAC_AMBUSH;    /* ID must be added to MyMissions.cs */
            DebugName      = new StringBuilder("13-EAC ambush"); // Name of mission
            Name           = MyTextsWrapperEnum.JUNKYARD_EAC_AMBUSH;
            Description    = MyTextsWrapperEnum.JUNKYARD_EAC_AMBUSH_Description;
            Flags          = MyMissionFlags.Story;
            RequiredActors = new MyActorEnum[] { MyActorEnum.MADELYN, MyActorEnum.MARCUS, MyActorEnum.TARJA, MyActorEnum.VALENTIN };
            MyMwcVector3Int baseSector = new MyMwcVector3Int(2567538, 0, -172727);          // Story sector of the script - i.e. (-2465,0,6541)

            Location = new MyMissionLocation(baseSector, (uint)EntityID.PlayerStart);       // Starting dummy point - must by typecasted to uint and referenced from EntityID enum

            RequiredMissions           = new MyMissionID[] { MyMissionID.RESEARCH_VESSEL }; // IDs of missions required to make this mission available
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN };

            Components.Add(new MySpawnpointLimiter(m_spawns, 7));

            #region Objectives
            m_objectives = new List <MyObjective>(); // Creating of list of submissions
            var flyToManjeet = new MyMeetObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_FLY_TO_MANJEET,
                MyMissionID.JUNKYARD_EAC_AMBUSH_FLY_MANJEET,
                MyTextsWrapperEnum.EAC_AMBUSH_FLY_TO_MANJEET_DESC,
                this,
                new MyMissionID[] { },
                null,
                (uint)EntityID.FlyToManjeet,
                100,
                0.25f,
                null,
                MyDialogueEnum.EAC_AMBUSH_0100_INTRO
                )
            {
                SaveOnSuccess = false, FollowMe = false
            };
            flyToManjeet.OnMissionLoaded += FlyToManjeet_Loaded;
            m_objectives.Add(flyToManjeet);

            var speakToManjeet = new MyObjectiveDialog(
                MyMissionID.JUNKYARD_EAC_AMBUSH_TALK_RANIJT,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_FLY_MANJEET },
                MyDialogueEnum.EAC_AMBUSH_0200_MANJEET
                )
            {
                SaveOnSuccess = false
            };
            speakToManjeet.OnMissionLoaded += SpeakToManjeet_Loaded;
            m_objectives.Add(speakToManjeet);

            m_backToMadelyn = new MyObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_GO_BACK_TO_MADELYN,
                MyMissionID.JUNKYARD_EAC_AMBUSH_GO_BACK_TO_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_GO_BACK_TO_MADELYN_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_TALK_RANIJT },
                new MyMissionLocation(baseSector, (uint)EntityID.GoBackToMadelyn),
                startDialogId: MyDialogueEnum.EAC_AMBUSH_0300_GUYS_HURRY_UP
                )
            {
                HudName = MyTextsWrapperEnum.Nothing
            };
            m_backToMadelyn.OnMissionLoaded += BackToMadelyn_Loaded;
            m_objectives.Add(m_backToMadelyn);

            m_speakWithPolice = new MyObjective(
                MyTextsWrapperEnum.Null,
                MyMissionID.JUNKYARD_EAC_AMBUSH_SPEAK_POLICE,
                MyTextsWrapperEnum.Null,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_GO_BACK_TO_MADELYN },
                null
                );
            m_speakWithPolice.OnMissionLoaded += SpeakWithPolice_Loaded;
            m_objectives.Add(m_speakWithPolice);

            m_defendMadelyn = new MyObjectiveDialog(
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN1,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN_1,
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN1_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_SPEAK_POLICE },
                MyDialogueEnum.EAC_AMBUSH_0500_ONE_LITTLE_ISSUE
                )
            {
                SaveOnSuccess = true
            };
            m_defendMadelyn.OnMissionLoaded += DefendMadelyn_Loaded;
            m_objectives.Add(m_defendMadelyn);

            var destroyGenerator = new MyObjectiveDestroy(
                MyTextsWrapperEnum.EAC_AMBUSH_DESTROY_GENERATOR,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DESTROY_GENERATOR,
                MyTextsWrapperEnum.EAC_AMBUSH_DESTROY_GENERATOR_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN_1 },
                new List <uint> {
                (uint)EntityID.DestroyGenerator
            }
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_AMBUSH_0700_SPLIT_TO_DESTROY_GENERATORS, HudName = MyTextsWrapperEnum.HudDisruptor
            };
            destroyGenerator.OnMissionLoaded  += DestroyGenerator_Loaded;
            destroyGenerator.OnMissionSuccess += DestroyGenerator_Success;
            m_objectives.Add(destroyGenerator);

            var returnToMadelyn = new MyTimedReachLocationObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_RETURN_TO_MADELYN,
                MyMissionID.JUNKYARD_EAC_AMBUSH_RETUR_TO_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_RETURN_TO_MADELYN_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_DESTROY_GENERATOR },
                new TimeSpan(0, 0, 45),
                new MyMissionLocation(baseSector, (uint)EntityID.ReturnToMadelyn)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_AMBUSH_1000, HudName = MyTextsWrapperEnum.HudMadelynsSapho
            };
            returnToMadelyn.OnMissionLoaded += ReturnToMadelyn_Loaded;
            m_objectives.Add(returnToMadelyn);

            m_defendMadelyn2 = new MyObjective(
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN2,
                MyMissionID.JUNKYARD_EAC_AMBUSH_DEFEND_MADELYN,
                MyTextsWrapperEnum.EAC_AMBUSH_DEFEND_MADELYN2_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.JUNKYARD_EAC_AMBUSH_RETUR_TO_MADELYN },
                null
                )
            {
                StartDialogId = MyDialogueEnum.EAC_AMBUSH_1200_1300
            };
            m_defendMadelyn2.OnMissionLoaded += DefendMadelyn2_Loaded;
            m_defendMadelyn2.OnMissionUpdate += DefendMadelyn2_Update;
            m_objectives.Add(m_defendMadelyn2);

            #endregion
        }
        public MyEACPrisonMission()
        {
            ID = MyMissionID.EAC_PRISON; /* ID must be added to MyMissions.cs */
            DebugName = new StringBuilder("20-EAC prison");
            Name = MyTextsWrapperEnum.EAC_PRISON;
            Description = MyTextsWrapperEnum.EAC_PRISON_Description;
            Flags = MyMissionFlags.Story;
            AchievementName = MySteamAchievementNames.Mission29_EacPrison;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(5480055, 0, -5077310);

            /* sector where the mission is located */
            Location = new MyMissionLocation(baseSector, (uint)EntityID.StartLocation); //posledne cislo - ID dummy pointu kde prijimam misiu

            RequiredMissions = new MyMissionID[] { MyMissionID.TWIN_TOWERS };
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.EAC_PRISON_MEETINGPOINT };
            RequiredActors = new MyActorEnum[] { MyActorEnum.TARJA, MyActorEnum.VALENTIN, MyActorEnum.MADELYN, MyActorEnum.MARCUS };
            
            m_objectives = new List<MyObjective>();

            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeStorage, 0, (uint)EntityID.SpawnpointAtStorage));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeIndustry, 0, (uint)EntityID.SpawnpointAtIndustry1));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeIndustry, 0, (uint)EntityID.SpawnpointAtIndustry2));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeParking, 0, (uint)EntityID.SpawnpointAtParking));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMines, 0, (uint)EntityID.SpawnpointAtMines));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMinesEntrance, 0, (uint)EntityID.SpawnpointAtMinesEntrance));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeMarcusCell, 0, (uint)EntityID.SpawnpointAtMarcusCell));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck7, 0, (uint)EntityID.SpawnpointAtSecurityCheck7));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck6, 0, (uint)EntityID.SpawnpointAtSecurityCheck6));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck8, 0, (uint)EntityID.SpawnpointAtSecurityCheck8));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck4, 0, (uint)EntityID.SpawnpointAtSecurityCheck4));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCellAfterSecurityCheck4, 0, (uint)EntityID.SpawnpointAtCellAfterSecurityCheck4));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck5, 0, (uint)EntityID.SpawnpointAtSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell1AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell1AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell2AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell2AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell3AfterSecurityCheck5, 0, (uint)EntityID.SpawnpointAtCell3AfterSecurityCheck5));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeSecurityCheck3, 0, (uint)EntityID.SpawnpointAtSecurityCheck3));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell1AfterSecurityCheck3, 0, (uint)EntityID.SpawnpointAtCell1AfterSecurityCheck3));
            Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorBeforeCell2AfterSecurityCheck3, 0, (uint)EntityID.SpawnpointAtCell2AfterSecurityCheck3));

            //Components.Add(new MySpawnpointWaves(detectorId, 3, new List<uint[]> { 
            //    new uint[] { spawnpointId1, spawnpointId2, spawnpointId3 },
            //    new uint[] { spawnpointId4, spawnpointId5 }}));
                        
            //01
            var mothershipBattle = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_THRUSWARM_Name),
                MyMissionID.EAC_PRISON_THRUSWARM,
                (MyTextsWrapperEnum.EAC_PRISON_THRUSWARM_Description),
                null,
                this,
                new MyMissionID[] {},
                new MyMissionLocation(baseSector, (uint)EntityID.MotherShiBattleLocationDummy)
                ) {SaveOnSuccess = true,StartDialogId = MyDialogueEnum.EAC_PRISON_0100, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0200};
            m_objectives.Add(mothershipBattle);
            //mothershipBattle.Components.Add(new MySpawnpointWaves(77073, 0, 76625));
            mothershipBattle.OnMissionLoaded += mothershipBattle_OnMissionLoaded;

            //02
            
            var destroySolarDefence = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_SOLARDEF_Name),
                MyMissionID.EAC_PRISON_SOLARDEF,
                (MyTextsWrapperEnum.EAC_PRISON_SOLARDEF_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_THRUSWARM },
                m_02toKill
            ) { SaveOnSuccess = true,StartDialogId = MyDialogueEnum.EAC_PRISON_0300};
            destroySolarDefence.OnMissionSuccess += DestroySolarDefenceOnOnMissionSuccess;
            m_objectives.Add(destroySolarDefence);
            destroySolarDefence.OnMissionLoaded += destroySolarDefence_OnMissionLoaded;

            //03
            m_destroySolarPanelsFirst = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF1_Name),
                MyMissionID.EAC_PRISON_SOLAROFF1,
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF1_Description),
                null,
                this,
                new MyMissionID[] {MyMissionID.EAC_PRISON_SOLARDEF},
                null
                ) {SaveOnSuccess = false};
            m_destroySolarPanelsFirst.OnMissionLoaded += DestroySolarPanelsFirstSubmissionLoaded;
            m_destroySolarPanelsFirst.OnMissionSuccess += DestroySolarPanelsFirstSubmissionSuccess;
            m_objectives.Add(m_destroySolarPanelsFirst);
            m_destroySolarPanelsFirst.SaveOnSuccess = true;

            //04
            var motherShipHelp = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_MOTHERSHIPHELP_Name),
                MyMissionID.EAC_PRISON_MOTHERSHIPHELP,
                (MyTextsWrapperEnum.EAC_PRISON_MOTHERSHIPHELP_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_SOLAROFF1 },
                m_04toKill
            ) { SaveOnSuccess = false, StartDialogId = MyDialogueEnum.EAC_PRISON_0400, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0500};
            m_objectives.Add(motherShipHelp);
            motherShipHelp.OnMissionLoaded += new MissionHandler(motherShipHelp_OnMissionLoaded);

                        //05
            m_destroySolarPanelsSecond = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF2_Name),
                MyMissionID.EAC_PRISON_SOLAROFF2,
                (MyTextsWrapperEnum.EAC_PRISON_SOLAROFF2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MOTHERSHIPHELP },
                null
            ) { SaveOnSuccess = true,};
            m_destroySolarPanelsSecond.OnMissionLoaded += DestroySolarPanelsSecondSubmissionLoaded;
            m_destroySolarPanelsSecond.OnMissionSuccess += DestroySolarPanelsSecondSubmissionSuccess;
            m_objectives.Add(m_destroySolarPanelsSecond);
            
            //06
            var breakInsideStation = new MyTimedReachLocationObjective(
               (MyTextsWrapperEnum.EAC_PRISON_BREAKIN_Name),
               MyMissionID.EAC_PRISON_BREAKIN,
               (MyTextsWrapperEnum.EAC_PRISON_BREAKIN_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.EAC_PRISON_SOLAROFF2 },
               new System.TimeSpan(0, 1, 0),
               new MyMissionLocation(baseSector,(uint) EntityID.BreakInsideStationLocationDummy)
           ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0600, HudName = MyTextsWrapperEnum.HudCargoBay };
            breakInsideStation.OnMissionSuccess += BreakInsideStationSubmissionSuccess;
            breakInsideStation.OnMissionLoaded += BreakInsideStationOnOnMissionLoaded;
            m_objectives.Add(breakInsideStation);
            
            //07
            var marcusLocationIntel = new MyUseObjective(
                   (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL_Name),
                   MyMissionID.EAC_PRISON_LOCINTEL,
                   (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL_Description),
                   null,
                   this,
                   new MyMissionID[] { MyMissionID.EAC_PRISON_BREAKIN },
                   new MyMissionLocation(baseSector, (uint)EntityID._MarcusIntelLocation),
                   MyTextsWrapperEnum.PressToDownloadData,
                   MyTextsWrapperEnum.Console,
                   MyTextsWrapperEnum.DownloadingData,
                   5000,
                   MyUseObjectiveType.Hacking
                ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudSecurityHub };

            m_objectives.Add(marcusLocationIntel);
            marcusLocationIntel.OnMissionLoaded += new MissionHandler(marcusLocationIntel_OnMissionLoaded);
            marcusLocationIntel.OnMissionSuccess += MarcusLocationIntelOnOnMissionSuccess;
            marcusLocationIntel.Components.Add(new MySpawnpointLimiter(m_spawns, 6));
            
            //08
            m_findCircoutPart = new MyUseObjective(
                    (MyTextsWrapperEnum.EAC_PRISON_ACQUIREIDCARD_Name),
                    MyMissionID.EAC_PRISON_ACQUIREIDCARD,
                    (MyTextsWrapperEnum.EAC_PRISON_ACQUIREIDCARD_Description),
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.EAC_PRISON_LOCINTEL},
                    new MyMissionLocation(baseSector, (uint)EntityID.CargoIDCard),
                    MyTextsWrapperEnum.PressToTakeCargo,
                    MyTextsWrapperEnum.TakeAll,
                    MyTextsWrapperEnum.TakeAll,
                    2000,
                    MyUseObjectiveType.Taking,
                    radiusOverride: 50
            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_0700, HudName = MyTextsWrapperEnum.HudIdCard };

            m_findCircoutPart.OnMissionLoaded += OnFindCircuitLoaded;
            m_findCircoutPart.OnMissionSuccess += new MissionHandler(m_findCircoutPart_OnMissionSuccess);
            m_objectives.Add(m_findCircoutPart);


            var marcusLocationIntel2 = new MyUseObjective(
               (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL2_Name),
               MyMissionID.EAC_PRISON_LOCINTEL2,
               (MyTextsWrapperEnum.EAC_PRISON_LOCINTEL2_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.EAC_PRISON_ACQUIREIDCARD },
               new MyMissionLocation(baseSector, (uint)EntityID._MarcusIntelLocation),
               MyTextsWrapperEnum.PressToDownloadData,
               MyTextsWrapperEnum.Console,
               MyTextsWrapperEnum.DownloadingData,
               5000,
               MyUseObjectiveType.Hacking
            ) { SaveOnSuccess = true, SuccessDialogId = MyDialogueEnum.EAC_PRISON_0900, StartDialogId = MyDialogueEnum.EAC_PRISON_0800, HudName = MyTextsWrapperEnum.HudSecurityHub };

            m_objectives.Add(marcusLocationIntel2);
            
            //09
            var openDoors = new MyObjectiveEnablePrefabs(
                (MyTextsWrapperEnum.EAC_PRISON_OPENACCESS_Name),
                MyMissionID.EAC_PRISON_OPENACCESS,
                (MyTextsWrapperEnum.EAC_PRISON_OPENACCESS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_LOCINTEL2 },
                null,
                new List<uint> {(int)EntityID.SecurityHub},
                m_09toEnablePrefabs
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudSecurityHub };
            m_objectives.Add(openDoors);

            openDoors.OnMissionLoaded += OnOpenDoorsLoaded;
            
            //10
            var takeOffSecurityCircuit = new MyObjectiveDisablePrefabs(
              (MyTextsWrapperEnum.EAC_PRISON_SECURITYOFF_Name),
              MyMissionID.EAC_PRISON_SECURITYOFF,
              (MyTextsWrapperEnum.EAC_PRISON_SECURITYOFF_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_OPENACCESS },
                new List<uint> { (uint)EntityID.HubHack },
                new List<uint> { (uint)EntityID.HubHackGenerator },
                false,
                false
            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1000, HudName = MyTextsWrapperEnum.HudHub };

            takeOffSecurityCircuit.OnMissionLoaded += OntakeOffSecuritypartLoaded;//zapne svetlo
            m_objectives.Add(takeOffSecurityCircuit);
            
            //11
            var approachMarcusCell = new MyUseObjective(
                (MyTextsWrapperEnum.EAC_PRISON_MARCUSCELL_Name),
               MyMissionID.EAC_PRISON_MARCUSCELL,
               (MyTextsWrapperEnum.EAC_PRISON_MARCUSCELL_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.EAC_PRISON_SECURITYOFF },
               new MyMissionLocation(baseSector, (uint)EntityID.MarcusCellLocation),
               MyTextsWrapperEnum.HoldToMoveMarcus,
               MyTextsWrapperEnum.Actor_Marcus,
               MyTextsWrapperEnum.Moving,
               4000,
               MyUseObjectiveType.Taking
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudMarcus };
            approachMarcusCell.OnMissionLoaded += OnapproachMarcusLoaded;
            m_objectives.Add(approachMarcusCell);

            var marcusLoaded = new MyObjectiveDialog(
                MyMissionID.EAC_PRISON_MARCUSDIALOG,
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MARCUSCELL },
                MyDialogueEnum.EAC_PRISON_1200
            ) { SaveOnSuccess = true };
            marcusLoaded.OnMissionLoaded += OnMarcusLoadedLoaded;
            m_objectives.Add(marcusLoaded);

            var weHaveCompany = new MyObjectiveDialog(
                MyMissionID.EAC_PRISON_WE_HAVE_COMPANY,
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_MARCUSDIALOG },
                MyDialogueEnum.EAC_PRISON_1250
            ) { SaveOnSuccess = false };
            weHaveCompany.OnMissionLoaded += OnWeHaveCompanyLoaded;
            m_objectives.Add(weHaveCompany);

            //12
            var findMarcusSmallShip = new MyUseObjective(
             (MyTextsWrapperEnum.EAC_PRISON_COVERMARCUS_Name),
             MyMissionID.EAC_PRISON_COVERMARCUS,
             (MyTextsWrapperEnum.EAC_PRISON_COVERMARCUS_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.EAC_PRISON_WE_HAVE_COMPANY },
               new MyMissionLocation(baseSector, (uint)EntityID.MarcusShipDetector),
               MyTextsWrapperEnum.HoldToMoveMarcus,
               MyTextsWrapperEnum.Actor_Marcus,
               MyTextsWrapperEnum.Moving,
               4000,
               MyUseObjectiveType.Putting
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudShip };

            // destroySolarDefence.OnMissionSuccess += ToHangarSubmissionSuccess;
            m_objectives.Add(findMarcusSmallShip);
            findMarcusSmallShip.OnMissionSuccess += OnSuccesfindMarcusSmallShip;

            //13
            var equipMarcus = new MyUseObjective(
             (MyTextsWrapperEnum.EAC_PRISON_GETARMS_Name),
             MyMissionID.EAC_PRISON_GETARMS,
             (MyTextsWrapperEnum.EAC_PRISON_GETARMS_Description),
                   null,
                   this,
                   new MyMissionID[] { MyMissionID.EAC_PRISON_COVERMARCUS },
                   new MyMissionLocation(baseSector, (uint)EntityID.CargoForMarcus),
                   MyTextsWrapperEnum.HoldToMoveWeapons,
                   MyTextsWrapperEnum.Actor_Marcus,
                   MyTextsWrapperEnum.Moving,
                   4000
             ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudEquipment };

            // destroySolarDefence.OnMissionSuccess += ToHangarSubmissionSuccess;
            m_objectives.Add(equipMarcus);
            equipMarcus.OnMissionSuccess += OnEquipMarcussSucces;
            equipMarcus.OnMissionLoaded += EquipMarcusOnOnMissionLoaded;

            //14
            var fightOutStation = new MyObjective(
                    (MyTextsWrapperEnum.EAC_PRISON_FIGHTOUT_Name),
                MyMissionID.EAC_PRISON_FIGHTOUT,
                (MyTextsWrapperEnum.EAC_PRISON_FIGHTOUT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_GETARMS },
                new MyMissionLocation(baseSector, (uint)EntityID.StationDummy)
            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1300, SuccessDialogId = MyDialogueEnum.EAC_PRISON_1400, HudName = MyTextsWrapperEnum.Nothing };
            fightOutStation.OnMissionLoaded += fightOutStation_OnMissionLoaded;
            fightOutStation.OnMissionSuccess += fightOutStation_OnMissionSuccess;
            m_objectives.Add(fightOutStation);

            //15
            var CrushRemainingShips = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.EAC_PRISON_CRUSHREINFORCEMENTS_Name),
                MyMissionID.EAC_PRISON_CRUSHREINFORCEMENTS,
                (MyTextsWrapperEnum.EAC_PRISON_CRUSHREINFORCEMENTS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_FIGHTOUT },
                new List<uint> { },         // entities needed to kill
                m_15toKillSpawnpoints,  // spawnpoint from which bots must be killed
                false                       // don't show marks on entities (not from spawnpoint)
            ) { SaveOnSuccess = true, };
            m_objectives.Add(CrushRemainingShips);
            
            //16
            var GetToMeetingPoint = new MyObjective(
                (MyTextsWrapperEnum.EAC_PRISON_MEETINGPOINT_Name),
                MyMissionID.EAC_PRISON_MEETINGPOINT,
                (MyTextsWrapperEnum.EAC_PRISON_MEETINGPOINT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.EAC_PRISON_CRUSHREINFORCEMENTS },
                new MyMissionLocation(baseSector, MyMissionLocation.MADELYN_HANGAR),
                radiusOverride: MyMissionLocation.MADELYN_HANGAR_RADIUS
              ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.EAC_PRISON_1500, SuccessDialogId = MyDialogueEnum.EAC_PRISON_1600, HudName = MyTextsWrapperEnum.HudMeetingPoint };
            m_objectives.Add(GetToMeetingPoint);
            
        }