Skip to content

Commit

Permalink
Remove Existing PMC waves on server start, disabled via config
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomp committed Feb 16, 2025
1 parent c5246d1 commit 2a54cbe
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
3 changes: 2 additions & 1 deletion project/assets/configs/pmc.json
Original file line number Diff line number Diff line change
Expand Up @@ -864,5 +864,6 @@
"max": 100
}
},
"addSecureContainerLootFromBotConfig": false
"addSecureContainerLootFromBotConfig": false,
"removeExistingPmcWaves": true
}
5 changes: 4 additions & 1 deletion project/src/models/spt/config/IPmcConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MinMax } from "@spt/models/common/MinMax";
import { IChancedEnemy } from "@spt/models/eft/common/ILocationBase";
import { IBossLocationSpawn, IChancedEnemy } from "@spt/models/eft/common/ILocationBase";
import { MemberCategory } from "@spt/models/enums/MemberCategory";
import { IBaseConfig } from "@spt/models/spt/config/IBaseConfig";

Expand Down Expand Up @@ -49,6 +49,9 @@ export interface IPmcConfig extends IBaseConfig {
locationSpecificPmcLevelOverride: Record<string, MinMax>;
/** Should secure container loot from usec.json/bear.json be added to pmc bots secure */
addSecureContainerLootFromBotConfig: boolean;
/** key = mapid */
removeExistingPmcWaves: boolean;
customPmcWaves: Record<string, IBossLocationSpawn[]>;
}

export interface IHostilitySettings {
Expand Down
20 changes: 19 additions & 1 deletion project/src/services/PostDbLoadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ export class PostDbLoadService {
this.openZoneService.applyZoneChangesToAllMaps();
}

if (this.pmcConfig.removeExistingPmcWaves) {
this.removeExistingPmcWaves();
}

if (this.locationConfig.addCustomBotWavesToMaps) {
this.customLocationWaveService.applyWaveChangesToAllMaps();
//this.customLocationWaveService.applyWaveChangesToAllMaps();
}

if (this.locationConfig.enableBotTypeLimits) {
Expand Down Expand Up @@ -134,6 +138,20 @@ export class PostDbLoadService {
this.addCustomItemPresetsToGlobals();
}

protected removeExistingPmcWaves() {
const locations: ILocation[] = Object.values(this.databaseService.getLocations());

for (const location of locations) {
if (!location || !location?.base?.BossLocationSpawn) {
continue;
}

location.base.BossLocationSpawn = location.base.BossLocationSpawn.filter(
(x) => !["pmcUSEC", "pmcBEAR"].includes(x.BossName),
);
}
}

protected removeNewBeginningRequirementFromPrestige() {
const newBeginningQuestIds = ["6761f28a022f60bb320f3e95", "6761ff17cdc36bd66102e9d0"];
const prestigeDb = this.databaseService.getTemplates().prestige;
Expand Down

0 comments on commit 2a54cbe

Please sign in to comment.