Changes to catch the git up to v1.2.3

This commit is contained in:
VforValens 2022-08-06 14:44:30 -04:00
parent 67f86859c4
commit 70d01dc474
8 changed files with 241 additions and 148 deletions

Binary file not shown.

View File

@ -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,

View File

@ -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
@ -301,6 +302,11 @@ export interface Loot
staticLootMultiplier: number
}
export interface Quests
{
onlyFoundInRaid: boolean
}
export interface Raid
{
carExtractBaseStandingGain: number

View File

@ -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",

View File

@ -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);
}
}

View File

@ -18,36 +18,61 @@ 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)
{
this.exfilTime();
this.logger.info(`Exfil Time Set to ${mod.exfilTime}`);
}
// Remove extracts restrictions
if (mod.noExtractRestrictions)
{
this.noExtractRestrictions();
this.logger.info("No Extract Restrictions Enabled");
}
// Make all extractions of the map available regardless of the infill
if (mod.extractionsExtended)
{
this.extractionsExtended();
this.logger.info("Extractions Are Extended");
}
}
private allExtractsAvailable(): 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")
{
if (locations[i].base.exits[x].Chance !== 100)
{
locations[i].base.exits[x].Chance = 100;
}
}
}
}
}
}
private exfilTime(): void
{
const maps = this.tables.locations;
const mod = this.modConfig.locations;
for (const map in maps)
{
if (map.toLowerCase() === "base")
@ -61,95 +86,95 @@ export class Locations
continue;
}
for (const i in mapBase.exits)
for (const exit of mapBase.exits)
{
const exit = mapBase[i];
exit.ExfiltrationTime = mod.exfilTime;
}
}
this.logger.info(`Exfil Time is set to ${mod.exfilTime} seconds`);
}
// Remove extracts restrictions
if (mod.noExtractRestrictions)
private noExtractRestrictions(): void
{
for (const i in maps)
const locations = this.tables.locations;
for (const i in locations)
{
if (i !== "base")
{
for (const x in maps[i].base.exits)
for (const x in locations[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 (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 (maps[i].base.exits[x].PassageRequirement !== "None")
if (locations[i].base.exits[x].PassageRequirement !== "None")
{
maps[i].base.exits[x].PassageRequirement = "None";
locations[i].base.exits[x].PassageRequirement = "None";
}
if (maps[i].base.exits[x].ExfiltrationType !== "Individual")
if (locations[i].base.exits[x].ExfiltrationType !== "Individual")
{
maps[i].base.exits[x].ExfiltrationType = "Individual";
locations[i].base.exits[x].ExfiltrationType = "Individual";
}
if (maps[i].base.exits[x].Id !== "")
if (locations[i].base.exits[x].Id !== "")
{
maps[i].base.exits[x].Id = "";
locations[i].base.exits[x].Id = "";
}
if (maps[i].base.exits[x].Count !== 0)
if (locations[i].base.exits[x].Count !== 0)
{
maps[i].base.exits[x].Count = 0;
locations[i].base.exits[x].Count = 0;
}
if (maps[i].base.exits[x].RequirementTip !== "")
if (locations[i].base.exits[x].RequirementTip !== "")
{
maps[i].base.exits[x].RequirementTip = "";
locations[i].base.exits[x].RequirementTip = "";
}
if (maps[i].base.exits[x].RequiredSlot)
if (locations[i].base.exits[x].RequiredSlot)
{
delete maps[i].base.exits[x].RequiredSlot;
}
}
delete locations[i].base.exits[x].RequiredSlot;
}
}
}
}
// Make all extractions of the map available regardless of the infill
if (mod.extractionsExtended)
}
}
private extractionsExtended(): void
{
for (const map in maps)
const locations = this.tables.locations;
for (const map in locations)
{
switch (map)
{
case "base":
break;
case "bigmap":
for (const extract in maps[map].base.exits)
for (const extract in locations[map].base.exits)
{
maps[map].base.exits[extract].EntryPoints = "Customs,Boiler Tanks";
locations[map].base.exits[extract].EntryPoints = "Customs,Boiler Tanks";
}
break;
case "interchange":
for (const extract in maps[map].base.exits)
for (const extract in locations[map].base.exits)
{
maps[map].base.exits[extract].EntryPoints = "MallSE,MallNW";
locations[map].base.exits[extract].EntryPoints = "MallSE,MallNW";
}
break;
case "shoreline":
for (const extract in maps[map].base.exits)
for (const extract in locations[map].base.exits)
{
maps[map].base.exits[extract].EntryPoints = "Village,Riverside";
locations[map].base.exits[extract].EntryPoints = "Village,Riverside";
}
break;
case "woods":
for (const extract in maps[map].base.exits)
for (const extract in locations[map].base.exits)
{
maps[map].base.exits[extract].EntryPoints = "House,Old Station";
locations[map].base.exits[extract].EntryPoints = "House,Old Station";
}
break;
default:
break;
}
}
}
}
}

View File

@ -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,9 +86,15 @@ 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();
const quests = new Quests(vLogger, this.databaseServer);
quests.updateQuests();
const raid = new Raid(vLogger, this.databaseServer, this.inRaidConfig);
raid.updateRaid();

48
Valens-AIO/src/quests.ts Normal file
View File

@ -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;
}
}
}
}