@Override
	public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet)
	{
		if (npc instanceof L2ChestInstance)
		{
			// This behavior is only run when the target of skill is the passed npc.
			if (!Util.contains(targets, npc))
				return super.onSkillSee(npc, caster, skill, targets, isPet);
			
			final L2ChestInstance chest = ((L2ChestInstance) npc);
			
			// If this chest has already been interacted, no further AI decisions are needed.
			if (!chest.isInteracted())
			{
				chest.setInteracted();
				
				// If it's the first interaction, check if this is a box or mimic.
				if (Rnd.get(100) < IS_BOX)
				{
					if (skill.getId() == SKILL_DELUXE_KEY)
					{
						// check the chance to open the box
						int keyLevelNeeded = (chest.getLevel() / 10) - skill.getLevel();
						if (keyLevelNeeded < 0)
							keyLevelNeeded *= -1;
						
						final int chance = BASE_CHANCE - keyLevelNeeded * LEVEL_DECREASE;
						
						// Success, die with rewards.
						if (Rnd.get(100) < chance)
						{
							chest.setSpecialDrop();
							chest.doDie(caster);
						}
						// Used a key but failed to open: disappears with no rewards.
						else
							chest.deleteMe(); // TODO: replace for a better system (as chests attack once before decaying)
					}
					else
						chest.doCast(SkillTable.getInstance().getInfo(4143, Math.min(10, Math.round(npc.getLevel() / 10))));
				}
				// Mimic behavior : attack the caster.
				else
					attack(chest, ((isPet) ? caster.getPet() : caster));
			}
		}
		return super.onSkillSee(npc, caster, skill, targets, isPet);
	}