Added minReserveRaiderSpawnChance to location.json config, set to 72 by default, wired up to adjust reserve values on server start

This commit is contained in:
Dev 2024-10-28 16:02:47 +00:00
parent 37d2fa63aa
commit 7964d8ef5a
3 changed files with 19 additions and 1 deletions

View File

@ -537,5 +537,6 @@
"mod_mount": 5,
"mod_equipment": 5
}
}
},
"minReserveRaiderSpawnChance": 72
}

View File

@ -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 {

View File

@ -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)) {