mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
custom supplydrops and battlebus based on version
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
#include "calendar.h"
|
||||
#include "gui.h"
|
||||
#include <random>
|
||||
#include "TSubclassOf.h"
|
||||
#include "FortAthenaSupplyDrop.h"
|
||||
|
||||
static UFortPlaylistAthena* GetPlaylistToUse()
|
||||
{
|
||||
@@ -188,6 +190,58 @@ void AFortGameModeAthena::StartAircraftPhase()
|
||||
}
|
||||
}
|
||||
|
||||
void AFortGameModeAthena::OverrideBattleBus(AFortGameStateAthena* GameState, UObject* OverrideBattleBusSkin)
|
||||
{
|
||||
if (!OverrideBattleBusSkin)
|
||||
{
|
||||
LOG_WARN(LogGame, "OverrideBattleBus not found! Equipping default battle bus.");
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AFortGameModeAthena::OverrideSupplyDrop(AFortGameStateAthena* GameState, UClass* OverrideSupplyDropBusClass)
|
||||
{
|
||||
if (!OverrideSupplyDropBusClass)
|
||||
{
|
||||
LOG_WARN(LogGame, "OverrideSuppyDrop not found! Equipping default supply drop.");
|
||||
return;
|
||||
}
|
||||
|
||||
static auto MapInfoOffset = GameState->GetOffset("MapInfo");
|
||||
auto MapInfo = GameState->Get<AFortAthenaMapInfo*>(MapInfoOffset);
|
||||
|
||||
static auto SupplyDropInfoListOffset = MapInfo->GetOffset("SupplyDropInfoList");
|
||||
auto SupplyDropInfoList = MapInfo->Get<TArray<UFortSupplyDropInfo*>>(SupplyDropInfoListOffset);
|
||||
|
||||
static auto SupplyDropClassOffset = SupplyDropInfoList[0]->GetOffset("SupplyDropClass");
|
||||
SupplyDropInfoList[0]->Get<TSubclassOf<AFortAthenaSupplyDrop*>>(SupplyDropClassOffset) = OverrideSupplyDropBusClass;
|
||||
|
||||
LOG_INFO(LogGame, "Overridden SupplyDropClass: {}", OverrideSupplyDropBusClass->GetFullName());
|
||||
}
|
||||
|
||||
void AFortGameModeAthena::PauseSafeZone(bool bPaused)
|
||||
{
|
||||
auto GameState = GetGameStateAthena();
|
||||
@@ -1145,6 +1199,39 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
||||
}
|
||||
}
|
||||
|
||||
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
|
||||
static UObject* OverrideBattleBusSkin = nullptr;
|
||||
static UClass* OverrideSupplyDropClass = LoadObject<UClass>(L"/Game/Athena/SupplyDrops/AthenaSupplyDrop.AthenaSupplyDrop_C", BGAClass);
|
||||
|
||||
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);
|
||||
|
||||
// if (Engine_Version < 427)
|
||||
{
|
||||
static int LastNum69 = 19451;
|
||||
|
||||
Reference in New Issue
Block a user