mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
Add random defaults 1.7.2, some other internal stuff
This commit is contained in:
@@ -929,20 +929,19 @@ void AFortGameModeAthena::Athena_HandleStartingNewPlayerHook(AFortGameModeAthena
|
||||
if (!PlayerStateAthena)
|
||||
return Athena_HandleStartingNewPlayerOriginal(GameMode, NewPlayerActor);
|
||||
|
||||
if (Globals::bNoMCP || Engine_Version == 416)
|
||||
{
|
||||
static auto CharacterPartsOffset = PlayerStateAthena->GetOffset("CharacterParts", false);
|
||||
static auto CustomCharacterPartsStruct = FindObject<UStruct>("/Script/FortniteGame.CustomCharacterParts");
|
||||
static auto CharacterPartsOffset = PlayerStateAthena->GetOffset("CharacterParts", false);
|
||||
static auto CustomCharacterPartsStruct = FindObject<UStruct>("/Script/FortniteGame.CustomCharacterParts");
|
||||
auto CharacterParts = PlayerStateAthena->GetPtr<__int64>("CharacterParts");
|
||||
|
||||
static auto PartsOffset = FindOffsetStruct("/Script/FortniteGame.CustomCharacterParts", "Parts", false);
|
||||
auto Parts = (UObject**)(__int64(CharacterParts) + PartsOffset); // UCustomCharacterPart* Parts[0x6]
|
||||
|
||||
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart");
|
||||
|
||||
if (Globals::bNoMCP)
|
||||
{
|
||||
if (CharacterPartsOffset != -1) // && CustomCharacterPartsStruct)
|
||||
{
|
||||
auto CharacterParts = PlayerStateAthena->GetPtr<__int64>("CharacterParts");
|
||||
|
||||
static auto PartsOffset = FindOffsetStruct("/Script/FortniteGame.CustomCharacterParts", "Parts", false);
|
||||
auto Parts = (UObject**)(__int64(CharacterParts) + PartsOffset); // UCustomCharacterPart* Parts[0x6]
|
||||
|
||||
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart");
|
||||
|
||||
static auto headPart = LoadObject("/Game/Characters/CharacterParts/Female/Medium/Heads/F_Med_Head1.F_Med_Head1", CustomCharacterPartClass);
|
||||
static auto bodyPart = LoadObject("/Game/Characters/CharacterParts/Female/Medium/Bodies/F_Med_Soldier_01.F_Med_Soldier_01", CustomCharacterPartClass);
|
||||
static auto backpackPart = LoadObject("/Game/Characters/CharacterParts/Backpacks/NoBackpack.NoBackpack", CustomCharacterPartClass);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "FortGameModePvPBase.h"
|
||||
// #include "FortPlayerControllerAthena.h"
|
||||
#include "FortGameStateAthena.h"
|
||||
#include "KismetStringLibrary.h"
|
||||
#include "reboot.h"
|
||||
#include "BuildingSMActor.h"
|
||||
#include "FortSafeZoneIndicator.h"
|
||||
#include "GameplayStatics.h"
|
||||
#include "FortItemDefinition.h"
|
||||
|
||||
struct FAircraftFlightInfo
|
||||
{
|
||||
@@ -158,6 +158,11 @@ static void ShowFoundation(AActor* BuildingFoundation, bool bShow = true)
|
||||
{
|
||||
UGameplayStatics::UnloadStreamLevel(GetWorld(), LevelToStream, FLatentActionInfo(), false);
|
||||
} */
|
||||
|
||||
// real
|
||||
|
||||
BuildingFoundation->FlushNetDormancy();
|
||||
BuildingFoundation->ForceNetUpdate();
|
||||
}
|
||||
|
||||
static void StreamLevel(const std::string& LevelName, FVector Location = {})
|
||||
@@ -210,6 +215,12 @@ public:
|
||||
return (AFortGameStateAthena*)GetGameState();
|
||||
}
|
||||
|
||||
TArray<FItemAndCount>& GetStartingItems() // really in zone
|
||||
{
|
||||
static auto StartingItemsOffset = GetOffset("StartingItems");
|
||||
return Get<TArray<FItemAndCount>>(StartingItemsOffset);
|
||||
}
|
||||
|
||||
FName RedirectLootTier(const FName& LootTier);
|
||||
UClass* GetVehicleClassOverride(UClass* DefaultClass);
|
||||
|
||||
|
||||
@@ -44,24 +44,6 @@ enum class EFortInventoryType : unsigned char
|
||||
MAX = 3,
|
||||
};
|
||||
|
||||
struct FItemAndCount
|
||||
{
|
||||
private:
|
||||
int Count; // 0x0000(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
unsigned char UnknownData00[0x4]; // 0x0004(0x0004) MISSED OFFSET
|
||||
UFortItemDefinition* Item; // 0x0008(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
public:
|
||||
int& GetCount()
|
||||
{
|
||||
return Count;
|
||||
}
|
||||
|
||||
UFortItemDefinition*& GetItem()
|
||||
{
|
||||
return Item;
|
||||
}
|
||||
};
|
||||
|
||||
struct FItemGuidAndCount
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -24,4 +24,22 @@ public:
|
||||
static auto Class = FindObject<UClass>("/Script/FortniteGame.FortItemDefinition");
|
||||
return Class;
|
||||
}
|
||||
};
|
||||
|
||||
struct FItemAndCount
|
||||
{
|
||||
private:
|
||||
int Count; // 0x0000(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
unsigned char UnknownData00[0x4]; // 0x0004(0x0004) MISSED OFFSET
|
||||
UFortItemDefinition* Item; // 0x0008(0x0008) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData, NoDestructor, HasGetValueTypeHash, NativeAccessSpecifierPublic)
|
||||
public:
|
||||
int& GetCount()
|
||||
{
|
||||
return Count;
|
||||
}
|
||||
|
||||
UFortItemDefinition*& GetItem()
|
||||
{
|
||||
return Item;
|
||||
}
|
||||
};
|
||||
@@ -123,7 +123,7 @@ void AFortPlayerController::ApplyCosmeticLoadout()
|
||||
return;
|
||||
}
|
||||
|
||||
auto CosmeticLoadout = this->GetCosmeticLoadout();
|
||||
auto CosmeticLoadout = GetCosmeticLoadoutOffset() != -1 ? this->GetCosmeticLoadout() : nullptr;
|
||||
|
||||
if (CosmeticLoadout)
|
||||
{
|
||||
@@ -168,6 +168,11 @@ void AFortPlayerController::ApplyCosmeticLoadout()
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static auto HeroTypeOffset = PlayerStateAsFort->GetOffset("HeroType");
|
||||
ApplyHID(PawnAsFort, PlayerStateAsFort->Get(HeroTypeOffset));
|
||||
}
|
||||
|
||||
PlayerStateAsFort->ForceNetUpdate();
|
||||
PawnAsFort->ForceNetUpdate();
|
||||
|
||||
@@ -66,16 +66,22 @@ public:
|
||||
return Get<AFortPawn*>(MyFortPawnOffset);
|
||||
}
|
||||
|
||||
FFortAthenaLoadout* GetCosmeticLoadout()
|
||||
int GetCosmeticLoadoutOffset()
|
||||
{
|
||||
static auto CosmeticLoadoutPCOffset = this->GetOffset("CosmeticLoadoutPC", false);
|
||||
|
||||
if (CosmeticLoadoutPCOffset == -1)
|
||||
CosmeticLoadoutPCOffset = this->GetOffset("CustomizationLoadout");
|
||||
CosmeticLoadoutPCOffset = this->GetOffset("CustomizationLoadout", false);
|
||||
|
||||
if (CosmeticLoadoutPCOffset == -1)
|
||||
return nullptr;
|
||||
return -1;
|
||||
|
||||
return CosmeticLoadoutPCOffset;
|
||||
}
|
||||
|
||||
FFortAthenaLoadout* GetCosmeticLoadout()
|
||||
{
|
||||
static auto CosmeticLoadoutPCOffset = GetCosmeticLoadoutOffset();
|
||||
auto CosmeticLoadout = this->GetPtr<FFortAthenaLoadout>(CosmeticLoadoutPCOffset);
|
||||
|
||||
return CosmeticLoadout;
|
||||
|
||||
@@ -8,6 +8,59 @@
|
||||
#include "AthenaMarkerComponent.h"
|
||||
#include "FortVolume.h"
|
||||
|
||||
static void ApplyHID(AFortPlayerPawn* Pawn, UObject* HeroDefinition)
|
||||
{
|
||||
using UFortHeroSpecialization = UObject;
|
||||
|
||||
static auto SpecializationsOffset = HeroDefinition->GetOffset("Specializations");
|
||||
auto& Specializations = HeroDefinition->Get<TArray<TSoftObjectPtr<UFortHeroSpecialization>>>(SpecializationsOffset);
|
||||
|
||||
auto PlayerState = Pawn->GetPlayerState();
|
||||
|
||||
for (int i = 0; i < Specializations.Num(); i++)
|
||||
{
|
||||
auto& SpecializationSoft = Specializations.at(i);
|
||||
|
||||
static auto FortHeroSpecializationClass = FindObject<UClass>("/Script/FortniteGame.FortHeroSpecialization");
|
||||
auto Specialization = SpecializationSoft.Get(FortHeroSpecializationClass, true);
|
||||
|
||||
if (Specialization)
|
||||
{
|
||||
static auto Specialization_CharacterPartsOffset = Specialization->GetOffset("CharacterParts");
|
||||
auto& CharacterParts = Specialization->Get<TArray<TSoftObjectPtr<UObject>>>(Specialization_CharacterPartsOffset);
|
||||
|
||||
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart");
|
||||
|
||||
/* if (bUseServerChoosePart)
|
||||
{
|
||||
for (int z = 0; z < CharacterParts.Num(); z++)
|
||||
{
|
||||
Pawn->ServerChoosePart((EFortCustomPartType)z, CharacterParts.at(z).Get(CustomCharacterPartClass, true));
|
||||
}
|
||||
|
||||
continue; // hm?
|
||||
} */
|
||||
|
||||
bool aa;
|
||||
|
||||
TArray<UObject*> CharacterPartsaa;
|
||||
|
||||
for (int z = 0; z < CharacterParts.Num(); z++)
|
||||
{
|
||||
auto& CharacterPartSoft = CharacterParts.at(z, GetSoftObjectSize());
|
||||
auto CharacterPart = CharacterPartSoft.Get(CustomCharacterPartClass, true);
|
||||
|
||||
CharacterPartsaa.Add(CharacterPart);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
UFortKismetLibrary::ApplyCharacterCosmetics(GetWorld(), CharacterPartsaa, PlayerState, &aa);
|
||||
CharacterPartsaa.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool ApplyCID(AFortPlayerPawn* Pawn, UObject* CID, bool bUseServerChoosePart = false)
|
||||
{
|
||||
if (!CID)
|
||||
@@ -46,57 +99,9 @@ static bool ApplyCID(AFortPlayerPawn* Pawn, UObject* CID, bool bUseServerChooseP
|
||||
static auto HeroDefinitionOffset = CID->GetOffset("HeroDefinition");
|
||||
auto HeroDefinition = CID->Get(HeroDefinitionOffset);
|
||||
|
||||
using UFortHeroSpecialization = UObject;
|
||||
ApplyHID(Pawn, HeroDefinition);
|
||||
|
||||
static auto SpecializationsOffset = HeroDefinition->GetOffset("Specializations");
|
||||
auto& Specializations = HeroDefinition->Get<TArray<TSoftObjectPtr<UFortHeroSpecialization>>>(SpecializationsOffset);
|
||||
|
||||
auto PlayerState = Pawn->GetPlayerState();
|
||||
|
||||
for (int i = 0; i < Specializations.Num(); i++)
|
||||
{
|
||||
auto& SpecializationSoft = Specializations.at(i);
|
||||
|
||||
static auto FortHeroSpecializationClass = FindObject<UClass>("/Script/FortniteGame.FortHeroSpecialization");
|
||||
auto Specialization = SpecializationSoft.Get(FortHeroSpecializationClass, true);
|
||||
|
||||
if (Specialization)
|
||||
{
|
||||
static auto Specialization_CharacterPartsOffset = Specialization->GetOffset("CharacterParts");
|
||||
auto& CharacterParts = Specialization->Get<TArray<TSoftObjectPtr<UObject>>>(Specialization_CharacterPartsOffset);
|
||||
|
||||
static auto CustomCharacterPartClass = FindObject<UClass>("/Script/FortniteGame.CustomCharacterPart");
|
||||
|
||||
/* if (bUseServerChoosePart)
|
||||
{
|
||||
for (int z = 0; z < CharacterParts.Num(); z++)
|
||||
{
|
||||
Pawn->ServerChoosePart((EFortCustomPartType)z, CharacterParts.at(z).Get(CustomCharacterPartClass, true));
|
||||
}
|
||||
|
||||
continue; // hm?
|
||||
} */
|
||||
|
||||
bool aa;
|
||||
|
||||
TArray<UObject*> CharacterPartsaa;
|
||||
|
||||
for (int z = 0; z < CharacterParts.Num(); z++)
|
||||
{
|
||||
auto& CharacterPartSoft = CharacterParts.at(z);
|
||||
auto CharacterPart = CharacterPartSoft.Get(CustomCharacterPartClass, true);
|
||||
|
||||
CharacterPartsaa.Add(CharacterPart);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
UFortKismetLibrary::ApplyCharacterCosmetics(GetWorld(), CharacterPartsaa, PlayerState, &aa);
|
||||
CharacterPartsaa.Free();
|
||||
}
|
||||
}
|
||||
|
||||
static auto HeroTypeOffset = PlayerState->GetOffset("HeroType");
|
||||
// static auto HeroTypeOffset = PlayerState->GetOffset("HeroType");
|
||||
// PlayerState->Get(HeroTypeOffset) = HeroDefinition;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -90,12 +90,12 @@ APawn* AGameModeBase::SpawnDefaultPawnForHook(AGameModeBase* GameMode, AControll
|
||||
{
|
||||
// TODO Check Playlist->bRequirePickaxeInStartingInventory
|
||||
|
||||
auto CosmeticLoadout = NewPlayerAsAthena->GetCosmeticLoadout();
|
||||
auto CosmeticLoadout = NewPlayerAsAthena->GetCosmeticLoadoutOffset() != -1 ? NewPlayerAsAthena->GetCosmeticLoadout() : nullptr;
|
||||
// LOG_INFO(LogDev, "CosmeticLoadout: {}", __int64(CosmeticLoadout));
|
||||
auto CosmeticLoadoutPickaxe = CosmeticLoadout ? CosmeticLoadout->GetPickaxe() : nullptr;
|
||||
// LOG_INFO(LogDev, "CosmeticLoadoutPickaxe: {}", __int64(CosmeticLoadoutPickaxe));
|
||||
// LOG_INFO(LogDev, "CosmeticLoadoutPickaxe Name: {}", CosmeticLoadoutPickaxe ? CosmeticLoadoutPickaxe->GetFullName() : "InvalidObject");
|
||||
static auto WeaponDefinitionOffset = FindOffsetStruct("/Script/FortniteGame.AthenaPickaxeItemDefinition", "WeaponDefinition");
|
||||
static auto WeaponDefinitionOffset = FindOffsetStruct("/Script/FortniteGame.AthenaPickaxeItemDefinition", "WeaponDefinition", false);
|
||||
|
||||
auto PickaxeDefinition = CosmeticLoadoutPickaxe ? CosmeticLoadoutPickaxe->Get<UFortItemDefinition*>(WeaponDefinitionOffset)
|
||||
: FindObject<UFortItemDefinition>(L"/Game/Athena/Items/Weapons/WID_Harvest_Pickaxe_Athena_C_T01.WID_Harvest_Pickaxe_Athena_C_T01");
|
||||
|
||||
@@ -52,4 +52,9 @@ public:
|
||||
return FindObject<T>(SoftObjectPtr.ObjectID.AssetPathName.ToString());
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
static inline int GetSoftObjectSize()
|
||||
{
|
||||
return Engine_Version == 416 ? sizeof(TAssetPtr<void>) : sizeof(TSoftObjectPtr<void>);
|
||||
}
|
||||
@@ -100,7 +100,26 @@ void __fastcall ApplyHomebaseEffectsOnPlayerSetupHook(
|
||||
{
|
||||
LOG_INFO(LogDev, "Old hero: {}", Hero ? Hero->GetFullName() : "InvalidObject");
|
||||
|
||||
auto HeroType = FindObject<UFortItemDefinition>("/Game/Athena/Heroes/HID_030_Athena_Commando_M_Halloween.HID_030_Athena_Commando_M_Halloween");
|
||||
UFortItemDefinition* HeroType = FindObject<UFortItemDefinition>("/Game/Athena/Heroes/HID_030_Athena_Commando_M_Halloween.HID_030_Athena_Commando_M_Halloween");
|
||||
|
||||
if (Fortnite_Version == 1.72)
|
||||
{
|
||||
auto AllHeroTypes = GetAllObjectsOfClass(FindObject<UClass>("/Script/FortniteGame.FortHeroType"));
|
||||
std::vector<UFortItemDefinition*> AthenaHeroTypes;
|
||||
|
||||
for (int i = 0; i < AllHeroTypes.size(); i++)
|
||||
{
|
||||
auto CurrentHeroType = (UFortItemDefinition*)AllHeroTypes.at(i);
|
||||
|
||||
if (CurrentHeroType->GetPathName().starts_with("/Game/Athena/Heroes/"))
|
||||
AthenaHeroTypes.push_back(CurrentHeroType);
|
||||
}
|
||||
|
||||
if (AthenaHeroTypes.size())
|
||||
{
|
||||
HeroType = AthenaHeroTypes.at(std::rand() % AthenaHeroTypes.size());
|
||||
}
|
||||
}
|
||||
|
||||
static auto ItemDefinitionOffset = Hero->GetOffset("ItemDefinition");
|
||||
Hero->Get<UFortItemDefinition*>(ItemDefinitionOffset) = HeroType;
|
||||
@@ -359,7 +378,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
|
||||
if (Engine_Version < 420)
|
||||
{
|
||||
auto ApplyHomebaseEffectsOnPlayerSetupAddr = Memcury::Scanner::FindPattern("40 55 53 57 41 54 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 00 4C 8B BD ? ? ? ? 49").Get();
|
||||
auto ApplyHomebaseEffectsOnPlayerSetupAddr = Memcury::Scanner::FindPattern("40 55 53 57 41 54 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 00 4C 8B").Get();
|
||||
|
||||
Hooking::MinHook::Hook((PVOID)ApplyHomebaseEffectsOnPlayerSetupAddr, ApplyHomebaseEffectsOnPlayerSetupHook, (PVOID*)&ApplyHomebaseEffectsOnPlayerSetupOriginal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user