diff --git a/project/assets/configs/location.json b/project/assets/configs/location.json index 2fec90f5..46c89450 100644 --- a/project/assets/configs/location.json +++ b/project/assets/configs/location.json @@ -537,5 +537,6 @@ "mod_mount": 5, "mod_equipment": 5 } - } + }, + "minReserveRaiderSpawnChance": 72 } diff --git a/project/src/models/spt/config/ILocationConfig.ts b/project/src/models/spt/config/ILocationConfig.ts index a43055c0..26a08684 100644 --- a/project/src/models/spt/config/ILocationConfig.ts +++ b/project/src/models/spt/config/ILocationConfig.ts @@ -43,6 +43,8 @@ export interface ILocationConfig extends IBaseConfig { scavRaidTimeSettings: IScavRaidTimeSettings; /** Settings to adjust mods for lootable equipment in raid */ equipmentLootSettings: IEquipmentLootSettings; + /** min percentage to set raider spawns at, -1 makes no changes */ + minReserveRaiderSpawnChance: number; } export interface IEquipmentLootSettings { diff --git a/project/src/services/PostDbLoadService.ts b/project/src/services/PostDbLoadService.ts index c30a3ce3..7f1fe24e 100644 --- a/project/src/services/PostDbLoadService.ts +++ b/project/src/services/PostDbLoadService.ts @@ -58,6 +58,8 @@ export class PostDbLoadService { this.addCustomLooseLootPositions(); + this.adjustMinReserveRaiderSpawnChance(); + if (this.coreConfig.fixes.fixShotgunDispersion) { this.fixShotgunDispersions(); } @@ -107,6 +109,19 @@ export class PostDbLoadService { } } + protected adjustMinReserveRaiderSpawnChance(): void { + if (this.locationConfig.minReserveRaiderSpawnChance === -1) { + return; + } + + const reserveBase = this.databaseService.getLocation("rezervbase").base; + for (const raiderSpawn of reserveBase.BossLocationSpawn.filter((x) => x.BossName === "pmcBot")) { + if (raiderSpawn.BossChance < this.locationConfig.minReserveRaiderSpawnChance) { + raiderSpawn.BossChance = this.locationConfig.minReserveRaiderSpawnChance; + } + } + } + protected addCustomLooseLootPositions(): void { const looseLootPositionsToAdd = this.lootConfig.looseLoot; for (const [mapId, positionsToAdd] of Object.entries(looseLootPositionsToAdd)) {