Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 03:13

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

Advertisement



[RELEASE]THE FIRST NPC I'VE EVER CODED!

Discussion on [RELEASE]THE FIRST NPC I'VE EVER CODED! within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
airborne.'s Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
Post [RELEASE]THE FIRST NPC I'VE EVER CODED!

Omg the first NPC i've ever coded myself. For source 5165

What does it do? It changes your job for free.

In PacketHandling/NPCsDialog find
Code:
case 300002
Then add:

Code:
                            #region
                            case 300002:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would you like to change your job?"));
                                        GC.AddSend(Packets.NPCLink("Sure!", 1));
                                        GC.AddSend(Packets.NPCLink("No thanks.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    else if (Control == 1)
                                    {

                                        GC.AddSend(Packets.NPCSay("Alright choose the job."));
                                        GC.AddSend(Packets.NPCLink("Trojan", 3));
                                        GC.AddSend(Packets.NPCLink("Warrior", 4));
                                        GC.AddSend(Packets.NPCLink("Archer", 5));
                                        GC.AddSend(Packets.NPCLink("WaterTaoist", 6));
                                        GC.AddSend(Packets.NPCLink("FireTaoist", 7));
                                        GC.AddSend(Packets.NPCLink("Ninja", 8));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());

                                    }

                                    else if (Control == 3)
                                    {
                                        GC.MyChar.Job = 15;
                                    }
                                    else if (Control == 4)
                                    {
                                        GC.MyChar.Job  = 25;
                                    }
                                    else if (Control == 5)
                                    {
                                        GC.MyChar.Job = 45;
                                    }
                                    else if (Control == 6)
                                    {
                                        GC.MyChar.Job = 135;
                                    }
                                    else if (Control == 7)
                                    {
                                        GC.MyChar.Job = 145;
                                    }
                                    else if (Control == 8)
                                    {
                                        GC.MyChar.Job = 55;
                                        }
                                        break;
                                }
                            #endregion
+k if it was useful.
airborne. is offline  
Thanks
12 Users
Old 12/05/2009, 07:15   #2
 
elite*gold: 0
Join Date: Feb 2007
Posts: 268
Received Thanks: 49
Congratz
tere12 is offline  
Thanks
1 User
Old 12/05/2009, 07:17   #3
 
airborne.'s Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
Quote:
Originally Posted by tere12 View Post
Congratz
Thank you.
airborne. is offline  
Thanks
1 User
Old 12/05/2009, 11:12   #4
 
~*NewDuuDe*~'s Avatar
 
elite*gold: 111
Join Date: Feb 2008
Posts: 2,161
Received Thanks: 646
As you actually released this you should put in a bit more work, lol.
~*NewDuuDe*~ is offline  
Thanks
1 User
Old 12/05/2009, 11:53   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
Quote:
Originally Posted by BERGHUIS1 View Post
As you actually released this you should put in a bit more work, lol.
Well, no matter how easy this is, its his first NPC, probably his first code, so at least he tries to code. Good Luck Airborne, you know where to find me when you need help.
Basser is offline  
Thanks
2 Users
Old 12/05/2009, 12:10   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Now that wasnt so hard was it?

A nice little npc, and with a few more you should start to understand how the compiler works, the syntax, and begin to get to grasps with the language. And then you can start to work abit more on your source.
Korvacs is offline  
Thanks
3 Users
Old 12/05/2009, 12:38   #7
 
Sp!!ke's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
Congratz
Sp!!ke is offline  
Thanks
1 User
Old 12/05/2009, 13:30   #8
 
osamaazez's Avatar
 
elite*gold: 0
Join Date: Jun 2008
Posts: 76
Received Thanks: 3
thanks but i need to add it and i dont know how and no one want help me

__________________________________________________ _______________________
Thanks Any WAy
osamaazez is offline  
Old 12/05/2009, 13:33   #9
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
Good work buddy.

to add it put the ID of the NPC u want.
~Yuki~ is offline  
Thanks
1 User
Old 12/05/2009, 14:02   #10
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
good...
but have a way to make it more simple.... for example:
Code:
#region
                            case 300002:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would you like to change your job?"));
                                        GC.AddSend(Packets.NPCLink("Sure!", 1));
                                        GC.AddSend(Packets.NPCLink("No thanks.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    else if (Control == 1)
                                    {

                                        GC.AddSend(Packets.NPCSay("Alright choose the job."));
                                        GC.AddSend(Packets.NPCLink("Trojan", 15));
                                        GC.AddSend(Packets.NPCLink("Warrior", 25));
                                        GC.AddSend(Packets.NPCLink("Archer", 45));
                                        GC.AddSend(Packets.NPCLink("WaterTaoist", 135));
                                        GC.AddSend(Packets.NPCLink("FireTaoist", 145));
                                        GC.AddSend(Packets.NPCLink("Ninja", 55));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());

                                    }

                                    else if (Control >= 15 && Control <= 145)
                                    {
                                        GC.MyChar.Job = Control;
                                    }
                                        break;
                                }
                            #endregion
it's just an example... : D
12tails is offline  
Thanks
2 Users
Old 12/05/2009, 15:13   #11
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Congrats, And thanks for contrubuting for others that might need it. Nor want it
-Shunsui- is offline  
Old 12/05/2009, 15:28   #12
 
airborne.'s Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
Quote:
Originally Posted by 12tails View Post
good...
but have a way to make it more simple.... for example:
Code:
#region
                            case 300002:
                                {
                                    if (Control == 0)
                                    {
                                        GC.AddSend(Packets.NPCSay("Would you like to change your job?"));
                                        GC.AddSend(Packets.NPCLink("Sure!", 1));
                                        GC.AddSend(Packets.NPCLink("No thanks.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
                                    }

                                    else if (Control == 1)
                                    {

                                        GC.AddSend(Packets.NPCSay("Alright choose the job."));
                                        GC.AddSend(Packets.NPCLink("Trojan", 15));
                                        GC.AddSend(Packets.NPCLink("Warrior", 25));
                                        GC.AddSend(Packets.NPCLink("Archer", 45));
                                        GC.AddSend(Packets.NPCLink("WaterTaoist", 135));
                                        GC.AddSend(Packets.NPCLink("FireTaoist", 145));
                                        GC.AddSend(Packets.NPCLink("Ninja", 55));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());

                                    }

                                    else if (Control >= 15 && Control <= 145)
                                    {
                                        GC.MyChar.Job = Control;
                                    }
                                        break;
                                }
                            #endregion
it's just an example... : D
Hmmm I kind of see how it'll work. Thanks.
airborne. is offline  
Old 12/05/2009, 16:37   #13
 
elite*gold: 0
Join Date: Dec 2009
Posts: 13
Received Thanks: 11
NICE RELEASE BROTHA!!! !!! !!!
W0LVERINE is offline  
Thanks
1 User
Old 12/05/2009, 16:39   #14
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
In my opinion you should rather use 12tails' code than airborne.
That's only because its short and takes up less room and is simpler.
Arcо is offline  
Old 12/05/2009, 16:42   #15
 
airborne.'s Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
Quote:
Originally Posted by Tiku View Post
In my opinion you should rather use 12tails' code than airborne.
That's only because its short and takes up less room and is simpler.
Yes I agree, but it is my first code lol wasn't supposed to be the best.
airborne. is offline  
Reply


Similar Threads Similar Threads
[WTS] Silkroad Website Templates - Coded/Not-Coded. With .PSD!
11/30/2009 - Silkroad Online Trading - 4 Replies
Examples : There Is NO Examples at the moment. Prices : Price for a full coded website, with a CMS - users can register, write comments. Admin panel included , easy write to news. - 60$. Included : PSD , all files, FREE WEB HOSTING - 3 months.
Coded with...?
06/30/2009 - General Coding - 1 Replies
Hello, With which was this coded?: Elitepvpers Browser Thanks in advance, High Fire



All times are GMT +1. The time now is 03:13.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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