Thread: [PI] Need help making NPC identify herbs for price

Results 1 to 5 of 5
  1. #1 [PI] Need help making NPC identify herbs for price 
    Registered Member
    Join Date
    Aug 2007
    Posts
    133
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    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?
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2008
    Posts
    420
    Thanks given
    8
    Thanks received
    28
    Rep Power
    84
    Quote Originally Posted by Ichigo1019 View Post
    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
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2007
    Posts
    133
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    thanks for replying that helped a lot making it so if i use a herb on him itll identify it but i want to make it so he'll identify all of them in one click from a dialogue ive alreedy got the dialogue in but idk how to make it do multiple items at once
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2013
    Age
    30
    Posts
    117
    Thanks given
    12
    Thanks received
    24
    Rep Power
    0
    Quote Originally Posted by Ichigo1019 View Post
    thanks for replying that helped a lot making it so if i use a herb on him itll identify it but i want to make it so he'll identify all of them in one click from a dialogue ive alreedy got the dialogue in but idk how to make it do multiple items at once
    The For-Each Loop
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2007
    Posts
    133
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    thanks for the link but i have no clue how to convert that to my pi source though
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 01-31-2012, 08:41 AM
  2. [PI] Need help making an webclient :/
    By brunexxx in forum Help
    Replies: 2
    Last Post: 04-02-2011, 05:48 PM
  3. [PI] Need help making an webclient :/
    By brunexxx in forum Help
    Replies: 0
    Last Post: 04-02-2011, 03:13 PM
  4. [PI] need help making command[REP ++]
    By jorjus16 in forum Help
    Replies: 10
    Last Post: 10-14-2010, 05:08 AM
  5. Replies: 1
    Last Post: 07-26-2010, 10:14 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •