Ensoul fixes.

Contributed by NviX.
This commit is contained in:
MobiusDev 2016-04-16 16:10:17 +00:00
parent 8de01b4cd2
commit 376d3aa789
2 changed files with 10 additions and 23 deletions

View File

@ -2388,6 +2388,15 @@ public final class L2ItemInstance extends L2Object
return _commonSoulCrystalOptions;
}
public int getCurrentCommonSAOptions()
{
if (_commonSoulCrystalOptions[0] == null)
{
return 1;
}
return 2;
}
public SoulCrystalOption getSpecialSoulCrystalOption()
{
return _specialSoulCrystalOption;

View File

@ -136,18 +136,13 @@ public class RequestItemEnsoul extends L2GameClientPacket
{
final CrystalType targetItemGrade = targetItem.getItem().getCrystalType();
final int gemstoneId = getGemStoneId(targetItemGrade);
final long count = getGemstoneCount(targetItemGrade, targetItem.getCommonSoulCrystalOptions().length > 0, changing, special);
final long count = getGemstoneCount(targetItemGrade, targetItem.getCurrentCommonSAOptions() == 2, changing, special);
if ((gemstoneId == 0) || (count == 0))
{
return false;
}
if (changing && !special && !available2xCommonOption(targetItemGrade))
{
return false;
}
if ((soulcrystal == null) || (activeChar.getInventory().getInventoryItemCount(soulcrystal.getId(), -1) < 1))
{
return false;
@ -250,23 +245,6 @@ public class RequestItemEnsoul extends L2GameClientPacket
}
}
private static final boolean available2xCommonOption(CrystalType ct)
{
switch (ct)
{
case R:
case R95:
case R99:
{
return true;
}
default:
{
return false;
}
}
}
@Override
public String getType()
{