GuildPQ Queue system + revamped Warp mechanic

Added a queue system for waiting guilds outside the GPQ area. Changed
the way players are transported through maps on non-portal passing
cases: if not defined, a spawn point is chosen randomly for each player.
This commit is contained in:
ronancpl
2017-06-13 20:47:58 -03:00
parent 7a8bba98ca
commit 81f9226286
82 changed files with 669 additions and 375 deletions

View File

@@ -19,24 +19,23 @@
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/>.
*/
/* @Author Lerk
/* @Author Lerk, Ronan
*
* Guild Quest Waiting Room - Entry Portal (map 990000000)
*/
function enter(pi) {
if (pi.getPlayer().getEventInstance() == null) {
pi.warp(101030104);
return true;
}
else {
if (pi.getPlayer().getEventInstance().getProperty("canEnter").equals("false")) {
var entryTime = pi.getPlayer().getEventInstance().getProperty("entryTimestamp");
var timeNow = Date.now();
var timeLeft = Math.ceil((entryTime - timeNow) / 1000);
if(timeLeft <= 0) {
pi.warp(990000100);
return true;
}
else { //cannot proceed while allies can still enter
pi.playerMessage(5, "The portal is not open yet.");
pi.playerMessage(5, "The portal will open in about " + timeLeft + " seconds.");
return false;
}
}
}

View File

@@ -20,8 +20,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function enter(pi) {
if (pi.getPlayer().getEventInstance() != null) {
pi.getPlayer().getEventInstance().removePlayer(pi.getPlayer());
}
pi.warp(101030104);
return true;
}

View File

@@ -1,5 +1,5 @@
function enter(pi) {
if (pi.getPlayer().getParty() != null && pi.isLeader() && pi.haveItem(4001055,1)) {
if (pi.getPlayer().getParty() != null && pi.isEventLeader() && pi.haveItem(4001055,1)) {
pi.getEventInstance().warpEventTeam(920010100);
return true;
} else {

View File

@@ -1,6 +1,6 @@
function enter(pi) {
if ((pi.getMap().getMonsters().size() == 0 || pi.getMap().getMonsterById(9300183) != null) && (pi.getMap().getReactorByName("") == null || pi.getMap().getReactorByName("").getState() == 1)) {
if(pi.isLeader()) {
if(pi.isEventLeader()) {
pi.getEventInstance().clearPQ();
return true;
}

View File

@@ -27,7 +27,7 @@ BossRushPQ - Rest Spot portal
function enter(pi) {
var evLevel = ((pi.getMapId() - 1) % 5) + 1;
if(pi.getPlayer().getEventInstance().isLeader(pi.getPlayer()) && pi.getPlayer().getEventInstance().getPlayerCount() > 1) {
if(pi.getPlayer().getEventInstance().isEventLeader(pi.getPlayer()) && pi.getPlayer().getEventInstance().getPlayerCount() > 1) {
pi.message("Being the party leader, you cannot leave before your teammates leave first or you pass leadership.");
return false;
}