Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Over Enchant Protector

Iniciado por Swarlog, Ago 31, 2022, 07:59 PM

Tema anterior - Siguiente tema

Swarlog

Para kickear y mandar a la jail al que supera el enchant max del server.

CitarDebes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

       
for (L2ItemInstance i : activeChar.getInventory().getItems())
        {
            if (!activeChar.isGM())
            {
if (i.isEquipable())
{
               if (i.getEnchantLevel() > Config.ENCHANT_MAX_WEAPON || i.getEnchantLevel() > Config.ENCHANT_MAX_ARMOR || i.getEnchantLevel() > Config.ENCHANT_MAX_JEWELRY)
               {
                //Delete Item Over enchanted
                activeChar.getInventory().destroyItem(null, i, activeChar, null);
                //Message to Player
                                activeChar.sendMessage("[Server]:You have Items over enchanted you will be kikked!");
                //If Audit is only a Kick, with this the player goes in Jail for 1.200 minutes
                activeChar.setPunishLevel(L2PcInstance.PunishLevel.JAIL, 1200);
                                //Punishment e log in audit
                Util.handleIllegalPlayerAction(activeChar, "Player " + activeChar.getName() + " have item Overenchanted ", Config.DEFAULT_PUNISH);
                            //Log in console
                _log.info("#### ATTENCTION ####");
                _log.info(i+" item has been removed from player.");
                }
            }
        }
}

CitarDebes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

buscamos:

if (item.isEquipable())
y abajo de: { ponemos:

               
 if (!activeChar.isGM() && item.getEnchantLevel() > Config.ENCHANT_MAX_WEAPON || item.getEnchantLevel() > Config.ENCHANT_MAX_ARMOR || item.getEnchantLevel() > Config.ENCHANT_MAX_JEWELRY)
                 {
                        activeChar.sendMessage("You have been kicked for using an item overenchanted!");
                        activeChar.closeNetConnection();
                        return;
                 }

Creditos: Nefer