Files
sweetgum-server/scripts/event/Aran_3rdmount.js
ronancpl f698c41f00 Nihal quests + Reactor's mapitem detection + MapleQuestMesoFetcher
Improved quests and game progression in the Nihal Desert region.
Reactors that uses map items now automatically detects those already on the ground after changing states.
New tool: MapleQuestMesoFetcher. This tool parses the Quest.wz XML files, detecting and reporting quest ids from quests that does not properly checks for mesos to take from the player before completing the quest.
2017-12-07 19:08:38 -02:00

114 lines
2.8 KiB
JavaScript

/*
This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server
Copyleft (L) 2017 RonanLana
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 Ronan
* Event - Wolves' Mount Quest
**/
importPackage(Packages.tools);
var entryMap = 914030000;
var exitMap = 140010210;
var minMapId = 914030000;
var maxMapId = 914030000;
var eventTime = 3; //3 minutes
var lobbyRange = [0, 0];
function setLobbyRange() {
return lobbyRange;
}
function init() {
em.setProperty("noEntry","false");
}
function respawnStages(eim) {}
function playerEntry(eim, player) {
var mapObj = eim.getInstanceMap(entryMap);
mapObj.resetPQ(1);
mapObj.instanceMapForceRespawn();
mapObj.closeMapSpawnPoints();
respawnStages(eim);
player.changeMap(entryMap, 1);
em.setProperty("noEntry","true");
player.getClient().getSession().write(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}
function playerUnregistered(eim, player) {}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
eim.dispose();
em.setProperty("noEntry","false");
}
function scheduledTimeout(eim) {
var player = eim.getPlayers().get(0);
playerExit(eim, player);
player.changeMap(exitMap);
}
function playerDisconnected(eim, player) {
playerExit(eim, player);
}
function changedMap(eim, chr, mapid) {
if(mapid < minMapId || mapid > maxMapId) playerExit(eim, chr);
}
function clearPQ(eim) {
eim.stopEventTimer();
eim.setEventCleared();
var player = eim.getPlayers().get(0);
eim.unregisterPlayer(player);
player.changeMap(exitMap);
eim.dispose();
em.setProperty("noEntry","false");
}
function monsterKilled(mob, eim) {}
function monsterValue(eim, mobId) {
return 1;
}
function friendlyKilled(mob, eim) {
if(em.getProperty("noEntry") != "false") {
var player = eim.getPlayers().get(0);
playerExit(eim, player);
player.changeMap(exitMap);
}
}
function allMonstersDead(eim) {}
function cancelSchedule() {}
function dispose() {}