Skip to content

Commit

Permalink
YobbinCallouts 1.7.0 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
YobB1n committed Dec 24, 2022
1 parent e712bbb commit d3e7169
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 62 deletions.
4 changes: 1 addition & 3 deletions CallHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public static void IdleAction(Ped ped, bool iscop)
}
else
{

int animation = monke.Next(0, MaleCopAnim.Length / 2);
//Game.LogTrivial("YOBBINCALLOUTS: There are "+MaleCopAnim.Length+"animations");
//Game.LogTrivial(MaleCopAnim[animation, 0]);
Expand All @@ -159,13 +158,11 @@ public static void IdleAction(Ped ped, bool iscop)
{
if (ped.IsFemale)
{

int animation = monke.Next(0, FemaleRandoAnim.Length / 2);
ped.Tasks.PlayAnimation(FemaleRandoAnim[animation, 0], FemaleRandoAnim[animation, 1], -1, AnimationFlags.Loop);
}
else
{

int animation = monke.Next(0, MaleRandoAnim.Length / 2);
ped.Tasks.PlayAnimation(MaleRandoAnim[animation, 0], MaleRandoAnim[animation, 1], -1, AnimationFlags.Loop);
}
Expand Down Expand Up @@ -366,6 +363,7 @@ public static void locationChooser(ArrayList list, float maxdistance = 600f, flo
SpawnPoint = (Vector3)closeLocations[monke.Next(0, closeLocations.Count)];
locationReturned = true;
Game.LogTrivial("YOBBINCALLOUTS: Spawn Point found successfully.");
Game.LogTrivial("YOBBINCALLOUTS: Spawn Point found at "+SpawnPoint+" in "+ Functions.GetZoneAtPosition(SpawnPoint).RealAreaName);
}
}

Expand Down
21 changes: 15 additions & 6 deletions Callouts/CitizenArrest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public override bool OnBeforeCalloutDisplayed()
{
Game.LogTrivial("==========YOBBINCALLOUTS: Citizen Arrest Callout Start==========");
System.Random r = new System.Random();
int Scenario = r.Next(0, 3); //change later
int Scenario = r.Next(0, 0); //change later
MainScenario = Scenario;
Game.LogTrivial("YOBBINCALLOUTS: Scenario is " + MainScenario + "");
if (MainScenario == 0) Crime = "Assault."; //PUT PERIODS AT THE END OF THESE CRIMES.
Expand Down Expand Up @@ -111,11 +111,11 @@ public override bool OnCalloutAccepted()
SuspectModels = new string[8] { "A_M_Y_SouCent_01", "A_M_Y_StWhi_01", "A_M_Y_StBla_01", "A_M_Y_Downtown_01", "A_M_Y_BevHills_01", "G_M_Y_MexGang_01", "G_M_Y_MexGoon_01", "G_M_Y_StrPunk_01" };
System.Random r2 = new System.Random();
int SuspectModel = r2.Next(0, SuspectModels.Length);
Suspect = new Ped(SuspectModels[SuspectModel], nodePosition, heading);
Suspect = new Ped(nodePosition, heading);
Suspect.IsPersistent = true;
Suspect.BlockPermanentEvents = true;
Functions.SetPedAsArrested(Suspect, true, false);
Suspect.Tasks.StandStill(-1);
//Suspect.Tasks.StandStill(-1);
Game.LogTrivial("YOBBINCALLOUTS: Suspect Spawned");

Citizen = new Citizen(Suspect.GetOffsetPositionFront(2));
Expand All @@ -136,6 +136,13 @@ public override bool OnCalloutAccepted()
AreaBlip.Alpha = 0.67f;
AreaBlip.IsRouteEnabled = true;
AreaBlip.Name = "Callout Location";

//this shouldn't be necessary but idk why it isn't working lol
if (!Suspect.Exists())
{
Game.LogTrivial("YOBBINCALLOUTS: Suspect no longer valid, aborting...");
return false;
}
}
catch (Exception e)
{
Expand Down Expand Up @@ -174,9 +181,11 @@ private void Callout()
CitizenBlip.Color = Color.Purple;
NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Citizen, player, -1);

SuspectBlip = Suspect.AttachBlip();
SuspectBlip.Scale = 0.7f;
SuspectBlip.IsFriendly = false;
//broken idk why
//SuspectBlip = Suspect.AttachBlip();
//SuspectBlip.Scale = 0.7f;
//SuspectBlip.IsFriendly = false;
CallHandler.AssignBlip(Suspect, Color.Red);

if (MainScenario == 0) Assault();
break;
Expand Down
19 changes: 9 additions & 10 deletions Callouts/HospitalEmergency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public override bool OnCalloutAccepted()
var GuardSpawnPoint = World.GetNextPositionOnStreet(Nurse.Position);
NativeFunction.Natives.xA0F8A7517A273C05<bool>(GuardSpawnPoint, 0, out Vector3 outPosition);

Guard = new Ped("s_m_m_security_01", outPosition, Nurse.Heading - 180); //offset position
if(CallHandler.FiftyFifty()) Guard = new Ped("s_m_m_security_01", outPosition, Nurse.Heading - 15); //offset position
else Guard = new Ped("s_m_m_security_01", outPosition, Nurse.Heading + 15); //offset position
Guard.IsPersistent = true;
Guard.BlockPermanentEvents = true;
CallHandler.IdleAction(Guard, true);
Expand Down Expand Up @@ -287,7 +288,7 @@ private void SuspectSearch()
{
if (CalloutRunning)
{
if (Config.DisplayHelp) Game.DisplayHelp("Start ~b~Searching~w~ for the Patient.");
if (Config.DisplayHelp) Game.DisplayHelp("Start ~o~Searching~w~ for the Patient.");
Area = new Blip(Suspect.Position.Around(5), 100f);
Area.Alpha = 0.69f;
Area.Color = Color.Orange;
Expand Down Expand Up @@ -345,23 +346,20 @@ private void SuspectSearch()
Game.DisplaySubtitle("~r~Patient:~w~ Don't come any closer, or they'll die!!");
//GameFiber.Wait(1000);

//doesn't do anything lol
//NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Suspect, player, -1);
//NativeFunction.Natives.TASK_TURN_PED_TO_FACE_ENTITY(Hostage, player, -1);

Suspect.Tasks.PlayAnimation("misssagrab_inoffice", "hostage_loop", 1f, AnimationFlags.None).WaitForCompletion(500);
Suspect.Tasks.PlayAnimation("misssagrab_inoffice", "hostage_loop_mrk", 1f, AnimationFlags.Loop);
Suspect.Tasks.PlayAnimation("misssagrab_inoffice", "hostage_loop_mrk", 1f, AnimationFlags.Loop | AnimationFlags.SecondaryTask);
HostageBlip = Hostage.AttachBlip();
HostageBlip.IsFriendly = true;
HostageBlip.Scale = 0.69f;
if (Hostage.IsFemale) Hostage.Tasks.PlayAnimation("anim@move_hostages@female", "female_idle", 1f, AnimationFlags.Loop);
else Hostage.Tasks.PlayAnimation("anim@move_hostages@male", "male_idle", 1f, AnimationFlags.Loop);
else Hostage.Tasks.PlayAnimation("anim@move_hostages@male", "male_idle", 1f, AnimationFlags.Loop | AnimationFlags.SecondaryTask);

//This switch doesn't actually do anything, it's just a statement to break out of if the Suspect is killed prematurely in the hostage situation
var lewis = 0;
switch (lewis)
{
case 0:
GameFiber.Wait(1000);
Game.DisplayHelp("Press ~y~" + Config.MainInteractionKey + "~w~ to Reason with the ~o~Patient.");
HostageHold();
if (Suspect.IsAlive) Game.DisplaySubtitle("~g~You:~w~ " + Suspect.Forename + "! You don't have to do this! Let's talk this through!"); //was Hostage1 Dialogue
Expand Down Expand Up @@ -423,6 +421,7 @@ private void SuspectSearch()
//test vvv
if (HostageBlip.Exists()) HostageBlip.Delete();
if (Hostage.Exists() && Hostage.IsAlive) Hostage.Tasks.ReactAndFlee(player); //might remove
Suspect.Tasks.PutHandsUp(5000, player);
if (Functions.IsPedArrested(Suspect) || Suspect.IsAlive)
{
Game.DisplayNotification("Dispatch, we have taken the Patient into ~r~Custody.");
Expand Down Expand Up @@ -487,9 +486,9 @@ private void DriveBack()
Game.DisplayHelp("Let the ~r~Patient ~w~Out of the Car.");
while (Suspect.IsInAnyVehicle(false)) GameFiber.Wait(0);
}
Nurse.Tasks.GoStraightToPosition(Suspect.GetOffsetPositionFront(1f), 3f, Suspect.Heading, 1f, 4000).WaitForCompletion(4000);
Nurse.Tasks.GoStraightToPosition(Suspect.GetOffsetPositionFront(-1f), 3f, Suspect.Heading, 1f, 4000).WaitForCompletion(4000);
//some frisking animation for nurse (idle, rest of callout)
Guard.Tasks.GoStraightToPosition(Nurse.GetOffsetPositionRight(2f), 2f, Nurse.Heading, 2f, 2500).WaitForCompletion(2500);
//Guard.Tasks.GoStraightToPosition(Nurse.GetOffsetPositionRight(2f), 2f, Nurse.Heading, 2f, 2500).WaitForCompletion(2500);
CallHandler.IdleAction(Nurse, false);
CallHandler.IdleAction(Guard, true);

Expand Down
2 changes: 1 addition & 1 deletion Callouts/HumanTrafficking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private void Confront()
if (SuspectBlip.Exists()) SuspectBlip.Delete();
Victim.Tasks.LeaveVehicle(SuspectVehicle, LeaveVehicleFlags.LeaveDoorOpen).WaitForCompletion();
Victim.Tasks.Cower(-1);
Game.DisplayHelp("When Ready, Speak with the ~b~Victim.");
Game.DisplayHelp("When Ready, Locate and Speak with the ~b~Victim.");
while (player.DistanceTo(Victim) >= 4) GameFiber.Wait(0);
Victim.Tasks.AchieveHeading(player.Heading - 180).WaitForCompletion(500);

Expand Down
Loading

0 comments on commit d3e7169

Please sign in to comment.