Browse Source

builders sell things at proper ranks

lakebane-strongholds
FatBoy-DOTC 2 months ago
parent
commit
96eb9a3ad0
  1. 5
      src/engine/net/client/ClientMessagePump.java
  2. 6
      src/engine/net/client/msg/BuyFromNPCWindowMsg.java
  3. 11
      src/engine/objects/NPC.java

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

@ -1402,9 +1402,12 @@ public class ClientMessagePump implements NetMsgHandler {
Item buy = null; Item buy = null;
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) { if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) {
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory(); ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory();
if(npc.contract.getName().toLowerCase().equals("steward")){ if(npc.contract.getObjectUUID() == 890){ // default steward
sellInventory = npc.getSellInventorySteward(); sellInventory = npc.getSellInventorySteward();
} }
if(npc.contract.getObjectUUID() == 889){ // default builder
sellInventory = npc.getSellInventoryBuilder();
}
if (sellInventory == null) { if (sellInventory == null) {
return; return;
} }

6
src/engine/net/client/msg/BuyFromNPCWindowMsg.java

@ -112,6 +112,12 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
if (contract != null) if (contract != null)
sellInventory = contract.getSellInventory(); sellInventory = contract.getSellInventory();
if(npc.contract.getObjectUUID() == 890){ // default steward
sellInventory = npc.getSellInventorySteward();
}
if(npc.contract.getObjectUUID() == 889){ // default builder
sellInventory = npc.getSellInventoryBuilder();
}
} }
if (man != null) if (man != null)

11
src/engine/objects/NPC.java

@ -1426,4 +1426,15 @@ public class NPC extends AbstractCharacter {
return smallList; return smallList;
} }
public ArrayList<MobEquipment> getSellInventoryBuilder() {
ArrayList<MobEquipment> smallList = new ArrayList<>();
int maxValue = this.getRank() * 2 * 100000;
for(MobEquipment me : this.contract.getSellInventory()){
if(me.getItemBase().getBaseValue() <= maxValue)
smallList.add(me);
}
return smallList;
}
} }

Loading…
Cancel
Save