Skip to content

Commit

Permalink
feat: Instant Regen
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiga74164 committed Apr 8, 2024
1 parent ab15d90 commit 132825c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 30 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project is created and shared for educational purposes only. I do not condo
2. Press insert to show the menu

## Features
- Instant Regen (Running can trigger this)
- No Cooldown
- No Cooldown Shadow (Enable only if you have shadow feature available)
- God Mode
Expand All @@ -22,7 +23,7 @@ This project is created and shared for educational purposes only. I do not condo
- FPS Unlocker
- Fov Changer
- Skip Intro Movie (Loads the game faster)
- Disable WebView (Disables annoying web pop-up when entering the game)
- Disable Web View (Disables annoying web pop-up when entering the game)

## Screenshot
![menu](src/res/Solo_Leveling_ARISE_4BRSUmbeJd.png)
Expand Down
6 changes: 1 addition & 5 deletions src/game/Hotkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define IM_VK_KEYPAD_ENTER (VK_RETURN + 256)

// Slightly modified version of Callow's Hotkey class
// Slightly modified version. All credits to Callow
static ImGuiKey LegacyToInput(short key)
{
switch (key)
Expand Down Expand Up @@ -540,13 +540,9 @@ Hotkey Hotkey::FromString(const std::string& hotkeyString)
ImGuiKey imguiKey = StringToImGuiKey(trimmedKey);
if (imguiKey != ImGuiKey_None)
{
// Now convert ImGuiKey back to legacy VK_ code.
// This requires a reverse mapping function similar to `InputToLegacy`, which might need to be manually implemented.
short legacyKey = ImGuiKeyToLegacy(imguiKey);
if (legacyKey != -1)
{ // Assuming -1 indicates an unmappable key
hotkey.m_Keys.insert(legacyKey);
}
}
}
return hotkey;
Expand Down
2 changes: 1 addition & 1 deletion src/game/Hotkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "events/event.hpp"

// Slightly modified version of Callow's Hotkey class
// Slightly modified version. All credits to Callow
class Hotkey
{
public:
Expand Down
29 changes: 16 additions & 13 deletions src/game/Render/Gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ void Gui::Render()
//if (vars.PlayerSpeed.value())
// ImGui::SliderFloat("Speed", &vars.PlayerSpeedValue.value(), 1.0f, 20.0f, "%.1f");

ImGui::CheckboxFill("Instant Regen", &vars.InstantRegen.value()); HELPMAKER("Press Run");

ImGui::CheckboxFill("No Cooldown", &vars.NoCooldown.value());

ImGui::CheckboxFill("No Cooldown Shadow", &vars.NoCooldownShadow.value()); HELPMAKER("Enable only if you have shadow feature available");
Expand Down Expand Up @@ -102,27 +104,28 @@ void Gui::Render()

ImGui::CheckboxFill("Skip Intro Movie", &vars.SkipIntroMovie.value()); HELPMAKER("This will skip the intro movie when you start the game");

ImGui::CheckboxFill("Disable WebView", &vars.DisableWebView.value()); HELPMAKER("Disables WebView pop-up every time you enter the game");
ImGui::CheckboxFill("Disable Web View", &vars.DisableWebView.value()); HELPMAKER("Disables WebView pop-up every time you enter the game");

ImGui::EndGroup();
ImGui::PopStyleVar();
break;
case 2: // Hotkeys
//ImGui::InputHotkey("PlayerSpeed", vars.PlayerSpeed);
ImGui::InputHotkey("NoCooldown", vars.NoCooldown);
ImGui::InputHotkey("NoCooldownShadow", vars.NoCooldownShadow);
ImGui::InputHotkey("GodMode", vars.GodMode);
ImGui::InputHotkey("DamageHack", vars.DamageHack);
ImGui::InputHotkey("Instant Regen", vars.InstantRegen);
ImGui::InputHotkey("No Cooldown", vars.NoCooldown);
ImGui::InputHotkey("No Cooldown Shadow", vars.NoCooldownShadow);
ImGui::InputHotkey("God Mode", vars.GodMode);
ImGui::InputHotkey("Damage Hack", vars.DamageHack);
//ImGui::InputHotkey("DamagePercentage", vars.DamagePercentage);
//ImGui::InputHotkey("DamageFixed",& vars.DamageFixedHotkey, vars.DamageFixed);
ImGui::InputHotkey("MobVacuum", vars.MobVacuum);
ImGui::InputHotkey("DumbEnemies", vars.DumbEnemies);
ImGui::InputHotkey("MissionTime", vars.MissionTime);
ImGui::InputHotkey("TimeScale", vars.TimeScale);
ImGui::InputHotkey("FPSUnlock", vars.FPSUnlock);
ImGui::InputHotkey("FovChanger", vars.FovChanger);
ImGui::InputHotkey("SkipIntroMovie", vars.SkipIntroMovie);
ImGui::InputHotkey("DisableWebView", vars.DisableWebView);
ImGui::InputHotkey("Mob Vacuum", vars.MobVacuum);
ImGui::InputHotkey("Dumb Enemies", vars.DumbEnemies);
ImGui::InputHotkey("Mission Time", vars.MissionTime);
ImGui::InputHotkey("Time Scale", vars.TimeScale);
ImGui::InputHotkey("FPS Unlock", vars.FPSUnlock);
ImGui::InputHotkey("Fov Changer", vars.FovChanger);
ImGui::InputHotkey("Skip Intro Movie", vars.SkipIntroMovie);
ImGui::InputHotkey("Disable Web View", vars.DisableWebView);

break;
case 3: // About
Expand Down
2 changes: 1 addition & 1 deletion src/game/Render/Gui/utils/gui-util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const int WINDOW_HEIGHT = 900;
namespace ImGui
{
bool HotkeyWidget(const char* label, Hotkey& hotkey, const ImVec2& size);
// Slightly Modified version of Callow's InputHotkey function
// Slightly modified version function. All credits to Callow
template<typename T>
bool InputHotkey(const char* label, ConfigEntry<T>& configEntry, bool clearable = true)
{
Expand Down
21 changes: 12 additions & 9 deletions src/game/cheat/features/DamageHack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ namespace Cheat::Features

if (entity->fields.FHNGHHPLPGD == app::eCharGroup__Enum::PLAYER)
{
// God Mode
if (vars.GodMode.value())
// TODO: Change later
if (vars.InstantRegen.value())
{
if (specialState == app::ESpecialState__Enum::None ||
specialState == app::ESpecialState__Enum::DotDamage)
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, app::ESpecialState__Enum::Invincible, someInt1, 3500i64, 4000i64, buffName, method);
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, app::ESpecialState__Enum::HpRecovery, 2i64, 99999999i64, 0i64, buffName, method);
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, app::ESpecialState__Enum::MpRecovery, 2i64, 99999999i64, 0i64, buffName, method);
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, app::ESpecialState__Enum::PgRecovery, 2i64, 99999999i64, 0i64, buffName, method);
}

if (specialState == app::ESpecialState__Enum::HpRecovery ||
specialState == app::ESpecialState__Enum::MpRecovery ||
specialState == app::ESpecialState__Enum::PgRecovery)
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, specialState, 2i64, 99999999i64, 0i64, buffName, method);
if (specialState == app::ESpecialState__Enum::None ||
specialState == app::ESpecialState__Enum::DotDamage)
{
// God Mode
if (vars.GodMode.value())
CALL_ORIGIN(PIPHNBOBFEF_KBCIIEFLPGB_Hook, __this, app::ESpecialState__Enum::Invincible, someInt1, 3500i64, 4000i64, buffName, method);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/game/cheat/vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Vars final : public Singleton<Vars>
// Features
CONFIG_ENTRY_HOTKEY(bool, PlayerSpeed, true, Hotkey());
CONFIG_ENTRY(float, PlayerSpeedValue, 5.0f);
CONFIG_ENTRY_HOTKEY(bool, InstantRegen, false, Hotkey());
CONFIG_ENTRY_HOTKEY(bool, NoCooldown, true, Hotkey());
CONFIG_ENTRY_HOTKEY(bool, NoCooldownShadow, false, Hotkey());
CONFIG_ENTRY_HOTKEY(bool, GodMode, true, Hotkey());
Expand Down

0 comments on commit 132825c

Please sign in to comment.