New PQ: Boss Rush PQ + Ellin/PiratePQ bug fixes

Introducing Boss Rush PQ. Corrected a few issues regarding rewardings in
PiratePQ and EllinPQ and implemented a standardized way to script PQs.
This commit is contained in:
ronancpl
2017-04-25 11:55:44 -03:00
parent 828a8a02a2
commit 939b214fb5
66 changed files with 16104 additions and 44622 deletions

View File

@@ -1,99 +1,74 @@
/*
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/>.
/**
* @author: Ronan
* @npc: Guon
* @map: 251010404 - Over the Pirate Ship
* @func: Pirate PQ
*/
var status = 0;
var minLevel = 55;
var maxLevel = 100;
var minPlayers = 2;
var maxPlayers = 6;
var minLevel = 1;
var maxLevel = 200;
var minPartySize = 1;
var maxPartySize = 6;
function start() {
status = -1;
action(1, 0, 0);
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
if (cm.getParty() == null) {
cm.sendOk("Please come back to me after you've formed a party.");
if (mode == -1) {
cm.dispose();
return;
}
if (!cm.isLeader()) {
cm.sendSimple("You are not the party leader.");
cm.dispose();
} else {
var party = cm.getParty().getMembers();
var mapId = cm.getPlayer().getMapId();
var next = true;
var levelValid = 0;
var inMap = 0;
if (party.size() < minPlayers || party.size() > maxPlayers)
next = false;
else {
for (var i = 0; i < party.size() && next; i++) {
if ((party.get(i).getLevel() >= minLevel) && (party.get(i).getLevel() <= maxLevel)) {
levelValid += 1;
if (party.get(i).getMapId() == mapId)
inMap += 1;
}
}
if (levelValid < minPlayers || inMap < minPlayers)
next = false;
}
if (next) {
var em = cm.getEventManager("PiratePQ");
if (em == null) {
cm.sendOk("PiratePQ does not work.");
} else {
if (mode == 0 && status == 0) {
cm.dispose();
}
else {
em.startInstance(cm.getParty(),cm.getPlayer().getMap(), 1);
party = cm.getParty().getMembers();
}
cm.dispose();
return;
}
else {
cm.sendOk("Your party is not a party of 2 to 6 members between level " + minLevel + " and " + maxLevel + ". Make sure all your members are present and qualified to participate in this quest.");
cm.dispose();
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendSimple("#b<Party Quest: Pirate PQ>#k\r\n\r\nHelp! My son has been kidnapped and is bound on the hands of the fearful #rLord Pirate#k. I need your help... Would you please assemble or join a team to save him? 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 (selection == 0) {
if (cm.getParty() == null) {
cm.sendOk("You can participate in the party quest only if you are in a party.");
cm.dispose();
} else if(!cm.isLeader()) {
cm.sendOk("Your party leader must talk to me to start this party quest.");
cm.dispose();
} else {
var em = cm.getEventManager("PiratePQ");
if(em == null) {
cm.sendOk("The Pirate PQ has encountered an error.");
cm.dispose();
}
var eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
var prop = em.getProperty("state");
if (prop != null && prop.equals("0")) {
em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1);
cm.dispose();
} else {
cm.sendOk("Another party has already entered the #rParty Quest#k in this channel. Please try another channel, or wait for the current party to finish.");
cm.dispose();
}
}
else {
cm.sendOk("You cannot start this party quest yet, because either your party is not in the range size, some of your party members are not eligible to attempt it or they are not in this map. If you're having trouble finding party members, try Party Search.");
cm.dispose();
}
}
} else if (selection == 1) {
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
cm.dispose();
} else {
cm.sendOk("#b<Party Quest: Pirate PQ>#k\r\nIn this PQ, your mission is to progressively make your way through the ship, taking on all pirates and baddies in your path. Reaching the #rLord Pirate#k, depending on how many great chests you opened on the stages before, the boss will reveal himself even more powerful, so stay alert. Said chests, if opened, gives many extra rewards to your crew, it's worth a shot! Good luck.");
cm.dispose();
}
}
}
}
else {
cm.sendOk("PiratePQ does not exist.");
cm.dispose();
}
}
}
}