import { TraderHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/mod.ts";
Constructors
Properties
Dictionary of item tpl and the highest trader buy back rouble price
Dictionary of item tpl and the highest trader sell rouble price
Methods
Add standing to current standing and clamp value if it goes too low
Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc)
Add standing to a trader and level them up if exp goes over level threshold
Store the purchase of an assort from a trader in the player profile
Get the highest price item can be sold to trader for (roubles)
Get the highest rouble price for an item from traders UNUSED
Get the next update timestamp for a trader
Get a trader base object, update profile to reflect players current standing in profile when trader not found in profile
Retrieve the Item from a traders assort data by its id
Get all assort data for a particular trader
Get a trader enum key by its value
Get the reset time between trader assort refreshes in seconds
Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string. This method provides a runtime check to prevent undefined behavior when using the enum as a dictionary key.
For example, instead of this:
const traderId = Traders[Traders.PRAPOR];
You can use safely use this:
const traderId = this.traderHelper.getValidTraderIdByEnumValue(Traders.PRAPOR);
Calculate traders level based on exp amount and increments level if over threshold
Reset a profiles trader data back to its initial state as seen by a level 1 player Does NOT take into account different profile levels
Alter a traders unlocked status
Does the 'Traders' enum has a value that matches the passed in parameter
Accepts a trader id