diff --git a/project/assets/configs/location.json b/project/assets/configs/location.json index 8f22f8d6..bfbd54a3 100644 --- a/project/assets/configs/location.json +++ b/project/assets/configs/location.json @@ -539,5 +539,11 @@ "nonTriggered": 80, "triggered": 90 }, + "tplsToStripChildItemsFrom": [ + "63a8970d7108f713591149f5", + "63a897c6b1ff6e29734fcc95", + "63a898a328e385334e0640a5", + "634959225289190e5e773b3b" + ], "nonMaps": ["base", "develop", "hideout", "privatearea", "suburbs", "terminal", "town"] } diff --git a/project/src/generators/LocationLootGenerator.ts b/project/src/generators/LocationLootGenerator.ts index 42b0562a..2338eea8 100644 --- a/project/src/generators/LocationLootGenerator.ts +++ b/project/src/generators/LocationLootGenerator.ts @@ -429,7 +429,10 @@ export class LocationLootGenerator { const tplsToAddToContainer = tplsForced.concat(chosenTpls); for (const tplToAdd of tplsToAddToContainer) { const chosenItemWithChildren = this.createStaticLootItem(tplToAdd, staticAmmoDist, parentId); - const items = chosenItemWithChildren.items; + + const items = this.locationConfig.tplsToStripChildItemsFrom.includes(tplToAdd) + ? [chosenItemWithChildren.items[0]] // Strip children from parent + : chosenItemWithChildren.items; const width = chosenItemWithChildren.width; const height = chosenItemWithChildren.height; @@ -918,6 +921,11 @@ export class LocationLootGenerator { // Ensure all IDs are unique itemWithChildren = this.itemHelper.replaceIDs(itemWithChildren); + if (this.locationConfig.tplsToStripChildItemsFrom.includes(chosenItem._tpl)) { + // Strip children from parent before adding + itemWithChildren = [itemWithChildren[0]]; + } + itemWithMods.push(...itemWithChildren); } diff --git a/project/src/models/spt/config/ILocationConfig.ts b/project/src/models/spt/config/ILocationConfig.ts index efbe15f0..cc7b44e8 100644 --- a/project/src/models/spt/config/ILocationConfig.ts +++ b/project/src/models/spt/config/ILocationConfig.ts @@ -45,6 +45,8 @@ export interface ILocationConfig extends IBaseConfig { equipmentLootSettings: IEquipmentLootSettings; /** min percentage to set raider spawns at, -1 makes no changes */ reserveRaiderSpawnChanceOverrides: IReserveRaiderSpawnChanceOverrides; + /** Containers to remove all children from when generating static/loose loot */ + tplsToStripChildItemsFrom: string[]; /** Map ids players cannot visit */ nonMaps: string[]; }