public MyRimeConvinceMission()
        {
            ID          = MyMissionID.RIME_CONVINCE;    /* ID must be added to MyMissions.cs */
            DebugName   = new StringBuilder("10-Rime"); // Name of mission
            Name        = MyTextsWrapperEnum.RIME_CONVINCE;
            Description = MyTextsWrapperEnum.RIME_CONVINCE_Description;
            Flags       = MyMissionFlags.Story;

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

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

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

            m_objectives   = new List <MyObjective>(); // Creating of list of submissions
            RequiredActors = new MyActorEnum[] { MyActorEnum.MADELYN, MyActorEnum.MARCUS, MyActorEnum.TARJA, MyActorEnum.VALENTIN };

            var introduction = new MyObjectiveDialog(
                MyMissionID.RIME_CONVINCE_INTRODUCTION,
                null,
                this,
                new MyMissionID[] { },
                dialogId: MyDialogueEnum.RIME_0100_INTRODUCTION
                )
            {
                SaveOnSuccess = true
            };

            m_objectives.Add(introduction);

            m_01MeetReef = new MyMeetObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_GET_FRANCIS_REEF_Name),
                MyMissionID.RIME_CONVINCE_GET_FRANCIS_REEF,
                (MyTextsWrapperEnum.RIME_CONVINCE_GET_FRANCIS_REEF_Description),
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_INTRODUCTION },
                null,
                (uint)EntityID.FrancisReef,
                distanceToTalk: 300,
                slowdown: 0.25f,
                startDialogueId: MyDialogueEnum.RIME_0150_HEAD_TO_REEF,
                successDialogueId: MyDialogueEnum.RIME_0200_REEF_REACHED
                )
            {
                SaveOnSuccess = false, FollowMe = false
            };
            m_objectives.Add(m_01MeetReef);
            m_01MeetReef.OnMissionLoaded += M01MeetReefOnOnMissionLoaded;

            m_02TalkToReef = new MyObjectiveDialog(
                MyTextsWrapperEnum.Null,
                MyMissionID.RIME_CONVINCE_TALK_FRANCIS_REEF,
                MyTextsWrapperEnum.Null,
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_GET_FRANCIS_REEF },
                dialogId: MyDialogueEnum.RIME_0300_TALK_TO_REEF
                )
            {
                SaveOnSuccess = true
            };
            m_objectives.Add(m_02TalkToReef);
            m_02TalkToReef.OnMissionLoaded  += M02TalkToReefOnOnMissionLoaded;
            m_02TalkToReef.OnMissionSuccess += M02TalkToReefOnOnMissionSuccess;

            m_05FlyToDuplex = new MyObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_GO_TO_DUPLEX_Name),
                MyMissionID.RIME_CONVINCE_GO_TO_DUPLEX,
                (MyTextsWrapperEnum.RIME_CONVINCE_GO_TO_DUPLEX_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_TALK_FRANCIS_REEF },
                new MyMissionLocation(baseSector, (uint)EntityID.FlyToDummy),
                //startDialogId: MyDialogueEnum.RIME_0400_ON_THE_WAY,
                successDialogId: MyDialogueEnum.RIME_0500_LISTEN_TO_SUSPICIOUS
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudDuplex
            };
            m_objectives.Add(m_05FlyToDuplex);

            MyObjectiveDialog clientsTalk = new MyObjectiveDialog(
                MyMissionID.RIME_CONVINCE_CLIENTS_TALK,
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_GO_TO_DUPLEX },
                dialogId: MyDialogueEnum.RIME_0600_CLIENTS_TALK);

            clientsTalk.OnMissionLoaded += delegate
            {
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointClient1);
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointClient2);
            };
            m_objectives.Add(clientsTalk);

            MyObjectiveDialog bouncerTalk = new MyObjectiveDialog(
                MyMissionID.RIME_CONVINCE_DUPLEX_BOUNCER,
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_CLIENTS_TALK },
                dialogId: MyDialogueEnum.RIME_0700_DUPLEX_BOUNCER);

            bouncerTalk.OnMissionLoaded += delegate
            {
                MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointBouncer);
            };
            bouncerTalk.OnMissionSuccess += delegate
            {
                MySmallShipBot bouncer = MyScriptWrapper.TryGetEntity("Bouncer") as MySmallShipBot;
                if (bouncer != null)
                {
                    bouncer.LookTarget     = null;
                    m_barkeeper.LookTarget = null;
                    bouncer.SetWaypointPath("Client1");
                    bouncer.PatrolMode = MyPatrolMode.ONE_WAY;
                    bouncer.Patrol();
                }
            };
            m_objectives.Add(bouncerTalk);

            var returnBack = new MyObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_RETURN_TO_POSITION_Name),
                MyMissionID.RIME_CONVINCE_RETURN_TO_POSITION,
                (MyTextsWrapperEnum.RIME_CONVINCE_RETURN_TO_POSITION_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_DUPLEX_BOUNCER },
                new MyMissionLocation(baseSector, (uint)EntityID.FlyToDummy))
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.Nothing
            };

            returnBack.OnMissionSuccess += ReturnBackOnMissionSuccess;
            m_objectives.Add(returnBack);

            MyObjectiveDialog contactAppears = new MyObjectiveDialog(
                MyTextsWrapperEnum.RIME_CONVINCE_CONTACT_APPEARS_Name,
                MyMissionID.RIME_CONVINCE_CONTACT_APPEARS,
                MyTextsWrapperEnum.RIME_CONVINCE_CONTACT_APPEARS_Description,
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_RETURN_TO_POSITION },
                dialogId: MyDialogueEnum.RIME_0800_CONTACT_APPEARS);

            contactAppears.OnMissionSuccess += delegate
            {
                MySmallShipBot mitchel = (MySmallShipBot)MyScriptWrapper.GetEntity("Mitchel");
                mitchel.SetWaypointPath("Follow1");
                mitchel.PatrolMode = MyPatrolMode.ONE_WAY;
                mitchel.Patrol();
                m_07followContact.TargetId = mitchel.EntityId.Value.NumericValue;
            };
            m_objectives.Add(contactAppears);

            m_07followContact = new MyObjectiveFollowBot(
                (MyTextsWrapperEnum.RIME_CONVINCE_FOLLOW_CONTACT_Name),
                MyMissionID.RIME_CONVINCE_FOLLOW_CONTACT,
                (MyTextsWrapperEnum.RIME_CONVINCE_FOLLOW_CONTACT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_CONTACT_APPEARS },
                null,
                (uint)EntityID.FactoryFound,
                MyDialogueEnum.RIME_0900_FOLLOW_INSTRUCTION)
            {
                FarDialog     = MyDialogueEnum.RIME_2100_HE_IS_GONE,
                ShortDialog   = MyDialogueEnum.RIME_2200_HE_SPOTTED_US,
                SaveOnSuccess = true,
                HudName       = MyTextsWrapperEnum.HudFollow
            };
            m_objectives.Add(m_07followContact);

            var factoryFoundDialogue = new MyObjectiveDialog(
                (MyTextsWrapperEnum.RIME_CONVINCE_FACTORY_FOUND_DIALOGUE_Name),
                MyMissionID.RIME_CONVINCE_FACTORY_FOUND_DIALOGUE,
                (MyTextsWrapperEnum.RIME_CONVINCE_FACTORY_FOUND_DIALOGUE_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_FOLLOW_CONTACT },
                dialogId: MyDialogueEnum.RIME_1000_FACTORY_FOUND
                )
            {
                SaveOnSuccess = true
            };

            m_objectives.Add(factoryFoundDialogue);

            var destroyFactoryBots = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.RIME_CONVINCE_DESTROY_FACTORY_BOTS_Name),
                MyMissionID.RIME_CONVINCE_DESTROY_FACTORY_BOTS,
                (MyTextsWrapperEnum.RIME_CONVINCE_DESTROY_FACTORY_BOTS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_FACTORY_FOUND_DIALOGUE },
                null,
                m_factorySpawns
                //startDialogID: MyDialogueEnum.RIME_1100_WE_GOT_YOUR_BACK
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.Nothing
            };

            destroyFactoryBots.OnMissionLoaded += DestroyFactoryBotsLoaded;
            m_objectives.Add(destroyFactoryBots);

            m_08CollectIllegalCargo = new MyMultipleUseObjective
                                          ((MyTextsWrapperEnum.RIME_CONVINCE_COLLECT_CARGO_Name),
                                          MyMissionID.RIME_CONVINCE_COLLECT_CARGO,
                                          (MyTextsWrapperEnum.RIME_CONVINCE_COLLECT_CARGO_Description),
                                          null,
                                          this,
                                          new MyMissionID[] { MyMissionID.RIME_CONVINCE_DESTROY_FACTORY_BOTS },
                                          MyTextsWrapperEnum.PressToCollectCargo,
                                          MyTextsWrapperEnum.IllegalCargo,
                                          MyTextsWrapperEnum.TakingInProgress,
                                          2000,
                                          m_boxes,
                                          MyUseObjectiveType.Taking
                                          )
            {
                RadiusOverride = 70f, SaveOnSuccess = true, StartDialogId = MyDialogueEnum.RIME_1100_GRAB_THE_ALCOHOL
            };
            m_objectives.Add(m_08CollectIllegalCargo);
            m_08CollectIllegalCargo.OnMissionLoaded    += M08CollectIllegalCargoOnOnMissionLoaded;
            m_08CollectIllegalCargo.OnObjectUsedSucces += M08CollectIllegalCargoOnOnObjectUsedSucces;
            m_08CollectIllegalCargo.OnMissionSuccess   += M08CollectIllegalCargoOnOnMissionSuccess;

            var cargoCollectedDialogue = new MyObjectiveDialog(
                (MyTextsWrapperEnum.RIME_CONVINCE_CARGO_COLLECTED_DIALOG_Name),
                MyMissionID.RIME_CONVINCE_CARGO_COLLECTED_DIALOG,
                (MyTextsWrapperEnum.RIME_CONVINCE_CARGO_COLLECTED_DIALOG_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_COLLECT_CARGO },
                dialogId: MyDialogueEnum.RIME_1200_GET_TO_THE_VESSEL
                )
            {
                SaveOnSuccess = true
            };

            m_objectives.Add(cargoCollectedDialogue);

            var flyToVessel = new MyObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_FLY_TO_VESSEL_Name),
                MyMissionID.RIME_CONVINCE_FLY_TO_VESSEL,
                (MyTextsWrapperEnum.RIME_CONVINCE_FLY_TO_VESSEL_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_CARGO_COLLECTED_DIALOG },
                new MyMissionLocation(baseSector, (uint)EntityID.FlyToVessel),
                startDialogId: MyDialogueEnum.RIME_1300_ON_THE_WAY_TO_VESSEL
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudRaynoldsVessel
            };

            m_objectives.Add(flyToVessel);
            flyToVessel.OnMissionLoaded += FlyToVesselLoaded;

            m_waitForTheMoment = new MyObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_WAIT_FOR_THE_MOMENT_Name),
                MyMissionID.RIME_CONVINCE_WAIT_FOR_THE_MOMENT,
                (MyTextsWrapperEnum.RIME_CONVINCE_WAIT_FOR_THE_MOMENT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_FLY_TO_VESSEL },
                null,
                startDialogId: MyDialogueEnum.RIME_1500_WAIT_FOR_THE_SIGNAL,
                successDialogId: MyDialogueEnum.RIME_1600_THIS_IS_OUR_CHANCE)
            {
                SaveOnSuccess = true
            };
            m_objectives.Add(m_waitForTheMoment);
            m_waitForTheMoment.OnMissionLoaded  += WaitForTheMomentLoaded;
            m_waitForTheMoment.OnMissionUpdate  += WaitForTheMomentUpdate;
            m_waitForTheMoment.OnMissionCleanUp += new MissionHandler(m_waitForTheMoment_OnMissionCleanUp);

            m_09plantcargo = new MyMultipleUseObjective
                                 ((MyTextsWrapperEnum.RIME_CONVINCE_PLANT_CARGO_Name),
                                 MyMissionID.RIME_CONVINCE_PLANT_CARGO,
                                 (MyTextsWrapperEnum.RIME_CONVINCE_PLANT_CARGO_Description),
                                 null,
                                 this,
                                 new MyMissionID[] { MyMissionID.RIME_CONVINCE_WAIT_FOR_THE_MOMENT },
                                 MyTextsWrapperEnum.HoldToPlantCargo,
                                 MyTextsWrapperEnum.IllegalCargo,
                                 MyTextsWrapperEnum.PlantingInProgress,
                                 2000,
                                 m_plantBoxes,
                                 MyUseObjectiveType.Taking,
                                 startDialogId: MyDialogueEnum.RIME_1650_PLACE
                                 )
            {
                RadiusOverride = 60f, SaveOnSuccess = true
            };
            m_objectives.Add(m_09plantcargo);
            m_09plantcargo.OnMissionLoaded    += M09PlantcargoOnOnMissionLoaded;
            m_09plantcargo.OnMissionSuccess   += M09PlantcargoOnOnMissionSuccess;
            m_09plantcargo.OnObjectUsedSucces += M09PlantcargoOnOnObjectUsedSucces;

            var getOutOfTheVessel = new MyObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_GET_OUT_OF_THE_VESSEL_Name),
                MyMissionID.RIME_CONVINCE_GET_OUT_OF_THE_VESSEL,
                (MyTextsWrapperEnum.RIME_CONVINCE_GET_OUT_OF_THE_VESSEL_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_PLANT_CARGO },
                new MyMissionLocation(baseSector, (uint)EntityID.FlyToVessel)
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.Nothing
            };

            m_objectives.Add(getOutOfTheVessel);
            getOutOfTheVessel.OnMissionLoaded  += GetOutOfTheVesselLoaded;
            getOutOfTheVessel.OnMissionSuccess += GetOutOfTheVesselSuccess;

            /*
             * var cargoPlantedObjectiveDialogue = new MyObjectiveDialog(
             * new StringBuilder("Listen to the conversation"),
             * MyMissionID.RIME_CONVINCE_CARGO_PLANTED_OBJECTIVE_DIALOGUE,
             * new StringBuilder(""),
             * null,
             * this,
             * new MyMissionID[] { MyMissionID.RIME_CONVINCE_GET_OUT_OF_THE_VESSEL },
             * dialogId: MyDialogueEnum.RIME_1800_CARGO_PLANTED
             * ) { SaveOnSuccess = true };
             * m_objectives.Add(cargoPlantedObjectiveDialogue);
             */
            m_10MeetReef = new MyMeetObjective(
                (MyTextsWrapperEnum.RIME_CONVINCE_GO_BACK_TO_FRANCIS_Name),
                MyMissionID.RIME_CONVINCE_GO_BACK_TO_FRANCIS,
                (MyTextsWrapperEnum.RIME_CONVINCE_GO_BACK_TO_FRANCIS_Description),
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_GET_OUT_OF_THE_VESSEL },
                null,
                (uint)EntityID.FrancisReef,
                100,
                0.25f,
                null,
                startDialogueId: MyDialogueEnum.RIME_1800_CARGO_PLANTED
                )
            {
                SaveOnSuccess = false, FollowMe = false
            };
            m_objectives.Add(m_10MeetReef);
            //m_01MeetReef.OnMissionLoaded += M01MeetReefOnOnMissionLoaded;

            m_11TalkToReef = new MyObjectiveDialog(
                MyMissionID.RIME_CONVINCE_TALK_TO_FRANCIS,
                null,
                this,
                new MyMissionID[] { MyMissionID.RIME_CONVINCE_GO_BACK_TO_FRANCIS },
                dialogId: MyDialogueEnum.RIME_2000_REEF_TALK
                )
            {
                SaveOnSuccess = false
            };
            m_objectives.Add(m_11TalkToReef);
            m_11TalkToReef.OnMissionLoaded  += M11TalkToReefOnOnMissionLoaded;
            m_11TalkToReef.OnMissionSuccess += M11TalkToReefOnOnMissionSuccess;
        }
        public MyBarthsMoonTransmitterMission()
            : base(
            MyMissionID.BARTHS_MOON_TRANSMITTER,
            new StringBuilder("06-Barth's moon transmitter"),
            MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER,
            MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_Description,
            new MyMissionID[] { MyMissionID.RUSSIAN_WAREHOUSE },
            new EntityID[] { },
            EntityID.PlayerStartLocationTransmitter)
        {
            m_objectives = new List<MyObjective>();
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_RETURN_BACK_TO_MADELYN };
            RequiredActors = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN };
            RequiredMissions = new MyMissionID[] { MyMissionID.RUSSIAN_WAREHOUSE };

            Components.Add(new MySpawnpointWaves((uint)EntityID.EnterMainLabDetector, 0,
                new List<uint[]> { new List<uint> { (uint)EntityID.SpawnPoint3 }.ToArray(), new List<uint> { (uint)EntityID.SpawnPoint4 }.ToArray() }));

            #region Objectives
            var meetThomasBarth = new MyObjective(
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_MEET_BARTH_Name),
                    MyMissionID.BARTHS_MOON_TRANSMITTER_MEET_BARTH,
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_MEET_BARTH_Description),
                    null,
                    this,
                    new MyMissionID[] { },
                    new MyMissionLocation(baseSector, (uint)EntityID.ThomasBartId),
                    radiusOverride: 50
                    ) { SaveOnSuccess = false, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0100_INTRO, HudName = MyTextsWrapperEnum.HudBarth };
            meetThomasBarth.OnMissionLoaded += MeetThomasBarthOnLoaded;
            m_objectives.Add(meetThomasBarth);


            m_talkWithThomasBarth = new MyBarthsMoonSubmissionTalkWithThomasBarth(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_TALK_TO_BARTH_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_TALK_TO_BARTH,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_TALK_TO_BARTH_Description),
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_MEET_BARTH },
                null,
                true
                ) { SaveOnSuccess = true, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0300 };
            m_objectives.Add(m_talkWithThomasBarth);


            //02
            m_findWayToMoon = new MyObjective(
                 (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_WAY_TO_MOON_Name),
                 MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_WAY_TO_MOON,
                 (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_WAY_TO_MOON_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_TALK_TO_BARTH },
                 new MyMissionLocation(baseSector, (uint)EntityID.BrokenMoonDummy),
                 null,
                 null,
                 MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0400
                 ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudBrokenMoon };
            m_objectives.Add(m_findWayToMoon);

            //03
            var destroyLaboratories = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DESTROY_LAB_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_DESTROY_LAB,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DESTROY_LAB_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_WAY_TO_MOON },
                new List<uint> { },         // entities needed to kill
                new List<uint> { },  // spawnpoint from which bots must be killed
                true,
                false // dont count 
                ) { SaveOnSuccess = true };
            destroyLaboratories.OnMissionLoaded += destroyLaboratories_OnMissionLoaded;
            destroyLaboratories.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog5DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0500));
            destroyLaboratories.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog6DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0600));
            m_objectives.Add(destroyLaboratories);

            //04


            var enableGenerator = new MyUseObjective(
                       (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_Name),
                   MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR,
                   (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_Description),
                   null,
                   this,
                   new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DESTROY_LAB },
                   new MyMissionLocation(baseSector, (uint)EntityID.SecurityHubDummy),
                   MyTextsWrapperEnum.PressToStartGenerator,
                   MyTextsWrapperEnum.Generator,
                   MyTextsWrapperEnum.StartingProgress,
                   5000,
                   MyUseObjectiveType.Activating
                   ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudGenerator, ShowNavigationMark = true };
            enableGenerator.OnMissionSuccess += EnableGeneratorOnOnMissionSuccess;
            m_objectives.Add(enableGenerator);
            


            //05
            m_lookBothHubs = new MyObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_LOOK_HUBS_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_LOOK_HUBS,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_LOOK_HUBS_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR },
                null,
                new List<uint> { (uint)EntityID.SecurityHubLook1 },
                null
                ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudHub, MarkMissionEntities = true };
            m_objectives.Add(m_lookBothHubs);


            //06
            var getItemsFromCargoBoxes = new MyObjectiveGetItems(
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_GET_ITEMS_Name),
                    MyMissionID.BARTHS_MOON_TRANSMITTER_GET_ITEMS,
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_GET_ITEMS_Description),
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_LOOK_HUBS },
                    new List<MyItemToGetDefinition>() { new MyItemToGetDefinition(MyMwcObjectBuilderTypeEnum.Drone, (int)MyMwcObjectBuilder_Drone_TypesEnum.DroneUS),
                    new MyItemToGetDefinition(MyMwcObjectBuilderTypeEnum.SmallShip_HackingTool, (int)MyMwcObjectBuilder_SmallShip_HackingTool_TypesEnum.Level_3)},
                    new List<uint>() { (uint)EntityID.Cargobox1, (uint)EntityID.Cargobox2 }
                    ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0700, MarkMissionEntities = true };
            m_objectives.Add(getItemsFromCargoBoxes);




            var findFans = new MyObjective(
                 (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FAN_Name),
                 MyMissionID.BARTHS_MOON_TRANSMITTER_FAN,
                 (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FAN_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_GET_ITEMS },
                 new MyMissionLocation(baseSector, (uint)EntityID.FanDummy)
                 ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0800, HudName = MyTextsWrapperEnum.HudEntrance };
            m_objectives.Add(findFans);


            m_learnToUseDrones = new MyObjective(
                     (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DRONES_Name),
                     MyMissionID.BARTHS_MOON_TRANSMITTER_DRONES,
                     (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DRONES_Description),
                     null,
                     this,
                     new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_FAN },
                     null
                     ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_0900 };
            m_objectives.Add(m_learnToUseDrones);

            m_learnToUseDrones.OnMissionLoaded += LearnDronesOnOnMissionLoaded;
            m_learnToUseDrones.OnMissionSuccess += LearnDronesOnOnMissionSuccess;



            //07
            m_enableGeneratorWithDrone1Mission = new MyUseObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE1_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE1,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DRONES },
                new MyMissionLocation(baseSector, (uint)EntityID.DroneGeneratroHub1),
                MyTextsWrapperEnum.PressToStartGenerator,
                MyTextsWrapperEnum.Generator,
                MyTextsWrapperEnum.StartingProgress,
                5000,
                radiusOverride: 50
                ) { SaveOnSuccess = true, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1100, HudName = MyTextsWrapperEnum.HudHub };

            m_enableGeneratorWithDrone1Mission.RequiresDrone = true;
            m_enableGeneratorWithDrone1Mission.OnMissionSuccess += EnableGeneratorWithDrone1OnOnMissionSuccess;
            m_enableGeneratorWithDrone1Mission.OnMissionLoaded += EnsureDronesInShip;
            m_enableGeneratorWithDrone1Mission.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog10DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1000));
            m_objectives.Add(m_enableGeneratorWithDrone1Mission);

            m_enableGeneratorWithDrone2Mission = new MyUseObjective(
                       (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE2_Name),
                       MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE2,
                       (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE2_Description),
                       null,
                       this,
                       new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE1 },
                       new MyMissionLocation(baseSector, (uint)EntityID.DroneGeneratroHub2),
                       MyTextsWrapperEnum.PressToStartGenerator,
                       MyTextsWrapperEnum.Generator,
                       MyTextsWrapperEnum.StartingProgress,
                       5000,
                       radiusOverride: 50
                       ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1200, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1400, RequiresDrone = true, HudName = MyTextsWrapperEnum.HudHub };
            m_enableGeneratorWithDrone2Mission.OnMissionSuccess += EnableGeneratorWithDrone2OnOnMissionSuccess;
            m_enableGeneratorWithDrone2Mission.OnMissionLoaded += EnsureDronesInShip;
            m_enableGeneratorWithDrone2Mission.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog13DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1300));
            m_objectives.Add(m_enableGeneratorWithDrone2Mission);

            //05
            m_lookBothHubs2 = new MyObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_LOOK_HUBS2_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_LOOK_HUBS2,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_LOOK_HUBS2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_ENABLE_GENERATOR_DRONE2 },
                null,
                new List<uint> { (uint)EntityID.SecurityHubLook2 }
                ) { SaveOnSuccess = true, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1500, HudName = MyTextsWrapperEnum.HudHub, ShowNavigationMark = true };
            m_objectives.Add(m_lookBothHubs2);

            //08


            var downloadData1 = new MyUseObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA1_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA1,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_LOOK_HUBS2 },
                new MyMissionLocation(baseSector, (uint)EntityID.Hub1Dummy),
                MyTextsWrapperEnum.PressToDownloadData,
                MyTextsWrapperEnum.Console,
                MyTextsWrapperEnum.DownloadingData,
                3000,
                MyUseObjectiveType.Activating,
                null) { HudName = MyTextsWrapperEnum.HudHub };
            downloadData1.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog17DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1700));
            m_objectives.Add(downloadData1);

            var downloadData2 = new MyUseObjective(
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA2_Name),
                    MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA2,
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA2_Description),
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA1 },
                    new MyMissionLocation(baseSector, (uint)EntityID.Hub2Dummy),
                    MyTextsWrapperEnum.PressToDownloadData,
                    MyTextsWrapperEnum.Console,
                    MyTextsWrapperEnum.DownloadingData,
                    3000,
                    MyUseObjectiveType.Hacking,
                    null) { SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1800, HudName = MyTextsWrapperEnum.HudHub };
            m_objectives.Add(downloadData2);

            var downloadData3 = new MyUseObjective(
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA3_Name),
                    MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA3,
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA3_Description),
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA2 },
                    new MyMissionLocation(baseSector, (uint)EntityID.Hub3Dummy),
                    MyTextsWrapperEnum.PressToDownloadData,
                    MyTextsWrapperEnum.Console,
                    MyTextsWrapperEnum.DownloadingData,
                    3000,
                    MyUseObjectiveType.Hacking,
                    null) { SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2000, HudName = MyTextsWrapperEnum.HudHub };
            downloadData3.RequiresDrone = true;
            downloadData3.OnMissionLoaded += DownloadData3OnOnMissionLoaded;
            downloadData3.OnMissionSuccess += DownloadData3OnOnMissionSuccess;
            downloadData3.Components.Add(new MyDetectorDialogue((uint)EntityID.Dialog19DetectorId, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_1900));
            m_objectives.Add(downloadData3);

            var downloadData4 = new MyUseObjective(
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA4_Name),
                    MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA4,
                    (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA4_Description),
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA3 },
                    new MyMissionLocation(baseSector, (uint)EntityID.Hub4Dummy),
                    MyTextsWrapperEnum.PressToDownloadData,
                    MyTextsWrapperEnum.Console,
                    MyTextsWrapperEnum.DownloadingData,
                    3000) { HudName = MyTextsWrapperEnum.HudHub };
            downloadData4.OnMissionLoaded += EnsureDronesInShip;
            m_objectives.Add(downloadData4);

            var entermainLab = new MyObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENTER_MAINLAB_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_ENTER_MAINLAB,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_ENTER_MAINLAB_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DOWNLOAD_DATA4 },
                new MyMissionLocation(baseSector, (uint)EntityID.EnterMainLabDummy)
                ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2100, HudName = MyTextsWrapperEnum.HudLab };
            entermainLab.OnMissionSuccess += EntermainLabOnOnMissionSuccess;
            m_objectives.Add(entermainLab);


            //10
            m_destroyComputer = new MyObjectiveDestroy(
               (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DESTROY_COMPUTER_Name),
               MyMissionID.BARTHS_MOON_TRANSMITTER_DESTROY_COMPUTER,
               (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_DESTROY_COMPUTER_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_ENTER_MAINLAB },
               new List<uint> { (uint)EntityID.DestroyComputer },         // entities needed to kill
               new List<uint> { },  // spawnpoint from which bots must be killed
               true,
               false // dont count 
               ) { SaveOnSuccess = false, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2200/*, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2400*/, HudName = MyTextsWrapperEnum.HudBlondi };
            m_destroyComputer.OnMissionSuccess += DestroyComputerOnOnMissionSuccess;
            m_destroyComputer.OnMissionLoaded += DestroyComputerOnOnMissionLoaded;
            m_destroyComputer.Components.Add(new MySpawnpointWaves((uint)EntityID.EnterMainLabDummy, 0,
                new List<uint[]>
                    {
                        new List<uint> { (uint)EntityID.SpawnPoint5, (uint)EntityID.SpawnPoint6 }.ToArray(), 
                        new List<uint> { (uint)EntityID.SpawnPoint7, (uint)EntityID.SpawnPoint8 }.ToArray()
                    }));
            m_objectives.Add(m_destroyComputer);


            m_needPart3 = new MyMultipleUseObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_PART3_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_PART3,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_PART3_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_DESTROY_COMPUTER },
                MyTextsWrapperEnum.PressToTakeComponent,
                MyTextsWrapperEnum.Component,
                MyTextsWrapperEnum.TakingInProgress,
                1000,
                new List<uint>() { (uint)EntityID.CollectPart1Dummy, (uint)EntityID.CollectPart2Dummy, (uint)EntityID.CollectPart3Dummy },
                MyUseObjectiveType.Taking) { SaveOnSuccess =  true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2500, HudName = MyTextsWrapperEnum.HudPart };
            m_needPart3.OnMissionSuccess += NeedPart3OnOnMissionSuccess;
            m_needPart3.OnObjectUsedSucces += OnObjectUsedSucces;
            m_needPart3.OnMissionLoaded += NeedPart1OnOnMissionLoaded;
            m_objectives.Add(m_needPart3);


            m_escape = new MyObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_WAY_OUT_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_WAY_OUT,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_FIND_WAY_OUT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_PART3 },
                new MyMissionLocation(baseSector, (uint)EntityID.EscapeDummy)
                ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2600, SuccessDialogId = MyDialogueEnum.BARTHS_MOON_TRANSMITTER_3100, HudName = MyTextsWrapperEnum.Nothing };
            m_escape.OnMissionSuccess += Escape_Success;
            m_escape.Components.Add(new MyDetectorDialogue((uint)EntityID.EscapeEventDummy, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2700));
            m_escape.Components.Add(new MyDetectorDialogue((uint)EntityID.EscapeDummy, MyDialogueEnum.BARTHS_MOON_TRANSMITTER_2900));
            m_escape.OnMissionLoaded += EscapeOnOnMissionLoaded;
            m_escape.OnMissionCleanUp += EscapeOnOnMissionCleanUp;
            m_objectives.Add(m_escape);
            

            var build = new MyUseObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_BUILD_TRANSMITTER_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_BUILD_TRANSMITTER,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_BUILD_TRANSMITTER_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_FIND_WAY_OUT },
                new MyMissionLocation(baseSector, (uint)EntityID.BuildDetector4),
                MyTextsWrapperEnum.PressToBuildTransmitter,
                MyTextsWrapperEnum.Transmitter,
                MyTextsWrapperEnum.BuildingInProgress,
                3000,
                MyUseObjectiveType.Building);
            build.OnMissionSuccess += Build_Success;
            build.OnMissionLoaded += Build_Loaded;
            build.Components.Add(new MySpawnpointWaves((uint)EntityID.EscapeDummy, 0,
                                                       new List<uint[]>
                                                           {
                                                               new List<uint> {(uint) EntityID.SpawnPoint9}.ToArray(),
                                                               new List<uint>
                                                                   {
                                                                       (uint) EntityID.SpawnPoint10,
                                                                       (uint) EntityID.SpawnPoint11,
                                                                       (uint) EntityID.SpawnPoint12
                                                                   }.ToArray()
                                                           }));
            build.Components.Add(new MySpawnpointWaves((uint)EntityID.DetectorWayBack2, 0,
                                                       new List<uint[]>
                                                           {
                                                               new List<uint> {(uint) EntityID.SpawnPoint13}.ToArray(),
                                                               new List<uint> {(uint) EntityID.SpawnPoint14}.ToArray()
                                                           }));
            m_objectives.Add(build);

            var backToMadelyn = new MyObjective(
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_RETURN_BACK_TO_MADELYN_Name),
                MyMissionID.BARTHS_MOON_TRANSMITTER_RETURN_BACK_TO_MADELYN,
                (MyTextsWrapperEnum.BARTHS_MOON_TRANSMITTER_RETURN_BACK_TO_MADELYN_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_BUILD_TRANSMITTER },
                new MyMissionLocation(baseSector, MyMissionLocation.MADELYN_HANGAR),
                startDialogId: MyDialogueEnum.BARTHS_MOON_TRANSMITTER_3200,
                radiusOverride: MyMissionLocation.MADELYN_HANGAR_RADIUS
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudMadelynsSapho };
            m_objectives.Add(backToMadelyn);

            //var talkWithThomasBarthEnd = new MyMeetObjective(
            //    new StringBuilder("Talk with Thomas Barth"),
            //    MyMissionID.BARTHS_MOON_TRANSMITTER_TALK_WITH_THOMAS_BARTH_END,
            //    new StringBuilder(""),
            //    this,
            //    new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER_BUILD_TRANSMITTER },
            //    null,
            //    (uint)EntityID.ThomasBartId,
            //    50,
            //    0.25f
            //) { SaveOnSuccess = true, FollowMe = false };
            //talkWithThomasBarthEnd.OnMissionSuccess += TalkWithThomasBarthEnd_Success;
            //m_objectives.Add(talkWithThomasBarthEnd);


            #endregion
        }
        public MySlaverBase2Mission()
        {
            RequiredActors = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN, MyActorEnum.TARJA, MyActorEnum.VALENTIN };


            ID = MyMissionID.SLAVER_BASE_2; /* ID must be added to MyMissions.cs */
            DebugName = new StringBuilder("09d-Slaver base Delta Earnings"); // Name of mission
            Name = MyTextsWrapperEnum.SLAVER_BASE_DELTA_EARNINGS;
            Description = MyTextsWrapperEnum.SLAVER_BASE_DELTA_EARNINGS_Description;
            Flags = MyMissionFlags.Story;

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

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

            RequiredMissions = new MyMissionID[] { MyMissionID.FORT_VALIANT_B }; // IDs of missions required to make this mission available
            RequiredMissionsForSuccess = new MyMissionID[]
                {
                    MyMissionID.SLAVER_BASE_2_FREE_SLAVES,
                };
            m_objectives = new List<MyObjective>(); // Creating of list of submissions


            // ----------- START OF SUBMISSIONS DEFINITION --------------
            var introTalk = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_INTRO,
                null,
                this,
                new MyMissionID[] { },
                MyDialogueEnum.SLAVERBASE2_0100_INTRO
                ) { SaveOnSuccess = false };
            m_objectives.Add(introTalk);


            var paralyzeDefense = new MyObjectiveDestroy(
                // MySubmissionDestroy means mission with objective to destroy something - here it is class member so you can call methods on it
                MyTextsWrapperEnum.SLAVER_BASE_2_PARALYZE_DEFENSE,
                //Name of the submission
                MyMissionID.SLAVER_BASE_2_PARALYZE_DEFENSE,
                // ID of the submission
                MyTextsWrapperEnum.SLAVER_BASE_2_PARALYZE_DEFENSE_Description,
                // Description of the submission
                null,
                this,
                new MyMissionID[]
                    {
                        MyMissionID.SLAVER_BASE_2_INTRO
                    },
                // ID of submissions required to make this submission available - these declares the sequence of submissions
                new List<uint>
                    {
                        (uint) EntityID.turret_1,
                        (uint) EntityID.turret_2,
                        (uint) EntityID.turret_3,
                        (uint) EntityID.turret_4,
                        (uint) EntityID.turret_5,
                        (uint) EntityID.turret_6
                    },
                // ID of objects to be destroyed as a mission objective
                null,
                true,
                startDialogID: MyDialogueEnum.SLAVERBASE2_0200_DESTROY_TURRETS
                ) { SaveOnSuccess = true };
            m_objectives.Add(paralyzeDefense);

            paralyzeDefense.OnMissionLoaded += ParalyzeDefenseOnMissionLoaded;
            paralyzeDefense.OnMissionCleanUp += ParalyzeDefenseOnMissionUnloaded;


            var unlockprison1 = new MyUseObjective(
                MyTextsWrapperEnum.UNLOCK_PRISON_1,
                MyMissionID.UNLOCK_PRISON_1,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_PARALYZE_DEFENSE },
                new MyMissionLocation(baseSector, (uint) EntityID.hub1),
                MyTextsWrapperEnum.PressToHack,
                MyTextsWrapperEnum.SecurityControlHUB,
                MyTextsWrapperEnum.HackingProgress,
                2000,
                startDialogId: MyDialogueEnum.SLAVERBASE2_0300_TURRETS_DESTROYED
                ) { SaveOnSuccess = false };
            unlockprison1.OnMissionSuccess += m_Unlockprison1_OnMissionSuccess;
            m_objectives.Add(unlockprison1);


            var unlockprison2 = new MyUseObjective(
                MyTextsWrapperEnum.UNLOCK_PRISON_2,
                MyMissionID.UNLOCK_PRISON_2,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.UNLOCK_PRISON_1 },
                new MyMissionLocation(baseSector, (uint) EntityID.hub2),
                MyTextsWrapperEnum.PressToHack,
                MyTextsWrapperEnum.SecurityControlHUB,
                MyTextsWrapperEnum.HackingProgress,
                2000,
                startDialogId: MyDialogueEnum.SLAVERBASE2_0400_FIRST_HUB_DESTROYED
                ) { SaveOnSuccess = false };
            m_objectives.Add(unlockprison2);


            var talkAboutGenerator = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_TALK_ABOUT_GENERATOR,
                null,
                this,
                new MyMissionID[] { MyMissionID.UNLOCK_PRISON_2 },
                MyDialogueEnum.SLAVERBASE2_0500_BOTH_HUBS_DESTROYED
                ) { SaveOnSuccess = false };
            m_objectives.Add(talkAboutGenerator);


            var breakTheChains = new MyObjectiveDestroy(
                MyTextsWrapperEnum.SLAVER_BASE_2_BREAK_THE_CHAINS,
                MyMissionID.SLAVER_BASE_2_BREAK_THE_CHAINS,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_TALK_ABOUT_GENERATOR },
                new List<uint> { (uint) EntityID.generator_1 },
                null,
                true
                ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudGenerator };
            breakTheChains.OnMissionSuccess += BreakTheChains_OnMissionSuccess;
            breakTheChains.Components.Add(new MyDetectorDialogue((uint)EntityID.GeneratorDetectorDummy, MyDialogueEnum.SLAVERBASE2_0600_GENERATOR_REACHED));
            m_objectives.Add(breakTheChains);


            var talkAboutPrisoners = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_TALK_ABOUT_PRISONERS,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_BREAK_THE_CHAINS },
                MyDialogueEnum.SLAVERBASE2_0700_GENERATOR_DESTROYED
                ) { SaveOnSuccess = false };
            m_objectives.Add(talkAboutPrisoners);


            var freeSlaves = new MyMultipleUseObjective(
                MyTextsWrapperEnum.SLAVER_BASE_2_FREE_SLAVES,
                MyMissionID.SLAVER_BASE_2_FREE_SLAVES,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_TALK_ABOUT_PRISONERS },
                MyTextsWrapperEnum.UnlockCell,
                MyTextsWrapperEnum.PrisonCell,
                MyTextsWrapperEnum.UnlockingInProgress,
                2000,
                new List<uint>
                    {
                        (uint) EntityID.slave_1,
                        (uint) EntityID.slave_2,
                        (uint) EntityID.slave_3,
                        (uint) EntityID.slave_4,
                        (uint) EntityID.slave_5
                    },
                MyUseObjectiveType.Activating
                )
                {
                    SaveOnSuccess = true,
                    SuccessDialogId = MyDialogueEnum.SLAVERBASE2_1200_MISSION_COMPLETE
                };
            freeSlaves.OnObjectUsedSucces += OnFreeSlavesObjectiveSuccess;
            m_objectives.Add(freeSlaves);

            //var finalFreedom = new MyObjective( // One member of that list - its type defines the type of submission - MySubmission means fly to the dummypoint to success. Here it is var so you cannot call methods on it
            //    new StringBuilder("Return to Valiant."), // Name of the submission
            //    MyMissionID.SLAVER_BASE_2_FINAL_FREEDOM, // ID of the submission - must be added to MyMissions.cs
            //    new StringBuilder("Return to Valiant.\n"), // Description of the submission
            //    null,
            //    this,
            //    new MyMissionID[] { MyMissionID.SLAVER_BASE_2_FREE_SLAVES, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_2, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_3, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_4, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_5 }, // ID of submissions required to make this submission available - it is clear so this submission is the starting submission
            //    new MyMissionLocation(baseSector, (uint)EntityID.FinalFreedom), // ID of dummy point of checkpoint
            //    startDialogId: MyDialogueEnum.SLAVERBASE2_1200_MISSION_COMPLETE
            //  ) { SaveOnSuccess = false }; // False means do not save game in that checkpointa
            //m_objectives.Add(finalFreedom); // Adding this submission to the list of submissions of current mission
        }
        public MyChineseTransportMission()
        {
            #region Validate IDs

            m_validateIDlists = new List<List<uint>>();
            m_validateIDlists.Add(m_explosion1);
            m_validateIDlists.Add(m_explosion2);
            m_validateIDlists.Add(m_explosion3);
            m_validateIDlists.Add(m_explosion4);
            m_validateIDlists.Add(m_explosionFinal);
            m_validateIDlists.Add(m_transmitterPrefabs1);
            m_validateIDlists.Add(m_transmitterPrefabs2);
            m_validateIDlists.Add(m_spawnsStart);
            m_validateIDlists.Add(m_spawnsCenterAsteroid);
            m_validateIDlists.Add(m_spawnsTransmitter);
            m_validateIDlists.Add(m_spawnsCenterAsteroidOut);
            m_validateIDlists.Add(m_spawnsWave1);
            m_validateIDlists.Add(m_spawnsWave2);
            m_validateIDlists.Add(m_spawnsWave3);
            m_validateIDlists.Add(m_spawnsWave4);
            m_validateIDlists.Add(m_spawnsWave5);

            #endregion

            ID = MyMissionID.CHINESE_TRANSPORT; /* ID must be added to MyMissions.cs */
            Name = MyTextsWrapperEnum.CHINESE_TRANSPORT;
            Description = MyTextsWrapperEnum.CHINESE_TRANSPORT_Description; // "Destroy the transmitter and steal the chinese transporter\n"
            DebugName = new StringBuilder("08b-Chinese mines of Changde");
            Flags = MyMissionFlags.Story;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(-4274372, 0, 4874227); // Story sector of the script

            Location = new MyMissionLocation(baseSector, (uint)EntityID.StartLocation); // Starting dummy point

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

            m_objectives = new List<MyObjective>(); // Creating of list of submissions


            m_mission01_getFirstKey = new MyObjective( // One member of that list - its type defines the type of submission - MySubmission means fly to the dummypoint to success. Here it is var so you cannot call methods on it
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_GET_SECURITY_KEY_Name), // Name of the submission
                MyMissionID.CHINESE_TRANSPORT_GET_SECURITY_KEY, // ID of the submission - must be added to MyMissions.cs
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_GET_SECURITY_KEY_Description), // Description of the submission
                null,
                this,
                new MyMissionID[] { }, // ID of submissions required to make this submission available - it is clear so this submission is the starting submission
                null,
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0100_INTRODUCE
            )
                {
                    SaveOnSuccess = false,
                    HudName = MyTextsWrapperEnum.HudHub
                };
            m_mission01_getFirstKey.MissionEntityIDs.Add((uint)EntityID.HUBGetKey);
            m_objectives.Add(m_mission01_getFirstKey);

            m_mission02_reachTunnel_1 = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TUNNEL_1_Name),
                MyMissionID.CHINESE_TRANSPORT_REACH_TUNNEL_1,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TUNNEL_1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_GET_SECURITY_KEY },
                new MyMissionLocation(baseSector, (uint) EntityID.ReachTunnel1),
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0200_FIRST_DEVICE_HACKED
                ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudTunnel };
            m_objectives.Add(m_mission02_reachTunnel_1);

            m_mission03_reachTransmitter = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TRANSMITTER_Name),
                MyMissionID.CHINESE_TRANSPORT_REACH_TRANSMITTER,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TRANSMITTER_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_REACH_TUNNEL_1 },
                 new MyMissionLocation(baseSector, (uint)EntityID.ReachTransmitter)
            ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudTransmitter };
            m_objectives.Add(m_mission03_reachTransmitter);

            m_mission04_killGuards = new MyObjectiveDestroy( // Var is used to call functions on that member
                 (MyTextsWrapperEnum.CHINESE_TRANSPORT_KILL_GUARDS_Name),
                 MyMissionID.CHINESE_TRANSPORT_KILL_GUARDS,
                 (MyTextsWrapperEnum.CHINESE_TRANSPORT_KILL_GUARDS_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_REACH_TRANSMITTER },
                 null,
                 m_spawnsTransmitter,
                 true,
                 startDialogID: MyDialogueEnum.CHINESE_TRANSPORT_0500_MARCUS_IS_HERE
             ) { SaveOnSuccess = true };
            m_objectives.Add(m_mission04_killGuards);

            m_mission05HackTransmitters = new MyMultipleUseObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_HACK_TRANSMITTER_Name),
                MyMissionID.CHINESE_TRANSPORT_HACK_TRANSMITTER,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_HACK_TRANSMITTER_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_KILL_GUARDS },
                MyTextsWrapperEnum.HoldToUseSecurityKey,
                MyTextsWrapperEnum.Using,
                MyTextsWrapperEnum.DeactivatingInProgress,
                2000,
                new List<uint> { (uint) EntityID.HUBHackTrans1, (uint) EntityID.HUBHackTrans2 }
                )
                {
                    StartDialogId = MyDialogueEnum.CHINESE_TRANSPORT_0600_DESTROY_THE_TRANSMITTER, 
                    SaveOnSuccess = false,
                    RadiusOverride = 30,
                    MakeEntityIndestructible = false,
                    FailIfEntityDestroyed = true
                };
            m_objectives.Add(m_mission05HackTransmitters);

            m_mission06_placeBomb = new MyUseObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_PLACE_BOMB_Name),
                MyMissionID.CHINESE_TRANSPORT_PLACE_BOMB,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_PLACE_BOMB_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_HACK_TRANSMITTER },
                new MyMissionLocation(baseSector, (uint)EntityID.PlaceBomb),
                MyTextsWrapperEnum.PressToPlaceBomb,
                MyTextsWrapperEnum.Bomb,
                MyTextsWrapperEnum.PlacementInProgress,
                5000,
                MyUseObjectiveType.Activating, 
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0670_disabling_the_terminals
            ) { SaveOnSuccess = false };
            m_mission06_placeBomb.MissionEntityIDs.Add((uint) EntityID.Bomb);
            m_objectives.Add(m_mission06_placeBomb);

            m_mission07_runExplosion = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_RUN_EXPLOSION_Name),
                MyMissionID.CHINESE_TRANSPORT_RUN_EXPLOSION,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_RUN_EXPLOSION_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_PLACE_BOMB },
                new MyMissionLocation(baseSector, (uint)EntityID.RunExplosion),
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0700_RUN
            ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudSafeArea };
            m_objectives.Add(m_mission07_runExplosion);

            m_mission08_lookOnExplosion = new MyObjective(
              (MyTextsWrapperEnum.CHINESE_TRANSPORT_LOOK_ON_EXPLOSION_Name),
              MyMissionID.CHINESE_TRANSPORT_LOOK_ON_EXPLOSION,
              (MyTextsWrapperEnum.CHINESE_TRANSPORT_LOOK_ON_EXPLOSION_Description),
              null,
              this,
              new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_RUN_EXPLOSION },
              new MyMissionLocation(baseSector, (uint)EntityID.DestructionTransmitter)
          ) { SaveOnSuccess = true };
            m_objectives.Add(m_mission08_lookOnExplosion);

            m_mission09_reachTunnel2 = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TUNNEL_2_Name),
                MyMissionID.CHINESE_TRANSPORT_REACH_TUNNEL_2,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_TUNNEL_2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_LOOK_ON_EXPLOSION },
                new MyMissionLocation(baseSector, (uint)EntityID.ReachTunnel2),
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0800_GO_TO_SECOND_BASE
            ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudTunnel };
            m_objectives.Add(m_mission09_reachTunnel2);

            m_mission10_pastTunnel2 = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_PAST_TUNNEL_2_Name),
                MyMissionID.CHINESE_TRANSPORT_PAST_TUNNEL_2,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_PAST_TUNNEL_2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_REACH_TUNNEL_2 },
                new MyMissionLocation(baseSector, (uint)EntityID.PastTunnel2),
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0850_INSIDE_TUNNEL,
                successDialogId: MyDialogueEnum.CHINESE_TRANSPORT_0900_SURRENDER
            ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudEnd };
            m_objectives.Add(m_mission10_pastTunnel2);

            m_mission11_reachHangarHack = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_HANGAR_HACK_Name),
                MyMissionID.CHINESE_TRANSPORT_REACH_HANGAR_HACK,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_REACH_HANGAR_HACK_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_PAST_TUNNEL_2 },
                new MyMissionLocation(baseSector, (uint)EntityID.ReachHacking),
                successDialogId: MyDialogueEnum.CHINESE_TRANSPORT_1000_DOOR_BLOCKED
            ) { SaveOnSuccess = false, HudName = MyTextsWrapperEnum.HudServiceRoom };
            m_mission11_reachHangarHack.OnMissionLoaded += Mission11ReachHangarHackOnOnMissionLoaded;
            m_objectives.Add(m_mission11_reachHangarHack);

            m_mission12_hackHangarServicePC = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_HACK_HANGAR_SERVICE_PC_Name),
                MyMissionID.CHINESE_TRANSPORT_HACK_HANGAR_SERVICE_PC,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_HACK_HANGAR_SERVICE_PC_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_REACH_HANGAR_HACK },
                null
                //startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_1400_DOORS_UNLOCKED
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudHub };
            m_mission12_hackHangarServicePC.OnMissionLoaded += new MissionHandler(m_mission12_hackHangarServicePC_OnMissionLoaded);
            m_objectives.Add(m_mission12_hackHangarServicePC);
            m_mission12_hackHangarServicePC.MissionEntityIDs.Add((uint)EntityID.HUBHackHangar);

            m_mission13_defendMarcus = new MyDestroyWavesObjective(
               (MyTextsWrapperEnum.CHINESE_TRANSPORT_DEFEND_MARCUS_Name),
               MyMissionID.CHINESE_TRANSPORT_DEFEND_MARCUS,
               (MyTextsWrapperEnum.CHINESE_TRANSPORT_DEFEND_MARCUS_Description),
               null,
               this,
               new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_HACK_HANGAR_SERVICE_PC },
               null,
               null,
               null,
               null,
               4
               )
                {
                    SaveOnSuccess = false,
                    StartDialogId = MyDialogueEnum.CHINESE_TRANSPORT_1100_HELP_MARCUS
                };
            m_mission13_defendMarcus.AddWave(m_spawnsWave1);
            m_mission13_defendMarcus.AddWave(m_spawnsWave2);
            m_mission13_defendMarcus.AddWave(m_spawnsWave3);
            m_mission13_defendMarcus.AddWave(m_spawnsWave4);
            m_mission13_defendMarcus.AddWave(m_spawnsWave5);
            m_mission13_defendMarcus.Components.Add(new MySpawnpointLimiter(m_spawns, 10));
            m_objectives.Add(m_mission13_defendMarcus);

            m_mission14_killBoss = new MyObjectiveDestroy( // Var is used to call functions on that member
                 (MyTextsWrapperEnum.CHINESE_TRANSPORT_KILL_BOSS_Name),
                 MyMissionID.CHINESE_TRANSPORT_KILL_BOSS,
                 (MyTextsWrapperEnum.CHINESE_TRANSPORT_KILL_BOSS_Description),
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_DEFEND_MARCUS },
                 null,
                 new List<uint> { (uint)EntityID.SpawnBossCompanion1, (uint)EntityID.SpawnBossCompanion2, (uint)EntityID.SpawnBoss },
                 true,
                 startDialogID: MyDialogueEnum.CHINESE_TRANSPORT_1200_GENERAL_ARRIVAL
             ) { SaveOnSuccess = true };
            m_objectives.Add(m_mission14_killBoss);

            m_mission15_landIn = new MyObjective(
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_LAND_IN_Name),
                MyMissionID.CHINESE_TRANSPORT_LAND_IN,
                (MyTextsWrapperEnum.CHINESE_TRANSPORT_LAND_IN_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.CHINESE_TRANSPORT_KILL_BOSS },
                new MyMissionLocation(baseSector, (uint)EntityID.Land),
                startDialogId: MyDialogueEnum.CHINESE_TRANSPORT_1300_LAND_IN
            ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudShip };
            m_objectives.Add(m_mission15_landIn);

            m_mission01_getFirstKey.OnMissionLoaded += M01GetFirstKeyLoaded;
            m_mission02_reachTunnel_1.OnMissionLoaded += M02ReachTunnel1Loaded;
            m_mission03_reachTransmitter.OnMissionLoaded += M03ReachTransmitterLoaded;
            m_mission04_killGuards.OnMissionLoaded += M04KillGuardsLoaded;
            m_mission05HackTransmitters.OnMissionLoaded += M05HackTransmitterLoaded;
            m_mission06_placeBomb.OnMissionLoaded += M06PlaceBombLoaded;
            m_mission07_runExplosion.OnMissionLoaded += M07RunExplosionLoaded;
            m_mission08_lookOnExplosion.OnMissionLoaded += M08LookOnExplosionLoaded;
            m_mission09_reachTunnel2.OnMissionLoaded += M09ReachTunnel2Loaded;
            m_mission10_pastTunnel2.OnMissionLoaded += M10PastTunnel2Loaded;
            m_mission11_reachHangarHack.OnMissionLoaded += M11ReachHangarHackLoaded;
            m_mission12_hackHangarServicePC.OnMissionLoaded += M12HackHangarServicePCLoaded;
            m_mission13_defendMarcus.OnMissionLoaded += M13DefendMarcusLoaded;
            m_mission13_defendMarcus.OnMissionCleanUp += Mission13DefendMarcusOnOnMissionCleanUp;
            m_mission14_killBoss.OnMissionLoaded += M14KillBossLoaded;
            m_mission14_killBoss.OnMissionCleanUp += M14KillBossUnloaded;
            m_mission15_landIn.OnMissionLoaded += M15LandInLoaded;

            m_mission06_placeBomb.OnMissionSuccess += M06PlaceBombSuccess;
            m_mission05HackTransmitters.OnObjectUsedSucces += M05TransmittersSuccess;
        }
        public MyTwinTowersMission()
        {
            ID = MyMissionID.TWIN_TOWERS; /* ID must be added to MyMissions.cs */
            Name = MyTextsWrapperEnum.TWIN_TOWERS;
            Description = MyTextsWrapperEnum.TWIN_TOWERS_Description;
            DebugName = new StringBuilder("19-Doppelburg");
            Flags = MyMissionFlags.Story;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(-2809328, 0, -4609055);

            /* sector where the mission is located */
            Location = new MyMissionLocation(baseSector, (uint)EntityID.StartLocation);

            RequiredMissions = new MyMissionID[] { MyMissionID.REICHSTAG_C };
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.TWIN_TOWERS_MOTHERSHIP1_V2 };
            RequiredActors = new MyActorEnum[] { MyActorEnum.MADELYN, MyActorEnum.TARJA, MyActorEnum.VALENTIN  };
            MovePlayerToMadelynHangar = false;

            m_objectives = new List<MyObjective>();

            m_introTalk = new MyObjective(
                MyTextsWrapperEnum.Blank,
                MyMissionID.TWIN_TOWERS_INTRO,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { },
                null
                ) { StartDialogId = MyDialogueEnum.TWIN_TOWERS_0100_INTRO };
            m_objectives.Add(m_introTalk);

            var multipleSabotage = new MyMultipleUseObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_SABOTAGE_Name),
                MyMissionID.TWIN_TOWERS_SABOTAGE,
                (MyTextsWrapperEnum.TWIN_TOWERS_SABOTAGE_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_INTRO },
                MyTextsWrapperEnum.PressToPlaceExplosive,
                MyTextsWrapperEnum.Blank,
                MyTextsWrapperEnum.PlacingExplosives,
                1000,
                new List<uint> { (uint)EntityID.Explosives2, (uint)EntityID.Explosives3, (uint)EntityID.Explosives1 },
                MyUseObjectiveType.Putting
                ) { StartDialogId = MyDialogueEnum.TWIN_TOWERS_0200_PLACE_EXPLOSIVES };
            multipleSabotage.OnObjectUsedSucces += MultipleSabotageOnOnObjectUsedSucces;
            multipleSabotage.RequiredUncompletedMissions = new MyMissionID[] { MyMissionID.TWIN_TOWERS_RANDEVOUZ };
            multipleSabotage.Components.Add(
                new MyDetectorDialogue(
                    (uint) EntityID.Sabotage1,
                    MyDialogueEnum.TWIN_TOWERS_0300_player_reaching_the_main_electricity_supply));
            multipleSabotage.Components.Add(
                new MyDetectorDialogue(
                    (uint) EntityID.Sabotage2,
                    MyDialogueEnum.TWIN_TOWERS_0400_reaching_a_hangar_with_unmanned_enemy_small_ships));
            multipleSabotage.Components.Add(
                new MyDetectorDialogue(
                    (uint) EntityID.Sabotage3, MyDialogueEnum.TWIN_TOWERS_0500_reaching_electricity_distribution_HUB));
            m_objectives.Add(multipleSabotage);

            /*
            var sabotageSubmission04 = new MySabotageSubmission(
                new StringBuilder("Industrial section control room"),
                MyMissionID.TWIN_TOWERS_SABOTAGE04,
                new StringBuilder(""),
                null,
                this,
                new MyMissionID[] { },
                new MyMissionLocation(baseSector, (uint)EntityID.Sabotage4)
            );
            sabotageSubmission04.RequiredUncompletedMissions = new MyMissionID[] { MyMissionID.TWIN_TOWERS_RANDEVOUZ };
            sabotageSubmission04.OnMissionSuccess += Sabotage04SubmissionSuccess;
            m_objectives.Add(sabotageSubmission04);
            */
            var randevouzSubmission = new MyObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_RANDEVOUZ_Name),
                MyMissionID.TWIN_TOWERS_RANDEVOUZ,
                (MyTextsWrapperEnum.TWIN_TOWERS_RANDEVOUZ_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_SABOTAGE },
                new MyMissionLocation(baseSector, (uint)EntityID.Objective_randevouz)
            )
                {
                    SaveOnSuccess = true,
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_0600_after_all_the_sabotages_are_done,
                    HudName = MyTextsWrapperEnum.HudMeetingPoint
                };
            randevouzSubmission.OnMissionLoaded += RandevouzSubmissionLoaded;
            randevouzSubmission.OnMissionSuccess += RandevouzSubmissionSuccess;
            m_objectives.Add(randevouzSubmission);

            m_assaultSubmission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_ASSAULT_Name),
                MyMissionID.TWIN_TOWERS_ASSAULT,
                (MyTextsWrapperEnum.TWIN_TOWERS_ASSAULT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_RANDEVOUZ },
                null,
                new List<uint> { (uint) EntityID.Spawnpoint_Command }
                )
                {
                    SaveOnSuccess = true,
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_0700_Meeting_point,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_0800_command_center_cleared
                };
            m_assaultSubmission.OnMissionSuccess += AssaultSubmissionSuccess;
            m_assaultSubmission.OnMissionLoaded += AssaultSubmissionLoaded;
            m_objectives.Add(m_assaultSubmission);

            m_hackerSubmission = new MyTimedObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_HACKING_Name),
                MyMissionID.TWIN_TOWERS_HACKING,
                (MyTextsWrapperEnum.TWIN_TOWERS_HACKING_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_ASSAULT },
                new TimeSpan(0, 3, 0),
                false
                )
                {
                    SaveOnSuccess = true,
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_0900_hacker_reaches_computer,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1100_hacking_gets_jammed,
                    HudName = MyTextsWrapperEnum.HudHacker
                };
            m_hackerSubmission.OnMissionSuccess += HackerSubmissionSuccess;
            m_hackerSubmission.OnMissionLoaded += HackerSubmissionLoaded;
            m_hackerSubmission.NotificationText = MyTextsWrapperEnum.CountdownHacker;
            m_hackerSubmission.Components.Add(new MyTimedDialogue(TimeSpan.FromSeconds(90), MyDialogueEnum.TWIN_TOWERS_1000_through_the_fight));
            m_objectives.Add(m_hackerSubmission);

            m_jammerSubmission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_JAMMER_Name),
                MyMissionID.TWIN_TOWERS_JAMMER,
                (MyTextsWrapperEnum.TWIN_TOWERS_JAMMER_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_HACKING },
                null,
                new List<uint> { (uint) EntityID.Spawnpoint_Jammer }
                )
                {
                    SaveOnSuccess = true,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1200_killing_jammer,
                    HudName = MyTextsWrapperEnum.HudJammer
                };
            m_jammerSubmission.OnMissionSuccess += JammerSubmissionSuccess;
            m_jammerSubmission.OnMissionLoaded += JammerSubmissionLoaded;
            m_objectives.Add(m_jammerSubmission);

            m_hackerSubmission2 = new MyTimedObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_HACKING_CONTINUE_Name),
                MyMissionID.TWIN_TOWERS_HACKING_CONTINUE,
                (MyTextsWrapperEnum.TWIN_TOWERS_HACKING_CONTINUE_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_JAMMER },
                new TimeSpan(0, 1, 7)
                )
                {
                    SaveOnSuccess = true,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1300_hacking_done,
                    HudName = MyTextsWrapperEnum.HudHacker
                };
            m_hackerSubmission2.OnMissionSuccess += Hacker2SubmissionSuccess;
            m_hackerSubmission2.OnMissionLoaded += Hacker2SubmissionLoaded;
            m_hackerSubmission2.NotificationText = MyTextsWrapperEnum.CountdownHacker;
            m_objectives.Add(m_hackerSubmission2);

            var railgun01Submission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_RAILGUN1_Name),
                MyMissionID.TWIN_TOWERS_RAILGUN1,
                (MyTextsWrapperEnum.TWIN_TOWERS_RAILGUN1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_HACKING_CONTINUE },
                new List<uint>
                    { (uint) EntityID.Objective_Railgun1_Controls_01, (uint) EntityID.Objective_Railgun1_Controls_02 }
                )
                {
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1400_clearing_first_control_room
                };
            railgun01Submission.OnMissionSuccess += Railgun01SubmissionSuccess;
            m_objectives.Add(railgun01Submission);

            var railgun02Submission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_RAILGUN2_Name),
                MyMissionID.TWIN_TOWERS_RAILGUN2,
                (MyTextsWrapperEnum.TWIN_TOWERS_RAILGUN2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_RAILGUN1 },
                new List<uint>
                    {
                        (uint) EntityID.Objective_Railgun2_Controls_01,
                        (uint) EntityID.Objective_Railgun2_Controls_02,
                        (uint) EntityID.Objective_Railgun2_Controls_03,
                        (uint) EntityID.Objective_Railgun2_Controls_04
                    }
                )
                {
                    SaveOnSuccess = true
                };
            railgun02Submission.OnMissionLoaded += Railgun02SubmissionLoaded;
            railgun02Submission.OnMissionSuccess += Railgun02SubmissionSuccess;
            m_objectives.Add(railgun02Submission);

            var rightBaseGoToSubmission = new MyObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_GOTO_RIGHT_Name),
                MyMissionID.TWIN_TOWERS_GOTO_RIGHT,
                (MyTextsWrapperEnum.TWIN_TOWERS_GOTO_RIGHT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_RAILGUN2 },
                new MyMissionLocation(baseSector, (uint) EntityID.Objective_RightBase)
                )
                {
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_1500_clearing_second_control_room,
                    HudName = MyTextsWrapperEnum.HudTowerB
                };
            rightBaseGoToSubmission.OnMissionSuccess += RightBaseGoToSubmissionSuccess;
            m_objectives.Add(rightBaseGoToSubmission);

            var rightBaseGeneratorSubmission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_GENERATOR_Name),
                MyMissionID.TWIN_TOWERS_GENERATOR,
                (MyTextsWrapperEnum.TWIN_TOWERS_GENERATOR_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_GOTO_RIGHT },
                new List<uint> { (uint) EntityID.Objective_Generator_Pipe1, (uint) EntityID.Objective_Generator_Pipe2 }
                )
                {
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_1600_in_tower_B,
                    HudName = MyTextsWrapperEnum.HudGenerator
                };
            rightBaseGeneratorSubmission.SaveOnSuccess = true;
            rightBaseGeneratorSubmission.OnMissionLoaded += RightBaseGeneratorSubmissionLoaded;
            rightBaseGeneratorSubmission.OnMissionSuccess += RightBaseGeneratorSubmissionSuccess;
            m_objectives.Add(rightBaseGeneratorSubmission);

            m_rightBaseCommandSubmission = new MyObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_COMMAND_Name),
                MyMissionID.TWIN_TOWERS_COMMAND,
                (MyTextsWrapperEnum.TWIN_TOWERS_COMMAND_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_GENERATOR },
                null,
                new List<uint> { (uint) EntityID.Objective_Command_HUB }
                )
                {
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_1700_reactor_shut_down,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1800_computer_hacked,
                    HudName = MyTextsWrapperEnum.HudCommandCenter
                };
            m_rightBaseCommandSubmission.OnMissionLoaded += RightBaseCommandSubmissionLoaded;
            m_rightBaseCommandSubmission.OnMissionSuccess += RightBaseCommandSubmissionSuccess;
            m_objectives.Add(m_rightBaseCommandSubmission);

            m_waitSubmission = new MyObjective(
                (MyTextsWrapperEnum.TWIN_TOWERS_WAIT_Name),
                MyMissionID.TWIN_TOWERS_WAIT,
                (MyTextsWrapperEnum.TWIN_TOWERS_WAIT_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_COMMAND },
                null
                )
                {
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_1900_motherships_arrived
                };
            m_waitSubmission.SaveOnSuccess = true;
            m_waitSubmission.OnMissionLoaded += WaitSubmissionLoaded;
            m_waitSubmission.OnMissionSuccess += WaitSubmissionSuccess;
            m_objectives.Add(m_waitSubmission);

            m_mothership1Submission = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_MOTHERSHIP1_Name),
                MyMissionID.TWIN_TOWERS_MOTHERSHIP1,
                (MyTextsWrapperEnum.TWIN_TOWERS_MOTHERSHIP1_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_WAIT },
                new List<uint> { (uint)EntityID.Objective_Zeppelin1_Generator }
                )
                {
                    HudName = MyTextsWrapperEnum.HudGenerator
                };
            m_mothership1Submission.SaveOnSuccess = true;
            m_mothership1Submission.Components.Add(new MySpawnpointWaves((uint)EntityID.Detector_Zeppelin_WW1_Hounds, 0, (uint)EntityID.Spawnpoint_Zeppelin_WW1_03_Hounds));
            m_mothership1Submission.OnMissionLoaded += Mothership1SubmissionLoaded;
            m_mothership1Submission.OnMissionSuccess += Mothership1SubmissionSuccess;
            m_mothership1Submission.Components.Add(new MySpawnpointLimiter(m_WWZeppelinSpawns, 10));
            m_objectives.Add(m_mothership1Submission);

            m_mothership1Submission2 = new MyObjectiveDestroy(
                (MyTextsWrapperEnum.TWIN_TOWERS_MOTHERSHIP1_V2_Name),
                MyMissionID.TWIN_TOWERS_MOTHERSHIP1_V2,
                (MyTextsWrapperEnum.TWIN_TOWERS_MOTHERSHIP1_V2_Description),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_MOTHERSHIP1 },
                new List<uint>
                    { (uint) EntityID.Objective_Zeppelin1_Battery1, (uint) EntityID.Objective_Zeppelin1_Battery2 }
                )
                {
                    StartDialogId = MyDialogueEnum.TWIN_TOWERS_2000_destroying_the_generator,
                    SuccessDialogId = MyDialogueEnum.TWIN_TOWERS_2100_destroying_batteries,
                    HudName = MyTextsWrapperEnum.HudBatteries
                };
            m_mothership1Submission2.Components.Add(new MySpawnpointWaves((uint)EntityID.Detector_Zeppelin_WW1_Hounds, 0, (uint)EntityID.Spawnpoint_Zeppelin_WW1_03_Hounds));
            m_mothership1Submission2.OnMissionLoaded += Mothership1Submission2Loaded;
            m_mothership1Submission2.OnMissionSuccess += Mothership1Submission2Success;
            m_mothership1Submission2.Components.Add(new MySpawnpointLimiter(m_WWZeppelinSpawns, 10));
            m_objectives.Add(m_mothership1Submission2);
            /*
            var mothership2Submission = new MyObjective(
                new StringBuilder("Destroy the second mothership"),
                MyMissionID.TWIN_TOWERS_MOTHERSHIP2,
                new StringBuilder(""),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_MOTHERSHIP1_V2 },
                new MyMissionLocation(baseSector, (uint)EntityID.Objective_Zeppelin2_Command)
            );
            mothership2Submission.OnMissionLoaded += Mothership2SubmissionLoaded;
            mothership2Submission.OnMissionSuccess += Mothership2SubmissionSuccess;
            m_objectives.Add(mothership2Submission);
            */  /*
            var returnSubmission = new MyObjective(
                new StringBuilder("Return to Madelyn"),
                MyMissionID.TWIN_TOWERS_GOTO_MADELYN,
                new StringBuilder(""),
                null,
                this,
                new MyMissionID[] { MyMissionID.TWIN_TOWERS_MOTHERSHIP1_V2 },
                new MyMissionLocation(baseSector, MyMissionLocation.MADELYN_HANGAR)
            );
            m_objectives.Add(returnSubmission);*/
        }
        public MyLastHopeMission()
        {
            ID = MyMissionID.LAST_HOPE;
            Name = MyTextsWrapperEnum.LAST_HOPE;
            Description = MyTextsWrapperEnum.LAST_HOPE_Description;
            DebugName = new StringBuilder("07-Last Hope");
            Flags = MyMissionFlags.Story;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(-190694, 0, -18204363);
            Location = new MyMissionLocation(baseSector, (uint)EntityId.ReachColonyDummy);

            RequiredMissions = new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER };
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.LAST_HOPE_LEAVE_UNDERGROUND };
            RequiredActors = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN };

            #region Objectives

            m_objectives = new List<MyObjective>();

            var reachColony = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_COLONY,
                MyMissionID.LAST_HOPE_REACH_COLONY,
                MyTextsWrapperEnum.LAST_HOPE_REACH_COLONY_DESCRIPTION,
                null,
                this,
                new MyMissionID[] { },
                new MyMissionLocation(baseSector, (uint)EntityId.ReachColonyDummy),
                startDialogId: MyDialogueEnum.LAST_HOPE_0100
                ) { SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudLastHope };
            reachColony.Components.Add(new MySpawnpointWaves((uint)EntityId.ReachColonyDialogDetector, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.ReachColonySpawn1}
                                                                                                        }));
            var dialogComponent = new MyDetectorDialogue((uint)EntityId.ReachColonyDialogDetector, MyDialogueEnum.LAST_HOPE_0200);
            dialogComponent.OnDialogStarted += ReachColonyDialogComonentOnOnDialogStarted;
            dialogComponent.OnDialogFinished += ReachColonyDialogComonentOnOnDialogFinished;
            reachColony.Components.Add(dialogComponent);
            m_objectives.Add(reachColony);




            var destroySlaverRiders = new MyObjectiveDestroy(
              MyTextsWrapperEnum.LAST_HOPE_REACH_DESTROY_RIDERS,
              MyMissionID.LAST_HOPE_DESTROY_SLAVER_RIDERS,
              MyTextsWrapperEnum.LAST_HOPE_REACH_DESTROY_RIDERS_DESC,
              null,
              this,
              new MyMissionID[] { MyMissionID.LAST_HOPE_REACH_COLONY },
              new List<uint> { (uint)EntityId.DestroySlaverRidersGenerator1, (uint)EntityId.DestroySlaverRidersGenerator2 }
            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0300, HudName = MyTextsWrapperEnum.Nothing };
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn11},
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn12}
                                                                                                        }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn21},
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn22}
                                                                                                        }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn31},
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn32}
                                                                                                        }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector3, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn41},
                                                                                                             new uint[]{(uint)EntityId.DestroySlaverRidersSpawn42}
                                                                                                        }));
            destroySlaverRiders.OnMissionLoaded += DestroySlaverRiders_Loaded;
            m_objectives.Add(destroySlaverRiders);


            m_catchSlaverRiders = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_CATCH_SHIPS,
                MyMissionID.LAST_HOPE_CATCH_SLAVER_RIDERS,
                MyTextsWrapperEnum.LAST_HOPE_REACH_CATCH_SHIPS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_DESTROY_SLAVER_RIDERS, },
                new MyMissionLocation(baseSector, (uint)EntityId.CatchSlaverRidersDummy)
            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0400 };
            m_catchSlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDetector1, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.CatchSlaverRidersSpawn1},
                                                                                                        }));
            m_catchSlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDetector2, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.CatchSlaverRidersSpawn21},
                                                                                                             new uint[]{(uint)EntityId.CatchSlaverRidersSpawn22}
                                                                                                        }));
            m_catchSlaverRiders.OnMissionLoaded += CatchSlaverRiders_Loaded;
            m_objectives.Add(m_catchSlaverRiders);



            m_stopSlaverTransport = new MyObjectiveDestroy(
                MyTextsWrapperEnum.LAST_HOPE_REACH_STOP_SHIPS,
                MyMissionID.LAST_HOPE_STOP_SLAVER_RIDERS,
                MyTextsWrapperEnum.LAST_HOPE_REACH_STOP_SHIPS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_CATCH_SLAVER_RIDERS },
                new List<uint>() { (uint)EntityId.StopSlaverTransportGenerator1, (uint)EntityId.StopSlaverTransportGenerator2 }
            ) { SaveOnSuccess = false, StartDialogId = MyDialogueEnum.LAST_HOPE_0500 };
            m_movingShip1 = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip1,
                                   (uint)EntityId.StopSlaverTransportShip1Target, StopSlaversObjectiveTime, false);

            m_movingShip2 = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip2,
                                   (uint)EntityId.StopSlaverTransportShip2Target, StopSlaversObjectiveTime, false);

            m_movingShip1Particle = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip1Particle,
                                   (uint)EntityId.StopSlaverTransportShip1TargetParticle, StopSlaversObjectiveTime, false);

            m_movingShip2Particle = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip2Particle,
                                   (uint)EntityId.StopSlaverTransportShip2TargetParticle, StopSlaversObjectiveTime, false);

            m_stopSlaverTransport.Components.Add(m_movingShip1);
            m_stopSlaverTransport.Components.Add(m_movingShip2);
            m_stopSlaverTransport.Components.Add(m_movingShip1Particle);
            m_stopSlaverTransport.Components.Add(m_movingShip2Particle);
            m_stopSlaverTransport.OnMissionLoaded += StopSlaverTransport_Loaded;

            m_stopSlaverTransport.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDummy, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.StopSlaverTransportSpawn11,(uint)EntityId.StopSlaverTransportSpawn21,},
                                                                                                             new uint[]{(uint)EntityId.StopSlaverTransportSpawn12,(uint)EntityId.StopSlaverTransportSpawn22,},
                                                                                                        }));
            m_objectives.Add(m_stopSlaverTransport);


            var speakWithFathetTobias = new MyObjectiveDialog
                (
                MyTextsWrapperEnum.LAST_HOPE_SPEAK_WITH_FATHER,
                MyMissionID.LAST_HOPE_SPEAK_WITH_FATHER,
                MyTextsWrapperEnum.LAST_HOPE_SPEAK_WITH_FATHER_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_STOP_SLAVER_RIDERS },
                MyDialogueEnum.LAST_HOPE_0600
                ) { SaveOnSuccess = true };
            m_objectives.Add(speakWithFathetTobias);


            var reachCaves = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_REACH_CAVE,
                MyMissionID.LAST_HOPE_REACH_UNDEGROUND_CAVES,
                MyTextsWrapperEnum.LAST_HOPE_REACH_REACH_CAVE_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_SPEAK_WITH_FATHER },
                new MyMissionLocation(baseSector, (uint)EntityId.ReachCavesLocation)

            ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0700, HudName = MyTextsWrapperEnum.HudCave };
            m_objectives.Add(reachCaves);


            m_findTunnel = new MyObjective(
                    MyTextsWrapperEnum.LAST_HOPE_REACH_TUNNEL,
                    MyMissionID.LAST_HOPE_FIND_MAINTANCE_TUNELL,
                    MyTextsWrapperEnum.LAST_HOPE_REACH_TUNNEL_DESC,
                    null,
                    this,
                    new MyMissionID[] { MyMissionID.LAST_HOPE_REACH_UNDEGROUND_CAVES },
                    new MyMissionLocation(baseSector, (uint)EntityId.FindTunnelDummy)
                    ) { SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0800, HudName = MyTextsWrapperEnum.HudTunnel };
            m_findTunnel.Components.Add(new MySpawnpointWaves((uint)EntityId.ReachCavesLocation, 1, new List<uint[]>()
                                                                                                         {
                                                                                                             new uint[]{(uint)EntityId.FindTunnelSpawn1},
                                                                                                             new uint[]{(uint)EntityId.FindTunnelSpawn2},
                                                                                                             new uint[]{(uint)EntityId.FindTunnelSpawn3},
                                                                                                        }));
            m_objectives.Add(m_findTunnel);


            var killSaboteurSquad = new MyDestroyWavesObjective
                (
                MyTextsWrapperEnum.LAST_HOPE_KILL_SABOTERS,
                MyMissionID.LAST_HOPE_KILL_SQUAD,
                MyTextsWrapperEnum.LAST_HOPE_KILL_SABOTERS,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_FIND_MAINTANCE_TUNELL }
                ) { SaveOnSuccess = true };
            killSaboteurSquad.AddWave(new List<uint>() { (uint)EntityId.KillSaboteursSpawn });
            killSaboteurSquad.Components.Add(new MyDetectorDialogue((uint)EntityId.KillSabotersDetector, MyDialogueEnum.LAST_HOPE_1100));
            m_objectives.Add(killSaboteurSquad);



            var deactivateBombs = new MyMultipleUseObjective
                (MyTextsWrapperEnum.LAST_HOPE_DEACTIVATE_BOMBS,
                 MyMissionID.LAST_HOPE_DEACTIVATE_BOMB,
                 MyTextsWrapperEnum.LAST_HOPE_DEACTIVATE_BOMBS_DESC,
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.LAST_HOPE_KILL_SQUAD },
                 MyTextsWrapperEnum.PressToDeactivateNuclearHead,
                 MyTextsWrapperEnum.NuclearHead,
                 MyTextsWrapperEnum.DeactivatingInProgress,
                 5000,
                 new List<uint>() { (uint)EntityId.DeactivateBombPrefab1, (uint)EntityId.DeactivateBombPrefab2 },
                 MyUseObjectiveType.Taking

                ) { RadiusOverride = 30, SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_1200 };
            deactivateBombs.OnMissionLoaded += DeactivateBombs_Loaded;
            deactivateBombs.OnObjectUsedSucces += DeactivateBombs_ObjectUsedSuccess;
            deactivateBombs.Components.Add(new MyDetectorDialogue((uint)EntityId.GasCloudsDetector, MyDialogueEnum.LAST_HOPE_1300));
            m_objectives.Add(deactivateBombs);



            m_repairPipes = new MyMultipleUseObjective
                (MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS,
                 MyMissionID.LAST_HOPE_REPAIR_PIPES,
                  MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS_DESC,
                 null,
                 this,
                 new MyMissionID[] { MyMissionID.LAST_HOPE_DEACTIVATE_BOMB },
                 MyTextsWrapperEnum.PressToRepairGasPipe,
                 MyTextsWrapperEnum.GasPipe,
                 MyTextsWrapperEnum.ProgressRepairing,
                 5000,
                 new List<uint>() { },
                 MyUseObjectiveType.Repairing
                ) { SaveOnSuccess = true, RadiusOverride = 30, StartDialogId = MyDialogueEnum.LAST_HOPE_1400, SuccessDialogId = MyDialogueEnum.LAST_HOPE_1600 };
            foreach (var gasPipe in m_gasPipes)
            {
                m_repairPipes.MissionEntityIDs.Add(gasPipe.Key);
            }
            m_repairPipes.OnObjectUsedSucces += RepairPipes_ObjectUsedSuccess;
            m_objectives.Add(m_repairPipes);



            var stabilizeNuclearCore = new MyMultipleUseObjective
                (
                MyTextsWrapperEnum.LAST_HOPE_STABILIZE_NUCLEAR_CORE,
                MyMissionID.LAST_HOPE_STABILIZE_NUCLEAR_CORE,
                MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_REPAIR_PIPES },
                MyTextsWrapperEnum.PressToRepairRadiation,
                MyTextsWrapperEnum.RadiationLeak,
                MyTextsWrapperEnum.Fixing,
                5000,
                new List<uint>() { },
                MyUseObjectiveType.Repairing
                ) { RadiusOverride = 40, SaveOnSuccess = true };
            stabilizeNuclearCore.Components.Add(new MyDetectorDialogue((uint)EntityId.StabilizeCoreDialog1Dummy, MyDialogueEnum.LAST_HOPE_1700));
            stabilizeNuclearCore.Components.Add(new MyDetectorDialogue((uint)EntityId.StabilizeCoreDialog2Dummy, MyDialogueEnum.LAST_HOPE_1800));
            foreach (var core in m_nuclearCores)
            {
                stabilizeNuclearCore.MissionEntityIDs.Add(core.Key);
            }
            stabilizeNuclearCore.OnObjectUsedSucces += StabilizeNuclearCore_ObjectUsedSuccess;
            m_objectives.Add(stabilizeNuclearCore);


            var leaveUnderground = new MyObjective
                (
                MyTextsWrapperEnum.LAST_HOPE_LEAVE_SHAFTS,
                MyMissionID.LAST_HOPE_LEAVE_UNDERGROUND,
                MyTextsWrapperEnum.LAST_HOPE_LEAVE_SHAFTS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_STABILIZE_NUCLEAR_CORE },
                new MyMissionLocation(baseSector, (uint)EntityId.LaveUndergroundDummy)) { StartDialogId = MyDialogueEnum.LAST_HOPE_1900, HudName = MyTextsWrapperEnum.Nothing };
            leaveUnderground.OnMissionSuccess += LeaveUnderground_Success;
            m_objectives.Add(leaveUnderground);

            #endregion
        }
        public MyLastHopeMission()
        {
            ID          = MyMissionID.LAST_HOPE;
            Name        = MyTextsWrapperEnum.LAST_HOPE;
            Description = MyTextsWrapperEnum.LAST_HOPE_Description;
            DebugName   = new StringBuilder("07-Last Hope");
            Flags       = MyMissionFlags.Story;

            MyMwcVector3Int baseSector = new MyMwcVector3Int(-190694, 0, -18204363);

            Location = new MyMissionLocation(baseSector, (uint)EntityId.ReachColonyDummy);

            RequiredMissions           = new MyMissionID[] { MyMissionID.BARTHS_MOON_TRANSMITTER };
            RequiredMissionsForSuccess = new MyMissionID[] { MyMissionID.LAST_HOPE_LEAVE_UNDERGROUND };
            RequiredActors             = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN };

            #region Objectives

            m_objectives = new List <MyObjective>();

            var reachColony = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_COLONY,
                MyMissionID.LAST_HOPE_REACH_COLONY,
                MyTextsWrapperEnum.LAST_HOPE_REACH_COLONY_DESCRIPTION,
                null,
                this,
                new MyMissionID[] { },
                new MyMissionLocation(baseSector, (uint)EntityId.ReachColonyDummy),
                startDialogId: MyDialogueEnum.LAST_HOPE_0100
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudLastHope
            };
            reachColony.Components.Add(new MySpawnpointWaves((uint)EntityId.ReachColonyDialogDetector, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.ReachColonySpawn1 }
            }));
            var dialogComponent = new MyDetectorDialogue((uint)EntityId.ReachColonyDialogDetector, MyDialogueEnum.LAST_HOPE_0200);
            dialogComponent.OnDialogStarted  += ReachColonyDialogComonentOnOnDialogStarted;
            dialogComponent.OnDialogFinished += ReachColonyDialogComonentOnOnDialogFinished;
            reachColony.Components.Add(dialogComponent);
            m_objectives.Add(reachColony);



            var destroySlaverRiders = new MyObjectiveDestroy(
                MyTextsWrapperEnum.LAST_HOPE_REACH_DESTROY_RIDERS,
                MyMissionID.LAST_HOPE_DESTROY_SLAVER_RIDERS,
                MyTextsWrapperEnum.LAST_HOPE_REACH_DESTROY_RIDERS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_REACH_COLONY },
                new List <uint> {
                (uint)EntityId.DestroySlaverRidersGenerator1, (uint)EntityId.DestroySlaverRidersGenerator2
            }
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0300, HudName = MyTextsWrapperEnum.Nothing
            };
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector1, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn11 },
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn12 }
            }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector1, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn21 },
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn22 }
            }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector3, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn31 },
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn32 }
            }));
            destroySlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.DestroySlaverRidersDetector3, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn41 },
                new uint[] { (uint)EntityId.DestroySlaverRidersSpawn42 }
            }));
            destroySlaverRiders.OnMissionLoaded += DestroySlaverRiders_Loaded;
            m_objectives.Add(destroySlaverRiders);


            m_catchSlaverRiders = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_CATCH_SHIPS,
                MyMissionID.LAST_HOPE_CATCH_SLAVER_RIDERS,
                MyTextsWrapperEnum.LAST_HOPE_REACH_CATCH_SHIPS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_DESTROY_SLAVER_RIDERS, },
                new MyMissionLocation(baseSector, (uint)EntityId.CatchSlaverRidersDummy)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0400
            };
            m_catchSlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDetector1, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.CatchSlaverRidersSpawn1 },
            }));
            m_catchSlaverRiders.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDetector2, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.CatchSlaverRidersSpawn21 },
                new uint[] { (uint)EntityId.CatchSlaverRidersSpawn22 }
            }));
            m_catchSlaverRiders.OnMissionLoaded += CatchSlaverRiders_Loaded;
            m_objectives.Add(m_catchSlaverRiders);



            m_stopSlaverTransport = new MyObjectiveDestroy(
                MyTextsWrapperEnum.LAST_HOPE_REACH_STOP_SHIPS,
                MyMissionID.LAST_HOPE_STOP_SLAVER_RIDERS,
                MyTextsWrapperEnum.LAST_HOPE_REACH_STOP_SHIPS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_CATCH_SLAVER_RIDERS },
                new List <uint>()
            {
                (uint)EntityId.StopSlaverTransportGenerator1, (uint)EntityId.StopSlaverTransportGenerator2
            }
                )
            {
                SaveOnSuccess = false, StartDialogId = MyDialogueEnum.LAST_HOPE_0500
            };
            m_movingShip1 = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip1,
                                               (uint)EntityId.StopSlaverTransportShip1Target, StopSlaversObjectiveTime, false);

            m_movingShip2 = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip2,
                                               (uint)EntityId.StopSlaverTransportShip2Target, StopSlaversObjectiveTime, false);

            m_movingShip1Particle = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip1Particle,
                                                       (uint)EntityId.StopSlaverTransportShip1TargetParticle, StopSlaversObjectiveTime, false);

            m_movingShip2Particle = new MyMovingEntity((uint)EntityId.StopSlaverTransportShip2Particle,
                                                       (uint)EntityId.StopSlaverTransportShip2TargetParticle, StopSlaversObjectiveTime, false);

            m_stopSlaverTransport.Components.Add(m_movingShip1);
            m_stopSlaverTransport.Components.Add(m_movingShip2);
            m_stopSlaverTransport.Components.Add(m_movingShip1Particle);
            m_stopSlaverTransport.Components.Add(m_movingShip2Particle);
            m_stopSlaverTransport.OnMissionLoaded += StopSlaverTransport_Loaded;

            m_stopSlaverTransport.Components.Add(new MySpawnpointWaves((uint)EntityId.CatchSlaverRidersDummy, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.StopSlaverTransportSpawn11, (uint)EntityId.StopSlaverTransportSpawn21, },
                new uint[] { (uint)EntityId.StopSlaverTransportSpawn12, (uint)EntityId.StopSlaverTransportSpawn22, },
            }));
            m_objectives.Add(m_stopSlaverTransport);


            var speakWithFathetTobias = new MyObjectiveDialog
                                        (
                MyTextsWrapperEnum.LAST_HOPE_SPEAK_WITH_FATHER,
                MyMissionID.LAST_HOPE_SPEAK_WITH_FATHER,
                MyTextsWrapperEnum.LAST_HOPE_SPEAK_WITH_FATHER_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_STOP_SLAVER_RIDERS },
                MyDialogueEnum.LAST_HOPE_0600
                                        )
            {
                SaveOnSuccess = true
            };
            m_objectives.Add(speakWithFathetTobias);


            var reachCaves = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_REACH_CAVE,
                MyMissionID.LAST_HOPE_REACH_UNDEGROUND_CAVES,
                MyTextsWrapperEnum.LAST_HOPE_REACH_REACH_CAVE_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_SPEAK_WITH_FATHER },
                new MyMissionLocation(baseSector, (uint)EntityId.ReachCavesLocation)

                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0700, HudName = MyTextsWrapperEnum.HudCave
            };
            m_objectives.Add(reachCaves);


            m_findTunnel = new MyObjective(
                MyTextsWrapperEnum.LAST_HOPE_REACH_TUNNEL,
                MyMissionID.LAST_HOPE_FIND_MAINTANCE_TUNELL,
                MyTextsWrapperEnum.LAST_HOPE_REACH_TUNNEL_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_REACH_UNDEGROUND_CAVES },
                new MyMissionLocation(baseSector, (uint)EntityId.FindTunnelDummy)
                )
            {
                SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_0800, HudName = MyTextsWrapperEnum.HudTunnel
            };
            m_findTunnel.Components.Add(new MySpawnpointWaves((uint)EntityId.ReachCavesLocation, 1, new List <uint[]>()
            {
                new uint[] { (uint)EntityId.FindTunnelSpawn1 },
                new uint[] { (uint)EntityId.FindTunnelSpawn2 },
                new uint[] { (uint)EntityId.FindTunnelSpawn3 },
            }));
            m_objectives.Add(m_findTunnel);


            var killSaboteurSquad = new MyDestroyWavesObjective
                                    (
                MyTextsWrapperEnum.LAST_HOPE_KILL_SABOTERS,
                MyMissionID.LAST_HOPE_KILL_SQUAD,
                MyTextsWrapperEnum.LAST_HOPE_KILL_SABOTERS,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_FIND_MAINTANCE_TUNELL }
                                    )
            {
                SaveOnSuccess = true
            };
            killSaboteurSquad.AddWave(new List <uint>()
            {
                (uint)EntityId.KillSaboteursSpawn
            });
            killSaboteurSquad.Components.Add(new MyDetectorDialogue((uint)EntityId.KillSabotersDetector, MyDialogueEnum.LAST_HOPE_1100));
            m_objectives.Add(killSaboteurSquad);



            var deactivateBombs = new MyMultipleUseObjective
                                      (MyTextsWrapperEnum.LAST_HOPE_DEACTIVATE_BOMBS,
                                      MyMissionID.LAST_HOPE_DEACTIVATE_BOMB,
                                      MyTextsWrapperEnum.LAST_HOPE_DEACTIVATE_BOMBS_DESC,
                                      null,
                                      this,
                                      new MyMissionID[] { MyMissionID.LAST_HOPE_KILL_SQUAD },
                                      MyTextsWrapperEnum.PressToDeactivateNuclearHead,
                                      MyTextsWrapperEnum.NuclearHead,
                                      MyTextsWrapperEnum.DeactivatingInProgress,
                                      5000,
                                      new List <uint>()
            {
                (uint)EntityId.DeactivateBombPrefab1, (uint)EntityId.DeactivateBombPrefab2
            },
                                      MyUseObjectiveType.Taking

                                      )
            {
                RadiusOverride = 30, SaveOnSuccess = true, StartDialogId = MyDialogueEnum.LAST_HOPE_1200
            };
            deactivateBombs.OnMissionLoaded    += DeactivateBombs_Loaded;
            deactivateBombs.OnObjectUsedSucces += DeactivateBombs_ObjectUsedSuccess;
            deactivateBombs.Components.Add(new MyDetectorDialogue((uint)EntityId.GasCloudsDetector, MyDialogueEnum.LAST_HOPE_1300));
            m_objectives.Add(deactivateBombs);



            m_repairPipes = new MyMultipleUseObjective
                                (MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS,
                                MyMissionID.LAST_HOPE_REPAIR_PIPES,
                                MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS_DESC,
                                null,
                                this,
                                new MyMissionID[] { MyMissionID.LAST_HOPE_DEACTIVATE_BOMB },
                                MyTextsWrapperEnum.PressToRepairGasPipe,
                                MyTextsWrapperEnum.GasPipe,
                                MyTextsWrapperEnum.ProgressRepairing,
                                5000,
                                new List <uint>()
            {
            },
                                MyUseObjectiveType.Repairing
                                )
            {
                SaveOnSuccess = true, RadiusOverride = 30, StartDialogId = MyDialogueEnum.LAST_HOPE_1400, SuccessDialogId = MyDialogueEnum.LAST_HOPE_1600
            };
            foreach (var gasPipe in m_gasPipes)
            {
                m_repairPipes.MissionEntityIDs.Add(gasPipe.Key);
            }
            m_repairPipes.OnObjectUsedSucces += RepairPipes_ObjectUsedSuccess;
            m_objectives.Add(m_repairPipes);



            var stabilizeNuclearCore = new MyMultipleUseObjective
                                       (
                MyTextsWrapperEnum.LAST_HOPE_STABILIZE_NUCLEAR_CORE,
                MyMissionID.LAST_HOPE_STABILIZE_NUCLEAR_CORE,
                MyTextsWrapperEnum.LAST_HOPE_STABILIZE_GAS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_REPAIR_PIPES },
                MyTextsWrapperEnum.PressToRepairRadiation,
                MyTextsWrapperEnum.RadiationLeak,
                MyTextsWrapperEnum.Fixing,
                5000,
                new List <uint>()
            {
            },
                MyUseObjectiveType.Repairing
                                       )
            {
                RadiusOverride = 40, SaveOnSuccess = true
            };
            stabilizeNuclearCore.Components.Add(new MyDetectorDialogue((uint)EntityId.StabilizeCoreDialog1Dummy, MyDialogueEnum.LAST_HOPE_1700));
            stabilizeNuclearCore.Components.Add(new MyDetectorDialogue((uint)EntityId.StabilizeCoreDialog2Dummy, MyDialogueEnum.LAST_HOPE_1800));
            foreach (var core in m_nuclearCores)
            {
                stabilizeNuclearCore.MissionEntityIDs.Add(core.Key);
            }
            stabilizeNuclearCore.OnObjectUsedSucces += StabilizeNuclearCore_ObjectUsedSuccess;
            m_objectives.Add(stabilizeNuclearCore);


            var leaveUnderground = new MyObjective
                                   (
                MyTextsWrapperEnum.LAST_HOPE_LEAVE_SHAFTS,
                MyMissionID.LAST_HOPE_LEAVE_UNDERGROUND,
                MyTextsWrapperEnum.LAST_HOPE_LEAVE_SHAFTS_DESC,
                null,
                this,
                new MyMissionID[] { MyMissionID.LAST_HOPE_STABILIZE_NUCLEAR_CORE },
                new MyMissionLocation(baseSector, (uint)EntityId.LaveUndergroundDummy))
            {
                StartDialogId = MyDialogueEnum.LAST_HOPE_1900, HudName = MyTextsWrapperEnum.Nothing
            };
            leaveUnderground.OnMissionSuccess += LeaveUnderground_Success;
            m_objectives.Add(leaveUnderground);

            #endregion
        }
        public MySlaverBase2Mission()
        {
            RequiredActors = new MyActorEnum[] { MyActorEnum.MARCUS, MyActorEnum.MADELYN, MyActorEnum.TARJA, MyActorEnum.VALENTIN };


            ID          = MyMissionID.SLAVER_BASE_2;                           /* ID must be added to MyMissions.cs */
            DebugName   = new StringBuilder("09d-Slaver base Delta Earnings"); // Name of mission
            Name        = MyTextsWrapperEnum.SLAVER_BASE_DELTA_EARNINGS;
            Description = MyTextsWrapperEnum.SLAVER_BASE_DELTA_EARNINGS_Description;
            Flags       = MyMissionFlags.Story;

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

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

            RequiredMissions           = new MyMissionID[] { MyMissionID.FORT_VALIANT_B }; // IDs of missions required to make this mission available
            RequiredMissionsForSuccess = new MyMissionID[]
            {
                MyMissionID.SLAVER_BASE_2_FREE_SLAVES,
            };
            m_objectives = new List <MyObjective>(); // Creating of list of submissions


            // ----------- START OF SUBMISSIONS DEFINITION --------------
            var introTalk = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_INTRO,
                null,
                this,
                new MyMissionID[] { },
                MyDialogueEnum.SLAVERBASE2_0100_INTRO
                )
            {
                SaveOnSuccess = false
            };

            m_objectives.Add(introTalk);


            var paralyzeDefense = new MyObjectiveDestroy(
                // MySubmissionDestroy means mission with objective to destroy something - here it is class member so you can call methods on it
                MyTextsWrapperEnum.SLAVER_BASE_2_PARALYZE_DEFENSE,
                //Name of the submission
                MyMissionID.SLAVER_BASE_2_PARALYZE_DEFENSE,
                // ID of the submission
                MyTextsWrapperEnum.SLAVER_BASE_2_PARALYZE_DEFENSE_Description,
                // Description of the submission
                null,
                this,
                new MyMissionID[]
            {
                MyMissionID.SLAVER_BASE_2_INTRO
            },
                // ID of submissions required to make this submission available - these declares the sequence of submissions
                new List <uint>
            {
                (uint)EntityID.turret_1,
                (uint)EntityID.turret_2,
                (uint)EntityID.turret_3,
                (uint)EntityID.turret_4,
                (uint)EntityID.turret_5,
                (uint)EntityID.turret_6
            },
                // ID of objects to be destroyed as a mission objective
                null,
                true,
                startDialogID: MyDialogueEnum.SLAVERBASE2_0200_DESTROY_TURRETS
                )
            {
                SaveOnSuccess = true
            };

            m_objectives.Add(paralyzeDefense);

            paralyzeDefense.OnMissionLoaded  += ParalyzeDefenseOnMissionLoaded;
            paralyzeDefense.OnMissionCleanUp += ParalyzeDefenseOnMissionUnloaded;


            var unlockprison1 = new MyUseObjective(
                MyTextsWrapperEnum.UNLOCK_PRISON_1,
                MyMissionID.UNLOCK_PRISON_1,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_PARALYZE_DEFENSE },
                new MyMissionLocation(baseSector, (uint)EntityID.hub1),
                MyTextsWrapperEnum.PressToHack,
                MyTextsWrapperEnum.SecurityControlHUB,
                MyTextsWrapperEnum.HackingProgress,
                2000,
                startDialogId: MyDialogueEnum.SLAVERBASE2_0300_TURRETS_DESTROYED
                )
            {
                SaveOnSuccess = false
            };

            unlockprison1.OnMissionSuccess += m_Unlockprison1_OnMissionSuccess;
            m_objectives.Add(unlockprison1);


            var unlockprison2 = new MyUseObjective(
                MyTextsWrapperEnum.UNLOCK_PRISON_2,
                MyMissionID.UNLOCK_PRISON_2,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.UNLOCK_PRISON_1 },
                new MyMissionLocation(baseSector, (uint)EntityID.hub2),
                MyTextsWrapperEnum.PressToHack,
                MyTextsWrapperEnum.SecurityControlHUB,
                MyTextsWrapperEnum.HackingProgress,
                2000,
                startDialogId: MyDialogueEnum.SLAVERBASE2_0400_FIRST_HUB_DESTROYED
                )
            {
                SaveOnSuccess = false
            };

            m_objectives.Add(unlockprison2);


            var talkAboutGenerator = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_TALK_ABOUT_GENERATOR,
                null,
                this,
                new MyMissionID[] { MyMissionID.UNLOCK_PRISON_2 },
                MyDialogueEnum.SLAVERBASE2_0500_BOTH_HUBS_DESTROYED
                )
            {
                SaveOnSuccess = false
            };

            m_objectives.Add(talkAboutGenerator);


            var breakTheChains = new MyObjectiveDestroy(
                MyTextsWrapperEnum.SLAVER_BASE_2_BREAK_THE_CHAINS,
                MyMissionID.SLAVER_BASE_2_BREAK_THE_CHAINS,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_TALK_ABOUT_GENERATOR },
                new List <uint> {
                (uint)EntityID.generator_1
            },
                null,
                true
                )
            {
                SaveOnSuccess = true, HudName = MyTextsWrapperEnum.HudGenerator
            };

            breakTheChains.OnMissionSuccess += BreakTheChains_OnMissionSuccess;
            breakTheChains.Components.Add(new MyDetectorDialogue((uint)EntityID.GeneratorDetectorDummy, MyDialogueEnum.SLAVERBASE2_0600_GENERATOR_REACHED));
            m_objectives.Add(breakTheChains);


            var talkAboutPrisoners = new MyObjectiveDialog(
                MyMissionID.SLAVER_BASE_2_TALK_ABOUT_PRISONERS,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_BREAK_THE_CHAINS },
                MyDialogueEnum.SLAVERBASE2_0700_GENERATOR_DESTROYED
                )
            {
                SaveOnSuccess = false
            };

            m_objectives.Add(talkAboutPrisoners);


            var freeSlaves = new MyMultipleUseObjective(
                MyTextsWrapperEnum.SLAVER_BASE_2_FREE_SLAVES,
                MyMissionID.SLAVER_BASE_2_FREE_SLAVES,
                MyTextsWrapperEnum.Blank,
                null,
                this,
                new MyMissionID[] { MyMissionID.SLAVER_BASE_2_TALK_ABOUT_PRISONERS },
                MyTextsWrapperEnum.UnlockCell,
                MyTextsWrapperEnum.PrisonCell,
                MyTextsWrapperEnum.UnlockingInProgress,
                2000,
                new List <uint>
            {
                (uint)EntityID.slave_1,
                (uint)EntityID.slave_2,
                (uint)EntityID.slave_3,
                (uint)EntityID.slave_4,
                (uint)EntityID.slave_5
            },
                MyUseObjectiveType.Activating
                )
            {
                SaveOnSuccess   = true,
                SuccessDialogId = MyDialogueEnum.SLAVERBASE2_1200_MISSION_COMPLETE
            };

            freeSlaves.OnObjectUsedSucces += OnFreeSlavesObjectiveSuccess;
            m_objectives.Add(freeSlaves);

            //var finalFreedom = new MyObjective( // One member of that list - its type defines the type of submission - MySubmission means fly to the dummypoint to success. Here it is var so you cannot call methods on it
            //    new StringBuilder("Return to Valiant."), // Name of the submission
            //    MyMissionID.SLAVER_BASE_2_FINAL_FREEDOM, // ID of the submission - must be added to MyMissions.cs
            //    new StringBuilder("Return to Valiant.\n"), // Description of the submission
            //    null,
            //    this,
            //    new MyMissionID[] { MyMissionID.SLAVER_BASE_2_FREE_SLAVES, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_2, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_3, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_4, MyMissionID.SLAVER_BASE_1_FREE_SLAVES_5 }, // ID of submissions required to make this submission available - it is clear so this submission is the starting submission
            //    new MyMissionLocation(baseSector, (uint)EntityID.FinalFreedom), // ID of dummy point of checkpoint
            //    startDialogId: MyDialogueEnum.SLAVERBASE2_1200_MISSION_COMPLETE
            //  ) { SaveOnSuccess = false }; // False means do not save game in that checkpointa
            //m_objectives.Add(finalFreedom); // Adding this submission to the list of submissions of current mission
        }