mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
a bit
add experimental lategame, removed some unnecessary logs
This commit is contained in:
@@ -37,6 +37,12 @@ FTransform AActor::GetTransform()
|
||||
return Ret;
|
||||
}
|
||||
|
||||
void AActor::SetNetDormancy(ENetDormancy Dormancy)
|
||||
{
|
||||
static auto SetNetDormancyFn = FindObject<UFunction>("/Script/Engine.Actor.SetNetDormancy");
|
||||
this->ProcessEvent(SetNetDormancyFn, &Dormancy);
|
||||
}
|
||||
|
||||
AActor* AActor::GetOwner()
|
||||
{
|
||||
static auto GetOwnerFunction = FindObject<UFunction>("/Script/Engine.Actor.GetOwner");
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
bool IsTearOff();
|
||||
/* FORCEINLINE */ ENetDormancy& GetNetDormancy();
|
||||
int32& GetNetTag();
|
||||
void SetNetDormancy(ENetDormancy Dormancy);
|
||||
AActor* GetOwner();
|
||||
struct FVector GetActorLocation();
|
||||
struct FVector GetActorRightVector();
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
#include "reboot.h"
|
||||
|
||||
void AFortWeap_EditingTool::OnRep_EditActor()
|
||||
{
|
||||
static auto OnRep_EditActorFn = FindObject<UFunction>("/Script/FortniteGame.FortWeap_EditingTool.OnRep_EditActor");
|
||||
this->ProcessEvent(OnRep_EditActorFn);
|
||||
}
|
||||
|
||||
UClass* AFortWeap_EditingTool::StaticClass()
|
||||
{
|
||||
static auto Class = FindObject<UClass>(L"/Script/FortniteGame.FortWeap_EditingTool");
|
||||
|
||||
@@ -20,5 +20,7 @@ public:
|
||||
return Get<ABuildingSMActor*>(EditActorOffset);
|
||||
}
|
||||
|
||||
void OnRep_EditActor();
|
||||
|
||||
static UClass* StaticClass();
|
||||
};
|
||||
@@ -24,6 +24,38 @@ enum class EDynamicFoundationType : uint8_t
|
||||
EDynamicFoundationType_MAX = 4
|
||||
};
|
||||
|
||||
struct FAircraftFlightInfo
|
||||
{
|
||||
float& GetTimeTillDropStart()
|
||||
{
|
||||
static auto TimeTillDropStartOffset = FindOffsetStruct("/Script/FortniteGame.AircraftFlightInfo", "TimeTillDropStart");
|
||||
return *(float*)(__int64(this) + TimeTillDropStartOffset);
|
||||
}
|
||||
|
||||
FVector& GetFlightStartLocation()
|
||||
{
|
||||
static auto FlightStartLocationOffset = FindOffsetStruct("/Script/FortniteGame.AircraftFlightInfo", "FlightStartLocation");
|
||||
return *(FVector*)(__int64(this) + FlightStartLocationOffset);
|
||||
}
|
||||
|
||||
float& GetFlightSpeed()
|
||||
{
|
||||
static auto FlightSpeedOffset = FindOffsetStruct("/Script/FortniteGame.AircraftFlightInfo", "FlightSpeed");
|
||||
return *(float*)(__int64(this) + FlightSpeedOffset);
|
||||
}
|
||||
|
||||
static UStruct* GetStruct()
|
||||
{
|
||||
static auto Struct = FindObject<UStruct>("/Script/FortniteGame.AircraftFlightInfo");
|
||||
return Struct;
|
||||
}
|
||||
|
||||
static int GetStructSize()
|
||||
{
|
||||
return GetStruct()->GetPropertiesSize();
|
||||
}
|
||||
};
|
||||
|
||||
static void ShowFoundation(UObject* BuildingFoundation)
|
||||
{
|
||||
if (!BuildingFoundation)
|
||||
|
||||
@@ -326,6 +326,9 @@ void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController
|
||||
static auto WallPiece = FindObject<UFortBuildingItemDefinition>("/Game/Items/Weapons/BuildingTools/BuildingItemData_Wall.BuildingItemData_Wall");
|
||||
static auto StairPiece = FindObject<UFortBuildingItemDefinition>("/Game/Items/Weapons/BuildingTools/BuildingItemData_Stair_W.BuildingItemData_Stair_W");
|
||||
|
||||
UBuildingEditModeMetadata* OldMetadata = nullptr; // Newer versions
|
||||
OldMetadata = BuildingTool->Get<UBuildingEditModeMetadata*>(DefaultMetadataOffset);
|
||||
|
||||
if (ItemDefinition == RoofPiece)
|
||||
{
|
||||
static auto RoofMetadata = FindObject<UBuildingEditModeMetadata>("/Game/Building/EditModePatterns/Roof/EMP_Roof_RoofC.EMP_Roof_RoofC");
|
||||
@@ -347,7 +350,7 @@ void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController
|
||||
BuildingTool->Get<UBuildingEditModeMetadata*>(DefaultMetadataOffset) = FloorMetadata;
|
||||
}
|
||||
|
||||
BuildingTool->ProcessEvent(OnRep_DefaultMetadataFn);
|
||||
BuildingTool->ProcessEvent(OnRep_DefaultMetadataFn, &OldMetadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -561,15 +564,18 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
|
||||
|
||||
void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController* PC, FRotator ClientRotation)
|
||||
{
|
||||
if (Fortnite_Version == 17.30 && Globals::bGoingToPlayEvent)
|
||||
return; // We want to be teleported back to the UFO but we dont use chooseplayerstart
|
||||
auto PlayerController = Cast<AFortPlayerController>(Engine_Version < 424 ? PC : ((UActorComponent*)PC)->GetOwner());
|
||||
|
||||
auto PlayerController = Cast<APlayerController>(Engine_Version < 424 ? PC : ((UActorComponent*)PC)->GetOwner());
|
||||
if (Engine_Version < 424 && !Globals::bLateGame)
|
||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||
|
||||
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
|
||||
|
||||
LOG_INFO(LogDev, "PlayerController: {}", __int64(PlayerController));
|
||||
|
||||
if (!PlayerController)
|
||||
return;
|
||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||
|
||||
// if (!PlayerController->bInAircraft)
|
||||
// return;
|
||||
@@ -581,7 +587,7 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
|
||||
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
|
||||
|
||||
if (Aircrafts->Num() <= 0)
|
||||
return;
|
||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||
|
||||
auto NewPawn = GameMode->SpawnDefaultPawnForHook(GameMode, (AController*)PlayerController, Aircrafts->at(0));
|
||||
PlayerController->Possess(NewPawn);
|
||||
@@ -592,6 +598,43 @@ void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController*
|
||||
NewPawnAsFort->SetHealth(100);
|
||||
|
||||
// PlayerController->ServerRestartPlayer();
|
||||
|
||||
if (Globals::bLateGame)
|
||||
{
|
||||
static auto WoodItemData = FindObject<UFortItemDefinition>("/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
|
||||
static auto StoneItemData = FindObject<UFortItemDefinition>("/Game/Items/ResourcePickups/StoneItemData.StoneItemData");
|
||||
static auto MetalItemData = FindObject<UFortItemDefinition>("/Game/Items/ResourcePickups/MetalItemData.MetalItemData");
|
||||
|
||||
static auto Rifle = FindObject<UFortItemDefinition>("/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03");
|
||||
static auto Shotgun = FindObject<UFortItemDefinition>("/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03");
|
||||
static auto SMG = FindObject<UFortItemDefinition>("/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03");
|
||||
|
||||
static auto MiniShields = FindObject<UFortItemDefinition>("/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall");
|
||||
|
||||
static auto Shells = FindObject<UFortItemDefinition>("/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells");
|
||||
static auto Medium = FindObject<UFortItemDefinition>("/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium");
|
||||
static auto Light = FindObject<UFortItemDefinition>("/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight");
|
||||
static auto Heavy = FindObject<UFortItemDefinition>("/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy");
|
||||
|
||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return ServerAttemptAircraftJumpOriginal(PC, ClientRotation);
|
||||
|
||||
WorldInventory->AddItem(WoodItemData, nullptr, 500);
|
||||
WorldInventory->AddItem(StoneItemData, nullptr, 500);
|
||||
WorldInventory->AddItem(MetalItemData, nullptr, 500);
|
||||
WorldInventory->AddItem(Rifle, nullptr, 1);
|
||||
WorldInventory->AddItem(Shotgun, nullptr, 1);
|
||||
WorldInventory->AddItem(SMG, nullptr, 1);
|
||||
WorldInventory->AddItem(MiniShields, nullptr, 6);
|
||||
WorldInventory->AddItem(Shells, nullptr, 999);
|
||||
WorldInventory->AddItem(Medium, nullptr, 999);
|
||||
WorldInventory->AddItem(Light, nullptr, 999);
|
||||
WorldInventory->AddItem(Heavy, nullptr, 999);
|
||||
|
||||
WorldInventory->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void AFortPlayerController::ServerDropAllItemsHook(AFortPlayerController* PlayerController, UFortItemDefinition* IgnoreItemDef)
|
||||
@@ -1217,42 +1260,42 @@ void AFortPlayerController::ClientOnPawnDiedHook(AFortPlayerController* PlayerCo
|
||||
|
||||
void AFortPlayerController::ServerBeginEditingBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToEdit)
|
||||
{
|
||||
// LOG_INFO(LogDev, "ServerBeginEditingBuildingActorHook!");
|
||||
|
||||
if (!BuildingActorToEdit || !BuildingActorToEdit->IsPlayerPlaced())
|
||||
if (!BuildingActorToEdit || !BuildingActorToEdit->IsPlayerPlaced()) // We need more checks.
|
||||
return;
|
||||
|
||||
auto Pawn = PlayerController->GetMyFortPawn();
|
||||
|
||||
// LOG_INFO(LogDev, "ServerBeginEditingBuildingAc1341torHook!");
|
||||
|
||||
if (!Pawn)
|
||||
return;
|
||||
|
||||
// LOG_INFO(LogDev, "ServerBeginEditingBuildingActorHook134!");
|
||||
auto PlayerState = PlayerController->GetPlayerState();
|
||||
|
||||
static auto EditToolDef = FindObject<UFortWeaponItemDefinition>("/Game/Items/Weapons/BuildingTools/EditTool.EditTool");
|
||||
if (!PlayerState)
|
||||
return;
|
||||
|
||||
/* auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
// if (!BuildingActorToEdit->GetEditingPlayer() || !PlayerController->GetPlayerState())
|
||||
// SetNetDormancy(BuildingActorToEdit, 1);
|
||||
BuildingActorToEdit->SetNetDormancy(ENetDormancy::DORM_Awake);
|
||||
BuildingActorToEdit->GetEditingPlayer() = PlayerState;
|
||||
// Onrep?
|
||||
|
||||
auto WorldInventory = PlayerController->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return;
|
||||
|
||||
static auto EditToolDef = FindObject<UFortWeaponItemDefinition>("/Game/Items/Weapons/BuildingTools/EditTool.EditTool");
|
||||
|
||||
auto EditToolInstance = WorldInventory->FindItemInstance(EditToolDef);
|
||||
|
||||
if (!EditToolInstance)
|
||||
return;
|
||||
|
||||
if (auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid()))) */
|
||||
if (auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, FGuid{})))
|
||||
if (auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, EditToolInstance->GetItemEntry()->GetItemGuid())))
|
||||
// if (auto EditTool = Cast<AFortWeap_EditingTool>(Pawn->EquipWeaponDefinition(EditToolDef, FGuid{})))
|
||||
{
|
||||
// LOG_INFO(LogDev, "ServerBeginEditingBuild135415ingActorHook!");
|
||||
|
||||
BuildingActorToEdit->GetEditingPlayer() = PlayerController->GetPlayerState();
|
||||
// Onrep?
|
||||
|
||||
EditTool->GetEditActor() = BuildingActorToEdit;
|
||||
// Onrep?
|
||||
EditTool->OnRep_EditActor();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1299,11 +1342,10 @@ void AFortPlayerController::ServerEditBuildingActorHook(UObject* Context, FFrame
|
||||
BuildingActorToEdit->GetCurrentBuildingLevel(), RotationIterations, bMirrored, PlayerController))
|
||||
{
|
||||
BuildingActor->SetPlayerPlaced(true);
|
||||
|
||||
// if (auto PlayerState = Cast<AFortPlayerStateAthena>(PlayerController->GetPlayerState()))
|
||||
// BuildingActor->SetTeam(PlayerState->GetTeamIndex());
|
||||
}
|
||||
|
||||
// we should do more things here
|
||||
|
||||
return ServerEditBuildingActorOriginal(Context, Stack, Ret);
|
||||
}
|
||||
|
||||
@@ -1324,6 +1366,6 @@ void AFortPlayerController::ServerEndEditingBuildingActorHook(AFortPlayerControl
|
||||
if (EditTool)
|
||||
{
|
||||
EditTool->GetEditActor() = nullptr;
|
||||
// EditTool->OnRep_EditActor();
|
||||
EditTool->OnRep_EditActor();
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
static inline void (*DropSpecificItemOriginal)(UObject* Context, FFrame& Stack, void* Ret);
|
||||
static inline AActor* (*SpawnToyInstanceOriginal)(UObject* Context, FFrame* Stack, AActor** Ret);
|
||||
static inline void (*ServerLoadingScreenDroppedOriginal)(UObject* Context, FFrame* Stack, void* Ret);
|
||||
static inline void (*ServerAttemptAircraftJumpOriginal)(AFortPlayerController* PC, FRotator ClientRotation);
|
||||
|
||||
void ClientReportDamagedResourceBuilding(ABuildingSMActor* BuildingSMActor, EFortResourceType PotentialResourceType, int PotentialResourceCount, bool bDestroyed, bool bJustHitWeakspot);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void AFortPlayerControllerAthena::ServerRequestSeatChangeHook(AFortPlayerControl
|
||||
auto PickaxeInstance = WorldInventory->GetPickaxeInstance();
|
||||
|
||||
if (!PickaxeInstance)
|
||||
return;
|
||||
return ServerRequestSeatChangeOriginal(PlayerController, TargetSeatIndex);
|
||||
|
||||
AFortPlayerController::ServerExecuteInventoryItemHook(PlayerController, PickaxeInstance->GetItemEntry()->GetItemGuid()); // Bad, we should equip the last weapon.
|
||||
return ServerRequestSeatChangeOriginal(PlayerController, TargetSeatIndex);
|
||||
@@ -59,7 +59,7 @@ void AFortPlayerControllerAthena::ServerRequestSeatChangeHook(AFortPlayerControl
|
||||
auto RequestedVehicleInstance = NewAndModifiedInstances.first[0];
|
||||
|
||||
if (!RequestedVehicleInstance)
|
||||
return;
|
||||
return ServerRequestSeatChangeOriginal(PlayerController, TargetSeatIndex);
|
||||
|
||||
WorldInventory->Update();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ void AFortPlayerPawnAthena::OnCapsuleBeginOverlapHook(UObject* Context, FFrame*
|
||||
bool bFromSweep;
|
||||
auto SweepResultPtr = (FHitResult*)std::realloc(0, FHitResult::GetStructSize());
|
||||
|
||||
LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!");
|
||||
// LOG_INFO(LogDev, "OnCapsuleBeginOverlapHook!");
|
||||
|
||||
Stack->StepCompiledIn(&OverlappedComp);
|
||||
Stack->StepCompiledIn(&OtherActor);
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
|
||||
void AFortPlayerStateAthena::ServerSetInAircraftHook(UObject* Context, FFrame& Stack, void* Ret)
|
||||
{
|
||||
if (Globals::bLateGame)
|
||||
return ServerSetInAircraftOriginal(Context, Stack, Ret);
|
||||
|
||||
auto PlayerState = (AFortPlayerStateAthena*)Context;
|
||||
auto PlayerController = Cast<AFortPlayerControllerAthena>(PlayerState->GetOwner());
|
||||
|
||||
if (!PlayerController)
|
||||
return;
|
||||
return ServerSetInAircraftOriginal(Context, Stack, Ret);
|
||||
|
||||
// std::cout << "bNewInAircraft: " << bNewInAircraft << '\n';
|
||||
// std::cout << "PlayerController->IsInAircraft(): " << PlayerController->IsInAircraft() << '\n';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "reboot.h"
|
||||
#include "FortPlayerControllerAthena.h"
|
||||
#include "FortGameModeAthena.h"
|
||||
#include "FortLootPackage.h"
|
||||
|
||||
UClass* AGameModeBase::GetDefaultPawnClassForController(AController* InController)
|
||||
{
|
||||
@@ -81,6 +82,9 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
{
|
||||
auto WorldInventory = NewPlayerAsAthena->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return NewPawn;
|
||||
|
||||
if (!WorldInventory->GetPickaxeInstance())
|
||||
{
|
||||
auto CosmeticLoadout = NewPlayerAsAthena->GetCosmeticLoadout();
|
||||
@@ -101,18 +105,33 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
static UFortItemDefinition* WoodItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
|
||||
static UFortItemDefinition* DamageTrap = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Traps/TID_ContextTrap_Athena.TID_ContextTrap_Athena");
|
||||
|
||||
WorldInventory->AddItem(PickaxeDefinition, nullptr);
|
||||
WorldInventory->AddItem(EditToolItemDefinition, nullptr);
|
||||
WorldInventory->AddItem(BuildingItemData_Wall, nullptr);
|
||||
WorldInventory->AddItem(BuildingItemData_Floor, nullptr);
|
||||
WorldInventory->AddItem(BuildingItemData_Stair_W, nullptr);
|
||||
WorldInventory->AddItem(BuildingItemData_RoofS, nullptr);
|
||||
WorldInventory->AddItem(PickaxeDefinition, nullptr);
|
||||
// WorldInventory->AddItem(WoodItemData, nullptr, 100);
|
||||
// WorldInventory->AddItem(DamageTrap, nullptr);
|
||||
// WorldInventory->AddItem(FindObject<UFortItemDefinition>(L"/ParallelGameplay/Items/WestSausage/WID_WestSausage_Parallel.WID_WestSausage_Parallel"), nullptr, 1, 1000);
|
||||
// WorldInventory->AddItem(FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Consumables/HappyGhost/WID_Athena_HappyGhost.WID_Athena_HappyGhost"), nullptr);
|
||||
|
||||
WorldInventory->Update(true);
|
||||
/* if (Globals::bLateGame)
|
||||
{
|
||||
auto SpawnIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot_Warmup");
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
auto LootDrops = PickLootDrops(SpawnIslandTierGroup);
|
||||
|
||||
for (auto& LootDrop : LootDrops)
|
||||
{
|
||||
WorldInventory->AddItem(LootDrop.ItemDefinition, nullptr, LootDrop.Count, LootDrop.LoadedAmmo);
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
WorldInventory->Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,6 +448,23 @@ void ServerCheatHook(AFortPlayerControllerAthena* PlayerController, FString Msg)
|
||||
CheatManager->Teleport();
|
||||
CheatManager = nullptr;
|
||||
}
|
||||
else if (Command == "setsafezonephase")
|
||||
{
|
||||
int NewSafeZonePhase = 1;
|
||||
|
||||
try { NewSafeZonePhase = std::stof(Arguments[1]); }
|
||||
catch (...) {}
|
||||
|
||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||
auto GameState = GameMode->GetGameState();
|
||||
|
||||
static auto GameMode_SafeZonePhaseOffset = GameMode->GetOffset("SafeZonePhase");
|
||||
static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase");
|
||||
|
||||
GameMode->Get<int>(GameMode_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
SendMessageToConsole(PlayerController, L"Set safe zone phase!");
|
||||
}
|
||||
else if (Command == "bugitgo")
|
||||
{
|
||||
if (Arguments.size() <= 3)
|
||||
|
||||
@@ -12,10 +12,51 @@ static inline void (*SetZoneToIndexOriginal)(AFortGameModeAthena* GameModeAthena
|
||||
|
||||
static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK)
|
||||
{
|
||||
static auto ZoneDurationsOffset = Fortnite_Version >= 15 && Fortnite_Version < 18 ? 0x258
|
||||
: std::floor(Fortnite_Version) >= 18 ? 0x248
|
||||
: 0x1F8; // S13-S14
|
||||
|
||||
LOG_INFO(LogDev, "SetZoneToIndexHook!");
|
||||
|
||||
bool bIsFirstZone = false;
|
||||
|
||||
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
||||
|
||||
if (!GameState)
|
||||
if (Globals::bLateGame)
|
||||
{
|
||||
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
|
||||
static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase");
|
||||
|
||||
int NewSafeZonePhase = GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset);
|
||||
|
||||
if (NewSafeZonePhase < 4)
|
||||
{
|
||||
NewSafeZonePhase = 4;
|
||||
bIsFirstZone = true;
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "Setting zone to: {}", NewSafeZonePhase);
|
||||
|
||||
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
}
|
||||
|
||||
if (Fortnite_Version < 13)
|
||||
{
|
||||
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
|
||||
if (Globals::bLateGame && bIsFirstZone)
|
||||
{
|
||||
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipshrinksafezone", nullptr);
|
||||
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
|
||||
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipshrinksafezone", nullptr);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GameState)
|
||||
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
|
||||
static auto SafeZoneIndicatorOffset = GameModeAthena->GetOffset("SafeZoneIndicator");
|
||||
auto SafeZoneIndicator = GameModeAthena->Get<AActor*>(SafeZoneIndicatorOffset);
|
||||
@@ -34,8 +75,7 @@ static void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int Override
|
||||
|
||||
LOG_INFO(LogDev, "SafeZoneDefinitionOffset: 0x{:x}", SafeZoneDefinitionOffset);
|
||||
|
||||
static auto ZoneDurationsOffset = Fortnite_Version >= 15 && Fortnite_Version < 18 ? 0x258 : std::floor(Fortnite_Version) >= 18 ? 0x248 : 0x1F8;
|
||||
static auto ZoneHoldDurationsOffset = ZoneDurationsOffset - 0x10;
|
||||
static auto ZoneHoldDurationsOffset = ZoneDurationsOffset - 0x10; // fr
|
||||
|
||||
auto& ZoneDurations = *(TArray<float>*)(__int64(SafeZoneDefinition) + ZoneDurationsOffset);
|
||||
auto& ZoneHoldDurations = *(TArray<float>*)(__int64(SafeZoneDefinition) + ZoneHoldDurationsOffset);
|
||||
|
||||
@@ -622,11 +622,13 @@ DWORD WINAPI Main(LPVOID)
|
||||
VirtualSwap(FortAbilitySystemComponentAthenaDefault->VFTable, InternalServerTryActivateAbilityIndex, UAbilitySystemComponent::InternalServerTryActivateAbilityHook);
|
||||
}
|
||||
|
||||
if (Engine_Version >= 424)
|
||||
// if (Engine_Version >= 424)
|
||||
{
|
||||
static auto FortControllerComponent_AircraftDefault = FindObject<UClass>(L"/Script/FortniteGame.Default__FortControllerComponent_Aircraft");
|
||||
static auto FortControllerComponent_AircraftDefault = FindObject<AActor>(L"/Script/FortniteGame.Default__FortControllerComponent_Aircraft");
|
||||
static auto ServerAttemptAircraftJumpFn = FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerAthena.ServerAttemptAircraftJump") ? FindObject<UFunction>(L"/Script/FortniteGame.FortPlayerControllerAthena.ServerAttemptAircraftJump")
|
||||
: FindObject<UFunction>(L"/Script/FortniteGame.FortControllerComponent_Aircraft.ServerAttemptAircraftJump");
|
||||
|
||||
Hooking::MinHook::Hook(FortControllerComponent_AircraftDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortControllerComponent_Aircraft.ServerAttemptAircraftJump"),
|
||||
Hooking::MinHook::Hook(FortControllerComponent_AircraftDefault ? FortControllerComponent_AircraftDefault : FortPlayerControllerAthenaDefault, ServerAttemptAircraftJumpFn,
|
||||
AFortPlayerController::ServerAttemptAircraftJumpHook, nullptr, false);
|
||||
}
|
||||
|
||||
@@ -683,8 +685,8 @@ DWORD WINAPI Main(LPVOID)
|
||||
);
|
||||
}
|
||||
|
||||
if (Fortnite_Version >= 13)
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::SetZoneToIndex, (PVOID)SetZoneToIndexHook, (PVOID*)&SetZoneToIndexOriginal);
|
||||
// if (Fortnite_Version >= 13)
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::SetZoneToIndex, (PVOID)SetZoneToIndexHook, (PVOID*)&SetZoneToIndexOriginal);
|
||||
|
||||
#ifndef PROD
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::ProcessEvent, ProcessEventHook, (PVOID*)&UObject::ProcessEventOriginal);
|
||||
|
||||
@@ -623,16 +623,10 @@ static inline uint64 FindNoMCP()
|
||||
|
||||
static inline uint64 FindSetZoneToIndex() // actually StartNewSafeZonePhase
|
||||
{
|
||||
// return 0;
|
||||
|
||||
// if (Fortnite_Version == 14.60)
|
||||
// return __int64(GetModuleHandleW(0)) + 0x207F9B0;
|
||||
|
||||
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 44 8B F2 89 54 24 48 4C 8B F9 48 89 4D 90 E8 ? ? ? ? 45 33 ED 48 89 45 A0 48 8B F0").Get(); // 19.10
|
||||
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D 68 98 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 08 44 8B F2 89 54 24 48 48 8B F1 48 89 4C 24 ? E8 ? ? ? ? 45 33 E4 48 89 44 24 ? 4C 8B F8 48 85 C0 74 09").Get(); // 17.30
|
||||
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D 68 88 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 10 44 8B F2 89 54 24 48 48 8B F1 48 89 4C 24 ? E8 ? ? ? ? 45 33 E4 48 89 45 80 4C 8B F8 48 85 C0 74 09 48 8B B8").Get(); // 17.50
|
||||
// return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 10 48 89 70 18 48 89 78 20 55 41 54 41 55 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 C8 0F 29 78 B8 44 0F 29 40 ? 44 0F 29 48 ? 44 0F 29 50 ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B B1 ? ? ? ? 45 33 ED 89 54 24 70 44 8B FA 48 89 4C 24").Get(); // 18.40
|
||||
// return Memcury::Scanner::FindPattern("40 55 53 56 41 55 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 18 48 8B").Get(); // 14.60
|
||||
if (Engine_Version == 420)
|
||||
return Memcury::Scanner::FindPattern("E8 ? ? ? ? EB 31 80 B9 ? ? ? ? ?").RelativeOffset(1).Get(); // 3.5
|
||||
if (Engine_Version == 422)
|
||||
return Memcury::Scanner::FindPattern("E9 ? ? ? ? 48 8B C1 40 38 B9").RelativeOffset(1).Get(); // 7.40
|
||||
|
||||
auto Addr = Memcury::Scanner::FindStringRef(L"FortGameModeAthena: No MegaStorm on SafeZone[%d]. GridCellThickness is less than 1.0.", true, 0, Fortnite_Version >= 16.50).Get();
|
||||
// return FindBytes(Addr, { 0x40, 0x55 }, 30000, 0, true);
|
||||
|
||||
@@ -420,59 +420,145 @@ void MainUI()
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::Button("Start Bus Countdown"))
|
||||
if (Globals::bLateGame)
|
||||
{
|
||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||
auto GameState = GameMode->GetGameState();
|
||||
|
||||
if (Fortnite_Version == 1.11)
|
||||
if (ImGui::Button("Start Bus"))
|
||||
{
|
||||
static auto OverrideBattleBusSkin = FindObject("/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
|
||||
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
|
||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||
auto GameState = GameMode->GetGameState();
|
||||
|
||||
if (OverrideBattleBusSkin)
|
||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts");
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||
|
||||
while (GameState->GetPtr<TArray<AActor*>>(AircraftsOffset)->Num() <= 0) // hmm
|
||||
{
|
||||
static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager");
|
||||
auto AssetManager = GetEngine()->Get(AssetManagerOffset);
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
if (AssetManager)
|
||||
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);
|
||||
}
|
||||
|
||||
auto Aircrafts = GameState->GetPtr<TArray<AActor*>>(AircraftsOffset);
|
||||
|
||||
while (Aircrafts->Num() <= 0)
|
||||
{
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
|
||||
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextCenterOffset); // SafeZoneLocations.at(4);
|
||||
LocationToStartAircraft.Z += 10000;
|
||||
|
||||
for (int i = 0; i < Aircrafts->Num(); i++)
|
||||
{
|
||||
Aircrafts->at(i)->TeleportTo(LocationToStartAircraft, FRotator());
|
||||
|
||||
static auto FlightInfoOffset = Aircrafts->at(i)->GetOffset("FlightInfo");
|
||||
auto FlightInfo = Aircrafts->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++)
|
||||
{
|
||||
static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData");
|
||||
auto AthenaGameData = AssetManager->Get(AthenaGameDataOffset);
|
||||
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
|
||||
|
||||
if (AthenaGameData)
|
||||
{
|
||||
static auto DefaultBattleBusSkinOffset = AthenaGameData->GetOffset("DefaultBattleBusSkin");
|
||||
AthenaGameData->Get(DefaultBattleBusSkinOffset) = OverrideBattleBusSkin;
|
||||
}
|
||||
FlightInfo->GetFlightSpeed() = 0;
|
||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
static auto DefaultBattleBusOffset = GameState->GetOffset("DefaultBattleBus");
|
||||
GameState->Get(DefaultBattleBusOffset) = OverrideBattleBusSkin;
|
||||
static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked");
|
||||
static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked"));
|
||||
GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false);
|
||||
|
||||
static auto FortAthenaAircraftClass = FindObject<UClass>("/Script/FortniteGame.FortAthenaAircraft");
|
||||
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipshrinksafezone", nullptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ImGui::Button("Start Bus Countdown"))
|
||||
{
|
||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||
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");
|
||||
Aircraft->Get(DefaultBusSkinOffset) = OverrideBattleBusSkin;
|
||||
|
||||
static auto SpawnedCosmeticActorOffset = Aircraft->GetOffset("SpawnedCosmeticActor");
|
||||
auto SpawnedCosmeticActor = Aircraft->Get<AActor*>(SpawnedCosmeticActorOffset);
|
||||
|
||||
if (SpawnedCosmeticActor)
|
||||
if (AssetManager)
|
||||
{
|
||||
static auto ActiveSkinOffset = SpawnedCosmeticActor->GetOffset("ActiveSkin");
|
||||
SpawnedCosmeticActor->Get(ActiveSkinOffset) = OverrideBattleBusSkin;
|
||||
static auto AthenaGameDataOffset = AssetManager->GetOffset("AthenaGameData");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user