Im not sure dude, but i think that problem is here
if (Rnd.get(100) < chance)
{
synchronized(item)
{
if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item
|| (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0))
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
Since u got a check for max enchant on a wep/armor for a successful enchant, but not if wasn't successful.
So try to delete check from there and put it above. as i have said before..
if (item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if (Rnd.get(100) < chance)
{
synchronized(item)
{
if (item.getOwnerId() != activeChar.getObjectId() // has just lost the item)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}