- Joined
- Apr 10, 2008
- Messages
- 4,087
- Reaction score
- 1,264
Pandora Box NPC:
[Tell me if it works].
[Tell me if it works].
Code:
/*
Pandora Box NPC.
Xoslize.
*/
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1)
cm.dispose();
else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("Hello, #h #. We have a new function in our server, It's the #bPandora Box.#k What is it? Well, you can get a random item that people added, and add a item yourself either. Why don't you try it? You can use it 2 times - a day.\r\n#b#L0#What is the Pandora Box?#l\r\n#L1#Start the Pandora!#l\r\n#L2#Nothing, really..#l#k");
} else if (status == 1) {
if (selection == 0) {
cm.sendNext("The #bPandora Box#k is like the #bFacebook's Pandora.#k With this system, every day a new user can add his item to the Box, and every day you can gain a random item that people added. Of course the system prevents you to add pots, or useless stuff. So please don't do that. So, why don't you try it? #bIt's fun & cool.#k You might gain your item some day too..!");
cm.dispose();
} else if (selection == 1) {
if (cm.getBossLog('PANDORA') < 2) { // Change to how much times you want people to use it a day.
var item = cm.getPandoraItem(Math.floor(Math.random() * cm.getMaxItems()) + 1)); // Gains a random item.
cm.gainItem(item);
cm.setPandoraLog('PANDORA');
cm.sendNext("You've gained a #iitem#. Maybe you were lucky, and maybe not. If you were'nt lucky this time, Please try again tommrow.");
cm.dispose();
} else {
cm.sendNext("You cannot use the #rPandora Box#k since you've used it 2 times already. Why don't you try again tommrow?!");
cm.dispose();
}
} else if (selection == 2) {
cm.sendOk("Well, I'm In charge of Pandora, so I don't have time to chit-chat. I will rush now!");
cm.dispose();
}
}
}
}