Added check for player listed weapons on flea, calculate the cost of the weapon+mods and use this value as the comparison against player listing price

This commit is contained in:
Chomp
2025-11-01 12:20:06 +00:00
parent 96c7feff55
commit 74cf552d48
@@ -774,6 +774,12 @@ public class RagfairController(
// Get average of items quality+children
var qualityMultiplier = itemHelper.GetItemQualityModifierForItems(offer.Items, true);
// Player may be listing a custom weapon with non-standard mods, calculate the average price of the listed weapons' mods
if (itemHelper.IsOfBaseclass(offerRootItem.Template, BaseClasses.WEAPON))
{
averageOfferPriceSingleItem = ragfairPriceService.GetPresetPriceByChildren(offer.Items);
}
// Check for and apply item price modifer if it exists in config
if (RagfairConfig.Dynamic.ItemPriceMultiplier.TryGetValue(offerRootItem.Template, out var itemPriceModifer))
{
@@ -789,6 +795,7 @@ public class RagfairController(
playerListedPriceInRub,
qualityMultiplier
);
offer.SellResults = ragfairSellHelper.RollForSale(sellChancePercent, (int)stackCountTotal);
// Subtract flea market fee from stash