ShowEquipmentsPacket 5508

07/13/2011 22:12 Mr_PoP#1
Code:
public ShowEquipmentsPacket()
            : base(1009, 100)
        {
        }
        public UInt32 heroId
        {
            get
            {
                return ReadUInt32(4);
            }
            set
            {
                WriteUInt32(4, value);
            }
        }
        public UInt32 heroID
        {
            get
            {
                return ReadUInt32(8);
            }
            set
            {
                WriteUInt32(8, value);
            }
        }
        public UInt16 Mode
        {
            get
            {
                return ReadUInt16(12);
            }
            set
            {
                WriteUInt16(12, value);
            }
        }
        public UInt32 Helm
        {
            get
            {
                return ReadUInt32(32);
            }
            set
            {
                WriteUInt32(32, value);
            }
        }
        public UInt32 Necklace
        {
            get
            {
                return ReadUInt32(36);
            }
            set
            {
                WriteUInt32(36, value);
            }
        }
        public UInt32 Armor
        {
            get
            {
                return ReadUInt32(40);
            }
            set
            {
                WriteUInt32(40, value);
            }
        }
        public UInt32 RHand
        {
            get
            {
                return ReadUInt32(44);
            }
            set
            {
                WriteUInt32(44, value);
            }
        }
        public UInt32 LHand
        {
            get
            {
                return ReadUInt32(48);
            }
            set
            {
                WriteUInt32(48, value);
            }
        }
        public UInt32 Ring
        {
            get
            {
                return ReadUInt32(52);
            }
            set
            {
                WriteUInt32(52, value);
            }
        }
        public UInt32 Talisman
        {
            get
            {
                return ReadUInt32(56);
            }
            set
            {
                WriteUInt32(56, value);
            }
        }
        public UInt32 Boots
        {
            get
            {
                return ReadUInt32(60);
            }
            set
            {
                WriteUInt32(60, value);
            }
        }
        public UInt32 Garment
        {
            get
            {
                return ReadUInt32(64);
            }
            set
            {
                WriteUInt32(64, value);
            }
        }
        public UInt32 AccessoryOne
        {
            get
            {
                return ReadUInt32(68);
            }
            set
            {
                WriteUInt32(68, value);
            }
        }
        public UInt32 AccessoryTwo
        {
            get
            {
                return ReadUInt32(72);
            }
            set
            {
                WriteUInt32(72, value);
            }
        }
here how am using it

Code:
ShowEquipmentsPacket show = new ShowEquipmentsPacket();
                        show.heroId = (uint)hero.id;
                        show.heroID = (uint)hero.id;
                        show.Mode = 0x2E;
                        foreach (var i in world.getItemsFromDBbyHeroId(hero.id))
                        {
                            ItemInfoPacket item = new ItemInfoPacket();
                            item.itemId = (uint)i.id;
                            item.itemTypeId = (uint)i.type;
                            item.CurrentDura = (ushort)i.CurrentDura;
                            item.MaxDura = (ushort)i.MaxDura;
                            item.Mode = i.Mode;
                            item.Location = i.Location;
                            item.SocketProgress = (uint)i.SocketProgress;
                            item.FirstSocket = i.FirstSocket;
                            item.SecondSocket = i.SecondSocket;
                            item.Effect = (ushort)i.Effect;
                            item.Composition = i.Composition;
                            item.Bless = i.Bless;
                            item.isFree = i.isFree;
                            item.Enchant = i.Enchant;
                            item.Suspicious = i.Suspicious;
                            item.isLocked = i.isLocked;
                            item.Colour = i.Colour;
                            item.CompositionProgress = (uint)i.CompositionProgress;
                            item.Inscribed = i.Inscribed;
                            item.InscribeTime = (uint)i.InscribeTime;
                            item.Amount = (ushort)i.Amount;
                            SendPacket(item);

                            if (i.Location == 1)
                            {
                                show.Helm = (uint)i.type;
                            }
                            if (i.Location == 2)
                            {
                                show.Necklace = (uint)i.type;
                            }
                            if (i.Location == 3)
                            {
                                show.Armor = (uint)i.type;
                            }
                            if (i.Location == 4)
                            {
                                show.RHand = (uint)i.type;
                            }
                            if (i.Location == 5)
                            {
                                show.LHand = (uint)i.type;
                            }
                            //TODO: the other items
                        }
                        SendPacket(show);
output as hex
Code:
64 00 F1 03 43 42 0F 00 43 42 0F 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 75 14 02 00 87 50 09 00 87 50 09 00 00 0
0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
but uh! it's not spewing the equipment
07/13/2011 23:12 pro4never#2
Why are you trying to send all equipments at once? It's not needed (not to mention incorrect).

Look at any public source and you'll see how the packet should be laid out.

There's no need to re-send item info packets at all. If the item shows for the user then the item info has already been sent. You simply need to send the 1009 (to self only) with ALL equipped uids in correct offsets.

The way you have it there seems to be sending 1009 for EACH item.


What you should be doing (could be better solutions but w/e...) is write a basic "displayGear" method which simply sets up the 1009 packet and then does

foreach(item i in gears)
switch(PositionType(I.Location))
case PositionType.Head:
viewPacket.Head = I.UID;
break;

etc

Then send it.
07/14/2011 04:29 Mr_PoP#3
Quote:
Originally Posted by pro4never View Post
Why are you trying to send all equipments at once? It's not needed (not to mention incorrect).

Look at any public source and you'll see how the packet should be laid out.

There's no need to re-send item info packets at all. If the item shows for the user then the item info has already been sent. You simply need to send the 1009 (to self only) with ALL equipped uids in correct offsets.

The way you have it there seems to be sending 1009 for EACH item.


What you should be doing (could be better solutions but w/e...) is write a basic "displayGear" method which simply sets up the 1009 packet and then does

foreach(item i in gears)
switch(PositionType(I.Location))
case PositionType.Head:
viewPacket.Head = I.UID;
break;

etc

Then send it.
am not sending the iteminfopacket 2wic and am sending it when the client request the commandpacket->HotkeysItems....

so am sending Time then the code i have mentioned , and if u looked good you will find that SendPacket(show); is out of the foreach scope the foreach scope is loading the items and writing the right location of every item in the showpacket so out the scope of foreach am sending the packet , so am sending it once not for every item..i believe it's something wrong with my offsets though
07/14/2011 14:57 pro4never#4
Ahh sorry I just got back from a very long day when I read that... My bad.

I'd say try testing this all via cmd first. Ensure that the items display properly in your inventory and in your character window first and then use a command to say... place slot 1 as uid X and test it one at a time to confirm all offsets and functionality of the packet.
07/14/2011 18:57 Mr_PoP#5
Quote:
Originally Posted by pro4never View Post
Ahh sorry I just got back from a very long day when I read that... My bad.

I'd say try testing this all via cmd first. Ensure that the items display properly in your inventory and in your character window first and then use a command to say... place slot 1 as uid X and test it one at a time to confirm all offsets and functionality of the packet.
nvm at least you tried to help me :).

about your advice i will try to work on it , thanks for your time i appreciate it :)
07/15/2011 02:57 Mr_PoP#6
[Only registered and activated users can see links. Click Here To Register...]
Code:
64 00 F1 03 43 42 0F 00 43 42 0F 00 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 75 14 02 00 87 50 09 00 87 50 09 00 00 0
0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
i can't see what's wrong

Code:
100 -> 0
1009 -> 2
1000003 -> 4
1000003 -> 8
46(0x2E)-> 12
136309 -> 40
610439 -> 44
610439 -> 48
it seems like every thing is OK !_!:mad: