diff --git a/Project Reboot 3.0/BGA.h b/Project Reboot 3.0/BGA.h index 23e09f3..3a042e1 100644 --- a/Project Reboot 3.0/BGA.h +++ b/Project Reboot 3.0/BGA.h @@ -105,7 +105,7 @@ static inline void SpawnBGAs() // hahah not "proper", there's a function that we */ } - if (FinalSpawnTransform.Translation == FVector(0, 0, 0)) + if (FinalSpawnTransform.Translation.CompareVectors(FVector(0, 0, 0))) { LOG_WARN(LogGame, "Invalid BGA spawn location!"); // ConsumableActor->K2_DestroyActor(); // ?? diff --git a/Project Reboot 3.0/FortAthenaCreativePortal.cpp b/Project Reboot 3.0/FortAthenaCreativePortal.cpp index c8939e0..29e393b 100644 --- a/Project Reboot 3.0/FortAthenaCreativePortal.cpp +++ b/Project Reboot 3.0/FortAthenaCreativePortal.cpp @@ -31,7 +31,7 @@ void AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeHook(UObject* Contex return TeleportPlayerToLinkedVolumeOriginal(Context, Stack, Ret); auto Location = LinkedVolume->GetActorLocation(); - Location.Z -= 10000; // proper 1:1 + // Location.Z -= 10000; // proper 1:1 PlayerPawn->TeleportTo(Location, FRotator()); return TeleportPlayerToLinkedVolumeOriginal(Context, Stack, Ret); diff --git a/Project Reboot 3.0/FortAthenaMapInfo.cpp b/Project Reboot 3.0/FortAthenaMapInfo.cpp index 9e16a1e..6013639 100644 --- a/Project Reboot 3.0/FortAthenaMapInfo.cpp +++ b/Project Reboot 3.0/FortAthenaMapInfo.cpp @@ -52,11 +52,11 @@ void AFortAthenaMapInfo::SpawnLlamas() // LOG_INFO(LogDev, "Initial Llama at {} {} {}", Location.X, Location.Y, Location.Z); - if (Location == FVector(0, 0, 0)) + if (Location.CompareVectors(FVector(0, 0, 0))) continue; FRotator RandomYawRotator = FRotator(); - RandomYawRotator.Yaw = (float)rand() * 0.010986663; + RandomYawRotator.Yaw = (float)rand() * 0.010986663f; FTransform InitialSpawnTransform; InitialSpawnTransform.Translation = Location; diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index ad9f372..9c3884a 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -233,6 +233,36 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game SetupServerBotManager(); // SetupNavConfig(UKismetStringLibrary::Conv_StringToName(L"MANG")); + static auto WorldManagerOffset = GameState->GetOffset("WorldManager", false); + + if (WorldManagerOffset != -1) // needed? + { + auto WorldManager = GameState->Get(WorldManagerOffset); + + if (WorldManager) + { + static auto WorldManagerStateOffset = WorldManager->GetOffset("WorldManagerState", false); + + if (WorldManagerStateOffset != -1) // needed? + { + enum class EFortWorldManagerState : uint8_t + { + WMS_Created = 0, + WMS_QueryingWorld = 1, + WMS_WorldQueryComplete = 2, + WMS_CreatingNewWorld = 3, + WMS_LoadingExistingWorld = 4, + WMS_Running = 5, + WMS_Failed = 6, + WMS_MAX = 7 + }; + + LOG_INFO(LogDev, "Old WorldManager State: {}", (int)WorldManager->Get(WorldManagerStateOffset)); + WorldManager->Get(WorldManagerStateOffset) = EFortWorldManagerState::WMS_Running; // needed? right time? + } + } + } + static auto WarmupRequiredPlayerCountOffset = GameMode->GetOffset("WarmupRequiredPlayerCount"); GameMode->Get(WarmupRequiredPlayerCountOffset) = 1; @@ -512,7 +542,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game } } - // if (!Globals::bCreative) + /* if (!Globals::bCreative) // ?? { static auto FortPlayerStartCreativeClass = FindObject(L"/Script/FortniteGame.FortPlayerStartCreative"); static auto FortPlayerStartWarmupClass = FindObject(L"/Script/FortniteGame.FortPlayerStartWarmup"); @@ -524,7 +554,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game if (ActorsNum == 0) return false; - } + } */ auto MapInfo = GameState->GetMapInfo(); @@ -1095,7 +1125,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena for (auto& LootDrop : LootDrops) { - PickupCreateData CreateData; + PickupCreateData CreateData{}; CreateData.bToss = true; CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(LootDrop->GetItemDefinition(), LootDrop->GetCount(), LootDrop->GetLoadedAmmo()); CreateData.SpawnLocation = Location; diff --git a/Project Reboot 3.0/FortGameStateAthena.cpp b/Project Reboot 3.0/FortGameStateAthena.cpp index 20bc112..e40a160 100644 --- a/Project Reboot 3.0/FortGameStateAthena.cpp +++ b/Project Reboot 3.0/FortGameStateAthena.cpp @@ -162,7 +162,7 @@ bool AFortGameStateAthena::IsRespawningAllowed(AFortPlayerState* PlayerState) auto GameModeAthena = Cast(GetWorld()->GetGameMode()); static auto IsRespawningAllowedFn = FindObject(L"/Script/FortniteGame.FortGameStateZone.IsRespawningAllowed"); - LOG_INFO(LogDev, "IsRespawningAllowedFn: {}", __int64(IsRespawningAllowedFn)); + // LOG_INFO(LogDev, "IsRespawningAllowedFn: {}", __int64(IsRespawningAllowedFn)); if (!IsRespawningAllowedFn) { @@ -178,7 +178,7 @@ bool AFortGameStateAthena::IsRespawningAllowed(AFortPlayerState* PlayerState) return false; auto& RespawnType = CurrentPlaylist->Get(RespawnTypeOffset); - LOG_INFO(LogDev, "RespawnType: {}", (int)RespawnType); + // LOG_INFO(LogDev, "RespawnType: {}", (int)RespawnType); if (RespawnType == 1) return true; @@ -278,25 +278,29 @@ void AFortGameStateAthena::AddToAdditionalPlaylistLevelsStreamed(const FName& Na auto NameStr = Name.ToString(); auto NameWStr = std::wstring(NameStr.begin(), NameStr.end()); - StreamLevel(Name.ToString()); // skunke bozo (I didn't test the next code too much soo) - /* ULevelStreamingDynamic::LoadLevelInstance(GetWorld(), NameWStr.c_str(), FVector(), FRotator()); - - static auto AdditionalPlaylistLevelsStreamedOffset = this->GetOffset("AdditionalPlaylistLevelsStreamed", false); - - if (!FAdditionalLevelStreamed::GetStruct()) + if (true) { - auto& AdditionalPlaylistLevelsStreamed = this->Get>(AdditionalPlaylistLevelsStreamedOffset); - AdditionalPlaylistLevelsStreamed.Add(Name); + StreamLevel(Name.ToString()); // skunke bozo (I didn't test the next code too much soo) } else { - auto& AdditionalPlaylistLevelsStreamed = this->Get>(AdditionalPlaylistLevelsStreamedOffset); - auto NewLevelStreamed = Alloc(FAdditionalLevelStreamed::GetStructSize()); - NewLevelStreamed->GetLevelName() = Name; - NewLevelStreamed->IsServerOnly() = bServerOnly; + static auto AdditionalPlaylistLevelsStreamedOffset = this->GetOffset("AdditionalPlaylistLevelsStreamed", false); - AdditionalPlaylistLevelsStreamed.AddPtr(NewLevelStreamed, FAdditionalLevelStreamed::GetStructSize()); - } */ + if (!FAdditionalLevelStreamed::GetStruct()) + { + auto& AdditionalPlaylistLevelsStreamed = this->Get>(AdditionalPlaylistLevelsStreamedOffset); + AdditionalPlaylistLevelsStreamed.Add(Name); + } + else + { + auto& AdditionalPlaylistLevelsStreamed = this->Get>(AdditionalPlaylistLevelsStreamedOffset); + auto NewLevelStreamed = Alloc(FAdditionalLevelStreamed::GetStructSize()); + NewLevelStreamed->GetLevelName() = Name; + NewLevelStreamed->IsServerOnly() = bServerOnly; + + AdditionalPlaylistLevelsStreamed.AddPtr(NewLevelStreamed, FAdditionalLevelStreamed::GetStructSize()); + } + } } UClass* AFortGameStateAthena::StaticClass() diff --git a/Project Reboot 3.0/FortKismetLibrary.cpp b/Project Reboot 3.0/FortKismetLibrary.cpp index 8a1bcad..1ad41f8 100644 --- a/Project Reboot 3.0/FortKismetLibrary.cpp +++ b/Project Reboot 3.0/FortKismetLibrary.cpp @@ -508,7 +508,7 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook(UObject* Con LOG_INFO(LogDev, __FUNCTION__); - PickupCreateData CreateData; + PickupCreateData CreateData{}; CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1); CreateData.Source = Source; CreateData.SourceType = SourceType; @@ -516,6 +516,7 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook(UObject* Con CreateData.bToss = bToss; CreateData.bRandomRotation = bRandomRotation; CreateData.bShouldFreeItemEntryWhenDeconstructed = true; + CreateData.PawnOwner = OptionalOwnerPC ? OptionalOwnerPC->GetMyFortPawn() : nullptr; auto NewPickup = AFortPickup::SpawnPickup(CreateData); @@ -590,13 +591,14 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldHook(UObject* Context, FFr auto Pawn = OptionalOwnerPC ? OptionalOwnerPC->GetMyFortPawn() : nullptr; - PickupCreateData CreateData; + PickupCreateData CreateData{}; CreateData.ItemEntry = FFortItemEntry::MakeItemEntry(ItemDefinition, NumberToSpawn, -1); CreateData.SpawnLocation = Position; CreateData.bToss = bToss; CreateData.bRandomRotation = bRandomRotation; CreateData.PawnOwner = Pawn; CreateData.bShouldFreeItemEntryWhenDeconstructed = true; + CreateData.PawnOwner = OptionalOwnerPC ? OptionalOwnerPC->GetMyFortPawn() : nullptr; auto NewPickup = AFortPickup::SpawnPickup(CreateData); diff --git a/Project Reboot 3.0/FortPawn.cpp b/Project Reboot 3.0/FortPawn.cpp index 7e04174..53a1793 100644 --- a/Project Reboot 3.0/FortPawn.cpp +++ b/Project Reboot 3.0/FortPawn.cpp @@ -33,16 +33,38 @@ AFortWeapon* AFortPawn::EquipWeaponDefinition(UFortWeaponItemDefinition* WeaponD bool AFortPawn::PickUpActor(AActor* PickupTarget, UFortDecoItemDefinition* PlacementDecoItemDefinition) { - static auto fn = FindObject("/Script/FortniteGame.FortPawn.PickUpActor"); + static auto fn = FindObject(L"/Script/FortniteGame.FortPawn.PickUpActor"); struct { AActor* PickupTarget; UFortDecoItemDefinition* PlacementDecoItemDefinition; bool ReturnValue; } AFortPawn_PickUpActor_Params{ PickupTarget, PlacementDecoItemDefinition }; this->ProcessEvent(fn, &AFortPawn_PickUpActor_Params); return AFortPawn_PickUpActor_Params.ReturnValue; } +float AFortPawn::GetShield() +{ + float Shield = 0; + static auto GetShieldFn = FindObject(L"/Script/FortniteGame.FortPawn.GetShield"); + + if (GetShieldFn) + this->ProcessEvent(GetShieldFn, &Shield); + + return Shield; +} + +float AFortPawn::GetHealth() +{ + float Health = 0; + static auto GetHealthFn = FindObject(L"/Script/FortniteGame.FortPawn.GetHealth"); + + if (GetHealthFn) + this->ProcessEvent(GetHealthFn, &Health); + + return Health; +} + void AFortPawn::SetHealth(float NewHealth) { - static auto SetHealthFn = FindObject("/Script/FortniteGame.FortPawn.SetHealth"); + static auto SetHealthFn = FindObject(L"/Script/FortniteGame.FortPawn.SetHealth"); if (SetHealthFn) this->ProcessEvent(SetHealthFn, &NewHealth); @@ -50,7 +72,7 @@ void AFortPawn::SetHealth(float NewHealth) void AFortPawn::SetMaxHealth(float NewHealthVal) { - static auto SetMaxHealthFn = FindObject("/Script/FortniteGame.FortPawn.SetMaxHealth"); + static auto SetMaxHealthFn = FindObject(L"/Script/FortniteGame.FortPawn.SetMaxHealth"); if (!SetMaxHealthFn) return; diff --git a/Project Reboot 3.0/FortPawn.h b/Project Reboot 3.0/FortPawn.h index ee6c647..b995ea5 100644 --- a/Project Reboot 3.0/FortPawn.h +++ b/Project Reboot 3.0/FortPawn.h @@ -27,6 +27,8 @@ public: return ReadBitfieldValue(bIsDBNOOffset, bIsDBNOFieldMask); } + float GetShield(); + float GetHealth(); void SetHealth(float NewHealth); void SetMaxHealth(float NewHealthVal); void SetShield(float NewShield); diff --git a/Project Reboot 3.0/FortPickup.cpp b/Project Reboot 3.0/FortPickup.cpp index 01a5e0f..f5013b5 100644 --- a/Project Reboot 3.0/FortPickup.cpp +++ b/Project Reboot 3.0/FortPickup.cpp @@ -32,9 +32,9 @@ void AFortPickup::SpawnMovementComponent() AFortPickup* AFortPickup::SpawnPickup(PickupCreateData& PickupData) { if (PickupData.Source == -1) - PickupData.Source = -1; + PickupData.Source = 0; if (PickupData.SourceType == -1) - PickupData.SourceType = -1; + PickupData.SourceType = 0; /* if (PickupData.bToss) { @@ -42,7 +42,7 @@ AFortPickup* AFortPickup::SpawnPickup(PickupCreateData& PickupData) } */ static auto FortPickupAthenaClass = FindObject(L"/Script/FortniteGame.FortPickupAthena"); - auto PlayerState = PickupData.PawnOwner ? Cast(PickupData.PawnOwner->GetPlayerState()) : nullptr; + auto PlayerState = PickupData.PawnOwner->IsValidLowLevel() ? Cast(PickupData.PawnOwner->GetPlayerState()) : nullptr; FActorSpawnParameters SpawnParameters{}; // SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn; diff --git a/Project Reboot 3.0/FortPlayerController.cpp b/Project Reboot 3.0/FortPlayerController.cpp index ad9db5d..bf0b069 100644 --- a/Project Reboot 3.0/FortPlayerController.cpp +++ b/Project Reboot 3.0/FortPlayerController.cpp @@ -1229,6 +1229,8 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo DeathCause = ToDeathCause(Tags, false, DeadPawn); // DeadPawn->IsDBNO() ?? LOG_INFO(LogDev, "DeathCause: {}", (int)DeathCause); + LOG_INFO(LogDev, "DeadPawn->IsDBNO(): {}", DeadPawn->IsDBNO()); + LOG_INFO(LogDev, "KillerPlayerState: {}", __int64(KillerPlayerState)); *(bool*)(__int64(DeathInfo) + MemberOffsets::DeathInfo::bDBNO) = DeadPawn->IsDBNO(); *(uint8*)(__int64(DeathInfo) + MemberOffsets::DeathInfo::DeathCause) = DeathCause; @@ -1295,11 +1297,37 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo // LOG_INFO(LogDev, "Reported kill."); - /* if (KillerPawn && KillerPawn != DeadPawn) + if (AmountOfHealthSiphon != 0) { - KillerPawn->SetHealth(100); - KillerPawn->SetShield(100); - } */ + if (KillerPawn && KillerPawn != DeadPawn) + { + float Health = KillerPawn->GetHealth(); + float Shield = KillerPawn->GetShield(); + + int MaxHealth = 100; + int MaxShield = 100; + int AmountGiven = 0; + + if ((MaxHealth - Health) > 0) + { + int AmountToGive = MaxHealth - Health >= AmountOfHealthSiphon ? AmountOfHealthSiphon : MaxHealth - Health; + KillerPawn->SetHealth(Health + AmountToGive); + AmountGiven += AmountToGive; + } + + if ((MaxShield - Shield) > 0 && AmountGiven < AmountOfHealthSiphon) + { + int AmountToGive = MaxShield - Shield >= AmountOfHealthSiphon ? AmountOfHealthSiphon : MaxShield - Shield; + AmountToGive -= AmountGiven; + + if (AmountToGive > 0) + { + KillerPawn->SetShield(Shield + AmountToGive); + AmountGiven += AmountToGive; + } + } + } + } } bool bIsRespawningAllowed = GameState->IsRespawningAllowed(DeadPlayerState); diff --git a/Project Reboot 3.0/FortPlayerControllerAthena.h b/Project Reboot 3.0/FortPlayerControllerAthena.h index 9c587e1..442f3e9 100644 --- a/Project Reboot 3.0/FortPlayerControllerAthena.h +++ b/Project Reboot 3.0/FortPlayerControllerAthena.h @@ -185,7 +185,7 @@ public: void RespawnPlayerAfterDeath(bool bEnterSkydiving) { - static auto RespawnPlayerAfterDeathFn = FindObject("/Script/FortniteGame.FortPlayerControllerAthena.RespawnPlayerAfterDeath"); + static auto RespawnPlayerAfterDeathFn = FindObject(L"/Script/FortniteGame.FortPlayerControllerAthena.RespawnPlayerAfterDeath"); if (RespawnPlayerAfterDeathFn) { @@ -193,10 +193,16 @@ public: } else { - // techinally we can remake this as all it really does on older versions is clear deathinfo + // techinally we can remake this as all it really does on older versions is clear deathinfo (I think?) } } + bool& IsMarkedAlive() + { + static auto bMarkedAliveOffset = GetOffset("bMarkedAlive"); + return Get(bMarkedAliveOffset); + } + static void StartGhostModeHook(UObject* Context, FFrame* Stack, void* Ret); // we could native hook this but eh static void EndGhostModeHook(AFortPlayerControllerAthena* PlayerController); static void EnterAircraftHook(UObject* PC, AActor* Aircraft); diff --git a/Project Reboot 3.0/FortPlayerPawn.cpp b/Project Reboot 3.0/FortPlayerPawn.cpp index a3e42a8..ac86b14 100644 --- a/Project Reboot 3.0/FortPlayerPawn.cpp +++ b/Project Reboot 3.0/FortPlayerPawn.cpp @@ -17,6 +17,11 @@ FFortAthenaLoadout* AFortPlayerPawn::GetCosmeticLoadout() return GetPtr(CosmeticLoadoutOffset); } +void AFortPlayerPawn::ServerReviveFromDBNOHook(AController* EventInstigator) +{ + LOG_INFO(LogDev, "ServerReviveFromDBNOHook!"); +} + void AFortPlayerPawn::ServerHandlePickupWithRequestedSwapHook(UObject* Context, FFrame* Stack, void* Ret) { auto Pawn = (AFortPlayerPawn*)Context; diff --git a/Project Reboot 3.0/FortPlayerPawn.h b/Project Reboot 3.0/FortPlayerPawn.h index 5346c4c..0ea9331 100644 --- a/Project Reboot 3.0/FortPlayerPawn.h +++ b/Project Reboot 3.0/FortPlayerPawn.h @@ -44,6 +44,7 @@ public: UFortWeaponItemDefinition* GetVehicleWeaponDefinition(AFortAthenaVehicle* Vehicle); void UnEquipVehicleWeaponDefinition(UFortWeaponItemDefinition* VehicleWeaponDefinition); + static void ServerReviveFromDBNOHook(AController* EventInstigator); static void ServerHandlePickupWithRequestedSwapHook(UObject* Context, FFrame* Stack, void* Ret); // we could native hook this but idk static void StartGhostModeExitHook(UObject* Context, FFrame* Stack, void* Ret); // we could native hook this but eh static AActor* ServerOnExitVehicleHook(AFortPlayerPawn* Pawn, ETryExitVehicleBehavior ExitForceBehavior); // actually returns AFortAthenaVehicle diff --git a/Project Reboot 3.0/FortPlayerStateAthena.h b/Project Reboot 3.0/FortPlayerStateAthena.h index 04ad044..38189bb 100644 --- a/Project Reboot 3.0/FortPlayerStateAthena.h +++ b/Project Reboot 3.0/FortPlayerStateAthena.h @@ -32,6 +32,23 @@ struct FFortRespawnData } }; +struct FDeathInfo +{ + static UStruct* GetStruct() + { + static auto Struct = FindObject("/Script/FortniteGame.DeathInfo"); + return Struct; + } + + static int GetStructSize() { return GetStruct()->GetPropertiesSize(); } + + bool& IsDBNO() + { + static auto bDBNOOffset = FindOffsetStruct("/Script/FortniteGame.DeathInfo", "bDBNO"); + return *(bool*)(__int64(this) + bDBNOOffset); + } +}; + class AFortPlayerStateAthena : public AFortPlayerState { public: @@ -87,15 +104,30 @@ public: void ClientReportKill(AFortPlayerStateAthena* Player) { - static auto ClientReportKillFn = FindObject("/Script/FortniteGame.FortPlayerStateAthena.ClientReportKill"); + static auto ClientReportKillFn = FindObject(L"/Script/FortniteGame.FortPlayerStateAthena.ClientReportKill"); this->ProcessEvent(ClientReportKillFn, &Player); } + + void OnRep_DeathInfo() + { + static auto OnRep_DeathInfoFn = FindObject(L"/Script/FortniteGame.FortPlayerStateAthena.OnRep_DeathInfo"); + + if (OnRep_DeathInfoFn) // needed? + { + this->ProcessEvent(OnRep_DeathInfoFn); + } + } + + FDeathInfo* GetDeathInfo() + { + return GetPtr(MemberOffsets::FortPlayerStateAthena::DeathInfo); + } static void ServerSetInAircraftHook(UObject* Context, FFrame& Stack, void* Ret); static UClass* StaticClass() { - static auto Class = FindObject("/Script/FortniteGame.FortPlayerStateAthena"); + static auto Class = FindObject(L"/Script/FortniteGame.FortPlayerStateAthena"); return Class; } }; \ No newline at end of file diff --git a/Project Reboot 3.0/Vector.h b/Project Reboot 3.0/Vector.h index f00e925..563b86a 100644 --- a/Project Reboot 3.0/Vector.h +++ b/Project Reboot 3.0/Vector.h @@ -7,6 +7,11 @@ public: float Y; float Z; + bool CompareVectors(const FVector& A) + { + return X == A.X && Y == A.Y && Z == A.Z; + } + FVector() : X(0), Y(0), Z(0) {} FVector(float x, float y, float z) : X(x), Y(y), Z(z) {} @@ -35,10 +40,10 @@ public: return FVector{ this->X * A, this->Y * A, this->Z * A }; } - bool operator==(const FVector& A) + /* bool operator==(const FVector& A) { return X == A.X && Y == A.Y && Z == A.Z; - } + } */ void operator+=(const FVector& A) { diff --git a/Project Reboot 3.0/ai.h b/Project Reboot 3.0/ai.h index 891e675..8e6a3db 100644 --- a/Project Reboot 3.0/ai.h +++ b/Project Reboot 3.0/ai.h @@ -134,6 +134,8 @@ static void SetupServerBotManager() static void SetupAIGoalManager() { + // Playlist->AISettings->bAllowAIGoalManager + // There is some virtual function in the gamemode that calls a spawner for this, it gets the class from GameData, not sure why this doesn't work automatically or if we should even spawn this. auto GameMode = Cast(GetWorld()->GetGameMode()); @@ -154,6 +156,8 @@ static void SetupAIGoalManager() static void SetupAIDirector() { + // Playlist->AISettings->bAllowAIDirector + auto GameState = Cast(GetWorld()->GetGameState()); auto GameMode = Cast(GetWorld()->GetGameMode()); diff --git a/Project Reboot 3.0/commands.h b/Project Reboot 3.0/commands.h index 072b6d4..429eb9c 100644 --- a/Project Reboot 3.0/commands.h +++ b/Project Reboot 3.0/commands.h @@ -723,8 +723,8 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg) auto GameState = Cast(GetWorld()->GetGameState()); auto GameMode = Cast(GetWorld()->GetGameMode()); - // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr); - GameMode->PauseSafeZone(GameState->IsSafeZonePaused() == 0); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"pausesafezone", nullptr); + // GameMode->PauseSafeZone(GameState->IsSafeZonePaused() == 0); } else if (Command == "teleport") { diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index 21c2c4a..3e89c7d 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -311,6 +311,8 @@ DWORD WINAPI Main(LPVOID) // UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogNavigation VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortMission VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAIGoalSelection VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortWorld VeryVerbose", nullptr); + UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortPlayerRegistration VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogBuilding VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAI VeryVerbose", nullptr); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"log LogFortAIDirector VeryVerbose", nullptr); @@ -400,13 +402,22 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3DECF40), (PVOID)ReturnFalseHook, nullptr); // 7FF7E556CF40 Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3DE5CE8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF7E5565CE8 } + else if (Fortnite_Version == 17.50) // Sky fire stuff + { + // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)GetMeshNetworkNodeTypeHook, nullptr); + Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3E54BCC), (PVOID)ReturnTrueHook, nullptr); // 7FF638A04BCC + 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 + } else if (Fortnite_Version == 18.40) { // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)GetMeshNetworkNodeTypeHook, nullptr); Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416AAB8), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EAAB8 Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416A840), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EA840 Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x416A93C), (PVOID)ReturnTrueHook, nullptr); // 7FF79E3EA93C - // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)ReturnFalseHook, nullptr); // 7FF7E556CF40 + // Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + ), (PVOID)ReturnFalseHook, nullptr); Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x41624C8), (PVOID)ActivatePhaseAtIndexHook, (PVOID*)&ActivatePhaseAtIndexOriginal); // 7FF79E3E24C8 } @@ -520,7 +531,7 @@ DWORD WINAPI Main(LPVOID) if (Fortnite_Version != 22.4) { - auto matchmaking = Memcury::Scanner::FindPattern("83 BD ? ? ? ? 01 7F 18 49 8D 4D D8 48 8B D6 E8 ? ? ? ? 48").Get(); + auto matchmaking = Memcury::Scanner::FindPattern("83 BD ? ? ? ? 01 7F 18 49 8D 4D D8 48 8B D6 E8 ? ? ? ? 48", false).Get(); matchmaking = matchmaking ? matchmaking : Memcury::Scanner::FindPattern("83 7D 88 01 7F 0D 48 8B CE E8").Get(); @@ -997,6 +1008,12 @@ DWORD WINAPI Main(LPVOID) static auto GameplayEventDataSize = FindObject(L"/Script/GameplayAbilities.GameplayEventData")->GetPropertiesSize(); LOG_INFO(LogDev, "GameplayEventDataSize: 0x{:x} {}", GameplayEventDataSize, GameplayEventDataSize); + if (Fortnite_Version == 1.11 || Fortnite_Version > 1.8) + { + Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerPawn.ServerReviveFromDBNO"), + AFortPlayerPawn::ServerReviveFromDBNOHook, nullptr, false); + } + { int increaseOffset = 0x10; diff --git a/Project Reboot 3.0/events.h b/Project Reboot 3.0/events.h index 1295a88..0e3716e 100644 --- a/Project Reboot 3.0/events.h +++ b/Project Reboot 3.0/events.h @@ -396,6 +396,32 @@ static inline std::vector Events = 17.30 ), Event + ( + "Operation: Sky Fire", + "", + "", + 0, + { + + }, + { + { + { + false, + // "/Buffet/Gameplay/Blueprints/BP_Buffet_Master_Scripting.BP_Buffet_Master_Scripting_C.startevent" + "/Script/SpecialEventGameplayRuntime.SpecialEventScript.StartEventAtIndex" + }, + + 0 + } + }, + + "/Kiwi/Gameplay/Kiwi_EventScript.Kiwi_EventScript_C", + // "/Buffet/Gameplay/Blueprints/BP_Buffet_Master_Scripting.BP_Buffet_Master_Scripting_C", + "/KiwiPlaylist/Playlists/Playlist_Kiwi.Playlist_Kiwi", + 17.50 + ), + Event ( "Ice King Event", "/Game/Athena/Prototype/Blueprints/Mooney/BP_MooneyLoader.BP_MooneyLoader_C", diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 22e760a..b580ef1 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -439,7 +439,7 @@ static inline uint64 FindOnRep_ZiplineState() return 0; } -static inline uint64 FindGetMaxTickRate() // Uengine::getmaxtickrate +static inline uint64 FindGetMaxTickRate() // UEngine::getmaxtickrate { // TODO switch to index maybe? @@ -455,6 +455,9 @@ static inline uint64 FindGetMaxTickRate() // Uengine::getmaxtickrate if (Engine_Version == 500) return Memcury::Scanner::FindPattern("40 53 48 83 EC 50 0F 29 74 24 ? 48 8B D9 0F 29 7C 24 ? 0F 28 F9 44 0F 29").Get(); // the string is in func + it's in function chunks. + if (Engine_Version == 427) + return Memcury::Scanner::FindPattern("40 53 48 83 EC 60 0F 29 74 24 ? 48 8B D9 0F 29 7C 24 ? 0F 28").Get(); // function chunks woo! + auto Addrr = Memcury::Scanner::FindStringRef(L"Hitching by request!").Get(); if (!Addrr) @@ -1129,8 +1132,12 @@ static inline uint64 FindActorGetNetMode() if (Engine_Version == 427) { - // note this sig doesnt work on s18 - return Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 48 83 EC 20 48 8B D9 E8 ? ? ? ? 48 8B 93 ? ? ? ? 48 8B C8 48 8B F8 E8 ? ? ? ? 48 85 C0 75 29").Get(); + auto addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 48 83 EC 20 48 8B D9 E8 ? ? ? ? 48 8B 93 ? ? ? ? 48 8B C8 48 8B F8 E8 ? ? ? ? 48 85 C0 75 29", false).Get(); + + if (!addr) + addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 48 83 EC 20 F6 41 08 10 48 8B D9 0F 85 ? ? ? ? 48 8B 41 20 48 85 C0 0F 84").Get(); // 17.50 & 18.40 + + return addr; } auto AActorGetNetmodeStrRef = Memcury::Scanner::FindStringRef(L"STAT_ServerUpdateCamera", false); diff --git a/Project Reboot 3.0/globals.h b/Project Reboot 3.0/globals.h index 71894c9..0b38a5e 100644 --- a/Project Reboot 3.0/globals.h +++ b/Project Reboot 3.0/globals.h @@ -35,4 +35,5 @@ extern inline std::string PlaylistName = // "/Game/Athena/Playlists/Low/Playlist_Low_Solo.Playlist_Low_Solo"; // "/Game/Athena/Playlists/Bling/Playlist_Bling_Solo.Playlist_Bling_Solo"; // "/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2"; -// "/Game/Athena/Playlists/Ashton/Playlist_Ashton_Sm.Playlist_Ashton_Sm"; \ No newline at end of file +// "/Game/Athena/Playlists/Ashton/Playlist_Ashton_Sm.Playlist_Ashton_Sm"; +// "/Game/Athena/Playlists/BattleLab/Playlist_BattleLab.Playlist_BattleLab"; \ No newline at end of file diff --git a/Project Reboot 3.0/gui.h b/Project Reboot 3.0/gui.h index dc225a1..ac92a48 100644 --- a/Project Reboot 3.0/gui.h +++ b/Project Reboot 3.0/gui.h @@ -71,6 +71,7 @@ extern inline bool bEnableCombinePickup = false; extern inline int AmountOfBotsToSpawn = 0; extern inline bool bEnableRebooting = false; extern inline bool bEngineDebugLogs = false; +extern inline int AmountOfHealthSiphon = 0; // THE BASE CODE IS FROM IMGUI GITHUB @@ -277,13 +278,18 @@ static inline void StaticUI() { // ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart); - if (Globals::bAutoRestart) + if (false) { - ImGui::InputFloat(std::format("How long after {} players join the bus will start", NumRequiredPlayersToStart).c_str(), &AutoBusStartSeconds); - ImGui::InputInt("How many players required to join for bus auto timer to start", &NumRequiredPlayersToStart); + if (Globals::bAutoRestart) + { + ImGui::InputFloat(std::format("How long after {} players join the bus will start", NumRequiredPlayersToStart).c_str(), &AutoBusStartSeconds); + ImGui::InputInt("Num Players required for bus auto timer", &NumRequiredPlayersToStart); + } } } + ImGui::InputInt("Shield/Health for siphon", &AmountOfHealthSiphon); + #ifndef PROD ImGui::Checkbox("Log ProcessEvent", &Globals::bLogProcessEvent); // ImGui::InputInt("Amount of bots to spawn", &AmountOfBotsToSpawn);