[HELP] BlacksmithLee (CoEmu v2)

08/10/2009 15:34 12tails#1
hello its me again asking for help kkkkkkkkkkkkkk...

well here are my codes... its basic from LOTF but i'm getting error..

this i put on character.cs:

Code:
        public uint[] Equips_UIDs = new uint[10];
        public string[] Equips = new string[10];
and Npc:

Code:
                case 1010:
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hello, i can make the first and the seccond socket to an item for CPs!! chose what do you wan't!", CSocket);
                            Link("1ST-Socket", 1, CSocket);
                            Link("2ND-Socket", 2, CSocket);
                            Link("Just passing by", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            Text("Choose what do you want the first socket to be created in.",CSocket);
                            Link("Headgear", 3,CSocket);
                            Link("Necklace/ bag", 4,CSocket);
                            Link("Armor/ gown", 5,CSocket);
                            Link("Ring/ bracelet", 6,CSocket);
                            Link("Boots", 7,CSocket);
                            Link("Just passing by.", 255,CSocket);
                            Face(30,CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 2)
                        {
                            Text("Choose what do you want the second socket to be created in.", CSocket);
                            Link("Headgear", 3, CSocket);
                            Link("Necklace/ bag", 4, CSocket);
                            Link("Armor/ gown", 5, CSocket);
                            Link("Ring/ bracelet", 6, CSocket);
                            Link("Boots", 7, CSocket);
                            Link("Just passing by.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 3 || LinkBack == 4 || LinkBack == 5 || LinkBack == 6 || LinkBack == 7)
                        {
                            int into = 0;

                            if (LinkBack == 3 && CSocket.Client.Equips[1] != null && CSocket.Client.Equips[1] != "0")
                                into = 1;
                            else if (LinkBack == 4 && CSocket.Client.Equips[2] != null && CSocket.Client.Equips[2] != "0")
                                into = 2;
                            else if (LinkBack == 5 && CSocket.Client.Equips[3] != null && CSocket.Client.Equips[3] != "0")
                                into = 3;
                            else if (LinkBack == 6 && CSocket.Client.Equips[6] != null && CSocket.Client.Equips[6] != "0")
                                into = 6;
                            else if (LinkBack == 7 && CSocket.Client.Equips[8] != null && CSocket.Client.Equips[8] != "0")
                                into = 8;
                            else
                                return;

                            if (CSocket.Client.CPs > 2580)
                            {
                                int soc1 = 0;
                                string[] item = CSocket.Client.Equips[into].Split('-');
                                if (item[4] != "0")
                                    return;

                                CPs(-2580, CSocket);
                                soc1 = 1;

                                item[4] = "255";

                                CSocket.Client.Equips[into] = item[0] + "-" + item[1] + "-" + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5];
                                CSocket.Send(ConquerPacket.AddItem((long)CSocket.Client.Equips_UIDs[into], int.Parse(item[0]), byte.Parse(item[1]), byte.Parse(item[2]), byte.Parse(item[3]), byte.Parse(item[4]), byte.Parse(item[5]), (byte)into, 100, 100));
                            }
                            else
                            {
                                Text("You don't have 2580 CPs!", CSocket);
                                Link("I see.", 255,CSocket);
                                Face(30,CSocket);
                                End(CSocket);
                            }
                        }

                        else if (LinkBack == 8 || LinkBack == 9 || LinkBack == 10 || LinkBack == 11 || LinkBack == 12)
                        {
                            int into = 0;

                            if (LinkBack == 8 && CSocket.Client.Equips[1] != null && CSocket.Client.Equips[1] != "0")
                                into = 1;
                            else if (LinkBack == 9 && CSocket.Client.Equips[2] != null && CSocket.Client.Equips[2] != "0")
                                into = 2;
                            else if (LinkBack == 10 && CSocket.Client.Equips[3] != null && CSocket.Client.Equips[3] != "0")
                                into = 3;
                            else if (LinkBack == 11 && CSocket.Client.Equips[6] != null && CSocket.Client.Equips[6] != "0")
                                into = 6;
                            else if (LinkBack == 12 && CSocket.Client.Equips[8] != null && CSocket.Client.Equips[8] != "0")
                                into = 8;
                            else
                                return;

                            if (CSocket.Client.CPs > 13230)
                            {
                                int soc2 = 0;
                                string[] item = CSocket.Client.Equips[into].Split('-');
                                if (item[5] != "0" || item[4] == "0")
                                    return;

                                CPs(-13230, CSocket);
                                soc2 = 2;

                                item[5] = "255";

                                CSocket.Client.Equips[into] = item[0] + "-" + item[1] + "-" + item[2] + "-" + item[3] + "-" + item[4] + "-" + item[5];
                                CSocket.Send(ConquerPacket.AddItem((long)CSocket.Client.Equips_UIDs[into], int.Parse(item[0]), byte.Parse(item[1]), byte.Parse(item[2]), byte.Parse(item[3]), byte.Parse(item[4]), byte.Parse(item[5]), (byte)into, 100, 100));
                            }
                            else
                            {
                                Text("You don't have the 13230 CPs!", CSocket);
                                Link("I see.", 255, CSocket);
                                Face(30, CSocket);
                            }
                        }
                        break;
                    }
if someone wanna help i will be here for some more time.... tkx and sorry for ask ^^

Edit:

forgot the image..
08/10/2009 17:53 samehvan#2
the ConquerPacket doesn't have an AddItem packet and u ddnt define it at ur NpcTalk

but there are some things at your code needs to be modified

1 :-Equips are already there CSocket.Client.Equipment ,so u don't need to state them again

2:-your first socket and second socket links are the same (LinkBack 1 and 2) they both have the links 3-7 i think u meant to make them 3-7 for first socket and 8-12 for the second

3-u can replace "CSocket.Client.Equipment[2] != null && CSocket.Client.Equips[2] != "0"" with "CSocket.Client.Equipment.ContainsKey(2)"

4-Soc1=1 and Soc2=2 will put a Phoenix Gem to the item sockets they suppose to be Soc1=255 ,Soc2=255
08/11/2009 02:32 12tails#3
hmmm... thankx....

but i don't have time to do it now.... i will do it latter need to work.. cya!