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

12/05/2009 06:39 airborne.#1
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.
12/05/2009 07:15 tere12#2
Congratz :D
12/05/2009 07:17 airborne.#3
Quote:
Originally Posted by tere12 View Post
Congratz :D
Thank you.
12/05/2009 11:12 ~*NewDuuDe*~#4
As you actually released this you should put in a bit more work, lol.
12/05/2009 11:53 Basser#5
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.
12/05/2009 12:10 Korvacs#6
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. :)
12/05/2009 12:38 Sp!!ke#7
Congratz
12/05/2009 13:30 osamaazez#8
thanks but i need to add it and i dont know how and no one want help me

__________________________________________________ _______________________
Thanks Any WAy
12/05/2009 13:33 ~Yuki~#9
Good work buddy.

to add it put the ID of the NPC u want.
12/05/2009 14:02 12tails#10
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
12/05/2009 15:13 -Shunsui-#11
Congrats, And thanks for contrubuting for others that might need it. Nor want it
12/05/2009 15:28 airborne.#12
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.
12/05/2009 16:37 W0LVERINE#13
NICE RELEASE BROTHA!!! !!! !!!
12/05/2009 16:39 Arcо#14
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.
12/05/2009 16:42 airborne.#15
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.