{
activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT)); // incorrect
return false;
}
final L2PlayableInstance targetPlayer = (L2PlayableInstance) targetChar;
final byte lvl = Byte.parseByte(val);
int max_level = ExperienceData.getInstance().getMaxLevel();
if(targetChar instanceof L2PcInstance && ((L2PcInstance) targetPlayer).isSubClassActive())
{
max_level = Config.MAX_SUBCLASS_LEVEL;
}
if(lvl >= 1 && lvl <= max_level)
{
final long pXp = targetPlayer.getStat().getExp();
final long tXp = ExperienceData.getInstance().getExpForLevel(lvl);
if(pXp > tXp)
{
targetPlayer.getStat().removeExpAndSp(pXp - tXp, 0);
}
else if(pXp < tXp)
{
targetPlayer.getStat().addExpAndSp(tXp - pXp, 0);
}
}
else
{
activeChar.sendMessage("You must specify level between 1 and " + ExperienceData.getInstance().getMaxLevel() + ".");