mirror of
https://github.com/swordbluesword/PalWorld-NetCrack.git
synced 2025-04-29 02:47:17 +09:00
Features and Adjustments
SDK - Changed TArray function name "Num" to "Count" for clarity CONFIG - included additional helper functions FEATURE - General cleanup - Include features as functions NOTES: - new feature functions have not been implemented ~squish-- Update feature.h - forgot to include function declarations
This commit is contained in:
parent
9c9f1373c9
commit
a5ef6cfc96
@ -97,7 +97,7 @@ public:
|
||||
return Data[Index];
|
||||
}
|
||||
|
||||
inline int32 Num()
|
||||
inline int32 Count()
|
||||
{
|
||||
return NumElements;
|
||||
}
|
||||
|
63
config.cpp
63
config.cpp
@ -40,10 +40,25 @@ SDK::UWorld* config::GetUWorld()
|
||||
{
|
||||
auto gworld = signature("48 8B 05 ? ? ? ? EB 05").instruction(3).add(7);
|
||||
gworld_ptr = gworld.GetPointer();
|
||||
if (gworld_ptr)
|
||||
gWorld = *(SDK::UWorld**)gworld_ptr;
|
||||
}
|
||||
return (*(SDK::UWorld**)(gworld_ptr));
|
||||
}
|
||||
|
||||
SDK::UPalCharacterImportanceManager* GetCharacterImpManager()
|
||||
{
|
||||
SDK::UWorld* pWorld = config::gWorld;
|
||||
if (!pWorld)
|
||||
return;
|
||||
|
||||
SDK::UGameInstance* pGameInstance = pWorld->OwningGameInstance;
|
||||
if (!pGameInstance)
|
||||
return nullptr;
|
||||
|
||||
return static_cast<SDK::UPalGameInstance*>(pGameInstance)->CharacterImportanceManager;
|
||||
}
|
||||
|
||||
SDK::APalPlayerCharacter* config::GetPalPlayerCharacter()
|
||||
{
|
||||
|
||||
@ -54,6 +69,54 @@ SDK::APalPlayerCharacter* config::GetPalPlayerCharacter()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SDK::APalPlayerState* config::GetPalPlayerState()
|
||||
{
|
||||
SDK::APalPlayerCharacter* pPlayer = GetPalPlayerCharacter();
|
||||
if (!pPlayer)
|
||||
return nullptr;
|
||||
|
||||
return static_cast<SDK::APalPlayerState*>(pPlayer->PlayerState);
|
||||
}
|
||||
|
||||
bool GetTAllPlayers(SDK::TArray<class SDK::APalCharacter*>* outResult)
|
||||
{
|
||||
SDK::UPalCharacterImportanceManager* mPal = GetCharacterImpManager();
|
||||
if (!mPal)
|
||||
return false;
|
||||
|
||||
mPal->GetAllPlayer(outResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetTAllImpNPC(SDK::TArray<class SDK::APalCharacter*>* outResult)
|
||||
{
|
||||
SDK::UPalCharacterImportanceManager* mPal = GetCharacterImpManager();
|
||||
if (!mPal)
|
||||
return false;
|
||||
|
||||
mPal->GetImportantNPC(outResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetTAllNPC(SDK::TArray<class SDK::APalCharacter*>* outResult)
|
||||
{
|
||||
SDK::UPalCharacterImportanceManager* mPal = GetCharacterImpManager();
|
||||
if (!mPal)
|
||||
return false;
|
||||
|
||||
mPal->GetAllNPC(outResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetTAllPals(SDK::TArray<class SDK::APalCharacter*>* outResult)
|
||||
{
|
||||
SDK::UPalCharacterImportanceManager* mPal = GetCharacterImpManager();
|
||||
if (!mPal)
|
||||
return false;
|
||||
|
||||
mPal->GetAllPalCharacter(outResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void config::Init()
|
||||
|
7
config.h
7
config.h
@ -39,6 +39,7 @@ public:
|
||||
char ItemName[255];
|
||||
char inputTextBuffer[255] = "";
|
||||
int EqModifiler = 1;
|
||||
static SDK::UWorld* gWorld;
|
||||
SDK::APalPlayerCharacter* localPlayer = NULL;
|
||||
SDK::TArray<SDK::APalPlayerCharacter*> AllPlayers = {};
|
||||
SDK::UPalCharacterImportanceManager* UCIM = NULL;
|
||||
@ -58,8 +59,14 @@ public:
|
||||
|
||||
//static function
|
||||
static SDK::UWorld* GetUWorld();
|
||||
static SDK::UPalCharacterImportanceManager* GetCharacterImpManager();
|
||||
static SDK::APalPlayerCharacter* GetPalPlayerCharacter();
|
||||
static SDK::APalPlayerState* GetPalPlayerState();
|
||||
static SDK::TArray<SDK::APalPlayerCharacter*> GetTAllPlayers();
|
||||
static bool GetTAllPlayers(SDK::TArray<class SDK::APalCharacter*>* outResult);
|
||||
static bool GetTAllImpNPC(SDK::TArray<class SDK::APalCharacter*>* outResult);
|
||||
static bool GetTAllNPC(SDK::TArray<class SDK::APalCharacter*>* outResult);
|
||||
static bool GetTAllPals(SDK::TArray<class SDK::APalCharacter*>* outResult);
|
||||
static void Init();
|
||||
static void Update(const char* filterText);
|
||||
static const std::vector<std::string>& GetFilteredItems();
|
||||
|
150
feature.cpp
150
feature.cpp
@ -1,37 +1,39 @@
|
||||
#include "pch.h"
|
||||
#include "feature.h"
|
||||
using namespace SDK;
|
||||
|
||||
void ESP()
|
||||
{
|
||||
if (Config.GetPalPlayerCharacter() != NULL)
|
||||
{
|
||||
if (Config.GetPalPlayerCharacter()->ShooterComponent != NULL)
|
||||
{
|
||||
if(Config.GetPalPlayerCharacter()->ShooterComponent->GetHasWeapon() != NULL)
|
||||
{
|
||||
DrawUActorComponent(Config.GetPalPlayerCharacter()->ShooterComponent->GetHasWeapon()->InstanceComponents, ImColor(128, 0, 0));
|
||||
}
|
||||
}
|
||||
if (Config.UCIM != NULL)
|
||||
{
|
||||
SDK::TArray<SDK::APalCharacter*> T = {};
|
||||
Config.UCIM->GetAllPalCharacter(&T);
|
||||
if (T.IsValid())
|
||||
{
|
||||
for (int i = 0; i < T.Num(); i++)
|
||||
{
|
||||
ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), ImColor(128,0,0), T[i]->GetFullName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter();
|
||||
if (!pPalCharacter)
|
||||
return;
|
||||
|
||||
UPalShooterComponent* pShootComponent = pPalCharacter->ShooterComponent;
|
||||
if (!pShootComponent)
|
||||
return;
|
||||
|
||||
APalWeaponBase* pWeapon = pShootComponent->HasWeapon;
|
||||
if (pWeapon)
|
||||
DrawUActorComponent(pWeapon->InstanceComponents, ImColor(128, 0, 0));
|
||||
|
||||
if (!Config.UCIM)
|
||||
return;
|
||||
|
||||
TArray<SDK::APalCharacter*> T = {};
|
||||
Config.UCIM->GetAllPalCharacter(&T);
|
||||
if (!T.IsValid())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < T.Count(); i++)
|
||||
ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(10, 10 + (i * 30)), ImColor(128,0,0), T[i]->GetFullName().c_str());
|
||||
}
|
||||
|
||||
void DrawUActorComponent(SDK::TArray<SDK::UActorComponent*> Comps,ImColor color)
|
||||
{
|
||||
ImGui::GetBackgroundDrawList()->AddText(nullptr, 16, ImVec2(ImGui::GetIO().DisplaySize.x / 2, ImGui::GetIO().DisplaySize.y / 2), color, "Drawing...");
|
||||
if (Comps.IsValid())
|
||||
{
|
||||
for (int i = 0; i < Comps.Num(); i++)
|
||||
for (int i = 0; i < Comps.Count(); i++)
|
||||
{
|
||||
|
||||
if (Comps[i] != NULL)
|
||||
@ -43,3 +45,105 @@ void DrawUActorComponent(SDK::TArray<SDK::UActorComponent*> Comps,ImColor color)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ResetStamina()
|
||||
{
|
||||
APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter();
|
||||
if (!pPalCharacter)
|
||||
return;
|
||||
|
||||
UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent;
|
||||
if (!pParams)
|
||||
return;
|
||||
|
||||
pParams->ResetSP();
|
||||
}
|
||||
|
||||
void SetInfiniteAmmo(bool bInfAmmo)
|
||||
{
|
||||
APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter();
|
||||
if (!pPalCharacter)
|
||||
return;
|
||||
|
||||
UPalShooterComponent* pShootComponent = pPalCharacter->ShooterComponent;
|
||||
if (!pShootComponent)
|
||||
return;
|
||||
|
||||
APalWeaponBase* pWeapon = pShootComponent->HasWeapon;
|
||||
if (pWeapon)
|
||||
pWeapon->IsRequiredBullet = bInfAmmo ? false : true;
|
||||
|
||||
}
|
||||
|
||||
void SetCraftingSpeed(float mNewSpeed, bool bRestoreDefault = false)
|
||||
{
|
||||
APalPlayerCharacter* pPalCharacter = Config.GetPalPlayerCharacter();
|
||||
if (!pPalCharacter)
|
||||
return;
|
||||
|
||||
UPalCharacterParameterComponent* pParams = pPalCharacter->CharacterParameterComponent;
|
||||
if (!pParams)
|
||||
return;
|
||||
|
||||
UPalIndividualCharacterParameter* ivParams = pParams->IndividualParameter;
|
||||
if (!ivParams)
|
||||
return;
|
||||
|
||||
FPalIndividualCharacterSaveParameter sParams = ivParams->SaveParameter;
|
||||
TArray<FFloatContainer_FloatPair> mCraftSpeedArray = sParams.CraftSpeedRates.Values;
|
||||
|
||||
if (mCraftSpeedArray.Count() > 0)
|
||||
mCraftSpeedArray[0].Value = bRestoreDefault ? 1.0f : mNewSpeed;
|
||||
}
|
||||
|
||||
void AddTechPoints(__int32 mPoints)
|
||||
{
|
||||
APalPlayerState* mPlayerState = Config.GetPalPlayerState();
|
||||
if (!mPlayerState)
|
||||
return;
|
||||
|
||||
UPalTechnologyData* pTechData = mPlayerState->TechnologyData;
|
||||
if (!pTechData)
|
||||
return;
|
||||
|
||||
pTechData->TechnologyPoint += mPoints;
|
||||
}
|
||||
|
||||
void AddAncientTechPoints(__int32 mPoints)
|
||||
{
|
||||
APalPlayerState* mPlayerState = Config.GetPalPlayerState();
|
||||
if (!mPlayerState)
|
||||
return;
|
||||
|
||||
UPalTechnologyData* pTechData = mPlayerState->TechnologyData;
|
||||
if (!pTechData)
|
||||
return;
|
||||
|
||||
pTechData->bossTechnologyPoint += mPoints;
|
||||
}
|
||||
|
||||
void RemoveTechPoints(__int32 mPoints)
|
||||
{
|
||||
APalPlayerState* mPlayerState = Config.GetPalPlayerState();
|
||||
if (!mPlayerState)
|
||||
return;
|
||||
|
||||
UPalTechnologyData* pTechData = mPlayerState->TechnologyData;
|
||||
if (!pTechData)
|
||||
return;
|
||||
|
||||
pTechData->TechnologyPoint -= mPoints;
|
||||
}
|
||||
|
||||
void RemoveAncientTechPoint(__int32 mPoints)
|
||||
{
|
||||
APalPlayerState* mPlayerState = Config.GetPalPlayerState();
|
||||
if (!mPlayerState)
|
||||
return;
|
||||
|
||||
UPalTechnologyData* pTechData = mPlayerState->TechnologyData;
|
||||
if (!pTechData)
|
||||
return;
|
||||
|
||||
pTechData->bossTechnologyPoint -= mPoints;
|
||||
}
|
14
feature.h
14
feature.h
@ -9,3 +9,17 @@ void DrawUActorComponent(SDK::TArray<SDK::UActorComponent*> Comps,ImColor color)
|
||||
|
||||
void DrawPosition();
|
||||
|
||||
|
||||
void ResetStamina();
|
||||
|
||||
void SetInfiniteAmmo(bool bInfAmmo);
|
||||
|
||||
void SetCraftingSpeed(float mNewSpeed, bool bRestoreDefault = false);
|
||||
|
||||
void AddTechPoints(__int32 mPoints);
|
||||
|
||||
void AddAncientTechPoints(__int32 mPoints);
|
||||
|
||||
void RemoveTechPoints(__int32 mPoints);
|
||||
|
||||
void RemoveAncientTechPoint(__int32 mPoints);
|
@ -10,7 +10,7 @@ void DetourEqui(SDK::UPalNetworkIndividualComponent* p_this, SDK::FPalInstanceID
|
||||
{
|
||||
if(AddStatusPointArray->IsValid())
|
||||
{
|
||||
for (int i = 0; i < AddStatusPointArray->Num(); i++)
|
||||
for (int i = 0; i < AddStatusPointArray->Count(); i++)
|
||||
{
|
||||
(*AddStatusPointArray)[i].StatusPoint = -1 * Config.EqModifiler;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user