builders sell things at proper ranks

This commit is contained in:
2024-09-09 21:06:03 -05:00
parent eaa70f43c0
commit 96eb9a3ad0
3 changed files with 21 additions and 1 deletions
+4 -1
View File
@@ -1402,9 +1402,12 @@ public class ClientMessagePump implements NetMsgHandler {
Item buy = null;
if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) {
ArrayList<MobEquipment> sellInventory = npc.getContract().getSellInventory();
if(npc.contract.getName().toLowerCase().equals("steward")){
if(npc.contract.getObjectUUID() == 890){ // default steward
sellInventory = npc.getSellInventorySteward();
}
if(npc.contract.getObjectUUID() == 889){ // default builder
sellInventory = npc.getSellInventoryBuilder();
}
if (sellInventory == null) {
return;
}
@@ -112,6 +112,12 @@ public class BuyFromNPCWindowMsg extends ClientNetMsg {
if (contract != null)
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)
+11
View File
@@ -1426,4 +1426,15 @@ public class NPC extends AbstractCharacter {
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;
}
}