diff --git a/Project Reboot 3.0/Actor.cpp b/Project Reboot 3.0/Actor.cpp index f84ac25..5af071f 100644 --- a/Project Reboot 3.0/Actor.cpp +++ b/Project Reboot 3.0/Actor.cpp @@ -124,13 +124,13 @@ FRotator AActor::GetActorRotation() void AActor::FlushNetDormancy() { - static auto fn = FindObject("/Script/Engine.Actor.FlushNetDormancy"); + static auto fn = FindObject(L"/Script/Engine.Actor.FlushNetDormancy"); this->ProcessEvent(fn); } bool AActor::TeleportTo(const FVector& DestLocation, const FRotator& DestRotation) { - static auto fn = FindObject("/Script/Engine.Actor.K2_TeleportTo"); + static auto fn = FindObject(L"/Script/Engine.Actor.K2_TeleportTo"); struct { struct FVector DestLocation; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) @@ -157,13 +157,13 @@ bool AActor::IsNetStartup() void AActor::SetOwner(AActor* Owner) { - static auto SetOwnerFn = FindObject("/Script/Engine.Actor.SetOwner"); + static auto SetOwnerFn = FindObject(L"/Script/Engine.Actor.SetOwner"); this->ProcessEvent(SetOwnerFn, &Owner); } void AActor::ForceNetUpdate() { - static auto ForceNetUpdateFn = FindObject("/Script/Engine.Actor.ForceNetUpdate"); + static auto ForceNetUpdateFn = FindObject(L"/Script/Engine.Actor.ForceNetUpdate"); this->ProcessEvent(ForceNetUpdateFn); } @@ -198,7 +198,7 @@ const AActor* AActor::GetNetOwner() const void AActor::GetActorEyesViewPoint(FVector* OutLocation, FRotator* OutRotation) const { - static auto GetActorEyesViewPointFn = FindObject("/Script/Engine.Actor.GetActorEyesViewPoint"); + static auto GetActorEyesViewPointFn = FindObject(L"/Script/Engine.Actor.GetActorEyesViewPoint"); struct { struct FVector OutLocation; // (Parm, OutParm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic) diff --git a/Project Reboot 3.0/FortGameModeAthena.cpp b/Project Reboot 3.0/FortGameModeAthena.cpp index 8c91e0a..be40847 100644 --- a/Project Reboot 3.0/FortGameModeAthena.cpp +++ b/Project Reboot 3.0/FortGameModeAthena.cpp @@ -553,6 +553,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game // return false; + LoopMutators([&](AFortAthenaMutator* Mutator) { LOG_INFO(LogGame, "Mutator {}", Mutator->GetPathName()); }); + Globals::AmountOfListens++; Globals::bStartedListening = true; } diff --git a/Project Reboot 3.0/FortGameModeAthena.h b/Project Reboot 3.0/FortGameModeAthena.h index fd5e7e1..20fb8fc 100644 --- a/Project Reboot 3.0/FortGameModeAthena.h +++ b/Project Reboot 3.0/FortGameModeAthena.h @@ -145,7 +145,7 @@ static void ShowFoundation(AActor* BuildingFoundation, bool bShow = true) if (FoundationEnabledStateOffset != -1) BuildingFoundation->Get(FoundationEnabledStateOffset) = bShow ? Enabled : Disabled; - SetFoundationTransform(BuildingFoundation, BuildingFoundation->GetTransform()); // idk + // SetFoundationTransform(BuildingFoundation, BuildingFoundation->GetTransform()); // idk static auto LevelToStreamOffset = BuildingFoundation->GetOffset("LevelToStream"); auto& LevelToStream = BuildingFoundation->Get(LevelToStreamOffset); diff --git a/Project Reboot 3.0/FortItem.h b/Project Reboot 3.0/FortItem.h index c43c0bd..2a15073 100644 --- a/Project Reboot 3.0/FortItem.h +++ b/Project Reboot 3.0/FortItem.h @@ -140,6 +140,7 @@ struct FFortItemEntry : FFastArraySerializerItem Entry->GetItemDefinition() = ItemDefinition; Entry->GetCount() = Count; Entry->GetLoadedAmmo() = LoadedAmmo; + // Entry->bUpdateStatsOnCollection = true; // Idk what this does but fortnite does it soo return Entry; } diff --git a/Project Reboot 3.0/FortItemDefinition.cpp b/Project Reboot 3.0/FortItemDefinition.cpp index 08c8a79..f890d70 100644 --- a/Project Reboot 3.0/FortItemDefinition.cpp +++ b/Project Reboot 3.0/FortItemDefinition.cpp @@ -5,7 +5,7 @@ UFortItem* UFortItemDefinition::CreateTemporaryItemInstanceBP(int Count, int Level) { static auto CreateTemporaryItemInstanceBPFunction = FindObject(L"/Script/FortniteGame.FortItemDefinition.CreateTemporaryItemInstanceBP"); - struct { int Count; int Level; UFortItem* ReturnValue; } CreateTemporaryItemInstanceBP_Params{ Count, 1 }; + struct { int Count; int Level; UFortItem* ReturnValue; } CreateTemporaryItemInstanceBP_Params{ Count, Level }; ProcessEvent(CreateTemporaryItemInstanceBPFunction, &CreateTemporaryItemInstanceBP_Params); diff --git a/Project Reboot 3.0/FortItemDefinition.h b/Project Reboot 3.0/FortItemDefinition.h index dca69ac..790cbff 100644 --- a/Project Reboot 3.0/FortItemDefinition.h +++ b/Project Reboot 3.0/FortItemDefinition.h @@ -9,7 +9,7 @@ class UFortItemDefinition : public UObject { public: - UFortItem* CreateTemporaryItemInstanceBP(int Count, int Level = 1); + UFortItem* CreateTemporaryItemInstanceBP(int Count, int Level = 1); // Should Level be 20? float GetMaxStackSize(); bool DoesAllowMultipleStacks() diff --git a/Project Reboot 3.0/FortPickup.cpp b/Project Reboot 3.0/FortPickup.cpp index 755c9f6..8de700e 100644 --- a/Project Reboot 3.0/FortPickup.cpp +++ b/Project Reboot 3.0/FortPickup.cpp @@ -7,6 +7,7 @@ #include "FortGameModePickup.h" #include "FortPlayerController.h" #include +#include "GameplayStatics.h" void AFortPickup::TossPickup(FVector FinalLocation, AFortPawn* ItemOwner, int OverrideMaxStackCount, bool bToss, EFortPickupSourceTypeFlag InPickupSourceTypeFlags, EFortPickupSpawnSource InPickupSpawnSource) { @@ -19,10 +20,23 @@ void AFortPickup::TossPickup(FVector FinalLocation, AFortPawn* ItemOwner, int Ov this->ProcessEvent(fn, &AFortPickup_TossPickup_Params); } +void AFortPickup::SpawnMovementComponent() +{ + static auto ProjectileMovementComponentClass = FindObject("/Script/Engine.ProjectileMovementComponent"); // UFortProjectileMovementComponent + + static auto MovementComponentOffset = this->GetOffset("MovementComponent"); + this->Get(MovementComponentOffset) = UGameplayStatics::SpawnObject(ProjectileMovementComponentClass, this); +} + AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Location, EFortPickupSourceTypeFlag PickupSource, EFortPickupSpawnSource SpawnSource, class AFortPawn* Pawn, UClass* OverrideClass, bool bToss, int OverrideCount) { + if (bToss) + { + PickupSource |= EFortPickupSourceTypeFlag::Tossed; + } + // static auto FortPickupClass = FindObject(L"/Script/FortniteGame.FortPickup"); static auto FortPickupAthenaClass = FindObject(L"/Script/FortniteGame.FortPickupAthena"); auto PlayerState = Pawn ? Cast(Pawn->GetPlayerState()) : nullptr; @@ -39,11 +53,12 @@ AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Locatio if (Addresses::PickupInitialize) { - static void (*SetupPickup)(AFortPickup * Pickup, __int64 ItemEntry, TArray<__int64> MultiItemPickupEntriesIGuess, bool bSplitOnPickup) + static void (*SetupPickup)(AFortPickup* Pickup, __int64 ItemEntry, TArray<__int64> MultiItemPickupEntriesIGuess, bool bSplitOnPickup) = decltype(SetupPickup)(Addresses::PickupInitialize); TArray<__int64> MultiItemPickupEntriesIGuess{}; SetupPickup(Pickup, __int64(ItemEntry), MultiItemPickupEntriesIGuess, false); + MultiItemPickupEntriesIGuess.Free(); } else { @@ -59,6 +74,11 @@ AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Locatio PrimaryPickupItemEntry->GetLoadedAmmo() = ItemEntry->GetLoadedAmmo(); } } + + static auto PickupSourceTypeFlagsOffset = Pickup->GetOffset("PickupSourceTypeFlags", false); + + if (PickupSourceTypeFlagsOffset != -1) + Pickup->Get(PickupSourceTypeFlagsOffset) |= (int)PickupSource; PrimaryPickupItemEntry->GetCount() = OverrideCount == -1 ? ItemEntry->GetCount() : OverrideCount; @@ -69,11 +89,6 @@ AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Locatio // static auto OptionalOwnerIDOffset = Pickup->GetOffset("OptionalOwnerID"); // Pickup->Get(OptionalOwnerIDOffset) = PlayerState ? PlayerState->GetWorldPlayerId() : -1; - if (bToss) - { - PickupSource |= EFortPickupSourceTypeFlag::Tossed; - } - Pickup->TossPickup(Location, Pawn, 0, bToss, PickupSource, SpawnSource); if (PickupSource == EFortPickupSourceTypeFlag::Container) // crashes if we do this then tosspickup @@ -83,6 +98,11 @@ AFortPickup* AFortPickup::SpawnPickup(FFortItemEntry* ItemEntry, FVector Locatio // Pickup->OnRep_TossedFromContainer(); } + if (Fortnite_Version < 6) + { + Pickup->SpawnMovementComponent(); + } + return Pickup; } diff --git a/Project Reboot 3.0/FortPickup.h b/Project Reboot 3.0/FortPickup.h index 983f8d7..cdf9ec1 100644 --- a/Project Reboot 3.0/FortPickup.h +++ b/Project Reboot 3.0/FortPickup.h @@ -68,6 +68,7 @@ public: static inline char (*CompletePickupAnimationOriginal)(AFortPickup* Pickup); void TossPickup(FVector FinalLocation, class AFortPawn* ItemOwner, int OverrideMaxStackCount, bool bToss, EFortPickupSourceTypeFlag InPickupSourceTypeFlags, EFortPickupSpawnSource InPickupSpawnSource); + void SpawnMovementComponent(); // BAD You probably don't wanna use unless absolutely necessary void OnRep_PrimaryPickupItemEntry() { diff --git a/Project Reboot 3.0/dllmain.cpp b/Project Reboot 3.0/dllmain.cpp index dbdaef4..756e129 100644 --- a/Project Reboot 3.0/dllmain.cpp +++ b/Project Reboot 3.0/dllmain.cpp @@ -440,8 +440,8 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerController.ServerDropAllItems"), AFortPlayerController::ServerDropAllItemsHook, nullptr, false); Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, - FindObject("/Script/FortniteGame.FortPlayerController.ServerSpawnInventoryDrop") - ? FindObject("/Script/FortniteGame.FortPlayerController.ServerSpawnInventoryDrop") : FindObject(L"/Script/FortniteGame.FortPlayerController.ServerAttemptInventoryDrop"), + FindObject(L"/Script/FortniteGame.FortPlayerController.ServerSpawnInventoryDrop") + ? FindObject(L"/Script/FortniteGame.FortPlayerController.ServerSpawnInventoryDrop") : FindObject(L"/Script/FortniteGame.FortPlayerController.ServerAttemptInventoryDrop"), AFortPlayerController::ServerAttemptInventoryDropHook, nullptr, false); Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerController.ServerCheat"), ServerCheatHook, nullptr, false); @@ -510,11 +510,11 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FortGameplayAbilityAthena_PeriodicItemGrantDefault, FindObject(L"/Script/FortniteGame.FortGameplayAbilityAthena_PeriodicItemGrant.StartItemAwardTimers"), UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersHook, (PVOID*)&UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersOriginal, false, true); - Hooking::MinHook::Hook(FindObject("/Script/FortniteGame.Default__FortAthenaMutator_Barrier"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_Barrier.OnGamePhaseStepChanged"), + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortAthenaMutator_Barrier"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_Barrier.OnGamePhaseStepChanged"), AFortAthenaMutator_Barrier::OnGamePhaseStepChangedHook, (PVOID*)&AFortAthenaMutator_Barrier::OnGamePhaseStepChangedOriginal, false, true); - Hooking::MinHook::Hook(FindObject("/Script/FortniteGame.Default__FortAthenaMutator_Disco"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_Disco.OnGamePhaseStepChanged"), + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortAthenaMutator_Disco"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_Disco.OnGamePhaseStepChanged"), AFortAthenaMutator_Disco::OnGamePhaseStepChangedHook, (PVOID*)&AFortAthenaMutator_Disco::OnGamePhaseStepChangedOriginal, false, true); - Hooking::MinHook::Hook(FindObject("/Script/FortniteGame.Default__FortAthenaMutator_GiveItemsAtGamePhaseStep"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_GiveItemsAtGamePhaseStep.OnGamePhaseStepChanged"), + Hooking::MinHook::Hook(FindObject(L"/Script/FortniteGame.Default__FortAthenaMutator_GiveItemsAtGamePhaseStep"), FindObject(L"/Script/FortniteGame.FortAthenaMutator_GiveItemsAtGamePhaseStep.OnGamePhaseStepChanged"), AFortAthenaMutator_GiveItemsAtGamePhaseStep::OnGamePhaseStepChangedHook, (PVOID*)&AFortAthenaMutator_GiveItemsAtGamePhaseStep::OnGamePhaseStepChangedOriginal, false, true); Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveItemToPlayer"), @@ -530,7 +530,7 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, NetMulticast_Athena_BatchedDamageCuesFn, AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook, (PVOID*)&AFortPawn::NetMulticast_Athena_BatchedDamageCuesOriginal, false, true); - Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject("/Script/FortniteGame.FortPawn.MovingEmoteStopped"), + Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPawn.MovingEmoteStopped"), AFortPawn::MovingEmoteStoppedHook, (PVOID*)&AFortPawn::MovingEmoteStoppedOriginal, false, true); Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") ? FindObject(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") : FindObject(L"/Script/FortniteGame.FortPlayerPawn.OnCapsuleBeginOverlap"), AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook, (PVOID*)&AFortPlayerPawnAthena::OnCapsuleBeginOverlapOriginal, false, true); @@ -603,7 +603,7 @@ DWORD WINAPI Main(LPVOID) Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItems"), UInventoryManagementLibrary::SwapItemsHook, (PVOID*)&UInventoryManagementLibrary::SwapItemsOriginal, false, true); - static auto ServerHandlePickupInfoFn = FindObject("/Script/FortniteGame.FortPlayerPawn.ServerHandlePickupInfo"); + static auto ServerHandlePickupInfoFn = FindObject(L"/Script/FortniteGame.FortPlayerPawn.ServerHandlePickupInfo"); if (ServerHandlePickupInfoFn) { @@ -615,7 +615,7 @@ DWORD WINAPI Main(LPVOID) AFortPlayerPawn::ServerHandlePickupHook, nullptr, false); } - static auto PredictionKeyStruct = FindObject("/Script/GameplayAbilities.PredictionKey"); + static auto PredictionKeyStruct = FindObject(L"/Script/GameplayAbilities.PredictionKey"); static auto PredictionKeySize = PredictionKeyStruct->GetPropertiesSize(); { @@ -623,7 +623,7 @@ DWORD WINAPI Main(LPVOID) if (Engine_Version > 420) { - static auto OnRep_ReplicatedAnimMontageFn = FindObject("/Script/GameplayAbilities.AbilitySystemComponent.OnRep_ReplicatedAnimMontage"); + static auto OnRep_ReplicatedAnimMontageFn = FindObject(L"/Script/GameplayAbilities.AbilitySystemComponent.OnRep_ReplicatedAnimMontage"); InternalServerTryActivateAbilityIndex = (GetFunctionIdxOrPtr(OnRep_ReplicatedAnimMontageFn) - 8) / 8; } else diff --git a/Project Reboot 3.0/finder.h b/Project Reboot 3.0/finder.h index 57ff5fc..b2d2349 100644 --- a/Project Reboot 3.0/finder.h +++ b/Project Reboot 3.0/finder.h @@ -722,7 +722,7 @@ static inline uint64 FindEnterAircraft() return Addr - i; } */ - if (*(uint8_t*)(uint8_t*)(Addr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addr - i + 2) == 0x5C && *(uint8_t*)(uint8_t*)(Addr - i + 3) == 0x74) // 4.1 + if (*(uint8_t*)(uint8_t*)(Addr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addr - i + 2) == 0x74) // 4.1 { return Addr - i; } diff --git a/Project Reboot 3.0/log.h b/Project Reboot 3.0/log.h index 7bf488c..1805dcf 100644 --- a/Project Reboot 3.0/log.h +++ b/Project Reboot 3.0/log.h @@ -79,6 +79,7 @@ inline void InitLogger() MakeLogger("LogCreative"); MakeLogger("LogZone"); MakeLogger("LogReplication"); + MakeLogger("LogMutator"); MakeLogger("LogVehicles"); }