Originally Posted by
Ichigo1019
I added a herblore quest to my server mostly based off jungle potion from rs and i want to make it so after the quest the npc for the quest Kaqemeex will identify herbs for 2kea i may change the price later but im not worried about that the way i want to make it is so in a dialogue he'll ask if you want him to identify herbs for you ive got all the dialogue in and can do all that but i dont know how to make it so he'll check your inventory for herbs and then replace the herb with its identified version and also take away 2k for that herb and how to make him do all the herbs in your invo with one click any help please?
You can use "playerHasItem(ITEMID, AMT)" if you have that method. I am not sure if you do but if not you can use a for loop which scans through the inventory checking with the "getItemSlot(ITEMID)" and if that returns -1 then its not in the spot so something like this
Code:
for(int i = 0; i < playerItems.length; i++) {
if(c.getItems().getItemSlot(HERBID) != -1 && c.getItems().getItemSlot(995) != -1) {
if(c.playerItemsN[c.getItems().getItemSlot(995)] >= 2000) {
c.getItems().deleteItem(995 c.getItems().getItemSlot(995), 2000);
c.getItems().deleteItem(HERBID, c.getItems().getItemSlot(HERBID), AMOUNT);
c.getItems().addItem(HERBID, AMOUNT);
} else
sendMessage("you need atleast 2k coins");
} else
sendMessage("you need a herb to identify and 2k coins");
}
Something like that and there is a million other ways to do it, i just did it quickly