fix some levels not streaming in, add unvaulting & showdown event (unvaulting levels after event don't really work), fixed some crashes.
This commit is contained in:
Milxnor
2023-04-21 10:59:04 -04:00
parent 5b930c7328
commit 4ad4e9cf14
20 changed files with 566 additions and 300 deletions

View File

@@ -85,6 +85,16 @@ float AActor::GetDistanceTo(AActor* OtherActor)
return AActor_GetDistanceTo_Params.ReturnValue; return AActor_GetDistanceTo_Params.ReturnValue;
} }
FVector AActor::GetActorScale3D()
{
static auto GetActorScale3DFn = FindObject<UFunction>("/Script/Engine.Actor.GetActorScale3D");
FVector Scale3D;
this->ProcessEvent(GetActorScale3DFn, &Scale3D);
return Scale3D;
}
FVector AActor::GetActorLocation() FVector AActor::GetActorLocation()
{ {
static auto K2_GetActorLocationFn = FindObject<UFunction>("/Script/Engine.Actor.K2_GetActorLocation"); static auto K2_GetActorLocationFn = FindObject<UFunction>("/Script/Engine.Actor.K2_GetActorLocation");

View File

@@ -25,6 +25,7 @@ public:
int32& GetNetTag(); int32& GetNetTag();
void SetNetDormancy(ENetDormancy Dormancy); void SetNetDormancy(ENetDormancy Dormancy);
AActor* GetOwner(); AActor* GetOwner();
struct FVector GetActorScale3D();
struct FVector GetActorLocation(); struct FVector GetActorLocation();
struct FVector GetActorRightVector(); struct FVector GetActorRightVector();
void K2_DestroyActor(); void K2_DestroyActor();

View File

@@ -14,7 +14,7 @@ void SpawnBGAs()
auto AllBGAConsumableSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BGAConsumableSpawnerClass); auto AllBGAConsumableSpawners = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BGAConsumableSpawnerClass);
LOG_INFO(LogDev, "AllBGAConsumableSpawners.Num(): ", (int)AllBGAConsumableSpawners.Num()); LOG_INFO(LogDev, "AllBGAConsumableSpawners.Num(): {}", (int)AllBGAConsumableSpawners.Num());
for (int i = 0; i < AllBGAConsumableSpawners.Num(); i++) for (int i = 0; i < AllBGAConsumableSpawners.Num(); i++)
{ {
@@ -25,7 +25,7 @@ void SpawnBGAs()
static auto SpawnLootTierGroupOffset = BGAConsumableSpawner->GetOffset("SpawnLootTierGroup"); static auto SpawnLootTierGroupOffset = BGAConsumableSpawner->GetOffset("SpawnLootTierGroup");
auto& SpawnLootTierGroup = BGAConsumableSpawner->Get<FName>(SpawnLootTierGroupOffset); auto& SpawnLootTierGroup = BGAConsumableSpawner->Get<FName>(SpawnLootTierGroupOffset);
auto LootDrops = PickLootDrops(SpawnLootTierGroup, true); auto LootDrops = PickLootDrops(SpawnLootTierGroup, false);
for (auto& LootDrop : LootDrops) for (auto& LootDrop : LootDrops)
{ {

View File

@@ -0,0 +1,21 @@
#include "BuildingFoundation.h"
#include "FortGameModeAthena.h"
void ABuildingFoundation::SetDynamicFoundationEnabledHook(UObject* Context, FFrame& Stack, void* Ret)
{
bool bEnabled;
Stack.StepCompiledIn(&bEnabled);
// LOG_INFO(LogDev, "{} TELL MILXNOR IF THIS PRINTS: {}", Context->GetFullName(), bEnabled);
auto BuildingFoundation = (ABuildingFoundation*)Context;
ShowFoundation(BuildingFoundation, bEnabled);
// idk lol
BuildingFoundation->ForceNetUpdate();
BuildingFoundation->FlushNetDormancy();
return SetDynamicFoundationEnabledOriginal(Context, Stack, Ret);
}

View File

@@ -0,0 +1,39 @@
#pragma once
#include "BuildingSMActor.h"
#include "Stack.h"
/* enum class EDynamicFoundationType : uint8
{
Static = 0,
StartEnabled_Stationary = 1,
StartEnabled_Dynamic = 2,
StartDisabled = 3,
EDynamicFoundationType_MAX = 4,
};
enum class EDynamicFoundationEnabledState : uint8_t
{
Unknown = 0,
Enabled = 1,
Disabled = 2,
EDynamicFoundationEnabledState_MAX = 3
};
enum class EDynamicFoundationType : uint8_t
{
Static = 0,
StartEnabled_Stationary = 1,
StartEnabled_Dynamic = 2,
StartDisabled = 3,
EDynamicFoundationType_MAX = 4
}; */
class ABuildingFoundation : public ABuildingSMActor
{
public:
static inline void (*SetDynamicFoundationEnabledOriginal)(UObject* Context, FFrame& Stack, void* Ret);
static void SetDynamicFoundationEnabledHook(UObject* Context, FFrame& Stack, void* Ret);
};

View File

@@ -210,67 +210,30 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
auto OldPlaylist = GetPlaylistForOldVersion(); auto OldPlaylist = GetPlaylistForOldVersion();
} }
// if (false) auto Fortnite_Season = std::floor(Fortnite_Version);
if (false) // Manual foundation showing
{ {
auto Fortnite_Season = std::floor(Fortnite_Version);
if (Fortnite_Season == 6)
{
if (Fortnite_Version != 6.10)
{
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1"));
auto Lake2 = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2");
Fortnite_Version <= 6.21 ? ShowFoundation(Lake) : ShowFoundation(Lake2);
// ^ This shows the lake after or before the event i dont know if this is needed.
}
else
{
auto Lake = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12"));
ShowFoundation(Lake);
}
auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13")) :
FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland"));
ShowFoundation(FloatingIsland);
UObject* Scripting = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.BP_IslandScripting3"); // bruh
if (Scripting)
{
static auto UpdateMapOffset = Scripting->GetOffset("UpdateMap", false);
if (UpdateMapOffset != -1)
{
Scripting->Get<bool>(UpdateMapOffset) = true;
static auto OnRep_UpdateMap = FindObject<UFunction>("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C.OnRep_UpdateMap");
Scripting->ProcessEvent(OnRep_UpdateMap);
}
}
}
if (Fortnite_Season >= 7 && Fortnite_Season <= 10) if (Fortnite_Season >= 7 && Fortnite_Season <= 10)
{ {
if (Fortnite_Season == 7) if (Fortnite_Season == 7)
{ {
if (Fortnite_Version == 7.30) if (Fortnite_Version == 7.30)
{ {
auto PleasantParkIdk = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus")); auto PleasantParkIdk = FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkFestivus"));
ShowFoundation(PleasantParkIdk); ShowFoundation(PleasantParkIdk);
auto PleasantParkGround = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault"); auto PleasantParkGround = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.PleasentParkDefault");
ShowFoundation(PleasantParkGround); ShowFoundation(PleasantParkGround);
} }
ShowFoundation(FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_25x36")); // Polar Peak ShowFoundation(FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_25x36")); // Polar Peak
ShowFoundation(FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.ShopsNew")); // Tilted Tower Shops, is this 7.40 specific? ShowFoundation(FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.ShopsNew")); // Tilted Tower Shops, is this 7.40 specific?
} }
else if (Fortnite_Season == 8) else if (Fortnite_Season == 8)
{ {
auto Volcano = FindObject(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_50x53_Volcano")); auto Volcano = FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_POI_50x53_Volcano"));
ShowFoundation(Volcano); ShowFoundation(Volcano);
} }
@@ -278,57 +241,57 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
{ {
if (Fortnite_Version >= 10.20) if (Fortnite_Version >= 10.20)
{ {
auto Island = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest16"); auto Island = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest16");
ShowFoundation(Island); ShowFoundation(Island);
} }
} }
auto TheBlock = FindObject("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank auto TheBlock = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank
ShowFoundation(TheBlock); ShowFoundation(TheBlock);
} }
if (Fortnite_Version == 14.60 && Globals::bGoingToPlayEvent) if (Fortnite_Version == 14.60 && Globals::bGoingToPlayEvent)
{ {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation3")); // Aircraft Carrier ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation3")); // Aircraft Carrier
} }
if (Fortnite_Version == 17.50) { if (Fortnite_Version == 17.50) {
auto FarmAfter = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.farmbase_2")); auto FarmAfter = FindObject<AActor>(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.farmbase_2"));
ShowFoundation(FarmAfter); ShowFoundation(FarmAfter);
auto FarmPhase = FindObject(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Farm_Phase_03")); // Farm Phases (Farm_Phase_01, Farm_Phase_02 and Farm_Phase_03) auto FarmPhase = FindObject<AActor>(("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Farm_Phase_03")); // Farm Phases (Farm_Phase_01, Farm_Phase_02 and Farm_Phase_03)
ShowFoundation(FarmPhase); ShowFoundation(FarmPhase);
} }
if (Fortnite_Version == 17.40) { if (Fortnite_Version == 17.40) {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.CoralPhase_02")); // Coral Castle Phases (CoralPhase_01, CoralPhase_02 and CoralPhase_03) ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.CoralPhase_02")); // Coral Castle Phases (CoralPhase_01, CoralPhase_02 and CoralPhase_03)
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation_0")); // CoralFoundation_01 ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation_0")); // CoralFoundation_01
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation6")); // CoralFoundation_05 ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation6")); // CoralFoundation_05
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation3")); // CoralFoundation_07 ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation3")); // CoralFoundation_07
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation2_1")); // CoralFoundation_10 ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation2_1")); // CoralFoundation_10
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation4")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation4"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation5")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.LF_Athena_16x16_Foundation5"));
} }
if (Fortnite_Version == 17.30) { if (Fortnite_Version == 17.30) {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Slurpy_Phase03")); // There are 1, 2 and 3 ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_Mother.Apollo_Mother.PersistentLevel.Slurpy_Phase03")); // There are 1, 2 and 3
} }
if (Fortnite_Season == 13) if (Fortnite_Season == 13)
{ {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.Lobby_Foundation"));
// SpawnIsland->RepData->Soemthing = FoundationSetup->LobbyLocation; // SpawnIsland->RepData->Soemthing = FoundationSetup->LobbyLocation;
} }
if (Fortnite_Version == 12.41) if (Fortnite_Version == 12.41)
{ {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_Athena_POI_19x19_2")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_Athena_POI_19x19_2"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head6_18")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head6_18"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head5_14")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head5_14"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head3_8")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head3_8"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head_2")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head_2"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head4_11")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.BP_Jerky_Head4_11"));
} }
if (Fortnite_Version == 11.31) if (Fortnite_Version == 11.31)
@@ -337,11 +300,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
if (false) // If the client loads this, it says the package doesnt exist... if (false) // If the client loads this, it says the package doesnt exist...
{ {
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_1")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_1"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_2")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_2"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_3")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_3"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_4")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_4"));
ShowFoundation(FindObject("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_5")); ShowFoundation(FindObject<AActor>("/Game/Athena/Apollo/Maps/Apollo_POI_Foundations.Apollo_POI_Foundations.PersistentLevel.LF_5x5_Galileo_Ferry_5"));
} }
} }
@@ -369,6 +332,48 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
} }
} }
if (Fortnite_Season == 6)
{
if (Fortnite_Version != 6.10)
{
auto Lake = FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake1"));
auto Lake2 = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Lake2");
Fortnite_Version <= 6.21 ? ShowFoundation(Lake) : ShowFoundation(Lake2);
// ^ This shows the lake after or before the event i dont know if this is needed.
}
else
{
auto Lake = FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest12"));
ShowFoundation(Lake);
}
auto FloatingIsland = Fortnite_Version == 6.10 ? FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_Athena_StreamingTest13")) :
FindObject<AActor>(("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.LF_FloatingIsland"));
ShowFoundation(FloatingIsland);
UObject* Scripting = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.BP_IslandScripting3"); // bruh
if (Scripting)
{
static auto UpdateMapOffset = Scripting->GetOffset("UpdateMap", false);
if (UpdateMapOffset != -1)
{
Scripting->Get<bool>(UpdateMapOffset) = true;
static auto OnRep_UpdateMap = FindObject<UFunction>("/Game/Athena/Prototype/Blueprints/Island/BP_IslandScripting.BP_IslandScripting_C.OnRep_UpdateMap");
Scripting->ProcessEvent(OnRep_UpdateMap);
}
}
}
auto TheBlock = FindObject<AActor>("/Game/Athena/Maps/Athena_POI_Foundations.Athena_POI_Foundations.PersistentLevel.SLAB_2"); // SLAB_3 is blank
if (TheBlock)
ShowFoundation(TheBlock);
SetBitfield(GameMode->GetPtr<PlaceholderBitfield>("bWorldIsReady"), 1, true); SetBitfield(GameMode->GetPtr<PlaceholderBitfield>("bWorldIsReady"), 1, true);
Globals::bInitializedPlaylist = true; Globals::bInitializedPlaylist = true;
} }

View File

@@ -6,23 +6,7 @@
#include "KismetStringLibrary.h" #include "KismetStringLibrary.h"
#include "reboot.h" #include "reboot.h"
#include "BuildingSMActor.h" #include "BuildingSMActor.h"
#include "GameplayStatics.h"
enum class EDynamicFoundationEnabledState : uint8_t
{
Unknown = 0,
Enabled = 1,
Disabled = 2,
EDynamicFoundationEnabledState_MAX = 3
};
enum class EDynamicFoundationType : uint8_t
{
Static = 0,
StartEnabled_Stationary = 1,
StartEnabled_Dynamic = 2,
StartDisabled = 3,
EDynamicFoundationType_MAX = 4
};
struct FAircraftFlightInfo struct FAircraftFlightInfo
{ {
@@ -56,7 +40,7 @@ struct FAircraftFlightInfo
} }
}; };
static void ShowFoundation(UObject* BuildingFoundation) static void ShowFoundation(AActor* BuildingFoundation, bool bShow = true)
{ {
if (!BuildingFoundation) if (!BuildingFoundation)
{ {
@@ -64,12 +48,28 @@ static void ShowFoundation(UObject* BuildingFoundation)
return; return;
} }
bool bServerStreamedInLevelValue = bShow; // ??
static auto bServerStreamedInLevelFieldMask = GetFieldMask(BuildingFoundation->GetProperty("bServerStreamedInLevel")); static auto bServerStreamedInLevelFieldMask = GetFieldMask(BuildingFoundation->GetProperty("bServerStreamedInLevel"));
static auto bServerStreamedInLevelOffset = BuildingFoundation->GetOffset("bServerStreamedInLevel"); static auto bServerStreamedInLevelOffset = BuildingFoundation->GetOffset("bServerStreamedInLevel");
BuildingFoundation->SetBitfieldValue(bServerStreamedInLevelOffset, bServerStreamedInLevelFieldMask, true); BuildingFoundation->SetBitfieldValue(bServerStreamedInLevelOffset, bServerStreamedInLevelFieldMask, bServerStreamedInLevelValue);
static auto bFoundationEnabledOffset = BuildingFoundation->GetOffset("bFoundationEnabled", false);
if (bFoundationEnabledOffset != -1)
{
static auto bFoundationEnabledFieldMask = GetFieldMask(BuildingFoundation->GetProperty("bFoundationEnabled"));
BuildingFoundation->SetBitfieldValue(bFoundationEnabledOffset, bFoundationEnabledFieldMask, bShow);
// theres a onrep too
}
static auto StartDisabled = 3;
static auto StartEnabled_Dynamic = 2;
static auto Static = 0;
static auto DynamicFoundationTypeOffset = BuildingFoundation->GetOffset("DynamicFoundationType"); static auto DynamicFoundationTypeOffset = BuildingFoundation->GetOffset("DynamicFoundationType");
BuildingFoundation->Get<uint8_t>(DynamicFoundationTypeOffset) = true ? 0 : 3; BuildingFoundation->Get<uint8_t>(DynamicFoundationTypeOffset) = bShow ? Static : StartDisabled;
static auto bShowHLODWhenDisabledOffset = BuildingFoundation->GetOffset("bShowHLODWhenDisabled", false); static auto bShowHLODWhenDisabledOffset = BuildingFoundation->GetOffset("bShowHLODWhenDisabled", false);
@@ -84,13 +84,33 @@ static void ShowFoundation(UObject* BuildingFoundation)
static auto DynamicFoundationRepDataOffset = BuildingFoundation->GetOffset("DynamicFoundationRepData", false); static auto DynamicFoundationRepDataOffset = BuildingFoundation->GetOffset("DynamicFoundationRepData", false);
static auto Enabled = 1;
static auto Disabled = 2;
static auto DynamicFoundationTransformOffset = BuildingFoundation->GetOffset("DynamicFoundationTransform", false);
if (DynamicFoundationTransformOffset != -1) // needed check?
{
auto DynamicFoundationTransform = BuildingFoundation->GetPtr<FTransform>(DynamicFoundationTransformOffset);
DynamicFoundationTransform->Rotation = BuildingFoundation->GetActorRotation().Quaternion();
DynamicFoundationTransform->Translation = BuildingFoundation->GetActorLocation();
DynamicFoundationTransform->Scale3D = BuildingFoundation->GetActorScale3D();
}
if (DynamicFoundationRepDataOffset != -1) if (DynamicFoundationRepDataOffset != -1)
{ {
auto DynamicFoundationRepData = BuildingFoundation->GetPtr<void>(DynamicFoundationRepDataOffset); auto DynamicFoundationRepData = BuildingFoundation->GetPtr<void>(DynamicFoundationRepDataOffset);
static auto RotationOffset = FindOffsetStruct("/Script/FortniteGame.DynamicBuildingFoundationRepData", "Rotation");
static auto TranslationOffset = FindOffsetStruct("/Script/FortniteGame.DynamicBuildingFoundationRepData", "Translation");
static auto EnabledStateOffset = FindOffsetStruct("/Script/FortniteGame.DynamicBuildingFoundationRepData", "EnabledState"); static auto EnabledStateOffset = FindOffsetStruct("/Script/FortniteGame.DynamicBuildingFoundationRepData", "EnabledState");
*(EDynamicFoundationEnabledState*)(__int64(DynamicFoundationRepData) + EnabledStateOffset) = EDynamicFoundationEnabledState::Enabled; *(uint8_t*)(__int64(DynamicFoundationRepData) + EnabledStateOffset) = bShow ? Enabled : Disabled;
// hmm
*(FRotator*)(__int64(DynamicFoundationRepData) + RotationOffset) = BuildingFoundation->GetActorRotation();
*(FVector*)(__int64(DynamicFoundationRepData) + TranslationOffset) = BuildingFoundation->GetActorLocation();
static auto OnRep_DynamicFoundationRepDataFn = FindObject<UFunction>("/Script/FortniteGame.BuildingFoundation.OnRep_DynamicFoundationRepData"); static auto OnRep_DynamicFoundationRepDataFn = FindObject<UFunction>("/Script/FortniteGame.BuildingFoundation.OnRep_DynamicFoundationRepData");
BuildingFoundation->ProcessEvent(OnRep_DynamicFoundationRepDataFn); BuildingFoundation->ProcessEvent(OnRep_DynamicFoundationRepDataFn);
@@ -99,7 +119,19 @@ static void ShowFoundation(UObject* BuildingFoundation)
static auto FoundationEnabledStateOffset = BuildingFoundation->GetOffset("FoundationEnabledState", false); static auto FoundationEnabledStateOffset = BuildingFoundation->GetOffset("FoundationEnabledState", false);
if (FoundationEnabledStateOffset != -1) if (FoundationEnabledStateOffset != -1)
BuildingFoundation->Get<EDynamicFoundationEnabledState>(FoundationEnabledStateOffset) = EDynamicFoundationEnabledState::Enabled; BuildingFoundation->Get<uint8_t>(FoundationEnabledStateOffset) = bShow ? Enabled : Disabled;
static auto LevelToStreamOffset = BuildingFoundation->GetOffset("LevelToStream");
auto& LevelToStream = BuildingFoundation->Get<FName>(LevelToStreamOffset);
/* if (bShow)
{
UGameplayStatics::LoadStreamLevel(GetWorld(), LevelToStream, true, false, FLatentActionInfo());
}
else
{
UGameplayStatics::UnloadStreamLevel(GetWorld(), LevelToStream, FLatentActionInfo(), false);
} */
} }
static void StreamLevel(const std::string& LevelName, FVector Location = {}) static void StreamLevel(const std::string& LevelName, FVector Location = {})

View File

@@ -533,7 +533,9 @@ AFortPickup* UFortKismetLibrary::K2_SpawnPickupInWorldHook(UObject* Context, FFr
if (!ItemDefinition) if (!ItemDefinition)
return K2_SpawnPickupInWorldOriginal(Context, Stack, Ret); return K2_SpawnPickupInWorldOriginal(Context, Stack, Ret);
auto aa = AFortPickup::SpawnPickup(ItemDefinition, Position, NumberToSpawn, SourceType, Source, -1, nullptr, nullptr, bToss); auto Pawn = OptionalOwnerPC ? OptionalOwnerPC->GetMyFortPawn() : nullptr;
auto aa = AFortPickup::SpawnPickup(ItemDefinition, Position, NumberToSpawn, SourceType, Source, -1, Pawn, nullptr, bToss);
K2_SpawnPickupInWorldOriginal(Context, Stack, Ret); K2_SpawnPickupInWorldOriginal(Context, Stack, Ret);

View File

@@ -567,7 +567,7 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
{ {
auto PlayerController = Cast<AFortPlayerController>(Engine_Version < 424 ? PC : ((UActorComponent*)PC)->GetOwner()); auto PlayerController = Cast<AFortPlayerController>(Engine_Version < 424 ? PC : ((UActorComponent*)PC)->GetOwner());
if (Engine_Version < 424 && !Globals::bLateGame) if (Engine_Version < 424 && !Globals::bLateGame.load())
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent) if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent)
@@ -1139,11 +1139,11 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
LOG_INFO(LogDev, "Reported kill."); LOG_INFO(LogDev, "Reported kill.");
if (KillerPawn && KillerPawn != DeadPawn) /* if (KillerPawn && KillerPawn != DeadPawn)
{ {
KillerPawn->SetHealth(100); KillerPawn->SetHealth(100);
KillerPawn->SetShield(100); KillerPawn->SetShield(100);
} } */
bool bIsRespawningAllowed = GameState->IsRespawningAllowed(DeadPlayerState); bool bIsRespawningAllowed = GameState->IsRespawningAllowed(DeadPlayerState);

View File

@@ -15,18 +15,18 @@ void AFortPlayerStateAthena::ServerSetInAircraftHook(UObject* Context, FFrame& S
if (!PlayerController) if (!PlayerController)
return ServerSetInAircraftOriginal(Context, Stack, Ret); return ServerSetInAircraftOriginal(Context, Stack, Ret);
// std::cout << "bNewInAircraft: " << bNewInAircraft << '\n';
// std::cout << "PlayerController->IsInAircraft(): " << PlayerController->IsInAircraft() << '\n'; // std::cout << "PlayerController->IsInAircraft(): " << PlayerController->IsInAircraft() << '\n';
struct aaa { bool wtf; }; struct aaa { bool wtf; };
auto bNewInAircraft = ((aaa*)Stack.Locals)->wtf;// *(bool*)Stack.Locals; auto bNewInAircraft = ((aaa*)Stack.Locals)->wtf;// *(bool*)Stack.Locals;
LOG_INFO(LogDev, "bNewInAircraft: {}", bNewInAircraft);
auto WorldInventory = PlayerController->GetWorldInventory(); auto WorldInventory = PlayerController->GetWorldInventory();
auto& InventoryList = WorldInventory->GetItemList(); auto& InventoryList = WorldInventory->GetItemList();
auto& ItemInstances = InventoryList.GetItemInstances(); auto& ItemInstances = InventoryList.GetItemInstances();
if (/* (bNewInAircraft && !PlayerController->IsInAircraft()) || */ /* (Globals::bLateGame ? bNewInAircraft : true)) && */ !Globals::bLateGame && ItemInstances.Num()) if (/* (bNewInAircraft && !PlayerController->IsInAircraft()) || */ /* (Globals::bLateGame ? bNewInAircraft : true)) && */ /* !Globals::bLateGame.load() && */ ItemInstances.Num())
{ {
// std::cout << "InventoryList.ItemInstances.Num(): " << InventoryList.ItemInstances.Num() << '\n'; // std::cout << "InventoryList.ItemInstances.Num(): " << InventoryList.ItemInstances.Num() << '\n';

View File

@@ -74,6 +74,38 @@ void UGameplayStatics::RemovePlayer(APlayerController* Player, bool bDestroyPawn
defaultObj->ProcessEvent(fn, &UGameplayStatics_RemovePlayer_Params); defaultObj->ProcessEvent(fn, &UGameplayStatics_RemovePlayer_Params);
} }
void UGameplayStatics::LoadStreamLevel(UObject* WorldContextObject, FName LevelName, bool bMakeVisibleAfterLoad, bool bShouldBlockOnLoad, const FLatentActionInfo& LatentInfo)
{
static auto LoadStreamLevelFn = FindObject<UFunction>("/Script/Engine.GameplayStatics.LoadStreamLevel");
struct
{
UObject* WorldContextObject; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName LevelName; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bMakeVisibleAfterLoad; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
bool bShouldBlockOnLoad; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FLatentActionInfo LatentInfo; // (Parm, NoDestructor, NativeAccessSpecifierPublic)
} UGameplayStatics_LoadStreamLevel_Params{WorldContextObject, LevelName, bMakeVisibleAfterLoad, bShouldBlockOnLoad, LatentInfo};
static auto defaultObj = StaticClass();
defaultObj->ProcessEvent(LoadStreamLevelFn, &UGameplayStatics_LoadStreamLevel_Params);
}
void UGameplayStatics::UnloadStreamLevel(UObject* WorldContextObject, FName LevelName, const FLatentActionInfo& LatentInfo, bool bShouldBlockOnUnload)
{
static auto UnloadStreamLevelFn = FindObject<UFunction>("/Script/Engine.GameplayStatics.UnloadStreamLevel");
struct
{
UObject* WorldContextObject; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName LevelName; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FLatentActionInfo LatentInfo; // (Parm, NoDestructor, NativeAccessSpecifierPublic)
bool bShouldBlockOnUnload; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
} UGameplayStatics_UnloadStreamLevel_Params{WorldContextObject, LevelName, LatentInfo, bShouldBlockOnUnload};
static auto defaultObj = StaticClass();
defaultObj->ProcessEvent(UnloadStreamLevelFn, &UGameplayStatics_UnloadStreamLevel_Params);
}
UClass* UGameplayStatics::StaticClass() UClass* UGameplayStatics::StaticClass()
{ {
static auto Class = FindObject<UClass>(L"/Script/Engine.GameplayStatics"); static auto Class = FindObject<UClass>(L"/Script/Engine.GameplayStatics");

View File

@@ -3,6 +3,7 @@
#include "Object.h" #include "Object.h"
#include "Array.h" #include "Array.h"
#include "Actor.h" #include "Actor.h"
#include "LatentActionManager.h"
class UGameplayStatics : public UObject class UGameplayStatics : public UObject
{ {
@@ -21,6 +22,8 @@ public:
// static void OpenLevel(UObject* WorldContextObject, FName LevelName, bool bAbsolute, const FString& Options); // static void OpenLevel(UObject* WorldContextObject, FName LevelName, bool bAbsolute, const FString& Options);
static void RemovePlayer(class APlayerController* Player, bool bDestroyPawn); static void RemovePlayer(class APlayerController* Player, bool bDestroyPawn);
static void LoadStreamLevel(UObject* WorldContextObject, FName LevelName, bool bMakeVisibleAfterLoad, bool bShouldBlockOnLoad, const FLatentActionInfo& LatentInfo);
static void UnloadStreamLevel(UObject* WorldContextObject, FName LevelName, const FLatentActionInfo& LatentInfo, bool bShouldBlockOnUnload);
static UClass* StaticClass(); static UClass* StaticClass();
}; };

View File

@@ -0,0 +1,12 @@
#pragma once
#include "Object.h"
struct FLatentActionInfo
{
int Linkage; // 0x0000(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
int UUID; // 0x0004(0x0004) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
FName ExecutionFunction; // 0x0008(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
UObject* CallbackTarget; // 0x0010(0x0008) (ZeroConstructor, IsPlainOldData, NoDestructor, UObjectWrapper, HasGetValueTypeHash, NativeAccessSpecifierPublic)
};

View File

@@ -178,6 +178,7 @@
<ClCompile Include="addresses.cpp" /> <ClCompile Include="addresses.cpp" />
<ClCompile Include="AthenaMarkerComponent.cpp" /> <ClCompile Include="AthenaMarkerComponent.cpp" />
<ClCompile Include="BuildingActor.cpp" /> <ClCompile Include="BuildingActor.cpp" />
<ClCompile Include="BuildingFoundation.cpp" />
<ClCompile Include="BuildingSMActor.cpp" /> <ClCompile Include="BuildingSMActor.cpp" />
<ClCompile Include="BuildingStructuralSupportSystem.cpp" /> <ClCompile Include="BuildingStructuralSupportSystem.cpp" />
<ClCompile Include="BuildingTrap.cpp" /> <ClCompile Include="BuildingTrap.cpp" />
@@ -261,6 +262,7 @@
<ClInclude Include="BitArray.h" /> <ClInclude Include="BitArray.h" />
<ClInclude Include="BuildingActor.h" /> <ClInclude Include="BuildingActor.h" />
<ClInclude Include="BuildingContainer.h" /> <ClInclude Include="BuildingContainer.h" />
<ClInclude Include="BuildingFoundation.h" />
<ClInclude Include="BuildingGameplayActor.h" /> <ClInclude Include="BuildingGameplayActor.h" />
<ClInclude Include="BuildingGameplayActorSpawnMachine.h" /> <ClInclude Include="BuildingGameplayActorSpawnMachine.h" />
<ClInclude Include="BuildingSMActor.h" /> <ClInclude Include="BuildingSMActor.h" />
@@ -351,6 +353,7 @@
<ClInclude Include="KismetStringLibrary.h" /> <ClInclude Include="KismetStringLibrary.h" />
<ClInclude Include="KismetSystemLibrary.h" /> <ClInclude Include="KismetSystemLibrary.h" />
<ClInclude Include="KismetTextLibrary.h" /> <ClInclude Include="KismetTextLibrary.h" />
<ClInclude Include="LatentActionManager.h" />
<ClInclude Include="Level.h" /> <ClInclude Include="Level.h" />
<ClInclude Include="log.h" /> <ClInclude Include="log.h" />
<ClInclude Include="Map.h" /> <ClInclude Include="Map.h" />

View File

@@ -230,6 +230,9 @@
<ClCompile Include="CheatManager.cpp"> <ClCompile Include="CheatManager.cpp">
<Filter>Engine\Source\Runtime\Engine\Private</Filter> <Filter>Engine\Source\Runtime\Engine\Private</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="BuildingFoundation.cpp">
<Filter>FortniteGame\Source\FortniteGame\Private\Building</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="log.h" /> <ClInclude Include="log.h" />
@@ -710,6 +713,12 @@
<ClInclude Include="CheatManager.h"> <ClInclude Include="CheatManager.h">
<Filter>Engine\Source\Runtime\Engine\Classes\GameFramework</Filter> <Filter>Engine\Source\Runtime\Engine\Classes\GameFramework</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="BuildingFoundation.h">
<Filter>FortniteGame\Source\FortniteGame\Public\Building</Filter>
</ClInclude>
<ClInclude Include="LatentActionManager.h">
<Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="Engine"> <Filter Include="Engine">

View File

@@ -301,7 +301,8 @@ void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
!strstr(FunctionFullName.c_str(), "GCNL_EnvCampFire_Fire_C") && !strstr(FunctionFullName.c_str(), "GCNL_EnvCampFire_Fire_C") &&
!strstr(FunctionName.c_str(), "BlueprintGetAllHighlightableComponents") && !strstr(FunctionName.c_str(), "BlueprintGetAllHighlightableComponents") &&
!strstr(FunctionFullName.c_str(), "Primitive_Structure_AmbAudioComponent") && !strstr(FunctionFullName.c_str(), "Primitive_Structure_AmbAudioComponent") &&
!strstr(FunctionName.c_str(), "ServerTriggerCombatEvent")) !strstr(FunctionName.c_str(), "ServerTriggerCombatEvent") &&
!strstr(FunctionName.c_str(), "SpinCubeTimeline__UpdateFunc"))
{ {
LOG_INFO(LogDev, "Function called: {} with {}", FunctionFullName, ObjectName); LOG_INFO(LogDev, "Function called: {} with {}", FunctionFullName, ObjectName);
} }

View File

@@ -14,6 +14,7 @@
#include <fstream> #include <fstream>
#include "GenericPlatformTime.h" #include "GenericPlatformTime.h"
#include "BuildingFoundation.h"
#include "Map.h" #include "Map.h"
#include "events.h" #include "events.h"
#include "FortKismetLibrary.h" #include "FortKismetLibrary.h"
@@ -192,6 +193,11 @@ DWORD WINAPI Main(LPVOID)
bool bUseRemovePlayer = false; bool bUseRemovePlayer = false;
bool bUseSwitchLevel = false; bool bUseSwitchLevel = false;
Hooking::MinHook::Hook(FindObject<ABuildingFoundation>("/Script/FortniteGame.Default__BuildingFoundation"),
FindObject<UFunction>(L"/Script/FortniteGame.BuildingFoundation.SetDynamicFoundationEnabled"),
ABuildingFoundation::SetDynamicFoundationEnabledHook, (PVOID*)&ABuildingFoundation::SetDynamicFoundationEnabledOriginal, false, true);
if (bUseSwitchLevel) if (bUseSwitchLevel)
{ {
static auto SwitchLevel = FindObject<UFunction>(L"/Script/Engine.PlayerController.SwitchLevel"); static auto SwitchLevel = FindObject<UFunction>(L"/Script/Engine.PlayerController.SwitchLevel");
@@ -488,96 +494,93 @@ DWORD WINAPI Main(LPVOID)
UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook1, nullptr, false); UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook1, nullptr, false);
} }
if (Addresses::FrameStep) // put all non rpc exec hooks in this scope static auto FortGameplayAbilityAthena_PeriodicItemGrantDefault = FindObject<UFortGameplayAbilityAthena_PeriodicItemGrant>("/Script/FortniteGame.Default__FortGameplayAbilityAthena_PeriodicItemGrant");
Hooking::MinHook::Hook(FortGameplayAbilityAthena_PeriodicItemGrantDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameplayAbilityAthena_PeriodicItemGrant.StartItemAwardTimers"),
UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersHook, (PVOID*)&UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveItemToPlayer"),
UFortKismetLibrary::K2_GiveItemToPlayerHook, (PVOID*)&UFortKismetLibrary::K2_GiveItemToPlayerOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveBuildingResource"),
UFortKismetLibrary::K2_GiveBuildingResourceHook, (PVOID*)&UFortKismetLibrary::K2_GiveBuildingResourceOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.GiveItemToInventoryOwner"),
UFortKismetLibrary::GiveItemToInventoryOwnerHook, (PVOID*)&UFortKismetLibrary::GiveItemToInventoryOwnerOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayerByGuid"),
UFortKismetLibrary::K2_RemoveItemFromPlayerByGuidHook, (PVOID*)&UFortKismetLibrary::K2_RemoveItemFromPlayerByGuidOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer"),
UFortKismetLibrary::K2_RemoveItemFromPlayerHook, (PVOID*)&UFortKismetLibrary::K2_RemoveItemFromPlayerOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, NetMulticast_Athena_BatchedDamageCuesFn,
AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook, (PVOID*)&AFortPawn::NetMulticast_Athena_BatchedDamageCuesOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject<UFunction>("/Script/FortniteGame.FortPawn.MovingEmoteStopped"),
AFortPawn::MovingEmoteStoppedHook, (PVOID*)&AFortPawn::MovingEmoteStoppedOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") ? FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") : FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawn.OnCapsuleBeginOverlap"),
AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook, (PVOID*)&AFortPlayerPawnAthena::OnCapsuleBeginOverlapOriginal, false, true);
if (!bNativeHookRemoveFortItemFromPlayer)
{ {
static auto FortGameplayAbilityAthena_PeriodicItemGrantDefault = FindObject<UFortGameplayAbilityAthena_PeriodicItemGrant>("/Script/FortniteGame.Default__FortGameplayAbilityAthena_PeriodicItemGrant"); Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveFortItemFromPlayer"),
UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook, (PVOID*)&UFortKismetLibrary::K2_RemoveFortItemFromPlayerOriginal, false, true);
Hooking::MinHook::Hook(FortGameplayAbilityAthena_PeriodicItemGrantDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameplayAbilityAthena_PeriodicItemGrant.StartItemAwardTimers"),
UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersHook, (PVOID*)&UFortGameplayAbilityAthena_PeriodicItemGrant::StartItemAwardTimersOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveItemToPlayer"),
UFortKismetLibrary::K2_GiveItemToPlayerHook, (PVOID*)&UFortKismetLibrary::K2_GiveItemToPlayerOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_GiveBuildingResource"),
UFortKismetLibrary::K2_GiveBuildingResourceHook, (PVOID*)&UFortKismetLibrary::K2_GiveBuildingResourceOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.GiveItemToInventoryOwner"),
UFortKismetLibrary::GiveItemToInventoryOwnerHook, (PVOID*)&UFortKismetLibrary::GiveItemToInventoryOwnerOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayerByGuid"),
UFortKismetLibrary::K2_RemoveItemFromPlayerByGuidHook, (PVOID*)&UFortKismetLibrary::K2_RemoveItemFromPlayerByGuidOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer"),
UFortKismetLibrary::K2_RemoveItemFromPlayerHook, (PVOID*)&UFortKismetLibrary::K2_RemoveItemFromPlayerOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, NetMulticast_Athena_BatchedDamageCuesFn,
AFortPawn::NetMulticast_Athena_BatchedDamageCuesHook, (PVOID*)&AFortPawn::NetMulticast_Athena_BatchedDamageCuesOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject<UFunction>("/Script/FortniteGame.FortPawn.MovingEmoteStopped"),
AFortPawn::MovingEmoteStoppedHook, (PVOID*)&AFortPawn::MovingEmoteStoppedOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerPawnAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") ? FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawnAthena.OnCapsuleBeginOverlap") : FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerPawn.OnCapsuleBeginOverlap"),
AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook, (PVOID*)&AFortPlayerPawnAthena::OnCapsuleBeginOverlapOriginal, false, true);
if (!bNativeHookRemoveFortItemFromPlayer)
{
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_RemoveFortItemFromPlayer"),
UFortKismetLibrary::K2_RemoveFortItemFromPlayerHook, (PVOID*)&UFortKismetLibrary::K2_RemoveFortItemFromPlayerOriginal, false, true);
}
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorld"),
UFortKismetLibrary::K2_SpawnPickupInWorldHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorldWithLootTier"),
UFortKismetLibrary::K2_SpawnPickupInWorldWithLootTierHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldWithLootTierOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorldWithClass"),
UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldWithClassOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.PickLootDrops"),
UFortKismetLibrary::PickLootDropsHook, (PVOID*)&UFortKismetLibrary::PickLootDropsOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.CreateTossAmmoPickupForWeaponItemDefinitionAtLocation"),
UFortKismetLibrary::CreateTossAmmoPickupForWeaponItemDefinitionAtLocationHook, (PVOID*)&UFortKismetLibrary::CreateTossAmmoPickupForWeaponItemDefinitionAtLocationOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.SpawnInstancedPickupInWorld"),
UFortKismetLibrary::SpawnInstancedPickupInWorldHook, (PVOID*)&UFortKismetLibrary::SpawnInstancedPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.SpawnItemVariantPickupInWorld"),
UFortKismetLibrary::SpawnItemVariantPickupInWorldHook, (PVOID*)&UFortKismetLibrary::SpawnItemVariantPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.PickLootDropsWithNamedWeights"),
UFortKismetLibrary::PickLootDropsWithNamedWeightsHook, (PVOID*)&UFortKismetLibrary::PickLootDropsWithNamedWeightsOriginal, false, true);
// TODO Add RemoveItemFromInventoryOwner
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.SpawnToyInstance"),
AFortPlayerController::SpawnToyInstanceHook, (PVOID*)&AFortPlayerController::SpawnToyInstanceOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.DropSpecificItem"),
AFortPlayerController::DropSpecificItemHook, (PVOID*)&AFortPlayerController::DropSpecificItemOriginal, false, true);
static auto FortAthenaSupplyDropDefault = FindObject(L"/Script/FortniteGame.Default__FortAthenaSupplyDrop");
Hooking::MinHook::Hook(FortAthenaSupplyDropDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaSupplyDrop.SpawnPickup"),
AFortAthenaSupplyDrop::SpawnPickupHook, (PVOID*)&AFortAthenaSupplyDrop::SpawnPickupOriginal, false, true);
static auto FortAthenaCreativePortalDefault = FindObject(L"/Script/FortniteGame.Default__FortAthenaCreativePortal");
Hooking::MinHook::Hook(FortAthenaCreativePortalDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaCreativePortal.TeleportPlayerToLinkedVolume"),
AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeHook, (PVOID*)&AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeOriginal, false, true);
Hooking::MinHook::Hook(FortAthenaCreativePortalDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaCreativePortal.TeleportPlayer"),
AFortAthenaCreativePortal::TeleportPlayerHook, (PVOID*)&AFortAthenaCreativePortal::TeleportPlayerOriginal, false, true);
static auto FortMinigameDefault = FindObject(L"/Script/FortniteGame.Default__FortMinigame");
Hooking::MinHook::Hook(FortMinigameDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortMinigame.ClearPlayerInventory"),
AFortMinigame::ClearPlayerInventoryHook, (PVOID*)&AFortMinigame::ClearPlayerInventoryOriginal, false, true);
static auto InventoryManagementLibraryDefault = FindObject<UInventoryManagementLibrary>(L"/Script/FortniteGame.Default__InventoryManagementLibrary");
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.AddItem"),
UInventoryManagementLibrary::AddItemHook, (PVOID*)&UInventoryManagementLibrary::AddItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.AddItems"),
UInventoryManagementLibrary::AddItemsHook, (PVOID*)&UInventoryManagementLibrary::AddItemsOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.GiveItemEntryToInventoryOwner"),
UInventoryManagementLibrary::GiveItemEntryToInventoryOwnerHook, (PVOID*)&UInventoryManagementLibrary::GiveItemEntryToInventoryOwnerOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.RemoveItem"),
UInventoryManagementLibrary::RemoveItemHook, (PVOID*)&UInventoryManagementLibrary::RemoveItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.RemoveItems"),
UInventoryManagementLibrary::RemoveItemsHook, (PVOID*)&UInventoryManagementLibrary::RemoveItemsOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItem"),
UInventoryManagementLibrary::SwapItemHook, (PVOID*)&UInventoryManagementLibrary::SwapItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItems"),
UInventoryManagementLibrary::SwapItemsHook, (PVOID*)&UInventoryManagementLibrary::SwapItemsOriginal, false, true);
} }
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorld"),
UFortKismetLibrary::K2_SpawnPickupInWorldHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorldWithLootTier"),
UFortKismetLibrary::K2_SpawnPickupInWorldWithLootTierHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldWithLootTierOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.K2_SpawnPickupInWorldWithClass"),
UFortKismetLibrary::K2_SpawnPickupInWorldWithClassHook, (PVOID*)&UFortKismetLibrary::K2_SpawnPickupInWorldWithClassOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.PickLootDrops"),
UFortKismetLibrary::PickLootDropsHook, (PVOID*)&UFortKismetLibrary::PickLootDropsOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.CreateTossAmmoPickupForWeaponItemDefinitionAtLocation"),
UFortKismetLibrary::CreateTossAmmoPickupForWeaponItemDefinitionAtLocationHook, (PVOID*)&UFortKismetLibrary::CreateTossAmmoPickupForWeaponItemDefinitionAtLocationOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.SpawnInstancedPickupInWorld"),
UFortKismetLibrary::SpawnInstancedPickupInWorldHook, (PVOID*)&UFortKismetLibrary::SpawnInstancedPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.SpawnItemVariantPickupInWorld"),
UFortKismetLibrary::SpawnItemVariantPickupInWorldHook, (PVOID*)&UFortKismetLibrary::SpawnItemVariantPickupInWorldOriginal, false, true);
Hooking::MinHook::Hook(FortKismetLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortKismetLibrary.PickLootDropsWithNamedWeights"),
UFortKismetLibrary::PickLootDropsWithNamedWeightsHook, (PVOID*)&UFortKismetLibrary::PickLootDropsWithNamedWeightsOriginal, false, true);
// TODO Add RemoveItemFromInventoryOwner
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.SpawnToyInstance"),
AFortPlayerController::SpawnToyInstanceHook, (PVOID*)&AFortPlayerController::SpawnToyInstanceOriginal, false, true);
Hooking::MinHook::Hook(FortPlayerControllerAthenaDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerController.DropSpecificItem"),
AFortPlayerController::DropSpecificItemHook, (PVOID*)&AFortPlayerController::DropSpecificItemOriginal, false, true);
static auto FortAthenaSupplyDropDefault = FindObject(L"/Script/FortniteGame.Default__FortAthenaSupplyDrop");
Hooking::MinHook::Hook(FortAthenaSupplyDropDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaSupplyDrop.SpawnPickup"),
AFortAthenaSupplyDrop::SpawnPickupHook, (PVOID*)&AFortAthenaSupplyDrop::SpawnPickupOriginal, false, true);
static auto FortAthenaCreativePortalDefault = FindObject(L"/Script/FortniteGame.Default__FortAthenaCreativePortal");
Hooking::MinHook::Hook(FortAthenaCreativePortalDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaCreativePortal.TeleportPlayerToLinkedVolume"),
AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeHook, (PVOID*)&AFortAthenaCreativePortal::TeleportPlayerToLinkedVolumeOriginal, false, true);
Hooking::MinHook::Hook(FortAthenaCreativePortalDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortAthenaCreativePortal.TeleportPlayer"),
AFortAthenaCreativePortal::TeleportPlayerHook, (PVOID*)&AFortAthenaCreativePortal::TeleportPlayerOriginal, false, true);
static auto FortMinigameDefault = FindObject(L"/Script/FortniteGame.Default__FortMinigame");
Hooking::MinHook::Hook(FortMinigameDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortMinigame.ClearPlayerInventory"),
AFortMinigame::ClearPlayerInventoryHook, (PVOID*)&AFortMinigame::ClearPlayerInventoryOriginal, false, true);
static auto InventoryManagementLibraryDefault = FindObject<UInventoryManagementLibrary>(L"/Script/FortniteGame.Default__InventoryManagementLibrary");
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.AddItem"),
UInventoryManagementLibrary::AddItemHook, (PVOID*)&UInventoryManagementLibrary::AddItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.AddItems"),
UInventoryManagementLibrary::AddItemsHook, (PVOID*)&UInventoryManagementLibrary::AddItemsOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.GiveItemEntryToInventoryOwner"),
UInventoryManagementLibrary::GiveItemEntryToInventoryOwnerHook, (PVOID*)&UInventoryManagementLibrary::GiveItemEntryToInventoryOwnerOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.RemoveItem"),
UInventoryManagementLibrary::RemoveItemHook, (PVOID*)&UInventoryManagementLibrary::RemoveItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.RemoveItems"),
UInventoryManagementLibrary::RemoveItemsHook, (PVOID*)&UInventoryManagementLibrary::RemoveItemsOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItem"),
UInventoryManagementLibrary::SwapItemHook, (PVOID*)&UInventoryManagementLibrary::SwapItemOriginal, false, true);
Hooking::MinHook::Hook(InventoryManagementLibraryDefault, FindObject<UFunction>(L"/Script/FortniteGame.InventoryManagementLibrary.SwapItems"),
UInventoryManagementLibrary::SwapItemsHook, (PVOID*)&UInventoryManagementLibrary::SwapItemsOriginal, false, true);
static auto ServerHandlePickupInfoFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerPawn.ServerHandlePickupInfo"); static auto ServerHandlePickupInfoFn = FindObject<UFunction>("/Script/FortniteGame.FortPlayerPawn.ServerHandlePickupInfo");
if (ServerHandlePickupInfoFn) if (ServerHandlePickupInfoFn)
@@ -629,7 +632,7 @@ DWORD WINAPI Main(LPVOID)
: FindObject<UFunction>(L"/Script/FortniteGame.FortControllerComponent_Aircraft.ServerAttemptAircraftJump"); : FindObject<UFunction>(L"/Script/FortniteGame.FortControllerComponent_Aircraft.ServerAttemptAircraftJump");
Hooking::MinHook::Hook(FortControllerComponent_AircraftDefault ? FortControllerComponent_AircraftDefault : FortPlayerControllerAthenaDefault, ServerAttemptAircraftJumpFn, Hooking::MinHook::Hook(FortControllerComponent_AircraftDefault ? FortControllerComponent_AircraftDefault : FortPlayerControllerAthenaDefault, ServerAttemptAircraftJumpFn,
AFortPlayerController::ServerAttemptAircraftJumpHook, nullptr, false); AFortPlayerController::ServerAttemptAircraftJumpHook, (PVOID*)&AFortPlayerController::ServerAttemptAircraftJumpOriginal, false);
} }
// if (false) // if (false)

View File

@@ -18,6 +18,7 @@ struct Event
std::string ScriptingClass; std::string ScriptingClass;
std::string PlaylistName; std::string PlaylistName;
double Version; double Version;
bool RequiredPlaylist = true;
}; };
static inline std::vector<Event> Events = static inline std::vector<Event> Events =
@@ -34,7 +35,7 @@ static inline std::vector<Event> Events =
{ {
{ {
true, true,
"/Game/Athena/Prototype/Blueprints/Island/BP_Butterfly.BP_Butterfly_C.ButterflySequence" "/Game/Athena/Prototype/Blueprints/Island/BP_Butterfly.BP_Butterfly_C.ButterflySequence" // StartButterflyOnPlaylistLoaded calls this
}, },
0 0
@@ -43,7 +44,61 @@ static inline std::vector<Event> Events =
"/Game/Athena/Prototype/Blueprints/Island/BP_Butterfly.BP_Butterfly_C", "/Game/Athena/Prototype/Blueprints/Island/BP_Butterfly.BP_Butterfly_C",
"/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo", "/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo",
6.21 6.21,
false
),
Event
(
"The Showdown",
"/Game/Athena/Prototype/Blueprints/Cattus/BP_CattusDoggus_Scripting.BP_CattusDoggus_Scripting_C",
"/Game/Athena/Prototype/Blueprints/Cattus/BP_CattusDoggus_Scripting.BP_CattusDoggus_Scripting_C.LoadCattusLevel",
1,
{
{
true,
"/Game/Athena/Prototype/Blueprints/Cattus/BP_CattusDoggus_Scripting.BP_CattusDoggus_Scripting_C.OnReady_C11CA7624A74FBAEC54753A3C2BD4506"
}
},
{
{
{
true,
"/Game/Athena/Prototype/Blueprints/Cattus/BP_CattusDoggus_Scripting.BP_CattusDoggus_Scripting_C.startevent"
},
0
}
},
"/Game/Athena/Prototype/Blueprints/Cattus/BP_CattusDoggus_Scripting.BP_CattusDoggus_Scripting_C",
"/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High",
9.40, // also 9.41
false
),
Event
(
"The Unvaulting",
"/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C",
"/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C.LoadSnowLevel",
1,
{
// todo?
},
{
{
{
true,
"/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C.FinalSequence"
},
0
}
},
"/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C",
"/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High",
8.51
// Probably requires playlist
), ),
Event Event
( (
@@ -136,7 +191,8 @@ static inline std::vector<Event> Events =
"/Game/Athena/Prototype/Blueprints/NightNight/BP_NightNight_Scripting.BP_NightNight_Scripting_C", "/Game/Athena/Prototype/Blueprints/NightNight/BP_NightNight_Scripting.BP_NightNight_Scripting_C",
"/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High", "/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High",
10.40 10.40,
false
), ),
Event Event
( (
@@ -202,7 +258,9 @@ static inline std::vector<Event> Events =
"/Game/Athena/Environments/Festivus/Blueprints/BP_FestivusManager.BP_FestivusManager_C", "/Game/Athena/Environments/Festivus/Blueprints/BP_FestivusManager.BP_FestivusManager_C",
"/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High", "/Game/Athena/Playlists/Music/Playlist_Music_High.Playlist_Music_High",
7.30 7.30
// Not sure if this requires playlist.
), ),
Event Event
( (
"Rift Tour", "Rift Tour",
@@ -290,6 +348,7 @@ static inline bool HasEvent()
static inline bool RequiresEventPlaylist() static inline bool RequiresEventPlaylist()
{ {
return false; // todo return false; // todo
// return GetOurEvent().PlaylistName != "/Game/Athena/Playlists/Playlist_DefaultSolo.Playlist_DefaultSolo";
} }
static inline UObject* GetEventScripting() static inline UObject* GetEventScripting()

View File

@@ -1,5 +1,7 @@
#pragma once #pragma once
#include <atomic>
#include "inc.h" #include "inc.h"
namespace Globals namespace Globals
@@ -9,7 +11,8 @@ namespace Globals
extern inline bool bEnableAGIDs = false; extern inline bool bEnableAGIDs = false;
extern inline bool bNoMCP = true; extern inline bool bNoMCP = true;
extern inline bool bLogProcessEvent = false; extern inline bool bLogProcessEvent = false;
extern inline bool bLateGame = false; // extern inline bool bLateGame = false;
extern inline std::atomic<bool> bLateGame(false);
extern inline bool bInfiniteMaterials = false; extern inline bool bInfiniteMaterials = false;
extern inline bool bInfiniteAmmo = false; extern inline bool bInfiniteAmmo = false;

View File

@@ -350,6 +350,8 @@ void PlayerTabs()
} }
} }
static bool bStartedBus = false;
void MainUI() void MainUI()
{ {
bool bLoaded = true; bool bLoaded = true;
@@ -366,7 +368,7 @@ void MainUI()
#ifndef PROD #ifndef PROD
ImGui::Checkbox("Log ProcessEvent", &Globals::bLogProcessEvent); ImGui::Checkbox("Log ProcessEvent", &Globals::bLogProcessEvent);
#endif #endif
ImGui::Text(std::format("Listening {}", Globals::bStartedListening).c_str()); ImGui::Text(std::format("Joinable {}", Globals::bStartedListening).c_str());
static std::string ConsoleCommand; static std::string ConsoleCommand;
@@ -412,6 +414,7 @@ void MainUI()
Globals::bInitializedPlaylist = false; Globals::bInitializedPlaylist = false;
Globals::bStartedListening = false; Globals::bStartedListening = false;
Globals::bHitReadyToStartMatch = false; Globals::bHitReadyToStartMatch = false;
bStartedBus = false;
AmountOfRestarts++; AmountOfRestarts++;
} }
else else
@@ -420,141 +423,148 @@ void MainUI()
} }
} }
if (Globals::bLateGame) if (!bStartedBus)
{ {
if (ImGui::Button("Start Bus")) if (Globals::bLateGame.load())
{ {
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode(); if (ImGui::Button("Start Bus"))
auto GameState = GameMode->GetGameState();
static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
{ {
Sleep(500); bStartedBus = true;
}
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr); auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
auto GameState = GameMode->GetGameState();
static auto SafeZoneLocationsOffset = GameMode->GetOffset("SafeZoneLocations"); static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
auto& SafeZoneLocations = GameMode->Get<TArray<FVector>>(SafeZoneLocationsOffset);
LOG_INFO(LogDev, "SafeZoneLocations.Num(): {}", SafeZoneLocations.Num()); UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
static auto SafeZoneIndicatorOffset = GameState->GetOffset("SafeZoneIndicator"); while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
GameState->Get<float>(SafeZonesStartTimeOffset) = 0;
while (!GameState->Get(SafeZoneIndicatorOffset))
{
Sleep(500);
}
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
{
Sleep(500);
}
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter");
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset); // SafeZoneLocations.at(4);
LocationToStartAircraft.Z += 10000;
for (int i = 0; i < GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num(); i++)
{
GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->TeleportTo(LocationToStartAircraft, FRotator());
static auto FlightInfoOffset = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetOffset("FlightInfo");
auto FlightInfo = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
FlightInfo->GetFlightSpeed() = 0;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = 0.0f;
}
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
auto MapInfo = GameState->Get(MapInfoOffset);
if (MapInfo)
{
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos");
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
for (int i = 0; i < FlightInfos.Num(); i++)
{ {
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize()); Sleep(500);
}
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr);
static auto SafeZoneLocationsOffset = GameMode->GetOffset("SafeZoneLocations");
auto& SafeZoneLocations = GameMode->Get<TArray<FVector>>(SafeZoneLocationsOffset);
LOG_INFO(LogDev, "SafeZoneLocations.Num(): {}", SafeZoneLocations.Num());
static auto SafeZoneIndicatorOffset = GameState->GetOffset("SafeZoneIndicator");
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
GameState->Get<float>(SafeZonesStartTimeOffset) = 0;
while (!GameState->Get(SafeZoneIndicatorOffset))
{
Sleep(500);
}
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
{
Sleep(500);
}
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter");
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset); // SafeZoneLocations.at(4);
LocationToStartAircraft.Z += 10000;
for (int i = 0; i < GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num(); i++)
{
GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->TeleportTo(LocationToStartAircraft, FRotator());
static auto FlightInfoOffset = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetOffset("FlightInfo");
auto FlightInfo = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
FlightInfo->GetFlightSpeed() = 0; FlightInfo->GetFlightSpeed() = 0;
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft; FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
FlightInfo->GetTimeTillDropStart() = 0.0f; FlightInfo->GetTimeTillDropStart() = 0.0f;
} }
}
static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked"); static auto MapInfoOffset = GameState->GetOffset("MapInfo");
static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked")); auto MapInfo = GameState->Get(MapInfoOffset);
GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false);
}
}
else
{
if (ImGui::Button("Start Bus Countdown"))
{
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
auto GameState = GameMode->GetGameState();
if (Fortnite_Version == 1.11) if (MapInfo)
{
static auto OverrideBattleBusSkin = FindObject("/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
if (OverrideBattleBusSkin)
{ {
static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager"); static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos");
auto AssetManager = GetEngine()->Get(AssetManagerOffset); auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
if (AssetManager) LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
for (int i = 0; i < FlightInfos.Num(); i++)
{ {
static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData"); auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
auto AthenaGameData = AssetManager->Get(AthenaGameDataOffset);
if (AthenaGameData) FlightInfo->GetFlightSpeed() = 0;
{ FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
static auto DefaultBattleBusSkinOffset = AthenaGameData->GetOffset("DefaultBattleBusSkin"); FlightInfo->GetTimeTillDropStart() = 0.0f;
AthenaGameData->Get(DefaultBattleBusSkinOffset) = OverrideBattleBusSkin;
}
} }
}
static auto DefaultBattleBusOffset = GameState->GetOffset("DefaultBattleBus"); static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked");
GameState->Get(DefaultBattleBusOffset) = OverrideBattleBusSkin; static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked"));
GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false);
}
}
else
{
if (ImGui::Button("Start Bus Countdown"))
{
bStartedBus = true;
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft"); auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass); auto GameState = GameMode->GetGameState();
for (int i = 0; i < AllAircrafts.Num(); i++) if (Fortnite_Version == 1.11)
{
static auto OverrideBattleBusSkin = FindObject("/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
if (OverrideBattleBusSkin)
{ {
auto Aircraft = AllAircrafts.at(i); static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager");
auto AssetManager = GetEngine()->Get(AssetManagerOffset);
static auto DefaultBusSkinOffset = Aircraft->GetOffset("DefaultBusSkin"); if (AssetManager)
Aircraft->Get(DefaultBusSkinOffset) = OverrideBattleBusSkin;
static auto SpawnedCosmeticActorOffset = Aircraft->GetOffset("SpawnedCosmeticActor");
auto SpawnedCosmeticActor = Aircraft->Get<AActor*>(SpawnedCosmeticActorOffset);
if (SpawnedCosmeticActor)
{ {
static auto ActiveSkinOffset = SpawnedCosmeticActor->GetOffset("ActiveSkin"); static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData");
SpawnedCosmeticActor->Get(ActiveSkinOffset) = OverrideBattleBusSkin; auto AthenaGameData = AssetManager->Get(AthenaGameDataOffset);
if (AthenaGameData)
{
static auto DefaultBattleBusSkinOffset = AthenaGameData->GetOffset("DefaultBattleBusSkin");
AthenaGameData->Get(DefaultBattleBusSkinOffset) = OverrideBattleBusSkin;
}
}
static auto DefaultBattleBusOffset = GameState->GetOffset("DefaultBattleBus");
GameState->Get(DefaultBattleBusOffset) = OverrideBattleBusSkin;
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft");
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
for (int i = 0; i < AllAircrafts.Num(); i++)
{
auto Aircraft = AllAircrafts.at(i);
static auto DefaultBusSkinOffset = Aircraft->GetOffset("DefaultBusSkin");
Aircraft->Get(DefaultBusSkinOffset) = OverrideBattleBusSkin;
static auto SpawnedCosmeticActorOffset = Aircraft->GetOffset("SpawnedCosmeticActor");
auto SpawnedCosmeticActor = Aircraft->Get<AActor*>(SpawnedCosmeticActorOffset);
if (SpawnedCosmeticActor)
{
static auto ActiveSkinOffset = SpawnedCosmeticActor->GetOffset("ActiveSkin");
SpawnedCosmeticActor->Get(ActiveSkinOffset) = OverrideBattleBusSkin;
}
} }
} }
} }
}
GameState->Get<float>("WarmupCountdownEndTime") = UGameplayStatics::GetTimeSeconds(GetWorld()) + 10; GameState->Get<float>("WarmupCountdownEndTime") = UGameplayStatics::GetTimeSeconds(GetWorld()) + 10;
}
} }
} }
} }
@@ -571,6 +581,25 @@ void MainUI()
{ {
StartEvent(); StartEvent();
} }
if (Fortnite_Version == 8.51)
{
if (ImGui::Button("Unvault DrumGun"))
{
static auto SetUnvaultItemNameFn = FindObject<UFunction>("/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C.SetUnvaultItemName");
auto EventScripting = GetEventScripting();
if (EventScripting)
{
FName Name = UKismetStringLibrary::Conv_StringToName(L"DrumGun");
EventScripting->ProcessEvent(SetUnvaultItemNameFn, &Name);
static auto PillarsConcludedFn = FindObject<UFunction>("/Game/Athena/Prototype/Blueprints/White/BP_SnowScripting.BP_SnowScripting_C.PillarsConcluded");
EventScripting->ProcessEvent(PillarsConcludedFn, &Name);
}
}
}
} }
else if (Tab == DUMP_TAB) else if (Tab == DUMP_TAB)
@@ -714,7 +743,9 @@ void PregameUI()
ImGui::Checkbox("Creative", &Globals::bCreative); ImGui::Checkbox("Creative", &Globals::bCreative);
} }
ImGui::Checkbox("Lategame", &Globals::bLateGame); bool bWillBeLategame = Globals::bLateGame.load();
ImGui::Checkbox("Lategame", &bWillBeLategame);
Globals::bLateGame.store(bWillBeLategame);
if (HasEvent()) if (HasEvent())
{ {