protected void SetScriptFinished() { var value = _isImportant == true ? 100 : 50; var medal = value < 100 ? MissionPassedScreen.Medal.Silver : MissionPassedScreen.Medal.Gold; var tick = _isImportant == true ? MissionPassedScreen.TickboxState.Tick : MissionPassedScreen.TickboxState.Empty; var handler = new MissionPassedHandler("Medical Examiner", value, medal); handler.AddItem("Updated by Medical Examiner", "Details Received", MissionPassedScreen.TickboxState.Tick); handler.AddItem("Suspect Acquired", "", tick); handler.Show(); _cData.CurrentStage = CaseData.LastStage.MedicalExaminer; _cData.LastCompletedStage = CaseData.LastStage.MedicalExaminer; _cData.CompletedStages.Add(CaseData.LastStage.MedicalExaminer); _cData.SajrsUpdates.Add("Medical Examiner Report Added"); _cData.StartingStage = this.Attributes.NextScripts.FirstOrDefault(); $"Case number: {_cData.Number}".AddLog(); Serializer.SaveItemToXML(_cData, Main.CDataPath); Functions.PlayScannerAudio("ATTN_DISPATCH CODE_04_PATROL"); "Terminating L.S. Noir Callout: Sexual Assault -- Stage 2b [ME]".AddLog(); if (_me.Exists()) { _me.Dismiss(); } if (_meCar.Exists()) { _meCar.Dismiss(); } SetScriptFinished(true); }
protected void SetScriptFinished() { var value = _interrogation.QuestionList.Where(q => q.Value == false) .Aggregate(100, (current, q) => current - 10); var medal = MissionPassedScreen.Medal.Gold; if (value >= 80 && value < 100) { medal = MissionPassedScreen.Medal.Silver; } else if (value < 80) { medal = MissionPassedScreen.Medal.Bronze; } var handler = new MissionPassedHandler("Victim Family", value, medal); handler.AddItem("Spoke to Family", "", MissionPassedScreen.TickboxState.Tick); var num = 0; foreach (var q in _interrogation.QuestionList) { num++; var correct = q.Value ? "Correct" : "Incorrect"; handler.AddItem($"Question {num}", correct, MissionPassedScreen.TickboxState.None); } handler.Show(); _cData.CurrentStage = CaseData.LastStage.VictimFamily; _cData.CompletedStages.Add(CaseData.LastStage.VictimFamily); _cData.SajrsUpdates.Add("Talked to Witness Family"); _cData.StartingStage = this.Attributes.NextScripts.FirstOrDefault(); _cData.LastCompletedStage = CaseData.LastStage.VictimFamily; Serializer.SaveItemToXML <CaseData>(_cData, Main.CDataPath); var l = Serializer.LoadItemFromXML <List <ReportData> >(Main.RDataPath); l.Add(_vfData); Serializer.SaveItemToXML(l, Main.RDataPath); $"Case number: {_cData.Number}".AddLog(); Functions.PlayScannerAudio("ATTN_DISPATCH CODE_04_PATROL"); Main.CompAccess = true; if (_areaBlip.Exists()) { _areaBlip.Delete(); } if (_one) { _one.Dismiss(); } SetScriptFinished(true); }
protected void SetScriptFinished() { "Sexual Assault Case Update".DisplayNotification("Case completed successfully \n\n~g~Good job ~b~Officer~w~!", _cData.Number); _cData.LastCompletedStage = CaseData.LastStage.SuspectWork; _cData.CompletedStages.Add(CaseData.LastStage.SuspectWork); _cData.SajrsUpdates.Add("Case completed!"); _cData.StartingStage = "Sa1Csi"; LtFlash.Common.Serialization.Serializer.SaveItemToXML <CaseData>(_cData, Main.CDataPath); var value = 100; if (_sus) { if (_sus.IsDead) { value = 70; } else if (Functions.IsPedArrested(_sus)) { value = 100; } } value = _copList.Where(c => c.Ped && c.Ped.IsDead).Aggregate(value, (current, c) => current - 10); var medal = MissionPassedScreen.Medal.Gold; if (value >= 80 && value < 100) { medal = MissionPassedScreen.Medal.Silver; } else if (value < 80) { medal = MissionPassedScreen.Medal.Bronze; } var passed = new MissionPassedHandler("Suspect Raid", value, medal); passed.AddItem("Suspect Arrested", "", Functions.IsPedArrested(_sus) ? MissionPassedScreen.TickboxState.Tick : MissionPassedScreen.TickboxState.Empty); passed.AddItem("All Officers Survived", "", _copList.Any(c => c.Ped && c.Ped.IsDead) ? MissionPassedScreen.TickboxState.Empty : MissionPassedScreen.TickboxState.Tick); passed.Show(); if (_areaBlip.Exists()) { _areaBlip.Delete(); } foreach (var c in _copList) { c.DismissPed(); c.DismissVeh(); } SetScriptFinished(true); }
private void RunEndStage() { var susAcq = false; _cData = Serializer.LoadItemFromXML <CaseData>(Main.CDataPath); if (!string.IsNullOrWhiteSpace(_cData.CurrentSuspect)) { var susDataList = Serializer.LoadFromXML <PedData>(Main.SDataPath); foreach (var s in susDataList) { if (s.Name != _cData.CurrentSuspect || !s.IsPerp) { continue; } this.Attributes.NextScripts.Clear(); this.Attributes.NextScripts.Add("Sa_4ASuspectHome"); susAcq = true; } } var value = susAcq ? 100 : 50; var medal = value < 100 ? MissionPassedScreen.Medal.Silver : MissionPassedScreen.Medal.Gold; var handler = new MissionPassedHandler("San Andreas Joint Records System", value, medal); var tick = susAcq ? MissionPassedScreen.TickboxState.Tick : MissionPassedScreen.TickboxState.Empty; handler.AddItem("Viewed SAJRS", "Details Received", MissionPassedScreen.TickboxState.Tick); handler.AddItem("Suspect Acquired", "", tick); $"Case number: {_cData.Number}".AddLog(); handler.Show(); SetScriptFinished(); }
protected override void Process() { if (Game.LocalPlayer.Character.Position.DistanceTo(_oneSpawn.Spawn) > 150f) { return; } if (!_one) { _one = new Ped(_sData.Model, _oneSpawn.Spawn, _oneSpawn.Heading); _one.MakeMissionPed(); _one.ResetVariation(); _one.Heading = _oneSpawn.Heading; GameFiber.StartNew(delegate { "_one.Task.Start".AddLog(); while (Game.LocalPlayer.Character.Position.DistanceTo(_one) > 5f) { _one.Task_Scenario(_scenario); while (NativeFunction.Natives.IS_PED_USING_ANY_SCENARIO <bool>(_one)) { GameFiber.Yield(); } GameFiber.Yield(); } NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(_one, Game.LocalPlayer.Character, -1); }); } if (Game.LocalPlayer.Character.Position.DistanceTo(_oneSpawn.Spawn) < 10f && !_notified) { _notified = true; Game.DisplayHelp("While you don't have enough information to arrest the ~r~suspect~w~ nothing is stopping you from have a conversation!"); _one.Tasks.Clear(); GameFiber.Sleep(1000); _one.Face(Game.LocalPlayer.Character); } if (Game.LocalPlayer.Character.Position.DistanceTo(_oneSpawn.Spawn) < 3f && !_beginDialogue) { _beginDialogue = true; if (_areaBlip.Exists()) { _areaBlip.Delete(); } Game.DisplayHelp("Press ~y~Y~w~ to ask the ~r~suspect~w~ some questions."); } if (Game.IsKeyDown(Keys.Y) && !_interrStarted) { _one.Tasks.ClearImmediately(); GameFiber.Sleep(0500); _one.Face(Game.LocalPlayer.Character); GameFiber.Sleep(1000); _interrogation = new Interrogation(InterrogationCreator.InterrogationLineCreator(InterrogationCreator.Type.Suspect, _one), _one); _interrogation.StartDialog(); _interrStarted = true; } if (_interrStarted && _interrogation.HasEnded && !_leaveNotified) { _sReportData = new ReportData(ReportData.Service.SusFamily, _one, _interrogation.InterrgoationText); _leaveNotified = true; Game.DisplayHelp("It looks like the ~r~suspect~w~ is done talking, leave the scene before you lose the case"); StartTimer(); } if (_interrStarted && Game.LocalPlayer.Character.DistanceTo(_one) > 20f) { if (!_interrogation.HasEnded) { return; } var value = _interrogation.QuestionList.Where(q => q.Value == false) .Aggregate(100, (current, q) => current - 15); var medal = MissionPassedScreen.Medal.Gold; if (value >= 80 && value < 100) { medal = MissionPassedScreen.Medal.Silver; } else if (value < 80) { medal = MissionPassedScreen.Medal.Bronze; } var handler = new MissionPassedHandler("Suspect Interrogation", value, medal); handler.AddItem("Spoke to Suspect", "", MissionPassedScreen.TickboxState.Tick); var num = 0; foreach (var q in _interrogation.QuestionList) { num++; var correct = q.Value ? "Correct" : "Incorrect"; handler.AddItem($"Question {num}", correct, MissionPassedScreen.TickboxState.None); } handler.Show(); SetScriptFinished(); } }
private void TaskLeaveTheScene() //9. { if (!(Vector3.Distance(Game.LocalPlayer.Character.Position, CsiCreator.Victim.Position) > 80f)) { return; } _missionValue = _missionValue + 15; $"Mission value changed to: {_missionValue}".AddLog(); SaveEndingData(); foreach (var obj in _evidenceObjData.Values.ToList()) { if (!obj.Collected) { continue; } _missionValue = _missionValue + 5; $"Mission value changed to: {_missionValue}".AddLog(); } var medal = MissionPassedScreen.Medal.Bronze; if (_missionValue > 60 && _missionValue < 85) { medal = MissionPassedScreen.Medal.Silver; } else if (_missionValue >= 85) { medal = MissionPassedScreen.Medal.Gold; } var handler = new MissionPassedHandler("Crime Scene Investiagion", _missionValue, medal); handler.AddItem("Accepted Call", "Accepted", MissionPassedScreen.TickboxState.Tick); handler.AddItem("Updated by First Officer", "Completed", MissionPassedScreen.TickboxState.Tick); handler.AddItem("Updated by EMS", "Completed", MissionPassedScreen.TickboxState.Tick); handler.AddItem("Body taken to ME", "Completed", MissionPassedScreen.TickboxState.Tick); foreach (var evid in _eDataList) { if (string.IsNullOrEmpty(evid.Name)) { return; } if (evid.Collected) { handler.AddItem(evid.Name, "Collected", MissionPassedScreen.TickboxState.Tick); } else { handler.AddItem(evid.Name, "Missed", MissionPassedScreen.TickboxState.Empty); } } var witnessNum = 0; foreach (var wit in _witList.Keys.ToArray()) { if (!wit.Exists()) { continue; } witnessNum++; var tick = wit.Dialog.HasEnded ? MissionPassedScreen.TickboxState.Tick : MissionPassedScreen.TickboxState.Empty; handler.AddItem($"Witness {witnessNum} Statement Taken", "", tick); } handler.AddItem("Scene Cleared", "Completed", MissionPassedScreen.TickboxState.Tick); handler.Show(); Functions.PlayScannerAudio("ATTN_DISPATCH CODE_04_PATROL"); "Terminating L.S. Noir Callout: Sexual Assault -- Stage 1 [CSI]".AddLog(); SetScriptFinished(); }