private void SetFriendsPatrol()
        {
            m_marcus.SetWaypointPath("ChurchPatrol");
            m_marcus.PatrolMode = MyPatrolMode.ONE_WAY;
            m_marcus.Patrol();

            m_ravengirlBot.SetWaypointPath("ChurchPatrol");
            m_ravengirlBot.PatrolMode = MyPatrolMode.ONE_WAY;
            m_ravengirlBot.Patrol();

            m_ravenguyBot.SetWaypointPath("ChurchPatrol");
            m_ravenguyBot.PatrolMode = MyPatrolMode.ONE_WAY;
            m_ravenguyBot.Patrol();
        }
Esempio n. 2
0
        void O10FindBombDealerLoaded(MyMissionBase sender)
        {
            m_manjeet.LookTarget = null;
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.Special, 1, "MM01");
            MyScriptWrapper.SetSleepDistance(m_marcus, 5000);
            MyScriptWrapper.StopFollow(m_marcus);
            m_marcus.SetWaypointPath("MarcusOut");
            m_marcus.SpeedModifier = 2.0f;
            MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.MarcusIsLeavingForTarja, MyGuiManager.GetFontMinerWarsGreen(), 5000));
            m_marcus.PatrolMode = MyPatrolMode.ONE_WAY;
            m_marcus.Patrol();

            m_valentin = (MySmallShipBot)MyScriptWrapper.GetEntity("RavenGuy");
            m_valentin.LeaderLostEnabled = true;
            MyScriptWrapper.MarkEntity(m_valentin, MyTextsWrapper.Get(MyActorConstants.GetActorDisplayName(MyActorEnum.VALENTIN)).ToString(), HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_ONLY_IF_DETECTED_BY_RADAR | HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, HUD.MyGuitargetMode.Friend);
            MyScriptWrapper.StopFollow(m_valentin);
            MyEntity valentinPosition = MyScriptWrapper.GetEntity((uint)EntityID.ValentinBRPosition);

            m_valentin.SetWorldMatrix(valentinPosition.WorldMatrix);

            m_tarja.LeaderLostEnabled = true;
            MyScriptWrapper.StopFollow(m_tarja);
            MyScriptWrapper.MarkEntity(m_tarja, MyTextsWrapper.Get(MyActorConstants.GetActorDisplayName(MyActorEnum.TARJA)).ToString(), HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_ONLY_IF_DETECTED_BY_RADAR | HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS, HUD.MyGuitargetMode.Friend);
            MyEntity tarjaPosition = MyScriptWrapper.GetEntity((uint)EntityID.TarjaBRPosition);

            m_tarja.SetWorldMatrix(tarjaPosition.WorldMatrix);
            MyScriptWrapper.SetEntityDisplayName(m_tarja, MyTextsWrapper.Get(MyTextsWrapperEnum.Actor_Tarja).ToString());

            MyScriptWrapper.UnhideEntity(MyScriptWrapper.GetEntity((uint)EntityID.BombDealer));
        }
Esempio n. 3
0
        void O03FlyToStartLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.OnBotReachedWaypoint += Script_BotReachedWaypoint;

            m_detector_ReachStart.OnEntityEnter += StartPositionEntered;
            m_detector_ReachStart.OnEntityLeave += StartPositionLeaved;
            m_detector_ReachStart.On();

            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Racer2);
            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.Racer3);
            MyScriptWrapper.MarkEntity(MyScriptWrapper.GetEntity((uint)EntityID.DetectorStartRacePosition), MyTexts.FlyToStartingPoint, HUD.MyHudIndicatorFlagsEnum.SHOW_TEXT | HUD.MyHudIndicatorFlagsEnum.SHOW_DISTANCE | HUD.MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS);

            m_manjeet.LookTarget = null;
            m_manjeet.SetWaypointPath("SmugglerOut");
            m_manjeet.PatrolMode = CommonLIB.AppCode.ObjectBuilders.Object3D.MyPatrolMode.ONE_WAY;
            m_manjeet.Patrol();
            MyScriptWrapper.SetSleepDistance(m_manjeet, 3000);

            MySmallShipBot challenger = (MySmallShipBot)MyScriptWrapper.GetEntity("Challenger");

            challenger.SetWaypointPath("Gotostart");
            challenger.PatrolMode = CommonLIB.AppCode.ObjectBuilders.Object3D.MyPatrolMode.ONE_WAY;
            challenger.Patrol();

            MyScriptWrapper.SetSleepDistance(challenger, 20000);

            MyScriptWrapper.SetEntitiesEnabled(m_influenceSpheresFansBeforeStart, true);
        }
Esempio n. 4
0
 void O04FollowSmugglerLoaded(MyMissionBase sender)
 {
     m_manjeetFindDetector.OnEntityEnter -= ManjeetFound;
     m_manjeetFindDetector.Off();
     m_manjeet.SetWaypointPath("SmugglerRun");
     m_manjeet.PatrolMode = MyPatrolMode.ONE_WAY;
     m_manjeet.Patrol();
     MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.StressOrTimeRush, 3, "MM01");
 }
        private void Follow1Reached()
        {
            MyScriptWrapper.ActivateSpawnPoint((uint)EntityID.SpawnpointFactory);
            MySmallShipBot mitchel = (MySmallShipBot)MyScriptWrapper.GetEntity("Mitchel");

            mitchel.SetWaypointPath("Follow2");
            mitchel.PatrolMode = MyPatrolMode.ONE_WAY;
            mitchel.Patrol();

            MyScriptWrapper.SetEntityEnabled((uint)EntityID.FactoryFound, true);
        }
        void Return_OnMissionLoaded(MyMissionBase sender)
        {
            MySmallShipBot transport1 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport1);

            transport1.SetWaypointPath("transport");
            transport1.Patrol();
            MySmallShipBot transport2 = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.ShipTransport2);

            transport2.SetWaypointPath("transport");
            transport2.Patrol();
        }
Esempio n. 7
0
        public void StartRace()
        {
            m_racer.SetWaypointPath(WayPointPath);
            m_racer.Patrol();
            m_racer.Enabled = true;
            m_racer.Engine  = MySession.PlayerShip.Engine;
            MyHudIndicatorFlagsEnum flags = MyHudIndicatorFlagsEnum.SHOW_TEXT |
                                            MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS |
                                            MyHudIndicatorFlagsEnum.SHOW_DISTANCE;

            MyScriptWrapper.MarkEntity(m_racer, Name, flags, MyGuitargetMode.Objective);
        }
        private void DestroyGenerator_Loaded(MyMissionBase sender)
        {
            MyScriptWrapper.ActivateSpawnPoints(m_wavesApolloSpawns);
            MyScriptWrapper.ActivateSpawnPoints(m_wavesMarcusSpawns);

            m_marcus.StopFollow();
            m_ravenGuy.StopFollow();

            m_marcus.SetWaypointPath("MarcusLeaved");
            m_marcus.PatrolMode  = MyPatrolMode.ONE_WAY;
            m_marcus.SeeDistance = 250f;
            m_marcus.Patrol();

            m_ravenGuy.SetWaypointPath("VitolinoLeaved");
            m_ravenGuy.SeeDistance = 250f;
            m_ravenGuy.PatrolMode  = MyPatrolMode.ONE_WAY;
            m_ravenGuy.Patrol();

            m_generatorPosition = MyScriptWrapper.GetEntity((uint)EntityID.DestroyGenerator).GetPosition();
            MyScriptWrapper.ActivateSpawnPoints(m_barricadeLoomers);

            MyScriptWrapper.AddNotification(MyScriptWrapper.CreateNotification(MyTextsWrapperEnum.MarcusAndValentinoLeavingParty, MyGuiManager.GetFontMinerWarsGreen(), 10000));
            EveryoneAttackMadelyn();
        }
        private void WaitForTheMomentLoaded(MyMissionBase sender)
        {
            m_guardLReached = false;
            m_guardRReached = false;
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.StealthAction, 3, "MM01");

            MySmallShipBot vesselGuardL = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardL");
            MySmallShipBot vesselGuardR = (MySmallShipBot)MyScriptWrapper.GetEntity("GuardR");

            vesselGuardL.SetWaypointPath("GUARDLL");
            vesselGuardR.SetWaypointPath("GUARDRL");
            vesselGuardL.PatrolMode = MyPatrolMode.ONE_WAY;
            vesselGuardR.PatrolMode = MyPatrolMode.ONE_WAY;
            vesselGuardR.Patrol();
            vesselGuardL.Patrol();
            MyScriptWrapper.SetEntityDestructible(vesselGuardR, false);
            MyScriptWrapper.SetEntityDestructible(vesselGuardL, false);

            m_vesselDetector = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.DetectorVessel));
            m_vesselDetector.On();
            m_vesselDetector.OnEntityEnter += VesselDetectorEntered;
        }
Esempio n. 10
0
        private void StopFollow()
        {
            if (m_stopFollow)
            {
                MyScriptWrapper.StopFollow(m_botToTalk);
            }
            else if (PathName != null) //PATROL MODE
            {
                if (m_botToTalk != null)
                {
                    m_botToTalk.SetWaypointPath(PathName);
                    m_botToTalk.PatrolMode    = MyPatrolMode.CYCLE;
                    m_botToTalk.SpeedModifier = m_slowdown;
                    m_botToTalk.Patrol();
                }
            }

            if (m_botToTalk != null)
            {
                m_botToTalk.LookTarget = null;
            }
        }
        public override void Load() // Code in that block will be called on the load of the sector
        {
            MyScriptWrapper.AlarmLaunched += MyScriptWrapperOnAlarmLaunched;

            MyScriptWrapper.OnHarvesterUse += MyScriptWrapperOnOnHarvesterUse;

            MyScriptWrapper.HideEntity(MyScriptWrapper.GetEntity((uint)EntityID.BotTemplar));
            MyScriptWrapper.ApplyTransition(MyMusicTransitionEnum.CalmAtmosphere); // Sets music group to be played in the sector - no matter if the mission is running or not
            MyScriptWrapper.EnableGlobalEvent(World.Global.MyGlobalEventEnum.SunWind, false);
            MyScriptWrapper.EnableGlobalEvent(World.Global.MyGlobalEventEnum.MeteorWind, false);
            MyScriptWrapper.EnableGlobalEvent(World.Global.MyGlobalEventEnum.IceStorm, false);


            m_captain                  = MyScriptWrapper.GetEntity((uint)EntityID.Captain) as MySmallShipBot;
            m_gateKeeper               = MyScriptWrapper.GetEntity((uint)EntityID.GateKeeper) as MySmallShipBot;
            m_captain.SpeedModifier    = 0.25f;
            m_gateKeeper.SpeedModifier = 0.25f;

            m_captain.SetWaypointPath("Captain");
            m_captain.PatrolMode    = MyPatrolMode.CYCLE;
            m_captain.SpeedModifier = 0.25f;
            m_captain.Patrol();

            m_gateKeeper.SetWaypointPath("GateKeep");
            m_gateKeeper.PatrolMode    = MyPatrolMode.CYCLE;
            m_gateKeeper.SpeedModifier = 0.25f;
            m_gateKeeper.Patrol();

            InitDetector((uint)EntityID.Detector1, OnDetecor1Active);
            InitDetector((uint)EntityID.Detector2, OnDetecor2Active);
            InitDetector((uint)EntityID.Detector3, OnDetecor3Active);
            InitDetector((uint)EntityID.Detector4, OnDetecor4Active);
            InitDetector((uint)EntityID.Detector5, OnDetecor5Active);


            base.Load();
        }
Esempio n. 12
0
        void O04RaceLoaded(MyMissionBase sender)
        {
            MyScriptWrapper.RemoveEntityMark(MyScriptWrapper.GetEntity((uint)EntityID.DetectorStartRacePosition));

            MySmallShipBot challenger = (MySmallShipBot)MyScriptWrapper.GetEntity("Challenger");

            challenger.SetWaypointPath("Gotostart");
            challenger.PatrolMode = CommonLIB.AppCode.ObjectBuilders.Object3D.MyPatrolMode.ONE_WAY;
            challenger.Patrol();
            MyScriptWrapper.SetSleepDistance(challenger, 20000);

            m_playerIsOnStart      = true;
            m_challengerIsOnStart  = true;
            m_unfollowedCompanions = true;


            m_detector_Explosion1.OnEntityEnter += RaceExplosionsDetectorEntered;
            m_detector_Explosion1.On();

            m_detector_Explosion2.OnEntityEnter += RaceExplosionsDetectorEntered;
            m_detector_Explosion2.On();

            m_detector_Explosion3.OnEntityEnter += RaceExplosionsDetectorEntered;
            m_detector_Explosion3.On();

            m_detector_TunnelExplosion.OnEntityEnter += RaceExplosionsDetectorEntered;
            m_detector_TunnelExplosion.On();

            var detectorComentator = MyScriptWrapper.GetDetector(MyScriptWrapper.GetEntity((uint)EntityID.ComentatorDeetctor));

            detectorComentator.OnEntityEnter += DetectorComentatorOnOnEntityEnter;
            detectorComentator.On();


            MyScriptWrapper.SetEntitiesEnabled(m_influenceSpheresFansAfterStart, true);
        }
        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 override void Load()
        {
            //if (!IsMainSector) return;
            MyScriptWrapper.OnSpawnpointBotSpawned += MyScriptWrapperOnOnSpawnpointBotSpawned;
            MyScriptWrapper.EntityDeath            += OnEntityDeath;
            MyGuiScreenGamePlay.Static.CameraContrlolledObjectChanged += Static_CameraContrlolledObjectChanged;



            m_templarBot = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.BotTemplar);
            m_royalBot   = (MySmallShipBot)MyScriptWrapper.GetEntity((uint)EntityID.BotRoyal);

            m_templarBot.SetWaypointPath("Templar");
            m_templarBot.PatrolMode    = MyPatrolMode.CYCLE;
            m_templarBot.SpeedModifier = 0.25f;
            m_templarBot.Patrol();

            m_royalBot.SetWaypointPath("Royal");
            m_royalBot.PatrolMode    = MyPatrolMode.CYCLE;
            m_royalBot.SpeedModifier = 0.25f;
            m_royalBot.Patrol();

            m_ravenguyBot  = MyScriptWrapper.GetEntity("RavenGuy") as MySmallShipBot;
            m_ravengirlBot = MyScriptWrapper.GetEntity("RavenGirl") as MySmallShipBot;
            m_marcus       = MyScriptWrapper.GetEntity("Marcus") as MySmallShipBot;



            MyScriptWrapper.UnhideEntity(MyScriptWrapper.GetEntity((uint)EntityID.BotTemplar));


            m_deadlyScanners = new MyDeadlyScanners(m_scanners1IDs, new List <int>()
            {
                2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000
            });
            if (!MyScriptWrapper.IsMissionFinished(m_disableScanner2.ID))
            {
                Components.Add(m_deadlyScanners);
            }
            DisableEntities(new List <uint>()
            {
                (uint)EntityID.Scanner1, (uint)EntityID.Scanner2
            });

            foreach (var mine in m_minesDummies)
            {
                MyScriptWrapper.GenerateMinesField <MyMineBasic>(MyScriptWrapper.GetEntity(mine),
                                                                 MyMwcObjectBuilder_FactionEnum.Russian_KGB, 1, MyTexts.Mine,
                                                                 MyHudIndicatorFlagsEnum.SHOW_BORDER_INDICATORS |
                                                                 MyHudIndicatorFlagsEnum.ALPHA_CORRECTION_BY_DISTANCE |
                                                                 MyHudIndicatorFlagsEnum.SHOW_TEXT |
                                                                 MyHudIndicatorFlagsEnum.SHOW_DISTANCE |
                                                                 MyHudIndicatorFlagsEnum.SHOW_FACTION_RELATION_MARKER |
                                                                 MyHudIndicatorFlagsEnum.SHOW_ONLY_IF_DETECTED_BY_RADAR
                                                                 );
            }

            if (MySession.Static.EventLog.IsMissionFinished(MyMissionID.FORT_VALIANT_C_FOLLOW_FIND_VENTILATION) && !MySession.Static.EventLog.IsMissionFinished(MyMissionID.FORT_VALIANT_C_CATACOMBS))
            {
                SetFriendsPatrol();
            }

            if (!MyMissions.GetMissionByID(MyMissionID.FORT_VALIANT_C_CAPTAIN).IsCompleted())
            {
                var startPosition = MyScriptWrapper.GetEntity((uint)EntityID.StartLocationC).GetPosition();
                MyScriptWrapper.Move(MyScriptWrapper.GetEntity(MyActorConstants.GetActorName(MyActorEnum.MADELYN)), startPosition);
                MyScriptWrapper.MovePlayerAndFriendsToHangar(this.RequiredActors);
            }


            base.Load();
        }
Esempio n. 15
0
 private void SetPatrolMode()
 {
     m_botToTalk.LookTarget = null;
     m_botToTalk.SetWaypointPath(m_pathName);
     m_botToTalk.Patrol();
 }