Help please

05/04/2010 22:42 KinG^PlutO#1
Alright.
I'm trying to add a new item and i'm coding it in character.cs, so when I right click the item it will give me gear.
Listen, here is the code i'm using.
AddItem(150249, 9, 12, 7, 255, 13, 13);AddItem, is getting the method from here:
Code:
private void AddItem(int p, int p_2, int p_3, int p_4, int p_5, int p_6, int p_7)
        {
            throw new NotImplementedException();
        }
How can I change it so that it get's the method from here:
Code:
public void AddItemf(uint ID, byte Plus, byte bless, byte ench, Item.Gem soc1, Item.Gem soc2)
        {
            Item I = new Item();
            I.Plus = Plus;
            I.ID = ID;
            I.UID = (uint)Rnd.Next(10000000);
            I.MaxDur = I.DBInfo.Durability;
            I.CurDur = I.MaxDur;
            I.Enchant = ench;
            I.Bless = bless;
            I.Soc1 = soc1;
            I.Soc2 = soc2;

            if (I.UID == 0)
            {
                I.UID = (uint)Rnd.Next(10000000);
            }

            Inventory.Add(I);
            MyClient.AddSend(Packets.AddItem(I, 0));
        }
Thanks in advance.
05/05/2010 03:05 s.bat#2
Quote:
Originally Posted by KinG^PlutO View Post
Alright.
I'm trying to add a new item and i'm coding it in character.cs, so when I right click the item it will give me gear.
Listen, here is the code i'm using.
AddItem(150249, 9, 12, 7, 255, 13, 13);AddItem, is getting the method from here:
Code:
private void AddItem(int p, int p_2, int p_3, int p_4, int p_5, int p_6, int p_7)
        {
            throw new NotImplementedException();
        }
How can I change it so that it get's the method from here:
Code:
public void AddItemf(uint ID, byte Plus, byte bless, byte ench, Item.Gem soc1, Item.Gem soc2)
        {
            Item I = new Item();
            I.Plus = Plus;
            I.ID = ID;
            I.UID = (uint)Rnd.Next(10000000);
            I.MaxDur = I.DBInfo.Durability;
            I.CurDur = I.MaxDur;
            I.Enchant = ench;
            I.Bless = bless;
            I.Soc1 = soc1;
            I.Soc2 = soc2;

            if (I.UID == 0)
            {
                I.UID = (uint)Rnd.Next(10000000);
            }

            Inventory.Add(I);
            MyClient.AddSend(Packets.AddItem(I, 0));
        }
Thanks in advance.
Are the two methods in the same class? If so, your method call has a different name than the one you want to call, and you're passing in 7 arguments when the one you want to call takes only 6. This may or may not be what you're looking for since I don't know what source you're using.