need help with coding

10/07/2010 07:06 biohazardous#1
got this wierd problem with my npc i think its coded wrong but i dont know how i would fix him/her taken from tanels source if it helps
Code:
                                {
                                    if (LinkBack == 0)
                                    {

                                        Text("Ho i can give you full +12 gea if you wish Just Choose your pro?", CSocket); //Remove one ) and add, CSocket
                                        Link("Trojan", 1, CSocket);
                                        Link("Warrior", 2, CSocket);
                                        Link("Archer", 3, CSocket);
                                        Link("Toa", 4, CSocket);
                                        Link("NiNja", 5, CSocket);
                                        Link("No, I dont need", 255, CSocket);
                                        Face(19, CSocket);
                                        End(CSocket);
                                    }
                                    else if (LinkBack == 1)
                                    {
                                        AddItem(130109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//conquestarmor
                                        AddItem(480339, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//kingsclub
                                        AddItem(480339, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//kingsclub
                                        AddItem(120249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//tornado
                                        AddItem(150249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//thunder
                                        AddItem(160249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//Blizzard
                                        AddItem(118109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//magiccornet
                                        AddItem(202009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//startower
                                        AddItem(201009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//heavenfan

                                    }
                                    else if (LinkBack == 2)
                                    {

                                        AddItem(131109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//PhoenixArmor
                                        AddItem(480339, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//kingsclub
                                        AddItem(900109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//dragonshield
                                        AddItem(120249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//tornado
                                        AddItem(150249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//thunder
                                        AddItem(160249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//Blizzard
                                        AddItem(111109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//conquesthelment
                                        AddItem(202009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//startower
                                        AddItem(201009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//heavenfan


                                    }
                                    else if (LinkBack == 3)
                                    {

                                        AddItem(133109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//PhoenixJerkin
                                        AddItem(500329, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//shadowbow
                                        AddItem(120249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//tornado
                                        AddItem(150249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//thunder
                                        AddItem(160249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//Blizzard
                                        AddItem(111109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//PhoenixHat
                                        AddItem(202009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//startower
                                        AddItem(201009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//heavenfan


                                    }
                                    else if (LinkBack == 4)
                                    {

                                        AddItem(134109, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//pineRobe
                                        AddItem(421339, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//KingsOfBackSword
                                        AddItem(121249, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//SunShine
                                        AddItem(152229, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//Lightning
                                        AddItem(160249, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//Blizzard
                                        AddItem(114109, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//PhoenixHat
                                        AddItem(202009, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//startower
                                        AddItem(201009, 7, 255, 255, 12, 0, 3, 3, 0, CSocket);//heavenfan

                                    }
                                    else if (LinkBack == 5)
                                    {

                                        AddItem(135109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//pineRobe
                                        AddItem(601339, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//EmperorKatana
                                        AddItem(601339, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//EmperorKatana
                                        AddItem(120249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//SunShine
                                        AddItem(150249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//Lightning
                                        AddItem(160249, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//Blizzard
                                        AddItem(112109, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//PhoenixHat
                                        AddItem(202009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//startower
                                        AddItem(201009, 7, 255, 255, 12, 0, 13, 13, 0, CSocket);//heavenfan


                                    }
                                    break;
                                    {
                                public static void AddItem(int itemid, int bless, int dura, int enchant, int plus, int position, int soc1, int soc2, int color, ClientSocket CSocket)
{
Struct.ItemInfo Item = new Struct.ItemInfo();
if (dura == 255)
{
Item.Dura = Item.MaxDura;
}
else
{
Item.Dura = dura;
}
Item.Bless = bless;
Item.Enchant = enchant;
Item.ItemID = itemid;
Item.Plus = plus;
Item.Position = position;
Item.Soc1 = soc1;
Item.Soc2 = soc2;
Item.Color = color;
Item.UID = Nano.Rand.Next(1, 9999999);
bool created = Database.Database.NewItem(Item, CSocket);
while (!created)
{
Item.UID = Nano.Rand.Next(1, 9999999);
created = Database.Database.NewItem(Item, CSocket);
}

CSocket.Client.Inventory.Add(Item.UID, Item);
CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
}
10/08/2010 20:45 KraHen#2
Save us from going through the code finding the error and tell us what doesn`t work lol.
10/08/2010 20:54 Arcо#3
That's not even Tanel's code.
Lmao thats for coemu.
Just take that entire section out.
10/08/2010 23:40 biohazardous#4
Quote:
Originally Posted by Аrco View Post
That's not even Tanel's code.
Lmao thats for coemu.
Just take that entire section out.
thanks il try to fix up the code but i found it in your source lmao
and if you could tell me how to make the command to give +12 item from an npc
unless the code to give the item in the code is correct the i kinda knew that the code for link back was wierd because its supposed to be Control
10/08/2010 23:58 pro4never#5
You must have an add item function already... if not items wouldn't really work in the source.

All it is is generating a new item (adding to database) and sending item info packet to client) I would be seriously shocked if NO add item function existed in your source at all..
10/09/2010 00:23 biohazardous#6
Quote:
Originally Posted by pro4never View Post
You must have an add item function already... if not items wouldn't really work in the source.

All it is is generating a new item (adding to database) and sending item info packet to client) I would be seriously shocked if NO add item function existed in your source at all..
like /item BuriedBlade Super 12 7 255 13 13
but in code form how would i do that
cause i want to make an npc who sells full +12 packs
and if its possible what is the code for Blazehoof,SPitfire, etc.. steeds
i want to make npc who sell that stuff i know how to make npc and stuff but i dont know the codes to make them
10/09/2010 01:51 onebitch#7
Why make a NPC for this ... why dont you make item boxs for each class and sell them from the vip shop.
10/09/2010 02:05 biohazardous#8
Quote:
Originally Posted by onebitch View Post
Why make a NPC for this ... why dont you make item boxs for each class and sell them from the vip shop.
how?
10/09/2010 02:18 tomtucker#9
Quote:
Originally Posted by onebitch View Post
Why make a NPC for this ... why dont you make item boxs for each class and sell them from the vip shop.
that will take more time than an npc
10/09/2010 02:51 Macnoo#10
Quote:
Originally Posted by tomtucker View Post
that will take more time than an npc
Yes would take abit more time to do, but would stop all them pointless npc that every pserver seems to have just for items to be sold from, every were you turn there is one and most could be done in to items and sold in shops. IE: take skill seller alot less code if made in to new skill book and sold in a shop.

The best way is not always the easiest way. And if someone does not want to put abit of hard work or time in to there server whats that going to tell you about how good its going to be:)