added skins and names to bosses

This commit is contained in:
Marvelco
2025-08-07 20:52:51 +03:00
parent 3dbb83a96f
commit 91cb107aed

View File

@@ -15,8 +15,46 @@ AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotM
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);
auto PC = Pawn->GetController();
auto PlayerState = Pawn->GetPlayerState();
auto BotNameSettings = InBotData->Get<UFortBotNameSettings*>(InBotData->GetOffset("BotNameSettings"));
Pawn->TeleportTo(InSpawnLocation, InSpawnRotation);//idfk????
auto SkinOverRide = InBotData->GetCharacterCustomization()->GetCustomizationLoadout()->GetCharacter();
if (SkinOverRide->GetName() == "CID_556_Athena_Commando_F_RebirthDefaultA")
{
if (InBotData->GetFullName().contains("Alter"))
{
SkinOverRide = LoadObject<UFortItemDefinition>("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_HenchmanBad.CID_NPC_Athena_Commando_M_HenchmanBad");
}
else if (InBotData->GetFullName().contains("Ego"))
{
SkinOverRide = LoadObject<UFortItemDefinition>("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_HenchmanGood.CID_NPC_Athena_Commando_M_HenchmanGood");
}
else if (InBotData->GetFullName().contains("Box")) //s13
{
SkinOverRide = LoadObject<UFortItemDefinition>("/Game/Athena/Items/Cosmetics/Characters/CID_NPC_Athena_Commando_M_Scrapyard.CID_NPC_Athena_Commando_M_Scrapyard");
}
}
else
{
if (InBotData->GetFullName().contains("Yatch") && Fortnite_Version >= 12.30 && Fortnite_Version <= 12.61)
{
SkinOverRide = LoadObject<UFortItemDefinition>("/Game/Athena/AI/MANG/BotData/BotData_MANG_POI_HDP.BotData_MANG_POI_HDP");
}
else
{
SkinOverRide = InBotData->GetCharacterCustomization()->GetCustomizationLoadout()->GetCharacter();
}
}
auto HeroDefinition = SkinOverRide->Get(SkinOverRide->GetOffset("HeroDefinition"));
ApplyHID(Pawn, HeroDefinition, true);
FString OverrideName = UKismetTextLibrary::Conv_TextToString(BotNameSettings->GetOverrideName());
*reinterpret_cast<FString*>(__int64(PlayerState) + PlayerState->GetOffset("PlayerNamePrivate")) = OverrideName;
PC->GetPlayerState()->OnRep_PlayerName();
return Pawn;
}