diff --git a/Valens-AIO/Valens-AIO ReadMe.pdf b/Valens-AIO/Valens-AIO ReadMe.pdf index 80437c6..a1b7f7c 100644 Binary files a/Valens-AIO/Valens-AIO ReadMe.pdf and b/Valens-AIO/Valens-AIO ReadMe.pdf differ diff --git a/Valens-AIO/config/config.json b/Valens-AIO/config/config.json index 88b3170..19f143f 100644 --- a/Valens-AIO/config/config.json +++ b/Valens-AIO/config/config.json @@ -1,5 +1,5 @@ { - "DebugMode": false, + "DebugMode": true, "ammo": { @@ -416,18 +416,18 @@ "examinedByDefault": false, "removeBackpackFilter": true, "removeKeyUsageMax": false, - "dollarsMaxStack": 50000, - "eurosMaxStack": 50000, - "roublesMaxStack": 500000, + "roublesMaxStack": 10000000, + "dollarsMaxStack": 1000000, + "eurosMaxStack": 1000000, "weightModifier": 1 }, "locations": { - "allExtractsAvailable": false, - "exfilTime": 8, - "extractionsExtended": false, - "noExtractRestrictions": false + "allExtractsAvailable": true, + "exfilTime": 3, + "extractionsExtended": true, + "noExtractRestrictions": true }, "loot": @@ -437,6 +437,11 @@ "staticLootMultiplier": 1 }, + "quests": + { + "onlyFoundInRaid": true + }, + "raid": { "carExtractBaseStandingGain": 0.25, diff --git a/Valens-AIO/config/config.ts b/Valens-AIO/config/config.ts index 29aa47b..884d3e0 100644 --- a/Valens-AIO/config/config.ts +++ b/Valens-AIO/config/config.ts @@ -12,6 +12,7 @@ export interface Config locations: Locations loot: Loot raid: Raid + quests: Quests prewipeEvents: PrewipeEvents weapons: Weapons } @@ -122,36 +123,36 @@ export interface Containers export interface CommonContainers { enabled: boolean - AMMO_CASE: Case - DOCUMENTS_CASE: Case - DOGTAG_CASE: Case - GRENADE_CASE: Case - INJECTOR_CASE: Case - ITEM_CASE: Case - KEY_TOOL: Case - KEYCARD_HOLDER: Case - SCAV_JUNKBOX: Case - MAGAZINE_CASE: Case - MEDICINE_CASE: Case - MONEY_CASE: Case - HOLODILNICK_THERMAL_BAG: Case - PISTOL_CASE: Case - SICC_ORGANIZATIONAL_POUCH: Case - SIMPLE_WALLET: Case - THICC_ITEM_CASE: Case - THICC_WEAPON_CASE: Case - WEAPON_CASE: Case - WZ_WALLET: Case + ammoCase: Case + docsCase: Case + dogsCase: Case + grenadeCase: Case + injectorCase: Case + itemCase: Case + keyTool: Case + keycardHolder: Case + scavJunkbox: Case + magsCase: Case + medsCase: Case + moneyCase: Case + holodilnick: Case + pistolCase: Case + siccCase: Case + wallet: Case + thiccItemCase: Case + thiccWeaponCase: Case + weaponCase: Case + wzWallet: Case } export interface SecuredContainers { enabled: boolean - ALPHA: Case - BETA: Case - EPSILON: Case - GAMMA: Case - KAPPA: Case + alpha: Case + beta: Case + epsilon: Case + gamma: Case + kappa: Case } export interface Case @@ -300,6 +301,11 @@ export interface Loot looseLootMultiplier: number staticLootMultiplier: number } + +export interface Quests +{ + onlyFoundInRaid: boolean +} export interface Raid { diff --git a/Valens-AIO/package.json b/Valens-AIO/package.json index b64a1be..d0a066d 100644 --- a/Valens-AIO/package.json +++ b/Valens-AIO/package.json @@ -1,6 +1,6 @@ { "name": "Valens-AIO", - "version": "1.2.1", + "version": "1.2.3", "main": "src/mod.js", "license": "CC BY-NC-ND 4.0", "author": "Valens", diff --git a/Valens-AIO/src/items.ts b/Valens-AIO/src/items.ts index c87461a..0c35c1c 100644 --- a/Valens-AIO/src/items.ts +++ b/Valens-AIO/src/items.ts @@ -1,6 +1,7 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { Config } from "../config/config"; import { Logger } from "./logger"; +import { Money } from "@spt-aki/models/enums/Money" export class Items { @@ -89,22 +90,22 @@ export class Items // Roubles Max Stack if (this.mod.roublesMaxStack != 500000) { - this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.mod.roublesMaxStack; - this.logger.info(`Rouble Max Stack set to ${this.mod.roublesMaxStack}`); + this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.modConfig.items.roublesMaxStack; + this.logger.info(`Rouble Max Stack set to ${this.mod.roublesMaxStack}`, true); } // Dollars Max Stack if (this.mod.dollarsMaxStack != 50000) { - this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.mod.dollarsMaxStack; - this.logger.info(`Dollar Max Stack set to ${this.mod.dollarsMaxStack}`); + this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.modConfig.items.dollarsMaxStack; + this.logger.info(`Dollar Max Stack set to ${this.mod.dollarsMaxStack}`, true); } // Euros Max Stack if (this.mod.eurosMaxStack != 50000) { - this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.mod.eurosMaxStack; - this.logger.info(`Euro Max Stack set to ${this.mod.eurosMaxStack}`); + this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.modConfig.items.eurosMaxStack; + this.logger.info(`Euro Max Stack set to ${this.mod.eurosMaxStack}`, true); } } diff --git a/Valens-AIO/src/locations.ts b/Valens-AIO/src/locations.ts index 32b025d..c9931ca 100644 --- a/Valens-AIO/src/locations.ts +++ b/Valens-AIO/src/locations.ts @@ -18,138 +18,163 @@ export class Locations public updateLocations(): void { const mod = this.modConfig.locations; - const maps = this.tables.locations; // Gives all extracts 100% chance to spawn. if (mod.allExtractsAvailable) { - for (const map in maps) - { - if (map.toLowerCase() === "base") - { - continue; - } - - const mapBase = this.tables.locations[map].base; - if (mapBase.Locked === true || mapBase?.EnabledCoop === undefined) - { - continue; - } - - for (const i in mapBase.exits) - { - const exit = mapBase[i]; - exit.Chance = 100; - } - } - this.logger.info("All Extracts Are Available @ 100% Chance"); + this.allExtractsAvailable(); + this.logger.info("All Extracts @ 100% Chance to Spawn"); } // Sets exfil/extract timer to config. if (mod.exfilTime != 8) { - for (const map in maps) - { - if (map.toLowerCase() === "base") - { - continue; - } - - const mapBase = this.tables.locations[map].base; - if (mapBase.Locked === true || mapBase?.EnabledCoop === undefined) - { - continue; - } - - for (const i in mapBase.exits) - { - const exit = mapBase[i]; - exit.ExfiltrationTime = mod.exfilTime; - } - } - this.logger.info(`Exfil Time is set to ${mod.exfilTime} seconds`); + this.exfilTime(); + this.logger.info(`Exfil Time Set to ${mod.exfilTime}`); } // Remove extracts restrictions if (mod.noExtractRestrictions) { - for (const i in maps) - { - if (i !== "base") - { - for (const x in maps[i].base.exits) - { - if (maps[i].base.exits[x].Name !== "EXFIL_Train" && - !maps[i].base.exits[x].Name.includes("lab") || - maps[i].base.exits[x].Name === "lab_Vent") - { - if (maps[i].base.exits[x].PassageRequirement !== "None") - { - maps[i].base.exits[x].PassageRequirement = "None"; - } - if (maps[i].base.exits[x].ExfiltrationType !== "Individual") - { - maps[i].base.exits[x].ExfiltrationType = "Individual"; - } - if (maps[i].base.exits[x].Id !== "") - { - maps[i].base.exits[x].Id = ""; - } - if (maps[i].base.exits[x].Count !== 0) - { - maps[i].base.exits[x].Count = 0; - } - if (maps[i].base.exits[x].RequirementTip !== "") - { - maps[i].base.exits[x].RequirementTip = ""; - } - if (maps[i].base.exits[x].RequiredSlot) - { - delete maps[i].base.exits[x].RequiredSlot; - } - } - } - } - } + this.noExtractRestrictions(); + this.logger.info("No Extract Restrictions Enabled"); } // Make all extractions of the map available regardless of the infill if (mod.extractionsExtended) { - for (const map in maps) + this.extractionsExtended(); + this.logger.info("Extractions Are Extended"); + } + } + + private allExtractsAvailable(): void + { + const locations = this.tables.locations; + for (const i in locations) + { + if (i !== "base") { - switch (map) + for (const x in locations[i].base.exits) { - case "base": - break; - case "bigmap": - for (const extract in maps[map].base.exits) + if (locations[i].base.exits[x].Name !== "EXFIL_Train") + { + if (locations[i].base.exits[x].Chance !== 100) { - maps[map].base.exits[extract].EntryPoints = "Customs,Boiler Tanks"; + locations[i].base.exits[x].Chance = 100; } - break; - case "interchange": - for (const extract in maps[map].base.exits) - { - maps[map].base.exits[extract].EntryPoints = "MallSE,MallNW"; - } - break; - case "shoreline": - for (const extract in maps[map].base.exits) - { - maps[map].base.exits[extract].EntryPoints = "Village,Riverside"; - } - break; - case "woods": - for (const extract in maps[map].base.exits) - { - maps[map].base.exits[extract].EntryPoints = "House,Old Station"; - } - break; - default: - break; + } } } } } + + private exfilTime(): void + { + const maps = this.tables.locations; + const mod = this.modConfig.locations; + for (const map in maps) + { + if (map.toLowerCase() === "base") + { + continue; + } + + const mapBase = this.tables.locations[map].base; + if (mapBase.Locked === true || mapBase?.EnabledCoop === undefined) + { + continue; + } + + for (const exit of mapBase.exits) + { + exit.ExfiltrationTime = mod.exfilTime; + } + } + } + + private noExtractRestrictions(): void + { + const locations = this.tables.locations; + for (const i in locations) + { + if (i !== "base") + { + for (const x in locations[i].base.exits) + { + if (locations[i].base.exits[x].Name !== "EXFIL_Train" && + !locations[i].base.exits[x].Name.includes("lab") || + locations[i].base.exits[x].Name === "lab_Vent") + { + if (locations[i].base.exits[x].PassageRequirement !== "None") + { + locations[i].base.exits[x].PassageRequirement = "None"; + } + if (locations[i].base.exits[x].ExfiltrationType !== "Individual") + { + locations[i].base.exits[x].ExfiltrationType = "Individual"; + } + if (locations[i].base.exits[x].Id !== "") + { + locations[i].base.exits[x].Id = ""; + } + if (locations[i].base.exits[x].Count !== 0) + { + locations[i].base.exits[x].Count = 0; + } + if (locations[i].base.exits[x].RequirementTip !== "") + { + locations[i].base.exits[x].RequirementTip = ""; + } + if (locations[i].base.exits[x].RequiredSlot) + { + delete locations[i].base.exits[x].RequiredSlot; + } + } + } + } + + } + } + + private extractionsExtended(): void + { + + const locations = this.tables.locations; + for (const map in locations) + { + switch (map) + { + case "base": + break; + case "bigmap": + for (const extract in locations[map].base.exits) + { + locations[map].base.exits[extract].EntryPoints = "Customs,Boiler Tanks"; + } + break; + case "interchange": + for (const extract in locations[map].base.exits) + { + locations[map].base.exits[extract].EntryPoints = "MallSE,MallNW"; + } + break; + case "shoreline": + for (const extract in locations[map].base.exits) + { + locations[map].base.exits[extract].EntryPoints = "Village,Riverside"; + } + break; + case "woods": + for (const extract in locations[map].base.exits) + { + locations[map].base.exits[extract].EntryPoints = "House,Old Station"; + } + break; + default: + break; + } + } + + } } \ No newline at end of file diff --git a/Valens-AIO/src/mod.ts b/Valens-AIO/src/mod.ts index b8879cd..721be32 100644 --- a/Valens-AIO/src/mod.ts +++ b/Valens-AIO/src/mod.ts @@ -25,6 +25,8 @@ import { Logger } from "./logger"; import { Config } from "../config/config"; import { Weapons } from "./weapons"; import { Containers } from "./containers"; +import { Locations } from "./locations"; +import { Quests } from "./quests"; //import { Airdrop } from "./airdrop"; class ValensAIO implements IPostDBLoadMod @@ -84,8 +86,14 @@ class ValensAIO implements IPostDBLoadMod const items = new Items(vLogger, this.databaseServer); items.updateItems(); + const locations = new Locations(vLogger, this.databaseServer); + locations.updateLocations(); + const loot = new Loot(vLogger, this.databaseServer, this.locationConfig); - loot.updateLoot(); + loot.updateLoot(); + + const quests = new Quests(vLogger, this.databaseServer); + quests.updateQuests(); const raid = new Raid(vLogger, this.databaseServer, this.inRaidConfig); raid.updateRaid(); diff --git a/Valens-AIO/src/quests.ts b/Valens-AIO/src/quests.ts new file mode 100644 index 0000000..e437f4c --- /dev/null +++ b/Valens-AIO/src/quests.ts @@ -0,0 +1,48 @@ +import { Logger } from "winston"; +import { Config } from "../config/config"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; + +export class Quests +{ + private modConfig: Config = require("../config/config.json"); + private logger: Logger; + private databaseServer: DatabaseServer; + + constructor(logger: Logger, databaseServer: DatabaseServer) + { + this.logger = logger; + this.databaseServer = databaseServer.getTables(); + } + + public updateQuests(): void + { + if (!this.modConfig.quests.onlyFoundInRaid) + { + this.onlyFoundInRaid(); + this.logger.info("Quest Items No Longer Need Be Found In Raid"); + } + } + + // Updates the weight modifier (as a multiplier) for all items in database/templates/items.json + private onlyFoundInRaid(): void + { + const quests = this.databaseServer.templates.quests; + + for (const questid in quests) + { + const questsAvailableForFinishConditions = quests[questid].conditions.AvailableForFinish; + const findItemConditions = questsAvailableForFinishConditions.find(x=>x.parent === "FindItem"); + + if (!findItemConditions) + { + continue; + } + + if (findItemConditions._props.onlyFoundInRaid) + { + findItemConditions._props.onlyFoundInRaid = false; + } + } + } + +}