Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 12:25

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] Being able to see items on the ground

Discussion on [Help] Being able to see items on the ground within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2006
Posts: 6
Received Thanks: 0
[Help] Being able to see items on the ground

I've been here for a long time but never really posted. Anyways, I'm using Hybrid's 5017 source and I'm having trouble with being able to see items on the ground. I've handled dropping an item like so in the packet handler:

(it's something simple for now)

Code:
        public static void DropItem(GameClient Client, ItemUsagePacket Packet)
        {
            IConquerItem thisItem = Client.GetInventoryItem(Packet.UID);
            
            Item item = new Item(Client.Entity.MapID,
                                Client.Entity.X,
                                Client.Entity.Y);

            Client.RemoveInventory(thisItem.UID);

            Kernel.ItemsOnTheFloor.Add(thisItem.UID, item);
        }
But I don't know what to do from there. Is it something with the general data packet that I have to deal with?
micro1337 is offline  
Old 12/11/2010, 23:19   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
You need to send the ground item packet (1101) with the subtype you require (add/remove/loot/etc) based on actions. As part of your spawn screen method you should be sending the ground items currently in range to clients.
pro4never is offline  
Thanks
1 User
Old 12/11/2010, 23:57   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 38
Received Thanks: 10
Afaik Arco did this in his release of hybrids 5017.so you might want to check that out.
FuriousFag is offline  
Old 12/12/2010, 05:57   #4
 
elite*gold: 0
Join Date: Sep 2006
Posts: 6
Received Thanks: 0
Wow thank you pro! I can't believe how simple the solution was. It took some thinking though. I was thinking that when I send this packet I would also have to do something in code to be able to see it in game. But I had to stop and think "what is the role of the client?". The client spawns the item when it receives the packet. Not the server spawning the item. Here is my code:

Code:
                                      case "@drop":
                                            {
                                                IConquerItem itm = new ItemDataPacket(true);
                                                itm.ID = 480339;
                                                itm.Plus = 12;
                                                itm.UID = ItemDataPacket.NextItemUID;

                                                byte[] packet = new byte[20];
                                                PacketBuilder.WriteUInt16(20, packet, 0);
                                                PacketBuilder.WriteUInt16(1101, packet, 2);
                                                PacketBuilder.WriteUInt32(itm.UID, packet, 4);
                                                PacketBuilder.WriteUInt32(itm.ID, packet, 8);
                                                PacketBuilder.WriteUInt16(Client.Entity.X, packet, 12);
                                                PacketBuilder.WriteUInt16(Client.Entity.Y, packet, 14);
                                                PacketBuilder.WriteUInt32(0x1, packet, 16);


                                                Kernel.ToLocal(packet, Client.Entity.X, Client.Entity.Y, Client.Entity.MapID, 0, 0);
                                                break;
                                            }
Edit: Ok, I've fixed the drop method like so:

Code:
        static public void DropItem(GameClient Client, ItemUsagePacket Packet)
        {
            IConquerItem thisItem = Client.GetInventoryItem(Packet.UID);

            Client.RemoveInventory(thisItem.UID);

            byte[] packet = new byte[20];
            PacketBuilder.WriteUInt16(20, packet, 0);
            PacketBuilder.WriteUInt16(1101, packet, 2);
            PacketBuilder.WriteUInt32(thisItem.UID, packet, 4);
            PacketBuilder.WriteUInt32(thisItem.ID, packet, 8);
            PacketBuilder.WriteUInt16(Client.Entity.X, packet, 12);
            PacketBuilder.WriteUInt16(Client.Entity.Y, packet, 14);
            PacketBuilder.WriteUInt32(0x1, packet, 16);

            Item item = new Item();
            item.UID = thisItem.UID;
            item.ID = thisItem.ID;
            item.MapID = Client.Entity.MapID;
            item.Plus = thisItem.Plus;
            item.Position = thisItem.Position;
            item.SocketOne = thisItem.SocketOne;
            item.SocketTwo = thisItem.SocketTwo;
            item.X = Client.Entity.X;
            item.Y = Client.Entity.Y;
            item.Enchant = thisItem.Enchant;
            item.Bless = thisItem.Bless;

            Kernel.ItemsOnTheFloor.Add(item.UID, item);
            Kernel.ToLocal(packet, Client.Entity.X, Client.Entity.Y, Client.Entity.MapID, 0, 0);
        }
And I thought it would be a good idea to update the client every time it jumps so it will be able to see items throughout the map--but one problem. The client keeps playing the item drop sound whenever I jump. Am I sending the wrong subtype or does the wiki not have all the subtypes? Is this a good idea to begin with?

In the jump method:

Code:
                foreach (KeyValuePair<uint, Item> itm in Kernel.ItemsOnTheFloor)
                {
                    if (itm.Value.MapID == Client.Entity.MapID && Kernel.CanSee(itm.Value.X, itm.Value.Y, Client.Entity.X, Client.Entity.Y))
                    {
                        byte[] packet = new byte[20];
                        PacketBuilder.WriteUInt16(20, packet, 0);
                        PacketBuilder.WriteUInt16(1101, packet, 2);
                        PacketBuilder.WriteUInt32(itm.Value.UID, packet, 4);
                        PacketBuilder.WriteUInt32(itm.Value.ID, packet, 8);
                        PacketBuilder.WriteUInt16(itm.Value.X, packet, 12);
                        PacketBuilder.WriteUInt16(itm.Value.Y, packet, 14);
                        PacketBuilder.WriteUInt32(0x1, packet, 16);

                        Client.Send(packet);
                    }
                }
micro1337 is offline  
Reply


Similar Threads Similar Threads
See special items on the ground
01/03/2010 - CO2 Exploits, Hacks & Tools - 15 Replies
See special items on the ground Here's the new ... Program has the ability to see Items is a very large images so as not to weaken your eyes ..!! http://img189.imageshack.us/img189/5329/asmasmasm asly.jpg Have Fun And Godd Luck ...!! :):)
Items on the ground
06/30/2007 - Conquer Online 2 - 0 Replies
Ok you probably want to know what my idea is and want me to of just made it work but I'm a noob at programming so I can't. I don't think this has been mentioned before but I may of missed it in my searches so forgive me if its been posted. Now everyone knows by now that editing the itemtype.dat file will allow you to see if and item is Unique-Super and Low-High normals. Now if CO has a way for the item to have elite in front of the name of the item in your inventory and not on the ground...
I need a bot to identify items on ground
07/16/2006 - Conquer Online 2 - 8 Replies
hey guys I need a bot to identify items on ground . its so nasty to get the normals out of ur inventory so i thought u guys are nice and that u could make a bot for me to identyfi the items what u say? could u do this favour for me pls??please guys i would be really thenkfull if u do this for me .ty any way ^^
+1 items on ground
09/24/2005 - Conquer Online 2 - 3 Replies
is there anyway 2 get +1 items 2 show up on ground it would be alot faster it shows everything else just not +1 why??



All times are GMT +1. The time now is 12:27.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.