diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index bbe38daee3..6176ff2298 100644 --- a/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_C6_Interlude/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -23,6 +23,7 @@ import com.l2jmobius.gameserver.datatables.GmListTable; import com.l2jmobius.gameserver.instancemanager.CursedWeaponsManager; import com.l2jmobius.gameserver.model.actor.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance.SkillDat; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; import com.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; @@ -167,10 +168,12 @@ public final class RequestDropItem extends L2GameClientPacket return; } - // Cannot discard item that the skill is consumming + // Cannot discard item that the skill is consuming. if (activeChar.isCastingNow()) { - if ((activeChar.getCurrentSkill() != null) && (activeChar.getCurrentSkill().getSkill().getItemConsumeId() == item.getItemId())) + final SkillDat skillDat = activeChar.getCurrentSkill(); + if ((skillDat != null) && (skillDat.getSkill().getItemConsumeId() == item.getItemId()) // + && ((activeChar.getInventory().getInventoryItemCount(item.getItemId(), -1) - skillDat.getSkill().getItemConsume()) < _count)) { activeChar.sendPacket(SystemMessageId.CANNOT_DISCARD_THIS_ITEM); return; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 63d1b284a1..1399af367c 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -22,10 +22,12 @@ import com.l2jmobius.gameserver.data.xml.impl.AdminData; import com.l2jmobius.gameserver.enums.PrivateStoreType; import com.l2jmobius.gameserver.model.PcCondOverride; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.holders.SkillUseHolder; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.model.items.type.EtcItemType; +import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -136,20 +138,24 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming + // Cannot discard item that the skill is consuming. if (activeChar.isCastingNow()) { - if ((activeChar.getCurrentSkill() != null) && (activeChar.getCurrentSkill().getSkill().getItemConsumeId() == item.getId())) + final SkillUseHolder skill = activeChar.getCurrentSkill(); + if ((skill != null) && (skill.getSkill().getItemConsumeId() == item.getId()) // + && ((activeChar.getInventory().getInventoryItemCount(item.getId(), -1) - skill.getSkill().getItemConsumeCount()) < _count)) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DISCARDED); return; } } - // Cannot discard item that the skill is consuming + // Cannot discard item that the skill is consuming. if (activeChar.isCastingSimultaneouslyNow()) { - if ((activeChar.getLastSimultaneousSkillCast() != null) && (activeChar.getLastSimultaneousSkillCast().getItemConsumeId() == item.getId())) + final Skill skill = activeChar.getLastSimultaneousSkillCast(); + if ((skill != null) && (skill.getItemConsumeId() == item.getId()) // + && ((activeChar.getInventory().getInventoryItemCount(item.getId(), -1) - skill.getItemConsumeCount()) < _count)) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DISCARDED); return; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 1c4f6ba529..2fad10a481 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java index 926479e8be..07213c776f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/network/clientpackets/RequestDropItem.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.itemcontainer.Inventory; import com.l2jmobius.gameserver.model.items.L2Item; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.items.type.EtcItemType; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.L2GameClient; @@ -140,8 +141,8 @@ public final class RequestDropItem implements IClientIncomingPacket return; } - // Cannot discard item that the skill is consuming - if (activeChar.isCastingNow(s -> s.getSkill().getItemConsumeId() == item.getId())) + // Cannot discard item that the skill is consuming. + if (activeChar.isCastingNow(s -> (s.getSkill().getItemConsumeId() == item.getId()) && (item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS))) { activeChar.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_DESTROYED); return;