mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
remove caaanactivateability
This commit is contained in:
@@ -125,7 +125,8 @@ public:
|
||||
if (Data && ArrayNum > 0 && sizeof(InElementType) > 0)
|
||||
{
|
||||
// VirtualFree(Data, _msize(Data), MEM_RELEASE);
|
||||
VirtualFree(Data, sizeof(InElementType) * ArrayNum, MEM_RELEASE);
|
||||
VirtualFree(Data, sizeof(InElementType) * ArrayNum, MEM_RELEASE); // ik this does nothing
|
||||
// VirtualFree(Data, 0, MEM_RELEASE);
|
||||
}
|
||||
|
||||
ArrayNum = 0;
|
||||
|
||||
@@ -260,6 +260,8 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
LocalPlayers.Remove(0);
|
||||
}
|
||||
|
||||
// LOG_INFO(LogDev, "ReadyToStartMatch!");
|
||||
|
||||
static int LastNum2 = 1;
|
||||
|
||||
if (AmountOfRestarts != LastNum2)
|
||||
@@ -649,105 +651,91 @@ int AFortGameModeAthena::Athena_PickTeamHook(AFortGameModeAthena* GameMode, uint
|
||||
|
||||
void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena* GameMode, AActor* NewPlayerActor)
|
||||
{
|
||||
if (!NewPlayerActor)
|
||||
if (NewPlayerActor == GetLocalPlayerController()) // we dont really need this but it also functions as a nullptr check usually
|
||||
return;
|
||||
|
||||
LOG_INFO(LogPlayer, "HandleStartingNewPlayer!");
|
||||
|
||||
static bool bFirst = Engine_Version >= 424;
|
||||
|
||||
auto GameState = GameMode->GetGameStateAthena();
|
||||
|
||||
if (bFirst)
|
||||
LOG_INFO(LogPlayer, "HandleStartingNewPlayer!");
|
||||
|
||||
if (Engine_Version < 427)
|
||||
{
|
||||
bFirst = false;
|
||||
|
||||
auto CurrentPlaylist = GameState->GetCurrentPlaylist();
|
||||
static int LastNum69 = 19451;
|
||||
|
||||
// if (!CurrentPlaylist || !CurrentPlaylist->Get<bool>("bSkipWarmup"))
|
||||
if (LastNum69 != AmountOfRestarts)
|
||||
{
|
||||
/* GameState->GetGamePhase() = EAthenaGamePhase::Warmup;
|
||||
GameState->OnRep_GamePhase(); */
|
||||
}
|
||||
LastNum69 = AmountOfRestarts;
|
||||
|
||||
// GameState->OnRep_CurrentPlaylistInfo();
|
||||
}
|
||||
auto SpawnIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
|
||||
auto BRIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C");
|
||||
|
||||
static bool bSpawnedFloorLoot = Engine_Version >= 427;
|
||||
TArray<AActor*> SpawnIsland_FloorLoot_Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), SpawnIsland_FloorLoot);
|
||||
|
||||
if (!bSpawnedFloorLoot)
|
||||
{
|
||||
bSpawnedFloorLoot = true;
|
||||
TArray<AActor*> BRIsland_FloorLoot_Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BRIsland_FloorLoot);
|
||||
|
||||
auto SpawnIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
|
||||
auto BRIsland_FloorLoot = FindObject<UClass>("/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_01.Tiered_Athena_FloorLoot_01_C");
|
||||
auto SpawnIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot_Warmup");
|
||||
auto BRIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot");
|
||||
|
||||
TArray<AActor*> SpawnIsland_FloorLoot_Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), SpawnIsland_FloorLoot);
|
||||
float UpZ = 50;
|
||||
|
||||
TArray<AActor*> BRIsland_FloorLoot_Actors = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BRIsland_FloorLoot);
|
||||
EFortPickupSourceTypeFlag SpawnFlag = EFortPickupSourceTypeFlag::Container;
|
||||
|
||||
auto SpawnIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot_Warmup");
|
||||
auto BRIslandTierGroup = UKismetStringLibrary::Conv_StringToName(L"Loot_AthenaFloorLoot");
|
||||
bool bPrintWarmup = false;
|
||||
|
||||
float UpZ = 50;
|
||||
|
||||
EFortPickupSourceTypeFlag SpawnFlag = EFortPickupSourceTypeFlag::Container;
|
||||
|
||||
bool bPrintWarmup = false;
|
||||
|
||||
for (int i = 0; i < SpawnIsland_FloorLoot_Actors.Num(); i++)
|
||||
{
|
||||
ABuildingContainer* CurrentActor = (ABuildingContainer*)SpawnIsland_FloorLoot_Actors.at(i);
|
||||
|
||||
// CurrentActor->K2_DestroyActor();
|
||||
// continue;
|
||||
|
||||
auto Location = CurrentActor->GetActorLocation();
|
||||
Location.Z += UpZ;
|
||||
|
||||
std::vector<LootDrop> LootDrops = PickLootDrops(SpawnIslandTierGroup, bPrintWarmup);
|
||||
|
||||
if (bPrintWarmup)
|
||||
for (int i = 0; i < SpawnIsland_FloorLoot_Actors.Num(); i++)
|
||||
{
|
||||
std::cout << "\n\n";
|
||||
ABuildingContainer* CurrentActor = (ABuildingContainer*)SpawnIsland_FloorLoot_Actors.at(i);
|
||||
|
||||
// CurrentActor->K2_DestroyActor();
|
||||
// continue;
|
||||
|
||||
auto Location = CurrentActor->GetActorLocation();
|
||||
Location.Z += UpZ;
|
||||
|
||||
std::vector<LootDrop> LootDrops = PickLootDrops(SpawnIslandTierGroup, bPrintWarmup);
|
||||
|
||||
if (bPrintWarmup)
|
||||
{
|
||||
std::cout << "\n\n";
|
||||
}
|
||||
|
||||
if (LootDrops.size())
|
||||
{
|
||||
for (auto& LootDrop : LootDrops)
|
||||
AFortPickup::SpawnPickup(LootDrop.ItemDefinition, Location, LootDrop.Count, SpawnFlag, EFortPickupSpawnSource::Unset, LootDrop.LoadedAmmo);
|
||||
}
|
||||
|
||||
CurrentActor->K2_DestroyActor();
|
||||
}
|
||||
|
||||
if (LootDrops.size())
|
||||
bool bPrint = false;
|
||||
|
||||
int spawned = 0;
|
||||
|
||||
for (int i = 0; i < BRIsland_FloorLoot_Actors.Num(); i++)
|
||||
{
|
||||
for (auto& LootDrop : LootDrops)
|
||||
AFortPickup::SpawnPickup(LootDrop.ItemDefinition, Location, LootDrop.Count, SpawnFlag, EFortPickupSpawnSource::Unset, LootDrop.LoadedAmmo);
|
||||
ABuildingContainer* CurrentActor = (ABuildingContainer*)BRIsland_FloorLoot_Actors.at(i);
|
||||
|
||||
// CurrentActor->K2_DestroyActor();
|
||||
spawned++;
|
||||
// continue;
|
||||
|
||||
auto Location = CurrentActor->GetActorLocation();
|
||||
Location.Z += UpZ;
|
||||
|
||||
std::vector<LootDrop> LootDrops = PickLootDrops(BRIslandTierGroup, bPrint);
|
||||
|
||||
if (bPrint)
|
||||
std::cout << "\n";
|
||||
|
||||
if (LootDrops.size())
|
||||
{
|
||||
for (auto& LootDrop : LootDrops)
|
||||
AFortPickup::SpawnPickup(LootDrop.ItemDefinition, Location, LootDrop.Count, SpawnFlag, EFortPickupSpawnSource::Unset, LootDrop.LoadedAmmo);
|
||||
}
|
||||
|
||||
CurrentActor->K2_DestroyActor();
|
||||
}
|
||||
|
||||
CurrentActor->K2_DestroyActor();
|
||||
}
|
||||
|
||||
bool bPrint = false;
|
||||
|
||||
int spawned = 0;
|
||||
|
||||
for (int i = 0; i < BRIsland_FloorLoot_Actors.Num(); i++)
|
||||
{
|
||||
ABuildingContainer* CurrentActor = (ABuildingContainer*)BRIsland_FloorLoot_Actors.at(i);
|
||||
|
||||
// CurrentActor->K2_DestroyActor();
|
||||
spawned++;
|
||||
// continue;
|
||||
|
||||
auto Location = CurrentActor->GetActorLocation();
|
||||
Location.Z += UpZ;
|
||||
|
||||
std::vector<LootDrop> LootDrops = PickLootDrops(BRIslandTierGroup, bPrint);
|
||||
|
||||
if (bPrint)
|
||||
std::cout << "\n";
|
||||
|
||||
if (LootDrops.size())
|
||||
{
|
||||
for (auto& LootDrop : LootDrops)
|
||||
AFortPickup::SpawnPickup(LootDrop.ItemDefinition, Location, LootDrop.Count, SpawnFlag, EFortPickupSpawnSource::Unset, LootDrop.LoadedAmmo);
|
||||
}
|
||||
|
||||
CurrentActor->K2_DestroyActor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
Project Reboot 3.0/GameMode.cpp
Normal file
9
Project Reboot 3.0/GameMode.cpp
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "GameMode.h"
|
||||
|
||||
#include "reboot.h"
|
||||
|
||||
void AGameMode::RestartGame()
|
||||
{
|
||||
static auto fn = FindObject<UFunction>("/Script/Engine.GameMode.RestartGame");
|
||||
this->ProcessEvent(fn);
|
||||
}
|
||||
@@ -6,6 +6,8 @@ class AGameMode : public AGameModeBase
|
||||
{
|
||||
public:
|
||||
|
||||
void RestartGame();
|
||||
|
||||
class AGameState*& GetGameState()
|
||||
{
|
||||
static auto GameStateOffset = this->GetOffset("GameState");
|
||||
|
||||
@@ -44,6 +44,36 @@ UObject* UGameplayStatics::SpawnObject(UClass* ObjectClass, UObject* Outer)
|
||||
return UGameplayStatics_SpawnObject_Params.ReturnValue;
|
||||
}
|
||||
|
||||
/* void UGameplayStatics::OpenLevel(UObject* WorldContextObject, FName LevelName, bool bAbsolute, const FString& Options)
|
||||
{
|
||||
static auto fn = FindObject<UFunction>("/Script/Engine.GameplayStatics.OpenLevel");
|
||||
|
||||
struct
|
||||
{
|
||||
UObject* WorldContextObject; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
FName LevelName; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
bool bAbsolute; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
FString Options; // (Parm, ZeroConstructor, AdvancedDisplay, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
} UGameplayStatics_OpenLevel_Params{WorldContextObject, LevelName, bAbsolute, Options};
|
||||
|
||||
static auto defaultObj = StaticClass();
|
||||
defaultObj->ProcessEvent(fn, &UGameplayStatics_OpenLevel_Params);
|
||||
} */
|
||||
|
||||
void UGameplayStatics::RemovePlayer(APlayerController* Player, bool bDestroyPawn)
|
||||
{
|
||||
static auto fn = FindObject<UFunction>("/Script/Engine.GameplayStatics.RemovePlayer");
|
||||
|
||||
struct
|
||||
{
|
||||
APlayerController* Player; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
bool bDestroyPawn; // (Parm, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
} UGameplayStatics_RemovePlayer_Params{Player, bDestroyPawn};
|
||||
|
||||
static auto defaultObj = StaticClass();
|
||||
defaultObj->ProcessEvent(fn, &UGameplayStatics_RemovePlayer_Params);
|
||||
}
|
||||
|
||||
UClass* UGameplayStatics::StaticClass()
|
||||
{
|
||||
static auto Class = FindObject<UClass>(L"/Script/Engine.GameplayStatics");
|
||||
|
||||
@@ -10,6 +10,8 @@ public:
|
||||
static TArray<AActor*> GetAllActorsOfClass(const UObject* WorldContextObject, UClass* ActorClass);
|
||||
static float GetTimeSeconds(UObject* WorldContextObject);
|
||||
static UObject* SpawnObject(UClass* ObjectClass, UObject* Outer);
|
||||
// static void OpenLevel(UObject* WorldContextObject, FName LevelName, bool bAbsolute, const FString& Options);
|
||||
static void RemovePlayer(class APlayerController* Player, bool bDestroyPawn);
|
||||
|
||||
static UClass* StaticClass();
|
||||
};
|
||||
@@ -201,6 +201,7 @@
|
||||
<ClCompile Include="FortPlaysetItemDefinition.cpp" />
|
||||
<ClCompile Include="FortWeapon.cpp" />
|
||||
<ClCompile Include="FortWeaponItemDefinition.cpp" />
|
||||
<ClCompile Include="GameMode.cpp" />
|
||||
<ClCompile Include="GameModeBase.cpp" />
|
||||
<ClCompile Include="GameplayStatics.cpp" />
|
||||
<ClCompile Include="GameState.cpp" />
|
||||
|
||||
@@ -161,6 +161,9 @@
|
||||
<ClCompile Include="InventoryManagementLibrary.cpp">
|
||||
<Filter>FortniteGame\Source\FortniteGame\Private</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameMode.cpp">
|
||||
<Filter>Engine\Source\Runtime\Engine\Private</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="log.h" />
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <locale>
|
||||
|
||||
#include "Array.h"
|
||||
#include "log.h"
|
||||
|
||||
class FString
|
||||
{
|
||||
@@ -44,4 +45,14 @@ public:
|
||||
{
|
||||
Set(str);
|
||||
}
|
||||
|
||||
~FString()
|
||||
{
|
||||
if (Data.Data)
|
||||
{
|
||||
// LOG_INFO(LogDev, "Deconstructing FString!");
|
||||
}
|
||||
|
||||
// Free();
|
||||
}
|
||||
};
|
||||
@@ -132,7 +132,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
GetLocalPlayerController()->ProcessEvent(SwitchLevel, &Level);
|
||||
|
||||
LOG_INFO(LogPlayer, "Switched level.");
|
||||
|
||||
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::ActorGetNetMode, (PVOID)GetNetModeHook2, nullptr);
|
||||
|
||||
LOG_INFO(LogDev, "FindGIsServer: 0x{:x}", FindGIsServer() - __int64(GetModuleHandleW(0)));
|
||||
@@ -154,11 +154,18 @@ DWORD WINAPI Main(LPVOID)
|
||||
Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x3DED158), (PVOID)ReturnTrueHook, nullptr);
|
||||
}
|
||||
|
||||
auto& LocalPlayers = GetLocalPlayers();
|
||||
|
||||
if (LocalPlayers.Num() && LocalPlayers.Data)
|
||||
if (true)
|
||||
{
|
||||
LocalPlayers.Remove(0);
|
||||
auto& LocalPlayers = GetLocalPlayers();
|
||||
|
||||
if (LocalPlayers.Num() && LocalPlayers.Data)
|
||||
{
|
||||
LocalPlayers.Remove(0);
|
||||
}
|
||||
}
|
||||
else if (false)
|
||||
{
|
||||
UGameplayStatics::RemovePlayer((APlayerController*)GetLocalPlayerController(), true);
|
||||
}
|
||||
|
||||
for (auto func : Addresses::GetFunctionsToNull())
|
||||
@@ -377,7 +384,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::TickFlush, (PVOID)UNetDriver::TickFlushHook, (PVOID*)&UNetDriver::TickFlushOriginal);
|
||||
// Hooking::MinHook::Hook((PVOID)(__int64(GetModuleHandleW(0)) + 0x1A001D0), GetServerDeltaTimeFromObjectHook);
|
||||
|
||||
// if (/* Engine_Version >= 420 && */ Engine_Version < 427)
|
||||
// if (Engine_Version < 427)
|
||||
{
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::OnDamageServer, (PVOID)ABuildingActor::OnDamageServerHook, (PVOID*)&ABuildingActor::OnDamageServerOriginal);
|
||||
}
|
||||
@@ -387,7 +394,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::PickTeam, (PVOID)AFortGameModeAthena::Athena_PickTeamHook);
|
||||
// Hooking::MinHook::Hook((PVOID)Addresses::SetZoneToIndex, (PVOID)AFortGameModeAthena::SetZoneToIndexHook, (PVOID*)&AFortGameModeAthena::SetZoneToIndexOriginal);
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::CompletePickupAnimation, (PVOID)AFortPickup::CompletePickupAnimationHook, (PVOID*)&AFortPickup::CompletePickupAnimationOriginal);
|
||||
Hooking::MinHook::Hook((PVOID)Addresses::CanActivateAbility, ReturnTrueHook); // ahhh wtf
|
||||
// Hooking::MinHook::Hook((PVOID)Addresses::CanActivateAbility, ReturnTrueHook); // ahhh wtf
|
||||
// Hooking::MinHook::Hook((PVOID)FindFunctionCall(L"ServerRemoveInventoryItem"), UFortInventoryInterface::RemoveInventoryItemHook);
|
||||
|
||||
if (Fortnite_Version >= 13)
|
||||
@@ -437,7 +444,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
MemberOffsets::DeathReport::KillerPlayerState = FindOffsetStruct("/Script/FortniteGame.FortPlayerDeathReport", "KillerPlayerState");
|
||||
MemberOffsets::DeathReport::DamageCauser = FindOffsetStruct("/Script/FortniteGame.FortPlayerDeathReport", "DamageCauser");
|
||||
}
|
||||
|
||||
|
||||
srand(time(0));
|
||||
|
||||
LOG_INFO(LogHook, "Finished!");
|
||||
@@ -473,6 +480,34 @@ DWORD WINAPI Main(LPVOID)
|
||||
{
|
||||
Globals::bLogProcessEvent = !Globals::bLogProcessEvent;
|
||||
}
|
||||
|
||||
/* else if (GetAsyncKeyState(VK_F10) & 1)
|
||||
{
|
||||
FString LevelA = Engine_Version < 424
|
||||
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501
|
||||
? L"open Asteria_Terrain"
|
||||
: Globals::bCreative ? L"open Creative_NoApollo_Terrain"
|
||||
: L"open Artemis_Terrain"
|
||||
: Globals::bCreative ? L"open Creative_NoApollo_Terrain"
|
||||
: L"open Apollo_Terrain";
|
||||
|
||||
static auto BeaconClass = FindObject<UClass>(L"/Script/FortniteGame.FortOnlineBeaconHost");
|
||||
auto AllFortBeacons = UGameplayStatics::GetAllActorsOfClass(GetWorld(), BeaconClass);
|
||||
|
||||
for (int i = 0; i < AllFortBeacons.Num(); i++)
|
||||
{
|
||||
AllFortBeacons.at(i)->K2_DestroyActor();
|
||||
}
|
||||
|
||||
AllFortBeacons.Free();
|
||||
|
||||
LOG_INFO(LogDev, "Switching!");
|
||||
((AGameMode*)GetWorld()->GetGameMode())->RestartGame();
|
||||
// UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), LevelA, nullptr);
|
||||
// UGameplayStatics::OpenLevel(GetWorld(), UKismetStringLibrary::Conv_StringToName(LevelA), true, FString());
|
||||
LOG_INFO(LogDev, "Restarting!");
|
||||
AmountOfRestarts++;
|
||||
} */
|
||||
|
||||
Sleep(1000 / 30);
|
||||
}
|
||||
|
||||
@@ -43,9 +43,12 @@ inline void InitLogger()
|
||||
|
||||
FILE* stream = nullptr;
|
||||
|
||||
freopen_s(&stream, "in.txt", "r", stdin);
|
||||
freopen_s(&stream, "out.txt", "w+", stdout);
|
||||
freopen_s(&stream, "err.txt", "w", stderr);
|
||||
// if (false)
|
||||
{
|
||||
freopen_s(&stream, "in.txt", "r", stdin);
|
||||
freopen_s(&stream, "out.txt", "w+", stdout);
|
||||
freopen_s(&stream, "err.txt", "w", stderr);
|
||||
}
|
||||
|
||||
SetConsoleTitleA("Project Reboot 3.0");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user