diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index 09d53e3..6bd1b82 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -40,13 +40,13 @@ FTransform AActor::GetTransform() void AActor::SetNetDormancy(ENetDormancy Dormancy) { - static auto SetNetDormancyFn = FindObject("/Script/Engine.Actor.SetNetDormancy"); + static auto SetNetDormancyFn = FindObject(L"/Script/Engine.Actor.SetNetDormancy"); this->ProcessEvent(SetNetDormancyFn, &Dormancy); } AActor* AActor::GetOwner() { - static auto GetOwnerFunction = FindObject("/Script/Engine.Actor.GetOwner"); + static auto GetOwnerFunction = FindObject(L"/Script/Engine.Actor.GetOwner"); AActor* Owner = nullptr; this->ProcessEvent(GetOwnerFunction, &Owner); diff --git a/Project Reboot 3.0/FortLootPackage.cpp b/Project Reboot 3.0/FortLootPackage.cpp index fd8151d..e1c7e6b 100644 --- a/Project Reboot 3.0/FortLootPackage.cpp +++ b/Project Reboot 3.0/FortLootPackage.cpp @@ -194,7 +194,7 @@ FFortLootTierData* PickLootTierData(const std::vector& LTDTables, F return ChosenRowLootTierData; } -void PickLootDropsFromLootPackage(const std::vector& LPTables, const FName& LootPackageName, std::vector* OutEntries, int LootPackageCategory = -1, int WorldLevel = 0, bool bPrint = false) +void PickLootDropsFromLootPackage(const std::vector& LPTables, const FName& LootPackageName, std::vector* OutEntries, int LootPackageCategory = -1, int WorldLevel = 0, bool bPrint = false, bool bCombineDrops = true) { if (!OutEntries) return; @@ -305,7 +305,29 @@ void PickLootDropsFromLootPackage(const std::vector& LPTables, cons auto ActualItemLevel = WorldItemDefinition->PickLevel(FinalItemLevel); - OutEntries->push_back(LootDrop(FFortItemEntry::MakeItemEntry(ItemDefinition, CurrentCountForEntry, LoadedAmmo, 0x3F800000, ActualItemLevel))); + bool bHasCombined = false; + + if (bCombineDrops) + { + for (auto& CurrentLootDrop : *OutEntries) + { + if (CurrentLootDrop->GetItemDefinition() == ItemDefinition) + { + int NewCount = CurrentLootDrop->GetCount() + CurrentCountForEntry; + + if (NewCount <= ItemDefinition->GetMaxStackSize()) + { + bHasCombined = true; + CurrentLootDrop->GetCount() = NewCount; + } + } + } + } + + if (!bHasCombined) + { + OutEntries->push_back(LootDrop(FFortItemEntry::MakeItemEntry(ItemDefinition, CurrentCountForEntry, LoadedAmmo, MAX_DURABILITY, ActualItemLevel))); + } if (Engine_Version >= 424) { @@ -346,7 +368,7 @@ void PickLootDropsFromLootPackage(const std::vector& LPTables, cons // #define brudda -std::vector PickLootDrops(FName TierGroupName, int WorldLevel, int ForcedLootTier, bool bPrint, int recursive) +std::vector PickLootDrops(FName TierGroupName, int WorldLevel, int ForcedLootTier, bool bPrint, int recursive, bool bCombineDrops) { std::vector LootDrops; diff --git a/Project Reboot 3.0/FortLootPackage.h b/Project Reboot 3.0/FortLootPackage.h index b863432..5d36a4e 100644 --- a/Project Reboot 3.0/FortLootPackage.h +++ b/Project Reboot 3.0/FortLootPackage.h @@ -255,4 +255,4 @@ FORCEINLINE static ValueType PickWeightedElement(const std::unordered_map PickLootDrops(FName TierGroupName, int WorldLevel, int ForcedLootTier = -1, bool bPrint = false, int recursive = 0); \ No newline at end of file +std::vector PickLootDrops(FName TierGroupName, int WorldLevel, int ForcedLootTier = -1, bool bPrint = false, int recursive = 0, bool bCombineDrops = true); \ No newline at end of file diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index 1fad788..e62c963 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -703,59 +703,6 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController* } // PlayerController->ServerRestartPlayer(); - - if (Globals::bLateGame) - { - static int LastNum1 = 124; - - if (LastNum1 != AmountOfRestarts) - { - auto SafeZoneIndicator = GameMode->GetSafeZoneIndicator(); - - if (SafeZoneIndicator) - { - LastNum1 = AmountOfRestarts; - - SafeZoneIndicator->SkipShrinkSafeZone(); - SafeZoneIndicator->SkipShrinkSafeZone(); - } - } - - static auto WoodItemData = FindObject(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData"); - static auto StoneItemData = FindObject(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData"); - static auto MetalItemData = FindObject(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData"); - - static auto Rifle = FindObject(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03"); - static auto Shotgun = FindObject(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03"); - static auto SMG = FindObject(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03"); - - static auto MiniShields = FindObject(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall"); - - static auto Shells = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells"); - static auto Medium = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium"); - static auto Light = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight"); - static auto Heavy = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy"); - - auto WorldInventory = PlayerController->GetWorldInventory(); - - if (!WorldInventory) - return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); - - WorldInventory->AddItem(WoodItemData, nullptr, 500); - WorldInventory->AddItem(StoneItemData, nullptr, 500); - WorldInventory->AddItem(MetalItemData, nullptr, 500); - WorldInventory->AddItem(Rifle, nullptr, 1); - WorldInventory->AddItem(Shotgun, nullptr, 1); - WorldInventory->AddItem(SMG, nullptr, 1); - WorldInventory->AddItem(MiniShields, nullptr, 6); - WorldInventory->AddItem(Shells, nullptr, 999); - WorldInventory->AddItem(Medium, nullptr, 999); - WorldInventory->AddItem(Light, nullptr, 999); - WorldInventory->AddItem(Heavy, nullptr, 999); - - WorldInventory->Update(); - } - // return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); } diff --git a/Project Reboot 3.0/GameModeBase.cpp b/Project Reboot 3.0/GameModeBase.cpp index b9e3939..278b525 100644 --- a/Project Reboot 3.0/GameModeBase.cpp +++ b/Project Reboot 3.0/GameModeBase.cpp @@ -225,6 +225,43 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll WorldInventory->Update(); } + else + { + if (GameState->GetGamePhase() == EAthenaGamePhase::Aircraft) + { + if (Globals::bLateGame) + { + static auto WoodItemData = FindObject(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData"); + static auto StoneItemData = FindObject(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData"); + static auto MetalItemData = FindObject(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData"); + + static auto Rifle = FindObject(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03"); + static auto Shotgun = FindObject(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03"); + static auto SMG = FindObject(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03"); + + static auto MiniShields = FindObject(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall"); + + static auto Shells = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells"); + static auto Medium = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium"); + static auto Light = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight"); + static auto Heavy = FindObject(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy"); + + WorldInventory->AddItem(WoodItemData, nullptr, 500); + WorldInventory->AddItem(StoneItemData, nullptr, 500); + WorldInventory->AddItem(MetalItemData, nullptr, 500); + WorldInventory->AddItem(Rifle, nullptr, 1); + WorldInventory->AddItem(Shotgun, nullptr, 1); + WorldInventory->AddItem(SMG, nullptr, 1); + WorldInventory->AddItem(MiniShields, nullptr, 6); + WorldInventory->AddItem(Shells, nullptr, 999); + WorldInventory->AddItem(Medium, nullptr, 999); + WorldInventory->AddItem(Light, nullptr, 999); + WorldInventory->AddItem(Heavy, nullptr, 999); + + WorldInventory->Update(); + } + } + } } else { diff --git a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters index 5b74285..c859929 100644 --- a/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters +++ b/Project Reboot 3.0/Project Reboot 3.0.vcxproj.filters @@ -819,7 +819,6 @@ FortniteGame\Source\FortniteGame\Public\Athena\Vehicle - FortniteGame\Source\FortniteGame\Public\Building @@ -934,6 +933,9 @@ FortniteGame\Source\FortniteGame\Public\Building\GameplayActors + + Reboot\Public + diff --git a/Project Reboot 3.0/commands.h b/Project Reboot 3.0/commands.h index f59089d..7470a17 100644 --- a/Project Reboot 3.0/commands.h +++ b/Project Reboot 3.0/commands.h @@ -73,41 +73,43 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) static auto ClientConnectionsOffset = WorldNetDriver->GetOffset("ClientConnections"); auto& ClientConnections = WorldNetDriver->Get>(ClientConnectionsOffset); - /* if (firstBackslash == lastBackslash) + if (firstBackslash != std::string::npos && lastBackslash != std::string::npos) { - SendMessageToConsole(PlayerController, L"Warning: You have a backslash but no ending backslash, was this by mistake? Executing on you."); - } */ - - if (firstBackslash != lastBackslash && firstBackslash != std::string::npos && lastBackslash != std::string::npos) // we want to specify a player - { - std::string player = OldMsg; - - player = player.substr(firstBackslash + 1, lastBackslash - firstBackslash - 1); - - for (int i = 0; i < ClientConnections.Num(); i++) + if (firstBackslash != lastBackslash) { - static auto PlayerControllerOffset = ClientConnections.at(i)->GetOffset("PlayerController"); - auto CurrentPlayerController = Cast(ClientConnections.at(i)->Get(PlayerControllerOffset)); + std::string player = OldMsg; - if (!CurrentPlayerController) - continue; + player = player.substr(firstBackslash + 1, lastBackslash - firstBackslash - 1); - auto CurrentPlayerState = Cast(CurrentPlayerController->GetPlayerState()); - - if (!CurrentPlayerState) - continue; - - auto PlayerName = CurrentPlayerState->GetPlayerName(); - - if (PlayerName.ToString() == player) // hopefully we arent on adifferent thread + for (int i = 0; i < ClientConnections.Num(); i++) { - ReceivingController = CurrentPlayerController; - ReceivingPlayerState = CurrentPlayerState; - PlayerName.Free(); - break; - } + static auto PlayerControllerOffset = ClientConnections.at(i)->GetOffset("PlayerController"); + auto CurrentPlayerController = Cast(ClientConnections.at(i)->Get(PlayerControllerOffset)); - PlayerName.Free(); + if (!CurrentPlayerController) + continue; + + auto CurrentPlayerState = Cast(CurrentPlayerController->GetPlayerState()); + + if (!CurrentPlayerState) + continue; + + auto PlayerName = CurrentPlayerState->GetPlayerName(); + + if (PlayerName.ToString() == player) // hopefully we arent on adifferent thread + { + ReceivingController = CurrentPlayerController; + ReceivingPlayerState = CurrentPlayerState; + PlayerName.Free(); + break; + } + + PlayerName.Free(); + } + } + else + { + // SendMessageToConsole(PlayerController, L"Warning: You have a backslash but no ending backslash, was this by mistake? Executing on you."); } } @@ -624,7 +626,7 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) Count = Max; } - static auto BGAClass = FindObject("/Script/Engine.BlueprintGeneratedClass"); + static auto BGAClass = FindObject(L"/Script/Engine.BlueprintGeneratedClass"); auto ClassObj = LoadObject(ClassName, BGAClass); if (ClassObj) diff --git a/Project Reboot 3.0/die.h b/Project Reboot 3.0/die.h index 1639f4a..998cd02 100644 --- a/Project Reboot 3.0/die.h +++ b/Project Reboot 3.0/die.h @@ -19,8 +19,6 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override LOG_INFO(LogDev, "SetZoneToIndexHook!"); - bool bIsFirstZone = false; - auto GameState = Cast(GameModeAthena->GetGameState()); LOG_INFO(LogDev, "GamePhaseStep: {}", (int)GameState->GetGamePhaseStep()); @@ -30,31 +28,26 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase"); static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase"); - int NewSafeZonePhase = GameModeAthena->Get(GameMode_SafeZonePhaseOffset); + static int ahaaSafeZonePhase = 4; + int NewSafeZonePhase = ahaaSafeZonePhase; // GameModeAthena->Get(GameMode_SafeZonePhaseOffset); + + const int OriginalOldSafeZonePhase = GameModeAthena->Get(GameMode_SafeZonePhaseOffset); if (NewSafeZonePhase < 4) { NewSafeZonePhase = 4; - bIsFirstZone = true; } - LOG_INFO(LogDev, "Setting zone to: {}", NewSafeZonePhase); + LOG_INFO(LogDev, "Setting zone to: {} ({})", NewSafeZonePhase, OriginalOldSafeZonePhase); GameModeAthena->Get(GameMode_SafeZonePhaseOffset) = NewSafeZonePhase; GameState->Get(GameState_SafeZonePhaseOffset) = NewSafeZonePhase; + ahaaSafeZonePhase++; } if (Fortnite_Version < 13) { SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK); - - if (Globals::bLateGame && bIsFirstZone) - { - // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipshrinksafezone", nullptr); - // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr); - // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipshrinksafezone", nullptr); - } - return; } diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 75bdd78..60fd56b 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -818,7 +818,7 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorldWithClass"), UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldWithClassOriginal, false, true); - if (Addresses::FreeArrayOfEntries || Addresses::FreeEntry) + // if (Addresses::FreeArrayOfEntries || Addresses::FreeEntry) { Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.PickLootDrops"), UFortKismetLibrary::PickLootDropsHook, (PVOID*)&UFortKismetLibrary::PickLootDropsOriginal, false, true); diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index 3026f68..1e969a7 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -46,7 +46,7 @@ #define GAMEMODE_TAB 3 #define THANOS_TAB 4 #define EVENT_TAB 5 -#define LATEGAME_TAB 6 +#define ZONE_TAB 6 #define DUMP_TAB 7 #define UNBAN_TAB 8 #define DEVELOPER_TAB 9 @@ -347,9 +347,9 @@ static inline void MainTabs() } } - if (false && Globals::bLateGame && ImGui::BeginTabItem(("Lategame"))) + if (ImGui::BeginTabItem(("Zone"))) { - Tab = LATEGAME_TAB; + Tab = ZONE_TAB; PlayerTab = -1; bInformationTab = false; ImGui::EndTabItem(); @@ -576,13 +576,13 @@ static inline void MainUI() if (!bStartedBus) { - if (Globals::bLateGame.load()) + if (Globals::bLateGame.load() || Fortnite_Version >= 11) { if (ImGui::Button("Start Bus")) { bStartedBus = true; - auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode(); + auto GameMode = (AFortGameModeAthena*)GetWorld()->GetGameMode(); auto GameState = GameMode->GetGameState(); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr); @@ -688,6 +688,24 @@ static inline void MainUI() static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked"); static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked")); GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false); + + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipaircraft", nullptr); + + auto SafeZoneIndicator = GameMode->GetSafeZoneIndicator(); + + if (SafeZoneIndicator) + { + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr); + SafeZoneIndicator->SkipShrinkSafeZone(); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr); + SafeZoneIndicator->SkipShrinkSafeZone(); + + // Sleep(1000); + // SafeZoneIndicator->SkipShrinkSafeZone(); + } + + LOG_INFO(LogDev, "Finished!"); } } else @@ -785,6 +803,40 @@ static inline void MainUI() } } + else if (Tab == ZONE_TAB) + { + if (ImGui::Button("Start Safe Zone")) + { + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr); + } + + if (ImGui::Button("Pause Safe Zone")) + { + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr); + } + + if (ImGui::Button("Skip Zone")) + { + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipsafezone", nullptr); + } + + if (ImGui::Button("Start Shrink Safe Zone")) + { + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr); + } + + if (ImGui::Button("Skip Shrink Safe Zone")) + { + auto GameMode = Cast(GetWorld()->GetGameMode()); + auto SafeZoneIndicator = GameMode->GetSafeZoneIndicator(); + + if (SafeZoneIndicator) + { + SafeZoneIndicator->SkipShrinkSafeZone(); + } + } + } + else if (Tab == DUMP_TAB) { ImGui::Text("These will all be in your Win64 folder!");