If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4488:
L2JDP Revision 7760:
How can I protect a particular item only one player not to drop, change or destroy?
I know that changing table etcitem it is possible, but the change is for everyone and not just a player.
Thanks
protect item... [DESISTANCE]
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
- morfiuz
- Posts: 90
- Joined: Sun Sep 19, 2010 5:45 pm
- Location: Brasil
protect item... [DESISTANCE]
Last edited by morfiuz on Sun Feb 13, 2011 7:06 am, edited 1 time in total.
- momo61
- Posts: 1648
- Joined: Fri Jun 06, 2008 2:05 pm
- Location: Europe
Re: protect item...
I'm dont think that is possible... (as far as I know)morfiuz wrote:If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 4488:
L2JDP Revision 7760:
How can I protect a particular item only one player not to drop, change or destroy?
I know that changing table etcitem it is possible, but the change is for everyone and not just a player.
Thanks
There are some tables in the items table, called custom_type1 and custom_type2 ... not sure about those though
- Flashy
- Posts: 310
- Joined: Mon Sep 29, 2008 11:49 am
- Location: Germany
Re: protect item...
etcItems? this table was moved out from database to .xml files.
But anyway, u could make a custom Config and add restriction to the requesthandlers in
com.l2jserver.gameserver.network.clientpackets.
- RequestDropItem
- RequestDestroyItem
- RequestSellItem
for example, to don't allow specific player to drop items...
feel free to extend it with item id's
But anyway, u could make a custom Config and add restriction to the requesthandlers in
com.l2jserver.gameserver.network.clientpackets.
- RequestDropItem
- RequestDestroyItem
- RequestSellItem
for example, to don't allow specific player to drop items...
feel free to extend it with item id's
Code: Select all
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java (revision 4488)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java (working copy)@@ -118,7 +118,17 @@ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM)); return; }- + if(Config.DISCARDITEM_RESTRICTION.length > 1)+ {+ for(String st : Config.DISCARDITEM_RESTRICTION)+ {+ if(activeChar.getName().toLowerCase().contains(st.toLowerCase()))+ {+ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));+ return;+ }+ }+ } if (!itemToRemove.isStackable() && count > 1) { Util.handleIllegalPlayerAction(activeChar, "[RequestDestroyItem] Character " + activeChar.getName() + " of account " + activeChar.getAccountName() + " tried to destroy a non-stackable item with oid " + _objectId + " but has count > 1!", Config.DEFAULT_PUNISH);Index: java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java (revision 4488)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java (working copy)@@ -80,6 +80,17 @@ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM)); return; }+ if(Config.DISCARDITEM_RESTRICTION.length > 1)+ {+ for(String st : Config.DISCARDITEM_RESTRICTION)+ {+ if(activeChar.getName().toLowerCase().contains(st.toLowerCase()))+ {+ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));+ return;+ }+ }+ } if (item.isQuestItem() && !(activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) { return;Index: java/com/l2jserver/Config.java===================================================================--- java/com/l2jserver/Config.java (revision 4488)+++ java/com/l2jserver/Config.java (working copy)@@ -1014,6 +1014,8 @@ //chatfilter public static ArrayList<String> FILTER_LIST;++ public static String[] DISCARDITEM_RESTRICTION; /** * This class initializes all global variables for configuration.<br>@@ -1817,6 +1819,7 @@ DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20")); RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False")); ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));+ DISCARDITEM_RESTRICTION = General.getProperty("PlayerDropRestiction", "abc").split(","); AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600")); HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000; String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");Index: java/config/General.properties===================================================================--- java/config/General.properties (revision 4488)+++ java/config/General.properties (working copy)@@ -246,6 +246,11 @@ # Default: True AllowDiscardItem = True +# Character Drop restriction+# Disallow characters to discard items which contains in this list.+# Split them with ",". Example: player1,player2,...+PlayerDropRestiction = abc, cdf+ # Delete dropped reward items from world after a specified amount of seconds. Disabled = 0. # Default: 600 AutoDestroyDroppedItemAfter = 600
- morfiuz
- Posts: 90
- Joined: Sun Sep 19, 2010 5:45 pm
- Location: Brasil
Re: protect item...
as it is not possible?momo61 wrote: I'm dont think that is possible... (as far as I know)
There are some tables in the items table, called custom_type1 and custom_type2 ... not sure about those though
I even know lineage 2 servers that use it!
I just do not know where to start to do that.
Flashy
I will look into this possibility. thanks
- UnAfraid
- L2j Veteran
- Posts: 4199
- Joined: Mon Jul 23, 2007 4:25 pm
- Location: Bulgaria
- Contact:
Re: protect item...
cant u just use object id :S name can be changed ..Flashy wrote:etcItems? this table was moved out from database to .xml files.
But anyway, u could make a custom Config and add restriction to the requesthandlers in
com.l2jserver.gameserver.network.clientpackets.
- RequestDropItem
- RequestDestroyItem
- RequestSellItem
for example, to don't allow specific player to drop items...
feel free to extend it with item id's
Code: Select all
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java (revision 4488)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestDestroyItem.java (working copy)@@ -118,7 +118,17 @@ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM)); return; }- + if(Config.DISCARDITEM_RESTRICTION.length > 1)+ {+ for(String st : Config.DISCARDITEM_RESTRICTION)+ {+ if(activeChar.getName().toLowerCase().contains(st.toLowerCase()))+ {+ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));+ return;+ }+ }+ } if (!itemToRemove.isStackable() && count > 1) { Util.handleIllegalPlayerAction(activeChar, "[RequestDestroyItem] Character " + activeChar.getName() + " of account " + activeChar.getAccountName() + " tried to destroy a non-stackable item with oid " + _objectId + " but has count > 1!", Config.DEFAULT_PUNISH);Index: java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java (revision 4488)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestDropItem.java (working copy)@@ -80,6 +80,17 @@ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM)); return; }+ if(Config.DISCARDITEM_RESTRICTION.length > 1)+ {+ for(String st : Config.DISCARDITEM_RESTRICTION)+ {+ if(activeChar.getName().toLowerCase().contains(st.toLowerCase()))+ {+ activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.CANNOT_DISCARD_THIS_ITEM));+ return;+ }+ }+ } if (item.isQuestItem() && !(activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) { return;Index: java/com/l2jserver/Config.java===================================================================--- java/com/l2jserver/Config.java (revision 4488)+++ java/com/l2jserver/Config.java (working copy)@@ -1014,6 +1014,8 @@ //chatfilter public static ArrayList<String> FILTER_LIST;++ public static String[] DISCARDITEM_RESTRICTION; /** * This class initializes all global variables for configuration.<br>@@ -1817,6 +1819,7 @@ DEADLOCK_CHECK_INTERVAL = Integer.parseInt(General.getProperty("DeadLockCheckInterval", "20")); RESTART_ON_DEADLOCK = Boolean.parseBoolean(General.getProperty("RestartOnDeadlock", "False")); ALLOW_DISCARDITEM = Boolean.parseBoolean(General.getProperty("AllowDiscardItem", "True"));+ DISCARDITEM_RESTRICTION = General.getProperty("PlayerDropRestiction", "abc").split(","); AUTODESTROY_ITEM_AFTER = Integer.parseInt(General.getProperty("AutoDestroyDroppedItemAfter", "600")); HERB_AUTO_DESTROY_TIME = Integer.parseInt(General.getProperty("AutoDestroyHerbTime","60"))*1000; String[] split = General.getProperty("ListOfProtectedItems", "0").split(",");Index: java/config/General.properties===================================================================--- java/config/General.properties (revision 4488)+++ java/config/General.properties (working copy)@@ -246,6 +246,11 @@ # Default: True AllowDiscardItem = True +# Character Drop restriction+# Disallow characters to discard items which contains in this list.+# Split them with ",". Example: player1,player2,...+PlayerDropRestiction = abc, cdf+ # Delete dropped reward items from world after a specified amount of seconds. Disabled = 0. # Default: 600 AutoDestroyDroppedItemAfter = 600
also he can put it on private store sell, trade or mail it ^^