Пример #1
0
 public override void End()
 {
     CalloutRunning = false;
     //Rage.Native.NativeFunction.Natives.RESET_AI_MELEE_WEAPON_DAMAGE_MODIFIER()
     if (Game.LocalPlayer.Character.IsDead)
     {
         GameFiber.Wait(1500);
         Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
         GameFiber.Wait(3000);
     }
     base.End();
     if (SearchArea.Exists())
     {
         SearchArea.Delete();
     }
     foreach (Blip bl in SuspectBlips)
     {
         if (bl.Exists())
         {
             bl.Delete();
         }
     }
     if (CalloutFinished)
     {
         foreach (Entity ent in Suspects)
         {
             if (ent.Exists())
             {
                 ent.Dismiss();
             }
         }
         foreach (Entity ent in Vehicles)
         {
             if (ent.Exists())
             {
                 ent.Dismiss();
             }
         }
     }
     else
     {
         foreach (Entity ent in Suspects)
         {
             if (ent.Exists())
             {
                 ent.Delete();
             }
         }
         foreach (Entity ent in Vehicles)
         {
             if (ent.Exists())
             {
                 ent.Delete();
             }
         }
     }
 }
Пример #2
0
 public override void End()
 {
     base.End();
     CalloutRunning = false;
     SpeechHandler.HandlingSpeech = false;
     if (!CalloutFinished)
     {
         if (Shopkeeper.Exists())
         {
             Shopkeeper.Delete();
         }
         if (ShopkeeperBlip.Exists())
         {
             ShopkeeperBlip.Delete();
         }
         if (SearchArea.Exists())
         {
             SearchArea.Delete();
         }
     }
     else
     {
         if (Shopkeeper.Exists())
         {
             Shopkeeper.Dismiss();
         }
         if (ShopkeeperBlip.Exists())
         {
             ShopkeeperBlip.Delete();
         }
         if (SearchArea.Exists())
         {
             SearchArea.Delete();
         }
     }
 }
Пример #3
0
        private void CalloutHandler()
        {
            CalloutRunning = true;
            GameFiber.StartNew(delegate
            {
                try
                {
                    //Destination = World.GetNextPositionOnStreet(SpawnPoint.Around(300f));
                    SpawnAllEntities();
                    SearchArea                = new Blip(Suspects[0].Position, 130f);
                    SearchArea.Color          = Color.Yellow;
                    SearchArea.IsRouteEnabled = true;
                    IsRouteEnabled            = true;
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Functions.IsPlayerPerformingPullover())
                        {
                            if (Suspects.Contains(Functions.GetPulloverSuspect(Functions.GetCurrentPullover())))
                            {
                                break;
                            }
                        }

                        foreach (Ped suspect in Suspects)
                        {
                            GameFiber.Yield();
                            if (!Game.LocalPlayer.Character.IsInAnyVehicle(false))
                            {
                                if (Vector3.Distance(suspect.Position, Game.LocalPlayer.Character.Position) < 15f)
                                {
                                    break;
                                }
                            }

                            //if (Vector3.Distance(suspect.Position, Destination) < 50f)
                            //{
                            //    Destination = World.GetNextPositionOnStreet(Destination.Around(300f));

                            //    Suspects[0].Tasks.DriveToPosition(Destination, 60f, VehicleDrivingFlags.Emergency).WaitForCompletion(200);

                            //}
                        }
                        if (Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            Ped nearestsuspect = (from x in Suspects where x.DistanceTo(Game.LocalPlayer.Character.Position) < 30f select x).FirstOrDefault();
                            if (nearestsuspect != null)
                            {
                                if (Game.LocalPlayer.Character.CurrentVehicle.IsPoliceVehicle)
                                {
                                    if (Game.LocalPlayer.Character.CurrentVehicle.IsSirenOn)
                                    {
                                        break;
                                    }
                                }
                            }
                        }

                        if (Vector3.Distance(Suspects[0].Position, SearchArea.Position) > 180f)
                        {
                            SearchArea.Delete();
                            SearchArea                = new Blip(Suspects[0].Position, 110f);
                            SearchArea.Color          = Color.Yellow;
                            SearchArea.IsRouteEnabled = IsRouteEnabled;
                            audiocount++;
                            if (audiocount >= 3)
                            {
                                Functions.PlayScannerAudioUsingPosition("SUSPECTS_LAST_REPORTED IN_OR_ON_POSITION", SearchArea.Position);
                                audiocount = 0;
                            }
                        }

                        if (IsRouteEnabled != Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea.Position) > 180f)
                        {
                            IsRouteEnabled            = Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea.Position) > 180f;
                            SearchArea.IsRouteEnabled = Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea.Position) > 180f;
                        }
                    }

                    if (CalloutRunning)
                    {
                        if (ComputerPlusRunning)
                        {
                            API.ComputerPlusFuncs.SetCalloutStatusToAtScene(CalloutID);
                            API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Vehicles located. In pursuit.");
                        }
                        GameFiber.Wait(1500);
                        Pursuit = Functions.CreatePursuit();

                        foreach (Ped suspect in Suspects.ToArray())
                        {
                            if (Vector3.Distance(suspect.Position, Game.LocalPlayer.Character.Position) < 150f)
                            {
                                Functions.AddPedToPursuit(Pursuit, suspect);
                                if (ComputerPlusRunning)
                                {
                                    API.ComputerPlusFuncs.AddVehicleToCallout(CalloutID, suspect.CurrentVehicle);
                                }
                            }
                            else
                            {
                                Suspects.Remove(suspect);
                                Vehicles.Remove(suspect.CurrentVehicle);
                                suspect.Dismiss();
                                suspect.CurrentVehicle.Dismiss();
                            }
                        }
                        Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                        Functions.ForceEndCurrentPullover();
                        if (SearchArea.Exists())
                        {
                            SearchArea.Delete();
                        }
                        Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                    }

                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        foreach (Ped suspect in Suspects.ToArray())
                        {
                            if (!suspect.Exists())
                            {
                                EscapeCount++;
                                Suspects.Remove(suspect);
                            }
                            else if (Functions.IsPedArrested(suspect))
                            {
                                ArrestCount++;
                                Suspects.Remove(suspect);
                            }
                            else if (suspect.IsDead)
                            {
                                DeadCount++;
                                Suspects.Remove(suspect);
                            }
                            else if (Vector3.Distance(suspect.Position, Game.LocalPlayer.Character.Position) > 1000f)
                            {
                                EscapeCount++;
                                Suspects.Remove(suspect);
                                if (suspect.CurrentVehicle.Exists())
                                {
                                    suspect.CurrentVehicle.Delete();
                                }
                                suspect.Delete();
                                Game.DisplayNotification("A suspect has escaped.");
                            }
                        }
                        if (!Functions.IsPursuitStillRunning(Pursuit))
                        {
                            break;
                        }
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("Assorted Callouts handled the exception successfully.");
                        Game.DisplayNotification("~O~OrganisedStreetRace~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
Пример #4
0
        public override void End()
        {
            CalloutRunning = false;
            Rage.Native.NativeFunction.Natives.CLEAR_PED_NON_CREATION_AREA();
            NativeFunction.Natives.SET_STORE_ENABLED(true);
            if (Game.LocalPlayer.Character.Exists())
            {
                if (Game.LocalPlayer.Character.IsDead)
                {
                    GameFiber.Wait(1500);
                    Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
                    GameFiber.Wait(3000);
                    if (ComputerPlusRunning)
                    {
                        API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Officer down. Urgent assistance required.");
                    }
                }
            }
            else
            {
                GameFiber.Wait(1500);
                Functions.PlayScannerAudio("OFFICER HAS_BEEN_FATALLY_SHOT NOISE_SHORT OFFICER_NEEDS_IMMEDIATE_ASSISTANCE");
                GameFiber.Wait(3000);
                if (ComputerPlusRunning)
                {
                    API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Officer down. Urgent assistance required.");
                }
            }
            base.End();
            if (SearchArea.Exists())
            {
                SearchArea.Delete();
            }

            if (CalloutFinished)
            {
                foreach (Ped ShopKeeper in ShopKeepers)
                {
                    if (ShopKeeper.Exists())
                    {
                        ShopKeeper.Tasks.Clear(); ShopKeeper.IsPersistent = false;
                    }
                }
                foreach (Ped suspect in Suspects)
                {
                    if (suspect.Exists())
                    {
                        Suspect.IsPersistent = false;
                    }
                }
                foreach (Rage.Object MoneyBag in MoneyBags)
                {
                    if (MoneyBag.Exists())
                    {
                        MoneyBag.Detach();
                        MoneyBag.Dismiss();
                    }
                }
                if (EscapeVanDriver.Exists())
                {
                    EscapeVanDriver.IsPersistent = false;
                }
                if (EscapeVan.Exists())
                {
                    EscapeVan.Dismiss();
                }
            }
            else
            {
                foreach (Ped ShopKeeper in ShopKeepers)
                {
                    if (ShopKeeper.Exists())
                    {
                        ShopKeeper.Delete();
                    }
                }
                foreach (Rage.Object MoneyBag in MoneyBags)
                {
                    if (MoneyBag.Exists())
                    {
                        MoneyBag.Delete();
                    }
                }
                foreach (Ped suspect in Suspects)
                {
                    if (suspect.Exists())
                    {
                        suspect.Delete();
                    }
                }
                if (EscapeVan.Exists())
                {
                    EscapeVan.Delete();
                }
                if (EscapeVanDriver.Exists())
                {
                    EscapeVanDriver.Delete();
                }
            }
        }
Пример #5
0
        private void SituationWaitForArriveFleeStab()
        {
            GameFiber.StartNew(delegate
            {
                try
                {
                    Suspect.Tasks.Wander();
                    Suspect.Inventory.GiveNewWeapon("WEAPON_KNIFE", -1, true);
                    Functions.SetPedCantBeArrestedByPlayer(Suspect, true);
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea.Position) < 55f)
                        {
                            PlaySuspectDescriptionAudio();
                            break;
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 15f && !Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            SuspectBlip       = Suspect.AttachBlip();
                            SuspectBlip.Color = Color.Red;
                            SuspectBlip.Scale = 0.6f;
                            Pursuit           = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(Pursuit, Suspect);
                            Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                            Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                            GameFiber.Yield();
                            NativeFunction.Natives.TASK_SMART_FLEE_PED(Suspect, Game.LocalPlayer.Character, 150f, 30000, true, true);
                            SearchArea.Delete();
                            GameFiber.Wait(3000);
                            break;
                        }
                        if (Vector3.Distance(Suspect.Position, SearchArea.Position) > 42f)
                        {
                            SearchAreaLocation  = Suspect.Position.Around(10f, 30f);
                            SearchArea.Position = SearchAreaLocation;
                        }
                    }

                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 8.5f && !Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            if (Suspect.Speed > 3f)
                            {
                                GameFiber.Wait(2500);
                            }

                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(1.5f);

                            Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);

                            break;
                        }
                    }
                    bool isragdoll = false;
                    if (CalloutRunning)
                    {
                        suspecthealth = Suspect.Health;
                        paincount     = 0;
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Suspect.IsDead || Functions.IsPedArrested(Suspect))
                        {
                            break;
                        }

                        if (Suspect.IsRagdoll && !isragdoll)
                        {
                            isragdoll = true;
                            paincount++;
                            //Game.LogTrivial("Paincount ragdoll");
                        }
                        else if (!Suspect.IsRagdoll && isragdoll)
                        {
                            isragdoll = false;
                        }

                        else if (Suspect.Health < suspecthealth)
                        {
                            paincount++;

                            //Game.LogTrivial("Paincount health");
                        }
                        suspecthealth = Suspect.Health;
                        if (paincount >= 3)
                        {
                            Functions.SetPedCantBeArrestedByPlayer(Suspect, false);
                        }
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("Assorted Callouts handled the exception successfully.");
                        Game.DisplayNotification("~O~Personwithaknife~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
Пример #6
0
        private void SituationAttackOtherPed()
        {
            GameFiber.StartNew(delegate
            {
                try
                {
                    Suspect.Tasks.Wander();
                    Suspect.Inventory.GiveNewWeapon("WEAPON_KNIFE", -1, true);
                    Functions.SetPedCantBeArrestedByPlayer(Suspect, true);
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();

                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 120f)
                        {
                            //Victim = new Ped(Model.PedModels.ToList().Shuffle()[0], Suspect.GetOffsetPosition(Vector3.RelativeFront * 3f), 0f);
                            Victim = NativeFunction.Natives.CREATE_RANDOM_PED <Ped>(Suspect.GetOffsetPosition(Vector3.RelativeFront * 3f).X, Suspect.GetOffsetPosition(Vector3.RelativeFront * 3f).Y, Suspect.GetOffsetPosition(Vector3.RelativeFront * 3f).Z);
                            Victim.MakeMissionPed();
                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(1.5f);
                            Game.LogTrivial("Victim health: " + Victim.Health.ToString());
                            Victim.Health = 150;
                            Functions.PlayScannerAudio("WE_HAVE CRIME_STABBING UNITS_RESPOND_CODE_99");
                            Game.DisplayNotification("~b~Control: ~s~Suspect is reportedly stabbing a victim. Respond ~b~CODE 99!");
                            if (ComputerPlusRunning)
                            {
                                API.ComputerPlusFuncs.AddUpdateToCallout(CalloutID, "Suspect is stabbing a victim. Units urgently required at scene.");
                            }
                            GameFiber.Wait(2000);
                            Suspect.Tasks.FightAgainst(Victim);
                            GameFiber.Wait(600);
                            NativeFunction.Natives.TASK_SMART_FLEE_PED(Victim, Suspect, 10f, -1, true, true);
                            Functions.RequestBackup(Suspect.Position, LSPD_First_Response.EBackupResponseType.Code3, LSPD_First_Response.EBackupUnitType.LocalUnit);

                            break;
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 30f)
                        {
                            PlaySuspectDescriptionAudio();

                            break;
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 15f && !Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            SuspectBlip       = Suspect.AttachBlip();
                            SuspectBlip.Color = Color.Red;
                            SuspectBlip.Scale = 0.6f;
                            VictimBlip        = Victim.AttachBlip();
                            VictimBlip.Color  = Color.Green;
                            VictimBlip.Scale  = 0.6f;
                            Pursuit           = Functions.CreatePursuit();
                            Functions.AddPedToPursuit(Pursuit, Suspect);
                            Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                            Functions.PlayScannerAudioUsingPosition("WE_HAVE CRIME_RESIST_ARREST IN_OR_ON_POSITION", Game.LocalPlayer.Character.Position);
                            GameFiber.Yield();
                            NativeFunction.Natives.TASK_SMART_FLEE_PED(Suspect, Game.LocalPlayer.Character, 150f, -1, true, true);
                            SearchArea.Delete();
                            GameFiber.Wait(3000);

                            break;
                        }
                        if (Vector3.Distance(Suspect.Position, SearchArea.Position) > 42f)
                        {
                            SearchAreaLocation  = Suspect.Position.Around(10f, 30f);
                            SearchArea.Position = SearchAreaLocation;
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Vector3.Distance(Game.LocalPlayer.Character.Position, Suspect.Position) < 10f && !Game.LocalPlayer.Character.IsInAnyVehicle(false))
                        {
                            GameFiber.Wait(2500);
                            Rage.Native.NativeFunction.Natives.SET_AI_MELEE_WEAPON_DAMAGE_MODIFIER(1.5f);

                            Suspect.Tasks.FightAgainst(Game.LocalPlayer.Character);

                            break;
                        }
                    }
                    //bool isragdoll = false;
                    if (CalloutRunning)
                    {
                        suspecthealth = Suspect.Health;
                        paincount     = 0;
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        if (Suspect.IsDead || Functions.IsPedArrested(Suspect))
                        {
                            break;
                        }

                        //if (Suspect.IsRagdoll && !isragdoll)
                        //{
                        //    isragdoll = true;
                        //    paincount++;
                        //    Game.LogTrivial("Paincount ragdoll");
                        //}
                        //else if (!Suspect.IsRagdoll)
                        //{
                        //    isragdoll = false;
                        //}

                        if (Suspect.Health < suspecthealth)
                        {
                            paincount++;
                            suspecthealth = Suspect.Health;
                            //Game.LogTrivial("Paincount health");
                        }

                        if (paincount >= 2)
                        {
                            Functions.SetPedCantBeArrestedByPlayer(Suspect, false);
                        }
                    }
                    while (CalloutRunning)
                    {
                        GameFiber.Yield();
                        Game.DisplayHelp("When you're done, press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.EndCallKey) + " ~s~to end the call.");
                        if (Game.IsKeyDown(AssortedCalloutsHandler.EndCallKey))
                        {
                            Game.HideHelp();
                            break;
                        }
                    }
                    DisplayCodeFourMessage();
                }
                catch (System.Threading.ThreadAbortException e)
                {
                    End();
                }
                catch (Exception e)
                {
                    if (CalloutRunning)
                    {
                        Game.LogTrivial(e.ToString());
                        Game.LogTrivial("Assorted Callouts handled the exception successfully.");
                        Game.DisplayNotification("~O~Personwithaknife~s~ callout crashed, sorry. Please send me your log file.");
                        Game.DisplayNotification("Full LSPDFR crash prevented ~g~successfully.");
                        End();
                    }
                }
            });
        }
Пример #7
0
        private void SituationTwo()
        {
            StolenGoodsValue = AssortedCalloutsHandler.rnd.Next(5, 500);
            SpawnStorePeds();
            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea) < 150f)
                {
                    SearchArea.IsRouteEnabled = false;
                    break;
                }
            }
            if (ComputerPlusRunning)
            {
                API.ComputerPlusFuncs.SetCalloutStatusToAtScene(CalloutID);
            }
            if (CalloutRunning)
            {
                SearchArea.Delete();
                Suspects[0].Position = World.GetNextPositionOnStreet(Suspects[0].Position);
                Pursuit = Functions.CreatePursuit();
                Functions.AddPedToPursuit(Pursuit, Suspects[0]);
                Functions.SetPedAsCop(Security[0]);
                Security[0].MakeMissionPed();
                Functions.AddCopToPursuit(Pursuit, Security[0]);
                Functions.SetPursuitIsActiveForPlayer(Pursuit, true);
                Game.DisplayNotification("3dtextures", "mpgroundlogo_cops", "~b~" + ShopliftingStore.Name + " ~r~shoplifting", "Dispatch to ~b~" + AssortedCalloutsHandler.DivisionUnitBeat, "Suspect has reportedly escaped from the store and is now being chased by security. Apprehend the suspect.");
                Functions.PlayScannerAudioUsingPosition("WE_HAVE_01 CRIME_RESIST_ARREST IN_OR_ON_POSITION", SpawnPoint);
            }
            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (!Functions.IsPursuitStillRunning(Pursuit))
                {
                    GameFiber.Wait(3000);
                    SearchArea                = ShopKeepers[0].AttachBlip();
                    SearchArea.Color          = System.Drawing.Color.Yellow;
                    SearchArea.IsRouteEnabled = true;
                    break;
                }
            }

            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (Vector3.Distance(Game.LocalPlayer.Character.Position, ShopKeepers[0].Position) < 4f)
                {
                    if (SearchArea.Exists())
                    {
                        SearchArea.IsRouteEnabled = false;
                        SearchArea.Delete();
                    }
                    Game.DisplayHelp("Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.TalkKey) + " ~s~to talk.");
                    if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(AssortedCalloutsHandler.TalkKey))
                    {
                        ShopKeepers[0].Tasks.ClearImmediately();
                        SpeechHandler.HandleSpeech("Shopkeeper", DetermineShopkeeperLines(), ShopKeepers[0]);
                        GameFiber.Wait(4000);
                        break;
                    }
                }
                else
                {
                    Game.DisplayHelp("Talk to the ~b~shopkeeper ~s~for a victim statement.");
                }
            }

            while (CalloutRunning)
            {
                GameFiber.Yield();
                Game.DisplayHelp("Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.EndCallKey) + " ~s~when you're done investigating.");
                if (Game.IsKeyDown(AssortedCalloutsHandler.EndCallKey))
                {
                    Game.HideHelp();
                    break;
                }
            }
            DisplayCodeFourMessage();
        }
Пример #8
0
        private void SituationOne()
        {
            //One robber, one shopkeeper. Wait, fight, flee (pursuit).
            StolenGoodsValue = AssortedCalloutsHandler.rnd.Next(5, 300);
            SpawnStorePeds();
            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (Vector3.Distance(Game.LocalPlayer.Character.Position, SearchArea) < 40f)
                {
                    SearchArea.IsRouteEnabled = false;
                    break;
                }
            }
            if (ComputerPlusRunning)
            {
                API.ComputerPlusFuncs.SetCalloutStatusToAtScene(CalloutID);
            }
            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (NativeFunction.Natives.GET_INTERIOR_FROM_ENTITY <int>(Game.LocalPlayer.Character) != 0)
                {
                    SpeechHandler.HandleSpeech("Shopkeeper", "Hey officer, the scumbag is in the back!");
                    break;
                }
            }
            while (CalloutRunning)
            {
                GameFiber.Yield();
                if (Vector3.Distance(Game.LocalPlayer.Character.Position, Security[0].Position) < 4f)
                {
                    Game.DisplayHelp("Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.TalkKey) + " ~s~to talk.");
                    if (Albo1125.Common.CommonLibrary.ExtensionMethods.IsKeyDownComputerCheck(AssortedCalloutsHandler.TalkKey))
                    {
                        Security[0].Tasks.ClearImmediately();

                        break;
                    }
                }
                else
                {
                    Game.HideHelp();
                }
            }
            if (CalloutRunning)
            {
                SearchArea.Delete();
                DetermineSecurityLines();
                SpeechHandler.HandleSpeech("Security", DetermineSecurityLines(), Security[0]);
                SpeechHandler.HandleSpeech("Suspect", DetermineSuspectLines(), Suspects[0]);
            }

            while (CalloutRunning)
            {
                GameFiber.Yield();
                Game.DisplayHelp("Deal with the situation as you see fit. Press ~b~" + AssortedCalloutsHandler.kc.ConvertToString(AssortedCalloutsHandler.EndCallKey) + " ~s~when done.");
                if (Game.IsKeyDown(AssortedCalloutsHandler.EndCallKey))
                {
                    Game.HideHelp();
                    break;
                }
            }
            DisplayCodeFourMessage();
        }