KerningPQ + some boosts on PQ/event scripting

Added cleaner mechanics for dealing with PQs and events (bonus Exp when
clearing a stage, for instance). Reimplemented KerningPQ.
This commit is contained in:
ronancpl
2017-05-05 00:55:36 -03:00
parent 03ab8be97d
commit da00345aec
45 changed files with 1260 additions and 1030 deletions

View File

@@ -66,7 +66,7 @@ function disbandParty(eim, player) {
}
function clearPQ(eim) {
// Happens when the function EventInstanceManager.finishPQ() is invoked by NPC/Reactor script
// Happens when the function EventInstanceManager.clearPQ() is invoked by NPC/Reactor script
}
function removePlayer(eim, player) {

View File

@@ -69,9 +69,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
function setup(level, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("BossRush" + leaderid);
em.setProperty("level", level);
eim.setProperty("level", level);
eim.startEventTimer(45 * 60000); //45 mins
setEventRewards(eim);
return eim;
@@ -93,8 +94,7 @@ function playerExit(eim, player) {
function changedMap(eim, player, mapid) {
if (mapid < 970030001 || mapid > 970042711) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
@@ -106,8 +106,7 @@ function changedMap(eim, player, mapid) {
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
@@ -117,16 +116,14 @@ function playerRevive(eim, player) { // player presses ok on the death pop up.
function playerDisconnected(eim, player) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers)
if (eim.isEventTeamLackingNow(true, minPlayers, player))
end(eim);
else
playerExit(eim, player);
}
function leftParty(eim, player) {
var party = eim.getPlayers();
if (party.size() <= minPlayers)
if (eim.isEventTeamLackingNow(false, minPlayers, player))
end(eim);
else
playerExit(eim, player);
@@ -137,35 +134,33 @@ function disbandParty(eim) {
}
function monsterValue(eim, mobId) {
return 1;
return 1;
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function playerClear(eim, player, toMap) {
eim.unregisterPlayer(player);
}
function complete(eim, toMap) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerClear(eim, party.get(i), toMap);
}
eim.dispose();
}
function clearPQ(eim, toMap) {
complete(eim, toMap);
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared(); // from now on event just finishes when ALL players gets out of the range defined inside changedMap function.
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
eim.giveEventReward(player);
}
function reopenEvent() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function monsterKilled(mob, eim) {}
@@ -174,9 +169,4 @@ function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {
em.cancelSchedule();
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function dispose(eim) {}

View File

@@ -1,6 +1,6 @@
var isPq = true;
var minPlayers = 4, maxPlayers = 6;
var minLevel = 44, maxLevel = 55;
var minPlayers = 1, maxPlayers = 6;
var minLevel = 1, maxLevel = 200;
var entryMap = 930000000;
var exitMap = 930000800;
var recruitMap = 300030100;
@@ -35,8 +35,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
function setup(level, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("Ellin" + leaderid);
eim.setProperty("level", level);
eim.setInstanceMap(930000000).resetPQ(level);
eim.setInstanceMap(930000100).resetPQ(level);
eim.setInstanceMap(930000200).resetPQ(level);
@@ -55,109 +57,89 @@ function setup(level, leaderid) {
function respawnStg2(eim) {
if(!eim.getMapInstance(930000200).getAllPlayer().isEmpty()) eim.getMapInstance(930000200).instanceMapRespawn();
em.schedule("respawnStg2", eim, 4 * 1000);
eim.schedule("respawnStg2", 4 * 1000);
}
function changedMap(eim, player, mapid) {
if (mapid < 930000000 || mapid > 930000800) {
eim.unregisterPlayer(player);
if(eim.getPlayers().isEmpty()) end(eim);
}
if (mapid < 930000000 || mapid > 930000800) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function scheduledTimeout(eim) {
end(eim);
end(eim);
}
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
playerExit(eim, party.get(i));
eim.dispose();
} else
playerExit(eim, player);
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() < minPlayers) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
if (party.get(i).equals(player))
removePlayer(eim, player);
else
playerExit(eim, party.get(i));
eim.dispose();
} else
removePlayer(eim, player);
if (eim.isEventTeamLackingNow(true, minPlayers, player))
end(eim);
else
playerExit(eim, player);
}
function leftParty(eim, player) {
var party = eim.getPlayers();
if (party.size() < minPlayers) {
for (var i = 0; i < party.size(); i++)
playerExit(eim,party.get(i));
eim.dispose();
} else
playerExit(eim, player);
if (eim.isEventTeamLackingNow(false, minPlayers, player))
end(eim);
else
playerExit(eim, player);
}
function disbandParty(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
end(eim);
}
function monsterValue(eim, mobId) {
return 1;
return 1;
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function playerClear(eim, player, toMap) {
eim.unregisterPlayer(player);
if(toMap != null) player.changeMap(toMap);
else player.changeMap(clearMap, 0);
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
eim.warpEventTeam(toMap);
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function complete(eim, toMap) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerClear(eim, party.get(i), toMap);
}
eim.dispose();
}
function clearPQ(eim, toMap) {
complete(eim, toMap);
function reopenEvent() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function monsterKilled(mob, eim) {}
@@ -166,9 +148,4 @@ function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {
em.cancelSchedule();
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function dispose(eim) {}

View File

@@ -1,140 +1,153 @@
/*
* 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>
var isPq = true;
var minPlayers = 1, maxPlayers = 6;
var minLevel = 1, maxLevel = 200;
var entryMap = 103000800;
var exitMap = 103000890;
var recruitMap = 103000000;
var clearMap = 103000805;
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 <http://www.gnu.org/licenses/>.
*/
/*
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300001,4001007,5);
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300000,4001008,1);
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300002,4001008,1);
INSERT monsterdrops (monsterid,itemid,chance) VALUES (9300003,4001008,1);
*/
importPackage(Packages.world);
var exitMap;
var minPlayers = 3;
function init() { // Initial loading.
exitMap = em.getChannelServer().getMapFactory().getMap(103000890);
em.setProperty("KPQOpen", "true"); // allows entrance.
em.setProperty("shuffleReactors", "true");
instanceId = 1;
function init() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel, expStages;
function monsterValue(eim, mobId) { // Killed monster.
return 1; // returns an amount to add onto kill count.
evLevel = 1; //Rewards at clear PQ
itemSet = [2040505, 2040514, 2040502, 2040002, 2040602, 2040402, 2040802, 1032009, 1032004, 1032005, 1032006, 1032007, 1032010, 1032002, 1002026, 1002089, 1002090, 2000003, 2000001, 2000002, 2000006, 2022003, 2022000, 2000004, 4003000, 4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 80, 80, 80, 50, 5, 15, 15, 30, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3, 3];
eim.setEventRewards(evLevel, itemSet, itemQty);
expStages = [100, 200, 400, 800, 1500]; //bonus exp given on CLEAR stage signal
eim.setEventClearStageExp(expStages);
}
function setup() { // Invoked from "EventManager.startInstance()"
var eim = em.newInstance("KerningPQ"); // adds a new instance and returns EventInstanceManager.
var eventTime = 30 * (1000 * 60); // 30 mins.
var firstPortal = eim.getMapInstance(103000800).getPortal("next00");
respawn(eim);
firstPortal.setScriptName("kpq0");
em.schedule("timeOut", eim, eventTime); // invokes "timeOut" in how ever many seconds.
eim.startEventTimer(eventTime); // Sends a clock packet and tags a timer to the players.
return eim; // returns the new instance.
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
var eligible = [];
var hasLeader = false;
if(party.size() > 0) {
var partyList = party.toArray();
for(var i = 0; i < party.size(); i++) {
var ch = partyList[i];
if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel) {
if(ch.isLeader()) hasLeader = true;
eligible.push(ch);
}
}
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
}
function playerEntry(eim, player) { // this gets looped for every player in the party.
var map = eim.getMapInstance(103000800);
player.changeMap(map, map.getPortal(0)); // We're now in KPQ :D
function setup(level, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("Kerning" + leaderid);
eim.setProperty("level", level);
respawnStg1(eim);
eim.startEventTimer(30 * 60000); //30 mins
setEventRewards(eim);
return eim;
}
function playerDead(eim, player) {
function respawnStg1(eim) {
eim.getMapInstance(103000800).instanceMapRespawn();
eim.schedule("respawnStg1", 10 * 1000);
}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
playerExit(eim, party.get(i));
eim.dispose();
} else
playerExit(eim, player);
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function respawn(eim) {
var map = eim.getMapInstance(103000800);
var map2 = eim.getMapInstance(103000805);
if (map.getSummonState()) { //Map spawns are set to true by default
map.instanceMapRespawn();
}
if(map2.getSummonState()) {
map2.instanceMapRespawn();
}
eim.schedule("respawn", 10000);
}
function playerDisconnected(eim, player) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() < minPlayers) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
if (party.get(i).equals(player))
removePlayer(eim, player);
else
playerExit(eim, party.get(i));
eim.dispose();
} else
removePlayer(eim, player);
}
function leftParty(eim, player) {
var party = eim.getPlayers();
if (party.size() < minPlayers) {
for (var i = 0; i < party.size(); i++)
playerExit(eim,party.get(i));
eim.dispose();
} else
playerExit(eim, player);
}
function disbandParty(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
function scheduledTimeout(eim) {
end(eim);
}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, exitMap.getPortal(0));
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.getMap().removePlayer(player);
player.setMap(exitMap);
function changedMap(eim, player, mapid) {
if (mapid < 103000800 || mapid > 103000805) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function leftParty(eim, player) {
if (eim.isEventTeamLackingNow(false, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function disbandParty(eim) {
end(eim);
}
function monsterValue(eim, mobId) {
return 1;
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
}
function clearPQ(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
playerExit(eim, party.get(i));
eim.dispose();
eim.stopEventTimer();
eim.setEventCleared();
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function reopenEvent() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function monsterKilled(mob, eim) {}
@@ -143,22 +156,4 @@ function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose(eim) {
em.cancelSchedule();
em.schedule("OpenKPQ", 10000); // 10 seconds ?
}
function OpenKPQ() {
em.setProperty("KPQOpen", "true");
}
function timeOut(eim) {
if (eim != null) {
if (eim.getPlayerCount() > 0) {
var pIter = eim.getPlayers().iterator();
while (pIter.hasNext())
playerExit(eim, pIter.next());
}
eim.dispose();
}
}
function dispose(eim) {}

View File

@@ -1,6 +1,6 @@
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 55, maxLevel = 100;
var minPlayers = 1, maxPlayers = 6;
var minLevel = 1, maxLevel = 200;
var entryMap = 925100000;
var exitMap = 925100700;
var recruitMap = 251010404;
@@ -35,7 +35,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
function setup(level, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("Pirate" + leaderid);
eim.setProperty("level", level);
em.setProperty("stage2", "0");
em.setProperty("stage2a", "0");
em.setProperty("stage3a", "0");
@@ -43,7 +46,7 @@ function setup(level, leaderid) {
em.setProperty("stage3b", "0");
em.setProperty("stage4", "0");
em.setProperty("stage5", "0");
em.setProperty("level", level);
em.setProperty("openedChests", "0");
eim.setInstanceMap(925100000).resetPQ(level);
eim.setInstanceMap(925100000).shuffleReactors();
@@ -125,111 +128,91 @@ function setup(level, leaderid) {
return eim;
}
function respawnStg4(eim) {
eim.getMapInstance(925100400).instanceMapRespawn();
eim.schedule("respawnStg4", 10 * 1000);
}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
}
function scheduledTimeout(eim) {
end(eim);
end(eim);
}
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function changedMap(eim, player, mapid) {
if (mapid < 925100000 || mapid > 925100500) {
eim.unregisterPlayer(player);
if (eim.disposeIfPlayerBelow(minPlayers, exitMap)) {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
}
if (mapid < 925100000 || mapid > 925100500) {
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function playerDead(eim, player) {}
function playerRevive(eim, player) { // player presses ok on the death pop up.
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) { // Check for party leader
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
playerExit(eim, party.get(i));
eim.dispose();
} else
playerExit(eim, player);
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
function playerDisconnected(eim, player) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() < minPlayers) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++)
if (party.get(i).equals(player))
removePlayer(eim, player);
else
playerExit(eim, party.get(i));
eim.dispose();
} else
removePlayer(eim, player);
if (eim.isEventTeamLackingNow(true, minPlayers, player))
end(eim);
else
playerExit(eim, player);
}
function leftParty(eim, player) {
var party = eim.getPlayers();
if (party.size() < minPlayers) {
for (var i = 0; i < party.size(); i++)
playerExit(eim,party.get(i));
eim.dispose();
} else
playerExit(eim, player);
if (eim.isEventTeamLackingNow(false, minPlayers, player))
end(eim);
else
playerExit(eim, player);
}
function disbandParty(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
end(eim);
}
function monsterValue(eim, mobId) {
return 1;
return 1;
}
function end(eim) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerExit(eim, party.get(i));
}
eim.dispose();
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function playerClear(eim, player, toMap) {
eim.unregisterPlayer(player);
if(toMap != null) player.changeMap(toMap);
else player.changeMap(clearMap, 0);
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
eim.warpEventTeam(toMap);
em.schedule("reopenEvent", 10 * 1000); // leaders have 10 seconds cooldown to reach recruit map and retry for a new PQ.
}
function complete(eim, toMap) {
var party = eim.getPlayers();
for (var i = 0; i < party.size(); i++) {
playerClear(eim, party.get(i), toMap);
}
eim.dispose();
}
function clearPQ(eim, toMap) {
complete(eim, toMap);
function reopenEvent() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function monsterKilled(mob, eim) {}
@@ -238,14 +221,4 @@ function allMonstersDead(eim) {}
function cancelSchedule() {}
function respawnStg4(eim) {
eim.getMapInstance(925100400).instanceMapRespawn();
em.schedule("respawnStg4", eim, 10 * 1000);
}
function dispose(eim) {
em.cancelSchedule();
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function dispose(eim) {}

View File

@@ -94,7 +94,11 @@ function action(mode, type, selection) {
if (prop == null || prop.equals("0")) { //Start the PQ
cm.removeHPQItems();
em.setProperty("latestLeader", cm.getPlayer().getName());
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
} else {
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
cm.dispose();

View File

@@ -37,7 +37,7 @@ function action(mode, type, selection) {
status++;
if (status == 51) {
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
eim.finishPQ();
eim.clearPQ();
cm.dispose();
return;
}
@@ -89,7 +89,7 @@ function action(mode, type, selection) {
cm.sendNextPrev("When the flowers of primrose blooms, the full moon will rise, and that's when the Moon Bunnies will appear and start pounding the mill. Your task is to fight off the monsters to make sure that Moon Bunny can concentrate on making the best rice cake possible.");
} else if (chosen == 1) {
var eim = cm.getEventManager("HenesysPQ").getInstance("HenesysPQ_" + cm.getParty().getLeader().getName());
eim.finishPQ();
eim.clearPQ();
cm.dispose();
}
} else if (status == 4) {

View File

@@ -22,7 +22,9 @@ function start() {
} else if (em.getProperty("started").equals("true")) {
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." );
} else {
em.startInstance(cm.getParty(), cm.getMap());
if(!em.startInstance(cm.getParty(), cm.getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
}
}
}
}

View File

@@ -44,7 +44,7 @@ function action(mode, type, selection) {
cm.sendNext("Thank you for not only restoring the statue, but rescuing me, Minerva, from the entrapment. May the blessing of the goddess be with you till the end...");
else if (status == 1) {
var eim = cm.getPlayer().getEventInstance();
eim.finishPQ();
eim.clearPQ();
cm.dispose();
}
} else if (cm.getPlayer().getMapId() == 920011300) {

View File

@@ -117,7 +117,11 @@ function action(mode, type, selection) {
if (em == null) {
cm.sendOk("This trial is currently under construction.");
} else {
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
party = cm.getPlayer().getEventInstance().getPlayers();
cm.removeFromParty(4001015, party);
cm.removeFromParty(4001018, party);

View File

@@ -79,7 +79,11 @@ function action(mode, type, selection) {
cm.sendOk("You may not use that password.");
else { // start Zakum Battle
var eim = em.newInstance("Zakum" + passwd);
em.startInstance(eim,cm.getPlayer().getName());
if(!em.startInstance(eim,cm.getPlayer().getName())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
eim.registerPlayer(cm.getPlayer());
}
}

View File

@@ -82,7 +82,7 @@ function action(mode, type, selection) {
cm.givePartyExp(20000, party);
} else
cm.givePartyExp(12000, party);
eim.finishPQ();
eim.clearPQ();
cm.dispose();
}
else if (selectedType == 2) {

View File

@@ -74,7 +74,11 @@ function action(mode, type, selection) {
} else {
var prop = em.getProperty("LPQOpen");
if (prop == null || prop.equals("true")) {
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.removeAll(4001022);
cm.removeAll(4001023);
cm.dispose();

View File

@@ -85,7 +85,11 @@ function action(mode, type, selection) {
}
else {
// Begin the PQ.
em.startInstance(cm.getParty(),cm.getPlayer().getMap());
if(!em.startInstance(cm.getParty(),cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
//force the two scripts on portals in the map
//eim = cm.getPlayer().getEventInstance();
var map = eim.getMapInstance(240050100);

View File

@@ -50,7 +50,11 @@ function action(mode, type, selection) {
if(eli.size() > 0) {
var prop = em.getProperty("state");
if (prop != null && prop.equals("0")) {
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.dispose();
} else {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");

View File

@@ -20,28 +20,32 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
var em = cm.getEventManager("PiratePQ");
if (em == null) {
cm.sendNext("The event isn't started...");
cm.dispose();
return;
}
level = em.getProperty("level");
if (!cm.isLeader()) {
cm.sendNext("I wish for your leader to talk to me.");
cm.dispose();
return;
}
var eim = cm.getEventInstance();
if (eim == null) {
cm.warp(251010404,0);
cm.sendNext("How are you even here without being registered on an event?");
cm.dispose();
return;
}
level = eim.getProperty("level");
switch(cm.getPlayer().getMapId()) {
case 925100000:
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must destroy all the monsters guarding it.");
cm.dispose();
break;
case 925100100:
var emp = em.getProperty("stage2");
var emp = eim.getProperty("stage2");
if (emp == null) {
em.setProperty("stage2", "0");
eim.setProperty("stage2", "0");
emp = "0";
}
if (emp.equals("0")) {
@@ -49,7 +53,7 @@ function action(mode, type, selection) {
cm.sendNext("Excellent! Now hunt me 20 Rising Medals.");
cm.gainItem(4001120,-20);
cm.getMap().killAllMonsters();
em.setProperty("stage2", "1");
eim.setProperty("stage2", "1");
} else {
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rookie Medals.");
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300114, level, true);
@@ -59,7 +63,7 @@ function action(mode, type, selection) {
cm.sendNext("Excellent! Now hunt me 20 Veteran Medals.");
cm.gainItem(4001121,-20);
cm.getMap().killAllMonsters();
em.setProperty("stage2", "2");
eim.setProperty("stage2", "2");
} else {
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Rising Medals.");
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300115, level, true);
@@ -69,7 +73,7 @@ function action(mode, type, selection) {
cm.sendNext("Excellent! Now let us go.");
cm.gainItem(4001122,-20);
cm.getMap().killAllMonsters();
em.setProperty("stage2", "3");
eim.setProperty("stage2", "3");
} else {
cm.sendNext("We are heading into the Pirate Ship now! To get in, we must qualify ourselves as noble pirates. Hunt me 20 Veteran Medals.");
if(cm.countMonster() < 1) cm.getPlayer().getMap().spawnAllMonsterIdFromMapSpawnList(9300116, level, true);
@@ -87,9 +91,9 @@ function action(mode, type, selection) {
case 925100201:
if (cm.getMap().getMonsters().size() == 0) {
cm.sendNext("Excellent.");
if (em.getProperty("stage2a") == "0") {
if (eim.getProperty("stage2a") == "0") {
cm.getMap().setReactorState();
em.setProperty("stage2a", "1");
eim.setProperty("stage2a", "1");
}
} else {
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
@@ -99,9 +103,9 @@ function action(mode, type, selection) {
case 925100301:
if (cm.getMap().getMonsters().size() == 0) {
cm.sendNext("Excellent.");
if (em.getProperty("stage3a").equals("0")) {
if (eim.getProperty("stage3a").equals("0")) {
cm.getMap().setReactorState();
em.setProperty("stage3a", "1");
eim.setProperty("stage3a", "1");
}
} else {
cm.sendNext("These bellflowers are in hiding. We must liberate them.");
@@ -119,7 +123,8 @@ function action(mode, type, selection) {
break;
case 925100500:
if (cm.getMap().getMonsters().size() == 0) {
cm.clearPQ(925100600);
cm.getEventInstance().clearPQ();
cm.getEventInstance().warpEventTeam(925100600);
} else {
cm.sendNext("Defeat all monsters! Even Lord Pirate's minions!");
}

View File

@@ -50,7 +50,11 @@ function action(mode, type, selection) {
if(eli.size() > 0) {
var prop = em.getProperty("state");
if (prop != null && prop.equals("0")) {
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.dispose();
} else {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");

View File

@@ -189,7 +189,7 @@ function action(mode, type, selection) {
cm.sendOk("Due to an unknown error, the request for squad has been denied.");
cm.dispose();
}
} else if (selection == 3) { // get insode
} else if (selection == 3) { // get inside
if (cm.getSquad("PinkBean") != null) {
var dd = cm.getEventManager("PinkBeanBattle");
dd.startInstance(cm.getSquad("PinkBean"), cm.getMap(), 160104);

View File

@@ -64,7 +64,7 @@ function action(mode, type, selection) {
} else if (status == 3) {
if (cm.haveItem(4031801))
cm.gainItem(4031801, -1);
cm.warp(2010000);
cm.warp(104000000);
cm.dispose();
}
}

View File

@@ -41,18 +41,16 @@ function action(mode, type, selection) {
if (status == 0) {
if(state == 3) {
if(cm.getEventInstance().getProperty("clear") == null) {
cm.getEventInstance().clearPQ();
cm.getEventInstance().setProperty("clear", "true");
}
if(cm.isLeader()) {
if(cm.getPlayer().getEventInstance().getPlayerCount() > 1) {
cm.sendOk("Now, tell your party I will be warping everyone out and rewarding them as they talk to me. The leader goes last.");
cm.dispose();
return;
}
else {
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out...");
}
}
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now I will be handing your reward as you are being transported out...");
}
else {
cm.sendOk("For #bdefeating all bosses#k in this event, congratulations! Now you will receive a prize that matches your performance here as I warp you out.");
cm.sendOk("For #bdefeating all bosses#k in this event, congratulations! You will now receive a prize that matches your performance here as I warp you out.");
}
}
else if(state == 2) {
@@ -114,7 +112,11 @@ function action(mode, type, selection) {
if(eli.size() > 0) {
var prop = em.getProperty("state");
if (prop != null && prop.equals("0")) {
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.dispose();
} else {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");

View File

@@ -1,89 +1,91 @@
/*
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 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: Ronan
* @npc: Lakelis
* @map: 103000000 - Kerning City
* @func: Kerning PQ
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Lakelis - Victoria Road: Kerning City (103000000)
-- By ---------------------------------------------------------------------------------------------
Stereo
-- Version Info -----------------------------------------------------------------------------------
1.0 - First Version by Stereo
---------------------------------------------------------------------------------------------------
**/
var status;
var minLevel = 21;
var maxLevel = 255;
var minPlayers = 1;
var maxPlayers = 6;
var status = 0;
var minLevel = 1;
var maxLevel = 200;
var minPartySize = 1;
var maxPartySize = 6;
var state;
function start() {
status = -1;
action(1, 0, 0);
status = -1;
state = (cm.getMapId() >= 103000800 && cm.getMapId() <= 103000805) ? 1 : 0;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1)
status++;
else {
cm.dispose();
return;
}
if (status == 0) {
if (cm.getParty() == null) { // No Party
cm.sendOk("How about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.");
cm.dispose();
} else if (!cm.isLeader()) { // Not Party Leader
cm.sendOk("If you want to try the quest, please tell the #bleader of your party#k to talk to me.");
cm.dispose();
if (mode == -1) {
cm.dispose();
} else {
var party = cm.getParty().getMembers();
var inMap = cm.partyMembersInMap();
var levelValid = 0;
for (var i = 0; i < party.size(); i++) {
if (party.get(i).getLevel() >= minLevel && party.get(i).getLevel() <= maxLevel)
levelValid++;
}
if (inMap < minPlayers || inMap > maxPlayers) {
cm.sendOk("Your party is not a party of "+minPlayers+". Please make sure all your members are present and qualified to participate in this quest.");
cm.dispose();
} else if (levelValid != inMap) {
cm.sendOk("Please make sure all your members are present and qualified to participate in this quest. This PQ requires players ranging from level "+minLevel+" to level "+maxLevel+". I see #b" + levelValid + "#k members are in the right level range. If this seems wrong, #blog out and log back in,#k or reform the party.");
cm.dispose();
} else {
var em = cm.getEventManager("KerningPQ");
if (em == null) {
cm.sendOk("This PQ is currently unavailable.");
} else if (em.getProperty("KPQOpen").equals("true")) {
// Begin the PQ.
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
party = cm.getParty();
cm.removePartyItems(4001008);
cm.removePartyItems(4001007);
em.setProperty("KPQOpen" , "false");
} else {
cm.sendNext("There is already another party inside. Please wait !");
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
if(state == 1) {
cm.sendYesNo("Do you wish to abandon this area?");
}
else {
cm.sendSimple("#b<Party Quest: 1st Accompaniment>#k\r\n\r\nHow about you and your party members collectively beating a quest? Here you'll find obstacles and problems where you won't be able to beat it without great teamwork. If you want to try it, please tell the #bleader of your party#k to talk to me.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
}
} else if (status == 1) {
if(state == 1) {
cm.warp(103000000);
cm.dispose();
}
else {
if (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var em = cm.getEventManager("KerningPQ");
if(em == null) {
cm.sendOk("The Kerning PQ has encountered an error.");
cm.dispose();
}
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
var prop = em.getProperty("state");
if (prop != null && prop.equals("0")) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.dispose();
} else {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
cm.dispose();
}
}
else {
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
cm.dispose();
}
}
} else if (selection == 1) {
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
cm.dispose();
} else {
cm.sendOk("#b<Party Quest: 1st Accompaniment>#k\r\nYour party must pass through many obstacles and puzzles while traversing the sub-objectives of this Party Quest. Coordinate with your team in order to further advance and defeat the final boss and collect the dropped item in order to access the rewards and bonus stage.");
cm.dispose();
}
}
}
cm.dispose();
}
}
}
}

View File

@@ -1,4 +1,4 @@
/*/*
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
@@ -21,31 +21,25 @@
*/
/**
-- Odin JavaScript --------------------------------------------------------------------------------
Cloto - Hidden Street : 1st Accompaniment
-- By ---------------------------------------------------------------------------------------------
Stereo
-- Version Info -----------------------------------------------------------------------------------
1.1 - Second Version by Moogra
1.0 - First Version by Stereo
---------------------------------------------------------------------------------------------------
**/
* @author: Stereo, Moogra, Ronan
* @npc: Cloto
* @map: 1st Accompaniment - KPQ
* @func: Kerning PQ
*/
importPackage(Packages.tools);
importPackage(java.awt);
var status;
var curMap;
var questions = Array("Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.",
var stage1Questions = Array(
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as warrior.",
"Here's the question. Collect the same number of coupons as the minimum amount of STR needed to make the first job advancement as a warrior.",
"Here's the question. Collect the same number of coupons as the minimum amount of INT needed to make the first job advancement as a magician.",
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a bowman.",
"Here's the question. Collect the same number of coupons as the minimum amount of DEX needed to make the first job advancement as a thief.",
"Here's the question. Collect the same number of coupons as the minimum level required to advance to 2nd job.",
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as a magician.");
var qanswers = Array(10, 35, 20, 25, 25, 30, 8);
var party;
var preamble; // we dont even need this mother fucker ! --
"Here's the question. Collect the same number of coupons as the minimum level required to make the first job advancement as a magician.");
var stage1Answers = Array(10, 35, 20, 25, 25, 30, 8);
var stage2Rects = Array(new Rectangle(-755,-132,4,218),new Rectangle(-721,-340,4,166),new Rectangle(-586,-326,4,150),new Rectangle(-483,-181,4,222));
var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,140,45),
new Rectangle(958,-180,140,50),new Rectangle(876,-238,140,45),
@@ -53,329 +47,251 @@ var stage3Rects = Array(new Rectangle(608,-180,140,50),new Rectangle(791,-117,14
var stage4Rects = Array(new Rectangle(910,-236,35,5),new Rectangle(877,-184,35,5),
new Rectangle(946,-184,35,5),new Rectangle(845,-132,35,5),
new Rectangle(910,-132,35,5),new Rectangle(981,-132,35,5));
var stage2combos = Array(Array(0,1,1,1),Array(1,0,1,1),Array(1,1,0,1),Array(1,1,1,0));
var stage3combos = Array(Array(0,0,1,1,1),Array(0,1,0,1,1),Array(0,1,1,0,1),
var stage2Combos = Array(Array(0,1,1,1),Array(1,0,1,1),Array(1,1,0,1),Array(1,1,1,0));
var stage3Combos = Array(Array(0,0,1,1,1),Array(0,1,0,1,1),Array(0,1,1,0,1),
Array(0,1,1,1,0),Array(1,0,0,1,1),Array(1,0,1,0,1),
Array(1,0,1,1,0),Array(1,1,0,0,1),Array(1,1,0,1,0),
Array(1,1,1,0,0));
var stage4combos = Array(Array(0,0,0,1,1,1),Array(0,0,1,0,1,1),Array(0,0,1,1,0,1),
var stage4Combos = Array(Array(0,0,0,1,1,1),Array(0,0,1,0,1,1),Array(0,0,1,1,0,1),
Array(0,0,1,1,1,0),Array(0,1,0,0,1,1),Array(0,1,0,1,0,1),
Array(0,1,0,1,1,0),Array(0,1,1,0,0,1),Array(0,1,1,0,1,0),
Array(0,1,1,1,0,0),Array(1,0,0,0,1,1),Array(1,0,0,1,0,1),
Array(1,0,0,1,1,0),Array(1,0,1,0,0,1),Array(1,0,1,0,1,0),
Array(1,0,1,1,0,0),Array(1,1,0,0,0,1),Array(1,1,0,0,1,0),
Array(1,1,0,1,0,0),Array(1,1,1,0,0,0));
var eye = 9300002;
var necki = 9300000;
var slime = 9300003;
var monsterIds = Array(eye, eye, eye, necki, necki, necki, necki, necki, necki, slime);
var prizeIdScroll = Array(2040502, 2040505,// Overall DEX and DEF
2040802,// Gloves for DEX
2040002, 2040402, 2040602);// Helmet, Topwear and Bottomwear for DEF
var prizeIdUse = Array(2000001, 2000002, 2000003, 2000006,// Orange, White and Blue Potions and Mana Elixir
2000004, 2022000, 2022003);// Elixir, Pure Water and Unagi
var prizeQtyUse = Array(80, 80, 80, 50, 5, 15, 15);
var prizeIdEquip = Array(1032004, 1032005, 1032009,// Level 20-25 Earrings
1032006, 1032007, 1032010,// Level 30 Earrings
1032002,// Level 35 Earring
1002026, 1002089, 1002090);// Bamboo Hats
var prizeIdEtc = Array(4010000, 4010001, 4010002, 4010003,// Mineral Ores
4010004, 4010005, 4010006,// Mineral Ores
4020000, 4020001, 4020002, 4020003,// Jewel Ores
4020004, 4020005, 4020006,// Jewel Ores
4020007, 4020008, 4003000); // Diamond and Black Crystal Ores and Screws
var prizeQtyEtc = Array(15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3, 3, 30);
//500, 1000, 2000, 4000, 7500 = default
Array(1,1,0,1,0,0),Array(1,1,1,0,0,0));
function clearStage(stage, eim, curMap) {
eim.setProperty(stage + "stageclear", "true");
eim.showClearEffect(true);
eim.linkToNextStage(stage, "kpq", curMap); //opens the portal to the next map
}
function rectangleStages(eim, property, areaCombos, areaRects) {
var c = eim.getProperty(property);
if(c == null) {
c = Math.floor(Math.random() * areaCombos.length);
eim.setProperty(property, c.toString());
}
else c = parseInt(c);
// get player placement
var players = eim.getPlayers();
var playerPlacement = new Array(0, 0, 0, 0, 0, 0);
for(var i = 0; i < eim.getPlayerCount(); i++) {
for(var j = 0; j < areaRects.length; j++) {
if(areaRects[j].contains(players.get(i).getPosition())) {
playerPlacement[j] += 1;
break;
}
}
}
var curCombo = areaCombos[c];
var accept = true;
for(var j = 0; j < curCombo.length; j++) {
if(curCombo[j] != playerPlacement[j]) {
accept = false;
break;
}
}
return accept;
}
var status = -1;
var eim;
function start() {
status = -1;
curMap = cm.getPlayer().getMapId() - 103000799;
action(1, 0, 0);
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1) {
status++;
} else if (type == 0 && mode == 0)
status--;
else {
cm.dispose();
return;
}
if (curMap == 1) { // First Stage.
if (isLeader()) {
var eim = cm.getPlayer().getEventInstance();
party = eim.getPlayers();
preamble = eim.getProperty("leader1stpreamble");
if (preamble == null) {
cm.sendNext("Hello. Welcome to the first stage. Look around and you'll see Ligators wandering around. When you defeat them, they will cough up a #bcoupon#k. Every member of the party other than the leader should talk to me, geta question, and gather up the same number of #bcoupons#k as the answer to the question I'll give to them.\r\nIf you gather up the right amount of #bcoupons#k, I'll give the #bpass#k to that player. Once all the party members other than the leader gather up the #bpasses#k and give them to the leader, the leader will hand over the #bpasses#k to me, clearing the stage in the process. The faster you take care of the stages, the more stages you'll be able to challenge. So I suggest you take care of things quickly and swiftly. Well then, best of luck to you.");
eim.setProperty("leader1stpreamble","done");
cm.dispose();
} else {
var complete = eim.getProperty(curMap + "stageclear");
if (complete != null) {
cm.sendNext("Please hurry on to the next stage, the portal opened!");
cm.dispose();
} else {
var numpasses = party.size() - 1; // All the players in the party need to get a pass besides the leader.
var strpasses = "#b" + numpasses + " passes#k";
if (!cm.haveItem(4001008, numpasses)) {
cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, " + strpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you.");
cm.dispose();
} else {
cm.sendNext("You gathered up " + strpasses + "! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!");
clear(1, eim, cm);
cm.givePartyExp("KerningPQ1st");
cm.gainItem(4001008, -numpasses);
cm.dispose();
// TODO: Make the shiny thing flash
}
}
}
} else { // Not leader
var eim = cm.getPlayer().getEventInstance();
pstring = "member1stpreamble" + cm.getPlayer().getId();
preamble = eim.getProperty(pstring);
if (status == 0) {
if (preamble == null) {
var qstring = "member1st" + cm.getPlayer().getId();
var question = eim.getProperty(qstring);
if (question == null) {
// Select a random question to ask the player.
var questionNum = Math.floor(Math.random() * questions.length);
eim.setProperty(qstring, questionNum);
}
cm.sendNext("Here, you need to collect #bcoupons#k by defeating the same number of Ligators as the answer to the questions asked individually.");
} else { // Otherwise, check for stage completed
var complete = eim.getProperty(curMap + "stageclear");
if (complete != null) { // Strage completed
cm.sendNext("Please hurry on to the next stage, the portal is open!");
cm.dispose();
} else {
// Reply to player correct/incorrect response to the question they have been asked
var qstring = "member1st" + cm.getPlayer().getId();
var qcompletestr = "member1stcom" + cm.getPlayer().getId();
var numcoupons = qanswers[parseInt(eim.getProperty(qstring))];
var qcorr = cm.itemQuantity(4001007);
if(eim.getProperty(qcompletestr) != null) {
cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue.");
cm.dispose();
} else if (numcoupons == qcorr) {
cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party.");
cm.gainItem(4001007, -numcoupons);
cm.gainItem(4001008, 1);
eim.setProperty(qcompletestr, "done");
cm.dispose();
} else
cm.sendNext("I'm sorry, but that is not the right answer! Please have the correct number of coupons in your inventory.");
}
}
} else if (status == 1) {
if (preamble == null) {
var qstring = "member1st" + cm.getPlayer().getId();
var question = parseInt(eim.getProperty(qstring));
cm.sendNextPrev(questions[question]);
} else {
var qstring = "member1st" + cm.getPlayer().getId();
var question = parseInt(eim.getProperty(qstring));
cm.sendNextPrev(questions[question]);
cm.dispose();
}
} else if (status == 2) { // Preamble completed
eim.setProperty(pstring,"done");
eim = cm.getEventInstance();
if (mode == -1) {
cm.dispose();
}
} // End first map scripts
}else if (2 <= curMap && 4 >= curMap) {
new Rectanglestages(cm);
}else if (curMap == 5) { // Final stage
var eim = cm.getPlayer().getEventInstance();
if (eim.getProperty("5stageclear") == null) { //If no
if (isLeader()) { // Leader
if (cm.haveItem(4001008, 10)) {
// Clear stage
cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Take care...");
party = eim.getPlayers();
cm.gainItem(4001008, -10);
clear(5, eim, cm);
cm.givePartyExp("KerningPQFinal");
cm.dispose();
} else { // Not done yet
cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!\r\nAs a result of complaints, it is now mandatory to kill all the Slimes! Do it!");
}
cm.dispose();
} else { // Members
cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and give them to your leader. Once you are done, return to me to collect your reward.");
cm.dispose();
}
} else { // Give rewards and warp to bonus
if (status == 0) {
cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available.\r\n#bYou will not receive a prize if you have no free slots!#k");
} else if (status == 1) {
getPrize(eim,cm);
cm.dispose();
}
}
} else { // No map found
cm.sendNext("Invalid map, this means the stage is incomplete.");
cm.dispose();
}
}
function clear(stage, eim, cm) {
eim.setProperty(stage + "stageclear", "true");
var map = eim.getMapInstance(cm.getPlayer().getMapId());
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2));
var mf = eim.getMapFactory();
map = mf.getMap(103000800 + stage);
var nextStage = eim.getMapInstance(103000800 + stage);
var portal = nextStage.getPortal("next00");
if (portal != null) {
portal.setScriptName("kpq" + stage);
}
}
function failstage(eim, cm) {
var map = eim.getMapInstance(cm.getPlayer().getMapId());
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Failed"));
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/wrong_kor"));
}
function Rectanglestages (cm) {
var eim = cm.getPlayer().getEventInstance();
var nthtext;
var nthobj;
var nthverb;
var nthpos;
var curArray;
var curCombo;
var objset;
if (curMap == 2) {
nthtext = "2nd";
nthobj = "ropes";
nthverb = "hang";
nthpos = "hang on the ropes too low";
curArray = stage2Rects;
curCombo = stage2combos;
objset = [0,0,0,0];
} else if (curMap == 3) {
nthtext = "3rd";
nthobj = "platforms";
nthverb = "stand";
nthpos = "stand too close to the edges";
curArray = stage3Rects;
curCombo = stage3combos;
objset = [0,0,0,0,0];
} else if (curMap == 4) {
nthtext = "4th";
nthobj = "barrels";
nthverb = "stand";
nthpos = "stand too close to the edges";
curArray = stage4Rects;
curCombo = stage4combos;
objset = [0,0,0,0,0,0];
}
if (isLeader()) { // Check if player is leader
if (status == 0) {
party = eim.getPlayers();
preamble = eim.getProperty("leader" + nthtext + "preamble");
if (preamble == null) { // first time talking.
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
eim.setProperty("leader" + nthtext + "preamble","done");
var sequenceNum = Math.floor(Math.random() * curCombo.length);
eim.setProperty("stage" + nthtext + "combo", sequenceNum.toString());
cm.dispose();
} else {
if(cm.getPlayer().getMap().getCharacters().size() != eim.getPlayerCount()) {
cm.sendOk("Please make sure all of your party members are here before you continue.");
cm.dispose();
return;
}
var complete = eim.getProperty(curMap + "stageclear");
if (complete != null) {
cm.sendNext("Please hurry on to the next stage, the portal opened!");
cm.dispose();
} else { // Check for people on ropes and their positions
var playersOnCombo = 0;
for (var i = 0; i < party.size(); i++) {
for (var y = 0; y < curArray.length; y++) {
if (curArray[y].contains(party.get(i).getPosition())) {
playersOnCombo++;
objset[y] = 1;
break;
}
}
}
if (playersOnCombo == 3) {
var combo = curCombo[parseInt(eim.getProperty("stage" + nthtext + "combo"))];
var correctCombo = true;
for (i = 0; i < objset.length && correctCombo; i++)
if (combo[i] != objset[i])
correctCombo = false;
if (correctCombo) {
clear(curMap, eim, cm);
cm.givePartyExp("KerningPQ" + nthtext);
cm.dispose();
} else { // Wrong
failstage(eim, cm);
cm.dispose();
}
} else {
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
cm.dispose();
}
}
}
} else {
var complete = eim.getProperty(curMap + "stageclear");
if (complete != null) {
var target = eim.getMapInstance(103000800 + curMap);
var targetPortal = target.getPortal("st00");
cm.getPlayer().changeMap(target, targetPortal);
}
cm.dispose();
}
} else { // Not leader
var complete = eim.getProperty(curMap.toString() + "stageclear");
if (complete != null) {
cm.sendNext("Please hurry on to the next stage, the portal opened!");
} else {
cm.sendNext("Please have the party leader talk to me.");
}
cm.dispose();
}
}
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
var curMap = cm.getMapId();
var stage = curMap - 103000800 + 1;
if(eim.getProperty(stage.toString() + "stageclear") != null) {
if(stage < 5) {
cm.sendNext("Please hurry on to the next stage, the portal opened!");
cm.dispose();
}
else {
cm.sendNext("Incredible! You cleared all the stages to get to this point. Here's a small prize for your job well done. Before you accept it, however, please make sure your use and etc. inventories have empty slots available.");
}
}
else if(curMap == 103000800) { // stage 1
if(cm.isLeader()) {
var numpasses = eim.getPlayerCount() - 1; // minus leader
function isLeader(){
if(cm.getParty() == null)
return false;
else
return cm.isLeader();
}
if(cm.hasItem(4001008, numpasses)) {
cm.sendNext("You gathered up " + numpasses + " passes! Congratulations on clearing the stage! I'll make the portal that sends you to the next stage. There's a time limit on getting there, so please hurry. Best of luck to you all!");
clearStage(stage, eim, curMap);
eim.gridClear();
cm.gainItem(4001008, -numpasses);
}
else {
cm.sendNext("I'm sorry, but you are short on the number of passes. You need to give me the right number of passes; it should be the number of members of your party minus the leader, in this case the total of " + numpasses + " to clear the stage. Tell your party members to solve the questions, gather up the passes, and give them to you.");
}
}
else {
var data = eim.gridCheck(cm.getPlayer());
function getPrize(eim,cm) {
var itemSetSel = Math.random();
var itemSet;
var itemSetQty;
var hasQty = false;
if (itemSetSel < 0.3)
itemSet = prizeIdScroll;
else if (itemSetSel < 0.6)
itemSet = prizeIdEquip;
else if (itemSetSel < 0.9) {
itemSet = prizeIdUse;
itemSetQty = prizeQtyUse;
hasQty = true;
} else {
itemSet = prizeIdEtc;
itemSetQty = prizeQtyEtc;
hasQty = true;
}
var sel = Math.floor(Math.random()*itemSet.length);
var qty = 1;
if (hasQty)
qty = itemSetQty[sel];
cm.gainItem(itemSet[sel], qty, true, true);
cm.getPlayer().changeMap(eim.getMapInstance(103000805));
if(data == 0) {
cm.sendNext("Thanks for bringing me the coupons. Please hand the pass to your party leader to continue.");
} else if(data == -1) {
data = Math.floor(Math.random() * stage1Questions.length) + 1; //data will be counted from 1
eim.gridInsert(cm.getPlayer(), data);
var question = stage1Questions[data - 1];
cm.sendNext(question);
} else {
var answer = stage1Answers[data - 1];
if(cm.itemQuantity(4001007) == answer) {
cm.sendNext("That's the right answer! For that you have just received a #bpass#k. Please hand it to the leader of the party.");
cm.gainItem(4001007, -answer);
cm.gainItem(4001008, 1);
eim.gridInsert(cm.getPlayer(), 0);
}
else {
cm.sendNext("I'm sorry, but that is not the right answer! Please have the correct number of coupons in your inventory.");
}
}
}
cm.dispose();
} else if(curMap == 103000801) { // stage 2
var stgProperty = "stg2Property";
var stgCombos = stage2Combos;
var stgAreas = stage2Rects;
var nthtext = "2nd", nthobj = "ropes", nthverb = "hang", nthpos = "hang on the ropes too low";
var nextStgId = 103000802;
if(!eim.isLeader(cm.getPlayer())) {
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
}
else if(eim.getProperty(stgProperty) == null) {
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
var c = Math.floor(Math.random() * stgCombos.length);
eim.setProperty(stgProperty, c.toString());
}
else {
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
if(accept) {
clearStage(stage, eim, curMap);
cm.sendNext("Please hurry on to the next stage, the portal opened!");
}
else {
eim.showWrongEffect();
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
}
}
cm.dispose();
} else if(curMap == 103000802) {
var stgProperty = "stg3Property";
var stgCombos = stage3Combos;
var stgAreas = stage3Rects;
var nthtext = "3rd", nthobj = "platforms", nthverb = "stand", nthpos = "stand too close to the edges";
var nextStgId = 103000803;
if(!eim.isLeader(cm.getPlayer())) {
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
}
else if(eim.getProperty(stgProperty) == null) {
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
var c = Math.floor(Math.random() * stgCombos.length);
eim.setProperty(stgProperty, c.toString());
}
else {
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
if(accept) {
clearStage(stage, eim, curMap);
cm.sendNext("Please hurry on to the next stage, the portal opened!");
}
else {
eim.showWrongEffect();
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
}
}
cm.dispose();
} else if(curMap == 103000803) {
var stgProperty = "stg4Property";
var stgCombos = stage4Combos;
var stgAreas = stage4Rects;
var nthtext = "4th", nthobj = "barrels", nthverb = "stand", nthpos = "stand too close to the edges";
var nextStgId = 103000804;
if(!eim.isLeader(cm.getPlayer())) {
cm.sendOk("Follow the instructions given by your party leader to proceed through this stage.");
}
else if(eim.getProperty(stgProperty) == null) {
cm.sendNext("Hi. Welcome to the " + nthtext + " stage. Next to me, you'll see a number of " + nthobj + ". Out of these " + nthobj + ", #b3 are connected to the portal that sends you to the next stage#k. All you need to do is have #b3 party members find the correct " + nthobj + " and " + nthverb + " on them.#k\r\nBUT, it doesn't count as an answer if you " + nthpos + "; please be near the middle of the " + nthobj + " to be counted as a correct answer. Also, only 3 members of your party are allowed on the " + nthobj + ". Once they are " + nthverb + "ing on them, the leader of the party must #bdouble-click me to check and see if the answer's correct or not#k. Now, find the right " + nthobj + " to " + nthverb + " on!");
var c = Math.floor(Math.random() * stgCombos.length);
eim.setProperty(stgProperty, c.toString());
}
else {
var accept = rectangleStages(eim, stgProperty, stgCombos, stgAreas);
if(accept) {
clearStage(stage, eim, curMap);
cm.sendNext("Please hurry on to the next stage, the portal opened!");
}
else {
eim.showWrongEffect();
cm.sendNext("It looks like you haven't found the 3 " + nthobj + " just yet. Please think of a different combination of " + nthobj + ". Only 3 are allowed to " + nthverb + " on " + nthobj + ", and if you " + nthpos + " it may not count as an answer, so please keep that in mind. Keep going!");
}
}
cm.dispose();
} else if(curMap == 103000804) {
if (eim.isLeader(cm.getPlayer())) {
if (cm.haveItem(4001008, 10)) {
cm.sendNext("Here's the portal that leads you to the last, bonus stage. It's a stage that allows you to defeat regular monsters a little easier. You'll be given a set amount of time to hunt as much as possible, but you can always leave the stage in the middle of it through the NPC. Again, congratulations on clearing all the stages. Let your party talk to me to receive their prizes as they are allowed to pass to the bonus stage. Take care...");
cm.gainItem(4001008, -10);
clearStage(stage, eim, curMap);
eim.clearPQ();
} else {
cm.sendNext("Hello. Welcome to the 5th and final stage. Walk around the map and you'll be able to find some Boss monsters. Defeat all of them, gather up #bthe passes#k, and please get them to me. Once you earn your pass, the leader of your party will collect them, and then get them to me once the #bpasses#k are gathered up. The monsters may be familiar to you, but they may be much stronger than you think, so please be careful. Good luck!");
}
} else {
cm.sendNext("Welcome to the 5th and final stage. Walk around the map and you will be able to find some Boss monsters. Defeat them all, gather up the #bpasses#k, and #bgive them to your leader#k. Once you are done, return to me to collect your reward.");
}
cm.dispose();
}
}
else if (status == 1) {
if(!eim.giveEventReward(cm.getPlayer())) {
cm.sendNext("Please make room on your inventory first!");
} else {
cm.warp(103000805, "st00");
}
cm.dispose();
}
}
}

View File

@@ -46,7 +46,7 @@ function action(mode, type, selection){
var mapId = cm.getPlayer().getMapId();
if (mapId == 103000890) {
if (status == 0) {
cm.sendNext("See you next time.");
cm.sendNext("To return back to the city, follow this way.");
} else {
cm.getPlayer().changeMap(103000000, cm.getClient().getChannelServer().getMapFactory().getMap(103000000).getRandomSpawnpoint());
cm.removeAll(4001007);
@@ -61,15 +61,7 @@ function action(mode, type, selection){
}
cm.sendYesNo(outText);
} else if (mode == 1) {
var eim = cm.getPlayer().getEventInstance(); // Remove them from the PQ!
if (eim == null)
cm.warp(103000890, "st00"); // Warp player
else if (cm.isLeader()) {
//cm.getEventManager("KerningPQ").setProperty("KPQOpen" , "true");
eim.disbandParty();
}
else
eim.leftParty(cm.getPlayer());
cm.warp(103000890, "st00"); // Warp player
cm.dispose();
}
}

View File

@@ -34,7 +34,7 @@ function start() {
points = 100;
cm.getGuild().gainGP(points);
}
eim.finishPQ();
eim.clearPQ();
}
else {
cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and return it to me. That is all.");

View File

@@ -72,8 +72,11 @@ function action(mode, type, selection) {
} else if (!open){
cm.sendOk("The PQ is #rclosed#k for now.");
} else {
//cm.sendOk("You may enter");//ENTER PQ
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
var party = cm.getPlayer().getEventInstance().getPlayers();
cm.removeFromParty(4001106, party);
}

View File

@@ -59,8 +59,13 @@ function start() {
var em = cm.getEventManager("AmoriaPQ");
if (em == null)
cm.dispose();
else
em.startInstance(cm.getParty(),cm.getPlayer().getMap());
else {
if(!em.startInstance(cm.getParty(),cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
}
cm.dispose();
}
else {

View File

@@ -26,7 +26,7 @@ Kerning PQ: 4th stage to final stage portal
function enter(pi) {
var eim = pi.getPlayer().getEventInstance();
var target = eim.getMapInstance(103000805);
if (eim.getProperty("4stageclear") != null) {
if (eim.getProperty("5stageclear") != null) {
pi.getPlayer().changeMap(target, target.getPortal("st00"));
return true;
}

View File

@@ -1,7 +1,8 @@
function enter(pi) {
if ((pi.getMap().getMonsters().size() == 0 || pi.getMap().getMonsterById(9300183) != null) && (pi.getMap().getReactorByName("") == null || pi.getMap().getReactorByName("").getState() == 1)) {
if(pi.isLeader()) {
pi.clearPQ(930000800);
pi.getEventInstance().clearPQ();
pi.getEventInstance().warpEventTeam(930000800);
return true;
}
else {