Files
sweetgum-server/scripts/portal/TD_Boss_enter.js
ronancpl 85a81b9bf9 Neo City + Revamped EllinPQ + New Release
Fixed Neo City area, now playable.
Overhauled the EllinPQ mechanics, such as the "CLEAR" effect when passing maps, and some bug fixes along the way.
Refactored a lot of out-of-place classes and properly renamed a few others through the project.
Updated readme and licenses through the source, preparing the stage for the new release.
2017-11-29 00:57:50 -02:00

33 lines
1.3 KiB
JavaScript

/* @author RonanLana */
function enter(pi) {
var stage = ((Math.floor(pi.getMapId() / 100)) % 10) - 1;
var em = pi.getEventManager("TD_Battle" + stage);
if(em == null) {
pi.playerMessage(5, "TD Battle " + stage + " encountered an unexpected error and is currently unavailable.");
return false;
}
if (pi.getParty() == null) {
pi.playerMessage(5, "You are currently not in a party, create one to attempt the boss.");
return false;
} else if(!pi.isLeader()) {
pi.playerMessage(5, "Your party leader must enter the portal to start the battle.");
return false;
} else {
var eli = em.getEligibleParty(pi.getParty());
if(eli.size() > 0) {
if(!em.startInstance(pi.getParty(), pi.getPlayer().getMap(), 1)) {
pi.playerMessage(5, "The battle against the boss has already begun, so you may not enter this place.");
return false;
}
}
else {
pi.playerMessage(5, "Your party must consist of at least 2 players to attempt the boss.");
return false;
}
return true;
}
}