Sync with L2jServer HighFive Aug 29th 2015.

This commit is contained in:
MobiusDev
2015-08-29 20:31:27 +00:00
parent ac04922328
commit 2bfc469d74
185 changed files with 1555 additions and 62 deletions

View File

@ -352,13 +352,6 @@ public final class RequestEnchantItem extends L2GameClientPacket
else
{
// enchant failed, destroy item
int crystalId = item.getItem().getCrystalItemId();
int count = item.getCrystalCount() - ((item.getItem().getCrystalCount() + 1) / 2);
if (count < 1)
{
count = 1;
}
if (activeChar.getInventory().destroyItem("Enchant", item, activeChar, null) == null)
{
// unable to destroy item, cheater ?
@ -383,24 +376,23 @@ public final class RequestEnchantItem extends L2GameClientPacket
}
L2World.getInstance().removeObject(item);
L2ItemInstance crystals = null;
if (crystalId != 0)
final int crystalId = item.getItem().getCrystalItemId();
if ((crystalId != 0) && item.getItem().isCrystallizable())
{
crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, item);
int count = item.getCrystalCount() - ((item.getItem().getCrystalCount() + 1) / 2);
count = count < 1 ? 1 : count;
activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, item);
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
sm.addItemName(crystals);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
sm.addItemName(crystalId);
sm.addLong(count);
activeChar.sendPacket(sm);
}
if (crystalId == 0)
{
activeChar.sendPacket(new EnchantResult(EnchantResult.NO_CRYSTAL, 0, 0));
activeChar.sendPacket(new EnchantResult(EnchantResult.NO_CRYSTAL, crystalId, count));
}
else
{
activeChar.sendPacket(new EnchantResult(EnchantResult.FAIL, crystalId, count));
activeChar.sendPacket(new EnchantResult(EnchantResult.FAIL, 0, 0));
}
if (Config.LOG_ITEM_ENCHANTS)