Skip to content

Commit 7a2ff39

Browse files
authored
Merge pull request #101 from How-Bout-No/feature/heists-menu
feat(YHV1): Add heists script
2 parents e9f02d3 + 3c1365a commit 7a2ff39

17 files changed

Lines changed: 481 additions & 12 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
-- Copyright (C) 2026 SAMURAI (xesdoog) & Contributors.
2+
-- This file is part of Samurai's Scripts.
3+
--
4+
-- Permission is hereby granted to copy, modify, and redistribute
5+
-- this code as long as you respect these conditions:
6+
-- * Credit the owner and contributors.
7+
-- * Provide a copy of or a link to the original license (GPL-3.0 or later); see LICENSE.md or <https://www.gnu.org/licenses/>.
8+
9+
10+
---@class HeistInfo
11+
---@field name string
12+
---@field coords vec3|nil
13+
---@field blip integer BlipID
14+
---@field stat { name: string, val: integer}
15+
---@field optInfo? string
16+
17+
---@alias HEIST_TYPES table<integer, HeistInfo>
18+
19+
---@class YimHeists
20+
---@field private m_raw_data RawBusinessData
21+
---@field m_tab Tab
22+
local YimHeists = { m_raw_data = require("includes.data.yrv3_data") }
23+
YimHeists.__index = YimHeists
24+
25+
---@return YimHeists
26+
function YimHeists:init()
27+
local instance = setmetatable({
28+
m_tab = GUI:RegisterNewTab(Enums.eTabID.TAB_ONLINE, "YimHeists")
29+
}, self)
30+
31+
return instance
32+
end
33+
34+
---@param statName string
35+
---@param statVal integer
36+
---@param notifTitle string
37+
function YimHeists:SkipPrep(statName, statVal, notifTitle)
38+
stats.set_int(statName, statVal)
39+
Notifier:ShowSuccess(notifTitle, _T("YH_PREP_SKIP_NOTIF"))
40+
end
41+
42+
---@return vec3
43+
function YimHeists:GetAgencyLocation()
44+
local property_index = stats.get_int("MPX_FIXER_HQ_OWNED")
45+
if (not YRV3:IsPropertyIndexValid(property_index)) then
46+
return
47+
end
48+
49+
local ref = self.m_raw_data.Agencies[property_index]
50+
return ref.coords
51+
end
52+
53+
---@param where integer|vec3
54+
---@param keepVehicle? boolean
55+
function YimHeists:Teleport(where, keepVehicle)
56+
if not Self:IsOutside() then
57+
Notifier:ShowError("YHV1", "Please go outside first!")
58+
return
59+
end
60+
61+
Self:Teleport(where, keepVehicle)
62+
end
63+
64+
return YimHeists

SSV2/includes/frontend/yhv1_ui.lua

Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
-- Copyright (C) 2026 SAMURAI (xesdoog) & Contributors.
2+
-- This file is part of Samurai's Scripts.
3+
--
4+
-- Permission is hereby granted to copy, modify, and redistribute
5+
-- this code as long as you respect these conditions:
6+
-- * Credit the owner and contributors.
7+
-- * Provide a copy of or a link to the original license (GPL-3.0 or later); see LICENSE.md or <https://www.gnu.org/licenses/>.
8+
9+
10+
local YHV1 = require("includes.features.YimHeistsV1"):init()
11+
12+
---@type HEIST_TYPES
13+
local HEIST_TYPES = {
14+
{
15+
name = "Cluckin Bell",
16+
coords = vec3:new(-1093.15, -807.14, 19.28),
17+
blip = 871,
18+
stat = {
19+
name = "MPX_SALV23_INST_PROG",
20+
val = 31,
21+
}
22+
},
23+
{
24+
name = "KnoWay",
25+
coords = vec3:new(42.82, -1599.19, 29.60),
26+
blip = 76,
27+
stat = {
28+
name = "MPX_M25_AVI_MISSION_CURRENT",
29+
val = 4,
30+
},
31+
},
32+
{
33+
name = "Dr. Dre",
34+
coords = YHV1:GetAgencyLocation(),
35+
blip = 826,
36+
stat = {
37+
name = "MPX_FIXER_STORY_BS",
38+
val = 4095,
39+
}
40+
},
41+
{
42+
name = "Oscar Guzman",
43+
coords = vec3:new(2150.65, 4796.60, 41.17),
44+
blip = 903,
45+
stat = {
46+
name = "MPX_HACKER24_INST_BS",
47+
val = 31,
48+
},
49+
optInfo = "Complete first mission on Hard first!"
50+
},
51+
}
52+
53+
-- This is all a pretty asinine way of handling this and has some UI/UX inconsistencies but it's quick and it works good enuff for now
54+
-- TODO: Make this better
55+
local function drawBasicTab()
56+
for i, heist in ipairs(HEIST_TYPES) do
57+
ImGui.BeginDisabled(not heist.coords or not Game.IsValidCoords(heist.blip))
58+
ImGui.PushID(i)
59+
ImGui.BulletText(heist.name)
60+
61+
if (GUI:Button(_T("GENERIC_TELEPORT"))) then
62+
YHV1:Teleport(heist.coords, false)
63+
end
64+
65+
ImGui.SameLine()
66+
if (GUI:Button(_T("GENERIC_SET_WAYPOINT"))) then
67+
Game.SetWaypointCoords(heist.blip)
68+
end
69+
70+
ImGui.SameLine()
71+
72+
ImGui.BeginDisabled(stats.get_int(heist.stat.name) == heist.stat.val)
73+
if GUI:Button(_T("SY_COMPLETE_PREPARATIONS")) then
74+
YHV1:SkipPrep(heist.stat.name, heist.stat.val, heist.name)
75+
end
76+
if (heist.optInfo) then
77+
GUI:Tooltip(heist.optInfo)
78+
end
79+
ImGui.EndDisabled()
80+
ImGui.PopID()
81+
ImGui.EndDisabled()
82+
end
83+
end
84+
85+
local cayo_secondary_target_i = 2
86+
local cayo_secondary_target_c = 3
87+
88+
local function drawCayoTab()
89+
-- https://www.unknowncheats.me/forum/grand-theft-auto-v/695454-edit-cayo-perico-primary-target-stat-yimmenu-v2.html
90+
-- https://www.unknowncheats.me/forum/grand-theft-auto-v/431801-cayo-perico-heist-click.html
91+
local cayo_heist_primary = stats.get_int("MPX_H4CNF_TARGET")
92+
local cayo_heist_difficulty = stats.get_int("MPX_H4_PROGRESS")
93+
local cayo_heist_weapons = stats.get_int("MPX_H4CNF_WEAPONS")
94+
95+
ImGui.SeparatorText("Targets")
96+
97+
local new_primary_target, primary_target_clicked = ImGui.Combo(
98+
_T "YH_CAYO_TARGET_PRIMARY",
99+
cayo_heist_primary,
100+
{ "Tequila", "Ruby", "Bearer Bonds", "Pink Diamond", "Madrazo Files", "Panther Statue" },
101+
6
102+
)
103+
104+
if (primary_target_clicked) then
105+
stats.set_int("MPX_H4CNF_TARGET", new_primary_target)
106+
end
107+
108+
ImGui.Spacing()
109+
110+
local secondary_targets = { "Cash", "Weed", "Coke", "Gold" }
111+
local new_secondary_target_i, secondary_target_i_click = ImGui.Combo(
112+
_T "YH_CAYO_TARGET_SECONDARY_I",
113+
cayo_secondary_target_i,
114+
secondary_targets,
115+
4
116+
)
117+
118+
if (secondary_target_i_click) then
119+
cayo_secondary_target_i = new_secondary_target_i
120+
end
121+
122+
local new_secondary_target_c, secondary_target_c_click = ImGui.Combo(
123+
_T "YH_CAYO_TARGET_SECONDARY_C",
124+
cayo_secondary_target_c,
125+
secondary_targets,
126+
4
127+
)
128+
129+
if (secondary_target_c_click) then
130+
cayo_secondary_target_c = new_secondary_target_c
131+
end
132+
133+
-- https://www.unknowncheats.me/forum/4489469-post16.html
134+
if GUI:Button("Set All Secondary Targets") then
135+
local targets_i = { 0, 0, 0, 0 }
136+
local targets_c = { 0, 0, 0, 0 }
137+
targets_i[new_secondary_target_i + 1] = -1
138+
targets_c[new_secondary_target_c + 1] = -1
139+
140+
stats.set_int("MPX_H4LOOT_CASH_I", targets_i[0])
141+
stats.set_int("MPX_H4LOOT_CASH_I_SCOPED", targets_i[0])
142+
stats.set_int("MPX_H4LOOT_WEED_I", targets_i[1])
143+
stats.set_int("MPX_H4LOOT_WEED_I_SCOPED", targets_i[1])
144+
stats.set_int("MPX_H4LOOT_COKE_I", targets_i[2])
145+
stats.set_int("MPX_H4LOOT_COKE_I_SCOPED", targets_i[2])
146+
stats.set_int("MPX_H4LOOT_GOLD_I", targets_i[3])
147+
stats.set_int("MPX_H4LOOT_GOLD_I_SCOPED", targets_i[3])
148+
stats.set_int("MPX_H4LOOT_CASH_C", targets_c[0])
149+
stats.set_int("MPX_H4LOOT_WEED_C", targets_c[1])
150+
stats.set_int("MPX_H4LOOT_COKE_C", targets_c[2])
151+
stats.set_int("MPX_H4LOOT_GOLD_C", targets_c[3])
152+
stats.set_int("MPX_H4LOOT_PAINT", -1) -- Not really any reason to have an option for paintings
153+
stats.set_int("MPX_H4LOOT_PAINT_SCOPED", -1)
154+
end
155+
156+
ImGui.SeparatorText(_T "GENERIC_SETTINGS_LABEL")
157+
158+
local new_difficulty, difficulty_toggled = GUI:CustomToggle(_T("YH_CAYO_DIFFICULTY"),
159+
cayo_heist_difficulty > 130000
160+
)
161+
162+
if (difficulty_toggled) then
163+
if (new_difficulty) then
164+
stats.set_int("MPX_H4_PROGRESS", 131055)
165+
else
166+
stats.set_int("MPX_H4_PROGRESS", 126823)
167+
end
168+
end
169+
170+
local new_weapons, weapons_clicked = ImGui.Combo(
171+
_T "YH_CAYO_WEAPONS",
172+
cayo_heist_weapons,
173+
{ "Unselected", "Aggressor", "Conspirator", "Crackshot", "Saboteur", "Marksman" },
174+
6
175+
)
176+
177+
if (weapons_clicked) then
178+
stats.set_int("MPX_H4CNF_WEAPONS", new_weapons)
179+
end
180+
181+
-- https://www.unknowncheats.me/forum/3058973-post602.html
182+
if GUI:Button(_T "CP_HEIST_UNLOCK_ALL") then
183+
stats.set_int("MPX_H4CNF_BS_GEN", 131071)
184+
stats.set_int("MPX_H4CNF_BS_ENTR", 63)
185+
stats.set_int("MPX_H4CNF_BS_ABIL", 63)
186+
stats.set_int("MPX_H4CNF_WEP_DISRP", 3)
187+
stats.set_int("MPX_H4CNF_ARM_DISRP", 3)
188+
stats.set_int("MPX_H4CNF_HEL_DISRP", 3)
189+
stats.set_int("MPX_H4_MISSIONS", 65535)
190+
if (stats.get_int("MPX_H4_PLAYTHROUGH_STATUS") == 0) then
191+
stats.set_int("MPX_H4_PLAYTHROUGH_STATUS", 40000)
192+
end
193+
Notifier:ShowSuccess("YHV1", "Heist ready")
194+
end
195+
196+
if GUI:Button(_T "YH_CAYO_RESET_ALL") then
197+
stats.set_int("MPX_H4_MISSIONS", 0)
198+
stats.set_int("MPX_H4_PROGRESS", 0)
199+
stats.set_int("MPX_H4_PLAYTHROUGH_STATUS", 0)
200+
stats.set_int("MPX_H4CNF_APPROACH", 0)
201+
stats.set_int("MPX_H4CNF_BS_ENTR", 0)
202+
stats.set_int("MPX_H4CNF_BS_GEN", 0)
203+
stats.set_int("MPX_H4CNF_BS_ABIL", 0)
204+
Notifier:ShowSuccess("YHV1", "All progress has been reset!")
205+
end
206+
end
207+
208+
local function HeistUI()
209+
if (not Game.IsOnline() or not Backend:IsUpToDate()) then
210+
ImGui.Text(_T("GENERIC_UNAVAILABLE_SP"))
211+
return
212+
end
213+
214+
if (ImGui.BeginTabBar("##dunkBar")) then
215+
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, 10, 10)
216+
217+
if ImGui.BeginTabItem(_T("GENERIC_GENERAL_LABEL")) then
218+
drawBasicTab()
219+
ImGui.EndTabItem()
220+
end
221+
222+
if ImGui.BeginTabItem(_T("YH_CAYO_TAB")) then
223+
drawCayoTab()
224+
ImGui.EndTabItem()
225+
end
226+
227+
-- if ImGui.BeginTabItem(_T("YH_DDAY_TAB")) then
228+
-- drawDDayTab()
229+
-- ImGui.EndTabItem()
230+
-- end
231+
232+
ImGui.PopStyleVar()
233+
ImGui.EndTabBar()
234+
end
235+
end
236+
237+
YHV1.m_tab:RegisterGUI(HeistUI)

SSV2/includes/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ local packages = {
124124
"frontend.vehicle.vehicle_ui",
125125
"frontend.world_ui",
126126
"frontend.yav3_ui",
127+
"frontend.yhv1_ui",
127128
"frontend.yrv3_ui",
128129
}
129130

SSV2/includes/lib/translations/__hashmap.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,5 +626,16 @@
626626
"SELF_ABILITY_MENTAL_STATE": 2176330063,
627627
"YRV3_CEO_OFFICE_NOT_OWNED": 1352588371,
628628
"YRV3_WAREHOUSE_SLOT": 1803512971,
629-
"YRV3_CARGO_WAREHOUSES_LABEL": 2490296227
629+
"YRV3_CARGO_WAREHOUSES_LABEL": 2490296227,
630+
"YH_BASIC_TAB": 4281242592,
631+
"YH_CAYO_TAB": 3700029630,
632+
"YH_PREP_SKIP": 2659644214,
633+
"YH_PREP_SKIP_NOTIF": 316236424,
634+
"YH_CAYO_TARGET_PRIMARY": 359769569,
635+
"YH_CAYO_TARGET_SECONDARY_I": 752009453,
636+
"YH_CAYO_TARGET_SECONDARY_C": 2356233384,
637+
"YH_CAYO_TARGET_SECONDARY_BUTTON": 1840450233,
638+
"YH_CAYO_DIFFICULTY": 950376902,
639+
"YH_CAYO_WEAPONS": 4293173989,
640+
"YH_CAYO_RESET_ALL": 3192949709
630641
}

SSV2/includes/lib/translations/de-DE.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,5 +626,16 @@ return {
626626
["SELF_ABILITY_FLYING"] = "Fliegen",
627627
["YRV3_WAREHOUSE_SLOT"] = "Lager %d",
628628
["YRV3_CEO_OFFICE_NOT_OWNED"] = "Sie besitzen kein CEO-Büro.",
629-
["YRV3_CARGO_WAREHOUSES_LABEL"] = "Spezielle Frachtlager"
629+
["YRV3_CARGO_WAREHOUSES_LABEL"] = "Spezielle Frachtlager",
630+
["YH_BASIC_TAB"] = "Basic",
631+
["YH_CAYO_TAB"] = "Cayo Perico",
632+
["YH_PREP_SKIP_NOTIF"] = "Alle Vorbereitungsmissionen wurden übersprungen. Sie können nun mit der letzten Mission beginnen.",
633+
["YH_CAYO_TARGET_SECONDARY_I"] = "Sekundäres Ziel (Insel)",
634+
["YH_CAYO_TARGET_SECONDARY_C"] = "Sekundäres Ziel (Verbindung)",
635+
["YH_CAYO_TARGET_SECONDARY_BUTTON"] = "Legen Sie alle sekundären Ziele fest",
636+
["YH_CAYO_RESET_ALL"] = "Setzen Sie ALLE Fortschritte zurück",
637+
["YH_CAYO_TARGET_PRIMARY"] = "Primäres Ziel",
638+
["YH_CAYO_DIFFICULTY"] = "Harter Modus",
639+
["YH_PREP_SKIP"] = "Überspringen Sie Vorbereitungsmissionen",
640+
["YH_CAYO_WEAPONS"] = "Waffenausstattung"
630641
}

SSV2/includes/lib/translations/en-US.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,4 +687,17 @@ return {
687687
["EF_IMPORT_SUCCESS"] = "Data successfully imported.",
688688
["EF_CHILD_ALPHA"] = "Child Item Transparency: %d",
689689
--#endregion
690+
691+
--#region YimHeists
692+
["YH_BASIC_TAB"] = "Basic",
693+
["YH_CAYO_TAB"] = "Cayo Perico",
694+
["YH_PREP_SKIP_NOTIF"] = "All preparation missions have been skipped. You can now start the final mission.",
695+
["YH_CAYO_TARGET_PRIMARY"] = "Primary Target",
696+
["YH_CAYO_TARGET_SECONDARY_I"] = "Secondary Target (Island)",
697+
["YH_CAYO_TARGET_SECONDARY_C"] = "Secondary Target (Compound)",
698+
["YH_CAYO_TARGET_SECONDARY_BUTTON"] = "Set All Secondary Targets",
699+
["YH_CAYO_DIFFICULTY"] = "Hard Mode",
700+
["YH_CAYO_WEAPONS"] = "Weapon Loadout",
701+
["YH_CAYO_RESET_ALL"] = "Reset ALL Progress",
702+
--#endregion
690703
}

SSV2/includes/lib/translations/es-ES.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,5 +626,16 @@ return {
626626
["SELF_ABILITY_LUNG_CAPACITY"] = "Capacidad pulmonar",
627627
["YRV3_CEO_OFFICE_NOT_OWNED"] = "No eres dueño de una oficina de director ejecutivo.",
628628
["YRV3_WAREHOUSE_SLOT"] = "Almacén %d",
629-
["YRV3_CARGO_WAREHOUSES_LABEL"] = "Bodegas de Carga Especial"
629+
["YRV3_CARGO_WAREHOUSES_LABEL"] = "Bodegas de Carga Especial",
630+
["YH_BASIC_TAB"] = "Básico",
631+
["YH_CAYO_TAB"] = "Cayo Perico",
632+
["YH_PREP_SKIP"] = "Saltar misiones de preparación",
633+
["YH_CAYO_TARGET_PRIMARY"] = "Objetivo principal",
634+
["YH_CAYO_DIFFICULTY"] = "Modo difícil",
635+
["YH_CAYO_TARGET_SECONDARY_C"] = "Objetivo secundario (compuesto)",
636+
["YH_PREP_SKIP_NOTIF"] = "Se han omitido todas las misiones de preparación. Ahora puedes comenzar la misión final.",
637+
["YH_CAYO_TARGET_SECONDARY_I"] = "Objetivo secundario (isla)",
638+
["YH_CAYO_WEAPONS"] = "Equipamiento de armas",
639+
["YH_CAYO_RESET_ALL"] = "Restablecer TODO el progreso",
640+
["YH_CAYO_TARGET_SECONDARY_BUTTON"] = "Establecer todos los objetivos secundarios"
630641
}

0 commit comments

Comments
 (0)