|
楼主 |
发表于 2024-7-20 15:23:40
|
显示全部楼层
var maps = Array(952000000, 952010000, 952020000, 952030000, 952040000);
var minLevel = Array(20, 45, 50, 55, 60);
var maxLevel = Array(70, 70, 70, 70, 70);
function start() {
var selStr = "妳想進入哪個地方?\r\n\r\n#b";
for (var i = 0; i < maps.length; i++) {
selStr += "#L" + i + "##m" + maps + "# (怪物 Lv." + minLevel + " - " + maxLevel + ")#l\r\n";
}
cm.sendSimple(selStr);
}
function action(mode, type, selection) {
if (mode == 1 && selection >= 0 && selection < maps.length) {
if (cm.getParty() == null || !cm.isLeader()) {
cm.sendOk("妳想要進入的地區是組隊遊戲區域。可以通過#b隊長#k入場。");
} else {
var party = cm.getParty().getMembers().iterator();
var next = true;
while (party.hasNext()) {
var cPlayer = party.next();
if (cPlayer.getLevel() < minLevel[selection] || cPlayer.getLevel() > maxLevel[selection] || cPlayer.getMapid() != cm.getMapId() || cPlayer.isCs() || cPlayer.isHp0() || !cPlayer.isOnline()) {
next = false;
}
}
if (!next) {
cm.sendOk("請確定妳組員都在該地圖,並且都在等級範圍內。");
} else {
var em = cm.getEventManager("MonsterPark");
if (em == null || em.getInstance("MonsterPark" + maps[selection]) != null) {
cm.sendOk("怪物公園裏面已經有人了。");
} else {
if (cm.givePartyHaveItem(4001514, 1)) {
cm.givePartyItems(4001514, -1);
em.startInstance_Party("" + maps[selection], cm.getPlayer());
} else {
cm.sendOk("有隊友沒有門票。");
}
}
}
}
}
cm.dispose();
} |
|