[Release]2 Npcs

06/25/2009 23:26 duddz#1
These are my first 2 ever npcs. I coded them with the help of several other codes.
This code will Trade in the amulet for the gear.
Code:
case 10062: //Magic Artisan
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hi. Gear here.", CSocket);
                            Link("Trojan", 1, CSocket);
                            Link("Warrior", 2, CSocket);
                            Link("Ninja", 3, CSocket);
                            Link("Water", 4, CSocket);
                            Link("Fire", 5, CSocket);
                            Link("Archer", 6, CSocket);
                            Link("Nevermind", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 710012)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(130009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LeatherArmor
                                AddItem(410019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LeafBlade
                                AddItem(480019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//RattanClub
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(150019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//CopperRing
                                AddItem(120009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LightNecklace
                                AddItem(118009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//GuardCoronet
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 710011)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(131009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideArmor
                                AddItem(480019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//RattanClub
                                AddItem(900009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//SoftSheild
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(150019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//CopperRing
                                AddItem(120009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LightNecklace
                                AddItem(111009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//IronHelment
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 3)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 723583)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(135009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LowerNinjaVest
                                AddItem(601019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//IronKatana
                                AddItem(601019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//IronKatana
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(150019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//CopperRing
                                AddItem(120009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LightNecklace
                                AddItem(112009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//FortitudeVeil
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 4)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 710014)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(134009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//TaoRobe
                                AddItem(421019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//SpellBacksword
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(152019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//PeachBraclet
                                AddItem(121009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//PerfumeBag
                                AddItem(114009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//DestinyCap
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 5)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 710013)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(134009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//TaoRobe
                                AddItem(421019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//SpellBacksword
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(152019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//PeachBraclet
                                AddItem(121009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//PerfumeBag
                                AddItem(114009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//DestinyCap
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 6)
                        {
                            int AMUID = 0;
                            int AMcount = 0;

                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                if (Item.ItemID == 710015)
                                {
                                    AMUID = Item.UID;
                                    AMcount++;
                                }
                            }


                            if (AMcount >= 1)
                            {
                                AddItem(133009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//DeerskinCoat
                                AddItem(500019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//HuntingBow
                                AddItem(160019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//OxhideBoots
                                AddItem(150019, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//CopperRing
                                AddItem(120009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//LightNecklace
                                AddItem(113009, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);//BadgerHat
                                CSocket.Client.Inventory.Remove(AMUID);
                                CSocket.Send(ConquerPacket.ItemUsage(AMUID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(AMUID);
                                Text("Theres Your gear", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("You don't have a Amulet", CSocket);
                                Link("Bye", 255, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
And this one will Sell you the Amulets.
Code:
case 390: //Love Stone
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hiya There!  Would you like to buy an Amulet? It will Cost you $100,000", CSocket);
                            Link("Yes I sure would!", 1, CSocket);
                            Link("No Not today.", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            Text("What Class are you?", CSocket);
                            Link("Trojan", 2, CSocket);
                            Link("Warrior", 3, CSocket);
                            Link("Ninja", 4, CSocket);
                            Link("Archer", 5, CSocket);
                            Link("Fire Taoist", 6, CSocket);
                            Link("Water Taoist", 7, CSocket);
                            Link("Nevermind", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 2)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710012, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 3)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710011, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 4)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(723583, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 5)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710015, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 6)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710013, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }

                        }
                        else if (LinkBack == 7)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710014, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        break;
                    }
I have a question tho, How do you make it so an Archer Cant Buy the Amulet or Trade the amulet for say Trojan gears.
06/26/2009 04:00 CIRASH#2
tell it if job doesnt equal an archer id then it cancels and the npc says sorry you are not a archer.
06/26/2009 08:47 mejo33#3
Quote:
Originally Posted by duddz View Post
These are my first 2 ever npcs. I coded them with the help of several other codes.
This code will Trade in the amulet for the gear.
And this one will Sell you the Amulets.
Code:
case 390: //Love Stone
                    {
                        if (LinkBack == 0)
                        {
                            Text("Hiya There!  Would you like to buy an Amulet? It will Cost you $100,000", CSocket);
                            Link("Yes I sure would!", 1, CSocket);
                            Link("No Not today.", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            Text("What Class are you?", CSocket);
                            Link("Trojan", 2, CSocket);
                            Link("Warrior", 3, CSocket);
                            Link("Ninja", 4, CSocket);
                            Link("Archer", 5, CSocket);
                            Link("Fire Taoist", 6, CSocket);
                            Link("Water Taoist", 7, CSocket);
                            Link("Nevermind", 255, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 2)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710012, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 3)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710011, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 4)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(723583, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 5)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710015, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        else if (LinkBack == 6)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710013, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }

                        }
                        else if (LinkBack == 7)
                        {
                            if (CSocket.Client.Money >= 100000)
                            {
                                AddItem(710014, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
                                Money(-100000, CSocket);
                            }
                        }
                        break;
                    }
I have a question tho, How do you make it so an Archer Cant Buy the Amulet or Trade the amulet for say Trojan gears.
Well, its easy :)
Quote:
else if (LinkBack == 2)
{
if (CSocket.Client.Money >= 100000)
{
AddItem(710012, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
Money(-100000, CSocket);
}
}
replace
Quote:
if (CSocket.Client.Money >= 100000)
to
Quote:
if (CSocket.Client.Money >= 100000)
if (CSocket.Client.Profession >= 15)
and
Quote:
{
AddItem(710012, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
Money(-100000, CSocket);
}
add
Quote:
{
AddItem(710012, 0, 0, 0, 0, 0, 0, 0, 0, 0, CSocket);
Money(-100000, CSocket);
}
else if
{
Text("You dont have money or please chose your profession.", CSocket);
Link("Aww, bye.", 255, CSocket);
End(CSocket);
}
I DONT TEST IT
06/26/2009 09:30 duddz#4
Quote:
Originally Posted by mejo33 View Post
Well, its easy :)

replace

to

and

add


I DONT TEST IT
It didnt work, Profession gave me the error.
06/26/2009 17:05 dextercsar#5
I have error with ADDitem does not accept 11 itens Help!!
06/26/2009 18:10 PeTe Ninja#6
well if you rewrote part of it you can make it so it will be first by professions like

if (Client.Profssion = 15)
{
stuff in here ( i think u want tro only rihgt? so itsl ike 10-15
}
else
{
your not a tro fool
}

if you tell me which jobs you want i can try and code this for you like the way i mean it if you want ... i dont use coemvu2 but i can help
06/26/2009 20:29 duddz#7
Quote:
Originally Posted by dextercsar View Post
I have error with ADDitem does not accept 11 itens Help!!
Find The Wuxing Oven guide and do that first.

Quote:
Originally Posted by PeTe Ninja View Post
well if you rewrote part of it you can make it so it will be first by professions like

if (Client.Profssion = 15)
{
stuff in here ( i think u want tro only rihgt? so itsl ike 10-15
}
else
{
your not a tro fool
}

if you tell me which jobs you want i can try and code this for you like the way i mean it if you want ... i dont use coemvu2 but i can help
Well Trojan, Warrior, Archer, Ninja, Water and Fire lol.
I think i know what your mean but lets see what you come up with, you only need to come up with one so that job 10 through 15 can get it and i can figure it out.
06/27/2009 03:10 m7med#8
I HAVE THIS ERROR
[Only registered and activated users can see links. Click Here To Register...]
HELP
06/27/2009 03:45 duddz#9
Quote:
Originally Posted by m7med View Post
I HAVE THIS ERROR
[Only registered and activated users can see links. Click Here To Register...]
HELP
take out 1 zero from each thing
or follow wuxing oven guide
07/08/2009 12:37 JustChillin#10
How can i make new item like ones That Look like the Amulet but name like "TrojanGear" or "WaterGear"...