[Release]Fixed Trading Packet

02/17/2010 04:00 Arcо#16
Quote:
Originally Posted by _Decker View Post
I did everything you said.
I replaced the first code with the second code.
:facepalm:
Read the directions.
Actually read them, don't skim through it.
02/17/2010 04:03 jitus2#17
Again thank you arco.

I still have a small display bug for certain items:

[Only registered and activated users can see links. Click Here To Register...]

This is not very annoying, and the bug occurs only for a few rare items.
02/17/2010 04:06 Arcо#18
That's probably your client, make sure you have an itemminicon for that item.
02/17/2010 04:10 jitus2#19
Agree =)
thx
I take this opportunity to ask a small question which I have great need, how can I do to change the name of an npc?
02/17/2010 04:34 xScott#20
great release :)
02/17/2010 05:01 -Shunsui-#21
Good Job, SON!

jk jk, But Good release
02/17/2010 13:53 ramix#22
the erro i see in my packet is

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);
            [COLOR="Red"]P.Move(2);[/COLOR]            
            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;
        }
to that

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);
            [COLOR="Red"]P.Move(0);[/COLOR]            
            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;
        }
ty and great release ;)
02/18/2010 20:34 Korvacs#23
Code:
P.Move(0);
This can be removed completely, its meant to move the write position in the buffer forward a number of spaces, by setting it to 0 it doesnt move at all and your just giving your processor some work to do for no reason at all.
02/18/2010 20:41 copz1337#24
mind explaining what the bug with the original packet was?
02/18/2010 20:47 ArtOfWar#25
Quote:
Originally Posted by copz1337 View Post
mind explaining what the bug with the original packet was?
The bug was that if you trade something full +12 it show it as just super not +12 or anything
02/18/2010 22:03 Decker_#26
Thanks Arco, I got it working!
+k ;)
02/18/2010 22:18 darkdestiny54#27
Great Job ^^ Works perfectly!
02/18/2010 22:36 Arcо#28
Quote:
Originally Posted by copz1337 View Post
mind explaining what the bug with the original packet was?
Click the link in my first post, you will see.
02/18/2010 22:58 Decker_#29
Quote:
Originally Posted by copz1337 View Post
mind explaining what the bug with the original packet was?
Example:
Let's say you trade a Super bow +12 2soc sdg, and they put it on the trade list, the other person see's it only as a super bow, not as a super +12 2soc sdg bow.

I hope I helped!
02/18/2010 23:19 ArtOfWar#30
Yeah this fixed the trading perfectly thanks .Arco