private void CreateServices(ServiceType type) { switch (type) { case ServiceType.Ems: "Creating EMS".AddLog(); if (Fiskey111Common.Rand.RandomNumber(2, 3) == 1) { _emstransport = true; } _ems = new Ems(CsiCreator.Victim.Ped, _dispEmsTo, null, _emstransport); _ems.Dispatch(); GameFiber.Sleep(1500); var d = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Ems, _ems.PedDriver), CsiCreator.Victim.Ped.LeftPosition); d.AddPed(0, Game.LocalPlayer.Character); d.AddPed(1, _ems.PedWorker); d.DistanceToStop = 3f; _ems.Dialogue = d; _emsData = new ReportData(ReportData.Service.EMS, _ems.PedDriver, d.Dialogue); _rDataList.Add(_emsData); _ems.VehicleDrivingSpeed = 9f; _ems.VehDrivingFlags = VehicleDrivingFlags.Emergency; break; case ServiceType.Coroner: "Creating Coroner".AddLog(); _coroner = new Coroner(CsiCreator.Victim.Ped, _dispCoronerTo, null); GameFiber.Sleep(0500); _coroner.ModelPedDriver = "s_m_m_scientist_01"; _coroner.ModelPedWorker = "s_m_m_scientist_01"; _coroner.ModelVehicle = Settings.Settings.CoronerModel(); _coroner.Dispatch(); GameFiber.Sleep(1500); _coroner.PedDriver.RandomizeVariation(); _coroner.PedWorker.RandomizeVariation(); var c = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Coroner, _coroner.PedWorker), CsiCreator.Victim.Ped.LeftPosition); c.AddPed(0, Game.LocalPlayer.Character); c.AddPed(1, _coroner.PedWorker); c.DistanceToStop = 3f; _coroner.Dialogue = c; _corData = new ReportData(ReportData.Service.Coroner, _coroner.PedWorker, c.Dialogue); _rDataList.Add(_corData); break; } }
private void InMe() { if (!_notified2) { _notified2 = true; _startingswap = false; NativeFunction.Natives.DO_SCREEN_FADE_IN(1000); var vicData = Serializer.GetSelectedListElementFromXml <PedData>(Main.PDataPath, p => Enumerable.FirstOrDefault <PedData>(p, v => v.Type == PedType.Victim)); var susData = Serializer.GetSelectedListElementFromXml <PedData>(Main.SDataPath, s => Enumerable.FirstOrDefault <PedData>(s, v => v.IsPerp == true)); ("Does ME Exist " + MeCreator.MedicalExaminer.Ped.Exists()).AddLog(); GameFiber.Sleep(0500); _meDialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.MedicalExaminer, MeCreator.MedicalExaminer.Ped, 0, false, vicData, susData), MeCreator.MedicalExaminer.Ped.Position); _meDialog.AddPed(0, Game.LocalPlayer.Character); _meDialog.AddPed(1, MeCreator.MedicalExaminer.Ped); _meDialog.DisableFirstKeypress = false; _meDialog.DistanceToStop = 6f; Vector3 markerPos = new Vector3(MeCreator.MedicalExaminer.Ped.Position.X, MeCreator.MedicalExaminer.Ped.Position.Y, MeCreator.MedicalExaminer.Ped.AbovePosition.Z); _meMarker = new Marker(new Vector3(237.67f, -1367.89f, 39.53f), Color.Green, Marker.MarkerTypes.MarkerTypeUpsideDownCone, true, true, true); "Notified to go speak to ME".AddLog(); Game.DisplayHelp("Go talk to the ~g~Medical Examiner~w~ in the office"); Vector3 p7Pos = new Vector3(MeCreator.MedicalExaminer.Ped.Position.X, MeCreator.MedicalExaminer.Ped.Position.Y, MeCreator.MedicalExaminer.Ped.AbovePosition.Z + 1.5f); } if (Game.LocalPlayer.Character.Position.DistanceTo(MeCreator.MedicalExaminer.Ped.Position) < 4f) { Game.DisplayHelp("Press ~y~Y~w~ to talk to the ~g~Medical Examiner~w~."); _meDialog.StartDialog(); _meMarker.Stop(); while (!_meDialog.HasEnded) { GameFiber.Yield(); } "Sexual Assault Case Update".DisplayNotification("Medical Examiner Conversation \nAdded to ~b~SAJRS", _cData.Number); Game.DisplayHelp("Now that you have the report, ~y~exit~w~ the building"); var rList = Serializer.LoadItemFromXML <List <ReportData> >(Main.RDataPath); _meData = new ReportData(ReportData.Service.ME, MeCreator.MedicalExaminer.Ped, _meDialog.Dialogue, true); rList.Add(_meData); Serializer.SaveItemToXML <List <ReportData> >(rList, Main.RDataPath); _meMarker = new Marker(MeCreator.PPos, Color.Yellow, Marker.MarkerTypes.MarkerTypeUpsideDownCone, true, true, true); SwapStages(InMe, ExitingMe); } }
public void Close() { _state = ELocation.Within15; if (_MEBlip.Exists()) { _MEBlip.Delete(); } NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(_me, Game.LocalPlayer.Character, -1); Game.DisplayHelp("Approach the ~y~Driver~w~ to go to the Medical Examiner's Office"); _dialogstate = EDialog.Pre; Dialog d = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.MeDriver, _me), _me.Position); d.AddPed(0, Game.LocalPlayer.Character); d.AddPed(1, _me); DeactivateStage(Close); }
internal void CreateEntityData(EntityType type, int num = 0) { ("Creating entity: " + type).AddLog(); switch (type) { case EntityType.Vic: $"Victim exists: {CsiCreator.Victim.Exists()}".AddLog(); var boneIDs = new List <PedBoneId> { PedBoneId.Head, PedBoneId.LeftFoot, PedBoneId.RightFoot, PedBoneId.LeftForeArm, PedBoneId.RightForearm, PedBoneId.LeftHand, PedBoneId.RightHand, PedBoneId.LeftThigh, PedBoneId.RightThigh, PedBoneId.LeftUpperArm, PedBoneId.RightUpperArm, PedBoneId.Neck }; Array traces = Enum.GetValues(typeof(EvidenceData.Traces)); Traces trace = (Traces)traces.GetValue(Fiskey111Common.Rand.RandomNumber(traces.Length)); _vicData = new PedData(CsiCreator.Victim.Ped, PedType.Victim, true, false, boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(), boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(), boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(), trace, true); if (MathHelper.GetRandomInteger(6) == 1) { _vicData.IsImportant = true; } _vicData.Model = CsiCreator.Victim.Ped.Model.Name; CsiCreator.Victim.KeyCollect = Settings.Settings.CollectKey(); CsiCreator.Victim.KeyInteract = Settings.Settings.InteractKey(); CsiCreator.Victim.KeyLeave = Settings.Settings.LeaveKey(); break; case EntityType.Fo: $"FO exists: {CsiCreator.FirstOfficer.Exists}".AddLog(); FoDialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Fo, CsiCreator.FirstOfficer.Ped, _wDataList.Count), CsiCreator.FirstOfficer.Ped.Position); FoDialog.AddPed(0, Game.LocalPlayer.Character); FoDialog.AddPed(1, CsiCreator.FirstOfficer.Ped); FoDialog.DistanceToStop = 3f; _foData = new ReportData(ReportData.Service.FO, Functions.GetPersonaForPed(CsiCreator.FirstOfficer.Ped).FullName, FoDialog.Dialogue) { Transcript = FoDialog.Dialogue, Exists = true }; _rDataList.Add(_foData); break; case EntityType.Wit1: if (MathHelper.GetRandomInteger(2) == 1) { "Creating Witness 1".AddLog(); _wit1 = new Services.LtFlash.Common.EvidenceLibrary.Evidence.Witness( "W1", "Witness 1", new Services.SpawnPoint(CsiCreator._W1SpawnPoint.Heading, CsiCreator._W1SpawnPoint.Position), Model.PedModels.ToList()[MathHelper.GetRandomInteger(Model.PedModels.ToList().Count)], null, CsiCreator.EmsLast.Position); _wit1.Ped.IsInvincible = true; _wit1.Ped.RandomizeVariation(); _wit1.Ped.MakeMissionPed(); _wit1.KeyCollect = Settings.Settings.CollectKey(); _wit1.KeyInteract = Settings.Settings.InteractKey(); _wit1.KeyLeave = Settings.Settings.LeaveKey(); _wit1Data = new PedData(_wit1.Ped, PedType.Witness1, MathHelper.GetRandomInteger(3) == 1); if (_wit1Data.IsImportant) { var keys = new List <int>(WitnessData.WhatSeen().Keys); var random = Fiskey111Common.Rand.RandomNumber(0, 8); _wit1Data.WhatSeenInt = keys[random]; _wit1Data.WhatSeenString = WitnessData.WhatSeen()[_wit1Data.WhatSeenInt]; } Wit1Dialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Witness, _wit1.Ped, 0, false, null, null, _wit1Data), _wit1.Ped.Position); Wit1Dialog.AddPed(0, Game.LocalPlayer.Character); Wit1Dialog.AddPed(1, _wit1.Ped); Wit1Dialog.DisableFirstKeypress = false; _wit1Data.Conversation = Wit1Dialog.Dialogue; _caseData.WitnessIDs.Add(1); _wDataList.Add(_wit1Data); _witList.Add(_wit1, Wit1Dialog); GameFiber.Sleep(0500); } break; case EntityType.Wit2: if (MathHelper.GetRandomInteger(2) == 1) { "Creating Witness 2".AddLog(); _wit2 = new Services.LtFlash.Common.EvidenceLibrary.Evidence.Witness( "W2", "Witness 2", new Services.SpawnPoint(CsiCreator._W2SpawnPoint.Heading, CsiCreator._W2SpawnPoint.Position), Model.PedModels.ToList()[MathHelper.GetRandomInteger(Model.PedModels.ToList().Count)], null, CsiCreator.EmsLast.Position); _wit2.Ped.IsInvincible = true; _wit2.Ped.RandomizeVariation(); _wit2.Ped.MakeMissionPed(); _wit2.KeyCollect = Settings.Settings.CollectKey(); _wit2.KeyInteract = Settings.Settings.InteractKey(); _wit2.KeyLeave = Settings.Settings.LeaveKey(); _wit2Data = new PedData(_wit2.Ped, PedType.Witness2, MathHelper.GetRandomInteger(3) == 1); if (_wit2Data.IsImportant) { var keys = new List <int>(WitnessData.WhatSeen().Keys); var random = Fiskey111Common.Rand.RandomNumber(0, 8); _wit2Data.WhatSeenInt = keys[random]; _wit2Data.WhatSeenString = WitnessData.WhatSeen()[_wit2Data.WhatSeenInt]; } Wit2Dialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Witness, _wit2.Ped, 0, false, null, null, _wit2Data), _wit2.Ped.Position); Wit2Dialog.AddPed(0, Game.LocalPlayer.Character); Wit2Dialog.AddPed(1, _wit2.Ped); Wit2Dialog.DisableFirstKeypress = false; _wit2.Dialog = Wit2Dialog; _wit2Data.Conversation = Wit2Dialog.Dialogue; _caseData.WitnessIDs.Add(2); _wDataList.Add(_wit2Data); _witList.Add(_wit2, Wit2Dialog); GameFiber.Sleep(0500); } break; case EntityType.Sus: { "Suspect being created".AddLog(); var s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f); if (!s.IsHuman) { s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f); } GameFiber.Sleep(1000); _sDataList.Add(new PedData(s, PedType.Suspect, false, num == 1)); GameFiber.Sleep(0500); if (s) { s.Delete(); } } break; case EntityType.VicFamily: { "Creating vicfamily member".AddLog(); var s = new Ped(new Vector3(0, 0, 0)); if (!s.IsHuman) { s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f); } GameFiber.Sleep(1000); var data = new PedData(s, PedType.VictimFamily); GameFiber.Sleep(0500); _pDataList.Add(data); GameFiber.Sleep(0500); if (s) { s.Delete(); } } break; } ("Entity " + type + " created successfully").AddLog(); }