From 376d3aa7894992deee0a30a09a17dbabbd84e7f4 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 16 Apr 2016 16:10:17 +0000 Subject: [PATCH] Ensoul fixes. Contributed by NviX. --- .../model/items/instance/L2ItemInstance.java | 9 +++++++ .../ensoul/RequestItemEnsoul.java | 24 +------------------ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/trunk/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java b/trunk/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java index c167ed78df..70b0884ffb 100644 --- a/trunk/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java +++ b/trunk/java/com/l2jmobius/gameserver/model/items/instance/L2ItemInstance.java @@ -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; diff --git a/trunk/java/com/l2jmobius/gameserver/network/clientpackets/ensoul/RequestItemEnsoul.java b/trunk/java/com/l2jmobius/gameserver/network/clientpackets/ensoul/RequestItemEnsoul.java index a2ff16c2fc..285c62bf29 100644 --- a/trunk/java/com/l2jmobius/gameserver/network/clientpackets/ensoul/RequestItemEnsoul.java +++ b/trunk/java/com/l2jmobius/gameserver/network/clientpackets/ensoul/RequestItemEnsoul.java @@ -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() {