[Release]Birth Village NPC Give Out Newbie Item Followed by Ur Class

07/05/2009 10:55 xXVamXx#1
Hi Guy Here are the code for Birth Village NPC Giving out Newbie Item followed by your Class rank.

Code:
case 1060://Welcome Guy
                    {
                        if (LinkBack == 0)
                        {
                            Text("Ahhh! Another traveller... But is he ready for adventure? Does he possess all the skills of the true conqueror?", CSocket);
                            Link("Where Am I?", 1, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("This is the birth Village, young one.", CSocket);
                                Text("Our Goddess ShaiYa have choosen you as our Generation Heroes.", CSocket);
                                Text("Soon you will see one by one heroes will be born here.", CSocket);
                                Text("So learn as much skill as possible Young one.", CSocket);
                                Text("Here you will learn the skills of a Warrior an Archer a Trojan a Taoist an a Ninja.", CSocket);
                                Text("The teahcers of the birth village are wise and helpful... but will you choose to listen?", CSocket);
                                Link("Yes. Tell me more.", 2, CSocket);
                                Link("Lessons bore me. Let's get straight to the action !", 4, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if ((int)CSocket.Client.Class >= 20 && (int)CSocket.Client.Class <= 25)
                            {
                                Text("A Warrior is born to be a leader who will lead people to a safe land.And A Warrior is also blessed by the Ancient Chinese Heros GuanYu.", CSocket);
                                Text("Follow his Steps and you will be always be remember and people will workship you.", CSocket);
                                Link("Please teleport me to the Village Of Birth", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 10 && (int)CSocket.Client.Class <= 15)
                            {
                                Text("A Trojan is born to be self action.", CSocket);
                                Text("They fight in one heart till death to protect their love one.", CSocket);
                                Text("Follow the step of the Spartan and you will always be remembered as a great one.", CSocket);
                                Link("Please teleport me to the Village Of Birth", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 50 && (int)CSocket.Client.Class <= 55)
                            {
                                Text("A Ninja is born to be a quick and silent killer.", CSocket);
                                Text("Although they are fast and silent but they have their weakness.They cant be love or in love.", CSocket);
                                Text("As an ancient Asia Culture follow the Step of the Yamagachi Tribes and one day you will rule the World.", CSocket);
                                Link("Please teleport me to the Village Of Birth", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                            {
                                Text("Priest and Taoist em...I hope you turn out to be a good one ha ha ha just kidding.", CSocket);
                                Text("Well here Priest and Taoist they are expert in magical thing although I dont really envy the magical Stuff. ", CSocket);
                                Text("But Priest and Taoist are the helper for all Ruler but beware of what type of Ruler you followed.", CSocket);
                                Text("Rinse your Ruler till he Conquer the World Like Zhuge Liang Does in the Era of the Three Kingdom.", CSocket);
                                Link("Please teleport me to the Village Of Birth", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 40 && (int)CSocket.Client.Class <= 45)
                            {
                                Text("Mystical Archer...A long Range fighter.Kill without coming to nearer.", CSocket);
                                Text("Well the most I envy.Archer are born to be defence the compound. ", CSocket);
                                Text("But the weakness of archer is that they are weak in defending themselves.", CSocket);
                                Text("Archer also is important to all tribes coz without archer the land that the ruler control will Fall.", CSocket);
                                Link("Please teleport me to the Village Of Birth", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 3)
                        {
                            {
                                Teleport(1010, 090, 075, 0, CSocket);
                            }
                        }
                        else if (LinkBack == 4)
                        {
                            {
                                Text("Are Sure you dont want to listen to your Class history?", CSocket);
                                Link("Well Tell me from the very begining.Where Am I now?", 1, CSocket);
                                Link("Teleport me, please.", 3, CSocket);
                                Link("No thanks I can walk", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
                case 10008://Phermacist Bitch
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hi! I am selling all kinds of potions and City gate scrolls in the cities. I also   sell fireworks and skill books in the market.", CSocket);
                            Link("What Potions?", 1, CSocket);
                            Link("Consult others.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("Healing and mana potions. Healing potions can make you healthy, and mana potions will enable you to cast spells.", CSocket);
                                Text("That is all. If you have not talked to others NPCs, you had better have a chat with them so that you can learn more.", CSocket);
                                Link("Do you have any potion to gave me???", 2, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            {
                                int[] items = { 1002020, 1002020, 1002020, 1002010, 1002010, 1002010 };
                                foreach (int i in items)
                                {
                                    AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                }
                                Link("Thanks Man.", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        break;
                    }
                case 10007://Armorer dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Armorers swear only to provide the very best in defense. Whether it's robes or helmets, we stock it all.", CSocket);
                            Link("I see. Where can I find an armorer?", 1, CSocket);
                            Link("Consult others.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("Every city or major settlement has one. But our armors very best from place to place. Some armorers have better helms, while others specialize in mail or helms.", CSocket);
                                Text("Just to be sure to buy armor without red text in the description. You won't be able to wear those!", CSocket);
                                Text("Here are some basic armor that i can offer you great hero.", CSocket);
                                Link("Oh Thank You.", 2, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            if ((int)CSocket.Client.Class >= 50 && (int)CSocket.Client.Class <= 55)
                            {
                                int[] items = { 150019, 135009, 135019, 132019, 120009, 160019 };
                                foreach (int i in items)
                                {
                                    AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                }
                                Link("Thanks Man.", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        if ((int)CSocket.Client.Class >= 10 && (int)CSocket.Client.Class <= 15)
                        {
                            int[] items = { 150019, 120009, 160019, 130009 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 40 && (int)CSocket.Client.Class <= 45)
                        {
                            int[] items = { 150019, 120009, 160019, 133009 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 20 && (int)CSocket.Client.Class <= 25)
                        {
                            int[] items = { 150019, 120009, 160019, 131009 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                        {
                            int[] items = { 150019, 120009, 160019, 134009 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        break;
                    }
                case 10006://Warehouseman dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Welcome! I run warehouse in every city. You can store your money and items in my warehouses, and retrieve them for free.", CSocket);
                            Link("Cool. How do I use them?", 1, CSocket);
                            Link("Consult others.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("First, you find my warehouse men in your city, cick on him and see your storage box open up. To deposit money, enter the amount in the bank field before clicking Deposit.", CSocket);
                                Text(" Withdrawing money is the same. If you want to put items in your storage space, just drag and drop. Taking them out only requires one click. Also, your money is totalled from all warehouses.", CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
                case 10005://BlackSmith dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Us blacksmiths can be found from North to South, East to West. We promise a fine selection of weapons for you to purchase!", CSocket);
                            Link("Hmmmm, tell me more.", 1, CSocket);
                            Link("Consult others.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("Let me tell you how to choose a good weapon. Hover your mouse pointer over the weapon, check its stats and find a weapon with all white writing. If there's red text, you won't be able to use it.", CSocket);
                                Text(" After you buy it, you open your backpack, find the right item and right-click it to equip. It's as easy as that! Oh, and to sell an item, you just drag and drop to my shop!", CSocket);
                                Link("What about repairs?", 2, CSocket);
                                Link("Consult others.", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            {
                                Text("First, unequip the item by double-clicking it in your status window. Then find me, click my repair button and click the item.", CSocket);
                                Link("Any other tips?", 3, CSocket);
                                Link("Consult others.", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        else if (LinkBack == 3)
                        {
                            {
                                Text("Yeah, some items are high quality: Normal, Refined, Unique, Elite, Super. That's specialist stuff, only found in the market. That is all. If you have not talked to other NPCs, you had better have a chat with them so that you can learn more.", CSocket);
                                Link("Is there any weapon that you can gave me now?", 4, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        else if (LinkBack == 4)
                        {
                            if ((int)CSocket.Client.Class >= 50 && (int)CSocket.Client.Class <= 55)
                            {
                                int[] items = { 601009, 601019, 601029 };
                                foreach (int i in items)
                                {
                                    AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                }
                                Link("Thanks Man.", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                        }
                        if ((int)CSocket.Client.Class >= 10 && (int)CSocket.Client.Class <= 15)
                        {
                            int[] items = { 410009, 410019, 410029 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 40 && (int)CSocket.Client.Class <= 45)
                        {
                            int[] items = { 500009, 500019, 500029 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 20 && (int)CSocket.Client.Class <= 25)
                        {
                            int[] items = { 420009, 420019, 420029 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                        {
                            int[] items = { 421009, 421019, 421029 };
                            foreach (int i in items)
                            {
                                AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                            }
                            Link("Thanks Man.", 255, CSocket);
                            Face(30, CSocket); End(CSocket);
                        }
                        break;
                    }
                case 10004://Vilage viseguy dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Well, if you want to talk to any NPCs, just click them. Easy, huh?", CSocket);
                            Link("About my class...", 1, CSocket);
                            Link("Ah, Forget about it.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if ((int)CSocket.Client.Class >= 50 && (int)CSocket.Client.Class <= 55)
                            {
                                {
                                    Text("The Ninja is an expert in various oriental weapons, boasting swift and powerful melee attack skills. I know somebody. In Twim City there are merchants I know. you go talk to them, they'll sort you out. Got it?", CSocket);
                                    Link("I see. Thanks.", 255, CSocket);
                                    Face(30, CSocket);
                                    End(CSocket);
                                }
                            }
                            if ((int)CSocket.Client.Class >= 10 && (int)CSocket.Client.Class <= 15)
                            {
                                Text("The Trojan is an expert in various oriental weapons, dual wield and a powerful melee attack skills. I know somebody. In Twim City there are merchants I know. you go talk to them, they'll sort you out. Got it?", CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 40 && (int)CSocket.Client.Class <= 45)
                            {
                                Text("The Archer is an expert in Ranged oriental weapons, Powerful Ranged attack skills. I know somebody. In Twim City there are merchants I know. you go talk to them, they'll sort you out. Got it?", CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 20 && (int)CSocket.Client.Class <= 25)
                            {
                                Text("The Warrior is an expert in various oriental weapons, two handed weapons, Sheald and a powerful melee attack skills. I know somebody. In Twim City there are merchants I know. you go talk to them, they'll sort you out. Got it?", CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                            {
                                Text("The Taoist is an expert in various Magic Spells, powerful melee Spells and skills. I know somebody. In Twim City there are merchants I know. you go talk to them, they'll sort you out. Got it?", CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
                case 10055://taoiststar dude
                    {
                        if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                        {
                            if (LinkBack == 0)
                            {
                                Text("The Taoist is an expert in various Magic Spells, powerful melee Spells and skills.", CSocket);
                                Link("More info, please.", 1, CSocket);
                                Link("I see. Thanks.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else if (LinkBack == 1)
                            {
                                {
                                    Text("The Taoist is an expert in various Magic Spells, powerful melee Spells and skills.", CSocket);
                                    Text("I cna teach you Cure and Thunder Skill.", CSocket);
                                    Link("Sweet dude Teach me Cure.", 2, CSocket);
                                    Link("Sweet dude Teach me Thunder.", 3, CSocket);
                                    Link("I see. Thanks.", 255, CSocket);
                                    Face(30, CSocket);
                                    End(CSocket);
                                }
                            }
                            else if (LinkBack == 2)
                            {
                                int SkillID = 1005;
                                {
                                    if (!CSocket.Client.Skills.ContainsKey(SkillID))
                                    {
                                        Struct.CharSkill Skill = new Struct.CharSkill();
                                        Skill.ID = SkillID;
                                        Skill.Level = 0;
                                        Skill.Exp = 0;
                                        CSocket.Client.Skills.Add(Skill.ID, Skill);
                                        Database.Database.SetSkill(Skill.ID, Skill.Level, Skill.Exp, CSocket.Client.ID, false);
                                        CSocket.Send(ConquerPacket.Skill(Skill.ID, Skill.Level, Skill.Exp));
                                    }
                                    Text("Congrats! You have learned Cure skill.", CSocket);
                                    Link("Thanks!", 255, CSocket);
                                    Face(30, CSocket); End(CSocket);
                                }
                            }
                            else if (LinkBack == 3)
                            {
                                int SkillID = 1000;
                                {
                                    if (!CSocket.Client.Skills.ContainsKey(SkillID))
                                    {
                                        Struct.CharSkill Skill = new Struct.CharSkill();
                                        Skill.ID = SkillID;
                                        Skill.Level = 0;
                                        Skill.Exp = 0;
                                        CSocket.Client.Skills.Add(Skill.ID, Skill);
                                        Database.Database.SetSkill(Skill.ID, Skill.Level, Skill.Exp, CSocket.Client.ID, false);
                                        CSocket.Send(ConquerPacket.Skill(Skill.ID, Skill.Level, Skill.Exp));
                                    }
                                    Text("Congrats! You have learned Thunder skill.", CSocket);
                                    Link("Thanks!", 255, CSocket);
                                    Face(30, CSocket); End(CSocket);
                                }
                            }
                        }
                        else
                        {
                            Text("Only Taoist's can learn what I have to teach. I cannot help you, young one.", CSocket);
                            Link("I see. Thanks.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        break;
                    }
                case 10009://idiot dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hello, new blood! Welcome! It is good that you selected This class!", CSocket);
                            Link("Thank you.", 1, CSocket);
                            Link("Not a chance. Leave me be!", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if ((int)CSocket.Client.Class >= 50 && (int)CSocket.Client.Class <= 55)
                            {
                                {
                                    Text("Some handy weapons are essential for Ninjas. But you'd never do that, Cause your're my friend now, right?", CSocket);
                                    Link("Sure.... I'll be back in my next life.", 255, CSocket);
                                    Face(30, CSocket);
                                    End(CSocket);
                                }
                            }
                            if ((int)CSocket.Client.Class >= 10 && (int)CSocket.Client.Class <= 15)
                            {
                                Text("Some handy weapons are essential for Trojans. But you'd never do that, Cause your're my friend now, right?", CSocket);
                                Link("Sure.... I'll be back in my next life.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 40 && (int)CSocket.Client.Class <= 45)
                            {
                                Text("Some handy weapons are essential for Archers. But you'd never do that, Cause your're my friend now, right?", CSocket);
                                Link("Sure.... I'll be back in my next life.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 20 && (int)CSocket.Client.Class <= 25)
                            {
                                Text("Some handy weapons are essential for Warriors. But you'd never do that, Cause your're my friend now, right?", CSocket);
                                Link("Sure.... I'll be back in my next life.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            if ((int)CSocket.Client.Class >= 100 && (int)CSocket.Client.Class <= 102)
                            {
                                Text("Some handy weapons are essential for Taoists. But you'd never do that, Cause your're my friend now, right?", CSocket);
                                Link("Sure.... I'll be back in my next life.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
                case 425://Old general yang dude
                        {
                            if (LinkBack == 0)
                            {
                                Text("I will teach you a basic weapon skill. ", CSocket);
                                Link("Ok I'm ready !", 1, CSocket);
                                Link("Thanks anyway...", 255, CSocket);
                                Face(30, CSocket); End(CSocket);
                            }
                            else if (LinkBack == 1)
                            {
                                {
                                    Text("Take this scroll and learn the art of fighting !", CSocket);
                                    int[] items = { 725005, 725002, 725012, 725025 };
                                    foreach (int i in items)
                                    {
                                        AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                    }
                                    Link("Thanks Man.", 255, CSocket);
                                    Face(30, CSocket); End(CSocket);
                                }
                            }
                        break;
                    }
                case 10010://Village gateman dude
                    {
                        if (LinkBack == 0)
                        {
                            Text("Well, with time the tremendous efforts, you will sure have a brilliant future in Twim City. Now, are you ready to visit Twim City?", CSocket);
                            Link("I need more advice.", 1, CSocket);
                            Link("Send me to Twim City.", 2, CSocket);
                            Link("I'll take a look around here.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            {
                                Text("You'll soon be in Twim city. I advise you not to stray too far from the city gates. Don't leave the Wind Plains until you're truly ready.", CSocket);
                                Text(" I wouldn't even cross the river until you've visited the job center and got a promotion. Open your backpack and drag some potions down into the quick item bar (use the F1-F10 Keys to active.) That'll help you stay alive.... Well, good luck.", CSocket);
                                Link("Thanks.", 2, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            Teleport(1002, 439, 390, 0, CSocket);
                        }
                        break;
                    }
If there any error on your AddItem(i, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket); just delete 1 of the 0, on it.
07/05/2009 20:34 pro4never#2
Interesting, I have a similar thing in place on my server info npc. It has an option for free items, an option for stats, an option for prof and an option for skills.

Each of those simply reads your class and gives out the appropriate settings (eg, clicking stats will check your job, promote you to highest class for your job, set your stats (based on job, will NOT lower stats if you already have higher stats then you should. This is so gms/players with boosted stats from rare drops wont loose them) and then up you to lvl 120.

Nice idea doing it for the birth village though, although I think the script could get fairly long if you are doing it for alot of text options just to change one or two words, you would be better off using a command to print the class name in there instead.

Simply a matter of preference though, I just wouldn't want to have to code all the if statements simply to change a few bits of text based on class.
07/06/2009 07:31 xXVamXx#3
Hi actually for the Birth Village PC i been cracking my brain on how can npc gave newbie item followed by class as u know I'm just a new learner.

And I been try to edit next NPC Weapon Master text and link are all done but I'm stuck at the packet for using DragonBall to level up item.

Can u gave me some guide on that I have been trying alot of ways to edit it but all fail I even use the Craft format thing like wux oven thing but also fail after i put item and DragonBall thers a msg can out unknown type 1028. Now I'm lost.
07/06/2009 08:38 pro4never#4
Quote:
Originally Posted by xXVamXx View Post
Hi actually for the Birth Village PC i been cracking my brain on how can npc gave newbie item followed by class as u know I'm just a new learner.

And I been try to edit next NPC Weapon Master text and link are all done but I'm stuck at the packet for using DragonBall to level up item.

Can u gave me some guide on that I have been trying alot of ways to edit it but all fail I even use the Craft format thing like wux oven thing but also fail after i put item and DragonBall thers a msg can out unknown type 1028. Now I'm lost.

Your best bet would be looking in chat.cs. That has all the gm commands and many of them will relate to what you are wanting to do.

I posted a few different functions that can be used when scripting npcs a few days back, that might be of some use for you.

[Only registered and activated users can see links. Click Here To Register...]


Basically for adding a level you are going to do

Code:
{
                                        CSocket.Client.Level += 1;//number of levels to raise
                                        CSocket.Client.Exp = 0;
                                        CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Level, Struct.StatusTypes.Level));//sends the actual packet
                                        ConquerPacket.ToLocal(ConquerPacket.Effect(CSocket.Client.ID, "LevelUp"), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);//displays the level up effect
                                        

                            };

For the db npc you will want something to check if you have db's in inventory (you want it to be 1 db for a lvl up? or what?)

Code:
{
                            int GMUID = 0;
                            int GMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 1088000)///code for a db
                                {
                                    GMUID = Item.UID;
                                    GMcount++;
                                }
                            }
                            if (GMcount >= 1)//number of db's
                            {
                                
                                CSocket.Client.Inventory.Remove(GMUID);///removes the db's
                                CSocket.Send(ConquerPacket.ItemUsage(GMUID, 255, Struct.ItemUsage.RemoveItem));///updates client
                                Database.Database.DeleteItem(GMUID);//deletes item
                                
                                Text("You know have successfully leveled up!" , CSocket);
                                Link("Thanks", 255, CSocket);                               
                                End(CSocket);
                            }
                            else
                            {
                                Text("You Dont have the db's!", CSocket);
                                Link("Ok", 255, CSocket);
                                End(CSocket);
                            }
                        }

Messy code, used sections from my met/db storage npc but that should give you an idea of how to start

Lemme know how it goes, thanks are appreciated.
07/06/2009 09:19 0105653642#5
first guyz is that working with CoEmu v2
07/06/2009 09:31 pro4never#6
Quote:
Originally Posted by 0105653642 View Post
first guyz is that working with CoEmu v2
Yupp, for the record anything I post is coemu2, I don't do other sources.

Also you can tell which source it is by the way it is coded usually (it takes a little bit to get used to but the scripts ARE different, you should learn the difference very quickly)

<edit>

I like when ppl make threads like this... mostly cause it makes me work on specific things :P

Just finished my db lvling npc. Although I just have it doing 1 level per db instead of scaling it to your level... although I could always do if level < 100 add this many if level < 110 add this many etc... but w/e. Db's drop damn often on my server anyways (or maybe it just seems like it cause of all my hunting to test out xp skills lol) and I didn't set a db lvling limit per day so it's all good.