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] Chair Trader

Legendary Battlemage
Loyal Member
Joined
Dec 13, 2010
Messages
649
Reaction score
140
Alright, this is a very simple simple release. You can edit the chair id's however you wish.

PHP:
/****************************************\
*    Made by Soulfist for DominoStory    *
\****************************************/

chairs = [3010000, 3010001, 3010002, 3010003, 3010004, 3010005, 3010006, 3010007, 3010008,
3010009, 3010010, 3010011, 3010012, 3010013, 3010014, 3010015, 3010016, 3010017, 3010018,
3010019, 3010020, 3010021, 3010022, 3010023, 3010024, 3010025, 3010026, 3010027, 3010028,
3010029, 3010030, 3010031, 3010032, 3010033, 3010034, 3010035, 3010036, 3010037, 3010038,
3010039, 3010040, 3010041, 3010042, 3010043, 3010044, 3010045, 3010046, 3010047, 3010048,
3010049, 3010050];

function start() {
var talk = "Welcome to DominoStory #g#h ##k, I sell chairs for\r\n 5 #i4030002#. Would you like to buy one?";
for(var i = 0; i < chairs.length; i++) {
talk += "\r\n#L"+"##i"+chairs[i]+"##l";
cm.sendSimple(talk);
}

function action(m, t, s) {
if (m < 1) {
  cm.dispose();
    return;
    } else {
 status++;
}
if (status == 1) {
if (cm.haveItem(4030002, 5) {
cm.sendOk("Enjoy your new #rChair#k!");
cm.gainItem(chairs[s], 1);
cm.gainItem(4030002, -5);
cm.dispose();
} else {
cm.sendOk("You do not have enough #i4030002#");
cm.dispose();
    }
  }
}

Side Note: DominoStory, ignore that. its a server I do some side scripting for ;) .

Also let me know if there are any errorz
 
Last edited:
Skilled Illusionist
Joined
Dec 16, 2010
Messages
304
Reaction score
164
I already told you there were numerous errors, but you chose to only fix ONE error I told you about, and went to sleep -_- God help you.
 
Newbie Spellweaver
Joined
Nov 27, 2009
Messages
94
Reaction score
58
This is your script a bit cleaner, and fixed.
Btw, unless you're using wz edits this NPC will d/c as many ids within the range of 3010000 - 3010050 don't exist.

PHP:
/****************************************\
*    Made by Soulfist for DominoStory    *
\****************************************/

chairs = Array();
for (var i = 3010000;  i < 3010051; i++) {
	chairs.push(i);
}

function start() {
	var talk = "Welcome to DominoStory #g#h ##k, I sell chairs for\r\n 5 #i4030002#. Would you like to buy one?";
	for(var i = 0; i < chairs.length; i++) 
		talk += "\r\n#L"+ i + "##i"+chairs[i]+"##l";
	cm.sendSimple(talk);
}

function action(m, t, s) {
	cm.dispose();
	if (m < 1) {
		return;
	}
	if (cm.haveItem(4030002, 5)) {
		cm.sendOk("Enjoy your new #e#b#t"+ chairs[s] + "##k#n!");
		cm.gainItem(chairs[s], 1);
		cm.gainItem(4030002, -5);
	} else {
		cm.sendOk("You do not have enough #i4030002#");
	}
}
 
Custom Title Activated
Loyal Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
Ohh the old Soulfist, releasing untested and not working stuff.

You surely love to break the rules. Also, this have more than 3 errors. Not to mention that if I'm not wrong, most of those chairs id's not even exist.

PHP:
function start() {
    var talk = "Welcome to DominoStory #g#h ##k, I sell chairs for\r\n 5 #i4030002#. Would you like to buy one?";
    for(var i = 3010000; i < 3010051; talk += "\r\n#L" + i + "##i" + i + "##l\r\n", i++);
    cm.sendSimple(talk);
}

function action(mode, type, selection) {
    cm.dispose();
	if (mode > 0)
        if (cm.haveItem(4030002, 5)) {
            cm.sendOk("Enjoy your new #rChair#k!");
            cm.gainItem(selection, 1);
            cm.gainItem(4030002, -5);
        } else
            cm.sendOk("You do not have enough #i4030002#");
}
 
Newbie Spellweaver
Joined
Feb 18, 2011
Messages
23
Reaction score
2
They also even go past 50 even though there are holes in between the chair's ids. For example:
PHP:
  <imgdir name="3012011">
    <string name="name" value="Chocolate Fondue Chair" />
    <string name="desc" value="Yummy! Use this chair next to someone else who's also using it, and a mouth-watering chocolate fondue appears. Smack your lips and dream about treats as you recover 50 HP every 10 seconds. " />
  </imgdir>
 
Junior Spellweaver
Joined
Jul 26, 2008
Messages
161
Reaction score
51
What version of this?

I think it goes up to v.0.83, without the WZ edits.

Ohh the old Soulfist, releasing untested and not working stuff.

You surely love to break the rules. Also, this have more than 3 errors. Not to mention that if I'm not wrong, most of those chairs id's not even exist.

PHP:
function start() {
    var talk = "Welcome to DominoStory #g#h ##k, I sell chairs for\r\n 5 #i4030002#. Would you like to buy one?";
    for(var i = 3010000; i < 3010051; talk += "\r\n#L" + i + "##i" + i + "##l\r\n", i++);
    cm.sendSimple(talk);
}

function action(mode, type, selection) {
    cm.dispose();
	if (mode > 0)
        if (cm.haveItem(4030002, 5)) {
            cm.sendOk("Enjoy your new #rChair#k!");
            cm.gainItem(selection, 1);
            cm.gainItem(4030002, -5);
        } else
            cm.sendOk("You do not have enough #i4030002#");
}

You are a legend, Osiris.
 
Legendary Battlemage
Loyal Member
Joined
Dec 13, 2010
Messages
649
Reaction score
140
The chair ids wouldnt work, I already knew that some of the id's were non-existent. But some servers have some chairs that others dont and vica versa. Although I was lazy in fixing the errors and I did learn from Nemesis and Osiris's script. So thats good for me ;)
 
Custom Title Activated
Loyal Member
Joined
Aug 21, 2009
Messages
1,149
Reaction score
598
The chair ids wouldnt work, I already knew that some of the id's were non-existent. But some servers have some chairs that others dont and vica versa. Although I was lazy in fixing the errors and I did learn from Nemesis and Osiris's script. So thats good for me ;)

Nonexistent ID = Disconnection.
 
Junior Spellweaver
Joined
Feb 8, 2011
Messages
121
Reaction score
17
PHP:
				var chairs = [4000313]; // for sake of different versions, input the IDs of the chairs you wish to sell HERE
		var name = ["Server Name"]; // input your server name here
		var item = 4000313; // the item you wish to take from the player
 
	function start() { 
		var txt = "Welcome to "+name+" #d#h ##k. I sell chairs for\r\n 5 #i"+item+"#. Please choose from the following list if you wish to buy one."; 
		for(var i = 0; i < chairs.length; i++) 
        txt += "\r\n#L" + i + "##i" + chairs[i] + "# - [ 5 #i"+item+"# ]#l";
		cm.sendSimple(txt);
	} 
	function action(m, t, s) { 
		if (m < 1) { 
			cm.dispose(); 
			return; 
		} else { 
			status++; 
		} 
		if (status == 1) { 
		if (cm.haveItem(item, 5) { 
			cm.sendOk("Enjoy your new #i"+chairs[s]+"#!"); 
			cm.gainItem(chairs[s], 1); 
			cm.gainItem(item, -5); 
			cm.dispose(); 
		} else { 
			cm.sendOk("You do not have enough #i"+item+"#"); 
			cm.dispose(); 
		} 
	} 
}    [/spoiler]
Idk It may work haha.
 
Last edited:
Back
Top