From b0901b9659901c8e4d66a4f5ce463d9d88df8ae9 Mon Sep 17 00:00:00 2001 From: ILoveTacosFromJITB <89064551+ILoveTacosFromJITB@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:25:52 -0800 Subject: [PATCH] Some Event Fixes, 18.10 Crash fix, random crash after a few minutes for s17+ --- Project Reboot 3.0/Actor.cpp | 22 ++ Project Reboot 3.0/Actor.h | 1 + Project Reboot 3.0/GameModeBase.cpp | 15 +- Project Reboot 3.0/dllmain.cpp | 332 +++++++++++++++++++++++++++- Project Reboot 3.0/events.h | 36 +++ Project Reboot 3.0/finder.h | 3 + Project Reboot 3.0/gui.h | 17 ++ 7 files changed, 418 insertions(+), 8 deletions(-) diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index 105e8c9..07ac52a 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -205,6 +205,28 @@ bool AActor::IsPendingKillPending() return IsActorBeingDestroyed() || !IsValidChecked(this); } +UObject* AActor::AddComponentByClass(UClass* Class) +{ + struct + { + UClass* Class; + bool bManualAttachment; + FTransform RelativeTransform; + bool bDeferredFinish; + UObject* ReturnValue; + } params; + params.Class = Class; + params.bManualAttachment = false; + params.RelativeTransform = FTransform(); + params.bDeferredFinish = true; + + static UFunction* AddComp = FindObject("/Script/Engine.Actor:AddComponentByClass"); + + this->ProcessEvent(AddComp, ¶ms); + + return params.ReturnValue; +} + float& AActor::GetNetUpdateFrequency() { static auto NetUpdateFrequencyOffset = GetOffset("NetUpdateFrequency"); diff --git a/Project Reboot 3.0/Actor.h b/Project Reboot 3.0/Actor.h index 2c48346..fceac71 100644 --- a/Project Reboot 3.0/Actor.h +++ b/Project Reboot 3.0/Actor.h @@ -48,6 +48,7 @@ public: void ForceNetUpdate(); bool IsNetStartupActor(); bool IsPendingKillPending(); + UObject* AddComponentByClass(UClass* Class); float& GetNetUpdateFrequency(); float& GetMinNetUpdateFrequency(); const AActor* GetNetOwner() const; diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index a4d1521..19a1217 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -159,7 +159,20 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll auto& StartingItems = ((AFortGameModeAthena*)GameMode)->GetStartingItems(); - NewPlayerAsAthena->AddPickaxeToInventory(); + if (Globals::bGoingToPlayEvent && Fortnite_Version >= 16.00) + { + auto WID = Cast(FindObject("WID_EventMode_Activator", nullptr, ANY_PACKAGE)); // Empty Hands + + bool bShouldUpdate = false; + WorldInventory->AddItem(WID, &bShouldUpdate, 1); + + if (bShouldUpdate) + WorldInventory->Update(); + } + else + { + NewPlayerAsAthena->AddPickaxeToInventory(); + } for (int i = 0; i < StartingItems.Num(); ++i) { diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index e385230..c3bf42c 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -211,9 +211,305 @@ void ActivatePhaseAtIndexHook(UObject* SpecialEventScript, int Index) static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex"); SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn); + auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections(); + + // Rift Tour + if (Fortnite_Version == 17.30) + { + auto EventPlaylist = GetEventPlaylist(); + + struct { UObject* GameState; UObject* Playlist; FGameplayTagContainer PlaylistContextTags; } OnReadyParams{ Cast(GetWorld()->GetGameState()), EventPlaylist }; + + { + if (Index == 0) // Start of Event + { + auto MasterScripting = FindObject("/Buffet/Levels/Buffet_P.Buffet_P:PersistentLevel.BP_Event_Master_Scripting_2"); + + auto AllSatelliteDishes = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject("/Game/Athena/Apollo/Environments/BuildingActors/Complex/Props/Apollo_Complex_Satellite_Dish_Top_01.Apollo_Complex_Satellite_Dish_Top_01_C")); + + for (int i = 0; i < AllSatelliteDishes.Num(); i++) + { + AllSatelliteDishes.At(i)->K2_DestroyActor(); + } + + MasterScripting->ProcessEvent(MasterScripting->FindFunction("EnableTheMutator")); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + auto CurrentController = ClientConnections.At(i)->GetPlayerController(); + + CurrentController->AddComponentByClass(FindObject("/Script/SpecialEventGameplayRuntime.FortControllerComponent_SpecialEvent")); + CurrentPawn->AddComponentByClass(FindObject("/Script/BuffetRuntime.FortSpecialRelevancyPawnAttachComponent")); + } + } + if (Index == 1) // Memories, BP_Buffet_PhaseScripting_Phase1_C + { + //EventPawn->TeleportTo(FVector(-963.630f, 25453.090f, 359392.125f), EventPawn->GetActorRotation()); + + auto Phase1Scripting = FindObject("/Buffet/Levels/Buffet_Part_3.Buffet_Part_3:PersistentLevel.BP_Buffet_PhaseScripting_Phase1_2"); + + auto TeleportRef = Phase1Scripting->Get(Phase1Scripting->GetOffset("TeleportRef")); + + //EventPawn->TeleportTo(TeleportRef->GetActorLocation(), EventPawn->GetActorRotation()); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + + //CurrentPawn->TeleportTo(TeleportRef->GetActorLocation(), CurrentPawn->GetActorRotation()); + + //Globals::PawnTeleportRotDefault = CurrentPawn->GetActorRotation(); + + CurrentPawn->ForceNetUpdate(); + } + } + if (Index == 2) // Slide + { + auto Script = FindObject("/Buffet/Levels/Buffet_Part_4.Buffet_Part_4.PersistentLevel.BP_Buffet_PhaseScripting_Paint_4"); + + Script->Get(Script->GetOffset("bRaceStarted")) = true; + Script->ProcessEvent(Script->FindFunction("OnRep_bRaceStarted")); + + Script->ProcessEvent(Script->FindFunction("OnReady_4E0ADA484A9A29A99CA6DD97BE645F09"), &OnReadyParams); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + auto CurrentController = ClientConnections.At(i)->GetPlayerController(); + + auto PlayerComponent = CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_PlayerComponent.BP_Buffet_Paint_PlayerComponent_C")); + CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_IntroTrackFinder.BP_Buffet_Paint_IntroTrackFinder_C")); + auto MovementComponent = CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/WrapWorldPrototype/BP_Buffet_Paint_MovementComponent.BP_Buffet_Paint_MovementComponent_C")); + + PlayerComponent->Get(PlayerComponent->GetOffset("MovementComponent")) = MovementComponent; + + PlayerComponent->ProcessEvent(PlayerComponent->FindFunction("InitializePaintComponent")); + PlayerComponent->ProcessEvent(PlayerComponent->FindFunction("InitializeMovementComponent")); + } + } + if (Index == 4) // Storm King + { + auto StormScript = FindObject("/Buffet/Levels/Buffet_Part_6.Buffet_Part_6:PersistentLevel.BP_Buffet_PhaseScripting_4"); + + auto DefaultPlane = FindObject("/Buffet/Gameplay/Blueprints/WolfMother/BP_PlanePrototype.Default__BP_PlanePrototype_C"); + + { + auto WID = Cast(FindObject("WID_Buffet_BeatMatchingBoomBox", nullptr, ANY_PACKAGE)); // Storm King weapon thing + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController(); + + auto WorldInventory = CurrentController->GetWorldInventory(); + + bool bShouldUpdate = false; + WorldInventory->AddItem(WID, &bShouldUpdate, 1); + + if (bShouldUpdate) + WorldInventory->Update(); + + SendMessageToConsole(CurrentController, L"Gave WID_Buffet_BeatMatchingBoomBox!"); + } + + auto AllWeps = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject("/Buffet/Gameplay/Blueprints/WolfMother/BeatmatchingWeapon/B_Buffet_BeatMatchingWeaponPrototype.B_Buffet_BeatMatchingWeaponPrototype_C")); + + for (int i = 0; i < AllWeps.Num(); i++) + { + auto CurrentWep = AllWeps.At(i); + + if (CurrentWep != nullptr) + { + CurrentWep->Get(CurrentWep->GetOffset("Phase4ScriptingRef")) = StormScript; + } + } + } + } + if (Index == 5) // Ariana Knocked + { + auto ReviveScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Revive_2"); + + auto ManualTeleportLocation = ReviveScripting->Get(ReviveScripting->GetOffset("ManualTeleportLocation")); + + auto ManualTeleportRotation = ReviveScripting->Get(ReviveScripting->GetOffset("Manual_Teleport_Rotation")); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + } + } + if (Index == 6) // Ariana + { + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + + CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/Stars/BP_Buffet_Stars_PlayerComponent.BP_Buffet_Stars_PlayerComponent_C")); + } + } + if (Index == 7) // Ariana Dance + { + auto ReviveScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Revive_2"); + + auto ReflectScripting = FindObject("/Buffet/Levels/Buffet_Reflect.Buffet_Reflect:PersistentLevel.BP_Buffet_PhaseScripting_Reflect_2"); + + auto ManualTeleportRotation = ReviveScripting->Get(ReviveScripting->GetOffset("Manual_Teleport_Rotation")); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + + CurrentPawn->AddComponentByClass(FindObject("/BuffetPlaylist/Playlist/BuffetCharacterMovementMutatorComponent.BuffetCharacterMovementMutatorComponent_C")); + } + } + if (Index == 8) // Bubbles + { + auto BubblesScripting = FindObject("/Buffet/Levels/Buffet_Bubbles.Buffet_Bubbles:PersistentLevel.BP_Buffet_PhaseScripting_Bubble_4"); + + BubblesScripting->Get(BubblesScripting->GetOffset("bUsePlayerMovementMode")) = false; + + BubblesScripting->Get(BubblesScripting->GetOffset("FollowActor")) = FindObject("/Buffet/Levels/Buffet_Bubbles.Buffet_Bubbles:PersistentLevel.BP_Buffet_BubbleFollowActor_2"); + } + if (Index == 9) // Clouds + { + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + + auto RemoveComponent = CurrentPawn->GetComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/Stars/BP_Buffet_Stars_PlayerComponent.BP_Buffet_Stars_PlayerComponent_C")); + + CurrentPawn->ProcessEvent(CurrentPawn->FindFunction("K2_DestroyComponent"), RemoveComponent); + + CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/Llama/BP_Buffet_Llama_PlayerComponent.BP_Buffet_Llama_PlayerComponent_C")); + CurrentPawn->AddComponentByClass(FindObject("/Buffet/Gameplay/Blueprints/PostEvent/LlamaSpeedControlComponent.LlamaSpeedControlComponent_C")); + } + } + if (Index == 10) // Escher + { + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + + CurrentPawn->TeleportTo(FVector(36.34f, 1044.07f, 504.50f), CurrentPawn->GetActorRotation()); + } + } + } + } + + if (Fortnite_Version == 18.40) + { + if (Index == 0) + { + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController(); + + static auto StormEffectClass = FindObject(L"/Game/Athena/SafeZone/GE_OutsideSafeZoneDamage.GE_OutsideSafeZoneDamage_C"); + auto PlayerState = CurrentController->GetPlayerStateAthena(); + PlayerState->GetAbilitySystemComponent()->RemoveActiveGameplayEffectBySourceEffect(StormEffectClass, 1, PlayerState->GetAbilitySystemComponent()); + } + + auto AssultWID = Cast(FindObject("WID_Guava_Assault_AutoHigh_Athena_SR_Ore_T03", nullptr, ANY_PACKAGE)); + auto RevolveWID = Cast(FindObject("WID_Guava_Pistol_SixShooter_Athena_SR_Ore_T03", nullptr, ANY_PACKAGE)); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentPawn = ClientConnections.At(i)->GetPlayerController()->GetPawn(); + auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController(); + + auto WorldInventory = CurrentController->GetWorldInventory(); + + bool bShouldUpdate = true; + WorldInventory->AddItem(AssultWID, &bShouldUpdate, 1); + WorldInventory->AddItem(RevolveWID, &bShouldUpdate, 1); + + + if (bShouldUpdate) + WorldInventory->Update(); + + SendMessageToConsole(CurrentController, L"Gave Event Weapons!"); + } + + auto AllSatelliteDishes = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FindObject("/Game/Athena/Apollo/Environments/BuildingActors/Complex/Props/Apollo_Complex_Satellite_Dish_Top_01.Apollo_Complex_Satellite_Dish_Top_01_C")); + + for (int i = 0; i < AllSatelliteDishes.Num(); i++) + { + AllSatelliteDishes.At(i)->K2_DestroyActor(); + } + } + } + return ActivatePhaseAtIndexOriginal(SpecialEventScript, Index); } +static void (*AttemptFinishPhaseOriginal)(AActor* SpecialEventScript, FGameplayTag PhaseTag); +void AttemptFinishPhaseHook(AActor* SpecialEventScript, FGameplayTag PhaseTag) +{ + LOG_INFO(LogDev, "SpecialEventScript::AttemptFinishPhase PhaseTag: {}", PhaseTag.TagName.ToString()); + + static auto ReplicatedActivePhaseIndexOffset = SpecialEventScript->GetOffset("ReplicatedActivePhaseIndex"); // Sets what Map/Phase were replicating to clients. + auto LastTag = PhaseTag.TagName.ToString(); + + static auto OnRep_ReplicatedActivePhaseIndexFn = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventScript.OnRep_ReplicatedActivePhaseIndex"); + + auto Connections = GetWorld()->GetNetDriver()->GetClientConnections(); + + if (LastTag == "Kiwi.Phase.Islands") // PrisonBlocks (Event Start) + { + SpecialEventScript->Get(ReplicatedActivePhaseIndexOffset) = 1; + + for (int i = 0; i < Connections.Num(); i++) + { + auto CurrentPawn = Cast(Connections.At(i)->GetPlayerController()->GetPawn()); + + CurrentPawn->TeleportTo(FVector(34640.0f, 32350.0f, 100600.0f), CurrentPawn->GetActorRotation()); + + CurrentPawn->ServerChoosePart(EFortCustomPartType::Backpack, FindObject("/Kiwi/Gameplay/Blueprints/Backpack/CP_Backpack_Kiwi.CP_Backpack_Kiwi")); + } + } + if (LastTag == "Kiwi.Phase.Prison") // Kevin + { + SpecialEventScript->Get(ReplicatedActivePhaseIndexOffset) = 2; + } + if (LastTag == "Kiwi.Phase.ObservationRoom") // Hangar + { + SpecialEventScript->Get(ReplicatedActivePhaseIndexOffset) = 3; + } + if (LastTag == "Kiwi.Phase.Hanger") // Ending + { + SpecialEventScript->Get(ReplicatedActivePhaseIndexOffset) = 4; + } + SpecialEventScript->ProcessEvent(OnRep_ReplicatedActivePhaseIndexFn); + + return AttemptFinishPhaseOriginal(SpecialEventScript, PhaseTag); +} + +// Used to teleport the pawn in some events, not used in all parts of rift tour for some reason. +static void (*TeleportPlayerPawnOriginal)(UObject* Context, FFrame& Stack, void* Ret); +void TeleportPlayerPawnHook(UObject* Context, FFrame& Stack, void* Ret) +{ + LOG_INFO(LogEvent, "Teleported PlayerPawn!"); + + UObject* WorldContextObject; + AFortPlayerPawn* PlayerPawn; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FVector DestLocation; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + FRotator DestRotation; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, NativeAccessSpecifierPublic) + bool bIgnoreCollision; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + bool bIgnoreSupplementalKillVolumeSweep; //(Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) + + Stack.StepCompiledIn(&WorldContextObject); + Stack.StepCompiledIn(&PlayerPawn); + Stack.StepCompiledIn(&DestLocation); + Stack.StepCompiledIn(&DestRotation); + Stack.StepCompiledIn(&bIgnoreCollision); + Stack.StepCompiledIn(&bIgnoreSupplementalKillVolumeSweep); + + PlayerPawn->TeleportTo(DestLocation, DestRotation); + + return TeleportPlayerPawnOriginal(Context, Stack, Ret); +} + static __int64 (*FlowStep_SetPhaseToActiveOriginal)(AActor* SpecialEventPhase); __int64 FlowStep_SetPhaseToActiveHook(AActor* SpecialEventPhase) @@ -297,14 +593,17 @@ void ChangeLevels() } else { - if (FindGIsServer()) + if (Fortnite_Version != 18.10) { - *(bool*)FindGIsServer() = true; - } + if (FindGIsServer()) + { + *(bool*)FindGIsServer() = true; + } - if (FindGIsClient()) - { - *(bool*)FindGIsClient() = false; + if (FindGIsClient()) + { + *(bool*)FindGIsClient() = false; + } } if (bShouldRemoveLocalPlayer) @@ -523,7 +822,8 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E5496C), (PVOID)ReturnTrueHook, nullptr); // 7FF638A0496C Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E54A68), (PVOID)ReturnTrueHook, nullptr); // 7FF638A04A68 // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)ReturnFalseHook, nullptr); - Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4D768), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 07FF6389FD768 + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4D768), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 07FF6389FD768 + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E4DFA4), (PVOID)AttemptFinishPhaseHook, (PVOID*)&AttemptFinishPhaseOriginal); } else if (Fortnite_Version == 18.40) { @@ -535,6 +835,24 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x41624C8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF79E3E24C8 } + if (Globals::bGoingToPlayEvent) + { + if (Fortnite_Version >= 17.30) + { + Hooking::MinHook::Hook(FindObject("/Script/FortniteGame.Default__FortMissionLibrary"), FindObject(L"/Script/FortniteGame.FortMissionLibrary:TeleportPlayerPawn"), TeleportPlayerPawnHook, + (PVOID*)&TeleportPlayerPawnOriginal, false, true); + } + } + + if (Fortnite_Version >= 17.00) // Fixes random crash that happens a couple minutes after server starts for s17+ + { + uintptr_t ServerCrashFix = Memcury::Scanner::FindPattern("48 89 5C 24 10 48 89 6C 24 20 56 57 41 54 41 56 41 57 48 81 EC ? ? ? ? 65 48 8B 04 25 ? ? ? ? 4C 8B F9").Get(); + + LOG_INFO(LogDev, "ServerCrashFix: 0x{:x}", ServerCrashFix); + + Hooking::MinHook::Hook((PVOID)ServerCrashFix, (PVOID)ReturnFalseHook, nullptr); + } + /* if (Fortnite_Version == 6.21) diff --git a/Project Reboot 3.0/events.h b/Project Reboot 3.0/events.h index 0068514..a98e8d5 100644 --- a/Project Reboot 3.0/events.h +++ b/Project Reboot 3.0/events.h @@ -756,6 +756,42 @@ static inline void StartEvent() auto SpecialEventScriptMeshActorClass = FindObject("/Script/SpecialEventGameplayRuntime.SpecialEventScriptMeshActor"); auto AllSpecialEventScriptMeshActors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), SpecialEventScriptMeshActorClass); + if (Fortnite_Version == 17.50) + { + auto Scripting = FindObject("/Kiwi/Levels/Kiwi_P.Kiwi_P:PersistentLevel.BP_Kiwi_Master_Scripting_2"); + + float SecondsSinceEventBegan = 0; + + auto EventPlaylist = GetEventPlaylist(); + + struct { UObject* GameState; UObject* Playlist; FGameplayTagContainer PlaylistContextTags; } OnReadyParams{ Cast(GetWorld()->GetGameState()), EventPlaylist }; + if (EventPlaylist) + { + static auto GameplayTagContainerOffset = EventPlaylist->GetOffset("GameplayTagContainer"); + OnReadyParams.PlaylistContextTags = EventPlaylist->Get(GameplayTagContainerOffset); + } + else + { + OnReadyParams.PlaylistContextTags = FGameplayTagContainer(); + } + auto BB = FindObject("/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 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); + + static auto StartEvent = FindObject("/Kiwi/Gameplay/BP_Kiwi_Master_Scripting.BP_Kiwi_Master_Scripting_C.startevent"); + Scripting->ProcessEvent(StartEvent, &SecondsSinceEventBegan); + } + if (AllSpecialEventScriptMeshActors.Num() > 0) { auto SpecialEventScriptMeshActor = AllSpecialEventScriptMeshActors.at(0); diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index d59e684..b5df0ec 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -347,6 +347,9 @@ static inline uint64 FindInitHost() if (!addr) // s18 addr = Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 56 41 57 48 8D 68 A1 48 81 EC ? ? ? ? 48 8B F1 4C 8D 35 ? ? ? ? 4D").Get(); + if (Fortnite_Version == 18.10) + addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 55 57 41 56 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B F1 48 8D 1D ? ? ? ? 4C 8B C3 48 8D 4D D7 45").Get(); + return addr; } diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index cc57bb3..bb1b4e0 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -902,6 +902,23 @@ static inline void MainUI() StartEvent(); } + if (Fortnite_Version == 18.40) + { + if (ImGui::Button("Remove Storm Effect")) + { + auto ClientConnections = GetWorld()->GetNetDriver()->GetClientConnections(); + + for (int i = 0; i < ClientConnections.Num(); i++) + { + auto CurrentController = (AFortPlayerControllerAthena*)ClientConnections.At(i)->GetPlayerController(); + + static auto StormEffectClass = FindObject(L"/Game/Athena/SafeZone/GE_OutsideSafeZoneDamage.GE_OutsideSafeZoneDamage_C"); + auto PlayerState = CurrentController->GetPlayerStateAthena(); + PlayerState->GetAbilitySystemComponent()->RemoveActiveGameplayEffectBySourceEffect(StormEffectClass, 1, PlayerState->GetAbilitySystemComponent()); + } + } + } + if (Fortnite_Version == 8.51) { if (ImGui::Button("Unvault DrumGun"))