protect item... [DESISTANCE]

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
morfiuz
Posts: 90
Joined: Sun Sep 19, 2010 5:45 pm
Location: Brasil

protect item... [DESISTANCE]

Post by morfiuz »

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
Last edited by morfiuz on Sun Feb 13, 2011 7:06 am, edited 1 time in total.
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: protect item...

Post by momo61 »

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
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
User avatar
Flashy
Posts: 310
Joined: Mon Sep 29, 2008 11:49 am
Location: Germany

Re: protect item...

Post by Flashy »

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  
User avatar
morfiuz
Posts: 90
Joined: Sun Sep 19, 2010 5:45 pm
Location: Brasil

Re: protect item...

Post by morfiuz »

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
as it is not possible?

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
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: protect item...

Post by UnAfraid »

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  
cant u just use object id :S name can be changed ..
also he can put it on private store sell, trade or mail it ^^
Image
Post Reply