}
if(Rnd.chance(chance))
{
itemToEnchant.setEnchantLevel(itemToEnchant.getEnchantLevel() + 1);
itemToEnchant.updateDatabase();
activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
Log.add(activeChar.getName() + "|Successfully enchanted|" + itemToEnchant.getItemId() + "|to+" + itemToEnchant.getEnchantLevel() + "|" + chance, "enchants");
Log.LogItem(activeChar, Log.EnchantItem, itemToEnchant);
activeChar.sendPacket(EnchantResult.SUCESS);
if(Config.EnableFireworksEnhant && itemToEnchant.getEnchantLevel() >= (itemType == L2Item.TYPE2_WEAPON ? Config.FireworksEnhantWeapon : Config.FireworksEnhantArmor))
{
activeChar.altUseSkill(SkillTable.getInstance().getInfo(21006, 1), activeChar);
activeChar.broadcastPacket(new SystemMessage(SystemMessage.C1_HAS_SUCCESSFULY_ENCHANTED_A__S2_S3).addName(activeChar).addNumber(itemToEnchant.getEnchantLevel()).addItemName(itemToEnchant.getItemId()));
}
}
else
{
Log.add(activeChar.getName() + "|Failed to enchant|" + itemToEnchant.getItemId() + "|+" + itemToEnchant.getEnchantLevel() + "|" + chance, "enchants");
if(scroll.isBlessedEnchantScroll()) // фейл, но заточка блесед
{
itemToEnchant.setEnchantLevel(Config.EnchantFail);
activeChar.sendPacket(new InventoryUpdate().addModifiedItem(itemToEnchant));
activeChar.sendPacket(Msg.FAILED_IN_BLESSED_ENCHANT_THE_ENCHANT_VALUE_OF_THE_ITEM_BECAME_0);
activeChar.sendPacket(EnchantResult.BLESSED_FAILED);
}
else if(scroll.isAncientEnchantScroll()) // фейл, но заточка ancient
{