Would this work?
__________________________________________________ __________________________________________________ _____
//Gachaphon
importPackage(net.sf.odinms.client);
Upper area based on moogra
var status = 0;
var chance1 = Math.floor(Math.random()*200+1);
var chance2 = Math.floor(Math.random()*50);
var chance3 = (Math.floor(Math.random()*20)+1);
var chance4 = Math.floor(Math.random()*2+1);
var itemchance = chance1 + chance2 + chance3 * chance4;
var itemamount = Math.floor(Math.random()*50+1);
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("See you next time, when you try your luck here~!");
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendNext("I am bitch of a gachapon. However, you actually may win something very RARE.\r\nI give things to people if they give me golden maple leaves, Yes. 1 Billion mesos ~!\r\nThe tickets look like this: #v4000313#");
}
else if (status == 1) {
if (cm.haveItem(4000313)) {
cm.sendYesNo("I see you have a ticket of mine, do you wish to use it?");
}
else if (!cm.haveItem(4000313)) {
cm.sendOk("You dont have any #bgachapon tickets#k.");
cm.dispose();
function start() {
else if (status == 2) {
cm.gainItem(4000313, -1);
if ((itemchance >= 1) && (itemchance <= 10)) {
var items = Array(eg, eg, eg, eg, eg);
var itemSetSel = Math.random();
var itemSetQty = (1);
else if ((itemchance >= 21) && (itemchance <= 25)) {
var items = Array(Random Items within this chance goes here);
var itemSetSel = Math.random();
var itemSetQty = (1);