From 6c255323fb2fd9832eed7d1006679e0f501143f4 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 7 Aug 2023 22:06:45 -0500 Subject: [PATCH] vendors now require ranks to roll high tier items --- src/engine/objects/NPC.java | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index e4851196..ae21de63 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -1310,20 +1310,47 @@ public class NPC extends AbstractCharacter { if (this.canRoll == null) { this.canRoll = DbManager.ItemQueries.GET_ITEMS_FOR_VENDOR(this.vendorID); - + } + HashSet fullItemList = this.canRoll; + HashSet returnIDs = new HashSet<>(); + short maxSkill = 25; + switch(this.getRank()){ + case 1: + maxSkill = 25; + break; + case 2: + maxSkill = 50; + break; + case 3: + case 4: + maxSkill = 75; + break; + case 5: + case 6: + maxSkill = 100; + break; + case 7: + maxSkill = 110; + break; + } + for(Integer itemID : fullItemList){ + if(ItemBase.getItemBase(itemID).getPercentRequired() <= maxSkill){ + returnIDs.add(itemID); + } + } if (this.contract.getVendorID() == 102) { for (int i = 0; i < this.getRank(); i++) { int subID = i + 1; - this.canRoll.add(910010 + subID); + returnIDs.add(910010 + subID); } if (this.getRank() == 7) - this.canRoll.add(910018); + returnIDs.add(910018); } - } + //} - return this.canRoll; + return returnIDs; } public int getRollingTimeInSeconds(int itemID) {