Hello,
This is my quest npc's script:
[Java] NPC Quest - Pastebin.com
It don't work.
I would like its changing items 03991005, 03991011 by item 03991000 but I would also be able to add a story that looks like a quest.
Thanks.
Printable View
Hello,
This is my quest npc's script:
[Java] NPC Quest - Pastebin.com
It don't work.
I would like its changing items 03991005, 03991011 by item 03991000 but I would also be able to add a story that looks like a quest.
Thanks.
I really couldn't figure the purpose of your NPC so I made you one which I thought would server it. Do tell me if it needs some modification of any sort.PHP Code:status = -1;
req = [03991005, 03991011, 03991000, 03991012, 03991004];
function start() {
var text = "Hello there! I am the <insert purpose of NPC here> of <insert server name here>! To be able to proceed you need to have 1 piece of the following items:\r\n";
for (var i = 0; i < req.length; i++)
text += "\r\n#o"+req[i]+"#"; // I believe #o shows the Item image.
text += "Do you have those items?";
cm.sendYesNo(text);
}
function action(mode, type, selection) {
cm.dispose();
if (mode == 1) {
if (status == 0) {
for (var i = 0; i < req.length; i++) {
if (!cm.haveItem(req[i], 1) {
cm.dispose();
return;
}
}
cm.sendNext("Insert text here.");
} else if (status == 1) {
cm.sendOk("Blabla, thank you for your items.");
for (var i = 0; i < req.length; i++) {
cm.gainItem(req[i], -1);
}
cm.gainItem(1002553 , 1);
}
cm.dispose();
}
}
Thanks.
It was that I needed.
#EDIT
Npc don't work. :S
I fix it:
[Java] NPC Quest 2 - Pastebin.com
But the button Yes/No don't work.
#EDIT
I fix it.
Script:
[Java] [FIX] NPC Quest - Pastebin.com