380 #24

Merged
chomp merged 13 commits from 380 into master 2024-04-04 17:29:49 -04:00
Showing only changes of commit b4e8caf1cd - Show all commits

View File

@ -16,7 +16,7 @@ import { JsonUtil } from "@spt-aki/utils/JsonUtil";
// New trader settings // New trader settings
import * as baseJson from "../db/base.json"; import * as baseJson from "../db/base.json";
import { TraderHelper } from "./traderHelpers"; import { TraderHelper } from "./traderHelpers";
import { FluentAssortConstructor } from "./fluentTraderAssortCreator"; import { FluentAssortConstructor as FluentAssortCreator } from "./fluentTraderAssortCreator";
import { Money } from "@spt-aki/models/enums/Money"; import { Money } from "@spt-aki/models/enums/Money";
import { Traders } from "@spt-aki/models/enums/Traders"; import { Traders } from "@spt-aki/models/enums/Traders";
import { HashUtil } from "@spt-aki/utils/HashUtil"; import { HashUtil } from "@spt-aki/utils/HashUtil";
@ -26,7 +26,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
private mod: string private mod: string
private logger: ILogger private logger: ILogger
private traderHelper: TraderHelper private traderHelper: TraderHelper
private fluentTraderAssortHeper: FluentAssortConstructor private fluentAssortCreator: FluentAssortCreator
constructor() { constructor() {
this.mod = "13AddTrader"; // Set name of mod so we can log it to console later this.mod = "13AddTrader"; // Set name of mod so we can log it to console later
@ -52,7 +52,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
// Create helper class and use it to register our traders image/icon + set its stock refresh time // Create helper class and use it to register our traders image/icon + set its stock refresh time
this.traderHelper = new TraderHelper(); this.traderHelper = new TraderHelper();
this.fluentTraderAssortHeper = new FluentAssortConstructor(hashUtil, this.logger); this.fluentAssortCreator = new FluentAssortCreator(hashUtil, this.logger);
this.traderHelper.registerProfileImage(baseJson, this.mod, preAkiModLoader, imageRouter, "cat.jpg"); this.traderHelper.registerProfileImage(baseJson, this.mod, preAkiModLoader, imageRouter, "cat.jpg");
this.traderHelper.setTraderUpdateTime(traderConfig, baseJson, 3600, 4000); this.traderHelper.setTraderUpdateTime(traderConfig, baseJson, 3600, 4000);
@ -86,7 +86,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
// Add milk // Add milk
const MILK_ID = "575146b724597720a27126d5"; // Can find item ids in `database\templates\items.json` or with https://db.sp-tarkov.com/search const MILK_ID = "575146b724597720a27126d5"; // Can find item ids in `database\templates\items.json` or with https://db.sp-tarkov.com/search
this.fluentTraderAssortHeper.createSingleAssortItem(MILK_ID) this.fluentAssortCreator.createSingleAssortItem(MILK_ID)
.addStackCount(200) .addStackCount(200)
.addBuyRestriction(10) .addBuyRestriction(10)
.addMoneyCost(Money.ROUBLES, 2000) .addMoneyCost(Money.ROUBLES, 2000)
@ -96,7 +96,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
// Add 3x bitcoin + salewa for milk barter // Add 3x bitcoin + salewa for milk barter
const BITCOIN_ID = "59faff1d86f7746c51718c9c" const BITCOIN_ID = "59faff1d86f7746c51718c9c"
const SALEWA_ID = "544fb45d4bdc2dee738b4568"; const SALEWA_ID = "544fb45d4bdc2dee738b4568";
this.fluentTraderAssortHeper.createSingleAssortItem(MILK_ID) this.fluentAssortCreator.createSingleAssortItem(MILK_ID)
.addStackCount(100) .addStackCount(100)
.addBarterCost(BITCOIN_ID, 3) .addBarterCost(BITCOIN_ID, 3)
.addBarterCost(SALEWA_ID, 1) .addBarterCost(SALEWA_ID, 1)
@ -105,7 +105,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
// Add glock as money purchase // Add glock as money purchase
this.fluentTraderAssortHeper.createComplexAssortItem(this.traderHelper.createGlock()) this.fluentAssortCreator.createComplexAssortItem(this.traderHelper.createGlock())
.addUnlimitedStackCount() .addUnlimitedStackCount()
.addMoneyCost(Money.ROUBLES, 20000) .addMoneyCost(Money.ROUBLES, 20000)
.addBuyRestriction(3) .addBuyRestriction(3)
@ -113,7 +113,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod
.export(tables.traders[baseJson._id]); .export(tables.traders[baseJson._id]);
// Add mp133 preset as mayo barter // Add mp133 preset as mayo barter
this.fluentTraderAssortHeper.createComplexAssortItem(tables.globals.ItemPresets["584148f2245977598f1ad387"]._items) this.fluentAssortCreator.createComplexAssortItem(tables.globals.ItemPresets["584148f2245977598f1ad387"]._items)
.addStackCount(200) .addStackCount(200)
.addBarterCost("5bc9b156d4351e00367fbce9", 1) .addBarterCost("5bc9b156d4351e00367fbce9", 1)
.addBuyRestriction(3) .addBuyRestriction(3)