예제 #1
0
        private void SetRelationshipsHate()
        {
            foreach (var perp in PedList)
            {
                if (!perp)
                {
                    continue;
                }
                foreach (var perp2 in PedList)
                {
                    Game.SetRelationshipBetweenRelationshipGroups(perp.RelationshipGroup,
                                                                  perp2.RelationshipGroup, Relationship.Hate);
                }

                if (CopPedList.Count > 0)
                {
                    Game.SetRelationshipBetweenRelationshipGroups(perp.RelationshipGroup, CopPedList.FirstOrDefault().RelationshipGroup, Relationship.Hate);
                }
            }
        }
        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;
            }
        }