Potion charges accounted for in price

This commit is contained in:
MagicBot committed 2024-03-25 05:43:20 -04:00
1 parent 6a62f93cba
commit 4e2add4d64
2 files changed
+16 -5

No files matched your search

@@ -109,7 +109,13 @@ public class VendorSellMsgHandler extends AbstractClientMsgHandler {
//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;
float bargain = player.getBargain();
float profit = npc.getBuyPercent(player) + bargain;