I've changed the script around quite a bit compared to last one. Now i'm just having trouble with the part when i click on the belt, it takes me no where. how should i fix it?
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 as published by the Free Software Foundation 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/>. */ /* * @Author: Moogra, XxOsirisxX * @NPC: 2091005 * @Name: So Gong * @Map(s): Dojo Hall */ importPackage(Packages.server.maps); var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belt_level = Array(25, 35, 45, 60, 75); var belt_points = Array(2, 4, 5, 6, 7); var status = -1; var selectedMenu = -1; function start() { if (cm.getPlayer().getLevel() >= 0) { cm.sendSimple("#L0#I want to receive a belt.#l"); } else { cm.sendYesNo("Bye!"); cm.dispose(); } } function action(mode, type, selection) { if (mode == -1) { cm.dispose(); } else if (mode >= 0) { if (status == -1) status++; //there is no prev. if (selection == 0) { //I want to receive a belt. if (mode < 1) { cm.dispose(); return; } if (status == 0) { var selStr = "You have #b" + cm.getPlayer().getDojoPoints() + "#k training points. Master prefers those with great talent. If you obtain more points than the average, you can receive a belt depending on your score.\r\n"; for (var i = 0; i < belts.length; i++) { if (cm.getPlayer().getItemQuantity(belts[i], true) > 0) { selStr += "\r\n #i" + belts[i] + "# #t" + belts[i] + "#(Obtain)"; } else selStr += "\r\n#L" + i + "##i" + belts[i] + "# #t" + belts[i] + "#l"; } cm.dispose(); cm.sendSimple(selStr); } else if (status == 1) { if (selection == 0) { var belt = belts[selection]; var level = belt_level[selection]; var points = belt_points[selection]; if (cm.getPlayer().getDojoPoints() > points) { cm.gainItem(belt, 1); Packages.server.MapleInventoryManipulator.editEquipById(cm.getPlayer(), 1, 1132000, "str", 2000); Packages.server.MapleInventoryManipulator.editEquipById(cm.getPlayer(), 1, 1132000, "dex", 2000); Packages.server.MapleInventoryManipulator.editEquipById(cm.getPlayer(), 1, 1132000, "int", 2000); Packages.server.MapleInventoryManipulator.editEquipById(cm.getPlayer(), 1, 1132000, "luk", 2000); } else cm.sendNext("In order to receive #i" + belt + "# #b#t" + belt + "#k and you need to have earned at least #b" + points + " training points#k.\r\n\r\nIf you want to obtain this belt, you need #r" + (cm.getPlayer().getDojoPoints() - points) + "#k more training points."); cm.dispose(); } } } } }


Reply With Quote![[Help] Scripting with Item stat editing Dojo points](http://ragezone.com/hyper728.png)


