mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
init bosses
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
#include "FortServerBotManagerAthena.h"
|
||||
#include "bots.h"
|
||||
#include "ai.h"
|
||||
#include "finder.h"
|
||||
|
||||
AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation,
|
||||
UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData* InRuntimeBotData)
|
||||
UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData)
|
||||
{
|
||||
LOG_INFO(LogBots, "SpawnBotHook!");
|
||||
|
||||
return nullptr;
|
||||
if (__int64(_ReturnAddress()) == SpawnBotRet()) {
|
||||
return SpawnBotOriginal(BotManager, InSpawnLocation, InSpawnRotation, InBotData, InRuntimeBotData);
|
||||
}
|
||||
|
||||
AActor* SpawnLocator = GetWorld()->SpawnActor<APawn>(APawn::StaticClass(), InSpawnLocation, InSpawnRotation.Quaternion());
|
||||
auto PawnClass = InBotData->Get<UClass*>(InBotData->GetOffset("PawnClass"));
|
||||
auto Pawn = BotMutator->SpawnBot(PawnClass , SpawnLocator, InSpawnLocation, InSpawnRotation, true);
|
||||
|
||||
Pawn->TeleportTo(InSpawnLocation, InSpawnRotation);//idfk????
|
||||
|
||||
return Pawn;
|
||||
}
|
||||
@@ -15,7 +15,7 @@ static inline void (*BotManagerSetupStuffIdk)(__int64 BotManaager, __int64 Pawn,
|
||||
class UFortServerBotManagerAthena : public UObject
|
||||
{
|
||||
public:
|
||||
static inline AFortPlayerPawnAthena* (*SpawnBotOriginal)(UFortServerBotManagerAthena* BotManager, FVector InSpawnLocation, FRotator InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData InRuntimeBotData);
|
||||
static inline AFortPlayerPawnAthena* (*SpawnBotOriginal)(UFortServerBotManagerAthena* BotManager, FVector InSpawnLocation, FRotator InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData);
|
||||
|
||||
AFortAthenaMutator_Bots*& GetCachedBotMutator()
|
||||
{
|
||||
@@ -23,5 +23,5 @@ public:
|
||||
return Get<AFortAthenaMutator_Bots*>(CachedBotMutatorOffset);
|
||||
}
|
||||
|
||||
static AFortPlayerPawnAthena* SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData* InRuntimeBotData);
|
||||
static AFortPlayerPawnAthena* SpawnBotHook(UFortServerBotManagerAthena* BotManager, FVector& InSpawnLocation, FRotator& InSpawnRotation, UFortAthenaAIBotCustomizationData* InBotData, FFortAthenaAIBotRunTimeCustomizationData& InRuntimeBotData);
|
||||
};
|
||||
@@ -21,6 +21,7 @@ using UNavigationSystemConfig = UObject;
|
||||
using AAthenaNavSystemConfigOverride = UObject;
|
||||
using UAthenaNavSystem = UObject;
|
||||
using UAthenaNavSystemConfig = UObject;
|
||||
inline AFortAthenaMutator_Bots* BotMutator = nullptr;
|
||||
|
||||
enum class EFNavigationSystemRunMode : uint8_t
|
||||
{
|
||||
@@ -111,14 +112,14 @@ static inline AFortAthenaMutator_Bots* SpawnBotMutator() //sets up all the class
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
|
||||
static auto BGAClass = FindObject<UClass>(L"/Script/Engine.BlueprintGeneratedClass");
|
||||
auto PhoebeMutatorClass = LoadObject<UClass>(L"/Game/Athena/AI/Phoebe/BP_Phoebe_Mutator.BP_Phoebe_Mutator_C", BGAClass);
|
||||
//auto PhoebeMutatorClass = LoadObject<UClass>(L"/Game/Athena/AI/Phoebe/BP_Phoebe_Mutator.BP_Phoebe_Mutator_C", BGAClass);
|
||||
|
||||
if (!PhoebeMutatorClass)
|
||||
if (!AFortAthenaMutator_Bots::StaticClass())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto BotMutator = GetWorld()->SpawnActor<AFortAthenaMutator_Bots>(PhoebeMutatorClass);
|
||||
BotMutator = GetWorld()->SpawnActor<AFortAthenaMutator_Bots>(AFortAthenaMutator_Bots::StaticClass());
|
||||
|
||||
if (!BotMutator)
|
||||
{
|
||||
|
||||
@@ -1308,8 +1308,11 @@ DWORD WINAPI Main(LPVOID)
|
||||
(PVOID*)&AFortGameModeAthena::OnAircraftEnteredDropZoneOriginal, false, false, true, true);
|
||||
}
|
||||
|
||||
// Hooking::MinHook::Hook(FindObject<UFortServerBotManagerAthena>(L"/Script/FortniteGame.Default__FortServerBotManagerAthena"), FindObject<UFunction>(L"/Script/FortniteGame.FortServerBotManagerAthena.SpawnBot"),
|
||||
// UFortServerBotManagerAthena::SpawnBotHook, (PVOID*)&UFortServerBotManagerAthena::SpawnBotOriginal, false);
|
||||
if (Fortnite_Version >= 12 && Fortnite_Version <= 13) // you cant spawn bosses using spawnbot on s14 and above
|
||||
{
|
||||
Hooking::MinHook::Hook(FindObject<UFortServerBotManagerAthena>(L"/Script/FortniteGame.Default__FortServerBotManagerAthena"), FindObject<UFunction>(L"/Script/FortniteGame.FortServerBotManagerAthena.SpawnBot"),
|
||||
UFortServerBotManagerAthena::SpawnBotHook, (PVOID*)&UFortServerBotManagerAthena::SpawnBotOriginal, false);
|
||||
}
|
||||
|
||||
Hooking::MinHook::Hook(GameModeDefault, FindObject<UFunction>(L"/Script/Engine.GameModeBase.SpawnDefaultPawnFor"),
|
||||
AGameModeBase::SpawnDefaultPawnForHook, nullptr, false);
|
||||
|
||||
@@ -2053,3 +2053,18 @@ static inline uint64 FindClearAbility()
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline uint64 SpawnBotRet()
|
||||
{
|
||||
auto String = Memcury::Scanner::FindStringRef(L"Unable to create UFortAthenaAIBotCustomizationData object. BotClass = %s", true, 0, false).Get();
|
||||
|
||||
for (int i = 0; i < 1000; i++)
|
||||
{
|
||||
if (*(uint8_t*)(String + i) == 0x48 && *(uint8_t*)(String + i + 1) == 0x8b && *(uint8_t*)(String + i + 2) == 0xd8)
|
||||
{
|
||||
return String + i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user