Cloud Piece Meso/Exp Exchange
:: Announcements :: Development
Page 1 of 1
Cloud Piece Meso/Exp Exchange
Pretty sure anyone could code this but whatever.
Untested so it might not work.
- Code:
item = [itemID]; // Cloud Piece?
status = -1;
var sel;
var amt = 1000; // Reward amount here
var choice = "exp" // exp or mesos
function start() {
if (cm.getLevel() < 1) {
cm.sendNext("Invalid Level.");
cm.dispose();
return;
}
var text = "Click the Cloud Piece to Proceed#b\r\n";
for(var i = 0; i < item.length; i++)
text += "\r\n#L" + i + "##v" + item[i] + "#.#l";
cm.sendSimple(text);
}
function action(mode, type, selection) {
status++;
if (mode != 1) {
cm.dispose();
return;
}
if (status == 0) {
sel = selection;
cm.sendGetNumber("How many #b#v" + item[sel] + "##k do you want to trade?", 1, 1, 500);
} else if (status == 1) {
if(cm.haveItem(item[sel], selection)) {
cm.gainItem(item[sel], -selection);
cm.gainExp(amt * selection); // Change gainExp to gainMeso to change to meso exchange
cm.sendOk("You have received #r"+selection * amt+"#k "+choice+"."); // Pic Exp or Mesos
} else
cm.sendOk("Uhh... Hold on, you don't have " + selection + " #v" + item[sel] + "# as you told me. Nice try.");
cm.dispose();
}
}
Untested so it might not work.
Maplepuppet- Lurkin' the forum.
- Posts : 30
Join date : 2011-08-02
:: Announcements :: Development
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|