Show HH/CT damage + Miniroom patch + Removed redundant skillbook drops
Added a server flag to allow solo expeditions. Added a server flag that allows short-lengthened cooldown on Hero's Will skill. Added recipes for Advanced Mob Crystal 2 and 3 (level 120 and 130) within Etc Maker. Fixed Heaven's Hammer and Combo Tempest not displaying damage dealt value. Fixed some minor PE exploits with players being allowed to create minirooms while dead or inside an event. Adjusted item dropped from mobs to now allow visible quest items appear before not-visible ones, thus showing no "empty spaces" when the mob has multiple quest drops. Fixed Horntail not attributing quest progress for "The Last Hour of Horntail" quest. Attribution only happens inside the expedition. Removed unnecessary skill books from the drop data, since quests for them were recently implemented.
This commit is contained in:
@@ -92,7 +92,11 @@ function clearPQ(eim) {
|
||||
em.setProperty("noEntry","false");
|
||||
}
|
||||
|
||||
function monsterKilled(mob, eim) {}
|
||||
function monsterKilled(mob, eim) {
|
||||
if(eim.getInstanceMap(entryMap).countMonsters() == 0) {
|
||||
eim.showClearEffect();
|
||||
}
|
||||
}
|
||||
|
||||
function monsterValue(eim, mobId) {
|
||||
return 1;
|
||||
|
||||
@@ -214,6 +214,7 @@ function monsterKilled(mob, eim) {
|
||||
eim.showClearEffect(mob.getMap().getId());
|
||||
eim.clearPQ();
|
||||
|
||||
eim.dispatchUpdateQuestMobCount(8810018, 240060200);
|
||||
mob.getMap().broadcastHorntailVictory();
|
||||
} else if(isHorntailHead(mob)) {
|
||||
var killed = eim.getIntProperty("defeatedHead");
|
||||
|
||||
@@ -54,7 +54,15 @@ function start() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && parseInt(cm.getJobId() / 100) == 1)){
|
||||
var jobBase = parseInt(cm.getJobId() / 100);
|
||||
var jobStyle = 1;
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle)){
|
||||
if(cm.getPlayer().getLevel() >= 70 && jobBase % 10 == jobStyle) {
|
||||
status++;
|
||||
action(1, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -134,6 +142,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendNext("Ok, go.");
|
||||
if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendNext("You're weak.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -26,11 +26,19 @@ var sel;
|
||||
actionx = {"Mental" : false, "Physical" : false};
|
||||
|
||||
function start() {
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && parseInt(cm.getJobId() / 100) == 2)){
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var jobBase = parseInt(cm.getJobId() / 100);
|
||||
var jobStyle = 2;
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle)){
|
||||
if(cm.getPlayer().getLevel() >= 70 && jobBase % 10 == jobStyle) {
|
||||
status++;
|
||||
action(1, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.haveItem(4031058))
|
||||
actionx["Mental"] = true;
|
||||
else if (cm.haveItem(4031057))
|
||||
@@ -106,6 +114,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendNext("Ok, go.");
|
||||
if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendNext("You're weak.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -28,11 +28,19 @@ var sel;
|
||||
actionx = {"Mental" : false, "Physical" : false};
|
||||
|
||||
function start() {
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && parseInt(cm.getJobId() / 100) == 3)){
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
var jobBase = parseInt(cm.getJobId() / 100);
|
||||
var jobStyle = 3;
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle)){
|
||||
if(cm.getPlayer().getLevel() >= 70 && jobBase % 10 == jobStyle) {
|
||||
status++;
|
||||
action(1, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
}
|
||||
if (cm.haveItem(4031058))
|
||||
actionx["Mental"] = true;
|
||||
else if (cm.haveItem(4031057))
|
||||
@@ -107,6 +115,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendNext("Ok, go.");
|
||||
if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendNext("You're weak.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -26,7 +26,15 @@ var sel;
|
||||
actionx = {"Mental" : false, "Physical" : false};
|
||||
|
||||
function start() {
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && parseInt(cm.getJobId() / 100) == 4)){
|
||||
var jobBase = parseInt(cm.getJobId() / 100);
|
||||
var jobStyle = 4;
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle)){
|
||||
if(cm.getPlayer().getLevel() >= 70 && jobBase % 10 == jobStyle) {
|
||||
status++;
|
||||
action(1, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -106,6 +114,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendNext("Ok, go.");
|
||||
if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendNext("You're weak.");
|
||||
cm.dispose();
|
||||
|
||||
@@ -26,7 +26,15 @@ var sel;
|
||||
actionx = {"Mental" : false, "Physical" : false};
|
||||
|
||||
function start() {
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && parseInt(cm.getJobId() / 100) == 5)){
|
||||
var jobBase = parseInt(cm.getJobId() / 100);
|
||||
var jobStyle = 5;
|
||||
if (!(cm.getPlayer().getLevel() >= 70 && jobBase == jobStyle)){
|
||||
if(cm.getPlayer().getLevel() >= 70 && jobBase % 10 == jobStyle) {
|
||||
status++;
|
||||
action(1, 0, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
cm.sendNext("Hi there.");
|
||||
cm.dispose();
|
||||
return;
|
||||
@@ -105,6 +113,7 @@ function action(mode, type, selection){
|
||||
if (cm.getPlayer().getLevel() >= 50){
|
||||
cm.sendNext("Ok, go.");
|
||||
if(!cm.isQuestStarted(100200)) cm.startQuest(100200);
|
||||
if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS && !cm.isQuestCompleted(100201)) cm.completeQuest(100201);
|
||||
}else
|
||||
cm.sendNext("You're weak.");
|
||||
cm.dispose();
|
||||
|
||||
226
scripts/npc/2042001.js
Normal file
226
scripts/npc/2042001.js
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 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/>.
|
||||
*/
|
||||
/* 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);
|
||||
}
|
||||
|
||||
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) {
|
||||
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.");
|
||||
}
|
||||
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) && 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);
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
} else {
|
||||
for(j = 4021000; j < 4021009; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
}
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
226
scripts/npc/2042002.js
Normal file
226
scripts/npc/2042002.js
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 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/>.
|
||||
*/
|
||||
/* 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);
|
||||
}
|
||||
|
||||
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) {
|
||||
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.");
|
||||
}
|
||||
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) && 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);
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
} else {
|
||||
for(j = 4021000; j < 4021009; j++) {
|
||||
cm.gainItem(j, -refineQty);
|
||||
}
|
||||
cm.gainItem(j, refineQty);
|
||||
}
|
||||
|
||||
break;
|
||||
} else if(refineQty <= 1) {
|
||||
allDone = false;
|
||||
break;
|
||||
} else {
|
||||
refineQty--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return allDone;
|
||||
}
|
||||
@@ -24,10 +24,6 @@
|
||||
*/
|
||||
|
||||
var status = 0;
|
||||
var minLevel = 80;
|
||||
var maxLevel = 255;
|
||||
var minPlayers = 1;
|
||||
var maxPlayers = 6;
|
||||
|
||||
function start() {
|
||||
status = -1;
|
||||
@@ -49,6 +45,13 @@ function action(mode, type, selection) {
|
||||
if (status == 0) {
|
||||
if(cm.haveItem(4001086)) {
|
||||
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
|
||||
} else if(Packages.constants.ServerConstants.USE_ENABLE_SOLO_EXPEDITIONS) {
|
||||
if(canBypassHTPQ()) {
|
||||
cm.sendYesNo("Do you want to access #b#m240050400##k right now?");
|
||||
} else {
|
||||
cm.sendOk("Those who don't have the #r#t4001086##k must prove their valor before challenging #bHorntail#k. Come here holding the #r3 certificates#k that proves you're worthy to || the task."); // NPC picture is so long it goes through some section of text, || to fill up that space
|
||||
cm.dispose();
|
||||
}
|
||||
} else {
|
||||
cm.sendOk("Those who don't have the #r#t4001086##k must prove their valor before challenging #bHorntail#k.");
|
||||
cm.dispose();
|
||||
@@ -60,5 +63,7 @@ function action(mode, type, selection) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function canBypassHTPQ() {
|
||||
return cm.haveItem(4001083) && cm.haveItem(4001084) && cm.haveItem(4001085);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ function action(mode, type, selection) {
|
||||
cm.dispose();
|
||||
} else if(state == 2) {
|
||||
var restSpot = ((cm.getMapId() - 1) % 5) + 1;
|
||||
cm.getPlayer().getEventInstance().addEventTimer(restSpot * 4 * 60000); // adds (restspot number * 4) minutes
|
||||
cm.getPlayer().getEventInstance().restartEventTimer(restSpot * 4 * 60000); // adds (restspot number * 4) minutes
|
||||
cm.getPlayer().getEventInstance().warpEventTeam(970030100 + cm.getEventInstance().getIntProperty("lobby") + (500 * restSpot));
|
||||
|
||||
cm.dispose();
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
importPackage(Packages.client);
|
||||
|
||||
var status = -1;
|
||||
|
||||
function start(mode, type, selection) {
|
||||
if(qm.getPlayer().getMeso() >= 1000000) {
|
||||
if(qm.canHold(2022337, 1)) {
|
||||
@@ -48,21 +50,36 @@ function usedPotion(ch) {
|
||||
}
|
||||
|
||||
function end(mode, type, selection) {
|
||||
if(!usedPotion(qm.getPlayer())) {
|
||||
if(qm.haveItem(2022337)) {
|
||||
qm.sendOk("Are you scared to drink the potion? I can assure you it has only a minor #rside effect#k.");
|
||||
} else {
|
||||
if(qm.canHold(2022337)) {
|
||||
qm.gainItem(2022337, 1);
|
||||
qm.sendOk("Lost it? Luckily for you I managed to recover it back. Take it.");
|
||||
} else {
|
||||
qm.sendOk("Lost it? Luckily for you I managed to recover it back. Make a room to get it.");
|
||||
}
|
||||
}
|
||||
if (mode == 0 && type == 0) {
|
||||
status--;
|
||||
} else if (mode == -1) {
|
||||
qm.dispose();
|
||||
return;
|
||||
} else {
|
||||
qm.sendOk("It seems the potion worked and your emotions are no longer frozen. And, oh, my... You're ailing bad, #bpurge#k that out quickly.");
|
||||
qm.gainExp(891500 * qm.getPlayer().getExpRate());
|
||||
qm.completeQuest(3514);
|
||||
status++;
|
||||
}
|
||||
qm.dispose();
|
||||
|
||||
if(status == 0) {
|
||||
if(!usedPotion(qm.getPlayer())) {
|
||||
if(qm.haveItem(2022337)) {
|
||||
qm.sendOk("Are you scared to drink the potion? I can assure you it has only a minor #rside effect#k.");
|
||||
} else {
|
||||
if(qm.canHold(2022337)) {
|
||||
qm.gainItem(2022337, 1);
|
||||
qm.sendOk("Lost it? Luckily for you I managed to recover it back. Take it.");
|
||||
} else {
|
||||
qm.sendOk("Lost it? Luckily for you I managed to recover it back. Make a room to get it.");
|
||||
}
|
||||
}
|
||||
|
||||
qm.dispose();
|
||||
return;
|
||||
} else {
|
||||
qm.sendOk("It seems the potion worked and your emotions are no longer frozen. And, oh, my... You're ailing bad, #bpurge#k that out quickly.");
|
||||
}
|
||||
} else if(status == 1) {
|
||||
qm.gainExp(891500 * qm.getPlayer().getExpRate());
|
||||
qm.completeQuest(3514);
|
||||
qm.dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user