public static void doDialogue(Player p, int status) { if (status > 0 && status < 76) { AgilityArena.doDialogue(p, status); } else if (status > 76 && status < 100) { WarriorGuild.talkToKamfreena(p, status); } else if (status > 100 && status < 125) { BrokenBarrows.showBobDialogue(p, status); } else if (status > 155 && status < 200) { HomeArea.showAliDialogue(p, status); } else if (status > 200 && status < 235) { AlKharid.showAliDialogue(p, status); } else if (status > 239 && status < 270) { BoatOptions.showBentleyDialogue(p, status); } else if (status > 279 && status < 300) { BoatOptions.showCanifisSailorDialogue(p, status); } else if (status > 299 && status < 330) { BoatOptions.showJarvaldDialogue(p, status); } else if (status > 339 && status < 360) { BoatOptions.showSquireDialogue(p, status); } else if (status > 370 && status < 400) { BoatOptions.showArnorDialogue(p, status); } else if (status > 410 && status < 430) { BoatOptions.showCaptainBarnabyDialogue(p, status); } }
private void handleThirdClickNPC(Player player, Packet packet) { int npcIndex = packet.readShortA(); if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } Npc npc = Server.getNpcList()[npcIndex]; if (npc == null || npc.isDestroyed()) { return; } Console.WriteLine("Third click NPC " + npc.getId()); SkillHandler.resetAllSkills(player); if (Thieving.wantToThieveNpc(player, npc)) { return; } else if (Fishing.wantToFish(player, npc, true)) { return; } else if (AgilityArena.dialogue(player, npc, true)) { return; } else if (TzHaar.interactTzhaarNPC(player, npc, 2)) { return; } else if (WarriorGuild.talkToWarriorGuildNPC(player, npc, 2)) { return; } switch (npc.getId()) { case 553: // Aubury HomeArea.interactWithAubury(player, npc, 2); break; case 519: // Bob BrokenBarrows.talkToBob(player, npc, -1, 2); break; } }
private void handleSecondClickNPC(Player player, Packet packet) { int npcIndex = packet.readLEShort(); if (npcIndex < 0 || npcIndex > Constants.MAX_NPCS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } Npc npc = Server.getNpcList()[npcIndex]; if (npc == null || npc.isDestroyed()) { return; } Console.WriteLine("Second click NPC " + npc.getId()); SkillHandler.resetAllSkills(player); if (Fishing.wantToFish(player, npc, false)) { return; } else if (Slayer.talkToMaster(player, npc)) { return; } else if (AgilityArena.dialogue(player, npc, false)) { return; } else if (TzHaar.interactTzhaarNPC(player, npc, 1)) { return; } else if (WarriorGuild.talkToWarriorGuildNPC(player, npc, 1)) { return; } else if (BoatOptions.interactWithBoatNPC(player, npc)) { return; } switch (npc.getId()) { case 519: // Bob BrokenBarrows.talkToBob(player, npc, -1, 1); break; case 553: // Aubury HomeArea.interactWithAubury(player, npc, 1); break; case 1862: // Ali morisanne if (npc.getLocation().inArea(2319, 3177, 2321, 3182)) { // Home Ali HomeArea.interactWithAliMorissaae(player, npc); break; } else if (npc.getLocation().inArea(3311, 3198, 3316, 3199)) { // Al Kharid Ali AlKharid.interactWithAliMorissaae(player, npc); break; } break; } }
private void handleItemOnObject(Player player, Packet packet) { int objectX = packet.readShortA(); int item = packet.readUShort(); int objectY = packet.readLEShort(); int slot = packet.readUShort(); int interfaceId = packet.readLEShort(); int child = packet.readUShort(); int objectId = packet.readShortA(); if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null) { return; } Console.WriteLine("Item on object = " + objectId + " " + objectX + " " + objectY); SkillHandler.resetAllSkills(player); player.getPackets().closeInterfaces(); player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ())); if (player.getInventory().getItemInSlot(slot) == item) { if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId)) { return; } else if (Farming.interactWithPatch(player, objectId, objectX, objectY, player.getInventory().getItemInSlot(slot))) { return; } else if (WarriorGuild.useAnimator(player, player.getInventory().getItemInSlot(slot), objectId, objectX, objectY)) { return; } if (player.getInventory().getItemInSlot(slot) == 7936) { if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY)) { return; } if (RuneCraft.useTalisman(player, objectId, objectX, objectY)) { return; } } switch (objectId) { case 6: // Cannon: DwarfCannon cannon = player.getCannon(); Location l = new Location(objectX, objectY, player.getLocation().getZ()); if (cannon == null || (cannon != null & !l.withinDistance(cannon.getLocation(), 2))) { player.getPackets().sendMessage("This isn't your cannon!"); break; } cannon.loadCannon(); break; case 36781: // Lumbridge fountain. case 24214: // Fountain in east Varrock. case 24265: // Varrock main fountain. case 11661: // Falador waterpump. case 11759: // Falador south fountain. case 879: // Camelot fountains. case 29529: // Sink. case 874: // Sink. if (FillVial.fillingVial(player, new Location(objectX, objectY, player.getLocation().getZ())) && player.getInventory().getItemInSlot(slot) == 229) { break; } break; case 2728: // Range in Catherby if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), false, -1, -1)) { break; } break; case 2732: // Fire if (Cooking.isCooking(player, player.getInventory().getItemInSlot(slot), true, objectX, objectY)) { break; } break; case 36956: // Lumbridge furnace case 11666: // Falador furnace if (Smelting.wantToSmelt(player, player.getInventory().getItemInSlot(slot))) { break; } else if (Crafting.wantsToCraftOnObject(player, player.getInventory().getItemInSlot(slot), objectId)) { break; } break; case 2783: // Anvil if (Smithing.wantToSmithOnAnvil(player, player.getInventory().getItemInSlot(slot), new Location(objectX, objectY, player.getLocation().getZ()))) { break; } break; default: player.getPackets().sendMessage("Nothing interesting happens."); break; } } }