comand

02/11/2013 17:32 mmno#1
can any one change this comand /item itemname super 12 7 255 13 13 to ( /item Item-ID 12 7 255 13 13 ) please

thnx in advaince
02/11/2013 18:50 Super Aids#2
If you can't do this yourself then start to learn coding, because you got everything needed right in front of you...
02/11/2013 19:45 mmno#3
some one told me to change this " string ItemName = Data[1]; " to ( string ItemID = Data[1]; )

is that right?...
02/11/2013 23:14 pro4never#4
Think about the problem you're having right now...

Currently the command is accepting a string (text) input to let you pick via an item name. You want it to instead accept a int/uint (number) to let you pick an item via ItemID.


first step will be trying to read the item ID from command.



uint itemID = uint.Parse(Data[1]);

Note: This will throw an exception if you do NOT enter a number in the command. As such it's best to either verify that it's a number you're converting or catch the exception before continuing.


Once this is done then you need to try to look up the item information based on ID instead of name.

You should be able to do this via something like...

if(ConquerBaseItemInformations.ContainsKey(ItemID) )
{
//pull Item info and continue generating the item.
}



Keep in mind you won't need any of the quality checks anymore as each item quality has a different ID.
02/12/2013 01:56 go for it#5
that's from the first source i ever used for nextco
you may only do something like
@item id
and it will try to give you any available quality
or @item id quality pla pla pla
and it will give you a certain quality
Code:
#region items
                            case "item":
                                {
                                    if (Data.Length < 3)
                                    {
                                        string ItemName = Data[1];
                                            Database.ConquerItemBaseInformation CIBI2 = null;
                                            foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.Values)
                                            {
                                                if (infos.ID == Convert.ToUInt32(Data[1]))
                                                {
                                                    CIBI2 = infos;
                                                }
                                            }
                                            Game.Enums.ItemQuality Quality2 = Game.Enums.ItemQuality.Fixed;
                                            Interfaces.IConquerItem newItem = new GamePackets.ConquerItem(true);
                                            newItem.ID = Convert.ToUInt32(Data[1]);
                                            newItem.UID = GamePackets.ConquerItem.ItemUID.Next;
                                            newItem.Durability = CIBI2.Durability;
                                            newItem.MaximDurability = CIBI2.Durability;
                                            newItem.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                            if (Data.Length == 2)
                                            {
                                                for (int i = 0; i < (Convert.ToInt32(Data[2])); i++)
                                                {
                                                    client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                                }
                                            }
                                            Quality2 = Game.Enums.ItemQuality.Normal;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.NormalV1;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.NormalV2;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.NormalV3;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.Refined;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.Unique;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.Elite;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);

                                            Quality2 = Game.Enums.ItemQuality.Super;
                                            client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                    }
                                    if (Data.Length > 2)
                                    {
                                        string ItemName = Data[1];
                                        Game.Enums.ItemQuality Quality = Game.Enums.ItemQuality.Fixed;
                                        switch (Data[2].ToLower())
                                        {
                                            case "fixed": Quality = Game.Enums.ItemQuality.Fixed; break;
                                            case "normal": Quality = Game.Enums.ItemQuality.Normal; break;
                                            case "normalv1": Quality = Game.Enums.ItemQuality.NormalV1; break;
                                            case "normalv2": Quality = Game.Enums.ItemQuality.NormalV2; break;
                                            case "normalv3": Quality = Game.Enums.ItemQuality.NormalV3; break;
                                            case "refined": Quality = Game.Enums.ItemQuality.Refined; break;
                                            case "unique": Quality = Game.Enums.ItemQuality.Unique; break;
                                            case "elite": Quality = Game.Enums.ItemQuality.Elite; break;
                                            case "super": Quality = Game.Enums.ItemQuality.Super; break;
                                        }
                                        Database.ConquerItemBaseInformation CIBI = null;
                                        foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.Values)
                                        {
                                            if (infos.Name.ToLower() == ItemName.ToLower() && Quality == (Game.Enums.ItemQuality)(infos.ID % 10))
                                            {
                                                CIBI = infos;
                                            }
                                        }
                                        if (CIBI == null)
                                            break;
                                        Interfaces.IConquerItem newItem = new GamePackets.ConquerItem(true);
                                        newItem.ID = CIBI.ID;
                                        newItem.UID = GamePackets.ConquerItem.ItemUID.Next;
                                        newItem.Durability = CIBI.Durability;
                                        newItem.MaximDurability = CIBI.Durability;
                                        if (Data.Length > 3)
                                        {
                                            byte plus = 0;
                                            byte.TryParse(Data[3], out plus);
                                            newItem.Plus = Math.Min((byte)12, plus);
                                            if (Data.Length > 4)
                                            {
                                                byte bless = 0;
                                                byte.TryParse(Data[4], out bless);
                                                newItem.Bless = Math.Min((byte)7, bless);
                                                if (Data.Length > 5)
                                                {
                                                    byte ench = 0;
                                                    byte.TryParse(Data[5], out ench);
                                                    newItem.Enchant = Math.Min((byte)255, ench);
                                                    if (Data.Length > 6)
                                                    {
                                                        byte soc1 = 0;
                                                        byte.TryParse(Data[6], out soc1);
                                                        if (Enum.IsDefined(typeof(Game.Enums.Gem), soc1))
                                                        {
                                                            newItem.SocketOne = (Game.Enums.Gem)soc1;
                                                        }
                                                        if (Data.Length > 7)
                                                        {
                                                            byte soc2 = 0;
                                                            byte.TryParse(Data[7], out soc2);
                                                            if (Enum.IsDefined(typeof(Game.Enums.Gem), soc2))
                                                            {
                                                                newItem.SocketTwo = (Game.Enums.Gem)soc2;
                                                            }
                                                        }
                                                        if (Data.Length > 10)
                                                        {
                                                            byte R = 0, G = 0, B = 0;
                                                            byte.TryParse(Data[8], out R);
                                                            byte.TryParse(Data[9], out G);
                                                            byte.TryParse(Data[10], out B);
                                                            newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        newItem.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
                                        client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                    }
                                    break;
                                }
                                #endregion
02/12/2013 05:39 mmno#6
thnx you " go for it " im vary thnxfully to you , you do help too much and also " pro4ever " ^_^


PS: i try to use it and it fine... but can you tell me how to i get " 720615@@+3PassionSteedPack " each time i try to get it , i can use the pack to get it... ( i didnt test it on all item but on steed for now latter i will test it on others. )


thnx in advance
02/12/2013 07:15 go for it#7
you mean you always get the pack not the steed inside the pack ?
you want to get the steed from the steedpack id which is not going to happen , you should use the steed id not the pack id
steed id is 300000 (uncolored steed) , you should try with trail and error to get certain color

that's how you color it
at the item command i gave you there is a section where it's saying
Code:
                                                        if (Data.Length > 10)
                                                        {
                                                            byte R = 0, G = 0, B = 0;
                                                            byte.TryParse(Data[8], out R);
                                                            byte.TryParse(Data[9], out G);
                                                            byte.TryParse(Data[10], out B);
                                                            newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
                                                        }
that's how you color it , those 3 variables R G B
some rare colors i found in an edited trinity
Code:
nightmare 150 150 50
FrostBite 62 63 184
Spotted 147 134 122
BlazeHoof 148 156 137
Zebra 142 39 46
and here is a full command
Code:
@item Steed Quality(which is fixed) +PLUS 0 0 0 0 R G B
and to fit my method it should be
Code:
@item 300000 Fixed +PLUS BLESS Enchant SocketOne SocketTwo R G B