From 228240101d2e81f2eb83dfeecbaded4455a65bb6 Mon Sep 17 00:00:00 2001 From: Gray <84999745+Milxnor@users.noreply.github.com> Date: Sun, 23 Mar 2025 18:21:42 -0400 Subject: [PATCH] Fix Skyfire (you have to destroytarget the doors) --- Project Reboot 3.0/Object.h | 18 ++++++++++++++++ Project Reboot 3.0/dllmain.cpp | 15 ++++++++++++-- Project Reboot 3.0/events.h | 38 +++++++++++++++++++++++----------- Project Reboot 3.0/finder.h | 2 +- Project Reboot 3.0/reboot.h | 7 +++++++ 5 files changed, 65 insertions(+), 15 deletions(-) diff --git a/Project Reboot 3.0/Object.h b/Project Reboot 3.0/Object.h index 744c62f..162f8cc 100644 --- a/Project Reboot 3.0/Object.h +++ b/Project Reboot 3.0/Object.h @@ -28,6 +28,8 @@ struct FGuid } }; +// #define PE_SAFETY + class UObject { public: @@ -42,12 +44,28 @@ public: /* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr) { +#ifdef PE_SAFETY + if (!Function) + { + LOG_INFO(LogDev, "TRIED CALLING INVALID PE FUNC! Ignoring."); + return; + } +#endif + // LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0))); ProcessEventOriginal(this, Function, Parms); } /* virtual */ void ProcessEvent(UFunction* Function, void* Parms = nullptr) const { +#ifdef PE_SAFETY + if (!Function) + { + LOG_INFO(LogDev, "TRIED CALLING INVALID PE FUNC! Ignoring."); + return; + } +#endif + // LOG_INFO(LogDev, "PE: 0x{:x}", __int64(ProcessEventOriginal) - __int64(GetModuleHandleW(0))); ProcessEventOriginal(this, Function, Parms); } diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 03f51e2..6d75286 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -669,6 +669,8 @@ void ChangeLevels() // auto bruh = std::wstring(CustomMapName.begin(), CustomMapName.end()); // auto bruhh = (L"open " + bruh); + bool bShouldUseMoleMap = PlaylistName == "/MoleGame/Playlists/Playlist_MoleGame.Playlist_MoleGame"; + FString LevelB = /* bUseCustomMap ? bruhh.c_str() : */ (Engine_Version < 424 ? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501 ? L"open Asteria_Terrain" @@ -685,7 +687,16 @@ void ChangeLevels() : Globals::bCreative ? L"Creative_NoApollo_Terrain" : L"Apollo_Terrain"); - LOG_INFO(LogDev, "Using {}.", bUseSwitchLevel ? Level.ToString() : LevelB.ToString()); + /* i think im dumb + if (bShouldUseMoleMap) + { + // FString MoleMap = L"/MoleGame/Maps/MoleGame_Layout.MoleGame_Layout"; + LevelB = L"open MoleGame_Layout"; + Level = L"MoleGame_Layout"; + } + */ + + LOG_INFO(LogDev, "Using \"{}\" as our map.", bUseSwitchLevel ? Level.ToString() : LevelB.ToString()); auto LocalPC = GetLocalPlayerController(); @@ -1062,7 +1073,7 @@ DWORD WINAPI Main(LPVOID) ChangeLevels(); - LOG_INFO(LogDev, "Switch levels."); + LOG_INFO(LogDev, "Switched levels."); if (Fortnite_Version < 20 && Fortnite_Version != 12) ApplyNullAndRetTrues(); diff --git a/Project Reboot 3.0/events.h b/Project Reboot 3.0/events.h index 5dea094..dd0344c 100644 --- a/Project Reboot 3.0/events.h +++ b/Project Reboot 3.0/events.h @@ -796,6 +796,8 @@ static inline void StartEvent() CallOnReadys(); + LOG_INFO(LogDev, "Called the on readys!"); + if (Fortnite_Version >= 17.30) { static auto OnRep_RootStartTimeFn = FindObject(L"/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor.OnRep_RootStartTime"); @@ -805,7 +807,8 @@ static inline void StartEvent() if (Fortnite_Version == 17.50) { - auto Scripting = FindObject(L"/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.BP_Kiwi_Master_Scripting_2"); + auto KiwiMasterScripting = FindObject(L"/Kiwi/Levels/Kiwi_P.Kiwi_P.PersistentLevel.BP_Kiwi_Master_Scripting_2"); + LOG_INFO(LogDev, "KiwiMasterScripting: {}", __int64(KiwiMasterScripting)); float SecondsSinceEventBegan = 0; @@ -821,22 +824,33 @@ static inline void StartEvent() { OnReadyParams.PlaylistContextTags = FGameplayTagContainer(); } - auto BB = FindObject(L"/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.OnReady_F1A32853487CB7603278E6847A5F2625"); - Scripting->ProcessEvent(BB, &OnReadyParams); - auto eventscript = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.Kiwi_EventScript_2"); - auto CC = FindObject("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.OnReady_F51BF8E143832CE6C552938B26BEFA93"); - auto DD = FindObject("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.LoadKiwiAssets"); + auto KiwiMasterScriptingOnReady = FindObject(L"/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.OnReady_F1A32853487CB7603278E6847A5F2625"); + LOG_INFO(LogDev, "KiwiMasterScriptingOnReady: {}", __int64(KiwiMasterScriptingOnReady)); + KiwiMasterScripting->ProcessEvent(KiwiMasterScriptingOnReady, &OnReadyParams); + + // auto eventscript = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.Kiwi_EventScript_2"); + auto KiwiOnReadyIdk = FindObject("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.OnReady_F51BF8E143832CE6C552938B26BEFA93"); + auto KiwiLoadAssets = FindObject("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.LoadKiwiAssets"); auto StartEventAtIndex = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventScript.StartEventAtIndex"); auto BP_OnScriptReady = FindObject("/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C.BP_OnScriptReady"); - // eventscript->ProcessEvent(CC, &bbparms); - eventscript->ProcessEvent(DD, &OnReadyParams); - eventscript->ProcessEvent(BP_OnScriptReady, &OnReadyParams); - eventscript->ProcessEvent(StartEventAtIndex, &SecondsSinceEventBegan); + LOG_INFO(LogDev, "KiwiLoadAssets: {}", __int64(KiwiLoadAssets)); + LOG_INFO(LogDev, "BP_OnScriptReady: {}", __int64(BP_OnScriptReady)); + LOG_INFO(LogDev, "StartEventAtIndex: {}", __int64(StartEventAtIndex)); - static auto StartEvent = FindObject("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent"); - Scripting->ProcessEvent(StartEvent, &SecondsSinceEventBegan); + // EventScripting->ProcessEvent(KiwiOnReadyIdk, &bbparms); + EventScripting->ProcessEvent(KiwiLoadAssets, &OnReadyParams); + LOG_INFO(LogDev, "CAlled KiwiLoadAssets!"); + EventScripting->ProcessEvent(BP_OnScriptReady, &OnReadyParams); + LOG_INFO(LogDev, "CAlled BP_OnScriptReady!"); + int InStartingIndex = 0; + // EventScripting->ProcessEvent(StartEventAtIndex, &InStartingIndex); + LOG_INFO(LogDev, "CAlled StartEventAtIndex!"); + + auto KiwiStartEvent = FindObject("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent"); + LOG_INFO(LogDev, "KiwiStartEvent: {}", __int64(KiwiStartEvent)); + KiwiMasterScripting->ProcessEvent(KiwiStartEvent, &SecondsSinceEventBegan); } if (AllSpecialEventScriptMeshActors.Num() > 0) diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 471059d..5bf0ead 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -868,7 +868,7 @@ static inline uint64 FindNoMCP() if (noMcpIthink.Get()) { - if (*noMcpIthink.GetAs() == 0xE8 || *noMcpIthink.GetAs() == 0xE9) // ex 7.20 + if (*noMcpIthink.GetAs() == 0xE8 || *noMcpIthink.GetAs() == 0xE9) // ex 7.20 (14.60 maybe too?) { LOG_INFO(LogDev, "Weird MCP thing!"); noMcpIthink.RelativeOffset(1); // we are in the weird thing that compiler does when the func is just in a jmp diff --git a/Project Reboot 3.0/reboot.h b/Project Reboot 3.0/reboot.h index b862778..6b3f154 100644 --- a/Project Reboot 3.0/reboot.h +++ b/Project Reboot 3.0/reboot.h @@ -24,6 +24,13 @@ template static inline T* FindObject(const TCHAR* Name, UClass* Class = nullptr, UObject* Outer = nullptr) { auto res = (T*)StaticFindObject/**/(Class, Outer, Name); + /* + if (!res) + { + std::wstring NameWStr = std::wstring(Name); + LOG_WARN(LogDev, "Failed to find object: {}", std::string(NameWStr.begin(), NameWStr.end())); + } + */ return res; }