|
You last visited: Today at 03:13
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.
12/05/2009, 06:39
|
#1
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
[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 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
|
#2
|
elite*gold: 0
Join Date: Feb 2007
Posts: 268
Received Thanks: 49
|
Congratz
|
|
|
12/05/2009, 07:17
|
#3
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
Quote:
Originally Posted by tere12
Congratz 
|
Thank you.
|
|
|
12/05/2009, 11:12
|
#4
|
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.
|
|
|
12/05/2009, 11:53
|
#5
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
|
Quote:
Originally Posted by BERGHUIS1
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
|
#6
|
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.
|
|
|
12/05/2009, 12:38
|
#7
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
Congratz
|
|
|
12/05/2009, 13:30
|
#8
|
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
|
|
|
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.
|
|
|
12/05/2009, 14:02
|
#10
|
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
|
|
|
12/05/2009, 15:13
|
#11
|
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
|
|
|
12/05/2009, 15:28
|
#12
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
Quote:
Originally Posted by 12tails
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
|
#13
|
elite*gold: 0
Join Date: Dec 2009
Posts: 13
Received Thanks: 11
|
NICE RELEASE BROTHA!!! !!! !!!
|
|
|
12/05/2009, 16:39
|
#14
|
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.
|
|
|
12/05/2009, 16:42
|
#15
|
elite*gold: 0
Join Date: Nov 2009
Posts: 256
Received Thanks: 63
|
Quote:
Originally Posted by Tiku
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.
|
|
|
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.
|
|