Fixed chest key issues.

This commit is contained in:
MobiusDevelopment
2020-09-01 21:49:58 +00:00
parent 22385c6944
commit b5596e480c
6 changed files with 26 additions and 32 deletions

View File

@@ -53,7 +53,6 @@ public class ChestKey implements IItemHandler
final PlayerInstance player = (PlayerInstance) playable;
final int itemId = item.getItemId();
final Skill skill = SkillTable.getInstance().getSkill(2229, itemId - 6664); // box key skill
final WorldObject target = player.getTarget();
if (!(target instanceof ChestInstance))
{
@@ -65,11 +64,12 @@ public class ChestKey implements IItemHandler
final ChestInstance chest = (ChestInstance) target;
if (chest.isDead() || chest.isInteracted())
{
player.sendMessage("The chest Is empty.");
player.sendMessage("The chest is empty.");
player.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
final Skill skill = SkillTable.getInstance().getSkill(2229, itemId - 6664); // box key skill
player.useMagic(skill, false, false);
}
}

View File

@@ -17,7 +17,6 @@
package org.l2jmobius.gameserver.handler.skillhandlers;
import java.util.List;
import java.util.logging.Logger;
import org.l2jmobius.gameserver.handler.ISkillHandler;
import org.l2jmobius.gameserver.model.Skill;
@@ -30,8 +29,6 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class DeluxeKey implements ISkillHandler
{
private static final Logger LOGGER = Logger.getLogger(DeluxeKey.class.getName());
private static final SkillType[] SKILL_IDS =
{
SkillType.DELUXE_KEY_UNLOCK
@@ -45,14 +42,11 @@ public class DeluxeKey implements ISkillHandler
return;
}
final List<Creature> targetList = skill.getTargetList(creature);
if (targetList == null)
if (skill.getTargetList(creature) == null)
{
return;
}
LOGGER.info("Delux key casting succeded.");
// This is just a dummy skill handler for the golden food and crystal food skills, since the AI responce onSkillUse handles the rest.
}