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:
@@ -20,7 +20,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
@ Author : Raz
|
||||
@ Author : Raz, Ronan
|
||||
@
|
||||
@ NPC = Lime Balloon
|
||||
@ Map = Hidden-Street <Stage 4>
|
||||
@@ -29,86 +29,64 @@
|
||||
@
|
||||
*/
|
||||
|
||||
importPackage(Packages.tools);
|
||||
|
||||
var status = 0;
|
||||
var party;
|
||||
var preamble;
|
||||
var gaveItems;
|
||||
var curMap, stage;
|
||||
|
||||
function start() {
|
||||
curMap = cm.getMapId();
|
||||
stage = Math.floor((curMap - 922010100) / 100) + 1;
|
||||
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function clearStage(stage, eim, curMap) {
|
||||
eim.setProperty(stage + "stageclear", "true");
|
||||
eim.showClearEffect(true);
|
||||
|
||||
eim.linkToNextStage(stage, "lpq", curMap); //opens the portal to the next map
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();//ExitChat
|
||||
}else if (mode == 0){
|
||||
cm.dispose();//No
|
||||
}else{ //Regular Talk
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
var eim = cm.getPlayer().getEventInstance();
|
||||
var nthtext = "4th";
|
||||
if (status == 0) {
|
||||
party = eim.getPlayers();
|
||||
preamble = eim.getProperty("leader" + nthtext + "preamble");
|
||||
gaveItems = eim.getProperty("leader" + nthtext + "gaveItems");
|
||||
if (preamble == null) {
|
||||
cm.sendNext("Hi. Welcome to the " + nthtext + " stage.");
|
||||
eim.setProperty("leader" + nthtext + "preamble","done");
|
||||
cm.dispose();
|
||||
}else{
|
||||
if(!isLeader()){
|
||||
if(gaveItems == null){
|
||||
cm.sendOk("Please tell your #bParty-Leader#k to come talk to me");
|
||||
cm.dispose();
|
||||
}else{
|
||||
cm.sendOk("Hurry, goto the next stage, the portal is open!");
|
||||
cm.dispose();
|
||||
}
|
||||
}else{
|
||||
if(gaveItems == null){
|
||||
if(cm.getPlayer().getMap().getCharacters().size() != eim.getPlayers().size()) {
|
||||
cm.sendOk("Please wait for all of your party members to get here.");
|
||||
cm.dispose();
|
||||
} else if(cm.itemQuantity(4001022) >= 6){
|
||||
cm.sendOk("Good job! you have collected all 6 #b#t4001022#'s#k");
|
||||
}else{
|
||||
cm.sendOk("Sorry you don't have all 6 #b#t4001022#'s#k");
|
||||
cm.dispose();
|
||||
}
|
||||
}else{
|
||||
cm.sendOk("Hurry, goto the next stage, the portal is open!");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (status == 1){
|
||||
cm.sendOk("You may continue to the next stage!");
|
||||
|
||||
var map = eim.getMapInstance(cm.getPlayer().getMapId());
|
||||
map.broadcastMessage(MaplePacketCreator.showEffect("quest/party/clear"));
|
||||
map.broadcastMessage(MaplePacketCreator.playSound("Party1/Clear"));
|
||||
map.broadcastMessage(MaplePacketCreator.environmentChange("gate", 2));
|
||||
|
||||
cm.removeAll(4001022);
|
||||
cm.givePartyExp("LudiPQ4th");
|
||||
eim.setProperty("4stageclear","true");
|
||||
eim.setProperty("leader" + nthtext + "gaveItems","done");
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else if (mode == 0){
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
var eim = cm.getPlayer().getEventInstance();
|
||||
|
||||
if(eim.getProperty(stage.toString() + "stageclear") != null) {
|
||||
cm.sendNext("Hurry, goto the next stage, the portal is open!");
|
||||
}
|
||||
else {
|
||||
if (eim.isLeader(cm.getPlayer())) {
|
||||
var state = eim.getIntProperty("statusStg" + stage);
|
||||
|
||||
if(state == -1) { // preamble
|
||||
cm.sendOk("Hi. Welcome to the #bstage " + stage + "#k. On this stage, several creatures are hiding in the shadows of the inner parts of this tower. Some of them cannot be beaten by physical means, so magical attacks are required to do the job, whereas others work the other way around. Get me 6 #t4001022#'s this time.");
|
||||
eim.setProperty("statusStg" + stage, 0);
|
||||
}
|
||||
else { // check stage completion
|
||||
if (cm.haveItem(4001022, 6)) {
|
||||
cm.sendOk("Good job! you have collected all 6 #b#t4001022#'s.#k");
|
||||
cm.gainItem(4001022, -6);
|
||||
|
||||
eim.setProperty("statusStg" + stage, 1);
|
||||
clearStage(stage, eim, curMap);
|
||||
} else {
|
||||
cm.sendNext("Sorry you don't have all 6 #b#t4001022#'s.#k");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("Please tell your #bParty-Leader#k to come talk to me.");
|
||||
}
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isLeader(){
|
||||
if(cm.getParty() == null){
|
||||
return false;
|
||||
}else{
|
||||
return cm.isLeader();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user