Browse Source

NPCs will now buy items based on how much durability is on the item

master
FatBoy-DOTC 1 year ago
parent
commit
516fa59068
  1. 6
      src/engine/net/client/ClientMessagePump.java

6
src/engine/net/client/ClientMessagePump.java

@ -1243,6 +1243,12 @@ public class ClientMessagePump implements NetMsgHandler { @@ -1243,6 +1243,12 @@ public class ClientMessagePump implements NetMsgHandler {
cost = sell.getBaseValue();
//apply damaged value reduction
float durabilityCurrent = sell.getDurabilityCurrent();
float durabilityMax = sell.getDurabilityMax();
float damagedModifier = durabilityCurrent / durabilityMax;
cost *= damagedModifier;
float bargain = player.getBargain();
float profit = npc.getBuyPercent(player) + bargain;

Loading…
Cancel
Save