mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
Merge pull request #53 from max8447/master
custom supplydrops and battlebus based on version
This commit is contained in:
@@ -412,4 +412,11 @@ public:
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
inline InElementType& operator[](uint32 Index)
|
||||
{
|
||||
return Data[Index];
|
||||
}
|
||||
*/
|
||||
};
|
||||
@@ -35,6 +35,8 @@
|
||||
#include "calendar.h"
|
||||
#include "gui.h"
|
||||
#include <random>
|
||||
#include "TSubclassOf.h"
|
||||
#include "FortAthenaSupplyDrop.h"
|
||||
|
||||
static UFortPlaylistAthena* GetPlaylistToUse()
|
||||
{
|
||||
@@ -190,6 +192,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>(L"/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.at(0)->GetOffset("SupplyDropClass");
|
||||
SupplyDropInfoList.at(0)->Get<TSubclassOf<AFortAthenaSupplyDrop*>>(SupplyDropClassOffset) = OverrideSupplyDropBusClass;
|
||||
|
||||
LOG_INFO(LogGame, "Overridden SupplyDropClass: {}", OverrideSupplyDropBusClass->GetFullName());
|
||||
}
|
||||
|
||||
void AFortGameModeAthena::PauseSafeZone(bool bPaused)
|
||||
{
|
||||
auto GameState = GetGameStateAthena();
|
||||
@@ -345,7 +399,7 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Fortnite_Version >= 4)
|
||||
if (Fortnite_Version >= 4.0) // ????
|
||||
{
|
||||
SetPlaylist(PlaylistToUse, true);
|
||||
|
||||
@@ -446,7 +500,9 @@ bool AFortGameModeAthena::Athena_ReadyToStartMatchHook(AFortGameModeAthena* Game
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO(LogDev, "Getting playlist!");
|
||||
GET_PLAYLIST(GameState);
|
||||
LOG_INFO(LogDev, "Got playlist!");
|
||||
|
||||
if (CurrentPlaylist)
|
||||
{
|
||||
@@ -1168,6 +1224,39 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
||||
}
|
||||
}
|
||||
|
||||
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
|
||||
UObject* OverrideBattleBusSkin = nullptr;
|
||||
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;
|
||||
|
||||
@@ -232,6 +232,11 @@ static void StreamLevel(const std::string& LevelName, FVector Location = {})
|
||||
ShowFoundation(BuildingFoundation);
|
||||
}
|
||||
|
||||
class UFortSupplyDropInfo : public UObject // UDataAsset
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class AFortGameModeAthena : public AFortGameModePvPBase
|
||||
{
|
||||
public:
|
||||
@@ -269,6 +274,8 @@ public:
|
||||
void PauseSafeZone(bool bPaused = true);
|
||||
void StartAircraftPhase();
|
||||
|
||||
static void OverrideBattleBus(AFortGameStateAthena* GameState, UObject* OverrideBattleBusSkin);
|
||||
static void OverrideSupplyDrop(AFortGameStateAthena* GameState, UClass* OverrideSupplyDropBusClass);
|
||||
static void HandleSpawnRateForActorClass(UClass* ActorClass, float SpawnPercentage); // idk where to put
|
||||
|
||||
static void OnAircraftEnteredDropZoneHook(AFortGameModeAthena* GameModeAthena, AActor* Aircraft);
|
||||
|
||||
@@ -471,6 +471,7 @@
|
||||
<ClInclude Include="Text.h" />
|
||||
<ClInclude Include="TimerManager.h" />
|
||||
<ClInclude Include="Transform.h" />
|
||||
<ClInclude Include="TSubclassOf.h" />
|
||||
<ClInclude Include="Tuple.h" />
|
||||
<ClInclude Include="TypeCompatibleBytes.h" />
|
||||
<ClInclude Include="TypeWrapper.h" />
|
||||
|
||||
63
Project Reboot 3.0/TSubclassOf.h
Normal file
63
Project Reboot 3.0/TSubclassOf.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
template<typename ClassType>
|
||||
class TSubclassOf
|
||||
{
|
||||
class UClass* ClassPtr;
|
||||
|
||||
public:
|
||||
TSubclassOf() = default;
|
||||
|
||||
inline TSubclassOf(UClass* Class)
|
||||
: ClassPtr(Class)
|
||||
{
|
||||
}
|
||||
|
||||
inline UClass* Get()
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline operator UClass* () const
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
template<typename Target, typename = std::enable_if<std::is_base_of_v<Target, ClassType>, bool>::type>
|
||||
inline operator TSubclassOf<Target>() const
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline UClass* operator->()
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline TSubclassOf& operator=(UClass* Class)
|
||||
{
|
||||
ClassPtr = Class;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator==(const TSubclassOf& Other) const
|
||||
{
|
||||
return ClassPtr == Other.ClassPtr;
|
||||
}
|
||||
|
||||
inline bool operator!=(const TSubclassOf& Other) const
|
||||
{
|
||||
return ClassPtr != Other.ClassPtr;
|
||||
}
|
||||
|
||||
inline bool operator==(UClass* Other) const
|
||||
{
|
||||
return ClassPtr == Other;
|
||||
}
|
||||
|
||||
inline bool operator!=(UClass* Other) const
|
||||
{
|
||||
return ClassPtr != Other;
|
||||
}
|
||||
};
|
||||
@@ -824,54 +824,7 @@ static inline void MainUI()
|
||||
auto GameMode = (AFortGameMode*)GetWorld()->GetGameMode();
|
||||
auto GameState = Cast<AFortGameStateAthena>(GameMode->GetGameState());
|
||||
|
||||
AmountOfPlayersWhenBusStart = GameState->GetPlayersLeft(); // scuffed!!!!
|
||||
|
||||
if (Fortnite_Version == 1.11)
|
||||
{
|
||||
static auto OverrideBattleBusSkin = FindObject(L"/Game/Athena/Items/Cosmetics/BattleBuses/BBID_WinterBus.BBID_WinterBus");
|
||||
LOG_INFO(LogDev, "OverrideBattleBusSkin: {}", __int64(OverrideBattleBusSkin));
|
||||
|
||||
if (OverrideBattleBusSkin)
|
||||
{
|
||||
static auto AssetManagerOffset = GetEngine()->GetOffset("AssetManager");
|
||||
auto AssetManager = GetEngine()->Get(AssetManagerOffset);
|
||||
|
||||
if (AssetManager)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AmountOfPlayersWhenBusStart = GameState->GetPlayersLeft();
|
||||
|
||||
static auto WarmupCountdownEndTimeOffset = GameState->GetOffset("WarmupCountdownEndTime");
|
||||
// GameState->Get<float>(WarmupCountdownEndTimeOffset) = UGameplayStatics::GetTimeSeconds(GetWorld()) + 10;
|
||||
|
||||
Reference in New Issue
Block a user