Properties
/GameServer/Settings/Modifications/Modifications.properties
# ========================== #
# Over Enchant #
# ========================== #
# Protection against Corrupt GMs!
# This protection will ban both GM and Edited character
# if a GM tries to enchant a NON GM player above the below value.
EnableOverEnchant = False
# Attention:
# Do not use values smaller than the settings EnchantMaxAllowed
# Ex: EnchantMaxAllowed = 25
# Use values equal to or greater
# GMOverEnchant = 26
GMOverEnchant = 65535
# EnchantMaxAllowed is if any player has bigger enchant gets banned.
# EnchantMax is what max value can be put by scrols.
# Attention:
# Not use values larger than the setting GMOverEnchant
# Ex: GMOverEnchant = 26
# Use values less than or equal
# EnchantMaxAllowed = 25
EnchantMaxAllowedWeapon = 65535
EnchantMaxAllowedArmor = 65535
EnchantMaxAllowedJewelry = 65535
Config Java
GameServer/java/net/sf/l2j/Config.java
public static boolean ENABLE_GM_OVERENCHANT;
public static int GM_OVER_ENCHANT;
public static int ENCHANT_MAX_ALLOWED_WEAPON;
public static int ENCHANT_MAX_ALLOWED_ARMOR;
public static int ENCHANT_MAX_ALLOWED_JEWELRY;
ENABLE_GM_OVERENCHANT = Boolean.parseBoolean(Modifications.getProperty("EnableOverEnchant", "False"));
GM_OVER_ENCHANT = Integer.parseInt(Modifications.getProperty("GMOverEnchant", "65535"));
ENCHANT_MAX_ALLOWED_WEAPON = Integer.parseInt(Modifications.getProperty("EnchantMaxAllowedWeapon", "65535"));
ENCHANT_MAX_ALLOWED_ARMOR = Integer.parseInt(Modifications.getProperty("EnchantMaxAllowedArmor", "65535"));
ENCHANT_MAX_ALLOWED_JEWELRY = Integer.parseInt(Modifications.getProperty("EnchantMaxAllowedJewelry", "65535"));
Client Packets
GameServer/java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.util.Util;
if (Config.ENABLE_GM_OVERENCHANT)
{
for (L2ItemInstance i : activeChar.getInventory().getItems())
{
if (i.isEquipable() && !activeChar.isGM() || !i.isEquipable() && !activeChar.isGM())
{
int itemType2 = i.getItem().getType2();
if (itemType2 == L2Item.TYPE2_WEAPON)
{
if (i.getEnchantLevel() > Config.ENCHANT_MAX_ALLOWED_WEAPON)
{
// 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!");
// 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.");
}
}
if (itemType2 == L2Item.TYPE2_SHIELD_ARMOR)
{
if (i.getEnchantLevel() > Config.ENCHANT_MAX_ALLOWED_ARMOR)
{
// 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!");
// 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.");
}
}
if (itemType2 == L2Item.TYPE2_ACCESSORY)
{
if (i.getEnchantLevel() > Config.ENCHANT_MAX_ALLOWED_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!");
// 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.");
}
}
}
}
}
Credits:RealTek^ L2JInfinity
Linkback: https://l2topzone.com/forum/index.php?topic=811.0