EnterWorld.java
Something like this (i am from phone atm, can't search for the exact methods and etc). Try to do it by yourself, wont be hard.
private boolean hasOverEnchantedItems(L2PcInstance player, int enchantLimit)
{
For (L2ItemInstance item : player.getInventory.getAllItems())
{
if (item.getEnchantLevel() > enchantLimit)
//player has over enchanted items
return true;
}
return false;
Now return in main method of EnterWorld.java and add this somewhere
if (hasOverEnchantedItems(activeChar,20) //more than +20, banned
{
// JAIL - BAN
// Steal code from admin commands
}
Note: This is going to be kinda slow and add some weight to your server... So, there might be another method than getAllItems() which returns only the armors or the weapons (for example getWeapons()). Try to search a little bit...Also, i would give a try to search how an item is added into the game, aka the constructor of L2itemInstance, where and when it is called. You could add a check into this constructor, but this is going to be kinda hard for you (dont wanna offend you, but the thing you ask gives me the clue you are new to this :)), since it might want some research before you do it...