Register for your free account! | Forgot your password?

You last visited: Today at 10:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



NPC error.

Discussion on NPC error. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2009
Posts: 14
Received Thanks: 0
NPC error.

Ok so, here I am again. With yet another problem

I decided to make an npc that sells you stuff. So i started off small.

I added this to the NPCDialogue.cs
NPCDialogue.cs


Code:
#region MeteoraTrophySeller
                            case 123789:
                                {
                                     if (option == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Welcome.I can sell you special items here"));
                                        GC.AddSend(Packets.NPCLink("Cool, what ya got?", 1));
                                        GC.AddSend(Packets.NPCLink("No thanks, I'm special enough.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                     }
                                    if (option == 1)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would you like any of these items?"));
                                        GC.AddSend(Packets.NPCLink("GoldTrophy - 500k cps", 2));                    
                                        GC.AddSend(Packets.NPCLink("I'm too broke for these", 255));
                                        GC.AddSend(Packets.NPCSetFace(15));
                                        GC.AddSend(Packets.NPCFinish());
                                    }
                                    if (option == 2)
                                    {
                                        if (GC.MyChar.CPs >= 500000)
                                        {
                                            GC.MyChar.CPs -= 500000;
                                            GC.MyChar.AddItem(2100085-12-7-255-13-13);
                                            GC.AddSend(Packets.NPCSay("Here you are."));
                                            GC.AddSend(Packets.NPCLink("Thanks.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                        else
                                        {
                                            GC.AddSend(Packets.NPCSay("You don't have enough Cps."));
                                            GC.AddSend(Packets.NPCLink("I see.", 255));
                                            GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                            GC.AddSend(Packets.NPCFinish());
                                        }
                                    }
                                  
                                }
                                break;
                               #endregion
And this to the NPCs.txt
Quote:
123789 4194 2 0 1036 200 200
After that, I tried running the server. And got this error.

And now the server won't start. :S. Don't make fun, just answer.
Golden11 is offline  
Old 07/21/2011, 21:21   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Can you do a Console.WriteLine(Info[6]); ?
Would be easier as it seems like you're parsing a string, that's not numeric.

Ex. You cannot parse
Code:
int i = int.Parse("123a");
BaussHacker is offline  
Old 07/21/2011, 22:11   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 14
Received Thanks: 0
Eh, found the problem.
Case id was too big
Golden11 is offline  
Reply




All times are GMT +1. The time now is 10:25.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.