34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
var status;
|
|
|
|
function start() {
|
|
status = -1;
|
|
action(1, 0, 0);
|
|
}
|
|
|
|
function action(mode, type, selection) {
|
|
if (mode == -1) {
|
|
cm.dispose();
|
|
} else {
|
|
if (mode == 0 && type > 0) {
|
|
cm.dispose();
|
|
return;
|
|
}
|
|
if (mode == 1)
|
|
status++;
|
|
else
|
|
status--;
|
|
|
|
if(status == 0) {
|
|
const MapleInventoryType = Java.type('client.inventory.MapleInventoryType');
|
|
if(cm.getPlayer().getInventory(MapleInventoryType.ETC).getNumFreeSlot() < 1) {
|
|
cm.sendNext("Check for a available slot on your ETC inventory.");
|
|
cm.dispose();
|
|
return;
|
|
}
|
|
|
|
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
|
|
cm.getClient().announce(MaplePacketCreator.openRPSNPC());
|
|
cm.dispose();
|
|
}
|
|
}
|
|
} |