Weight limit check for extractable items.
This commit is contained in:
parent
937a2006a6
commit
c579e8a7d8
@ -19,6 +19,7 @@ package handlers.effecthandlers;
|
||||
import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@ -80,4 +81,10 @@ public final class Restoration extends AbstractEffect
|
||||
effected.getActingPlayer().sendPacket(new PetItemList(effected.getInventory().getItems()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2EffectType getEffectType()
|
||||
{
|
||||
return L2EffectType.EXTRACT_ITEM;
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import com.l2jmobius.gameserver.model.StatsSet;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import com.l2jmobius.gameserver.model.effects.L2EffectType;
|
||||
import com.l2jmobius.gameserver.model.holders.ItemHolder;
|
||||
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
|
||||
import com.l2jmobius.gameserver.model.skills.Skill;
|
||||
@ -104,4 +105,10 @@ public final class RestorationRandom extends AbstractEffect
|
||||
player.addItem("Extract", createdItem.getId(), (long) (createdItem.getCount() * Config.RATE_EXTRACTABLE), effector, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2EffectType getEffectType()
|
||||
{
|
||||
return L2EffectType.EXTRACT_ITEM;
|
||||
}
|
||||
}
|
||||
|
@ -57,6 +57,12 @@ public class ExtractableItems implements IItemHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!activeChar.isInventoryUnder80(false))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_VE_EXCEEDED_THE_LIMIT_AND_CANNOT_RETRIEVE_THE_ITEM_PLEASE_CHECK_YOUR_LIMIT_IN_THE_INVENTORY);
|
||||
return false;
|
||||
}
|
||||
|
||||
// destroy item
|
||||
if (!activeChar.destroyItem("Extract", item.getObjectId(), 1, activeChar, true))
|
||||
{
|
||||
|
@ -57,6 +57,12 @@ public class FatedSupportBox implements IItemHandler
|
||||
final Race race = player.getRace();
|
||||
final ClassId classId = player.getClassId();
|
||||
|
||||
if (!player.isInventoryUnder80(false))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_VE_EXCEEDED_THE_LIMIT_AND_CANNOT_RETRIEVE_THE_ITEM_PLEASE_CHECK_YOUR_LIMIT_IN_THE_INVENTORY);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Characters that have gone through their 2nd class transfer/1st liberation will be able to open the Fated Support Box at level 40.
|
||||
if ((player.getLevel() < 40) || player.isInCategory(CategoryType.FIRST_CLASS_GROUP) || ((race != Race.ERTHEIA) && player.isInCategory(CategoryType.SECOND_CLASS_GROUP)))
|
||||
{
|
||||
|
@ -79,6 +79,13 @@ public class ItemSkillsTemplate implements IItemHandler
|
||||
|
||||
if (itemSkill != null)
|
||||
{
|
||||
|
||||
if (itemSkill.hasEffectType(L2EffectType.EXTRACT_ITEM) && (playable.getActingPlayer() != null) && !playable.getActingPlayer().isInventoryUnder80(false))
|
||||
{
|
||||
playable.getActingPlayer().sendPacket(SystemMessageId.YOU_VE_EXCEEDED_THE_LIMIT_AND_CANNOT_RETRIEVE_THE_ITEM_PLEASE_CHECK_YOUR_LIMIT_IN_THE_INVENTORY);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemSkill.getItemConsumeId() > 0)
|
||||
{
|
||||
hasConsumeSkill = true;
|
||||
|
@ -12696,7 +12696,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if player inventory is under 90% capaity
|
||||
* Test if player inventory is under 90% capacity
|
||||
* @param includeQuestInv check also quest inventory
|
||||
* @return
|
||||
*/
|
||||
@ -12706,7 +12706,7 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if player inventory is under 80% capaity
|
||||
* Test if player inventory is under 80% capacity
|
||||
* @param includeQuestInv check also quest inventory
|
||||
* @return
|
||||
*/
|
||||
|
@ -32,6 +32,7 @@ public enum L2EffectType
|
||||
MAGICAL_DMG_OVER_TIME,
|
||||
DEATH_LINK,
|
||||
BLOCK_CONTROL,
|
||||
EXTRACT_ITEM,
|
||||
FISHING,
|
||||
FISHING_START,
|
||||
HATE,
|
||||
|
Loading…
Reference in New Issue
Block a user