Reworked cash item consume. It now depletes from the selected slot rather than from the first slot it appears on inventory. Implemented PNPC and PMOB commands. Solved an issue with some events finishing abruptly when players quit a party. Added missing mandatory script functions to the event scripts. Solved an interaction issue with Wheel of Destiny activation in event instances. Added interaction with NPC Mom & Dad in the Engagement prequest. Solved an issue with event maps being disposed while reactor's spray items activity is still in effect. Fixed modifier scrolls such as Spikes on Shoes depleting a upgrade slot. Added a server flag for avoiding compulsory consuming by pet autopot. Added a cache for fetching mob names. Implemented boss drop rate. Smart protected commands system against command requests in burst by the same user. Revised login handler, bringing disconnection checks before checking login state and preventing new client reattribution to already logged-in character objects. Botched login handler sessions now properly gets closed.
133 lines
3.3 KiB
JavaScript
133 lines
3.3 KiB
JavaScript
/*
|
|
* 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/>.
|
|
*/
|
|
|
|
importPackage(Packages.tools);
|
|
|
|
var exitMap;
|
|
var entryMap;
|
|
var otherMap;
|
|
var minPlayers = 1;
|
|
var fightTime = 30;
|
|
var timer = 1000 * 60 * fightTime;
|
|
|
|
function init() {
|
|
exitMap = em.getChannelServer().getMapFactory().getMap(103040400);
|
|
entryMap = em.getChannelServer().getMapFactory().getMap(103040440);
|
|
otherMap = em.getChannelServer().getMapFactory().getMap(103040450);
|
|
}
|
|
|
|
function setup() {
|
|
var eim = em.newInstance("RockSpiritVIP_" + em.getProperty("player"));
|
|
respawn(eim);
|
|
eim.startEventTimer(timer);
|
|
return eim;
|
|
}
|
|
|
|
function afterSetup(eim) {}
|
|
|
|
function respawn(eim) {
|
|
var map = eim.getMapInstance(entryMap.getId());
|
|
var map2 = eim.getMapInstance(otherMap.getId());
|
|
map.allowSummonState(true);
|
|
map2.allowSummonState(true);
|
|
map.instanceMapRespawn();
|
|
map2.instanceMapRespawn();
|
|
eim.schedule("respawn", 10000);
|
|
}
|
|
|
|
|
|
function playerEntry(eim, player) {
|
|
var amplifierMap = eim.getMapInstance(entryMap.getId());
|
|
player.changeMap(amplifierMap);
|
|
eim.schedule("timeOut", timer);
|
|
}
|
|
|
|
function playerRevive(eim, player) {
|
|
player.respawn(eim, exitMap);
|
|
return false;
|
|
}
|
|
|
|
function playerDead(eim, player) {}
|
|
|
|
function playerDisconnected(eim, player) {
|
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
|
eim.unregisterPlayer(player);
|
|
end(eim);
|
|
}
|
|
else
|
|
eim.unregisterPlayer(player);
|
|
}
|
|
|
|
function changedMap(eim, player, mapid) {
|
|
if(mapid == exitMap.getId()) {
|
|
if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
|
|
eim.unregisterPlayer(player);
|
|
end(eim);
|
|
}
|
|
else
|
|
eim.unregisterPlayer(player);
|
|
}
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
function leftParty(eim, player) {}
|
|
|
|
function disbandParty(eim) {}
|
|
|
|
function playerUnregistered(eim, player) {}
|
|
|
|
function playerExit(eim, player) {
|
|
eim.unregisterPlayer(player);
|
|
player.changeMap(exitMap, exitMap.getPortal(0));
|
|
}
|
|
|
|
function cancelSchedule() {}
|
|
|
|
function dispose() {}
|
|
|
|
function clearPQ(eim) {}
|
|
|
|
function monsterKilled(mob, eim) {}
|
|
|
|
function allMonstersDead(eim) {}
|
|
|
|
function timeOut(eim) {
|
|
end(eim);
|
|
}
|
|
|
|
// ---------- FILLER FUNCTIONS ----------
|
|
|
|
function scheduledTimeout(eim) {}
|
|
|
|
function changedLeader(eim, leader) {}
|
|
|