Item use improvements.
This commit is contained in:
@@ -8473,8 +8473,12 @@ public final class L2PcInstance extends L2Playable
|
||||
// In case of double casting, check if both slots are occupied, then queue skill.
|
||||
if ((!doubleCast && isCastingNow(SkillCaster::isAnyNormalType)) || (isCastingNow(s -> s.getCastingType() == SkillCastingType.NORMAL) && isCastingNow(s -> s.getCastingType() == SkillCastingType.NORMAL_SECOND)))
|
||||
{
|
||||
// Create a new SkillDat object and queue it in the player _queuedSkill
|
||||
setQueuedSkill(skill, item, forceUse, dontMove);
|
||||
// Do not queue skill if called by an item.
|
||||
if (item == null)
|
||||
{
|
||||
// Create a new SkillDat object and queue it in the player _queuedSkill
|
||||
setQueuedSkill(skill, item, forceUse, dontMove);
|
||||
}
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ import com.l2jmobius.gameserver.model.holders.ItemSkillHolder;
|
||||
import com.l2jmobius.gameserver.model.items.L2EtcItem;
|
||||
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.network.L2GameClient;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
@@ -100,7 +101,7 @@ public final class UseItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.getItem().getType2() == L2Item.TYPE2_QUEST)
|
||||
if (item.isQuestItem() && (item.getItem().getDefaultAction() != ActionType.NONE))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_QUEST_ITEMS);
|
||||
return;
|
||||
@@ -166,6 +167,13 @@ public final class UseItem implements IClientIncomingPacket
|
||||
}
|
||||
}
|
||||
|
||||
// If item's default action is to show html, show item's main html.
|
||||
if (item.getItem().getDefaultAction() == ActionType.SHOW_HTML)
|
||||
{
|
||||
item.onBypassFeedback(activeChar, null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.isEquipable())
|
||||
{
|
||||
// Don't allow to put formal wear while a cursed weapon is equipped.
|
||||
|
Reference in New Issue
Block a user