|
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!/* 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;
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/* 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/* 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;Thanks for the help
now it doesn't eat keys unless you have all keys at once and then gives reward! now to revise/* 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;and yes I might be a little drunk
and this is what i ended up withnow just need to add barrows drop and switch barrows brothers from dropping individual armor pieces to keys and make a chest drop/* 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;
npc drops
and the start of the barrows chest itselfpublic 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)];
}
Final Edit(maybe lol):public static int randomBarrowsChest[] = {
4
};
public static int getBarrowsChestDrop() {
return randomBarrowsChest[(int)(Math.random()*randomBarrowsChest.length)];
}
Objectoption1.java
npcdrops.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;
Commands.javapublic 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)];
}
Npcdrops.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);
items.cfgpublic 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)];
}
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
« 718 Noclip command? | Requesting RS3 resources » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |