Page 1 of 1
Mail untradable items?
Posted: Sat Sep 11, 2010 4:59 pm
by Pandragon
L2J Revision: 4413
L2JDP Revision: 7664
I know that GMs can trade untradable items by...
General.properties
GMTradeRestrictedItems = True
...but when you try to send item by mail, you can't attach an untradable item.
Anyone know how to do it?
Expected to be added on a next server revision?
Re: Mail untradable items?
Posted: Sat Sep 11, 2010 5:43 pm
by SolidSnake
Try this patch,
BE WARNED: isn't tested..
Code: Select all
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java (revision 4415)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java (working copy)@@ -279,5 +279,97 @@ if (_items != null) { for (AttachmentItem i : _items) { // Check validity of requested item L2ItemInstance item = player.checkItemManipulation(i.getObjectId(), i.getCount(), "attach");- if (item == null || !item.isTradeable() || item.isEquipped())+ if (item == null || !(item.isTradeable() || (activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) || item.isEquipped()) { player.sendPacket(new SystemMessage(SystemMessageId.CANT_FORWARD_BAD_ITEM)); return false; } fee += MESSAGE_FEE_PER_SLOT;@@ -315,4 +315,99 @@ for (AttachmentItem i : _items) { // Check validity of requested item L2ItemInstance oldItem = player.checkItemManipulation(i.getObjectId(), i.getCount(), "attach");- if (oldItem == null || !oldItem.isTradeable() || oldItem.isEquipped())+ if (oldItem == null || !(oldItem.isTradeable() || (activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) || oldItem.isEquipped()) { _log.warning("Error adding attachment for char "+player.getName()+" (olditem == null)"); return false; }Index: java/config/General.properties===================================================================--- java/config/General.properties (revision 4415)+++ java/config/General.properties (working copy)@@ -79,1 +79,17 @@# Default: TrueGMSkillRestriction = True -# Allow GMs to drop/trade non-tradeable and quest(drop only) items+# Allow GMs to drop/trade/send mail with non-tradeable and quest (drop only) items# Default: FalseGMTradeRestrictedItems = False # Allow GMs to restart/exit while is fighting stance
I hope it works

Re: Mail untradable items?
Posted: Sat Sep 11, 2010 6:01 pm
by Probe
I think your patch is wrong. should be:
Code: Select all
Index: java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java===================================================================--- java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java (revision 4415)+++ java/com/l2jserver/gameserver/network/clientpackets/RequestSendPost.java (working copy)@@ -279,5 +279,97 @@ if (_items != null) { for (AttachmentItem i : _items) { // Check validity of requested item L2ItemInstance item = player.checkItemManipulation(i.getObjectId(), i.getCount(), "attach");- if (item == null || !item.isTradeable() || item.isEquipped())+ if (item == null || (!item.isTradeable() || (item.isTradeable() && player.isGM() && !Config.GM_TRADE_RESTRICTED_ITEMS)) || item.isEquipped()) { player.sendPacket(new SystemMessage(SystemMessageId.CANT_FORWARD_BAD_ITEM)); return false; } fee += MESSAGE_FEE_PER_SLOT;@@ -315,4 +315,99 @@ for (AttachmentItem i : _items) { // Check validity of requested item L2ItemInstance oldItem = player.checkItemManipulation(i.getObjectId(), i.getCount(), "attach");- if (oldItem == null || !oldItem.isTradeable() || oldItem.isEquipped())+ if (oldItem == null || !(oldItem.isTradeable() || (activeChar.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) || oldItem.isEquipped()) { _log.warning("Error adding attachment for char "+player.getName()+" (olditem == null)"); return false; }Index: java/config/General.properties===================================================================--- java/config/General.properties (revision 4415)+++ java/config/General.properties (working copy)@@ -79,1 +79,17 @@# Default: TrueGMSkillRestriction = True -# Allow GMs to drop/trade non-tradeable and quest(drop only) items+# Allow GMs to drop/trade/send mail with non-tradeable and quest (drop only) items# Default: FalseGMTradeRestrictedItems = False # Allow GMs to restart/exit while is fighting stance
Re: Mail untradable items?
Posted: Sat Sep 11, 2010 6:12 pm
by SolidSnake
Mine:
if item is null or item isn't tradeable or active char isn't gm and Config GM_TRADE_RESTRICTED_ITEMS is false or item is equipped, send packet
Yours:
if item is null or item isn't tradeable or item is tradeable and
player (
active Char) is gm and Config GM_TRADE_RESTRICTED_ITEMS is false or item is equipped, send packet
I think that my patch is easiest than yours but are both good

Re: Mail untradable items?
Posted: Sat Sep 11, 2010 6:28 pm
by Naonah
SolidSnake wrote:Mine:
if item is null or item isn't tradeable or active char isn't gm and Config GM_TRADE_RESTRICTED_ITEMS is false or item is equipped, send packet
Yours:
if item is null or item isn't tradeable or item is tradeable and
player (
active Char) is gm and Config GM_TRADE_RESTRICTED_ITEMS is false or item is equipped, send packet
I think that my patch is easiest than yours but are both good

btw: another codes worth commiting cuz it is essential
Re: Mail untradable items?
Posted: Sat Sep 11, 2010 8:15 pm
by Pandragon
Naonah wrote:
btw: another codes worth commiting cuz it is essential
+1
ty, great job.
Re: Mail untradable items?
Posted: Fri Feb 11, 2011 8:46 pm
by Starter
I dont get it working with the codes above and my own test-codes.. Someone else got a working code or is it only me? :S
Re: Mail untradable items?
Posted: Fri Feb 11, 2011 11:24 pm
by feather56
Starter wrote:I dont get it working with the codes above and my own test-codes.. Someone else got a working code or is it only me? :S
same here
Re: Mail untradable items?
Posted: Sat Feb 12, 2011 2:19 pm
by Starter
Noone? :S