MAX_ITEM_ENCHANT_KICK = Integer.parseInt(ENCHANTSetting.getProperty("EnchantKick", "0"));
GM_OVER_ENCHANT = Integer.parseInt(ENCHANTSetting.getProperty("GMOverEnchant", "0"));
// SECURE FIX - Anti Overenchant Cheat!!
if(Config.MAX_ITEM_ENCHANT_KICK >0)
{
for (L2ItemInstance i : activeChar.getInventory().getItems())
{
if (!activeChar.isGM())
{
if (i.isEquipable())
{
if (i.getEnchantLevel() > Config.MAX_ITEM_ENCHANT_KICK)
{
//Delete Item Over enchanted
activeChar.getInventory().destroyItem(null, i, activeChar, null);
//Message to Player
activeChar.sendMessage("[server]: You have over enchanted items you will be kicked from server!");
activeChar.sendMessage("[server]: Respect our server rules.");
//Message with screen
sendPacket(new ExShowScreenMessage(" You have an over enchanted item, you will be kicked from server! ", 6000));
//Punishment e log in audit
Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " has Overenchanted item! Kicked! ", Config.DEFAULT_PUNISH);
//Logger in console
_log.info("#### ATTENTION ####");
_log.info(i+" item has been removed from "+activeChar);
}
}
}
}
}