public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;

            CreateCopsOnScene(true);

            PedList = SpawnPeds(RandomNumber(1, 3), 12f, 13f);

            GiveHeavyWeapons(PedList);

            AddPedListWeapons(PedList, PedType.Type.Suspect);

            DisplayAdditionalInformation(CalloutMsg);

            for (var i = 0; i < RandomNumber(2); i++)
            {
                SpawnSpecialPed();
            }

            ResponseInfo = CalloutResponseInfo;

            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            CalloutEState = EState.Accepted;

            return(base.OnCalloutAccepted());
        }
        public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;

            CreateCopsOnScene(false);

            PedList = SpawnPeds(Fiskey111Common.Rand.RandomNumber(1, 4), 9f, 12f);

            ResponseInfo = CalloutResponseInfo;

            GiveWeaponOrArmor(PedList);

            AddPedListWeapons(PedList, PedType.Type.Suspect);

            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            SpawnBlip = false;

            CreatePursuit(PedList);

            return(base.OnCalloutAccepted());
        }
Ejemplo n.º 3
0
        public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;
            ResponseInfo       = CalloutResponseInfo;
            BlipAlpha          = 0.75f;
            CalloutEState      = EState.Accepted;
            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            _ambulance = new Vehicle(new Model("ambulance"), SpawnPoint)
            {
                IsSirenOn     = true,
                IsSirenSilent = true
            };

            _emsList = SpawnPeds("s_m_m_paramedic_01", 2, 2f);
            PedList  = SpawnPeds(Fiskey111Common.Rand.RandomNumber(2, 6));

            AddPedList(_emsList, PedType.Type.Service);
            GiveWeaponOrArmor(PedList);
            AddPedListWeapons(PedList, PedType.Type.Suspect);

            return(base.OnCalloutAccepted());
        }
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.EnRoute:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.DecisionMade;
                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetRelationshipGroups(PedList, "Fiskey111Perps");

                SetRelationshipsHate(PedList, CopPedList);

                SetPlayerRelationships(PedList);
                SetPlayerRelationships(CopPedList, Relationship.Companion);

                GiveFightTask(PedList);

                break;

            case EState.DecisionMade:
                if (PlayerDistanceFromSpawnPoint > 30f)
                {
                    break;
                }

                CalloutEState = EState.Checking;

                break;

            case EState.Checking:
                IsNearAnyPed(PedList);
                if (PedCheck(SuspectPositionCheck(PedList).ToList()))
                {
                    GiveCourtCase(PedList.Where(p => p.IsAlive).ToList(), "Attempted murder of a police officer; Illegal possession of a firearm");
                    CalloutFinished();
                    this.End();
                }

                break;
            }
        }
 public override void OnCalloutNotAccepted()
 {
     base.OnCalloutNotAccepted();
     if (_computerPlus)
     {
         ComputerPlusAPI.AssignCallToAIUnit(_callId);
     }
     if (Settings.AiAudio)
     {
         Functions.PlayScannerAudio("OFFICER_INTRO_01 UNIT_RESPONDING_DISPATCH_04");
     }
 }
Ejemplo n.º 6
0
        public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;

            CreateCopsOnScene(true);

            var ballasSpawn = SpawnPoint.Around2D(6f);
            var lostSpawn   = ballasSpawn.Around2D(18f);

            for (var l = 1; l < RandomNumber(5, 10); l++)
            {
                var model = _ballasModelArray[RandomNumber(_ballasModelArray.Length)];
                $"Creating ped model {model}".AddLog();
                _ballasList.Add(new Ped(model, ballasSpawn.Around2D(1f, 2f), 0f));
            }

            for (var l = 0; l < RandomNumber(2); l++)
            {
                _vehList.Add(new Vehicle(new Model(_ballasVehicles[RandomNumber(_ballasVehicles.Length)]), ballasSpawn));
                _vehList[l].PrimaryColor = Color.MediumPurple;
            }

            for (var l = 1; l < RandomNumber(5, 10); l++)
            {
                var model = _lostModelArray[RandomNumber(_lostModelArray.Length)];
                $"Creating ped model {model}".AddLog();
                _lostList.Add(new Ped(model, lostSpawn.Around2D(1f, 2f), 0f));
            }

            for (var l = 0; l < RandomNumber(2); l++)
            {
                _vehList.Add(new Vehicle(new Model(_lostVehicles[RandomNumber(_lostVehicles.Length)]), ballasSpawn));
            }

            DisplayAdditionalInformation(CalloutMsg);
            ResponseInfo = CalloutResponseInfo;

            GiveWeapons(_ballasList);
            GiveWeapons(_lostList);


            AddPedListWeapons(_ballasList, PedType.Type.Suspect);
            AddPedListWeapons(_lostList, PedType.Type.Suspect);

            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            CalloutEState = EState.Accepted;

            return(base.OnCalloutAccepted());
        }
        public void CalloutFinished()
        {
            "CalloutFinished()".AddLog();
            if (_computerPlus)
            {
                ComputerPlusAPI.ConcludeCallout(_callId);
            }
            DisplayEndInformation();

            var fiber = new GameFiber(DetectiveFiber);

            fiber.Start();
            _activeFibers.Add(fiber);
        }
        public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;
            ResponseInfo       = CalloutResponseInfo;
            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            PedList = SpawnPeds(Fiskey111Common.Rand.RandomNumber(1, 10), 4f);
            CreateCopsOnScene(false, true, false, 1);

            GiveWeaponOrArmor(PedList);
            AddPedListWeapons(PedList, PedType.Type.Suspect);

            CalloutEState = EState.EnRoute;

            return(base.OnCalloutAccepted());
        }
Ejemplo n.º 9
0
 public override bool OnCalloutAccepted()
 {
     "Starting OnCalloutAccepted".AddLog();
     AcceptScannerAudio = _acceptAudio;
     ResponseInfo       = CalloutResponseInfo;
     if (ComputerPlus_Active)
     {
         ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
     }
     SpawnBlip = false;
     "Initial data set".AddLog();
     CreateCopsOnScene(false);
     "Cops created".AddLog();
     PedList = SpawnPeds(Fiskey111Common.Rand.RandomNumber(3, 4), 12f, 12f);
     "Peds created".AddLog();
     GiveWeaponOrArmor(PedList);
     AddPedListWeapons(PedList, PedType.Type.Suspect);
     "Peds given weapons and data stored".AddLog();
     CreatePursuit(PedList);
     "Pursuit created".AddLog();
     return(base.OnCalloutAccepted());
 }
        public override bool OnCalloutAccepted()
        {
            "Callout has been accepted".AddLog();

            if (!string.IsNullOrWhiteSpace(AcceptScannerAudio))
            {
                var fiber = new GameFiber(StartSecondaryAudio);
                fiber.Start();
                _activeFibers.Add(fiber);
            }

            if (_computerPlus)
            {
                ComputerPlusAPI.SetCalloutStatusToUnitResponding(_callId);
            }

            //            if (FalseCall && Fiskey111Common.Rand.RandomNumber(1, 15) == 1)
            //            {
            //                "False Call".AddLog();
            //                _isFalseCall = true;
            //                FalseCallHandler.callState = FalseCallHandler.CallState.Start;
            //            }

            //CalloutName.DisplayNotification(ResponseInfo);

            var position = SpawnPoint.Around2D(5f, 20f);

            if (SpawnBlip)
            {
                AreaBlip       = CalloutStandardization.CreateStandardizedBlip(position, BlipType, BlipScale);
                AreaBlip.Alpha = BlipAlpha;
                AreaBlip.EnableRoute(AreaBlip.Color);
            }

            "Returning OnCalloutAccepted".AddLog();

            return(base.OnCalloutAccepted());
        }
Ejemplo n.º 11
0
        public override bool OnCalloutAccepted()
        {
            AcceptScannerAudio = _acceptAudio;

            PedList     = SpawnPeds(Fiskey111Common.Rand.RandomNumber(1, 3));
            _targetList = SpawnPeds(Fiskey111Common.Rand.RandomNumber(1, 4));

            ResponseInfo = CalloutResponseInfo;

            GiveWeaponOrArmor(PedList);

            AddPedListWeapons(PedList, PedType.Type.Suspect);
            AddPedList(_targetList, PedType.Type.Victim);

            if (ComputerPlus_Active)
            {
                ComputerPlusAPI.AddUpdateToCallout(ComputerPlus_GUID, ComputerPlusUpdate);
            }

            CalloutEState = EState.EnRoute;

            return(base.OnCalloutAccepted());
        }
        public override bool OnBeforeCalloutDisplayed()
        {
            $"Starting callout".AddLog();
            SpawnPoint = World.GetNextPositionOnStreet(Game.LocalPlayer.Character.Position.Around2D(250f, 350f));

            this.ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 150f);

            this.CalloutPosition = SpawnPoint;

            Functions.PlayScannerAudio(StartScannerAudio);

            if (PluginCheck.IsComputerPlusRunning())
            {
                $"Computer+ found".AddLog();
                _computerPlus = true;
                _callId       = ComputerPlusAPI.CreateCallout(CalloutName, SpawnPoint,
                                                              (int)ComputerPlus_ResponseType, ComputerPlus_CallMsg);
                ComputerPlusAPI.UpdateCalloutStatus(_callId, 2);
            }

            _sw.Start();

            return(base.OnBeforeCalloutDisplayed());
        }
Ejemplo n.º 13
0
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.Accepted:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.OnScene;

                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetRelationshipGroups(_ballasList, "FiskeyBallas");
                SetRelationshipGroups(_lostList, "FiskeyLost");

                SetRelationshipsHate(_ballasList, _lostList);
                SetRelationshipsHate(_lostList, _ballasList);

                SetRelationshipsHate(CopPedList, _ballasList);
                SetRelationshipsHate(CopPedList, _lostList);
                SetPlayerRelationships(_ballasList);
                SetPlayerRelationships(_lostList);

                GiveFightTasks(_ballasList);
                GiveFightTasks(_lostList);
                GiveFightTasks(CopPedList);

                "Swapping to OnScene".AddLog();

                break;

            case EState.OnScene:
                if (PlayerDistanceFromSpawnPoint > 45f)
                {
                    break;
                }

                if (RandomNumber(10) == 1)
                {
                    RequestBackup(RandomNumber(2) == 1 ? GangType.Ballas : GangType.Lost);
                }

                CalloutEState = EState.Checking;

                break;

            case EState.Checking:
                IsNearAnyPed(_ballasList, _lostList);
                if (PedCheck(_ballasList) && PedCheck(_lostList))
                {
                    GiveCourtCase(PedList.Where(p => p.IsAlive).ToList(), "Assault with a deadly weapon; Murder");
                    CalloutFinished();
                    this.End();
                }
                break;
            }
        }
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.EnRoute:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.DecisionMade;
                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetPedAsPursuitOrFight(PedList);

                break;

            case EState.DecisionMade:
                if (PlayerDistanceFromSpawnPoint > 30f)
                {
                    break;
                }

                CalloutEState = EState.Checking;
                if (AreaBlip.Exists())
                {
                    AreaBlip.Delete();
                }

                break;

            case EState.Checking:
                if (IsNearOfficer)
                {
                    if (_cprStarted)
                    {
                        return;
                    }

                    if (!_helpDisplayed)
                    {
                        _helpDisplayed = true;
                        Game.DisplayHelp("Press ~y~Y~w~ to perform CPR on the ~y~officer~w~ while you wait for ~g~EMS~w~");
                    }
                    if (!Game.IsKeyDown(System.Windows.Forms.Keys.Y))
                    {
                        return;
                    }
                    Game.LocalPlayer.Character.Position = CopPedList[0].LeftPosition;
                    _procHost.ActivateProcess(StartCPR);
                    _procHost.Start();
                }
                break;
            }
        }
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.Accepted:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.OnScene;

                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetRelationshipGroups(PedList, "FiskeyPerps");

                SetRelationships(PedList, CopPedList);
                SetRelationships(PedList, PedList.FirstOrDefault().GetNearbyPeds(5));

                SetPlayerRelationships(CopPedList, Relationship.Companion);
                SetPlayerRelationships(PedList);

                GiveFightTasks(PedList);

                LSPD_First_Response.Mod.API.Functions.PlayScannerAudio(_mgScanner);

                for (var i = 0; i < RandomNumber(4); i++)
                {
                    SendBackup(SpawnPoint);
                }

                break;

            case EState.OnScene:
                if (PlayerDistanceFromSpawnPoint > 45f)
                {
                    break;
                }

                CalloutEState = EState.Checking;

                foreach (var ped in PedList)
                {
                    if (!ped)
                    {
                        continue;
                    }
                    ped.Tasks.TakeCoverFrom(CopPedList.FirstOrDefault(), -1, true);
                }

                break;

            case EState.Checking:
                IsNearAnyPed(PedList, CopPedList);
                PedList = SuspectPositionCheck(PedList);
                if (PedCheck(PedList.ToList()))
                {
                    GiveCourtCase(PedList.Where(p => p.IsAlive).ToList(), "Assault with a deadly weapon; Possession of an illegal firearm");
                    CalloutFinished();
                    this.End();
                }
                break;
            }
        }
Ejemplo n.º 16
0
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.EnRoute:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.DecisionMade;
                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetRelationshipGroups();

                SetRelationshipsHate();

                StartPursuit();

                StartFightTask();

                break;

            case EState.DecisionMade:
                if (PlayerDistanceFromSpawnPoint > 50f)
                {
                    break;
                }
                if (!StartedWeaponFireCheck)
                {
                    StartWeaponFireCheck(PedList.ToList());
                }

                if (PlayerDistanceFromSpawnPoint > 40f)
                {
                    break;
                }

                CalloutEState = EState.Checking;

                break;

            case EState.Checking:
                IsNearAnyPed(PedList);
                PedList = SuspectPositionCheck(PedList);
                if (PedCheck(PedList.ToList()))
                {
                    GiveCourtCase(PedList.Where(p => p.IsAlive).ToList(), "Assault and battery");
                    CalloutFinished();
                    this.End();
                }

                break;
            }
        }
Ejemplo n.º 17
0
        public override void Process()
        {
            base.Process();

            if (IsFalseCall)
            {
                return;
            }

            switch (CalloutEState)
            {
            case EState.Accepted:
                if (PlayerDistanceFromSpawnPoint > 100f)
                {
                    break;
                }

                CalloutEState = EState.EnRoute;
                if (ComputerPlus_Active)
                {
                    ComputerPlusAPI.SetCalloutStatusToAtScene(ComputerPlus_GUID);
                }

                SetRelationshipGroups(PedList, "Fiskey111Perps");
                SetRelationshipGroups(_emsList, "Fiskey111EMS");

                SetRelationshipsHate(PedList, _emsList);
                SetRelationshipsHate(_emsList, PedList);
                SetPlayerRelationships(_emsList, Relationship.Companion);

                StartFightTask(PedList);
                StartFightTask(_emsList);
                break;

            case EState.EnRoute:
                if (PlayerDistanceFromSpawnPoint > 50f)
                {
                    break;
                }
                if (!StartedWeaponFireCheck)
                {
                    StartWeaponFireCheck(PedList);
                }

                if (PlayerDistanceFromSpawnPoint > 40f)
                {
                    break;
                }

                CalloutEState = EState.Checking;

                _hasArrived = true;
                break;

            case EState.Checking:
                IsNearAnyPed(PedList, _emsList);
                CheckIfBeingArrested();
                PedList = SuspectPositionCheck(PedList);
                if (PedCheck(PedList))
                {
                    CalloutFinished();
                    GiveCourtCase(PedList.Where(p => p.IsAlive).ToList(), "Assault and battery on a paramedic");
                    this.End();
                }
                break;
            }
        }