Proper instant extract for stackable items.
This commit is contained in:
@@ -23,6 +23,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
@@ -108,7 +109,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
@@ -156,7 +157,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
|
@@ -23,6 +23,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
@@ -108,7 +109,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
@@ -156,7 +157,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
|
@@ -23,6 +23,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
@@ -108,7 +109,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
@@ -156,7 +157,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
|
@@ -19,6 +19,7 @@ package handlers.itemhandlers;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
@@ -72,7 +73,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, true);
|
activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, true);
|
||||||
}
|
}
|
||||||
|
@@ -23,6 +23,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.Rnd;
|
import com.l2jmobius.commons.util.Rnd;
|
||||||
|
import com.l2jmobius.gameserver.datatables.ItemTable;
|
||||||
import com.l2jmobius.gameserver.handler.IItemHandler;
|
import com.l2jmobius.gameserver.handler.IItemHandler;
|
||||||
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
import com.l2jmobius.gameserver.model.L2ExtractableProduct;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
import com.l2jmobius.gameserver.model.actor.L2Playable;
|
||||||
@@ -108,7 +109,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
@@ -156,7 +157,7 @@ public class ExtractableItems implements IItemHandler
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.isStackable() || (createItemAmount == 1))
|
if (ItemTable.getInstance().getTemplate(expi.getId()).isStackable() || (createItemAmount == 1))
|
||||||
{
|
{
|
||||||
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
final L2ItemInstance newItem = activeChar.addItem("Extract", expi.getId(), createItemAmount, activeChar, false);
|
||||||
if (expi.getMaxEnchant() > 0)
|
if (expi.getMaxEnchant() > 0)
|
||||||
|
Reference in New Issue
Block a user