From 3dbb83a96f62ad35e6c02fe913fd034fe471414a Mon Sep 17 00:00:00 2001 From: Marvelco Date: Thu, 7 Aug 2025 18:27:56 +0300 Subject: [PATCH 1/4] init bosses --- .../FortServerBotManagerAthena.cpp | 16 ++++++++++++++-- Project Reboot 3.0/FortServerBotManagerAthena.h | 4 ++-- Project Reboot 3.0/ai.h | 7 ++++--- Project Reboot 3.0/dllmain.cpp | 7 +++++-- Project Reboot 3.0/finder.h | 15 +++++++++++++++ 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/Project Reboot 3.0/FortServerBotManagerAthena.cpp b/Project Reboot 3.0/FortServerBotManagerAthena.cpp index a6be9fe..d284797 100644 --- a/Project Reboot 3.0/FortServerBotManagerAthena.cpp +++ b/Project Reboot 3.0/FortServerBotManagerAthena.cpp @@ -1,10 +1,22 @@ #include "FortServerBotManagerAthena.h" #include "bots.h" +#include "ai.h" +#include "finder.h" AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation, - UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData* InRuntimeBotData) + UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData) { LOG_INFO(LogBots, "SpawnBotHook!"); - return nullptr; + if (__int64(_ReturnAddress()) == SpawnBotRet()) { + return SpawnBotOriginal(BotManager, InSpawnLocation, InSpawnRotation, InBotData, InRuntimeBotData); + } + + AActor* SpawnLocator = GetWorld()->SpawnActor(APawn::StaticClass(), InSpawnLocation, InSpawnRotation.Quaternion()); + auto PawnClass = InBotData->Get(InBotData->GetOffset("PawnClass")); + auto Pawn = BotMutator->SpawnBot(PawnClass , SpawnLocator, InSpawnLocation, InSpawnRotation, true); + + Pawn->TeleportTo(InSpawnLocation, InSpawnRotation);//idfk???? + + return Pawn; } \ No newline at end of file diff --git a/Project Reboot 3.0/FortServerBotManagerAthena.h b/Project Reboot 3.0/FortServerBotManagerAthena.h index 121595f..42f4887 100644 --- a/Project Reboot 3.0/FortServerBotManagerAthena.h +++ b/Project Reboot 3.0/FortServerBotManagerAthena.h @@ -15,7 +15,7 @@ static inline void (*BotManagerSetupStuffIdk)(__int64 BotManaager, __int64 Pawn, class UFortServerBotManagerAthena : public UObject { public: - static inline AFortPlayerPawnAthena* (*SpawnBotOriginal)(UFortServerBotManagerAthena* BotManager, FVector InSpawnLocation, FRotator InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData InRuntimeBotData); + static inline AFortPlayerPawnAthena* (*SpawnBotOriginal)(UFortServerBotManagerAthena* BotManager, FVector InSpawnLocation, FRotator InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData); AFortAthenaMutator_Bots*& GetCachedBotMutator() { @@ -23,5 +23,5 @@ public: return Get(CachedBotMutatorOffset); } - static AFortPlayerPawnAthena* SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData* InRuntimeBotData); + static AFortPlayerPawnAthena* SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData); }; \ No newline at end of file diff --git a/Project Reboot 3.0/ai.h b/Project Reboot 3.0/ai.h index 5892a94..51c340f 100644 --- a/Project Reboot 3.0/ai.h +++ b/Project Reboot 3.0/ai.h @@ -21,6 +21,7 @@ using UNavigationSystemConfig = UObject; using AAthenaNavSystemConfigOverride = UObject; using UAthenaNavSystem = UObject; using UAthenaNavSystemConfig = UObject; +inline AFortAthenaMutator_Bots* BotMutator = nullptr; enum class EFNavigationSystemRunMode : uint8_t { @@ -111,14 +112,14 @@ static inline AFortAthenaMutator_Bots* SpawnBotMutator() //sets up all the class auto GameMode = Cast(GetWorld()->GetGameMode()); static auto BGAClass = FindObject(L"/Script/Engine.BlueprintGeneratedClass"); - auto PhoebeMutatorClass = LoadObject(L"/Game/Athena/AI/Phoebe/BP_Phoebe_Mutator.BP_Phoebe_Mutator_C", BGAClass); + //auto PhoebeMutatorClass = LoadObject(L"/Game/Athena/AI/Phoebe/BP_Phoebe_Mutator.BP_Phoebe_Mutator_C", BGAClass); - if (!PhoebeMutatorClass) + if (!AFortAthenaMutator_Bots::StaticClass()) { return nullptr; } - auto BotMutator = GetWorld()->SpawnActor(PhoebeMutatorClass); + BotMutator = GetWorld()->SpawnActor(AFortAthenaMutator_Bots::StaticClass()); if (!BotMutator) { diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index bbf62d2..aab1c25 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -1308,8 +1308,11 @@ DWORD WINAPI Main(LPVOID) (PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true); } - // Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortServerBotManagerAthena"), FindObject(L"/Script/FortniteGame.FortServerBotManagerAthena.SpawnBot"), - // UFortServerBotManagerAthena::SpawnBotHook, (PVOID*)&UFortServerBotManagerAthena::SpawnBotOriginal, false); + if (Fortnite_Version >= 12 && Fortnite_Version <= 13) // you cant spawn bosses using spawnbot on s14 and above + { + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortServerBotManagerAthena"), FindObject(L"/Script/FortniteGame.FortServerBotManagerAthena.SpawnBot"), + UFortServerBotManagerAthena::SpawnBotHook, (PVOID*)&UFortServerBotManagerAthena::SpawnBotOriginal, false); + } Hooking::MinHook::Hook(GameModeDefault, FindObject(L"/Script/Engine.GameModeBase.SpawnDefaultPawnFor"), AGameModeBase::SpawnDefaultPawnForHook, nullptr, false); diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 6a55b7e..0a90299 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -2053,3 +2053,18 @@ static inline uint64 FindClearAbility() return 0; } + +static inline uint64 SpawnBotRet() +{ + auto String = Memcury::Scanner::FindStringRef(L"Unable to create UFortAthenaAIBotCustomizationData object. BotClass = %s", true, 0, false).Get(); + + for (int i = 0; i < 1000; i++) + { + if (*(uint8_t*)(String + i) == 0x48 && *(uint8_t*)(String + i + 1) == 0x8b && *(uint8_t*)(String + i + 2) == 0xd8) + { + return String + i; + } + } + + return 0; +} From 91cb107aed5053aec505a39da089b4cb27a307ba Mon Sep 17 00:00:00 2001 From: Marvelco Date: Thu, 7 Aug 2025 20:52:51 +0300 Subject: [PATCH 2/4] added skins and names to bosses --- .../FortServerBotManagerAthena.cpp | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Project Reboot 3.0/FortServerBotManagerAthena.cpp b/Project Reboot 3.0/FortServerBotManagerAthena.cpp index d284797..4823f66 100644 --- a/Project Reboot 3.0/FortServerBotManagerAthena.cpp +++ b/Project Reboot 3.0/FortServerBotManagerAthena.cpp @@ -15,8 +15,46 @@ AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotM AActor* SpawnLocator = GetWorld()->SpawnActor(APawn::StaticClass(), InSpawnLocation, InSpawnRotation.Quaternion()); auto PawnClass = InBotData->Get(InBotData->GetOffset("PawnClass")); auto Pawn = BotMutator->SpawnBot(PawnClass , SpawnLocator, InSpawnLocation, InSpawnRotation, true); - + auto PC = Pawn->GetController(); + auto PlayerState = Pawn->GetPlayerState(); + auto BotNameSettings = InBotData->Get(InBotData->GetOffset("BotNameSettings")); Pawn->TeleportTo(InSpawnLocation, InSpawnRotation);//idfk???? + auto SkinOverRide = InBotData->GetCharacterCustomization()->GetCustomizationLoadout()->GetCharacter(); + + if (SkinOverRide->GetName() == "CID_556_Athena_Commando_F_RebirthDefaultA") + { + if (InBotData->GetFullName().contains("Alter")) + { + SkinOverRide = LoadObject("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_HenchmanBad.CID_NPC_Athena_Commando_M_HenchmanBad"); + } + else if (InBotData->GetFullName().contains("Ego")) + { + SkinOverRide = LoadObject("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_HenchmanGood.CID_NPC_Athena_Commando_M_HenchmanGood"); + } + else if (InBotData->GetFullName().contains("Box")) //s13 + { + SkinOverRide = LoadObject("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_Scrapyard.CID_NPC_Athena_Commando_M_Scrapyard"); + } + } + else + { + if (InBotData->GetFullName().contains("Yatch") && Fortnite_Version >= 12.30 && Fortnite_Version <= 12.61) + { + SkinOverRide = LoadObject("/Game/Athena/AI/MANG/BotData/BotData_MANG_POI_HDP.BotData_MANG_POI_HDP"); + } + else + { + SkinOverRide = InBotData->GetCharacterCustomization()->GetCustomizationLoadout()->GetCharacter(); + } + } + + auto HeroDefinition = SkinOverRide->Get(SkinOverRide->GetOffset("HeroDefinition")); + ApplyHID(Pawn, HeroDefinition, true); + + FString OverrideName = UKismetTextLibrary::Conv_TextToString(BotNameSettings->GetOverrideName()); + *reinterpret_cast(__int64(PlayerState) + PlayerState->GetOffset("PlayerNamePrivate")) = OverrideName; + PC->GetPlayerState()->OnRep_PlayerName(); + return Pawn; } \ No newline at end of file From a500f10a056fbd2ceb72a3a6de9b30003c366b6f Mon Sep 17 00:00:00 2001 From: Marvelco Date: Thu, 7 Aug 2025 23:01:57 +0300 Subject: [PATCH 3/4] minor bug fix --- Project Reboot 3.0/botnames.h | 1 + Project Reboot 3.0/gui.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Project Reboot 3.0/botnames.h b/Project Reboot 3.0/botnames.h index e55d7c8..18b5c43 100644 --- a/Project Reboot 3.0/botnames.h +++ b/Project Reboot 3.0/botnames.h @@ -69,6 +69,7 @@ static inline void InitBotNames() PlayerBotNames.push_back(L"AllyJax"); PlayerBotNames.push_back(L"secret_pommes"); PlayerBotNames.push_back(L"Twin1"); + PlayerBotNames.push_back(L"Marvelco"); std::shuffle(PlayerBotNames.begin(), PlayerBotNames.end(), std::default_random_engine((unsigned int)time(0))); } diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index ba934e4..79b115a 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -1564,7 +1564,9 @@ static inline DWORD WINAPI GuiThread(LPVOID) { WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, L"RebootClass", NULL }; ::RegisterClassEx(&wc); - HWND hwnd = ::CreateWindowExW(0L, wc.lpszClassName, (L"Project Reboot " + std::to_wstring(Fortnite_Version)).c_str(), (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX), 100, 100, Width, Height, NULL, NULL, wc.hInstance, NULL); + + HWND hwnd = ::CreateWindowExW(0L,wc.lpszClassName,(L"Project Reboot " + ([](double v) { std::wstringstream ss; ss << std::fixed << std::setprecision(2) << v; return ss.str(); })(Fortnite_Version)).c_str(),(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX), 100, 100, Width, Height, NULL, NULL, wc.hInstance, NULL); + if (hwnd == NULL) { From d071ea14abe05b910de4ea3f1c361417a19b1547 Mon Sep 17 00:00:00 2001 From: Marvelco Date: Thu, 7 Aug 2025 23:19:20 +0300 Subject: [PATCH 4/4] opps --- Project Reboot 3.0/dllmain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index aab1c25..cdf640c 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -1308,7 +1308,7 @@ DWORD WINAPI Main(LPVOID) (PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true); } - if (Fortnite_Version >= 12 && Fortnite_Version <= 13) // you cant spawn bosses using spawnbot on s14 and above + if (Fortnite_Version >= 12.00 && Fortnite_Version <= 13.40) // you cant spawn bosses using spawnbot on s14 and above { Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortServerBotManagerAthena"), FindObject(L"/Script/FortniteGame.FortServerBotManagerAthena.SpawnBot"), UFortServerBotManagerAthena::SpawnBotHook, (PVOID*)&UFortServerBotManagerAthena::SpawnBotOriginal, false);