mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 02:42:22 +01:00
idk bbruh
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
|
||||
#include "reboot.h"
|
||||
|
||||
void APlayerController::ServerChangeName(FString& S)
|
||||
void APlayerController::ServerChangeName(const FString& S)
|
||||
{
|
||||
static auto ServerChangeNameFn = FindObject<UFunction>(L"/Script/Engine.PlayerController.ServerChangeName");
|
||||
this->ProcessEvent(ServerChangeNameFn, &S);
|
||||
this->ProcessEvent(ServerChangeNameFn, (FString*)&S);
|
||||
}
|
||||
|
||||
void APlayerController::SetPlayerIsWaiting(bool NewValue)
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
void SetPlayerIsWaiting(bool NewValue);
|
||||
bool IsPlayerWaiting();
|
||||
void ServerChangeName(FString& S);
|
||||
void ServerChangeName(const FString& S);
|
||||
UCheatManager*& SpawnCheatManager(UClass* CheatManagerClass);
|
||||
FRotator GetControlRotation();
|
||||
void ServerRestartPlayer();
|
||||
|
||||
@@ -293,6 +293,7 @@
|
||||
<ClInclude Include="BGA.h" />
|
||||
<ClInclude Include="BinaryHeap.h" />
|
||||
<ClInclude Include="BitArray.h" />
|
||||
<ClInclude Include="botnames.h" />
|
||||
<ClInclude Include="bots.h" />
|
||||
<ClInclude Include="BP_IslandScripting.h" />
|
||||
<ClInclude Include="BuildingActor.h" />
|
||||
|
||||
@@ -984,6 +984,9 @@
|
||||
<ClInclude Include="AIController.h">
|
||||
<Filter>Engine\Source\Runtime\AIModule\Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="botnames.h">
|
||||
<Filter>Reboot\Public</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Engine">
|
||||
|
||||
73
Project Reboot 3.0/botnames.h
Normal file
73
Project Reboot 3.0/botnames.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "discord.h"
|
||||
#include "log.h"
|
||||
|
||||
static inline size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* buffer) {
|
||||
size_t total_size = size * nmemb;
|
||||
buffer->append((char*)contents, total_size);
|
||||
return total_size;
|
||||
}
|
||||
|
||||
inline std::vector<FString> PlayerBotNames;
|
||||
|
||||
static inline void InitBotNames()
|
||||
{
|
||||
PlayerBotNames.clear();
|
||||
|
||||
PlayerBotNames.push_back(L"qwertyouriop");
|
||||
PlayerBotNames.push_back(L"willdey");
|
||||
PlayerBotNames.push_back(L"Soggs");
|
||||
PlayerBotNames.push_back(L"vxzty");
|
||||
PlayerBotNames.push_back(L"Milxnor");
|
||||
PlayerBotNames.push_back(L"max");
|
||||
PlayerBotNames.push_back(L"Callum");
|
||||
PlayerBotNames.push_back(L"Samicc");
|
||||
PlayerBotNames.push_back(L"AidasP");
|
||||
PlayerBotNames.push_back(L"danii");
|
||||
PlayerBotNames.push_back(L"sizzy");
|
||||
PlayerBotNames.push_back(L"penguin");
|
||||
PlayerBotNames.push_back(L"Jagger");
|
||||
PlayerBotNames.push_back(L"Jacobb");
|
||||
PlayerBotNames.push_back(L"Zulu");
|
||||
PlayerBotNames.push_back(L"kemo");
|
||||
PlayerBotNames.push_back(L"Ender");
|
||||
PlayerBotNames.push_back(L"Samuel");
|
||||
PlayerBotNames.push_back(L"Kyiro");
|
||||
PlayerBotNames.push_back(L"Ahava");
|
||||
PlayerBotNames.push_back(L"Spooky");
|
||||
PlayerBotNames.push_back(L"Akos");
|
||||
PlayerBotNames.push_back(L"ridecly");
|
||||
PlayerBotNames.push_back(L"cardurr");
|
||||
PlayerBotNames.push_back(L"android");
|
||||
PlayerBotNames.push_back(L"Sync");
|
||||
PlayerBotNames.push_back(L"GD");
|
||||
PlayerBotNames.push_back(L"Jeremy");
|
||||
PlayerBotNames.push_back(L"TeoVR");
|
||||
PlayerBotNames.push_back(L"CuteLess");
|
||||
PlayerBotNames.push_back(L"Trash Bot");
|
||||
PlayerBotNames.push_back(L"Lawin");
|
||||
PlayerBotNames.push_back(L"Adam");
|
||||
PlayerBotNames.push_back(L"Ruby");
|
||||
PlayerBotNames.push_back(L"Rythm");
|
||||
PlayerBotNames.push_back(L"Fexor");
|
||||
PlayerBotNames.push_back(L"Windermed");
|
||||
PlayerBotNames.push_back(L"BIGGINS");
|
||||
PlayerBotNames.push_back(L"Charles");
|
||||
PlayerBotNames.push_back(L"Custox");
|
||||
PlayerBotNames.push_back(L"Kaede");
|
||||
PlayerBotNames.push_back(L"lintu");
|
||||
PlayerBotNames.push_back(L"Baby");
|
||||
PlayerBotNames.push_back(L"Mineluke");
|
||||
PlayerBotNames.push_back(L"wiktorwiktor12");
|
||||
PlayerBotNames.push_back(L"solo");
|
||||
PlayerBotNames.push_back(L"HxD");
|
||||
PlayerBotNames.push_back(L"Noggo");
|
||||
PlayerBotNames.push_back(L"weyn");
|
||||
PlayerBotNames.push_back(L"ralz");
|
||||
PlayerBotNames.push_back(L"farex");
|
||||
PlayerBotNames.push_back(L"AllyJax");
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "OnlineReplStructs.h"
|
||||
#include "FortAthenaAIBotController.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "botnames.h"
|
||||
|
||||
class BotPOI
|
||||
{
|
||||
@@ -62,7 +63,6 @@ public:
|
||||
else
|
||||
{
|
||||
PawnClass = LoadObject<UClass>(L"/Game/Athena/AI/Phoebe/BP_PlayerPawn_Athena_Phoebe.BP_PlayerPawn_Athena_Phoebe_C", BlueprintGeneratedClassClass);
|
||||
|
||||
// ControllerClass = PawnClass->CreateDefaultObject()->GetAIControllerClass();
|
||||
}
|
||||
|
||||
@@ -160,6 +160,98 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void PickRandomLoadout()
|
||||
{
|
||||
auto AllHeroTypes = GetAllObjectsOfClass(FindObject<UClass>(L"/Script/FortniteGame.FortHeroType"));
|
||||
std::vector<UFortItemDefinition*> AthenaHeroTypes;
|
||||
|
||||
UFortItemDefinition* HeroType = FindObject<UFortItemDefinition>(L"/Game/Athena/Heroes/HID_030_Athena_Commando_M_Halloween.HID_030_Athena_Commando_M_Halloween");
|
||||
|
||||
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 HeroTypeOffset = PlayerState->GetOffset("HeroType");
|
||||
PlayerState->Get(HeroTypeOffset) = HeroType;
|
||||
}
|
||||
|
||||
void ApplyCosmeticLoadout()
|
||||
{
|
||||
static auto HeroTypeOffset = PlayerState->GetOffset("HeroType");
|
||||
const auto CurrentHeroType = PlayerState->Get(HeroTypeOffset);
|
||||
|
||||
if (!CurrentHeroType)
|
||||
{
|
||||
LOG_WARN(LogBots, "CurrentHeroType called with an invalid HeroType!");
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyHID(Pawn, CurrentHeroType, true);
|
||||
}
|
||||
|
||||
void SetName(const FString& NewName)
|
||||
{
|
||||
if (// true ||
|
||||
Fortnite_Version < 9
|
||||
)
|
||||
{
|
||||
if (auto PlayerController = Cast<APlayerController>(Controller))
|
||||
{
|
||||
PlayerController->ServerChangeName(NewName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto GameMode = Cast<AFortGameModeAthena>(GetWorld()->GetGameMode());
|
||||
GameMode->ChangeName(Controller, NewName, true);
|
||||
}
|
||||
|
||||
PlayerState->OnRep_PlayerName(); // ?
|
||||
}
|
||||
|
||||
FString GetRandomName() // Todo SetName(GetRandomName())
|
||||
{
|
||||
static int CurrentBotNum = 1;
|
||||
std::wstring BotNumWStr;
|
||||
FString NewName;
|
||||
|
||||
if (Fortnite_Version < 9)
|
||||
{
|
||||
BotNumWStr = std::to_wstring(CurrentBotNum++);
|
||||
NewName = (L"RebootBot" + BotNumWStr).c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Fortnite_Version < 11)
|
||||
{
|
||||
BotNumWStr = std::to_wstring(CurrentBotNum++ + 200);
|
||||
NewName = (std::format(L"Anonymous[{}]", BotNumWStr)).c_str();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PlayerBotNames.empty())
|
||||
{
|
||||
// std::shuffle(PlayerBotNames.begin(), PlayerBotNames.end(), std::default_random_engine((unsigned int)time(0)));
|
||||
|
||||
int RandomIndex = std::rand() % (PlayerBotNames.size() - 1);
|
||||
NewName = PlayerBotNames[RandomIndex];
|
||||
PlayerBotNames.erase(PlayerBotNames.begin() + RandomIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NewName;
|
||||
}
|
||||
|
||||
void Initialize(const FTransform& SpawnTransform, AActor* InSpawnLocator)
|
||||
{
|
||||
auto GameState = Cast<AFortGameStateAthena>(GetWorld()->GetGameState());
|
||||
@@ -202,25 +294,9 @@ public:
|
||||
Controller->Possess(Pawn);
|
||||
}
|
||||
|
||||
static int CurrentBotNum = 1;
|
||||
auto BotNumWStr = std::to_wstring(CurrentBotNum++);
|
||||
FString NewName = (L"Jimmy" + BotNumWStr).c_str();
|
||||
|
||||
if (true ||
|
||||
Fortnite_Version < 9
|
||||
)
|
||||
{
|
||||
if (auto PlayerController = Cast<APlayerController>(Controller))
|
||||
{
|
||||
PlayerController->ServerChangeName(NewName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMode->ChangeName(Controller, NewName, true);
|
||||
}
|
||||
|
||||
PlayerState->OnRep_PlayerName();
|
||||
auto BotNewName = GetRandomName();
|
||||
LOG_INFO(LogBots, "BotNewName: {}", BotNewName.ToString());
|
||||
SetName(BotNewName);
|
||||
|
||||
PlayerState->GetTeamIndex() = GameMode->Athena_PickTeamHook(GameMode, 0, Controller);
|
||||
|
||||
@@ -231,8 +307,6 @@ public:
|
||||
|
||||
GameState->AddPlayerStateToGameMemberInfo(PlayerState);
|
||||
|
||||
Controller->Possess(Pawn);
|
||||
|
||||
Pawn->SetHealth(100);
|
||||
Pawn->SetMaxHealth(100);
|
||||
|
||||
@@ -245,38 +319,8 @@ public:
|
||||
}
|
||||
|
||||
SetupInventory();
|
||||
|
||||
// PlayerController->GetCosmeticLoadout()->GetCharacter() = FindObject("/Game/Athena/Items/Cosmetics/Characters/CID_263_Athena_Commando_F_MadCommander.CID_263_Athena_Commando_F_MadCommander");
|
||||
// Pawn->GetCosmeticLoadout()->GetCharacter() = PlayerController->GetCosmeticLoadout()->GetCharacter();
|
||||
|
||||
// PlayerController->ApplyCosmeticLoadout();
|
||||
|
||||
auto AllHeroTypes = GetAllObjectsOfClass(FindObject<UClass>(L"/Script/FortniteGame.FortHeroType"));
|
||||
std::vector<UFortItemDefinition*> AthenaHeroTypes;
|
||||
|
||||
UFortItemDefinition* HeroType = FindObject<UFortItemDefinition>(L"/Game/Athena/Heroes/HID_030_Athena_Commando_M_Halloween.HID_030_Athena_Commando_M_Halloween");
|
||||
|
||||
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 HeroTypeOffset = PlayerState->GetOffset("HeroType");
|
||||
|
||||
if (HeroTypeOffset != -1)
|
||||
{
|
||||
PlayerState->Get(HeroTypeOffset) = HeroType;
|
||||
}
|
||||
|
||||
ApplyHID(Pawn, HeroType, true);
|
||||
PickRandomLoadout();
|
||||
ApplyCosmeticLoadout();
|
||||
|
||||
GameState->GetPlayersLeft()++;
|
||||
GameState->OnRep_PlayersLeft();
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "FortGameSessionDedicatedAthena.h"
|
||||
#include "FortAIEncounterInfo.h"
|
||||
#include "FortServerBotManagerAthena.h"
|
||||
#include "botnames.h"
|
||||
|
||||
enum class EMeshNetworkNodeType : uint8_t
|
||||
{
|
||||
@@ -846,7 +847,7 @@ DWORD WINAPI Main(LPVOID)
|
||||
#else
|
||||
if (Fortnite_Version > 20)
|
||||
{
|
||||
MessageBoxA(0, "Please define ABOVE_S20", "Project Reboot 3.0", MB_ICONERROR);
|
||||
MessageBoxA(0, "Please define ABOVE_S20 (compile it yourself and change inc.h)", "Project Reboot 3.0", MB_ICONERROR);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -1120,6 +1121,8 @@ DWORD WINAPI Main(LPVOID)
|
||||
|
||||
// Globals::bAbilitiesEnabled = Engine_Version < 500;
|
||||
|
||||
InitBotNames();
|
||||
|
||||
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").Get();
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "Fonts/ruda-bold.h"
|
||||
#include "Vector.h"
|
||||
#include "reboot.h"
|
||||
#include "botnames.h"
|
||||
#include "FortGameModeAthena.h"
|
||||
#include "UnrealString.h"
|
||||
#include "KismetTextLibrary.h"
|
||||
@@ -119,6 +120,8 @@ static inline bool HasAnyCalendarModification()
|
||||
|
||||
static inline void Restart() // todo move?
|
||||
{
|
||||
InitBotNames();
|
||||
|
||||
FString LevelA = Engine_Version < 424
|
||||
? L"open Athena_Terrain" : Engine_Version >= 500 ? Engine_Version >= 501
|
||||
? L"open Asteria_Terrain"
|
||||
|
||||
Reference in New Issue
Block a user