added returnChancePercent tweak
This commit is contained in:
parent
f8303dd051
commit
2ae704839c
@ -3,9 +3,11 @@
|
|||||||
"PraporMinReturn": 2,
|
"PraporMinReturn": 2,
|
||||||
"PraporMaxReturn": 4,
|
"PraporMaxReturn": 4,
|
||||||
"PraporMaxStorageTime": 72,
|
"PraporMaxStorageTime": 72,
|
||||||
|
"PraporReturnChancePercent": 50,
|
||||||
|
|
||||||
//Therapist
|
//Therapist
|
||||||
"TherapistMinReturn": 1,
|
"TherapistMinReturn": 1,
|
||||||
"TherapistMaxReturn": 2,
|
"TherapistMaxReturn": 2,
|
||||||
"TherapistMaxStorageTime": 72
|
"TherapistMaxStorageTime": 72,
|
||||||
|
"TherapistReturnChancePercent": 75
|
||||||
}
|
}
|
37
src/mod.ts
37
src/mod.ts
@ -10,14 +10,20 @@ import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
|
|||||||
import { VFS } from "@spt/utils/VFS";
|
import { VFS } from "@spt/utils/VFS";
|
||||||
|
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||||
|
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
|
||||||
|
|
||||||
type ModConfig = {
|
type ModConfig = {
|
||||||
PraporMinReturn: number,
|
PraporMinReturn: number;
|
||||||
PraporMaxReturn: number,
|
PraporMaxReturn: number;
|
||||||
PraporMaxStorageTime: number,
|
PraporMaxStorageTime: number;
|
||||||
TherapistMinReturn: number,
|
PraporReturnChancePercent: number;
|
||||||
TherapistMaxReturn: number,
|
|
||||||
TherapistMaxStorageTime: number
|
TherapistMinReturn: number;
|
||||||
|
TherapistMaxReturn: number;
|
||||||
|
TherapistMaxStorageTime: number;
|
||||||
|
TherapistReturnChancePercent: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod
|
class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod
|
||||||
@ -25,6 +31,7 @@ class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod
|
|||||||
public logger: ILogger;
|
public logger: ILogger;
|
||||||
public tables: IDatabaseTables;
|
public tables: IDatabaseTables;
|
||||||
public modConfig: ModConfig;
|
public modConfig: ModConfig;
|
||||||
|
public configServer: ConfigServer;
|
||||||
|
|
||||||
public preSptLoad(container: DependencyContainer): void
|
public preSptLoad(container: DependencyContainer): void
|
||||||
{
|
{
|
||||||
@ -36,21 +43,27 @@ class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod
|
|||||||
public postDBLoad(container: DependencyContainer): void
|
public postDBLoad(container: DependencyContainer): void
|
||||||
{
|
{
|
||||||
this.tables = container.resolve<DatabaseServer>("DatabaseServer").getTables();
|
this.tables = container.resolve<DatabaseServer>("DatabaseServer").getTables();
|
||||||
|
this.configServer = container.resolve<ConfigServer>("ConfigServer");
|
||||||
this.traderTweaks(this.modConfig);
|
this.traderTweaks(this.modConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private traderTweaks(modConfig: ModConfig): void
|
private traderTweaks(modConfig: ModConfig): void
|
||||||
{
|
{
|
||||||
const traders = this.tables.traders;
|
const traders = this.tables.traders;
|
||||||
|
const PRAPOR = "54cb50c76803fa8b248b4571";
|
||||||
|
const THERAPIST = "54cb57776803fa99248b456e";
|
||||||
|
const insuranceConfig = this.configServer.getConfig<IInsuranceConfig>(ConfigTypes.INSURANCE);
|
||||||
|
|
||||||
// Prapor
|
// Prapor
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.min_return_hour = modConfig.PraporMinReturn
|
traders[PRAPOR].base.insurance.min_return_hour = modConfig.PraporMinReturn;
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.max_return_hour = modConfig.PraporMaxReturn
|
traders[PRAPOR].base.insurance.max_return_hour = modConfig.PraporMaxReturn;
|
||||||
traders["54cb50c76803fa8b248b4571"].base.insurance.max_storage_time = modConfig.PraporMaxStorageTime
|
traders[PRAPOR].base.insurance.max_storage_time = modConfig.PraporMaxStorageTime;
|
||||||
|
insuranceConfig.returnChancePercent[PRAPOR] = modConfig.PraporReturnChancePercent;
|
||||||
// Therapist
|
// Therapist
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.min_return_hour = modConfig.TherapistMinReturn
|
traders[THERAPIST].base.insurance.min_return_hour = modConfig.TherapistMinReturn;
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.max_return_hour = modConfig.TherapistMaxReturn
|
traders[THERAPIST].base.insurance.max_return_hour = modConfig.TherapistMaxReturn;
|
||||||
traders["54cb57776803fa99248b456e"].base.insurance.max_storage_time = modConfig.TherapistMaxStorageTime
|
traders[THERAPIST].base.insurance.max_storage_time = modConfig.TherapistMaxStorageTime;
|
||||||
|
insuranceConfig.returnChancePercent[THERAPIST] = modConfig.TherapistReturnChancePercent;
|
||||||
|
|
||||||
this.logger.logWithColor("[InsuranceTweaks] Applied insurance settings", LogTextColor.GREEN);
|
this.logger.logWithColor("[InsuranceTweaks] Applied insurance settings", LogTextColor.GREEN);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user