package com.rs.net.decoders.handlers;

import java.util.List;

import com.rs.Settings;
import com.rs.game.Animation;
import com.rs.game.ForceTalk;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.Hit.HitLook;
import com.rs.game.World;
import com.rs.game.WorldObject;
import com.rs.game.WorldTile;
import com.rs.game.item.Item;
import com.rs.game.npc.familiar.Familiar.SpecialAttack;
import com.rs.game.npc.others.PolyporeCreature;
import com.rs.game.npc.others.Revenant;
import com.rs.game.player.ActionBar.MagicAbilityShortcut;
import com.rs.game.player.Equipment;
import com.rs.game.player.Inventory;
import com.rs.game.player.MoneyPouch;
import com.rs.game.player.Player;
import com.rs.game.player.Skills;
import com.rs.game.player.actions.DungeoneeringClothMaking;
import com.rs.game.player.actions.DungeoneeringLeatherMaking;
import com.rs.game.player.actions.DyingItems;
import com.rs.game.player.actions.Dyingcapes;
import com.rs.game.player.actions.Firemaking;
import com.rs.game.player.actions.Fletching2;
import com.rs.game.player.actions.Fletching2.FletchData;
import com.rs.game.player.actions.GemCutting;
import com.rs.game.player.actions.GlassBlowing;
import com.rs.game.player.actions.OysterCutting;
import com.rs.game.player.actions.PotionMaking;
import com.rs.game.player.actions.HerbCleaning;
import com.rs.game.player.actions.Herblore;
import com.rs.game.player.actions.LeatherMaking;
import com.rs.game.player.actions.Smithing;
import com.rs.game.player.actions.TrapAction;
import com.rs.game.player.actions.divination.DivinePlacing;
import com.rs.game.player.actions.divination.WeaveAction;
import com.rs.game.player.actions.divination.WeaveAction.Weaves;
import com.rs.game.player.content.AccessorySmithing;
import com.rs.game.player.content.AncientEffigies;
import com.rs.game.player.content.Consumables;
import com.rs.game.player.content.Dicing;
import com.rs.game.player.content.DragonfireShield;
import com.rs.game.player.content.Drinkables;
import com.rs.game.player.content.Drinkables.Drink;
import com.rs.game.player.content.DwarfMultiCannon;
import com.rs.game.player.content.FadingScreen;
import com.rs.game.player.content.FlyingEntityHunter;
import com.rs.game.player.content.FlyingEntityHunter.FlyingEntities;
import com.rs.game.player.content.GodswordCreating;
import com.rs.game.player.content.GoldDwarfMultiCannon;
import com.rs.game.player.content.ItemConstants;
import com.rs.game.player.content.ItemSets;
import com.rs.game.player.content.ItemTransportation;
import com.rs.game.player.content.Lamps;
import com.rs.game.player.content.LightSource;
import com.rs.game.player.content.Magic;
import com.rs.game.player.content.Nest;
import com.rs.game.player.content.OrnamentKits;
import com.rs.game.player.content.PrayerBooks;
import com.rs.game.player.content.RoyalDwarfMultiCannon;
import com.rs.game.player.content.Runecrafting;
import com.rs.game.player.content.SkillCapeCustomizer;
import com.rs.game.player.content.SkillsDialogue;
import com.rs.game.player.content.Slayer;
import com.rs.game.player.content.SpiritshieldCreating;
import com.rs.game.player.content.Summoning;
import com.rs.game.player.content.Summoning.Pouch;
import com.rs.game.player.content.TreeSaplings;
import com.rs.game.player.content.WeaponFire;
import com.rs.game.player.content.WeaponLight;
import com.rs.game.player.content.WeaponPoison;
import com.rs.game.player.content.prayer.Burying.Bone;
import com.rs.game.player.controllers.Barrows;
import com.rs.game.player.controllers.FightKiln;
import com.rs.game.player.controllers.SorceressGarden;
import com.rs.game.player.controllers.Wilderness;
import com.rs.game.player.dialogues.impl.AmuletAttaching;
import com.rs.game.player.dialogues.impl.AttachingOrbsDialouge;
import com.rs.game.player.dialogues.impl.CombinationsD.Combinations;
import com.rs.game.player.dialogues.impl.SqirkFruitSqueeze;
import com.rs.game.player.dialogues.impl.SqirkFruitSqueeze.SqirkFruit;
import com.rs.game.tasks.WorldTask;
import com.rs.game.tasks.WorldTasksManager;
import com.rs.io.InputStream;
import com.rs.utils.Logger;
import com.rs.utils.Utils;

public class InventoryOptionsHandler {

	public static void handleItemOption2(final Player player, final int slotId, final int itemId, Item item) {
		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		if (Firemaking.isFiremaking(player, itemId))
			return;
		else if (itemId == 4155)
			player.getSlayerManager().checkKillsLeft();
		else if (itemId == 31846) {
		    	player.getPackets().sendGameMessage("Your current assignment is " +player.getTask().getName() + "; only " +player.getTask().getTaskAmount()+ " left to go");
		}
		else if (itemId == 15262)
			ItemSets.openSkillPack(player, itemId, 12183, 5000, player.getInventory().getAmountOf(itemId));
		else if (itemId == 15362)
			ItemSets.openSkillPack(player, itemId, 230, 50, player.getInventory().getAmountOf(itemId));
		else if (itemId == 15363)
			ItemSets.openSkillPack(player, itemId, 228, 50, player.getInventory().getAmountOf(itemId));
		else if (itemId == 15364)
			ItemSets.openSkillPack(player, itemId, 222, 50, player.getInventory().getAmountOf(itemId));
		else if (itemId == 15365)
			ItemSets.openSkillPack(player, itemId, 9979, 50, player.getInventory().getAmountOf(itemId));
		else if (itemId >= 5509 && itemId <= 5514) {
			int pouch = -1;
			if (itemId == 5509)
				pouch = 0;
			if (itemId == 5510 || itemId == 5511)
				pouch = 1;
			if (itemId == 5512)
				pouch = 2;
			if (itemId == 5514)
				pouch = 3;
			Runecrafting.emptyPouch(player, pouch);
			player.stopAll(false);
		}
		else if (itemId >= 15086 && itemId <= 15100) {
			Dicing.handleRoll(player, itemId, true);
			return;
		}
		else if (itemId == 6583 || itemId == 7927 || itemId == 22560 || itemId == 22562 || itemId == 22564 || itemId == 22566) {
			AccessorySmithing.ringTransformation(player, itemId);
		}
		else if (itemId == 4024 || itemId == 4025 || itemId == 4026 || itemId == 4027 || itemId == 4028 || itemId == 4029 || itemId == 4030 || itemId == 4031) {
			AccessorySmithing.ringTransformation2(player, itemId);
		}
		 else if (itemId == 4079) { //Yoyo Loop
			player.setNextAnimation(new Animation(1458));
		} else if(itemId == 6866) { //Green marionette Walk
			player.setNextAnimation(new Animation(3004));
			player.setNextGraphics(new Graphics(516));
			return;
	    	} else if(itemId == 6865) { //Blue marionette Walk
			player.setNextAnimation(new Animation(3004));
			player.setNextGraphics(new Graphics(512));
			return;
		} else if(itemId == 6867) { //Red marionette Walk
			player.setNextAnimation(new Animation(3004));
			player.setNextGraphics(new Graphics(508));
			return;
		} else if (itemId == 4531) { // Candle Lantern Extinguish
                         player.getInventory().deleteItem(4531, 1);
                         player.getInventory().addItem(4529, 1);
			return;
		} else if (itemId == 10890) { // Prayer Book
			player.setNextAnimation(new Animation(5864));
			return;
		}
		else if (item.getDefinitions().containsInventoryOption(1, "Extinguish")) {
			if (LightSource.extinguishSource(player, slotId, false))
				return;
		}
		else {
			handleWear(player, slotId, item);
		}
	}

	public static void handleWear(final Player player, final int slotId, Item item) {
		if (player.isEquipDisabled())
			return;
		if (player.getSwitchItemCache().isEmpty()) {
			player.getSwitchItemCache().add(slotId);
			WorldTasksManager.schedule(new WorldTask() {

				@Override
				public void run() {
					List<Integer> slots = player.getSwitchItemCache();
					int[] slot = new int[slots.size()];
					for (int i = 0; i < slot.length; i++)
						slot[i] = slots.get(i);
					player.getSwitchItemCache().clear();
					ButtonHandler.processWear(player, slot);
					player.stopAll(false, true, false);
				}
			});
		}
		else if (!player.getSwitchItemCache().contains(slotId)) {
			player.getSwitchItemCache().add(slotId);
		}
	}

	public static void dig(final Player player) {
		player.resetWalkSteps();
		player.setNextAnimation(new Animation(830));
		player.lock();
		WorldTasksManager.schedule(new WorldTask() {

			@Override
			public void run() {
				player.unlock();
				if (player.getTreasureTrailsManager().useDig())
					return;
				if (Barrows.digIntoGrave(player))
					return;
				if (player.getX() == 3005 && player.getY() == 3376 || player.getX() == 2999 && player.getY() == 3375 || player.getX() == 2996 && player.getY() == 3377 || player.getX() == 2989 && player.getY() == 3378 || player.getX() == 2987 && player.getY() == 3387 || player.getX() == 2984 && player.getY() == 3387) {
					// mole
					player.setNextWorldTile(new WorldTile(1752, 5137, 0));
					player.getPackets().sendGameMessage("You seem to have dropped down into a network of mole tunnels.");
					return;
				}
				else if (player.withinDistance(new WorldTile(2748, 3734, 0), 2)) {
					player.lock();
					player.setNextGraphics(new Graphics(80, 5, 60));
					FadingScreen.fade(player, 1000, new Runnable() {

						@Override
						public void run() {
							player.unlock();
							player.setNextWorldTile(new WorldTile(2696, 10121, 0));
						}
					});
					player.getPackets().sendGameMessage("You fall through the ground into a network of tunnels.");
					return;
				}
				player.getPackets().sendGameMessage("You find nothing.");
			}

		});
	}

	public static void handleItemOption1(final Player player, final int slotId, final int itemId, Item item) {
		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		if (Drinkables.drink(player, item, slotId))
			return;
		player.stopAll(false);
		Pouch sumPouch = Pouch.forId(itemId);
		if (sumPouch != null)
			Summoning.spawnFamiliar(player, sumPouch);
		Weaves weave = WeaveAction.Weaves.getEnergy(itemId);
		for(Weaves w : Weaves.values())
		{
		   for(int i = 0; i < w.getEnergy().length; i++)
		   {
		       if(item.getId() == w.getEnergy()[i].getId())
		       {
			   player.getDialogueManager().startDialogue("DivinationD", weave);
		       }
		   }
		}
		if (player.getTreasureTrailsManager().useItem(item, slotId))
			return;
		else if (itemId == 28600 || itemId == 28602 || itemId == 28604) 
			if (player.getInventory().containsItems(new Item[] { new Item(28600), new Item(28602), new Item(28604)})) {  // checks inventory for 3 pieces
			    	player.getInventory().deleteItem(28600, 1);
				player.getInventory().deleteItem(28602, 1);
				player.getInventory().deleteItem(28604, 1);
				player.getInventory().addItem(28606, 1);
				player.getPackets().sendGameMessage("You create a Maul of Omens from your weapon pieces.");
				return;
			}
			else {
				player.getPackets().sendGameMessage("You need all 3 pieces of the "
						+ "Maul to combine it."); //if you don't have 3 pieces
			}
		else if (item.getId() == 32334) {
			if (player.getRights() == 2) {
			    player.setRights(1);
				player.getPackets().sendGameMessage("You have became a <img=0>Moderator");
				return;
			}
			if (player.getRights() == 1) {
			    player.setRights(2);
				player.getPackets().sendGameMessage("You have become an <img=1>Administrator");
				return;
			}
		}
		else if (Consumables.eat(player, slotId, item))
			return;
		else if (AttachingOrbsDialouge.isAttachingOrb(player, item, new Item(AttachingOrbsDialouge.BATTLESTAFF)))
			return;
		else if (itemId == 2574)
			player.getTreasureTrailsManager().useSextant();
		else if (itemId == 1856)
			player.getPackets().sendOpenURL(Settings.HELP_LINK);
		else if (itemId == 17489){
		    player.getInventory().deleteItem(17489, 1);
		    World.addGroundItem(item, new WorldTile(player), player, true, 1500);
		}
		else if (itemId == 18829){
		    player.getInventory().deleteItem(18829, 1);
		    World.addGroundItem(item, new WorldTile(player), player, true, 1500);
		}
		else if (itemId == 1775 || itemId == 23193 || itemId == 32845)
		    player.getDialogueManager().startDialogue("GlassBlowingD", player, GlassBlowing.SmeltingBar.BEER_GLASS);
		else if (itemId == 1741 || itemId == 1743)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.LEATHER_BOOTS);
		else if (itemId == 25545)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.IMPHIDE_GLOVES);
		else if (itemId == 25547)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.SPIDER_SILK_GLOVES);
		else if (itemId == 25551)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.CARAPACE_GLOVES);
		else if (itemId == 25549)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.BATWING_GLOVES);
		else if (itemId == 6289)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.SNAKESKIN_BOOTS);
		else if (itemId == 10820)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.YAK_HIDE_LEGS);
		else if (itemId == 1745)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.GREEN_DRAGONHIDE_VAMBRACES);
		else if (itemId == 2505)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.BLUE_DRAGONHIDE_VAMBRACES);
		else if (itemId == 2507)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.RED_DRAGONHIDE_VAMBRACES);
		else if (itemId == 2509)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.BLACK_DRAGONHIDE_VAMBRACES);
		else if (itemId == 24374)
		    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.ROYAL_DRAGONHIDE_VAMBRACES);
		else if (itemId == 17468)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.SALVE_GLOVES);
		else if (itemId == 17470)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.WILDERCRESS_GLOVES);
		else if (itemId == 17472)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.BLIGHTLEAF_GLOVES);
		else if (itemId == 17474)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.ROSEBLOOD_GLOVES);
		else if (itemId == 17476)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.BRYLL_GLOVES);
		else if (itemId == 17478)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.DUSKWEED_GLOVES);
		else if (itemId == 17480)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.SOULBELL_GLOVES);
		else if (itemId == 17482)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.ECTOCLOTH_GLOVES);
		else if (itemId == 17484)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.RUNIC_GLOVES);
		else if (itemId == 17486)
		    player.getDialogueManager().startDialogue("DungeoneeringClothMakingD", player, DungeoneeringClothMaking.SmeltingBar.SPIRITBLOOM_GLOVES);
		else if (itemId == 17424)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.PROTOLEATHER_VAMBRACES);
		else if (itemId == 17426)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.SUBLEATHER_VAMBRACES);
		else if (itemId == 17428)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.PARALEATHER_VAMBRACES);
		else if (itemId == 17430)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.ARCHLEATHER_VAMBRACES);
		else if (itemId == 17432)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.DROMOLEATHER_VAMBRACES);
		else if (itemId == 17434)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.SPINOLEATHER_VAMBRACES);
		else if (itemId == 17436)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.GALLILEATHER_VAMBRACES);
		else if (itemId == 17438)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.STEGOLEATHER_VAMBRACES);
		else if (itemId == 17440)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.MEGALEATHER_VAMBRACES);
		else if (itemId == 17442)
		    player.getDialogueManager().startDialogue("DungeoneeringLeatherMakingD", player, DungeoneeringLeatherMaking.SmeltingBar.TYRANNOLEATHER_VAMBRACES);
		else if(itemId == 27616 || itemId == 27617)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getCrawlingHandKills() + "</col> Crawling Hands.");
		else if(itemId == 27618 || itemId == 27619)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getCockatriceKills() + "</col> Cockatrices.");
		else if(itemId == 27620 || itemId == 27621)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getBasiliskKills() + "</col> Basilisks.");
		else if(itemId == 27622 || itemId == 27623)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getKuraskKills() + "</col> Kurasks.");
		else if(itemId == 27624 || itemId == 27625)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getAbyssalDemonKills() + "</col> Abyssal Demons.");
		else if(itemId == 28686 || itemId == 28687)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getBansheeKills() + "</col> Banshees.");
		else if(itemId == 28688 || itemId == 28689)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getGelatinKills() + "</col> Jelly's.");
		else if(itemId == 28690 || itemId == 28691)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getDustDevilKills() + "</col> Dust Devils.");
		else if(itemId == 28692 || itemId == 28693)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getGargoyleKills() + "</col> Gargoyles.");
		else if(itemId == 28694 || itemId == 28695)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getJadinkoKills() + "</col> Jadinkos.");
		else if(itemId == 31089 || itemId == 31090)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getBloodveldKills() + "</col> Bloodvelds.");
		else if(itemId == 31091 || itemId == 31092)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getAberrantSpectreKills() + "</col> Aberrant Spectres.");
		else if(itemId == 31093 || itemId == 31094)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getJungleWyrmKills() + "</col> Jungle Strykewyrms.");
		else if(itemId == 31095 || itemId == 31096)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getDesertWyrmKills() + "</col> Desert Strykewyrms.");
		else if(itemId == 31097 || itemId == 31098)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getIceWyrmKills() + "</col> Ice Strykewyrms.");
		else if(itemId == 31099 || itemId == 31100)
		    player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getDarkBeastKills() + "</col> Dark Beasts.");
		else if (item.getId() == 20667)
			Magic.useVecnaSkull(player);
		else if (item.getId() == 25205) {
			if (Settings.WORLD_ID == 3) {
				player.getPackets().sendGameMessage("You can't set a deposit box in this world.");
				return;
			}
			if (!World.isTileFree(player.getPlane(), player.getX(), player.getY() - 1, 3)) {
				player.getPackets().sendGameMessage("You need clear space outside in order to place a deposit box.");
				return;
			}
			if (player.getControlerManager().getControler() != null && !(player.getControlerManager().getControler() instanceof Wilderness)) {
				player.getPackets().sendGameMessage("You can't set a deposit box here.");
				return;
			}
			player.getInventory().deleteItem(slotId, item);
			player.setNextAnimation(new Animation(832));
			player.lock(1);
			World.spawnObjectTemporary(new WorldObject(73268, 10, 0, player.getX() + 1, player.getY(), player.getPlane()), 3600 * 1000);
		}
		else if (itemId >= 5509 && itemId <= 5514) {
			int pouch = -1;
			if (itemId == 5509)
				pouch = 0;
			if (itemId == 5510)
				pouch = 1;
			if (itemId == 5512)
				pouch = 2;
			if (itemId == 5514)
				pouch = 3;
			Runecrafting.fillPouch(player, pouch);
			return;
		}
		//else if (itemId == 27617 || itemId == 27618 || itemId == 27619 || itemId == 27620 || itemId == 27621 || itemId == 27622 || itemId == 27623 || itemId == 27624 || itemId == 27625){
		//    player.getPackets().sendGameMessage("This Option Is Being Worked On");
		//}
		if (itemId == 4079){ //Yoyo Play
			player.setNextAnimation(new Animation(1457));
			return;
		}
		if(itemId == 6866) { //Green marionette Jump
			player.setNextAnimation(new Animation(3003));
			player.setNextGraphics(new Graphics(515));
			return;
		}
	    	if(itemId == 6865) { //Blue marionette Jump
			player.setNextAnimation(new Animation(3003));
			player.setNextGraphics(new Graphics(511));
			return;
	    	}
		if(itemId == 6867) { //Red marionette Jump
			player.setNextAnimation(new Animation(3003));
			player.setNextGraphics(new Graphics(507));
			return;
		}
		if (itemId == 11026) {
                if (player.getInventory().containsItem(11026, 1)) {
                        player.getInventory().deleteItem(11026, 1);
                        player.heal(2);
				player.getPackets().sendGameMessage("Mmmm! Chocolaty!");
			return;
                }
             }
		if (itemId == 6722) {
			player.setNextAnimation(new Animation(2840));
			return;
		}
		if (itemId == 10890){ // Prayer Book
			player.setNextAnimation(new Animation(5864));
			return;
		}
		if (itemId == 407) {
			player.getInventory().deleteItem(407, 1);
			OysterCutting.searchOysterBag(player);
			return;
		}
		if (itemId == 20091) { // Giant Boulder
			player.setNextAnimation(new Animation(15182));
			return;
		}
		if (itemId == 36) { // White candle Light
                	if (player.getInventory().containsItem(590, 1) || player.getToolbelt().containsItem(590)) {
                        player.getInventory().deleteItem(36, 1);
                        player.getInventory().addItem(33, 1);
			return;
			}
		}
		if (itemId == 38) { // Black candle Light
          		if (player.getInventory().containsItem(590, 1) || player.getToolbelt().containsItem(590)) {
                        player.getInventory().deleteItem(38, 1);
                        player.getInventory().addItem(32, 1);
			return;
				}
			}
		if (itemId == 33) { // White candle Extinguish
                        player.getInventory().deleteItem(33, 1);
                        player.getInventory().addItem(36, 1);
			return;
		}
		if (itemId == 32) { // Black candle Extinguish
                        player.getInventory().deleteItem(32, 1);
                        player.getInventory().addItem(38, 1);
			return;
		}
		if (itemId == 4529) { // Candle Lantern Light
            	if (player.getInventory().containsItem(590, 1) || player.getToolbelt().containsItem(590)) {
                        player.getInventory().deleteItem(4529, 1);
                        player.getInventory().addItem(4531, 1);
			return;
			}
		}
		if (itemId == 11204) { // Shrink me Quick
                if (player.getInventory().containsItem(11204, 1)) {
                        player.getInventory().deleteItem(11204, 1);
                        player.getInventory().addItem(229, 1);
		player.setNextAnimation(new Animation(6525));
			return;
			}
		}
		if (itemId == 4251) { // Ectophial
                if (player.getInventory().containsItem(4251, 1)) {
                        player.getInventory().deleteItem(4251, 1);
                        player.getInventory().addItem(4252, 1);
		player.setNextAnimation(new Animation(9609));
		player.setNextGraphics(new Graphics(1688));
			return;
			}
		}
		if (itemId == 9469) { // Grand seed pod
                if (player.getInventory().containsItem(9469, 1)) {
                        player.getInventory().deleteItem(9469, 1);
		player.setNextAnimation(new Animation(4547));
		player.setNextGraphics(new Graphics(768));
			return;
			}
		}
		if (itemId == 11949) { // Snow Globe
		player.setNextAnimation(new Animation(7528));
		player.setNextGraphics(new Graphics(1284));
			return;
		}
		if (itemId == 19832) { // bone brooch
		player.setNextAnimation(new Animation(14870));
		player.setNextGraphics(new Graphics(2838));
			return;
		}
		if (itemId == 16) { // Magic Whistle
		player.setNextAnimation(new Animation(5863));
			return;
		}
		if (itemId == 10896) { // Wolf Whistle
		player.setNextAnimation(new Animation(5863));
			return;
		}
		if (itemId == 13598) { //RC Guild Teleport
                if (player.getInventory().containsItem(13598, 1)) {
                        player.getInventory().deleteItem(13598, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13599) { //Air Altar Teleport
                if (player.getInventory().containsItem(13599, 1)) {
                        player.getInventory().deleteItem(13599, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13600) { //Mind Altar Teleport
                if (player.getInventory().containsItem(13600, 1)) {
                        player.getInventory().deleteItem(13600, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13601) { //Water Altar Teleport
                if (player.getInventory().containsItem(13601, 1)) {
                        player.getInventory().deleteItem(13601, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13602) { //Earth Altar Teleport
                if (player.getInventory().containsItem(13602, 1)) {
                        player.getInventory().deleteItem(13602, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13603) { //Fire Altar Teleport
                if (player.getInventory().containsItem(13603, 1)) {
                        player.getInventory().deleteItem(13603, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13604) { //Body Altar Teleport
                if (player.getInventory().containsItem(13604, 1)) {
                        player.getInventory().deleteItem(13604, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13605) { //Cosmic Altar Teleport
                if (player.getInventory().containsItem(13605, 1)) {
                        player.getInventory().deleteItem(13605, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13606) { //Chaos Altar Teleport
                if (player.getInventory().containsItem(13606, 1)) {
                        player.getInventory().deleteItem(13606, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13607) { //Nature Altar Teleport
                if (player.getInventory().containsItem(13607, 1)) {
                        player.getInventory().deleteItem(13607, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13608) { //Law Altar Teleport
                if (player.getInventory().containsItem(13608, 1)) {
                        player.getInventory().deleteItem(13608, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13609) { //Death Altar Teleport
                if (player.getInventory().containsItem(13609, 1)) {
                        player.getInventory().deleteItem(13609, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13610) { //Blood Altar Teleport
                if (player.getInventory().containsItem(13610, 1)) {
                        player.getInventory().deleteItem(13610, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 13611) { //Astral Altar Teleport
                if (player.getInventory().containsItem(13611, 1)) {
                        player.getInventory().deleteItem(13611, 1);
			Magic.sendTabletTeleportSpell(player, 0, 0, new WorldTile(2334, 4241, 0));
			return;
			}
		}
		if (itemId == 19475) { //Nardah Teleport
                if (player.getInventory().containsItem(19475, 1)) {
                        player.getInventory().deleteItem(19475, 1);
			Magic.sendScrollTeleportSpell(player, 0, 0, new WorldTile(3434, 2891, 0));
			return;
			}
		}
		if (itemId == 14692) { // bandos throne room sphere
                if (player.getInventory().containsItem(14692, 1)) {
                        player.getInventory().deleteItem(14692, 1);
			Magic.sendOrbTeleportSpell(player, 0, 0.0D, new WorldTile(2334, 4241, 0), new int[0]);
			return;
			}
		}
		if (itemId == 10972) { // Dorgesh-kaan sphere
                if (player.getInventory().containsItem(10972, 1)) {
                        player.getInventory().deleteItem(10972, 1);
			Magic.sendOrbTeleportSpell(player, 0, 0.0D, new WorldTile(2703, 5349, 0), new int[0]);
			return;
			}
		}
		if (itemId == 11794) { // Plain of mud sphere
                if (player.getInventory().containsItem(11794, 1)) {
                        player.getInventory().deleteItem(11794, 1);
			Magic.sendOrbTeleportSpell(player, 0, 0.0D, new WorldTile(2617, 9798, 0), new int[0]);
			return;
			}
		}
		if (itemId == 11060) { // Keldagrim sphere
                if (player.getInventory().containsItem(11060, 1)) {
                        player.getInventory().deleteItem(11060, 1);
			Magic.sendOrbTeleportSpell(player, 0, 0.0D, new WorldTile(2846, 10210, 0), new int[0]);
			return;
			}
		}
		else if (itemId == 29294) {
			DivinePlacing.placeDivine(player, itemId, 87285, 34107, 1, 14);	
			//DivinePlacing.fucker = player;
			player.getPackets().sendGameMessage("You spawn a divine bronze rock.");
		}
		else if (itemId == 29295) {
			player.getPackets().sendGameMessage("You spawn a divine iron rock.");
			DivinePlacing.placeDivine(player, itemId, 87286, 57572, 15, 14);	
		}
		else if (itemId == 29296) {
			DivinePlacing.placeDivine(player, itemId, 87287, 87266, 30, 14);
			player.getPackets().sendGameMessage("You spawn a divine coal rock.");
		}
		else if (itemId == 29297 ) {
			DivinePlacing.placeDivine(player, itemId, 87288, 87267, 55, 14);
			player.getPackets().sendGameMessage("You spawn a divine mithril rock.");	
		}
		else if (itemId == 29298) {
			DivinePlacing.placeDivine(player, itemId, 87289, 87268, 70, 14);
			player.getPackets().sendGameMessage("You spawn a divine adamantite rock.");	
		}
		else if (itemId == 29299) {
			DivinePlacing.placeDivine(player, itemId, 87290, 87269, 85, 14);
			player.getPackets().sendGameMessage("You spawn a divine runite rock.");
		}
		// divine trees
		else if (itemId == 29304) {
			DivinePlacing.placeDivine(player, itemId, 87295, 87274, 1, 8);
			player.getPackets().sendGameMessage("You spawn a divine tree.");
		}
		else if (itemId == 29305) {
			DivinePlacing.placeDivine(player, itemId, 87296, 87275, 15, 8);
			player.getPackets().sendGameMessage("You spawn a divine oak tree.");
		}
		else if (itemId == 29306) {
			DivinePlacing.placeDivine(player, itemId, 87297, 87276, 30, 8);
			player.getPackets().sendGameMessage("You spawn a divine willow tree.");
		}
		else if (itemId == 29307) {
			DivinePlacing.placeDivine(player, itemId, 87298, 87277, 45, 8);
			player.getPackets().sendGameMessage("You spawn a divine maple tree.");
		}
		else if (itemId == 29308) {
			DivinePlacing.placeDivine(player, itemId, 87299, 87278, 60, 8);
			player.getPackets().sendGameMessage("You spawn a divine yew tree.");
		}
		else if (itemId == 29309) {
			DivinePlacing.placeDivine(player, itemId, 87300, 87279, 75, 8);
			player.getPackets().sendGameMessage("You spawn a divine magic tree.");
		}
		// herbolore
		else if (itemId == 29310) {
			DivinePlacing.placeDivine(player, itemId, 87301, 87280, 9, 15);
			player.getPackets().sendGameMessage("You spawn a divine herb patch I.");
		}
		else if (itemId == 29311) {
			DivinePlacing.placeDivine(player, itemId, 87302, 87281, 44, 15);
			player.getPackets().sendGameMessage("You spawn a divine herb patch II.");
		}
		else if (itemId == 29312) {
			DivinePlacing.placeDivine(player, itemId, 87303, 87282, 67, 15);
			player.getPackets().sendGameMessage("You spawn a divine herb patch III.");
		}
		//hunting
		else if (itemId == 29300) {
			DivinePlacing.placeDivine(player, itemId, 87291, 87270, 1, 21);
			player.getPackets().sendGameMessage("You spawn a divine kebbit burrow.");
		}
		else if (itemId == 29301) {
			DivinePlacing.placeDivine(player, itemId, 87292, 87271, 1, 21);
			player.getPackets().sendGameMessage("You spawn a divine bird snare.");
		}
		else if (itemId == 29302) {
			DivinePlacing.placeDivine(player, itemId, 87293, 87272, 23, 21);
			player.getPackets().sendGameMessage("You spawn a divine deadfall trap.");
		}
		else if (itemId == 29303) {
			DivinePlacing.placeDivine(player, itemId, 87294, 87273, 53, 21);
			player.getPackets().sendGameMessage("You spawn a divine box trap.");
		}
		// fishing 
		else if (itemId == 31080) {
			DivinePlacing.placeDivine(player, itemId, 90232, 90223, 10, 10);
			player.getPackets().sendGameMessage("You spawn a divine crayfish bubble.");
		}
		else if (itemId == 31081) {
			DivinePlacing.placeDivine(player, itemId, 90233, 90224, 10, 10);
			player.getPackets().sendGameMessage("You spawn a divine herring bubble.");
		}
		else if (itemId == 31082) {
			DivinePlacing.placeDivine(player, itemId, 90234, 90225, 20, 10);
			player.getPackets().sendGameMessage("You spawn a divine trout bubble.");
		}
		else if (itemId == 31083) {
			DivinePlacing.placeDivine(player, itemId, 90235, 90226, 30, 10);
			player.getPackets().sendGameMessage("You spawn a divine salmon bubble.");
		}
		else if (itemId == 31084) {
			DivinePlacing.placeDivine(player, itemId, 90236, 90227, 40, 10);
			player.getPackets().sendGameMessage("You spawn a divine lobster bubble.");
		}
		else if (itemId == 31085) {
			DivinePlacing.placeDivine(player, itemId, 90237, 90228, 50, 10);
			player.getPackets().sendGameMessage("You spawn a divine swordfish bubble.");
		}
		else if (itemId == 31086) {
			DivinePlacing.placeDivine(player, itemId, 90238, 90229, 76, 10);
			player.getPackets().sendGameMessage("You spawn a divine shark bubble.");
		}
		else if (itemId == 31087) {
			DivinePlacing.placeDivine(player, itemId, 90239, 90230, 85, 10);
			player.getPackets().sendGameMessage("You spawn a divine cavefish bubble.");
		}
		else if (itemId == 31088) {
			DivinePlacing.placeDivine(player, itemId, 90240, 90231, 90, 10);
			player.getPackets().sendGameMessage("You spawn a divine rocktail bubble.");
		}
		else if (itemId == 3211) {
			if (player.getSkills().getLevel(Skills.CRAFTING) < 12) {
				player.getPackets().sendGameMessage("You need a Crafting level of at least 12 in order to make a Limestone Brick.");
				return;
			}
			player.getSkills().addXp(Skills.CRAFTING, 9);
		    player.getInventory().deleteItem(3211, 1);
		    player.getInventory().addItem(3420, 1);
		    player.getPackets().sendGameMessage("Your crafting expertise lets you form a Limestone Brick.");
		}
		//div not being used
		else if (itemId == 31310) {
			DivinePlacing.placeDivine(player, itemId, 66526, 66528, 65, 1);
			player.getPackets().sendGameMessage("You spawn a divine simulacrum I.");
		}
		else if (itemId == 31311) {
			DivinePlacing.placeDivine(player, itemId, 66529, 66531, 65, 1);
			player.getPackets().sendGameMessage("You spawn a divine simulacrum II.");
		}
		else if (itemId == 31041) {
			player.getPackets().sendGameMessage("You place a portable forge infront of you.");
			WorldTasksManager.schedule(new WorldTask() {
			    int ticks;
			    @Override
			    public void run() {
				ticks++;
			if(ticks == 1){
				player.getInventory().deleteItem(31041, 1);
				final WorldObject divinerune = new WorldObject(89767,10, 0, player.getX() + 1, player.getY(), player.getPlane()); // object spawning
				player.faceObject(divinerune); // forces player to face where he is putting the object
				World.spawnTemporaryObject(divinerune, 60000); // dont touch
				stop();
			}
			    return;
			    }  
		}, 0, 0);
		}
		else if (itemId == 31042) {
			player.getPackets().sendGameMessage("You place a portable range infront of you.");
			WorldTasksManager.schedule(new WorldTask() {
			    int ticks;
			    @Override
			    public void run() {
				ticks++;
			if(ticks == 1){
				player.getInventory().deleteItem(31042, 1);
				final WorldObject divinerune = new WorldObject(89768,10, 0, player.getX() + 1, player.getY(), player.getPlane()); // object spawning
				player.faceObject(divinerune); // forces player to face where he is putting the object
				World.spawnTemporaryObject(divinerune, 60000); // dont touch
				stop();
			}
			    return;
			    }  
		}, 0, 0);
		}
		else if (itemId == 952) {// spade
			dig(player);
			return;
		}
		else if (itemId == 10952) {
			if (Slayer.isUsingBell(player))
				return;
		}
		else if (HerbCleaning.clean(player, item, slotId))
			return;
		else if (TrapAction.isTrap(player, new WorldTile(player), itemId))
			return;
		else if (Bone.forId(itemId) != null) {
			Bone.bury(player, slotId);
			return;
		}
		else if (Magic.useTabTeleport(player, itemId))
			return;
		else if (item.getId() == 7509 || item.getId() == 7510) {
			player.setNextForceTalk(new ForceTalk("Ow! It nearly broke my tooth!"));
			player.getPackets().sendGameMessage("The rock cake resists all attempts to eat it.");
			player.applyHit(new Hit(player, player.getHitpoints() - 10 < 35 ? player.getHitpoints() - 35 < 0 ? 0 : player.getHitpoints() - 35 : 10, HitLook.REGULAR_DAMAGE));

		}
		else if (ItemTransportation.transportationDialogue(player, item, true))
			return;
		else if (Lamps.isSelectable(itemId) || Lamps.isSkillLamp(itemId) || Lamps.isOtherLamp(itemId))
			Lamps.processLampClick(player, slotId, itemId);
		else if (LightSource.lightSource(player, slotId))
			return;
		else if (LightSource.extinguishSource(player, slotId, false))
			return;
		if (player.getPetManager().spawnPet(itemId, true))
			return;
		else if (itemId == 299) {
			if (player.withinDistance(Settings.START_PLAYER_LOCATION, 120)) {
				player.getPackets().sendGameMessage("Planting flowers in this area has been disabled.");
				return;
			}
			else if (player.isCanPvp()) {
				player.getPackets().sendGameMessage("You cant plant a seed while doing this action.");
				return;
			}
			else if (World.getStandartObject(player) != null) {
				player.getPackets().sendGameMessage("You can't plant a flower here.");
				return;
			}
			player.setNextAnimation(new Animation(827));
			final WorldObject object = new WorldObject(2980 + Utils.random(8), 10, 0, player.getX(), player.getY(), player.getPlane());
			World.spawnObjectTemporary(object, 25000);
			player.getInventory().deleteItem(299, 1);
			WorldTasksManager.schedule(new WorldTask() {

				@Override
				public void run() {
					if (!player.addWalkSteps(player.getX() - 1, player.getY(), 1))
						if (!player.addWalkSteps(player.getX() + 1, player.getY(), 1))
							if (!player.addWalkSteps(player.getX(), player.getY() + 1, 1))
								if (!player.addWalkSteps(player.getX(), player.getY() - 1, 1))
									return;
					player.getDialogueManager().startDialogue("FlowerPickD", object);
				}
			}, 2);
		}
		else if (itemId == 4251)
			Magic.useEctoPhial(player, item);
		else if (itemId == 15262)
			ItemSets.openSkillPack(player, itemId, 12183, 5000, 1);
		else if (itemId == 15362)
			ItemSets.openSkillPack(player, itemId, 230, 50, 1);
		else if (itemId == 15363)
			ItemSets.openSkillPack(player, itemId, 228, 50, 1);
		else if (itemId == 15364)
			ItemSets.openSkillPack(player, itemId, 222, 50, 1);
		else if (itemId == 15365)
			ItemSets.openSkillPack(player, itemId, 9979, 50, 1);
		else if (Herblore.isRawIngredient(player, itemId))
			return;
		else if (itemId == 2798 || itemId == 3565 || itemId == 3576 || itemId == 19042)
			player.getTreasureTrailsManager().openPuzzle(itemId);
		else if (itemId == 22445)
			player.getDialogueManager().startDialogue("NeemDrupeSqueeze");
		//else if (itemId == 1775 || itemId == 23193)
		//	player.getDialogueManager().startDialogue("NewGlassBlowing", itemId == 23193 ? 1 : 0);
		else if (itemId == 22444)
			PolyporeCreature.sprinkleOil(player, null);
		else if (itemId == 550)
			player.getInterfaceManager().sendCentralInterface(270);
		//else if (itemId == 24154 || itemId == 24155)
			//player.getSquealOfFortune().processItemClick(slotId, itemId, item);
		else if (itemId == AncientEffigies.SATED_ANCIENT_EFFIGY || itemId == AncientEffigies.GORGED_ANCIENT_EFFIGY || itemId == AncientEffigies.NOURISHED_ANCIENT_EFFIGY || itemId == AncientEffigies.STARVED_ANCIENT_EFFIGY)
			player.getDialogueManager().startDialogue("AncientEffigiesD", itemId);
		else if (itemId == 4155)
			player.getDialogueManager().startDialogue("EnchantedGemDialouge", player.getSlayerManager().getCurrentMaster().getNPCId());
		else if (itemId == 31846) {
		    	player.getPackets().sendGameMessage("Your current assignment is " +player.getTask().getName() + "; only " +player.getTask().getTaskAmount()+ " left to go");
		}
		else if (itemId >= 23653 && itemId <= 23658)
			FightKiln.useCrystal(player, itemId);
		else if (itemId == 20124 || itemId == 20123 || itemId == 20122 || itemId == 20121)
			GodswordCreating.attachKeys(player);
		//else if (itemId == 6)
		//	DwarfMultiCannon.setUp(player);
		
		else if (itemId == 6)
		    if (player.getInventory().containsItem(20494, 1) 
			    || player.getInventory().containsItem(20495, 1) 
			    || player.getInventory().containsItem(20496, 1)
			    || player.getInventory().containsItem(20497, 1)
			    || player.getInventory().containsItem(20498, 1) 
			    || player.getInventory().containsItem(20499, 1) 
			    || player.getInventory().containsItem(20500, 1)
			    || player.getInventory().containsItem(20501, 1)) {
			player.getPackets().sendGameMessage("May only have one cannon at a time.");
		    }else{
			DwarfMultiCannon.setUp(player);
			return;
		}
		
		else if (itemId == 20494)
		    if (player.getInventory().containsItem(6, 1) 
			    || player.getInventory().containsItem(8, 1) 
			    || player.getInventory().containsItem(10, 1)
			    || player.getInventory().containsItem(12, 1)
			    || player.getInventory().containsItem(20498, 1) 
			    || player.getInventory().containsItem(20499, 1) 
			    || player.getInventory().containsItem(20500, 1)
			    || player.getInventory().containsItem(20501, 1)) {
			player.getPackets().sendGameMessage("May only have one cannon at a time.");
		    }else{
			GoldDwarfMultiCannon.setUp(player);
			return;
		}
		
		else if (itemId == 20498)
		    if (player.getInventory().containsItem(6, 1) || player.getInventory().containsItem(8, 1) || player.getInventory().containsItem(10, 1) || player.getInventory().containsItem(12, 1) || player.getInventory().containsItem(20494, 1) || player.getInventory().containsItem(20495, 1) || player.getInventory().containsItem(20496, 1) || player.getInventory().containsItem(20497, 1)) {
			player.getPackets().sendGameMessage("May only have one cannon at a time.");//Regular Cannon
		    }else{
			RoyalDwarfMultiCannon.setUp(player);
			return;
		}
		
		else if (itemId == 15707)
			player.getDungManager().openPartyInterface();
		else if (Nest.isNest(itemId))
			Nest.searchNest(player, slotId);
		else if (itemId == 14057) // broomstick
			player.setNextAnimation(new Animation(10532));
		else if (itemId == 21776) {
			if (player.getSkills().getLevel(Skills.CRAFTING) < 77) {
				player.getPackets().sendGameMessage("You need a Crafting level of at least 77 in order to combine the shards.");
				return;
			}
			else if (player.getInventory().containsItem(itemId, 100)) {
				player.setNextAnimation(new Animation(713));
				player.setNextGraphics(new Graphics(1383));
				player.getInventory().deleteItem(new Item(itemId, 100));
				player.getInventory().addItem(new Item(21775, 1));
				player.getSkills().addXp(Skills.CRAFTING, 150);
				player.getPackets().sendGameMessage("You combine the shards into an orb.");
			}
			else {
				player.getPackets().sendGameMessage("You need at least 100 shards in order to create an orb of armadyl.");
			}
		}
		else if (itemId == 5974) {
			if (!player.getInventory().containsItemToolBelt(Smithing.HAMMER)) {
				player.getDialogueManager().startDialogue("SimpleMessage", "You need a hammer in order to break open a coconut.");
				return;
			}
			player.getInventory().addItem(new Item(5976, 1));
			player.getInventory().deleteItem(new Item(5974, 1));
			player.getPackets().sendGameMessage("You smash the coconut with a hammer and it breaks into two symmetrical pieces.");
		}else if (itemId == 24352) 
			player.getDialogueManager().startDialogue("DragonBoneUpgradeKiteInfoD");
		else if (itemId == SqirkFruitSqueeze.SqirkFruit.AUTUMM.getFruitId())
			player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.AUTUMM);
		else if (itemId == SqirkFruitSqueeze.SqirkFruit.SPRING.getFruitId())
			player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.SPRING);
		else if (itemId == SqirkFruitSqueeze.SqirkFruit.SUMMER.getFruitId())
			player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.SUMMER);
		else if (itemId == SqirkFruitSqueeze.SqirkFruit.WINTER.getFruitId())
			player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.WINTER);
		else if (item.getDefinitions().getName().startsWith("Burnt"))
			player.getDialogueManager().startDialogue("SimplePlayerMessage", "Ugh, this is inedible.");
		else if ((item.getDefinitions().containsInventoryOption(0, "Craft") || item.getDefinitions().containsInventoryOption(0, "Fletch") || item.getDefinitions().containsInventoryOption(0, "String")) && SkillsDialogue.selectTool(player, item.getId())) {
			return;
		}
		else
			//player.getPackets().sendGameMessage("Nothing interesting happens.");
		if (Settings.DEBUG)
			Logger.log("ItemHandler", "Item option 1:" + itemId + ", Slot Id:" + slotId);
	}

	/*
	 * returns the other
	 */
	public static Item contains(int id1, Item item1, Item item2) {
		if (item1.getId() == id1)
			return item2;
		if (item2.getId() == id1)
			return item1;
		return null;
	}

	public static boolean contains(int id1, int id2, Item... items) {
		boolean containsId1 = false;
		boolean containsId2 = false;
		for (Item item : items) {
			if (item.getId() == id1)
				containsId1 = true;
			else if (item.getId() == id2)
				containsId2 = true;
		}
		return containsId1 && containsId2;
	}

	public static void handleInterfaceOnInterface(final Player player, InputStream stream) {
		
		int usedWithId = stream.readUnsignedShortLE();
		int interface1 = stream.readInt();
		int fromSlot = stream.readUnsignedShort128();
		int itemUsedId = stream.readUnsignedShortLE();
		int toSlot = stream.readUnsignedShortLE();
		int interface2 = stream.readInt();

		int interfaceId = interface1 >> 16;
		int interfaceComponent = interface1 - (interfaceId << 16);
		int interfaceId2 = interface2 >> 16;
		@SuppressWarnings("unused")
		int interface2Component = interface2 - (interfaceId2 << 16);

		if (Settings.DEBUG)
			Logger.log("ItemHandler", "ItemOnItem " + usedWithId + ", " + toSlot + ", " + interfaceId + ", " + interfaceComponent + ", " + fromSlot + ", " + itemUsedId);

		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		player.stopAll();
		if (interfaceId == 1430 && interfaceComponent >= 55 && interfaceComponent <= 229 && (interfaceId2 == Inventory.INVENTORY_INTERFACE || interfaceId2 == Inventory.INVENTORY_INTERFACE_2) && !player.getInterfaceManager().containsInventoryInter()) {
			Item item = player.getInventory().getItem(toSlot);
			if (item == null || item.getId() != usedWithId)
				return;
			player.getActionbar().pushShortcutOnSomething((interfaceComponent - 55) / 13, item);
			return;
		}
		if ((interfaceId == 747 || interfaceId == 662) && (interfaceId2 == Inventory.INVENTORY_INTERFACE || interfaceId2 == Inventory.INVENTORY_INTERFACE_2)) {
			if (player.getFamiliar() != null) {
				player.getFamiliar().setSpecial(true);
				if (player.getFamiliar().getSpecialAttack() == SpecialAttack.ITEM) {
					if (player.getFamiliar().hasSpecialOn())
						player.getFamiliar().submitSpecial(toSlot);
				}
			}
			return;
		}
		if ((interfaceId == Inventory.INVENTORY_INTERFACE || interfaceId == Inventory.INVENTORY_INTERFACE_2) && interfaceId == interfaceId2 && !player.getInterfaceManager().containsInventoryInter()) {
			if (toSlot >= 28 || fromSlot >= 28 || toSlot == fromSlot)
				return;
			Item usedWith = player.getInventory().getItem(toSlot);
			Item itemUsed = player.getInventory().getItem(fromSlot);
			if (itemUsed == null || usedWith == null || itemUsed.getId() != itemUsedId || usedWith.getId() != usedWithId)
				return;
			if (!player.getControlerManager().canUseItemOnItem(itemUsed, usedWith))
				return;
			FletchData fletch = Fletching2.isFletchingCombination(usedWith, itemUsed);
			if (fletch != null) {
				player.getDialogueManager().startDialogue("FletchingD", fletch);
				return;
			}
			Combinations combination = Combinations.isCombining(itemUsedId, usedWithId);
			if (combination != null) {
				player.getDialogueManager().startDialogue("CombinationsD", combination);
				return;
			}
			else if (Firemaking.isFiremaking(player, itemUsed, usedWith))
				return;
			else if (OrnamentKits.attachKit(player, itemUsed, usedWith, fromSlot, toSlot))
				return;
			else if (AmuletAttaching.isAttaching(itemUsedId, usedWithId))
				player.getDialogueManager().startDialogue("AmuletAttaching");
			else if (GemCutting.isCutting(player, itemUsed, usedWith))
				return;
			else if (DyingItems.dye(player, itemUsed, usedWith, false))
				return;
			else if (Dyingcapes.dye(player, itemUsed, usedWith, false))
				return;
			else if (AttachingOrbsDialouge.isAttachingOrb(player, itemUsed, usedWith))
				return;
			else if (TreeSaplings.hasSaplingRequest(player, itemUsedId, usedWithId)) {
				if (itemUsedId == 5354)
					TreeSaplings.plantSeed(player, usedWithId, fromSlot);
				else
					TreeSaplings.plantSeed(player, itemUsedId, toSlot);
			}
			else if (Drinkables.mixPot(player, itemUsed, usedWith, fromSlot, toSlot, true) != -1)
				return;
			else if (WeaponPoison.poison(player, itemUsed, usedWith, false))
				return;
			else if (WeaponFire.poison(player, itemUsed, usedWith, false))
				return;
			else if (WeaponLight.poison(player, itemUsed, usedWith, false))
				return;
			else if (PrayerBooks.isGodBook(itemUsedId, false) || PrayerBooks.isGodBook(usedWithId, false)) {
				PrayerBooks.bindPages(player, itemUsed.getName().contains(" page ") ? usedWithId : itemUsedId);
			}
			else if (contains(22452, 22451, itemUsed, usedWith) || contains(22451, 22452, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Ganodermic Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22451, 500)) {
					player.getPackets().sendGameMessage("You need 500 Ganodermic Flakes in order to make a Ganodermic Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22452, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Visor in order to make a Ganodermic Visor.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22451, 500);
				player.getInventory().deleteItem(22452, 1);
				player.getInventory().addItem(22482, 1);
				player.getPackets().sendGameMessage("You attach the Ganodermic Flakes to the Mycelium Visor to make a Ganodermic Visor.");
			}
			else if (contains(22454, 22451, itemUsed, usedWith) || contains(22451, 22454, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Ganodermic Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22451, 1500)) {
					player.getPackets().sendGameMessage("You need 1500 Ganodermic Flakes in order to make a Ganodermic Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22454, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Leggings in order to make a Ganodermic Leggings.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22451, 1500);
				player.getInventory().deleteItem(22454, 1);
				player.getInventory().addItem(22482, 1);
				player.getPackets().sendGameMessage("You attach the Ganodermic Flakes to the Mycelium Leggings to make a Ganodermic Leggings.");
			}
			else if (contains(22456, 22451, itemUsed, usedWith) || contains(22451, 22456, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Ganodermic Poncho.");
					return;
				}
				else if (!player.getInventory().containsItem(22451, 5000)) {
					player.getPackets().sendGameMessage("You need 5000 Ganodermic Flakes in order to make a Ganodermic Ponco.");
					return;
				}
				else if (!player.getInventory().containsItem(22456, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Poncho in order to make a Ganodermic Poncho.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22451, 5000);
				player.getInventory().deleteItem(22456, 1);
				player.getInventory().addItem(22490, 1);
				player.getPackets().sendGameMessage("You attach the Ganodermic Flakes to the Mycelium Poncho to make a Ganodermic Poncho.");
			}
			else if (contains(22452, 22450, itemUsed, usedWith) || contains(22450, 22452, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Grifolic Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22450, 500)) {
					player.getPackets().sendGameMessage("You need 500 Grifolic Flakes in order to make a Grifolic Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22452, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Visor in order to make a Grifolic Visor.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22450, 500);
				player.getInventory().deleteItem(22452, 1);
				player.getInventory().addItem(22470, 1);
				player.getPackets().sendGameMessage("You attach the Grifolic Flakes to the Mycelium Visor to make a Grifolic Visor.");
			}
			else if (contains(22454, 22450, itemUsed, usedWith) || contains(22450, 22454, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Grifolic Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22450, 1500)) {
					player.getPackets().sendGameMessage("You need 1500 Grifolic Flakes in order to make a Grifolic Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22454, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Leggings in order to make a Grifolic Leggings.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22450, 1500);
				player.getInventory().deleteItem(22454, 1);
				player.getInventory().addItem(22474, 1);
				player.getPackets().sendGameMessage("You attach the Grifolic Flakes to the Mycelium Leggings to make a Grifolic Leggings.");
			}
			else if (contains(22456, 22450, itemUsed, usedWith) || contains(22450, 22456, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Grifolic Poncho.");
					return;
				}
				else if (!player.getInventory().containsItem(22450, 5000)) {
					player.getPackets().sendGameMessage("You need 5000 Grifolic Flakes in order to make a Grifolic Ponco.");
					return;
				}
				else if (!player.getInventory().containsItem(22456, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Poncho in order to make a Grifolic Poncho.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22450, 5000);
				player.getInventory().deleteItem(22456, 1);
				player.getInventory().addItem(22478, 1);
				player.getPackets().sendGameMessage("You attach the Grifolic Flakes to the Mycelium Poncho to make a Grifolic Poncho.");
			}
			else if (contains(22452, 22449, itemUsed, usedWith) || contains(22449, 22452, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Fungal Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22449, 500)) {
					player.getPackets().sendGameMessage("You need 500 Fungal Flakes in order to make a Fungal Visor.");
					return;
				}
				else if (!player.getInventory().containsItem(22452, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Visor in order to make a Fungal Visor.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22449, 500);
				player.getInventory().deleteItem(22452, 1);
				player.getInventory().addItem(22458, 1);
				player.getPackets().sendGameMessage("You attach the Fungal Flakes to the Mycelium Visor to make a Fungal Visor.");
			}
			else if (contains(22454, 22449, itemUsed, usedWith) || contains(22449, 22454, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Fungal Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22449, 1500)) {
					player.getPackets().sendGameMessage("You need 1500 Fungal Flakes in order to make a Fungal Leggings.");
					return;
				}
				else if (!player.getInventory().containsItem(22454, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Leggings in order to make a Fungal Leggings.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22449, 1500);
				player.getInventory().deleteItem(22454, 1);
				player.getInventory().addItem(22462, 1);
				player.getPackets().sendGameMessage("You attach the Fungal Flakes to the Mycelium Leggings to make a Fungal Leggings.");
			}
			else if (contains(22456, 22449, itemUsed, usedWith) || contains(22449, 22456, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.CRAFTING) < 80) {
					player.getPackets().sendGameMessage("You need a Crafting level of 80 in order to make a Fungal Poncho.");
					return;
				}
				else if (!player.getInventory().containsItem(22449, 5000)) {
					player.getPackets().sendGameMessage("You need 5000 Fungal Flakes in order to make a Fungal Ponco.");
					return;
				}
				else if (!player.getInventory().containsItem(22456, 1)) {
					player.getPackets().sendGameMessage("You need 1 Mycelium Poncho in order to make a Fungal Poncho.");
					return;
				}
				//player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22449, 5000);
				player.getInventory().deleteItem(22456, 1);
				player.getInventory().addItem(22466, 1);
				player.getPackets().sendGameMessage("You attach the Fungal Flakes to the Mycelium Poncho to make a Fungal Poncho.");
			}
			else if (contains(22498, 554, itemUsed, usedWith) || contains(22498, 22448, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.FARMING) < 80) {
					player.getPackets().sendGameMessage("You need a Farming level of 80 in order to make a polypore staff.");
					return;
				}
				else if (!player.getInventory().containsItem(22448, 3000)) {
					player.getPackets().sendGameMessage("You need 3,000 polypore spores in order to make a polypore staff.");
					return;
				}
				else if (!player.getInventory().containsItem(554, 15000)) {
					player.getPackets().sendGameMessage("You need 15,000 fire runes in order to make a polypore staff.");
					return;
				}
				player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(554, 15000);
				player.getInventory().deleteItem(22448, 3000);
				player.getInventory().deleteItem(22498, 1);
				player.getInventory().addItem(22494, 1);
				player.getPackets().sendGameMessage("You attach the polypore spores and infuse the fire runes to the stick in order to create a staff.");
			}
			else if (itemUsed.getId() == 36 && usedWith.getId() == 4527) {
	                    if (player.getInventory().containsItem(36, 1)
	                                    && player.getInventory().containsItem(4527, 1)) {
	                            player.getInventory().deleteItem(36, 1);
	                            player.getInventory().deleteItem(4527, 1);
	                            player.getInventory().addItem(4529, 1);
				    player.getPackets().sendGameMessage("You made a Candle latern... Just add light!");
	                    	} else {
					player.getPackets().sendGameMessage("You need a Candle and a Candle lantern.");
				return;
	                    }
	                }
	                else if (itemUsed.getId() == 9913 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().whiteDestabilizer();
	                else if (itemUsed.getId() == 9914 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().redDestabilizer();
	                else if (itemUsed.getId() == 9915 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().blueDestabilizer();
	                else if (itemUsed.getId() == 9916 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().greenDestabilizer();
	                else if (itemUsed.getId() == 9917 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().yellowDestabilizer();
	                else if (itemUsed.getId() == 9918 && usedWith.getId() == 9912)
	                    player.getInterfaceManager().blackDestabilizer();
	                else if (itemUsed.getId() == 7331 && usedWith.getId() == 1511)
	                    player.getInterfaceManager().blueLogColoring();
	                else if (itemUsed.getId() == 7330 && usedWith.getId() == 1511)
	                    player.getInterfaceManager().greenLogColoring();
	                else if (itemUsed.getId() == 7329 && usedWith.getId() == 1511)
	                    player.getInterfaceManager().redLogColoring();
	                else if (itemUsed.getId() == 10326 && usedWith.getId() == 1511)
	                    player.getInterfaceManager().purpleLogColoring();
	                else if (itemUsed.getId() == 10327 && usedWith.getId() == 1511)
	                    player.getInterfaceManager().whiteLogColoring();
	                else if (itemUsed.getId() == 6874 && usedWith.getId() == 6864)
	                    player.getInterfaceManager().redMarionette();
	                else if (itemUsed.getId() == 6878 && usedWith.getId() == 6864)
	                    player.getInterfaceManager().blueMarionette();
	                else if (itemUsed.getId() == 6882 && usedWith.getId() == 6864)
	                    player.getInterfaceManager().greenMarionette();
	                else if (itemUsed.getId() == 1381 && usedWith.getId() == 21488 || itemUsed.getId() == 21488 && usedWith.getId() == 1381)
	                    player.getInterfaceManager().skeletalAirStaff();
	                else if (itemUsed.getId() == 1383 && usedWith.getId() == 21488 || itemUsed.getId() == 21488 && usedWith.getId() == 1383)
	                    player.getInterfaceManager().skeletalWaterStaff();
	                else if (itemUsed.getId() == 1385 && usedWith.getId() == 21488 || itemUsed.getId() == 21488 && usedWith.getId() == 1385)
	                    player.getInterfaceManager().skeletalEarthStaff();
	                else if (itemUsed.getId() == 1387 && usedWith.getId() == 21488 || itemUsed.getId() == 21488 && usedWith.getId() == 1387)
	                    player.getInterfaceManager().skeletalFireStaff();
	                else if (itemUsed.getId() == 8794 && usedWith.getId() == 960)
	                    player.getInterfaceManager().marionetteHandle();
			else if (contains(10113, 1063, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.SPIKY_VAMBRACES);
			else if (contains(10113, 1065, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.GREEN_SPIKY_VAMBRACES);
			else if (contains(10113, 2487, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.BLUE_SPIKY_VAMBRACES);
			else if (contains(10113, 2489, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.RED_SPIKY_VAMBRACES);
			else if (contains(10113, 2491, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.BLACK_SPIKY_VAMBRACES);
			else if (contains(10113, 24376, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.ROYAL_SPIKY_VAMBRACES);
			else if (contains(2370, 1095, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.STUDDED_CHAPS);
			else if (contains(2370, 1129, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.STUDDED_BODY);
			else if (contains(2370, 1059, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.STUDDED_LEATHER_GLOVES);
			else if (contains(2370, 1061, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.STUDDED_LEATHER_BOOTS);
			else if (contains(2370, 25806, itemUsed, usedWith))
			    player.getDialogueManager().startDialogue("LeatherMakingD", player, LeatherMaking.SmeltingBar.STUDDED_LEATHER_SHIELD);
			else if (contains(22496, 22448, itemUsed, usedWith)) {
				if (player.getSkills().getLevel(Skills.FARMING) < 80) {
					player.getPackets().sendGameMessage("You need a Farming level of 80 in order to recharge polypore staff.");
					return;
				}
				int charges = 3000 - player.getCharges().getCharges(22496);
				if (!player.getInventory().containsItem(22448, charges)) {
					player.getPackets().sendGameMessage("You need " + charges + " polypore spores in order to recharge polypore staff.");
					return;
				}
				player.setNextAnimation(new Animation(15434));
				player.lock(2);
				player.getInventory().deleteItem(22448, charges);
				player.getInventory().deleteItem(22496, 1);
				player.getCharges().resetCharges(22496);
				player.getInventory().addItem(22494, 1);
				player.getPackets().sendGameMessage("You attach the polypore spores to the staff.");
			}
			else if (contains(11710, 11712, itemUsed, usedWith) || contains(11710, 11714, itemUsed, usedWith) || contains(11712, 11714, itemUsed, usedWith))
				GodswordCreating.joinPieces(player, false);
			else if (Slayer.createSlayerHelmet(player, itemUsedId, usedWithId))
				return;
			else if (itemUsedId == 23191 || usedWithId == 23191) {
				Drink pot = Drinkables.getDrink(itemUsedId == 23191 ? usedWithId : itemUsedId);
				if (pot == null)
					return;
				player.getDialogueManager().startDialogue("FlaskDecantingD", pot);
			}
			else if (contains(6573, 31851, itemUsed, usedWith)){
				player.getInventory().deleteItem(6573, 1);
				player.getInventory().deleteItem(31851, 1);
				player.getInventory().addItem(31853, 1);
			    player.getPackets().sendGameMessage("You attatch the Onyx to the Incomplete Hydrix and create an Uncut Hydrix.");
			}
			else if (itemUsed.getId() == 1534 || itemUsed.getId() == 1526 || itemUsed.getId() == 253 || itemUsed.getId() == 251 || itemUsed.getId() == 255
				|| itemUsed.getId() == 257 || itemUsed.getId() == 12172 || itemUsed.getId() == 259 || itemUsed.getId() == 14854 || itemUsed.getId() == 261
				|| itemUsed.getId() == 263 || itemUsed.getId() == 9017 || itemUsed.getId() == 3000 || itemUsed.getId() == 265 || itemUsed.getId() == 2481
				|| itemUsed.getId() == 267 || itemUsed.getId() == 269 || itemUsed.getId() == 21624 || itemUsed.getId() == 2998
				|| itemUsed.getId() == 1528 || itemUsed.getId() == 249 && usedWith.getId() == 227
				|| itemUsed.getId() == 5976 && usedWith.getId() == 229
				|| itemUsed.getId() == 6016 || itemUsed.getId() == 259 || itemUsed.getId() == 2398 || itemUsed.getId() == 2998 && usedWith.getId() == 5935)
			    	player.getDialogueManager().startDialogue("PotionMakingD", player, PotionMaking.SmeltingBar.GUAM_POTION_UNF);
			else if (itemUsed.getId() == 221 || itemUsed.getId() == 251 || itemUsed.getId() == 12630 || itemUsed.getId() == 1951 && usedWith.getId() == 91 
				|| itemUsed.getId() == 592 || itemUsed.getId() == 1474 || itemUsed.getId() == 225 && usedWith.getId() == 95
				|| itemUsed.getId() == 1581 || itemUsed.getId() == 1975 || itemUsed.getId() == 9736 || itemUsed.getId() == 223 && usedWith.getId() == 97
				|| itemUsed.getId() == 1550 && usedWith.getId() == 127
				|| itemUsed.getId() == 7650 && usedWith.getId() == 7652
				|| itemUsed.getId() == 1526 && usedWith.getId() == 4840
				|| itemUsed.getId() == 948 || itemUsed.getId() == 235 && usedWith.getId() == 93
				|| itemUsed.getId() == 231 && usedWith.getId() == 99 || itemUsed.getId() == 12109 && usedWith.getId() == 12181
				|| itemUsed.getId() == 11525 || itemUsed.getId() == 5004 && usedWith.getId() == 14856
				|| itemUsed.getId() == 235 || itemUsed.getId() == 221 && usedWith.getId() == 101
				|| itemUsed.getId() == 2970 || itemUsed.getId() == 10111 || itemUsed.getId() == 231 && usedWith.getId() == 103
				|| itemUsed.getId() == 241 || itemUsed.getId() == 225 && usedWith.getId() == 105
				|| itemUsed.getId() == 9018 && usedWith.getId() == 9019
				|| itemUsed.getId() == 11807 || itemUsed.getId() == 6693 || itemUsed.getId() == 2152 && usedWith.getId() == 3002
				|| itemUsed.getId() == 223 && usedWith.getId() == 3004
				|| itemUsed.getId() == 235 && usedWith.getId() == 3026
				|| itemUsed.getId() == 1526 && usedWith.getId() == 10911
				|| itemUsed.getId() == 10937 && usedWith.getId() == 10919
				|| itemUsed.getId() == 239 && usedWith.getId() == 107
				|| itemUsed.getId() == 6049 && usedWith.getId() == 5942
				|| itemUsed.getId() == 3138 || itemUsed.getId() == 241 && usedWith.getId() == 2483
				|| itemUsed.getId() == 245 && usedWith.getId() == 109
				|| itemUsed.getId() == 247 && usedWith.getId() == 111
				|| itemUsed.getId() == 6051 && usedWith.getId() == 5951
				|| itemUsed.getId() == 223 && usedWith.getId() == 5936
				|| itemUsed.getId() == 6018 && usedWith.getId() == 5939
				|| itemUsed.getId() == 5972 && usedWith.getId() == 3018
				|| itemUsed.getId() == 4621 && usedWith.getId() == 2454
				|| itemUsed.getId() == 261 && usedWith.getId() == 145
				|| itemUsed.getId() == 267 && usedWith.getId() == 157
				|| itemUsed.getId() == 245 && usedWith.getId() == 189
				|| itemUsed.getId() == 28256 && usedWith.getId() == 6687
				|| itemUsed.getId() == 28253 && usedWith.getId() == 4419
				|| itemUsed.getId() == 2481 && usedWith.getId() == 163
				|| itemUsed.getId() == 6810 && usedWith.getId() == 139
				|| itemUsed.getId() == 21622 && usedWith.getId() == 21628
				|| itemUsed.getId() == 9594 && usedWith.getId() == 3042
				|| itemUsed.getId() == 169 && usedWith.getId() == 12539
				|| itemUsed.getId() == 269 && usedWith.getId() == 15309 || usedWith.getId() == 15313 || usedWith.getId() == 15317 || usedWith.getId() == 15321 || usedWith.getId() == 15325)
			    	player.getDialogueManager().startDialogue("PotionMakingD", player, PotionMaking.SmeltingBar.ATTACK_POTION);
			else if (contains(11690, 11702, itemUsed, usedWith))
				GodswordCreating.attachHilt(player, 0);
			else if (contains(11690, 11704, itemUsed, usedWith))
				GodswordCreating.attachHilt(player, 1);
			else if (contains(11690, 11706, itemUsed, usedWith))
				GodswordCreating.attachHilt(player, 2);
			else if (contains(11690, 11708, itemUsed, usedWith))
				GodswordCreating.attachHilt(player, 3);
			else if (contains(SpiritshieldCreating.HOLY_ELIXIR, SpiritshieldCreating.SPIRIT_SHIELD, itemUsed, usedWith))
				player.getPackets().sendGameMessage("The shield must be blessed at an altar.");
			else if (contains(SpiritshieldCreating.SPIRIT_SHIELD, 13746, itemUsed, usedWith) || contains(SpiritshieldCreating.SPIRIT_SHIELD, 13748, itemUsed, usedWith) || contains(SpiritshieldCreating.SPIRIT_SHIELD, 13750, itemUsed, usedWith) || contains(SpiritshieldCreating.SPIRIT_SHIELD, 13752, itemUsed, usedWith))
				player.getPackets().sendGameMessage("You need a blessed spirit shield to attach the sigil to.");
			else if (contains(SqirkFruitSqueeze.SqirkFruit.AUTUMM.getFruitId(), Herblore.PESTLE_AND_MORTAR, itemUsed, usedWith))
				player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.AUTUMM);
			else if (contains(SqirkFruitSqueeze.SqirkFruit.SPRING.getFruitId(), Herblore.PESTLE_AND_MORTAR, itemUsed, usedWith))
				player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.SPRING);
			else if (contains(SqirkFruitSqueeze.SqirkFruit.SUMMER.getFruitId(), Herblore.PESTLE_AND_MORTAR, itemUsed, usedWith))
				player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.SUMMER);
			else if (contains(SqirkFruitSqueeze.SqirkFruit.WINTER.getFruitId(), Herblore.PESTLE_AND_MORTAR, itemUsed, usedWith))
				player.getDialogueManager().startDialogue("SqirkFruitSqueeze", SqirkFruit.WINTER);
			else if (contains(5976, 229, itemUsed, usedWith)) {
				player.getInventory().deleteItem(new Item(5976, 1));
				player.getInventory().deleteItem(new Item(229, 1));
				player.getInventory().addItem(new Item(Herblore.COCONUT_MILK, 1));
				player.getInventory().addItem(new Item(5978, 1));
				player.getPackets().sendGameMessage("You pour the milk of the coconut into a vial.");
			}
			else if (contains(4151, 21369, itemUsed, usedWith)) {
				if (!player.getSkills().hasRequiriments(Skills.ATTACK, 75, Skills.SLAYER, 80)) {
					player.getPackets().sendGameMessage("You need an attack level of 75 and slayer level of 80 in order to attach the whip vine to the whip.");
					return;
				}
				player.getInventory().replaceItem(21371, 1, toSlot);
				player.getInventory().deleteItem(fromSlot, itemUsed);
				player.getPackets().sendGameMessage("You attach the whip vine to the abbysal whip.");
			}
			else if (contains(985, 987, itemUsed, usedWith)) { // crystal key
				player.getInventory().deleteItem(toSlot, usedWith);
				itemUsed.setId(989);
				player.getInventory().refresh(fromSlot);
				player.getPackets().sendGameMessage("You join the two halves of the key together.");
			}
			else
				//player.getPackets().sendGameMessage("Nothing interesting happens.");
			if (Settings.DEBUG)
				Logger.log("ItemHandler", "Used:" + itemUsed.getId() + ", With:" + usedWith.getId());
		}
		else if ((interfaceId == 1461 && interfaceComponent == 1) && (interfaceId2 == Inventory.INVENTORY_INTERFACE || interfaceId2 == Inventory.INVENTORY_INTERFACE_2) && !player.getInterfaceManager().containsInventoryInter()) {
			if (toSlot >= 28)
				return;
			Item item = player.getInventory().getItem(toSlot);
			if (item == null || item.getId() != usedWithId)
				return;
			player.getActionbar().useAbility(new MagicAbilityShortcut(fromSlot), item);
			//Magic.handleSpellOnItem(player, fromSlot, (byte) toSlot);
		}
	}

	public static void handleItemOption3(Player player, int slotId, int itemId, Item item) {
		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		player.stopAll(false);
		FlyingEntities impJar = FlyingEntities.forItem((short) itemId);
		if (impJar != null)
			FlyingEntityHunter.openJar(player, impJar, slotId);
		if (LightSource.lightSource(player, slotId))
			return;
		if (OrnamentKits.splitKit(player, item))
			return;
		if (item.getDefinitions().isBindItem())
			player.getDungManager().bind(item, slotId);
		else if (itemId >= 11095 && itemId <= 11103 && (itemId & 0x1) != 0)
			Revenant.useForinthryBrace(player, item, slotId);
		else if (itemId >= 13281 && itemId <= 13288)
			player.getSlayerManager().checkKillsLeft();
		else if (itemId == 15707)
			Magic.sendTeleportSpell(player, 13652, 13654, 2602, 2603, 1, 0, new WorldTile(3447, 3694, 0), 10, true, Magic.ITEM_TELEPORT);
		else if (itemId == 32151 || itemId == 32152 || itemId == 32153 || itemId == 20767 || itemId == 20769 || itemId == 20771)
			SkillCapeCustomizer.startCustomizing(player, itemId);
		else if (itemId == 24437 || itemId == 24439 || itemId == 24440 || itemId == 24441)
			player.getDialogueManager().startDialogue("FlamingSkull", item, slotId);
		else if (Equipment.getItemSlot(itemId) == Equipment.SLOT_AURA)
			player.getAuraManager().sendTimeRemaining(itemId);
		else if (itemId == 26192){
			if (player.getTzHaarCityKills() >= 50) {
			    player.getInventory().deleteItem(26192, 1);
			    player.getInventory().addItem(26193, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26193){
			if (player.getTzHaarCityKills() >= 100) {
			    player.getInventory().deleteItem(26193, 1);
			    player.getInventory().addItem(26194, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26194){
			if (player.getTzHaarCityKills() >= 150) {
			    player.getInventory().deleteItem(26194, 1);
			    player.getInventory().addItem(26195, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26195){
			if (player.getTzHaarCityKills() >= 200) {
			    player.getInventory().deleteItem(26195, 1);
			    player.getInventory().addItem(26196, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26196){
			if (player.getTzHaarCityKills() >= 250) {
			    player.getInventory().deleteItem(26196, 1);
			    player.getInventory().addItem(26197, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26197){
			if (player.getTzHaarCityKills() >= 300) {
			    player.getInventory().deleteItem(26197, 1);
			    player.getInventory().addItem(26198, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to upgrade this whip.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 26198){
			if (player.getTzHaarCityKills() >= 400) {
			    player.getInventory().deleteItem(26198, 1);
			    player.getInventory().addItem(26192, 1);
			    //player.setTzHaarCityKills(player.getTzHaarCityKills() - 100);
			} else
			    player.getPackets().sendGameMessage("Kill more TzHaar City monsters to revert this whip to stage 1.");
			player.getPackets().sendGameMessage("I have killed <col=33ccff>" + player.getTzHaarCityKills() + "</col> TzHaar City monsters.");
			return;
		}
		else if (itemId == 27616 || itemId == 27617)
		    player.getDialogueManager().startDialogue("CrawlingHandTeleportD");
		else if	(itemId == 27618 || itemId == 27619)
		    player.getDialogueManager().startDialogue("CockatriceTeleportD");
		else if	(itemId == 27620 || itemId == 27621)
		    player.getDialogueManager().startDialogue("ReflectionTeleportD");
		else if	(itemId == 27622 || itemId == 27623)
		    player.getDialogueManager().startDialogue("KuraskTeleportD");
		else if	(itemId == 27624 || itemId == 27625)
		    player.getDialogueManager().startDialogue("AbyssTeleportD");
		else if	(itemId == 28686 || itemId == 28687)
		    player.getDialogueManager().startDialogue("MourningMaskTeleportD");
		else if	(itemId == 28688 || itemId == 28689)
		    player.getDialogueManager().startDialogue("GelatinMaskTeleportD");
		else if	(itemId == 28690 || itemId == 28691)
		    player.getDialogueManager().startDialogue("DustMaskTeleportD");
		else if	(itemId == 28692 || itemId == 28693)
		    player.getDialogueManager().startDialogue("GargoyleTeleportD");
		else if	(itemId == 28694 || itemId == 28695)
		    player.getDialogueManager().startDialogue("JadinkoMaskTeleportD");
		else if	(itemId == 31089 || itemId == 31090)
		    player.getDialogueManager().startDialogue("BloodveldTeleportD");
		else if	(itemId == 31091 || itemId == 31092)
		    player.getDialogueManager().startDialogue("AberrantSpectreTeleportD");
		else if	(itemId == 31093 || itemId == 31094)
		    player.getDialogueManager().startDialogue("JungleWyrmTeleportD");
		else if	(itemId == 31095 || itemId == 31096)
		    player.getDialogueManager().startDialogue("DesertWyrmTeleportD");
		else if	(itemId == 31097 || itemId == 31098)
		    player.getDialogueManager().startDialogue("IceWyrmTeleportD");
		else if	(itemId == 31099 || itemId == 31100)
		    player.getDialogueManager().startDialogue("DarkBeastTeleportD");
		else if (PrayerBooks.isGodBook(itemId, true))
			PrayerBooks.sermanize(player, itemId);
		else if (itemId == 21371) {
			player.getInventory().replaceItem(4151, 1, slotId);
			player.getInventory().addItem(21369, 1);
			player.getPackets().sendGameMessage("You split the whip vine from the abbysal whip.");
		}
		else if (itemId == 4155) {
			player.getInterfaceManager().sendCentralInterface(1309);
			player.getPackets().sendIComponentText(1309, 37, "List Co-Op Partner");
		}
		else if (itemId == 31846) {
		    	player.getPackets().sendGameMessage("Your current assignment is " +player.getTask().getName() + "; only " +player.getTask().getTaskAmount()+ " left to go");
		}
		else if (itemId == 19613 || itemId == 19615 || itemId == 19617) // Prayer Book
			player.setNextAnimation(new Animation(5864));
		else if (itemId == 3840) // Prayer Book
			player.setNextAnimation(new Animation(1335));
		else if (itemId == 3842) // Prayer Book
			player.setNextAnimation(new Animation(1336));
		else if (itemId == 3844) // Prayer Book
			player.setNextAnimation(new Animation(1337));
		else if (itemId == 22332) // Wicked hood
			player.getInterfaceManager().teleportWicked();
		else if (itemId == 4079)
			player.setNextAnimation(new Animation(1459));
		else if (itemId == 2886) { // Battered Book
			if (player.getToolbelt().containsItem(946)) {
                        player.getInventory().deleteItem(2886, 1);
                        player.getInventory().addItem(2887, 1);
                        player.getInventory().addItem(9715, 1);
			} else {
				player.getPackets().sendGameMessage("You need a knife in your toolbelt.");
			return;
			}
		}
		else if (itemId == 14577) { // Falador Shield 1
			//if (player.getPrayer().getPrayerpoints() < player.getSkills().getLevelForXp(Skills.PRAYER) * 10) {
			player.getPrayer().setPrayerpoints((int) ((player.getSkills().getLevelForXp(Skills.PRAYER) * 10) * 0.55));
			player.getPrayer().refreshPrayerPoints();
			player.setNextGraphics(new Graphics(1964));
			return;
			//}
		}
		else if (itemId == 14578) { // Falador Shield 2
			//if (player.getPrayer().getPrayerpoints() < player.getSkills().getLevelForXp(Skills.PRAYER) * 10) {
			player.getPrayer().setPrayerpoints((int) ((player.getSkills().getLevelForXp(Skills.PRAYER) * 10) * 0.75));
			player.getPrayer().refreshPrayerPoints();
			player.setNextGraphics(new Graphics(1964));
			return;
			//}
		}
		else if (itemId == 14579) { // Falador Shield 3
			//if (player.getPrayer().getPrayerpoints() < player.getSkills().getLevelForXp(Skills.PRAYER) * 10) {
			player.getPrayer().setPrayerpoints((int) ((player.getSkills().getLevelForXp(Skills.PRAYER) * 10) * 1.05));
			player.getPrayer().refreshPrayerPoints();
			player.setNextGraphics(new Graphics(1964));
			return;
			//}
		}
		else if (itemId == 19749) { // Falador Shield 4
			//if (player.getPrayer().getPrayerpoints() < player.getSkills().getLevelForXp(Skills.PRAYER) * 10) {
			player.getPrayer().setPrayerpoints((int) ((player.getSkills().getLevelForXp(Skills.PRAYER) * 10) * 1.25));
			player.getPrayer().refreshPrayerPoints();
			player.setNextGraphics(new Graphics(1964));
			return;
			//}
		}
		else if(itemId == 6866) { //Green marionette Bow
			player.setNextAnimation(new Animation(3005));
			player.setNextGraphics(new Graphics(517));
		}
		else if (itemId == 9906) {//White Ghost buster
			player.getInterfaceManager().removeWhiteStabilizer();
			return;
		}
		else if (itemId == 9907) {//Red Ghost buster
			if (player.getInventory().getFreeSlots() < 2) {
                    player.getPackets().sendGameMessage("Not enough space in your inventory.");
                    return;
                	}
                    player.getInventory().deleteItem(9907, 1);
                    player.getInventory().addItem(9914, 1);
                    player.getInventory().addItem(9912, 1);
			player.getPackets().sendGameMessage("You have removed the Destabiliser....");
			return;
		}
		else if (itemId == 9908) {//Blue Ghost buster
			if (player.getInventory().getFreeSlots() < 2) {
                    player.getPackets().sendGameMessage("Not enough space in your inventory.");
                    return;
                	}
                    player.getInventory().deleteItem(9908, 1);
                    player.getInventory().addItem(9915, 1);
                    player.getInventory().addItem(9912, 1);
			player.getPackets().sendGameMessage("You have removed the Destabiliser....");
			return;
		}
		else if (itemId == 9909) {//Green Ghost buster
			if (player.getInventory().getFreeSlots() < 2) {
                    player.getPackets().sendGameMessage("Not enough space in your inventory.");
                    return;
                	}
                    player.getInventory().deleteItem(9909, 1);
                    player.getInventory().addItem(9916, 1);
                    player.getInventory().addItem(9912, 1);
			player.getPackets().sendGameMessage("You have removed the Destabiliser....");
			return;
		}
		else if (itemId == 9910) {//Yellow Ghost buster
			if (player.getInventory().getFreeSlots() < 2) {
                    player.getPackets().sendGameMessage("Not enough space in your inventory.");
                    return;
                	}
                    player.getInventory().deleteItem(9910, 1);
                    player.getInventory().addItem(9917, 1);
                    player.getInventory().addItem(9912, 1);
			player.getPackets().sendGameMessage("You have removed the Destabiliser....");
			return;
		}
		else if (itemId == 9911) {//Black Ghost buster
			if (player.getInventory().getFreeSlots() < 2) {
                    player.getPackets().sendGameMessage("Not enough space in your inventory.");
                    return;
                	}
                    player.getInventory().deleteItem(9911, 1);
                    player.getInventory().addItem(9918, 1);
                    player.getInventory().addItem(9912, 1);
			player.getPackets().sendGameMessage("You have removed the Destabiliser....");
			return;
		}
		else if (itemId == 7051) { // Unlit Bug Lantern Light
                if (player.getInventory().containsItem(590, 1) || player.getToolbelt().containsItem(590)) {
                        player.getInventory().deleteItem(7051, 1);
                        player.getInventory().addItem(7053, 1);
			return;
			}
		}
		else if (itemId == 7053) { // Lit Bug Lantern Extinguish
                        player.getInventory().deleteItem(7053, 1);
                        player.getInventory().addItem(7051, 1);
			return;
		}
	    	else if(itemId == 6865) { //Blue marionette Bow
			player.setNextAnimation(new Animation(3005));
			player.setNextGraphics(new Graphics(513));
			return;
	    	}
		else if(itemId == 6867) { //Red marionette Bow
			player.setNextAnimation(new Animation(3005));
			player.setNextGraphics(new Graphics(509));
			return;
		}
		else if (itemId == 15439) {
			player.setNextAnimation(new Animation(12755));
			player.setNextGraphics(new Graphics(2298));
			return;
		}
		else if (itemId == 9013) {//Skull Sceptre
			player.getInterfaceManager().teleportSkullSceptre();
			return;
		}
		else if (itemId == 15353) { // Eek the spider
			player.setNextGraphics(new Graphics(2178));
			player.setNextAnimation(new Animation(12490));
			return;
			}
		else if (itemId == 11694 || itemId == 11696 || itemId == 11698 || itemId == 11700)
			GodswordCreating.dismantleGS(player, item, slotId);
		else if (itemId == 23044 || itemId == 23045 || itemId == 23046 || itemId == 23047)
			player.getDialogueManager().startDialogue("MindSpikeD", itemId, slotId);
		else if (item.getDefinitions().containsOption("Teleport") && ItemTransportation.transportationDialogue(player, item, true))
			return;
		else if (player.getCharges().checkCharges(item))
			return;
		if (Settings.DEBUG)
			System.out.println("Option 3");
	}

	public static void handleItemOption4(Player player, int slotId, int itemId, Item item) {
		if (Settings.DEBUG)
			System.out.println("Option 4");
	}

	public static void handleItemOption5(Player player, int slotId, int itemId, Item item) {
		if (Settings.DEBUG)
			System.out.println("Option 5");
	}

	public static void handleItemOption6(Player player, int slot, int itemId, Item item) {
		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		player.stopAll(false);
		if (player.getToolbelt().addItem(slot, item))
			return;
		if ((item.getDefinitions().containsOption("Rub") || item.getDefinitions().containsOption("Cabbage-port")) && ItemTransportation.transportationDialogue(player, item, true))
			return;
		else if (Drinkables.emptyPot(player, item, slot))
			return;
		else if (item.getDefinitions().isBindItem())
			player.getDungManager().bind(item, slot);
		else if (itemId == 27616){
			if (player.getCrawlingHandKills() >= 100) {
			    player.getInventory().deleteItem(27616, 1);
			    player.getInventory().addItem(27617, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Crawling Hands to transform this mask.");
			return;
		}
		else if (itemId == 27617){
			    player.getInventory().deleteItem(27617, 1);
			    player.getInventory().addItem(27616, 1);
			return;
		}
		else if (itemId == 27618){
			if (player.getCockatriceKills() >= 300) {
			    player.getInventory().deleteItem(27618, 1);
			    player.getInventory().addItem(27619, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Cockatrices to transform this mask.");
			return;
		}
		else if (itemId == 27619){
			    player.getInventory().deleteItem(27619, 1);
			    player.getInventory().addItem(27618, 1);
			return;
		}
		else if (itemId == 27620){
			if (player.getBasiliskKills() >= 500) {
			    player.getInventory().deleteItem(27620, 1);
			    player.getInventory().addItem(27621, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Basilisks to transform this mask.");
			return;
		}
		else if (itemId == 27621){
			    player.getInventory().deleteItem(27621, 1);
			    player.getInventory().addItem(27620, 1);
			return;
		}
		else if (itemId == 27622){
			if (player.getKuraskKills() >= 800) {
			    player.getInventory().deleteItem(27622, 1);
			    player.getInventory().addItem(27623, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Kurasks to transform this mask.");
			return;
		}
		else if (itemId == 27623){
			    player.getInventory().deleteItem(27623, 1);
			    player.getInventory().addItem(27622, 1);
			return;
		}
		else if (itemId == 27624){
			if (player.getAbyssalDemonKills() >= 900) {
			    player.getInventory().deleteItem(27624, 1);
			    player.getInventory().addItem(27625, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Abyssal Demons to transform this mask.");
			return;
		}
		else if (itemId == 27625){
			    player.getInventory().deleteItem(27625, 1);
			    player.getInventory().addItem(27624, 1);
			return;
		}
		else if (itemId == 28686){
			if (player.getBansheeKills() >= 200) {
			    player.getInventory().deleteItem(28686, 1);
			    player.getInventory().addItem(28687, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Banshees to transform this mask.");
			return;
		}
		else if (itemId == 28687){
			    player.getInventory().deleteItem(28687, 1);
			    player.getInventory().addItem(28686, 1);
			return;
		}
		
		else if (itemId == 28688){
			if (player.getGelatinKills() >= 600) {
			    player.getInventory().deleteItem(28688, 1);
			    player.getInventory().addItem(28689, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Jellys to transform this mask.");
			return;
		}
		else if (itemId == 28689){
			    player.getInventory().deleteItem(28689, 1);
			    player.getInventory().addItem(28688, 1);
			return;
		}
		else if (itemId == 28690){
			if (player.getDustDevilKills() >= 700) {
			    player.getInventory().deleteItem(28690, 1);
			    player.getInventory().addItem(28691, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Dust Devils to transform this mask.");
			return;
		}
		else if (itemId == 28691){
			    player.getInventory().deleteItem(28691, 1);
			    player.getInventory().addItem(28690, 1);
			return;
		}
		else if (itemId == 28692){
			if (player.getGargoyleKills() >= 800) {
			    player.getInventory().deleteItem(28692, 1);
			    player.getInventory().addItem(28693, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Gargoyles to transform this mask.");
			return;
		}
		else if (itemId == 28693){
			    player.getInventory().deleteItem(28693, 1);
			    player.getInventory().addItem(28692, 1);
			return;
		}
		else if (itemId == 28694){
			if (player.getJadinkoKills() >= 900) {
			    player.getInventory().deleteItem(28694, 1);
			    player.getInventory().addItem(28695, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Jadinkos to transform this mask.");
			return;
		}
		else if (itemId == 28695){
			    player.getInventory().deleteItem(28695, 1);
			    player.getInventory().addItem(28694, 1);
			return;
		}
		else if (itemId == 31089){
			if (player.getBloodveldKills() >= 600) {
			    player.getInventory().deleteItem(31089, 1);
			    player.getInventory().addItem(31090, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Bloodvelds to transform this mask.");
			return;
		}
		else if (itemId == 31090){
			    player.getInventory().deleteItem(31090, 1);
			    player.getInventory().addItem(31089, 1);
			return;
		}
		else if (itemId == 31091){
			if (player.getAberrantSpectreKills() >= 700) {
			    player.getInventory().deleteItem(31091, 1);
			    player.getInventory().addItem(31092, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Aberrant Spectres to transform this mask.");
			return;
		}
		else if (itemId == 31092){
			    player.getInventory().deleteItem(31092, 1);
			    player.getInventory().addItem(31091, 1);
			return;
		}
		else if (itemId == 31093){
			if (player.getJungleWyrmKills() >= 800) {
			    player.getInventory().deleteItem(31093, 1);
			    player.getInventory().addItem(31094, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Jungle Strykewyrms to transform this mask.");
			return;
		}
		else if (itemId == 31094){
			    player.getInventory().deleteItem(31094, 1);
			    player.getInventory().addItem(31093, 1);
			return;
		}
		else if (itemId == 31095){
			if (player.getDesertWyrmKills() >= 800) {
			    player.getInventory().deleteItem(31095, 1);
			    player.getInventory().addItem(31096, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Desert Strykewyrms to transform this mask.");
			return;
		}
		else if (itemId == 31096){
			    player.getInventory().deleteItem(31096, 1);
			    player.getInventory().addItem(31095, 1);
			return;
		}
		else if (itemId == 31097){
			if (player.getIceWyrmKills() >= 1000) {
			    player.getInventory().deleteItem(31097, 1);
			    player.getInventory().addItem(31098, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Ice Strykewyrms to transform this mask.");
			return;
		}
		else if (itemId == 31098){
			    player.getInventory().deleteItem(31098, 1);
			    player.getInventory().addItem(31097, 1);
			return;
		}
		else if (itemId == 31099){
			if (player.getDarkBeastKills() >= 1000) {
			    player.getInventory().deleteItem(31099, 1);
			    player.getInventory().addItem(31100, 1);
			} else
			    player.getPackets().sendGameMessage("Kill more Dark Beasts to transform this mask.");
			return;
		}
		else if (itemId == 31100){
			    player.getInventory().deleteItem(31100, 1);
			    player.getInventory().addItem(31099, 1);
			return;
		}
		
		else if (itemId == 995) {
			if (player.isCanPvp()) {
				player.getPackets().sendGameMessage("You cannot acess your money pouch within a player-vs-player zone.");
				return;
			}
			player.getMoneyPouch().sendDynamicInteraction(item.getAmount(), false, MoneyPouch.TYPE_POUCH_INVENTORY);
		}
		else if (itemId == 1438)
			Runecrafting.locate(player, 3127, 3405);
		else if (itemId == 1440)
			Runecrafting.locate(player, 3306, 3474);
		else if (itemId == 1442)
			Runecrafting.locate(player, 3313, 3255);
		else if (itemId == 1444)
			Runecrafting.locate(player, 3185, 3165);
		else if (itemId == 1446)
			Runecrafting.locate(player, 3053, 3445);
		else if (itemId == 1448)
			Runecrafting.locate(player, 2982, 3514);
		else if (itemId == 1458)
			Runecrafting.locate(player, 2858, 3381);
		else if (itemId == 1454)
			Runecrafting.locate(player, 2408, 4377);
		else if (itemId == 1452)
			Runecrafting.locate(player, 3060, 3591);
		else if (itemId == 1462)
			Runecrafting.locate(player, 2872, 3020);
		else if (itemId == 14057)
			SorceressGarden.teleportToSocreressGarden(player, true);
		else if (itemId == 21776) {
			if (Herblore.isRawIngredient(player, item.getId()))
				return;
		}
		else if (itemId == 11749) //Chimes
			player.setNextAnimation(new Animation(7088));
		else if (itemId == 249) {
		    	player.getDialogueManager().startDialogue("PotionMakingD", player, PotionMaking.SmeltingBar.ATTACK_POTION);
		    	player.getPackets().sendGameMessage("Option 6.");
		}
		else if (itemId == 10014) {//Black Warlock
			//player.getInterfaceManager().releaseBlackWarlock();
			player.setNextAnimation(new Animation(5213));
			player.getInventory().deleteItem(10014, 1);
			player.getInventory().addItem(10012, 1);
			player.setNextGraphics(new Graphics(2299));
			return;
		}
		else if (itemId == 10016) {//Snowy Knight
			//player.getInterfaceManager().releaseSnowyKnight();
			player.setNextAnimation(new Animation(5213));
			player.getInventory().deleteItem(10016, 1);
			player.getInventory().addItem(10012, 1);
			player.setNextGraphics(new Graphics(2300));
			return;
		}
		else if (itemId == 10018) {//Sapphire Glacialis
			//player.getInterfaceManager().releaseSapphireGlacialis();
			player.setNextAnimation(new Animation(5213));
			player.getInventory().deleteItem(10018, 1);
			player.getInventory().addItem(10012, 1);
			player.setNextGraphics(new Graphics(2301));
			return;
		}
		else if (itemId == 10020) {//Ruby Harvest
			//player.getInterfaceManager().releaseRubyHarvest();
			player.setNextAnimation(new Animation(5213));
			player.getInventory().deleteItem(10020, 1);
			player.getInventory().addItem(10012, 1);
			player.setNextGraphics(new Graphics(2302));
			return;
		}
		else if (itemId == 13145) // Ivandis Flail
			player.setNextAnimation(new Animation(7088));
		else if (itemId == 24137 || itemId == 24136 || itemId == 24135) // Morytania legs
			player.getInterfaceManager().TeleportMorytania();
		else if (itemId == 19760 || itemId == 13562) // Morytania legs
			player.getInterfaceManager().TeleportCabbagePatch();
		else if (itemId == 4079)
			player.setNextAnimation(new Animation(1460));
		else if (itemId == 11283) { // DragonBRETH SHIELD empty
			player.setNextAnimation(new Animation(6700));
			player.setNextGraphics(new Graphics(1161));
			return;
		}
	    	else if(itemId == 6865) { //Blue marionette dance
			player.setNextAnimation(new Animation(3006));
			player.setNextGraphics(new Graphics(514));
			return;
	    	}
		else if(itemId == 6866) { //Green marionette dance
			player.setNextAnimation(new Animation(3006));
			player.setNextGraphics(new Graphics(518));
			return;
		}
		else if(itemId == 6867) { //Red marionette dance
			player.setNextAnimation(new Animation(3006));
			player.setNextGraphics(new Graphics(510));
			return;
		}
		else if (itemId == 14062) {// Empty
			player.setNextAnimation(new Animation(10535));
			player.setNextGraphics(new Graphics(1865));
			return;
		} else if (itemId == 6635) { // Commorob v1
			player.setNextAnimation(new Animation(2721));
			player.setNextGraphics(new Graphics(454, 0, 100));
			return;
		} else if (itemId == 9681) { // Commorob v2
			player.setNextAnimation(new Animation(4839));
			player.setNextGraphics(new Graphics(799, 0, 105));
			return;
		}
		else if (itemId == 11283)
			DragonfireShield.empty(player);
		else if (itemId == 15492 || itemId == 13263)
			Slayer.dissasembleSlayerHelmet(player, itemId == 15492);
		else if (Slayer.isBlackMask(itemId)) {
			player.getInventory().replaceItem(8921, 1, slot);
			player.getPackets().sendGameMessage("You remove all the charges from the black mask.");
		}
		//else
			//player.getPackets().sendGameMessage("Nothing interesting happens.");
	}

	public static void handleItemOption7(Player player, int slotId, int itemId, Item item) {
		if (player.isLocked() || player.isStunned() || player.getEmotesManager().isDoingEmote())
			return;
		if (!player.getControlerManager().canDropItem(item))
			return;
		player.stopAll(false);
		if (item.getDefinitions().isDestroyItem()) {
			player.getDialogueManager().startDialogue("DestroyItemOption", slotId, item);
			return;
		}
		if (player.getPetManager().spawnPet(itemId, true))
			return;
		if (item.getId() == 32334) {
			player.getInventory().deleteItem(slotId, item);
			player.getInventory().addItem(slotId, 32334);
			player.getPackets().sendGameMessage("Destorying this is not an option. You will take it and enjoy it.");
			return;
		}
		if (item.getId() == 707 || item.getId() == 703) {
			player.setNextForceTalk(new ForceTalk("Ow! The " + item.getName().toLowerCase() + " exploded!"));
			int damage = item.getId() == 703 ? 350 : 650;
			player.applyHit(new Hit(player, player.getHitpoints() - damage < 35 ? player.getHitpoints() - 35 < 0 ? 0 : player.getHitpoints() - 35 : damage, HitLook.REGULAR_DAMAGE));
			player.setNextAnimation(new Animation(827));
			player.setNextGraphics(new Graphics(954));
			player.getInventory().deleteItem(slotId, item);
			return;
		}
		player.getInventory().deleteItem(slotId, item);
		if (player.getCharges().degradeCompletly(item))
			return;
		if (player.isBeginningAccount()) {
			World.addGroundItem(item, new WorldTile(player), player, true, 60, 2, 0);
		}
		else if (player.getControlerManager().getControler() instanceof Wilderness && ItemConstants.isTradeable(item))
			World.addGroundItem(item, new WorldTile(player), player, false, -1);
		else
			World.addGroundItem(item, new WorldTile(player), player, true, 60);
		Logger.globalLog(player.getUsername(), player.getSession().getIP(), new String(" has dropped item [ id: " + item.getId() + ", amount: " + item.getAmount() + " ]."));
	}

	public static void handleItemOption8(Player player, int slotId, int itemId, Item item) {
		if (itemId >= 15084 && itemId <= 15100)
			Dicing.handleRoll(player, itemId, true);
		player.getInventory().sendExamine(slotId);
	}
}
