Example #1
0
 private void handleFifthClickNPC(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("Fifth click NPC " + npc.getId());
     SkillHandler.resetAllSkills(player);
     if (Slayer.openPointsInterface(player, npc))
     {
         return;
     }
 }
Example #2
0
        private void handleSecondClickObject(Player player, Packet packet)
        {
            int objectY = packet.readLEShortA();
            int objectX = packet.readLEShort();
            ushort objectId = packet.readUShort();
            Console.WriteLine("Second object click = " + objectId + " " + objectX + " " + objectY);
            if (player.getTemporaryAttribute("unmovable") != null)
            {
                return;
            }
            if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            SkillHandler.resetAllSkills(player);
            player.getPackets().closeInterfaces();
            player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
            if (Thieving.wantToThieveStall(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1))
            {
                return;
            }
            else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2))
            {
                return;
            }
            switch (objectId)
            {
                case 28089: // GE desk
                    Server.getGrandExchange().clickDesk(player, objectX, objectY, 2);
                    break;

                case 25824: // Spinning wheel (Seers)
                case 36970: // Spinning wheel (Lumbridge
                    Spinning.displaySpinningInterface(player);
                    break;

                case 6: // Dwarf multicannon
                    DwarfCannon cannon = player.getCannon();
                    Location l = new Location(objectX, objectY, player.getLocation().getZ());
                    if (cannon == null || (cannon != null & !l.Equals(cannon.getLocation())))
                    {
                        player.getPackets().sendMessage("This isn't your cannon!");
                        break;
                    }
                    cannon.pickupCannon();
                    break;

                case 11666: // Falador furnace
                case 36956: // Lumbridge furnace
                    Smelting.displaySmeltOptions(player);
                    break;

                case 11959: // Tin rocks
                case 11958:
                case 11957:
                case 11933:
                case 11934:
                case 11935:
                case 31077:
                case 31078:
                case 31079:
                    Mining.prospectRock(player, objectX, objectY, "tin");
                    break;

                case 11960: // Copper rocks
                case 11961:
                case 11962:
                case 11936:
                case 11937:
                case 11938:
                case 31080:
                case 31081:
                case 31082:
                    Mining.prospectRock(player, objectX, objectY, "copper");
                    break;

                case 15504: // Clay rocks
                case 15503:
                case 15505:
                case 11189:
                case 11190:
                case 11191:
                case 31062:
                case 31063:
                case 31064:
                case 32429:
                case 32430:
                case 32431:
                    Mining.prospectRock(player, objectX, objectY, "clay");
                    break;

                case 11948: // Silver rocks
                case 11949:
                case 11950:
                case 11165:
                case 11186:
                case 11187:
                case 11188:
                case 31074:
                case 31075:
                case 31076:
                case 32444:
                case 32445:
                case 32446:
                case 15579:
                case 15580:
                case 15581:
                    Mining.prospectRock(player, objectX, objectY, "silver");
                    break;

                case 11930: // Coal rocks
                case 11931:
                case 11932:
                case 14850:
                case 14851:
                case 14852:
                case 31068:
                case 31069:
                case 31070:
                case 32426:
                case 32427:
                case 32428:
                    Mining.prospectRock(player, objectX, objectY, "coal");
                    break;

                case 11945: // Mithril rocks
                case 11946:
                case 11947:
                case 11942:
                case 11943:
                case 11944:
                case 14853:
                case 14854:
                case 14855:
                case 31086:
                case 31087:
                case 31088:
                case 32438:
                case 32439:
                case 32440:
                    Mining.prospectRock(player, objectX, objectY, "mithril");
                    break;

                case 11954: // Iron rocks
                case 11955:
                case 11956:
                case 14856:
                case 14857:
                case 14858:
                case 31071:
                case 31072:
                case 31073:
                case 32441:
                case 32442:
                case 32443:
                    Mining.prospectRock(player, objectX, objectY, "iron");
                    break;

                case 14859: // Rune rocks
                case 14860:
                case 14861:
                    Mining.prospectRock(player, objectX, objectY, "runite");
                    break;

                case 11951: // Gold rocks
                case 11952:
                case 11953:
                case 11183:
                case 11184:
                case 11185:
                case 31065:
                case 31066:
                case 31067:
                case 32432:
                case 32433:
                case 32434:
                case 15576:
                case 15577:
                case 15578:
                    Mining.prospectRock(player, objectX, objectY, "gold");
                    break;

                case 11963: // Adamant rocks
                case 11964:
                case 11965:
                case 11939:
                case 11940:
                case 11941:
                case 14862:
                case 14863:
                case 14864:
                case 31083:
                case 31084:
                case 31085:
                case 32435:
                case 32436:
                case 32437:
                    Mining.prospectRock(player, objectX, objectY, "adamantite");
                    break;

                case 11552: // Empty rocks
                case 11553:
                case 11554:
                case 11555:
                case 11556:
                case 31059:
                case 31060:
                case 31061:
                case 14832:
                case 14833:
                case 14834:
                case 33400:
                case 33401:
                case 33402:
                case 15582:
                case 15583:
                case 15584:
                    Mining.displayEmptyRockMessage(player, new Location(objectX, objectY, player.getLocation().getZ()));
                    break;

                case 2491: // Rune essence
                    Mining.prospectRock(player, objectX, objectY, "Rune essence");
                    break;

                case 27663: // Duel arena bank chest.
                case 2213:  // Catherby bank booth.
                case 11402: // Varrock bank booth.
                case 11758: // Falador bank booth.
                case 36786: // Lumbridge bank booth.
                case 35647: // Al-Kharid bank booth.
                case 25808: // Seers bank booth.
                case 34752: // Ardougne bank booth.
                case 26972: // Edgeville bank booth.
                case 29085: // Ooglog bank booth.
                    player.getBank().openBank(false, objectX, objectY);
                    break;
            }
        }
Example #3
0
 private void handleDropItem(Player player, Packet packet)
 {
     int item = packet.readShortA();
     int slot = packet.readShortA();
     int interfaceId = packet.readLEShort();
     int childId = packet.readUShort();
     if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     if (player.getInventory().getItemInSlot(slot) == item)
     {
         player.getPackets().closeInterfaces();
         if (ItemData.isPlayerBound(player.getInventory().getItemInSlot(slot)))
         {
             Item[] items = { new Item(player.getInventory().getItemInSlot(slot), 1) };
             //player.getPackets().sendItems(94, 0, 93, items);
             player.getPackets().modifyText("Are you sure you want to destroy this item?", 94, 3); // Title
             //player.getPackets().modifyText("Yes", 94, 4); // Yes
             //player.getPackets().modifyText("No", 94, 5); // No
             player.getPackets().modifyText("", 94, 10); // Line 1
             player.getPackets().modifyText("If you wish to get another Fire cape, you must", 94, 11); // Line 2
             player.getPackets().modifyText("complete the Fight cave minigame again.", 94, 12); // Line 3
             player.getPackets().modifyText("Fire Cape", 94, 13); // Item name
             player.getPackets().sendChatboxInterface(94);
             return;
         }
         int id = player.getInventory().getItemInSlot(slot);
         int amt = player.getInventory().getAmountInSlot(slot);
         GroundItem i = new GroundItem(id, amt, new Location(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()), player);
         if (player.getInventory().deleteItem(id, slot, amt))
         {
             if (!Server.getGroundItems().addToStack(id, amt, player.getLocation(), player))
             {
                 Server.getGroundItems().newEntityDrop(i);
             }
         }
     }
 }
Example #4
0
        private void handleSwapSlot2(Player player, Packet packet)
        {
            int interfaceId = packet.readLEShort();
            int child = packet.readUShort();
            int newSlot = packet.readLEShort();
            int interface2 = packet.readUShort();
            int child2 = packet.readUShort();
            int oldSlot = packet.readLEShort();
            int oldItem = player.getInventory().getItemInSlot(oldSlot);
            int oldAmount = player.getInventory().getAmountInSlot(oldSlot);
            int newItem = player.getInventory().getItemInSlot(newSlot);
            int newAmount = player.getInventory().getAmountInSlot(newSlot);
            if (oldSlot > 28 || oldSlot < 0 || newSlot > 28 || oldSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            switch (interfaceId)
            {
                case 621: // Shop.
                case 763: // Bank.
                case 336: // Duel
                    player.getInventory().getSlot(oldSlot).setItemId(newItem);
                    player.getInventory().getSlot(oldSlot).setItemAmount(newAmount);
                    player.getInventory().getSlot(newSlot).setItemId(oldItem);
                    player.getInventory().getSlot(newSlot).setItemAmount(oldAmount);
                    break;

                default:
                    Misc.WriteError("UNHANDLED ITEM SWAP 2 : interface = " + interfaceId);
                    break;
            }
            //No need to update the screen since the client does it for us!
            player.getPackets().refreshInventory();
        }
Example #5
0
        private void handleSwapSlot(Player player, Packet packet)
        {
            int oldSlot = packet.readUShort();
            int childId = packet.readLEShort();
            int interfaceId = packet.readLEShort();
            int newSlot = packet.readShortA();
            int swapType = packet.readByteS();
            int oldItem = player.getInventory().getItemInSlot(oldSlot);
            int oldAmount = player.getInventory().getAmountInSlot(oldSlot);
            int newItem = player.getInventory().getItemInSlot(newSlot);
            int newAmount = player.getInventory().getAmountInSlot(newSlot);
            if (oldSlot > 28 || oldSlot < 0 || newSlot > 28 || oldSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            switch (interfaceId)
            {
                case 149:
                    if (swapType == 0 && childId == 0)
                    {
                        player.getInventory().getSlot(oldSlot).setItemId(newItem);
                        player.getInventory().getSlot(oldSlot).setItemAmount(newAmount);
                        player.getInventory().getSlot(newSlot).setItemId(oldItem);
                        player.getInventory().getSlot(newSlot).setItemAmount(oldAmount);
                    }
                    break;

                default:
                    Misc.WriteError("UNHANDLED ITEM SWAP 1 : interface = " + interfaceId);
                    break;
            }
            //No need to update the screen since the client does it for us!
        }
Example #6
0
 private void handleMagicOnPlayer(Player player, Packet packet)
 {
     int junk = packet.readShortA();
     int id = packet.readLEShort();
     int interfaceId = packet.readLEShort();
     int index = packet.readLEShortA();
     if (index < 0 || index >= Constants.MAX_PLAYERS || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     Player p2 = Server.getPlayerList()[index];
     if (p2 == null)
     {
         return;
     }
     player.getPackets().closeInterfaces();
     player.setTarget(p2);
     MagicCombat.newMagicAttack(player, p2, id, interfaceId == 193);
 }
Example #7
0
        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;
            }
        }
Example #8
0
 private void handleItemOnNPC(Player player, Packet packet)
 {
     int interfaceId = packet.readInt();
     int slot = packet.readLEShort();
     int npcIndex = packet.readLEShort();
     int item = packet.readLEShortA();
     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;
     }
     SkillHandler.resetAllSkills(player);
     player.getPackets().closeInterfaces();
     Console.WriteLine("Item on NPC " + npc.getId());
     if (player.getInventory().getItemInSlot(slot) == item)
     {
         switch (npc.getId())
         {
             case 519: // Bob
                 BrokenBarrows.talkToBob(player, npc, player.getInventory().getItemInSlot(slot), 0);
                 break;
         }
     }
 }
Example #9
0
 private void handleOperateItem(Player player, Packet packet)
 {
     int item = packet.readShortA();
     int slot = packet.readLEShort();
     int interfaceId = packet.readLEShort();
     int childId = packet.readLEShort();
     if (slot < 0 || slot > 13 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     ItemData.EQUIP equipSlot = (ItemData.EQUIP)slot;
     if (player.getEquipment().getItemInSlot(equipSlot) == item)
     {
         SkillHandler.resetAllSkills(player);
         player.getPackets().closeInterfaces();
         if (JewelleryTeleport.useJewellery(player, player.getEquipment().getItemInSlot(equipSlot), slot, true))
         {
             return;
         }
         else
             if (equipSlot == ItemData.EQUIP.CAPE && Skillcape.emote(player))
             {
                 return;
             }
         player.getPackets().sendMessage("This item isn't operable.");
     }
 }
Example #10
0
        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;
                }
            }
        }
Example #11
0
 private void handleItemOnItem(Player player, Packet packet)
 {
     int itemSlot = packet.readUShort();
     int unused = packet.readInt();
     int withSlot = packet.readLEShort();
     int unused2 = packet.readInt();
     int itemUsed = packet.readLEShortA();
     int usedWith = packet.readLEShortA();
     if (itemSlot > 28 || itemSlot < 0 || withSlot > 28 || withSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     player.getPackets().closeInterfaces();
     if (player.getInventory().getSlot(itemSlot).getItemId() == itemUsed && player.getInventory().getSlot(withSlot).getItemId() == usedWith)
     {
         if (Fletching.isFletching(player, itemUsed, usedWith))
         {
             return;
         }
         else if (Herblore.doingHerblore(player, itemUsed, usedWith))
         {
             return;
         }
         else if (Herblore.mixDoses(player, itemUsed, usedWith, itemSlot, withSlot))
         {
             return;
         }
         else if (Crafting.wantsToCraft(player, itemUsed, usedWith))
         {
             return;
         }
         else if (Firemaking.isFiremaking(player, itemUsed, usedWith, itemSlot, withSlot))
         {
             return;
         }
         else if (Farming.plantSapling(player, itemUsed, usedWith))
         {
             return;
         }
         else
         {
             player.getPackets().sendMessage("Nothing interesting happens.");
         }
     }
 }
Example #12
0
        private void handleItemOnGroundItem(Player player, Packet packet)
        {
            int objectX = packet.readLEShortA();
            int itemSlot = packet.readLEShort();
            int itemIdInInventory = packet.readLEShort();
            int itemIdOnGround = packet.readLEShort();
            int objectY = packet.readLEShortA();
            int interfaceId = packet.readLEShort();
            int child = packet.readUShort();

            if (itemSlot > 28 || itemSlot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
                return;

            if (Firemaking.isFiremaking(player, itemIdInInventory, itemIdOnGround, itemSlot, -1))
                return;
            else
                player.getPackets().sendMessage("Nothing interesting happens.");
        }
Example #13
0
        private void handleInvenClickItem(Player player, Packet packet)
        {
            int slot = packet.readLEShortA();
            int item = packet.readShortA();
            int childId = packet.readLEShort();
            int interfaceId = packet.readLEShort();
            if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            SkillHandler.resetAllSkills(player);
            if (player.getInventory().getItemInSlot(slot) == item)
            {
                player.getPackets().closeInterfaces();
                if (Consumables.isEating(player, player.getInventory().getItemInSlot(slot), slot))
                    return;
                else if (Herblore.idHerb(player, player.getInventory().getItemInSlot(slot)))
                    return;
                else if (RuneCraft.fillPouch(player, (RuneCraftData.POUCHES)player.getInventory().getItemInSlot(slot)))
                    return;
                else if (Prayer.wantToBury(player, player.getInventory().getItemInSlot(slot), slot))
                    return;
                else if (Teleport.useTeletab(player, player.getInventory().getItemInSlot(slot), slot))
                    return;
                else if (FarmingAmulet.showOptions(player, player.getInventory().getItemInSlot(slot)))
                    return;

                switch (item)
                {
                    case 4155: // Slayer gem
                        Slayer.doDialogue(player, 1051);
                        break;

                    case 6: // Dwarf multicannon
                        if (player.getCannon() != null)
                        {
                            player.getPackets().sendMessage("You already have a cannon set up!");
                            break;
                        }
                        player.setCannon(new DwarfCannon(player));
                        break;

                    case 5073: // Nest with seeds.
                    case 5074: // Nest with jewellery.
                        Woodcutting.randomNestItem(player, item);
                        break;

                    case 952: // Spade
                        player.setLastAnimation(new Animation(830));
                        if (Barrows.enterCrypt(player))
                        {
                            player.getPackets().sendMessage("You've broken into a crypt!");
                            break;
                        }
                        player.getPackets().sendMessage("You find nothing.");
                        break;
                }
            }
        }
Example #14
0
 private void handleEquipItem(Player player, Packet packet)
 {
     int item = packet.readLEShort();
     int slot = packet.readShortA();
     int interfaceId = packet.readInt();
     if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     if (player.getInventory().getItemInSlot(slot) == item)
     {
         //player.getPackets().closeInterfaces();
         if (RuneCraft.emptyPouch(player, (RuneCraftData.POUCHES)player.getInventory().getItemInSlot(slot)))
         {
             return;
         }
         player.getEquipment().equipItem(player.getInventory().getItemInSlot(slot), slot);
     }
 }
Example #15
0
        private void handleFirstClickObject(Player player, Packet packet)
        {
            int objectX = packet.readLEShort();
            ushort objectId = (ushort)packet.readShortA();
            int objectY = packet.readUShort();
            if (objectX < 1000 || objectY < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            SkillHandler.resetAllSkills(player);
            player.getPackets().closeInterfaces();
            Console.WriteLine("First object click = " + objectId + " " + objectX + " " + objectY);
            if (RuneCraft.wantToRunecraft(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (RuneCraft.enterRift(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (RuneCraft.enterViaTiara(player, objectId, objectX, objectY))
            {
                player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
                return;
            }
            else if (RuneCraft.leaveAltar(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Barrows.leaveCrypt(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Barrows.tryOpenCoffin(player, objectId))
            {
                return;
            }
            else if (Barrows.openTunnelDoor(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Thieving.wantToThieveChest(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Agility.doAgility(player, objectId, objectX, objectY))
            {
                return;
            }
            else if (Farming.interactWithPatch(player, objectId, objectX, objectY, -1))
            {
                return;
            }
            else if (Server.getGlobalObjects().getDoors().useDoor(player, objectId, objectX, objectY, player.getLocation().getZ()))
            {
                return;
            }
            else if (LaddersAndStairs.useObject(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1))
            {
                return;
            }
            else if (WildernessObelisks.useWildernessObelisk(player, objectId, new Location(objectX, objectY, player.getLocation().getZ())))
            {
                return;
            }
            if (player.getTemporaryAttribute("unmovable") != null)
            {
                return;
            }
            player.setFaceLocation(new Location(objectX, objectY, player.getLocation().getZ()));
            switch (objectId)
            {
                case 2492: // essence mine portals
                    RuneCraft.leaveEssMine(player, new Location(objectX, objectY, player.getLocation().getZ()));
                    break;

                case 5959:
                case 5960:
                    Wilderness.handleLever(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
                    break;

                case 733: // Wilderness web
                    Wilderness.slashWeb(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()));
                    break;

                case 28089: // GE desk
                    Server.getGrandExchange().clickDesk(player, objectX, objectY, 1);
                    break;

                case 9359: // Tzhaar main exit
                    TzHaar.exitTzhaar(player);
                    break;

                case 31284: // Tzhaar entrance
                    TzHaar.enterTzhaar(player);
                    break;

                case 9357: // Fight cave exit
                    FightCave.exitCave(player, objectX, objectY);
                    break;

                case 9356: // Fight cave entrance
                    FightCave.enterCave(player);
                    break;

                case 9391: // Tzhaar fight pits viewing orb
                    Server.getMinigames().getFightPits().useOrb(player, -1);
                    break;

                case 9369: // Tzhaar pits main entrance
                case 9368: // Tzhaar pits game door
                    Server.getMinigames().getFightPits().useDoor(player, objectId);
                    break;

                case 3617: // Agility arena ladder
                    AgilityArena.enterArena(player, objectX, objectY);
                    break;

                case 3618:
                    if (Location.atAgilityArena(player.getLocation()))
                    {
                        AgilityArena.exitArena(player, objectX, objectY);
                    }
                    break;

                case 6: // Dwarf multicannon
                    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.fireCannon();
                    break;

                case 7: //Cannon base only
                case 8: //Cannon stand
                case 9: //Cannon barrels
                    DwarfCannon cannonPickup = player.getCannon();
                    Location cannonLocation = new Location(objectX, objectY, player.getLocation().getZ());
                    if (cannonPickup == null || (cannonPickup != null & !cannonLocation.withinDistance(cannonPickup.getLocation(), 2)))
                    {
                        player.getPackets().sendMessage("This isn't your cannon!");
                        break;
                    }
                    cannonPickup.pickupCannon();
                    break;

                case 11601: // Clay oven
                    player.getPackets().modifyText("Please use the item on the oven.", 210, 1);
                    player.getPackets().sendChatboxInterface(210);
                    break;

                case 10284: // Barrows chest
                    Barrows.openChest(player);
                    break;

                case 4483: // Castle wars bank chest.
                case 21301: // Neitiznot bank chest
                    player.getBank().openBank(false, objectX, objectY);
                    break;

                case 1276: // Normal tree
                case 1278: // Normal tree
                case 2409: // Normal tree
                case 1277: // Normal tree with but different coloured stump
                case 3034: // Normal tree with dark stump
                case 3033: // Normal tree with dark stump
                case 10041: // Normal tree
                case 1282: // Dead tree
                case 1283: // Dead tree
                case 1284: // Dead tree
                case 1285: // Dead tree
                case 1286: // Dead tree
                case 1289: // Dead tree
                case 1290: // Dead tree
                case 1365: // Dead tree
                case 1383: // Dead tree
                case 1384: // Dead tree
                case 1291: // Dead tree
                case 3035: // Dead tree
                case 3036: // Dead tree
                case 1315: // Evergreen
                case 1316: // Evergreen
                case 1318: // Snowy Evergreen
                case 1319: // Snowy Evergreen
                case 1330: // Snow covered tree
                case 1331: // Snow covered tree
                case 1332: // Snow covered tree
                case 3879: // Evergreen from elf land
                case 3881: // Evergreen from elf land (slightly bigger than one above)
                case 3882: // Evergreen from elf land (slightly bigger than one above)
                case 3883: // Small Evergreen from elf land
                case 1280: // Normal tree orange stump
                case 14309: // PC game island tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 0, true);
                    break;

                case 1281: // Normal Oak tree
                case 3037: // Oak tree dark stump
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1, true);
                    break;

                case 1308: // Normal Willow tree
                case 5551: // Normal Willow tree
                case 5552: // Normal Willow tree
                case 5553: // Normal Willow tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2, true);
                    break;

                case 2023: // Achey tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 3, true);
                    break;

                case 9036: // Normal Teak tree
                case 15062: // Normal Teak tree (same as above?)
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 4, true);
                    break;

                case 1307: // Normal Maple tree
                case 4674:// Exactly same as above
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 5, true);
                    break;

                case 2289: // Normal Hollow tree
                case 4060: // Normal Hollow tree (bigger than above)
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 6, true);
                    break;

                case 9034: // Normal Mahogany tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 7, true);
                    break;

                case 21273: // Normal Arctic pine
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 8, true);
                    break;

                case 28951: // Normal Eucalyptus tree
                case 28952: // Normal Eucalyptus tree (smaller)
                case 28953: // Normal Eucalyptus tree (smallest)
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 9, true);
                    break;

                case 1309: // Yew tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 10, true);
                    break;

                case 1306: // Normal Magic tree
                    Woodcutting.tryCutTree(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 11, true);
                    break;

                case 3203: // Duel arena trapdoors.
                    if (player.getDuel() != null)
                    {
                        player.getDuel().forfeitDuel(objectX, objectY);
                        break;
                    }
                    break;

                case 7152: // Abyss tendrils.
                case 7144:
                    AbyssObstacles.chopTendrils(player, objectX, objectY);
                    break;

                case 7147: // Abyss tunnel.
                    AbyssObstacles.useAgilityTunnel(player, objectX, objectY);
                    break;

                case 7146: // Abyss eyes.
                case 7150:
                    AbyssObstacles.passEyes(player, objectX, objectY);
                    break;

                case 7151: // Abyss boil.
                case 7145:
                    AbyssObstacles.burnBoil(player, objectX, objectY);
                    break;

                case 7153: // Abyss mining rock.
                case 7143:
                    AbyssObstacles.mineRock(player, objectX, objectY);
                    break;

                case 2213: // Catherby bank booth.
                case 11402: // Varrock bank booth.
                case 11758: // Falador bank booth.
                case 36786: // Lumbridge bank booth.
                case 35647: // Al-Kharid bank booth.
                case 25808: // Seers bank booth.
                case 34752: // Ardougne bank booth.
                case 26972: // Edgeville bank booth.
                case 29085: // Ooglog bank booth.
                    player.getBank().openBank(true, objectX, objectY);
                    break;

                case 2491: // Essence rock
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 0, true);
                    break;

                case 11954: // Iron rocks
                case 11955:
                case 11956:
                case 14856:
                case 14857:
                case 14858:
                case 31071:
                case 31072:
                case 31073:
                case 32441:
                case 32442:
                case 32443:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 6, true);
                    break;

                case 11948: // Silver rocks
                case 11949:
                case 11950:
                case 11165:
                case 11186:
                case 11187:
                case 11188:
                case 31074:
                case 31075:
                case 31076:
                case 32444:
                case 32445:
                case 32446:
                case 15579:
                case 15580:
                case 15581:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 8, true);
                    break;

                case 15504: // Clay rocks
                case 15503:
                case 15505:
                case 11189:
                case 11190:
                case 11191:
                case 31062:
                case 31063:
                case 31064:
                case 32429:
                case 32430:
                case 32431:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 1, true);
                    break;

                case 11960: // Copper rocks
                case 11961:
                case 11962:
                case 11936:
                case 11937:
                case 11938:
                case 31080:
                case 31081:
                case 31082:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 2, true);
                    break;

                case 11959: // Tin rocks
                case 11958:
                case 11957:
                case 11933:
                case 11934:
                case 11935:
                case 31077:
                case 31078:
                case 31079:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 3, true);
                    break;

                case 11930: // Coal rocks
                case 11931:
                case 11932:
                case 14850:
                case 14851:
                case 14852:
                case 31068:
                case 31069:
                case 31070:
                case 32426:
                case 32427:
                case 32428:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 9, true);
                    break;

                case 11951: // Gold rocks
                case 11952:
                case 11953:
                case 11183:
                case 11184:
                case 11185:
                case 31065:
                case 31066:
                case 31067:
                case 32432:
                case 32433:
                case 32434:
                case 15576:
                case 15577:
                case 15578:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 10, true);
                    break;

                case 11945: // Mithril rocks
                case 11946:
                case 11947:
                case 11942:
                case 11943:
                case 11944:
                case 14853:
                case 14854:
                case 14855:
                case 31086:
                case 31087:
                case 31088:
                case 32438:
                case 32439:
                case 32440:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 11, true);
                    break;

                case 11963: // Adamant rocks
                case 11964:
                case 11965:
                case 11939:
                case 11940:
                case 11941:
                case 14862:
                case 14863:
                case 14864:
                case 31083:
                case 31084:
                case 31085:
                case 32435:
                case 32436:
                case 32437:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 12, true);
                    break;

                case 14859: // Rune rocks
                case 14860:
                case 14861:
                    Mining.tryMineRock(player, objectId, new Location(objectX, objectY, player.getLocation().getZ()), 13, true);
                    break;

                case 11552: // Empty rocks
                case 11553:
                case 11554:
                case 11555:
                case 11556:
                case 31059:
                case 31060:
                case 31061:
                case 14832:
                case 14833:
                case 14834:
                case 33400:
                case 33401:
                case 33402:
                case 15582:
                case 15583:
                case 15584:
                    Mining.displayEmptyRockMessage(player, new Location(objectX, objectY, player.getLocation().getZ()));
                    break;

                case 23271: // Wilderness ditch
                    Wilderness.crossDitch(player, objectX, objectY);
                    break;
            }
        }
Example #16
0
 private void handleThirdClickObject(Player player, Packet packet)
 {
     short id = packet.readLEShortA();
     int y = packet.readLEShortA();
     int x = packet.readLEShort();
     if (player.getTemporaryAttribute("unmovable") != null)
     {
         return;
     }
     if (x < 1000 || id < 0 || y < 1000 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     player.getPackets().closeInterfaces();
     player.setFaceLocation(new Location(x, y, player.getLocation().getZ()));
     Console.WriteLine("Third object click = " + id + " " + x + " " + y);
     if (LaddersAndStairs.useObject(player, id, new Location(x, y, player.getLocation().getZ()), 3))
     {
         return;
     }
     switch (id)
     {
         case 28089: // GE desk
             Server.getGrandExchange().clickDesk(player, x, y, 3);
             break;
     }
 }
Example #17
0
 private void handlePickupItem(Player player, Packet packet)
 {
     int x = packet.readLEShort();
     int id = packet.readUShort();
     int y = packet.readLEShortA();
     Location l = new Location(x, y, player.getLocation().getZ());
     SkillHandler.resetAllSkills(player);
     if (x < 1000 || y < 1000 | id < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     player.getPackets().closeInterfaces();
     if (player.getLocation().Equals(l))
     {
         Server.getGroundItems().pickupItem(player, id, player.getLocation());
         return;
     }
     CoordinateEvent pickupItemCoordinateEvent = new CoordinateEvent(player, l);
     pickupItemCoordinateEvent.setAction(() =>
     {
         Server.getGroundItems().pickupItem(player, id, player.getLocation());
     });
     Server.registerCoordinateEvent(pickupItemCoordinateEvent);
 }
Example #18
0
 private void handleMagicOnNPC(Player player, Packet packet)
 {
     int childId = packet.readLEShort();
     int interfaceId = packet.readLEShort();
     int junk = packet.readShortA();
     int npcIndex = packet.readLEShortA();
     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;
     }
     SkillHandler.resetAllSkills(player);
     player.setTarget(npc);
     MagicCombat.newMagicAttack(player, npc, childId, interfaceId == 193);
     Console.WriteLine(childId);
 }
Example #19
0
 private void handleRightClickOne(Player player, Packet packet)
 {
     int childId = packet.readLEShort();
     int interfaceId = packet.readLEShort();
     int item = packet.readLEShortA();
     int slot = packet.readLEShortA();
     if (slot > 28 || slot < 0 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
     {
         return;
     }
     SkillHandler.resetAllSkills(player);
     if (player.getInventory().getItemInSlot(slot) == item)
     {
         player.getPackets().closeInterfaces();
         if (interfaceId == 149 && childId == 0)
         {
             if (Herblore.emptyPotion(player, player.getInventory().getItemInSlot(slot), slot))
             {
                 return;
             }
             else if (JewelleryTeleport.useJewellery(player, player.getInventory().getItemInSlot(slot), slot, false))
             {
                 return;
             }
         }
     }
 }
Example #20
0
        private void handleRightClickTwo(Player player, Packet packet)
        {
            int childId = packet.readLEShort();
            int interfaceId = packet.readLEShort();
            int slot = packet.readLEShort();
            int item = packet.readLEShort();
            if (slot < 0 || slot > 28 || player.isDead() || player.getTemporaryAttribute("cantDoAnything") != null)
            {
                return;
            }
            SkillHandler.resetAllSkills(player);
            if (player.getInventory().getItemInSlot(slot) == item)
            {
                player.getPackets().closeInterfaces();
                switch (player.getInventory().getItemInSlot(slot))
                {
                    case 5509: // Small pouch.
                        player.getPackets().sendMessage("There is " + player.getSmallPouchAmount() + " Pure essence in your small pouch. (holds 3).");
                        break;

                    case 5510: // Medium pouch.
                        player.getPackets().sendMessage("There is " + player.getMediumPouchAmount() + " Pure essence in your medium pouch. (holds 6).");
                        break;

                    case 5512: // Large pouch.
                        player.getPackets().sendMessage("There is " + player.getLargePouchAmount() + " Pure essence in your large pouch. (holds 9).");
                        break;

                    case 5514: // Giant pouch.
                        player.getPackets().sendMessage("There is " + player.getGiantPouchAmount() + " Pure essence in your giant pouch. (holds 12).");
                        break;
                }
            }
        }
Example #21
0
        private void handleActionButton3(Player player, Packet packet)
        {
            int id = packet.readUShort();
            int interfaceId = packet.readUShort();
            int junk = packet.readLEShort();

            int logType = (int)(player.getTemporaryAttribute("fletchType") == null ? -1 : (int)player.getTemporaryAttribute("fletchType")); // Bows (Fletching).
            int ammoType = (int)(player.getTemporaryAttribute("ammoType") == null ? -1 : (int)player.getTemporaryAttribute("ammoType")); // Arrows (Fletching).
            int boltType = (int)(player.getTemporaryAttribute("ammoType2") == null ? -1 : (int)player.getTemporaryAttribute("ammoType2")); // Bolts (Fletching).
            int xbowType = (int)(player.getTemporaryAttribute("bowType2") == null ? -1 : (int)player.getTemporaryAttribute("bowType2")); // Xbows (Fletching).
            int bowType = (int)(player.getTemporaryAttribute("bowType") == null ? -1 : (int)player.getTemporaryAttribute("bowType")); // Longbow/Shortbow stringing (Fletching).
            int grindItem = (int)(player.getTemporaryAttribute("herbloreGrindItem") == null ? -1 : (int)player.getTemporaryAttribute("herbloreGrindItem")); // item to be grinded (Herblore)
            bool stringingBow = (bool)(player.getTemporaryAttribute("stringingBow") == null ? false : (bool)player.getTemporaryAttribute("stringingBow")); // Stringing bow/xbow (Fletching)
            int unfinishedPotion = (int)(player.getTemporaryAttribute("unfinishedPotion") == null ? -1 : (int)player.getTemporaryAttribute("unfinishedPotion")); // unfinished potion to make (Herblore)
            int completePotion = (int)(player.getTemporaryAttribute("completePotion") == null ? -1 : (int)player.getTemporaryAttribute("completePotion")); // unfinished potion to make (Herblore)
            int cookItem = (int)(player.getTemporaryAttribute("meatItem") == null ? -1 : (int)player.getTemporaryAttribute("meatItem")); // item to cook (Cooking)
            int dialogueStatus = (int)(player.getTemporaryAttribute("dialogue") == null ? -1 : (int)player.getTemporaryAttribute("dialogue")); // Dialogue status
            int craftType = (int)(player.getTemporaryAttribute("craftType") == null ? -1 : (int)player.getTemporaryAttribute("craftType")); // 'Category' of item to craft
            int leatherCraft = (int)(player.getTemporaryAttribute("leatherCraft") == null ? -1 : (int)player.getTemporaryAttribute("leatherCraft")); // Type of leather item to craft (high lvl hides)
            int boltTips = (int)(player.getTemporaryAttribute("boltTips") == null ? -1 : (int)player.getTemporaryAttribute("boltTips")); // Type of bolt tips to cut
            JewelleryTeleport.JewellerySlot js = (JewelleryTeleport.JewellerySlot)player.getTemporaryAttribute("jewelleryTeleport") == null ? null : (JewelleryTeleport.JewellerySlot)player.getTemporaryAttribute("jewelleryTeleport");
            Console.WriteLine("ACTIONBUTTON-3 " + id);
            if (JewelleryTeleport.teleport(player, id, js))
            {
                return;
            }
            switch (id)
            {
                case 2:
                    if (player.getDuel() != null)
                    {
                        if (player.getDuel().getStatus() == 6)
                        {
                            player.getDuel().finishDuel(true, true);
                            player.getPackets().sendMessage("You climb through the trapdoor and forfeit the duel.");
                            break;
                        }
                        break;
                    }
                    else
                        if (player.getTemporaryAttribute("barrowTunnel") != null)
                        {
                            Barrows.verifyEnterTunnel(player);
                            return;
                        }
                        else if (dialogueStatus == 1005)
                        {
                            Slayer.doDialogue(player, 1006);
                            break;
                        }
                        else if (dialogueStatus == 1009)
                        {
                            Slayer.doDialogue(player, 1010);
                            break;
                        }
                        else if (dialogueStatus == 1002)
                        {
                            Slayer.doDialogue(player, 1013);
                            break;
                        }
                        else if (dialogueStatus == 1017)
                        {
                            Slayer.doDialogue(player, 1019);
                            break;
                        }
                        else if (dialogueStatus == 1029)
                        {
                            Slayer.doDialogue(player, 1029);
                            break;
                        }
                        else if (dialogueStatus == 1053)
                        {
                            Slayer.doDialogue(player, 1055);
                            break;
                        }
                        else if (dialogueStatus > 1000)
                        {
                            Slayer.doDialogue(player, 1006);
                            break;
                        }
                        else if (dialogueStatus == 7)
                        {
                            AgilityArena.doDialogue(player, 7);
                            break;
                        }
                        else if (dialogueStatus == 29)
                        {
                            AgilityArena.doDialogue(player, 29);
                            break;
                        }
                        else if (dialogueStatus == 37)
                        {
                            AgilityArena.doDialogue(player, 37);
                            break;
                        }
                        else if (dialogueStatus == 46)
                        {
                            AgilityArena.doDialogue(player, 46);
                            break;
                        }
                        else if (dialogueStatus == 79)
                        {
                            WarriorGuild.talkToKamfreena(player, 79);
                            break;
                        }
                        else if (dialogueStatus == 103)
                        {
                            BrokenBarrows.showBobDialogue(player, 103);
                            break;
                        }
                        else if (dialogueStatus == 109)
                        {
                            BrokenBarrows.showBobDialogue(player, 109);
                            break;
                        }
                        else if (dialogueStatus == 159)
                        {
                            HomeArea.showAliDialogue(player, 159);
                            break;
                        }
                        else if (dialogueStatus == 207)
                        {
                            AlKharid.showAliDialogue(player, 207);
                            break;
                        }
                        else if (dialogueStatus == 242)
                        {
                            BoatOptions.showBentleyDialogue(player, 242);
                            break;
                        }
                        else if (dialogueStatus == 450)
                        {
                            FarmingAmulet.displayAllotmentOptions(player);
                            break;
                        }
                        else if (dialogueStatus == 451)
                        {
                            FarmingAmulet.teleportToPatch(player, 0);
                            break;
                        }
                        else if (dialogueStatus == 452)
                        {
                            FarmingAmulet.teleportToPatch(player, 4);
                            break;
                        }
                        else if (dialogueStatus == 453)
                        {
                            FarmingAmulet.teleportToPatch(player, 8);
                            break;
                        }
                    break;

                case 13:
                    if (logType != -1)
                    {
                        MakeBows.cutLog(player, 1, logType, 0, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pie dish
                        Clay.craftClay(player, 5, craftType, 1, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 8));
                        break;
                    }
                    else if (craftType == 6)
                    {// Crossbow string
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 2));
                        break;
                    }
                    break;

                case 12:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 5, logType, 0, stringingBow, true);
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 1, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pie dish
                        Clay.craftClay(player, 10, craftType, 1, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 1, 4, leatherCraft, true); // Vambraces
                        break;
                    }
                    else if (craftType == 6)
                    {// Bowstring
                        Spinning.craftSpinning(player, 1, 1, true);
                        break;
                    }
                    break;

                case 11:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 10, logType, 0, stringingBow, true);
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 1, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pie dish
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(306, 1));
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 5, 4, leatherCraft, true); // Vambraces
                        break;
                    }
                    else if (craftType == 6)
                    {// Bowstring
                        Spinning.craftSpinning(player, 5, 1, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Tiara
                        Silver.newSilverItem(player, 1, 121, true);
                        break;
                    }
                    break;

                case 10:
                    if (logType == 0)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 0));
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 5, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pot
                        Clay.craftClay(player, 1, craftType, 0, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 10, 4, leatherCraft, true); // Vambraces
                        break;
                    }
                    else if (craftType == 6)
                    {// Bowstring
                        Spinning.craftSpinning(player, 10, 1, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Tiara
                        Silver.newSilverItem(player, 5, 121, true);
                        break;
                    }
                    break;

                case 17:
                    if (logType != -1)
                    {
                        MakeBows.cutLog(player, 1, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay Bowl
                        Clay.craftClay(player, 5, craftType, 2, true);
                    }
                    break;

                case 16:
                    if (logType != -1)
                    {
                        MakeBows.cutLog(player, 5, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay Bowl
                        Clay.craftClay(player, 10, craftType, 2, true);
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 1, 8, leatherCraft, true); // Chaps
                        break;
                    }
                    else if (craftType == 6)
                    {// Crossbow string
                        Spinning.craftSpinning(player, 1, 2, true);
                        break;
                    }
                    break;

                case 15:
                    if (logType != -1)
                    {
                        MakeBows.cutLog(player, 10, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay Bowl
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(306, 2));
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 5, 8, leatherCraft, true); // Chaps
                        break;
                    }
                    else if (craftType == 6)
                    {// Crossbow string
                        Spinning.craftSpinning(player, 5, 2, true);
                        break;
                    }
                    break;

                case 14:
                    if (craftType == 1 || craftType == 2)
                    { // Clay pie dish
                        Clay.craftClay(player, 1, craftType, 1, true);
                        break;
                    }
                    else if (logType == 0 && !stringingBow)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 1));
                        break;
                    }
                    else if (logType > 0)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 1));
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 10, 8, leatherCraft, true); // Chaps
                        break;
                    }
                    else if (craftType == 6)
                    {// Crossbow string
                        Spinning.craftSpinning(player, 10, 2, true);
                        break;
                    }
                    break;

                case 9:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 1, logType, 2, false, true);
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 10, logType, 1, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pot
                        Clay.craftClay(player, 5, craftType, 0, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 4));
                        break;
                    }
                    else if (craftType == 6)
                    {// Bowstring
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 1));
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Tiara
                        Silver.newSilverItem(player, 10, 121, true);
                        break;
                    }
                    break;

                case 8:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 5, logType, 2, false, true);
                        break;
                    }
                    else if (logType > 0)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 1));
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pot
                        Clay.craftClay(player, 10, craftType, 0, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 1, 0, leatherCraft, true); // Body
                        break;
                    }
                    else if (craftType == 6)
                    {// Ball of wool
                        Spinning.craftSpinning(player, 1, 0, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Tiara
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(303, 121));
                        break;
                    }
                    else if (dialogueStatus < 1000)
                    {
                        Dialogue.doDialogue(player, dialogueStatus);
                        break;
                    }
                    break;

                case 7:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 10, logType, 2, false, true);
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 1, logType, 0, stringingBow, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay pot
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(306, 0));
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 5, 0, leatherCraft, true); // Body
                        break;
                    }
                    else if (craftType == 6)
                    {// Ball of wool
                        Spinning.craftSpinning(player, 5, 0, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Unholy symbol
                        Silver.newSilverItem(player, 1, 120, true);
                        break;
                    }
                    else if (dialogueStatus > 1000)
                    {
                        Slayer.doDialogue(player, dialogueStatus);
                        break;
                    }
                    else if (dialogueStatus < 1000)
                    {
                        Dialogue.doDialogue(player, dialogueStatus);
                        break;
                    }
                    break;

                case 6:
                    if (logType == 0 && !stringingBow)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 2));
                        break;
                    }
                    else if (stringingBow && bowType != -1)
                    {
                        MakeBows.cutLog(player, 1, logType, bowType, true, true);
                        break;
                    }
                    else if (boltTips > -1)
                    {
                        MakeAmmo.makeBoltTip(player, boltTips, 1, true);
                        break;
                    }
                    else if (xbowType != -1)
                    {
                        MakeXbow.createXbow(player, 1, xbowType, stringingBow, true);
                        break;
                    }
                    else if (grindItem != -1)
                    {
                        Herblore.grindIngredient(player, 1, true);
                        break;
                    }
                    else if (unfinishedPotion != -1)
                    {
                        Herblore.makeUnfinishedPotion(player, 1, true);
                        break;
                    }
                    else if (completePotion != -1)
                    {
                        Herblore.completePotion(player, 1, true);
                        break;
                    }
                    else if (cookItem != -1)
                    {
                        Cooking.cookItem(player, 1, true, player.getTemporaryAttribute("cookingFireLocation") != null);
                        break;
                    }
                    else if (logType > 0)
                    {
                        MakeBows.cutLog(player, 5, logType, 0, false, true);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        Leather.craftDragonHide(player, 10, 0, leatherCraft, true); // Body
                        break;
                    }
                    else if (craftType == 6)
                    {// Ball of wool
                        Spinning.craftSpinning(player, 10, 0, true);
                        break;
                    }
                    else if (craftType >= 50 && craftType <= 60)
                    { // Cut gem
                        Jewellery.cutGem(player, craftType, 1, true);
                        break;
                    }
                    else if (craftType >= 100 && craftType <= 110)
                    { // String amulet
                        Jewellery.stringAmulet(player, craftType, 1, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Unholy symbol
                        Silver.newSilverItem(player, 5, 120, true);
                        break;
                    }
                    else if (dialogueStatus > 1000)
                    {
                        Slayer.doDialogue(player, dialogueStatus);
                        break;
                    }
                    else if (dialogueStatus == 7)
                    {
                        AgilityArena.doDialogue(player, 41);
                        break;
                    }
                    else if (dialogueStatus == 242)
                    {
                        BoatOptions.showBentleyDialogue(player, 246);
                        break;
                    }
                    else if (dialogueStatus == 451 || dialogueStatus == 452 || dialogueStatus == 453)
                    {
                        FarmingAmulet.showOptions(player, 12622);
                        break;
                    }
                    else if (dialogueStatus < 1000)
                    {
                        Dialogue.doDialogue(player, dialogueStatus);
                        break;
                    }
                    break;

                case 5:
                    if (ammoType != -1)
                    {
                        MakeAmmo.createAmmo(player, 1, ammoType, false, true);
                        break;
                    }
                    else if (stringingBow && bowType != -1)
                    {
                        MakeBows.cutLog(player, 5, logType, bowType, true, true);
                        break;
                    }
                    else if (boltType != -1)
                    {
                        MakeAmmo.createAmmo(player, 1, boltType, true, true);
                        break;
                    }
                    else if (xbowType != -1)
                    {
                        MakeXbow.createXbow(player, 5, xbowType, stringingBow, true);
                        break;
                    }
                    else if (grindItem != -1)
                    {
                        Herblore.grindIngredient(player, 5, true);
                        break;
                    }
                    else if (unfinishedPotion != -1)
                    {
                        Herblore.makeUnfinishedPotion(player, 5, true);
                        break;
                    }
                    else if (completePotion != -1)
                    {
                        Herblore.completePotion(player, 5, true);
                        break;
                    }
                    else if (cookItem != -1)
                    {
                        Cooking.cookItem(player, 5, true, player.getTemporaryAttribute("cookingFireLocation") != null);
                        break;
                    }
                    else if (logType != -1)
                    {
                        MakeBows.cutLog(player, 10, logType, 0, false, true);
                        break;
                    }
                    else if (dialogueStatus == 1002)
                    {
                        Slayer.doDialogue(player, 1024);
                        break;
                    }
                    else if (dialogueStatus == 1053)
                    {
                        Slayer.doDialogue(player, 1061);
                        break;
                    }
                    else if (dialogueStatus > 1000)
                    {
                        Slayer.doDialogue(player, dialogueStatus);
                        break;
                    }
                    else if (dialogueStatus == 7)
                    {
                        AgilityArena.doDialogue(player, 34);
                        break;
                    }
                    else if (leatherCraft != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 0));
                        break;
                    }
                    else if (craftType == 6)
                    {// Ball of wool
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(304, 0));
                        break;
                    }
                    else if (craftType >= 50 && craftType <= 60)
                    { // Cut gem
                        Jewellery.cutGem(player, craftType, 5, true);
                        break;
                    }
                    else if (craftType >= 100 && craftType <= 110)
                    { // String amulet
                        Jewellery.stringAmulet(player, craftType, 5, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Unholy symbol
                        Silver.newSilverItem(player, 10, 120, true);
                        break;
                    }
                    else if (dialogueStatus == 46)
                    {
                        AgilityArena.doDialogue(player, 54);
                        break;
                    }
                    else if (dialogueStatus == 242)
                    {
                        BoatOptions.showBentleyDialogue(player, 245);
                        break;
                    }
                    else if (dialogueStatus == 451)
                    {
                        FarmingAmulet.teleportToPatch(player, 3);
                        break;
                    }
                    else if (dialogueStatus == 452)
                    {
                        FarmingAmulet.teleportToPatch(player, 7);
                        break;
                    }
                    else if (dialogueStatus == 453)
                    {
                        FarmingAmulet.teleportToPatch(player, 11);
                        break;
                    }
                    else if (dialogueStatus == 450)
                    {
                        player.getPackets().closeInterfaces();
                        break;
                    }
                    else if (dialogueStatus != -1 && dialogueStatus < 1000)
                    {
                        Dialogue.doDialogue(player, dialogueStatus);
                        break;
                    }
                    else if (boltTips > -1)
                    {
                        MakeAmmo.makeBoltTip(player, boltTips, 5, true);
                        break;
                    }
                    break;

                case 4:
                    if (ammoType != -1)
                    {
                        MakeAmmo.createAmmo(player, 5, ammoType, false, true);
                        break;
                    }
                    else if (boltType != -1)
                    {
                        MakeAmmo.createAmmo(player, 5, boltType, true, true);
                        break;
                    }
                    else if (xbowType != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 0));
                        break;
                    }
                    else if (stringingBow && bowType != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 1));
                        break;
                    }
                    else if (grindItem != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 2));
                        break;
                    }
                    else if (unfinishedPotion != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 3));
                        break;
                    }
                    else if (completePotion != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 4));
                        break;
                    }
                    else if (cookItem != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 5));
                        break;
                    }
                    else if (logType != -1)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 0));
                        break;
                    }
                    else if (craftType >= 50 && craftType <= 60)
                    { // Cut gem
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, craftType));
                        break;
                    }
                    else if (craftType >= 100 && craftType <= 110)
                    { // String amulet
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, craftType));
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Unholy symbol
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(303, 120));
                        break;
                    }
                    else if (dialogueStatus == 1053)
                    {
                        Slayer.doDialogue(player, 1059);
                        break;
                    }
                    else if (dialogueStatus == 1002)
                    {
                        Slayer.doDialogue(player, 1025);
                        break;
                    }
                    else if (dialogueStatus == 7)
                    {
                        AgilityArena.doDialogue(player, 24);
                        break;
                    }
                    else if (dialogueStatus == 46)
                    {
                        AgilityArena.doDialogue(player, 51);
                        break;
                    }
                    else if (dialogueStatus == 109)
                    {
                        BrokenBarrows.showBobDialogue(player, 114);
                        break;
                    }
                    else if (dialogueStatus == 140 || dialogueStatus == 141)
                    {
                        player.getPackets().closeInterfaces();
                        break;
                    }
                    else if (dialogueStatus == 159)
                    {
                        HomeArea.showAliDialogue(player, 177);
                        break;
                    }
                    else if (dialogueStatus == 242)
                    {
                        BoatOptions.showBentleyDialogue(player, 244);
                        break;
                    }
                    else if (boltTips > -1)
                    { // Cut bolt tips
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(309, 6));
                        break;
                    }
                    else if (dialogueStatus == 451)
                    {
                        FarmingAmulet.teleportToPatch(player, 2);
                        break;
                    }
                    else if (dialogueStatus == 452)
                    {
                        FarmingAmulet.teleportToPatch(player, 6);
                        break;
                    }
                    else if (dialogueStatus == 450)
                    {
                        FarmingAmulet.displayFruitTreeOptions(player);
                        break;
                    }
                    else if (dialogueStatus == 453)
                    {
                        FarmingAmulet.teleportToPatch(player, 10);
                        break;
                    }
                    break;

                case 3:
                    if (player.getDuel() != null)
                    {
                        player.getPackets().closeChatboxInterface();
                        break;
                    }
                    else if (ammoType != -1)
                    {
                        MakeAmmo.createAmmo(player, 10, ammoType, false, true);
                        break;
                    }
                    else if (boltType != -1)
                    {
                        MakeAmmo.createAmmo(player, 10, boltType, true, true);
                        break;
                    }
                    else if (stringingBow && bowType != -1)
                    {
                        MakeBows.cutLog(player, player.getInventory().getItemAmount(1777), logType, bowType, true, true);
                        break;
                    }
                    else if (xbowType != -1)
                    {
                        MakeXbow.createXbow(player, player.getInventory().getItemAmount(9438), xbowType, stringingBow, true);
                        break;
                    }
                    else if (grindItem != -1)
                    {
                        Herblore.grindIngredient(player, 28, true);
                        break;
                    }
                    else if (unfinishedPotion != -1)
                    {
                        Herblore.makeUnfinishedPotion(player, 28, true);
                        break;
                    }
                    else if (completePotion != -1)
                    {
                        Herblore.completePotion(player, 28, true);
                        break;
                    }
                    else if (cookItem != -1)
                    {
                        Cooking.cookItem(player, 28, true, player.getTemporaryAttribute("cookingFireLocation") != null);
                        break;
                    }
                    else if (bowType != -1 && logType != -1)
                    {
                        MakeBows.cutLog(player, 10, logType, bowType, false, true);
                        break;
                    }
                    else if (craftType >= 50 && craftType <= 60)
                    { // Cut gem
                        Jewellery.cutGem(player, craftType, 27, true);
                        break;
                    }
                    else if (craftType >= 100 && craftType <= 110)
                    { // String amulet
                        Jewellery.stringAmulet(player, craftType, 27, true);
                        break;
                    }
                    else if (craftType >= 120 && craftType <= 130)
                    { // Unholy symbol
                        Silver.newSilverItem(player, 27, 120, true);
                        break;
                    }
                    else if (dialogueStatus == 1017)
                    {
                        Slayer.doDialogue(player, 1017);
                        break;
                    }
                    else if (dialogueStatus == 1053)
                    {
                        Slayer.doDialogue(player, 1057);
                        break;
                    }
                    else if (dialogueStatus == 1002)
                    {
                        Slayer.doDialogue(player, 1021);
                        break;
                    }
                    else if (dialogueStatus > 1000)
                    {
                        Slayer.doDialogue(player, dialogueStatus);
                        break;
                    }
                    else if (dialogueStatus == 7)
                    {
                        AgilityArena.doDialogue(player, 17);
                        break;
                    }
                    else if (dialogueStatus == 29)
                    {
                        AgilityArena.doDialogue(player, 33);
                        break;
                    }
                    else if (dialogueStatus == 37)
                    {
                        AgilityArena.doDialogue(player, 39);
                        break;
                    }
                    else if (dialogueStatus == 46)
                    {
                        AgilityArena.doDialogue(player, 48);
                        break;
                    }
                    else if (dialogueStatus == 79)
                    {
                        WarriorGuild.talkToKamfreena(player, 80);
                        break;
                    }
                    else if (dialogueStatus == 103)
                    {
                        BrokenBarrows.showBobDialogue(player, 105);
                        break;
                    }
                    else if (dialogueStatus == 109)
                    {
                        BrokenBarrows.showBobDialogue(player, 111);
                        break;
                    }
                    else if (dialogueStatus == 159)
                    {
                        HomeArea.showAliDialogue(player, 162);
                        break;
                    }
                    else if (dialogueStatus == 207)
                    {
                        AlKharid.showAliDialogue(player, 210);
                        break;
                    }
                    else if (dialogueStatus == 242)
                    {
                        BoatOptions.showBentleyDialogue(player, 243);
                        break;
                    }
                    else if (boltTips > -1)
                    {
                        MakeAmmo.makeBoltTip(player, boltTips, player.getInventory().getItemAmount((int)FletchingData.GEMS[boltTips][0]), true);
                        break;
                    }
                    else if (dialogueStatus == 451)
                    {
                        FarmingAmulet.teleportToPatch(player, 1);
                        break;
                    }
                    else if (dialogueStatus == 450)
                    {
                        FarmingAmulet.displayTreeOptions(player);
                        break;
                    }
                    else if (dialogueStatus == 452)
                    {
                        FarmingAmulet.teleportToPatch(player, 5);
                        break;
                    }
                    else if (dialogueStatus == 453)
                    {
                        FarmingAmulet.teleportToPatch(player, 9);
                        break;
                    }
                    break;

                case 21:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 1, logType, 3, false, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay plant pot
                        Clay.craftClay(player, 5, craftType, 3, true);
                        break;
                    }
                    break;

                case 20:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 5, logType, 3, false, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay plant pot
                        Clay.craftClay(player, 10, craftType, 3, true);
                        break;
                    }
                    break;

                case 19:
                    if (logType == 0)
                    {
                        MakeBows.cutLog(player, 10, logType, 3, false, true);
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay plant pot
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(306, 3));
                        break;
                    }
                    break;

                case 18:
                    if (logType == 0)
                    {
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(305, 3));
                        break;
                    }
                    else if (craftType == 1 || craftType == 2)
                    { // Clay Bowl
                        Clay.craftClay(player, 1, craftType, 2, true);
                        break;
                    }
                    break;

                case 22:
                    if (craftType == 1 || craftType == 2)
                    { // Clay plant pot
                        Clay.craftClay(player, 1, craftType, 3, true);
                        break;
                    }
                    break;

                case 26:
                    if (craftType == 1 || craftType == 2)
                    { // Clay lid
                        Clay.craftClay(player, 1, craftType, 4, true);
                        break;
                    }
                    break;

                case 25:
                    if (craftType == 1 || craftType == 2)
                    { // Clay lid
                        Clay.craftClay(player, 5, craftType, 4, true);
                        break;
                    }
                    break;

                case 24:
                    if (craftType == 1 || craftType == 2)
                    { // Clay lid
                        Clay.craftClay(player, 10, craftType, 4, true);
                        break;
                    }
                    break;

                case 23:
                    if (craftType == 1 || craftType == 2)
                    { // Clay lid
                        player.getPackets().displayEnterAmount();
                        player.setTemporaryAttribute("interfaceVariable", new EnterVariable(306, 4));
                        break;
                    }
                    break;

                case 1:
                    switch (id)
                    {
                        case 1:
                            if (dialogueStatus == 1002)
                            {
                                Slayer.doDialogue(player, dialogueStatus);
                                break;
                            }
                            else if (dialogueStatus == 1053)
                            {
                                Slayer.doDialogue(player, dialogueStatus);
                                break;
                            }
                            break;
                    }
                    break;

                default:
                    Console.WriteLine("ACTIONBUTTON3 = " + id);
                    break;
            }
            if (dialogueStatus == -1)
            {
                player.getPackets().closeInterfaces();
            }
        }