CPQ 1 CPQ 2 CASAMENTO
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
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/>.
|
||||
*/
|
||||
/**
|
||||
* @author BubblesDev
|
||||
* @author Ronan
|
||||
@@ -29,104 +29,104 @@ var status = 0;
|
||||
var em = null;
|
||||
|
||||
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(cm.getMapId() == 100000200) {
|
||||
if (status == 0) {
|
||||
em = cm.getEventManager("HenesysPQ");
|
||||
if(em == null) {
|
||||
cm.sendOk("The Henesys PQ has encountered an error.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if(cm.isUsingOldPqNpcStyle()) {
|
||||
action(1, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendSimple("#e#b<Party Quest: Primrose Hill>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nI'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat. Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?#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.\r\n#L3#I would like to redeem an instance hat.");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (cm.getParty() == null) {
|
||||
cm.sendOk("Hi there! I'm Tory. This place is covered with mysterious aura of the full moon, and no one person can enter here by him/herself.");
|
||||
cm.dispose();
|
||||
} else if(!cm.isLeader()) {
|
||||
cm.sendOk("If you'd like to enter here, the leader of your party will have to talk to me. Talk to your party leader about this.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
var eli = em.getEligibleParty(cm.getParty());
|
||||
if(eli.size() > 0) {
|
||||
if(!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
}
|
||||
}
|
||||
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 if (selection == 2) {
|
||||
cm.sendOk("#e#b<Party Quest: Primrose Hill>#k#n\r\nCollect primrose seeds from the flowers at the bottom part of the map and drop them by the platforms above the stage. Primrose seed color must match to grow the seeds, so test until you find the correct combination. When all the seeds have been planted, that is, starting second part of the mission, scout the Moon Bunny while it prepares Rice Cakes for the hungry Growlie. Once Growlie becomes satisfied, your mission is complete.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendYesNo("So you want to exchange #b20 #b#t4001158##k for the instance-designed hat?");
|
||||
}
|
||||
} else {
|
||||
if(cm.hasItem(4001158, 20)) {
|
||||
if(cm.canHold(1002798)) {
|
||||
cm.gainItem(4001158, -20);
|
||||
cm.gainItem(1002798, 20);
|
||||
cm.sendNext("Here it is. Enjoy!");
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("You don't have enough #t4001158# to buy it yet!");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010100) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("Thank you for aiding in the effort of feeding the Growlie. As a matter of fact, your team has already been rewarded for reaching this far. With this problem now solved, there is another issue happening right now, if you are interessed check #bTommy#k there for the info. So, are you returning straight to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if(cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
}
|
||||
else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010400) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("So, are you returning to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if(cm.getEventInstance() == null) {
|
||||
cm.warp(100000200);
|
||||
} else if(cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
} else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && status == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if (cm.getMapId() == 100000200) {
|
||||
if (status == 0) {
|
||||
em = cm.getEventManager("HenesysPQ");
|
||||
if (em == null) {
|
||||
cm.sendOk("The Henesys PQ has encountered an error.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (cm.isUsingOldPqNpcStyle()) {
|
||||
action(1, 0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendSimple("#e#b<Party Quest: Primrose Hill>\r\n#k#n" + em.getProperty("party") + "\r\n\r\nI'm Tory. Inside here is a beautiful hill where the primrose blooms. There's a tiger that lives in the hill, Growlie, and he seems to be looking for something to eat. Would you like to head over to the hill of primrose and join forces with your party members to help Growlie out?#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.\r\n#L3#I would like to redeem an instance hat.");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (cm.getParty() == null) {
|
||||
cm.sendOk("Hi there! I'm Tory. This place is covered with mysterious aura of the full moon, and no one person can enter here by him/herself.");
|
||||
cm.dispose();
|
||||
} else if (!cm.isLeader()) {
|
||||
cm.sendOk("If you'd like to enter here, the leader of your party will have to talk to me. Talk to your party leader about this.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
var eli = em.getEligibleParty(cm.getParty());
|
||||
if (eli.size() > 0) {
|
||||
if (!em.startInstance(cm.getParty(), cm.getPlayer().getMap(), 1)) {
|
||||
cm.sendOk("Someone is already attempting the PQ. Please wait for them to finish, or find another channel.");
|
||||
}
|
||||
}
|
||||
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 if (selection == 2) {
|
||||
cm.sendOk("#e#b<Party Quest: Primrose Hill>#k#n\r\nCollect primrose seeds from the flowers at the bottom part of the map and drop them by the platforms above the stage. Primrose seed color must match to grow the seeds, so test until you find the correct combination. When all the seeds have been planted, that is, starting second part of the mission, scout the Moon Bunny while it prepares Rice Cakes for the hungry Growlie. Once Growlie becomes satisfied, your mission is complete.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendYesNo("So you want to exchange #b20 #b#t4001158##k for the instance-designed hat?");
|
||||
}
|
||||
} else {
|
||||
if (cm.hasItem(4001158, 20)) {
|
||||
if (cm.canHold(1002798)) {
|
||||
cm.gainItem(4001158, -20);
|
||||
cm.gainItem(1002798, 20);
|
||||
cm.sendNext("Here it is. Enjoy!");
|
||||
}
|
||||
} else {
|
||||
cm.sendNext("You don't have enough #t4001158# to buy it yet!");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010100) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("Thank you for aiding in the effort of feeding the Growlie. As a matter of fact, your team has already been rewarded for reaching this far. With this problem now solved, there is another issue happening right now, if you are interessed check #bTommy#k there for the info. So, are you returning straight to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if (cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
}
|
||||
else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getMapId() == 910010400) {
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("So, are you returning to Henesys now?");
|
||||
} else if (status == 1) {
|
||||
if (cm.getEventInstance() == null) {
|
||||
cm.warp(100000200);
|
||||
} else if (cm.getEventInstance().giveEventReward(cm.getPlayer())) {
|
||||
cm.warp(100000200);
|
||||
} else {
|
||||
cm.sendOk("It seems you are short on space in one of your inventories. Please check that first to get rewarded properly.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
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/>.
|
||||
*/
|
||||
/**
|
||||
* @author BubblesDev
|
||||
* @author Ronan
|
||||
@@ -31,45 +31,45 @@ function start() {
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode < 1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
status++;
|
||||
if (cm.getPlayer().getMap().getId() == 910010100) { //Clear map
|
||||
if (status == 0) {
|
||||
cm.sendNext("Hello, there! I'm Tommy. There's a Pig Town nearby where we're standing. The pigs there are rowdy and uncontrollable to the point where they have stolen numerous weapons from travelers. They were kicked out from their towns, and are currently hiding out at the Pig Town.");
|
||||
} else if (status == 1) {
|
||||
if(cm.isEventLeader()) {
|
||||
cm.sendYesNo("What do you think about making your way there with your party members and teach those rowdy pigs a lesson?");
|
||||
}
|
||||
else {
|
||||
cm.sendOk("Interessed? Tell your party leader to talk to me to head there!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (status == 2) {
|
||||
cm.getEventInstance().startEventTimer(5 * 60000);
|
||||
cm.getEventInstance().warpEventTeam(910010200);
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (cm.getPlayer().getMap().getId() == 910010200) { //Bonus map
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("Would you like to exit the bonus now?");
|
||||
} else {
|
||||
cm.warp(910010400);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (cm.getPlayer().getMap().getId() == 910010300) { //Exit map
|
||||
if (status == 0) {
|
||||
cm.sendOk("You will now be warped out, thank you for helping us!");
|
||||
} else {
|
||||
cm.warp(100000200);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode < 1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
status++;
|
||||
if (cm.getPlayer().getMap().getId() == 910010100) { //Clear map
|
||||
if (status == 0) {
|
||||
cm.sendNext("Hello, there! I'm Tommy. There's a Pig Town nearby where we're standing. The pigs there are rowdy and uncontrollable to the point where they have stolen numerous weapons from travelers. They were kicked out from their towns, and are currently hiding out at the Pig Town.");
|
||||
} else if (status == 1) {
|
||||
if (cm.isEventLeader()) {
|
||||
cm.sendYesNo("What do you think about making your way there with your party members and teach those rowdy pigs a lesson?");
|
||||
}
|
||||
else {
|
||||
cm.sendOk("Interessed? Tell your party leader to talk to me to head there!");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (status == 2) {
|
||||
cm.getEventInstance().startEventTimer(5 * 60000);
|
||||
cm.getEventInstance().warpEventTeam(910010200);
|
||||
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (cm.getPlayer().getMap().getId() == 910010200) { //Bonus map
|
||||
if (status == 0) {
|
||||
cm.sendYesNo("Would you like to exit the bonus now?");
|
||||
} else {
|
||||
cm.warp(910010400);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
} else if (cm.getPlayer().getMap().getId() == 910010300) { //Exit map
|
||||
if (status == 0) {
|
||||
cm.sendOk("You will now be warped out, thank you for helping us!");
|
||||
} else {
|
||||
cm.warp(100000200);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,232 +1,84 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
var map = 980000000;
|
||||
var minLvl = 0;
|
||||
var maxLvl = 255;
|
||||
var minAmt = 0;
|
||||
var maxAmt = 6;
|
||||
|
||||
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/>.
|
||||
*/
|
||||
/* Spiegelmann
|
||||
Refining NPC:
|
||||
* Auto ore refiner
|
||||
*
|
||||
* @author RonanLana
|
||||
*/
|
||||
|
||||
var status;
|
||||
var refineRocks = true; // enables moon rock, star rock
|
||||
var refineCrystals = true; // enables common crystals
|
||||
var refineSpecials = true; // enables lithium, special crystals
|
||||
var feeMultiplier = 7.0;
|
||||
|
||||
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 && type > 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
if (!Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
|
||||
cm.sendOk("The Monster Carnival is currently unavailable.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
var selStr = "The Monster Carnival is currently unavailable, but instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b";
|
||||
|
||||
var options = new Array("Refine mineral ores","Refine jewel ores");
|
||||
if(refineCrystals) {
|
||||
options.push("Refine crystal ores");
|
||||
}
|
||||
if(refineRocks) {
|
||||
options.push("Refine plates/jewels");
|
||||
}
|
||||
|
||||
for (var i = 0; i < options.length; i++){
|
||||
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
|
||||
}
|
||||
|
||||
cm.sendSimple(selStr);
|
||||
} else if(status == 1) {
|
||||
var allDone;
|
||||
|
||||
if (selection == 0) {
|
||||
allDone = refineItems(0); // minerals
|
||||
} else if (selection == 1) {
|
||||
allDone = refineItems(1); // jewels
|
||||
} else if (selection == 2 && refineCrystals) {
|
||||
allDone = refineItems(2); // crystals
|
||||
} else if (selection == 2 && !refineCrystals || selection == 3) {
|
||||
allDone = refineRockItems(); // moon/star rock
|
||||
}
|
||||
|
||||
if(allDone) {
|
||||
cm.sendOk("Done. Thanks for showing up~.");
|
||||
} else {
|
||||
cm.sendOk("Done. Be aware some of the items #rcould not be synthetized#k because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0 && status == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function getRefineFee(fee) {
|
||||
return ((feeMultiplier * fee) | 0);
|
||||
}
|
||||
|
||||
function isRefineTarget(refineType, refineItemid) {
|
||||
if(refineType == 0) { //mineral refine
|
||||
return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials);
|
||||
} else if(refineType == 1) { //jewel refine
|
||||
return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials);
|
||||
} else if(refineType == 2) { //crystal refine
|
||||
return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getRockRefineTarget(refineItemid) {
|
||||
if(refineItemid >= 4011000 && refineItemid <= 4011006) {
|
||||
return 0;
|
||||
} else if(refineItemid >= 4021000 && refineItemid <= 4021008) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function refineItems(refineType) {
|
||||
var allDone = true;
|
||||
|
||||
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
|
||||
var itemCount = {};
|
||||
|
||||
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
|
||||
if(isRefineTarget(refineType, itemid)) {
|
||||
var ic = itemCount[itemid];
|
||||
|
||||
if(ic != undefined) {
|
||||
itemCount[itemid] += it.getQuantity();
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
if (cm.getParty() == null) {
|
||||
status = 10;
|
||||
cm.sendOk("#eÉ necessário criar um grupo antes de começar o Festival de Monstros!#k");
|
||||
} else if (!cm.isLeader()) {
|
||||
status = 10;
|
||||
cm.sendOk("Se você quer começar o Festival, avise o #blíder do grupo#k para falar comigo.");
|
||||
} else {
|
||||
itemCount[itemid] = it.getQuantity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var key in itemCount) {
|
||||
var itemqty = itemCount[key];
|
||||
var itemid = parseInt(key);
|
||||
|
||||
var refineQty = ((itemqty / 10) | 0);
|
||||
if(refineQty <= 0) continue;
|
||||
|
||||
while(true) {
|
||||
itemqty = refineQty * 10;
|
||||
|
||||
var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty);
|
||||
if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) {
|
||||
cm.gainMeso(-fee);
|
||||
cm.gainItem(itemid, -itemqty);
|
||||
cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty);
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
|
||||
function refineRockItems() {
|
||||
var allDone = true;
|
||||
var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||
var minRocks = [2147483647, 2147483647];
|
||||
|
||||
var rockItems = [4011007, 4021009];
|
||||
var rockFees = [10000, 15000];
|
||||
|
||||
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
var rockRefine = getRockRefineTarget(itemid);
|
||||
if(rockRefine >= 0) {
|
||||
var rockItem = ((itemid % 100) | 0);
|
||||
var itemqty = it.getQuantity();
|
||||
|
||||
minItems[rockRefine][rockItem] += itemqty;
|
||||
}
|
||||
}
|
||||
|
||||
for(var i = 0; i < minRocks.length; i++) {
|
||||
for(var j = 0; j < minItems[i].length; j++) {
|
||||
if(minRocks[i] > minItems[i][j]) {
|
||||
minRocks[i] = minItems[i][j];
|
||||
}
|
||||
}
|
||||
if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue;
|
||||
|
||||
var refineQty = minRocks[i];
|
||||
while(true) {
|
||||
var fee = getRefineFee(rockFees[i] * refineQty);
|
||||
if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) {
|
||||
cm.gainMeso(-fee);
|
||||
|
||||
var j;
|
||||
if(i == 0) {
|
||||
for(j = 4011000; j < 4011007; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
var party = cm.getParty().getMembers();
|
||||
var inMap = cm.partyMembersInMap();
|
||||
var lvlOk = 0;
|
||||
var isInMap = 0;
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
if (party.get(i).getLevel() >= minLvl && party.get(i).getLevel() <= maxLvl) {
|
||||
lvlOk++;
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
if (party.get(i).getPlayer().getMapId() != 980000000) {
|
||||
//isInMap = false;
|
||||
isInMap++
|
||||
}
|
||||
}
|
||||
|
||||
if (party >= 1) {
|
||||
status = 10;
|
||||
cm.sendOk("Você não tem número suficiente de pessoas em seu grupo. Você precisa de um grupo com #b" + minAmt + "#k - #r" + maxAmt + "#k membros e eles devem estar no mapa com você.");
|
||||
} else if (lvlOk != inMap) {
|
||||
status = 10;
|
||||
cm.sendOk("Certifique se todos em seu grupo estão dentre os níveis corretos (" + minLvl + "~" + maxLvl + ")!");
|
||||
} else if (isInMap > 0) {
|
||||
status = 10;
|
||||
cm.sendOk("Existe alguém do grupo que não esta no mapa!");
|
||||
} else {
|
||||
for(j = 4021000; j < 4021009; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
cm.sendCPQMapLists();
|
||||
}
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
}
|
||||
} else if (status == 1) {
|
||||
|
||||
if (cm.fieldTaken(selection)) {
|
||||
if (cm.fieldLobbied(selection)) {
|
||||
cm.challengeParty(selection);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("A sala esta cheia.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
if ((selection === 0 || selection === 1 || selection === 2 || selection === 3) && party.size() < 2) {
|
||||
cm.sendOk("Você precisa de no mínimo 2 player para entrar na competição.");
|
||||
} else if ((selection === 4 || selection === 5) && party.size() < 3) {
|
||||
cm.sendOk("Você precisa de no mínimo 3 player para entrar na competição.");
|
||||
} else {
|
||||
cm.cpqLobby(selection);
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 11) {
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
}
|
||||
@@ -1,226 +1,320 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
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.
|
||||
var status = 0;
|
||||
var rnk = -1;
|
||||
var n1 = 50; //???
|
||||
var n2 = 40; //??? ???
|
||||
var n3 = 7; //35
|
||||
var n4 = 10; //40
|
||||
var n5 = 20; //50
|
||||
|
||||
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/>.
|
||||
*/
|
||||
/* Spiegelmann
|
||||
Refining NPC:
|
||||
* Auto ore refiner
|
||||
*
|
||||
* @author RonanLana
|
||||
*/
|
||||
|
||||
var status;
|
||||
var refineRocks = true; // enables moon rock, star rock
|
||||
var refineCrystals = true; // enables common crystals
|
||||
var refineSpecials = true; // enables lithium, special crystals
|
||||
var feeMultiplier = 7.0;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (status >= 0 && mode == 0) {
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (cm.getPlayer().getMapId() == 980000010) {
|
||||
if (status == 0) {
|
||||
cm.sendNext("Eu espero que você tinha divertido na Folia dos Monstros!");
|
||||
} else if (status > 0) {
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (cm.getChar().getMap().isCPQLoserMap()) {
|
||||
if (status == 0) {
|
||||
if (cm.getChar().getParty() != null) {
|
||||
var shiu = "";
|
||||
if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||
shiu += "#rA#k";
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vitória pode ser sua da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
rnk = 10;
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
||||
shiu += "#rB#k";
|
||||
rnk = 20;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, mesmo com sua ótima performance. Só mais um pouquinho, e a vitória poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 30 && cm.getPlayer().getFestivalPoints() < 50) {
|
||||
shiu += "#rC#k";
|
||||
rnk = 30;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha. A vitória está para aqueles que se esforçam. Vejo seus esforços, então a vitória não está tão longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
} else {
|
||||
shiu += "#rD#k";
|
||||
rnk = 40;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de você da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
}
|
||||
} else {
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 1) {
|
||||
switch (rnk) {
|
||||
case 10:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(17500);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 20:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(1200);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 30:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(5000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 40:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(2500);
|
||||
cm.dispose();
|
||||
break;
|
||||
default:
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (cm.getChar().getMap().isCPQWinnerMap()) {
|
||||
if (status == 0) {
|
||||
if (cm.getChar().getParty() != null) {
|
||||
var shi = "";
|
||||
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||
shi += "#rA#k";
|
||||
rnk = 1;
|
||||
cm.sendOk("Parabéns pela sua vitória!!! Que ótima performance! O grupo adversário não pôde fazer nada! Espero o mesmo bom trabalho da próxima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 100 && cm.getPlayer().getFestivalPoints() < 300) {
|
||||
shi += "#rB#k";
|
||||
rnk = 2;
|
||||
cm.sendOk("Parabéns pela sua vitória! Isso foi impressionante! Você fez um bom trabalho contra o grupo adversário! Só mais um pouco, e você definitivamente vai conseguir um A na próxima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
||||
shi += "#rC#k";
|
||||
rnk = 3;
|
||||
cm.sendOk("Parabéns pela sua vitória. Você fez algumas coisas cá e lá, mas essa não pode ser considerada uma boa vitória. Espero mais de ti da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else {
|
||||
shi += "#rD#k";
|
||||
rnk = 4;
|
||||
cm.sendOk("Parabéns pela sua vitória, entretanto sua performance não refletiu muito bem isso. Seja mais ativo na sua próxima participação da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
}
|
||||
} else {
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 1) {
|
||||
switch (rnk) {
|
||||
case 1:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(50000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 2:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(25500);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 3:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(21000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 4:
|
||||
cm.warp(980000000, 0);
|
||||
cm.gainExp(19505);
|
||||
cm.dispose();
|
||||
break;
|
||||
default:
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mode == 0 && type > 0) {
|
||||
if (status == 0) {
|
||||
// cm.sendSimple("O que gostaria de fazer? Se você nunca participou da Folia de Monstros, você precisará saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l");
|
||||
cm.sendSimple("O que gostaria de fazer? Se você nunca participou da Folia de Monstros, você precisará saber de algumas coisas antes de participar.\r\n#b#L0# Ir para o campo da Folia de Monstros 1.#l\r\n#L3# Ir para o campo da Folia de Monstros 2.#l\r\n#L1# Aprender sobre a Folia de Monstros.#l\r\n#L2# Trocar #t4001129#.#l");
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if ((cm.getLevel() > 29 && cm.getLevel() < 51) || cm.getPlayer().isGM()) {
|
||||
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
||||
cm.warp(980000000, 0);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
|
||||
if(status == 0) {
|
||||
var selStr = "The Monster Carnival is currently unavailable, but instead I offer a steadfast #bore refining#k service for you, taxing #r" + ((feeMultiplier * 100) | 0) + "%#k over the usual fee to synthetize them. What will you do?#b";
|
||||
|
||||
var options = new Array("Refine mineral ores","Refine jewel ores");
|
||||
if(refineCrystals) {
|
||||
options.push("Refine crystal ores");
|
||||
}
|
||||
if(refineRocks) {
|
||||
options.push("Refine plates/jewels");
|
||||
}
|
||||
|
||||
for (var i = 0; i < options.length; i++){
|
||||
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
|
||||
}
|
||||
|
||||
cm.sendSimple(selStr);
|
||||
} else if(status == 1) {
|
||||
var allDone;
|
||||
|
||||
if (selection == 0) {
|
||||
allDone = refineItems(0); // minerals
|
||||
} else if (selection == 1) {
|
||||
allDone = refineItems(1); // jewels
|
||||
} else if (selection == 2 && refineCrystals) {
|
||||
allDone = refineItems(2); // crystals
|
||||
} else if (selection == 2 && !refineCrystals || selection == 3) {
|
||||
allDone = refineRockItems(); // moon/star rock
|
||||
}
|
||||
|
||||
if(allDone) {
|
||||
cm.sendOk("Done. Thanks for showing up~.");
|
||||
} else {
|
||||
cm.sendOk("Done. Be aware some of the items could not be synthetized because either you have a lack of space on your ETC inventory or there's not enough mesos to cover the fee.");
|
||||
}
|
||||
} else if (cm.getLevel() < 30) {
|
||||
cm.sendOk("Você precisa ser no mínimo nível 30 para participar da Folia de Monstros. Fale comigo quando for forte o bastante.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getRefineFee(fee) {
|
||||
return ((feeMultiplier * fee) | 0);
|
||||
}
|
||||
|
||||
function isRefineTarget(refineType, refineItemid) {
|
||||
if(refineType == 0) { //mineral refine
|
||||
return refineItemid >= 4010000 && refineItemid <= 4010007 && !(refineItemid == 4010007 && !refineSpecials);
|
||||
} else if(refineType == 1) { //jewel refine
|
||||
return refineItemid >= 4020000 && refineItemid <= 4020008 && !(refineItemid == 4020008 && !refineSpecials);
|
||||
} else if(refineType == 2) { //crystal refine
|
||||
return refineItemid >= 4004000 && refineItemid <= 4004004 && !(refineItemid == 4004004 && !refineSpecials);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getRockRefineTarget(refineItemid) {
|
||||
if(refineItemid >= 4011000 && refineItemid <= 4011006) {
|
||||
return 0;
|
||||
} else if(refineItemid >= 4021000 && refineItemid <= 4021008) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function refineItems(refineType) {
|
||||
var allDone = true;
|
||||
|
||||
var refineFees = [[300,300,300,500,500,500,800,270],[500,500,500,500,500,500,500,1000,3000],[5000,5000,5000,5000,1000000]];
|
||||
var itemCount = {};
|
||||
|
||||
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
|
||||
if(isRefineTarget(refineType, itemid)) {
|
||||
var ic = itemCount[itemid];
|
||||
|
||||
if(ic != undefined) {
|
||||
itemCount[itemid] += it.getQuantity();
|
||||
} else {
|
||||
itemCount[itemid] = it.getQuantity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var key in itemCount) {
|
||||
var itemqty = itemCount[key];
|
||||
var itemid = parseInt(key);
|
||||
|
||||
var refineQty = ((itemqty / 10) | 0);
|
||||
if(refineQty <= 0) continue;
|
||||
|
||||
while(true) {
|
||||
itemqty = refineQty * 10;
|
||||
|
||||
var fee = getRefineFee(refineFees[refineType][(itemid % 100) | 0] * refineQty);
|
||||
if(cm.canHold(itemid + 1000, refineQty, itemid, itemqty) && cm.getMeso() >= fee) {
|
||||
cm.gainMeso(-fee);
|
||||
cm.gainItem(itemid, -itemqty);
|
||||
cm.gainItem(itemid + (itemid != 4010007 ? 1000 : 1001), refineQty);
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
|
||||
function refineRockItems() {
|
||||
var allDone = true;
|
||||
var minItems = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
|
||||
var minRocks = [2147483647, 2147483647];
|
||||
|
||||
var rockItems = [4011007, 4021009];
|
||||
var rockFees = [10000, 15000];
|
||||
|
||||
var iter = cm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).iterator();
|
||||
while (iter.hasNext()) {
|
||||
var it = iter.next();
|
||||
var itemid = it.getItemId();
|
||||
var rockRefine = getRockRefineTarget(itemid);
|
||||
if(rockRefine >= 0) {
|
||||
var rockItem = ((itemid % 100) | 0);
|
||||
var itemqty = it.getQuantity();
|
||||
|
||||
minItems[rockRefine][rockItem] += itemqty;
|
||||
}
|
||||
}
|
||||
|
||||
for(var i = 0; i < minRocks.length; i++) {
|
||||
for(var j = 0; j < minItems[i].length; j++) {
|
||||
if(minRocks[i] > minItems[i][j]) {
|
||||
minRocks[i] = minItems[i][j];
|
||||
}
|
||||
}
|
||||
if(minRocks[i] <= 0 || minRocks[i] == 2147483647) continue;
|
||||
|
||||
var refineQty = minRocks[i];
|
||||
while(true) {
|
||||
var fee = getRefineFee(rockFees[i] * refineQty);
|
||||
if(cm.canHold(rockItems[i], refineQty) && cm.getMeso() >= fee) {
|
||||
cm.gainMeso(-fee);
|
||||
|
||||
var j;
|
||||
if(i == 0) {
|
||||
for(j = 4011000; j < 4011007; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
return;
|
||||
} else {
|
||||
cm.sendOk("Sinto muito, mas apenas os jogadores de nível 30~50 podem participar da Folia de Monstros.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
} else if (selection == 1) {
|
||||
status = 60;
|
||||
cm.sendSimple("O que gostaria de fazer?\r\n#b#L0# O que é a Folia de Monstros?#l\r\n#L1# Visão geral sobre a Folia de Monstros#l\r\n#L2# Informações detalhadas sobre a Folia de Monstros#l\r\n#L3# Nada, de verdade. Mudei de ideia.#l");
|
||||
} else if (selection == 2) {
|
||||
cm.sendSimple("Lembre-se se você possui #t4001129#, você pode trocá-las por itens. Tenha certeza que você possui #t4001129# suficientes para o item que você deseja. Selecione o item que você gostaria de trocá-las! \r\n#b#L0# #t1122007#(" + n1 + " moedas)#l\r\n#L1# #t2041211#(" + n2 + " moedas)#l\r\n#L2# Armas para Guerreiros#l\r\n#L3# Armas para Bruxos#l\r\n#L4# Armas para Arqueiros#l\r\n#L5# Armas para Gatunos#l");
|
||||
} else if (selection == 3) {
|
||||
cm.getChar().saveLocation("MONSTER_CARNIVAL");
|
||||
cm.warp(980030000, 0);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (status == 2) {
|
||||
select = selection;
|
||||
if (select == 0) {
|
||||
if (cm.haveItem(4001129, n1) && cm.canHold(4001129)) {
|
||||
cm.gainItem(1122007, 1);
|
||||
cm.gainItem(4001129, -n1);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Verifique e veja se estão faltando #b#t4001129##k ou se seu inventário de Equipamentos está cheio.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (select == 1) {
|
||||
if (cm.haveItem(4001129, n2) && cm.canHold(2041211)) {
|
||||
cm.gainItem(2041211, 1);
|
||||
cm.gainItem(4001129, -n2);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Verifique e veja se estão faltando #b#t4001129##k ou se seu inventário de Uso está cheio.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (select == 2) {//S2 Warrior 26 S3 Magician 6 S4 Bowman 6 S5 Thief 8
|
||||
status = 10;
|
||||
cm.sendSimple("Por favor tenha certeza que você possui #t4001129# para a arma que você deseja. Selecione a arma que você gostaria de trocar #t4001129# por. As opções que tenho são realmente boas, e eu não sou eu que falo é o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a próxima página(1/2)#l");
|
||||
} else if (select == 3) {
|
||||
status = 20;
|
||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente atraentes. Veja você mesmo! \r\n#b#L0# #z1372001#(" + n3 + " moedas)#l\r\n#L1# #z1382018#(" + n3 + " moedas)#l\r\n#L2# #z1372012#(" + n4 + "moedas)#l\r\n#L3# #z1382019#(" + n4 + "moedas)#l\r\n#L4# #z1382001#(" + n5 + " moedas)#l\r\n#L5# #z1372007#(" + n5 + " moedas)#l");
|
||||
} else if (select == 4) {
|
||||
status = 30;
|
||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente atraentes. Veja você mesmo! \r\n#b#L0# #z1452006#(" + n3 + " moedas)#l\r\n#L1# #z1452007#(" + n4 + " moedas)#l\r\n#L2# #z1452008#(" + n5 + " moedas)#l\r\n#L3# #z1462005#(" + n3 + " moedas)#l\r\n#L4# #z1462006#(" + n4 + " moedas)#l\r\n#L5# #z1462007#(" + n5 + " moedas)#l");
|
||||
} else if (select == 5) {
|
||||
status = 40;
|
||||
cm.sendSimple("Selecione a arma que você gostaria de trocar por. As armas que eu tenho são da maior qualidade. Seleciona a mais atraente para você! \r\n#b#L0# #z1472013#(" + n3 + " moedas)#l\r\n#L1# #z1472017#(" + n4 + "moedas)#l\r\n#L2# #z1472021#(" + n5 + " moedas)#l\r\n#L3# #z1332014#(" + n3 + " moedas)#l\r\n#L4# #z1332031#(" + n4 + "moedas)#l\r\n#L5# #z1332011#(" + n4 + "moedas)#l\r\n#L6# #z1332016#(" + n5 + " moedas)#l\r\n#L7# #z1332003#(" + n5 + " moedas)#l");
|
||||
}
|
||||
} else if (status == 11) {
|
||||
if (selection == 12) {
|
||||
cm.sendSimple("Selecione a arma que você gostaria de trocar. As armas que eu tenho aqui são extremamente úteis. Dá uma olhada! \r\n#b#L0# #z1322015#(" + n3 + " moedas)#l\r\n#L1# #z1422008#(" + n3 + " moedas)#l\r\n#L2# #z1322016#(" + n4 + "moedas)#l\r\n#L3# #z1422007#(" + n4 + "moedas)#l\r\n#L4# #z1322017#(" + n5 + " moedas)#l\r\n#L5# #z1422005#(" + n5 + " moedas)#l\r\n#L6# #z1432003#(" + n3 + " moedas)#l\r\n#L7# #z1442003#(" + n3 + " moedas)#l\r\n#L8# #z1432005#(" + n4 + "moedas)#l\r\n#L9# #z1442009#(" + n4 + "moedas)#l\r\n#L10# #z1442005#(" + n5 + " moedas)#l\r\n#L11# #z1432004#(" + n5 + " moedas)#l\r\n#L12# Voltar para a página inicial(2/2)#l");
|
||||
} else {
|
||||
for(j = 4021000; j < 4021009; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
var item = new Array(1302004, 1402006, 1302009, 1402007, 1302010, 1402003, 1312006, 1412004, 1312007, 1412005, 1312008, 1412003);
|
||||
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5);
|
||||
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||
cm.gainItem(item[selection], 1);
|
||||
cm.gainItem(4001129, -cost[selection]);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Você ou não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
||||
cm.dispose();
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
}
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
} else if (status == 12) {
|
||||
if (selection == 12) {
|
||||
status = 10;
|
||||
cm.sendSimple("Por favor tenha certeza que você possui #t4001129# para a arma que você deseja. Selecione a arma que você gostaria de trocar #t4001129# por. As opções que tenho são realmente boas, e eu não sou eu que falo é o povo que diz! \r\n#b#L0# #z1302004#(" + n3 + " moedas)#l\r\n#L1# #z1402006#(" + n3 + " moedas)#l\r\n#L2# #z1302009#(" + n4 + " moedas)#l\r\n#L3# #z1402007#(" + n4 + " moedas)#l\r\n#L4# #z1302010#(" + n5 + " moedas)#l\r\n#L5# #z1402003#(" + n5 + " moedas)#l\r\n#L6# #z1312006#(" + n3 + " moedas)#l\r\n#L7# #z1412004#(" + n3 + " moedas)#l\r\n#L8# #z1312007#(" + n4 + " moedas)#l\r\n#L9# #z1412005#(" + n4 + " moedas)#l\r\n#L10# #z1312008#(" + n5 + " moedas)#l\r\n#L11# #z1412003#(" + n5 + " moedas)#l\r\n#L12# Ir para a próxima página(1/2)#l");
|
||||
} else {
|
||||
var item = new Array(1322015, 1422008, 1322016, 1422007, 1322017, 1422005, 1432003, 1442003, 1432005, 1442009, 1442005, 1432004);
|
||||
var cost = new Array(n3, n3, n4, n4, n5, n5, n3, n3, n4, n4, n5, n5);
|
||||
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||
cm.gainItem(item[selection], 1);
|
||||
cm.gainItem(4001129, -cost[selection]);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Você ou não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else if (status == 21) {
|
||||
var item = new Array(1372001, 1382018, 1372012, 1382019, 1382001, 1372007);
|
||||
var cost = new Array(n3, n3, n4, n4, n5, n5);
|
||||
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||
cm.gainItem(item[selection], 1);
|
||||
cm.gainItem(4001129, -cost[selection]);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 31) {
|
||||
var item = new Array(1452006, 1452007, 1452008, 1462005, 1462006, 1462007);
|
||||
var cost = new Array(n3, n4, n5, n3, n4, n5);
|
||||
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||
cm.gainItem(item[selection], 1);
|
||||
cm.gainItem(4001129, -cost[selection]);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 41) {
|
||||
var item = new Array(1472013, 1472017, 1472021, 1332014, 1332031, 1332011, 1332016, 1332003);
|
||||
var cost = new Array(n3, n4, n5, n3, n4, n4, n5, n5);
|
||||
if (cm.haveItem(4001129, cost[selection]) && cm.canHold(item[selection])) {
|
||||
cm.gainItem(item[selection], 1);
|
||||
cm.gainItem(4001129, -cost[selection]);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("Ou você não possui #b#t4001129##k suficientes, ou seu inventário está cheio. Verifique novamente.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 61) {
|
||||
select = selection;
|
||||
if (selection == 0) {
|
||||
cm.sendNext("Haha! Eu sou Spiegelmann, o líder dessa Folia. Eu comecei a primeira #bFolia de Monstros#k aqui, aguardando por viajantes como você para participar dessa extravaganza!");
|
||||
} else if (selection == 1) {
|
||||
cm.sendNext("#bFolia de Monstros#k consiste em 2 grupos entrando no campo de batalha, e caçando os monstros invocados pelo outro grupo. É uma #bmissão de combate que determina o vitorioso pela quantia de Pontos de Folia (CP) recebidos#k.");
|
||||
} else if (selection == 2) {
|
||||
cm.sendNext("Quando entrar no Campo da Folia, você verá a janela da Folia de Monstros aparecer. Tudo que precisa fazer é #bselecionar o que vocêe quer usar, e pressionar OK#k. Muito fácil, né?");
|
||||
} else {
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 62) {
|
||||
if (select == 0) {
|
||||
cm.sendNext("O que é a #bFolia de Monstros#k? Hahaha! Vamos dizer que é uma experiência que jamais esquecerá! É uma #bbatalha contra outros viajantes assim como você!#k");
|
||||
} else if (select == 1) {
|
||||
cm.sendNext("Quando entrar no Campo da Folia, sua tarefa é #breceber CP caçando os monstros do grupo oposto, e usar estes CP's para distrair o grupo oposto de caçar monstros.#k.");
|
||||
} else if (select == 2) {
|
||||
cm.sendNext("Assim que se acostumar com os comandos, tente usar #bas teclas TAB e F1 ~ F12#k. #bTAB alterna entre Invocação de Monstros/Habilidades/Protetor,#k e, #bF1~ F12 possibilita-o de acessar uma das janelas diretamente#k.");
|
||||
}
|
||||
} else if (status == 63) {
|
||||
if (select == 0) {
|
||||
cm.sendNext("Eu sei que é muito perigoso para vocês lutarem uns com os outros usando armas de verdade; e eu não sugeriria um ato tão barbárico. Não meu amigo, o que eu ofereço é competição. A emoção da batalha e a emoção de competir contra pessoas tão fortes e motivadas. Eu ofereço a premissa de que seu grupo e o grupo oposto ambos #binvoquem os monstros, e derrote os monstros invocados pelo grupo adversário. Essa é a essência da Folia de Monstros. Além disso, você pode usar Maple Coins ganhos durante a Folia de Monstros para obter novos itens e armas! #k");
|
||||
} else if (select == 1) {
|
||||
cm.sendNext("Existem 3 maneiras de distrair o grupo adversário: #bInvodar um monstro, Habilidade, and Protetor#k. Vou dar-lhe um olhar mais aprofundado, se você quiser saber mais sobre 'Instruções detalhadas'.");
|
||||
} else if (select == 2) {
|
||||
cm.sendNext("#bInvocar um Monstro#k chama um monstro que ataca o grupo adversário, sob seu controle. Use CP para trazer um Monstro Invocado, e ele irá aparecer na mesma área, atacando o grupo oposto.");
|
||||
}
|
||||
} else if (status == 64) {
|
||||
if (select == 0) {
|
||||
cm.sendNext("Claro, não é tão simples assim. Existem outras maneiras de prevenir o outro grupo de caçar monstros, e cabe a você descobrir como fazê-lo. O que acha? Interessado em uma competição amigável?");
|
||||
cm.dispose();
|
||||
} else if (select == 1) {
|
||||
cm.sendNext("Por favor lembre-se. Nunca é uma boa ideia guardar seus CP's. #bOs CP's que você usou irão ajudar a determinar o vencedor e o perdedor da Folia.");
|
||||
} else if (select == 2) {
|
||||
cm.sendNext("#bHabilidade#k é uma opção de usar habilidades tais como Escuridão, Fraqueza, e outras para prevenir o grupo oposto de matar outros monstros. São necessários muitos CP's, mas vale muito a pena. O único problema é que eles não duram muito. Use essa tática com sabedoria!");
|
||||
}
|
||||
} else if (status == 65) {
|
||||
if (select == 1) {
|
||||
cm.sendNext("Oh, e não se preocupe em tranformar-se em um fantasma. Na Folia de Monstros, #bvocê não perderá EXP após a morte#k. É realmente uma experência como nenhuma outra!");
|
||||
cm.dispose();
|
||||
} else if (select == 2) {
|
||||
cm.sendNext("#bProtetor#k é basicamente um item invocado que aumenta drásticamente as habilidades dos monstros invocados pelo seu grupo. Protetor funciona enquanto não for demolido pelo grupo oposto, então eu surigo que você invoque vários monstros primeiro, e então traga o Protetor.");
|
||||
}
|
||||
} else if (status == 66) {
|
||||
cm.sendNext("Por último, enquanto estiver na Folia de Monstros, #bvocê não pode usar items/poções de recuperação que você leva por ai contigo.#k Entretanto, os monstros deixam esses items cair de vez em quando, e #bassim que pegá-los, o item ativará imediatamente#k. É por isso que é importante saber quando pegar estes items.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
|
||||
|
||||
30
scripts/npc/2042003.js
Normal file
30
scripts/npc/2042003.js
Normal file
@@ -0,0 +1,30 @@
|
||||
var status = 0;
|
||||
var request;
|
||||
|
||||
function start() {
|
||||
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) {
|
||||
cm.warpParty(980000000);
|
||||
cm.cancelarSaida();
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
16
scripts/npc/2042004.js
Normal file
16
scripts/npc/2042004.js
Normal file
@@ -0,0 +1,16 @@
|
||||
var status = 0;
|
||||
var request;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
function action(mode, type, selection) {
|
||||
cm.warpParty(980000000);
|
||||
cm.cancelarSaida();
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
|
||||
83
scripts/npc/2042005.js
Normal file
83
scripts/npc/2042005.js
Normal file
@@ -0,0 +1,83 @@
|
||||
var map = 980030000;
|
||||
var minLvl = 30;
|
||||
var maxLvl = 255;
|
||||
var minAmt = 0;
|
||||
var maxAmt = 6;
|
||||
|
||||
function start() {
|
||||
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) {
|
||||
status = 10;
|
||||
cm.sendOk("#eÉ necessário criar um grupo antes de começar o Festival de Monstros!#k");
|
||||
} else if (!cm.isLeader()) {
|
||||
status = 10;
|
||||
cm.sendOk("Se você quer começar o Festival, avise o #blíder do grupo#k para falar comigo.");
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
var inMap = cm.partyMembersInMap();
|
||||
var lvlOk = 0;
|
||||
var isInMap = 0;
|
||||
for (var i = 0; i < party.size(); i++) {
|
||||
if (party.get(i).getLevel() >= minLvl && party.get(i).getLevel() <= maxLvl) {
|
||||
lvlOk++;
|
||||
}
|
||||
if (party.get(i).getPlayer().getMapId()!= 980030000) {
|
||||
//isInMap = false;
|
||||
isInMap++
|
||||
}
|
||||
}
|
||||
|
||||
if (party >= 1) {
|
||||
status = 10;
|
||||
cm.sendOk("Você não tem número suficiente de pessoas em seu grupo. Você precisa de um grupo com #b" + minAmt + "#k - #r" + maxAmt + "#k membros e eles devem estar no mapa com você.");
|
||||
} else if (lvlOk != inMap) {
|
||||
status = 10;
|
||||
cm.sendOk("Certifique se todos em seu grupo estão dentre os níveis corretos (" + minLvl + "~" + maxLvl + ")!");
|
||||
} else if (isInMap > 0) {
|
||||
status = 10;
|
||||
cm.sendOk("Existe alguém do grupo que não esta no mapa!");
|
||||
} else {
|
||||
cm.sendCPQMapLists2();
|
||||
}
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if (cm.fieldTaken2(selection)) {
|
||||
if (cm.fieldLobbied2(selection)) {
|
||||
cm.challengeParty2(selection);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("A sala esta cheia.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
var party = cm.getParty().getMembers();
|
||||
if ((selection === 0 || selection === 1 ) && party.size() < 2) {
|
||||
cm.sendOk("Você precisa de no mínimo 2 player para entrar na competição.");
|
||||
} else if ((selection === 2 ) && party.size() < 3) {
|
||||
cm.sendOk("Você precisa de no mínimo 3 player para entrar na competição.");
|
||||
} else {
|
||||
cm.cpqLobby2(selection);
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 11) {
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
132
scripts/npc/2042007.js
Normal file
132
scripts/npc/2042007.js
Normal file
@@ -0,0 +1,132 @@
|
||||
importPackage(net.sf.odinms.server.maps);
|
||||
|
||||
var status = 0;
|
||||
var rnk = -1;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (status >= 0 && mode == 0) {
|
||||
cm.sendOk("Alright then, I hope we can chat later next time.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (cm.getChar().getMap().isCPQLoserMap()) {
|
||||
if (status == 0) {
|
||||
if (cm.getChar().getParty() != null) {
|
||||
var shiu = "";
|
||||
if (cm.getPlayer().getFestivalPoints() >= 100) {
|
||||
shiu += "#rA#k";
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, apesar da sua excelente performance. A vitória pode ser sua da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
rnk = 10;
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
||||
shiu += "#rB#k";
|
||||
rnk = 20;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, mesmo com sua ótima performance. Só mais um pouquinho, e a vitória poderia ter sido sua.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 30 && cm.getPlayer().getFestivalPoints() < 50) {
|
||||
shiu += "#rC#k";
|
||||
rnk = 30;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha. A vitória está para aqueles que se esforçam. Vejo seus esforços, então a vitória não está tão longe do seu alcance. Continue assim!\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
} else {
|
||||
shiu += "#rD#k";
|
||||
rnk = 40;
|
||||
cm.sendOk("Infelizmente, você ou empatou ou perdeu a batalha, e sua performance claramente reflete nisso. Espero mais de você da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shiu);
|
||||
}
|
||||
} else {
|
||||
cm.warp(980030000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 1) {
|
||||
switch (rnk) {
|
||||
case 10:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(35000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 20:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(25000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 30:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(12500);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 40:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(3500);
|
||||
cm.dispose();
|
||||
break;
|
||||
default:
|
||||
cm.warp(980030000, 0);
|
||||
cm.dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (cm.getChar().getMap().isCPQWinnerMap()) {
|
||||
if (status == 0) {
|
||||
if (cm.getChar().getParty() != null) {
|
||||
var shi = "";
|
||||
if (cm.getPlayer().getFestivalPoints() >= 300) {
|
||||
shi += "#rA#k";
|
||||
rnk = 1;
|
||||
cm.sendOk("Parabéns pela sua vitória!!! Que ótima performance! O grupo adversário não pôde fazer nada! Espero o mesmo bom trabalho da próxima vez!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 100 && cm.getPlayer().getFestivalPoints() < 300) {
|
||||
shi += "#rB#k";
|
||||
rnk = 2;
|
||||
cm.sendOk("Parabéns pela sua vitória! Isso foi impressionante! Você fez um bom trabalho contra o grupo adversário! Só mais um pouco, e você definitivamente vai conseguir um A na próxima vez. \r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else if (cm.getPlayer().getFestivalPoints() >= 50 && cm.getPlayer().getFestivalPoints() < 100) {
|
||||
shi += "#rC#k";
|
||||
rnk = 3;
|
||||
cm.sendOk("Parabéns pela sua vitória. Você fez algumas coisas cá e lá, mas essa não pode ser considerada uma boa vitória. Espero mais de ti da próxima vez.\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
} else {
|
||||
shi += "#rD#k";
|
||||
rnk = 4;
|
||||
cm.sendOk("Parabéns pela sua vitória, entretanto sua performance não refletiu muito bem isso. Seja mais ativo na sua próxima participação da Folia de Monstros!\r\n\r\n#bNota da Folia de Monstros : " + shi);
|
||||
}
|
||||
} else {
|
||||
cm.warp(980030000, 0);
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (status == 1) {
|
||||
switch (rnk) {
|
||||
case 1:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(875000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 2:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(700000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 3:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(555000);
|
||||
cm.dispose();
|
||||
break;
|
||||
case 4:
|
||||
cm.warp(980030000, 0);
|
||||
cm.gainExp(100000);
|
||||
cm.dispose();
|
||||
break;
|
||||
default:
|
||||
cm.warp(980030000, 0);
|
||||
cm.dispose();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
30
scripts/npc/2042008.js
Normal file
30
scripts/npc/2042008.js
Normal file
@@ -0,0 +1,30 @@
|
||||
var status = 0;
|
||||
var request;
|
||||
|
||||
function start() {
|
||||
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) {
|
||||
cm.warpParty(980030000, 4);
|
||||
cm.cancelarSaida();
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
30
scripts/npc/2042009.js
Normal file
30
scripts/npc/2042009.js
Normal file
@@ -0,0 +1,30 @@
|
||||
var status = 0;
|
||||
var request;
|
||||
|
||||
function start() {
|
||||
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) {
|
||||
cm.warpParty(980030000, 4);
|
||||
cm.cancelarSaida();
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2017 RonanLana
|
||||
|
||||
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/>.
|
||||
*/
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2017 RonanLana
|
||||
|
||||
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/>.
|
||||
*/
|
||||
/* High Priest John
|
||||
Marriage NPC
|
||||
Marriage NPC
|
||||
*/
|
||||
|
||||
importPackage(Packages.constants);
|
||||
@@ -40,14 +40,14 @@ function isWeddingIndoors(mapid) {
|
||||
|
||||
function getMarriageInstance(player) {
|
||||
var em = cm.getEventManager(weddingEventName);
|
||||
|
||||
for (var iterator = em.getInstances().iterator(); iterator.hasNext();) {
|
||||
|
||||
for (var iterator = em.getInstances().iterator(); iterator.hasNext(); ) {
|
||||
var eim = iterator.next();
|
||||
if(eim.isEventLeader(player)) {
|
||||
if (eim.isEventLeader(player)) {
|
||||
return eim;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ function detectPlayerItemid(player) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -67,31 +67,35 @@ function getRingId(boxItemId) {
|
||||
|
||||
function isSuitedForWedding(player, equipped) {
|
||||
var baseid = (player.getGender() == 0) ? 1050131 : 1051150;
|
||||
|
||||
if(equipped) {
|
||||
for(var i = 0; i < 4; i++) {
|
||||
if(player.haveItemEquipped(baseid + i)) {
|
||||
|
||||
if (equipped) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
if (player.haveItemEquipped(baseid + i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(var i = 0; i < 4; i++) {
|
||||
if(player.haveItemWithId(baseid + i, true)) {
|
||||
for (var i = 0; i < 4; i++) {
|
||||
if (player.haveItemWithId(baseid + i, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getWeddingPreparationStatus(player, partner) {
|
||||
if(!player.haveItem(4000313)) return -3;
|
||||
if(!partner.haveItem(4000313)) return 3;
|
||||
|
||||
if(!isSuitedForWedding(player, true)) return -4;
|
||||
if(!isSuitedForWedding(partner, true)) return 4;
|
||||
|
||||
if (!player.haveItem(4000313))
|
||||
return -3;
|
||||
if (!partner.haveItem(4000313))
|
||||
return 3;
|
||||
|
||||
if (!isSuitedForWedding(player, true))
|
||||
return -4;
|
||||
if (!isSuitedForWedding(partner, true))
|
||||
return 4;
|
||||
|
||||
var hasEngagement = false;
|
||||
for (var x = 4031357; x <= 4031364; x++) {
|
||||
if (player.haveItem(x)) {
|
||||
@@ -99,7 +103,8 @@ function getWeddingPreparationStatus(player, partner) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasEngagement) return -1;
|
||||
if (!hasEngagement)
|
||||
return -1;
|
||||
|
||||
hasEngagement = false;
|
||||
for (var x = 4031357; x <= 4031364; x++) {
|
||||
@@ -108,24 +113,28 @@ function getWeddingPreparationStatus(player, partner) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasEngagement) return -2;
|
||||
if (!hasEngagement)
|
||||
return -2;
|
||||
|
||||
if(!player.canHold(1112803)) return 1;
|
||||
if(!partner.canHold(1112803)) return 2;
|
||||
if (!player.canHold(1112803))
|
||||
return 1;
|
||||
if (!partner.canHold(1112803))
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function giveCoupleBlessings(eim, player, partner) {
|
||||
var blessCount = eim.gridSize();
|
||||
|
||||
|
||||
player.gainExp(blessCount * weddingBlessingExp);
|
||||
partner.gainExp(blessCount * weddingBlessingExp);
|
||||
}
|
||||
|
||||
function start() {
|
||||
function start() {
|
||||
weddingIndoors = isWeddingIndoors(cm.getMapId());
|
||||
if(weddingIndoors) eim = cm.getEventInstance();
|
||||
if (weddingIndoors)
|
||||
eim = cm.getEventInstance();
|
||||
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
@@ -144,8 +153,8 @@ function action(mode, type, selection) {
|
||||
else
|
||||
status--;
|
||||
|
||||
if(!weddingIndoors) {
|
||||
if(status == 0) {
|
||||
if (!weddingIndoors) {
|
||||
if (status == 0) {
|
||||
var hasEngagement = false;
|
||||
for (var x = 4031357; x <= 4031364; x++) {
|
||||
if (cm.haveItem(x, 1)) {
|
||||
@@ -154,7 +163,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
}
|
||||
|
||||
if(hasEngagement) {
|
||||
if (hasEngagement) {
|
||||
var text = "Hi there. How can I help you?";
|
||||
var choice = new Array("We're ready to get married.");
|
||||
for (x = 0; x < choice.length; x++) {
|
||||
@@ -165,32 +174,32 @@ function action(mode, type, selection) {
|
||||
cm.sendOk("Hmm, today two fluttering hearts are about to be joined together by the blessings of love!");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if(status == 1) {
|
||||
} else if (status == 1) {
|
||||
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
|
||||
var cserv = cm.getClient().getChannelServer();
|
||||
|
||||
if(cserv.isWeddingReserved(wid)) {
|
||||
if(wid == cserv.getOngoingWedding(cathedralWedding)) {
|
||||
if (cserv.isWeddingReserved(wid)) {
|
||||
if (wid == cserv.getOngoingWedding(cathedralWedding)) {
|
||||
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
|
||||
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
|
||||
if(!cm.canHold(4000313)) {
|
||||
if (!(partner == null || !cm.getMap().equals(partner.getMap()))) {
|
||||
if (!cm.canHold(4000313)) {
|
||||
cm.sendOk("Please have a free ETC slot available to get the #b#t4000313##k.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if(!partner.canHold(4000313)) {
|
||||
} else if (!partner.canHold(4000313)) {
|
||||
cm.sendOk("Please let your partner know they must have a free ETC slot available to get the #b#t4000313##k.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if(!isSuitedForWedding(cm.getPlayer(), false)) {
|
||||
} else if (!isSuitedForWedding(cm.getPlayer(), false)) {
|
||||
cm.sendOk("Please purchase a #rwedding garment#k for the ceremony, quickly! Without it I am not able to marry you.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if(!isSuitedForWedding(partner, false)) {
|
||||
} else if (!isSuitedForWedding(partner, false)) {
|
||||
cm.sendOk("Please let your partner know they must have a #rwedding garment#k ready for the ceremony.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
cm.sendOk("Very well, the preparatives here are finished too. This indeed is a beautiful day, you two are truly blessed to marry on such a day. Let us begin the marriage!!");
|
||||
} else {
|
||||
cm.sendOk("Hmm, it seems your partner is elsewhere... Please let them come here before starting the ceremony.");
|
||||
@@ -206,19 +215,19 @@ function action(mode, type, selection) {
|
||||
cm.sendOk("Hmm, I'm sorry but there are no reservations made for you at this channel for the time being.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if(status == 2) {
|
||||
} else if (status == 2) {
|
||||
var cserv = cm.getClient().getChannelServer();
|
||||
var wtype = cserv.getOngoingWeddingType(cathedralWedding);
|
||||
|
||||
|
||||
var partner = cserv.getPlayerStorage().getCharacterById(cm.getPlayer().getPartnerId());
|
||||
if(!(partner == null || !cm.getMap().equals(partner.getMap()))) {
|
||||
if(cserv.acceptOngoingWedding(cathedralWedding)) {
|
||||
if (!(partner == null || !cm.getMap().equals(partner.getMap()))) {
|
||||
if (cserv.acceptOngoingWedding(cathedralWedding)) {
|
||||
var wid = cm.getClient().getWorldServer().getRelationshipId(cm.getPlayer().getId());
|
||||
if(wid > 0) {
|
||||
if (wid > 0) {
|
||||
var em = cm.getEventManager(weddingEventName);
|
||||
if(em.startInstance(cm.getPlayer())) {
|
||||
if (em.startInstance(cm.getPlayer())) {
|
||||
eim = getMarriageInstance(cm.getPlayer());
|
||||
if(eim != null) {
|
||||
if (eim != null) {
|
||||
eim.setIntProperty("weddingId", wid);
|
||||
eim.setIntProperty("groomId", cm.getPlayer().getId());
|
||||
eim.setIntProperty("brideId", cm.getPlayer().getPartnerId());
|
||||
@@ -248,20 +257,20 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else {
|
||||
if (status == 0) {
|
||||
if(eim == null) {
|
||||
cm.warp(680000000,0);
|
||||
if (eim == null) {
|
||||
cm.warp(680000000, 0);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var playerId = cm.getPlayer().getId();
|
||||
if(playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) {
|
||||
if (playerId == eim.getIntProperty("groomId") || playerId == eim.getIntProperty("brideId")) {
|
||||
var wstg = eim.getIntProperty("weddingStage");
|
||||
|
||||
if(wstg == 2) {
|
||||
|
||||
if (wstg == 2) {
|
||||
cm.sendYesNo("Very well, the guests has bestowed all their blessings to you now. The time has come, #rshould I make you Husband and Wife#k?");
|
||||
state = 1;
|
||||
} else if(wstg == 1) {
|
||||
} else if (wstg == 1) {
|
||||
cm.sendOk("While you two are making your wedding vows to each other, your guests are currently giving their blessings to you. This is a time of happiness for both of you, please rejoice the ceremony.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
@@ -270,12 +279,12 @@ function action(mode, type, selection) {
|
||||
}
|
||||
} else {
|
||||
var wstg = eim.getIntProperty("weddingStage");
|
||||
if(wstg == 1) {
|
||||
if(eim.gridCheck(cm.getPlayer()) != -1) {
|
||||
if (wstg == 1) {
|
||||
if (eim.gridCheck(cm.getPlayer()) != -1) {
|
||||
cm.sendOk("Everyone give your blessings to this lovely couple!");
|
||||
cm.dispose();
|
||||
} else {
|
||||
if(eim.getIntProperty("guestBlessings") == 1) {
|
||||
if (eim.getIntProperty("guestBlessings") == 1) {
|
||||
cm.sendYesNo("Do you want to bless this couple?");
|
||||
state = 0;
|
||||
} else {
|
||||
@@ -283,7 +292,7 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
} else if(wstg == 3) {
|
||||
} else if (wstg == 3) {
|
||||
cm.sendOk("The two loving birds are now married. What a lively day! Please #rget ready for the afterparty#k, it should start soon. Follow the married couple's lead.");
|
||||
cm.dispose();
|
||||
} else {
|
||||
@@ -292,10 +301,10 @@ function action(mode, type, selection) {
|
||||
}
|
||||
}
|
||||
} else if (status == 1) {
|
||||
if(state == 0) { // give player blessings
|
||||
if (state == 0) { // give player blessings
|
||||
eim.gridInsert(cm.getPlayer(), 1);
|
||||
|
||||
if(ServerConstants.WEDDING_BLESSER_SHOWFX) {
|
||||
|
||||
if (ServerConstants.WEDDING_BLESSER_SHOWFX) {
|
||||
var target = cm.getPlayer();
|
||||
target.announce(MaplePacketCreator.showSpecialEffect(9));
|
||||
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
|
||||
@@ -308,15 +317,15 @@ function action(mode, type, selection) {
|
||||
target.announce(MaplePacketCreator.showSpecialEffect(9));
|
||||
target.getMap().broadcastMessage(target, MaplePacketCreator.showForeignEffect(target.getId(), 9), false);
|
||||
}
|
||||
|
||||
|
||||
cm.sendOk("Your blessings have been added to their love. What a noble act for a lovely couple!");
|
||||
cm.dispose();
|
||||
} else { // couple wants to complete the wedding
|
||||
var wstg = eim.getIntProperty("weddingStage");
|
||||
|
||||
if(wstg == 2) {
|
||||
|
||||
if (wstg == 2) {
|
||||
var pid = cm.getPlayer().getPartnerId();
|
||||
if(pid <= 0) {
|
||||
if (pid <= 0) {
|
||||
cm.sendOk("It seems you are no longer engaged to your partner, just before the altar... Where did all that happiness you two had sported a while ago went?");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -324,14 +333,14 @@ function action(mode, type, selection) {
|
||||
|
||||
var player = cm.getPlayer();
|
||||
var partner = cm.getMap().getCharacterById(cm.getPlayer().getPartnerId());
|
||||
if(partner != null) {
|
||||
if (partner != null) {
|
||||
state = getWeddingPreparationStatus(player, partner);
|
||||
|
||||
switch(state) {
|
||||
switch (state) {
|
||||
case 0:
|
||||
var pid = eim.getIntProperty("confirmedVows");
|
||||
if(pid != -1) {
|
||||
if(pid == player.getId()) {
|
||||
if (pid != -1) {
|
||||
if (pid == player.getId()) {
|
||||
cm.sendOk("You have already confirmed your vows. All that is left is for your partner to confirm now.");
|
||||
} else {
|
||||
eim.setIntProperty("weddingStage", 3);
|
||||
@@ -362,7 +371,7 @@ function action(mode, type, selection) {
|
||||
eim.setIntProperty("confirmedVows", player.getId());
|
||||
cm.getMap().dropMessage(6, "Wedding Assistant: " + player.getName() + " has confirmed vows! Alright, one step away to make it official. Tighten your seatbelts!");
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case -1:
|
||||
@@ -376,7 +385,7 @@ function action(mode, type, selection) {
|
||||
case -3:
|
||||
cm.sendOk("It seems you don't have the #r#t4000313##k given at the entrance... Please find it, I can't marry you without that item in hands.");
|
||||
break;
|
||||
|
||||
|
||||
case -4:
|
||||
cm.sendOk("Pardon my rudiness, but the garments are a essential part of the ceremony. Please #rsuit yourself properly#k for a wedding.");
|
||||
break;
|
||||
@@ -392,7 +401,7 @@ function action(mode, type, selection) {
|
||||
case 3:
|
||||
cm.sendOk("It seems your partner don't have the #r#t4000313##k given at the entrance... Please find it, I can't marry you without that item in hands.");
|
||||
break;
|
||||
|
||||
|
||||
case 4:
|
||||
cm.sendOk("It seems your partner is not properly dressed for the wedding... Pardon my rudiness, but the garments are a essential part of the ceremony.");
|
||||
break;
|
||||
|
||||
@@ -50,6 +50,7 @@ function action(mode, type, selection) {
|
||||
var eim = cm.getEventInstance();
|
||||
if(eim == null) {
|
||||
cm.warp(680000000,0);
|
||||
//cm.criarLista();
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
@@ -71,7 +72,7 @@ function action(mode, type, selection) {
|
||||
cm.sendOk("Congratulations on your wedding. Please talk to #b#p9201007##k to start the afterparty.");
|
||||
cm.dispose();
|
||||
} else if(hasEngagement) {
|
||||
cm.sendOk("Please continue with the wedding.");
|
||||
cm.criarLista();
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("You do not have the required item to continue through this wedding. Unfortunately, it's over...");
|
||||
|
||||
@@ -27,75 +27,25 @@
|
||||
1.0 - First Version by Angel
|
||||
2.0 - Second Version by happydud3 & XotiCraze
|
||||
3.0 - Third Version by RonanLana (HeavenMS)
|
||||
4.0 - Four Version bby Drago(MapleStorySA)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
**/
|
||||
|
||||
var bgPrizes = [[2022179,10], [2022282,10], [2210005,5], [2210003,5]];
|
||||
var cmPrizes = [[2022011,10], [2000005,50], [2022273,10], [2022179,3]];
|
||||
|
||||
var status;
|
||||
var status = -1;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1 || mode == 0) {
|
||||
cm.sendOk("Goodbye then.");
|
||||
cm.dispose();
|
||||
return;
|
||||
} else if (mode == 1) {
|
||||
function action(mode, type, selection) {
|
||||
if (mode == 1) {
|
||||
status++;
|
||||
} else {
|
||||
status--;
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
if (status == 0) {
|
||||
var msg = "Hello I exchange Onyx Chest for Bride and Groom and the Onyx Chest for prizes!#b";
|
||||
var choice1 = new Array("I have an Onyx Chest for Bride and Groom", "I have an Onyx Chest");
|
||||
for (var i = 0; i < choice1.length; i++) {
|
||||
msg += "\r\n#L" + i + "#" + choice1[i] + "#l";
|
||||
}
|
||||
cm.sendSimple(msg);
|
||||
} else if (status == 1) {
|
||||
if (selection == 0) {
|
||||
if (cm.haveItem(4031424)) {
|
||||
if (cm.getPlayer().isMarried()) { // thanks MedicOP for solving an issue here
|
||||
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
|
||||
var rand = Math.floor(Math.random() * bgPrizes.length);
|
||||
cm.gainItem(bgPrizes[rand][0], bgPrizes[rand][1]);
|
||||
|
||||
cm.gainItem(4031424,-1);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("You don't have a free USE slot right now.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You must be married to claim the prize for this box.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You don't have an Onyx Chest for Bride and Groom.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else if (selection == 1) {
|
||||
if (cm.haveItem(4031423)) {
|
||||
if(cm.getInventory(2).getNextFreeSlot() >= 0) {
|
||||
var rand = Math.floor(Math.random() * cmPrizes.length);
|
||||
cm.gainItem(cmPrizes[rand][0], cmPrizes[rand][1]);
|
||||
|
||||
cm.gainItem(4031423,-1);
|
||||
cm.dispose();
|
||||
} else {
|
||||
cm.sendOk("You don't have a free USE slot right now.");
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("You don't have an Onyx Chest.");
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
cm.enviarLista();
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
54
scripts/npc/cpqchallenge.js
Normal file
54
scripts/npc/cpqchallenge.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/* global cm */
|
||||
|
||||
var status = 0;
|
||||
var party;
|
||||
|
||||
function start(chrs) {
|
||||
status = -1;
|
||||
party = chrs;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.getChar().setChallenged(false);
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0) {
|
||||
cm.sendOk("Come back once you have thought about it some more.");
|
||||
cm.getChar().setChallenged(false);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mode == -1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
if (cm.getParty().getMembers().size() == party.size()) {
|
||||
cm.getPlayer().setChallenged(true);
|
||||
var snd = "";
|
||||
for (var i = 0; i < party.size(); i++)
|
||||
snd += "#bNome: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + party.get(i).getJobNameById(party.get(i).getJobId()) + "#k\r\n\r\n";
|
||||
cm.sendAcceptDecline(snd + "Gostaria de lutar contra este grupo no Festival de Monstros?");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else if (status == 1) {
|
||||
var ch = cm.getChrById(party.get(0).getId());
|
||||
if (party.size() == cm.getParty().getMembers().size()) {
|
||||
cm.startCPQ(ch, ch.getMapId() + 1);
|
||||
ch.getParty().setEnemy(cm.getPlayer().getParty());
|
||||
cm.getChar().getParty().setEnemy(ch.getParty());
|
||||
cm.getChar().setChallenged(false);
|
||||
} else {
|
||||
cm.sendOk("O numero de players entre os times não esta igual.");
|
||||
}
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
scripts/npc/cpqchallenge2.js
Normal file
48
scripts/npc/cpqchallenge2.js
Normal file
@@ -0,0 +1,48 @@
|
||||
var status = 0;
|
||||
var party;
|
||||
|
||||
function start(chrs) {
|
||||
status = -1;
|
||||
party = chrs;
|
||||
action(1, 0, 0);
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
if (mode == -1) {
|
||||
cm.getChar().setChallenged(false);
|
||||
cm.dispose();
|
||||
} else {
|
||||
if (mode == 0) {
|
||||
cm.sendOk("Come back once you have thought about it some more.");
|
||||
cm.getChar().setChallenged(false);
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (mode == -1)
|
||||
cm.dispose();
|
||||
else {
|
||||
if (mode == 1)
|
||||
status++;
|
||||
else
|
||||
status--;
|
||||
if (status == 0) {
|
||||
if (cm.getParty().getMembers().size() == party.size()) {
|
||||
cm.getPlayer().setChallenged(true);
|
||||
var snd = "";
|
||||
for (var i = 0; i < party.size(); i++)
|
||||
snd += "#bNome: " + party.get(i).getName() + " / (Level: " + party.get(i).getLevel() + ") / " + party.get(i).getJobNameById(party.get(i).getJobId()) + "#k\r\n\r\n";
|
||||
cm.sendAcceptDecline(snd + "Gostaria de lutar contra este grupo no Festival de Monstros?");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else if (status == 1) {
|
||||
var ch = cm.getChrById(party.get(0).getId());
|
||||
cm.startCPQ2(ch, ch.getMapId() + 1);
|
||||
ch.getParty().setEnemy(cm.getPlayer().getParty());
|
||||
cm.getChar().getParty().setEnemy(ch.getParty());
|
||||
cm.getChar().setChallenged(false);
|
||||
cm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
8
scripts/portal/MC2revive.js
Normal file
8
scripts/portal/MC2revive.js
Normal file
@@ -0,0 +1,8 @@
|
||||
function enter(pi) {
|
||||
if ( pi.getPlayer().getTeam() == 0 ) {
|
||||
pi.warp( pi.getMapId() - 100);
|
||||
} else {
|
||||
pi.warp( pi.getMapId() - 100);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
10
scripts/portal/MCRevive1.js
Normal file
10
scripts/portal/MCRevive1.js
Normal file
@@ -0,0 +1,10 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.warp(980000101, 0);
|
||||
return true;
|
||||
}
|
||||
10
scripts/portal/MCRevive2.js
Normal file
10
scripts/portal/MCRevive2.js
Normal file
@@ -0,0 +1,10 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.warp(980000201, 0);
|
||||
return true;
|
||||
}
|
||||
19
scripts/portal/MCRevive3.js
Normal file
19
scripts/portal/MCRevive3.js
Normal file
@@ -0,0 +1,19 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
var portal = 0;
|
||||
switch (pi.getPlayer().getTeam()) {
|
||||
case 0:
|
||||
portal = 4;
|
||||
break;
|
||||
case 1:
|
||||
portal = 3;
|
||||
break;
|
||||
}
|
||||
pi.warp(980000301, portal);
|
||||
return true;
|
||||
}
|
||||
19
scripts/portal/MCRevive4.js
Normal file
19
scripts/portal/MCRevive4.js
Normal file
@@ -0,0 +1,19 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
var portal = 0;
|
||||
switch (pi.getPlayer().getTeam()) {
|
||||
case 0:
|
||||
portal = 4;
|
||||
break;
|
||||
case 1:
|
||||
portal = 3;
|
||||
break;
|
||||
}
|
||||
pi.warp(980000401, portal);
|
||||
return true;
|
||||
}
|
||||
10
scripts/portal/MCRevive5.js
Normal file
10
scripts/portal/MCRevive5.js
Normal file
@@ -0,0 +1,10 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.warp(980000501, 0);
|
||||
return true;
|
||||
}
|
||||
10
scripts/portal/MCRevive6.js
Normal file
10
scripts/portal/MCRevive6.js
Normal file
@@ -0,0 +1,10 @@
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
/*
|
||||
[CelticMS] Monster Carnival Reviving Field 1
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.warp(980000601, 0);
|
||||
return true;
|
||||
}
|
||||
@@ -1,28 +1,35 @@
|
||||
/*
|
||||
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 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/>.
|
||||
*/
|
||||
|
||||
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.
|
||||
importPackage(Packages.server.maps);
|
||||
|
||||
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: kevintjuh93
|
||||
*/
|
||||
*/
|
||||
|
||||
function enter(pi) {
|
||||
pi.playPortalSound(); pi.warp(pi.getPlayer().getSavedLocation("MIRROR"));
|
||||
var returnMap = pi.getPlayer().getSavedLocation("MONSTER_CARNIVAL");
|
||||
if (returnMap < 0) {
|
||||
returnMap = 102000000; // Just Incase there is no saved location.
|
||||
}
|
||||
var target = pi.getPlayer().getClient().getChannelServer().getMapFactory().getMap(returnMap);
|
||||
pi.getPlayer().changeMap(target);
|
||||
return true;
|
||||
}
|
||||
@@ -1,28 +1,3 @@
|
||||
/*
|
||||
* 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 kevintjuh93
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getReactor().removeMonsterStatus();
|
||||
rm.dispelAllMonsters(parseInt(rm.getReactor().getName().substring(1,2)), parseInt(rm.getReactor().getName().substring(0,1)));
|
||||
}
|
||||
@@ -1,28 +1,3 @@
|
||||
/*
|
||||
* 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 kevintjuh93
|
||||
*/
|
||||
|
||||
function act() {
|
||||
rm.getReactor().removeMonsterStatus();
|
||||
rm.dispelAllMonsters(parseInt(rm.getReactor().getName().substring(1,2)), parseInt(rm.getReactor().getName().substring(0,1)));
|
||||
}
|
||||
Reference in New Issue
Block a user