Merge pull request #21 from P0nk/java-16-and-graal

Upgrade to Java 16 and GraalJS script engine
This commit is contained in:
Ponk
2021-05-21 21:23:50 +02:00
committed by GitHub
306 changed files with 1692 additions and 1686 deletions

View File

@@ -4,7 +4,7 @@
#
# Cosmic JAR creation stage
#
FROM maven:3.6.3-jdk-8 AS jar
FROM maven:3.8.1-openjdk-16 AS jar
# Build in a separated location which won't have permissions issues.
WORKDIR /opt/cosmic
@@ -21,7 +21,7 @@ RUN mvn -f ./pom.xml clean package -Dmaven.test.skip -T 1C
#
# Server creation stage
#
FROM openjdk:8
FROM openjdk:16
# Host the server in a location that won't have permissions issues.
WORKDIR /opt/server

View File

@@ -27,8 +27,8 @@ Discord: https://discord.gg/JU5aQapVZK
---
## Tools
* **Java 8 SDK**
* Link: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
* **Java 16 SDK** - Needed to compile and run Java code. Install manually or through IntelliJ depending on how you prefer to launch the server. Not required for launching with Docker.
* Link: https://jdk.java.net/16/
* **IntelliJ IDEA** - Java IDE and your main tool for working with the source code. Community edition is good enough.
@@ -260,10 +260,6 @@ Besides myself for maintaining this repository, credits are to be given to Wizet
Regarding distributability and usage of the code presented here: like it was before, this MapleStory server is open-source. By that, it is meant that anyone is **free to install, use, modify and redistribute the contents**, as long as there is **no kind of commercial trading involved** and the **credits to the original creators are maintained** within the codes.
This server source should be built and run on Java 8 in order to run properly -- used to be ran in Java 7, thanks kolakcc (Familiar) for the Java 8 support!
Consider using an IDE for setting up the server source into a project. Once mounted the project, build it on your machine and run the server using the "launch.bat" application.
In this project, many gameplay-wise issues generated from either the original WZ files and the server source have been partially or completely solved. Considering the use of the provided edited WZ's and server-side wz.xml files should be of the greatest importance when dealing with this instance of server source, in order to perceive it at it's full potential. My opinion, though!
- In other case, as fallback from the provided ones, consider using **whole clean set**. Selecting part of the provided ones to play pretty much *may eventually* lead to unexpected issues.
@@ -289,17 +285,6 @@ By taking the v83 MapleStory as the angular stone, incrementally look forward to
---
#### Preparing the ambient
For Hamachi:
* Try opening it. It's that simple.
Hamachi is optional, though. You don't have to install Hamachi if you want to make the server just for use on your own machine.
However, if you want to let other players access your server, consider alternatively using port-forwarding methods.
---
#### The MobBookUpdate example
As an example of client WZ editing, consider the MapleMobBookUpdate tool project I developed, it updates all reported drop data on the Monster Book with what is currently being hold on the database:
@@ -350,12 +335,8 @@ Our Discord channel is still available on: https://discord.gg/Q7wKxHX
<hr id="donate" />
[//]: <> (If you REALLY liked what you have seen on this project, please feel free to donate a little something as a helping hand for my contributions towards Maple development. Also remember to **support Nexon**!)
### Disclaimer
[//]: <> (* HeavenMS development is decisively __ONLY accepting donations__ from the Paypal link aforementioned, in the __ronancpl/HeavenMS__ repository readme \(no patreons or other revenue resources\).)
* HeavenMS staff has __no current intention__ to publicly open a server with this source, if that ever comes to happen this note will be lifted. __Don't be scammed!__
* This server source is __NOT intended to be stable__ as is. Proper deadlock review and other maintenance contributions are needed in order to make it steps ahead on viability.

31
pom.xml
View File

@@ -12,23 +12,25 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>16</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<mainClass>net.server.Server</mainClass>
<log4j.version>2.14.1</log4j.version>
<graalvm.version>21.1.0</graalvm.version>
</properties>
<dependencies>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java7</artifactId>
<version>2.4.13</version>
<artifactId>HikariCP</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.0.19</version>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
@@ -38,7 +40,12 @@
<dependency>
<groupId>com.esotericsoftware.yamlbeans</groupId>
<artifactId>yamlbeans</artifactId>
<version>1.13</version>
<version>1.15</version>
</dependency>
<dependency>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<version>1.0</version>
</dependency>
<!-- Logging -->
@@ -62,6 +69,18 @@
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- Scripting -->
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>${graalvm.version}</version>
</dependency>
</dependencies>
<build>

View File

@@ -12,14 +12,14 @@ var maxMapId;
var eventTime; // Max time allotted for the event, in minutes.
var lobbyRange = [0, 0]; // Range of concurrent lobbies (min range is 0, max range is 7).
const maxLobbies = 7; // Max amount of concurrent active lobbies.
function init() {
// After loading, ChannelServer
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {

View File

@@ -31,8 +31,6 @@ var timer2;
var timer3;
var timer4;
importPackage(Packages.client);
function init() {
/*
if(em.getChannelServer().getId() == 1) { // Only run on channel 1.
@@ -58,15 +56,19 @@ function cancelSchedule() {
}
function start() {
var world = Packages.net.server.Server.getInstance().getWorld(em.getChannelServer().getWorld());
world.setExpRate(8);
world.broadcastPacket(Packages.tools.MaplePacketCreator.serverNotice(6, "The Bunny Onslaught Survival Scanner (BOSS) has detected an Easter Bunny onslaught soon! The GM team has activated the Emergency XP Pool (EXP) that doubles experience gained for the next two hours!"));
const Server = Java.type('net.server.Server');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var world = Server.getInstance().getWorld(em.getChannelServer().getWorld());
world.setExpRate(8);
world.broadcastPacket(MaplePacketCreator.serverNotice(6, "The Bunny Onslaught Survival Scanner (BOSS) has detected an Easter Bunny onslaught soon! The GM team has activated the Emergency XP Pool (EXP) that doubles experience gained for the next two hours!"));
}
function stop() {
var world = Packages.net.server.Server.getInstance().getWorld(em.getChannelServer().getWorld());
world.setExpRate(4);
world.broadcastPacket(Packages.tools.MaplePacketCreator.serverNotice(6, "Unfortunately the Emergency XP Pool (EXP) has run out of juice for now and needs to recharge causing the EXP rate to go back to normal."));
const Server = Java.type('net.server.Server');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var world = Server.getInstance().getWorld(em.getChannelServer().getWorld());
world.setExpRate(4);
world.broadcastPacket(MaplePacketCreator.serverNotice(6, "Unfortunately the Emergency XP Pool (EXP) has run out of juice for now and needs to recharge causing the EXP rate to go back to normal."));
}
// ---------- FILLER FUNCTIONS ----------

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Bowman
**/
importPackage(Packages.tools);
var entryMap = 108010100;
var exitMap = 105040305;
@@ -31,10 +30,10 @@ var maxMapId = 108010101;
var eventTime = 20; //20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -54,7 +53,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Magician
**/
importPackage(Packages.tools);
var entryMap = 108010200;
var exitMap = 100040106;
@@ -31,10 +30,10 @@ var maxMapId = 108010201;
var eventTime = 20; //20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -54,7 +53,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Kenta's Mount Quest
**/
importPackage(Packages.tools);
var entryMap = 923010000;
var exitMap = 923010100;
@@ -33,10 +32,10 @@ var eventMaps = [923010000];
var eventTime = 5; //5 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -84,7 +83,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Pirate
**/
importPackage(Packages.tools);
var entryMap = 108010500;
var exitMap = 105070200;
@@ -31,10 +30,10 @@ var maxMapId = 108010501;
var eventTime = 20; //20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -46,7 +45,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Thief
**/
importPackage(Packages.tools);
var entryMap = 108010400;
var exitMap = 107000402;
@@ -31,10 +30,10 @@ var maxMapId = 108010401;
var eventTime = 20; //20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -54,7 +53,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* 3rd Job Event - Warrior
**/
importPackage(Packages.tools);
var entryMap = 108010300;
var exitMap = 105070001;
@@ -31,10 +30,10 @@ var maxMapId = 108010301;
var eventTime = 20; //20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -54,7 +53,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -30,10 +30,10 @@ var maxMapId = 912020000;
var eventTime = 2; //2 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {

View File

@@ -30,10 +30,10 @@ var maxMapId = 912010200;
var eventTime = 4; //4 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {

View File

@@ -30,10 +30,10 @@ var maxMapId = 912010200;
var eventTime = 4; //4 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var KC_bfd;
var Plane_to_CBD;
var CBD_docked;

View File

@@ -37,14 +37,14 @@ var maxMapId = 670010800;
var eventTime = 75; // 75 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -107,7 +107,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers && mask == 3)) eligible = [];
if(onlyMarriedPlayers && hasNotMarried) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -147,8 +147,11 @@ function setup(level, lobbyid) {
eim.getInstanceMap(670010800).shuffleReactors();
var mapObj = eim.getInstanceMap(670010700);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400536);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(942, 478));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400536);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(942, 478));
respawnStages(eim);

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* Event - Scadur's Mount Quest
**/
importPackage(Packages.tools);
var entryMap = 921110000;
var exitMap = 211050000;
@@ -31,10 +30,10 @@ var maxMapId = 921110000;
var eventTime = 3; //3 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -60,7 +59,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 2);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* Event - Wolves' Mount Quest
**/
importPackage(Packages.tools);
var entryMap = 914030000;
var exitMap = 140010210;
@@ -31,10 +30,10 @@ var maxMapId = 914030000;
var eventTime = 3; //3 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -61,7 +60,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 1);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -40,16 +40,19 @@ function cancelSchedule() {
}
function start() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var mapObj = em.getChannelServer().getMapFactory().getMap(800020120); // original mapid was 251010101
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(6090002);
var mobObj = MapleLifeFactory.getMonster(6090002);
if(mapObj.getMonsterById(6090002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(560, 50));
mapObj.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears."));
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(560, 50));
mapObj.broadcastMessage(MaplePacketCreator.serverNotice(6, "From amongst the ruins shrouded by the mists, Bamboo Warrior appears."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var herbGarden = em.getChannelServer().getMapFactory().getMap(251010102);
var gcent = Packages.server.life.MapleLifeFactory.getMonster(5220004);
if(herbGarden.getMonsterById(5220004) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
herbGarden.spawnMonsterOnGroundBelow(gcent, new Packages.java.awt.Point(560, 50));
herbGarden.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var gcent = MapleLifeFactory.getMonster(5220004);
herbGarden.spawnMonsterOnGroundBelow(gcent, new Point(560, 50));
herbGarden.broadcastMessage(MaplePacketCreator.serverNotice(6, "From the mists surrounding the herb garden, the gargantuous Giant Centipede appears."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var royalCatthusDesert = em.getChannelServer().getMapFactory().getMap(260010201);
var deo = Packages.server.life.MapleLifeFactory.getMonster(3220001);
if(royalCatthusDesert.getMonsterById(3220001) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Packages.java.awt.Point(645, 275));
royalCatthusDesert.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var deo = MapleLifeFactory.getMonster(3220001);
royalCatthusDesert.spawnMonsterOnGroundBelow(deo, new Point(645, 275));
royalCatthusDesert.broadcastMessage(MaplePacketCreator.serverNotice(6, "Deo slowly appeared out of the sand dust."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400610;
var bossMapid = 677000003;
var bossMsg = "Amdusias has appeared!";
var bossPos = new Packages.java.awt.Point(467, 0);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(467, 0);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400609;
var bossMapid = 677000005;
var bossMsg = "Andras has appeared!";
var bossPos = new Packages.java.awt.Point(201, 80);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(201, 80);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400613;
var bossMapid = 677000009;
var bossMsg = "Valefor has appeared!";
var bossPos = new Packages.java.awt.Point(251, -841);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(251, -841);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400633;
var bossMapid = 677000012;
var bossMsg = "Astaroth has appeared!";
var bossPos = new Packages.java.awt.Point(842, 0);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(842, 0);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400612;
var bossMapid = 677000001;
var bossMsg = "Marbas has appeared!";
var bossPos = new Packages.java.awt.Point(461, 61);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(461, 61);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,17 +41,21 @@ function start() {
var bossMobid = 9400611;
var bossMapid = 677000007;
var bossMsg = "Crocell has appeared!";
var bossPos = new Packages.java.awt.Point(171, 50);
var map = em.getChannelServer().getMapFactory().getMap(bossMapid);
if (map.getMonsterById(bossMobid) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var boss = Packages.server.life.MapleLifeFactory.getMonster(bossMobid);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var boss = MapleLifeFactory.getMonster(bossMobid);
var bossPos = new Point(171, 50);
map.spawnMonsterOnGroundBelow(boss, bossPos);
map.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, bossMsg));
map.broadcastMessage(MaplePacketCreator.serverNotice(6, bossMsg));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -26,8 +26,6 @@
ThreeStep - based on xQuasar's King Clang spawner
**/
importPackage(Packages.server.life);
importPackage(Packages.tools);
function init() {
scheduleNew();
@@ -48,7 +46,12 @@ function start() {
setupTask = em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
dangeroudCroko1.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(6220000), new Packages.java.awt.Point(90, 119));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(90, 119);
dangeroudCroko1.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(6220000), spawnpoint);
dangeroudCroko1.broadcastMessage(MaplePacketCreator.serverNotice(6, "The huge crocodile Dyle has come out from the swamp."));
setupTask = em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
var setupTask;
function init() {
@@ -45,16 +43,20 @@ function cancelSchedule() {
}
function start() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var eliza = MapleLifeFactory.getMonster(8220000);
var stairwayToTheSky2 = em.getChannelServer().getMapFactory().getMap(200010300);
var eliza = Packages.server.life.MapleLifeFactory.getMonster(8220000);
if(stairwayToTheSky2.getMonsterById(8220000) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
stairwayToTheSky2.spawnMonsterOnGroundBelow(eliza, new Packages.java.awt.Point(208, 83));
stairwayToTheSky2.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Eliza has appeared with a black whirlwind."));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(208, 83);
stairwayToTheSky2.spawnMonsterOnGroundBelow(eliza, spawnpoint);
stairwayToTheSky2.broadcastMessage(MaplePacketCreator.serverNotice(6, "Eliza has appeared with a black whirlwind."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,15 +42,19 @@ function cancelSchedule() {
function start() {
var theForestOfEvil1 = em.getChannelServer().getMapFactory().getMap(100040105);
var faust1 = Packages.server.life.MapleLifeFactory.getMonster(5220002);
if(theForestOfEvil1.getMonsterById(5220002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
theForestOfEvil1.spawnMonsterOnGroundBelow(faust1, new Packages.java.awt.Point(456, 278));
theForestOfEvil1.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Faust appeared amidst the blue fog."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
const Point = Java.type('java.awt.Point');
var faust1 = MapleLifeFactory.getMonster(5220002);
const spawnpoint = new Point(456, 278);
theForestOfEvil1.spawnMonsterOnGroundBelow(faust1, spawnpoint);
theForestOfEvil1.broadcastMessage(MaplePacketCreator.serverNotice(6, "Faust appeared amidst the blue fog."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -43,16 +41,21 @@ function cancelSchedule() {
}
function start() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var theForestOfEvil2 = em.getChannelServer().getMapFactory().getMap(100040106);
var faust2 = Packages.server.life.MapleLifeFactory.getMonster(5220002);
var faust2 = MapleLifeFactory.getMonster(5220002);
if(theForestOfEvil2.getMonsterById(5220002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
theForestOfEvil2.spawnMonsterOnGroundBelow(faust2, new Packages.java.awt.Point(474, 278));
theForestOfEvil2.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Faust appeared amidst the blue fog."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(474, 278);
theForestOfEvil2.spawnMonsterOnGroundBelow(faust2, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
theForestOfEvil2.broadcastMessage(MaplePacketCreator.serverNotice(6, "Faust appeared amidst the blue fog."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -43,8 +41,9 @@ function cancelSchedule() {
}
function start() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var labSecretBasementPath = em.getChannelServer().getMapFactory().getMap(261030000);
var chimera = Packages.server.life.MapleLifeFactory.getMonster(8220002);
var chimera = MapleLifeFactory.getMonster(8220002);
if(labSecretBasementPath.getMonsterById(8220002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
@@ -54,8 +53,12 @@ function start() {
var posX;
var posY = 180;
posX = (Math.floor(Math.random() * 900) - 900);
labSecretBasementPath.spawnMonsterOnGroundBelow(chimera, new Packages.java.awt.Point(posX, posY));
labSecretBasementPath.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Kimera has appeared out of the darkness of the underground with a glitter in her eyes."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
labSecretBasementPath.spawnMonsterOnGroundBelow(chimera, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
labSecretBasementPath.broadcastMessage(MaplePacketCreator.serverNotice(6, "Kimera has appeared out of the darkness of the underground with a glitter in her eyes."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
var hotSand;
function init() {
@@ -50,12 +48,18 @@ function start() {
em.schedule("start", 3 * 60 *60 * 1000);
return;
}
var kingClang = Packages.server.life.MapleLifeFactory.getMonster(5220001);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var kingClang = MapleLifeFactory.getMonster(5220001);
var posX;
var posY = 140;
posX = Math.floor((Math.random() * 2400) - 1600);
hotSand.spawnMonsterOnGroundBelow(kingClang, new Packages.java.awt.Point(posX, posY));
hotSand.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "A strange turban shell has appeared on the beach."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
hotSand.spawnMonsterOnGroundBelow(kingClang, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
hotSand.broadcastMessage(MaplePacketCreator.serverNotice(6, "A strange turban shell has appeared on the beach."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var goblinForest2 = em.getChannelServer().getMapFactory().getMap(250010504);
var kingSageCat = Packages.server.life.MapleLifeFactory.getMonster(7220002);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var kingSageCat = MapleLifeFactory.getMonster(7220002);
if(goblinForest2.getMonsterById(7220002) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
@@ -53,8 +52,12 @@ function start() {
var posX;
var posY = 540;
posX = Math.floor((Math.random() * 1300) - 500);
goblinForest2.spawnMonsterOnGroundBelow(kingSageCat, new Packages.java.awt.Point(posX, posY));
goblinForest2.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The ghostly air around here has become stronger. The unpleasant sound of a cat crying can be heard."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
goblinForest2.spawnMonsterOnGroundBelow(kingSageCat, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
goblinForest2.broadcastMessage(MaplePacketCreator.serverNotice(6, "The ghostly air around here has become stronger. The unpleasant sound of a cat crying can be heard."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var leviathansCanyon = em.getChannelServer().getMapFactory().getMap(240040401);
var leviathan = Packages.server.life.MapleLifeFactory.getMonster(8220003);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var leviathan = MapleLifeFactory.getMonster(8220003);
if(leviathansCanyon.getMonsterById(8220003) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
@@ -53,8 +52,12 @@ function start() {
var posX;
var posY = 1125;
posX = Math.floor((Math.random() * 600) - 300);
leviathansCanyon.spawnMonsterOnGroundBelow(leviathan, new Packages.java.awt.Point(posX, posY));
leviathansCanyon.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Leviathan emerges from the canyon and the cold icy wind blows."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
leviathansCanyon.spawnMonsterOnGroundBelow(leviathan, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
leviathansCanyon.broadcastMessage(MaplePacketCreator.serverNotice(6, "Leviathan emerges from the canyon and the cold icy wind blows."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -26,8 +26,6 @@
ThreeStep - based on xQuasar's King Clang spawner
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -43,14 +41,19 @@ function cancelSchedule() {
function start() {
var thicketAroundTheBeach3 = em.getChannelServer().getMapFactory().getMap(104000400);
var mano = Packages.server.life.MapleLifeFactory.getMonster(2220000);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var mano = MapleLifeFactory.getMonster(2220000);
if(thicketAroundTheBeach3.getMonsterById(2220000) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
thicketAroundTheBeach3.spawnMonsterOnGroundBelow(mano, new Packages.java.awt.Point(279, -496));
thicketAroundTheBeach3.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "A cool breeze was felt when Mano appeared."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(279, -496);
thicketAroundTheBeach3.spawnMonsterOnGroundBelow(mano, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
thicketAroundTheBeach3.broadcastMessage(MaplePacketCreator.serverNotice(6, "A cool breeze was felt when Mano appeared."));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var moonRidge = em.getChannelServer().getMapFactory().getMap(222010310);
var nineTailedFox = Packages.server.life.MapleLifeFactory.getMonster(7220001);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var nineTailedFox = MapleLifeFactory.getMonster(7220001);
if(moonRidge.getMonsterById(7220001) != null) {
em.schedule("start", 3 * 60 *60 * 1000);
return;
@@ -52,8 +51,12 @@ function start() {
var posX;
var posY = 33;
posX = Math.floor((Math.random() * 1300) - 800);
moonRidge.spawnMonsterOnGroundBelow(nineTailedFox, new Packages.java.awt.Point(posX, posY));
moonRidge.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "As the moon light dims, a long fox cry can be heard and the presence of the old fox can be felt"));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
moonRidge.spawnMonsterOnGroundBelow(nineTailedFox, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
moonRidge.broadcastMessage(MaplePacketCreator.serverNotice(6, "As the moon light dims, a long fox cry can be heard and the presence of the old fox can be felt"));
em.schedule("start", 3 * 60 *60 * 1000);
}

View File

@@ -28,8 +28,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -45,7 +43,8 @@ function cancelSchedule() {
function start() {
var theSeaweedTower = em.getChannelServer().getMapFactory().getMap(230020100);
var seruf = Packages.server.life.MapleLifeFactory.getMonster(4220001);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var seruf = MapleLifeFactory.getMonster(4220001);
if(theSeaweedTower.getMonsterById(4220001) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -55,8 +54,12 @@ function start() {
var posX;
var posY = 520;
posX = Math.floor((Math.random() * 2300) - 1500);
theSeaweedTower.spawnMonsterOnGroundBelow(seruf, new Packages.java.awt.Point(posX, posY));
theSeaweedTower.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "A strange shell has appeared from a grove of seaweed"));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
theSeaweedTower.spawnMonsterOnGroundBelow(seruf, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
theSeaweedTower.broadcastMessage(MaplePacketCreator.serverNotice(6, "A strange shell has appeared from a grove of seaweed"));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,19 +41,23 @@ function cancelSchedule() {
function start() {
var snackBarMap = em.getChannelServer().getMapFactory().getMap(105090310);
var snackBar = Packages.server.life.MapleLifeFactory.getMonster(8220008);
if(snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var setPos = [[-626, -604], [735, -600]];
var rndPos = setPos[Math.floor(Math.random() * setPos.length)];
snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Packages.java.awt.Point(rndPos[0], rndPos[1]));
snackBarMap.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place."));
em.schedule("start", 3 * 60 *60 * 1000);
if (snackBarMap.getMonsterById(8220008) != null || snackBarMap.getMonsterById(8220009) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
var setPos = [[-626, -604], [735, -600]];
var rndPos = setPos[Math.floor(Math.random() * setPos.length)];
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var snackBar = MapleLifeFactory.getMonster(8220008);
snackBarMap.spawnMonsterOnGroundBelow(snackBar, new Point(rndPos[0], rndPos[1]));
snackBarMap.broadcastMessage(MaplePacketCreator.serverNotice(6, "Slowly, a suspicious food stand opens up on a strangely remote place."));
em.schedule("start", 3 * 60 * 60 * 1000);
}
// ---------- FILLER FUNCTIONS ----------

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var eastRockyMountain5 = em.getChannelServer().getMapFactory().getMap(101030404);
var stumpy = Packages.server.life.MapleLifeFactory.getMonster(3220000);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var stumpy = MapleLifeFactory.getMonster(3220000);
if(eastRockyMountain5.getMonsterById(3220000) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -54,8 +53,12 @@ function start() {
var posX;
var posY = 1280;
posX = Math.floor((Math.random() * 800) + 400);
eastRockyMountain5.spawnMonsterOnGroundBelow(stumpy, new Packages.java.awt.Point(posX, posY));
eastRockyMountain5.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Stumpy has appeared with a stumping sound that rings the Stone Mountain."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
eastRockyMountain5.spawnMonsterOnGroundBelow(stumpy, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
eastRockyMountain5.broadcastMessage(MaplePacketCreator.serverNotice(6, "Stumpy has appeared with a stumping sound that rings the Stone Mountain."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var territoryOfWanderingBear = em.getChannelServer().getMapFactory().getMap(250010304);
var taeRoon = Packages.server.life.MapleLifeFactory.getMonster(7220000);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var taeRoon = MapleLifeFactory.getMonster(7220000);
if(territoryOfWanderingBear.getMonsterById(7220000) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -54,8 +53,12 @@ function start() {
var posX;
var posY = 390;
posX = Math.floor((Math.random() * 700) - 800);
territoryOfWanderingBear.spawnMonsterOnGroundBelow(taeRoon, new Packages.java.awt.Point(posX, posY));
territoryOfWanderingBear.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Tae Roon has appeared with a soft whistling sound."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
territoryOfWanderingBear.spawnMonsterOnGroundBelow(taeRoon, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
territoryOfWanderingBear.broadcastMessage(MaplePacketCreator.serverNotice(6, "Tae Roon has appeared with a soft whistling sound."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -26,8 +26,6 @@
ThreeStep - based on xQuasar's King Clang spawner
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -43,7 +41,8 @@ function cancelSchedule() {
function start() {
var whirlpoolOfTime = em.getChannelServer().getMapFactory().getMap(220050100);
var timer1 = Packages.server.life.MapleLifeFactory.getMonster(5220003);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var timer1 = MapleLifeFactory.getMonster(5220003);
if(whirlpoolOfTime.getMonsterById(5220003) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -53,8 +52,12 @@ function start() {
var posX;
var posY = 1030;
posX = Math.floor((Math.random() * 770) - 770);
whirlpoolOfTime.spawnMonsterOnGroundBelow(timer1, new Packages.java.awt.Point(posX, posY));
whirlpoolOfTime.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
whirlpoolOfTime.spawnMonsterOnGroundBelow(timer1, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
whirlpoolOfTime.broadcastMessage(MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -27,8 +27,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -44,7 +42,8 @@ function cancelSchedule() {
function start() {
var lostTime1 = em.getChannelServer().getMapFactory().getMap(220050000);
var timer2 = Packages.server.life.MapleLifeFactory.getMonster(5220003);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var timer2 = MapleLifeFactory.getMonster(5220003);
if(lostTime1.getMonsterById(5220003) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -54,8 +53,12 @@ function start() {
var posX;
var posY = 1030;
posX = Math.floor((Math.random() * 1400) - 1000);
lostTime1.spawnMonsterOnGroundBelow(timer2, new Packages.java.awt.Point(posX, posY));
lostTime1.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
lostTime1.spawnMonsterOnGroundBelow(timer2, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
lostTime1.broadcastMessage(MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -28,8 +28,6 @@
**/
importPackage(Packages.client);
function init() {
scheduleNew();
}
@@ -45,7 +43,8 @@ function cancelSchedule() {
function start() {
var lostTime2 = em.getChannelServer().getMapFactory().getMap(220050200);
var timer3 = Packages.server.life.MapleLifeFactory.getMonster(5220003);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var timer3 = MapleLifeFactory.getMonster(5220003);
if(lostTime2.getMonsterById(5220003) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
@@ -55,8 +54,12 @@ function start() {
var posX;
var posY = 1030;
posX = Math.floor((Math.random() * 1400) - 700);
lostTime2.spawnMonsterOnGroundBelow(timer3, new Packages.java.awt.Point(posX, posY));
lostTime2.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
const Point = Java.type('java.awt.Point');
const spawnpoint = new Point(posX, posY);
lostTime2.spawnMonsterOnGroundBelow(timer3, spawnpoint);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
lostTime2.broadcastMessage(MaplePacketCreator.serverNotice(6, "Tick-Tock Tick-Tock! Timer makes it's presence known."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -41,15 +41,19 @@ function cancelSchedule() {
function start() {
var graysPrairie = em.getChannelServer().getMapFactory().getMap(221040301);
var zeno = Packages.server.life.MapleLifeFactory.getMonster(6220001);
if(graysPrairie.getMonsterById(6220001) != null) {
em.schedule("start", 3 * 60 * 60 * 1000);
return;
}
graysPrairie.spawnMonsterOnGroundBelow(zeno, new Packages.java.awt.Point(-4224, 776));
graysPrairie.broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery."));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
var zeno = MapleLifeFactory.getMonster(6220001);
graysPrairie.spawnMonsterOnGroundBelow(zeno, new Point(-4224, 776));
graysPrairie.broadcastMessage(MaplePacketCreator.serverNotice(6, "Zeno has appeared with a heavy sound of machinery."));
em.schedule("start", 3 * 60 * 60 * 1000);
}

View File

@@ -23,8 +23,6 @@
* @event: Vs Balrog
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 6, maxPlayers = 30;
var minLevel = 50, maxLevel = 255;
@@ -43,14 +41,14 @@ var bossMobId = 8830003;
var eventTime = 60; // 60 minutes
var releaseClawTime = 1;
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -105,7 +103,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -136,14 +134,17 @@ function releaseLeftClaw(eim) {
function spawnBalrog(eim) {
var mapObj = eim.getInstanceMap(entryMap);
mapObj.spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830000), new Packages.java.awt.Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830002), new Packages.java.awt.Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830006), new Packages.java.awt.Point(412, 258));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapObj.spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830000), new Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830002), new Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830006), new Point(412, 258));
}
function spawnSealedBalrog(eim) {
eim.getInstanceMap(entryMap).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(bossMobId), new Packages.java.awt.Point(412, 258));
const Point = Java.type('java.awt.Point');
eim.getInstanceMap(entryMap).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(bossMobId), new Point(412, 258));
}
function playerEntry(eim, player) {

View File

@@ -23,8 +23,6 @@
* @event: Vs Balrog
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 3, maxPlayers = 30;
var minLevel = 50, maxLevel = 255;
@@ -43,14 +41,14 @@ var bossMobId = 8830010;
var eventTime = 60; // 60 minutes
var releaseClawTime = 1;
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -105,7 +103,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -136,14 +134,17 @@ function releaseLeftClaw(eim) {
function spawnBalrog(eim) {
var mapObj = eim.getInstanceMap(entryMap);
mapObj.spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830007), new Packages.java.awt.Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830009), new Packages.java.awt.Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830013), new Packages.java.awt.Point(412, 258));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
mapObj.spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830007), new Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830009), new Point(412, 258));
mapObj.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8830013), new Point(412, 258));
}
function spawnSealedBalrog(eim) {
eim.getInstanceMap(entryMap).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(bossMobId), new Packages.java.awt.Point(412, 258));
const Point = Java.type('java.awt.Point');
eim.getInstanceMap(entryMap).spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(bossMobId), new Point(412, 258));
}
function playerEntry(eim, player) {

View File

@@ -21,7 +21,6 @@
* @Author Ronan
* Event - Balrog Quest
**/
importPackage(Packages.tools);
var entryMap = 910520000;
var exitMap = 105100100;
@@ -31,10 +30,10 @@ var maxMapId = 910520000;
var eventTime = 10; //10 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function init() {
@@ -63,7 +62,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 1);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}
@@ -96,7 +96,8 @@ function isBalrog(mob) {
function monsterKilled(mob, eim) {
if(isBalrog(mob)) {
eim.spawnNpc(1061015, new java.awt.Point(0, 115), mob.getMap());
const Point = Java.type('java.awt.Point');
eim.spawnNpc(1061015, new Point(0, 115), mob.getMap());
}
}
function monsterValue(eim, mobId) {

View File

@@ -1,7 +1,3 @@
importPackage(Packages.client);
importPackage(Packages.tools);
importPackage(Packages.server.life);
var Orbis_btf;
var Boat_to_Orbis;
var Orbis_Boat_Cabin;
@@ -64,7 +60,9 @@ function takeoff() {
em.setProperty("docked","false");
if(Math.random() < 0.42) em.schedule("approach", (invasionStartTime + (Math.random() * invasionDelayTime)));
if (Math.random() < 0.42) {
em.schedule("approach", (invasionStartTime + Math.trunc((Math.random() * invasionDelayTime))));
}
em.schedule("arrived", rideTime);
}
@@ -88,6 +86,7 @@ function approach() {
em.setProperty("haveBalrog","true");
Boat_to_Orbis.broadcastEnemyShip(true);
Boat_to_Ellinia.broadcastEnemyShip(true);
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
Boat_to_Orbis.broadcastMessage(MaplePacketCreator.musicChange("Bgm04/ArabPirate"));
Boat_to_Ellinia.broadcastMessage(MaplePacketCreator.musicChange("Bgm04/ArabPirate"));
@@ -96,6 +95,8 @@ function approach() {
}
function invasion() {
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var map1 = Boat_to_Ellinia;
var pos1 = new java.awt.Point(-538, 143);
map1.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(8150000), pos1);

View File

@@ -36,14 +36,14 @@ var maxMapId = 970042711;
var eventTime = 5; //5 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -117,7 +117,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 610030800;
var eventTime = 2; // 2 minutes for first stg
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {

View File

@@ -39,8 +39,6 @@
---------------------------------------------------------------------------------------------------
**/
importPackage(Packages.tools);
var Orbis_btf;
var Leafre_btf;
var Cabin_to_Orbis;

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 1
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [190000000, 190000001, 190000002];
var eventTime = 45; // 45 minutes
var couponsNeeded = 400; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, getDroppedQuantity(mob));
var dropper = eim.getPlayers().get(0);

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 2
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [191000000, 191000001];
var eventTime = 45; // 45 minutes
var couponsNeeded = 350; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, getDroppedQuantity(mob));
var dropper = eim.getPlayers().get(0);

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 3
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [192000000, 192000001];
var eventTime = 45; // 45 minutes
var couponsNeeded = 350; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, getDroppedQuantity(mob));
var dropper = eim.getPlayers().get(0);

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 4
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [195000000, 195010000, 195020000, 195030000];
var eventTime = 45; // 45 minutes
var couponsNeeded = 450; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, getDroppedQuantity(mob));
var dropper = eim.getPlayers().get(0);

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 5
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [196000000, 196010000];
var eventTime = 45; // 45 minutes
var couponsNeeded = 500; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, getDroppedQuantity(mob));
var dropper = eim.getPlayers().get(0);

View File

@@ -23,8 +23,6 @@
* @event: Cafe PQ 6
*/
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 120;
@@ -40,14 +38,14 @@ var eventMaps = [197000000, 197010000];
var eventTime = 45; // 45 minutes
var couponsNeeded = 300; // total of coupons to complete the event
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -102,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -255,6 +253,7 @@ function monsterKilled(mob, eim) {
if(eim.isEventCleared()) return;
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(4001007, 0, 1);
var dropper = eim.getPlayers().get(0);

View File

@@ -35,14 +35,14 @@ var maxMapId = 925010300;
var eventTime = 6; // 6 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -80,7 +80,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -22,7 +22,6 @@
/**
*Dollhouse Event
**/
importPackage(Packages.tools);
var entryMap = 922000010;
var exitMap = 221024400;
@@ -46,7 +45,8 @@ function playerEntry(eim, player) {
player.changeMap(entryMap, 0);
em.setProperty("noEntry","true");
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(eventTime * 60));
eim.startEventTimer(eventTime * 60000);
}

View File

@@ -36,14 +36,14 @@ var maxMapId = 922020100;
var eventTime = 20; // 20 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 930000800;
var eventTime = 30; // 30 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -90,7 +90,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -35,14 +35,14 @@ var maxMapId = 921100300;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -80,7 +80,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -19,7 +19,6 @@
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 Orbis_btf;
var Genie_to_Orbis;

View File

@@ -38,14 +38,14 @@ var waitTime = 3; // 3 minutes
var eventTime = 90; // 90 minutes
var bonusTime = 0.5; // 30 seconds
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -112,7 +112,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var returnTo = new Array(200000141, 250000100);
var rideTo = new Array(250000100, 200000141);
var birdRide = new Array(200090300, 200090310);
@@ -33,7 +31,8 @@ function playerEntry(eim, player) {
returnMap = eim.getMapFactory().getMap(returnTo[myRide]);
onRide = eim.getMapFactory().getMap(birdRide[myRide]);
player.changeMap(onRide, onRide.getPortal(0));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(rideTime / 1000));
eim.schedule("timeOut", rideTime);
}

View File

@@ -36,14 +36,14 @@ var maxMapId = 910010400;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -249,8 +249,9 @@ function friendlyItemDrop(eim, mob) {
if (mob.getId() == 9300061) {
var cakes = eim.getIntProperty("bunnyCake") + 1;
eim.setIntProperty("bunnyCake", cakes);
mob.getMap().broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + "."));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
mob.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny made rice cake number " + cakes + "."));
}
}
@@ -258,7 +259,8 @@ function friendlyDamaged(eim, mob) {
if (mob.getId() == 9300061) {
var bunnyDamage = eim.getIntProperty("bunnyDamaged") + 1;
if (bunnyDamage > 5) {
broadcastMessage(Packages.tools.MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes."));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny is feeling sick. Please protect it so it can make delicious rice cakes."));
eim.setIntProperty("bunnyDamaged", 0);
}
}

View File

@@ -25,9 +25,6 @@
// GMS-like event string data thanks to iHealForLove
importPackage(Packages.client.inventory);
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 21, maxLevel = 30;
@@ -41,14 +38,14 @@ var maxMapId = 889100001;
var eventTime = 15; // 15 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -113,7 +110,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -277,6 +274,7 @@ function monsterKilled(mob, eim) {
}
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item((forceDrop || Math.random() < 0.77) ? 4032094 : 4032095, 0, 1); // 77% chance of not fake
var dropper = eim.getPlayers().get(0);
@@ -305,9 +303,11 @@ function snowmanEvolve(eim, curLevel) {
eim.setIntProperty("snowmanLevel", curLevel + 2); // increment by 2 to decrement by 1 on friendlyKilled
mapobj.killMonster(snowman, null, false, 2);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var snowman = MapleLifeFactory.getMonster(9400317 + (5 * difficulty) + curLevel);
mapobj.spawnMonsterOnGroundBelow(snowman, new java.awt.Point(-180, 15));
mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15));
if(curLevel >= 4) {
mapobj.allowSummonState(false);

View File

@@ -25,9 +25,6 @@
// GMS-like event string data thanks to iHealForLove
importPackage(Packages.client.inventory);
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 31, maxLevel = 40;
@@ -41,14 +38,14 @@ var maxMapId = 889100011;
var eventTime = 20; // 20 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -113,7 +110,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -277,6 +274,7 @@ function monsterKilled(mob, eim) {
}
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item((forceDrop || Math.random() < 0.77) ? 4032094 : 4032095, 0, 1); // 77% chance of not fake
var dropper = eim.getPlayers().get(0);
@@ -305,9 +303,11 @@ function snowmanEvolve(eim, curLevel) {
eim.setIntProperty("snowmanLevel", curLevel + 2); // increment by 2 to decrement by 1 on friendlyKilled
mapobj.killMonster(snowman, null, false, 2);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var snowman = MapleLifeFactory.getMonster(9400317 + (5 * difficulty) + curLevel);
mapobj.spawnMonsterOnGroundBelow(snowman, new java.awt.Point(-180, 15));
mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15));
if(curLevel >= 4) {
mapobj.allowSummonState(false);

View File

@@ -25,9 +25,6 @@
// GMS-like event string data thanks to iHealForLove
importPackage(Packages.client.inventory);
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 3, maxPlayers = 6;
var minLevel = 41, maxLevel = 50;
@@ -41,14 +38,14 @@ var maxMapId = 889100021;
var eventTime = 25; // 25 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -113,7 +110,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -277,6 +274,7 @@ function monsterKilled(mob, eim) {
}
var mapObj = mob.getMap();
const Item = Java.type('client.inventory.Item');
var itemObj = new Item((forceDrop || Math.random() < 0.77) ? 4032094 : 4032095, 0, 1); // 77% chance of not fake
var dropper = eim.getPlayers().get(0);
@@ -305,9 +303,11 @@ function snowmanEvolve(eim, curLevel) {
eim.setIntProperty("snowmanLevel", curLevel + 2); // increment by 2 to decrement by 1 on friendlyKilled
mapobj.killMonster(snowman, null, false, 2);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var snowman = MapleLifeFactory.getMonster(9400317 + (5 * difficulty) + curLevel);
mapobj.spawnMonsterOnGroundBelow(snowman, new java.awt.Point(-180, 15));
mapobj.spawnMonsterOnGroundBelow(snowman, new Point(-180, 15));
if(curLevel >= 4) {
mapobj.allowSummonState(false);

View File

@@ -23,8 +23,6 @@
* @event: Horntail Battle
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 6, maxPlayers = 30;
var minLevel = 100, maxLevel = 255;
@@ -38,14 +36,14 @@ var maxMapId = 240060200;
var eventTime = 120; // 120 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -97,15 +95,17 @@ function setup(channel) {
eim.getInstanceMap(240060000).resetPQ(level);
eim.getInstanceMap(240060100).resetPQ(level);
eim.getInstanceMap(240060200).resetPQ(level);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var map, mob;
map = eim.getInstanceMap(240060000);
mob = MapleLifeFactory.getMonster(8810000);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(960, 120));
map.spawnMonsterOnGroundBelow(mob, new Point(960, 120));
map = eim.getInstanceMap(240060100);
mob = MapleLifeFactory.getMonster(8810001);
map.spawnMonsterOnGroundBelow(mob, new java.awt.Point(-420, 120));
map.spawnMonsterOnGroundBelow(mob, new Point(-420, 120));
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);

View File

@@ -36,14 +36,14 @@ var maxMapId = 240050310;
var eventTime = 25; // 25 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 103000805;
var eventTime = 30; // 30 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var returnTo = new Array(103000100, 103000310);
var rideTo = new Array(103000310, 103000100);
var trainRide = new Array(103000301, 103000302);
@@ -34,7 +32,8 @@ function playerEntry(eim, player) {
returnMap = eim.getMapFactory().getMap(returnTo[myRide]);
onRide = eim.getMapFactory().getMap(trainRide[myRide]);
player.changeMap(onRide, onRide.getPortal(0));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.getClient().announce(MaplePacketCreator.getClock(rideTime / 1000));
player.getClient().announce(MaplePacketCreator.earnTitleMessage("The next stop is at Kerning " + (myRide == 0 ? "Square" : "Subway") + " Station. The exit is to your left."));
eim.schedule("timeOut", rideTime);

View File

@@ -36,14 +36,14 @@ var maxMapId = 541010100;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 809050016;
var eventTime = 15; // 15 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 922011100;
var eventTime = 45; // 45 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -1,6 +1,3 @@
importPackage(Packages.tools);
importPackage(Packages.server.life);
var eventTime = 10 * 60 * 1000; // 10 minutes
var entryMap = 106021600;
var exitMap = 106021402;
@@ -34,7 +31,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(difficulty, lobbyId){
@@ -66,7 +63,9 @@ function respawn(eim){
var weddinghall = eim.getMapInstance(entryMap);
weddinghall.getPortal(1).setPortalState(false);
weddinghall.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(292, 143));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
weddinghall.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(292, 143));
} else {
eim.schedule("respawn", 10000);
}

View File

@@ -1,6 +1,3 @@
importPackage(Packages.tools);
importPackage(Packages.server.life);
var eventTime = 10 * 60 * 1000; // 10 minutes
var entryMap = 106021601;
var exitMap = 106021402;
@@ -34,7 +31,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(difficulty, lobbyId){
@@ -57,7 +54,9 @@ function respawn(eim){
var weddinghall = eim.getMapInstance(entryMap);
weddinghall.getPortal(1).setPortalState(false);
weddinghall.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(292, 143));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
weddinghall.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new Point(292, 143));
} else {
eim.schedule("respawn", 10000);
}

View File

@@ -23,8 +23,6 @@
* @event: Magatia PQ (Alcadno)
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 4, maxPlayers = 4;
var minLevel = 71, maxLevel = 85;
@@ -38,14 +36,14 @@ var maxMapId = 926110600;
var eventTime = 45; // 45 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -144,11 +142,12 @@ function setup(level, lobbyid) {
eim.getInstanceMap(926110201).shuffleReactors(2518000, 2612004);
eim.getInstanceMap(926110202).shuffleReactors(2518000, 2612004);
eim.spawnNpc(2112010, new java.awt.Point(252, 243), eim.getInstanceMap(926110203));
eim.spawnNpc(2112010, new java.awt.Point(200, 100), eim.getInstanceMap(926110401));
eim.spawnNpc(2112011, new java.awt.Point(200, 100), eim.getInstanceMap(926110500));
eim.spawnNpc(2112018, new java.awt.Point(200, 100), eim.getInstanceMap(926110600));
const Point = Java.type('java.awt.Point');
eim.spawnNpc(2112010, new Point(252, 243), eim.getInstanceMap(926110203));
eim.spawnNpc(2112010, new Point(200, 100), eim.getInstanceMap(926110401));
eim.spawnNpc(2112011, new Point(200, 100), eim.getInstanceMap(926110500));
eim.spawnNpc(2112018, new Point(200, 100), eim.getInstanceMap(926110600));
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
@@ -245,15 +244,17 @@ function respawnStages(eim) {
var mapobj = eim.getMapInstance(926110401);
var mobcount = mapobj.countMonster(9300150);
var mobobj;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if(mobcount == 0) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-278, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-278, -126));
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-542, -126));
} else if(mobcount == 1) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-542, -126));
}
}
@@ -311,14 +312,16 @@ function yuleteAction(eim) {
var mob1 = 9300143, mob2 = 9300144;
mapobj.destroyNPC(2112010);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobobj1, mobobj2;
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(-455, 135));
}
@@ -326,8 +329,8 @@ function yuleteAction(eim) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(0, 135));
}
@@ -335,8 +338,8 @@ function yuleteAction(eim) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(360, 135));
}
}

View File

@@ -23,8 +23,6 @@
* @event: Magatia PQ (Zenumist)
*/
importPackage(Packages.server.life);
var isPq = true;
var minPlayers = 4, maxPlayers = 4;
var minLevel = 71, maxLevel = 85;
@@ -38,14 +36,14 @@ var maxMapId = 926100600;
var eventTime = 45; // 45 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -144,11 +142,12 @@ function setup(level, lobbyid) {
eim.getInstanceMap(926100201).shuffleReactors(2518000, 2612004);
eim.getInstanceMap(926100202).shuffleReactors(2518000, 2612004);
eim.spawnNpc(2112000, new java.awt.Point(252, 243), eim.getInstanceMap(926100203));
eim.spawnNpc(2112000, new java.awt.Point(200, 100), eim.getInstanceMap(926100401));
eim.spawnNpc(2112001, new java.awt.Point(200, 100), eim.getInstanceMap(926100500));
eim.spawnNpc(2112018, new java.awt.Point(200, 100), eim.getInstanceMap(926100600));
const Point = Java.type('java.awt.Point');
eim.spawnNpc(2112000, new Point(252, 243), eim.getInstanceMap(926100203));
eim.spawnNpc(2112000, new Point(200, 100), eim.getInstanceMap(926100401));
eim.spawnNpc(2112001, new Point(200, 100), eim.getInstanceMap(926100500));
eim.spawnNpc(2112018, new Point(200, 100), eim.getInstanceMap(926100600));
respawnStages(eim);
eim.startEventTimer(eventTime * 60000);
@@ -245,15 +244,17 @@ function respawnStages(eim) {
var mapobj = eim.getMapInstance(926100401);
var mobcount = mapobj.countMonster(9300150);
var mobobj;
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
if(mobcount == 0) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-278, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-278, -126));
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-542, -126));
} else if(mobcount == 1) {
mobobj = MapleLifeFactory.getMonster(9300150);
mapobj.spawnMonsterOnGroundBelow(mobobj, new Packages.java.awt.Point(-542, -126));
mapobj.spawnMonsterOnGroundBelow(mobobj, new Point(-542, -126));
}
}
@@ -311,14 +312,16 @@ function yuleteAction(eim) {
var mob1 = 9300143, mob2 = 9300144;
mapobj.destroyNPC(2112000);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobobj1, mobobj2;
for(var i = 0; i < 5; i++) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(-455, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(-455, 135));
}
@@ -326,8 +329,8 @@ function yuleteAction(eim) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(0, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(0, 135));
}
@@ -335,8 +338,8 @@ function yuleteAction(eim) {
mobobj1 = MapleLifeFactory.getMonster(mob1);
mobobj2 = MapleLifeFactory.getMonster(mob2);
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Packages.java.awt.Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj1, new Point(360, 135));
mapobj.spawnMonsterOnGroundBelow(mobobj2, new Point(360, 135));
}
}

View File

@@ -33,7 +33,7 @@ var maxMapId = 914020000;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 7];
const maxLobbies = 7;
function init() {}

View File

@@ -36,14 +36,14 @@ var maxMapId = 920011300;
var eventTime = 45; // 45 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -36,14 +36,14 @@ var maxMapId = 220080001;
var eventTime = 45; // 45 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -98,7 +98,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -23,9 +23,6 @@
* @event: Pink Bean Battle
*/
importPackage(Packages.server.life);
importPackage(Packages.client.inventory);
var isPq = true;
var minPlayers = 6, maxPlayers = 30;
var minLevel = 120, maxLevel = 255;
@@ -39,14 +36,14 @@ var maxMapId = 270050300;
var eventTime = 140; // 140 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -104,10 +101,12 @@ function setup(channel) {
eim.getInstanceMap(270050100).resetPQ(level);
eim.getInstanceMap(270050200).resetPQ(level);
eim.getInstanceMap(270050300).resetPQ(level);
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mob = MapleLifeFactory.getMonster(8820000);
mob.disableDrops();
eim.getInstanceMap(270050100).spawnMonsterOnGroundBelow(mob, new java.awt.Point(0, -42));
eim.getInstanceMap(270050100).spawnMonsterOnGroundBelow(mob, new Point(0, -42));
eim.startEventTimer(eventTime * 60000);
setEventRewards(eim);
@@ -234,7 +233,8 @@ function spawnJrBoss(mobObj, gotKilled) {
mobObj.getMap().killMonster(mobObj.getId());
spawnid = mobObj.getId() - 17;
}
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
var mob = MapleLifeFactory.getMonster(spawnid);
mobObj.getMap().spawnMonsterOnGroundBelow(mob, mobObj.getPosition());
}
@@ -254,6 +254,7 @@ function monsterKilled(mob, eim) {
if(stage == 5) {
var iid = 4001193;
const Item = Java.type('client.inventory.Item');
var itemObj = new Item(iid, 0, 1);
var mapObj = eim.getMapFactory().getMap(270050100);
var reactObj = mapObj.getReactorById(2708000);

View File

@@ -38,14 +38,14 @@ var maxMapId = 925100500;
var eventTime = 4; // 4 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -90,7 +90,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -3,8 +3,6 @@
* @author: Ronan
*/
importPackage(Packages.tools);
var isPq = true;
var minPlayers = 1, maxPlayers = 1;
var minLevel = 12, maxLevel = 255;
@@ -17,14 +15,14 @@ var maxMapId = 922240100;
var eventTime = 3; // 3 minutes
var lobbyRange = [0, 19];
const maxLobbies = 20;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -79,7 +77,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {
@@ -102,7 +100,8 @@ function respawnStages(eim) {}
function playerEntry(eim, player) {
var map = eim.getMapInstance(entryMap);
player.changeMap(map, map.getPortal(0));
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
player.announce(MaplePacketCreator.showEffect("event/space/start"));
player.startMapEffect("Please rescue Gaga within the time limit.", 5120027);
}
@@ -199,7 +198,8 @@ function clearPQ(eim) {
}
function spawnGrandpaBunny(eim) {
eim.spawnNpc(9001105, new java.awt.Point(175, -20), eim.getInstanceMap(maxMapId));
const Point = Java.type('java.awt.Point');
eim.spawnNpc(9001105, new Point(175, -20), eim.getInstanceMap(maxMapId));
}
function monsterKilled(mob, eim) {}

View File

@@ -19,8 +19,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
importPackage(Packages.tools);
var entryMap;
var exitMap;
var otherMap;

View File

@@ -19,8 +19,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
importPackage(Packages.tools);
var entryMap;
var exitMap;
var otherMap;

View File

@@ -36,14 +36,14 @@ var maxMapId = 551030200;
var eventTime = 60; // 60 minutes for boss stg
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {

View File

@@ -36,14 +36,14 @@ var maxMapId = 801040101;
var eventTime = 60; // 60 minutes for boss stg
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var KC_Waiting;
var Subway_to_KC;
var KC_docked;
@@ -38,6 +36,8 @@ function stopEntry() {
}
function takeoff() {
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
//sound src: https://www.soundjay.com/transportation/metro-door-close-01.mp3
KC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
NLC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
@@ -52,7 +52,8 @@ function arrived() {
Subway_to_KC.warpEveryone(KC_docked.getId(), 0);
Subway_to_NLC.warpEveryone(NLC_docked.getId(), 0);
scheduleNew();
const MaplePacketCreator = Java.type('tools.MaplePacketCreator');
KC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
NLC_docked.broadcastMessage(MaplePacketCreator.playSound("subway/whistle"));
}

View File

@@ -38,14 +38,14 @@ var tdBossId = 7220005;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -38,14 +38,14 @@ var tdBossId = 8220010;
var eventTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -38,14 +38,14 @@ var tdBossId = 8220011;
var eventTime = 15; // 15 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -38,14 +38,14 @@ var tdBossId = 8220012;
var eventTime = 15; // 15 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -38,14 +38,14 @@ var tdBossId = 8220015;
var eventTime = 20; // 20 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -100,7 +100,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -1,5 +1,3 @@
importPackage(Packages.tools);
var Orbis_btf;
var Train_to_Orbis;
var Orbis_docked;

View File

@@ -37,14 +37,14 @@ var maxMapId = 674030300;
var eventTime = 45; // 45 minutes
var bonusTime = 10; // 10 minutes
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {
setEventRequirements();
}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventRequirements() {
@@ -99,7 +99,7 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
return Java.to(eligible, Java.type('net.server.world.MaplePartyCharacter[]'));
}
function setup(level, lobbyid) {

View File

@@ -44,12 +44,12 @@ var forceHideMsgTime = 10; // unfortunately, EIM weddings don't send wedding ta
var eventBoss = true; // spawns a Cake boss at the hunting ground
var isCathedral = true;
var lobbyRange = [0, 0];
const maxLobbies = 1;
function init() {}
function setLobbyRange() {
return lobbyRange;
function getMaxLobbies() {
return maxLobbies;
}
function setEventExclusives(eim) {
@@ -71,9 +71,11 @@ function setEventRewards(eim) {
function spawnCakeBoss(eim) {
var mapObj = eim.getMapInstance(680000400);
var mobObj = Packages.server.life.MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Packages.java.awt.Point(777, -177));
const MapleLifeFactory = Java.type('server.life.MapleLifeFactory');
const Point = Java.type('java.awt.Point');
var mobObj = MapleLifeFactory.getMonster(9400606);
mapObj.spawnMonsterOnGroundBelow(mobObj, new Point(777, -177));
}
function setup(level, lobbyid) {
@@ -125,10 +127,11 @@ function stopBlessings(eim) {
function sendWeddingAction(eim, type) {
var chr = eim.getLeader();
const Wedding = Java.type('tools.packets.Wedding');
if(chr.getGender() == 0) {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("groomId"), eim.getIntProperty("brideId"), type + 1));
} else {
chr.getMap().broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
chr.getMap().broadcastMessage(Wedding.OnWeddingProgress(type == 2, eim.getIntProperty("brideId"), eim.getIntProperty("groomId"), type + 1));
}
}
@@ -137,12 +140,14 @@ function hidePriestMsg(eim) {
}
function showStartMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 0));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 0));
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}
function showBlessMsg(eim) {
eim.getMapInstance(entryMap + 10).broadcastMessage(Packages.tools.packets.Wedding.OnWeddingProgress(false, 0, 0, 1));
const Wedding = Java.type('tools.packets.Wedding');
eim.getMapInstance(entryMap + 10).broadcastMessage(Wedding.OnWeddingProgress(false, 0, 0, 1));
eim.setIntProperty("guestBlessings", 1);
eim.schedule("hidePriestMsg", forceHideMsgTime * 1000);
}

Some files were not shown because too many files have changed in this diff Show More