package net.sf.l2j.gameserver.handler.voicedcommandhandlers;
import net.sf.l2j.gameserver.data.xml.PlayerLevelData;
import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.model.PlayerLevel;
public class delevel implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS =
{
"delevel"
};
@Override
public boolean useVoicedCommand(String command, Player player, String target)
{
final PlayerLevel pl = PlayerLevelData.getInstance().getPlayerLevel(player.getStatus().getLevel() - 1);
if (command.equalsIgnoreCase("delevel"))
{
player.destroyItemByItemId("Consume", 57, 10000000, player, true);
player.getStatus().removeExpAndSp((player.getStatus().getExp() - pl.getRequiredExpToLevelUp()), 0);
}
return true;
}
@Override
public String[] getVoicedCommandList()
{
return VOICED_COMMANDS;
}
}