Thread: Multiple keys on one chest z525

Results 1 to 3 of 3
  1. #1 Multiple keys on one chest z525 
    Registered Member
    X Decisive's Avatar
    Join Date
    Aug 2014
    Posts
    43
    Thanks given
    9
    Thanks received
    37
    Rep Power
    80
    I'm struggling here I hate to take it to the forums I haven't given up nothing I seem to be doing is working here. I'm trying to make it so you need multiple keys in your inventory which once used will be deleted for a barrows chest. Given the fact its barrows there will be 6 keys and 6 items out of the inventory that need to be deleted.

    here is my test code:

    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    Engine.playerItems.addItem(p, NpcDrops.getCrystalChestDrop(), 1);
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    break;
    Any and all help is appreciated thanks!

    so I got it to work with 2 keys but wont display message notifying that you need all keys

    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    if (Engine.playerItems.invItemCount(p, 1544) >=1) {
    Server.engine.playerItems.deleteItem(p, 1544, Server.engine.playerItems.getItemSlot(p, 1544), 1);
    Engine.playerItems.addItem(p, NpcDrops.getCrystalChestDrop(), 1);
    } else {
    }
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    break;
    so now i have it so it displays the message but will eat one of the keys and not give you a reward, but display the message but if you have both keys it will take the keys and give you reward
    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    if (Engine.playerItems.invItemCount(p, 1544) >=1) {
    Server.engine.playerItems.deleteItem(p, 1544, Server.engine.playerItems.getItemSlot(p, 1544), 1);
    Engine.playerItems.addItem(p, NpcDrops.getCrystalChestDrop(), 1);
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    break;
    I have it figured out Thanks for the help
    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    if (Engine.playerItems.invItemCount(p, 1544) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    Server.engine.playerItems.deleteItem(p, 1544, Server.engine.playerItems.getItemSlot(p, 1544), 1);
    Engine.playerItems.addItem(p, NpcDrops.getCrystalChestDrop(), 1);
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    }
    break;
    now it doesn't eat keys unless you have all keys at once and then gives reward! now to revise and yes I might be a little drunk

    and this is what i ended up with
    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    if (Engine.playerItems.invItemCount(p, 1544) >=1) {
    if (Engine.playerItems.invItemCount(p, 1545) >=1) {
    if (Engine.playerItems.invItemCount(p, 1546) >=1) {
    if (Engine.playerItems.invItemCount(p, 1547) >=1) {
    if (Engine.playerItems.invItemCount(p, 1548) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    Server.engine.playerItems.deleteItem(p, 1544, Server.engine.playerItems.getItemSlot(p, 1544), 1);
    Server.engine.playerItems.deleteItem(p, 1545, Server.engine.playerItems.getItemSlot(p, 1545), 1);
    Server.engine.playerItems.deleteItem(p, 1546, Server.engine.playerItems.getItemSlot(p, 1546), 1);
    Server.engine.playerItems.deleteItem(p, 1547, Server.engine.playerItems.getItemSlot(p, 1547), 1);
    Server.engine.playerItems.deleteItem(p, 1548, Server.engine.playerItems.getItemSlot(p, 1548), 1);
    Engine.playerItems.addItem(p, NpcDrops.getCrystalChestDrop(), 1);
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    break;
    now just need to add barrows drop and switch barrows brothers from dropping individual armor pieces to keys and make a chest drop

    npc drops
    public static int randomDharok[] = {
    1548, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getDharokDrop() {
    return randomDharok[(int)(Math.random()*randomDharok.length)];
    }
    public static int randomGuthan[] = {
    1547, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getGuthanDrop() {
    return randomGuthan[(int)(Math.random()*randomGuthan.length)];
    }
    public static int randomKaril[] = {
    1546, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getKarilDrop() {
    return randomKaril[(int)(Math.random()*randomKaril.length)];
    }
    public static int randomVerac[] = {
    1545, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getVeracDrop() {
    return randomVerac[(int)(Math.random()*randomVerac.length)];
    }
    public static int randomTorag[] = {
    1544, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getToragDrop() {
    return randomTorag[(int)(Math.random()*randomTorag.length)];
    }
    public static int randomAhrim[] = {
    1543, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getAhrimDrop() {
    return randomAhrim[(int)(Math.random()*randomAhrim.length)];
    }
    and the start of the barrows chest itself
    public static int randomBarrowsChest[] = {
    4
    };
    public static int getBarrowsChestDrop() {
    return randomBarrowsChest[(int)(Math.random()*randomBarrowsChest.length)];
    }
    Final Edit(maybe lol):

    Objectoption1.java
    /* Barrows Chest */
    case 1994:
    if (Engine.playerItems.invItemCount(p, 1543) >=1) {
    if (Engine.playerItems.invItemCount(p, 1544) >=1) {
    if (Engine.playerItems.invItemCount(p, 1545) >=1) {
    if (Engine.playerItems.invItemCount(p, 1546) >=1) {
    if (Engine.playerItems.invItemCount(p, 1547) >=1) {
    if (Engine.playerItems.invItemCount(p, 1548) >=1) {
    Server.engine.playerItems.deleteItem(p, 1543, Server.engine.playerItems.getItemSlot(p, 1543), 1);
    Server.engine.playerItems.deleteItem(p, 1544, Server.engine.playerItems.getItemSlot(p, 1544), 1);
    Server.engine.playerItems.deleteItem(p, 1545, Server.engine.playerItems.getItemSlot(p, 1545), 1);
    Server.engine.playerItems.deleteItem(p, 1546, Server.engine.playerItems.getItemSlot(p, 1546), 1);
    Server.engine.playerItems.deleteItem(p, 1547, Server.engine.playerItems.getItemSlot(p, 1547), 1);
    Server.engine.playerItems.deleteItem(p, 1548, Server.engine.playerItems.getItemSlot(p, 1548), 1);
    Server.engine.playerItems.addItem(p, 560, Misc.random(300));
    Server.engine.playerItems.addItem(p, 558, Misc.random(300));
    Server.engine.playerItems.addItem(p, 562, Misc.random(300));
    Server.engine.playerItems.addItem(p, 565, Misc.random(300));
    Engine.playerItems.addItem(p, NpcDrops.getBarrowsChestDrop(), 1);
    Engine.playerItems.addItem(p, NpcDrops.getBarrowsChestDrop(), 1);
    Engine.playerItems.addItem(p, NpcDrops.getBarrowsChestDrop(), 1);
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    } else {
    p.getActionSender().sendMessage(p, "You need all keys to unlock the barrows chest.");
    }
    break;
    npcdrops.java
    public static int randomBarrowsChest[] = {
    4716, 4718, 4720, 4722, 4708, 4710, 4712, 4714, 4724, 4726, 4728, 4730, 4732, 4734, 3736, 4738, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 1079, 1725, 1093, 1127, 1147, 1163, 1185, 1201, 1213, 1247, 1275, 1289, 1303, 1319, 536, 536, 536, 536, 536, 536, 1333, 1347, 1359, 1373, 1432, 2363, 1215, 1231, 1249, 1305, 1377, 1434, 1540, 1615, 1631, 1631, 1631, 1631, 1631, 3204, 4087, 4585, 4587, 5698, 6739, 7407, 9215, 544, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 9075
    };
    public static int getBarrowsChestDrop() {
    return randomBarrowsChest[(int)(Math.random()*randomBarrowsChest.length)];
    }
    Commands.java
    } else if (cmd[0].equals("barrowskeys")) {
    Engine.playerItems.addItem(p, 1543, 1);
    Engine.playerItems.addItem(p, 1544, 1);
    Engine.playerItems.addItem(p, 1545, 1);
    Engine.playerItems.addItem(p, 1546, 1);
    Engine.playerItems.addItem(p, 1547, 1);
    Engine.playerItems.addItem(p, 1548, 1);
    Npcdrops.java
    public static int randomDharok[] = {
    1548, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getDharokDrop() {
    return randomDharok[(int)(Math.random()*randomDharok.length)];
    }
    public static int randomGuthan[] = {
    1547, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getGuthanDrop() {
    return randomGuthan[(int)(Math.random()*randomGuthan.length)];
    }
    public static int randomKaril[] = {
    1546, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getKarilDrop() {
    return randomKaril[(int)(Math.random()*randomKaril.length)];
    }
    public static int randomVerac[] = {
    1545, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getVeracDrop() {
    return randomVerac[(int)(Math.random()*randomVerac.length)];
    }
    public static int randomTorag[] = {
    1544, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getToragDrop() {
    return randomTorag[(int)(Math.random()*randomTorag.length)];
    }
    public static int randomAhrim[] = {
    1543, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 1333, 536, 385, 5698, 1079, 1127, 555, 557, 559, 556, 560, 985, 987
    };
    public static int getAhrimDrop() {
    return randomAhrim[(int)(Math.random()*randomAhrim.length)];
    }
    items.cfg

    item = 1543 Key Ahrims_Chest_Key. 1000000 1000000 1000000 0 0 0 0 0 0 0 0 0 0 0 0
    item = 1544 Key Torags_Chest_Key. 1000000 1000000 1000000 0 0 0 0 0 0 0 0 0 0 0 0
    item = 1545 Key Veracs_Chest_key. 1000000 1000000 1000000 0 0 0 0 0 0 0 0 0 0 0 0
    item = 1546 Key Karils_Chest_key. 750000 750000 750000 0 0 0 0 0 0 0 0 0 0 0 0
    item = 1547 Key Guthans_Chest_key. 900000 900000 900000 0 0 0 0 0 0 0 0 0 0 0 0
    item = 1548 Key Dharoks_Chest_Key. 1200000 1200000 1200000 0 0 0 0 0 0 0 0 0 0 0 0
    X Decisive - Runescape and RSPS Veteran
    HAPPYPKSCAPE z525 UNDERCONSTRUCTION
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,547
    Thanks given
    646
    Thanks received
    637
    Rep Power
    334
    Quote Originally Posted by X Decisive View Post
    I'm struggling here I hate to take it to the forums I haven't given up nothing I seem to be doing is working here. I'm trying to make it so you need multiple keys in your inventory which once used will be deleted for a barrows chest. Given the fact its barrows there will be 6 keys and 6 items out of the inventory that need to be deleted.

    here is my test code:



    Any and all help is appreciated thanks!

    so I got it to work with 2 keys but wont display message notifying that you need all keys



    so now i have it so it displays the message but will eat one of the keys and not give you a reward, but display the message but if you have both keys it will take the keys and give you reward

    I have it figured out Thanks for the help

    now it doesn't eat keys unless you have all keys at once and then gives reward! now to revise and yes I might be a little drunk

    and this is what i ended up with
    now just need to add barrows drop and switch barrows brothers from dropping individual armor pieces to keys and make a chest drop

    npc drops


    and the start of the barrows chest itself


    Final Edit(maybe lol):

    Objectoption1.java

    npcdrops.java


    Commands.java


    Npcdrops.java


    items.cfg
    Next time you will get more feedback if you post into this section: [Only registered and activated users can see links. ]
    Not sure about your server revision, but its structure looks more similar to rs2 servers than 503+ servers
    Project thread
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    X Decisive's Avatar
    Join Date
    Aug 2014
    Posts
    43
    Thanks given
    9
    Thanks received
    37
    Rep Power
    80
    Quote Originally Posted by clem585 View Post
    Next time you will get more feedback if you post into this section: [Only registered and activated users can see links. ]
    Not sure about your server revision, but its structure looks more similar to rs2 servers than 503+ servers
    Hey thanks and yeah totally saw the help section after i posted this in requests haha
    X Decisive - Runescape and RSPS Veteran
    HAPPYPKSCAPE z525 UNDERCONSTRUCTION
    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. RSPS-Clients! Multiple Servers on one site.
    By JavaKing in forum Advertise
    Replies: 0
    Last Post: 03-24-2011, 06:52 PM
  2. Error on one connection per IP
    By dark mager in forum Help
    Replies: 1
    Last Post: 09-17-2009, 11:41 PM
  3. ActionButtonId is said when clicking on one
    By Rebirth in forum Snippets
    Replies: 3
    Last Post: 08-04-2009, 02:20 PM
  4. [req] help on one error [req]
    By Discardedx2 in forum Help
    Replies: 2
    Last Post: 02-21-2009, 02:52 AM
  5. Replies: 4
    Last Post: 01-01-2008, 05:50 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
  •