Value is set as items as used or damaged. Not calculated on the fly.

This commit is contained in:
MagicBot committed 2024-03-25 05:59:59 -04:00
1 parent 4e2add4d64
commit a7ed30130d
4 files changed
+12 -13

No files matched your search

@@ -105,17 +105,7 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler {
//get goldItem cost to sell
cost = sell.template.item_value;
//apply damaged value reduction
float damagedModifier = sell.combat_health_current / sell.template.combat_health_full;
float chargeModifier = 1.0f;
if (sell.chargesRemaining != 0)
chargeModifier = sell.chargesRemaining * 1.0f / sell.template.item_initial_charges;
cost *= damagedModifier;
cost *= chargeModifier;
cost = sell.value;
float bargain = player.getBargain();
float profit = npc.getBuyPercent(player) + bargain;