[Question]Npc selling moonbox.

05/06/2010 21:40 alex4war#1
hello,

i want a Npc in Twin City who is selling Moonboxes for any price.
Could anybody tell me how to create that Npc?
05/06/2010 23:20 NeoN[PM]#2
Quote:
Originally Posted by alex4war View Post
hello,

i want a Npc in Twin City who is selling Moonboxes for any price.
Could anybody tell me how to create that Npc?

Code:
#region Promotion Item Seller
                            case 24:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would u like to buy any of these promotion items"));
                                        GC.AddSend(Packets.NPCLink("Eux Ores (10CPs)", 1));
                                        GC.AddSend(Packets.NPCLink("Emerald (10CPs)", 2));
                                        GC.AddSend(Packets.NPCLink("Meteor (13CPs)", 3));
                                        GC.AddSend(Packets.NPCLink("Moonbox (200CPs)", 4));
                                        GC.AddSend(Packets.NPCLink("Just Passing By", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.CPs >= 100)
                                        {
                                            GC.MyChar.CPs -= 100;
                                            GC.MyChar.AddItem(1072031);
                                        }
                                    }
                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.CPs >= 10)
                                        {
                                            GC.MyChar.CPs -= 10;
                                            GC.MyChar.AddItem(1080001);
                                        }
                                    }
                                    if (Control == 3)
                                    {
                                        if (GC.MyChar.CPs >= 13)
                                        {
                                            GC.MyChar.CPs -= 13;
                                            GC.MyChar.AddItem(1088001);
                                        }
                                    }
                                    if (Control == 4)
                                    {
                                        if (GC.MyChar.CPs >= 200)
                                        {
                                            GC.MyChar.CPs -= 200;
                                            GC.MyChar.AddItem(721020);
                                        }
                                    }
                                    break;
                                }
                            #endregion

also add this at the bottom in NPCs.txt

Code:
24 1390 2 0 1002 382 341
Press thanks if it helped :)
05/08/2010 19:58 ftp4life#3
do you know why im getting an error saying this (my ID is 24) and nothing else
05/08/2010 22:06 alex4war#4
It Says Hi,i dont talk my ID is 24
05/08/2010 22:37 pintser#5
u maybe already have an NPC who's case is "24"
Make it Case 030208..

change in NPC.txt here:
Code:
24 1390 2 0 1002 382 341
Will be:
Code:
030208 1390 2 0 1002 382 341


In NPCDialog.cs
will be this:
Code:
#region Promotion Item Seller
                            case 030208:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would u like to buy any of these promotion items"));
                                        GC.AddSend(Packets.NPCLink("Eux Ores (10CPs)", 1));
                                        GC.AddSend(Packets.NPCLink("Emerald (10CPs)", 2));
                                        GC.AddSend(Packets.NPCLink("Meteor (13CPs)", 3));
                                        GC.AddSend(Packets.NPCLink("Moonbox (200CPs)", 4));
                                        GC.AddSend(Packets.NPCLink("Just Passing By", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.CPs >= 100)
                                        {
                                            GC.MyChar.CPs -= 100;
                                            GC.MyChar.AddItem(1072031);
                                        }
                                    }
                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.CPs >= 10)
                                        {
                                            GC.MyChar.CPs -= 10;
                                            GC.MyChar.AddItem(1080001);
                                        }
                                    }
                                    if (Control == 3)
                                    {
                                        if (GC.MyChar.CPs >= 13)
                                        {
                                            GC.MyChar.CPs -= 13;
                                            GC.MyChar.AddItem(1088001);
                                        }
                                    }
                                    if (Control == 4)
                                    {
                                        if (GC.MyChar.CPs >= 200)
                                        {
                                            GC.MyChar.CPs -= 200;
                                            GC.MyChar.AddItem(721020);
                                        }
                                    }
                                    break;
                                }
                            #endregion
Still thanks for neon
05/08/2010 22:49 NeoN[PM]#6
Quote:
Originally Posted by pintser View Post
u maybe already have an NPC who's case is "24"
Make it Case 030208..

change in NPC.txt here:
Code:
24 1390 2 0 1002 382 341
Will be:
Code:
030208 1390 2 0 1002 382 341


In NPCDialog.cs
will be this:
Code:
#region Promotion Item Seller
                            case 030208:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would u like to buy any of these promotion items"));
                                        GC.AddSend(Packets.NPCLink("Eux Ores (10CPs)", 1));
                                        GC.AddSend(Packets.NPCLink("Emerald (10CPs)", 2));
                                        GC.AddSend(Packets.NPCLink("Meteor (13CPs)", 3));
                                        GC.AddSend(Packets.NPCLink("Moonbox (200CPs)", 4));
                                        GC.AddSend(Packets.NPCLink("Just Passing By", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (Control == 1)
                                    {
                                        if (GC.MyChar.CPs >= 100)
                                        {
                                            GC.MyChar.CPs -= 100;
                                            GC.MyChar.AddItem(1072031);
                                        }
                                    }
                                    if (Control == 2)
                                    {
                                        if (GC.MyChar.CPs >= 10)
                                        {
                                            GC.MyChar.CPs -= 10;
                                            GC.MyChar.AddItem(1080001);
                                        }
                                    }
                                    if (Control == 3)
                                    {
                                        if (GC.MyChar.CPs >= 13)
                                        {
                                            GC.MyChar.CPs -= 13;
                                            GC.MyChar.AddItem(1088001);
                                        }
                                    }
                                    if (Control == 4)
                                    {
                                        if (GC.MyChar.CPs >= 200)
                                        {
                                            GC.MyChar.CPs -= 200;
                                            GC.MyChar.AddItem(721020);
                                        }
                                    }
                                    break;
                                }
                            #endregion
Still thanks for neon

Thanks :) Dident think about "ID is already in use" ^^
05/08/2010 23:02 pintser#7
;) np...
05/09/2010 12:56 alex4war#8
She says hi, i dont talk anything useful yet, my id is 30208 i did everything you say. help me?
05/09/2010 13:47 pintser#9
did u put it in NPc.Dialog?
are u using 5165?
05/09/2010 15:38 alex4war#10
yes and yes
05/09/2010 15:42 pintser#11
Add me on msn, email is in PM
05/09/2010 16:54 ftp4life#12
okay i had fixed it but now i cant even use the moon box it says not added yet its for promotion use only and it doesnt work for promo either u got any idea bout that bro?
05/09/2010 17:09 pintser#13
look in youre: items.txt
Search for moonbox

Look if there are 2 diffrent itemtypes..(7 numbers long i thought)
then just compare them in youre promotion Npc code..
and if needed change them.
05/09/2010 18:14 ftp4life#14
how bout i send u my 2 files and tell me wth is wrong with them
05/09/2010 19:21 MonstersAbroad#15
Here it is WORKING RIGHT ID and a faster way to do npc's
Code:
#region MoobBox seller
                            case 559988:
                                {
                                    switch (Control)
                                    {
                                        case 0:
                                            Say("Would you like to MooobBox for 1000CPs ?", GC);
                                            Link("Yes", 2, GC);
                                            Link("No", 255, GC);
                                            break;

                                        case 2:
                                            if (GC.MyChar.CPs == 1000)
                                            {
                                                GC.MyChar.AddItem(721080);
                                                Say("There you are!", GC);
                                                Link("Thanks", 255, GC);
                                            }
                                            else
                                            {
                                                Say("You do not have enough CPs", GC);
                                                Link("Ok", 255, GC);
                                            }
                                            break;
                                    }
                                    Face(N.Avatar, GC);
                                    Finish(GC);
                                    break;
                                }
                            #endregion
and if you npcs are not like that do this

Change:
- Text to GC.AddSend(Packets.NPCSay
- Link to GC.AddSend(Packets.NPCLink
- Finish(GC) to GC.AddSend(Packets.NPCFinish());
- Face(N.Avatar, GC) to GC.AddSend(Packets.NpcSetFace(N.Avater));

and add this to OldCODB/NPCs.txt
Code:
559988 1390 2 0 1002 382 341