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:
@@ -25,6 +25,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function padWithZeroes(n, width) {
|
||||
while(n.length < width) n = '0' + n;
|
||||
return n;
|
||||
}
|
||||
|
||||
function act() {
|
||||
var eim = rm.getPlayer().getEventInstance();
|
||||
if (eim != null) {
|
||||
@@ -32,19 +37,25 @@ function act() {
|
||||
if (status != null && !status.equals("waiting")) {
|
||||
var stage = parseInt(eim.getProperty("stage1phase"));
|
||||
if (status.equals("display")) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
prevCombo += rm.getReactor().getObjectId();
|
||||
rm.mapMessage(6,"Current Combo: " + prevCombo);
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
if(!rm.getReactor().isRecentHitFromAttack()) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevCombo += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
}
|
||||
}
|
||||
} else { //active
|
||||
var prevGuess = eim.getProperty("stage1guess");
|
||||
var prevGuess = "" + eim.getProperty("stage1guess");
|
||||
if (prevGuess.length != (3 * (stage + 3))) {
|
||||
prevGuess += rm.getReactor().getObjectId();
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevGuess += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1guess",prevGuess);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,16 @@
|
||||
*/
|
||||
/* @Author Lerk
|
||||
*
|
||||
* 9208000.js: Guild Quest - Gatekeeper Puzzle Reactor
|
||||
* 9208001.js: Guild Quest - Gatekeeper Puzzle Reactor
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
function padWithZeroes(n, width) {
|
||||
while(n.length < width) n = '0' + n;
|
||||
return n;
|
||||
}
|
||||
|
||||
function act() {
|
||||
var eim = rm.getPlayer().getEventInstance();
|
||||
if (eim != null) {
|
||||
@@ -33,18 +39,25 @@ function act() {
|
||||
var stage = parseInt(eim.getProperty("stage1phase"));
|
||||
//rm.mapMessage(6,"Stage " + stage);
|
||||
if (status.equals("display")) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
prevCombo += rm.getReactor().getObjectId();
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
if(!rm.getReactor().isRecentHitFromAttack()) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevCombo += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
}
|
||||
}
|
||||
} else { //active
|
||||
var prevGuess = eim.getProperty("stage1guess");
|
||||
var prevGuess = "" + eim.getProperty("stage1guess");
|
||||
if (prevGuess.length != (3 * (stage + 3))) {
|
||||
prevGuess += rm.getReactor().getObjectId();
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevGuess += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1guess",prevGuess);
|
||||
}
|
||||
//rm.mapMessage(6,"Current Guess: " + prevGuess);
|
||||
|
||||
@@ -21,10 +21,15 @@
|
||||
|
||||
/* @Author Lerk
|
||||
*
|
||||
* 9208000.js: Guild Quest - Gatekeeper Puzzle Reactor
|
||||
* 9208002.js: Guild Quest - Gatekeeper Puzzle Reactor
|
||||
*
|
||||
*/
|
||||
|
||||
function padWithZeroes(n, width) {
|
||||
while(n.length < width) n = '0' + n;
|
||||
return n;
|
||||
}
|
||||
|
||||
function act() {
|
||||
var eim = rm.getPlayer().getEventInstance();
|
||||
if (eim != null) {
|
||||
@@ -32,18 +37,24 @@ function act() {
|
||||
if (status != null && !status.equals("waiting")) {
|
||||
var stage = parseInt(eim.getProperty("stage1phase"));
|
||||
if (status.equals("display")) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
prevCombo += rm.getReactor().getObjectId();
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
if(!rm.getReactor().isRecentHitFromAttack()) {
|
||||
var prevCombo = eim.getProperty("stage1combo");
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevCombo += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1combo",prevCombo);
|
||||
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
|
||||
eim.setProperty("stage1status","active");
|
||||
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
|
||||
eim.setProperty("stage1guess","");
|
||||
}
|
||||
}
|
||||
} else { //active
|
||||
var prevGuess = eim.getProperty("stage1guess");
|
||||
if (prevGuess.length != (3 * stage + 9)) {
|
||||
prevGuess += rm.getReactor().getObjectId();
|
||||
var prevGuess = "" + eim.getProperty("stage1guess");
|
||||
if (prevGuess.length != (3 * (stage + 3))) {
|
||||
var n = "" + rm.getReactor().getObjectId();
|
||||
prevGuess += padWithZeroes(n, 3);
|
||||
|
||||
eim.setProperty("stage1guess",prevGuess);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,9 +22,21 @@
|
||||
/*
|
||||
Stage 2: Spear destinations - Guild Quest
|
||||
|
||||
@Author Lerk
|
||||
@Author Lerk, Ronan
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getPlayer().getEventInstance().getMapInstance(990000400).getReactorByName("speargate").hitReactor(rm.getPlayer().getClient());
|
||||
var react = rm.getPlayer().getEventInstance().getMapInstance(990000400).getReactorByName("speargate");
|
||||
react.forceHitReactor(react.getState() + 1);
|
||||
|
||||
if(react.getState() == 4) {
|
||||
var eim = rm.getPlayer().getEventInstance();
|
||||
|
||||
var maps = [990000400, 990000410, 990000420, 990000430, 990000431, 990000440];
|
||||
for(var i = 0; i < maps.length; i++) {
|
||||
eim.showClearEffect(false, maps[i]);
|
||||
}
|
||||
|
||||
rm.getGuild().gainGP(20);
|
||||
}
|
||||
}
|
||||
28
scripts/reactor/9208009.js
Normal file
28
scripts/reactor/9208009.js
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This file is part of the OdinMS Maple Story Server
|
||||
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
|
||||
Matthias Butz <matze@odinms.de>
|
||||
Jan Christian Meyer <vimes@odinms.de>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License version 3
|
||||
as published by the Free Software Foundation. You may not use, modify
|
||||
or distribute this program under any other version of the
|
||||
GNU Affero General Public License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
// Opened GPQ boss room, players may now revive and stay on the GPQ
|
||||
|
||||
function act() {
|
||||
if(rm.getEventInstance() != null) {
|
||||
rm.getEventInstance().setProperty("canRevive", "1");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user