mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
Later game and fix mcp
This commit is contained in:
@@ -15,8 +15,7 @@ bool ABuildingContainer::SpawnLoot(AFortPawn* Pawn)
|
||||
|
||||
FVector LocationToSpawnLoot = this->GetActorLocation() + this->GetActorForwardVector() * this->GetLootSpawnLocation_Athena().X + this->GetActorRightVector() * this->GetLootSpawnLocation_Athena().Y + this->GetActorUpVector() * this->GetLootSpawnLocation_Athena().Z;
|
||||
|
||||
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup");
|
||||
auto RedirectedLootTier = GameMode->RedirectLootTier(this->Get<FName>(SearchLootTierGroupOffset));
|
||||
auto RedirectedLootTier = GameMode->RedirectLootTier(GetSearchLootTierGroup());
|
||||
|
||||
// LOG_INFO(LogInteraction, "RedirectedLootTier: {}", RedirectedLootTier.ToString());
|
||||
|
||||
|
||||
@@ -13,6 +13,12 @@ public:
|
||||
return this->ReadBitfieldValue(bDestroyContainerOnSearchOffset, bDestroyContainerOnSearchFieldMask);
|
||||
}
|
||||
|
||||
FName& GetSearchLootTierGroup()
|
||||
{
|
||||
static auto SearchLootTierGroupOffset = this->GetOffset("SearchLootTierGroup");
|
||||
return Get<FName>(SearchLootTierGroupOffset);
|
||||
}
|
||||
|
||||
bool IsAlreadySearched()
|
||||
{
|
||||
static auto bAlreadySearchedOffset = this->GetOffset("bAlreadySearched");
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
{
|
||||
auto CurveTableMode = GetCurveTableMode();
|
||||
|
||||
LOG_INFO(LogDev, "RowName {} CurveTableMode {} Size {}", RowName.ComparisonIndex.Value ? RowName.ToString() : "InvalidComparision", (int)CurveTableMode, GetCurveTableSize());
|
||||
// LOG_INFO(LogDev, "RowName {} CurveTableMode {} Size {}", RowName.ComparisonIndex.Value ? RowName.ToString() : "InvalidComparision", (int)CurveTableMode, GetCurveTableSize());
|
||||
|
||||
if (CurveTableMode == ECurveTableMode::SimpleCurves)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
}
|
||||
else if (CurveTableMode == ECurveTableMode::RichCurves)
|
||||
{
|
||||
|
||||
LOG_INFO(LogDev, "RICHCURVE UNIMPLEMENTED!");
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -62,7 +62,7 @@ static UFortPlaylist* GetPlaylistToUse()
|
||||
// SET OVERRIDE PLAYLIST DOWN HERE
|
||||
|
||||
if (Globals::bCreative)
|
||||
Playlist = FindObject<UFortPlaylist>("/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2");
|
||||
Playlist = FindObject<UFortPlaylist>(L"/Game/Athena/Playlists/Creative/Playlist_PlaygroundV2.Playlist_PlaygroundV2");
|
||||
|
||||
return Playlist;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void AFortGameModeAthena::SkipAircraft()
|
||||
if (bGameModeWillSkipAircraftOffset != -1) // hmm?
|
||||
GameState->Get<bool>(bGameModeWillSkipAircraftOffset) = true;
|
||||
|
||||
static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>("/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone");
|
||||
static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone");
|
||||
|
||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
|
||||
|
||||
@@ -194,6 +194,19 @@ void AFortGameModeAthena::PauseSafeZone(bool bPaused)
|
||||
SafeZoneIndicator->GetSafeZoneFinishShrinkTime() = GameState->GetServerWorldTimeSeconds() + this->Get<float>(TimeRemainingWhenPhasePausedOffset);
|
||||
}
|
||||
|
||||
void AFortGameModeAthena::OnAircraftEnteredDropZoneHook(AFortGameModeAthena* GameModeAthena, AActor* Aircraft)
|
||||
{
|
||||
LOG_INFO(LogDev, "OnAircraftEnteredDropZoneHook!");
|
||||
|
||||
OnAircraftEnteredDropZoneOriginal(GameModeAthena, Aircraft);
|
||||
|
||||
if (Globals::bLateGame.load())
|
||||
{
|
||||
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
||||
GameState->SkipAircraft();
|
||||
}
|
||||
}
|
||||
|
||||
bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode)
|
||||
{
|
||||
Globals::bHitReadyToStartMatch = true;
|
||||
@@ -600,11 +613,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
|
||||
auto MapInfo = GameState->GetMapInfo();
|
||||
|
||||
if (!bUseCustomMap)
|
||||
{
|
||||
if (!MapInfo && Engine_Version >= 421)
|
||||
return false;
|
||||
}
|
||||
if (!MapInfo && Engine_Version >= 421)
|
||||
return false;
|
||||
|
||||
static int LastNum = 1;
|
||||
|
||||
@@ -1229,6 +1239,8 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
||||
ABuildingContainer* CurrentActor = (ABuildingContainer*)BRIsland_FloorLoot_Actors.at(i);
|
||||
spawned++;
|
||||
|
||||
// LOG_INFO(LogDev, "Test: {}", CurrentActor->GetSearchLootTierGroup().ToString());
|
||||
|
||||
auto Location = CurrentActor->GetActorLocation() + CurrentActor->GetActorForwardVector() * CurrentActor->GetLootSpawnLocation_Athena().X + CurrentActor->GetActorRightVector() * CurrentActor->GetLootSpawnLocation_Athena().Y + CurrentActor->GetActorUpVector() * CurrentActor->GetLootSpawnLocation_Athena().Z;
|
||||
|
||||
std::vector<LootDrop> LootDrops = PickLootDrops(BRIslandTierGroup, GameState->GetWorldLevel(), -1, bPrintIsland);
|
||||
|
||||
@@ -234,6 +234,7 @@ public:
|
||||
static inline bool (*Athena_ReadyToStartMatchOriginal)(AFortGameModeAthena* GameMode);
|
||||
static inline void (*Athena_HandleStartingNewPlayerOriginal)(AFortGameModeAthena* GameMode, AActor* NewPlayer);
|
||||
static inline void (*SetZoneToIndexOriginal)(AFortGameModeAthena* GameModeAthena, int OverridePhaseMaybeIDFK);
|
||||
static inline void (*OnAircraftEnteredDropZoneOriginal)(AFortGameModeAthena* GameModeAthena, AActor* Aircraft);
|
||||
|
||||
AFortSafeZoneIndicator*& GetSafeZoneIndicator()
|
||||
{
|
||||
@@ -265,6 +266,7 @@ public:
|
||||
|
||||
static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage); // idk where to put
|
||||
|
||||
static void OnAircraftEnteredDropZoneHook(AFortGameModeAthena* GameModeAthena, AActor* Aircraft);
|
||||
static bool Athena_ReadyToStartMatchHook(AFortGameModeAthena* GameMode);
|
||||
static int Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint8 preferredTeam, AActor* Controller);
|
||||
static void Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor);
|
||||
|
||||
@@ -74,6 +74,57 @@ void AFortGameStateAthena::AddPlayerStateToGameMemberInfo(AFortPlayerStateAthena
|
||||
GameMemberInfoArray->MarkArrayDirty();
|
||||
}
|
||||
|
||||
void AFortGameStateAthena::SkipAircraft()
|
||||
{
|
||||
// return UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipaircraft", nullptr);
|
||||
|
||||
if (GetGamePhase() != EAthenaGamePhase::Aircraft)
|
||||
return;
|
||||
|
||||
// this->bGameModeWillSkipAircraft = true;
|
||||
|
||||
auto GetAircrafts = [&]() -> std::vector<AActor*>
|
||||
{
|
||||
static auto AircraftsOffset = this->GetOffset("Aircrafts", false);
|
||||
std::vector<AActor*> Aircrafts;
|
||||
|
||||
if (AircraftsOffset == -1)
|
||||
{
|
||||
// GameState->Aircraft
|
||||
|
||||
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
|
||||
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
|
||||
|
||||
for (int i = 0; i < AllAircrafts.Num(); i++)
|
||||
{
|
||||
Aircrafts.push_back(AllAircrafts.at(i));
|
||||
}
|
||||
|
||||
AllAircrafts.Free();
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& GameStateAircrafts = this->Get<TArray<AActor*>>(AircraftsOffset);
|
||||
|
||||
for (int i = 0; i < GameStateAircrafts.Num(); i++)
|
||||
{
|
||||
Aircrafts.push_back(GameStateAircrafts.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
return Aircrafts;
|
||||
};
|
||||
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
|
||||
for (auto Aircraft : GetAircrafts())
|
||||
{
|
||||
// haha skunked we should do GetAircraft!!
|
||||
static auto OnAircraftExitedDropZoneFn = FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftExitedDropZone");
|
||||
GameMode->ProcessEvent(OnAircraftExitedDropZoneFn, &Aircraft);
|
||||
}
|
||||
}
|
||||
|
||||
TScriptInterface<UFortSafeZoneInterface> AFortGameStateAthena::GetSafeZoneInterface()
|
||||
{
|
||||
int Offset = -1;
|
||||
|
||||
@@ -153,6 +153,7 @@ public:
|
||||
TScriptInterface<UFortSafeZoneInterface> GetSafeZoneInterface();
|
||||
|
||||
void AddPlayerStateToGameMemberInfo(class AFortPlayerStateAthena* PlayerState);
|
||||
void SkipAircraft();
|
||||
|
||||
int GetAircraftIndex(AFortPlayerState* PlayerState);
|
||||
bool IsRespawningAllowed(AFortPlayerState* PlayerState); // actually in zone
|
||||
|
||||
@@ -471,16 +471,20 @@ void AFortInventory::ModifyCount(UFortItem* ItemInstance, int New, bool bRemove,
|
||||
|
||||
UFortItem* AFortInventory::GetPickaxeInstance()
|
||||
{
|
||||
static auto FortWeaponMeleeItemDefinitionClass = FindObject<UClass>("/Script/FortniteGame.FortWeaponMeleeItemDefinition");
|
||||
static auto FortWeaponMeleeItemDefinitionClass = FindObject<UClass>(L"/Script/FortniteGame.FortWeaponMeleeItemDefinition");
|
||||
|
||||
auto& ItemInstances = GetItemList().GetItemInstances();
|
||||
|
||||
for (int i = 0; i < ItemInstances.Num(); i++)
|
||||
for (int i = 0; i < ItemInstances.Num(); ++i)
|
||||
{
|
||||
auto ItemInstance = ItemInstances.At(i);
|
||||
|
||||
if (ItemInstance->GetItemEntry()->GetItemDefinition()->IsA(FortWeaponMeleeItemDefinitionClass))
|
||||
if (ItemInstance->GetItemEntry() && ItemInstance->GetItemEntry()->GetItemDefinition() &&
|
||||
ItemInstance->GetItemEntry()->GetItemDefinition()->IsA(FortWeaponMeleeItemDefinitionClass)
|
||||
)
|
||||
{
|
||||
return ItemInstance;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -15,7 +15,7 @@ char UFortInventoryInterface::RemoveInventoryItemHook(__int64 a1, FGuid a2, int
|
||||
// LOG_INFO(LogDev, "FortPlayerControllerSuperSize: {}", FortPlayerControllerSuperSize);
|
||||
// LOG_INFO(LogDev, "ControllerObject: {}", ControllerObject->GetFullName());
|
||||
|
||||
LOG_INFO(LogDev, __FUNCTION__);
|
||||
// LOG_INFO(LogDev, __FUNCTION__);
|
||||
|
||||
if (!ControllerObject)
|
||||
return false;
|
||||
|
||||
@@ -226,7 +226,7 @@ void AFortPlayerController::ServerLoadingScreenDroppedHook(UObject* Context, FFr
|
||||
|
||||
auto PlayerController = (AFortPlayerController*)Context;
|
||||
|
||||
// PlayerController->ApplyCosmeticLoadout();
|
||||
PlayerController->ApplyCosmeticLoadout();
|
||||
|
||||
return ServerLoadingScreenDroppedOriginal(Context, Stack, Ret);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "FortGameModeAthena.h"
|
||||
#include "reboot.h"
|
||||
#include "KismetSystemLibrary.h"
|
||||
|
||||
void AFortSafeZoneIndicator::SkipShrinkSafeZone()
|
||||
{
|
||||
|
||||
@@ -127,25 +127,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
if (!NewPawn)
|
||||
return nullptr;
|
||||
|
||||
bool bIsRespawning = false;
|
||||
|
||||
/*
|
||||
static auto RespawnDataOffset = PlayerStateAthena->GetOffset("RespawnData", false);
|
||||
|
||||
if (RespawnDataOffset != -1)
|
||||
{
|
||||
auto RespawnDataPtr = PlayerStateAthena->GetRespawnData();
|
||||
|
||||
if (RespawnDataPtr->IsServerReady() && RespawnDataPtr->IsClientReady()) // && GameState->IsRespawningAllowed(PlayerState);
|
||||
{
|
||||
bIsRespawning = true;
|
||||
}
|
||||
} */
|
||||
|
||||
/* auto DeathInfo = (void*)(__int64(PlayerStateAthena) + MemberOffsets::FortPlayerStateAthena::DeathInfo);
|
||||
FVector DeathLocation = MemberOffsets::DeathInfo::DeathLocation != -1 ? *(FVector*)(__int64(DeathInfo) + MemberOffsets::DeathInfo::DeathLocation) : FVector(0, 0, 0);
|
||||
|
||||
bIsRespawning = !(DeathLocation.CompareVectors(FVector(0, 0, 0))); // bro kms */
|
||||
bool bIsRespawning = false; // reel
|
||||
|
||||
auto ASC = PlayerStateAthena->GetAbilitySystemComponent();
|
||||
auto GameState = ((AFortGameModeAthena*)GameMode)->GetGameStateAthena();
|
||||
@@ -168,62 +150,62 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
{
|
||||
auto WorldInventory = NewPlayerAsAthena->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
return NewPawn;
|
||||
|
||||
if (!WorldInventory->GetPickaxeInstance())
|
||||
if (WorldInventory->IsValidLowLevel())
|
||||
{
|
||||
// TODO Check Playlist->bRequirePickaxeInStartingInventory
|
||||
|
||||
auto& StartingItems = ((AFortGameModeAthena*)GameMode)->GetStartingItems();
|
||||
|
||||
NewPlayerAsAthena->AddPickaxeToInventory();
|
||||
|
||||
for (int i = 0; i < StartingItems.Num(); ++i)
|
||||
if (!WorldInventory->GetPickaxeInstance())
|
||||
{
|
||||
auto& StartingItem = StartingItems.at(i);
|
||||
// TODO Check Playlist->bRequirePickaxeInStartingInventory
|
||||
|
||||
WorldInventory->AddItem(StartingItem.GetItem(), nullptr, StartingItem.GetCount());
|
||||
}
|
||||
auto& StartingItems = ((AFortGameModeAthena*)GameMode)->GetStartingItems();
|
||||
|
||||
/* if (Globals::bLateGame)
|
||||
{
|
||||
auto SpawnIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot_Warmup");
|
||||
NewPlayerAsAthena->AddPickaxeToInventory();
|
||||
|
||||
for (int i = 0; i < 5; ++i)
|
||||
for (int i = 0; i < StartingItems.Num(); ++i)
|
||||
{
|
||||
auto LootDrops = PickLootDrops(SpawnIslandTierGroup);
|
||||
auto& StartingItem = StartingItems.at(i);
|
||||
|
||||
for (auto& LootDrop : LootDrops)
|
||||
{
|
||||
WorldInventory->AddItem(LootDrop.ItemDefinition, nullptr, LootDrop.Count, LootDrop.LoadedAmmo);
|
||||
}
|
||||
WorldInventory->AddItem(StartingItem.GetItem(), nullptr, StartingItem.GetCount());
|
||||
}
|
||||
} */
|
||||
|
||||
auto AddInventoryOverrideTeamLoadouts = [&](AFortAthenaMutator* Mutator)
|
||||
{
|
||||
if (auto InventoryOverride = Cast<AFortAthenaMutator_InventoryOverride>(Mutator))
|
||||
/* if (Globals::bLateGame)
|
||||
{
|
||||
auto TeamIndex = PlayerStateAthena->GetTeamIndex();
|
||||
auto LoadoutTeam = InventoryOverride->GetLoadoutTeamForTeamIndex(TeamIndex);
|
||||
auto SpawnIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot_Warmup");
|
||||
|
||||
if (LoadoutTeam.UpdateOverrideType == EAthenaInventorySpawnOverride::Always)
|
||||
for (int i = 0; i < 5; ++i)
|
||||
{
|
||||
auto LoadoutContainer = InventoryOverride->GetLoadoutContainerForTeamIndex(TeamIndex);
|
||||
auto LootDrops = PickLootDrops(SpawnIslandTierGroup);
|
||||
|
||||
for (int i = 0; i < LoadoutContainer.Loadout.Num(); ++i)
|
||||
for (auto& LootDrop : LootDrops)
|
||||
{
|
||||
auto& ItemAndCount = LoadoutContainer.Loadout.at(i);
|
||||
WorldInventory->AddItem(ItemAndCount.GetItem(), nullptr, ItemAndCount.GetCount());
|
||||
WorldInventory->AddItem(LootDrop.ItemDefinition, nullptr, LootDrop.Count, LootDrop.LoadedAmmo);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
} */
|
||||
|
||||
LoopMutators(AddInventoryOverrideTeamLoadouts);
|
||||
auto AddInventoryOverrideTeamLoadouts = [&](AFortAthenaMutator* Mutator)
|
||||
{
|
||||
if (auto InventoryOverride = Cast<AFortAthenaMutator_InventoryOverride>(Mutator))
|
||||
{
|
||||
auto TeamIndex = PlayerStateAthena->GetTeamIndex();
|
||||
auto LoadoutTeam = InventoryOverride->GetLoadoutTeamForTeamIndex(TeamIndex);
|
||||
|
||||
WorldInventory->Update();
|
||||
if (LoadoutTeam.UpdateOverrideType == EAthenaInventorySpawnOverride::Always)
|
||||
{
|
||||
auto LoadoutContainer = InventoryOverride->GetLoadoutContainerForTeamIndex(TeamIndex);
|
||||
|
||||
for (int i = 0; i < LoadoutContainer.Loadout.Num(); ++i)
|
||||
{
|
||||
auto& ItemAndCount = LoadoutContainer.Loadout.at(i);
|
||||
WorldInventory->AddItem(ItemAndCount.GetItem(), nullptr, ItemAndCount.GetCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
LoopMutators(AddInventoryOverrideTeamLoadouts);
|
||||
|
||||
WorldInventory->Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -249,5 +231,7 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
// NewPlayerAsAthena->RespawnPlayerAfterDeath(true);
|
||||
}
|
||||
|
||||
// LOG_INFO(LogDev, "Finish SpawnDefaultPawnFor!");
|
||||
|
||||
return NewPawn;
|
||||
}
|
||||
@@ -17,45 +17,41 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
|
||||
: 0x1F8; // S13-S14
|
||||
|
||||
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
|
||||
LOG_INFO(LogDev, "Old SafeZonePhase: {}", GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset));
|
||||
|
||||
auto GameState = Cast<AFortGameStateAthena>(GameModeAthena->GetGameState());
|
||||
|
||||
if (!GameState)
|
||||
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
|
||||
LOG_INFO(LogDev, "GamePhaseStep: {}", (int)GameState->GetGamePhaseStep());
|
||||
auto SafeZoneIndicator = GameModeAthena->GetSafeZoneIndicator();
|
||||
|
||||
if (false)
|
||||
{
|
||||
if (Globals::bLateGame)
|
||||
{
|
||||
static auto GameMode_SafeZonePhaseOffset = GameModeAthena->GetOffset("SafeZonePhase");
|
||||
static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase");
|
||||
static auto GameState_SafeZonePhaseOffset = GameState->GetOffset("SafeZonePhase");
|
||||
|
||||
static int ahaaSafeZonePhase = 4;
|
||||
int NewSafeZonePhase = ahaaSafeZonePhase; // GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset);
|
||||
static int NewLateGameSafeZonePhase = 2;
|
||||
|
||||
const int OriginalOldSafeZonePhase = GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset);
|
||||
|
||||
if (NewSafeZonePhase < 4)
|
||||
{
|
||||
NewSafeZonePhase = 4;
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "Setting zone to: {} ({})", NewSafeZonePhase, OriginalOldSafeZonePhase);
|
||||
|
||||
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewSafeZonePhase;
|
||||
ahaaSafeZonePhase++;
|
||||
}
|
||||
}
|
||||
LOG_INFO(LogDev, "NewLateGameSafeZonePhase: {}", NewLateGameSafeZonePhase);
|
||||
|
||||
if (Fortnite_Version < 13)
|
||||
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
{
|
||||
if (Globals::bLateGame.load())
|
||||
{
|
||||
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
|
||||
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
|
||||
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
|
||||
static auto SafeZoneIndicatorOffset = GameModeAthena->GetOffset("SafeZoneIndicator");
|
||||
auto SafeZoneIndicator = GameModeAthena->Get<AActor*>(SafeZoneIndicatorOffset);
|
||||
if (NewLateGameSafeZonePhase == 2 || NewLateGameSafeZonePhase == 3)
|
||||
{
|
||||
if (SafeZoneIndicator)
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
else
|
||||
LOG_WARN(LogZone, "Invalid SafeZoneIndicator!");
|
||||
}
|
||||
|
||||
NewLateGameSafeZonePhase++;
|
||||
return;
|
||||
}
|
||||
|
||||
return SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
}
|
||||
|
||||
if (!SafeZoneIndicator)
|
||||
{
|
||||
@@ -103,23 +99,8 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
|
||||
if (!FortGameData)
|
||||
FortGameData = FindObject<UCurveTable>(L"/Game/Balance/AthenaGameData.AthenaGameData");
|
||||
|
||||
// LOG_INFO(LogDev, "FortGameData: {}", FortGameData ? FortGameData->GetFullName() : "InvalidObject");
|
||||
|
||||
auto ShrinkTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.ShrinkTime");
|
||||
auto HoldTimeFName = UKismetStringLibrary::Conv_StringToName(L"Default.SafeZone.WaitTime");
|
||||
FString ContextString;
|
||||
|
||||
/* for (int i = 0; i < 10; i++)
|
||||
{
|
||||
LOG_INFO(LogDev, "[{}] Value {}", i, FortGameData->GetValueOfKey(FortGameData->GetKey(ShrinkTimeFName, i)));
|
||||
} */
|
||||
|
||||
/* for (float i = 0; i < 1.1; i += 0.1)
|
||||
{
|
||||
float res;
|
||||
UDataTableFunctionLibrary::EvaluateCurveTableRow(FortGameData, ShrinkTimeFName, i, ContextString, nullptr, &res);
|
||||
LOG_INFO(LogZone, "[{}] {}", i, res);
|
||||
} */
|
||||
|
||||
for (int i = 0; i < ZoneDurations.Num(); i++)
|
||||
{
|
||||
@@ -129,26 +110,23 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
|
||||
{
|
||||
ZoneHoldDurations.at(i) = FortGameData->GetValueOfKey(FortGameData->GetKey(HoldTimeFName, i));
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < ZoneDurations.Num(); i++)
|
||||
{
|
||||
LOG_INFO(LogZone, "Move [{}] {}", i, ZoneDurations.at(i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < ZoneHoldDurations.Num(); i++)
|
||||
{
|
||||
LOG_INFO(LogZone, "Hold [{}] {}", i, ZoneHoldDurations.at(i));
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
LOG_INFO(LogZone, "SafeZonePhase: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset));
|
||||
LOG_INFO(LogZone, "OverridePhaseMaybeIDFK: {}", OverridePhaseMaybeIDFK);
|
||||
LOG_INFO(LogZone, "TimeSeconds: {}", UGameplayStatics::GetTimeSeconds(GetWorld()));
|
||||
|
||||
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
if (Globals::bLateGame.load())
|
||||
{
|
||||
GameModeAthena->Get<int>(GameMode_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
|
||||
GameState->Get<int>(GameState_SafeZonePhaseOffset) = NewLateGameSafeZonePhase;
|
||||
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
NewLateGameSafeZonePhase++;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetZoneToIndexOriginal(GameModeAthena, OverridePhaseMaybeIDFK);
|
||||
}
|
||||
|
||||
LOG_INFO(LogZone, "SafeZonePhase After: {}", GameModeAthena->Get<int>(SafeZonePhaseOffset));
|
||||
|
||||
@@ -168,6 +146,14 @@ static inline void SetZoneToIndexHook(AFortGameModeAthena* GameModeAthena, int O
|
||||
LOG_INFO(LogZone, "Duration: {}", SafeZoneIndicator->Get<float>(RadiusOffset));
|
||||
|
||||
SafeZoneIndicator->Get<float>(SafeZoneFinishShrinkTimeOffset) = SafeZoneIndicator->Get<float>(SafeZoneStartShrinkTimeOffset) + ZoneDuration;
|
||||
|
||||
if (NewLateGameSafeZonePhase == 3 || NewLateGameSafeZonePhase == 4)
|
||||
{
|
||||
if (SafeZoneIndicator)
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
else
|
||||
LOG_WARN(LogZone, "Invalid SafeZoneIndicator!");
|
||||
}
|
||||
}
|
||||
|
||||
static inline void ProcessEventHook(UObject* Object, UFunction* Function, void* Parameters)
|
||||
|
||||
@@ -645,7 +645,8 @@ DWORD WINAPI Main(LPVOID)
|
||||
|
||||
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameMode.ReadyToStartMatch"), AFortGameModeAthena::Athena_ReadyToStartMatchHook,
|
||||
(PVOID*)&AFortGameModeAthena::Athena_ReadyToStartMatchOriginal, false, false, true);
|
||||
|
||||
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/FortniteGame.FortGameModeAthena.OnAircraftEnteredDropZone"), AFortGameModeAthena::OnAircraftEnteredDropZoneHook,
|
||||
(PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true);
|
||||
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnFor"),
|
||||
AGameModeBase::SpawnDefaultPawnForHook, nullptr, false);
|
||||
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.HandleStartingNewPlayer"), AFortGameModeAthena::Athena_HandleStartingNewPlayerHook,
|
||||
|
||||
@@ -479,6 +479,190 @@ static inline void PlayerTabs()
|
||||
}
|
||||
}
|
||||
|
||||
static inline DWORD WINAPI LateGameThread(LPVOID)
|
||||
{
|
||||
float MaxTickRate = 30;
|
||||
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
auto GameState = Cast<AFortGameStateAthena>(GameMode->GetGameState());
|
||||
|
||||
auto GetAircrafts = [&]() -> std::vector<AActor*>
|
||||
{
|
||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
|
||||
std::vector<AActor*> Aircrafts;
|
||||
|
||||
if (AircraftsOffset == -1)
|
||||
{
|
||||
// GameState->Aircraft
|
||||
|
||||
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
|
||||
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
|
||||
|
||||
for (int i = 0; i < AllAircrafts.Num(); i++)
|
||||
{
|
||||
Aircrafts.push_back(AllAircrafts.at(i));
|
||||
}
|
||||
|
||||
AllAircrafts.Free();
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& GameStateAircrafts = GameState->Get<TArray<AActor*>>(AircraftsOffset);
|
||||
|
||||
for (int i = 0; i < GameStateAircrafts.Num(); i++)
|
||||
{
|
||||
Aircrafts.push_back(GameStateAircrafts.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
return Aircrafts;
|
||||
};
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||
|
||||
while (GetAircrafts().size() <= 0)
|
||||
{
|
||||
Sleep(1000 / MaxTickRate);
|
||||
}
|
||||
|
||||
static auto SafeZoneLocationsOffset = GameMode->GetOffset("SafeZoneLocations");
|
||||
const TArray<FVector>& SafeZoneLocations = GameMode->Get<TArray<FVector>>(SafeZoneLocationsOffset);
|
||||
|
||||
if (SafeZoneLocations.Num() < 4)
|
||||
{
|
||||
LOG_WARN(LogLateGame, "Unable to find SafeZoneLocation! Disabling lategame..");
|
||||
Globals::bLateGame.store(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const FVector ZoneCenterLocation = SafeZoneLocations.at(3);
|
||||
|
||||
FVector LocationToStartAircraft = ZoneCenterLocation;
|
||||
LocationToStartAircraft.Z += 10000;
|
||||
|
||||
auto Aircrafts = GetAircrafts();
|
||||
|
||||
float DropStartTime = GameState->GetServerWorldTimeSeconds() + 5.f;
|
||||
float FlightSpeed = 0.0f;
|
||||
|
||||
for (int i = 0; i < Aircrafts.size(); ++i)
|
||||
{
|
||||
auto CurrentAircraft = Aircrafts.at(i);
|
||||
CurrentAircraft->TeleportTo(LocationToStartAircraft, FRotator());
|
||||
|
||||
static auto FlightInfoOffset = CurrentAircraft->GetOffset("FlightInfo", false);
|
||||
|
||||
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) = DropStartTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto FlightInfo = CurrentAircraft->GetPtr<FAircraftFlightInfo>(FlightInfoOffset);
|
||||
|
||||
FlightInfo->GetFlightSpeed() = FlightSpeed;
|
||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||
FlightInfo->GetTimeTillDropStart() = DropStartTime;
|
||||
}
|
||||
}
|
||||
|
||||
while (GameState->GetGamePhase() != EAthenaGamePhase::Aircraft)
|
||||
{
|
||||
Sleep(1000 / MaxTickRate);
|
||||
}
|
||||
|
||||
/*
|
||||
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
|
||||
auto MapInfo = GameState->Get(MapInfoOffset);
|
||||
|
||||
if (MapInfo)
|
||||
{
|
||||
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos", false);
|
||||
|
||||
if (FlightInfosOffset != -1)
|
||||
{
|
||||
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
|
||||
|
||||
for (int i = 0; i < FlightInfos.Num(); i++)
|
||||
{
|
||||
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
|
||||
|
||||
FlightInfo->GetFlightSpeed() = FlightSpeed;
|
||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||
FlightInfo->GetTimeTillDropStart() = DropStartTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
while (GameState->GetGamePhase() == EAthenaGamePhase::Aircraft)
|
||||
{
|
||||
Sleep(1000 / MaxTickRate);
|
||||
}
|
||||
|
||||
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
|
||||
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
|
||||
auto& ClientConnections = WorldNetDriver->GetClientConnections();
|
||||
|
||||
for (int z = 0; z < ClientConnections.Num(); z++)
|
||||
{
|
||||
auto ClientConnection = ClientConnections.at(z);
|
||||
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
|
||||
|
||||
if (!FortPC)
|
||||
continue;
|
||||
|
||||
auto WorldInventory = FortPC->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
continue;
|
||||
|
||||
static auto WoodItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
|
||||
static auto StoneItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData");
|
||||
static auto MetalItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData");
|
||||
|
||||
static auto Rifle = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03");
|
||||
static auto Shotgun = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
|
||||
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
|
||||
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_C_Ore_T03.WID_Shotgun_Standard_Athena_C_Ore_T03");
|
||||
static auto SMG = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
|
||||
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
|
||||
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03.WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03");
|
||||
|
||||
static auto MiniShields = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall");
|
||||
|
||||
static auto Shells = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells");
|
||||
static auto Medium = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium");
|
||||
static auto Light = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight");
|
||||
static auto Heavy = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy");
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
|
||||
GameState->Get<float>(SafeZonesStartTimeOffset) = 0.001f;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void MainUI()
|
||||
{
|
||||
bool bLoaded = true;
|
||||
@@ -520,7 +704,7 @@ static inline void MainUI()
|
||||
|
||||
if (GameState)
|
||||
{
|
||||
static auto DefaultGliderRedeployCanRedeployOffset = FindOffsetStruct("/Script/FortniteGame.FortGameStateAthena", "DefaultGliderRedeployCanRedeploy");
|
||||
static auto DefaultGliderRedeployCanRedeployOffset = FindOffsetStruct("/Script/FortniteGame.FortGameStateAthena", "DefaultGliderRedeployCanRedeploy", false);
|
||||
|
||||
if (DefaultGliderRedeployCanRedeployOffset != -1)
|
||||
{
|
||||
@@ -612,226 +796,14 @@ static inline void MainUI()
|
||||
|
||||
AmountOfPlayersWhenBusStart = GameState->GetPlayersLeft();
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||
|
||||
if (Globals::bLateGame.load())
|
||||
{
|
||||
auto GetAircrafts = [&]() -> TArray<AActor*>
|
||||
{
|
||||
static auto AircraftsOffset = GameState->GetOffset("Aircrafts", false);
|
||||
|
||||
if (AircraftsOffset == -1)
|
||||
{
|
||||
// GameState->Aircraft
|
||||
|
||||
static auto FortAthenaAircraftClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaAircraft");
|
||||
auto AllAircrafts = UGameplayStatics::GetAllActorsOfClass(GetWorld(), FortAthenaAircraftClass);
|
||||
|
||||
return AllAircrafts;
|
||||
}
|
||||
|
||||
return GameState->Get<TArray<AActor*>>(AircraftsOffset);
|
||||
};
|
||||
|
||||
while (GetAircrafts().Num() <= 0) // hmm
|
||||
{
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startsafezone", nullptr);
|
||||
|
||||
static auto SafeZoneIndicatorOffset = GameState->GetOffset("SafeZoneIndicator");
|
||||
|
||||
static auto SafeZonesStartTimeOffset = GameState->GetOffset("SafeZonesStartTime");
|
||||
GameState->Get<float>(SafeZonesStartTimeOffset) = 0;
|
||||
|
||||
LOG_INFO(LogDev, "Waiting for SafeZoneIndicator..");
|
||||
|
||||
while (!GameState->Get(SafeZoneIndicatorOffset))
|
||||
{
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "SafeZoneIndicator is valid!");
|
||||
|
||||
while (GetAircrafts().Num() <= 0) // hmm
|
||||
{
|
||||
Sleep(500);
|
||||
}
|
||||
|
||||
static auto NextNextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextNextCenter", false);
|
||||
static auto NextCenterOffset = GameState->Get(SafeZoneIndicatorOffset)->GetOffset("NextCenter");
|
||||
FVector LocationToStartAircraft = GameState->Get(SafeZoneIndicatorOffset)->Get<FVector>(NextNextCenterOffset == -1 ? NextCenterOffset : NextNextCenterOffset); // SafeZoneLocations.at(4);
|
||||
LocationToStartAircraft.Z += 10000;
|
||||
|
||||
for (int i = 0; i < GetAircrafts().Num(); i++)
|
||||
{
|
||||
auto CurrentAircraft = GetAircrafts().at(i);
|
||||
|
||||
CurrentAircraft->TeleportTo(LocationToStartAircraft, FRotator());
|
||||
|
||||
static auto FlightInfoOffset = CurrentAircraft->GetOffset("FlightInfo", false);
|
||||
|
||||
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");
|
||||
auto MapInfo = GameState->Get(MapInfoOffset);
|
||||
|
||||
if (MapInfo)
|
||||
{
|
||||
static auto FlightInfosOffset = MapInfo->GetOffset("FlightInfos", false);
|
||||
|
||||
if (FlightInfosOffset != -1)
|
||||
{
|
||||
auto& FlightInfos = MapInfo->Get<TArray<FAircraftFlightInfo>>(FlightInfosOffset);
|
||||
|
||||
LOG_INFO(LogDev, "FlightInfos.Num(): {}", FlightInfos.Num());
|
||||
|
||||
for (int i = 0; i < FlightInfos.Num(); i++)
|
||||
{
|
||||
auto FlightInfo = FlightInfos.AtPtr(i, FAircraftFlightInfo::GetStructSize());
|
||||
|
||||
FlightInfo->GetFlightSpeed() = 0;
|
||||
FlightInfo->GetFlightStartLocation() = LocationToStartAircraft;
|
||||
FlightInfo->GetTimeTillDropStart() = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static auto bAircraftIsLockedOffset = GameState->GetOffset("bAircraftIsLocked");
|
||||
static auto bAircraftIsLockedFieldMask = GetFieldMask(GameState->GetProperty("bAircraftIsLocked"));
|
||||
GameState->SetBitfieldValue(bAircraftIsLockedOffset, bAircraftIsLockedFieldMask, false);
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"skipaircraft", nullptr);
|
||||
|
||||
static auto World_NetDriverOffset = GetWorld()->GetOffset("NetDriver");
|
||||
auto WorldNetDriver = GetWorld()->Get<UNetDriver*>(World_NetDriverOffset);
|
||||
auto& ClientConnections = WorldNetDriver->GetClientConnections();
|
||||
|
||||
for (int z = 0; z < ClientConnections.Num(); z++)
|
||||
{
|
||||
auto ClientConnection = ClientConnections.at(z);
|
||||
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
|
||||
|
||||
if (!FortPC)
|
||||
continue;
|
||||
|
||||
auto WorldInventory = FortPC->GetWorldInventory();
|
||||
|
||||
if (!WorldInventory)
|
||||
continue;
|
||||
|
||||
static auto WoodItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/WoodItemData.WoodItemData");
|
||||
static auto StoneItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/StoneItemData.StoneItemData");
|
||||
static auto MetalItemData = FindObject<UFortItemDefinition>(L"/Game/Items/ResourcePickups/MetalItemData.MetalItemData");
|
||||
|
||||
static auto Rifle = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Assault_AutoHigh_Athena_SR_Ore_T03.WID_Assault_AutoHigh_Athena_SR_Ore_T03");
|
||||
static auto Shotgun = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
|
||||
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_SR_Ore_T03.WID_Shotgun_Standard_Athena_SR_Ore_T03")
|
||||
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Shotgun_Standard_Athena_C_Ore_T03.WID_Shotgun_Standard_Athena_C_Ore_T03");
|
||||
static auto SMG = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
|
||||
? FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03.WID_Pistol_AutoHeavyPDW_Athena_R_Ore_T03")
|
||||
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03.WID_Pistol_AutoHeavySuppressed_Athena_R_Ore_T03");
|
||||
|
||||
static auto MiniShields = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Consumables/ShieldSmall/Athena_ShieldSmall.Athena_ShieldSmall");
|
||||
|
||||
static auto Shells = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataShells.AthenaAmmoDataShells");
|
||||
static auto Medium = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsMedium.AthenaAmmoDataBulletsMedium");
|
||||
static auto Light = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsLight.AthenaAmmoDataBulletsLight");
|
||||
static auto Heavy = FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Ammo/AthenaAmmoDataBulletsHeavy.AthenaAmmoDataBulletsHeavy");
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
auto SafeZoneIndicator = GameMode->GetSafeZoneIndicator();
|
||||
|
||||
if (SafeZoneIndicator)
|
||||
{
|
||||
SetZoneToIndexHook(GameMode, -1);
|
||||
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
|
||||
/*
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startshrinksafezone", nullptr);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
|
||||
bool bBreak = false;
|
||||
int a = 0;
|
||||
|
||||
while (!bBreak)
|
||||
{
|
||||
for (int z = 0; z < ClientConnections.Num(); z++)
|
||||
{
|
||||
auto ClientConnection = ClientConnections.at(z);
|
||||
auto FortPC = Cast<AFortPlayerController>(ClientConnection->GetPlayerController());
|
||||
|
||||
if (!FortPC)
|
||||
continue;
|
||||
|
||||
if (FortPC->GetMyFortPawn())
|
||||
{
|
||||
bBreak = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (++a >= 5)
|
||||
bBreak = true;
|
||||
|
||||
Sleep(1000);
|
||||
}
|
||||
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
|
||||
if (Engine_Version >= 424)
|
||||
{
|
||||
Sleep(1000);
|
||||
SafeZoneIndicator->SkipShrinkSafeZone();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_WARN(LogDev, "Invalid Indicator!");
|
||||
}
|
||||
CreateThread(0, 0, LateGameThread, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), L"startaircraft", nullptr);
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "Finished!");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1343,7 +1315,7 @@ static inline void PregameUI()
|
||||
|
||||
if (!bSwitchedInitialLevel)
|
||||
{
|
||||
ImGui::Checkbox("Use Custom Map", &bUseCustomMap);
|
||||
// ImGui::Checkbox("Use Custom Map", &bUseCustomMap);
|
||||
|
||||
if (bUseCustomMap)
|
||||
{
|
||||
|
||||
@@ -193,7 +193,7 @@ inline __int64 GetFunctionIdxOrPtr(UFunction* Function, bool bBreakWhenHitRet =
|
||||
}
|
||||
}
|
||||
|
||||
if ((*(uint8_t*)(NativeAddr + i) == 0x48 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF) && *(uint8_t*)(NativeAddr + i + 2) == 0xA0) // jmp qword ptr
|
||||
if (*(uint8_t*)(NativeAddr + i) == 0x48 && *(uint8_t*)(NativeAddr + i + 1) == 0xFF && *(uint8_t*)(NativeAddr + i + 2) == 0xA0) // jmp qword ptr
|
||||
{
|
||||
if (bFoundValidate)
|
||||
{
|
||||
@@ -295,7 +295,7 @@ namespace Hooking
|
||||
// *(int32_t*)(instrAddr + 1) = static_cast<int32_t>(delta);
|
||||
}
|
||||
|
||||
static bool Hook(UObject* DefaultClass, UFunction* Function, void* Detour, void** Original = nullptr, bool bUseSecondMethod = true, bool bHookExec = false, bool bOverride = true) // Native hook
|
||||
static bool Hook(UObject* DefaultClass, UFunction* Function, void* Detour, void** Original = nullptr, bool bUseSecondMethod = true, bool bHookExec = false, bool bOverride = true, bool bBreakWhenRet = false) // Native hook
|
||||
{
|
||||
if (!bOverride)
|
||||
return false;
|
||||
@@ -324,7 +324,7 @@ namespace Hooking
|
||||
return true;
|
||||
}
|
||||
|
||||
auto AddrOrIdx = bUseSecondMethod ? GetFunctionIdxOrPtr2(Function) : GetFunctionIdxOrPtr(Function);
|
||||
auto AddrOrIdx = bUseSecondMethod ? GetFunctionIdxOrPtr2(Function) : GetFunctionIdxOrPtr(Function, bBreakWhenRet);
|
||||
|
||||
if (AddrOrIdx == -1)
|
||||
{
|
||||
|
||||
@@ -87,6 +87,7 @@ inline void InitLogger()
|
||||
MakeLogger("LogMatchmaker");
|
||||
MakeLogger("LogRebooting");
|
||||
MakeLogger("LogObjectViewer");
|
||||
MakeLogger("LogLateGame");
|
||||
}
|
||||
|
||||
#define LOG_DEBUG(loggerName, ...) \
|
||||
|
||||
Reference in New Issue
Block a user