Here's a script I made, similar to Gacha, it gives out a random scroll from the list in exchange for an item. Replace 4031013 with your own item id and replace or add to any of the preset scrolls in the list. Use on any NPC. Im not a pro so don't complain saying "oh wow this is easy" or "this has been already made" etc., I just thought I'd share this script if anyone was looking for something similar. It IS tested and does work.
PHP Code:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
scroll = ["2044700", "2044701", "2044702", "2340000", "2049100", "2041016", "2040317", "2043301", "2041022", "2041004", "2040516", "2040513", "2043001", "2040701", "2043701", "2041021", "2040300", "2040207", "2040818", "2040024", "2040515", "2040817", "2040804"]
var status = 0;
var scrolling = scroll[Math.floor(Math.random()*scroll.length)]
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("Alright, see you next time.");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendNext("I am Gordon the Scrollmaker.");
} else if (status == 1) {
if (cm.haveItem(4031013)) {
cm.sendYesNo("I can make you a random scroll for #b1#k Marble. Would you like to try your luck?");
} else {
cm.sendOk("You do not have enough Marbles.")
cm.dispose();
}
} else if (status == 2) {
cm.gainItem(scrolling, 1);
cm.gainItem(4031013, -1);
cm.dispose();
}
}
}