Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Add-On]Learning NPCs, Start to Finish

Status
Not open for further replies.
bleh....
Loyal Member
Joined
Oct 15, 2008
Messages
2,898
Reaction score
1,129
Check in your source to see if you have the modifyNX method. For npc related help replies, please use Sharkys thread, which is stickied in the Help section.
 
Newbie Spellweaver
Joined
Sep 9, 2010
Messages
9
Reaction score
0
Ok... I'm new to most of this.. Where would that be in the source?

---------- Post added at 09:21 AM ---------- Previous post was at 09:14 AM ----------

Ok, I found it.. But how would I code it in?
 
Initiate Mage
Joined
Sep 20, 2008
Messages
2
Reaction score
0
Liked, bookmarked. Awesome tut, this helped me alot.

Especially the 'var' thing, that's useful!

Thanks mate ;)
 
Newbie Spellweaver
Joined
Nov 23, 2010
Messages
12
Reaction score
1
Very nice guide helped me a lot when I was first learning NPC scripting
 
Newbie Spellweaver
Joined
Apr 4, 2012
Messages
35
Reaction score
6
Hello, thanks for sharing this great tutorial! I apologize for not having a very good English, is not my first language. Anyway, I would like to leave a question:

- I am from a country that uses accents on words (Brazil), I need to use these accents in my script's because I intend to put them on my tongue. How should I proceed? Is there a way, if so, what?

Thank you!
 
Newbie Spellweaver
Joined
Feb 1, 2009
Messages
51
Reaction score
5
Errm, 1 Question, On Most Other Repacks, This:
function start() {
cm.sendOk("I am an NPC without a status.");
cm.dispose();
}
Wouldn't Work, Atleast On All The Repacks I've Testing Except MoopleDez, You Need:
function start() {
cm.sendOk("I am an NPC without a status.");
}
function action(mode, type, selection) {
cm.dispose();
}

^^Idk why, in NPCConversationalManager, It Isn't Optional In Most Of The Repacks/SOurces I've Trued
 
Mythic Archon
Joined
Dec 25, 2011
Messages
723
Reaction score
97
Errm, 1 Question, On Most Other Repacks, This:

Wouldn't Work, Atleast On All The Repacks I've Testing Except MoopleDez, You Need:


^^Idk why, in NPCConversationalManager, It Isn't Optional In Most Of The Repacks/SOurces I've Trued
Not a lot more work to do just to type another function.
 
Initiate Mage
Joined
Jun 13, 2012
Messages
1
Reaction score
0
modifyNX(int amount, int type) {

Doesnt work, is there any other commands to give Nx?
 
Newbie Spellweaver
Joined
Jun 9, 2012
Messages
7
Reaction score
2
modifyNX(int amount, int type) {

Doesnt work, is there any other commands to give Nx?

I am not sure, you should hunt out and find anyway to get a function or search into your source. What source are you using? I can try to find out and give your the function, just tell us.

btw, I have a question, is there anyway to use two or more conditions in a selection? For example:

PHP:
if (selection == 1) {
if (cm.getJob(jobid)) {
cm.gainMeso(10);
} else if (cm.getJob(jobid)) {
cm.gainMeso(100);
}

Should this exattly work? I am trying to make a "information" about my private server, it has some "status" and it would have two selections, one that just end the converstation and other warp who warps the player to his "main map", like, beginner to 1000 and others.

Thanks you.
 
Last edited:
Experienced Elementalist
Joined
Apr 18, 2009
Messages
211
Reaction score
38
btw, I have a question, is there anyway to use two or more conditions in a selection? For example:

PHP:
if (selection == 1) {
if (cm.getJob(jobid)) {
cm.gainMeso(10);
} else if (cm.getJob(jobid)) {
cm.gainMeso(100);
}

Should this exattly work? I am trying to make a "information" about my private server, it has some "status" and it would have two selections, one that just end the converstation and other warp who warps the player to his "main map", like, beginner to 1000 and others.

Thanks you.

Yes something like that would work, you'd just have to be careful on how it is scripted. And it'd be better if you added an } else { statement for anyone that doesn't fulfill either of the checks
 
Mythic Archon
Joined
Dec 25, 2011
Messages
723
Reaction score
97
I am not sure, you should hunt out and find anyway to get a function or search into your source. What source are you using? I can try to find out and give your the function, just tell us.

btw, I have a question, is there anyway to use two or more conditions in a selection? For example:

PHP:
if (selection == 1) {
if (cm.getJob(jobid)) {
cm.gainMeso(10);
} else if (cm.getJob(jobid)) {
cm.gainMeso(100);
}

Should this exattly work? I am trying to make a "information" about my private server, it has some "status" and it would have two selections, one that just end the converstation and other warp who warps the player to his "main map", like, beginner to 1000 and others.

Thanks you.

or you can merely do,
PHP:
var doesGuyHaveJob = cm.getJob(jobid) ? 10 : cm.getJob(jobid) ? 100 : 0; // not sure if exactly works, but it should.
if (selection == 1) {
cm.gainMeso(doesGuyHaveJob);
} // if selection == 1

For example:
PHP:
var doesGuyHaveJob = cm.getJob(100) ? 10 : cm.getJob(0) ? 100 : 0; // 0 = 100 mesos, 100 = 10 mesos.

function start() {
	cm.sendYesNo("Would you like to gain mesos? It will depend on your job.");
}

function action(m,t,s) {
	if (m > 0) {
		cm.gainMeso(doesGuyHaveJob);
		cm.sendOk("You have gained your mesos.");
	}
	cm.dispose();
}
 
Experienced Elementalist
Joined
Jul 3, 2012
Messages
202
Reaction score
32
nice guide :D, altho when i made a npc it bugged, but posted that in the help section
 
Newbie Spellweaver
Joined
May 1, 2012
Messages
54
Reaction score
0
Thanks for the detailed guide, although i have a quick question. Can i have 2 Selection Screens? So if one selection out of two was selected in the first window, it would then lead to the next screen with another two selections? If that makes sense.
 
Status
Not open for further replies.
Back
Top