From 91cb107aed5053aec505a39da089b4cb27a307ba Mon Sep 17 00:00:00 2001 From: Marvelco Date: Thu, 7 Aug 2025 20:52:51 +0300 Subject: [PATCH] added skins and names to bosses --- .../FortServerBotManagerAthena.cpp | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Project Reboot 3.0/FortServerBotManagerAthena.cpp b/Project Reboot 3.0/FortServerBotManagerAthena.cpp index d284797..4823f66 100644 --- a/Project Reboot 3.0/FortServerBotManagerAthena.cpp +++ b/Project Reboot 3.0/FortServerBotManagerAthena.cpp @@ -15,8 +15,46 @@ AFortPlayerPawnAthena* UFortServerBotManagerAthena::SpawnBotHook(UFortServerBotM AActor* SpawnLocator = GetWorld()->SpawnActor(APawn::StaticClass(), InSpawnLocation, InSpawnRotation.Quaternion()); auto PawnClass = InBotData->Get(InBotData->GetOffset("PawnClass")); auto Pawn = BotMutator->SpawnBot(PawnClass , SpawnLocator, InSpawnLocation, InSpawnRotation, true); - + auto PC = Pawn->GetController(); + auto PlayerState = Pawn->GetPlayerState(); + auto BotNameSettings = InBotData->Get(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("/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("/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("/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("/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(__int64(PlayerState) + PlayerState->GetOffset("PlayerNamePrivate")) = OverrideName; + PC->GetPlayerState()->OnRep_PlayerName(); + return Pawn; } \ No newline at end of file