- Joined
- Sep 21, 2008
- Messages
- 68
- Reaction score
- 0
Re: [Guide] Learning NPC scripts (beginner's guide)
The hell is this crap?
The hell is this crap?
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!The hell is this crap?
The hell is this crap?
cm.getPlayer().getMapId()
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}
else {
if (status >= 5 && mode == 0) {
cm.sendOk("Goodbye. If you need anything else, just talk to a GM!");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
cm.sendNext("Hello #h #, I'm OurStory's Informational NPC");
}
else if (status == 1) {
cm.sendNextPrev("I am here to give you some basic info on OurStory!");
}
else if (status == 2) {
cm.sendNextPrev("Our current staff: #bNameHere#n is the owner.\r\n #bNameHere#n and #n'NameHere#n are co-Admins.\r\n #bNameHere#n is a SuperGM");
else if (status == 3) {
cm.sendNextPrev("You can talk to #bCody#n in the FM to get a Job Advance, and #bGlimmerman#n maxes your skills.");
else if (status == 4) {
cm.sendNextPrev("#bSera#n is our AP Reset NPC. #bAmos#b will take you to Boss Maps, and the #bMysterious Statue#b is our Town Warper NPC. These NPCs are all found in the #bFree Market#");
else if (status == 5) {
cm.sendOk("If you need anything else, just use one of these #bSuperMegaphones#n to ask!")
cm.gainItem(5072000, 10)
cm. dispose();
}
}
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}
else {
if (status >= 2 && mode == 0) {
cm.sendOk("Goodbye");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext("Hello #h #, I'm OurStory's Informational NPC");
}
else if (status == 1) {
cm.sendNextPrev("I am here to give you some basic info on OurStory!");
}
else if (status == 2) {
cm.sendNextPrev("Our current staff: #bNameHere#n is the owner.\r\n #bNameHere#n and #n'NameHere#n are co-Admins.\r\n #bNameHere#n is a SuperGM");
}
else if (status == 3) {
cm.sendNextPrev("You can talk to #bCody#n in the FM to get a Job Advance, and #bGlimmerman#n maxes your skills.");
}
else if (status == 4) {
cm.sendNextPrev("#bSera#n is our AP Reset NPC. #bAmos#b will take you to Boss Maps, and the #bMysterious Statue#b is our Town Warper NPC. These NPCs are all found in the #bFree Market#");
}
else if (status == 5) {
cm.sendOk("If you need anything else, just use one of these #bSuperMegaphones#n to ask!");
cm.gainItem(5072000, 10)
cm.dispose();
}
}
}
Sorry for the double post but, is there any way to make an NPC check how many rebirths a player has?
More on that in this threadcm.getPlayer().getReborn() or cm.getPlayer().getRebirth() .
Make sure you have it implemented .
- XotiCraze .
Please give more detail... "sending a party?" that's quite vague, send what do what, I'm guessing do something with an entire party, but uhh...?
I have a question as well,
How do I get an NPC to have a little box where the user can type oh say an answer to a question?
EX
NPC out: "What is the name of this server?"
User IN: "servernameMS"
store user IN into variable.
Edit:
K I got "cm.sendGetNumber("What's a number you'd like me to store, 1-100 please.",50,1,100)
Buttt how do I put that into a variable?
else if (status == 1) {
if(cm.haveItem(2000005)) {
cm.sendSimple("You have power elixirs.\r\n#L0#Can I have some anyway?#l\r\n#L1#I'll see you later#l");
}
else if (status == 1) {
if(cm.haveItem(01382016))
(cm.haveItem(01332052))
(cm.getChar().getMeso()(>=300000000))
else if (status == 2) {
cm.getChar().levelUp();
cm.unequipEverything()
cm.gainItem(01382016,-1)
cm.gainItem(01332052,-1)
cm.gainMeso(-300000000)
cm.changeJob(net.sf.odinms.client.MapleJob.BEGINNER);
cm.sendNext("Go level up you level 1 noob =D");
cm.getChar().setLevel(2);
cm.dispose();
I dont understand what you're saying on this part sorry .I was wondering if you could help me understand a bit more.. I was wanting to make a rebirth NPC and all
the guides I read haven't touched on checking multiple items in the players inventory or how to remove said items
like in this portion of your script
Code:else if (status == 1) { if(cm.haveItem(2000005)) { cm.sendSimple("You have power elixirs.\r\n#L0#Can I have some anyway?#l\r\n#L1#I'll see you later#l"); }
How could I change that to check for 2 equips and 300mil mesos? Please help me correct if terribly wrong which most likely it is.
Code:else if (status == 1) { if(cm.haveItem(01382016)) (cm.haveItem(01332052)) (cm.getChar().getMeso()(>=300000000))
if (cm.haveItem(01382016) && cm.haveItem(01332052) && cm.getMeso() >= 300000000) {
and how would I take said Items away after rebirthing player? Again please help me correct if wrong.
Code:else if (status == 2) { cm.getChar().levelUp(); cm.unequipEverything() cm.gainItem(01382016,-1) cm.gainItem(01332052,-1) cm.gainMeso(-300000000) cm.changeJob(net.sf.odinms.client.MapleJob.BEGINNER); cm.sendNext("Go level up you level 1 noob =D"); cm.getChar().setLevel(2); cm.dispose();