Example #1
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 #2
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.");
            }
        }