Fixed many bugs/issues, and finally v1.1.0 is actually release ready.

This commit is contained in:
VforValens 2022-08-04 14:43:56 -04:00
parent 5c3f24dbdb
commit b90d5ffbbc
3 changed files with 68 additions and 52 deletions

Binary file not shown.

View File

@ -125,7 +125,7 @@ export class Bots
// Prewipe Events
if (this.modConfig.prewipe_events.killaOnFactory)
{
const killaWave = this.botConfig.other.createBossWave("bossKilla", 100, "followerBully", 0, locations.factory4_day.base.OpenZones);
const killaWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.factory4_day.base.OpenZones);
this.tables.locations.factory4_day.base.BossLocationSpawn.push(killaWave);
locations.factory4_night.base.BossLocationSpawn.push(killaWave);
this.logger.info("Killa Prewipe Event Enabled");
@ -133,13 +133,13 @@ export class Bots
if (this.modConfig.prewipe_events.allBossesOnReserve)
{
let bossWave = this.botConfig.other.createBossWave("bossKilla", 100, "followerBully", 0, locations.rezervbase.base.OpenZones);
let bossWave = this.createBossWave("bossKilla", 100, "followerBully", 0, locations.rezervbase.base.OpenZones);
locations.rezervbase.base.BossLocationSpawn.push(bossWave);
bossWave = this.botConfig.other.createBossWave("bossBully", 100, "followerBully", 4, locations.rezervbase.base.OpenZones);
bossWave = this.createBossWave("bossBully", 100, "followerBully", 4, locations.rezervbase.base.OpenZones);
locations.rezervbase.base.BossLocationSpawn.push(bossWave);
bossWave = this.botConfig.other.createBossWave("bossKojaniy", 100, "followerKojaniy", 2, locations.rezervbase.base.OpenZones);
bossWave = this.createBossWave("bossKojaniy", 100, "followerKojaniy", 2, locations.rezervbase.base.OpenZones);
locations.rezervbase.base.BossLocationSpawn.push(bossWave);
bossWave = this.botConfig.other.createBossWave("bossSanitar", 100, "followerSanitar", 2, locations.rezervbase.base.OpenZones);
bossWave = this.createBossWave("bossSanitar", 100, "followerSanitar", 2, locations.rezervbase.base.OpenZones);
locations.rezervbase.base.BossLocationSpawn.push(bossWave);
this.logger.info("Bosses On Reserve Prewipe Event Enabled");
}
@ -400,4 +400,19 @@ export class Bots
return lootItems;
}
private createBossWave(role: string, chance: number, followers: string, escortAmount: number, zones: string): any
{
return {
"BossName": role,
"BossChance": chance,
"BossZone": zones,
"BossPlayer": false,
"BossDifficult": "normal",
"BossEscortType": followers,
"BossEscortDifficult": "normal",
"BossEscortAmount": escortAmount,
"Time": -1
}
}
}

View File

@ -5,97 +5,99 @@ export class Items
{
private modConfig = require("../config/config.json")
private logger: Logger;
private databaseServer: DatabaseServer;
private tables: DatabaseServer;
private wtf;
private items;
constructor(logger: Logger, databaseServer: DatabaseServer)
{
this.logger = logger;
this.databaseServer = databaseServer;
this.tables = databaseServer;
}
public updateItems(): void
{
const items = Object.values(this.databaseServer.getTables().templates.items);
const mod = this.modConfig.items;
this.items = this.tables.getTables().templates.items;
this.wtf = this.modConfig.items;
// Weight Modifier. Multiplier of Weight *= modConfig.weightModifier
if (mod.weightModifier != 1)
if (this.wtf.weightModifier != 1)
{
this.updateWeight();
this.logger.info(`Weight Multipler patched to ${mod.weightModifier}`);
this.logger.info(`Weight Multipler patched to ${this.wtf.weightModifier}`);
}
// Removes the ExcludedFilter on Backpacks
// which in turn enables common containers to spawn in the loot pool of AI.
if (mod.removeBackpackFilter)
if (this.wtf.removeBackpackFilter)
{
this.updateBackpacks();
this.logger.info(`Backpack Restrictions Removed: ${mod.removeBackpackFilter}`)
this.logger.info(`Backpack Restrictions Removed: ${this.wtf.removeBackpackFilter}`)
}
// Standard Stash Size Changes
if (mod.standardStash.vertical != 28 || mod.standardStash.horizontal != 10)
if (this.wtf.standardStash.vertical != 28 || this.wtf.standardStash.horizontal != 10)
{
items["566abbc34bdc2d92178b4576"]._grids._props.cellsV = mod.standardStash.vertical;
items["566abbc34bdc2d92178b4576"]._grids._props.cellsH = mod.standardStash.horizontal;
this.logger.info(`Standard Stash Vertical changed to ${mod.standardStash.vertical}`);
this.logger.info(`Standard Stash Horizontal changed to ${mod.tandardStash.horizontal}`);
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsV = this.wtf.standardStash.vertical;
this.items["566abbc34bdc2d92178b4576"]._props.Grids[0]._props.cellsH = this.wtf.standardStash.horizontal;
this.logger.info(`Standard Stash Vertical changed to ${this.wtf.standardStash.vertical}`);
this.logger.info(`Standard Stash Horizontal changed to ${this.wtf.standardStash.horizontal}`);
}
// Left Behind Stash Size Changes
if (mod.behindStash.vertical != 38 || mod.behindStash.horizontal != 10)
if (this.wtf.behindStash.vertical != 38 || this.wtf.behindStash.horizontal != 10)
{
items["5811ce572459770cba1a34ea"]._grids._props.cellsV = mod.behindStash.vertical;
items["5811ce572459770cba1a34ea"]._grids._props.cellsH = mod.behindStash.horizontal;
this.logger.info(`Left Behind Stash Vertical changed to ${mod.behindStash.vertical}`);
this.logger.info(`Left Behind Stash Horizontal changed to ${mod.behindStash.horizontal}`);
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsV = this.wtf.behindStash.vertical;
this.items["5811ce572459770cba1a34ea"]._props.Grids[0]._props.cellsH = this.wtf.behindStash.horizontal;
this.logger.info(`Left Behind Stash Vertical changed to ${this.wtf.behindStash.vertical}`);
this.logger.info(`Left Behind Stash Horizontal changed to ${this.wtf.behindStash.horizontal}`);
}
// Prepare for Escape Stash Size Changes
if (mod.escapeStash.vertical != 48 || mod.escapeStash.horizontal != 10)
if (this.wtf.escapeStash.vertical != 48 || this.wtf.escapeStash.horizontal != 10)
{
items["5811ce662459770f6f490f32"]._grids._props.cellsV = mod.escapeStash.vertical;
items["5811ce662459770f6f490f32"]._grids._props.cellsH = mod.escapeStash.horizontal;
this.logger.info(`Prepare for Escape Stash Vertical changed to ${mod.escapeStash.vertical}`);
this.logger.info(`Prepare for Escape Stash Horizontal changed to ${mod.escapeStash.horizontal}`);
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsV = this.wtf.escapeStash.vertical;
this.items["5811ce662459770f6f490f32"]._props.Grids[0]._props.cellsH = this.wtf.escapeStash.horizontal;
this.logger.info(`Prepare for Escape Stash Vertical changed to ${this.wtf.escapeStash.vertical}`);
this.logger.info(`Prepare for Escape Stash Horizontal changed to ${this.wtf.escapeStash.horizontal}`);
}
// Edge of Darkness Stash Size Changes
if (mod.eodStash.vertical != 68 || mod.eodStash.horizontal != 10)
if (this.wtf.eodStash.vertical != 68 || this.wtf.eodStash.horizontal != 10)
{
items["5811ce772459770e9e5f9532"]._grids._props.cellsV = mod.eodStash.vertical;
items["5811ce772459770e9e5f9532"]._grids._props.cellsH = mod.eodStash.horizontal;
this.logger.info(`Edge of Darkness Stash Vertical changed to ${mod.eodStash.vertical}`);
this.logger.info(`Edge of Darkness Stash Horizontal changed to ${mod.eodStash.horizontal}`);
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsV = this.wtf.eodStash.vertical;
this.items["5811ce772459770e9e5f9532"]._props.Grids[0]._props.cellsH = this.wtf.eodStash.horizontal;
this.logger.info(`Edge of Darkness Stash Vertical changed to ${this.wtf.eodStash.vertical}`);
this.logger.info(`Edge of Darkness Stash Horizontal changed to ${this.wtf.eodStash.horizontal}`);
}
// Toggles true/false the Examined By Default config on all items in database/templates/items.json
if (mod.examinedByDefault)
if (this.wtf.examinedByDefault)
{
this.examinedByDefault();
this.logger.info(`Examined By Default is ${mod.examinedByDefault}`);
this.logger.info(`Examined By Default is ${this.wtf.examinedByDefault}`);
}
// Roubles Max Stack
if (mod.roublesMaxStack != 500000)
if (this.wtf.roublesMaxStack != 500000)
{
items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = mod.roublesMaxStack;
this.logger.info(`Rouble Max Stack set to ${mod.roublesMaxStack}`);
this.items["5449016a4bdc2d6f028b456f"]._props.StackMaxSize = this.wtf.roublesMaxStack;
this.logger.info(`Rouble Max Stack set to ${this.wtf.roublesMaxStack}`);
}
// Dollars Max Stack
if (mod.dollarsMaxStack != 50000)
if (this.wtf.dollarsMaxStack != 50000)
{
items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = mod.dollarsMaxStack;
this.logger.info(`Dollar Max Stack set to ${mod.dollarsMaxStack}`);
this.items["5696686a4bdc2da3298b456a"]._props.StackMaxSize = this.wtf.dollarsMaxStack;
this.logger.info(`Dollar Max Stack set to ${this.wtf.dollarsMaxStack}`);
}
// Euros Max Stack
if (mod.eurosMaxStack != 50000)
if (this.wtf.eurosMaxStack != 50000)
{
items["569668774bdc2da2298b4568"]._props.StackMaxSize = mod.eurosMaxStack;
this.logger.info(`Euro Max Stack set to ${mod.eurosMaxStack}`);
this.items["569668774bdc2da2298b4568"]._props.StackMaxSize = this.wtf.eurosMaxStack;
this.logger.info(`Euro Max Stack set to ${this.wtf.eurosMaxStack}`);
}
}
@ -105,12 +107,11 @@ export class Items
// Updates the weight modifier (as a multiplier) for all items in database/templates/items.json
private updateWeight(): void
{
const items = Object.values(this.databaseServer.getTables().templates.items);
for (const item of items)
for (const item in this.items)
{
if (item._props?.Weight)
if (this.items[item]._props?.Weight)
{
item._props.Weight *= this.modConfig.items.weightModifier;
this.items[item]._props.Weight *= this.wtf.weightModifier;
}
}
}
@ -118,10 +119,10 @@ export class Items
// Updates backpacks and removes any values in the ExcludedFilter under props > Grids > props > filters > ExcludedFilter in database/templates/items.json
private updateBackpacks(): void
{
const items = Object.values(this.databaseServer.getTables().templates.items);
const items = Object.values(this.tables.getTables().templates.items);
for (const item of items)
{
if (item._parent === "5448e53e4bdc2d60728b4567")
if (items._parent === "5448e53e4bdc2d60728b4567")
{
for (const grid of item._props.Grids)
grid._props.filters[0].ExcludedFilter = [];
@ -132,10 +133,10 @@ export class Items
// Updates the Examined By Default modifier for all items in database/templates/items.json to either True or False depending on the config value.
private examinedByDefault(): void
{
const items = Object.values(this.databaseServer.getTables().templates.items);
const items = Object.values(this.tables.getTables().templates.items);
for (const item of items)
{
item._props.ExaminedByDefault = this.modConfig.items.examinedByDefault;
item._props.ExaminedByDefault = this.wtf.examinedByDefault;
}
}
}