diff --git a/EGameTools/source/changelog.h b/EGameTools/source/changelog.h index 01fe3d7..bc4e917 100644 --- a/EGameTools/source/changelog.h +++ b/EGameTools/source/changelog.h @@ -57,6 +57,7 @@ Thank you everyone for the support <3)" }, - Added "Unlimited Immunity" (Player) - Added "Unlimited Stamina" (Player) - Added "Invisible to Enemies" (Player) +- Added "Disable Air Control" (Player) - Added "Allow Grapple Hook in Safezone" (Player) - Added "Increase Data PAKs Limit" (Misc; requires game restart to apply) - you can now add more than 8 data PAKs, e.g. data8.pak, data9.pak, data10.pak, etc, up to 200 PAKs in total - Added "Disable Data PAKs CRC Check" (Misc; requires game restart to apply) - stops the game from scanning data PAKs, which allows you to use data PAK mods in multiplayer as well @@ -70,6 +71,7 @@ Thank you everyone for the support <3)" }, - Fixed volatiles still being able to kill you when they jump on top of you while "God Mode" (Player) is enabled - Fixed "Disable Out of Bounds Timer" (Player) not working in missions - Fixed immunity drastically being lowered while rapidly changing the time forward with the "Time" slider (World) at night or while in a dark zone +- Fixed blood overlay still displaying after falling from a great height with "God Mode" (Player) enabled - Changed the config system to only write to the config file whenever there's a change in the mod menu - Changed the way the mod menu gets the list of player variables, meaning the player variables list should self-update, with no manual intervention required even after a game update diff --git a/EGameTools/source/config/config.cpp b/EGameTools/source/config/config.cpp index 8e78410..a9d4e42 100644 --- a/EGameTools/source/config/config.cpp +++ b/EGameTools/source/config/config.cpp @@ -4349,6 +4349,7 @@ namespace Config { { "Menu:Keybinds", "DisableOutOfBoundsTimerToggleKey", std::string("VK_NONE"), &Menu::Player::disableOutOfBoundsTimer, String}, { "Menu:Keybinds", "NightrunnerModeToggleKey", std::string("VK_F9"), &Menu::Player::nightrunnerMode, String}, { "Menu:Keybinds", "OneHandedModeToggleKey", std::string("VK_NONE"), &Menu::Player::oneHandedMode, String}, + { "Menu:Keybinds", "DisableAirControlToggleKey", std::string("VK_NONE"), &Menu::Player::disableAirControl, String}, { "Menu:Keybinds", "AllowGrappleHookInSafezoneToggleKey", std::string("VK_NONE"), &Menu::Player::allowGrappleHookInSafezone, String}, { "Menu:Keybinds", "FreeCamToggleKey", std::string("VK_F3"), &Menu::Camera::freeCam, String}, { "Menu:Keybinds", "TeleportPlayerToCameraToggleKey", std::string("VK_F4"), &Menu::Camera::teleportPlayerToCamera, String}, @@ -4367,6 +4368,7 @@ namespace Config { { "Player:Misc", "DisableOutOfBoundsTimer", true, &Menu::Player::disableOutOfBoundsTimer, OPTION }, { "Player:Misc", "NightrunnerMode", false, &Menu::Player::nightrunnerMode, OPTION }, { "Player:Misc", "OneHandedMode", false, &Menu::Player::oneHandedMode, OPTION }, + { "Player:Misc", "DisableAirControl", false, &Menu::Player::disableAirControl, OPTION }, { "Player:Misc", "AllowGrappleHookInSafezone", false, &Menu::Player::allowGrappleHookInSafezone, OPTION }, { "Player:PlayerVariables", "Enabled", false, &Menu::Player::playerVariables, OPTION }, { "Player:PlayerVariables", "LastSaveSCRPath", std::string(), &Menu::Player::saveSCRPath, String }, diff --git a/EGameTools/source/game/GamePH/game_hooks.cpp b/EGameTools/source/game/GamePH/game_hooks.cpp index fff8569..368d3dc 100644 --- a/EGameTools/source/game/GamePH/game_hooks.cpp +++ b/EGameTools/source/game/GamePH/game_hooks.cpp @@ -219,6 +219,9 @@ namespace GamePH { return 0; } + if (Menu::Player::godMode.GetValue()) + return 0; + return CalculateFallHeightHook.pOriginal(pInstance, height); } #pragma endregion @@ -235,6 +238,34 @@ namespace GamePH { } #pragma endregion +#pragma region ReadPlayerJumpParam + static bool isOnAllowVelocityMod = false; + + static bool detourReadPlayerJumpParam(DWORD64 a1, const char* a2); + static Utils::Hook::MHook ReadPlayerJumpParamHook{ "ReadPlayerJumpParam", &Offsets::Get_ReadPlayerJumpParam, &detourReadPlayerJumpParam }; + + static bool detourReadPlayerJumpParam(DWORD64 a1, const char* a2) { + if (!strcmp(a2, "AllowVelocityMod")) + isOnAllowVelocityMod = true; + + return ReadPlayerJumpParamHook.pOriginal(a1, a2); + } +#pragma endregion + +#pragma region GetBoolFromPlayerJumpParam + static bool detourGetBoolFromPlayerJumpParam(LPVOID a1); + static Utils::Hook::MHook GetBoolFromPlayerJumpParamHook{ "GetBoolFromPlayerJumpParam", &Offsets::Get_GetBoolFromPlayerJumpParam, &detourGetBoolFromPlayerJumpParam }; + + static bool detourGetBoolFromPlayerJumpParam(LPVOID a1) { + if (Menu::Player::disableAirControl.GetValue() && isOnAllowVelocityMod) { + isOnAllowVelocityMod = false; + return false; + } + + return GetBoolFromPlayerJumpParamHook.pOriginal(a1); + } +#pragma endregion + #pragma region ByteHooks static unsigned char SaveGameCRCBoolCheckBytes[3] = { 0xB3, 0x01, 0x90 }; // mov bl, 01 Utils::Hook::ByteHook SaveGameCRCBoolCheckHook{ "SaveGameCRCBoolCheck", &Offsets::Get_SaveGameCRCBoolCheck, SaveGameCRCBoolCheckBytes, sizeof(SaveGameCRCBoolCheckBytes), &Menu::Misc::disableSavegameCRCCheck }; // and bl, dil diff --git a/EGameTools/source/menu/player.cpp b/EGameTools/source/menu/player.cpp index da1114c..7cd7c30 100644 --- a/EGameTools/source/menu/player.cpp +++ b/EGameTools/source/menu/player.cpp @@ -6443,6 +6443,7 @@ namespace Menu { KeyBindOption disableOutOfBoundsTimer{ VK_NONE }; KeyBindOption nightrunnerMode{ VK_F9 }; KeyBindOption oneHandedMode{ VK_NONE }; + KeyBindOption disableAirControl{ VK_NONE }; KeyBindOption allowGrappleHookInSafezone{ VK_NONE }; Option playerVariables{}; @@ -6592,6 +6593,12 @@ namespace Menu { static void UpdateDisabledOptions() { freezePlayer.SetChangesAreDisabled(!Engine::CBulletPhysicsCharacter::Get()); } + static void HandleToggles() { + if (disableAirControl.HasChanged()) { + disableAirControl.SetPrevValue(disableAirControl.GetValue()); + GamePH::ReloadJumps(); + } + } Tab Tab::instance{}; void Tab::Update() { @@ -6601,6 +6608,7 @@ namespace Menu { PlayerImmunityUpdate(); UpdateDisabledOptions(); UpdatePlayerVars(); + HandleToggles(); } static void SaveVariablesToSCR() { @@ -6917,6 +6925,8 @@ namespace Menu { ImGui::CheckboxHotkey("Nightrunner Mode", &nightrunnerMode, "Makes Aiden super-human/infected"); ImGui::SameLine(); ImGui::CheckboxHotkey("One-handed Mode", &oneHandedMode, "Removes Aiden's left hand"); + ImGui::CheckboxHotkey("Disable Air Control", &disableAirControl, "Disables the ability to change the player's direction of momentum while in-air"); + ImGui::SameLine(); ImGui::CheckboxHotkey("Allow Grapple Hook in Safezone", &allowGrappleHookInSafezone, "Allows player to use grapple hook while in a safezone"); ImGui::SeparatorText("Player Jump Parameters"); diff --git a/EGameTools/source/menu/player.h b/EGameTools/source/menu/player.h index 9b8403b..6b92b4a 100644 --- a/EGameTools/source/menu/player.h +++ b/EGameTools/source/menu/player.h @@ -16,6 +16,7 @@ namespace Menu { extern KeyBindOption disableOutOfBoundsTimer; extern KeyBindOption nightrunnerMode; extern KeyBindOption oneHandedMode; + extern KeyBindOption disableAirControl; extern KeyBindOption allowGrappleHookInSafezone; extern Option playerVariables; diff --git a/EGameTools/source/offsets.h b/EGameTools/source/offsets.h index c957bac..b263239 100644 --- a/EGameTools/source/offsets.h +++ b/EGameTools/source/offsets.h @@ -90,6 +90,8 @@ struct Offsets { AddOffset(CalculateFallHeight, "gamedll_ph_x64_rwdi.dll", "40 55 56 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 44 0F 29 9C 24", Utils::SigScan::PatternType::Address, LPVOID) AddOffset(PlayerHealthModuleKillPlayer, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 48 8B 01 48 8B D9 FF 90 ?? ?? ?? ?? 84 C0 74 ?? 48 8B 4B ?? 48 81 C1 ?? ?? ?? ?? 48 8B 01 FF 50", Utils::SigScan::PatternType::Address, LPVOID) AddOffset(CanUseGrappleHook, "gamedll_ph_x64_rwdi.dll", "48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 01 0F B6 FA 48 8B D9 FF 90 ?? ?? ?? ?? F6 80", Utils::SigScan::PatternType::Address, LPVOID) + AddOffset(ReadPlayerJumpParam, "gamedll_ph_x64_rwdi.dll", "48 8B 01 4C 8B C2 48 8B 48", Utils::SigScan::PatternType::Address, LPVOID) + AddOffset(GetBoolFromPlayerJumpParam, "gamedll_ph_x64_rwdi.dll", "40 53 48 83 EC ?? 48 83 79 ?? ?? 48 8B D9 74 ?? 48 8B 41 ?? 48 8B 48 ?? 48 8B 01 FF 50 ?? 85 C0", 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)