From 596292c332050566f890c6b34de6b54eb13b5141 Mon Sep 17 00:00:00 2001 From: Valens Date: Fri, 17 Feb 2023 14:06:16 -0500 Subject: [PATCH] Valens Progression v1.3.2 Compatible with AKI 3.5.* * Hotfix for PMCs not generating with proper equipment. --- package.json | 2 +- src/mod.ts | 13 +++++--- src/pmc.ts | 91 +++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 81 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 0918dc8..6e4ab90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Valens-Progression", - "version": "1.3.0", + "version": "1.3.2", "main": "src/mod.js", "license": "CC BY-NC-ND 4.0", "author": "Valens", diff --git a/src/mod.ts b/src/mod.ts index 0508e76..df01a1c 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -1,16 +1,18 @@ -import { DependencyContainer } from "tsyringe"; -import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod"; -import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; -import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; +import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; +import { ConfigServer } from "@spt-aki/servers/ConfigServer"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { DependencyContainer } from "tsyringe"; //import { Scavs } from "./scavs"; +import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; import { PMCs } from "./pmc"; class ValensProgression implements IPostDBLoadMod { private configServer: ConfigServer; + private locationConfig: ILocationConfig private botConfig: IBotConfig; private databaseServer: DatabaseServer; // private scavs: Scavs; @@ -20,6 +22,7 @@ class ValensProgression implements IPostDBLoadMod { // get database from server this.configServer = container.resolve("ConfigServer"); + this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION); this.botConfig = this.configServer.getConfig(ConfigTypes.BOT); this.databaseServer = container.resolve("DatabaseServer"); @@ -27,7 +30,7 @@ class ValensProgression implements IPostDBLoadMod // this.scavs = new Scavs(this.botConfig, this.databaseServer); // this.scavs.updateScavs(); - this.pmcs = new PMCs(this.botConfig, this.databaseServer); + this.pmcs = new PMCs(this.locationConfig, this.botConfig, this.databaseServer); this.pmcs.updatePmcs(); } } diff --git a/src/pmc.ts b/src/pmc.ts index 374a3c0..e9d8658 100644 --- a/src/pmc.ts +++ b/src/pmc.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; +import { ILocationConfig } from "@spt-aki/models/spt/config/ILocationConfig"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; @@ -7,11 +8,13 @@ export class PMCs { private botConfig: IBotConfig; private databaseServer: IDatabaseTables; + private locationConfig: ILocationConfig; - constructor (botConfig: IBotConfig, databaseServer: DatabaseServer) + constructor (locationConfig: ILocationConfig, botConfig: IBotConfig, databaseServer: DatabaseServer) { this.botConfig = botConfig; + this.locationConfig = locationConfig; this.databaseServer = databaseServer.getTables(); } @@ -23,6 +26,56 @@ export class PMCs private generatePmcs() { + // Reduce Custom PMC Boss Chances + const pmcBoss = this.locationConfig.customWaves; + pmcBoss.boss.factory4_day = [{ + "sptId": "sptBearFactoryDayBossSpawn", + "BossName": "sptBear", + "BossChance": 25, + "BossZone": "BotZone", + "BossPlayer": false, + "BossDifficult": "normal", + "BossEscortType": "sptBear", + "BossEscortDifficult": "normal", + "BossEscortAmount": "1", + "Time": -1, + "Supports": [{ + "BossEscortType": "sptBear", + "BossEscortDifficult": [ + "normal" + ], + "BossEscortAmount": "1" + } + ], + "RandomTimeSpawn": false, + "TriggerId": "", + "TriggerName": "" + }, { + "sptId": "sptUsecFactoryDayBossSpawn", + "BossName": "sptUsec", + "BossChance": 25, + "BossZone": "BotZone", + "BossPlayer": false, + "BossDifficult": "normal", + "BossEscortType": "sptUsec", + "BossEscortDifficult": "normal", + "BossEscortAmount": "1", + "Time": -1, + "Supports": [{ + "BossEscortType": "sptUsec", + "BossEscortDifficult": [ + "normal" + ], + "BossEscortAmount": "1" + } + ], + "RandomTimeSpawn": false, + "TriggerId": "", + "TriggerName": "" + } + ]; + + // Gear Arrays // Primary Weapon Array const primaryWeaponArrayLL1 = ["5926bb2186f7744b1c6c6e60", "574d967124597745970e7c94", "57dc2fa62459775949412633", "57f3c6bd24597738e730fa2f", "5839a40f24597726f856b511", "57d14d2524597714373db789", "57f4c844245977379d5c14d1", "59984ab886f7743e98271174", "5ea03f7400685063ec28bfa8", "5a7828548dc32e5a9c28b516", "5bfd297f0db834001a669119", "59d6088586f774275f37482f", "583990e32459771419544dd2", "59e6152586f77473dc057aa1", "5c07c60e0db834002330051f", "5a38e6bac4a2826c6e06d79b", "56dee2bdd2720bc8328b4567", "5447a9cd4bdc2dbd208b4567", "5d2f0d8048f0356c925bc3b0", "5d2f0d8048f0356c925bc3b0", "5fc3e272f8b6a877a729eac5", "58948c8e86f77409493f7266", "59e6687d86f77411d949b251", "54491c4f4bdc2db1078b4568", "5ba26383d4351e00334c93d9", "587e02ff24597743df3deaeb", "5c501a4d2e221602b412b540", "60db29ce99594040e04c4a27", "5580223e4bdc2d1c128b457f", "61f7c9e189e6fb1a5e3ea78d", "5e870397991fd70db46995c8", "5de652c31b7e3716273428be"]; @@ -223,8 +276,8 @@ export class PMCs "5f9949d869e2777a0e779ba5": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.ArmBand; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.ArmBand; + this.databaseServer.bots.types.usec.inventory.equipment.ArmBand = pmcEquipment.ArmBand; + this.databaseServer.bots.types.bear.inventory.equipment.ArmBand = pmcEquipment.ArmBand; // PMC Armor Vest Weighting @@ -274,8 +327,8 @@ export class PMCs "5df8a4d786f77412672a1e3b": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.Backpack; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.Backpack; + this.databaseServer.bots.types.usec.inventory.equipment.Backpack = pmcEquipment.Backpack; + this.databaseServer.bots.types.bear.inventory.equipment.Backpack = pmcEquipment.Backpack; // PMC Earpiece Weighting @@ -288,8 +341,8 @@ export class PMCs "5a16b9fffcdbcb0176308b34": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.Earpiece; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.Earpiece; + this.databaseServer.bots.types.usec.inventory.equipment.Earpiece = pmcEquipment.Earpiece; + this.databaseServer.bots.types.bear.inventory.equipment.Earpiece = pmcEquipment.Earpiece; // PMC Eyewear Weighting @@ -304,8 +357,8 @@ export class PMCs "5c0d32fcd174af02a1659c75": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.Eyewear; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.Eyewear; + this.databaseServer.bots.types.usec.inventory.equipment.Eyewear = pmcEquipment.Eyewear; + this.databaseServer.bots.types.bear.inventory.equipment.Eyewear = pmcEquipment.Eyewear; // PMC FaceCover Weighting @@ -318,8 +371,8 @@ export class PMCs "5b432f3d5acfc4704b4a1dfb": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.FaceCover; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.FaceCover; + this.databaseServer.bots.types.usec.inventory.equipment.FaceCover = pmcEquipment.FaceCover; + this.databaseServer.bots.types.bear.inventory.equipment.FaceCover = pmcEquipment.FaceCover; // PMC FirstPrimaryWeapon Weighting @@ -397,8 +450,8 @@ export class PMCs "5df24cf80dee1b22f862e9bc": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.FirstPrimaryWeapon; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.FirstPrimaryWeapon; + this.databaseServer.bots.types.usec.inventory.equipment.FirstPrimaryWeapon = pmcEquipment.FirstPrimaryWeapon; + this.databaseServer.bots.types.bear.inventory.equipment.FirstPrimaryWeapon = pmcEquipment.FirstPrimaryWeapon; // PMC Headwear Weighting @@ -422,8 +475,8 @@ export class PMCs "5d6d3716a4b9361bc8618872": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.Headwear; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.Headwear; + this.databaseServer.bots.types.usec.inventory.equipment.Headwear = pmcEquipment.Headwear; + this.databaseServer.bots.types.bear.inventory.equipment.Headwear = pmcEquipment.Headwear; // PMC Holster Weighting @@ -449,8 +502,8 @@ export class PMCs "633ec7c2a6918cb895019c6c": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.Holster; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.Holster; + this.databaseServer.bots.types.usec.inventory.equipment.Holster = pmcEquipment.Holster; + this.databaseServer.bots.types.bear.inventory.equipment.Holster = pmcEquipment.Holster; // PMC Tactical Vest Weighting @@ -487,8 +540,8 @@ export class PMCs "5df8a42886f77412640e2e75": 1 }; - this.databaseServer.bots.types.usec.inventory.equipment.ArmorVest = pmcEquipment.TacticalVest; - this.databaseServer.bots.types.bear.inventory.equipment.ArmorVest = pmcEquipment.TacticalVest; + this.databaseServer.bots.types.usec.inventory.equipment.TacticalVest = pmcEquipment.TacticalVest; + this.databaseServer.bots.types.bear.inventory.equipment.TacticalVest = pmcEquipment.TacticalVest;