diff --git a/src/engine/net/client/ClientMessagePump.java b/src/engine/net/client/ClientMessagePump.java index 4a0b96a4..9d73ae98 100644 --- a/src/engine/net/client/ClientMessagePump.java +++ b/src/engine/net/client/ClientMessagePump.java @@ -15,7 +15,6 @@ import engine.exception.MsgSendException; import engine.gameManager.*; import engine.job.JobContainer; import engine.job.JobScheduler; -import engine.jobs.LogoutCharacterJob; import engine.jobs.RefreshGroupJob; import engine.jobs.StuckJob; import engine.math.Vector3fImmutable; @@ -1403,6 +1402,9 @@ public class ClientMessagePump implements NetMsgHandler { Item buy = null; if (msg.getItemType() == GameObjectType.MobEquipment.ordinal()) { ArrayList sellInventory = npc.getContract().getSellInventory(); + if(npc.contract.getName().toLowerCase().equals("steward")){ + sellInventory = npc.getSellInventorySteward(); + } if (sellInventory == null) { return; } diff --git a/src/engine/objects/Contract.java b/src/engine/objects/Contract.java index 61379726..de0fefc4 100644 --- a/src/engine/objects/Contract.java +++ b/src/engine/objects/Contract.java @@ -292,6 +292,7 @@ public class Contract extends AbstractGameObject { me.magicValue = 1; } } + return this.sellInventory; } diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 49ed5ac9..4ce4c1ff 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -1363,4 +1363,67 @@ public class NPC extends AbstractCharacter { } } + public ArrayList getSellInventorySteward() { + + ArrayList smallList = new ArrayList<>(); + for (MobEquipment me : this.contract.getSellInventory()) { + int rankRequired = 0; + if (me.getItemBase().getType().equals(Enum.ItemType.CONTRACT)) { + switch (me.getItemBase().getUUID()) { + case 866: + case 889: + case 860: + case 850: + case 892: + case 1502003: + case 890: + case 896: + rankRequired = 1; + break; + case 899: + case 801: + case 803: + case 802: + case 821: + case 810: + case 806: + case 818: + case 800: + rankRequired = 2; + break; + + case 840: + case 848: + case 813: + case 805: + case 804: + case 838: + rankRequired = 3; + break; + case 815: + rankRequired = 4; + break; + case 847: + case 830: + case 820: + rankRequired = 6; + break; + case 865: + case 252637: + rankRequired = 7; + break; + case 1502002: // harvesters don't need to exist but might one day + case 1502001: //mine guards don't need to exist but might one day + continue; + } + if(me.getItemBase().getName().toLowerCase().contains("trainer") || me.getItemBase().getName().toLowerCase().contains("refiner")){ + rankRequired = 5; + } + if (this.getRank() >= rankRequired) + smallList.add(me); + } + } + return smallList; + } + }