- Added "Unlimited Items" (Player) - Stops the game from lowering the amount of items such as consumables / throwables when using them, alongside other inventory items such as ammo, lockpicks and even money; WARNING: Dropping the entire amount of an item will remove the item from your inventory, whilst also being dropped

This commit is contained in:
EricPlayZ
2024-05-10 19:21:19 +03:00
parent 1bd10e06d6
commit 870a625728
6 changed files with 27 additions and 3 deletions

View File

@ -57,6 +57,7 @@ Thank you everyone for the support <3)" },
- Added "Old World Money" slider (Player)
- Added "Unlimited Immunity" (Player)
- Added "Unlimited Stamina" (Player)
- Added "Unlimited Items" (Player) - Stops the game from lowering the amount of items such as consumables / throwables when using them, alongside other inventory items such as ammo, lockpicks and even money; WARNING: Dropping the entire amount of an item will remove the item from your inventory, whilst also being dropped
- Added "One-Hit Kill" (Player)
- Added "Invisible to Enemies" (Player)
- Added "Allow Grapple Hook in Safezone" (Player)

View File

@ -4347,6 +4347,7 @@ namespace Config {
{ "Menu:Keybinds", "FreezePlayerToggleKey", std::string("VK_F7"), &Menu::Player::freezePlayer, String },
{ "Menu:Keybinds", "UnlimitedImmunityToggleKey", std::string("VK_NONE"), &Menu::Player::unlimitedImmunity, String},
{ "Menu:Keybinds", "UnlimitedStaminaToggleKey", std::string("VK_NONE"), &Menu::Player::unlimitedStamina, String},
{ "Menu:Keybinds", "UnlimitedItemsToggleKey", std::string("VK_NONE"), &Menu::Player::unlimitedItems, String},
{ "Menu:Keybinds", "OneHitKillToggleKey", std::string("VK_NONE"), &Menu::Player::oneHitKill, String},
{ "Menu:Keybinds", "DisableOutOfBoundsTimerToggleKey", std::string("VK_NONE"), &Menu::Player::disableOutOfBoundsTimer, String},
{ "Menu:Keybinds", "NightrunnerModeToggleKey", std::string("VK_F9"), &Menu::Player::nightrunnerMode, String},
@ -4372,6 +4373,7 @@ namespace Config {
{ "Player:Misc", "GodMode", false, &Menu::Player::godMode, OPTION },
{ "Player:Misc", "UnlimitedImmunity", false, &Menu::Player::unlimitedImmunity, OPTION },
{ "Player:Misc", "UnlimitedStamina", false, &Menu::Player::unlimitedStamina, OPTION },
{ "Player:Misc", "UnlimitedItems", false, &Menu::Player::unlimitedItems, OPTION },
{ "Player:Misc", "OneHitKill", false, &Menu::Player::oneHitKill, OPTION },
{ "Player:Misc", "InvisibleToEnemies", true, &Menu::Player::invisibleToEnemies, OPTION },
{ "Player:Misc", "DisableOutOfBoundsTimer", true, &Menu::Player::disableOutOfBoundsTimer, OPTION },

View File

@ -254,6 +254,21 @@ namespace GamePH {
}
#pragma endregion
#pragma region HandleInventoryItemsAmount
static void detourHandleInventoryItemsAmount(int* pInventoryItem_0x10, UINT amount);
static Utils::Hook::MHook<LPVOID, void(*)(int*, UINT)> HandleInventoryItemsAmountHook{ "HandleInventoryItemsAmount", &Offsets::Get_HandleInventoryItemsAmount, &detourHandleInventoryItemsAmount };
static void detourHandleInventoryItemsAmount(int* pInventoryItem_0x10, UINT amount) {
int previousValue = *pInventoryItem_0x10;
HandleInventoryItemsAmountHook.pOriginal(pInventoryItem_0x10, amount);
if (!LevelDI::Get() || !LevelDI::Get()->IsLoaded())
return;
if (*pInventoryItem_0x10 < previousValue && *pInventoryItem_0x10 == amount && Menu::Player::unlimitedItems.GetValue())
*pInventoryItem_0x10 = previousValue;
}
#pragma endregion
#pragma region ByteHooks
static unsigned char SaveGameCRCBoolCheckBytes[3] = { 0xB3, 0x01, 0x90 }; // mov bl, 01
Utils::Hook::ByteHook<LPVOID> SaveGameCRCBoolCheckHook{ "SaveGameCRCBoolCheck", &Offsets::Get_SaveGameCRCBoolCheck, SaveGameCRCBoolCheckBytes, sizeof(SaveGameCRCBoolCheckBytes), &Menu::Misc::disableSavegameCRCCheck }; // and bl, dil

View File

@ -6441,6 +6441,7 @@ namespace Menu {
KeyBindOption freezePlayer{ VK_F7 };
KeyBindOption unlimitedImmunity{ VK_NONE };
KeyBindOption unlimitedStamina{ VK_NONE };
KeyBindOption unlimitedItems{ VK_NONE };
KeyBindOption oneHitKill{ VK_NONE };
KeyBindOption invisibleToEnemies{ VK_NONE };
KeyBindOption disableOutOfBoundsTimer{ VK_NONE };
@ -6589,6 +6590,8 @@ namespace Menu {
GamePH::PlayerVariables::ManagePlayerVarOption("InfiniteStamina", true, false, &unlimitedStamina);
GamePH::PlayerVariables::ManagePlayerVarOption("UvFlashlightEnergyDrainFactor", 0.0f, 1.0f, &unlimitedItems);
GamePH::PlayerVariables::ManagePlayerVarOption("DamageMulAll", 99999.0f, 0.0f, &oneHitKill, true);
GamePH::PlayerVariables::ManagePlayerVarOption("InVisibleToEnemies", true, false, &invisibleToEnemies);
@ -6960,14 +6963,15 @@ namespace Menu {
ImGui::CheckboxHotkey("Unlimited Immunity", &unlimitedImmunity, "Stops immunity from draining");
ImGui::SameLine();
ImGui::CheckboxHotkey("Unlimited Stamina", &unlimitedStamina, "Stops stamina from draining");
ImGui::CheckboxHotkey("Unlimited Items", &unlimitedItems, "Stops the game from lowering the amount of items such as consumables / throwables when using them, alongside other inventory items such as ammo, lockpicks and even money\nWARNING: Dropping the entire amount of an item will remove the item from your inventory, whilst also being dropped");
ImGui::SameLine();
ImGui::CheckboxHotkey("One-Hit Kill", &oneHitKill, "Makes the player one-hit kill EVERYTHING and EVERYONE RAWRRR");
ImGui::SameLine();
ImGui::CheckboxHotkey("Invisible to Enemies", &invisibleToEnemies, "Makes the player invisible to the enemies");
ImGui::SameLine();
ImGui::CheckboxHotkey("Disable Out of Bounds Timer", &disableOutOfBoundsTimer, "Disables the timer that runs when out of map bounds or mission bounds");
ImGui::SameLine();
ImGui::CheckboxHotkey("Nightrunner Mode", &nightrunnerMode, "Makes Aiden super-human/infected");
ImGui::CheckboxHotkey("One-handed Mode", &oneHandedMode, "Removes Aiden's left hand");
ImGui::SameLine();
ImGui::CheckboxHotkey("One-handed Mode", &oneHandedMode, "Removes Aiden's left hand");
ImGui::CheckboxHotkey("Allow Grapple Hook in Safezone", &allowGrappleHookInSafezone, "Allows player to use grapple hook while in a safezone");
ImGui::SeparatorText("Player Jump Parameters");

View File

@ -13,6 +13,7 @@ namespace Menu {
extern KeyBindOption freezePlayer;
extern KeyBindOption unlimitedImmunity;
extern KeyBindOption unlimitedStamina;
extern KeyBindOption unlimitedItems;
extern KeyBindOption oneHitKill;
extern KeyBindOption invisibleToEnemies;
extern KeyBindOption disableOutOfBoundsTimer;

View File

@ -99,6 +99,7 @@ struct Offsets {
AddOffset(ReadPlayerJumpParams, "gamedll_ph_x64_rwdi.dll", "40 55 56 57 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 4C 8B B5", Utils::SigScan::PatternType::Address, LPVOID)
AddOffset(PlayerGetCurrentWeapon, "gamedll_ph_x64_rwdi.dll", "8B C2 48 8D 14 80 48 83 BC D1 ?? ?? ?? ?? ?? 74 ?? 48 8B 84 D1 ?? ?? ?? ?? C3 33 C0 C3 CC CC CC 8B C2", Utils::SigScan::PatternType::Address, LPVOID)
AddOffset(PlayerGetInventoryMoney, "gamedll_ph_x64_rwdi.dll", "8B C2 48 8B 44 C1", Utils::SigScan::PatternType::Address, LPVOID)
AddOffset(HandleInventoryItemsAmount, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC ?? 8B 29", Utils::SigScan::PatternType::Address, LPVOID)
//AddOffset(CompareAndUpdateFloat, "gamedll_ph_x64_rwdi.dll", "0F 2F C1 73 ?? 0F 28 C1 C3", Utils::SigScan::PatternType::Address, LPVOID)
//AddOffset(HandlePlayerImmunity, "gamedll_ph_x64_rwdi.dll", "48 8B C4 53 56 57 41 56 41 57", Utils::SigScan::PatternType::Address, LPVOID)
//AddOffset(HandlePlayerImmunity2, "gamedll_ph_x64_rwdi.dll", "40 55 56 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B F1 45 0F B6 F0", Utils::SigScan::PatternType::Address, LPVOID)