Prohibit using items while jailed.

Contributed by Sero.
This commit is contained in:
MobiusDevelopment
2020-11-23 22:24:05 +00:00
parent bc74e23738
commit b0b753586a
21 changed files with 149 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -41,6 +41,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -77,6 +78,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -35,6 +35,7 @@ import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.Weapon; import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.WeaponType; import org.l2jmobius.gameserver.model.items.type.WeaponType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate; import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
@@ -115,6 +116,13 @@ public class UseItem extends GameClientPacket
{ {
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping()) if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping())
{ {
player.sendMessage("You cannot use items right now."); player.sendMessage("You cannot use items right now.");

View File

@@ -35,6 +35,7 @@ import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.Weapon; import org.l2jmobius.gameserver.model.items.Weapon;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.WeaponType; import org.l2jmobius.gameserver.model.items.type.WeaponType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
import org.l2jmobius.gameserver.network.serverpackets.EtcStatusUpdate; import org.l2jmobius.gameserver.network.serverpackets.EtcStatusUpdate;
@@ -116,6 +117,13 @@ public class UseItem extends GameClientPacket
{ {
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping()) if (player.isStunned() || player.isConfused() || player.isParalyzed() || player.isSleeping())
{ {
player.sendMessage("You cannot use items right now."); player.sendMessage("You cannot use items right now.");

View File

@@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ArmorType; import org.l2jmobius.gameserver.model.items.type.ArmorType;
import org.l2jmobius.gameserver.model.items.type.WeaponType; import org.l2jmobius.gameserver.model.items.type.WeaponType;
import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -78,6 +79,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ArmorType; import org.l2jmobius.gameserver.model.items.type.ArmorType;
import org.l2jmobius.gameserver.model.items.type.WeaponType; import org.l2jmobius.gameserver.model.items.type.WeaponType;
import org.l2jmobius.gameserver.model.skills.Skill; import org.l2jmobius.gameserver.model.skills.Skill;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -78,6 +79,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -40,6 +40,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -75,6 +76,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -41,6 +41,7 @@ import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.items.type.CrystalType; import org.l2jmobius.gameserver.model.items.type.CrystalType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -76,6 +77,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();

View File

@@ -41,6 +41,7 @@ import org.l2jmobius.gameserver.model.items.EtcItem;
import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.ActionType; import org.l2jmobius.gameserver.model.items.type.ActionType;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.network.GameClient; import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.ActionFailed; import org.l2jmobius.gameserver.network.serverpackets.ActionFailed;
@@ -77,6 +78,12 @@ public class UseItem implements IClientIncomingPacket
return; return;
} }
if (player.isInsideZone(ZoneId.JAIL))
{
player.sendMessage("You cannot use items while jailed.");
return;
}
if (player.getActiveTradeList() != null) if (player.getActiveTradeList() != null)
{ {
player.cancelActiveTrade(); player.cancelActiveTrade();