Compare commits
5 Commits
44d35231e0
...
c302aeef2f
Author | SHA1 | Date | |
---|---|---|---|
c302aeef2f | |||
9be6704522 | |||
7ef907bedd | |||
7fb74a7cf5 | |||
b3fc3d87e8 |
@ -18,3 +18,7 @@
|
|||||||
/package-lock.json
|
/package-lock.json
|
||||||
/tsconfig.json
|
/tsconfig.json
|
||||||
/types
|
/types
|
||||||
|
/.prettierignore
|
||||||
|
/.prettierrc.json
|
||||||
|
/icon.png
|
||||||
|
/README.md
|
||||||
|
@ -8,3 +8,4 @@
|
|||||||
*.json
|
*.json
|
||||||
*.txt
|
*.txt
|
||||||
*.exe
|
*.exe
|
||||||
|
*.mjs
|
@ -1,68 +1,50 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"plugins": [
|
"plugins": ["@typescript-eslint"],
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:@typescript-eslint/eslint-recommended",
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"plugin:@typescript-eslint/recommended"
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
|
||||||
|
"plugin:import/recommended",
|
||||||
|
"plugin:import/typescript"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"@typescript-eslint/no-explicit-any": 0,
|
"@typescript-eslint/no-explicit-any": 0,
|
||||||
"@typescript-eslint/no-unused-vars": 1,
|
"@typescript-eslint/no-unused-vars": 1,
|
||||||
"@typescript-eslint/no-empty-interface": 0,
|
"@typescript-eslint/no-empty-interface": 0,
|
||||||
"@typescript-eslint/no-namespace": 0,
|
"@typescript-eslint/no-namespace": 0,
|
||||||
"@typescript-eslint/comma-dangle": 1,
|
|
||||||
"@typescript-eslint/func-call-spacing": 2,
|
"@typescript-eslint/func-call-spacing": 2,
|
||||||
"@typescript-eslint/quotes": 1,
|
"@typescript-eslint/quotes": ["warn", "double"],
|
||||||
"@typescript-eslint/brace-style": [
|
"@typescript-eslint/brace-style": ["warn", "1tbs"],
|
||||||
"warn",
|
|
||||||
"allman"
|
|
||||||
],
|
|
||||||
"@typescript-eslint/naming-convention": [
|
"@typescript-eslint/naming-convention": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
"selector": "default",
|
"selector": "default",
|
||||||
"format": [
|
"format": ["camelCase"],
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"leadingUnderscore": "allow"
|
"leadingUnderscore": "allow"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selector": "typeLike",
|
"selector": "typeLike",
|
||||||
"format": [
|
"format": ["PascalCase"]
|
||||||
"PascalCase"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selector": "objectLiteralProperty",
|
"selector": "objectLiteralProperty",
|
||||||
"format": [
|
"format": ["PascalCase", "camelCase"],
|
||||||
"PascalCase",
|
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"leadingUnderscore": "allow"
|
"leadingUnderscore": "allow"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selector": "typeProperty",
|
"selector": "typeProperty",
|
||||||
"format": [
|
"format": ["PascalCase", "camelCase"],
|
||||||
"PascalCase",
|
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"leadingUnderscore": "allow"
|
"leadingUnderscore": "allow"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selector": "enumMember",
|
"selector": "enumMember",
|
||||||
"format": [
|
"format": ["UPPER_CASE"]
|
||||||
"UPPER_CASE"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@typescript-eslint/indent": [
|
"@typescript-eslint/indent": ["warn", 2],
|
||||||
"warn",
|
|
||||||
4
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-unused-expressions": [
|
"@typescript-eslint/no-unused-expressions": [
|
||||||
"warn",
|
"warn",
|
||||||
{
|
{
|
||||||
@ -82,14 +64,47 @@
|
|||||||
{
|
{
|
||||||
"allowArgumentsExplicitlyTypedAsAny": true
|
"allowArgumentsExplicitlyTypedAsAny": true
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"sort-imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"ignoreCase": false,
|
||||||
|
"ignoreDeclarationSort": true, // don"t want to sort import lines, use eslint-plugin-import instead
|
||||||
|
"ignoreMemberSort": false,
|
||||||
|
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
|
||||||
|
"allowSeparatedGroups": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"import/no-unresolved": "error",
|
||||||
|
"import/order": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"groups": [
|
||||||
|
"builtin",
|
||||||
|
"external",
|
||||||
|
"internal",
|
||||||
|
["sibling", "parent"],
|
||||||
|
"index",
|
||||||
|
"unknown"
|
||||||
|
],
|
||||||
|
"newlines-between": "always",
|
||||||
|
"alphabetize": {
|
||||||
|
"order": "asc",
|
||||||
|
"caseInsensitive": true
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"settings": {
|
||||||
|
"import/resolver": {
|
||||||
|
"typescript": {
|
||||||
|
"project": "./tsconfig.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": [
|
"files": ["*.mjs", "*.ts"],
|
||||||
"*.mjs",
|
|
||||||
"*.ts"
|
|
||||||
],
|
|
||||||
"env": {
|
"env": {
|
||||||
"node": true
|
"node": true
|
||||||
}
|
}
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
|
.vscode/
|
11
.prettierignore
Normal file
11
.prettierignore
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Exclude these folders from linting
|
||||||
|
**/node_modules
|
||||||
|
/tmp
|
||||||
|
/dist
|
||||||
|
/types
|
||||||
|
|
||||||
|
# Exclude these filetypes from linting
|
||||||
|
*.json
|
||||||
|
*.txt
|
||||||
|
*.exe
|
||||||
|
*.mjs
|
6
.prettierrc.json
Normal file
6
.prettierrc.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": false,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"tabWidth": 2,
|
||||||
|
"semi": true
|
||||||
|
}
|
@ -1,10 +1,14 @@
|
|||||||
# InsuranceTweaks
|
# InsuranceTweaks
|
||||||
|
|
||||||
A simple mod with little to no configuration to tweak the insurance settings
|
A simple mod with little to no configuration to tweak the insurance settings
|
||||||
|
|
||||||
# Config
|
# Config
|
||||||
|
|
||||||
| Setting | Default Value | Details |
|
| Setting | Default Value | Details |
|
||||||
|------------------------------|---------------|--------------------------------------------------------------------|
|
| ---------------------------- | ------------- | ------------------------------------------------------------------ |
|
||||||
| PraporMinReturn | 2 | Minimum time (in hours) for Prapor to return your insured items |
|
| InstantReturn | | |
|
||||||
|
| ├ enabled | false | Whether or not the instant return is enabled |
|
||||||
|
| └ runIntervalSeconds | 30 | Time (in seconds) between each insurance check |
|
||||||
| PraporMaxReturn | 4 | Maximum time (in hours) for Prapor to return your insured items |
|
| PraporMaxReturn | 4 | Maximum time (in hours) for Prapor to return your insured items |
|
||||||
| PraporMaxStorageTime | 72 | Number of hours Prapor insured items will stay in your inbox |
|
| PraporMaxStorageTime | 72 | Number of hours Prapor insured items will stay in your inbox |
|
||||||
| PraporReturnChancePercent | 50 | Return chance percentage for Prapor insured items |
|
| PraporReturnChancePercent | 50 | Return chance percentage for Prapor insured items |
|
||||||
@ -14,5 +18,6 @@ A simple mod with little to no configuration to tweak the insurance settings
|
|||||||
| TherapistReturnChancePercent | 75 | Return chance percentage for Therapist insured items |
|
| TherapistReturnChancePercent | 75 | Return chance percentage for Therapist insured items |
|
||||||
|
|
||||||
# Thanks
|
# Thanks
|
||||||
|
|
||||||
- [chomp](https://dev.sp-tarkov.com/chomp) for the mod examples
|
- [chomp](https://dev.sp-tarkov.com/chomp) for the mod examples
|
||||||
- [DJLang](https://github.com/KillerDJLang) for [RaidOverhaul](https://hub.sp-tarkov.com/files/file/1673-raid-overhaul/) giving me the idea to make this mod
|
- [DJLang](https://github.com/KillerDJLang) for [RaidOverhaul](https://hub.sp-tarkov.com/files/file/1673-raid-overhaul/) giving me the idea to make this mod
|
@ -121,7 +121,7 @@ async function main() {
|
|||||||
logger.log("info", zipFilePath);
|
logger.log("info", zipFilePath);
|
||||||
|
|
||||||
// Move the zip file inside of the project directory, within the temporary working directory.
|
// Move the zip file inside of the project directory, within the temporary working directory.
|
||||||
const zipFileInProjectDir = path.join(projectDir, `${projectName}.zip`);
|
const zipFileInProjectDir = path.join(projectDir, `${projectName}-${packageJson.version}.zip`);
|
||||||
await fs.move(zipFilePath, zipFileInProjectDir);
|
await fs.move(zipFilePath, zipFileInProjectDir);
|
||||||
logger.log("success", "Archive successfully moved.");
|
logger.log("success", "Archive successfully moved.");
|
||||||
logger.log("info", zipFileInProjectDir);
|
logger.log("info", zipFileInProjectDir);
|
||||||
@ -134,7 +134,7 @@ async function main() {
|
|||||||
logger.log("success", "------------------------------------");
|
logger.log("success", "------------------------------------");
|
||||||
logger.log("success", "Build script completed successfully!");
|
logger.log("success", "Build script completed successfully!");
|
||||||
logger.log("success", "Your mod package has been created in the 'dist' directory:");
|
logger.log("success", "Your mod package has been created in the 'dist' directory:");
|
||||||
logger.log("success", `/${path.relative(process.cwd(), path.join(distDir, `${projectName}.zip`))}`);
|
logger.log("success", `/${path.relative(process.cwd(), path.join(distDir, `${projectName}-${packageJson.version}.zip`))}`);
|
||||||
logger.log("success", "------------------------------------");
|
logger.log("success", "------------------------------------");
|
||||||
if (!verbose) {
|
if (!verbose) {
|
||||||
logger.log("success", "To see a detailed build log, use `npm run buildinfo`.");
|
logger.log("success", "To see a detailed build log, use `npm run buildinfo`.");
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
{
|
{
|
||||||
|
InstantReturn: {
|
||||||
|
enabled: false,
|
||||||
|
runIntervalSeconds: 30,
|
||||||
|
},
|
||||||
|
|
||||||
//Prapor
|
//Prapor
|
||||||
"PraporMinReturn": 2,
|
PraporMinReturn: 2,
|
||||||
"PraporMaxReturn": 4,
|
PraporMaxReturn: 4,
|
||||||
"PraporMaxStorageTime": 72,
|
PraporMaxStorageTime: 72,
|
||||||
"PraporReturnChancePercent": 50,
|
PraporReturnChancePercent: 50,
|
||||||
|
|
||||||
//Therapist
|
//Therapist
|
||||||
"TherapistMinReturn": 1,
|
TherapistMinReturn: 1,
|
||||||
"TherapistMaxReturn": 2,
|
TherapistMaxReturn: 2,
|
||||||
"TherapistMaxStorageTime": 72,
|
TherapistMaxStorageTime: 72,
|
||||||
"TherapistReturnChancePercent": 75
|
TherapistReturnChancePercent: 75,
|
||||||
}
|
}
|
@ -1,13 +1,18 @@
|
|||||||
{
|
{
|
||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"path": "."
|
"path": ".",
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
"extensions": {
|
"extensions": {
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"refringe.spt-id-highlighter"
|
"refringe.spt-id-highlighter",
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
|
"settings": {
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
1553
package-lock.json
generated
1553
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "InsuranceTweaks",
|
"name": "InsuranceTweaks",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"sptVersion": "~3.9",
|
"sptVersion": "~3.9",
|
||||||
"loadBefore": [],
|
"loadBefore": [],
|
||||||
"loadAfter": [],
|
"loadAfter": [],
|
||||||
"incompatibilities": [],
|
"incompatibilities": [],
|
||||||
"isBundleMod": false,
|
"isBundleMod": false,
|
||||||
"main": "src/mod.js",
|
"main": "src/insurancetweaks.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"setup": "npm i",
|
"setup": "npm i",
|
||||||
"build": "node ./build.mjs",
|
"build": "node ./build.mjs",
|
||||||
@ -18,9 +18,14 @@
|
|||||||
"@typescript-eslint/parser": "7.2",
|
"@typescript-eslint/parser": "7.2",
|
||||||
"archiver": "^6.0",
|
"archiver": "^6.0",
|
||||||
"eslint": "8.57",
|
"eslint": "8.57",
|
||||||
|
"eslint-config-prettier": "^9.1.0",
|
||||||
|
"eslint-import-resolver-typescript": "^3.6.1",
|
||||||
|
"eslint-plugin-import": "^2.29.1",
|
||||||
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"fs-extra": "11.2",
|
"fs-extra": "11.2",
|
||||||
"ignore": "^5.2",
|
"ignore": "^5.2",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
|
"prettier": "^3.3.3",
|
||||||
"tsyringe": "4.8.0",
|
"tsyringe": "4.8.0",
|
||||||
"typescript": "5.4",
|
"typescript": "5.4",
|
||||||
"winston": "3.12"
|
"winston": "3.12"
|
||||||
|
98
src/insurancetweaks.ts
Normal file
98
src/insurancetweaks.ts
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
import * as path from "node:path";
|
||||||
|
|
||||||
|
import { parse } from "json5";
|
||||||
|
import { DependencyContainer } from "tsyringe";
|
||||||
|
|
||||||
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||||
|
import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
|
||||||
|
import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod";
|
||||||
|
import { IInsuranceConfig } from "@spt/models/spt/config/IInsuranceConfig";
|
||||||
|
import { LogTextColor } from "@spt/models/spt/logging/LogTextColor";
|
||||||
|
import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables";
|
||||||
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
|
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
||||||
|
import { SaveServer } from "@spt/servers/SaveServer";
|
||||||
|
import { VFS } from "@spt/utils/VFS";
|
||||||
|
|
||||||
|
type ModConfig = {
|
||||||
|
InstantReturn: {
|
||||||
|
enabled: boolean;
|
||||||
|
runIntervalSeconds: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
PraporMinReturn: number;
|
||||||
|
PraporMaxReturn: number;
|
||||||
|
PraporMaxStorageTime: number;
|
||||||
|
PraporReturnChancePercent: number;
|
||||||
|
|
||||||
|
TherapistMinReturn: number;
|
||||||
|
TherapistMaxReturn: number;
|
||||||
|
TherapistMaxStorageTime: number;
|
||||||
|
TherapistReturnChancePercent: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod {
|
||||||
|
public logger: ILogger;
|
||||||
|
public tables: IDatabaseTables;
|
||||||
|
public modConfig: ModConfig;
|
||||||
|
public configServer: ConfigServer;
|
||||||
|
public saveServer: SaveServer;
|
||||||
|
|
||||||
|
public preSptLoad(container: DependencyContainer): void {
|
||||||
|
this.logger = container.resolve<ILogger>("WinstonLogger");
|
||||||
|
const vfs = container.resolve<VFS>("VFS");
|
||||||
|
this.modConfig = parse(
|
||||||
|
vfs.readFile(path.resolve(__dirname, "../config/config.json5")),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public postDBLoad(container: DependencyContainer): void {
|
||||||
|
this.tables = container
|
||||||
|
.resolve<DatabaseServer>("DatabaseServer")
|
||||||
|
.getTables();
|
||||||
|
this.configServer = container.resolve<ConfigServer>("ConfigServer");
|
||||||
|
this.traderTweaks(this.modConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
private traderTweaks(modConfig: ModConfig): void {
|
||||||
|
const traders = this.tables.traders;
|
||||||
|
const PRAPOR = "54cb50c76803fa8b248b4571";
|
||||||
|
const THERAPIST = "54cb57776803fa99248b456e";
|
||||||
|
|
||||||
|
const insuranceConfig = this.configServer.getConfig<IInsuranceConfig>(
|
||||||
|
ConfigTypes.INSURANCE,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!modConfig.InstantReturn.enabled) {
|
||||||
|
traders[PRAPOR].base.insurance.min_return_hour =
|
||||||
|
modConfig.PraporMinReturn;
|
||||||
|
traders[PRAPOR].base.insurance.max_return_hour =
|
||||||
|
modConfig.PraporMaxReturn;
|
||||||
|
traders[THERAPIST].base.insurance.min_return_hour =
|
||||||
|
modConfig.TherapistMinReturn;
|
||||||
|
traders[THERAPIST].base.insurance.max_return_hour =
|
||||||
|
modConfig.TherapistMaxReturn;
|
||||||
|
} else {
|
||||||
|
insuranceConfig.runIntervalSeconds =
|
||||||
|
modConfig.InstantReturn.runIntervalSeconds;
|
||||||
|
insuranceConfig.returnTimeOverrideSeconds = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
traders[PRAPOR].base.insurance.max_storage_time =
|
||||||
|
modConfig.PraporMaxStorageTime;
|
||||||
|
traders[THERAPIST].base.insurance.max_storage_time =
|
||||||
|
modConfig.TherapistMaxStorageTime;
|
||||||
|
insuranceConfig.returnChancePercent[PRAPOR] =
|
||||||
|
modConfig.PraporReturnChancePercent;
|
||||||
|
insuranceConfig.returnChancePercent[THERAPIST] =
|
||||||
|
modConfig.TherapistReturnChancePercent;
|
||||||
|
|
||||||
|
this.logger.logWithColor(
|
||||||
|
"[InsuranceTweaks] Applied insurance settings",
|
||||||
|
LogTextColor.GREEN,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const mod = new InsuranceTweaks();
|
72
src/mod.ts
72
src/mod.ts
@ -1,72 +0,0 @@
|
|||||||
import { DependencyContainer } from "tsyringe";
|
|
||||||
import json5 from "json5";
|
|
||||||
|
|
||||||
import { IPreSptLoadMod } from "@spt/models/external/IPreSptLoadMod";
|
|
||||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
|
||||||
import { LogTextColor } from "@spt/models/spt/logging/LogTextColor";
|
|
||||||
import { IDatabaseTables } from "@spt/models/spt/server/IDatabaseTables";
|
|
||||||
import { DatabaseServer } from "@spt/servers/DatabaseServer";
|
|
||||||
import { IPostDBLoadMod } from "@spt/models/external/IPostDBLoadMod";
|
|
||||||
import { VFS } from "@spt/utils/VFS";
|
|
||||||
|
|
||||||
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 = {
|
|
||||||
PraporMinReturn: number;
|
|
||||||
PraporMaxReturn: number;
|
|
||||||
PraporMaxStorageTime: number;
|
|
||||||
PraporReturnChancePercent: number;
|
|
||||||
|
|
||||||
TherapistMinReturn: number;
|
|
||||||
TherapistMaxReturn: number;
|
|
||||||
TherapistMaxStorageTime: number;
|
|
||||||
TherapistReturnChancePercent: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
class InsuranceTweaks implements IPreSptLoadMod, IPostDBLoadMod
|
|
||||||
{
|
|
||||||
public logger: ILogger;
|
|
||||||
public tables: IDatabaseTables;
|
|
||||||
public modConfig: ModConfig;
|
|
||||||
public configServer: ConfigServer;
|
|
||||||
|
|
||||||
public preSptLoad(container: DependencyContainer): void
|
|
||||||
{
|
|
||||||
this.logger = container.resolve<ILogger>("WinstonLogger");
|
|
||||||
const vfs = container.resolve<VFS>("VFS");
|
|
||||||
this.modConfig = json5.parse(vfs.readFile(path.resolve(__dirname, "../config/config.json5")));
|
|
||||||
}
|
|
||||||
|
|
||||||
public postDBLoad(container: DependencyContainer): void
|
|
||||||
{
|
|
||||||
this.tables = container.resolve<DatabaseServer>("DatabaseServer").getTables();
|
|
||||||
this.configServer = container.resolve<ConfigServer>("ConfigServer");
|
|
||||||
this.traderTweaks(this.modConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
private traderTweaks(modConfig: ModConfig): void
|
|
||||||
{
|
|
||||||
const traders = this.tables.traders;
|
|
||||||
const PRAPOR = "54cb50c76803fa8b248b4571";
|
|
||||||
const THERAPIST = "54cb57776803fa99248b456e";
|
|
||||||
const insuranceConfig = this.configServer.getConfig<IInsuranceConfig>(ConfigTypes.INSURANCE);
|
|
||||||
|
|
||||||
// Prapor
|
|
||||||
traders[PRAPOR].base.insurance.min_return_hour = modConfig.PraporMinReturn;
|
|
||||||
traders[PRAPOR].base.insurance.max_return_hour = modConfig.PraporMaxReturn;
|
|
||||||
traders[PRAPOR].base.insurance.max_storage_time = modConfig.PraporMaxStorageTime;
|
|
||||||
insuranceConfig.returnChancePercent[PRAPOR] = modConfig.PraporReturnChancePercent;
|
|
||||||
// Therapist
|
|
||||||
traders[THERAPIST].base.insurance.min_return_hour = modConfig.TherapistMinReturn;
|
|
||||||
traders[THERAPIST].base.insurance.max_return_hour = modConfig.TherapistMaxReturn;
|
|
||||||
traders[THERAPIST].base.insurance.max_storage_time = modConfig.TherapistMaxStorageTime;
|
|
||||||
insuranceConfig.returnChancePercent[THERAPIST] = modConfig.TherapistReturnChancePercent;
|
|
||||||
|
|
||||||
this.logger.logWithColor("[InsuranceTweaks] Applied insurance settings", LogTextColor.GREEN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const mod = new InsuranceTweaks();
|
|
Loading…
x
Reference in New Issue
Block a user