diff --git a/src/mod.ts b/src/mod.ts index 1d29ee3..b9cfb92 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -4,14 +4,12 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { ConfigServer } from "@spt-aki/servers/ConfigServer"; import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes"; import { IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; -import { ILogger } from "@spt-aki/models/spt/utils/ILogger"; import { Scavs } from "./scavs"; import { PMCs } from "./pmc"; class ValensProgression implements IPostDBLoadMod { - private logger: ILogger; private configServer: ConfigServer; private botConfig: IBotConfig; private databaseServer: DatabaseServer; @@ -32,121 +30,6 @@ class ValensProgression implements IPostDBLoadMod this.pmcs = new PMCs(this.botConfig, this.databaseServer); this.pmcs.updatePmcs(); } - - /*public preAkiLoad(container: DependencyContainer): void - { - // We will save a reference to the dependency container to resolve dependencies - // that we may need down the line - ValensProgression.container = container; - - // Wait until WatermarkLocale gets resolved by the server and run code afterwards to replace - // the getDescription() function with the one below called 'replacementFunction() - container.afterResolution("BotGenerator", (_t, result: BotGenerator) => - { - // We want to replace the original method logic with something different - result.generateDogtag = (bot: IBotBase) => - { - // We are calling a replacement function, technically you could also do: - // result.login = this.replacementFunction; - return this.generateDogtags(bot); - } - // The modifier Always makes sure this replacement method is ALWAYS replaced - }, {frequency: "Always"}); - } - - public generateDogtags(bot: IBotBase) - { - const profile = this.profileController.getCompleteProfile(sessionId); - const playerLevel = this.playerService.calculateLevel(profile[0]); // find(x=>x._id === sessionId) - const usecLvl = this.databaseServer.getTables().bots["usec"].experience.level; - const bearLvl = this.databaseServer.getTables().bots["bear"].experience.level; - - if (playerLevel >= 1 && playerLevel <= 15) - { - this.generateDogtagLL1(usecLvl, bearLvl); - } - - if (playerLevel >= 16 && playerLevel <= 25) - { - this.generateDogtagLL2(usecLvl, bearLvl); - } - - if (playerLevel >= 26 && playerLevel <= 36) - { - this.generateDogtagLL3(usecLvl, bearLvl); - } - - if (playerLevel >= 37) - { - this.generateDogtagLL4(usecLvl, bearLvl); - } - - const upd: Upd = { - SpawnedInSession: true, - Dogtag: { - AccountId: bot.aid, - ProfileId: bot._id, - Nickname: bot.Info.Nickname, - Side: bot.Info.Side, - Level: bot.Info.Level, - Time: (new Date().toISOString()), - Status: "Killed by ", - KillerAccountId: "Unknown", - KillerProfileId: "Unknown", - KillerName: "Unknown", - WeaponName: "Unknown" - } - } - - const inventoryItem: Item = { - _id: this.hashUtil.generate(), - _tpl: ((bot.Info.Side === "Usec") ? BaseClasses.DOG_TAG_USEC : BaseClasses.DOG_TAG_BEAR), - parentId: bot.Inventory.equipment, - slotId: "Dogtag", - location: undefined, - upd: upd - } - - bot.Inventory.items.push(inventoryItem); - - return bot; - } - - private generateDogtagLL1(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void - { - usecLvl.max = 15; - usecLvl.min = 1; - - bearLvl.max = 15; - bearLvl.min = 1; - } - - private generateDogtagLL2(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void - { - usecLvl.max = 25; - usecLvl.min = 16; - - bearLvl.max = 25; - bearLvl.min = 16; - } - - private generateDogtagLL3(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void - { - usecLvl.max = 36; - usecLvl.min = 26; - - bearLvl.max = 36; - bearLvl.min = 26; - } - - private generateDogtagLL4(usecLvl: {max: number; min: number;}, bearLvl: {max: number; min: number;}): void - { - usecLvl.max = 70; - usecLvl.min = 37; - - bearLvl.max = 70; - bearLvl.min = 37; - }*/ } module.exports = { mod: new ValensProgression() } \ No newline at end of file diff --git a/src/pmc.ts b/src/pmc.ts index 55b9b6a..74e2a0d 100644 --- a/src/pmc.ts +++ b/src/pmc.ts @@ -1,6 +1,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { IDatabaseTables } from "@spt-aki/models/spt/server/IDatabaseTables"; -import { EquipmentFilterDetails, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; +import { EquipmentFilterDetails, EquipmentFilters, IBotConfig } from "@spt-aki/models/spt/config/IBotConfig"; export class PMCs { @@ -195,14 +195,23 @@ export class PMCs const ammo23x75ArrayLL3 = ["5e85a9a6eacf8c039e4e2ac1", "5f647f31b6238e5dd066e196"]; - const progressionWhitelistLL1PMC: EquipmentFilterDetails = + const progressionWhitelistLL1PMC: EquipmentFilters = { - "levelRange": + "weaponModLimits": {}, + "weaponSightWhitelist": {}, + "nvgIsActiveChancePercent": 5, + "faceShieldIsActiveChancePercent": 85, + "lightLaserIsActiveChancePercent": 75, + "randomisation": [], + "blacklist": [], + "weightingAdjustments": [], + "whitelist": [{ + "levelRange": { "min": 1, "max": 15 }, - "equipment": + "equipment": { "FirstPrimaryWeapon": [...primaryWeaponArrayLL1], "Holster": [...holsterArrayLL1], @@ -215,7 +224,7 @@ export class PMCs "ArmBand": [...armBandArrayLL1], "FaceCover": [...faceCoverArrayLL1] }, - "cartridge": + "cartridge": { "Caliber762x54R": [...ammo762x54ArrayLL1], "Caliber762x51": [...ammo762x51ArrayLL1], @@ -230,7 +239,8 @@ export class PMCs "Caliber9x18PM": [...ammo9x18ArrayLL1], "Caliber12g": [...ammo12x70ArrayLL1], "Caliber20g": [...ammo20x70ArrayLL1] - } + }}], + "clothing": [] } const progressionWhitelistLL2PMC: EquipmentFilterDetails = @@ -323,7 +333,7 @@ export class PMCs } const pmc = this.botConfig.equipment.pmc.whitelist; - pmc.push(progressionWhitelistLL1PMC); + this.botConfig.equipment.pmc = progressionWhitelistLL1PMC; pmc.push(progressionWhitelistLL2PMC); pmc.push(progressionWhitelistLL3PMC); } diff --git a/src/scavs.ts b/src/scavs.ts index 81cc881..42bfe0c 100644 --- a/src/scavs.ts +++ b/src/scavs.ts @@ -90,18 +90,14 @@ export class Scavs // Scav Whitelist const progressionWhitelistScav1: EquipmentFilters = { + "weaponModLimits": {}, + "weaponSightWhitelist": {}, + "nvgIsActiveChancePercent": 5, "faceShieldIsActiveChancePercent": 85, "lightLaserIsActiveChancePercent": 75, - "weightingAdjustments": [], - "weaponModLimits": { - "scopeLimit": 1, - "lightLaserLimit": 1 - }, - "weaponSightWhitelist": {}, - "nvgIsActiveChancePercent": 50, - "clothing": [], "randomisation": [], "blacklist": [], + "weightingAdjustments": [], "whitelist": [{ "levelRange": { @@ -136,7 +132,8 @@ export class Scavs "Caliber12g": [...ammo12x70ArrayScav], "Caliber20g": [...ammo20x70ArrayScav] } - }] + }], + "clothing": [] } const progressionWhitelistScav2: EquipmentFilterDetails =