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!

Pandora Box | Daily item winning.

Joined
Apr 10, 2008
Messages
4,087
Reaction score
1,264
Pandora Box NPC:
[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();
		}
	}
	}
}
 
Newbie Spellweaver
Joined
Nov 7, 2008
Messages
88
Reaction score
1
Pandora Box NPC:
[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();
		}
	}
	}
}

Not working :(
 
Custom Title Activated
Loyal Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
I don't get the video, it says "Item added" but you never added a thing. Not to mention that the script you gave have nothing related to that.
 
Newbie Spellweaver
Joined
Aug 20, 2009
Messages
82
Reaction score
0
the npc is which one ?

---------- Post added at 04:23 AM ---------- Previous post was at 04:15 AM ----------

if (cm.getBossLog('PANDORA') < 1) {
cm.gainItem(cm.getPandoraItem(Math.floor(Math.random() * cm.getMaxItems()) + 1)); // Gains a random item.
cm.setPandoraLog('PANDORA');
cm.dispose();
} else {
cm.sendNext("You've used all your uses. Please come back tommrow!");
cm.dispose();
} , not working at all .

---------- Post added at 04:24 AM ---------- Previous post was at 04:23 AM ----------

it says cm is not defined in line number 1
 
Back
Top