From 54cc65378deb3a2512fcb4582b4b476b788c99bb Mon Sep 17 00:00:00 2001 From: NightFyre <80198020+xCENTx@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:09:33 -0500 Subject: [PATCH 1/4] New Features # FEATURES - Teleport Pals to crosshair - Waypoints ( add by name & rendering ) # HELPERS - Get Party Pals - Get class pointer by blueprint name - Forge Actors ( set position , height, angle ) # FIXES - Fixed modify attack - Fixed Uninject DLL crash --- DX11-Base.vcxproj.filters | 3 ++ config.cpp | 6 +++ config.h | 22 ++++++++ feature.cpp | 108 +++++++++++++++++++++++++++++++++++++- feature.h | 10 +++- initialize.hpp | 24 ++++++++- src/D3D11Window.cpp | 7 +-- src/Hooking.cpp | 4 +- src/Menu.cpp | 67 ++++++++++++++++++++++- 9 files changed, 240 insertions(+), 11 deletions(-) diff --git a/DX11-Base.vcxproj.filters b/DX11-Base.vcxproj.filters index ae247de..cf1847c 100644 --- a/DX11-Base.vcxproj.filters +++ b/DX11-Base.vcxproj.filters @@ -120,6 +120,9 @@ Header Files + + Header Files + diff --git a/config.cpp b/config.cpp index 5087091..1f09a9e 100644 --- a/config.cpp +++ b/config.cpp @@ -164,6 +164,12 @@ bool config::GetTAllPals(SDK::TArray* outResult) return true; } +bool GetPartyPals(std::vector outResult) +{ + return false; +} + +// credit: xCENTx bool config::GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels, bool bSkipLocalPlayer) { SDK::UWorld* pWorld = Config.gWorld; diff --git a/config.h b/config.h index e88a03c..21d1eff 100644 --- a/config.h +++ b/config.h @@ -15,6 +15,8 @@ public: //check bool IsESP = false; bool IsFullbright = false; + bool IsForgeMode = false; + bool IsTeleportAllToXhair = false; bool IsAimbot = false; bool IsSpeedHack = false; bool IsAttackModiler = false; @@ -35,6 +37,7 @@ public: float SpeedModiflers = 1.0f; //def and value float mDebugESPDistance = 5.0f; + float mDebugEntCapDistance = 10.0f; int DamageUp = 0; int DefuseUp = 0; int EXP = 0; @@ -61,6 +64,24 @@ public: }; //Filtered Items std::vector db_filteredItems; + + + + struct SWaypoint + { + std::string waypointName; + SDK::FVector waypointLocation; + SDK::FRotator waypointRotation; + + bool bIsShown = true; + float* mColor[4]; + + SWaypoint() {}; + SWaypoint(std::string wpName, SDK::FVector wpLocation, SDK::FRotator wpRotation) { waypointName = wpName; waypointLocation = wpLocation; waypointRotation = wpRotation; } + }; + std::vector db_waypoints; + std::vector> db_filteredEnts; + //static function static SDK::UWorld* GetUWorld(); @@ -75,6 +96,7 @@ public: static bool GetTAllImpNPC(SDK::TArray* outResult); static bool GetTAllNPC(SDK::TArray* outResult); static bool GetTAllPals(SDK::TArray* outResult); + static bool GetPartyPals(std::vector outResult); static bool GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels = false, bool bSkipLocalPlayer = false); static void Init(); static void Update(const char* filterText); diff --git a/feature.cpp b/feature.cpp index 887137a..82459c3 100644 --- a/feature.cpp +++ b/feature.cpp @@ -29,6 +29,7 @@ void ESP() ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), ImColor(128,0,0), T[i]->GetFullName().c_str()); } +// credit: xCENTx // draws debug information for the input actor array // should only be called from a GUI thread with ImGui context void ESP_DEBUG(float mDist, ImVec4 color, UClass* mEntType) @@ -235,7 +236,7 @@ void ExploitFly(bool IsFly) IsFly ? pPalPlayerController->StartFlyToServer() : pPalPlayerController->EndFlyToServer(); } -// credit: nknights23 +// credit: xCENTx void SetFullbright(bool bIsSet) { ULocalPlayer* pLocalPlayer = Config.GetLocalPlayer(); @@ -335,6 +336,24 @@ void ResetStamina() return; pParams->ResetSP(); + + + // Reset Pal Stamina ?? + TArray outPals; + Config.GetTAllPals(&outPals); + DWORD palsSize = outPals.Count(); + for (int i = 0; i < palsSize; i++) + { + APalCharacter* cPal = outPals[i]; + if (!cPal || cPal->IsA(APalMonsterCharacter::StaticClass())) + continue; + + UPalCharacterParameterComponent* pPalParams = pPalCharacter->CharacterParameterComponent; + if (!pPalParams) + return; + + pPalParams->ResetSP(); + } } // @@ -472,6 +491,7 @@ void RemoveAncientTechPoint(__int32 mPoints) pTechData->bossTechnologyPoint -= mPoints; } +// credit: xCENTx float GetDistanceToActor(AActor* pLocal, AActor* pTarget) { if (!pLocal || !pTarget) @@ -484,6 +504,92 @@ float GetDistanceToActor(AActor* pLocal, AActor* pTarget) return distance / 100.0f; } +// credit xCENTx +void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight, float mAngle) +{ + APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + APlayerController* pPlayerController = Config.GetPalPlayerController(); + if (!pTarget || !pPalPlayerCharacter || !pPlayerController) + return; + + APlayerCameraManager* pCamera = pPlayerController->PlayerCameraManager; + if (!pCamera) + return; + + FVector playerLocation = pPalPlayerCharacter->K2_GetActorLocation(); + FVector camFwdDir = pCamera->GetActorForwardVector() * ( mDistance * 100.f ); + FVector targetLocation = playerLocation + camFwdDir; + + if (mHeight != 0.0f) + targetLocation.Y += mHeight; + + FRotator targetRotation = pTarget->K2_GetActorRotation(); + if (mAngle != 0.0f) + targetRotation.Roll += mAngle; + + pTarget->K2_SetActorLocation(targetLocation, false, nullptr, true); + pTarget->K2_SetActorRotation(targetRotation, true); +} + +// credit: xCENTx +void TeleportAllPalsToCrosshair(float mDistance) +{ + TArray outPals; + Config.GetTAllPals(&outPals); + DWORD palsCount = outPals.Count(); + for (int i = 0; i < palsCount; i++) + { + APalCharacter* cPal = outPals[i]; + + if (!cPal || !cPal->IsA(APalMonsterCharacter::StaticClass())) + continue; + + // @TODO: displace with entity width for true distance, right now it is distance from origin + // FVector palOrigin; + // FVector palBounds; + // cPal->GetActorBounds(true, &palOrigin, &palBounds, false); + // float adj = palBounds.X * .5 + mDistance; + + ForgeActor(cPal, mDistance); + } +} + +// credit: xCENTx +void AddWaypointLocation(std::string wpName) +{ + APalCharacter* pPalCharacater = Config.GetPalPlayerCharacter(); + if (!pPalCharacater) + return; + + FVector wpLocation = pPalCharacater->K2_GetActorLocation(); + FRotator wpRotation = pPalCharacater->K2_GetActorRotation(); + config::SWaypoint newWaypoint = config::SWaypoint("[WAYPOINT]" + wpName, wpLocation, wpRotation); + Config.db_waypoints.push_back(newWaypoint); +} + +// credit: xCENTx +// must be called from a rendering thread with imgui context +void RenderWaypointsToScreen() +{ + APalCharacter* pPalCharacater = Config.GetPalPlayerCharacter(); + APalPlayerController* pPalController = Config.GetPalPlayerController(); + if (!pPalCharacater || !pPalController) + return; + + ImDrawList* draw = ImGui::GetWindowDrawList(); + + for (auto waypoint : Config.db_waypoints) + { + FVector2D vScreen; + if (!pPalController->ProjectWorldLocationToScreen(waypoint.waypointLocation, &vScreen, false)) + continue; + + auto color = ImColor(1.0f, 1.0f, 1.0f, 1.0f); + + draw->AddText(ImVec2( vScreen.X, vScreen.Y ), color, waypoint.waypointName.c_str()); + } +} + /// OLDER METHODS //SDK::FPalDebugOtomoPalInfo palinfo = SDK::FPalDebugOtomoPalInfo(); //SDK::TArray EA = { 0U }; diff --git a/feature.h b/feature.h index 279323a..fefa0cb 100644 --- a/feature.h +++ b/feature.h @@ -51,4 +51,12 @@ void RemoveTechPoints(__int32 mPoints); void RemoveAncientTechPoint(__int32 mPoints); -float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget); \ No newline at end of file +float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget); + +void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight = 0.0f, float mAngle = 0.0f); + +void TeleportAllPalsToCrosshair(float mDistance); + +void AddWaypointLocation(std::string wpName); + +void RenderWaypointsToScreen(); \ No newline at end of file diff --git a/initialize.hpp b/initialize.hpp index daf1379..cb9598d 100644 --- a/initialize.hpp +++ b/initialize.hpp @@ -7,6 +7,18 @@ #include "include/Hooking.hpp" using namespace DX11_Base; +// please dont remove , this is useful for a variety of things +void ClientBGThread() +{ + while (g_Running) + { + // test cache runners + + std::this_thread::sleep_for(1ms); + std::this_thread::yield(); + } +} + DWORD WINAPI MainThread_Initialize() { g_Console = std::make_unique(); @@ -29,7 +41,9 @@ DWORD WINAPI MainThread_Initialize() #endif /// RENDER LOOP - g_Running = TRUE; + g_Running = TRUE; + + std::thread WCMUpdate(ClientBGThread); // Initialize Loops Thread while (g_Running) { if (GetAsyncKeyState(VK_INSERT) & 1) @@ -38,9 +52,17 @@ DWORD WINAPI MainThread_Initialize() g_GameVariables->m_ShowHud = !g_GameVariables->m_ShowMenu; } + + + if (g_KillSwitch) + { + g_KillSwitch = false; + g_Hooking->Unhook(); + } } /// EXIT + WCMUpdate.join(); // Exit Loops Thread FreeLibraryAndExitThread(g_hModule, EXIT_SUCCESS); return EXIT_SUCCESS; } \ No newline at end of file diff --git a/src/D3D11Window.cpp b/src/D3D11Window.cpp index 4427d5a..8fa296d 100644 --- a/src/D3D11Window.cpp +++ b/src/D3D11Window.cpp @@ -41,6 +41,7 @@ bool HookCursor() namespace DX11_Base { static uint64_t* MethodsTable = NULL; + // @TODO: boolean for active window LRESULT D3D11Window::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (g_GameVariables->m_ShowMenu) { @@ -224,12 +225,6 @@ namespace DX11_Base { /// HRESULT APIENTRY D3D11Window::HookPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags) { - if (g_KillSwitch) { - g_Hooking->Unhook(); - g_D3D11Window->oIDXGISwapChainPresent(pSwapChain, SyncInterval, Flags); - g_Running = FALSE; - return 0; - } g_D3D11Window->Overlay(pSwapChain); return g_D3D11Window->oIDXGISwapChainPresent(pSwapChain, SyncInterval, Flags); } diff --git a/src/Hooking.cpp b/src/Hooking.cpp index 37b084d..992a945 100644 --- a/src/Hooking.cpp +++ b/src/Hooking.cpp @@ -31,8 +31,10 @@ namespace DX11_Base { void Hooking::Unhook() { g_D3D11Window->Unhook(); - MH_RemoveHook(MH_ALL_HOOKS); + MH_DisableHook((Tick)(Config.ClientBase + Config.offset_Tick)); + MH_RemoveHook((Tick)(Config.ClientBase + Config.offset_Tick)); g_Console->DestroyConsole(); + g_Running = FALSE; return; } } diff --git a/src/Menu.cpp b/src/Menu.cpp index 4eb9bc8..8b31213 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -42,6 +42,8 @@ namespace DX11_Base { // helper variables char inputBuffer_getFnAddr[100]; + char inputBuffer_getClass[100]; + char inputBuffer_setWaypoint[32]; namespace Styles { @@ -380,6 +382,13 @@ namespace DX11_Base ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SliderFloat("##DISTANCE", &Config.mDebugESPDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp); } + ImGui::Checkbox("TELEPORT PALS TO XHAIR", &Config.IsTeleportAllToXhair); + if (Config.IsTeleportAllToXhair) + { + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + ImGui::SliderFloat("##ENT_CAP_DISTANCE", &Config.mDebugEntCapDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp); + } // @TODO: print additional debug information if (ImGui::Button("PrintPlayerAddr", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) @@ -390,6 +399,7 @@ namespace DX11_Base } + // Get Function Pointer Offset ImGui::InputTextWithHint("##INPUT", "INPUT GOBJECT fn NAME", inputBuffer_getFnAddr, 100); ImGui::SameLine(); if (ImGui::Button("GET fn", ImVec2(ImGui::GetContentRegionAvail().x, 20))) @@ -408,6 +418,55 @@ namespace DX11_Base memset(inputBuffer_getFnAddr, 0, 100); } + + // Get Class pointer by name + ImGui::InputTextWithHint("##INPUT_GETCLASS", "INPUT OBJECT CLASS NAME", inputBuffer_getClass, 100); + ImGui::SameLine(); + if (ImGui::Button("GET CLASS", ImVec2(ImGui::GetContentRegionAvail().x, 20))) + { + std::string input = inputBuffer_getClass; + SDK::UClass* czClass = SDK::UObject::FindObject(input.c_str()); + if (czClass) + { + static __int64 dwHandle = reinterpret_cast<__int64>(GetModuleHandle(0)); + g_Console->printdbg("[+] Found [%s] -> 0x%llX\n", Console::Colors::yellow, input.c_str(), czClass->Class); + } + else + g_Console->printdbg("[!] CLASS [%s] NOT FOUND!\n", Console::Colors::red, input.c_str()); + + } + + // Waypoints + ImGui::InputTextWithHint("##INPUT_SETWAYPOINT", "CUSTOM WAYPOINT NAME", inputBuffer_setWaypoint, 32); + ImGui::SameLine(); + if (ImGui::Button("SET", ImVec2(ImGui::GetContentRegionAvail().x, 20))) + { + std::string wpName = inputBuffer_setWaypoint; + if (wpName.size() > 0) + { + AddWaypointLocation(wpName); + memset(inputBuffer_setWaypoint, 0, 32); + } + } + if (Config.db_waypoints.size() > 0) + { + if (ImGui::BeginChild("##CHILD_WAYPOINTS", { 0.0f, 100.f })) + { + DWORD index = -1; + for (auto waypoint : Config.db_waypoints) + { + index++; + ImGui::PushID(index); + // ImGui::Checkbox("SHOW", &waypoint.bIsShown); + // ImGui::SameLine(); + if (ImGui::Button(waypoint.waypointName.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 20))) + AnyWhereTP(waypoint.waypointLocation, false); + ImGui::PopID(); + } + + ImGui::EndChild(); + } + } } } @@ -662,6 +721,9 @@ namespace DX11_Base if (Config.isDebugESP) ESP_DEBUG(Config.mDebugESPDistance); + if (Config.db_waypoints.size() > 0) + RenderWaypointsToScreen(); + ImGui::End(); } @@ -681,7 +743,7 @@ namespace DX11_Base // if (Config.IsAttackModiler) - SetPlayerDefenseParam(Config.DamageUp); + SetPlayerAttackParam(Config.DamageUp); // if (Config.IsDefuseModiler) @@ -691,6 +753,9 @@ namespace DX11_Base if (Config.IsInfStamina) ResetStamina(); + if (Config.IsTeleportAllToXhair) + TeleportAllPalsToCrosshair(Config.mDebugEntCapDistance); + // // SetDemiGodMode(Config.IsMuteki); } From b22c6026349bcfd61c87ad8c488e12e6a0980586 Mon Sep 17 00:00:00 2001 From: NightFyre <80198020+xCENTx@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:34:17 -0500 Subject: [PATCH 2/4] move feature --- feature.cpp | 21 +++++++++++++++++++++ feature.h | 2 ++ src/Menu.cpp | 16 +--------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/feature.cpp b/feature.cpp index 82459c3..33cf89c 100644 --- a/feature.cpp +++ b/feature.cpp @@ -531,6 +531,27 @@ void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight, float mAng pTarget->K2_SetActorRotation(targetRotation, true); } +// credit: +void SendDamageToActor(APalCharacter* character, int32 damage, bool bSpoofAttacker) +{ + APalPlayerState* pPalPlayerState = Config.GetPalPlayerState(); + APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); + if (!pPalPlayerState || !pPalPlayerCharacter) + return; + + FPalDamageInfo info = FPalDamageInfo(); + info.AttackElementType = EPalElementType::Normal; + info.Attacker = pPalPlayerCharacter; // @TODO: spoof attacker + info.AttackerGroupID = Config.GetPalPlayerState()->IndividualHandleId.PlayerUId; + info.AttackerLevel = 50; + info.AttackType = EPalAttackType::Weapon; + info.bApplyNativeDamageValue = true; + info.bAttackableToFriend = true; + info.IgnoreShield = true; + info.NativeDamageValue = damage; + pPalPlayerState->SendDamage_ToServer(character, info); +} + // credit: xCENTx void TeleportAllPalsToCrosshair(float mDistance) { diff --git a/feature.h b/feature.h index fefa0cb..6902d90 100644 --- a/feature.h +++ b/feature.h @@ -55,6 +55,8 @@ float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget); void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight = 0.0f, float mAngle = 0.0f); +void SendDamageToActor(SDK::APalCharacter* character, int32 damage, bool bSpoofAttacker = false); + void TeleportAllPalsToCrosshair(float mDistance); void AddWaypointLocation(std::string wpName); diff --git a/src/Menu.cpp b/src/Menu.cpp index 8b31213..3214850 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -15,20 +15,6 @@ std::string rand_str(const int len) } return str; } -void Damage(SDK::APalCharacter* character, int32 damage) -{ - SDK::FPalDamageInfo info = SDK::FPalDamageInfo(); - info.AttackElementType = SDK::EPalElementType::Normal; - info.Attacker = Config.GetPalPlayerCharacter(); - info.AttackerGroupID = Config.GetPalPlayerState()->IndividualHandleId.PlayerUId; - info.AttackerLevel = 50; - info.AttackType = SDK::EPalAttackType::Weapon; - info.bApplyNativeDamageValue = true; - info.bAttackableToFriend = true; - info.IgnoreShield = true; - info.NativeDamageValue = damage; - Config.GetPalPlayerState()->SendDamage_ToServer(character, info); -} int InputTextCallback(ImGuiInputTextCallbackData* data) { char inputChar = data->EventChar; @@ -547,7 +533,7 @@ namespace DX11_Base if (ImGui::Button("Kill")) { if (T[i]->IsA(SDK::APalCharacter::StaticClass())) - Damage(Character, 99999999999); + SendDamageToActor(Character, 99999999999); } ImGui::SameLine(); if (ImGui::Button("TP")) From 84ee64515807bba2acb48d8276ba05a1260046bb Mon Sep 17 00:00:00 2001 From: NightFyre <80198020+xCENTx@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:23:52 -0500 Subject: [PATCH 3/4] death aura # FEATURES - Death Aura ( distance, dmg amount , scalar, vFx ) - Debug print engine globals - attempt restore default values for some toggles # PROJECT - include SDK solution to base project --- DX11-Base.sln | 12 +++++++++++- config.cpp | 9 ++++++++- config.h | 6 +++++- feature.cpp | 39 ++++++++++++++++++++++++++++++++++++-- feature.h | 4 +++- src/Menu.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++-------- 6 files changed, 108 insertions(+), 14 deletions(-) diff --git a/DX11-Base.sln b/DX11-Base.sln index 0c8f69b..5de8613 100644 --- a/DX11-Base.sln +++ b/DX11-Base.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.32802.440 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX11-Base", "DX11-Base.vcxproj", "{EB52DDF1-EFC4-4222-9D86-6918D4D891A5}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NetCrack-PalWorld", "DX11-Base.vcxproj", "{EB52DDF1-EFC4-4222-9D86-6918D4D891A5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PalworldSDK", "libs\SDKLibrary\PalworldSDK.vcxproj", "{202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +23,14 @@ Global {EB52DDF1-EFC4-4222-9D86-6918D4D891A5}.Release|x64.Build.0 = Release|x64 {EB52DDF1-EFC4-4222-9D86-6918D4D891A5}.Release|x86.ActiveCfg = Release|Win32 {EB52DDF1-EFC4-4222-9D86-6918D4D891A5}.Release|x86.Build.0 = Release|Win32 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Debug|x64.ActiveCfg = Debug|x64 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Debug|x64.Build.0 = Debug|x64 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Debug|x86.ActiveCfg = Debug|Win32 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Debug|x86.Build.0 = Debug|Win32 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Release|x64.ActiveCfg = Release|x64 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Release|x64.Build.0 = Release|x64 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Release|x86.ActiveCfg = Release|Win32 + {202F0C63-0183-4CE5-AAB4-4ABD2EA773D9}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/config.cpp b/config.cpp index 1f09a9e..3854bf0 100644 --- a/config.cpp +++ b/config.cpp @@ -164,7 +164,14 @@ bool config::GetTAllPals(SDK::TArray* outResult) return true; } -bool GetPartyPals(std::vector outResult) +// @TODO: +bool config::GetPartyPals(std::vector* outResult) +{ + return false; +} + +// @TODO: +bool config::GetPlayerDeathChests(std::vector* outLocations) { return false; } diff --git a/config.h b/config.h index 21d1eff..7af0f2d 100644 --- a/config.h +++ b/config.h @@ -17,6 +17,7 @@ public: bool IsFullbright = false; bool IsForgeMode = false; bool IsTeleportAllToXhair = false; + bool IsDeathAura = false; bool IsAimbot = false; bool IsSpeedHack = false; bool IsAttackModiler = false; @@ -38,6 +39,8 @@ public: //def and value float mDebugESPDistance = 5.0f; float mDebugEntCapDistance = 10.0f; + float mDeathAuraDistance = 10.f; + int mDeathAuraAmount = 1.f; int DamageUp = 0; int DefuseUp = 0; int EXP = 0; @@ -96,7 +99,8 @@ public: static bool GetTAllImpNPC(SDK::TArray* outResult); static bool GetTAllNPC(SDK::TArray* outResult); static bool GetTAllPals(SDK::TArray* outResult); - static bool GetPartyPals(std::vector outResult); + static bool GetPartyPals(std::vector* outResult); + static bool GetPlayerDeathChests(std::vector* outLocations); static bool GetAllActorsofType(SDK::UClass* mType, std::vector* outArray, bool bLoopAllLevels = false, bool bSkipLocalPlayer = false); static void Init(); static void Update(const char* filterText); diff --git a/feature.cpp b/feature.cpp index 33cf89c..5377f43 100644 --- a/feature.cpp +++ b/feature.cpp @@ -532,7 +532,7 @@ void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight, float mAng } // credit: -void SendDamageToActor(APalCharacter* character, int32 damage, bool bSpoofAttacker) +void SendDamageToActor(APalCharacter* pTarget, int32 damage, bool bSpoofAttacker) { APalPlayerState* pPalPlayerState = Config.GetPalPlayerState(); APalPlayerCharacter* pPalPlayerCharacter = Config.GetPalPlayerCharacter(); @@ -549,7 +549,42 @@ void SendDamageToActor(APalCharacter* character, int32 damage, bool bSpoofAttack info.bAttackableToFriend = true; info.IgnoreShield = true; info.NativeDamageValue = damage; - pPalPlayerState->SendDamage_ToServer(character, info); + pPalPlayerState->SendDamage_ToServer(pTarget, info); +} + +// NOTE: only targets pals +void DeathAura(__int32 dmgAmount, float mDistance, bool bIntensityEffect, bool bVisualAffect, EPalVisualEffectID visID) +{ + APalCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + + TArray outPals; + if (!Config.GetTAllPals(&outPals)) + return; + + DWORD palsCount = outPals.Count(); + for (auto i = 0; i < palsCount; i++) + { + APalCharacter* cEnt = outPals[i]; + + if (!cEnt || !cEnt->IsA(APalMonsterCharacter::StaticClass())) + continue; + + float distanceTo = GetDistanceToActor(pPalCharacter, cEnt); + if (distanceTo > mDistance) + continue; + + float dmgScalar = dmgAmount * (1.0f - distanceTo / mDistance); + if (bIntensityEffect) + dmgAmount = dmgScalar; + + UPalVisualEffectComponent* pVisComp = cEnt->VisualEffectComponent; + if (bVisualAffect && pVisComp) + { + FPalVisualEffectDynamicParameter fvedp; + pVisComp->AddVisualEffect_ToServer(visID, fvedp, 1); // uc: killer1478 + } + SendDamageToActor(cEnt, dmgAmount); + } } // credit: xCENTx diff --git a/feature.h b/feature.h index 6902d90..fdf8fa3 100644 --- a/feature.h +++ b/feature.h @@ -55,7 +55,9 @@ float GetDistanceToActor(SDK::AActor* pLocal, SDK::AActor* pTarget); void ForgeActor(SDK::AActor* pTarget, float mDistance, float mHeight = 0.0f, float mAngle = 0.0f); -void SendDamageToActor(SDK::APalCharacter* character, int32 damage, bool bSpoofAttacker = false); +void SendDamageToActor(SDK::APalCharacter* pTarget, int32 damage, bool bSpoofAttacker = false); + +void DeathAura(__int32 dmgAmount, float mDistance, bool bIntensityEffect = false, bool bVisualEffect = false, SDK::EPalVisualEffectID visID = SDK::EPalVisualEffectID::None); void TeleportAllPalsToCrosshair(float mDistance); diff --git a/src/Menu.cpp b/src/Menu.cpp index 3214850..350f2f0 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -361,27 +361,61 @@ namespace DX11_Base void TABDebug() { - ImGui::Checkbox("DEBUG ESP", &Config.isDebugESP); + if (ImGui::Checkbox("DEBUG ESP", &Config.isDebugESP) && !Config.isDebugESP) + Config.mDebugESPDistance = 10.f; if (Config.isDebugESP) { ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SliderFloat("##DISTANCE", &Config.mDebugESPDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp); } - ImGui::Checkbox("TELEPORT PALS TO XHAIR", &Config.IsTeleportAllToXhair); + + if (ImGui::Checkbox("TELEPORT PALS TO XHAIR", &Config.IsTeleportAllToXhair) && !Config.IsTeleportAllToXhair) + Config.mDebugEntCapDistance = 10.f; if (Config.IsTeleportAllToXhair) { ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); ImGui::SliderFloat("##ENT_CAP_DISTANCE", &Config.mDebugEntCapDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp); } - - // @TODO: print additional debug information - if (ImGui::Button("PrintPlayerAddr", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + + if (ImGui::Checkbox("DEATH AURA", &Config.IsDeathAura) && !Config.IsDeathAura) { - SDK::APalPlayerCharacter* p_appc = Config.GetPalPlayerCharacter(); - if (p_appc) - g_Console->printdbg("\n\n[+] APalPlayerCharacter: 0x%llX\n", Console::Colors::green, p_appc); + Config.mDeathAuraDistance = 10.0f; + Config.mDeathAuraAmount = 1; + } + if (Config.IsDeathAura) + { + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * .7); + ImGui::SliderFloat("##AURA_DISTANCE", &Config.mDeathAuraDistance, 1.0f, 100.f, "%.0f", ImGuiSliderFlags_AlwaysClamp); + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + ImGui::SliderInt("##AURA_DMG", &Config.mDeathAuraAmount, 1, 10, "%d", ImGuiSliderFlags_AlwaysClamp); + } + + if (ImGui::Button("PRINT ENGINE GLOBALS", ImVec2(ImGui::GetContentRegionAvail().x - 3, 20))) + { + + g_Console->printdbg("[+] [UNREAL ENGINE GLOBALS]\n" + "UWorld:\t\t\t0x%llX\n" + "ULocalPlayer:\t\t0x%llX\n" + "APalPlayerController:\t0x%llX\n" + "APalPlayerCharacter:\t0x%llX\n" + "APalPlayerState:\t0x%llX\n" + "UCharacterImpMan:\t0x%llX\n" + "UPalPlayerInventory:\t0x%llX\n" + "APalWeaponBase:\t\t0x%llX\n", + Console::Colors::yellow, + Config.gWorld, + Config.GetLocalPlayer(), + Config.GetPalPlayerController(), + Config.GetPalPlayerCharacter(), + Config.GetPalPlayerState(), + Config.GetCharacterImpManager(), + Config.GetInventoryComponent(), + Config.GetPlayerEquippedWeapon() + ); } @@ -742,6 +776,8 @@ namespace DX11_Base if (Config.IsTeleportAllToXhair) TeleportAllPalsToCrosshair(Config.mDebugEntCapDistance); + if (Config.IsDeathAura) + DeathAura(Config.mDeathAuraAmount, Config.mDeathAuraDistance); // // SetDemiGodMode(Config.IsMuteki); } From e2986241c8773adca38fa151ec30d493bfad9237 Mon Sep 17 00:00:00 2001 From: NightFyre <80198020+xCENTx@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:08:41 -0500 Subject: [PATCH 4/4] adjust death aura - prevent accidentally killing cast pal --- feature.cpp | 13 +++++++++++-- src/Menu.cpp | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/feature.cpp b/feature.cpp index 5377f43..571e3d7 100644 --- a/feature.cpp +++ b/feature.cpp @@ -556,6 +556,14 @@ void SendDamageToActor(APalCharacter* pTarget, int32 damage, bool bSpoofAttacker void DeathAura(__int32 dmgAmount, float mDistance, bool bIntensityEffect, bool bVisualAffect, EPalVisualEffectID visID) { APalCharacter* pPalCharacter = Config.GetPalPlayerCharacter(); + if (!pPalCharacter) + return; + + UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent; + if (!pParams) + return; + + APalCharacter* pPlayerPal = pParams->OtomoPal; TArray outPals; if (!Config.GetTAllPals(&outPals)) @@ -566,7 +574,7 @@ void DeathAura(__int32 dmgAmount, float mDistance, bool bIntensityEffect, bool b { APalCharacter* cEnt = outPals[i]; - if (!cEnt || !cEnt->IsA(APalMonsterCharacter::StaticClass())) + if (!cEnt || !cEnt->IsA(APalMonsterCharacter::StaticClass()) || cEnt == pPlayerPal) continue; float distanceTo = GetDistanceToActor(pPalCharacter, cEnt); @@ -581,7 +589,8 @@ void DeathAura(__int32 dmgAmount, float mDistance, bool bIntensityEffect, bool b if (bVisualAffect && pVisComp) { FPalVisualEffectDynamicParameter fvedp; - pVisComp->AddVisualEffect_ToServer(visID, fvedp, 1); // uc: killer1478 + if (!pVisComp->ExecutionVisualEffects.Count()) + pVisComp->AddVisualEffect_ToServer(visID, fvedp, 1); // uc: killer1478 } SendDamageToActor(cEnt, dmgAmount); } diff --git a/src/Menu.cpp b/src/Menu.cpp index 350f2f0..04575c4 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -777,7 +777,7 @@ namespace DX11_Base TeleportAllPalsToCrosshair(Config.mDebugEntCapDistance); if (Config.IsDeathAura) - DeathAura(Config.mDeathAuraAmount, Config.mDeathAuraDistance); + DeathAura(Config.mDeathAuraAmount, Config.mDeathAuraDistance, true); // // SetDemiGodMode(Config.IsMuteki); }