Ludibrium PQ + MapleIdRetriever

Implemented LPQ. New application tool that realizes fetches by names and
returns respective ids, over all items depicted in the GM handbook.
This commit is contained in:
ronancpl
2017-05-13 15:24:02 -03:00
parent ed6121dd5f
commit b26469301d
94 changed files with 36729 additions and 1186 deletions

View File

@@ -1,17 +1,12 @@
/**
* @author: Eric
* @author: Eric, Ronan
* @npc: Red Sign
* @map: 101st Floor Eos Tower (221024500)
* @func: Ludi PQ
*/
var status = 0;
var minLevel = 35; // according to Nexon it's 30, but it's actually a 50 requirement.
var maxLevel = 200;
var minPartySize = 5;
var maxPartySize = 6;
var brokenGlassesCount = 0; // code custom quest data is on the todo list
var em = null;
function start() {
status = -1;
@@ -19,92 +14,60 @@ function start() {
}
function action(mode, type, selection) {
if (mode == 1) {
status++;
} else if (mode == 0) {
if (status == 1) {
cm.sendNext((cm.getParty() == null ? "Remember that using the Party Search function (Hotkey O) will allow you to find a party anytime, anywhere." : "Send an invite to friends nearby. Remember that using the Party Search function (Hotkey O) will allow you to find a party anytime, anywhere."));
cm.dispose();
return;
} else {
status--;
}
}
if (status == 0) {
cm.sendSimple("#e<Party Quest: Dimensional Schism>#n\r\n\r\nYou can't go any higher because of the extremely dangerous creatures above. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#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 want to receive the Broken Glasses.\r\n#L3#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();
return;
} else if (!cm.getPlayer().isGM() && (cm.getParty().getMembers().size() < minPartySize || !cm.isLeader())) {
cm.sendOk("You cannot participate in the quest, because you do not have at least 3 party members.");
cm.dispose();
return;
} else {
// Check if all party members are within PQ levels
var party = cm.getParty().getMembers();
var mapId = cm.getMapId();
var next = true;
var levelValid = 0;
var inMap = 0;
var it = party.iterator();
while (it.hasNext()) {
var cPlayer = it.next();
if ((cPlayer.getLevel() >= minLevel) && (cPlayer.getLevel() <= maxLevel)) {
levelValid += 1;
} else {
next = false;
}
if (cPlayer.getMapId() == mapId) {
inMap += (cPlayer.getJobId() == 910 ? 6 : 1);
}
}
if (party.size() > maxPartySize || inMap < minPartySize) {
next = false;
}
if(cm.getPlayer().isGM())
next = true;
if (next) {
var em = cm.getEventManager("LudiPQ");
if (em == null) {
cm.sendOk("The Ludibrium PQ has encountered an error. Please report this on the forums, and with a screenshot.");
} else {
var prop = em.getProperty("LPQOpen");
if (prop == null || prop.equals("true")) {
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap())) {
cm.sendOk("A party in your name is already registered in this event.");
cm.dispose();
return;
}
cm.removeAll(4001022);
cm.removeAll(4001023);
cm.dispose();
return;
} 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.");
}
}
} else {
cm.sendYesNo("You cannot participate in the quest, because you do not have at least 3 party members. If you're having trouble finding party members, try Party Search.");
}
}
} else if (selection == 1) {
cm.sendOk("Try using a Super Megaphone or asking your buddies or guild to join!");
cm.dispose();
} else if (selection == 2) { // todo
cm.sendNext("I am offering 1 #i1022073:# #bBroken Glasses#k for every 20 times you help me. If you help me #b" + brokenGlassesCount + " more times, you can receive Broken Glasses.#k");
cm.dispose();
} else {
cm.sendOk("#e<Party Quest: Dimensional Schism>#n\r\nA Dimensional Schism has appeared in #b#m220000000#!#k We desperately need brave adventurers who can defeat the intruding monsters. Please, party with some dependable allies to save #m220000000#! You must pass through various stages by defeating monsters and solving quizzes, and ultimately defeat #r#o9300012##k.\r\n - #eLevel#n: 30 or above #r(Recommended Level: 60 ~ 69)#k\r\n - #eTime Limit#n: 20 min\r\n - #eNumber of Players#n: 3 to 6\r\n - #eReward#n: #i1022073:# Broken Glasses #b(obtained every 20 time(s) you participate)#k\r\n Various Use, Etc, and Equip items");
cm.dispose();
}
} else if (status == 2) {
if (mode > 0) {
//cm.findParty();
}
cm.dispose();
}
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && status == 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0) {
em = cm.getEventManager("LudiPQ");
if(em == null) {
cm.sendOk("The Ludibrium PQ has encountered an error.");
cm.dispose();
return;
}
cm.sendSimple("#e#b<Party Quest: Dimensional Schism>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nYou can't go any higher because of the extremely dangerous creatures above. Would you like to collaborate with party members to complete the quest? If so, please have your #bparty leader#k talk to me.#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 eli = em.getEligibleParty(cm.getParty());
if(eli.size() > 0) {
if(!em.startInstance(0, cm.getParty(), cm.getPlayer().getMap(), 1)) {
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.");
}
/*
else {
cm.gainItem(4001022, 200);
}
*/
}
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("#e#b<Party Quest: Dimensional Schism>#k#n\r\nA Dimensional Schism has appeared in #b#m220000000#!#k We desperately need brave adventurers who can defeat the intruding monsters. Please, party with some dependable allies to save #m220000000#! You must pass through various stages by defeating monsters and solving quizzes, and ultimately defeat #r#o9300012##k.");
cm.dispose();
}
}
}
}