From 4ce5512d7dd52c8e05a8dcf4a7c84556b6d3714b Mon Sep 17 00:00:00 2001 From: Chomp Date: Fri, 17 Oct 2025 10:53:25 +0100 Subject: [PATCH] Added `BotConfig.ReplaceScavWith` to allow adjustment of scavs into other bot types --- .../SPT_Data/configs/bot.json | 3 ++- .../Models/Spt/Config/BotConfig.cs | 6 +++++ .../Services/PostDbLoadService.cs | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/bot.json b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/bot.json index c482fae2..7bc5ea6b 100644 --- a/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/bot.json +++ b/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/bot.json @@ -2838,5 +2838,6 @@ "bossKnight" ], "resetDay": "Monday" - } + }, + "replaceScavWith": "assault" } diff --git a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs index 690111d9..fb11db48 100644 --- a/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs +++ b/Libraries/SPTarkov.Server.Core/Models/Spt/Config/BotConfig.cs @@ -131,6 +131,12 @@ public record BotConfig : BaseConfig /// [JsonPropertyName("weeklyBoss")] public required WeeklyBossSettings WeeklyBoss { get; set; } + + /// + /// Replace all scavs across all maps with the provided WildSpawnType + /// + [JsonPropertyName("replaceScavWith")] + public required WildSpawnType ReplaceScavWith { get; set; } } public record WeeklyBossSettings diff --git a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs index 71e2c04f..528c5d29 100644 --- a/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/PostDbLoadService.cs @@ -131,6 +131,30 @@ public class PostDbLoadService( var chosenBoss = GetWeeklyBoss(BotConfig.WeeklyBoss.BossPool, BotConfig.WeeklyBoss.ResetDay); FlagMapAsGuaranteedBoss(chosenBoss); } + + if (BotConfig.ReplaceScavWith != WildSpawnType.assault) + { + ReplaceScavWavesWithRole(BotConfig.ReplaceScavWith); + } + } + + protected void ReplaceScavWavesWithRole(WildSpawnType newScavRole) + { + foreach (var location in databaseService.GetLocations().GetDictionary().Values) + { + if (location.Base?.Waves is null) + { + continue; + } + + foreach (var wave in location.Base.Waves) + { + if (wave.WildSpawnType == WildSpawnType.assault) + { + wave.WildSpawnType = newScavRole; + } + } + } } ///