Reformat and clean up event scripts
This commit is contained in:
@@ -17,10 +17,10 @@ var invasionDelay = 5 * 1000; //The time that spawn balrog
|
||||
function init() {
|
||||
closeTime = em.getTransportationTime(closeTime);
|
||||
beginTime = em.getTransportationTime(beginTime);
|
||||
rideTime = em.getTransportationTime(rideTime);
|
||||
rideTime = em.getTransportationTime(rideTime);
|
||||
invasionStartTime = em.getTransportationTime(invasionStartTime);
|
||||
invasionDelayTime = em.getTransportationTime(invasionDelayTime);
|
||||
|
||||
|
||||
Orbis_btf = em.getChannelServer().getMapFactory().getMap(200000112);
|
||||
Ellinia_btf = em.getChannelServer().getMapFactory().getMap(101000301);
|
||||
Boat_to_Orbis = em.getChannelServer().getMapFactory().getMap(200090010);
|
||||
@@ -30,16 +30,16 @@ function init() {
|
||||
Ellinia_docked = em.getChannelServer().getMapFactory().getMap(101000300);
|
||||
Orbis_Station = em.getChannelServer().getMapFactory().getMap(200000100);
|
||||
Orbis_docked = em.getChannelServer().getMapFactory().getMap(200000111);
|
||||
|
||||
|
||||
Ellinia_docked.setDocked(true);
|
||||
Orbis_docked.setDocked(true);
|
||||
|
||||
|
||||
scheduleNew();
|
||||
}
|
||||
|
||||
function scheduleNew() {
|
||||
em.setProperty("docked", "true");
|
||||
|
||||
|
||||
em.setProperty("entry", "true");
|
||||
em.setProperty("haveBalrog", "false");
|
||||
em.schedule("stopentry", closeTime);
|
||||
@@ -47,7 +47,7 @@ function scheduleNew() {
|
||||
}
|
||||
|
||||
function stopentry() {
|
||||
em.setProperty("entry","false");
|
||||
em.setProperty("entry", "false");
|
||||
Orbis_Boat_Cabin.clearMapObjects(); //boxes
|
||||
Ellinia_Boat_Cabin.clearMapObjects();
|
||||
}
|
||||
@@ -57,9 +57,9 @@ function takeoff() {
|
||||
Ellinia_btf.warpEveryone(Boat_to_Orbis.getId());
|
||||
Ellinia_docked.broadcastShip(false);
|
||||
Orbis_docked.broadcastShip(false);
|
||||
|
||||
em.setProperty("docked","false");
|
||||
|
||||
|
||||
em.setProperty("docked", "false");
|
||||
|
||||
if (Math.random() < 0.42) {
|
||||
em.schedule("approach", (invasionStartTime + Math.trunc((Math.random() * invasionDelayTime))));
|
||||
}
|
||||
@@ -83,13 +83,13 @@ function arrived() {
|
||||
|
||||
function approach() {
|
||||
if (Math.floor(Math.random() * 10) < 10) {
|
||||
em.setProperty("haveBalrog","true");
|
||||
em.setProperty("haveBalrog", "true");
|
||||
Boat_to_Orbis.broadcastEnemyShip(true);
|
||||
Boat_to_Ellinia.broadcastEnemyShip(true);
|
||||
const PacketCreator = Java.type('tools.PacketCreator');
|
||||
Boat_to_Orbis.broadcastMessage(PacketCreator.musicChange("Bgm04/ArabPirate"));
|
||||
Boat_to_Ellinia.broadcastMessage(PacketCreator.musicChange("Bgm04/ArabPirate"));
|
||||
|
||||
|
||||
em.schedule("invasion", invasionDelay);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user