Files
sweetgum-server/scripts/event/Subway.js
ronancpl fca7b2adaa Implemented Kites, PlayerNPCs and C. Shop Surprise & Tweaked login
Added code support for Kites.
Reviewed concurrent access issues with pet autopot.
Addressed PlayerStorage issue where characters would not be properly deregistered from channel PlayerStorage in certain situations.
Implemented harp quest (questid 3314) because of reasons.
Added SFX to signalize KC/NLC subway departing/approaching.
Changed traveling time values to work similarly to GMS.
Properly developed the PlayerNPC feature in the source.
Added autodeployable PlayerNPC system and Hall of Fame.
Solved a glitch with NLC mayor's quiz questline that would allow a player to restart the quiz as many times one would see fit.
Added a custom server flag that allows overwriting the ToT 999 mobs to a new value (technically it doesn't overwrite, rather sets the player at quest start with 999 - n credited mobs).
Fixed permanent pets expiring after a while.
Added code support for Cash Shop Surprise item.
Reviewed login handler system as a whole, protecting many exposed flaws.
Solved a bug with ULTRA_THREE_SNAILS sometimes taking wrong etc shell from inventory.
2018-05-19 14:28:06 -03:00

57 lines
1.8 KiB
JavaScript

importPackage(Packages.tools);
var KC_Waiting;
var Subway_to_KC;
var KC_docked;
var NLC_Waiting;
var Subway_to_NLC;
var NLC_docked;
//Time Setting is in millisecond
var closeTime = 50 * 1000; //The time to close the gate
var beginTime = 1 * 60 * 1000; //The time to begin the ride
var rideTime = 4 * 60 * 1000; //The time that require move to destination
function init() {
KC_Waiting = em.getChannelServer().getMapFactory().getMap(600010004);
NLC_Waiting = em.getChannelServer().getMapFactory().getMap(600010002);
Subway_to_KC = em.getChannelServer().getMapFactory().getMap(600010003);
Subway_to_NLC = em.getChannelServer().getMapFactory().getMap(600010005);
KC_docked = em.getChannelServer().getMapFactory().getMap(103000100);
NLC_docked = em.getChannelServer().getMapFactory().getMap(600010001);
scheduleNew();
}
function scheduleNew() {
em.setProperty("docked", "true");
em.setProperty("entry", "true");
em.schedule("stopEntry", closeTime);
em.schedule("takeoff", beginTime);
}
function stopEntry() {
em.setProperty("entry","false");
}
function takeoff() {
KC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
NLC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
em.setProperty("docked","false");
KC_Waiting.warpEveryone(Subway_to_NLC.getId());
NLC_Waiting.warpEveryone(Subway_to_KC.getId());
em.schedule("arrived", rideTime);
}
function arrived() {
Subway_to_KC.warpEveryone(KC_docked.getId(), 0);
Subway_to_NLC.warpEveryone(NLC_docked.getId(), 0);
scheduleNew();
KC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
NLC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
}
function cancelSchedule() {
}