Register for your free account! | Forgot your password?

You last visited: Today at 19:27

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

Advertisement



Item Command [Help]

Discussion on Item Command [Help] within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Item Command [Help]

Ok so this is going to be my item command i just wanna no if it looks correct cause it doesnt to me yet it works but cant find how to make the item super
And how to make the item Free

Any Help WILL BE GREATLY Appreciated

Code:
case "item":
                            {
                                if(CSocket.Client.isPM || CSocket.Client.isGM)
                                    {
                                        if (CSocket.Client.Inventory.Count >= 40)
                                        {
                                            CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, " Your inventory is full.", Struct.ChatType.Top));
                                            break;
                                        }
                                        Struct.ItemData Item = null;
                                        int NewItemID = 0;
                                        foreach (KeyValuePair<int, Struct.ItemData> Items in Nano.Items)
                                        {
                                            if (Items.Value.Name.ToLower() == Command[1].ToLower())
                                            {
                                                Item = Items.Value;
                                                int l = int.Parse(Item.ID.ToString().Remove(0, Item.ID.ToString().Length - 1));
                                                string Version = Command[2].ToLower();
                                                int version = 9;
                                                switch (Version)
                                                {
                                                    case "free": version = 20; break;
                                                    case "super": version = 9; break;
                                                    case "elite": version = 8; break;
                                                    case "unique": version = 7; break;
                                                    case "refined": version = 6; break;
                                                    case "normal": version = 2; break;
                                                    case "normalv1": version = 3; break;
                                                    case "normalv2": version = 4; break;
                                                    case "normalv3": version = 5; break;
                                                }
                                                if (l == version)
                                                { NewItemID = Item.ID; break; }
                                                else
                                                    continue;
                                            }
                                        }
                                        if (Item != null)
                                        {
                                            string ItemID = Item.ID.ToString();
                                            Struct.ItemInfo NewItem = new Struct.ItemInfo();
                                            NewItem.Bless = 0;
                                            NewItem.Dura = Item.MaxDura;
                                            NewItem.Enchant = 0;
                                            if (!Nano.Items.ContainsKey(Convert.ToInt32(ItemID))) { throw new Exception("Invalid quality. Could not create the it."); }
                                            NewItem.ItemID = NewItemID = Convert.ToInt32(ItemID);
                                            NewItem.MaxDura = Item.MaxDura;
                                            NewItem.Plus = 0;
                                            NewItem.Position = 0;
                                            NewItem.Soc1 = 0;
                                            NewItem.Soc2 = 0;
                                            NewItem.Color = new Random().Next(2, 9);
                                            NewItem.UID = Database.Database.ItemUID;

                                            if (Command.Length > 3)
                                            {
                                                NewItem.Plus = Math.Min(12, int.Parse(Command[3]));
                                                if (Command.Length > 4)
                                                {
                                                    NewItem.Bless = Math.Min(7, int.Parse(Command[4]));
                                                    if (Command.Length > 5)
                                                    {
                                                        NewItem.Enchant = Math.Min(255, int.Parse(Command[5]));
                                                        if (Command.Length > 6)
                                                        {
                                                            NewItem.Soc1 = Math.Min(255, int.Parse(Command[6]));
                                                            if (Command.Length > 7)
                                                            {
                                                                NewItem.Soc2 = Math.Min(255, int.Parse(Command[7]));
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            bool created = Database.Database.NewItem(NewItem, CSocket);
                                            CSocket.Client.Inventory.Add(NewItem.UID, NewItem);
                                            CSocket.Send(ConquerPacket.ItemInfo(NewItem.UID, NewItem.ItemID, NewItem.Plus, NewItem.Bless, NewItem.Enchant, NewItem.Soc1, NewItem.Soc2, NewItem.Dura, NewItem.MaxDura, NewItem.Suspicious, NewItem.Free, NewItem.Locked, NewItem.Progress, NewItem.SocketProgress, NewItem.Position, NewItem.Color));
                                            break;
                                        }
                                        else
                                            CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, " Invalid item name. Could not create it.", Struct.ChatType.Top));

                                    }
                                break;
Thanks for the help Note Flamers Reported
hunterman01 is offline  
Reply


Similar Threads Similar Threads
[HELP] item Free Command
11/11/2009 - CO2 Private Server - 3 Replies
Alright so i implemented Free items into coemu just cant figure out the Command when i try the normal command its saying the item does not exist Here is my item command case "item": { if(CSocket.Client.isPM || CSocket.Client.isGM) {
[SEARCH]GM Command for item dropping
08/16/2009 - Dekaron Private Server - 11 Replies
I have an own Dekaron private Server(Only4Fun) and a few questions What is the GM Command to drop an item i chosed? If i type /GM callmonster 101 (Spider larva) the there is no monster spawning. Why? Pls help me Greets Ghosthunter PS: I have a List with the commands but the most one are not working. I type them and then nothing happens
[Help]Item command up to +9
07/08/2009 - CO2 Private Server - 1 Replies
Well this is kinda the secound thread I'm making about this, which I am sorry for. I'm trying to get the player item command to go only up to +9 even when they try getting +12 items. This is what I've tried: Item.Plus = byte.Parse(Cmd); if (Item.Plus >= 9) { Item.Plus = 9; } -------------------------- Item.Plus = byte.Parse(Cmd);
GM command, creat item don't work
08/11/2008 - RF Online - 6 Replies
Hello all, I got a gm account on gamehaze server, but when i try %* it tell me error authority. I show alot of gm naked, and after a log off full stuffed anyone know how to ? Another question :) Absolute reaver anyone know who to get it?



All times are GMT +1. The time now is 19:28.


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.