Guild PQ + fixed negative EXP error

Implemented Guild PQ. Fixed a problem introduced earlier where negative
EXP would be deemed as "integer overflow", provoking many game breaking
issues as result.
This commit is contained in:
ronancpl
2017-06-18 03:19:53 -03:00
parent 81f9226286
commit 42fe74955d
135 changed files with 822 additions and 564 deletions

View File

@@ -22,26 +22,32 @@
function start() {
var eim = cm.getPlayer().getEventInstance();
if (eim != null) {
if (eim.getProperty("leader").equals(cm.getPlayer().getName())) {
if (cm.isEventLeader()) {
if (cm.haveItem(4001024)) {
cm.removeAll(4001024);
var prev = eim.setProperty("bossclear","true",true);
var prev = eim.setProperty("bossclear", "true");
if (prev == null) {
var start = parseInt(eim.getProperty("entryTimestamp"));
var diff = Packages.java.lang.System.currentTimeMillis() - start;
var diff = Date.now() - start;
var points = 1000 - Math.floor(diff / (100 * 60));
if(points < 100)
points = 100;
if(points < 100) points = 100;
cm.getGuild().gainGP(points);
}
eim.clearPQ();
}
else {
cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and return it to me. That is all.");
}
}
else {
cm.sendOk("This is your final challenge. Defeat the evil lurking within the Rubian and let your event leader return it to me. That is all.");
}
}
else
cm.warp(990001100);
cm.dispose();
}