diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java index 4811702e93..8feeae7db6 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/effecthandlers/CreateItemRandom.java @@ -25,6 +25,7 @@ import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.effects.AbstractEffect; import com.l2jmobius.gameserver.model.holders.ItemChanceHolder; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.model.items.type.ActionType; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -83,6 +84,9 @@ public class CreateItemRandom extends AbstractEffect return; } - player.addItem("CreateItems", selectedItem.getId(), selectedItem.getCount(), player, true); + if ((item.getItem().getDefaultAction() != ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS) || player.destroyItem("Consume", item.getObjectId(), 1, player, true)) + { + player.addItem("CreateItems", selectedItem.getId(), selectedItem.getCount(), player, true); + } } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/ItemSkillsTemplate.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/ItemSkillsTemplate.java index ff2bf1f30a..194bfb67dc 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/ItemSkillsTemplate.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/itemhandlers/ItemSkillsTemplate.java @@ -173,12 +173,16 @@ public class ItemSkillsTemplate implements IItemHandler { case CAPSULE: case SKILL_REDUCE: - case SKILL_REDUCE_ON_SKILL_SUCCESS: { if (!hasConsumeSkill && item.getItem().hasImmediateEffect()) { return true; } + break; + } + case SKILL_REDUCE_ON_SKILL_SUCCESS: + { + return false; } } return hasConsumeSkill; diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java index 0f6cec7164..8184d59bb2 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/skills/SkillCaster.java @@ -319,7 +319,7 @@ public class SkillCaster implements Runnable } // Consume the required items. Should happen after use message is displayed and SetupGauge - if ((_skill.getItemConsumeId() > 0) && (_skill.getItemConsumeCount() > 0) && !((_item != null) && (_item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE))) + if ((_skill.getItemConsumeId() > 0) && (_skill.getItemConsumeCount() > 0) && !((_item != null) && ((_item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE) || (_item.getItem().getDefaultAction() == ActionType.SKILL_REDUCE_ON_SKILL_SUCCESS)))) { if (!caster.destroyItemByItemId(_skill.toString(), _skill.getItemConsumeId(), _skill.getItemConsumeCount(), null, true)) {