Mail untradable items?

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
Pandragon
Posts: 704
Joined: Tue Jul 26, 2005 7:38 pm

Mail untradable items?

Post 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?
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Mail untradable items?

Post 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 :)
Image
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: Mail untradable items?

Post 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
User avatar
SolidSnake
Posts: 865
Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy

Re: Mail untradable items?

Post 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 :)
Image
User avatar
Naonah
Posts: 357
Joined: Sun Apr 04, 2010 11:12 pm

Re: Mail untradable items?

Post 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 :)
:mrgreen:

btw: another codes worth commiting cuz it is essential
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
User avatar
Pandragon
Posts: 704
Joined: Tue Jul 26, 2005 7:38 pm

Re: Mail untradable items?

Post by Pandragon »

Naonah wrote: btw: another codes worth commiting cuz it is essential
+1

ty, great job.
Starter
Posts: 484
Joined: Sat Jan 23, 2010 4:42 pm

Re: Mail untradable items?

Post 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
I have promises to keep and miles to go before I sleep.
feather56
Posts: 55
Joined: Thu Aug 12, 2010 4:43 pm

Re: Mail untradable items?

Post 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
MELERIX is our G0D !
Starter
Posts: 484
Joined: Sat Jan 23, 2010 4:42 pm

Re: Mail untradable items?

Post by Starter »

Noone? :S
I have promises to keep and miles to go before I sleep.
Post Reply