mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
quite a bit
llamas, fix some ltm specific stuff, add auto bus start for auto restart, work in progress lategame on 1.11, fix a crash, performance
This commit is contained in:
84
Project Reboot 3.0/FortAthenaMapInfo.cpp
Normal file
84
Project Reboot 3.0/FortAthenaMapInfo.cpp
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#include "FortAthenaMapInfo.h"
|
||||||
|
#include "GameplayStatics.h"
|
||||||
|
#include "FortAthenaSupplyDrop.h"
|
||||||
|
#include "FortGameModeAthena.h"
|
||||||
|
#include "Vector2D.h"
|
||||||
|
|
||||||
|
FVector2D GenerateRandomVector2D(float Radius)
|
||||||
|
{
|
||||||
|
float v3;
|
||||||
|
float v4;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
v3 = (float)((float)rand() * 0.000061037019) - 1.0;
|
||||||
|
v4 = (float)((float)rand() * 0.000061037019) - 1.0;
|
||||||
|
} while ((float)((float)(v4 * v4) + (float)(v3 * v3)) > 1.0);
|
||||||
|
|
||||||
|
return FVector2D(v3 * Radius, v4 * Radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
FVector AFortAthenaMapInfo::PickSupplyDropLocation(FVector Center, float Radius)
|
||||||
|
{
|
||||||
|
static FVector* (*PickSupplyDropLocationOriginal)(AFortAthenaMapInfo* MapInfo, FVector* outLocation, __int64 Center, float Radius) = decltype(PickSupplyDropLocationOriginal)(Addresses::PickSupplyDropLocation);
|
||||||
|
|
||||||
|
if (!PickSupplyDropLocationOriginal)
|
||||||
|
return FVector(0, 0, 0);
|
||||||
|
|
||||||
|
// LOG_INFO(LogDev, "GetAircraftDropVolume: {}", __int64(GetAircraftDropVolume()));
|
||||||
|
|
||||||
|
FVector Out = FVector(0, 0, 0);
|
||||||
|
auto ahh = PickSupplyDropLocationOriginal(this, &Out, __int64(&Center), Radius);
|
||||||
|
return Out;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AFortAthenaMapInfo::SpawnLlamas()
|
||||||
|
{
|
||||||
|
if (!GetLlamaClass())
|
||||||
|
{
|
||||||
|
// LOG_INFO(LogDev, "No Llama Class, is this intended?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto AmountOfLlamasToSpawn = CalcuateCurveMinAndMax(GetLlamaQuantityMin(), GetLlamaQuantityMax(), 1);
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Attempting to spawn {} llamas.", AmountOfLlamasToSpawn);
|
||||||
|
|
||||||
|
for (int i = 0; i < AmountOfLlamasToSpawn; i++)
|
||||||
|
{
|
||||||
|
FVector Location = PickSupplyDropLocation(FVector(1, 1, 10000), 30000);
|
||||||
|
|
||||||
|
// LOG_INFO(LogDev, "Initial Llama at {} {} {}", Location.X, Location.Y, Location.Z);
|
||||||
|
|
||||||
|
if (Location == FVector(0, 0, 0))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
FRotator RandomYawRotator = FRotator();
|
||||||
|
RandomYawRotator.Yaw = (float)rand() * 0.010986663;
|
||||||
|
|
||||||
|
FTransform InitialSpawnTransform;
|
||||||
|
InitialSpawnTransform.Translation = Location;
|
||||||
|
InitialSpawnTransform.Rotation = RandomYawRotator.Quaternion();
|
||||||
|
InitialSpawnTransform.Scale3D = FVector(1, 1, 1);
|
||||||
|
|
||||||
|
FActorSpawnParameters SpawnParameters{};
|
||||||
|
SpawnParameters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
|
SpawnParameters.bDeferConstruction = true;
|
||||||
|
|
||||||
|
auto LlamaStart = GetWorld()->SpawnActor<AFortAthenaSupplyDrop>(GetLlamaClass(), InitialSpawnTransform, SpawnParameters);
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "LlamaStart: {}", __int64(LlamaStart));
|
||||||
|
|
||||||
|
if (!LlamaStart)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
auto GroundLocation = LlamaStart->FindGroundLocationAt(InitialSpawnTransform.Translation);
|
||||||
|
|
||||||
|
FTransform FinalSpawnTransform = InitialSpawnTransform;
|
||||||
|
FinalSpawnTransform.Translation = GroundLocation;
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Spawning Llama at {} {} {}", GroundLocation.X, GroundLocation.Y, GroundLocation.Z);
|
||||||
|
|
||||||
|
UGameplayStatics::FinishSpawningActor(LlamaStart, FinalSpawnTransform);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,15 +6,16 @@
|
|||||||
|
|
||||||
#include "GameplayAbilityTypes.h"
|
#include "GameplayAbilityTypes.h"
|
||||||
#include "DataTableFunctionLibrary.h"
|
#include "DataTableFunctionLibrary.h"
|
||||||
|
#include "SoftObjectPtr.h"
|
||||||
|
|
||||||
static inline float CalcuateCurveMinAndMax(FScalableFloat* Min, FScalableFloat* Max) // returns 000 not 0.00 (forgot techinal name for this)
|
static inline float CalcuateCurveMinAndMax(FScalableFloat* Min, FScalableFloat* Max, float Multiplier = 100.f) // returns 000 not 0.00 (forgot techinal name for this)
|
||||||
{
|
{
|
||||||
float MinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(Min->GetCurve().CurveTable, Min->GetCurve().RowName, 0);
|
float MinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(Min->GetCurve().CurveTable, Min->GetCurve().RowName, 0);
|
||||||
float MaxSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(Max->GetCurve().CurveTable, Max->GetCurve().RowName, 0);
|
float MaxSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(Max->GetCurve().CurveTable, Max->GetCurve().RowName, 0);
|
||||||
|
|
||||||
std::random_device MinMaxRd;
|
std::random_device MinMaxRd;
|
||||||
std::mt19937 MinMaxGen(MinMaxRd());
|
std::mt19937 MinMaxGen(MinMaxRd());
|
||||||
std::uniform_int_distribution<> MinMaxDis(MinSpawnPercent * 100, MaxSpawnPercent * 100 + 1); // + 1 ?
|
std::uniform_int_distribution<> MinMaxDis(MinSpawnPercent * Multiplier, MaxSpawnPercent * Multiplier + 1); // + 1 ?
|
||||||
|
|
||||||
float SpawnPercent = MinMaxDis(MinMaxGen);
|
float SpawnPercent = MinMaxDis(MinMaxGen);
|
||||||
|
|
||||||
@@ -129,4 +130,35 @@ public:
|
|||||||
static auto BuildingGameplayActorSpawnDetailsOffset = GetOffset("BuildingGameplayActorSpawnDetails");
|
static auto BuildingGameplayActorSpawnDetailsOffset = GetOffset("BuildingGameplayActorSpawnDetails");
|
||||||
return Get<TArray<FBuildingGameplayActorSpawnDetails>>(BuildingGameplayActorSpawnDetailsOffset);
|
return Get<TArray<FBuildingGameplayActorSpawnDetails>>(BuildingGameplayActorSpawnDetailsOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FScalableFloat* GetLlamaQuantityMin()
|
||||||
|
{
|
||||||
|
static auto LlamaQuantityMinOffset = GetOffset("LlamaQuantityMin");
|
||||||
|
return GetPtr<FScalableFloat>(LlamaQuantityMinOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
FScalableFloat* GetLlamaQuantityMax()
|
||||||
|
{
|
||||||
|
static auto LlamaQuantityMaxOffset = GetOffset("LlamaQuantityMax");
|
||||||
|
return GetPtr<FScalableFloat>(LlamaQuantityMaxOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
UClass* GetLlamaClass()
|
||||||
|
{
|
||||||
|
static auto LlamaClassOffset = GetOffset("LlamaClass", false);
|
||||||
|
|
||||||
|
if (LlamaClassOffset == -1)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return Get<UClass*>(LlamaClassOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
AActor*& GetAircraftDropVolume() // actually AVolume
|
||||||
|
{
|
||||||
|
static auto AircraftDropVolumeOffset = GetOffset("AircraftDropVolume");
|
||||||
|
return Get<AActor*>(AircraftDropVolumeOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
FVector PickSupplyDropLocation(FVector Center, float Radius);
|
||||||
|
void SpawnLlamas();
|
||||||
};
|
};
|
||||||
@@ -30,4 +30,15 @@ static inline void LoopMutators(std::function<void(AFortAthenaMutator*)> Callbac
|
|||||||
}
|
}
|
||||||
|
|
||||||
AllMutators.Free();
|
AllMutators.Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename MutatorType = AFortAthenaMutator>
|
||||||
|
static inline MutatorType* FindFirstMutator(UClass* MutatorClass = MutatorType::StaticClass())
|
||||||
|
{
|
||||||
|
auto AllMutators = UGameplayStatics::GetAllActorsOfClass(GetWorld(), MutatorClass);
|
||||||
|
auto FirstMutator = AllMutators.Num() >= 1 ? AllMutators.at(0) : nullptr;
|
||||||
|
|
||||||
|
AllMutators.Free();
|
||||||
|
|
||||||
|
return (MutatorType*)FirstMutator;
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Food Fight
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "FortAthenaMutator.h"
|
#include "FortAthenaMutator.h"
|
||||||
@@ -5,6 +7,18 @@
|
|||||||
#include "AthenaBarrierObjective.h"
|
#include "AthenaBarrierObjective.h"
|
||||||
#include "AthenaBarrierFlag.h"
|
#include "AthenaBarrierFlag.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
EVENT IDS (got on 10.40):
|
||||||
|
|
||||||
|
WallComingDown - 1
|
||||||
|
WallDown - 2
|
||||||
|
// IDK REST COMPILER WAS TOO SMART
|
||||||
|
Intro - 9
|
||||||
|
NoMoreRespawns - 10
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
struct FBarrierTeamState // Idk if this actually changes
|
struct FBarrierTeamState // Idk if this actually changes
|
||||||
{
|
{
|
||||||
static UStruct* GetStruct()
|
static UStruct* GetStruct()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
void AFortAthenaMutator_Disco::OnGamePhaseStepChangedHook(UObject* Context, FFrame& Stack, void* Ret)
|
void AFortAthenaMutator_Disco::OnGamePhaseStepChangedHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||||
{
|
{
|
||||||
TScriptInterface<UObject> SafeZoneInterface;
|
/* TScriptInterface<UObject> SafeZoneInterface;
|
||||||
EAthenaGamePhaseStep GamePhaseStep = EAthenaGamePhaseStep::BusFlying;
|
EAthenaGamePhaseStep GamePhaseStep = EAthenaGamePhaseStep::BusFlying;
|
||||||
|
|
||||||
static auto SafeZoneInterfaceOffset = FindOffsetStruct("/Script/FortniteGame.FortAthenaMutator_Disco.OnGamePhaseStepChanged", "SafeZoneInterface", false);
|
static auto SafeZoneInterfaceOffset = FindOffsetStruct("/Script/FortniteGame.FortAthenaMutator_Disco.OnGamePhaseStepChanged", "SafeZoneInterface", false);
|
||||||
@@ -10,9 +10,9 @@ void AFortAthenaMutator_Disco::OnGamePhaseStepChangedHook(UObject* Context, FFra
|
|||||||
if (SafeZoneInterfaceOffset != -1)
|
if (SafeZoneInterfaceOffset != -1)
|
||||||
Stack.StepCompiledIn(&SafeZoneInterface);
|
Stack.StepCompiledIn(&SafeZoneInterface);
|
||||||
|
|
||||||
// Stack.StepCompiledIn(&GamePhaseStep, true);
|
Stack.StepCompiledIn(&GamePhaseStep, true); */
|
||||||
|
|
||||||
LOG_INFO(LogDev, "{} GamePhaseStep: {}", __FUNCTION__, (int)GamePhaseStep);
|
// LOG_INFO(LogDev, "{} GamePhaseStep: {}", __FUNCTION__, (int)GamePhaseStep);
|
||||||
|
|
||||||
return OnGamePhaseStepChangedOriginal(Context, Stack, Ret);
|
return OnGamePhaseStepChangedOriginal(Context, Stack, Ret);
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Disco Domination
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "FortAthenaMutator.h"
|
#include "FortAthenaMutator.h"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Gun Game
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
|
|||||||
@@ -22,12 +22,18 @@ struct FHeistExitCraftSpawnData : public FFortPieSliceSpawnData
|
|||||||
class AFortAthenaMutator_Heist : public AFortAthenaMutator
|
class AFortAthenaMutator_Heist : public AFortAthenaMutator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TArray<FHeistExitCraftSpawnData>& GetHeistExitCraftSpawnData()
|
/* TArray<FHeistExitCraftSpawnData>& GetHeistExitCraftSpawnData()
|
||||||
{
|
{
|
||||||
static auto HeistExitCraftSpawnDataOffset = GetOffset("HeistExitCraftSpawnData");
|
static auto HeistExitCraftSpawnDataOffset = GetOffset("HeistExitCraftSpawnData");
|
||||||
return Get<TArray<FHeistExitCraftSpawnData>>(HeistExitCraftSpawnDataOffset);
|
return Get<TArray<FHeistExitCraftSpawnData>>(HeistExitCraftSpawnDataOffset);
|
||||||
}
|
} */
|
||||||
|
|
||||||
|
float& GetSpawnExitCraftTime()
|
||||||
|
{
|
||||||
|
static auto SpawnExitCraftTimeOffset = GetOffset("SpawnExitCraftTime");
|
||||||
|
return Get<float>(SpawnExitCraftTimeOffset);
|
||||||
|
}
|
||||||
|
|
||||||
static UClass* StaticClass()
|
static UClass* StaticClass()
|
||||||
{
|
{
|
||||||
static auto Class = FindObject<UClass>("/Script/FortniteGame.FortAthenaMutator_Heist");
|
static auto Class = FindObject<UClass>("/Script/FortniteGame.FortAthenaMutator_Heist");
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
#include "FortAthenaSupplyDrop.h"
|
#include "FortAthenaSupplyDrop.h"
|
||||||
|
|
||||||
|
FVector AFortAthenaSupplyDrop::FindGroundLocationAt(FVector InLocation)
|
||||||
|
{
|
||||||
|
static auto FindGroundLocationAtFn = FindObject<UFunction>("/Script/FortniteGame.FortAthenaSupplyDrop.FindGroundLocationAt");
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
FVector InLocation; // (ConstParm, Parm, OutParm, ZeroConstructor, ReferenceParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
FVector ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||||
|
} AFortAthenaSupplyDrop_FindGroundLocationAt_Params{ InLocation };
|
||||||
|
|
||||||
|
this->ProcessEvent(FindGroundLocationAtFn, &AFortAthenaSupplyDrop_FindGroundLocationAt_Params);
|
||||||
|
|
||||||
|
return AFortAthenaSupplyDrop_FindGroundLocationAt_Params.ReturnValue;
|
||||||
|
}
|
||||||
|
|
||||||
AFortPickup* AFortAthenaSupplyDrop::SpawnPickupFromItemEntryHook(UObject* Context, FFrame& Stack, AFortPickup** Ret)
|
AFortPickup* AFortAthenaSupplyDrop::SpawnPickupFromItemEntryHook(UObject* Context, FFrame& Stack, AFortPickup** Ret)
|
||||||
{
|
{
|
||||||
LOG_INFO(LogDev, __FUNCTION__);
|
LOG_INFO(LogDev, __FUNCTION__);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public:
|
|||||||
static inline AFortPickup* (*SpawnGameModePickupOriginal)(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
static inline AFortPickup* (*SpawnGameModePickupOriginal)(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
||||||
static inline AFortPickup* (*SpawnPickupFromItemEntryOriginal)(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
static inline AFortPickup* (*SpawnPickupFromItemEntryOriginal)(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
||||||
|
|
||||||
|
FVector FindGroundLocationAt(FVector InLocation);
|
||||||
|
|
||||||
static AFortPickup* SpawnPickupFromItemEntryHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
static AFortPickup* SpawnPickupFromItemEntryHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
||||||
static AFortPickup* SpawnGameModePickupHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
static AFortPickup* SpawnGameModePickupHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
||||||
static AFortPickup* SpawnPickupHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
static AFortPickup* SpawnPickupHook(UObject* Context, FFrame& Stack, AFortPickup** Ret);
|
||||||
|
|||||||
@@ -480,11 +480,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
|||||||
{
|
{
|
||||||
LastNum = AmountOfRestarts;
|
LastNum = AmountOfRestarts;
|
||||||
|
|
||||||
float Duration = 10000.f;
|
|
||||||
float EarlyDuration = Duration;
|
|
||||||
|
|
||||||
float TimeSeconds = UGameplayStatics::GetTimeSeconds(GetWorld());
|
|
||||||
|
|
||||||
LOG_INFO(LogDev, "Initializing!");
|
LOG_INFO(LogDev, "Initializing!");
|
||||||
|
|
||||||
if (std::floor(Fortnite_Version) == 3)
|
if (std::floor(Fortnite_Version) == 3)
|
||||||
@@ -492,6 +487,11 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
|||||||
|
|
||||||
LOG_INFO(LogDev, "GameMode 0x{:x}", __int64(GameMode));
|
LOG_INFO(LogDev, "GameMode 0x{:x}", __int64(GameMode));
|
||||||
|
|
||||||
|
float Duration = 100000.f;
|
||||||
|
float EarlyDuration = Duration;
|
||||||
|
|
||||||
|
float TimeSeconds = UGameplayStatics::GetTimeSeconds(GetWorld());
|
||||||
|
|
||||||
static auto WarmupCountdownEndTimeOffset = GameState->GetOffset("WarmupCountdownEndTime");
|
static auto WarmupCountdownEndTimeOffset = GameState->GetOffset("WarmupCountdownEndTime");
|
||||||
static auto WarmupCountdownStartTimeOffset = GameState->GetOffset("WarmupCountdownStartTime");
|
static auto WarmupCountdownStartTimeOffset = GameState->GetOffset("WarmupCountdownStartTime");
|
||||||
static auto WarmupCountdownDurationOffset = GameMode->GetOffset("WarmupCountdownDuration");
|
static auto WarmupCountdownDurationOffset = GameMode->GetOffset("WarmupCountdownDuration");
|
||||||
@@ -729,6 +729,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
|||||||
|
|
||||||
static int CurrentTeamMembers = 0; // bad
|
static int CurrentTeamMembers = 0; // bad
|
||||||
static int Current = DefaultFirstTeam;
|
static int Current = DefaultFirstTeam;
|
||||||
|
static int NextTeamIndex = DefaultFirstTeam;
|
||||||
|
|
||||||
static int LastNum = 1;
|
static int LastNum = 1;
|
||||||
|
|
||||||
@@ -737,6 +738,7 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
|||||||
LastNum = Globals::AmountOfListens;
|
LastNum = Globals::AmountOfListens;
|
||||||
|
|
||||||
Current = DefaultFirstTeam;
|
Current = DefaultFirstTeam;
|
||||||
|
NextTeamIndex = DefaultFirstTeam;
|
||||||
CurrentTeamMembers = 0;
|
CurrentTeamMembers = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,8 +783,6 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
|||||||
TeamsNum = 100;
|
TeamsNum = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int NextTeamIndex = DefaultFirstTeam;
|
|
||||||
|
|
||||||
LOG_INFO(LogTeams, "Before team assigning NextTeamIndex: {} CurrentTeamMembers: {}", NextTeamIndex, CurrentTeamMembers);
|
LOG_INFO(LogTeams, "Before team assigning NextTeamIndex: {} CurrentTeamMembers: {}", NextTeamIndex, CurrentTeamMembers);
|
||||||
|
|
||||||
if (!bShouldSpreadTeams)
|
if (!bShouldSpreadTeams)
|
||||||
@@ -829,6 +829,34 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
|||||||
|
|
||||||
LOG_INFO(LogPlayer, "HandleStartingNewPlayer!");
|
LOG_INFO(LogPlayer, "HandleStartingNewPlayer!");
|
||||||
|
|
||||||
|
if (Globals::bAutoRestart)
|
||||||
|
{
|
||||||
|
static int LastNum123 = 15;
|
||||||
|
|
||||||
|
if (GetWorld()->GetNetDriver()->GetClientConnections().Num() >= NumRequiredPlayersToStart && LastNum123 != Globals::AmountOfListens)
|
||||||
|
{
|
||||||
|
LastNum123 = Globals::AmountOfListens;
|
||||||
|
|
||||||
|
float Duration = AutoBusStartSeconds;
|
||||||
|
float EarlyDuration = Duration;
|
||||||
|
|
||||||
|
float TimeSeconds = UGameplayStatics::GetTimeSeconds(GetWorld());
|
||||||
|
|
||||||
|
static auto WarmupCountdownEndTimeOffset = GameState->GetOffset("WarmupCountdownEndTime");
|
||||||
|
static auto WarmupCountdownStartTimeOffset = GameState->GetOffset("WarmupCountdownStartTime");
|
||||||
|
static auto WarmupCountdownDurationOffset = GameMode->GetOffset("WarmupCountdownDuration");
|
||||||
|
static auto WarmupEarlyCountdownDurationOffset = GameMode->GetOffset("WarmupEarlyCountdownDuration");
|
||||||
|
|
||||||
|
GameState->Get<float>(WarmupCountdownEndTimeOffset) = TimeSeconds + Duration;
|
||||||
|
GameMode->Get<float>(WarmupCountdownDurationOffset) = Duration;
|
||||||
|
|
||||||
|
GameState->Get<float>(WarmupCountdownStartTimeOffset) = TimeSeconds;
|
||||||
|
GameMode->Get<float>(WarmupEarlyCountdownDurationOffset) = EarlyDuration;
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Auto starting bus in {}.", AutoBusStartSeconds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (Engine_Version < 427)
|
// if (Engine_Version < 427)
|
||||||
{
|
{
|
||||||
static int LastNum69 = 19451;
|
static int LastNum69 = 19451;
|
||||||
@@ -837,11 +865,14 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
|||||||
{
|
{
|
||||||
LastNum69 = Globals::AmountOfListens;
|
LastNum69 = Globals::AmountOfListens;
|
||||||
|
|
||||||
bool bShouldDestroyVendingMachines = Fortnite_Version < 3.4 || Engine_Version >= 424; // This is not how it works, we need to add the spawn percentage.
|
// is there spawn percentage for vending machines?
|
||||||
|
|
||||||
if (!bShouldDestroyVendingMachines) // idk how to set the mat count sooooo problem for later me
|
bool bShouldDestroyVendingMachines = Fortnite_Version < 3.4 || Engine_Version >= 424;
|
||||||
|
|
||||||
|
if (!bShouldDestroyVendingMachines)
|
||||||
{
|
{
|
||||||
FillVendingMachines();
|
if (Globals::bFillVendingMachines)
|
||||||
|
FillVendingMachines();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -861,15 +892,21 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
|||||||
AllVendingMachines.Free();
|
AllVendingMachines.Free();
|
||||||
}
|
}
|
||||||
|
|
||||||
SpawnBGAs();
|
if (Fortnite_Version < 19) // fr idk what i did too lazy to debug
|
||||||
|
SpawnBGAs();
|
||||||
|
|
||||||
// Handle spawn rate
|
// Handle spawn rate
|
||||||
|
|
||||||
if (false)
|
auto MapInfo = GameState->GetMapInfo();
|
||||||
{
|
|
||||||
auto MapInfo = GameState->GetMapInfo();
|
|
||||||
|
|
||||||
if (MapInfo)
|
if (MapInfo)
|
||||||
|
{
|
||||||
|
if (Fortnite_Version >= 3.3)
|
||||||
|
{
|
||||||
|
MapInfo->SpawnLlamas();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false)
|
||||||
{
|
{
|
||||||
float AmmoBoxMinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(
|
float AmmoBoxMinSpawnPercent = UDataTableFunctionLibrary::EvaluateCurveTableRow(
|
||||||
MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().RowName, 0
|
MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().CurveTable, MapInfo->GetAmmoBoxMinSpawnPercent()->GetCurve().RowName, 0
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "reboot.h"
|
#include "reboot.h"
|
||||||
#include "FortPlayerStateAthena.h"
|
#include "FortPlayerStateAthena.h"
|
||||||
#include "FortGameModeAthena.h"
|
#include "FortGameModeAthena.h"
|
||||||
|
#include "FortAthenaMutator.h"
|
||||||
|
|
||||||
/* void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState)
|
/* void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState)
|
||||||
{
|
{
|
||||||
@@ -36,6 +37,33 @@ TScriptInterface<UFortSafeZoneInterface> AFortGameStateAthena::GetSafeZoneInterf
|
|||||||
return ScriptInterface;
|
return ScriptInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AFortGameStateAthena::SetGamePhaseStep(EAthenaGamePhaseStep NewGamePhaseStep)
|
||||||
|
{
|
||||||
|
this->GetGamePhaseStep() = NewGamePhaseStep;
|
||||||
|
|
||||||
|
std::vector<std::pair<AFortAthenaMutator*, UFunction*>> FunctionsToCall;
|
||||||
|
|
||||||
|
LoopMutators([&](AFortAthenaMutator* Mutator) { FunctionsToCall.push_back(std::make_pair(Mutator, Mutator->FindFunction("OnGamePhaseStepChanged"))); });
|
||||||
|
|
||||||
|
for (auto& FunctionToCallPair : FunctionsToCall)
|
||||||
|
{
|
||||||
|
// On newer versions there is a second param.
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "A1: {} FunctionToCallPair.second: {}", FunctionToCallPair.first->IsValidLowLevel() ? FunctionToCallPair.first->GetFullName() : "BadRead", __int64(FunctionToCallPair.second));
|
||||||
|
|
||||||
|
if (FunctionToCallPair.second->IsValidLowLevel() && FunctionToCallPair.first->IsValidLowLevel())
|
||||||
|
{
|
||||||
|
auto Params = ConstructOnGamePhaseStepChangedParams(NewGamePhaseStep);
|
||||||
|
|
||||||
|
if (Params)
|
||||||
|
{
|
||||||
|
FunctionToCallPair.first->ProcessEvent(FunctionToCallPair.second, Params);
|
||||||
|
VirtualFree(Params, 0, MEM_RELEASE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UFortPlaylist*& AFortGameStateAthena::GetCurrentPlaylist()
|
UFortPlaylist*& AFortGameStateAthena::GetCurrentPlaylist()
|
||||||
{
|
{
|
||||||
static auto CurrentPlaylistInfoOffset = GetOffset("CurrentPlaylistInfo", false);
|
static auto CurrentPlaylistInfoOffset = GetOffset("CurrentPlaylistInfo", false);
|
||||||
|
|||||||
@@ -86,6 +86,14 @@ public:
|
|||||||
return Get<AFortAthenaMapInfo*>(MapInfoOffset);
|
return Get<AFortAthenaMapInfo*>(MapInfoOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EAthenaGamePhaseStep& GetGamePhaseStep()
|
||||||
|
{
|
||||||
|
static auto GamePhaseStepOffset = GetOffset("GamePhaseStep");
|
||||||
|
return Get<EAthenaGamePhaseStep>(GamePhaseStepOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetGamePhaseStep(EAthenaGamePhaseStep NewGamePhaseStep);
|
||||||
|
|
||||||
UFortPlaylist*& GetCurrentPlaylist();
|
UFortPlaylist*& GetCurrentPlaylist();
|
||||||
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();
|
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ std::pair<std::vector<UFortItem*>, std::vector<UFortItem*>> AFortInventory::AddI
|
|||||||
|
|
||||||
if (PickaxeInstance)
|
if (PickaxeInstance)
|
||||||
{
|
{
|
||||||
RemoveItem(PickaxeInstance->GetItemEntry()->GetItemGuid(), nullptr, PickaxeInstance->GetItemEntry()->GetCount(), true);
|
// RemoveItem(PickaxeInstance->GetItemEntry()->GetItemGuid(), nullptr, PickaxeInstance->GetItemEntry()->GetCount(), true);
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ bool AFortInventory::RemoveItem(const FGuid& ItemGuid, bool* bShouldUpdate, int
|
|||||||
|
|
||||||
if (Fortnite_Version < 7)
|
if (Fortnite_Version < 7)
|
||||||
{
|
{
|
||||||
FortPlayerController->AddPickaxeToInventory();
|
// FortPlayerController->AddPickaxeToInventory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ std::vector<LootDrop> PickLootDrops(FName TierGroupName, bool bPrint, int recurs
|
|||||||
{
|
{
|
||||||
std::vector<LootDrop> LootDrops;
|
std::vector<LootDrop> LootDrops;
|
||||||
|
|
||||||
if (recursive > 10)
|
if (recursive > 6)
|
||||||
return LootDrops;
|
return LootDrops;
|
||||||
|
|
||||||
auto GameState = ((AFortGameModeAthena*)GetWorld()->GetGameMode())->GetGameStateAthena();
|
auto GameState = ((AFortGameModeAthena*)GetWorld()->GetGameMode())->GetGameStateAthena();
|
||||||
@@ -505,7 +505,7 @@ std::vector<LootDrop> PickLootDrops(FName TierGroupName, bool bPrint, int recurs
|
|||||||
|
|
||||||
if (ChosenLootPackageName.contains(".Empty")) // I don't think?
|
if (ChosenLootPackageName.contains(".Empty")) // I don't think?
|
||||||
{
|
{
|
||||||
return PickLootDrops(TierGroupName, bPrint);
|
return PickLootDrops(TierGroupName, bPrint, ++recursive);
|
||||||
// return LootDrops;
|
// return LootDrops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -586,8 +586,6 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
|
|||||||
if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent)
|
if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent)
|
||||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); // We want to be teleported back to the UFO but we dont use chooseplayerstart
|
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation); // We want to be teleported back to the UFO but we dont use chooseplayerstart
|
||||||
|
|
||||||
LOG_INFO(LogDev, "PlayerController: {}", __int64(PlayerController));
|
|
||||||
|
|
||||||
if (!PlayerController)
|
if (!PlayerController)
|
||||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||||
|
|
||||||
@@ -597,13 +595,25 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
|
|||||||
auto GameMode = (AFortGameModeAthena*)GetWorld()->GetGameMode();
|
auto GameMode = (AFortGameModeAthena*)GetWorld()->GetGameMode();
|
||||||
auto GameState = GameMode->GetGameStateAthena();
|
auto GameState = GameMode->GetGameStateAthena();
|
||||||
|
|
||||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
|
AActor* AircraftToJumpFrom = nullptr;
|
||||||
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
|
|
||||||
|
|
||||||
if (Aircrafts->Num() <= 0)
|
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
|
||||||
|
|
||||||
|
if (AircraftsOffset == -1)
|
||||||
|
{
|
||||||
|
static auto AircraftOffset = GameState->GetOffset("Aircraft");
|
||||||
|
AircraftToJumpFrom = GameState->Get<AActor*>(AircraftOffset);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
|
||||||
|
AircraftToJumpFrom = Aircrafts->Num() > 0 ? Aircrafts->at(0) : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!AircraftToJumpFrom)
|
||||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||||
|
|
||||||
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, Aircrafts->at(0));
|
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, AircraftToJumpFrom);
|
||||||
PlayerController->Possess(NewPawn);
|
PlayerController->Possess(NewPawn);
|
||||||
|
|
||||||
auto NewPawnAsFort = Cast<AFortPawn>(NewPawn);
|
auto NewPawnAsFort = Cast<AFortPawn>(NewPawn);
|
||||||
|
|||||||
@@ -149,11 +149,7 @@ void AFortPlayerControllerAthena::EnterAircraftHook(UObject* PC, AActor* Aircraf
|
|||||||
WorldInventory->RemoveItem(Pair.first, nullptr, Pair.second, true);
|
WorldInventory->RemoveItem(Pair.first, nullptr, Pair.second, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static auto mutatorClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaMutator");
|
|
||||||
auto AllMutators = UGameplayStatics::GetAllActorsOfClass(GetWorld(), mutatorClass);
|
|
||||||
|
|
||||||
std::vector<std::pair<AFortAthenaMutator*, UFunction*>> FunctionsToCall;
|
std::vector<std::pair<AFortAthenaMutator*, UFunction*>> FunctionsToCall;
|
||||||
|
|
||||||
LoopMutators([&](AFortAthenaMutator* Mutator) { FunctionsToCall.push_back(std::make_pair(Mutator, Mutator->FindFunction("OnGamePhaseStepChanged"))); });
|
LoopMutators([&](AFortAthenaMutator* Mutator) { FunctionsToCall.push_back(std::make_pair(Mutator, Mutator->FindFunction("OnGamePhaseStepChanged"))); });
|
||||||
|
|
||||||
auto HandleGiveItemsAtGamePhaseStepMutator = [&](AFortAthenaMutator* Mutator) {
|
auto HandleGiveItemsAtGamePhaseStepMutator = [&](AFortAthenaMutator* Mutator) {
|
||||||
@@ -162,7 +158,7 @@ void AFortPlayerControllerAthena::EnterAircraftHook(UObject* PC, AActor* Aircraf
|
|||||||
auto PhaseToGive = GiveItemsAtGamePhaseStepMutator->GetPhaseToGiveItems();
|
auto PhaseToGive = GiveItemsAtGamePhaseStepMutator->GetPhaseToGiveItems();
|
||||||
auto& ItemsToGive = GiveItemsAtGamePhaseStepMutator->GetItemsToGive();
|
auto& ItemsToGive = GiveItemsAtGamePhaseStepMutator->GetItemsToGive();
|
||||||
|
|
||||||
// LOG_INFO(LogDev, "[{}] PhaseToGiveItems: {} ItemsToGive.Num(): {}", i, (int)PhaseToGive, ItemsToGive.Num());
|
LOG_INFO(LogDev, "PhaseToGiveItems: {} ItemsToGive.Num(): {}", (int)PhaseToGive, ItemsToGive.Num());
|
||||||
|
|
||||||
if (PhaseToGive <= 5) // Flying or lower
|
if (PhaseToGive <= 5) // Flying or lower
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,4 +9,22 @@ void AFortSafeZoneIndicator::SkipShrinkSafeZone()
|
|||||||
|
|
||||||
GetSafeZoneStartShrinkTime() = GameState->GetServerWorldTimeSeconds();
|
GetSafeZoneStartShrinkTime() = GameState->GetServerWorldTimeSeconds();
|
||||||
GetSafeZoneFinishShrinkTime() = GameState->GetServerWorldTimeSeconds() + 0.2;
|
GetSafeZoneFinishShrinkTime() = GameState->GetServerWorldTimeSeconds() + 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AFortSafeZoneIndicator::OnSafeZoneStateChangeHook(AFortSafeZoneIndicator* SafeZoneIndicator, EFortSafeZoneState NewState, bool bInitial)
|
||||||
|
{
|
||||||
|
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "OnSafeZoneStateChangeHook!");
|
||||||
|
|
||||||
|
if (NewState == EFortSafeZoneState::Shrinking)
|
||||||
|
{
|
||||||
|
GameState->SetGamePhaseStep(EAthenaGamePhaseStep::StormShrinking);
|
||||||
|
}
|
||||||
|
else if (NewState == EFortSafeZoneState::Holding)
|
||||||
|
{
|
||||||
|
GameState->SetGamePhaseStep(EAthenaGamePhaseStep::StormHolding);
|
||||||
|
}
|
||||||
|
|
||||||
|
return OnSafeZoneStateChangeOriginal(SafeZoneIndicator, NewState, bInitial);
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,20 @@
|
|||||||
|
|
||||||
#include "Actor.h"
|
#include "Actor.h"
|
||||||
|
|
||||||
|
enum class EFortSafeZoneState : uint8_t
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Starting = 1,
|
||||||
|
Holding = 2,
|
||||||
|
Shrinking = 3,
|
||||||
|
EFortSafeZoneState_MAX = 4
|
||||||
|
};
|
||||||
|
|
||||||
class AFortSafeZoneIndicator : public AActor
|
class AFortSafeZoneIndicator : public AActor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static inline void (*OnSafeZoneStateChangeOriginal)(AFortSafeZoneIndicator* SafeZoneIndicator, EFortSafeZoneState NewState, bool bInitial);
|
||||||
|
|
||||||
float& GetSafeZoneStartShrinkTime()
|
float& GetSafeZoneStartShrinkTime()
|
||||||
{
|
{
|
||||||
static auto SafeZoneStartShrinkTimeOffset = GetOffset("SafeZoneStartShrinkTime");
|
static auto SafeZoneStartShrinkTimeOffset = GetOffset("SafeZoneStartShrinkTime");
|
||||||
@@ -18,4 +29,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SkipShrinkSafeZone();
|
void SkipShrinkSafeZone();
|
||||||
|
|
||||||
|
static void OnSafeZoneStateChangeHook(AFortSafeZoneIndicator* SafeZoneIndicator, EFortSafeZoneState NewState, bool bInitial);
|
||||||
};
|
};
|
||||||
@@ -194,6 +194,7 @@
|
|||||||
<ClCompile Include="EngineTypes.cpp" />
|
<ClCompile Include="EngineTypes.cpp" />
|
||||||
<ClCompile Include="events.cpp" />
|
<ClCompile Include="events.cpp" />
|
||||||
<ClCompile Include="FortAthenaCreativePortal.cpp" />
|
<ClCompile Include="FortAthenaCreativePortal.cpp" />
|
||||||
|
<ClCompile Include="FortAthenaMapInfo.cpp" />
|
||||||
<ClCompile Include="FortAthenaMutator_Barrier.cpp" />
|
<ClCompile Include="FortAthenaMutator_Barrier.cpp" />
|
||||||
<ClCompile Include="FortAthenaMutator_Disco.cpp" />
|
<ClCompile Include="FortAthenaMutator_Disco.cpp" />
|
||||||
<ClCompile Include="FortAthenaMutator_GiveItemsAtGamePhaseStep.cpp" />
|
<ClCompile Include="FortAthenaMutator_GiveItemsAtGamePhaseStep.cpp" />
|
||||||
@@ -444,6 +445,7 @@
|
|||||||
<ClInclude Include="UObjectArray.h" />
|
<ClInclude Include="UObjectArray.h" />
|
||||||
<ClInclude Include="UObjectGlobals.h" />
|
<ClInclude Include="UObjectGlobals.h" />
|
||||||
<ClInclude Include="Vector.h" />
|
<ClInclude Include="Vector.h" />
|
||||||
|
<ClInclude Include="Vector2D.h" />
|
||||||
<ClInclude Include="vehicles.h" />
|
<ClInclude Include="vehicles.h" />
|
||||||
<ClInclude Include="vendingmachine.h" />
|
<ClInclude Include="vendingmachine.h" />
|
||||||
<ClInclude Include="WeakObjectPtr.h" />
|
<ClInclude Include="WeakObjectPtr.h" />
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
<Filter>FortniteGame\Source\FortniteGame\Private\Pawns</Filter>
|
<Filter>FortniteGame\Source\FortniteGame\Private\Pawns</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="events.cpp">
|
<ClCompile Include="events.cpp">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Public\Private\Gameplay</Filter>
|
<Filter>Reboot\Private\Gameplay</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="FortPlayerControllerAthena.cpp">
|
<ClCompile Include="FortPlayerControllerAthena.cpp">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Private\Player</Filter>
|
<Filter>FortniteGame\Source\FortniteGame\Private\Player</Filter>
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
<Filter>Engine\Source\Runtime\Engine\Private</Filter>
|
<Filter>Engine\Source\Runtime\Engine\Private</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="addresses.cpp">
|
<ClCompile Include="addresses.cpp">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Public\Private</Filter>
|
<Filter>Reboot\Private</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="NetConnection.h">
|
<ClCompile Include="NetConnection.h">
|
||||||
<Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter>
|
<Filter>Engine\Source\Runtime\Engine\Classes\Engine</Filter>
|
||||||
@@ -265,6 +265,9 @@
|
|||||||
<ClCompile Include="BuildingContainer.cpp">
|
<ClCompile Include="BuildingContainer.cpp">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Private\Building</Filter>
|
<Filter>FortniteGame\Source\FortniteGame\Private\Building</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="FortAthenaMapInfo.cpp">
|
||||||
|
<Filter>FortniteGame\Source\FortniteGame\Private</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="log.h" />
|
<ClInclude Include="log.h" />
|
||||||
@@ -826,9 +829,6 @@
|
|||||||
<ClInclude Include="Package.h">
|
<ClInclude Include="Package.h">
|
||||||
<Filter>Engine\Source\Runtime\CoreUObject\Public\UObject</Filter>
|
<Filter>Engine\Source\Runtime\CoreUObject\Public\UObject</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="Vector.h">
|
|
||||||
<Filter>Engine\Source\Runtime\Core\Public\Misc</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="FortAthenaVehicleSpawner.h">
|
<ClInclude Include="FortAthenaVehicleSpawner.h">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Public\Athena\Vehicle</Filter>
|
<Filter>FortniteGame\Source\FortniteGame\Public\Athena\Vehicle</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -842,6 +842,12 @@
|
|||||||
<ClInclude Include="FortAthenaSupplyDrop.h">
|
<ClInclude Include="FortAthenaSupplyDrop.h">
|
||||||
<Filter>FortniteGame\Source\FortniteGame\Public\Building</Filter>
|
<Filter>FortniteGame\Source\FortniteGame\Public\Building</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Vector.h">
|
||||||
|
<Filter>Engine\Source\Runtime\Core\Public\Math</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Vector2D.h">
|
||||||
|
<Filter>Engine\Source\Runtime\Core\Public\Math</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="Engine">
|
<Filter Include="Engine">
|
||||||
@@ -1051,12 +1057,6 @@
|
|||||||
<Filter Include="Libaries\ImGUI">
|
<Filter Include="Libaries\ImGUI">
|
||||||
<UniqueIdentifier>{2eee3380-ea4b-4137-b058-b57a7b66005e}</UniqueIdentifier>
|
<UniqueIdentifier>{2eee3380-ea4b-4137-b058-b57a7b66005e}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="FortniteGame\Source\FortniteGame\Public\Private">
|
|
||||||
<UniqueIdentifier>{563ca89b-be74-42a6-a995-f87ac7a532e4}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="FortniteGame\Source\FortniteGame\Public\Private\Gameplay">
|
|
||||||
<UniqueIdentifier>{52d438db-beaf-44be-bddd-9aeb07c2459f}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="FortniteGame\Source\FortniteGame\Public\Athena">
|
<Filter Include="FortniteGame\Source\FortniteGame\Public\Athena">
|
||||||
<UniqueIdentifier>{af212a31-57d1-4345-a73f-cd28dc4ebd2f}</UniqueIdentifier>
|
<UniqueIdentifier>{af212a31-57d1-4345-a73f-cd28dc4ebd2f}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
@@ -1082,7 +1082,10 @@
|
|||||||
<UniqueIdentifier>{c04eb59f-e186-49a3-a145-1fd3dc1dcd3d}</UniqueIdentifier>
|
<UniqueIdentifier>{c04eb59f-e186-49a3-a145-1fd3dc1dcd3d}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="Reboot\Private">
|
<Filter Include="Reboot\Private">
|
||||||
<UniqueIdentifier>{00ba0f86-7eef-4ffd-9a9d-47477e5193b2}</UniqueIdentifier>
|
<UniqueIdentifier>{563ca89b-be74-42a6-a995-f87ac7a532e4}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Reboot\Private\Gameplay">
|
||||||
|
<UniqueIdentifier>{52d438db-beaf-44be-bddd-9aeb07c2459f}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ public:
|
|||||||
float Y;
|
float Y;
|
||||||
float Z;
|
float Z;
|
||||||
|
|
||||||
|
FVector() : X(0), Y(0), Z(0) {}
|
||||||
|
FVector(float x, float y, float z) : X(x), Y(y), Z(z) {}
|
||||||
|
|
||||||
FVector operator+(const FVector& A)
|
FVector operator+(const FVector& A)
|
||||||
{
|
{
|
||||||
return FVector{ this->X + A.X, this->Y + A.Y, this->Z + A.Z };
|
return FVector{ this->X + A.X, this->Y + A.Y, this->Z + A.Z };
|
||||||
|
|||||||
7
Project Reboot 3.0/Vector2D.h
Normal file
7
Project Reboot 3.0/Vector2D.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct FVector2D
|
||||||
|
{
|
||||||
|
float X;
|
||||||
|
float Y;
|
||||||
|
};
|
||||||
@@ -41,18 +41,24 @@ public:
|
|||||||
static inline UObject* (*SpawnActorOriginal)(UWorld* World, UClass* Class, FTransform const* UserTransformPtr, const FActorSpawnParameters& SpawnParameters);
|
static inline UObject* (*SpawnActorOriginal)(UWorld* World, UClass* Class, FTransform const* UserTransformPtr, const FActorSpawnParameters& SpawnParameters);
|
||||||
|
|
||||||
template <typename T = AActor>
|
template <typename T = AActor>
|
||||||
T* GetGameMode()
|
T*& GetGameMode()
|
||||||
{
|
{
|
||||||
static auto AuthorityGameModeOffset = GetOffset("AuthorityGameMode");
|
static auto AuthorityGameModeOffset = GetOffset("AuthorityGameMode");
|
||||||
return this->Get<T*>(AuthorityGameModeOffset);
|
return this->Get<T*>(AuthorityGameModeOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
class AGameState* GetGameState()
|
class AGameState*& GetGameState()
|
||||||
{
|
{
|
||||||
static auto GameStateOffset = GetOffset("GameState");
|
static auto GameStateOffset = GetOffset("GameState");
|
||||||
return this->Get<class AGameState*>(GameStateOffset);
|
return this->Get<class AGameState*>(GameStateOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UNetDriver*& GetNetDriver()
|
||||||
|
{
|
||||||
|
static auto NetDriverOffset = GetOffset("NetDriver");
|
||||||
|
return this->Get<class UNetDriver*>(NetDriverOffset);
|
||||||
|
}
|
||||||
|
|
||||||
UGameInstance* GetOwningGameInstance()
|
UGameInstance* GetOwningGameInstance()
|
||||||
{
|
{
|
||||||
static auto OwningGameInstanceOffset = GetOffset("OwningGameInstance");
|
static auto OwningGameInstanceOffset = GetOffset("OwningGameInstance");
|
||||||
|
|||||||
@@ -288,6 +288,9 @@ void Addresses::FindAll()
|
|||||||
LOG_INFO(LogDev, "Finding CreateBuildingActorCallForDeco");
|
LOG_INFO(LogDev, "Finding CreateBuildingActorCallForDeco");
|
||||||
Addresses::CreateBuildingActorCallForDeco = FindCreateBuildingActorCallForDeco();
|
Addresses::CreateBuildingActorCallForDeco = FindCreateBuildingActorCallForDeco();
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "Finding PickSupplyDropLocation");
|
||||||
|
Addresses::PickSupplyDropLocation = FindPickSupplyDropLocation();
|
||||||
|
|
||||||
LOG_INFO(LogDev, "Finished finding!");
|
LOG_INFO(LogDev, "Finished finding!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,6 +356,7 @@ void Addresses::Print()
|
|||||||
LOG_INFO(LogDev, "UpdateTrackedAttributesLea: 0x{:x}", UpdateTrackedAttributesLea - Base);
|
LOG_INFO(LogDev, "UpdateTrackedAttributesLea: 0x{:x}", UpdateTrackedAttributesLea - Base);
|
||||||
LOG_INFO(LogDev, "CombinePickupLea: 0x{:x}", CombinePickupLea - Base);
|
LOG_INFO(LogDev, "CombinePickupLea: 0x{:x}", CombinePickupLea - Base);
|
||||||
LOG_INFO(LogDev, "CreateBuildingActorCallForDeco: 0x{:x}", CreateBuildingActorCallForDeco - Base);
|
LOG_INFO(LogDev, "CreateBuildingActorCallForDeco: 0x{:x}", CreateBuildingActorCallForDeco - Base);
|
||||||
|
LOG_INFO(LogDev, "PickSupplyDropLocation: 0x{:x}", PickSupplyDropLocation - Base);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Offsets::FindAll()
|
void Offsets::FindAll()
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ namespace Addresses
|
|||||||
extern inline uint64 UpdateTrackedAttributesLea = 0;
|
extern inline uint64 UpdateTrackedAttributesLea = 0;
|
||||||
extern inline uint64 CombinePickupLea = 0;
|
extern inline uint64 CombinePickupLea = 0;
|
||||||
extern inline uint64 CreateBuildingActorCallForDeco = 0;
|
extern inline uint64 CreateBuildingActorCallForDeco = 0;
|
||||||
|
extern inline uint64 PickSupplyDropLocation = 0;
|
||||||
|
|
||||||
void SetupVersion(); // Finds Engine Version
|
void SetupVersion(); // Finds Engine Version
|
||||||
void FindAll();
|
void FindAll();
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
|||||||
|
|
||||||
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
||||||
|
|
||||||
|
LOG_INFO(LogDev, "GamePhaseStep: {}", (int)GameState->GetGamePhaseStep());
|
||||||
|
|
||||||
if (Globals::bLateGame)
|
if (Globals::bLateGame)
|
||||||
{
|
{
|
||||||
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
|
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
|
||||||
|
|||||||
@@ -778,12 +778,13 @@ DWORD WINAPI Main(LPVOID)
|
|||||||
|
|
||||||
AddVehicleHook();
|
AddVehicleHook();
|
||||||
|
|
||||||
// if (Fortnite_Version > 1.8 || Fortnite_Version == 1.11)
|
auto ClientOnPawnDiedCallAddr = FindFunctionCall(L"ClientOnPawnDied", Engine_Version == 416 ? std::vector<uint8_t>{ 0x48, 0x89, 0x54 } : std::vector<uint8_t>{ 0x48, 0x89, 0x5C });
|
||||||
{
|
LOG_INFO(LogDev, "ClientOnPawnDiedCallAddr: 0x{:x}", ClientOnPawnDiedCallAddr - __int64(GetModuleHandleW(0)));
|
||||||
auto ClientOnPawnDiedCallAddr = FindFunctionCall(L"ClientOnPawnDied", Engine_Version == 416 ? std::vector<uint8_t>{ 0x48, 0x89, 0x54 } : std::vector<uint8_t>{ 0x48, 0x89, 0x5C });
|
Hooking::MinHook::Hook((PVOID)ClientOnPawnDiedCallAddr, AFortPlayerController::ClientOnPawnDiedHook, (PVOID*)&AFortPlayerController::ClientOnPawnDiedOriginal);
|
||||||
LOG_INFO(LogDev, "ClientOnPawnDiedCallAddr: 0x{:x}", ClientOnPawnDiedCallAddr - __int64(GetModuleHandleW(0)));
|
|
||||||
Hooking::MinHook::Hook((PVOID)ClientOnPawnDiedCallAddr, AFortPlayerController::ClientOnPawnDiedHook, (PVOID*)&AFortPlayerController::ClientOnPawnDiedOriginal);
|
auto OnSafeZoneStateChangeAddr = FindFunctionCall(L"OnSafeZoneStateChange", Engine_Version == 416 ? std::vector<uint8_t>{ 0x48, 0x89, 0x54 } : std::vector<uint8_t>{ 0x48, 0x89, 0x5C });
|
||||||
}
|
LOG_INFO(LogDev, "OnSafeZoneStateChangeAddr: 0x{:x}", OnSafeZoneStateChangeAddr - __int64(GetModuleHandleW(0)));
|
||||||
|
Hooking::MinHook::Hook((PVOID)OnSafeZoneStateChangeAddr, AFortSafeZoneIndicator::OnSafeZoneStateChangeHook, (PVOID*)&AFortSafeZoneIndicator::OnSafeZoneStateChangeOriginal);
|
||||||
|
|
||||||
LOG_INFO(LogDev, "PredictionKeySize: 0x{:x} {}", PredictionKeySize, PredictionKeySize);
|
LOG_INFO(LogDev, "PredictionKeySize: 0x{:x} {}", PredictionKeySize, PredictionKeySize);
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,14 @@ static inline uint64 FindPickupInitialize()
|
|||||||
if (Engine_Version == 420)
|
if (Engine_Version == 420)
|
||||||
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 41 56 48 83 EC 20 80 B9 ? ? ? ? ? 45 0F B6 F1 49 8B E8").Get(); // 4.1
|
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 41 56 48 83 EC 20 80 B9 ? ? ? ? ? 45 0F B6 F1 49 8B E8").Get(); // 4.1
|
||||||
if (Engine_Version == 421)
|
if (Engine_Version == 421)
|
||||||
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 55 57 41 57 48 83 EC 30 80 B9 ? ? ? ? ? 41 0F B6").Get(); // 6.21
|
{
|
||||||
|
auto addr = Memcury::Scanner::FindPattern("48 89 5C 24 ? 55 57 41 57 48 83 EC 30 80 B9 ? ? ? ? ? 41 0F B6", false).Get(); // 6.21
|
||||||
|
|
||||||
|
if (!addr)
|
||||||
|
addr = Memcury::Scanner::FindPattern("48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 80 B9 ? ? ? ? ? 41 0F B6 E9").Get(); // 5.41
|
||||||
|
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
if (Engine_Version == 422)
|
if (Engine_Version == 422)
|
||||||
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 41 56 41 57 48 83 EC 30 80 B9 ? ? ? ? ? 45 0F B6 F1").Get(); // 7.30
|
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 57 41 56 41 57 48 83 EC 30 80 B9 ? ? ? ? ? 45 0F B6 F1").Get(); // 7.30
|
||||||
if (Engine_Version == 423)
|
if (Engine_Version == 423)
|
||||||
@@ -235,6 +242,26 @@ static inline uint64 FindInitHost()
|
|||||||
return FindBytes(Addr, (Engine_Version == 427 ? std::vector<uint8_t>{ 0x48, 0x8B, 0x5C } : std::vector<uint8_t>{ 0x48, 0x8B, 0xC4 }), 1000, 0, true);
|
return FindBytes(Addr, (Engine_Version == 427 ? std::vector<uint8_t>{ 0x48, 0x8B, 0x5C } : std::vector<uint8_t>{ 0x48, 0x8B, 0xC4 }), 1000, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint64 FindPickSupplyDropLocation()
|
||||||
|
{
|
||||||
|
auto Addrr = Memcury::Scanner::FindStringRef(L"PickSupplyDropLocation: Failed to find valid location using rejection. Using safe zone location.", true, 0).Get();
|
||||||
|
|
||||||
|
if (!Addrr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// Newer versions it is "AFortAthenaMapInfo::PickSupplyDropLocation" (no wide str), but they also changed params so ill add later.
|
||||||
|
|
||||||
|
for (int i = 0; i < 1000; i++)
|
||||||
|
{
|
||||||
|
if (*(uint8_t*)(uint8_t*)(Addrr - i) == 0x48 && *(uint8_t*)(uint8_t*)(Addrr - i + 1) == 0x89 && *(uint8_t*)(uint8_t*)(Addrr - i + 2) == 0x5C)
|
||||||
|
{
|
||||||
|
return Addrr - i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static inline uint64 FindPauseBeaconRequests()
|
static inline uint64 FindPauseBeaconRequests()
|
||||||
{
|
{
|
||||||
if (Engine_Version == 500)
|
if (Engine_Version == 500)
|
||||||
@@ -251,6 +278,9 @@ static inline uint64 FindPauseBeaconRequests()
|
|||||||
if (Engine_Version == 420)
|
if (Engine_Version == 420)
|
||||||
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72 2C 48 8B 05 ? ? ? ? 4C 8D 44").Get();
|
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D ? ? ? ? ? 72 2C 48 8B 05 ? ? ? ? 4C 8D 44").Get();
|
||||||
|
|
||||||
|
if (Fortnite_Version == 6.30 || Fortnite_Version == 6.31) // bro for real! (i think its cuz theres like 3 refs to the same string)
|
||||||
|
return Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 68 80 3D").Get();
|
||||||
|
|
||||||
if (Engine_Version == 419)
|
if (Engine_Version == 419)
|
||||||
{
|
{
|
||||||
auto aa = Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 6F 80 3D", false).Get();
|
auto aa = Memcury::Scanner::FindPattern("40 53 48 83 EC 30 48 8B D9 84 D2 74 6F 80 3D", false).Get();
|
||||||
@@ -725,6 +755,8 @@ static inline uint64 FindNoMCP()
|
|||||||
|
|
||||||
static inline uint64 FindSetZoneToIndex() // actually StartNewSafeZonePhase
|
static inline uint64 FindSetZoneToIndex() // actually StartNewSafeZonePhase
|
||||||
{
|
{
|
||||||
|
if (Engine_Version == 419)
|
||||||
|
return Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 70 48 8B B9 ? ? ? ? 33 DB 0F 29 74 24 ? 48 8B F1 48 85 FF 74 2C E8").Get(); // 1.11
|
||||||
if (Engine_Version == 420)
|
if (Engine_Version == 420)
|
||||||
return Memcury::Scanner::FindPattern("E8 ? ? ? ? EB 31 80 B9 ? ? ? ? ?").RelativeOffset(1).Get(); // 3.5
|
return Memcury::Scanner::FindPattern("E8 ? ? ? ? EB 31 80 B9 ? ? ? ? ?").RelativeOffset(1).Get(); // 3.5
|
||||||
if (Engine_Version == 422)
|
if (Engine_Version == 422)
|
||||||
@@ -1474,7 +1506,7 @@ static inline uint64 FindPickTeam()
|
|||||||
auto testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 56 41 54 41 55 41 56 48 83 EC 60 4C 8B A1", false).Get(); // 14.60 what is happening lol ????
|
auto testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 56 41 54 41 55 41 56 48 83 EC 60 4C 8B A1", false).Get(); // 14.60 what is happening lol ????
|
||||||
|
|
||||||
if (!testAddr)
|
if (!testAddr)
|
||||||
testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 55 56 41 55 41 56 48 83 EC 70 48 8B", false).Get(); // 15.10
|
testAddr = Memcury::Scanner::FindPattern("88 54 24 10 53 55 56 41 55 41 ? 48 83 EC 70 48", false).Get(); // 15.10 & 15.50
|
||||||
|
|
||||||
if (testAddr)
|
if (testAddr)
|
||||||
return testAddr;
|
return testAddr;
|
||||||
@@ -1640,7 +1672,7 @@ static inline uint64 FindCantBuild()
|
|||||||
|
|
||||||
static inline uint64 FindReplaceBuildingActor()
|
static inline uint64 FindReplaceBuildingActor()
|
||||||
{
|
{
|
||||||
auto StringRef = Memcury::Scanner::FindStringRef(L"STAT_Fort_BuildingSMActorReplaceBuildingActor");
|
auto StringRef = Memcury::Scanner::FindStringRef(L"STAT_Fort_BuildingSMActorReplaceBuildingActor", false);
|
||||||
|
|
||||||
if (!StringRef.Get()) // we are on a version where stats dont exist
|
if (!StringRef.Get()) // we are on a version where stats dont exist
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Globals
|
|||||||
extern inline bool bInitializedPlaylist = false;
|
extern inline bool bInitializedPlaylist = false;
|
||||||
extern inline bool bStartedListening = false;
|
extern inline bool bStartedListening = false;
|
||||||
extern inline bool bAutoRestart = true;
|
extern inline bool bAutoRestart = true;
|
||||||
|
extern inline bool bFillVendingMachines = true;
|
||||||
|
|
||||||
extern inline int AmountOfListens = 0; // TODO: Switch to this for LastNum
|
extern inline int AmountOfListens = 0; // TODO: Switch to this for LastNum
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,9 +56,11 @@
|
|||||||
#define LOADOUT_PLAYERTAB 4
|
#define LOADOUT_PLAYERTAB 4
|
||||||
#define FUN_PLAYERTAB 5
|
#define FUN_PLAYERTAB 5
|
||||||
|
|
||||||
static inline int SecondsUntilTravel = 5;
|
extern inline int SecondsUntilTravel = 5;
|
||||||
static inline bool bSwitchedInitialLevel = false;
|
extern inline bool bSwitchedInitialLevel = false;
|
||||||
extern inline bool bIsInAutoRestart = false;
|
extern inline bool bIsInAutoRestart = false;
|
||||||
|
extern inline float AutoBusStartSeconds = 60;
|
||||||
|
extern inline int NumRequiredPlayersToStart = 2;
|
||||||
|
|
||||||
// THE BASE CODE IS FROM IMGUI GITHUB
|
// THE BASE CODE IS FROM IMGUI GITHUB
|
||||||
|
|
||||||
@@ -264,6 +266,12 @@ static inline void StaticUI()
|
|||||||
if (IsRestartingSupported())
|
if (IsRestartingSupported())
|
||||||
{
|
{
|
||||||
ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart);
|
ImGui::Checkbox("Auto Restart", &Globals::bAutoRestart);
|
||||||
|
|
||||||
|
if (Globals::bAutoRestart)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PROD
|
#ifndef PROD
|
||||||
@@ -548,22 +556,32 @@ static inline void MainUI()
|
|||||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||||
auto GameState = GameMode->GetGameState();
|
auto GameState = GameMode->GetGameState();
|
||||||
|
|
||||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
|
|
||||||
|
|
||||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||||
|
|
||||||
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
|
auto GetAircrafts = [&]() -> TArray<AActor*>
|
||||||
|
{
|
||||||
|
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
|
||||||
|
|
||||||
|
if (AircraftsOffset == -1)
|
||||||
|
{
|
||||||
|
// GameState->Aircraft
|
||||||
|
|
||||||
|
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft");
|
||||||
|
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
|
||||||
|
|
||||||
|
return AllAircrafts;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GameState->Get<TArray<AActor*>>(AircraftsOffset);
|
||||||
|
};
|
||||||
|
|
||||||
|
while (GetAircrafts().Num() <= 0) // hmm
|
||||||
{
|
{
|
||||||
Sleep(500);
|
Sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr);
|
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 SafeZoneIndicatorOffset = GameState->GetOffset("SafeZoneIndicator");
|
||||||
|
|
||||||
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
|
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
|
||||||
@@ -574,26 +592,44 @@ static inline void MainUI()
|
|||||||
Sleep(500);
|
Sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
|
while (GetAircrafts().Num() <= 0) // hmm
|
||||||
{
|
{
|
||||||
Sleep(500);
|
Sleep(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter");
|
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter", false);
|
||||||
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
|
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
|
||||||
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset); // SafeZoneLocations.at(4);
|
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset == -1 ? NextCenterOffset : NextNextCenterOffset); // SafeZoneLocations.at(4);
|
||||||
LocationToStartAircraft.Z += 10000;
|
LocationToStartAircraft.Z += 10000;
|
||||||
|
|
||||||
for (int i = 0; i < GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num(); i++)
|
for (int i = 0; i < GetAircrafts().Num(); i++)
|
||||||
{
|
{
|
||||||
GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->TeleportTo(LocationToStartAircraft, FRotator());
|
auto CurrentAircraft = GetAircrafts().at(i);
|
||||||
|
|
||||||
static auto FlightInfoOffset = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetOffset("FlightInfo");
|
CurrentAircraft->TeleportTo(LocationToStartAircraft, FRotator());
|
||||||
auto FlightInfo = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->at(i)->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
|
|
||||||
|
|
||||||
FlightInfo->GetFlightSpeed() = 0;
|
static auto FlightInfoOffset = CurrentAircraft->GetOffset("FlightInfo", false);
|
||||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
|
||||||
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
float FlightSpeed = 0.0f;
|
||||||
|
|
||||||
|
if (FlightInfoOffset == -1)
|
||||||
|
{
|
||||||
|
static auto FlightStartLocationOffset = CurrentAircraft->GetOffset("FlightStartLocation");
|
||||||
|
static auto FlightSpeedOffset = CurrentAircraft->GetOffset("FlightSpeed");
|
||||||
|
static auto DropStartTimeOffset = CurrentAircraft->GetOffset("DropStartTime");
|
||||||
|
|
||||||
|
CurrentAircraft->Get<FVector>(FlightStartLocationOffset) = LocationToStartAircraft;
|
||||||
|
CurrentAircraft->Get<float>(FlightSpeedOffset) = FlightSpeed;
|
||||||
|
CurrentAircraft->Get<float>(DropStartTimeOffset) = GameState->GetServerWorldTimeSeconds();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto FlightInfo = CurrentAircraft->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
|
||||||
|
|
||||||
|
FlightInfo->GetFlightSpeed() = FlightSpeed;
|
||||||
|
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||||
|
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
|
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
|
||||||
@@ -601,18 +637,22 @@ static inline void MainUI()
|
|||||||
|
|
||||||
if (MapInfo)
|
if (MapInfo)
|
||||||
{
|
{
|
||||||
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos");
|
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos", false);
|
||||||
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
|
|
||||||
|
|
||||||
LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
|
if (FlightInfosOffset != -1)
|
||||||
|
|
||||||
for (int i = 0; i < FlightInfos.Num(); i++)
|
|
||||||
{
|
{
|
||||||
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
|
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
|
||||||
|
|
||||||
FlightInfo->GetFlightSpeed() = 0;
|
LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
|
||||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
|
||||||
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
for (int i = 0; i < FlightInfos.Num(); i++)
|
||||||
|
{
|
||||||
|
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
|
||||||
|
|
||||||
|
FlightInfo->GetFlightSpeed() = 0;
|
||||||
|
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||||
|
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,6 +885,7 @@ static inline void MainUI()
|
|||||||
static std::string ClassNameToDump;
|
static std::string ClassNameToDump;
|
||||||
static std::string FunctionNameToDump;
|
static std::string FunctionNameToDump;
|
||||||
|
|
||||||
|
ImGui::Checkbox("Fill Vending Machines", &Globals::bFillVendingMachines);
|
||||||
ImGui::InputText("Class Name to mess with", &ClassNameToDump);
|
ImGui::InputText("Class Name to mess with", &ClassNameToDump);
|
||||||
|
|
||||||
ImGui::InputText("Function Name to mess with", &FunctionNameToDump);
|
ImGui::InputText("Function Name to mess with", &FunctionNameToDump);
|
||||||
@@ -864,7 +905,7 @@ static inline void MainUI()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Print Function Exec Addy"))
|
if (ImGui::Button("Print Function Exec Addr"))
|
||||||
{
|
{
|
||||||
auto Function = FindObject<UFunction>(FunctionNameToDump);
|
auto Function = FindObject<UFunction>(FunctionNameToDump);
|
||||||
|
|
||||||
@@ -929,9 +970,12 @@ static inline void PregameUI()
|
|||||||
ImGui::Checkbox("Creative", &Globals::bCreative);
|
ImGui::Checkbox("Creative", &Globals::bCreative);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bWillBeLategame = Globals::bLateGame.load();
|
if (Addresses::SetZoneToIndex)
|
||||||
ImGui::Checkbox("Lategame", &bWillBeLategame);
|
{
|
||||||
Globals::bLateGame.store(bWillBeLategame);
|
bool bWillBeLategame = Globals::bLateGame.load();
|
||||||
|
ImGui::Checkbox("Lategame", &bWillBeLategame);
|
||||||
|
Globals::bLateGame.store(bWillBeLategame);
|
||||||
|
}
|
||||||
|
|
||||||
if (HasEvent())
|
if (HasEvent())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user