diff --git a/src/core/commands/ListCommand.cpp b/src/core/commands/ListCommand.cpp index d65c5e58..cdc680b9 100644 --- a/src/core/commands/ListCommand.cpp +++ b/src/core/commands/ListCommand.cpp @@ -38,6 +38,12 @@ namespace YimMenu MarkDirty(); } + void ListCommand::SetList(std::vector> list) + { + m_List = std::move(list); + MarkDirty(); + } + std::vector>& ListCommand::GetList() { return m_List; diff --git a/src/core/commands/ListCommand.hpp b/src/core/commands/ListCommand.hpp index 8dca5f70..4738c842 100644 --- a/src/core/commands/ListCommand.hpp +++ b/src/core/commands/ListCommand.hpp @@ -18,6 +18,7 @@ namespace YimMenu ListCommand(std::string name, std::string label, std::string description, std::vector> list, int def_val = 0); int GetState(); void SetState(int state); + void SetList(std::vector> list); std::vector>& GetList(); }; } \ No newline at end of file diff --git a/src/game/features/recovery/CayoPericoCooldown.cpp b/src/game/features/recovery/CayoPericoCooldown.cpp deleted file mode 100644 index 13ea767c..00000000 --- a/src/game/features/recovery/CayoPericoCooldown.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "core/commands/Command.hpp" -#include "game/gta/Stats.hpp" - -namespace YimMenu::Features -{ - class CayoPericoCooldown : public Command - { - using Command::Command; - - virtual void OnCall() override - { - Stats::SetInt("MPX_H4_TARGET_POSIX", 1); - Stats::SetInt("MPX_H4_COOLDOWN", 1); - Stats::SetInt("MPX_H4_COOLDOWN_HARD", 1); - } - }; - - static CayoPericoCooldown _CayoPericoCooldown{"skipcayocooldown", "Cooldown skip for Cayo Perico Heist", "Skips the cooldown between each Cayo Perico heist"}; -} \ No newline at end of file diff --git a/src/game/features/recovery/CayoPericoSetup.cpp b/src/game/features/recovery/CayoPericoSetup.cpp deleted file mode 100644 index c615bd1c..00000000 --- a/src/game/features/recovery/CayoPericoSetup.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include "core/commands/Command.hpp" -#include "game/gta/Stats.hpp" - -namespace YimMenu::Features -{ - class CayoPericoSetup : public Command - { - using Command::Command; - - virtual void OnCall() override - { - Stats::SetInt("MPX_H4CNF_BS_GEN", 131071); - Stats::SetInt("MPX_H4CNF_BS_ENTR", 63); - Stats::SetInt("MPX_H4CNF_BS_ABIL", 63); - Stats::SetInt("MPX_H4CNF_WEAPONS", 2); - Stats::SetInt("MPX_H4CNF_WEP_DISRP", 3); - Stats::SetInt("MPX_H4CNF_ARM_DISRP", 3); - Stats::SetInt("MPX_H4CNF_HEL_DISRP", 3); - Stats::SetInt("MPX_H4CNF_TARGET", 5); - Stats::SetInt("MPX_H4CNF_TROJAN", 4); - Stats::SetInt("MPX_H4CNF_APPROACH", -1); - Stats::SetInt("MPX_H4LOOT_CASH_I", 0); - Stats::SetInt("MPX_H4LOOT_CASH_C", 0); - Stats::SetInt("MPX_H4LOOT_WEED_I", 0); - Stats::SetInt("MPX_H4LOOT_WEED_C", 0); - Stats::SetInt("MPX_H4LOOT_COKE_I", 0); - Stats::SetInt("MPX_H4LOOT_COKE_C", 0); - Stats::SetInt("MPX_H4LOOT_GOLD_I", -1); - Stats::SetInt("MPX_H4LOOT_GOLD_C", -1); - Stats::SetInt("MPX_H4LOOT_PAINT", -1); - Stats::SetInt("MPX_H4_PROGRESS", 131055); - Stats::SetInt("MPX_H4LOOT_CASH_I_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_CASH_C_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_WEED_I_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_WEED_C_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_COKE_I_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_COKE_C_SCOPED", 0); - Stats::SetInt("MPX_H4LOOT_GOLD_I_SCOPED", -1); - Stats::SetInt("MPX_H4LOOT_GOLD_C_SCOPED", -1); - Stats::SetInt("MPX_H4LOOT_PAINT_SCOPED", -1); - Stats::SetInt("MPX_H4_MISSIONS", 65535); - Stats::SetInt("MPX_H4_PLAYTHROUGH_STATUS", 40000); - } - }; - - static CayoPericoSetup _CayoPericoSetup{"skipcayosetup", "Setup Cayo Perico Heist", "Gives the best cayo perico loadout."}; -} \ No newline at end of file diff --git a/src/game/features/recovery/Heist/ApartmentHeist.cpp b/src/game/features/recovery/Heist/ApartmentHeist.cpp new file mode 100644 index 00000000..d23ef763 --- /dev/null +++ b/src/game/features/recovery/Heist/ApartmentHeist.cpp @@ -0,0 +1,132 @@ +#include "core/commands/IntCommand.hpp" +#include "core/commands/Command.hpp" +#include "game/gta/Stats.hpp" +#include "game/backend/Players.hpp" +#include "game/gta/ScriptGlobal.hpp" +#include "game/gta/ScriptLocal.hpp" +#include "core/backend/ScriptMgr.hpp" +#include "types/script/globals/GlobalPlayerBD.hpp" + +namespace YimMenu::Features +{ + namespace ApartmentHeist + { + static IntCommand _ApartmentHeistCut1{"apartmentheistcut1", "Player 1", "Player 1 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _ApartmentHeistCut2{"apartmentheistcut2", "Player 2", "Player 2 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _ApartmentHeistCut3{"apartmentheistcut3", "Player 3", "Player 3 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _ApartmentHeistCut4{"apartmentheistcut4", "Player 4", "Player 4 cut", std::nullopt, std::nullopt, 0}; + + class SetCuts : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base1 = ScriptGlobal(1929794).At(1); + auto base2 = ScriptGlobal(1931762).At(3008); + + *base1.At(1).As() = 100 - (_ApartmentHeistCut1.GetState() + _ApartmentHeistCut2.GetState() + _ApartmentHeistCut3.GetState() + _ApartmentHeistCut4.GetState()); + *base1.At(2).As() = _ApartmentHeistCut2.GetState(); + *base1.At(3).As() = _ApartmentHeistCut3.GetState(); + *base1.At(4).As() = _ApartmentHeistCut4.GetState(); + + ScriptMgr::Yield(500ms); + + *base2.At(1).As() = -1 * (*base1.At(1).As() + *base1.At(2).As() + *base1.At(3).As() + *base1.At(4).As() - 100); + *base2.At(2).As() = *base1.At(2).As(); + *base2.At(3).As() = *base1.At(3).As(); + *base2.At(4).As() = *base1.At(4).As(); + } + }; + + class ForceReady : public Command + { + using Command::Command; + + virtual void OnCall() override + { + if (auto gpbd = GlobalPlayerBD::Get(); gpbd && Scripts::SafeToModifyFreemodeBroadcastGlobals()) + { + for (auto& player : Players::GetPlayers()) + { + gpbd->Entries[player.second.GetId()].HeistCutSelectionStage = 6; + } + } + } + }; + + class Setup : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Stats::SetInt("MPX_HEIST_PLANNING_STAGE", -1); + } + }; + + class SkipHacking : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 12216).At(24).As() = 7; + *ScriptLocal("fm_mission_controller"_J, 10213).As() = *ScriptLocal("fm_mission_controller"_J, 10213).As() | (1 << 9); + } + }; + + class SkipDrilling : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 10507).At(11).As() = 100.0f; + } + }; + + class InstantFinish : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller"_J, 20387).At(1725).At(1).As() = 80; + *ScriptLocal("fm_mission_controller"_J, 20387).As() = 12; + *ScriptLocal("fm_mission_controller"_J, 29006).At(1).As() = 99999; + *ScriptLocal("fm_mission_controller"_J, 32462).At(1).At(68).As() = 99999; + + // TODO: find a way of getting current heist info so that InstantFinishPacific can be implemented here conditionally. + } + }; + + class InstantFinishPacific : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller"_J, 20387).At(2686).As() = 1875000; + *ScriptLocal("fm_mission_controller"_J, 20387).At(1062).As() = 5; + *ScriptLocal("fm_mission_controller"_J, 20387).As() = 12; + *ScriptLocal("fm_mission_controller"_J, 29006).At(1).As() = 99999; + *ScriptLocal("fm_mission_controller"_J, 32462).At(1).At(68).As() = 99999; + } + }; + + static SetCuts _ApartmentHeistSetCuts{"apartmentheistsetcuts", "Set Cuts", "Sets heist cut"}; + static ForceReady _ApartmentHeistForceReady{"apartmentheistforceready", "Force Ready", "Forces all players to be ready"}; + static Setup _ApartmentHeistSetup{"apartmentheistsetup", "Setup", "Sets up current apartment heist"}; + static SkipHacking _ApartmentHeistSkipHacking{"apartmentheistskiphacking", "Skip Hacking", "Skips hacking process"}; + static SkipDrilling _ApartmentHeistSkipDrilling{"apartmentheistskipdrilling", "Skip Drilling", "Skips drilling process"}; + static InstantFinish _ApartmentHeistInstantFinish{"apartmentheistinstantfinish", "Instant Finish", "Instantly passes the heist"}; + static InstantFinishPacific _ApartmentHeistInstantFinishPacific{"apartmentheistinstantfinishpacific", "Instant Finish (Pacific)", "Instantly passes Pacific Standard Job"}; + } +} \ No newline at end of file diff --git a/src/game/features/recovery/Heist/CayoPericoHeist.cpp b/src/game/features/recovery/Heist/CayoPericoHeist.cpp new file mode 100644 index 00000000..401c5dfc --- /dev/null +++ b/src/game/features/recovery/Heist/CayoPericoHeist.cpp @@ -0,0 +1,257 @@ +#include "core/commands/Command.hpp" +#include "core/commands/IntCommand.hpp" +#include "core/commands/ListCommand.hpp" +#include "game/backend/Self.hpp" +#include "game/gta/Natives.hpp" +#include "game/gta/Stats.hpp" +#include "game/gta/ScriptGlobal.hpp" +#include "game/gta/ScriptLocal.hpp" +#include "core/backend/ScriptMgr.hpp" +#include "game/backend/Tunables.hpp" + +namespace YimMenu::Features +{ + namespace CayoPericoHeist + { + static IntCommand _CayoPericoHeistCut1{"cayopericoheistcut1", "Player 1", "Player 1 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _CayoPericoHeistCut2{"cayopericoheistcut2", "Player 2", "Player 2 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _CayoPericoHeistCut3{"cayopericoheistcut3", "Player 3", "Player 3 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _CayoPericoHeistCut4{"cayopericoheistcut4", "Player 4", "Player 4 cut", std::nullopt, std::nullopt, 0}; + + class SetCuts : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1973698).At(831).At(56); + + *base.At(1).As() = _CayoPericoHeistCut1.GetState(); + *base.At(2).As() = _CayoPericoHeistCut2.GetState(); + *base.At(3).As() = _CayoPericoHeistCut3.GetState(); + *base.At(4).As() = _CayoPericoHeistCut4.GetState(); + } + }; + + class ForceReady : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1974810); + + *base.At(0, 27).At(8).At(0).As() = 1; + *base.At(1, 27).At(8).At(1).As() = 1; + *base.At(2, 27).At(8).At(2).As() = 1; + *base.At(3, 27).At(8).At(3).As() = 1; + } + }; + + static std::vector> cayoPericoHeistDifficulty = { + {126823, "Normal"}, + {131055, "Hard"} + }; + static ListCommand _CayoPericoHeistDifficulty{"cayopericoheistdifficulty", "Difficulty", "Heist difficulty", cayoPericoHeistDifficulty, 126823}; + + static std::vector> cayoPericoHeistPrimaryTarget = { + {5, "Panther Statue"}, + {3, "Pink Diamond"}, + {4, "Madrazo Files"}, + {2, "Bearer Bonds"}, + {1, "Ruby Necklace"}, + {0, "Sinsimito Tequila"} + }; + static ListCommand _CayoPericoHeistPrimaryTarget{"cayopericoheistprimarytarget", "Primary Target", "Primary target", cayoPericoHeistPrimaryTarget, 5}; + + static std::vector> cayoPericoHeistWeapon = { + {1, "Aggressor"}, + {2, "Conspirator"}, + {3, "Crack Shot"}, + {4, "Saboteur"}, + {5, "Marksman"} + }; + static ListCommand _CayoPericoHeistWeapon{"cayopericoheistweapon", "Weapon", "Weapon category", cayoPericoHeistWeapon, 1}; + + class Setup : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Stats::SetInt("MPX_H4CNF_TARGET", _CayoPericoHeistPrimaryTarget.GetState()); // Primary target + Stats::SetInt("MPX_H4LOOT_CASH_I", 2359448); + Stats::SetInt("MPX_H4LOOT_CASH_I_SCOPED", 2359448); + Stats::SetInt("MPX_H4LOOT_CASH_C", 0); + Stats::SetInt("MPX_H4LOOT_CASH_C_SCOPED", 0); + Stats::SetInt("MPX_H4LOOT_COKE_I", 4901222); + Stats::SetInt("MPX_H4LOOT_COKE_I_SCOPED", 4901222); + Stats::SetInt("MPX_H4LOOT_COKE_C", 0); + Stats::SetInt("MPX_H4LOOT_COKE_C_SCOPED", 0); + Stats::SetInt("MPX_H4LOOT_GOLD_I", 0); + Stats::SetInt("MPX_H4LOOT_GOLD_I_SCOPED", 0); + Stats::SetInt("MPX_H4LOOT_GOLD_C", 255); + Stats::SetInt("MPX_H4LOOT_GOLD_C_SCOPED", 255); + Stats::SetInt("MPX_H4LOOT_WEED_I", 0); + Stats::SetInt("MPX_H4LOOT_WEED_I_SCOPED", 0); + Stats::SetInt("MPX_H4LOOT_WEED_C", 0); + Stats::SetInt("MPX_H4LOOT_WEED_C_SCOPED", 0); + Stats::SetInt("MPX_H4LOOT_PAINT", 127); + Stats::SetInt("MPX_H4LOOT_PAINT_SCOPED", 127); + Stats::SetInt("MPX_H4LOOT_CASH_V", 599431); + Stats::SetInt("MPX_H4LOOT_COKE_V", 1198863); + Stats::SetInt("MPX_H4LOOT_GOLD_V", 1598484); + Stats::SetInt("MPX_H4LOOT_PAINT_V", 1198863); + Stats::SetInt("MPX_H4LOOT_WEED_V", 0); + Stats::SetInt("MPX_H4_PROGRESS", _CayoPericoHeistDifficulty.GetState()); // Difficulty + Stats::SetInt("MPX_H4CNF_BS_GEN", 262143); + Stats::SetInt("MPX_H4CNF_BS_ENTR", 63); + Stats::SetInt("MPX_H4CNF_BS_ABIL", 63); + Stats::SetInt("MPX_H4CNF_WEP_DISRP", 3); + Stats::SetInt("MPX_H4CNF_ARM_DISRP", 3); + Stats::SetInt("MPX_H4CNF_HEL_DISRP", 3); + Stats::SetInt("MPX_H4CNF_APPROACH", -1); + Stats::SetInt("MPX_H4CNF_BOLTCUT", 4424); + Stats::SetInt("MPX_H4CNF_UNIFORM", 5256); + Stats::SetInt("MPX_H4CNF_GRAPPEL", 5156); + Stats::SetInt("MPX_H4_MISSIONS", -1); + Stats::SetInt("MPX_H4CNF_WEAPONS", _CayoPericoHeistWeapon.GetState()); // Weapon + Stats::SetInt("MPX_H4CNF_TROJAN", 5); + Stats::SetInt("MPX_H4_PLAYTHROUGH_STATUS", 100); + + ScriptMgr::Yield(500ms); + + *ScriptLocal("heist_island_planning"_J, 1566).As() = 2; + } + }; + + static IntCommand _CayoPericoHeistPrimaryTargetValue{"cayopericoheistprimarytargetvalue", "Primary Target Value", "Updates primary target value", std::nullopt, std::nullopt, 0}; + + class SetPrimaryTargetValue : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto primary_target = Stats::GetInt("MPX_H4CNF_TARGET"); + + switch (primary_target) + { + case 0: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_TEQUILA"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + case 1: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_PEARL_NECKLACE"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + case 2: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_BEARER_BONDS"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + case 3: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_PINK_DIAMOND"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + case 4: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_MADRAZO_FILES"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + case 5: *Tunables::GetTunable("IH_PRIMARY_TARGET_VALUE_SAPPHIRE_PANTHER_STATUE"_J).As() = _CayoPericoHeistPrimaryTargetValue.GetState(); break; + default: break; + } + } + }; + + static IntCommand _CayoPericoHeistSecondaryTakeValue{"cayopericoheistsecondarytakevalue", "Secondary Take Value", "Updates secondary take value", std::nullopt, std::nullopt, 0}; + + class SetSecondaryTakeValue : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller_2020"_J, 56033).At(1518).At(53).As() = _CayoPericoHeistSecondaryTakeValue.GetState(); + } + }; + + class SkipHacking : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller_2020"_J, 25388).As() = 5; + } + }; + + class CutSewer : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller_2020"_J, 30212).As() = 6; + } + }; + + class CutGlass : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller_2020"_J, 31451).At(3).As() = 100.0f; + } + }; + + class TakePrimaryTarget : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto ped = Self::GetPed(); + + if (!ped) + return; + + auto pos = ped.GetPosition(); + auto heading = ped.GetHeading(); + auto primary_target = Stats::GetInt("MPX_H4CNF_TARGET"); + + TASK::TASK_GO_STRAIGHT_TO_COORD(ped.GetHandle(), 5006.917, -5755.931, 15.484, 1.0, 3, 15, 5); + + switch (primary_target) + { + case 0: + case 1: + case 3: + case 5: + *ScriptLocal("fm_mission_controller_2020"_J, 31450).As() = 5; + *ScriptLocal("fm_mission_controller_2020"_J, 31451).As() = 3; + break; + case 2: + case 4: + *ScriptLocal("fm_mission_controller_2020"_J, 31426).As() = 7; + break; + default: break; + } + + ScriptMgr::Yield(4000ms); + + TASK::TASK_GO_STRAIGHT_TO_COORD(ped.GetHandle(), pos.x, pos.y, pos.z, 1.0, 3, heading, 5); + } + }; + + class InstantFinish : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller_2020"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller_2020"_J, 52581).As() = 9; + *ScriptLocal("fm_mission_controller_2020"_J, 52581).At(1776).At(1).As() = 50; + } + }; + + static SetCuts _CayoPericoHeistSetCuts{"cayopericoheistsetcuts", "Set Cuts", "Sets heist cut"}; + static ForceReady _CayoPericoHeistForceReady{"cayopericoheistforceready", "Force Ready", "Forces all players to be ready"}; + static Setup _CayoPericoHeistSetup{"cayopericoheistsetup", "Setup", "Sets up cayo perico heist"}; + static SetPrimaryTargetValue _CayoPericoHeistSetPrimaryTargetValue{"cayopericoheistsetprimarytargetvalue", "Set Primary Target Value", "Updates primary target value"}; + static SetSecondaryTakeValue _CayoPericoHeistSetSecondaryTakeValue{"cayopericoheistsetsecondarytakevalue", "Set Secondary Take Value", "Updates secondary take value"}; + static SkipHacking _CayoPericoHeistSkipHacking{"cayopericoheistskiphacking", "Skip Hacking", "Skips hacking process"}; + static CutSewer _CayoPericoHeistCutSewer{"cayopericoheistcutsewer", "Cut Sewer", "Cuts the sewer"}; + static CutGlass _CayoPericoHeistCutGlass{"cayopericoheistcutglass", "Cut Glass", "Cuts the glass"}; + static TakePrimaryTarget _CayoPericoHeistTakePrimaryTarget{"cayopericoheisttakeprimarytarget", "Take Primary Target", "Takes primary target"}; + static InstantFinish _CayoPericoHeistInstantFinish{"cayopericoheistinstantfinish", "Instant Finish", "Instantly passes the heist"}; + } +} \ No newline at end of file diff --git a/src/game/features/recovery/Heist/DiamondCasinoHeist.cpp b/src/game/features/recovery/Heist/DiamondCasinoHeist.cpp new file mode 100644 index 00000000..0fa8ac0d --- /dev/null +++ b/src/game/features/recovery/Heist/DiamondCasinoHeist.cpp @@ -0,0 +1,333 @@ +#include "core/commands/Command.hpp" +#include "core/commands/IntCommand.hpp" +#include "core/commands/ListCommand.hpp" +#include "game/gta/Stats.hpp" +#include "core/backend/FiberPool.hpp" +#include "game/gta/ScriptGlobal.hpp" +#include "game/gta/ScriptLocal.hpp" +#include "core/backend/ScriptMgr.hpp" +#include "game/backend/Tunables.hpp" + +namespace YimMenu::Features +{ + namespace DiamondCasinoHeist + { + static IntCommand _DiamondCasinoHeistCut1{"diamondcasinoheistcut1", "Player 1", "Player 1 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DiamondCasinoHeistCut2{"diamondcasinoheistcut2", "Player 2", "Player 2 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DiamondCasinoHeistCut3{"diamondcasinoheistcut3", "Player 3", "Player 3 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DiamondCasinoHeistCut4{"diamondcasinoheistcut4", "Player 4", "Player 4 cut", std::nullopt, std::nullopt, 0}; + + class SetCuts : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1966898).At(1497).At(736).At(92); + + *base.At(1).As() = _DiamondCasinoHeistCut1.GetState(); + *base.At(2).As() = _DiamondCasinoHeistCut2.GetState(); + *base.At(3).As() = _DiamondCasinoHeistCut3.GetState(); + *base.At(4).As() = _DiamondCasinoHeistCut4.GetState(); + } + }; + + class ForceReady : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1971261); + + *base.At(0, 68).At(8).At(0).As() = 1; + *base.At(1, 68).At(8).At(1).As() = 1; + *base.At(2, 68).At(8).At(2).As() = 1; + *base.At(3, 68).At(8).At(3).As() = 1; + } + }; + + static std::vector> diamondCasinoHeistDifficulty = { + {0, "Normal"}, + {1, "Hard"} + }; + static ListCommand _DiamondCasinoHeistDifficulty{"diamondcasinoheistdifficulty", "Difficulty", "Heist difficulty", diamondCasinoHeistDifficulty, 0}; + + static std::vector> diamondCasinoHeistPrimaryTarget = { + {3, "Diamonds"}, + {1, "Gold"}, + {2, "Artwork"}, + {0, "Cash"} + }; + static ListCommand _DiamondCasinoHeistPrimaryTarget{"diamondcasinoheistprimarytarget", "Primary Target", "Primary target", diamondCasinoHeistPrimaryTarget, 3}; + + static ListCommand* _DiamondCasinoHeistGunmanPtr = nullptr; + static ListCommand* _DiamondCasinoHeistApproachPtr = nullptr; + + static std::vector>>> diamondCasinoHeistWeapon = { + { + {{0, "MK II Shotgun Loadout"}, {1, "MK II Rifle Loadout"}}, + {{0, "MK II SMG Loadout"}, {1, "MK II Rifle Loadout"}}, + {{0, "MK II Shotgun Loadout"}, {1, "MK II Rifle Loadout"}} + }, + { + {{0, "Rifle Loadout"}, {1, "Shotgun Loadout"}}, + {{0, "Rifle Loadout"}, {1, "Shotgun Loadout"}}, + {{0, "Rifle Loadout"}, {1, "Shotgun Loadout"}} + }, + { + {{0, "Combat PDW Loadout"}, {1, "Rifle Loadout"}}, + {{0, "Shotgun Loadout"}, {1, "Rifle Loadout"}}, + {{0, "Shotgun Loadout"}, {1, "Combat MG Loadout"}} + }, + { + {{0, "SMG Loadout"}, {1, "Shotgun Loadout"}}, + {{0, "Machine Pistol Loadout"}, {1, "Shotgun Loadout"}}, + {{0, "SMG Loadout"}, {1, "Shotgun Loadout"}} + }, + { + {{0, "Micro SMG Loadout"}, {1, "Machine Pistol Loadout"}}, + {{0, "Micro SMG Loadout"}, {1, "Shotgun Loadout"}}, + {{0, "Shotgun Loadout"}, {1, "Revolver Loadout"}} + }, + { + {{0, " "}, {1, ""}}, + {{0, ""}, {1, ""}}, + {{0, ""}, {1, ""}} + } + }; + static ListCommand _DiamondCasinoHeistWeapon{"diamondcasinoheistweapon", "Weapon", "Weapon", diamondCasinoHeistWeapon[5][0], 0}; + + static std::vector> diamondCasinoHeistGunman = { + {0, "Chester McCoy"}, + {1, "Gustavo Mota"}, + {2, "Patrick McReary"}, + {3, "Charlie Reed"}, + {4, "Karl Abolaji"}, + {5, "Remove Gunman"} + }; + + class Gunman : public ListCommand + { + using ListCommand::ListCommand; + + virtual void OnChange() override + { + _DiamondCasinoHeistWeapon.SetList(diamondCasinoHeistWeapon[this->GetState()][_DiamondCasinoHeistApproachPtr->GetState()]); + _DiamondCasinoHeistWeapon.SetState(0); + } + }; + static Gunman _DiamondCasinoHeistGunman{"diamondcasinoheistgunman", "Gunman", "Gunman", diamondCasinoHeistGunman, 5}; + + static std::vector> diamondCasinoHeistApproach = { + {0, "Silent & Sneaky"}, + {1, "The Big Con"}, + {2, "Aggressive"} + }; + + class Approach : public ListCommand + { + using ListCommand::ListCommand; + + virtual void OnChange() override + { + _DiamondCasinoHeistWeapon.SetList(diamondCasinoHeistWeapon[_DiamondCasinoHeistGunmanPtr->GetState()][this->GetState()]); + _DiamondCasinoHeistWeapon.SetState(0); + } + }; + static Approach _DiamondCasinoHeistApproach{"diamondcasinoheistapproach", "Approach", "Heist approach", diamondCasinoHeistApproach, 0}; + + static struct InitPtrs + { + InitPtrs() + { + _DiamondCasinoHeistGunmanPtr = &_DiamondCasinoHeistGunman; + _DiamondCasinoHeistApproachPtr = &_DiamondCasinoHeistApproach; + } + } _initPtrs; + + static std::vector>> diamondCasinoHeistVehicle = { + {{0, "Zhaba"}, {1, "Vagrant"}, {2, "Outlaw"}, {3, "Everon"}}, + {{0, "Sultan Classic"}, {1, "Gauntlet Classic"}, {2, "Ellie"}, {3, "Komoda"}}, + {{0, "Retinue MK II"}, {1, "Drifty Yosemite"}, {2, "Sugoi"}, {3, "Jugular"}}, + {{0, "Manchez"}, {1, "Stryder"}, {2, "Defiler"}, {3, "Lectro"}}, + {{0, "Issi Classic"}, {1, "Asbo"}, {2, "Kanjo"}, {3, "Sentinel Classic"}}, + {{0, " "}, {1, ""}, {2, ""}, {3, ""}} + }; + static ListCommand _DiamondCasinoHeistVehicle{"diamondcasinoheistvehicle", "Vehicle", "Vehicle", diamondCasinoHeistVehicle[5], 0}; + + static std::vector> diamondCasinoHeistDriver = { + {0, "Chester McCoy"}, + {1, "Eddie Toh"}, + {2, "Taliana Martinez"}, + {3, "Zach Nelson"}, + {4, "Karim Denz"}, + {5, "Remove Driver"} + }; + + class Driver : public ListCommand + { + using ListCommand::ListCommand; + + virtual void OnChange() override + { + _DiamondCasinoHeistVehicle.SetList(diamondCasinoHeistVehicle[this->GetState()]); + _DiamondCasinoHeistVehicle.SetState(0); + } + }; + static Driver _DiamondCasinoHeistDriver{"diamondcasinoheistdriver", "Driver", "Driver", diamondCasinoHeistDriver, 5}; + + static std::vector> diamondCasinoHeistHacker = { + {4, "Avi Schwartzman"}, + {5, "Paige Harris"}, + {2, "Christian Feltz"}, + {3, "Yohan Blair"}, + {1, "Rickie Lukens"}, + {6, "Remove Hacker"} + }; + static ListCommand _DiamondCasinoHeistHacker{"diamondcasinoheisthacker", "Hacker", "Hacker", diamondCasinoHeistHacker, 6}; + + class Setup : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Stats::SetInt("MPX_H3_COMPLETEDPOSIX", -1); + Stats::SetInt("MPX_H3OPT_MASKS", 4); + Stats::SetInt("MPX_H3OPT_WEAPS", _DiamondCasinoHeistWeapon.GetState()); + Stats::SetInt("MPX_H3OPT_VEHS", _DiamondCasinoHeistVehicle.GetState()); + Stats::SetInt("MPX_CAS_HEIST_FLOW", -1); + Stats::SetInt("MPX_H3_LAST_APPROACH", 0); + Stats::SetInt("MPX_H3OPT_APPROACH", _DiamondCasinoHeistApproach.GetState() + 1); // 1 = Silent & Sneaky, 2 = The Big Con, 3 = Aggressive + + switch (_DiamondCasinoHeistDifficulty.GetState()) + { + case 0: Stats::SetInt("MPX_H3_HARD_APPROACH", 0); break; + case 1: Stats::SetInt("MPX_H3_HARD_APPROACH", _DiamondCasinoHeistApproach.GetState() + 1); break; + default: break; + } + + Stats::SetInt("MPX_H3OPT_TARGET", _DiamondCasinoHeistPrimaryTarget.GetState()); + Stats::SetInt("MPX_H3OPT_POI", 1023); + Stats::SetInt("MPX_H3OPT_ACCESSPOINTS", 2047); + + switch (_DiamondCasinoHeistGunman.GetState()) + { + case 0: Stats::SetInt("MPX_H3OPT_CREWWEAP", 4); break; + case 1: Stats::SetInt("MPX_H3OPT_CREWWEAP", 2); break; + case 2: Stats::SetInt("MPX_H3OPT_CREWWEAP", 5); break; + case 3: Stats::SetInt("MPX_H3OPT_CREWWEAP", 3); break; + case 4: Stats::SetInt("MPX_H3OPT_CREWWEAP", 1); break; + case 5: Stats::SetInt("MPX_H3OPT_CREWWEAP", 6); break; + default: break; + } + + switch (_DiamondCasinoHeistDriver.GetState()) + { + case 0: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 5); break; + case 1: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 3); break; + case 2: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 2); break; + case 3: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 4); break; + case 4: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 1); break; + case 5: Stats::SetInt("MPX_H3OPT_CREWDRIVER", 6); break; + default: break; + } + + Stats::SetInt("MPX_H3OPT_CREWHACKER", _DiamondCasinoHeistHacker.GetState()); + Stats::SetInt("MPX_H3OPT_DISRUPTSHIP", 3); // Security Strength: 1 = Strong, 2 = Medium, 3 = Weak + Stats::SetInt("MPX_H3OPT_BODYARMORLVL", -1); + Stats::SetInt("MPX_H3OPT_KEYLEVELS", 2); // 1 = Level1 Security Pass, 2 = Level2 Security Pass + + Stats::SetInt("MPX_H3OPT_BITSET0", rand() % (INT_MAX)); // Refresh board + Stats::SetInt("MPX_H3OPT_BITSET1", rand() % (INT_MAX)); // Refresh board + + ScriptMgr::Yield(500ms); + + Stats::SetInt("MPX_H3OPT_BITSET0", -1); // Refresh board + Stats::SetInt("MPX_H3OPT_BITSET1", -1); // Refresh board + } + }; + + static IntCommand _DiamondCasinoHeistPotentialTake{"diamondcasinoheistpotentialtake", "Potential Take", "Updates potential take", std::nullopt, std::nullopt, 0}; + + class SetPotentialTake : public Command + { + using Command::Command; + + virtual void OnCall() override + { + int primary_target = Stats::GetInt("MPX_H3OPT_TARGET"); + + switch (primary_target) + { + case 0: *Tunables::GetTunable(static_cast(-1638885821)).As() = _DiamondCasinoHeistPotentialTake.GetState(); break; // "Cash" + case 1: *Tunables::GetTunable(static_cast(-582734553)).As() = _DiamondCasinoHeistPotentialTake.GetState(); break; // "Gold" + case 2: *Tunables::GetTunable(static_cast(1934398910)).As() = _DiamondCasinoHeistPotentialTake.GetState(); break; // "Artwork" + case 3: *Tunables::GetTunable(static_cast(1277889925)).As() = _DiamondCasinoHeistPotentialTake.GetState(); break; // "Diamond" + default: break; + } + } + }; + + static IntCommand _DiamondCasinoHeistActualTake{"diamondcasinoheistactualtake", "Actual Take", "Updates actual take", std::nullopt, std::nullopt, 0}; + + class SetActualTake : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 20387).At(2686).As() = _DiamondCasinoHeistActualTake.GetState(); + } + }; + + class SkipHacking : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 53999).As() = 5; + *ScriptLocal("fm_mission_controller"_J, 55065).As() = 5; + } + }; + + class SkipDrilling : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 10547).At(7).As() = *ScriptLocal("fm_mission_controller"_J, 10547).At(37).As(); + } + }; + + class InstantFinish : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller"_J, 20387).At(1740).At(1).As() = 80; + *ScriptLocal("fm_mission_controller"_J, 20387).At(2686).As() = 4443220; + *ScriptLocal("fm_mission_controller"_J, 20387).At(1062).As() = 5; + *ScriptLocal("fm_mission_controller"_J, 20387).As() = 12; + *ScriptLocal("fm_mission_controller"_J, 29006).At(1).As() = 99999; + *ScriptLocal("fm_mission_controller"_J, 32462).At(1).At(68).As() = 99999; + } + }; + + static SetCuts _DiamondCasinoHeistSetCuts{"diamondcasinoheistsetcuts", "Set Cuts", "Sets heist cut"}; + static ForceReady _DiamondCasinoHeistForceReady{"diamondcasinoheistforceready", "Force Ready", "Forces all players to be ready"}; + static Setup _DiamondCasinoHeistSetup{"diamondcasinoheistsetup", "Setup", "Sets up diamond casino heist"}; + static SetPotentialTake _DiamondCasinoHeistSetPotentialTake{"diamondcasinoheistsetpotentialtake", "Set Potential Take", "Updates potential take"}; + static SetActualTake _DiamondCasinoHeistSetActualTake{"diamondcasinoheistsetactualtake", "Set Actual Take", "Updates actual take"}; + static SkipHacking _DiamondCasinoHeistSkipHacking{"diamondcasinoheistskiphacking", "Skip Hacking", "Skips hacking process"}; + static SkipDrilling _DiamondCasinoHeistSkipDrilling{"diamondcasinoheistskipdrilling", "Skip Drilling", "Skips drilling process"}; + static InstantFinish _DiamondCasinoHeistInstantFinish{"diamondcasinoheistinstantfinish", "Instant Finish", "Instantly passes the heist"}; + } +} \ No newline at end of file diff --git a/src/game/features/recovery/Heist/DoomsdayHeist.cpp b/src/game/features/recovery/Heist/DoomsdayHeist.cpp new file mode 100644 index 00000000..2431dd31 --- /dev/null +++ b/src/game/features/recovery/Heist/DoomsdayHeist.cpp @@ -0,0 +1,141 @@ +#include "core/commands/Command.hpp" +#include "core/commands/IntCommand.hpp" +#include "core/commands/ListCommand.hpp" +#include "game/gta/Stats.hpp" +#include "game/gta/ScriptGlobal.hpp" +#include "game/gta/ScriptLocal.hpp" +#include "core/backend/ScriptMgr.hpp" + +namespace YimMenu::Features +{ + namespace DoomsdayHeist + { + static IntCommand _DoomsdayHeistCut1{"doomsdayheistcut1", "Player 1", "Player 1 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DoomsdayHeistCut2{"doomsdayheistcut2", "Player 2", "Player 2 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DoomsdayHeistCut3{"doomsdayheistcut3", "Player 3", "Player 3 cut", std::nullopt, std::nullopt, 0}; + static IntCommand _DoomsdayHeistCut4{"doomsdayheistcut4", "Player 4", "Player 4 cut", std::nullopt, std::nullopt, 0}; + + class SetCuts : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1962078).At(812).At(50); + + *base.At(1).As() = _DoomsdayHeistCut1.GetState(); + *base.At(2).As() = _DoomsdayHeistCut2.GetState(); + *base.At(3).As() = _DoomsdayHeistCut3.GetState(); + *base.At(4).As() = _DoomsdayHeistCut4.GetState(); + } + }; + + class ForceReady : public Command + { + using Command::Command; + + virtual void OnCall() override + { + auto base = ScriptGlobal(1882925); + + *base.At(0, 149).At(43).At(0).At(4).At(8).As() = 1; + *base.At(1, 149).At(43).At(1).At(4).At(8).As() = 1; + *base.At(2, 149).At(43).At(2).At(4).At(8).As() = 1; + *base.At(3, 149).At(43).At(3).At(4).At(8).As() = 1; + } + }; + + static std::vector> doomsdayHeistCategory = { + {0, "The Data Breaches"}, + {1, "The Bogdan Problem"}, + {2, "The Doomsday Senario"} + }; + static ListCommand _DoomsdayHeistCategory{"doomsdayheistcategory", "Select Heist", "Heist categories", doomsdayHeistCategory, 0}; + + class Setup : public Command + { + using Command::Command; + + virtual void OnCall() override + { + switch (_DoomsdayHeistCategory.GetState()) + { + case 0: + Stats::SetInt("MPX_GANGOPS_FLOW_MISSION_PROG", 503); + Stats::SetInt("MPX_GANGOPS_HEIST_STATUS", -229383); + Stats::SetInt("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557); + break; + case 1: + Stats::SetInt("MPX_GANGOPS_FLOW_MISSION_PROG", 240); + Stats::SetInt("MPX_GANGOPS_HEIST_STATUS", -229378); + Stats::SetInt("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557); + break; + case 2: + Stats::SetInt("MPX_GANGOPS_FLOW_MISSION_PROG", 16368); + Stats::SetInt("MPX_GANGOPS_HEIST_STATUS", -229380); + Stats::SetInt("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557); + break; + default: break; + } + + ScriptMgr::Yield(500ms); + + *ScriptLocal("gb_gang_ops_planning"_J, 207).As() = 6; // Reload planning screen + } + }; + + class SkipHacking : public Command + { + using Command::Command; + + virtual void OnCall() override + { + *ScriptLocal("fm_mission_controller"_J, 1538).As() = 3; + *ScriptLocal("fm_mission_controller"_J, 1569).As() = 2; + *ScriptLocal("fm_mission_controller"_J, 1294).At(135).As() = 3; + } + }; + + class InstantFinish : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller"_J, 20387).At(1725).At(1).As() = 80; + *ScriptLocal("fm_mission_controller"_J, 20387).As() = 12; + *ScriptLocal("fm_mission_controller"_J, 29006).At(1).As() = 99999; + *ScriptLocal("fm_mission_controller"_J, 32462).At(1).At(68).As() = 99999; + + // TODO: find a way of getting current heist info so that InstantFinishAct3 can be implemented here conditionally. + } + }; + + class InstantFinishAct3 : public Command + { + using Command::Command; + + virtual void OnCall() override + { + Scripts::ForceScriptHost(Scripts::FindScriptThread("fm_mission_controller"_J)); + ScriptMgr::Yield(500ms); + + *ScriptLocal("fm_mission_controller"_J, 20387).As() = 12; + *ScriptLocal("fm_mission_controller"_J, 20387).At(1740).At(1).As() = 150; + *ScriptLocal("fm_mission_controller"_J, 20387).At(1062).As() = 5; + *ScriptLocal("fm_mission_controller"_J, 29006).At(1).As() = 99999; + *ScriptLocal("fm_mission_controller"_J, 32462).At(1).At(68).As() = 99999; + } + }; + + static SetCuts _DoomsdayHeistSetCuts{"doomsdayheistsetcuts", "Set Cuts", "Sets heist cut"}; + static ForceReady _DoomsdayHeistForceReady{"doomsdayheistforceready", "Force Ready", "Forces all players to be ready"}; + static Setup _DoomsdayHeistSetup{"doomsdayheistsetup", "Setup", "Sets up doomsday heist"}; + static SkipHacking _DoomsdayHeistSkipHacking{"doomsdayheistskiphacking", "Skip Hacking", "Skips hacking process"}; + static InstantFinish _DoomsdayHeistInstantFinish{"doomsdayheistinstantfinish", "Instant Finish", "Instantly passes the heist"}; + static InstantFinishAct3 _DoomsdayHeistInstantFinishAct3{"doomsdayheistinstantfinishact3", "Instant Finish (Act: III)", "Instantly passes Doomsday Scenario Act: III"}; + } +} \ No newline at end of file diff --git a/src/game/features/teleport/TpToWaypoint.cpp b/src/game/features/teleport/TpToWaypoint.cpp index 153b604d..9271dc30 100644 --- a/src/game/features/teleport/TpToWaypoint.cpp +++ b/src/game/features/teleport/TpToWaypoint.cpp @@ -75,7 +75,6 @@ namespace YimMenu::Features auto new_coords{coords}; ResolveZCoordinate(new_coords); Self::GetPed().TeleportTo(new_coords); - ScriptMgr::Yield(); }); HUD::SET_WAYPOINT_OFF(); } diff --git a/src/game/frontend/items/Items.hpp b/src/game/frontend/items/Items.hpp index 34f1b677..bd157238 100644 --- a/src/game/frontend/items/Items.hpp +++ b/src/game/frontend/items/Items.hpp @@ -197,4 +197,20 @@ namespace YimMenu std::optional m_LabelOverride; std::optional m_CurrentInput = std::nullopt; }; + + class TabItem : public UIItem + { + public: + explicit TabItem(const std::string& name); + void Draw() override; + + void AddItem(std::shared_ptr&& item) + { + m_Items.push_back(std::move(item)); + } + + private: + std::string m_Name; + std::vector> m_Items; + }; } \ No newline at end of file diff --git a/src/game/frontend/items/TabItem.cpp b/src/game/frontend/items/TabItem.cpp new file mode 100644 index 00000000..427f47be --- /dev/null +++ b/src/game/frontend/items/TabItem.cpp @@ -0,0 +1,22 @@ +#include "Items.hpp" + +namespace YimMenu +{ + TabItem::TabItem(const std::string& name) : + m_Name(name) + { + } + + void TabItem::Draw() + { + if (ImGui::BeginTabItem(m_Name.c_str())) + { + for (auto& item : m_Items) + { + if (item->CanDraw()) + item->Draw(); + } + ImGui::EndTabItem(); + } + } +} diff --git a/src/game/frontend/submenus/Network.cpp b/src/game/frontend/submenus/Network.cpp index 9bb0f963..d58befbc 100644 --- a/src/game/frontend/submenus/Network.cpp +++ b/src/game/frontend/submenus/Network.cpp @@ -4,7 +4,7 @@ #include "game/frontend/items/Items.hpp" #include "game/frontend/submenus/Network/SavedPlayers.hpp" #include "game/gta/Network.hpp" -#include "game/frontend/submenus/network/RandomEvents.hpp" +#include "game/frontend/submenus/Network/RandomEvents.hpp" namespace YimMenu::Submenus { diff --git a/src/game/frontend/submenus/Recovery.cpp b/src/game/frontend/submenus/Recovery.cpp index 481b90ea..60e76fcd 100644 --- a/src/game/frontend/submenus/Recovery.cpp +++ b/src/game/frontend/submenus/Recovery.cpp @@ -3,6 +3,7 @@ #include "game/features/recovery/GiveVehicleReward.hpp" #include "Recovery/StatEditor.hpp" #include "Recovery/Transactions.hpp" +#include "Recovery/HeistModifier.hpp" namespace YimMenu::Submenus { @@ -13,7 +14,6 @@ namespace YimMenu::Submenus auto missions = std::make_shared("Missions"); auto vehiclesGroup = std::make_shared("Vehicles"); auto generalGroup = std::make_shared("General"); - auto cayoPericoGroup = std::make_shared("Cayo Perico"); vehiclesGroup->AddItem(std::make_shared("dlcvehicles"_J)); @@ -30,15 +30,12 @@ namespace YimMenu::Submenus generalGroup->AddItem(std::make_shared("playallmissionssolo"_J)); generalGroup->AddItem(std::make_shared("forcelaunchheist"_J)); - cayoPericoGroup->AddItem(std::make_shared("skipcayosetup"_J)); - cayoPericoGroup->AddItem(std::make_shared("skipcayocooldown"_J)); - shopping->AddItem(vehiclesGroup); missions->AddItem(generalGroup); - missions->AddItem(cayoPericoGroup); AddCategory(std::move(shopping)); AddCategory(std::move(missions)); AddCategory(BuildStatEditorMenu()); AddCategory(BuildTransactionsMenu()); + AddCategory(BuildHeistModifierMenu()); } } \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.cpp b/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.cpp new file mode 100644 index 00000000..309cddda --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.cpp @@ -0,0 +1,33 @@ +#include "ApartmentHeist.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderApartmentHeistMenu() + { + auto tab = std::make_shared("Apartment Heist"); + + auto cuts = std::make_shared("Heist Cuts", 2); + auto setups = std::make_shared("Heist Setups"); + auto misc = std::make_shared("Misc", 1); + + cuts->AddItem(std::make_shared("apartmentheistcut1"_J)); + cuts->AddItem(std::make_shared("apartmentheistcut3"_J)); + cuts->AddItem(std::make_shared("apartmentheistcut2"_J)); + cuts->AddItem(std::make_shared("apartmentheistcut4"_J)); + cuts->AddItem(std::make_shared("apartmentheistforceready"_J)); + cuts->AddItem(std::make_shared("apartmentheistsetcuts"_J)); + + setups->AddItem(std::make_shared("apartmentheistsetup"_J)); + + misc->AddItem(std::make_shared("apartmentheistskiphacking"_J)); + misc->AddItem(std::make_shared("apartmentheistskipdrilling"_J)); + misc->AddItem(std::make_shared("apartmentheistinstantfinish"_J)); + misc->AddItem(std::make_shared("apartmentheistinstantfinishpacific"_J)); + + tab->AddItem(cuts); + tab->AddItem(setups); + tab->AddItem(misc); + + return tab; + } +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.hpp b/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.hpp new file mode 100644 index 00000000..7de2104c --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/ApartmentHeist.hpp @@ -0,0 +1,6 @@ +#include "game/frontend/submenus/Recovery/HeistModifier.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderApartmentHeistMenu(); +} diff --git a/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.cpp b/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.cpp new file mode 100644 index 00000000..471059f1 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.cpp @@ -0,0 +1,50 @@ +#include "CayoPericoHeist.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderCayoPericoHeistMenu() + { + auto tab = std::make_shared("Cayo Perico Heist"); + + auto cuts = std::make_shared("Heist Cuts", 2); + auto setups = std::make_shared("Heist Setups"); + auto loots = std::make_shared("Loots"); + auto misc = std::make_shared("Misc", 1); + + cuts->AddItem(std::make_shared("cayopericoheistcut1"_J)); + cuts->AddItem(std::make_shared("cayopericoheistcut3"_J)); + cuts->AddItem(std::make_shared("cayopericoheistcut2"_J)); + cuts->AddItem(std::make_shared("cayopericoheistcut4"_J)); + cuts->AddItem(std::make_shared("cayopericoheistforceready"_J)); + cuts->AddItem(std::make_shared("cayopericoheistsetcuts"_J)); + + setups->AddItem(std::make_shared("cayopericoheistdifficulty"_J)); + setups->AddItem(std::make_shared("cayopericoheistprimarytarget"_J)); + setups->AddItem(std::make_shared("cayopericoheistweapon"_J)); + setups->AddItem(std::make_shared("cayopericoheistsetup"_J)); + + loots->AddItem(std::make_shared("cayopericoheistprimarytargetvalue"_J)); + loots->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + loots->AddItem(std::make_shared("cayopericoheistsetprimarytargetvalue"_J)); + loots->AddItem(std::make_shared("cayopericoheistsecondarytakevalue"_J)); + loots->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + loots->AddItem(std::make_shared("cayopericoheistsetsecondarytakevalue"_J)); + + misc->AddItem(std::make_shared("cayopericoheistskiphacking"_J)); + misc->AddItem(std::make_shared("cayopericoheistcutsewer"_J)); + misc->AddItem(std::make_shared("cayopericoheistcutglass"_J)); + misc->AddItem(std::make_shared("cayopericoheisttakeprimarytarget"_J)); + misc->AddItem(std::make_shared("cayopericoheistinstantfinish"_J)); + + tab->AddItem(cuts); + tab->AddItem(setups); + tab->AddItem(loots); + tab->AddItem(misc); + + return tab; + } +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.hpp b/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.hpp new file mode 100644 index 00000000..59dddfa4 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/CayoPericoHeist.hpp @@ -0,0 +1,6 @@ +#include "game/frontend/submenus/Recovery/HeistModifier.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderCayoPericoHeistMenu(); +} diff --git a/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.cpp b/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.cpp new file mode 100644 index 00000000..3ef6b854 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.cpp @@ -0,0 +1,61 @@ +#include "DiamondCasinoHeist.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderDiamondCasinoHeistMenu() + { + auto tab = std::make_shared("Diamond Casino Heist"); + + auto cuts = std::make_shared("Heist Cuts", 2); + auto setups1 = std::make_shared("Heist Setups"); + auto setups2 = std::make_shared(""); + auto loots = std::make_shared("Loots"); + auto misc = std::make_shared("Misc", 1); + + cuts->AddItem(std::make_shared("diamondcasinoheistcut1"_J)); + cuts->AddItem(std::make_shared("diamondcasinoheistcut3"_J)); + cuts->AddItem(std::make_shared("diamondcasinoheistcut2"_J)); + cuts->AddItem(std::make_shared("diamondcasinoheistcut4"_J)); + cuts->AddItem(std::make_shared("diamondcasinoheistforceready"_J)); + cuts->AddItem(std::make_shared("diamondcasinoheistsetcuts"_J)); + + setups1->AddItem(std::make_shared("diamondcasinoheistdifficulty"_J)); + setups1->AddItem(std::make_shared("diamondcasinoheistprimarytarget"_J)); + setups1->AddItem(std::make_shared("diamondcasinoheistapproach"_J)); + setups1->AddItem(std::make_shared("diamondcasinoheistgunman"_J)); + setups1->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + setups1->AddItem(std::make_shared("diamondcasinoheistweapon"_J)); + setups2->AddItem(std::make_shared("diamondcasinoheistdriver"_J)); + setups2->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + setups2->AddItem(std::make_shared("diamondcasinoheistvehicle"_J)); + setups2->AddItem(std::make_shared("diamondcasinoheisthacker"_J)); + setups2->AddItem(std::make_shared("diamondcasinoheistsetup"_J)); + + loots->AddItem(std::make_shared("diamondcasinoheistpotentialtake"_J)); + loots->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + loots->AddItem(std::make_shared("diamondcasinoheistsetpotentialtake"_J)); + loots->AddItem(std::make_shared("diamondcasinoheistactualtake"_J)); + loots->AddItem(std::make_shared([] { + ImGui::SameLine(); + })); + loots->AddItem(std::make_shared("diamondcasinoheistsetactualtake"_J)); + + misc->AddItem(std::make_shared("diamondcasinoheistskiphacking"_J)); + misc->AddItem(std::make_shared("diamondcasinoheistskipdrilling"_J)); + misc->AddItem(std::make_shared("diamondcasinoheistinstantfinish"_J)); + + tab->AddItem(cuts); + tab->AddItem(setups1); + tab->AddItem(setups2); + tab->AddItem(loots); + tab->AddItem(misc); + + return tab; + } +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.hpp b/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.hpp new file mode 100644 index 00000000..7394e33c --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/DiamondCasinoHeist.hpp @@ -0,0 +1,6 @@ +#include "game/frontend/submenus/Recovery/HeistModifier.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderDiamondCasinoHeistMenu(); +} diff --git a/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.cpp b/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.cpp new file mode 100644 index 00000000..39d40a43 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.cpp @@ -0,0 +1,33 @@ +#include "DoomsdayHeist.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderDoomsdayHeistMenu() + { + auto tab = std::make_shared("Doomsday Heist"); + + auto cuts = std::make_shared("Heist Cuts", 2); + auto setups = std::make_shared("Heist Setups"); + auto misc = std::make_shared("Misc", 1); + + cuts->AddItem(std::make_shared("doomsdayheistcut1"_J)); + cuts->AddItem(std::make_shared("doomsdayheistcut3"_J)); + cuts->AddItem(std::make_shared("doomsdayheistcut2"_J)); + cuts->AddItem(std::make_shared("doomsdayheistcut4"_J)); + cuts->AddItem(std::make_shared("doomsdayheistforceready"_J)); + cuts->AddItem(std::make_shared("doomsdayheistsetcuts"_J)); + + setups->AddItem(std::make_shared("doomsdayheistcategory"_J)); + setups->AddItem(std::make_shared("doomsdayheistsetup"_J)); + + misc->AddItem(std::make_shared("doomsdayheistskiphacking"_J)); + misc->AddItem(std::make_shared("doomsdayheistinstantfinish"_J)); + misc->AddItem(std::make_shared("doomsdayheistinstantfinishact3"_J)); + + tab->AddItem(cuts); + tab->AddItem(setups); + tab->AddItem(misc); + + return tab; + } +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.hpp b/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.hpp new file mode 100644 index 00000000..078d71e5 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/Heist/DoomsdayHeist.hpp @@ -0,0 +1,6 @@ +#include "game/frontend/submenus/Recovery/HeistModifier.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr RenderDoomsdayHeistMenu(); +} diff --git a/src/game/frontend/submenus/Recovery/HeistModifier.cpp b/src/game/frontend/submenus/Recovery/HeistModifier.cpp new file mode 100644 index 00000000..5b7c01af --- /dev/null +++ b/src/game/frontend/submenus/Recovery/HeistModifier.cpp @@ -0,0 +1,26 @@ +#include "HeistModifier.hpp" +#include "Heist/ApartmentHeist.hpp" +#include "Heist/DiamondCasinoHeist.hpp" +#include "Heist/CayoPericoHeist.hpp" +#include "Heist/DoomsdayHeist.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr BuildHeistModifierMenu() + { + auto menu = std::make_shared("Heists"); + + menu->AddItem(std::make_shared([] { + ImGui::BeginTabBar("Heist Modifier"); + })); + menu->AddItem(RenderApartmentHeistMenu()); + menu->AddItem(RenderDiamondCasinoHeistMenu()); + menu->AddItem(RenderCayoPericoHeistMenu()); + menu->AddItem(RenderDoomsdayHeistMenu()); + menu->AddItem(std::make_shared([] { + ImGui::EndTabBar(); + })); + + return menu; + } +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery/HeistModifier.hpp b/src/game/frontend/submenus/Recovery/HeistModifier.hpp new file mode 100644 index 00000000..843f9944 --- /dev/null +++ b/src/game/frontend/submenus/Recovery/HeistModifier.hpp @@ -0,0 +1,8 @@ +#pragma once +#include "core/frontend/manager/Category.hpp" +#include "game/frontend/items/Items.hpp" + +namespace YimMenu::Submenus +{ + std::shared_ptr BuildHeistModifierMenu(); +} \ No newline at end of file diff --git a/src/game/gta/ScriptGlobal.hpp b/src/game/gta/ScriptGlobal.hpp index 1d3b166a..b9ec82f8 100644 --- a/src/game/gta/ScriptGlobal.hpp +++ b/src/game/gta/ScriptGlobal.hpp @@ -42,5 +42,4 @@ namespace YimMenu void* Get() const; }; - } \ No newline at end of file diff --git a/src/game/gta/ScriptLocal.hpp b/src/game/gta/ScriptLocal.hpp index f9d88d9b..470b8648 100644 --- a/src/game/gta/ScriptLocal.hpp +++ b/src/game/gta/ScriptLocal.hpp @@ -2,6 +2,8 @@ #include #include #include +#include +#include namespace YimMenu { @@ -32,6 +34,12 @@ namespace YimMenu } + constexpr ScriptLocal(joaat_t script, std::size_t index) : + ScriptLocal(Scripts::FindScriptThread(script)->m_Stack, index) + { + + } + constexpr ScriptLocal At(std::ptrdiff_t offset) const { return { m_StackPtr, m_Index + offset };