Advertisement
Guest User

RareDrops

a guest
Aug 27th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1. if (playerCommand.startsWith("raredrops")) {
  2.         try {
  3.         String[] args = playerCommand.split(" ", 2);
  4.         for (int i = 0; i < NpcHandler.maxListedNPCs; i++) {
  5.             if (NpcHandler.NpcList[i] != null) {
  6.             if (NpcHandler.NpcList[i].npcName.equalsIgnoreCase(args[1].replaceAll(" ", "_"))
  7.                 || NpcHandler.NpcList[i].npcName.equalsIgnoreCase(args[1].replaceAll(" ", " "))) {
  8.                 if (NPCDrops.rareDrops.get(NpcHandler.NpcList[i].npcId) != null) {
  9.                 c.getPA().showInterface(47000);
  10.                 for (int p = 0; p < 100; p++) {
  11.                     c.getPA().sendFrame126("", 47016 + p);
  12.                 }
  13.                 c.getPA().sendFrame126(
  14.                     "@red@NPC NAME: " + NpcHandler.NpcList[i].npcName.replaceAll("_", " "), 47016);
  15.                 for (int j = 0; j < NPCDrops.rareDrops.get(NpcHandler.NpcList[i].npcId).length; j++) {
  16.                     c.getPA()
  17.                         .sendFrame126(
  18.                             (j + 1) + ". "
  19.                                 + ItemAssistant.getItemName(NPCDrops.rareDrops
  20.                                     .get(NpcHandler.NpcList[i].npcId)[j][0])
  21.                                 + ", Amount: "
  22.                                 + NPCDrops.rareDrops.get(NpcHandler.NpcList[i].npcId)[j][1],
  23.                             47018 + j);
  24.                 }
  25.                 return;
  26.                 }
  27.             }
  28.             }
  29.         }
  30.         c.sendMessage("This NPC cannot be searched.");
  31.         } catch (Exception e) {
  32.         c.sendMessage("::raredrops NPC NAME");
  33.         }
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement