[Release]Fixed Trading Packet

02/16/2010 23:47 Arcо#1
Well there is a bug with the trading packet that resulted in this.
[Only registered and activated users can see links. Click Here To Register...]
I have fixed it.
Go to packets.cs and search for
Code:
public static COPacket TradeItem(Game.Item I)
Replace that entire packet with this:
Code:
        public static COPacket TradeItem(Game.Item I)
        {
            byte[] Packet = new byte[8 + 48];
            COPacket P = new COPacket(Packet);
            P.WriteInt16((ushort)(Packet.Length - 8));
            P.WriteInt16((ushort)0x3f0);
            P.WriteInt32(I.UID);
            P.WriteInt32(I.ID);
            P.WriteInt16(I.CurDur);
            P.WriteInt16(I.MaxDur);
            P.WriteInt16(2);
            P.WriteInt16(0);
            P.WriteInt32(I.TalismanProgress);
            P.Move(0);            
            P.WriteByte((byte)I.Soc1);
            P.WriteByte((byte)I.Soc2);
            P.WriteInt16((ushort)I.Effect);
            P.WriteByte(I.Plus);
            P.WriteByte(I.Bless);
            if (I.FreeItem)
                P.WriteByte(1);
            else
                P.WriteByte(0);
            P.WriteByte(I.Enchant);
            P.Move(6);
            if (I.Locked)
                P.WriteInt16(3);
            else P.WriteInt16(0);
            P.WriteInt32((uint)I.Color);
            P.WriteInt32(I.Progress);

            return P;
        }
If you are using Immune's itemlock code than change it to this:
Code:
        public static COPacket TradeItem(Game.Item I)
        {
            byte[] Packet = new byte[8 + 48];
            COPacket P = new COPacket(Packet);
            P.WriteInt16((ushort)(Packet.Length - 8));
            P.WriteInt16((ushort)0x3f0);
            P.WriteInt32(I.UID);
            P.WriteInt32(I.ID);
            P.WriteInt16(I.CurDur);
            P.WriteInt16(I.MaxDur);
            P.WriteInt16(2);
            P.WriteInt16(0);
            P.WriteInt32(I.TalismanProgress);
            P.Move(0);            
            P.WriteByte((byte)I.Soc1);
            P.WriteByte((byte)I.Soc2);
            P.WriteInt16((ushort)I.Effect);
            P.WriteByte(I.Plus);
            P.WriteByte(I.Bless);
            if (I.FreeItem)
                P.WriteByte(1);
            else
                P.WriteByte(0);
            P.WriteByte(I.Enchant);
            P.Move(6);
            if (I.Locked == 1)
                P.WriteInt16(1);
            else P.WriteInt16(0); 
            P.WriteInt32((uint)I.Color);
            P.WriteInt32(I.Progress);

            return P;
        }
Hope this helps.
02/17/2010 00:06 Decker_#2
Can you make it so PM's can drop things?
02/17/2010 00:07 Arcо#3
Quote:
Originally Posted by _Decker View Post
Can you make it so PM's can drop things?
Um, that has nothing to do with this thread, if you have a request pm it to me.
02/17/2010 00:26 killerbee#4
i have this error: if (I.Locked == 1)

Operator '==' cannot be applied to operands of type "bool" and "int"


#EDITED

got it to work. i changed: if (I.Locked == 1) back to if (I.Locked)
02/17/2010 00:29 Arcо#5
Quote:
Originally Posted by killerbee View Post
i have this error: if (I.Locked == 1)

Operator '==' cannot be applied to operands of type "bool" and "int"
Please read the instructions on how to use this packet.
02/17/2010 00:59 dextercsar#6
Thanksss!!!!!
02/17/2010 01:22 [GM]#7
another great release from a great person keep it up .Arco +k
02/17/2010 01:36 ~Yuki~#8
Thanks Acro.
02/17/2010 01:44 StarEvaAfta!~#9
Great release +k
02/17/2010 03:45 Decker_#10
I get 62 errors :S
02/17/2010 03:46 Arcо#11
Quote:
Originally Posted by _Decker View Post
I get 62 errors :S
Cause you probably added it wrong.

What did you do?
02/17/2010 03:51 jitus2#12
Arco good work! he had the bug on my server .. it is correct thanks to you now, thank you!
(Sorry for my bad English)
02/17/2010 03:52 Arcо#13
Quote:
Originally Posted by jitus2 View Post
Arco good work! he had the bug on my server .. it is correct thanks to you now, thank you!
(Sorry for my bad English)
No problem.
Glad to help.
:)
02/17/2010 03:55 salem rey#14
If this work i will give you a thanks, but all your works i think worked :D
02/17/2010 03:59 Decker_#15
Quote:
Originally Posted by .Arco View Post
Cause you probably added it wrong.

What did you do?
I did everything you said.
I replaced the first code with the second code.