Advertisement
EddieShoe

BetterSpawnsPlus

Sep 21st, 2023
572
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "use strict";
  2. /*
  3.  * BetterSpawnsPlus v1.1.5
  4.  * MIT License
  5.  * Copyright (c) 2023 PreyToLive
  6.  */
  7. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  8.     if (k2 === undefined) k2 = k;
  9.     var desc = Object.getOwnPropertyDescriptor(m, k);
  10.     if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  11.       desc = { enumerable: true, get: function() { return m[k]; } };
  12.     }
  13.     Object.defineProperty(o, k2, desc);
  14. }) : (function(o, m, k, k2) {
  15.     if (k2 === undefined) k2 = k;
  16.     o[k2] = m[k];
  17. }));
  18. var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
  19.     Object.defineProperty(o, "default", { enumerable: true, value: v });
  20. }) : function(o, v) {
  21.     o["default"] = v;
  22. });
  23. var __importStar = (this && this.__importStar) || function (mod) {
  24.     if (mod && mod.__esModule) return mod;
  25.     var result = {};
  26.     if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  27.     __setModuleDefault(result, mod);
  28.     return result;
  29. };
  30. var __importDefault = (this && this.__importDefault) || function (mod) {
  31.     return (mod && mod.__esModule) ? mod : { "default": mod };
  32. };
  33. Object.defineProperty(exports, "__esModule", { value: true });
  34. const ConfigTypes_1 = require("C:/snapshot/project/obj/models/enums/ConfigTypes");
  35. const Traders_1 = require("C:/snapshot/project/obj/models/enums/Traders");
  36. const path = __importStar(require("path"));
  37. const fs = __importStar(require("fs"));
  38. const package_json_1 = __importDefault(require("../package.json"));
  39. const presetManager_json_1 = __importDefault(require("../config/presetManager.json"));
  40. const pmcDogTags_json_1 = __importDefault(require("../db/bots/pmcs/pmcDogTags.json"));
  41. class BetterSpawnsPlus {
  42.     constructor() {
  43.         this.configFileToUseInGame = presetManager_json_1.default.configFileToUseInGame;
  44.         this.globalOverrides = presetManager_json_1.default.globalOverrides;
  45.         this.config = require(`../config/presets/${this.configFileToUseInGame}.json`);
  46.         this.logSuccess = "green";
  47.         this.logInfo = "cyan";
  48.         this.logDisable = "gray";
  49.         this.logWarning = "yellow";
  50.         this.logError = "red";
  51.         this.openZones = {
  52.             "bigmap": "ZoneBlockPost,ZoneBlockPostSniper,ZoneBlockPostSniper3,ZoneBrige,ZoneCrossRoad,ZoneCustoms,ZoneDormitory,ZoneFactoryCenter,ZoneFactorySide,ZoneGasStation,ZoneOldAZS,ZoneScavBase,ZoneSnipeBrige,ZoneSnipeFactory,ZoneSnipeTower,ZoneTankSquare,ZoneWade",
  53.             "interchange": "ZoneCenter,ZoneCenterBot,ZoneGoshan,ZoneIDEA,ZoneIDEAPark,ZoneOLI,ZoneOLIPark,ZonePowerStation,ZoneRoad,ZoneTrucks",
  54.             "laboratory": "BotZoneBasement,BotZoneFloor1,BotZoneFloor2,BotZoneGate1,BotZoneGate2",
  55.             "lighthouse": "Zone_Blockpost,Zone_Bridge,Zone_Chalet,Zone_Containers,Zone_DestroyedHouse,Zone_Hellicopter,Zone_Island,Zone_LongRoad,Zone_OldHouse,Zone_Rocks,Zone_RoofBeach,Zone_RoofContainers,Zone_RoofRocks,Zone_SniperPeak,Zone_TreatmentBeach,Zone_TreatmentContainers,Zone_TreatmentRocks,Zone_Village",
  56.             "rezervbase": "ZoneBarrack,ZoneBunkerStorage,ZonePTOR1,ZonePTOR2,ZoneRailStrorage,ZoneSubCommand,ZoneSubStorage",
  57.             "shoreline": "ZoneBunker,ZoneBunkeSniper,ZoneBusStation,ZoneForestGasStation,ZoneForestSpawn,ZoneForestTruck,ZoneGasStation,ZoneGreenHouses,ZoneIsland,ZoneMeteoStation,ZonePassClose,ZonePassFar,ZonePort,ZonePowerStation,ZonePowerStationSniper,ZoneRailWays,ZoneSanatorium1,ZoneSanatorium2,ZoneTunnel,ZoneStartVillage",
  58.             "tarkovstreets": "ZoneCarShowroom,ZoneCinema,ZoneColumn,ZoneConcordia_1,ZoneConcordia_2,ZoneConcordiaParking,ZoneConstruction,ZoneFactory,ZoneHotel_1,ZoneHotel_2,ZoneSnipeBuilding,ZoneSnipeCarShowroom,ZoneSnipeCinema,ZoneSnipeSW01,ZoneSW01",
  59.             "woods": "ZoneBigRocks,ZoneBrokenVill,ZoneClearVill,ZoneHighRocks,ZoneHouse,ZoneMiniHouse,ZoneRedHouse,ZoneRoad,ZoneScavBase2,ZoneWoodCutter"
  60.         };
  61.         this.altLocationArray = ["bigmap", "factory4_day", "factory4_night", "interchange", "laboratory", "lighthouse", "rezervbase", "shoreline", "tarkovstreets", "woods"];
  62.         this.locationArray = ["customs", "factory", "interchange", "labs", "lighthouse", "reserve", "shoreline", "streets", "woods"];
  63.         this.brainTypeArray = ["bossKilla", "bossKnight", "bossGluhar", "bossSanitar", "bossTagilla", "followerGluharAssault", "followerBully", "followerBigPipe", "followerSanitar", "assault", "cursedAssault", "exUsec", "arenaFighter", "arenaFighterEvent", "crazyAssaultEvent", "pmcBot"];
  64.         this.bossTypeArray = ["bossBully", "bossKilla", "bossKojaniy", "bossGluhar", "bossSanitar", "bossTagilla", "bossKnight", "bossZryachiy"];
  65.         this.enemyTypeArray = ["assault", "cursedassault", "pmcbot", "exusec", "arenafighter", "arenafighterevent", "crazyassaultevent"];
  66.         this.botDifficultyArray = ["easy", "normal", "hard", "impossible"];
  67.         this.pmcTypeArray = ["bear", "usec"];
  68.         this.idArray = [];
  69.     }
  70.     preAkiLoad(container) {
  71.         this.logger = container.resolve("WinstonLogger");
  72.         this.databaseServer = container.resolve("DatabaseServer");
  73.         const staticRouterModService = container.resolve("StaticRouterModService");
  74.         function generateRandomInteger(min, max) {
  75.             min = Math.ceil(min);
  76.             max = Math.floor(max);
  77.             return Math.floor(Math.random() * (max - min + 1) + min);
  78.         }
  79.         function generateRandomNumberFromSequence(array) {
  80.             let random = array[Math.floor(Math.random() * array.length)];
  81.             if (random > 0) {
  82.                 random = random - 1;
  83.             }
  84.             else {
  85.                 random = 0;
  86.             }
  87.             return random.toString();
  88.         }
  89.         function generateWeightArray(object) {
  90.             const array = [];
  91.             for (let [key, value] of Object.entries(object)) {
  92.                 if (value > 5) {
  93.                     value = 5;
  94.                 }
  95.                 if (value == 1) {
  96.                     array.push(key);
  97.                 }
  98.                 else if (value == 2) {
  99.                     array.push(key);
  100.                     array.push(key);
  101.                 }
  102.                 else if (value == 3) {
  103.                     array.push(key);
  104.                     array.push(key);
  105.                     array.push(key);
  106.                 }
  107.                 else if (value == 4) {
  108.                     array.push(key);
  109.                     array.push(key);
  110.                     array.push(key);
  111.                     array.push(key);
  112.                 }
  113.                 else if (value == 5) {
  114.                     array.push(key);
  115.                     array.push(key);
  116.                     array.push(key);
  117.                     array.push(key);
  118.                     array.push(key);
  119.                 }
  120.             }
  121.             return array;
  122.         }
  123.         function removeElementFromWeightArray(array) {
  124.             const element = (Math.random() * array.length) | 0;
  125.             return array.splice(element, 1)[0];
  126.         }
  127.         function checkProperties(object) {
  128.             let count = 0;
  129.             for (const key in object) {
  130.                 if (object[key] == 0) {
  131.                     count++;
  132.                 }
  133.             }
  134.             if (count == Object.keys(object).length) {
  135.                 return false;
  136.             }
  137.             else {
  138.                 return true;
  139.             }
  140.         }
  141.         staticRouterModService.registerStaticRouter("BetterSpawnsPlus", [
  142.             {
  143.                 url: "/client/items",
  144.                 action: (url, info, sessionID, output) => {
  145.                     try {
  146.                         Object.keys(require.cache).forEach(function (key) {
  147.                             delete require.cache[key];
  148.                         });
  149.                         this.config = require(`../config/presets/${this.configFileToUseInGame}.json`);
  150.                         const otherOptions = this.config.otherOptions;
  151.                         const databaseLocations = this.databaseServer.getTables().locations;
  152.                         const configsAirdrops = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.AIRDROP);
  153.                         const configsBots = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.BOT);
  154.                         const configsPmc = container.resolve("ConfigServer").getConfig("aki-pmc"); //no ENUM for PMC exists yet
  155.                         const configsInraids = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.IN_RAID);
  156.                         const configsLocations = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.LOCATION);
  157.                         // other options
  158.                         if (otherOptions.enabled) {
  159.                             if (otherOptions.consoleLogs) {
  160.                                 this.logger.log(`Mod: ${package_json_1.default.name}: continuing...`, this.logSuccess);
  161.                                 this.logger.log("> [other options]: logs", this.logInfo);
  162.                             }
  163.                             // bots
  164.                             if (otherOptions.bots.enabled) {
  165.                                 if (otherOptions.consoleLogs) {
  166.                                     this.logger.log(" > [bots]", this.logInfo);
  167.                                 }
  168.                                 // pmc brain type
  169.                                 if (otherOptions.bots.pmc.brainType.enabled) {
  170.                                     // randomize brain type
  171.                                     if (otherOptions.bots.pmc.brainType.randomize) {
  172.                                         for (const brainType of this.brainTypeArray) {
  173.                                             otherOptions.bots.pmc.brainType.bear[brainType] = generateRandomInteger(1, 5);
  174.                                             otherOptions.bots.pmc.brainType.usec[brainType] = generateRandomInteger(1, 5);
  175.                                         }
  176.                                     }
  177.                                     for (const altLocation of this.altLocationArray) {
  178.                                         configsBots.pmc.pmcType.sptbear[altLocation] = otherOptions.bots.pmc.brainType.bear;
  179.                                         configsBots.pmc.pmcType.sptusec[altLocation] = otherOptions.bots.pmc.brainType.usec;
  180.                                     }
  181.                                     if (otherOptions.consoleLogs) {
  182.                                         this.logger.log("  > pmc:", this.logInfo);
  183.                                         this.logger.log(`   > bear brain type: ${JSON.stringify(otherOptions.bots.pmc.brainType.bear, null, 6)}`, this.logInfo);
  184.                                         this.logger.log(`   > usec brain type: ${JSON.stringify(otherOptions.bots.pmc.brainType.usec, null, 6)}`, this.logInfo);
  185.                                     }
  186.                                 }
  187.                             }
  188.                             // max bots cap
  189.                             if (otherOptions.maxBotCap.enabled) {
  190.                                 if (otherOptions.consoleLogs) {
  191.                                     this.logger.log(" > [max bot cap]", this.logInfo);
  192.                                 }
  193.                                 for (const location of this.locationArray) {
  194.                                     const randomBotCap = generateRandomInteger(otherOptions.maxBotCap[location].min, otherOptions.maxBotCap[location].max);
  195.                                     switch (location) {
  196.                                         case "customs":
  197.                                             configsBots.maxBotCap.bigmap = randomBotCap;
  198.                                             break;
  199.                                         case "factory":
  200.                                             configsBots.maxBotCap.factory4_day = randomBotCap;
  201.                                             configsBots.maxBotCap.factory4_night = randomBotCap;
  202.                                             break;
  203.                                         case "interchange":
  204.                                         case "lighthouse":
  205.                                         case "shoreline":
  206.                                         case "woods":
  207.                                             configsBots.maxBotCap[location] = randomBotCap;
  208.                                             break;
  209.                                         case "labs":
  210.                                             configsBots.maxBotCap.laboratory = randomBotCap;
  211.                                             break;
  212.                                         case "reserve":
  213.                                             configsBots.maxBotCap.rezervbase = randomBotCap;
  214.                                             break;
  215.                                         case "streets":
  216.                                             configsBots.maxBotCap.tarkovstreets = randomBotCap;
  217.                                             break;
  218.                                     }
  219.                                     if (otherOptions.consoleLogs) {
  220.                                         this.logger.log(`  > ${location}: ${randomBotCap}`, this.logInfo);
  221.                                     }
  222.                                 }
  223.                             }
  224.                             // raid timer
  225.                             if (otherOptions.raidTimer.enabled) {
  226.                                 if (otherOptions.consoleLogs) {
  227.                                     this.logger.log(" > [raid timer]", this.logInfo);
  228.                                 }
  229.                                 for (const location of this.locationArray) {
  230.                                     const randomRaidTimer = generateRandomInteger(otherOptions.raidTimer[location].min, otherOptions.raidTimer[location].max);
  231.                                     if (location == "customs") {
  232.                                         databaseLocations.bigmap.base.exit_access_time = randomRaidTimer + 20;
  233.                                         databaseLocations.bigmap.base.EscapeTimeLimit = randomRaidTimer;
  234.                                         if (otherOptions.maxBotCap.enabled) {
  235.                                             databaseLocations.bigmap.base.AirdropParameters["PlaneAirdropEnd"] = randomRaidTimer * 60 * 0.75;
  236.                                         }
  237.                                         if (otherOptions.consoleLogs) {
  238.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  239.                                         }
  240.                                     }
  241.                                     if (location == "factory") {
  242.                                         databaseLocations.factory4_day.base.exit_access_time = randomRaidTimer + 20;
  243.                                         databaseLocations.factory4_night.base.exit_access_time = randomRaidTimer + 20;
  244.                                         databaseLocations.factory4_day.base.EscapeTimeLimit = randomRaidTimer;
  245.                                         databaseLocations.factory4_night.base.EscapeTimeLimit = randomRaidTimer;
  246.                                         if (otherOptions.consoleLogs) {
  247.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  248.                                         }
  249.                                     }
  250.                                     if (location == "interchange") {
  251.                                         databaseLocations.interchange.base.exit_access_time = randomRaidTimer + 20;
  252.                                         databaseLocations.interchange.base.EscapeTimeLimit = randomRaidTimer;
  253.                                         if (otherOptions.consoleLogs) {
  254.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  255.                                         }
  256.                                     }
  257.                                     if (location == "labs") {
  258.                                         databaseLocations.laboratory.base.exit_access_time = randomRaidTimer + 20;
  259.                                         databaseLocations.laboratory.base.EscapeTimeLimit = randomRaidTimer;
  260.                                         if (otherOptions.consoleLogs) {
  261.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  262.                                         }
  263.                                     }
  264.                                     if (location == "lighthouse") {
  265.                                         databaseLocations.lighthouse.base.exit_access_time = randomRaidTimer + 20;
  266.                                         databaseLocations.lighthouse.base.EscapeTimeLimit = randomRaidTimer;
  267.                                         for (const exfil in databaseLocations.lighthouse.base.exits) {
  268.                                             if (databaseLocations.lighthouse.base.exits[exfil].Name == "EXFIL_Train") {
  269.                                                 databaseLocations.lighthouse.base.exits[exfil].MinTime = randomRaidTimer * 60 * 0.5;
  270.                                                 databaseLocations.lighthouse.base.exits[exfil].MaxTime = (randomRaidTimer * 60) - 300;
  271.                                             }
  272.                                         }
  273.                                         if (otherOptions.consoleLogs) {
  274.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  275.                                         }
  276.                                     }
  277.                                     if (location == "reserve") {
  278.                                         databaseLocations.rezervbase.base.exit_access_time = randomRaidTimer + 20;
  279.                                         databaseLocations.rezervbase.base.EscapeTimeLimit = randomRaidTimer;
  280.                                         for (const exfil in databaseLocations.rezervbase.base.exits) {
  281.                                             if (databaseLocations.rezervbase.base.exits[exfil].Name == "EXFIL_Train") {
  282.                                                 databaseLocations.rezervbase.base.exits[exfil].MinTime = randomRaidTimer * 60 * 0.5;
  283.                                                 databaseLocations.rezervbase.base.exits[exfil].MaxTime = (randomRaidTimer * 60) - 300;
  284.                                             }
  285.                                         }
  286.                                         if (otherOptions.consoleLogs) {
  287.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  288.                                         }
  289.                                     }
  290.                                     if (location == "shoreline") {
  291.                                         databaseLocations.shoreline.base.exit_access_time = randomRaidTimer + 20;
  292.                                         databaseLocations.shoreline.base.EscapeTimeLimit = randomRaidTimer;
  293.                                         if (otherOptions.consoleLogs) {
  294.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  295.                                         }
  296.                                     }
  297.                                     if (location == "streets") {
  298.                                         databaseLocations.tarkovstreets.base.exit_access_time = randomRaidTimer + 20;
  299.                                         databaseLocations.tarkovstreets.base.EscapeTimeLimit = randomRaidTimer;
  300.                                         if (otherOptions.consoleLogs) {
  301.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  302.                                         }
  303.                                     }
  304.                                     if (location == "woods") {
  305.                                         databaseLocations.woods.base.exit_access_time = randomRaidTimer + 20;
  306.                                         databaseLocations.woods.base.EscapeTimeLimit = randomRaidTimer;
  307.                                         if (otherOptions.consoleLogs) {
  308.                                             this.logger.log(`  > ${location}: ${randomRaidTimer} minutes`, this.logInfo);
  309.                                         }
  310.                                     }
  311.                                 }
  312.                             }
  313.                             // airdrops
  314.                             if (otherOptions.airdrops.enabled) {
  315.                                 // plane start time
  316.                                 if (otherOptions.airdrops.startTime.min < 0 || otherOptions.airdrops.startTime.min > otherOptions.airdrops.startTime.max) {
  317.                                     otherOptions.airdrops.startTime.min = 0;
  318.                                 }
  319.                                 const randomPlaneStartTime = generateRandomInteger(otherOptions.airdrops.startTime.min, otherOptions.airdrops.startTime.max);
  320.                                 configsAirdrops.airdropMinStartTimeSeconds = randomPlaneStartTime * 60;
  321.                                 configsAirdrops.airdropMaxStartTimeSeconds = randomPlaneStartTime * 60;
  322.                                 // plane speed
  323.                                 if (otherOptions.airdrops.plane.speed.min < 50) {
  324.                                     otherOptions.airdrops.plane.speed.min = 50;
  325.                                 }
  326.                                 if (otherOptions.airdrops.plane.speed.max > 120) {
  327.                                     otherOptions.airdrops.plane.speed.max = 120;
  328.                                 }
  329.                                 if (otherOptions.airdrops.plane.speed.min > otherOptions.airdrops.plane.speed.max) {
  330.                                     otherOptions.airdrops.plane.speed.min = 50;
  331.                                     otherOptions.airdrops.plane.speed.max = 120;
  332.                                 }
  333.                                 const randomPlaneSpeed = generateRandomInteger(otherOptions.airdrops.plane.speed.min, otherOptions.airdrops.plane.speed.max);
  334.                                 configsAirdrops.planeSpeed = randomPlaneSpeed;
  335.                                 // plane height
  336.                                 if (otherOptions.airdrops.plane.height.min < 200) {
  337.                                     otherOptions.airdrops.plane.height.min = 200;
  338.                                 }
  339.                                 if (otherOptions.airdrops.plane.height.max > 600) {
  340.                                     otherOptions.airdrops.plane.height.max = 600;
  341.                                 }
  342.                                 if (otherOptions.airdrops.plane.height.min > otherOptions.airdrops.plane.height.max) {
  343.                                     otherOptions.airdrops.plane.height.min = 200;
  344.                                     otherOptions.airdrops.plane.height.max = 600;
  345.                                 }
  346.                                 const randomPlaneHeight = generateRandomInteger(otherOptions.airdrops.plane.height.min, otherOptions.airdrops.plane.height.max);
  347.                                 configsAirdrops.planeMinFlyHeight = randomPlaneHeight;
  348.                                 configsAirdrops.planeMaxFlyHeight = randomPlaneHeight;
  349.                                 // plane volume
  350.                                 if (otherOptions.airdrops.plane.volume.min < 0 || otherOptions.airdrops.plane.volume.min > otherOptions.airdrops.plane.volume.max) {
  351.                                     otherOptions.airdrops.plane.volume.min = 0;
  352.                                 }
  353.                                 if (otherOptions.airdrops.plane.volume.max > 100) {
  354.                                     otherOptions.airdrops.plane.volume.max = 100;
  355.                                 }
  356.                                 const randomPlaneVolume = generateRandomInteger(otherOptions.airdrops.plane.volume.min, otherOptions.airdrops.plane.volume.max);
  357.                                 configsAirdrops.planeVolume = randomPlaneVolume * 0.01;
  358.                                 // crate speed
  359.                                 if (otherOptions.airdrops.plane.crate.speed.min < 1) {
  360.                                     otherOptions.airdrops.plane.crate.speed.min = 1;
  361.                                 }
  362.                                 if (otherOptions.airdrops.plane.crate.speed.max > 10) {
  363.                                     otherOptions.airdrops.plane.crate.speed.max = 10;
  364.                                 }
  365.                                 if (otherOptions.airdrops.plane.crate.speed.min > otherOptions.airdrops.plane.crate.speed.max) {
  366.                                     otherOptions.airdrops.plane.crate.speed.min = 1;
  367.                                     otherOptions.airdrops.plane.crate.speed.max = 10;
  368.                                 }
  369.                                 const randomCrateSpeed = generateRandomInteger(otherOptions.airdrops.plane.crate.speed.min, otherOptions.airdrops.plane.crate.speed.max);
  370.                                 configsAirdrops.crateFallSpeed = randomCrateSpeed;
  371.                                 // crate item count
  372.                                 if (otherOptions.airdrops.plane.crate.items.min < 0) {
  373.                                     otherOptions.airdrops.plane.crate.items.min = 0;
  374.                                 }
  375.                                 if (otherOptions.airdrops.plane.crate.items.max > 35) {
  376.                                     otherOptions.airdrops.plane.crate.items.max = 35;
  377.                                 }
  378.                                 if (otherOptions.airdrops.plane.crate.items.min > otherOptions.airdrops.plane.crate.items.max) {
  379.                                     otherOptions.airdrops.plane.crate.items.min = 0;
  380.                                     otherOptions.airdrops.plane.crate.items.max = 35;
  381.                                 }
  382.                                 const randomCrateItemCount = generateRandomInteger(otherOptions.airdrops.plane.crate.items.min, otherOptions.airdrops.plane.crate.items.max);
  383.                                 configsAirdrops.loot.mixed.itemCount.min = randomCrateItemCount;
  384.                                 configsAirdrops.loot.mixed.itemCount.max = randomCrateItemCount;
  385.                                 // dynamic planes
  386.                                 if (otherOptions.airdrops.plane.dynamic) {
  387.                                     const planeHeightMaxMin25 = (otherOptions.airdrops.plane.height.min + ((otherOptions.airdrops.plane.height.max - otherOptions.airdrops.plane.height.min) * 0.25));
  388.                                     const planeHeightMaxMin50 = (otherOptions.airdrops.plane.height.min + ((otherOptions.airdrops.plane.height.max - otherOptions.airdrops.plane.height.min) * 0.5));
  389.                                     const planeHeightMaxMin75 = (otherOptions.airdrops.plane.height.min + ((otherOptions.airdrops.plane.height.max - otherOptions.airdrops.plane.height.min) * 0.75));
  390.                                     const planeVolumeMaxMin25 = (otherOptions.airdrops.plane.volume.min + ((otherOptions.airdrops.plane.volume.max - otherOptions.airdrops.plane.volume.min) * 0.25));
  391.                                     const planeVolumeMaxMin50 = (otherOptions.airdrops.plane.volume.min + ((otherOptions.airdrops.plane.volume.max - otherOptions.airdrops.plane.volume.min) * 0.5));
  392.                                     const planeVolumeMaxMin75 = (otherOptions.airdrops.plane.volume.min + ((otherOptions.airdrops.plane.volume.max - otherOptions.airdrops.plane.volume.min) * 0.75));
  393.                                     const planeSpeedMaxMin25 = (otherOptions.airdrops.plane.speed.min + ((otherOptions.airdrops.plane.speed.max - otherOptions.airdrops.plane.speed.min) * 0.25));
  394.                                     const planeSpeedMaxMin50 = (otherOptions.airdrops.plane.speed.min + ((otherOptions.airdrops.plane.speed.max - otherOptions.airdrops.plane.speed.min) * 0.5));
  395.                                     const planeSpeedMaxMin75 = (otherOptions.airdrops.plane.speed.min + ((otherOptions.airdrops.plane.speed.max - otherOptions.airdrops.plane.speed.min) * 0.75));
  396.                                     const planeCrateSpeedMaxMin25 = (otherOptions.airdrops.plane.crate.speed.min + ((otherOptions.airdrops.plane.crate.speed.max - otherOptions.airdrops.plane.crate.speed.min) * 0.25));
  397.                                     const planeCrateSpeedMaxMin50 = (otherOptions.airdrops.plane.crate.speed.min + ((otherOptions.airdrops.plane.crate.speed.max - otherOptions.airdrops.plane.crate.speed.min) * 0.5));
  398.                                     const planeCrateSpeedMaxMin75 = (otherOptions.airdrops.plane.crate.speed.min + ((otherOptions.airdrops.plane.crate.speed.max - otherOptions.airdrops.plane.crate.speed.min) * 0.75));
  399.                                     const planeCrateItemCountMaxMin25 = (otherOptions.airdrops.plane.crate.items.min + ((otherOptions.airdrops.plane.crate.items.max - otherOptions.airdrops.plane.crate.items.min) * 0.25));
  400.                                     const planeCrateItemCountMaxMin50 = (otherOptions.airdrops.plane.crate.items.min + ((otherOptions.airdrops.plane.crate.items.max - otherOptions.airdrops.plane.crate.items.min) * 0.5));
  401.                                     const planeCrateItemCountMaxMin75 = (otherOptions.airdrops.plane.crate.items.min + ((otherOptions.airdrops.plane.crate.items.max - otherOptions.airdrops.plane.crate.items.min) * 0.75));
  402.                                     if (randomPlaneHeight >= otherOptions.airdrops.plane.height.min && randomPlaneHeight <= planeHeightMaxMin25) {
  403.                                         configsAirdrops.planeVolume = Math.round(generateRandomInteger(planeVolumeMaxMin75, otherOptions.airdrops.plane.volume.max)) * 0.01;
  404.                                         configsAirdrops.planeSpeed = Math.round(generateRandomInteger(planeSpeedMaxMin75, otherOptions.airdrops.plane.speed.max));
  405.                                     }
  406.                                     if (randomPlaneHeight > planeHeightMaxMin25 && randomPlaneHeight <= planeHeightMaxMin50) {
  407.                                         configsAirdrops.planeVolume = Math.round(generateRandomInteger(planeVolumeMaxMin50, planeVolumeMaxMin75)) * 0.01;
  408.                                         configsAirdrops.planeSpeed = Math.round(generateRandomInteger(planeSpeedMaxMin50, planeSpeedMaxMin75));
  409.                                     }
  410.                                     if (randomPlaneHeight > planeHeightMaxMin50 && randomPlaneHeight <= planeHeightMaxMin75) {
  411.                                         configsAirdrops.planeVolume = Math.round(generateRandomInteger(planeVolumeMaxMin25, planeVolumeMaxMin50)) * 0.01;
  412.                                         configsAirdrops.planeSpeed = Math.round(generateRandomInteger(planeSpeedMaxMin25, planeSpeedMaxMin50));
  413.                                     }
  414.                                     if (randomPlaneHeight > planeHeightMaxMin75 && randomPlaneHeight <= otherOptions.airdrops.plane.height.max) {
  415.                                         configsAirdrops.planeVolume = Math.round(generateRandomInteger(otherOptions.airdrops.plane.volume.min, planeVolumeMaxMin25)) * 0.01;
  416.                                         configsAirdrops.planeSpeed = Math.round(generateRandomInteger(otherOptions.airdrops.plane.volume.min, planeSpeedMaxMin25));
  417.                                     }
  418.                                     if (randomCrateItemCount >= otherOptions.airdrops.plane.crate.items.min && randomCrateItemCount <= planeCrateItemCountMaxMin25) {
  419.                                         configsAirdrops.crateFallSpeed = Math.round(generateRandomInteger(otherOptions.airdrops.plane.crate.speed.min, planeCrateSpeedMaxMin25));
  420.                                     }
  421.                                     if (randomCrateItemCount > planeCrateItemCountMaxMin25 && randomCrateItemCount <= planeCrateItemCountMaxMin50) {
  422.                                         configsAirdrops.crateFallSpeed = Math.round(generateRandomInteger(planeCrateSpeedMaxMin25, planeCrateSpeedMaxMin50));
  423.                                     }
  424.                                     if (randomCrateItemCount > planeCrateItemCountMaxMin50 && randomCrateItemCount <= planeCrateItemCountMaxMin75) {
  425.                                         configsAirdrops.crateFallSpeed = Math.round(generateRandomInteger(planeCrateSpeedMaxMin50, planeCrateSpeedMaxMin75));
  426.                                     }
  427.                                     if (randomCrateItemCount > planeCrateItemCountMaxMin75 && randomCrateItemCount <= otherOptions.airdrops.plane.crate.items.max) {
  428.                                         configsAirdrops.crateFallSpeed = Math.round(generateRandomInteger(planeCrateSpeedMaxMin75, otherOptions.airdrops.plane.crate.speed.max));
  429.                                     }
  430.                                 }
  431.                                 // airdrop chance
  432.                                 for (const locations in this.locationArray) {
  433.                                     const location = this.locationArray[locations];
  434.                                     if (location == "customs") {
  435.                                         configsAirdrops.airdropChancePercent.bigmap = otherOptions.airdrops.chance[location];
  436.                                     }
  437.                                     if (location == "streets") {
  438.                                         configsAirdrops.airdropChancePercent.tarkovStreets = otherOptions.airdrops.chance[location];
  439.                                     }
  440.                                     if (location == "interchange" || location == "lighthouse" || location == "reserve" || location == "shoreline" || location == "woods") {
  441.                                         configsAirdrops.airdropChancePercent[location] = otherOptions.airdrops.chance[location];
  442.                                     }
  443.                                 }
  444.                                 // extend plane airdrop end time based on the raid timer
  445.                                 if (otherOptions.raidTimer.enabled) {
  446.                                     for (const altLocations in this.altLocationArray) {
  447.                                         const altLocation = this.altLocationArray[altLocations];
  448.                                         if (altLocation != "factory4_day" && altLocation != "factory4_night" && altLocation != "laboratory") {
  449.                                             databaseLocations[altLocation].base.AirdropParameters["PlaneAirdropEnd"] = databaseLocations[altLocation].base.EscapeTimeLimit * 60 * 0.75;
  450.                                         }
  451.                                     }
  452.                                 }
  453.                                 if (otherOptions.consoleLogs) {
  454.                                     this.logger.log(" > [airdrops]", this.logInfo);
  455.                                     this.logger.log(`  > start time: ${configsAirdrops.airdropMinStartTimeSeconds / 60} minutes`, this.logInfo);
  456.                                     if (otherOptions.airdrops.plane.dynamic) {
  457.                                         this.logger.log("  > dynamic airdrops enabled", this.logInfo);
  458.                                     }
  459.                                     else {
  460.                                         this.logger.log("  > dynamic airdrops disabled", this.logDisable);
  461.                                     }
  462.                                     this.logger.log("  > plane:", this.logInfo);
  463.                                     this.logger.log(`   > speed: ${configsAirdrops.planeSpeed} m/s`, this.logInfo);
  464.                                     this.logger.log(`   > height: ${configsAirdrops.planeMaxFlyHeight} m`, this.logInfo);
  465.                                     this.logger.log(`   > volume: ${Math.round(configsAirdrops.planeVolume * 100)}%`, this.logInfo);
  466.                                     this.logger.log(`   > crate speed: ${configsAirdrops.crateFallSpeed} m/s`, this.logInfo);
  467.                                     this.logger.log(`   > crate items: ${configsAirdrops.loot.mixed.itemCount.max}`, this.logInfo);
  468.                                     this.logger.log("  > chance:", this.logInfo);
  469.                                     this.logger.log(`   > customs: ${configsAirdrops.airdropChancePercent.bigmap}%`, this.logInfo);
  470.                                     this.logger.log(`   > interchange: ${configsAirdrops.airdropChancePercent.interchange}%`, this.logInfo);
  471.                                     this.logger.log(`   > lighthouse: ${configsAirdrops.airdropChancePercent.lighthouse}%`, this.logInfo);
  472.                                     this.logger.log(`   > reserve: ${configsAirdrops.airdropChancePercent.reserve}%`, this.logInfo);
  473.                                     this.logger.log(`   > shoreline: ${configsAirdrops.airdropChancePercent.shoreline}%`, this.logInfo);
  474.                                     this.logger.log(`   > streets: ${configsAirdrops.airdropChancePercent.tarkovStreets}%`, this.logInfo);
  475.                                     this.logger.log(`   > woods: ${configsAirdrops.airdropChancePercent.woods}%`, this.logInfo);
  476.                                 }
  477.                             }
  478.                         }
  479.                         // better spawns plus
  480.                         if (this.config.betterSpawnsPlus.enabled) {
  481.                             for (const locations in this.locationArray) {
  482.                                 const location = this.locationArray[locations];
  483.                                 if (this.config.betterSpawnsPlus.locations[location].consoleLogs) {
  484.                                     this.logger.log("> [better spawns plus]: logs", this.logInfo);
  485.                                     break;
  486.                                 }
  487.                             }
  488.                             const importInitFile = require("../db/locations/init.json");
  489.                             configsInraids.raidMenuSettings.bossEnabled = true;
  490.                             configsLocations.splitWaveIntoSingleSpawnsSettings.enabled = false;
  491.                             configsLocations.rogueLighthouseSpawnTimeSettings.enabled = false;
  492.                             configsLocations.fixEmptyBotWavesSettings.enabled = false;
  493.                             configsLocations.addOpenZonesToAllMaps = false;
  494.                             configsLocations.addCustomBotWavesToMaps = false;
  495.                             configsLocations.enableBotTypeLimits = false;
  496.                             for (const altLocation of this.altLocationArray) {
  497.                                 databaseLocations[altLocation].base.NewSpawn = false;
  498.                                 databaseLocations[altLocation].base.OldSpawn = true;
  499.                                 databaseLocations[altLocation].base.OfflineNewSpawn = false;
  500.                                 databaseLocations[altLocation].base.OfflineOldSpawn = true;
  501.                             }
  502.                             for (const zone in this.openZones) {
  503.                                 databaseLocations[zone].base.OpenZones = this.openZones[zone];
  504.                             }
  505.                             this.enemyTypeArray.forEach(function (type) {
  506.                                 configsPmc.convertIntoPmcChance[type].min = 0;
  507.                                 configsPmc.convertIntoPmcChance[type].max = 0;
  508.                             });
  509.                             for (const locations in this.locationArray) {
  510.                                 const location = this.locationArray[locations];
  511.                                 const initSpawns = importInitFile[location];
  512.                                 const mainSpawnSystemArray = generateWeightArray(this.config.betterSpawnsPlus.locations[location].main.presets);
  513.                                 const generatorSpawnSystemArray = generateWeightArray(this.config.betterSpawnsPlus.locations[location].spawnGenerator.presets);
  514.                                 const randomMainPreset = Math.floor(Math.random() * mainSpawnSystemArray.length);
  515.                                 const randomGeneratorPreset = Math.floor(Math.random() * generatorSpawnSystemArray.length);
  516.                                 let countBears = 0, countUsecs = 0, countScavs = 0, countSniperScavs = 0;
  517.                                 let countBosses = 0, countCultists = 0, countRaiders = 0, countRogues = 0;
  518.                                 let countBloodhounds = 0, countWeirdScavs = 0;
  519.                                 let countAddBear = 0, countAddUsec = 0, countAddScav = 0, countAddSniperScav = 0;
  520.                                 let countAddBoss = 0, countAddCultist = 0, countAddRaider = 0, countAddRogue = 0;
  521.                                 let countAddBloodhound = 0, countAddWeirdScav = 0;
  522.                                 let countRandomChanceToDisableMainPreset = 0;
  523.                                 if (location == "customs") {
  524.                                     databaseLocations.bigmap.base.waves = [];
  525.                                     databaseLocations.bigmap.base.BossLocationSpawn = initSpawns;
  526.                                 }
  527.                                 if (location == "factory") {
  528.                                     databaseLocations.factory4_day.base.waves = [];
  529.                                     databaseLocations.factory4_night.base.waves = [];
  530.                                     databaseLocations.factory4_day.base.BossLocationSpawn = initSpawns;
  531.                                     databaseLocations.factory4_night.base.BossLocationSpawn = initSpawns;
  532.                                 }
  533.                                 if (location == "interchange" || location == "lighthouse" || location == "shoreline" || location == "woods") {
  534.                                     databaseLocations[location].base.waves = [];
  535.                                     databaseLocations[location].base.BossLocationSpawn = initSpawns;
  536.                                 }
  537.                                 if (location == "labs") {
  538.                                     databaseLocations.laboratory.base.waves = [];
  539.                                     databaseLocations.laboratory.base.BossLocationSpawn = initSpawns;
  540.                                 }
  541.                                 if (location == "reserve") {
  542.                                     databaseLocations.rezervbase.base.waves = [];
  543.                                     databaseLocations.rezervbase.base.BossLocationSpawn = initSpawns;
  544.                                 }
  545.                                 if (location == "streets") {
  546.                                     databaseLocations.tarkovstreets.base.waves = [];
  547.                                     databaseLocations.tarkovstreets.base.BossLocationSpawn = initSpawns;
  548.                                 }
  549.                                 // generator spawn system
  550.                                 if (this.config.betterSpawnsPlus.locations[location].spawnGenerator.enabled) {
  551.                                     if (generatorSpawnSystemArray.length != 0) {
  552.                                         const importPresetFile = require(`../db/locations/${location}/spawnGenerator/presets/${generatorSpawnSystemArray[randomGeneratorPreset]}.${"json"}`);
  553.                                         const addPmcs = importPresetFile[location].pmcs;
  554.                                         const addScavs = importPresetFile[location].scavs;
  555.                                         const addSniperScavs = importPresetFile[location].sniperScavs;
  556.                                         const addBosses = importPresetFile[location].bosses;
  557.                                         const addCultists = importPresetFile[location].cultists;
  558.                                         const addRaiders = importPresetFile[location].raiders;
  559.                                         const addRogues = importPresetFile[location].rogues;
  560.                                         const addBloodhounds = importPresetFile[location].bloodhounds;
  561.                                         const addWeirdScavs = importPresetFile[location].weirdScavs;
  562.                                         let chanceToDisable = 0;
  563.                                         if (!importPresetFile.enableMainPresets && this.config.betterSpawnsPlus.locations[location].main.enabled) {
  564.                                             chanceToDisable = generateRandomInteger(1, 2);
  565.                                         }
  566.                                         if (chanceToDisable === 1) {
  567.                                             countRandomChanceToDisableMainPreset++;
  568.                                         }
  569.                                         else {
  570.                                             if (chanceToDisable === 2) {
  571.                                                 countRandomChanceToDisableMainPreset += 2;
  572.                                             }
  573.                                             // pmcs
  574.                                             if (addPmcs.enabled && checkProperties(addPmcs.botType) && checkProperties(addPmcs.botDifficulty) && checkProperties(addPmcs.botChance) && (addPmcs.spawnWaves.initial.waves !== 0 || addPmcs.spawnWaves.interval.waves !== 0)) {
  575.                                                 if (!checkProperties(addPmcs.openZones)) {
  576.                                                     for (const zone in addPmcs.openZones) {
  577.                                                         addPmcs.openZones[zone] = 1;
  578.                                                     }
  579.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for pmcs on location [${location}]`, this.logError);
  580.                                                     this.logger.log(`> reverted to all open zones being available for pmcs on [${location}]`, this.logError);
  581.                                                 }
  582.                                                 let timeInterval = addPmcs.spawnWaves.interval.time;
  583.                                                 const addTimeInterval = timeInterval;
  584.                                                 let countInterval = 0;
  585.                                                 let zoneArray = generateWeightArray(addPmcs.openZones);
  586.                                                 let typeArray = generateWeightArray(addPmcs.botType);
  587.                                                 let difficultyArray = generateWeightArray(addPmcs.botDifficulty);
  588.                                                 for (let i = 0; i < addPmcs.spawnWaves.initial.waves + addPmcs.spawnWaves.interval.waves; i++) {
  589.                                                     const randomAmount = generateRandomNumberFromSequence(addPmcs.botAmountPerSpawnWave);
  590.                                                     let randomTime = generateRandomInteger(addPmcs.spawnWaves.spawnDelay.min, addPmcs.spawnWaves.spawnDelay.max);
  591.                                                     if (addPmcs.botChance.min < 0 || addPmcs.botChance.min > 100) {
  592.                                                         addPmcs.botChance.min = 0;
  593.                                                     }
  594.                                                     else if (addPmcs.botChance.max < 0 || addPmcs.botChance.max > 100) {
  595.                                                         addPmcs.botChance.max = 100;
  596.                                                     }
  597.                                                     const randomChance = generateRandomInteger(addPmcs.botChance.min, addPmcs.botChance.max);
  598.                                                     if (i < Math.abs(addPmcs.spawnWaves.initial.waves - addPmcs.spawnWaves.interval.wavesPerInterval)) {
  599.                                                         timeInterval = addPmcs.spawnWaves.initial.time;
  600.                                                     }
  601.                                                     else {
  602.                                                         countInterval++;
  603.                                                     }
  604.                                                     if (randomTime + timeInterval < 0) {
  605.                                                         randomTime = 0;
  606.                                                     }
  607.                                                     if (zoneArray.length == 0) {
  608.                                                         zoneArray = generateWeightArray(addPmcs.openZones);
  609.                                                     }
  610.                                                     if (difficultyArray.length == 0) {
  611.                                                         difficultyArray = generateWeightArray(addPmcs.botDifficulty);
  612.                                                     }
  613.                                                     if (typeArray.length == 0) {
  614.                                                         typeArray = generateWeightArray(addPmcs.botType);
  615.                                                     }
  616.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  617.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  618.                                                     let randomType = removeElementFromWeightArray(typeArray);
  619.                                                     if (randomType == "bear") {
  620.                                                         randomType = "sptBear";
  621.                                                         countAddBear++;
  622.                                                     }
  623.                                                     else {
  624.                                                         randomType = "sptUsec";
  625.                                                         countAddUsec++;
  626.                                                     }
  627.                                                     if (location == "labs") {
  628.                                                         initSpawns.push(this.generateBot(randomType, randomChance, randomZone, randomDifficulty, randomType, randomAmount, -1, null, "", "", randomTime + timeInterval));
  629.                                                     }
  630.                                                     else {
  631.                                                         initSpawns.push(this.generateBot(randomType, randomChance, randomZone, randomDifficulty, randomType, randomAmount, randomTime + timeInterval, null, "", "", 0));
  632.                                                     }
  633.                                                     if (countInterval == addPmcs.spawnWaves.interval.wavesPerInterval) {
  634.                                                         timeInterval += addTimeInterval;
  635.                                                         countInterval = 0;
  636.                                                     }
  637.                                                 }
  638.                                             }
  639.                                             // scavs
  640.                                             if (addScavs.enabled && checkProperties(addScavs.botDifficulty) && checkProperties(addScavs.botChance) && (addScavs.spawnWaves.initial.waves !== 0 || addScavs.spawnWaves.interval.waves !== 0)) {
  641.                                                 if (!checkProperties(addScavs.openZones)) {
  642.                                                     for (const zone in addScavs.openZones) {
  643.                                                         addScavs.openZones[zone] = 1;
  644.                                                     }
  645.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for scavs on location [${location}]`, this.logError);
  646.                                                     this.logger.log(`> reverted to all open zones being available for scavs on [${location}]`, this.logError);
  647.                                                 }
  648.                                                 let timeInterval = addScavs.spawnWaves.interval.time;
  649.                                                 const addTimeInterval = timeInterval;
  650.                                                 let countInterval = 0;
  651.                                                 let zoneArray = generateWeightArray(addScavs.openZones);
  652.                                                 let difficultyArray = generateWeightArray(addScavs.botDifficulty);
  653.                                                 for (let i = 0; i < addScavs.spawnWaves.initial.waves + addScavs.spawnWaves.interval.waves; i++) {
  654.                                                     const randomAmount = generateRandomNumberFromSequence(addScavs.botAmountPerSpawnWave);
  655.                                                     let randomTime = generateRandomInteger(addScavs.spawnWaves.spawnDelay.min, addScavs.spawnWaves.spawnDelay.max);
  656.                                                     if (addScavs.botChance.min < 0 || addScavs.botChance.min > 100) {
  657.                                                         addScavs.botChance.min = 0;
  658.                                                     }
  659.                                                     else if (addScavs.botChance.max < 0 || addScavs.botChance.max > 100) {
  660.                                                         addScavs.botChance.max = 100;
  661.                                                     }
  662.                                                     const randomChance = generateRandomInteger(addScavs.botChance.min, addScavs.botChance.max);
  663.                                                     if (i < Math.abs(addScavs.spawnWaves.initial.waves - addScavs.spawnWaves.interval.wavesPerInterval)) {
  664.                                                         timeInterval = addScavs.spawnWaves.initial.time;
  665.                                                     }
  666.                                                     else {
  667.                                                         countInterval++;
  668.                                                     }
  669.                                                     if (randomTime + timeInterval < 0) {
  670.                                                         randomTime = 0;
  671.                                                     }
  672.                                                     if (zoneArray.length == 0) {
  673.                                                         zoneArray = generateWeightArray(addScavs.openZones);
  674.                                                     }
  675.                                                     if (difficultyArray.length == 0) {
  676.                                                         difficultyArray = generateWeightArray(addScavs.botDifficulty);
  677.                                                     }
  678.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  679.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  680.                                                     countAddScav++;
  681.                                                     initSpawns.push(this.generateBot("assault", randomChance, randomZone, randomDifficulty, "assault", randomAmount, randomTime + timeInterval, null, "", "", 0));
  682.                                                     if (countInterval == addScavs.spawnWaves.interval.wavesPerInterval) {
  683.                                                         timeInterval += addTimeInterval;
  684.                                                         countInterval = 0;
  685.                                                     }
  686.                                                 }
  687.                                             }
  688.                                             // sniper scavs
  689.                                             if (addSniperScavs.enabled && checkProperties(addSniperScavs.botDifficulty) && checkProperties(addSniperScavs.botChance) && (addSniperScavs.spawnWaves.initial.waves !== 0 || addSniperScavs.spawnWaves.interval.waves !== 0)) {
  690.                                                 if (!checkProperties(addSniperScavs.openZones)) {
  691.                                                     for (const zone in addSniperScavs.openZones) {
  692.                                                         addSniperScavs.openZones[zone] = 1;
  693.                                                     }
  694.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for sniper scavs on location [${location}]`, this.logError);
  695.                                                     this.logger.log(`> reverted to all open zones being available for sniper scavs on [${location}]`, this.logError);
  696.                                                 }
  697.                                                 let timeInterval = addSniperScavs.spawnWaves.interval.time;
  698.                                                 const addTimeInterval = timeInterval;
  699.                                                 let countInterval = 0;
  700.                                                 let zoneArray = generateWeightArray(addSniperScavs.openZones);
  701.                                                 let difficultyArray = generateWeightArray(addSniperScavs.botDifficulty);
  702.                                                 for (let i = 0; i < addSniperScavs.spawnWaves.initial.waves + addSniperScavs.spawnWaves.interval.waves; i++) {
  703.                                                     const randomAmount = generateRandomNumberFromSequence(addSniperScavs.botAmountPerSpawnWave);
  704.                                                     let randomTime = generateRandomInteger(addSniperScavs.spawnWaves.spawnDelay.min, addSniperScavs.spawnWaves.spawnDelay.max);
  705.                                                     if (addSniperScavs.botChance.min < 0 || addSniperScavs.botChance.min > 100) {
  706.                                                         addSniperScavs.botChance.min = 0;
  707.                                                     }
  708.                                                     else if (addSniperScavs.botChance.max < 0 || addSniperScavs.botChance.max > 100) {
  709.                                                         addSniperScavs.botChance.max = 100;
  710.                                                     }
  711.                                                     const randomChance = generateRandomInteger(addSniperScavs.botChance.min, addSniperScavs.botChance.max);
  712.                                                     if (i < Math.abs(addSniperScavs.spawnWaves.initial.waves - addSniperScavs.spawnWaves.interval.wavesPerInterval)) {
  713.                                                         timeInterval = addSniperScavs.spawnWaves.initial.time;
  714.                                                     }
  715.                                                     else {
  716.                                                         countInterval++;
  717.                                                     }
  718.                                                     if (randomTime + timeInterval < 0) {
  719.                                                         randomTime = 0;
  720.                                                     }
  721.                                                     if (zoneArray.length == 0) {
  722.                                                         zoneArray = generateWeightArray(addSniperScavs.openZones);
  723.                                                     }
  724.                                                     if (difficultyArray.length == 0) {
  725.                                                         difficultyArray = generateWeightArray(addSniperScavs.botDifficulty);
  726.                                                     }
  727.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  728.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  729.                                                     countAddSniperScav++;
  730.                                                     initSpawns.push(this.generateBot("marksman", randomChance, randomZone, randomDifficulty, "marksman", randomAmount, randomTime + timeInterval, null, "", "", 0));
  731.                                                     if (countInterval == addSniperScavs.spawnWaves.interval.wavesPerInterval) {
  732.                                                         timeInterval += addTimeInterval;
  733.                                                         countInterval = 0;
  734.                                                     }
  735.                                                 }
  736.                                             }
  737.                                             // bosses
  738.                                             if (addBosses.enabled && checkProperties(addBosses.botType) && checkProperties(addBosses.botDifficulty) && checkProperties(addBosses.botChance) && (addBosses.spawnWaves.initial.waves !== 0 || addBosses.spawnWaves.interval.waves !== 0)) {
  739.                                                 if (!checkProperties(addBosses.openZones)) {
  740.                                                     for (const zone in addBosses.openZones) {
  741.                                                         addBosses.openZones[zone] = 1;
  742.                                                     }
  743.                                                     if (!addBosses.onlyVanillaOpenZones) {
  744.                                                         this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for bosses on location [${location}]`, this.logError);
  745.                                                         this.logger.log(`> reverted to all open zones being available for bosses on [${location}]`, this.logError);
  746.                                                     }
  747.                                                 }
  748.                                                 let timeInterval = addBosses.spawnWaves.interval.time;
  749.                                                 const addTimeInterval = timeInterval;
  750.                                                 let countInterval = 0;
  751.                                                 let supportAmount = "";
  752.                                                 let supportType = "";
  753.                                                 let supports = null;
  754.                                                 let typeArray = generateWeightArray(addBosses.botType);
  755.                                                 let difficultyArray = generateWeightArray(addBosses.botDifficulty);
  756.                                                 let zoneArray = generateWeightArray(addBosses.openZones);
  757.                                                 for (let i = 0; i < addBosses.spawnWaves.initial.waves + addBosses.spawnWaves.interval.waves; i++) {
  758.                                                     let randomTime = generateRandomInteger(addBosses.spawnWaves.spawnDelay.min, addBosses.spawnWaves.spawnDelay.max);
  759.                                                     if (addBosses.botChance.min < 0 || addBosses.botChance.min > 100) {
  760.                                                         addBosses.botChance.min = 0;
  761.                                                     }
  762.                                                     else if (addBosses.botChance.max < 0 || addBosses.botChance.max > 100) {
  763.                                                         addBosses.botChance.max = 100;
  764.                                                     }
  765.                                                     let randomChance = generateRandomInteger(addBosses.botChance.min, addBosses.botChance.max);
  766.                                                     if (i < Math.abs(addBosses.spawnWaves.initial.waves - addBosses.spawnWaves.interval.wavesPerInterval)) {
  767.                                                         timeInterval = addBosses.spawnWaves.initial.time;
  768.                                                     }
  769.                                                     else {
  770.                                                         countInterval++;
  771.                                                     }
  772.                                                     if (randomTime == 0) {
  773.                                                         randomTime = -1;
  774.                                                     }
  775.                                                     else if (randomTime + timeInterval < 0) {
  776.                                                         randomTime = 0;
  777.                                                     }
  778.                                                     if (zoneArray.length == 0) {
  779.                                                         zoneArray = generateWeightArray(addBosses.openZones);
  780.                                                     }
  781.                                                     if (difficultyArray.length == 0) {
  782.                                                         difficultyArray = generateWeightArray(addBosses.botDifficulty);
  783.                                                     }
  784.                                                     if (typeArray.length == 0) {
  785.                                                         typeArray = generateWeightArray(addBosses.botType);
  786.                                                     }
  787.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  788.                                                     let randomZone = removeElementFromWeightArray(zoneArray);
  789.                                                     let randomType = removeElementFromWeightArray(typeArray);
  790.                                                     if (randomType == "glukhar") {
  791.                                                         randomType = "bossGluhar";
  792.                                                         supportType = "followerGluharAssault";
  793.                                                         supportAmount = "0";
  794.                                                         supports = [
  795.                                                             {
  796.                                                                 "BossEscortType": "followerGluharAssault",
  797.                                                                 "BossEscortDifficult": [randomDifficulty],
  798.                                                                 "BossEscortAmount": "2"
  799.                                                             },
  800.                                                             {
  801.                                                                 "BossEscortType": "followerGluharSecurity",
  802.                                                                 "BossEscortDifficult": [randomDifficulty],
  803.                                                                 "BossEscortAmount": "2"
  804.                                                             },
  805.                                                             {
  806.                                                                 "BossEscortType": "followerGluharScout",
  807.                                                                 "BossEscortDifficult": [randomDifficulty],
  808.                                                                 "BossEscortAmount": "2"
  809.                                                             }
  810.                                                         ];
  811.                                                         if (addBosses.onlyVanillaOpenZones && location == "reserve") {
  812.                                                             const glukharOpenZones = ["ZoneRailStrorage", "ZoneRailStrorage", "ZoneRailStrorage", "ZonePTOR1", "ZonePTOR2", "ZoneBarrack", "ZoneBarrack", "ZoneBarrack", "ZoneSubStorage"];
  813.                                                             const randomGlukharZone = glukharOpenZones[Math.floor(Math.random() * glukharOpenZones.length)];
  814.                                                             randomZone = randomGlukharZone;
  815.                                                         }
  816.                                                         if (addBosses.onlyVanillaOpenZones && location == "streets") {
  817.                                                             randomZone = "ZoneCarShowroom";
  818.                                                             supports[2].BossEscortAmount = "1";
  819.                                                         }
  820.                                                     }
  821.                                                     else if (randomType == "killa") {
  822.                                                         randomType = "bossKilla";
  823.                                                         supportType = "followerTagilla";
  824.                                                         supportAmount = "0";
  825.                                                         supports = null;
  826.                                                         if (addBosses.onlyVanillaOpenZones && location == "interchange") {
  827.                                                             const killaOpenZones = ["ZoneCenterBot", "ZoneCenter", "ZoneOLI", "ZoneIDEA", "ZoneGoshan", "ZoneIDEAPark", "ZoneOLIPark"];
  828.                                                             const randomKillaZone = killaOpenZones[Math.floor(Math.random() * killaOpenZones.length)];
  829.                                                             randomZone = randomKillaZone;
  830.                                                         }
  831.                                                         if (addBosses.onlyVanillaOpenZones && location == "streets") {
  832.                                                             const killaOpenZones = ["ZoneHotel_1", "ZoneHotel_2"];
  833.                                                             const randomKillaZone = killaOpenZones[Math.floor(Math.random() * killaOpenZones.length)];
  834.                                                             randomZone = randomKillaZone;
  835.                                                         }
  836.                                                     }
  837.                                                     else if (randomType == "knight") {
  838.                                                         randomType = "bossKnight";
  839.                                                         supportType = "exUsec";
  840.                                                         supportAmount = "2";
  841.                                                         supports = [
  842.                                                             {
  843.                                                                 "BossEscortType": "followerBigPipe",
  844.                                                                 "BossEscortDifficult": [randomDifficulty],
  845.                                                                 "BossEscortAmount": "1"
  846.                                                             },
  847.                                                             {
  848.                                                                 "BossEscortType": "followerBirdEye",
  849.                                                                 "BossEscortDifficult": [randomDifficulty],
  850.                                                                 "BossEscortAmount": "1"
  851.                                                             }
  852.                                                         ];
  853.                                                         if (addBosses.onlyVanillaOpenZones && location == "customs") {
  854.                                                             randomZone = "ZoneScavBase";
  855.                                                         }
  856.                                                         if (addBosses.onlyVanillaOpenZones && location == "lighthouse") {
  857.                                                             const knightOpenZones = ["Zone_TreatmentContainers", "Zone_Chalet"];
  858.                                                             const randomKnightZone = knightOpenZones[Math.floor(Math.random() * knightOpenZones.length)];
  859.                                                             randomZone = randomKnightZone;
  860.                                                         }
  861.                                                         if (addBosses.onlyVanillaOpenZones && location == "shoreline") {
  862.                                                             randomZone = "ZoneMeteoStation";
  863.                                                         }
  864.                                                         if (addBosses.onlyVanillaOpenZones && location == "woods") {
  865.                                                             randomZone = "ZoneScavBase2";
  866.                                                         }
  867.                                                     }
  868.                                                     else if (randomType == "reshala") {
  869.                                                         randomType = "bossBully";
  870.                                                         supportType = "followerBully";
  871.                                                         supportAmount = "4";
  872.                                                         supports = null;
  873.                                                         if (addBosses.onlyVanillaOpenZones && location == "customs") {
  874.                                                             const reshalaOpenZones = ["ZoneDormitory", "ZoneGasStation"];
  875.                                                             const randomReshalaZone = reshalaOpenZones[Math.floor(Math.random() * reshalaOpenZones.length)];
  876.                                                             randomZone = randomReshalaZone;
  877.                                                         }
  878.                                                     }
  879.                                                     else if (randomType == "sanitar") {
  880.                                                         randomType = "bossSanitar";
  881.                                                         supportType = "followerSanitar";
  882.                                                         supportAmount = "2";
  883.                                                         supports = null;
  884.                                                         if (addBosses.onlyVanillaOpenZones && location == "shoreline") {
  885.                                                             const sanitarOpenZones = ["ZonePort", "ZoneGreenHouses", "ZoneSanatorium1", "ZoneGreenHouses", "ZoneSanatorium2"];
  886.                                                             const randomSanitarZone = sanitarOpenZones[Math.floor(Math.random() * sanitarOpenZones.length)];
  887.                                                             randomZone = randomSanitarZone;
  888.                                                         }
  889.                                                     }
  890.                                                     else if (randomType == "shturman") {
  891.                                                         randomType = "bossKojaniy";
  892.                                                         supportType = "followerKojaniy";
  893.                                                         supportAmount = "2";
  894.                                                         supports = null;
  895.                                                         if (addBosses.onlyVanillaOpenZones && location == "woods") {
  896.                                                             randomZone = "ZoneWoodCutter";
  897.                                                         }
  898.                                                     }
  899.                                                     else if (randomType == "tagilla") {
  900.                                                         randomType = "bossTagilla";
  901.                                                         supportType = "followerBully";
  902.                                                         supportAmount = "0";
  903.                                                         supports = null;
  904.                                                     }
  905.                                                     else if (randomType == "zryachiy") {
  906.                                                         randomType = "bossZryachiy";
  907.                                                         supportType = "followerZryachiy";
  908.                                                         supportAmount = "2";
  909.                                                         supports = null;
  910.                                                         if (addBosses.onlyVanillaOpenZones && location == "lighthouse") {
  911.                                                             randomZone = "Zone_Island";
  912.                                                             randomChance = 100;
  913.                                                         }
  914.                                                     }
  915.                                                     countAddBoss++;
  916.                                                     initSpawns.push(this.generateBot(randomType, randomChance, randomZone, randomDifficulty, supportType, supportAmount, randomTime + timeInterval, supports, "", "", 0));
  917.                                                     if (countInterval == addBosses.spawnWaves.interval.wavesPerInterval) {
  918.                                                         timeInterval += addTimeInterval;
  919.                                                         countInterval = 0;
  920.                                                     }
  921.                                                 }
  922.                                             }
  923.                                             // cultists
  924.                                             if (addCultists.enabled && checkProperties(addCultists.botDifficulty) && checkProperties(addCultists.botChance) && (addCultists.spawnWaves.initial.waves !== 0 || addCultists.spawnWaves.interval.waves !== 0)) {
  925.                                                 if (!checkProperties(addCultists.openZones)) {
  926.                                                     for (const zone in addCultists.openZones) {
  927.                                                         addCultists.openZones[zone] = 1;
  928.                                                     }
  929.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for cultists on location [${location}]`, this.logError);
  930.                                                     this.logger.log(`> reverted to all open zones being available for cultists on [${location}]`, this.logError);
  931.                                                 }
  932.                                                 let timeInterval = addCultists.spawnWaves.interval.time;
  933.                                                 const addTimeInterval = timeInterval;
  934.                                                 let countInterval = 0;
  935.                                                 let zoneArray = generateWeightArray(addCultists.openZones);
  936.                                                 let difficultyArray = generateWeightArray(addCultists.botDifficulty);
  937.                                                 let countOpenZone1 = 0;
  938.                                                 let countOpenZone2 = 0;
  939.                                                 for (let i = 0; i < addCultists.spawnWaves.initial.waves + addCultists.spawnWaves.interval.waves; i++) {
  940.                                                     const randomAmount = generateRandomNumberFromSequence(addCultists.botAmountPerSpawnWave);
  941.                                                     let randomTime = generateRandomInteger(addCultists.spawnWaves.spawnDelay.min, addCultists.spawnWaves.spawnDelay.max);
  942.                                                     if (addCultists.botChance.min < 0 || addCultists.botChance.min > 100) {
  943.                                                         addCultists.botChance.min = 0;
  944.                                                     }
  945.                                                     else if (addCultists.botChance.max < 0 || addCultists.botChance.max > 100) {
  946.                                                         addCultists.botChance.max = 100;
  947.                                                     }
  948.                                                     const randomChance = generateRandomInteger(addCultists.botChance.min, addCultists.botChance.max);
  949.                                                     if (i < Math.abs(addCultists.spawnWaves.initial.waves - addCultists.spawnWaves.interval.wavesPerInterval)) {
  950.                                                         timeInterval = addCultists.spawnWaves.initial.time;
  951.                                                     }
  952.                                                     else {
  953.                                                         countInterval++;
  954.                                                     }
  955.                                                     if (randomTime + timeInterval < 0) {
  956.                                                         randomTime = 0;
  957.                                                     }
  958.                                                     if (zoneArray.length == 0) {
  959.                                                         zoneArray = generateWeightArray(addCultists.openZones);
  960.                                                     }
  961.                                                     if (difficultyArray.length == 0) {
  962.                                                         difficultyArray = generateWeightArray(addCultists.botDifficulty);
  963.                                                     }
  964.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  965.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  966.                                                     countAddCultist++;
  967.                                                     if (location == "shoreline") {
  968.                                                         if (addCultists.onlyVanillaOpenZones) {
  969.                                                             const zoneArr1 = ["ZoneSanatorium1", "ZoneSanatorium2"];
  970.                                                             const newZone1 = zoneArr1[Math.floor(Math.random() * zoneArr1.length)];
  971.                                                             const zoneArr2 = ["ZoneForestGasStation", "ZoneForestSpawn"];
  972.                                                             const newZone2 = zoneArr2[Math.floor(Math.random() * zoneArr2.length)];
  973.                                                             if (randomZone == "ZoneForestGasStation" || randomZone == "ZoneForestSpawn") {
  974.                                                                 if (countOpenZone1 > 0) {
  975.                                                                     countOpenZone1--;
  976.                                                                     initSpawns.push(this.generateBot("sectantPriest", randomChance, newZone1, randomDifficulty, "sectantWarrior", randomAmount, randomTime + timeInterval, null, "", "", 0));
  977.                                                                 }
  978.                                                                 else {
  979.                                                                     countOpenZone1++;
  980.                                                                     initSpawns.push(this.generateBot("sectantPriest", randomChance, randomZone, randomDifficulty, "sectantWarrior", randomAmount, randomTime + timeInterval, null, "", "", 0));
  981.                                                                 }
  982.                                                             }
  983.                                                             else {
  984.                                                                 if (countOpenZone2 > 0) {
  985.                                                                     countOpenZone2--;
  986.                                                                     initSpawns.push(this.generateBot("sectantPriest", randomChance, newZone2, randomDifficulty, "sectantWarrior", randomAmount, randomTime + timeInterval, null, "", "", 0));
  987.                                                                 }
  988.                                                                 else {
  989.                                                                     countOpenZone2++;
  990.                                                                     initSpawns.push(this.generateBot("sectantPriest", randomChance, randomZone, randomDifficulty, "sectantWarrior", randomAmount, randomTime + timeInterval, null, "", "", 0));
  991.                                                                 }
  992.                                                             }
  993.                                                         }
  994.                                                     }
  995.                                                     else {
  996.                                                         initSpawns.push(this.generateBot("sectantPriest", randomChance, randomZone, randomDifficulty, "sectantWarrior", randomAmount, randomTime + timeInterval, null, "", "", 0));
  997.                                                     }
  998.                                                     if (countInterval == addCultists.spawnWaves.interval.wavesPerInterval) {
  999.                                                         timeInterval += addTimeInterval;
  1000.                                                         countInterval = 0;
  1001.                                                     }
  1002.                                                 }
  1003.                                             }
  1004.                                             // raiders
  1005.                                             if (addRaiders.enabled && checkProperties(addRaiders.botDifficulty) && checkProperties(addRaiders.botChance) && (addRaiders.spawnWaves.initial.waves !== 0 || addRaiders.spawnWaves.interval.waves !== 0)) {
  1006.                                                 if (!checkProperties(addRaiders.openZones)) {
  1007.                                                     for (const zone in addRaiders.openZones) {
  1008.                                                         addRaiders.openZones[zone] = 1;
  1009.                                                     }
  1010.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for raiders on location [${location}]`, this.logError);
  1011.                                                     this.logger.log(`> reverted to all open zones being available for raiders on [${location}]`, this.logError);
  1012.                                                 }
  1013.                                                 if (location == "labs") {
  1014.                                                     let timeInterval = addRaiders.spawnWaves.interval.time;
  1015.                                                     const addTimeInterval = timeInterval;
  1016.                                                     let countInterval = 0;
  1017.                                                     let zoneArray = generateWeightArray(addRaiders.openZones);
  1018.                                                     let difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1019.                                                     const triggerIdArray = generateWeightArray(addRaiders.triggers);
  1020.                                                     let triggerName = "interactObject";
  1021.                                                     let countTriggerZoneGate1 = 0;
  1022.                                                     let countTriggerZoneGate2 = 0;
  1023.                                                     for (let i = 0; i < addRaiders.spawnWaves.initial.waves + addRaiders.spawnWaves.interval.waves; i++) {
  1024.                                                         const randomAmount = generateRandomNumberFromSequence(addRaiders.botAmountPerSpawnWave);
  1025.                                                         let randomTime = generateRandomInteger(addRaiders.spawnWaves.spawnDelay.min, addRaiders.spawnWaves.spawnDelay.max);
  1026.                                                         let delayTime = randomTime + timeInterval;
  1027.                                                         if (addRaiders.botChance.min < 0 || addRaiders.botChance.min > 100) {
  1028.                                                             addRaiders.botChance.min = 0;
  1029.                                                         }
  1030.                                                         else if (addRaiders.botChance.max < 0 || addRaiders.botChance.max > 100) {
  1031.                                                             addRaiders.botChance.max = 100;
  1032.                                                         }
  1033.                                                         const randomChance = generateRandomInteger(addRaiders.botChance.min, addRaiders.botChance.max);
  1034.                                                         if (i < Math.abs(addRaiders.spawnWaves.initial.waves - addRaiders.spawnWaves.interval.wavesPerInterval)) {
  1035.                                                             timeInterval = addRaiders.spawnWaves.initial.time;
  1036.                                                         }
  1037.                                                         else {
  1038.                                                             countInterval++;
  1039.                                                         }
  1040.                                                         if (randomTime + timeInterval < 0) {
  1041.                                                             randomTime = 0;
  1042.                                                             delayTime = 0;
  1043.                                                         }
  1044.                                                         if (zoneArray.length == 0) {
  1045.                                                             zoneArray = generateWeightArray(addRaiders.openZones);
  1046.                                                         }
  1047.                                                         if (difficultyArray.length == 0) {
  1048.                                                             difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1049.                                                         }
  1050.                                                         let randomZone = removeElementFromWeightArray(zoneArray);
  1051.                                                         const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1052.                                                         let randomTrigger = removeElementFromWeightArray(triggerIdArray);
  1053.                                                         countAddRaider++;
  1054.                                                         if (addRaiders.onlyVanillaOpenZones) {
  1055.                                                             const newArr = ["BotZoneBasement", "BotZoneFloor1", "BotZoneFloor2"];
  1056.                                                             const newRand = newArr[Math.floor(Math.random() * newArr.length)];
  1057.                                                             if (randomTrigger == "autoId_00008_EXFIL" || randomTrigger == "autoId_00010_EXFIL") {
  1058.                                                                 randomZone = "BotZoneBasement";
  1059.                                                             }
  1060.                                                             if (randomZone == "BotZoneGate1") {
  1061.                                                                 if (countTriggerZoneGate1 >= 1) {
  1062.                                                                     randomZone = newRand;
  1063.                                                                 }
  1064.                                                                 else {
  1065.                                                                     delete addRaiders.openZones["BotZoneGate1"];
  1066.                                                                     randomTrigger = "autoId_00632_EXFIL";
  1067.                                                                     randomTime = -1;
  1068.                                                                     timeInterval = 0;
  1069.                                                                     delayTime = 8;
  1070.                                                                 }
  1071.                                                                 countTriggerZoneGate1++;
  1072.                                                             }
  1073.                                                             if (randomZone == "BotZoneGate2") {
  1074.                                                                 if (countTriggerZoneGate2 >= 1) {
  1075.                                                                     randomZone = newRand;
  1076.                                                                 }
  1077.                                                                 else {
  1078.                                                                     delete addRaiders.openZones["BotZoneGate2"];
  1079.                                                                     randomTrigger = "autoId_00014_EXFIL";
  1080.                                                                     randomTime = -1;
  1081.                                                                     timeInterval = 0;
  1082.                                                                     delayTime = 8;
  1083.                                                                 }
  1084.                                                                 countTriggerZoneGate2++;
  1085.                                                             }
  1086.                                                             initSpawns.push(this.generateBot("pmcBot", randomChance, randomZone, randomDifficulty, "pmcBot", randomAmount, randomTime + timeInterval, null, randomTrigger, triggerName, delayTime));
  1087.                                                         }
  1088.                                                         else {
  1089.                                                             initSpawns.push(this.generateBot("pmcBot", randomChance, randomZone, randomDifficulty, "pmcBot", randomAmount, randomTime + timeInterval, null, randomTrigger, triggerName, 0));
  1090.                                                         }
  1091.                                                         if (triggerIdArray.length == 0) {
  1092.                                                             randomTrigger = "";
  1093.                                                             triggerName = "";
  1094.                                                         }
  1095.                                                         if (countInterval == addRaiders.spawnWaves.interval.wavesPerInterval) {
  1096.                                                             timeInterval += addTimeInterval;
  1097.                                                             countInterval = 0;
  1098.                                                         }
  1099.                                                     }
  1100.                                                 }
  1101.                                                 if (location == "reserve") {
  1102.                                                     let timeInterval = addRaiders.spawnWaves.interval.time;
  1103.                                                     const addTimeInterval = timeInterval;
  1104.                                                     let countInterval = 0;
  1105.                                                     let zoneArray = generateWeightArray(addRaiders.openZones);
  1106.                                                     let difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1107.                                                     const triggerIdArray = generateWeightArray(addRaiders.triggers);
  1108.                                                     let triggerName = "interactObject";
  1109.                                                     let countTriggerZone1 = 0;
  1110.                                                     let countTriggerZone2 = 0;
  1111.                                                     for (let i = 0; i < addRaiders.spawnWaves.initial.waves + addRaiders.spawnWaves.interval.waves; i++) {
  1112.                                                         const randomAmount = generateRandomNumberFromSequence(addRaiders.botAmountPerSpawnWave);
  1113.                                                         let randomTime = generateRandomInteger(addRaiders.spawnWaves.spawnDelay.min, addRaiders.spawnWaves.spawnDelay.max);
  1114.                                                         let delayTime = randomTime + timeInterval;
  1115.                                                         if (addRaiders.botChance.min < 0 || addRaiders.botChance.min > 100) {
  1116.                                                             addRaiders.botChance.min = 0;
  1117.                                                         }
  1118.                                                         else if (addRaiders.botChance.max < 0 || addRaiders.botChance.max > 100) {
  1119.                                                             addRaiders.botChance.max = 100;
  1120.                                                         }
  1121.                                                         const randomChance = generateRandomInteger(addRaiders.botChance.min, addRaiders.botChance.max);
  1122.                                                         if (i < Math.abs(addRaiders.spawnWaves.initial.waves - addRaiders.spawnWaves.interval.wavesPerInterval)) {
  1123.                                                             timeInterval = addRaiders.spawnWaves.initial.time;
  1124.                                                         }
  1125.                                                         else {
  1126.                                                             countInterval++;
  1127.                                                         }
  1128.                                                         if (randomTime + timeInterval < 0) {
  1129.                                                             randomTime = 0;
  1130.                                                             delayTime = 0;
  1131.                                                         }
  1132.                                                         if (zoneArray.length == 0) {
  1133.                                                             zoneArray = generateWeightArray(addRaiders.openZones);
  1134.                                                         }
  1135.                                                         if (difficultyArray.length == 0) {
  1136.                                                             difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1137.                                                         }
  1138.                                                         const randomZone = removeElementFromWeightArray(zoneArray);
  1139.                                                         const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1140.                                                         let randomTrigger = removeElementFromWeightArray(triggerIdArray);
  1141.                                                         countAddRaider++;
  1142.                                                         if (addRaiders.onlyVanillaOpenZones) {
  1143.                                                             if (randomZone == "ZoneRailStrorage") {
  1144.                                                                 if (countTriggerZone1 == 0) {
  1145.                                                                     randomTrigger = "autoId_00632_EXFIL";
  1146.                                                                     randomTime = -1;
  1147.                                                                     timeInterval = 0;
  1148.                                                                     delayTime = 0;
  1149.                                                                     countTriggerZone1++;
  1150.                                                                 }
  1151.                                                                 else {
  1152.                                                                     randomTrigger = "";
  1153.                                                                     triggerName = "";
  1154.                                                                     randomTime = addRaiders.spawnWaves.interval.time + randomTime;
  1155.                                                                     timeInterval = 0;
  1156.                                                                     delayTime = 0;
  1157.                                                                 }
  1158.                                                             }
  1159.                                                             if (randomZone == "ZoneSubCommand") {
  1160.                                                                 if (countTriggerZone2 == 0) {
  1161.                                                                     randomTrigger = "autoId_00000_D2_LEVER";
  1162.                                                                     randomTime = -1;
  1163.                                                                     timeInterval = 0;
  1164.                                                                     delayTime = 0;
  1165.                                                                     countTriggerZone2++;
  1166.                                                                 }
  1167.                                                                 else {
  1168.                                                                     randomTrigger = "raider_simple_patroling";
  1169.                                                                     randomTime = 3;
  1170.                                                                     timeInterval = 0;
  1171.                                                                     delayTime = 0;
  1172.                                                                 }
  1173.                                                             }
  1174.                                                             initSpawns.push(this.generateBot("pmcBot", randomChance, randomZone, randomDifficulty, "pmcBot", randomAmount, randomTime + timeInterval, null, randomTrigger, triggerName, delayTime));
  1175.                                                         }
  1176.                                                         else {
  1177.                                                             initSpawns.push(this.generateBot("pmcBot", randomChance, randomZone, randomDifficulty, "pmcBot", randomAmount, randomTime + timeInterval, null, randomTrigger, triggerName, 0));
  1178.                                                         }
  1179.                                                         if (triggerIdArray.length == 0) {
  1180.                                                             randomTrigger = "";
  1181.                                                             triggerName = "";
  1182.                                                         }
  1183.                                                         if (countInterval == addRaiders.spawnWaves.interval.wavesPerInterval) {
  1184.                                                             timeInterval += addTimeInterval;
  1185.                                                             countInterval = 0;
  1186.                                                         }
  1187.                                                     }
  1188.                                                 }
  1189.                                                 if (location != "labs" && location != "reserve") {
  1190.                                                     let timeInterval = addRaiders.spawnWaves.interval.time;
  1191.                                                     const addTimeInterval = timeInterval;
  1192.                                                     let countInterval = 0;
  1193.                                                     let zoneArray = generateWeightArray(addRaiders.openZones);
  1194.                                                     let difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1195.                                                     for (let i = 0; i < addRaiders.spawnWaves.initial.waves + addRaiders.spawnWaves.interval.waves; i++) {
  1196.                                                         const randomAmount = generateRandomNumberFromSequence(addRaiders.botAmountPerSpawnWave);
  1197.                                                         let randomTime = generateRandomInteger(addRaiders.spawnWaves.spawnDelay.min, addRaiders.spawnWaves.spawnDelay.max);
  1198.                                                         if (addRaiders.botChance.min < 0 || addRaiders.botChance.min > 100) {
  1199.                                                             addRaiders.botChance.min = 0;
  1200.                                                         }
  1201.                                                         else if (addRaiders.botChance.max < 0 || addRaiders.botChance.max > 100) {
  1202.                                                             addRaiders.botChance.max = 100;
  1203.                                                         }
  1204.                                                         const randomChance = generateRandomInteger(addRaiders.botChance.min, addRaiders.botChance.max);
  1205.                                                         if (i < Math.abs(addRaiders.spawnWaves.initial.waves - addRaiders.spawnWaves.interval.wavesPerInterval)) {
  1206.                                                             timeInterval = addRaiders.spawnWaves.initial.time;
  1207.                                                         }
  1208.                                                         else {
  1209.                                                             countInterval++;
  1210.                                                         }
  1211.                                                         if (randomTime + timeInterval < 0) {
  1212.                                                             randomTime = 0;
  1213.                                                         }
  1214.                                                         if (zoneArray.length == 0) {
  1215.                                                             zoneArray = generateWeightArray(addRaiders.openZones);
  1216.                                                         }
  1217.                                                         if (difficultyArray.length == 0) {
  1218.                                                             difficultyArray = generateWeightArray(addRaiders.botDifficulty);
  1219.                                                         }
  1220.                                                         const randomZone = removeElementFromWeightArray(zoneArray);
  1221.                                                         const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1222.                                                         countAddRaider++;
  1223.                                                         initSpawns.push(this.generateBot("pmcBot", randomChance, randomZone, randomDifficulty, "pmcBot", randomAmount, randomTime + timeInterval, null, "", "", 0));
  1224.                                                         if (countInterval == addRaiders.spawnWaves.interval.wavesPerInterval) {
  1225.                                                             timeInterval += addTimeInterval;
  1226.                                                             countInterval = 0;
  1227.                                                         }
  1228.                                                     }
  1229.                                                 }
  1230.                                             }
  1231.                                             // rogues
  1232.                                             if (addRogues.enabled && checkProperties(addRogues.botDifficulty) && checkProperties(addRogues.botChance) && (addRogues.spawnWaves.initial.waves !== 0 || addRogues.spawnWaves.interval.waves !== 0)) {
  1233.                                                 if (!checkProperties(addRogues.openZones)) {
  1234.                                                     for (const zone in addRogues.openZones) {
  1235.                                                         addRogues.openZones[zone] = 1;
  1236.                                                     }
  1237.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for rogues on location [${location}]`, this.logError);
  1238.                                                     this.logger.log(`> reverted to all open zones being available for rogues on [${location}]`, this.logError);
  1239.                                                 }
  1240.                                                 let timeInterval = addRogues.spawnWaves.interval.time;
  1241.                                                 const addTimeInterval = timeInterval;
  1242.                                                 let countInterval = 0;
  1243.                                                 let zoneArray = generateWeightArray(addRogues.openZones);
  1244.                                                 let difficultyArray = generateWeightArray(addRogues.botDifficulty);
  1245.                                                 for (let i = 0; i < addRogues.spawnWaves.initial.waves + addRogues.spawnWaves.interval.waves; i++) {
  1246.                                                     const randomAmount = generateRandomNumberFromSequence(addRogues.botAmountPerSpawnWave);
  1247.                                                     let randomTime = generateRandomInteger(addRogues.spawnWaves.spawnDelay.min, addRogues.spawnWaves.spawnDelay.max);
  1248.                                                     if (addRogues.botChance.min < 0 || addRogues.botChance.min > 100) {
  1249.                                                         addRogues.botChance.min = 0;
  1250.                                                     }
  1251.                                                     else if (addRogues.botChance.max < 0 || addRogues.botChance.max > 100) {
  1252.                                                         addRogues.botChance.max = 100;
  1253.                                                     }
  1254.                                                     const randomChance = generateRandomInteger(addRogues.botChance.min, addRogues.botChance.max);
  1255.                                                     if (i < Math.abs(addRogues.spawnWaves.initial.waves - addRogues.spawnWaves.interval.wavesPerInterval)) {
  1256.                                                         timeInterval = addRogues.spawnWaves.initial.time;
  1257.                                                     }
  1258.                                                     else {
  1259.                                                         countInterval++;
  1260.                                                     }
  1261.                                                     if (randomTime + timeInterval < 0) {
  1262.                                                         randomTime = 0;
  1263.                                                     }
  1264.                                                     if (zoneArray.length == 0) {
  1265.                                                         zoneArray = generateWeightArray(addRogues.openZones);
  1266.                                                     }
  1267.                                                     if (difficultyArray.length == 0) {
  1268.                                                         difficultyArray = generateWeightArray(addRogues.botDifficulty);
  1269.                                                     }
  1270.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  1271.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1272.                                                     countAddRogue++;
  1273.                                                     initSpawns.push(this.generateBot("exUsec", randomChance, randomZone, randomDifficulty, "exUsec", randomAmount, randomTime + timeInterval, null, "", "", 0));
  1274.                                                     if (countInterval == addRogues.spawnWaves.interval.wavesPerInterval) {
  1275.                                                         timeInterval += addTimeInterval;
  1276.                                                         countInterval = 0;
  1277.                                                     }
  1278.                                                 }
  1279.                                             }
  1280.                                             // bloodhounds
  1281.                                             if (addBloodhounds.enabled && checkProperties(addBloodhounds.botDifficulty) && checkProperties(addBloodhounds.botChance) && (addBloodhounds.spawnWaves.initial.waves !== 0 || addBloodhounds.spawnWaves.interval.waves !== 0)) {
  1282.                                                 if (!checkProperties(addBloodhounds.openZones)) {
  1283.                                                     for (const zone in addBloodhounds.openZones) {
  1284.                                                         addBloodhounds.openZones[zone] = 1;
  1285.                                                     }
  1286.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for bloodhounds on location [${location}]`, this.logError);
  1287.                                                     this.logger.log(`> reverted to all open zones being available for bloodhounds on [${location}]`, this.logError);
  1288.                                                 }
  1289.                                                 let timeInterval = addBloodhounds.spawnWaves.interval.time;
  1290.                                                 const addTimeInterval = timeInterval;
  1291.                                                 let countInterval = 0;
  1292.                                                 let zoneArray = generateWeightArray(addBloodhounds.openZones);
  1293.                                                 let difficultyArray = generateWeightArray(addBloodhounds.botDifficulty);
  1294.                                                 for (let i = 0; i < addBloodhounds.spawnWaves.initial.waves + addBloodhounds.spawnWaves.interval.waves; i++) {
  1295.                                                     const randomAmount = generateRandomNumberFromSequence(addBloodhounds.botAmountPerSpawnWave);
  1296.                                                     let randomTime = generateRandomInteger(addBloodhounds.spawnWaves.spawnDelay.min, addBloodhounds.spawnWaves.spawnDelay.max);
  1297.                                                     if (addBloodhounds.botChance.min < 0 || addBloodhounds.botChance.min > 100) {
  1298.                                                         addBloodhounds.botChance.min = 0;
  1299.                                                     }
  1300.                                                     else if (addBloodhounds.botChance.max < 0 || addBloodhounds.botChance.max > 100) {
  1301.                                                         addBloodhounds.botChance.max = 100;
  1302.                                                     }
  1303.                                                     const randomChance = generateRandomInteger(addBloodhounds.botChance.min, addBloodhounds.botChance.max);
  1304.                                                     if (i < Math.abs(addBloodhounds.spawnWaves.initial.waves - addBloodhounds.spawnWaves.interval.wavesPerInterval)) {
  1305.                                                         timeInterval = addBloodhounds.spawnWaves.initial.time;
  1306.                                                     }
  1307.                                                     else {
  1308.                                                         countInterval++;
  1309.                                                     }
  1310.                                                     if (randomTime + timeInterval < 0) {
  1311.                                                         randomTime = 0;
  1312.                                                     }
  1313.                                                     if (zoneArray.length == 0) {
  1314.                                                         zoneArray = generateWeightArray(addBloodhounds.openZones);
  1315.                                                     }
  1316.                                                     if (difficultyArray.length == 0) {
  1317.                                                         difficultyArray = generateWeightArray(addBloodhounds.botDifficulty);
  1318.                                                     }
  1319.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  1320.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1321.                                                     countAddBloodhound++;
  1322.                                                     initSpawns.push(this.generateBot("arenaFighterEvent", randomChance, randomZone, randomDifficulty, "arenaFighterEvent", randomAmount, randomTime + timeInterval, null, "", "", 0));
  1323.                                                     if (countInterval == addBloodhounds.spawnWaves.interval.wavesPerInterval) {
  1324.                                                         timeInterval += addTimeInterval;
  1325.                                                         countInterval = 0;
  1326.                                                     }
  1327.                                                 }
  1328.                                             }
  1329.                                             // weird scavs
  1330.                                             if (addWeirdScavs.enabled && checkProperties(addWeirdScavs.botDifficulty) && checkProperties(addWeirdScavs.botChance) && (addWeirdScavs.spawnWaves.initial.waves !== 0 || addWeirdScavs.spawnWaves.interval.waves !== 0)) {
  1331.                                                 if (!checkProperties(addWeirdScavs.openZones)) {
  1332.                                                     for (const zone in addWeirdScavs.openZones) {
  1333.                                                         addWeirdScavs.openZones[zone] = 1;
  1334.                                                     }
  1335.                                                     this.logger.log(`Mod: ${package_json_1.default.name} error: failed to load an open zone from "${generatorSpawnSystemArray[randomGeneratorPreset]}" for weird scavs on location [${location}]`, this.logError);
  1336.                                                     this.logger.log(`> reverted to all open zones being available for weird scavs on [${location}]`, this.logError);
  1337.                                                 }
  1338.                                                 let timeInterval = addWeirdScavs.spawnWaves.interval.time;
  1339.                                                 const addTimeInterval = timeInterval;
  1340.                                                 let countInterval = 0;
  1341.                                                 let zoneArray = generateWeightArray(addWeirdScavs.openZones);
  1342.                                                 let difficultyArray = generateWeightArray(addWeirdScavs.botDifficulty);
  1343.                                                 for (let i = 0; i < addWeirdScavs.spawnWaves.initial.waves + addWeirdScavs.spawnWaves.interval.waves; i++) {
  1344.                                                     const randomAmount = generateRandomNumberFromSequence(addWeirdScavs.botAmountPerSpawnWave);
  1345.                                                     let randomTime = generateRandomInteger(addWeirdScavs.spawnWaves.spawnDelay.min, addWeirdScavs.spawnWaves.spawnDelay.max);
  1346.                                                     if (addWeirdScavs.botChance.min < 0 || addWeirdScavs.botChance.min > 100) {
  1347.                                                         addWeirdScavs.botChance.min = 0;
  1348.                                                     }
  1349.                                                     else if (addWeirdScavs.botChance.max < 0 || addWeirdScavs.botChance.max > 100) {
  1350.                                                         addWeirdScavs.botChance.max = 100;
  1351.                                                     }
  1352.                                                     const randomChance = generateRandomInteger(addWeirdScavs.botChance.min, addWeirdScavs.botChance.max);
  1353.                                                     if (i < Math.abs(addWeirdScavs.spawnWaves.initial.waves - addWeirdScavs.spawnWaves.interval.wavesPerInterval)) {
  1354.                                                         timeInterval = addWeirdScavs.spawnWaves.initial.time;
  1355.                                                     }
  1356.                                                     else {
  1357.                                                         countInterval++;
  1358.                                                     }
  1359.                                                     if (randomTime + timeInterval < 0) {
  1360.                                                         randomTime = 0;
  1361.                                                     }
  1362.                                                     if (zoneArray.length == 0) {
  1363.                                                         zoneArray = generateWeightArray(addWeirdScavs.openZones);
  1364.                                                     }
  1365.                                                     if (difficultyArray.length == 0) {
  1366.                                                         difficultyArray = generateWeightArray(addWeirdScavs.botDifficulty);
  1367.                                                     }
  1368.                                                     const randomZone = removeElementFromWeightArray(zoneArray);
  1369.                                                     const randomDifficulty = removeElementFromWeightArray(difficultyArray);
  1370.                                                     countAddWeirdScav++;
  1371.                                                     initSpawns.push(this.generateBot("crazyAssaultEvent", randomChance, randomZone, randomDifficulty, "crazyAssaultEvent", randomAmount, randomTime + timeInterval, null, "", "", 0));
  1372.                                                     if (countInterval == addWeirdScavs.spawnWaves.interval.wavesPerInterval) {
  1373.                                                         timeInterval += addTimeInterval;
  1374.                                                         countInterval = 0;
  1375.                                                     }
  1376.                                                 }
  1377.                                             }
  1378.                                         }
  1379.                                     }
  1380.                                     else {
  1381.                                         this.logger.log(`Mod: ${package_json_1.default.name} failed to load a spawn preset from "config.json" for location [${location}]`, this.logError);
  1382.                                         this.logger.log(`> reverted location [${location}] to default sp-tarkov spawn waves`, this.logError);
  1383.                                     }
  1384.                                 }
  1385.                                 // main spawn system
  1386.                                 if (mainSpawnSystemArray.length != 0) {
  1387.                                     const importMainFile = require(`../db/locations/${location}/main/presets/${mainSpawnSystemArray[randomMainPreset]}.${"json"}`);
  1388.                                     if (this.config.betterSpawnsPlus.locations[location].main.enabled && countRandomChanceToDisableMainPreset <= 1) {
  1389.                                         if (location != "labs") {
  1390.                                             for (const pmc in importMainFile.pmcs) {
  1391.                                                 if (importMainFile.randomize.enabled) {
  1392.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.pmcs.difficulty);
  1393.                                                     importMainFile.pmcs[pmc].Time = importMainFile.pmcs[pmc].Time + generateRandomInteger(importMainFile.randomize.pmcs.spawnDelay.min, importMainFile.randomize.pmcs.spawnDelay.max);
  1394.                                                     importMainFile.pmcs[pmc].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1395.                                                     importMainFile.pmcs[pmc].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1396.                                                     if (importMainFile.pmcs[pmc].Time < 0 && importMainFile.pmcs[pmc].Time != -1) {
  1397.                                                         importMainFile.pmcs[pmc].Time = 0;
  1398.                                                     }
  1399.                                                 }
  1400.                                                 initSpawns.push(importMainFile.pmcs[pmc]);
  1401.                                             }
  1402.                                             for (const scav in importMainFile.scavs) {
  1403.                                                 if (importMainFile.randomize.enabled) {
  1404.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.scavs.difficulty);
  1405.                                                     importMainFile.scavs[scav].Time = importMainFile.scavs[scav].Time + generateRandomInteger(importMainFile.randomize.scavs.spawnDelay.min, importMainFile.randomize.scavs.spawnDelay.max);
  1406.                                                     importMainFile.scavs[scav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1407.                                                     importMainFile.scavs[scav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1408.                                                     if (importMainFile.scavs[scav].Time < 0 && importMainFile.scavs[scav].Time != -1) {
  1409.                                                         importMainFile.scavs[scav].Time = 0;
  1410.                                                     }
  1411.                                                 }
  1412.                                                 initSpawns.push(importMainFile.scavs[scav]);
  1413.                                             }
  1414.                                             for (const sniperScav in importMainFile.sniperScavs) {
  1415.                                                 if (importMainFile.randomize.enabled) {
  1416.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.sniperScavs.difficulty);
  1417.                                                     importMainFile.sniperScavs[sniperScav].Time = importMainFile.sniperScavs[sniperScav].Time + generateRandomInteger(importMainFile.randomize.sniperScavs.spawnDelay.min, importMainFile.randomize.sniperScavs.spawnDelay.max);
  1418.                                                     importMainFile.sniperScavs[sniperScav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1419.                                                     importMainFile.sniperScavs[sniperScav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1420.                                                     if (importMainFile.sniperScavs[sniperScav].Time < 0 && importMainFile.sniperScavs[sniperScav].Time != -1) {
  1421.                                                         importMainFile.sniperScavs[sniperScav].Time = 0;
  1422.                                                     }
  1423.                                                 }
  1424.                                                 initSpawns.push(importMainFile.sniperScavs[sniperScav]);
  1425.                                             }
  1426.                                             for (const boss in importMainFile.bosses) {
  1427.                                                 if (importMainFile.randomize.enabled) {
  1428.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.bosses.difficulty);
  1429.                                                     importMainFile.bosses[boss].Time = importMainFile.bosses[boss].Time + generateRandomInteger(importMainFile.randomize.bosses.spawnDelay.min, importMainFile.randomize.bosses.spawnDelay.max);
  1430.                                                     importMainFile.bosses[boss].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1431.                                                     importMainFile.bosses[boss].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1432.                                                     if (importMainFile.bosses[boss].Time < 0 && importMainFile.bosses[boss].Time != -1) {
  1433.                                                         importMainFile.bosses[boss].Time = 0;
  1434.                                                     }
  1435.                                                 }
  1436.                                                 if (this.config.betterSpawnsPlus.locations[location].main.enableBosses) {
  1437.                                                     initSpawns.push(importMainFile.bosses[boss]);
  1438.                                                 }
  1439.                                             }
  1440.                                             for (const cultist in importMainFile.cultists) {
  1441.                                                 if (importMainFile.randomize.enabled) {
  1442.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.cultists.difficulty);
  1443.                                                     importMainFile.cultists[cultist].Time = importMainFile.cultists[cultist].Time + generateRandomInteger(importMainFile.randomize.cultists.spawnDelay.min, importMainFile.randomize.cultists.spawnDelay.max);
  1444.                                                     importMainFile.cultists[cultist].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1445.                                                     importMainFile.cultists[cultist].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1446.                                                     if (importMainFile.cultists[cultist].Time < 0 && importMainFile.cultists[cultist].Time != -1) {
  1447.                                                         importMainFile.cultists[cultist].Time = 0;
  1448.                                                     }
  1449.                                                 }
  1450.                                                 initSpawns.push(importMainFile.cultists[cultist]);
  1451.                                             }
  1452.                                             for (const raider in importMainFile.raiders) {
  1453.                                                 if (importMainFile.randomize.enabled) {
  1454.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.raiders.difficulty);
  1455.                                                     importMainFile.raiders[raider].Time = importMainFile.raiders[raider].Time + generateRandomInteger(importMainFile.randomize.raiders.spawnDelay.min, importMainFile.randomize.raiders.spawnDelay.max);
  1456.                                                     importMainFile.raiders[raider].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1457.                                                     importMainFile.raiders[raider].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1458.                                                     if (importMainFile.raiders[raider].Time < 0 && importMainFile.raiders[raider].Time != -1) {
  1459.                                                         importMainFile.raiders[raider].Time = 0;
  1460.                                                     }
  1461.                                                 }
  1462.                                                 initSpawns.push(importMainFile.raiders[raider]);
  1463.                                             }
  1464.                                             for (const rogue in importMainFile.rogues) {
  1465.                                                 if (importMainFile.randomize.enabled) {
  1466.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.rogues.difficulty);
  1467.                                                     importMainFile.rogues[rogue].Time = importMainFile.rogues[rogue].Time + generateRandomInteger(importMainFile.randomize.rogues.spawnDelay.min, importMainFile.randomize.rogues.spawnDelay.max);
  1468.                                                     importMainFile.rogues[rogue].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1469.                                                     importMainFile.rogues[rogue].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1470.                                                     if (importMainFile.rogues[rogue].Time < 0 && importMainFile.rogues[rogue].Time != -1) {
  1471.                                                         importMainFile.rogues[rogue].Time = 0;
  1472.                                                     }
  1473.                                                 }
  1474.                                                 initSpawns.push(importMainFile.rogues[rogue]);
  1475.                                             }
  1476.                                             for (const bloodhound in importMainFile.bloodhounds) {
  1477.                                                 if (importMainFile.randomize.enabled) {
  1478.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.bloodhounds.difficulty);
  1479.                                                     importMainFile.bloodhounds[bloodhound].Time = importMainFile.bloodhounds[bloodhound].Time + generateRandomInteger(importMainFile.randomize.bloodhounds.spawnDelay.min, importMainFile.randomize.bloodhounds.spawnDelay.max);
  1480.                                                     importMainFile.bloodhounds[bloodhound].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1481.                                                     importMainFile.bloodhounds[bloodhound].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1482.                                                     if (importMainFile.bloodhounds[bloodhound].Time < 0 && importMainFile.bloodhounds[bloodhound].Time != -1) {
  1483.                                                         importMainFile.bloodhounds[bloodhound].Time = 0;
  1484.                                                     }
  1485.                                                 }
  1486.                                                 initSpawns.push(importMainFile.bloodhounds[bloodhound]);
  1487.                                             }
  1488.                                             for (const weirdScav in importMainFile.weirdScavs) {
  1489.                                                 if (importMainFile.randomize.enabled) {
  1490.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.weirdScavs.difficulty);
  1491.                                                     importMainFile.weirdScavs[weirdScav].Time = importMainFile.weirdScavs[weirdScav].Time + generateRandomInteger(importMainFile.randomize.weirdScavs.spawnDelay.min, importMainFile.randomize.weirdScavs.spawnDelay.max);
  1492.                                                     importMainFile.weirdScavs[weirdScav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1493.                                                     importMainFile.weirdScavs[weirdScav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1494.                                                     if (importMainFile.weirdScavs[weirdScav].Time < 0 && importMainFile.weirdScavs[weirdScav].Time != -1) {
  1495.                                                         importMainFile.weirdScavs[weirdScav].Time = 0;
  1496.                                                     }
  1497.                                                 }
  1498.                                                 initSpawns.push(importMainFile.weirdScavs[weirdScav]);
  1499.                                             }
  1500.                                         }
  1501.                                         else {
  1502.                                             for (const pmc in importMainFile.pmcs) {
  1503.                                                 if (importMainFile.randomize.enabled) {
  1504.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.pmcs.difficulty);
  1505.                                                     importMainFile.pmcs[pmc].Delay = importMainFile.pmcs[pmc].Delay + generateRandomInteger(importMainFile.randomize.pmcs.spawnDelay.min, importMainFile.randomize.pmcs.spawnDelay.max);
  1506.                                                     importMainFile.pmcs[pmc].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1507.                                                     importMainFile.pmcs[pmc].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1508.                                                     if (importMainFile.pmcs[pmc].Delay < 0 && importMainFile.pmcs[pmc].Delay != -1) {
  1509.                                                         importMainFile.pmcs[pmc].Delay = 0;
  1510.                                                     }
  1511.                                                 }
  1512.                                                 initSpawns.push(importMainFile.pmcs[pmc]);
  1513.                                             }
  1514.                                             for (const scav in importMainFile.scavs) {
  1515.                                                 if (importMainFile.randomize.enabled) {
  1516.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.scavs.difficulty);
  1517.                                                     importMainFile.scavs[scav].Delay = importMainFile.scavs[scav].Delay + generateRandomInteger(importMainFile.randomize.scavs.spawnDelay.min, importMainFile.randomize.scavs.spawnDelay.max);
  1518.                                                     importMainFile.scavs[scav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1519.                                                     importMainFile.scavs[scav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1520.                                                     if (importMainFile.scavs[scav].Delay < 0 && importMainFile.scavs[scav].Delay != -1) {
  1521.                                                         importMainFile.scavs[scav].Delay = 0;
  1522.                                                     }
  1523.                                                 }
  1524.                                                 initSpawns.push(importMainFile.scavs[scav]);
  1525.                                             }
  1526.                                             for (const sniperScav in importMainFile.sniperScavs) {
  1527.                                                 if (importMainFile.randomize.enabled) {
  1528.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.sniperScavs.difficulty);
  1529.                                                     importMainFile.sniperScavs[sniperScav].Delay = importMainFile.sniperScavs[sniperScav].Delay + generateRandomInteger(importMainFile.randomize.sniperScavs.spawnDelay.min, importMainFile.randomize.sniperScavs.spawnDelay.max);
  1530.                                                     importMainFile.sniperScavs[sniperScav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1531.                                                     importMainFile.sniperScavs[sniperScav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1532.                                                     if (importMainFile.sniperScavs[sniperScav].Delay < 0 && importMainFile.sniperScavs[sniperScav].Delay != -1) {
  1533.                                                         importMainFile.sniperScavs[sniperScav].Delay = 0;
  1534.                                                     }
  1535.                                                 }
  1536.                                                 initSpawns.push(importMainFile.sniperScavs[sniperScav]);
  1537.                                             }
  1538.                                             for (const boss in importMainFile.bosses) {
  1539.                                                 if (importMainFile.randomize.enabled) {
  1540.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.bosses.difficulty);
  1541.                                                     importMainFile.bosses[boss].Delay = importMainFile.bosses[boss].Delay + generateRandomInteger(importMainFile.randomize.bosses.spawnDelay.min, importMainFile.randomize.bosses.spawnDelay.max);
  1542.                                                     importMainFile.bosses[boss].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1543.                                                     importMainFile.bosses[boss].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1544.                                                     if (importMainFile.bosses[boss].Delay < 0 && importMainFile.bosses[boss].Delay != -1) {
  1545.                                                         importMainFile.bosses[boss].Delay = 0;
  1546.                                                     }
  1547.                                                 }
  1548.                                                 if (this.config.betterSpawnsPlus.locations[location].main.enableBosses) {
  1549.                                                     initSpawns.push(importMainFile.bosses[boss]);
  1550.                                                 }
  1551.                                             }
  1552.                                             for (const cultist in importMainFile.cultists) {
  1553.                                                 if (importMainFile.randomize.enabled) {
  1554.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.cultists.difficulty);
  1555.                                                     importMainFile.cultists[cultist].Delay = importMainFile.cultists[cultist].Delay + generateRandomInteger(importMainFile.randomize.cultists.spawnDelay.min, importMainFile.randomize.cultists.spawnDelay.max);
  1556.                                                     importMainFile.cultists[cultist].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1557.                                                     importMainFile.cultists[cultist].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1558.                                                     if (importMainFile.cultists[cultist].Delay < 0 && importMainFile.cultists[cultist].Delay != -1) {
  1559.                                                         importMainFile.cultists[cultist].Delay = 0;
  1560.                                                     }
  1561.                                                 }
  1562.                                                 initSpawns.push(importMainFile.cultists[cultist]);
  1563.                                             }
  1564.                                             for (const raider in importMainFile.raiders) {
  1565.                                                 if (importMainFile.randomize.enabled) {
  1566.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.raiders.difficulty);
  1567.                                                     importMainFile.raiders[raider].Delay = importMainFile.raiders[raider].Delay + generateRandomInteger(importMainFile.randomize.raiders.spawnDelay.min, importMainFile.randomize.raiders.spawnDelay.max);
  1568.                                                     importMainFile.raiders[raider].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1569.                                                     importMainFile.raiders[raider].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1570.                                                     if (importMainFile.raiders[raider].Delay < 0 && importMainFile.raiders[raider].Delay != -1) {
  1571.                                                         importMainFile.raiders[raider].Delay = 0;
  1572.                                                     }
  1573.                                                 }
  1574.                                                 initSpawns.push(importMainFile.raiders[raider]);
  1575.                                             }
  1576.                                             for (const rogue in importMainFile.rogues) {
  1577.                                                 if (importMainFile.randomize.enabled) {
  1578.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.rogues.difficulty);
  1579.                                                     importMainFile.rogues[rogue].Delay = importMainFile.rogues[rogue].Delay + generateRandomInteger(importMainFile.randomize.rogues.spawnDelay.min, importMainFile.randomize.rogues.spawnDelay.max);
  1580.                                                     importMainFile.rogues[rogue].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1581.                                                     importMainFile.rogues[rogue].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1582.                                                     if (importMainFile.rogues[rogue].Delay < 0 && importMainFile.rogues[rogue].Delay != -1) {
  1583.                                                         importMainFile.rogues[rogue].Delay = 0;
  1584.                                                     }
  1585.                                                 }
  1586.                                                 initSpawns.push(importMainFile.rogues[rogue]);
  1587.                                             }
  1588.                                             for (const bloodhound in importMainFile.bloodhounds) {
  1589.                                                 if (importMainFile.randomize.enabled) {
  1590.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.bloodhounds.difficulty);
  1591.                                                     importMainFile.bloodhounds[bloodhound].Delay = importMainFile.bloodhounds[bloodhound].Delay + generateRandomInteger(importMainFile.randomize.bloodhounds.spawnDelay.min, importMainFile.randomize.bloodhounds.spawnDelay.max);
  1592.                                                     importMainFile.bloodhounds[bloodhound].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1593.                                                     importMainFile.bloodhounds[bloodhound].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1594.                                                     if (importMainFile.bloodhounds[bloodhound].Delay < 0 && importMainFile.bloodhounds[bloodhound].Delay != -1) {
  1595.                                                         importMainFile.bloodhounds[bloodhound].Delay = 0;
  1596.                                                     }
  1597.                                                 }
  1598.                                                 initSpawns.push(importMainFile.bloodhounds[bloodhound]);
  1599.                                             }
  1600.                                             for (const weirdScav in importMainFile.weirdScavs) {
  1601.                                                 if (importMainFile.randomize.enabled) {
  1602.                                                     const randomDifficulty = generateWeightArray(importMainFile.randomize.weirdScavs.difficulty);
  1603.                                                     importMainFile.weirdScavs[weirdScav].Delay = importMainFile.weirdScavs[weirdScav].Delay + generateRandomInteger(importMainFile.randomize.weirdScavs.spawnDelay.min, importMainFile.randomize.weirdScavs.spawnDelay.max);
  1604.                                                     importMainFile.weirdScavs[weirdScav].BossDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1605.                                                     importMainFile.weirdScavs[weirdScav].BossEscortDifficult = randomDifficulty[Math.floor(Math.random() * randomDifficulty.length)];
  1606.                                                     if (importMainFile.weirdScavs[weirdScav].Delay < 0 && importMainFile.weirdScavs[weirdScav].Delay != -1) {
  1607.                                                         importMainFile.weirdScavs[weirdScav].Delay = 0;
  1608.                                                     }
  1609.                                                 }
  1610.                                                 initSpawns.push(importMainFile.weirdScavs[weirdScav]);
  1611.                                             }
  1612.                                         }
  1613.                                     }
  1614.                                 }
  1615.                                 else {
  1616.                                     this.logger.log(`Mod: ${package_json_1.default.name} failed to load a spawn preset from "config.json" for location [${location}]`, this.logError);
  1617.                                     this.logger.log(`> reverted location [${location}] to default sp-tarkov spawn waves`, this.logError);
  1618.                                 }
  1619.                                 if (this.config.betterSpawnsPlus.consoleLogs) {
  1620.                                     for (const spawn in initSpawns) {
  1621.                                         const bossName = initSpawns[spawn].BossName;
  1622.                                         if (bossName == "sptBear") {
  1623.                                             countBears++;
  1624.                                         }
  1625.                                         else if (bossName == "sptUsec") {
  1626.                                             countUsecs++;
  1627.                                         }
  1628.                                         else if (bossName == "assault") {
  1629.                                             countScavs++;
  1630.                                         }
  1631.                                         else if (bossName == "marksman") {
  1632.                                             countSniperScavs++;
  1633.                                         }
  1634.                                         else if (this.bossTypeArray.includes(bossName)) {
  1635.                                             countBosses++;
  1636.                                         }
  1637.                                         else if (bossName == "sectantPriest") {
  1638.                                             countCultists++;
  1639.                                         }
  1640.                                         else if (bossName == "pmcBot") {
  1641.                                             countRaiders++;
  1642.                                         }
  1643.                                         else if (bossName == "exUsec") {
  1644.                                             countRogues++;
  1645.                                         }
  1646.                                         else if (bossName == "arenaFighterEvent") {
  1647.                                             countBloodhounds++;
  1648.                                         }
  1649.                                         else if (bossName == "crazyAssaultEvent") {
  1650.                                             countWeirdScavs++;
  1651.                                         }
  1652.                                     }
  1653.                                     if (this.config.betterSpawnsPlus.locations[location].main.enabled && !this.config.betterSpawnsPlus.locations[location].spawnGenerator.enabled) {
  1654.                                         this.logger.log(` > [${location}]`, this.logInfo);
  1655.                                         this.logger.log(`  > loaded main preset file: "${mainSpawnSystemArray[randomMainPreset]}.json"`, this.logInfo);
  1656.                                         this.logger.log("  > total spawn waves:", this.logInfo);
  1657.                                         this.logger.log(`   > bears: ${countBears}, usecs: ${countUsecs}, scavs: ${countScavs}, sniper scavs: ${countSniperScavs}`, this.logInfo);
  1658.                                         this.logger.log(`   > bosses: ${countBosses}, cultists: ${countCultists}, raiders: ${countRaiders}, rogues: ${countRogues}`, this.logInfo);
  1659.                                         this.logger.log(`   > bloodhounds: ${countBloodhounds}, weird scavs: ${countWeirdScavs}`, this.logInfo);
  1660.                                     }
  1661.                                     if (!this.config.betterSpawnsPlus.locations[location].main.enabled && this.config.betterSpawnsPlus.locations[location].spawnGenerator.enabled) {
  1662.                                         this.logger.log(` > [${location}]`, this.logInfo);
  1663.                                         this.logger.log(`  > loaded spawn generator preset file: "${generatorSpawnSystemArray[randomGeneratorPreset]}.json"`, this.logInfo);
  1664.                                         this.logger.log("  > added spawn waves:", this.logInfo);
  1665.                                         this.logger.log(`   > bears: ${countAddBear}, usecs: ${countAddUsec}, scavs: ${countAddScav}, sniper scavs: ${countAddSniperScav}`, this.logInfo);
  1666.                                         this.logger.log(`   > bosses: ${countAddBoss}, cultists: ${countAddCultist}, raiders: ${countAddRaider}, rogues: ${countAddRogue}`, this.logInfo);
  1667.                                         this.logger.log(`   > bloodhounds: ${countAddBloodhound}, weird scavs: ${countWeirdScavs}`, this.logInfo);
  1668.                                     }
  1669.                                     if (this.config.betterSpawnsPlus.locations[location].main.enabled && this.config.betterSpawnsPlus.locations[location].spawnGenerator.enabled) {
  1670.                                         this.logger.log(` > [${location}]`, this.logInfo);
  1671.                                         if (countRandomChanceToDisableMainPreset == 0) {
  1672.                                             this.logger.log(`  > loaded main preset file: "${mainSpawnSystemArray[randomMainPreset]}.json"`, this.logInfo);
  1673.                                             this.logger.log(`  > loaded spawn generator preset file: "${generatorSpawnSystemArray[randomGeneratorPreset]}.json"`, this.logInfo);
  1674.                                         }
  1675.                                         else if (countRandomChanceToDisableMainPreset == 1) {
  1676.                                             this.logger.log(`  > loaded main preset file: "${mainSpawnSystemArray[randomMainPreset]}.json"`, this.logInfo);
  1677.                                             this.logger.log(`  > disabled spawn generator preset file: "${generatorSpawnSystemArray[randomGeneratorPreset]}.json"`, this.logDisable);
  1678.                                         }
  1679.                                         else if (countRandomChanceToDisableMainPreset == 2) {
  1680.                                             this.logger.log(`  > disabled main preset file: "${mainSpawnSystemArray[randomMainPreset]}.json"`, this.logDisable);
  1681.                                             this.logger.log(`  > loaded spawn generator preset file: "${generatorSpawnSystemArray[randomGeneratorPreset]}.json"`, this.logInfo);
  1682.                                         }
  1683.                                         this.logger.log("  > added spawn waves:", this.logInfo);
  1684.                                         this.logger.log(`   > bears: ${countAddBear}, usecs: ${countAddUsec}, scavs: ${countAddScav}, sniper scavs: ${countAddSniperScav}`, this.logInfo);
  1685.                                         this.logger.log(`   > bosses: ${countAddBoss}, cultists: ${countAddCultist}, raiders: ${countAddRaider}, rogues: ${countAddRogue}`, this.logInfo);
  1686.                                         this.logger.log(`   > bloodhounds: ${countAddBloodhound}, weird scavs: ${countAddWeirdScav}`, this.logInfo);
  1687.                                         this.logger.log("  > total spawn waves:", this.logInfo);
  1688.                                         this.logger.log(`   > bears: ${countBears}, usecs: ${countUsecs}, scavs: ${countScavs}, sniper scavs: ${countSniperScavs}`, this.logInfo);
  1689.                                         this.logger.log(`   > bosses: ${countBosses}, cultists: ${countCultists}, raiders: ${countRaiders}, rogues: ${countRogues}`, this.logInfo);
  1690.                                         this.logger.log(`   > bloodhounds: ${countBloodhounds}, weird scavs: ${countWeirdScavs}`, this.logInfo);
  1691.                                     }
  1692.                                 }
  1693.                                 if (this.globalOverrides.enabled) {
  1694.                                     for (const spawn in initSpawns) {
  1695.                                         const difficultyOverride = this.globalOverrides.botDifficulty;
  1696.                                         const chanceOverride = this.globalOverrides.botChance;
  1697.                                         switch (initSpawns[spawn].BossName) {
  1698.                                             case "sptBear":
  1699.                                             case "sptUsec":
  1700.                                                 if (difficultyOverride.pmcs.enabled) {
  1701.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.pmcs.difficulty;
  1702.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.pmcs.difficulty;
  1703.                                                 }
  1704.                                                 if (chanceOverride.pmcs.enabled) {
  1705.                                                     initSpawns[spawn].BossChance = chanceOverride.pmcs.chance;
  1706.                                                 }
  1707.                                                 break;
  1708.                                             case "assault":
  1709.                                                 if (difficultyOverride.scavs.enabled) {
  1710.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.scavs.difficulty;
  1711.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.scavs.difficulty;
  1712.                                                 }
  1713.                                                 if (chanceOverride.scavs.enabled) {
  1714.                                                     initSpawns[spawn].BossChance = chanceOverride.scavs.chance;
  1715.                                                 }
  1716.                                                 break;
  1717.                                             case "marksman":
  1718.                                                 if (difficultyOverride.sniperScavs.enabled) {
  1719.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.sniperScavs.difficulty;
  1720.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.sniperScavs.difficulty;
  1721.                                                 }
  1722.                                                 if (chanceOverride.sniperScavs.enabled) {
  1723.                                                     initSpawns[spawn].BossChance = chanceOverride.sniperScavs.chance;
  1724.                                                 }
  1725.                                                 break;
  1726.                                             case "sectantPriest":
  1727.                                                 if (difficultyOverride.cultists.enabled) {
  1728.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.cultists.difficulty;
  1729.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.cultists.difficulty;
  1730.                                                 }
  1731.                                                 if (chanceOverride.cultists.enabled) {
  1732.                                                     initSpawns[spawn].BossChance = chanceOverride.cultists.chance;
  1733.                                                 }
  1734.                                                 break;
  1735.                                             case "pmcBot":
  1736.                                                 if (difficultyOverride.raiders.enabled) {
  1737.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.raiders.difficulty;
  1738.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.raiders.difficulty;
  1739.                                                 }
  1740.                                                 if (chanceOverride.raiders.enabled) {
  1741.                                                     initSpawns[spawn].BossChance = chanceOverride.raiders.chance;
  1742.                                                 }
  1743.                                                 break;
  1744.                                             case "exUsec":
  1745.                                                 if (difficultyOverride.rogues.enabled) {
  1746.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.rogues.difficulty;
  1747.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.rogues.difficulty;
  1748.                                                 }
  1749.                                                 if (chanceOverride.rogues.enabled) {
  1750.                                                     initSpawns[spawn].BossChance = chanceOverride.rogues.chance;
  1751.                                                 }
  1752.                                                 break;
  1753.                                             case "arenaFighterEvent":
  1754.                                                 if (difficultyOverride.bloodhounds.enabled) {
  1755.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.bloodhounds.difficulty;
  1756.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.bloodhounds.difficulty;
  1757.                                                 }
  1758.                                                 if (chanceOverride.bloodhounds.enabled) {
  1759.                                                     initSpawns[spawn].BossChance = chanceOverride.bloodhounds.chance;
  1760.                                                 }
  1761.                                                 break;
  1762.                                             case "crazyAssaultEvent":
  1763.                                                 if (difficultyOverride.weirdScavs.enabled) {
  1764.                                                     initSpawns[spawn].BossDifficult = difficultyOverride.weirdScavs.difficulty;
  1765.                                                     initSpawns[spawn].BossEscortDifficult = difficultyOverride.weirdScavs.difficulty;
  1766.                                                 }
  1767.                                                 if (chanceOverride.weirdScavs.enabled) {
  1768.                                                     initSpawns[spawn].BossChance = chanceOverride.weirdScavs.chance;
  1769.                                                 }
  1770.                                                 break;
  1771.                                             default:
  1772.                                                 if (difficultyOverride.bosses.enabled) {
  1773.                                                     if (this.bossTypeArray.includes(initSpawns[spawn].BossName)) {
  1774.                                                         initSpawns[spawn].BossDifficult = difficultyOverride.bosses.difficulty;
  1775.                                                         initSpawns[spawn].BossEscortDifficult = difficultyOverride.bosses.difficulty;
  1776.                                                     }
  1777.                                                 }
  1778.                                                 if (chanceOverride.bosses.enabled) {
  1779.                                                     if (this.bossTypeArray.includes(initSpawns[spawn].BossName)) {
  1780.                                                         initSpawns[spawn].BossChance = chanceOverride.bosses.chance;
  1781.                                                     }
  1782.                                                 }
  1783.                                                 break;
  1784.                                         }
  1785.                                     }
  1786.                                 }
  1787.                                 const fileName = path.basename(path.dirname(__dirname.split('/').pop()));
  1788.                                 const spawnWavesFilePath = `${container.resolve("PreAkiModLoader").getModPath(fileName)}info/consoleOutput/spawnWaves/extended_logs_${location}_spawn_waves.json`;
  1789.                                 fs.writeFileSync(spawnWavesFilePath, '');
  1790.                                 fs.appendFileSync(spawnWavesFilePath, JSON.stringify(initSpawns, null, 4));
  1791.                             }
  1792.                             this.logger.log(`Mod: ${package_json_1.default.name}: successfully loaded with 3.7 fix`, this.logSuccess);
  1793.                         }
  1794.                     }
  1795.                     catch (error) {
  1796.                         this.logger.error(error.message);
  1797.                     }
  1798.                     return output;
  1799.                 }
  1800.             }
  1801.         ], "aki");
  1802.     }
  1803.     postDBLoad(container) {
  1804.         const logger = container.resolve("WinstonLogger");
  1805.         const configsBots = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.BOT);
  1806.         const configsInsurance = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.INSURANCE);
  1807.         const configsLocations = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.LOCATION);
  1808.         const configsRepairs = container.resolve("ConfigServer").getConfig(ConfigTypes_1.ConfigTypes.REPAIR);
  1809.         const databaseBots = container.resolve("DatabaseServer").getTables().bots;
  1810.         const databaseCustomization = container.resolve("DatabaseServer").getTables().templates.customization;
  1811.         const databaseGlobals = container.resolve("DatabaseServer").getTables().globals;
  1812.         const databaseHideout = container.resolve("DatabaseServer").getTables().hideout;
  1813.         const databaseItems = container.resolve("DatabaseServer").getTables().templates.items;
  1814.         const databaseLocations = container.resolve("DatabaseServer").getTables().locations;
  1815.         const databaseTraders = container.resolve("DatabaseServer").getTables().traders;
  1816.         const otherOptions = this.config.otherOptions;
  1817.         if (this.config.betterSpawnsPlus.enabled && otherOptions.enabled) {
  1818.             logger.log(`Mod: ${package_json_1.default.name}: spawn changes and other options enabled with 3.7 fix`, this.logSuccess);
  1819.         }
  1820.         else if (this.config.betterSpawnsPlus.enabled && !otherOptions.enabled) {
  1821.             logger.log(`Mod: ${package_json_1.default.name}: only spawn changes enabled with 3.7 fix`, this.logSuccess);
  1822.         }
  1823.         else if (!this.config.betterSpawnsPlus.enabled && otherOptions.enabled) {
  1824.             logger.log(`Mod: ${package_json_1.default.name}: only other options enabled with 3.7 fix`, this.logSuccess);
  1825.         }
  1826.         else {
  1827.             logger.log(`Mod: ${package_json_1.default.name}: disabled`, this.logDisable);
  1828.         }
  1829.         // other options
  1830.         if (otherOptions.enabled) {
  1831.             if (otherOptions.consoleLogs) {
  1832.                 this.logger.log("> [other options]: logs", this.logInfo);
  1833.                 if (otherOptions.misc.replaceTradersProfilePics || otherOptions.misc.replaceLauncherBackground) {
  1834.                     this.logger.log(" > [misc]", this.logInfo);
  1835.                 }
  1836.                 if (otherOptions.misc.replaceLauncherBackground) {
  1837.                     this.logger.log("  > replace launcher backgrounds: enabled", this.logInfo);
  1838.                 }
  1839.                 if (otherOptions.misc.replaceTradersProfilePics) {
  1840.                     this.logger.log("  > replace traders profile pics: enabled", this.logInfo);
  1841.                 }
  1842.             }
  1843.             // extractions
  1844.             if (otherOptions.extractions.enabled) {
  1845.                 if (otherOptions.consoleLogs) {
  1846.                     this.logger.log(" > [extractions]", this.logInfo);
  1847.                 }
  1848.                 // make all exfils open regardless of entry point
  1849.                 if (otherOptions.extractions.openAllExfilsRegardlessOfEntryPoint) {
  1850.                     for (const location in databaseLocations) {
  1851.                         switch (location) {
  1852.                             case "base":
  1853.                                 break;
  1854.                             case "bigmap":
  1855.                                 for (const exfil in databaseLocations[location].base.exits) {
  1856.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "Customs,Boiler Tanks";
  1857.                                 }
  1858.                                 break;
  1859.                             case "interchange":
  1860.                                 for (const exfil in databaseLocations[location].base.exits) {
  1861.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "MallSE,MallNW";
  1862.                                 }
  1863.                                 break;
  1864.                             case "lighthouse":
  1865.                                 for (const exfil in databaseLocations[location].base.exits) {
  1866.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "Tunnel,North";
  1867.                                 }
  1868.                                 break;
  1869.                             case "shoreline":
  1870.                                 for (const exfil in databaseLocations[location].base.exits) {
  1871.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "Village,Riverside";
  1872.                                 }
  1873.                                 break;
  1874.                             case "tarkovstreets":
  1875.                                 for (const exfil in databaseLocations[location].base.exits) {
  1876.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "E1_2,E2_3,E3_4,E4_5,E5_6,E6_1";
  1877.                                 }
  1878.                                 break;
  1879.                             case "woods":
  1880.                                 for (const exfil in databaseLocations[location].base.exits) {
  1881.                                     databaseLocations[location].base.exits[exfil].EntryPoints = "House,Old Station";
  1882.                                 }
  1883.                                 break;
  1884.                             default:
  1885.                                 break;
  1886.                         }
  1887.                     }
  1888.                     if (otherOptions.consoleLogs) {
  1889.                         this.logger.log("  > make all exfils open regardless of entry point: enabled", this.logInfo);
  1890.                     }
  1891.                 }
  1892.                 for (const i in databaseLocations) {
  1893.                     if (i !== "base") {
  1894.                         for (const x in databaseLocations[i].base.exits) {
  1895.                             // remove extraction restrictions
  1896.                             if (otherOptions.extractions.removeExtractionRestrictions) {
  1897.                                 if (databaseLocations[i].base.exits[x].Name !== "EXFIL_Train" && !databaseLocations[i].base.exits[x].Name.includes("lab") || databaseLocations[i].base.exits[x].Name === "lab_Vent") {
  1898.                                     if (databaseLocations[i].base.exits[x].RequiredSlot) {
  1899.                                         delete databaseLocations[i].base.exits[x].RequiredSlot;
  1900.                                     }
  1901.                                     databaseLocations[i].base.exits[x].PassageRequirement = "None";
  1902.                                     databaseLocations[i].base.exits[x].ExfiltrationType = "Individual";
  1903.                                     databaseLocations[i].base.exits[x].Id = "";
  1904.                                     databaseLocations[i].base.exits[x].Count = 0;
  1905.                                     databaseLocations[i].base.exits[x].RequirementTip = "";
  1906.                                 }
  1907.                             }
  1908.                             // make all extractions always available
  1909.                             if (otherOptions.extractions.allExtractionsAlwaysAvailable) {
  1910.                                 if (databaseLocations[i].base.exits[x].Name !== "EXFIL_Train") {
  1911.                                     databaseLocations[i].base.exits[x].Chance = 100;
  1912.                                 }
  1913.                             }
  1914.                         }
  1915.                     }
  1916.                 }
  1917.                 if (otherOptions.consoleLogs && otherOptions.extractions.removeExtractionRestrictions) {
  1918.                     this.logger.log("  > remove extraction restrictions: enabled", this.logInfo);
  1919.                 }
  1920.                 if (otherOptions.consoleLogs && otherOptions.extractions.allExtractionsAlwaysAvailable) {
  1921.                     this.logger.log("  > make all extractions always available: enabled", this.logInfo);
  1922.                 }
  1923.             }
  1924.             // loot
  1925.             if (otherOptions.loot.enabled) {
  1926.                 if (otherOptions.consoleLogs) {
  1927.                     this.logger.log(" > [loot]", this.logInfo);
  1928.                 }
  1929.                 for (const location of this.locationArray) {
  1930.                     if (location == "customs") {
  1931.                         databaseLocations.bigmap.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1932.                         configsLocations.looseLootMultiplier.bigmap = otherOptions.loot[location].looseLootMultiplier;
  1933.                         configsLocations.staticLootMultiplier.bigmap = otherOptions.loot[location].staticLootMultiplier;
  1934.                     }
  1935.                     if (location == "factory") {
  1936.                         databaseLocations.factory4_day.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1937.                         databaseLocations.factory4_night.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1938.                         configsLocations.looseLootMultiplier.factory4_day = otherOptions.loot[location].looseLootMultiplier;
  1939.                         configsLocations.looseLootMultiplier.factory4_night = otherOptions.loot[location].looseLootMultiplier;
  1940.                         configsLocations.staticLootMultiplier.factory4_day = otherOptions.loot[location].staticLootMultiplier;
  1941.                         configsLocations.staticLootMultiplier.factory4_night = otherOptions.loot[location].staticLootMultiplier;
  1942.                     }
  1943.                     if (location == "interchange" || location == "lighthouse" || location == "shoreline" || location == "woods") {
  1944.                         databaseLocations[location].base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1945.                         configsLocations.looseLootMultiplier[location] = otherOptions.loot[location].looseLootMultiplier;
  1946.                         configsLocations.staticLootMultiplier[location] = otherOptions.loot[location].staticLootMultiplier;
  1947.                     }
  1948.                     if (location == "labs") {
  1949.                         databaseLocations.laboratory.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1950.                         configsLocations.looseLootMultiplier.laboratory = otherOptions.loot[location].looseLootMultiplier;
  1951.                         configsLocations.staticLootMultiplier.laboratory = otherOptions.loot[location].staticLootMultiplier;
  1952.                     }
  1953.                     if (location == "reserve") {
  1954.                         databaseLocations.rezervbase.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1955.                         configsLocations.looseLootMultiplier.rezervbase = otherOptions.loot[location].looseLootMultiplier;
  1956.                         configsLocations.staticLootMultiplier.rezervbase = otherOptions.loot[location].staticLootMultiplier;
  1957.                     }
  1958.                     if (location == "streets") {
  1959.                         databaseLocations.tarkovstreets.base.GlobalLootChanceModifier = otherOptions.loot[location].globalLootChanceModifier;
  1960.                         configsLocations.looseLootMultiplier.tarkovstreets = otherOptions.loot[location].looseLootMultiplier;
  1961.                         configsLocations.staticLootMultiplier.tarkovstreets = otherOptions.loot[location].staticLootMultiplier;
  1962.                     }
  1963.                     if (otherOptions.consoleLogs) {
  1964.                         this.logger.log(`  > ${location}`, this.logInfo);
  1965.                         this.logger.log(`   > globalLootModifier: ${otherOptions.loot[location].globalLootChanceModifier}`, this.logInfo);
  1966.                         this.logger.log(`   > looseLootMultiplier: ${otherOptions.loot[location].looseLootMultiplier}`, this.logInfo);
  1967.                         this.logger.log(`   > staticLootMultiplier: ${otherOptions.loot[location].staticLootMultiplier}`, this.logInfo);
  1968.                     }
  1969.                 }
  1970.             }
  1971.             // items
  1972.             if (otherOptions.items.enabled) {
  1973.                 if (otherOptions.consoleLogs) {
  1974.                     this.logger.log(" > [items]", this.logInfo);
  1975.                 }
  1976.                 if (otherOptions.consoleLogs && (otherOptions.items.repairs.removeArmorDegradationFromRepairs || otherOptions.items.repairs.removeWeaponDegradationFromRepairs)) {
  1977.                     this.logger.log("  > repairs", this.logInfo);
  1978.                 }
  1979.                 // remove armor degradation from repairs
  1980.                 if (otherOptions.items.repairs.removeArmorDegradationFromRepairs) {
  1981.                     for (const armor in databaseGlobals.config.ArmorMaterials) {
  1982.                         databaseGlobals.config.ArmorMaterials[armor].MinRepairDegradation = 0;
  1983.                         databaseGlobals.config.ArmorMaterials[armor].MaxRepairDegradation = 0;
  1984.                         databaseGlobals.config.ArmorMaterials[armor].MinRepairKitDegradation = 0;
  1985.                         databaseGlobals.config.ArmorMaterials[armor].MaxRepairKitDegradation = 0;
  1986.                     }
  1987.                     if (otherOptions.consoleLogs) {
  1988.                         this.logger.log("   > remove armor degradation from repairs: enabled", this.logInfo);
  1989.                     }
  1990.                 }
  1991.                 // remove weapon degradation from repairs
  1992.                 if (otherOptions.items.repairs.removeWeaponDegradationFromRepairs) {
  1993.                     for (const weapon in databaseItems) {
  1994.                         if (databaseItems[weapon]._props.MaxRepairDegradation !== undefined && databaseItems[weapon]._props.MaxRepairKitDegradation !== undefined) {
  1995.                             this.itemData(container, weapon, "MinRepairDegradation", 0);
  1996.                             this.itemData(container, weapon, "MaxRepairDegradation", 0);
  1997.                             this.itemData(container, weapon, "MinRepairKitDegradation", 0);
  1998.                             this.itemData(container, weapon, "MaxRepairKitDegradation", 0);
  1999.                         }
  2000.                     }
  2001.                     if (otherOptions.consoleLogs) {
  2002.                         this.logger.log("   > remove weapon degradation from repairs: enabled", this.logInfo);
  2003.                     }
  2004.                 }
  2005.                 if (otherOptions.consoleLogs && (otherOptions.items.insurance.insuranceAllowedOnAllLocations || otherOptions.items.insurance.insuranceAllowedForAllItems)) {
  2006.                     this.logger.log("  > insurance", this.logInfo);
  2007.                 }
  2008.                 // allow insurance on all locations
  2009.                 if (otherOptions.items.insurance.insuranceAllowedOnAllLocations) {
  2010.                     this.altLocationArray.forEach(function (location) {
  2011.                         databaseLocations[location].base.Insurance = true;
  2012.                     });
  2013.                     if (otherOptions.consoleLogs) {
  2014.                         this.logger.log("   > allow insurance on all locations: enabled", this.logInfo);
  2015.                     }
  2016.                 }
  2017.                 for (const id in databaseItems) {
  2018.                     if (!this.getId([id])) {
  2019.                         const base = databaseItems[id];
  2020.                         // allow insurance for all items
  2021.                         if (otherOptions.items.insurance.insuranceAllowedForAllItems && base._props.IsAlwaysAvailableForInsurance !== undefined) {
  2022.                             this.itemData(container, id, "IsAlwaysAvailableForInsurance", true);
  2023.                         }
  2024.                         // remove weapon durability burn
  2025.                         if (otherOptions.items.gear.removeWeaponDurabilityBurn && base._props.DurabilityBurnModificator) {
  2026.                             this.itemData(container, id, "DurabilityBurnModificator", 0);
  2027.                         }
  2028.                         // remove weapon deterioration from bullets
  2029.                         if (otherOptions.items.gear.removeWeaponDeteriorationFromBullets && base._props.Deterioration) {
  2030.                             this.itemData(container, id, "Deterioration", 0);
  2031.                         }
  2032.                         // allow all items to be lootable
  2033.                         if (otherOptions.items.allowAllItemsToBelootable && base._props.Unlootable !== undefined) {
  2034.                             this.itemData(container, id, "Unlootable", false);
  2035.                         }
  2036.                         // make all items unexamined by default
  2037.                         if (otherOptions.items.allItemsUnexaminedByDefault && base._props.ExaminedByDefault !== undefined) {
  2038.                             this.itemData(container, id, "ExaminedByDefault", false);
  2039.                         }
  2040.                     }
  2041.                 }
  2042.                 if (otherOptions.consoleLogs && otherOptions.items.insurance.insuranceAllowedForAllItems) {
  2043.                     this.logger.log("   > allow insurance for all items: enabled", this.logInfo);
  2044.                 }
  2045.                 if (otherOptions.consoleLogs && (otherOptions.items.gear.removeWeaponDurabilityBurn || otherOptions.items.allowAllItemsToBelootable)) {
  2046.                     this.logger.log("  > gear", this.logInfo);
  2047.                 }
  2048.                 if (otherOptions.consoleLogs && otherOptions.items.gear.removeWeaponDurabilityBurn) {
  2049.                     this.logger.log("   > remove weapon durability burn: enabled", this.logInfo);
  2050.                 }
  2051.                 if (otherOptions.consoleLogs && otherOptions.items.gear.removeWeaponDeteriorationFromBullets) {
  2052.                     this.logger.log("   > remove weapon deterioration from bullets: enabled", this.logInfo);
  2053.                 }
  2054.                 if (otherOptions.consoleLogs && otherOptions.items.allowAllItemsToBelootable) {
  2055.                     this.logger.log("  > allow all items to be lootable: enabled", this.logInfo);
  2056.                 }
  2057.                 if (otherOptions.consoleLogs && otherOptions.items.allItemsUnexaminedByDefault) {
  2058.                     this.logger.log("  > make all items unexamined by default: enabled", this.logInfo);
  2059.                 }
  2060.                 if (otherOptions.consoleLogs) {
  2061.                     this.logger.log("  > keys", this.logInfo);
  2062.                     this.logger.log("   > labs access keycard", this.logInfo);
  2063.                 }
  2064.                 // remove labs access keycard requirement
  2065.                 if (otherOptions.items.keys.labsAccessKeycard.removeLabsReq) {
  2066.                     databaseLocations.laboratory.base.AccessKeys = [];
  2067.                     if (otherOptions.consoleLogs) {
  2068.                         this.logger.log("    > remove labs access keycard requirement: enabled", this.logInfo);
  2069.                     }
  2070.                 }
  2071.                 // set max number of uses for labs access keycard
  2072.                 const labsAccessKeycard = databaseItems["5c94bbff86f7747ee735c08f"];
  2073.                 labsAccessKeycard._props.MaximumNumberOfUsage = otherOptions.items.keys.labsAccessKeycard.maxNumberOfUses;
  2074.                 if (otherOptions.consoleLogs) {
  2075.                     this.logger.log(`    > max number of uses for labs access keycard: ${labsAccessKeycard._props.MaximumNumberOfUsage}`, this.logInfo);
  2076.                 }
  2077.             }
  2078.             // player
  2079.             if (otherOptions.player.enabled) {
  2080.                 if (otherOptions.consoleLogs) {
  2081.                     this.logger.log(" > [player]", this.logInfo);
  2082.                 }
  2083.                 // scav cooldown timer
  2084.                 databaseGlobals.config.SavagePlayCooldown = otherOptions.player.scavCooldownTimer * 60;
  2085.                 if (otherOptions.consoleLogs) {
  2086.                     this.logger.log(`  > scav cooldown timer: ${databaseGlobals.config.SavagePlayCooldown / 60} minutes`, this.logInfo);
  2087.                 }
  2088.                 // health in-raid
  2089.                 if (otherOptions.player.healthInRaid.enabled) {
  2090.                     databaseGlobals.config.Health.Effects.Existence.EnergyLoopTime = otherOptions.player.healthInRaid.energyLoopTime * 60;
  2091.                     databaseGlobals.config.Health.Effects.Existence.EnergyDamage = otherOptions.player.healthInRaid.energyDecreasePerLoopTime;
  2092.                     databaseGlobals.config.Health.Effects.Existence.HydrationLoopTime = otherOptions.player.healthInRaid.hydrationLoopTime * 60;
  2093.                     databaseGlobals.config.Health.Effects.Existence.HydrationDamage = otherOptions.player.healthInRaid.hydrationDecreasePerLoopTime;
  2094.                     if (otherOptions.consoleLogs) {
  2095.                         this.logger.log("  > health in-raid:", this.logInfo);
  2096.                         this.logger.log(`   > energy loop time: ${databaseGlobals.config.Health.Effects.Existence.EnergyLoopTime} seconds`, this.logInfo);
  2097.                         this.logger.log(`   > energy damage: ${databaseGlobals.config.Health.Effects.Existence.EnergyDamage}`, this.logInfo);
  2098.                         this.logger.log(`   > hydration loop time: ${databaseGlobals.config.Health.Effects.Existence.HydrationLoopTime} seconds`, this.logInfo);
  2099.                         this.logger.log(`   > hydration damage: ${databaseGlobals.config.Health.Effects.Existence.HydrationDamage}`, this.logInfo);
  2100.                     }
  2101.                 }
  2102.                 // health in-hideout
  2103.                 if (otherOptions.player.healthInHideout.enabled) {
  2104.                     databaseGlobals.config.Health.Effects.Regeneration.Energy = otherOptions.player.healthInHideout.energyRegenerationLoopTime;
  2105.                     databaseGlobals.config.Health.Effects.Regeneration.Hydration = otherOptions.player.healthInHideout.hydrationRegenerationLoopTime;
  2106.                     const bodyHealth = databaseGlobals.config.Health.Effects.Regeneration.BodyHealth;
  2107.                     const regenerationMultiplier = otherOptions.player.healthInHideout.healthRegenerationMultiplier;
  2108.                     bodyHealth.Chest.Value = bodyHealth.Chest.Value * regenerationMultiplier;
  2109.                     bodyHealth.Head.Value = bodyHealth.Head.Value * regenerationMultiplier;
  2110.                     bodyHealth.LeftArm.Value = bodyHealth.LeftArm.Value * regenerationMultiplier;
  2111.                     bodyHealth.LeftLeg.Value = bodyHealth.LeftLeg.Value * regenerationMultiplier;
  2112.                     bodyHealth.RightArm.Value = bodyHealth.RightArm.Value * regenerationMultiplier;
  2113.                     bodyHealth.RightLeg.Value = bodyHealth.RightLeg.Value * regenerationMultiplier;
  2114.                     bodyHealth.Stomach.Value = bodyHealth.Stomach.Value * regenerationMultiplier;
  2115.                     if (otherOptions.consoleLogs) {
  2116.                         this.logger.log("  > health in-hideout:", this.logInfo);
  2117.                         this.logger.log(`   > energy regeneration time: ${databaseGlobals.config.Health.Effects.Regeneration.Energy} minutes`, this.logInfo);
  2118.                         this.logger.log(`   > hydration regeneration time: ${databaseGlobals.config.Health.Effects.Regeneration.Hydration} minutes`, this.logInfo);
  2119.                         this.logger.log(`   > health regeneration multiplier: ${regenerationMultiplier}`, this.logInfo);
  2120.                     }
  2121.                     // remove free heals and trial levels
  2122.                     if (otherOptions.player.healthInHideout.removeFreeHealTrialLevelsAndRaids) {
  2123.                         databaseGlobals.config.Health.HealPrice.TrialLevels = 0;
  2124.                         databaseGlobals.config.Health.HealPrice.TrialRaids = 0;
  2125.                         if (otherOptions.consoleLogs) {
  2126.                             this.logger.log("   > remove free heals and trial levels: enabled", this.logInfo);
  2127.                         }
  2128.                     }
  2129.                 }
  2130.             }
  2131.             // allow all tactical clothing for both factions
  2132.             if (otherOptions.player.tacticalClothing.allowAllTacticalClothingForBothFactions) {
  2133.                 for (const customization in databaseCustomization) {
  2134.                     const customizationData = databaseCustomization[customization];
  2135.                     if (customizationData._parent === "5cd944d01388ce000a659df9" || customizationData._parent === "5cd944ca1388ce03a44dc2a4") {
  2136.                         customizationData._props.Side = ["Usec", "Bear"];
  2137.                     }
  2138.                 }
  2139.                 if (otherOptions.consoleLogs) {
  2140.                     this.logger.log("   > allow all tactical clothing for both factions: enabled", this.logInfo);
  2141.                 }
  2142.             }
  2143.             // unlock all tactical clothing for free
  2144.             if (otherOptions.player.tacticalClothing.unlockAllTacticalClothingForFree) {
  2145.                 for (const trader in databaseTraders) {
  2146.                     if (this.getId([trader]) === false && databaseTraders[trader].suits) {
  2147.                         for (const suit in databaseTraders[trader].suits) {
  2148.                             const suitId = databaseTraders[trader].suits[suit];
  2149.                             suitId.requirements.loyaltyLevel = 1;
  2150.                             suitId.requirements.profileLevel = 1;
  2151.                             suitId.requirements.standing = 0;
  2152.                             suitId.requirements.skillRequirements = [];
  2153.                             suitId.requirements.questRequirements = [];
  2154.                             suitId.requirements.itemRequirements = [];
  2155.                         }
  2156.                     }
  2157.                 }
  2158.                 if (otherOptions.consoleLogs) {
  2159.                     this.logger.log("   > unlock all tactical clothing for free: enabled", this.logInfo);
  2160.                 }
  2161.             }
  2162.             // hideout
  2163.             if (otherOptions.hideout.enabled) {
  2164.                 if (otherOptions.consoleLogs) {
  2165.                     this.logger.log(" > [hideout]", this.logInfo);
  2166.                 }
  2167.                 const constructionMultiplier = otherOptions.hideout.constructionTimeMultiplier;
  2168.                 const productionMultiplier = otherOptions.hideout.productionTimeMultiplier;
  2169.                 // construction multiplier
  2170.                 for (const data in databaseHideout.areas) {
  2171.                     const areaData = databaseHideout.areas[data];
  2172.                     if (this.getId([areaData._id]) === false) {
  2173.                         for (const i in areaData.stages) {
  2174.                             if (areaData.stages[i].constructionTime > 0) {
  2175.                                 areaData.stages[i].constructionTime = areaData.stages[i].constructionTime * constructionMultiplier;
  2176.                             }
  2177.                         }
  2178.                     }
  2179.                 }
  2180.                 if (otherOptions.consoleLogs) {
  2181.                     this.logger.log(`  > construction multiplier: ${constructionMultiplier}`, this.logInfo);
  2182.                 }
  2183.                 // production multiplier
  2184.                 for (const data in databaseHideout.production) {
  2185.                     const productionData = databaseHideout.production[data];
  2186.                     if (this.getId([productionData._id]) === false) {
  2187.                         if (!productionData.continuous && productionData.productionTime > 1) {
  2188.                             productionData.productionTime = productionData.productionTime * productionMultiplier;
  2189.                         }
  2190.                     }
  2191.                 }
  2192.                 for (const data in databaseHideout.scavcase) {
  2193.                     const scavcaseData = databaseHideout.scavcase[data];
  2194.                     if (this.getId([scavcaseData._id]) === false) {
  2195.                         if (scavcaseData.ProductionTime > 1) {
  2196.                             scavcaseData.ProductionTime = scavcaseData.ProductionTime * productionMultiplier;
  2197.                         }
  2198.                     }
  2199.                 }
  2200.                 if (otherOptions.consoleLogs) {
  2201.                     this.logger.log(`  > production multiplier: ${productionMultiplier}`, this.logInfo);
  2202.                 }
  2203.             }
  2204.             // traders
  2205.             if (otherOptions.traders.enabled) {
  2206.                 if (otherOptions.consoleLogs) {
  2207.                     this.logger.log(" > [traders]", this.logInfo);
  2208.                 }
  2209.                 // repair cost multiplier for all traders
  2210.                 configsRepairs.priceMultiplier = otherOptions.traders.repairCostMultiplierForAllTraders;
  2211.                 if (otherOptions.consoleLogs) {
  2212.                     this.logger.log(`  > repair cost multiplier for all traders: ${configsRepairs.priceMultiplier}`, this.logInfo);
  2213.                 }
  2214.                 // prapor insurance
  2215.                 configsInsurance.insuranceMultiplier[Traders_1.Traders.PRAPOR] = otherOptions.traders.prapor.insurance.insuranceMultiplier;
  2216.                 configsInsurance.returnChancePercent[Traders_1.Traders.PRAPOR] = otherOptions.traders.prapor.insurance.returnChancePercent;
  2217.                 databaseTraders[Traders_1.Traders.PRAPOR].base.insurance.min_return_hour = otherOptions.traders.prapor.insurance.minReturnTime;
  2218.                 databaseTraders[Traders_1.Traders.PRAPOR].base.insurance.max_return_hour = otherOptions.traders.prapor.insurance.maxReturnTime;
  2219.                 if (otherOptions.consoleLogs) {
  2220.                     this.logger.log("  > prapor insurance", this.logInfo);
  2221.                     this.logger.log(`   > multiplier: ${configsInsurance.insuranceMultiplier[Traders_1.Traders.PRAPOR]}`, this.logInfo);
  2222.                     this.logger.log(`   > return chance: ${configsInsurance.returnChancePercent[Traders_1.Traders.PRAPOR]}%`, this.logInfo);
  2223.                     this.logger.log(`   > min return time: ${databaseTraders[Traders_1.Traders.PRAPOR].base.insurance.min_return_hour} hours`, this.logInfo);
  2224.                     this.logger.log(`   > max return time: ${databaseTraders[Traders_1.Traders.PRAPOR].base.insurance.max_return_hour} hours`, this.logInfo);
  2225.                 }
  2226.                 // therapist insurance
  2227.                 configsInsurance.insuranceMultiplier[Traders_1.Traders.THERAPIST] = otherOptions.traders.therapist.insurance.insuranceMultiplier;
  2228.                 configsInsurance.returnChancePercent[Traders_1.Traders.THERAPIST] = otherOptions.traders.therapist.insurance.returnChancePercent;
  2229.                 databaseTraders[Traders_1.Traders.THERAPIST].base.insurance.min_return_hour = otherOptions.traders.therapist.insurance.minReturnTime;
  2230.                 databaseTraders[Traders_1.Traders.THERAPIST].base.insurance.max_return_hour = otherOptions.traders.therapist.insurance.maxReturnTime;
  2231.                 if (otherOptions.consoleLogs) {
  2232.                     this.logger.log("  > therapist insurance", this.logInfo);
  2233.                     this.logger.log(`   > multiplier: ${configsInsurance.insuranceMultiplier[Traders_1.Traders.THERAPIST]}`, this.logInfo);
  2234.                     this.logger.log(`   > return chance: ${configsInsurance.returnChancePercent[Traders_1.Traders.THERAPIST]}%`, this.logInfo);
  2235.                     this.logger.log(`   > min return time: ${databaseTraders[Traders_1.Traders.THERAPIST].base.insurance.min_return_hour} hours`, this.logInfo);
  2236.                     this.logger.log(`   > max return time: ${databaseTraders[Traders_1.Traders.THERAPIST].base.insurance.max_return_hour} hours`, this.logInfo);
  2237.                 }
  2238.                 // trader repair quality
  2239.                 databaseTraders[Traders_1.Traders.MECHANIC].base.repair.quality = otherOptions.traders.mechanic.repairs.repairQualityDegradation;
  2240.                 databaseTraders[Traders_1.Traders.PRAPOR].base.repair.quality = otherOptions.traders.prapor.repairs.repairQualityDegradation;
  2241.                 databaseTraders[Traders_1.Traders.SKIER].base.repair.quality = otherOptions.traders.skier.repairs.repairQualityDegradation;
  2242.                 if (otherOptions.consoleLogs) {
  2243.                     this.logger.log(`  > mechanic repair quality degradation: ${databaseTraders[Traders_1.Traders.MECHANIC].base.repair.quality}`, this.logInfo);
  2244.                     this.logger.log(`  > prapor repair quality degradation: ${databaseTraders[Traders_1.Traders.PRAPOR].base.repair.quality}`, this.logInfo);
  2245.                     this.logger.log(`  > skier repair quality degradation: ${databaseTraders[Traders_1.Traders.SKIER].base.repair.quality}`, this.logInfo);
  2246.                 }
  2247.             }
  2248.             // bots
  2249.             if (otherOptions.bots.enabled) {
  2250.                 if (otherOptions.consoleLogs) {
  2251.                     this.logger.log(" > [bots]", this.logInfo);
  2252.                 }
  2253.                 // bot level relative to player level
  2254.                 configsBots.pmc.botRelativeLevelDeltaMax = otherOptions.bots.pmc.botLevelRelativeToPlayerLevel;
  2255.                 // chance same side is hostile
  2256.                 configsBots.pmc.chanceSameSideIsHostilePercent = otherOptions.bots.pmc.chanceSameFactionIsHostile;
  2257.                 if (otherOptions.consoleLogs) {
  2258.                     this.logger.log("  > pmc:", this.logInfo);
  2259.                     this.logger.log(`   > bot level relative to player level: ${configsBots.pmc.botRelativeLevelDeltaMax}`, this.logInfo);
  2260.                     this.logger.log(`   > chance same side is hostile: ${configsBots.pmc.chanceSameSideIsHostilePercent}%`, this.logInfo);
  2261.                 }
  2262.                 // custom pmc dog tags
  2263.                 if (otherOptions.bots.pmc.customPmcDogTags) {
  2264.                     for (const types in this.pmcTypeArray) {
  2265.                         const type = this.pmcTypeArray[types];
  2266.                         databaseBots.types[type].firstName = pmcDogTags_json_1.default.usernames;
  2267.                         databaseBots.types[type].lastName = [];
  2268.                     }
  2269.                     if (otherOptions.consoleLogs) {
  2270.                         this.logger.log("   > custom pmc dog tags: enabled", this.logInfo);
  2271.                     }
  2272.                 }
  2273.                 // make pmcs not randomly talk
  2274.                 if (otherOptions.bots.pmc.makePmcsNotRandomlyTalk) {
  2275.                     for (const types in this.pmcTypeArray) {
  2276.                         const type = this.pmcTypeArray[types];
  2277.                         this.botDifficultyArray.forEach(function (difficulty) {
  2278.                             databaseBots.types[type].difficulty[difficulty].Grenade.CHANCE_TO_NOTIFY_ENEMY_GR_100 = 0;
  2279.                             databaseBots.types[type].difficulty[difficulty].Mind.CAN_TALK = false;
  2280.                             databaseBots.types[type].difficulty[difficulty].Mind.CAN_THROW_REQUESTS = false;
  2281.                             databaseBots.types[type].difficulty[difficulty].Mind.TALK_WITH_QUERY = false;
  2282.                             databaseBots.types[type].difficulty[difficulty].Mind.MIN_TALK_DELAY = 100;
  2283.                             databaseBots.types[type].difficulty[difficulty].Patrol.TALK_DELAY = 50;
  2284.                             databaseBots.types[type].difficulty[difficulty].Patrol.TALK_DELAY_BIG = 50.1;
  2285.                             databaseBots.types[type].difficulty[difficulty].Patrol.MIN_DIST_TO_CLOSE_TALK = 100;
  2286.                             databaseBots.types[type].difficulty[difficulty].Patrol.MIN_DIST_TO_CLOSE_TALK_SQR = 10000;
  2287.                         });
  2288.                     }
  2289.                     if (otherOptions.consoleLogs) {
  2290.                         this.logger.log("   > make pmcs not randomly talk: enabled", this.logInfo);
  2291.                     }
  2292.                 }
  2293.             }
  2294.             if (otherOptions.consoleLogs) {
  2295.                 this.logger.log(`Mod: ${package_json_1.default.name}: waiting for launcher to start...`, this.logSuccess);
  2296.             }
  2297.         }
  2298.         else {
  2299.             return;
  2300.         }
  2301.     }
  2302.     postAkiLoad(container) {
  2303.         const fileName = path.basename(path.dirname(__dirname.split('/').pop()));
  2304.         const filePath = `${container.resolve("PreAkiModLoader").getModPath(fileName)}res/`;
  2305.         const otherOptions = this.config.otherOptions;
  2306.         fs.readdir(filePath, (err, files) => {
  2307.             files.forEach(file => {
  2308.                 if (otherOptions.enabled) {
  2309.                     const imageId = file.split('/').pop().split('.').shift();
  2310.                     if (otherOptions.misc.replaceTradersProfilePics) {
  2311.                         container.resolve("ImageRouter").addRoute(`/files/trader/avatar/${imageId}`, `${filePath}${imageId}.${"jpg"}`);
  2312.                     }
  2313.                     const imageArray = [
  2314.                         "eft00", "eft01", "eft02", "eft03", "eft04", "eft05", "eft06", "eft07", "eft08", "eft09", "eft10", "eft11", "eft12", "eft13",
  2315.                         "eft14", "eft15", "eft16", "eft17", "eft18", "eft19", "eft20", "eft21", "eft22", "eft23", "eft24", "eft25", "eft26", "eft27"
  2316.                     ];
  2317.                     const random = Math.floor(Math.random() * imageArray.length);
  2318.                     if (otherOptions.misc.replaceLauncherBackground) {
  2319.                         container.resolve("ImageRouter").addRoute(`/files/launcher/${imageId}`, `${filePath}${imageArray[random]}.${"jpg"}`);
  2320.                     }
  2321.                 }
  2322.             });
  2323.         });
  2324.     }
  2325.     itemData(container, id, data, value) {
  2326.         const databaseItems = container.resolve("DatabaseServer").getTables().templates.items;
  2327.         databaseItems[id]._props[data] = value;
  2328.     }
  2329.     getId(id) {
  2330.         if (this.idArray.length > 0) {
  2331.             for (const isId in this.idArray) {
  2332.                 if (id.includes(this.idArray[isId])) {
  2333.                     return true;
  2334.                 }
  2335.                 else {
  2336.                     return false;
  2337.                 }
  2338.             }
  2339.         }
  2340.         else {
  2341.             return false;
  2342.         }
  2343.     }
  2344.     generateBot(type, chance, zones, difficulty, supportType, sequence, time, supports, triggerId, triggerName, delay) {
  2345.         return {
  2346.             "BossName": type,
  2347.             "BossChance": chance,
  2348.             "BossZone": zones,
  2349.             "BossPlayer": false,
  2350.             "BossDifficult": difficulty,
  2351.             "BossEscortType": supportType,
  2352.             "BossEscortDifficult": difficulty,
  2353.             "BossEscortAmount": sequence,
  2354.             "Time": time,
  2355.             "Supports": supports,
  2356.             "TriggerId": triggerId,
  2357.             "TriggerName": triggerName,
  2358.             "Delay": delay,
  2359.             "RandomTimeSpawn": false
  2360.         };
  2361.     }
  2362. }
  2363. module.exports = { mod: new BetterSpawnsPlus() };
  2364.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement