Boss Rush PQ Rewarding System + minor patches

Introducing BRPQ rewarding system (KPQ/LPQ clear-like) and patched
issues regarding "no apparent party leader" after party leader
disconnects and reconnects.
This commit is contained in:
ronancpl
2017-04-29 12:05:26 -03:00
parent 7942dde1a1
commit 1d8caff63f
35 changed files with 644 additions and 391 deletions

View File

@@ -11,6 +11,40 @@ function init() {
em.setProperty("leader", "true");
}
function setEventRewards(eim) {
var itemSet, itemQty, evLevel;
evLevel = 6; //Rewards at event completion
itemSet = [1122018, 1122005, 1022088, 1402013, 1032048, 1032070, 1102046, 2330004, 2041013, 2041016, 2041019, 2041022, 2049100, 2049003, 2020012, 2020013, 2020014, 2020015, 2022029, 2022045, 2022068, 2022069, 2022179, 2022180, 4004000, 4004001, 4004002, 4004003, 4004004, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, 25, 25, 25, 25, 4, 12, 12, 12, 12, 12, 25];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 5; //Rewards at Rest Spot V
itemSet = [1122018, 1122005, 1022088, 1402013, 1032048, 1032070, 1102046, 2330004, 2041013, 2041016, 2041019, 2041022, 2049100, 2049003, 2020012, 2020013, 2020014, 2020015, 2022029, 2022045, 2022068, 2022069, 2022179, 2022180, 4004000, 4004001, 4004002, 4004003, 4004004, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 2, 8, 8, 8, 8, 8, 12];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 4; //Rewards at Rest Spot IV
itemSet = [1122001, 1122006, 1022103, 1442065, 1032042, 1032021, 1102168, 2070005, 2040025, 2040029, 2040301, 2040413, 2040701, 2040817, 2002028, 2020009, 2020010, 2020011, 2022004, 2022005, 2022025, 2022027, 2022048, 2022049, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 3; //Rewards at Rest Spot III
itemSet = [1122002, 1022088, 1012076, 1402029, 1032041, 1032044, 1102167, 2070011, 2040026, 2040030, 2040302, 2040412, 2040702, 2040818, 2002028, 2020009, 2020010, 2020011, 2022004, 2022005, 2022025, 2022027, 2022048, 2022049, 4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 2; //Rewards at Rest Spot II
itemSet = [1122003, 1012077, 1012079, 1432014, 1032059, 1032002, 1102191, 2330002, 2040001, 2040311, 2040401, 2040601, 2040824, 2040901, 2010000, 2010001, 2010002, 2010003, 2010004, 2020001, 2020002, 2020003, 2022020, 2022022, 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3];
eim.setEventRewards(evLevel, itemSet, itemQty);
evLevel = 1; //Rewards at Rest Spot I
itemSet = [1122004, 1012078, 1432008, 1432009, 1032040, 1032009, 1102166, 2070001, 2040002, 2040310, 2040400, 2040600, 2040825, 2040902, 2010000, 2010001, 2010002, 2010003, 2010004, 2020001, 2020002, 2020003, 2022020, 2022022, 4003000];
itemQty = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 2, 2, 2, 2, 2, 2, 2, 2, 2];
eim.setEventRewards(evLevel, itemSet, itemQty);
}
function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event
var eligible = [];
var hasLeader = false;
@@ -28,6 +62,10 @@ function getEligibleParty(party) { //selects, from the given party, the tea
}
}
if(!hasLeader) print("no leader");
else if(eligible.length < minPlayers) print("no min");
else if(eligible.length < minPlayers) print("no max");
if(!(hasLeader && eligible.length >= minPlayers && eligible.length <= maxPlayers)) eligible = [];
return eligible;
}
@@ -39,6 +77,7 @@ function setup(level, leaderid) {
em.setProperty("level", level);
eim.startEventTimer(45 * 60000); //45 mins
setEventRewards(eim);
return eim;
}
@@ -51,26 +90,21 @@ function scheduledTimeout(eim) {
end(eim);
}
function removePlayer(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function playerExit(eim, player) {
eim.unregisterPlayer(player);
player.changeMap(exitMap, 0);
}
function changedMap(eim, player, mapid) {
if (mapid < 970030001 || mapid > 970042711) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
if (mapid < 970030001 || mapid > 970042711) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) {
eim.unregisterPlayer(player);
end(eim);
}
else
eim.unregisterPlayer(player);
}
}
function playerDead(eim, player) {}
@@ -88,12 +122,10 @@ function playerRevive(eim, player) { // player presses ok on the death pop up.
function playerDisconnected(eim, player) {
var party = eim.getPlayers();
if (eim.isLeader(player) || party.size() <= minPlayers) {
eim.unregisterPlayer(player);
if (eim.isLeader(player) || party.size() <= minPlayers)
end(eim);
}
else
removePlayer(eim, player);
playerExit(eim, player);
}
function leftParty(eim, player) {
@@ -122,9 +154,6 @@ function end(eim) {
function playerClear(eim, player, toMap) {
eim.unregisterPlayer(player);
if(toMap != null) player.changeMap(toMap);
else player.changeMap(clearMap, 0);
}
function complete(eim, toMap) {
@@ -139,6 +168,10 @@ function clearPQ(eim, toMap) {
complete(eim, toMap);
}
function giveRandomEventReward(eim, player) {
eim.giveEventReward(player);
}
function monsterKilled(mob, eim) {}
function allMonstersDead(eim) {}

View File

@@ -0,0 +1,26 @@
/*
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 as
published by the Free Software Foundation 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/>.
*/
function start() {
cm.sendOk("Should you have a locked box you want to open, bring it to me.");
cm.dispose();
}

View File

@@ -12,9 +12,17 @@ var minPartySize = 1;
var maxPartySize = 6;
var state;
function onRestingSpot() {
return cm.getMapId() >= 970030001 && cm.getMapId() <= 970030010;
}
function isFinalBossDone() {
return cm.getMapId() >= 970032700 && cm.getMapId() < 970032800 && cm.getMap().getMonsters().isEmpty();
}
function start() {
status = -1;
state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? 1 : 0;
state = (cm.getMapId() >= 970030001 && cm.getMapId() <= 970042711) ? (!onRestingSpot() ? (isFinalBossDone() ? 3 : 1) : 2) : 0;
action(1, 0, 0);
}
@@ -32,14 +40,62 @@ function action(mode, type, selection) {
status--;
if (status == 0) {
if(state) {
if(state == 3) {
if(cm.getPlayer().getEventInstance() != null) {
if(!cm.isLeader()) {
cm.sendOk("Your party leader has not spoken to me yet, please wait him/her talk to me.");
cm.dispose();
return;
}
else {
cm.getPlayer().getEventInstance().finishPQ();
}
}
if(cm.isLeader()) {
cm.sendOk("Your party completed such an astounding feat coming this far, #byou have defeated all the bosses#k, congratulations! Now, tell your party I will be warping everyone out and rewarding them as they talk to me.");
}
else {
cm.sendOk("For completing all stages in this event, congratulations! Now you will receive a prize that matches your performance here as I warp you out.");
}
}
else if(state == 2) {
if(cm.isLeader()) {
if(cm.getPlayer().getEventInstance().isEventTeamTogether()) {
cm.sendYesNo("Is your party ready to proceed to the next stages? Walk through the portal if you think you're done, the time is now.. Now, do you guys REALLY want to proceed?");
}
else {
cm.sendOk("Please wait for your party to reassemble before proceeding.");
cm.dispose();
return;
}
}
else {
cm.sendOk("Wait for your party leader to give me the signal to proceed. If you're not feeling too well and want to quit, walk through the portal and you will be transported out, you will receive a prize for coming this far.");
cm.dispose();
return;
}
} else if(state == 1) {
cm.sendYesNo("Do you wish to abandon this event?");
}
else {
cm.sendSimple("#b<Party Quest: Boss Rush>#k\r\n\r\nWould you like to collaborate with party members to complete the expedition, or are you brave enough to take it on all by yourself? Have your #bparty leader#k talk to me or make yourself a party.#b\r\n#L0#I want to participate in the party quest.\r\n#L1#I want to find party members.\r\n#L2#I would like to hear more details.");
}
} else if (status == 1) {
if(state) {
if(state == 3) {
if(!cm.getPlayer().getEventInstance().giveEventReward(cm.getPlayer(), 6)) {
cm.sendOk("Please arrange a slot in all tabs of your inventory beforehand.");
cm.dispose();
return;
}
cm.warp(970030000);
cm.dispose();
} else if(state == 2) {
var restSpot = ((cm.getMapId() - 1) % 5) + 1;
cm.getPlayer().getEventInstance().warpEventTeam(970030100 + (500 * restSpot)); //oh well, other maps won't be used anyway
cm.dispose();
} else if(state == 1) {
cm.warp(970030000);
cm.dispose();
}

View File

@@ -0,0 +1,38 @@
/*
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/>.
*/
/*
BossRushPQ - Rest Spot portal
@author Ronan
*/
function enter(pi) {
var evLevel = ((pi.getMapId() - 1) % 5) + 1;
if(pi.getPlayer().getEventInstance().giveEventReward(pi.getPlayer(), evLevel)) {
pi.warp(970030000);
return true;
}
else {
pi.message("You cannot receive an event prize without having an empty room in your EQUIP, USE, SET-UP or ETC inventory.");
return false;
}
}

View File

@@ -25,11 +25,11 @@ BossRushPQ - Next Stage
*/
function enter(pi) {
if(pi.getMap().getMonsters().size() == 0) {
if(pi.getMap().getMonsters().isEmpty()) {
var nextStage;
if(pi.getMapId() % 5 == 0) nextStage = pi.getMapId() + 100;
else nextStage = 970030001 + (pi.getMapId() - 970030100 / 500);
if(pi.getMapId() % 500 != 0) nextStage = pi.getMapId() + 100;
else nextStage = 970030001 + ((pi.getMapId() - 970030100) / 500);
pi.warp(nextStage);
return true;