Code:
/*
This file is part of the MyStoryMS Maple Story Server
Copyright (C) 2008 Nathan
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 .#fUI/UIWindow.img/QuestIcon/6/0
*/
//Malady
var status = 0;
var price = 10000000;
var fame = 1;
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...\r\nI am the #fUI/UIWindow.img/QuestIcon/6/0# Seller .. If you would like to buy some Fame just choose one of the following deals :\r\n#b#L0#1 #fUI/UIWindow.img/QuestIcon/6/0# (10,000,000 mesos).#l\r\n#L1#3 #fUI/UIWindow.img/QuestIcon/6/0# (30,000,000 mesos).#l\r\n#L2#5 #fUI/UIWindow.img/QuestIcon/6/0# (50,000,000 mesos).#l\r\n#L3#10 #fUI/UIWindow.img/QuestIcon/6/0# (100,000,000 mesos).#l\r\n#L4#20 #fUI/UIWindow.img/QuestIcon/6/0# (200,000,000 mesos).#l\r\n#L5#50 #fUI/UIWindow.img/QuestIcon/6/0# (500,000,000 mesos).#l\r\n#L6#100 #fUI/UIWindow.img/QuestIcon/6/0# (1,000,000,000 mesos).#l\r\n\r\n#kEnjoy :)");
} else if (status == 1) {
if (selection == 0) {
cm.sendSimple("1 #fUI/UIWindow.img/QuestIcon/6/0# #b10,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#b#L0#Yes, I am.#l");
} else if (selection == 1) {
cm.sendSimple("3 #fUI/UIWindow.img/QuestIcon/6/0# #b30,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#b#L1#Yes, I am.#l");
} else if (selection == 2) {
cm.sendSimple("5 #fUI/UIWindow.img/QuestIcon/6/0# #b50,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#b#L2#Yes, I am.#l");
} else if (selection == 3) {
cm.sendSimple("10 #fUI/UIWindow.img/QuestIcon/6/0# #b100,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#b#L3#Yes, I am.#l");
} else if (selection == 4) {
cm.sendSimple("20 #fUI/UIWindow.img/QuestIcon/6/0# #b200,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#n#L4#Yes, I am.#l");
} else if (selection == 5) {
cm.sendSimple("50 #fUI/UIWindow.img/QuestIcon/6/0# #b500,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#n#L5#Yes, I am.#l");
} else if (selection == 6) {
cm.sendSimple("100 #fUI/UIWindow.img/QuestIcon/6/0# #b1,000,000,000 mesos#k.\r\nAre you sure you want to buy it ?\r\n#n#L6#Yes, I am.#l");
}
} if (status == 2) {
if (selection == 0) {
if (cm.getMeso() >= 10000000) {
cm.sendOk("You have bought #b1 #fUI/UIWindow.img/QuestIcon/6/0##k.");
cm.gainMeso(-10000000);
cm.gainFame(1);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 1) {
if (cm.getMeso() >= 30000000) {
cm.sendOk("You have bought #b3 #fUI/UIWindow.img/QuestIcon/6/0##k.");
cm.gainMeso(-30000000);
cm.gainFame(3);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 2) {
if (cm.getMeso() >= 50000000) {
cm.sendOk("You have bought #b5 #fUI/UIWindow.img/QuestIcon/6/0##k.");
cm.gainMeso(-50000000);
cm.gainFame(5);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 3) {
if (cm.getMeso() >= 100000000) {
cm.sendOk("You have bought #b10 #fUI/UIWindow.img/QuestIcon/6/0##k");
cm.gainMeso(-100000000);
cm.gainFame(10);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 4) {
if (cm.getMeso() >= 200000000) {
cm.sendOk("You have bought #b20 #fUI/UIWindow.img/QuestIcon/6/0##k");
cm.gainMeso(-200000000);
cm.gainFame(20);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 5) {
if (cm.getMeso() >= 500000000) {
cm.sendOk("You have bought #b50 #fUI/UIWindow.img/QuestIcon/6/0##k");
cm.gainMeso(-500000000);
cm.gainFame(50);
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
} else if (selection == 6) {
if (cm.getMeso() >= 1000000000) {
cm.sendOk("You have bought #b100 #fUI/UIWindow.img/QuestIcon/6/0##k");
cm.gainMeso(-1000000000);
cm.gainFame(100);
var winningplayer = cm.getChar().getName();
cm.mapMessage(5, "[FAME] "+ winningplayer +" Just bought 100 Fame for 1,000,000,000! WOW, so rich! ~");
cm.dispose();
} else {
cm.sendOk("You don't have enough mesos.");
cm.dispose();
}
}
}
}
}