Categories_NOTSYNC.json - AlPepino/Next-Days GitHub Wiki
- This trader categories config file is generated itself at first server run.
- It contains all default available trader categories in one array.
- It isn't synchronized to client. Any overriding must be done manually through file Categories.json
CategoryID
takes any integer. Must be unique.
Tag
takes string value, which represents label for whole group set. It is used for declaring available categories at trader (Example_Trader.json).
Groups
takes string value, which represents group name (level 0 at trader menu)
Category
takes string value, which represents category name (level 1 at trader menu)
SubCategory
takes string value, which represents subcategory name (level 0 at trader menu)
Restock
takes positive integer representing added item per restocking event. 0 means no restocking = realistic model.
RestockCap
takes positive integer representing restocking cap.
StockCap
takes positive integer representing warehouse cap.
SellingRatioMin
takes positive real number. See below how is used in "price calculation"
SellingRatioMax
takes positive real number. See below how is used in "price calculation"
BuingRatioMin
takes positive real number. See below how is used in "price calculation"
Price calculation
- BP = final buing price
- SP = final selling price
- PoI = default price of item from TraderItemsPrices.json
- CoI = count of item in storage from TraderStock.json
- Dis = discount determined by player's reputation level. It is calculated on condition when sellingRatioMin != 0
if (stockCap == 0)
BP = PoI * (1 - Dis) * quantity * health
SP = PoI * (SellingRatioMin + Dis) * quantity * health
if (stockCap > 0)
PRICE = PoI - CoI * (((1 - BuingRatioMin) * PoI) / stockCap)
BP = PRICE * (1 - Dis) * quantity * health
maxSP = SellingRatioMax * PRICE
minSP = SellingRatioMin * PRICE
SP = maxSP - CoI * (maxSP - minSP) / stockCap
SP = SP * (1 + Dis) * quantity * health