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

@@ -20,13 +20,20 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* @Author TheRamon
* @Author TheRamon, Ronan
*
* Sharen III's Soul, Sharenian: Sharen III's Grave (990000700)
*
* Guild Quest - end of stage 4
*/
function clearStage(stage, eim) {
eim.setProperty("stage" + stage + "clear", "true");
eim.showClearEffect(true);
eim.giveEventPlayersStageReward(stage);
}
var status = 0;
function start() {
status = -1;
@@ -41,39 +48,30 @@ function action(mode, type, selection) {
status++;
else
cm.dispose();
var eim = cm.getPlayer().getEventInstance();
if (eim.getProperty("stage4clear") != null && eim.getProperty("stage4clear").equals("true")) {
cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now.");
cm.dispose();
return;
}
if (status == 0) {
if (cm.getPlayer().getEventInstance().getProperty("leader").equals(cm.getPlayer().getName())) {
if (cm.getPlayer().getEventInstance().getProperty("stage4clear") != null && cm.getPlayer().getEventInstance().getProperty("stage4clear").equals("true"))
{
cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now.");
cm.dispose();
}
else {
var prev = cm.getPlayer().getEventInstance().setProperty("stage4clear","true",true);
if (prev == null) {
cm.sendNext("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. This old man will now pave the way for you to finish the quest." + mode);
}
else {//if not null, was set before, and Gp already gained
cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now.");
cm.dispose();
}
}
if (cm.isEventLeader()) {
cm.sendNext("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. This old man will now pave the way for you to finish the quest.");
clearStage(4, eim);
cm.getGuild().gainGP(30);
cm.getPlayer().getMap().getReactorByName("ghostgate").forceHitReactor(1);
cm.dispose();
}
else
{
if (cm.getPlayer().getEventInstance().getProperty("stage4clear") != null && cm.getPlayer().getEventInstance().getProperty("stage4clear").equals("true"))
cm.sendOk("After what I thought would be an immortal sleep, I have finally found someone that will save Sharenian. I can truly rest in peace now.");
else
cm.sendOk("I need the leader of your party to speak with me, nobody else.");
cm.sendOk("I need the leader of your party to speak with me, nobody else.");
cm.dispose();
}
}
else if (status == 1) {
cm.getGuild().gainGP(30);
cm.getPlayer().getMap().getReactorByName("ghostgate").hitReactor(cm.getClient());
cm.showEffect("quest/party/clear");
cm.playSound("Party1/Clear");
cm.dispose();
}
}
}