fixed things

This commit is contained in:
Gray
2024-03-16 18:10:53 -04:00
parent 3c26f7b954
commit 724cf50267
9 changed files with 85 additions and 70 deletions

View File

@@ -795,39 +795,6 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
GetWorld()->Listen();
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
UObject* OverrideBattleBusSkin = nullptr;
UClass* OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass); // wrong for some builds but its ok
if (Fortnite_Version == 1.11 || Fortnite_Version == 7.30 || Fortnite_Version == 11.31 || Fortnite_Version == 15.10 || Fortnite_Version == 19.10)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus"); // Winterfest
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_Holiday.AthenaSupplyDrop_Holiday_C", BGAClass);
}
else if (Fortnite_Version == 5.10 || Fortnite_Version == 9.41 || Fortnite_Version == 14.20 || Fortnite_Version == 18.00)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_BirthdayBus2nd.BBID_BirthdayBus2nd"); // Birthday
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_BDay.AthenaSupplyDrop_BDay_C", BGAClass);
}
else if (Fortnite_Version == 1.8 || Fortnite_Version == 6.20 || Fortnite_Version == 6.21 || Fortnite_Version == 11.10 || Fortnite_Version == 14.40 || Fortnite_Version == 18.21)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_HalloweenBus.BBID_HalloweenBus"); // Fortnitemares
}
else if (Fortnite_Version >= 12.30 && Fortnite_Version <= 12.61)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_DonutBus.BBID_DonutBus"); // Deadpool
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_Donut.AthenaSupplyDrop_Donut_C", BGAClass);
}
else if (Fortnite_Version == 9.30)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WorldCupBus.BBID_WorldCupBus"); // World Cup
}
if (OverrideBattleBusSkin)
OverrideBattleBus(GameState, OverrideBattleBusSkin);
OverrideSupplyDrop(GameState, OverrideSupplyDropClass);
LOG_INFO(LogNet, "WorldLevel {}", GameState->GetWorldLevel());
if (Globals::AmountOfListens == 1) // we only want to do this one time.
@@ -1286,6 +1253,39 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
{
LastNum69 = Globals::AmountOfListens;
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
UObject* OverrideBattleBusSkin = nullptr;
UClass* OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass); // wrong for some builds but its ok
if (Fortnite_Version == 1.11 || Fortnite_Version == 7.30 || Fortnite_Version == 11.31 || Fortnite_Version == 15.10 || Fortnite_Version == 19.10)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus"); // Winterfest
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_Holiday.AthenaSupplyDrop_Holiday_C", BGAClass);
}
else if (Fortnite_Version == 5.10 || Fortnite_Version == 9.41 || Fortnite_Version == 14.20 || Fortnite_Version == 18.00)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_BirthdayBus2nd.BBID_BirthdayBus2nd"); // Birthday
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_BDay.AthenaSupplyDrop_BDay_C", BGAClass);
}
else if (Fortnite_Version == 1.8 || Fortnite_Version == 6.20 || Fortnite_Version == 6.21 || Fortnite_Version == 11.10 || Fortnite_Version == 14.40 || Fortnite_Version == 18.21)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_HalloweenBus.BBID_HalloweenBus"); // Fortnitemares
}
else if (Fortnite_Version >= 12.30 && Fortnite_Version <= 12.61)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_DonutBus.BBID_DonutBus"); // Deadpool
OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop_Donut.AthenaSupplyDrop_Donut_C", BGAClass);
}
else if (Fortnite_Version == 9.30)
{
OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WorldCupBus.BBID_WorldCupBus"); // World Cup
}
if (OverrideBattleBusSkin)
OverrideBattleBus(GameState, OverrideBattleBusSkin);
OverrideSupplyDrop(GameState, OverrideSupplyDropClass);
// is there spawn percentage for vending machines?
bool bShouldDestroyVendingMachines = Fortnite_Version < 3.4 || Engine_Version >= 424;
@@ -1349,6 +1349,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
}
}
#if 1
LOG_INFO(LogDev, "Spawning loot!");
auto SpawnIsland_FloorLoot = FindObject<UClass>(L"/Game/Athena/Environments/Blueprints/Tiered_Athena_FloorLoot_Warmup.Tiered_Athena_FloorLoot_Warmup_C");
@@ -1362,7 +1363,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
uint8 SpawnFlag = EFortPickupSourceTypeFlag::GetContainerValue();
bool bTest = false;
bool bDestroyFloorLootActor = false;
bool bPrintWarmup = bDebugPrintFloorLoot;
for (int i = 0; i < SpawnIsland_FloorLoot_Actors.Num(); i++)
@@ -1385,7 +1386,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
auto Pickup = AFortPickup::SpawnPickup(CreateData);
}
if (!bTest)
if (!bDestroyFloorLootActor)
CurrentActor->K2_DestroyActor();
}
@@ -1417,7 +1418,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
auto Pickup = AFortPickup::SpawnPickup(CreateData);
}
if (!bTest)
if (!bDestroyFloorLootActor)
CurrentActor->K2_DestroyActor();
}
@@ -1425,6 +1426,7 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
BRIsland_FloorLoot_Actors.Free();
LOG_INFO(LogDev, "Spawned loot!");
#endif
}
}

View File

@@ -309,16 +309,21 @@ void UFortKismetLibrary::GiveItemToInventoryOwnerHook(UObject* Context, FFrame&
void UFortKismetLibrary::K2_RemoveItemFromPlayerHook(UObject* Context, FFrame& Stack, void* Ret)
{
// int32 K2_RemoveItemFromPlayer(class AFortPlayerController* PlayerController, class UFortWorldItemDefinition* ItemDefinition, const struct FGuid& ItemVariantGuid, int32 AmountToRemove, bool bForceRemoval); // S18+
static auto PlayerControllerOffset = FindOffsetStruct("/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer", "PlayerController");
static auto ItemDefinitionOffset = FindOffsetStruct("/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer", "ItemDefinition");
static auto ItemVariantGuidOffset = FindOffsetStruct("/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer", "ItemVariantGuid", false);
static auto AmountToRemoveOffset = FindOffsetStruct("/Script/FortniteGame.FortKismetLibrary.K2_RemoveItemFromPlayer", "AmountToRemove");
AFortPlayerController* PlayerController = nullptr;
UFortWorldItemDefinition* ItemDefinition = nullptr;
FGuid ItemVariantGuid{};
int AmountToRemove;
Stack.StepCompiledIn(&PlayerController);
Stack.StepCompiledIn(&ItemDefinition);
if (ItemVariantGuidOffset != -1)
Stack.StepCompiledIn(&ItemVariantGuid);
Stack.StepCompiledIn(&AmountToRemove);
LOG_INFO(LogDev, __FUNCTION__);

View File

@@ -406,7 +406,7 @@ void AFortPlayerController::ServerExecuteInventoryItemHook(AFortPlayerController
}
}
void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame* Stack, void* Ret)
void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame* Stack)
{
// static auto LlamaClass = FindObject<UClass>(L"/Game/Athena/SupplyDrops/Llama/AthenaSupplyDrop_Llama.AthenaSupplyDrop_Llama_C");
static auto FortAthenaSupplyDropClass = FindObject<UClass>(L"/Script/FortniteGame.FortAthenaSupplyDrop");
@@ -471,7 +471,7 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
else if (ReceivingActor->IsA(FortAthenaVehicleClass))
{
auto Vehicle = (AFortAthenaVehicle*)ReceivingActor;
ServerAttemptInteractOriginal(Context, Stack, Ret);
ServerAttemptInteractOriginal(Context, Stack);
if (!AreVehicleWeaponsEnabled())
return;
@@ -545,9 +545,9 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
EFortWeaponUpgradeDirection Direction;
};
static auto WumbaDataTable = FindObject<UDataTable>("/Game/Items/Datatables/AthenaWumbaData.AthenaWumbaData");
static auto WumbaDataTable = FindObject<UDataTable>(L"/Game/Items/Datatables/AthenaWumbaData.AthenaWumbaData");
static auto LootPackagesRowMap = WumbaDataTable->GetRowMap();
auto& LootPackagesRowMap = WumbaDataTable->GetRowMap();
auto Pawn = Cast<AFortPawn>(PlayerController->GetPawn());
auto CurrentHeldWeapon = Pawn->GetCurrentWeapon();
@@ -593,9 +593,9 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
MetalCost = 20;
}
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 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");
auto WorldInventory = PlayerController->GetWorldInventory();
@@ -626,14 +626,14 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
auto WorldInventory = PlayerController->GetWorldInventory();
if (!WorldInventory)
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
auto ItemCollector = ReceivingActor;
static auto ActiveInputItemOffset = ItemCollector->GetOffset("ActiveInputItem");
auto CurrentMaterial = ItemCollector->Get<UFortWorldItemDefinition*>(ActiveInputItemOffset); // InteractType->OptionalObjectData
if (!CurrentMaterial)
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
int Index = 0;
@@ -657,17 +657,17 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
auto Cost = ItemCollection->GetInputCount()->GetValue();
if (!CurrentMaterial)
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
auto MatInstance = WorldInventory->FindItemInstance(CurrentMaterial);
if (!MatInstance)
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
bool bShouldUpdate = false;
if (!WorldInventory->RemoveItem(MatInstance->GetItemEntry()->GetItemGuid(), &bShouldUpdate, Cost, true))
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
if (bShouldUpdate)
WorldInventory->Update();
@@ -704,7 +704,7 @@ void AFortPlayerController::ServerAttemptInteractHook(UObject* Context, FFrame*
}
}
return ServerAttemptInteractOriginal(Context, Stack, Ret);
return ServerAttemptInteractOriginal(Context, Stack);
}
void AFortPlayerController::ServerAttemptAircraftJumpHook(AFortPlayerController* PC, FRotator ClientRotation)

View File

@@ -94,7 +94,7 @@ class AFortPlayerController : public APlayerController
public:
static inline void (*ClientOnPawnDiedOriginal)(AFortPlayerController* PlayerController, void* DeathReport);
static inline void (*ServerCreateBuildingActorOriginal)(UObject* Context, FFrame* Stack, void* Ret);
static inline void (*ServerAttemptInteractOriginal)(UObject* Context, FFrame* Stack, void* Ret);
static inline void (*ServerAttemptInteractOriginal)(UObject* Context, FFrame* Stack);
static inline void (*ServerEditBuildingActorOriginal)(UObject* Context, FFrame& Stack, void* Ret);
static inline void (*DropSpecificItemOriginal)(UObject* Context, FFrame& Stack, void* Ret);
static inline AActor* (*SpawnToyInstanceOriginal)(UObject* Context, FFrame* Stack, AActor** Ret);
@@ -198,7 +198,7 @@ public:
static void ServerLoadingScreenDroppedHook(UObject* Context, FFrame* Stack, void* Ret);
static void ServerRepairBuildingActorHook(AFortPlayerController* PlayerController, ABuildingSMActor* BuildingActorToRepair);
static void ServerExecuteInventoryItemHook(AFortPlayerController* PlayerController, FGuid ItemGuid);
static void ServerAttemptInteractHook(UObject* Context, FFrame* Stack, void* Ret);
static void ServerAttemptInteractHook(UObject* Context, FFrame* Stack);
static void ServerAttemptAircraftJumpHook(AFortPlayerController* PC, FRotator ClientRotation);
// static void ServerCreateBuildingActorHook(AFortPlayerController* PlayerController, FCreateBuildingActorData CreateBuildingData);

View File

@@ -90,14 +90,18 @@ void Addresses::SetupVersion()
FFastArraySerializer::bNewSerializer = Fortnite_Version >= 8.30;
if (Fortnite_CL == 3807424)
Fortnite_Version = 1.11;
if (Fortnite_CL == 3700114)
Fortnite_Version = 1.72;
if (Fortnite_CL == 3724489)
Fortnite_Version = 1.8;
if (Fortnite_CL == 3757339)
Fortnite_Version = 1.9;
if (Fortnite_CL == 3775276)
Fortnite_Version = 1.9; // 1.9.1
if (Fortnite_CL == 3790078)
Fortnite_Version = 1.10;
if (Fortnite_CL == 3807424)
Fortnite_Version = 1.11;
if (Fortnite_CL == 3841827)
Fortnite_Version = 2.2;
if (Fortnite_CL == 3847564)
@@ -446,6 +450,11 @@ void Offsets::FindAll()
Offsets::NetworkObjectList = 0x3F8;
Offsets::ReplicationFrame = 0x288;
}
if (Engine_Version == 419) // checked 2.4.2 & 2.2 & 1.10 & 1.11
{
Offsets::NetworkObjectList = 0x490;
Offsets::ReplicationFrame = 0x2C8;
}
if (Fortnite_Version == 1.72)
{
Offsets::ClientWorldPackageName = 0x336A8;
@@ -454,6 +463,10 @@ void Offsets::FindAll()
{
Offsets::ClientWorldPackageName = 0x33788;
}
if (Fortnite_Version == 1.10)
{
Offsets::ClientWorldPackageName = 0x337A8;
}
if (Fortnite_Version == 1.11)
{
Offsets::ClientWorldPackageName = 0x337B8;
@@ -490,11 +503,6 @@ void Offsets::FindAll()
Offsets::NetworkObjectList = 0x508;
Offsets::ClientWorldPackageName = 0x1828;
}
if (Engine_Version == 419) // checked 2.4.2 & 2.2 & 1.11
{
Offsets::NetworkObjectList = 0x490;
Offsets::ReplicationFrame = 0x2C8;
}
if (Fortnite_Version >= 20 && Fortnite_Version < 22)
{
Offsets::ReplicationFrame = 0x3D8;
@@ -548,7 +556,7 @@ std::vector<uint64> Addresses::GetFunctionsToReturnTrue()
{
std::vector<uint64> toReturnTrue;
if (Fortnite_Version == 1.11 || Fortnite_Version >= 2.2 && Fortnite_Version <= 2.4)
if (Fortnite_Version == 1.10 || Fortnite_Version == 1.11 || Fortnite_Version >= 2.2 && Fortnite_Version <= 2.4)
{
toReturnTrue.push_back(Memcury::Scanner::FindPattern("48 89 5C 24 ? 48 89 6C 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 48 8B 01 49 8B E9 45 0F B6 F8").Get()); // No Reserve
}

View File

@@ -100,17 +100,18 @@ namespace Calendar
if (SnowSetup && SetSnowFn)
{
if (Engine_Version >= 500)
NewValue = static_cast<int>(NewValue);
NewValue = (int)NewValue;
SnowSetup->ProcessEvent(SetSnowFn, &NewValue);
if (NewValue != -1 && Engine_Version >= 500)
LOG_INFO(LogDev, "Called SetSnow!");
if (NewValue != -1 && Engine_Version >= 500 && !Addresses::GIsClient)
{
auto UpdateSnowVisualsOnClientFn = FindObject<UFunction>("/SpecialSurfaceCoverage/Items/BP_Artemis_S19Progression.BP_Artemis_S19Progression_C.UpdateSnowVisualsOnClient");
SnowSetup->ProcessEvent(UpdateSnowVisualsOnClientFn);
LOG_INFO(LogDev, "Called UpdateSnowVisualsOnClientFn!");
}
LOG_INFO(LogDev, "Called SetSnow!");
}
else
{

View File

@@ -1570,7 +1570,7 @@ DWORD WINAPI Main(LPVOID)
srand(time(0));
LOG_INFO(LogHook, "Finished!");
LOG_INFO(LogHook, "Finished initialization!");
if (false)
{

View File

@@ -46,8 +46,7 @@ uint64 FindStartAircraftPhase()
uint64 FindGIsClient()
{
/* if (Fortnite_Version >= 20)
return 0; */
// if (Fortnite_Version >= 19) return 0;
auto Addr = Memcury::Scanner::FindStringRef(L"AllowCommandletRendering");

View File

@@ -295,8 +295,8 @@ static inline uint64 FindLoadAsset()
static inline uint64 FindKickPlayer()
{
if (Engine_Version == 416)
return Memcury::Scanner::FindPattern("40 53 56 48 81 EC ? ? ? ? 48 8B DA 48 8B F1 E8 ? ? ? ? 48 8B 06 48 8B CE").Get();
if (Engine_Version == 416) // <1.8
return Memcury::Scanner::FindPattern("40 53 56 48 81 EC ? ? ? ? 48 8B DA 48 8B F1 E8 ? ? ? ? 48 8B 06 48 8B CE").Get(); // postlogin
if (std::floor(Fortnite_Version) == 18)
return Memcury::Scanner::FindPattern("48 8B C4 48 89 58 08 48 89 70 10 48 89 78 18 4C 89 60 20 55 41 56 41 57 48 8B EC 48 83 EC 60 48 83 65 ? ? 4C 8B F2 83 65 E8 00 4C 8B E1 83 65 EC").Get();
if (std::floor(Fortnite_Version) == 19)
@@ -532,9 +532,9 @@ static inline uint64 FindStepExplicitProperty()
static inline uint64 FindIsNetRelevantForOffset()
{
if (Engine_Version == 416 || Fortnite_Version == 3.3) // checked on 1.7.2 & 1.8 & 3.3
if (Engine_Version == 416 || Fortnite_Version == 3.3) // checked on 1.7.2, 1.8, 3.3
return 0x420 / 8;
if (Fortnite_Version == 1.11 || (Fortnite_Version >= 2.42 && Fortnite_Version <= 3.2)) // checked 1.11, 2.4.2, 2.5, 3.0, 3.1
if (Fortnite_Version == 1.10 || Fortnite_Version == 1.11 || (Fortnite_Version >= 2.42 && Fortnite_Version <= 3.2)) // checked 1.10, 1.11, 2.4.2, 2.5, 3.0, 3.1, 3.2
return 0x418 / 8;
return 0;