Fix buy_price_coef inversion

buy_price_coef isn't a direct percentage for their buyback value, it's
an inverse percentage

If it is 30, then their buyback rate is 70% of the handbook, not 30%
This commit is contained in:
Chomp
2025-03-19 16:43:25 +00:00
parent 875b471453
commit 787f15b124
@@ -578,7 +578,7 @@ public class TraderHelper(
// Get loyalty level details player has achieved with this trader
// Uses lowest loyalty level as this function is used before a player has logged into server
// We have no idea what player loyalty is with traders
var traderBuyBackPricePercent = traderBase.LoyaltyLevels.FirstOrDefault().BuyPriceCoefficient;
var traderBuyBackPricePercent = 100 - traderBase.LoyaltyLevels.FirstOrDefault().BuyPriceCoefficient;
var itemHandbookPrice = _handbookHelper.GetTemplatePrice(tpl);
var priceTraderBuysItemAt = _randomUtil.GetPercentOfValue(traderBuyBackPricePercent ?? 0, itemHandbookPrice, 0);