Files
sweetgum-server/scripts/npc/9201096.js
ronancpl 0910dc2428 Missing Pirate questlines + Find & MoveLife update + Party-Map patch
Implemented missing scripts for Aerial Strike, Hypnotize and Time Leap skill questlines.
Fixed an deadlock issue within player's inventory and status.
Fixed skill spam detection disconnecting players when legitimatelly spamming Flash Jump or Heal.
Fixed party members map location not being properly updated after changing maps.
Rehauled MoveLife handler. Improved packet read of attack and skill elements, properly reflecting incoming actions to other player on the map.
Reviewed an issue with equipments MaxHP/MaxMP getting unsynced with player's MaxHP/MaxMP, resulting in differences within server-client view of a player's pool.
Fixed mobs not being spawned by dojo bosses after enough spawn actions were instanced.
Implemented proper Mob.wz linked mob data support.
Fixed /find not identifying a player's channel properly.
Fixed Echo of Hero not affecting other player in the map.
Fixed commands warp and goto not taking player off events/expeditions properly.
Fixed storage expansion not being registered on DB when buying the cash item.
Fixed party leadership being reassigned after changing channels.
Implemented suggested level range limit between party members on the EXP share system. Players whose level range from the attacker exceeds the estipulated threshold will not receive any EXP from the action.

Happy Thanksgiving Day everyone!!!
2018-11-22 16:16:21 -02:00

141 lines
5.2 KiB
JavaScript

/*
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/>.
*/
/* Jack - Refining NPC
@author RonanLana
*/
var status = 0;
var selectedType = -1;
var selectedItem = -1;
var item;
var mats;
var matQty;
var cost;
var qty;
var equip;
var last_use; //last item is a use item
function start() {
cm.getPlayer().setCS(true);
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1)
status++;
else {
cm.sendOk("Very well, see you around.");
cm.dispose();
return;
}
if (status == 0) {
var selStr = "Hey, are you aware about the expeditions running right now at the Crimsonwood Keep? So, there is a great opportunity for one to improve themselves, one can rack up experience and loot pretty fast there.";
cm.sendNext(selStr);
}
else if (status == 1) {
var selStr = "Said so, methinks making use of some strong utility potions can potentially create some differential on the front, and by this I mean to start crafting #b#t2022284##k's to help on the efforts. So, getting right down to business, I'm currently pursuing #rplenty#k of those items: #r#t4032010##k, #r#t4032011##k, #r#t4032012##k, and some funds to support the cause. Would you want to get some of these boosters?";
cm.sendYesNo(selStr);
}
else if (status == 2) {
//selectedItem = selection;
selectedItem = 0;
var itemSet = new Array(2022284, 7777777);
var matSet = new Array(new Array(4032010, 4032011, 4032012));
var matQtySet = new Array(new Array(60, 60, 45));
var costSet = new Array(75000, 7777777);
item = itemSet[selectedItem];
mats = matSet[selectedItem];
matQty = matQtySet[selectedItem];
cost = costSet[selectedItem];
var prompt = "Ok, I'll be crafting some #t" + item + "#. In that case, how many of those do you want me to make?";
cm.sendGetNumber(prompt,1,1,100)
}
else if (status == 3) {
qty = (selection > 0) ? selection : (selection < 0 ? -selection : 1);
last_use = false;
var prompt = "So, you want me to make ";
if (qty == 1)
prompt += "a #t" + item + "#?";
else
prompt += qty + " #t" + item + "#?";
prompt += " In that case, I'm going to need specific items from you in order to make it. And make sure you have room in your inventory!#b";
if (mats instanceof Array){
for (var i = 0; i < mats.length; i++) {
prompt += "\r\n#i"+mats[i]+"# " + matQty[i] * qty + " #t" + mats[i] + "#";
}
} else {
prompt += "\r\n#i"+mats+"# " + matQty * qty + " #t" + mats + "#";
}
if (cost > 0) {
prompt += "\r\n#i4031138# " + cost * qty + " meso";
}
cm.sendYesNo(prompt);
}
else if (status == 4) {
var complete = true;
if (cm.getMeso() < cost * qty) {
cm.sendOk("Well, I DID say I would be needing some funds to craft it, wasn't it?");
}
else if(!cm.canHold(item, qty)) {
cm.sendOk("You didn't check if you got a slot to spare on your inventory before crafting, right?");
}
else {
if (mats instanceof Array) {
for (var i = 0; complete && i < mats.length; i++) {
if (matQty[i] * qty == 1) {
complete = cm.haveItem(mats[i]);
} else {
complete = cm.haveItem(mats[i], matQty[i] * qty);
}
}
} else {
complete = cm.haveItem(mats, matQty * qty);
}
if (!complete)
cm.sendOk("There are not enough resources on your inventory. Please check it again.");
else {
if (mats instanceof Array) {
for (var i = 0; i < mats.length; i++){
cm.gainItem(mats[i], -matQty[i] * qty);
}
} else {
cm.gainItem(mats, -matQty * qty);
}
cm.gainMeso(-cost * qty);
cm.gainItem(item, qty);
cm.sendOk("There it is! Thanks for your cooperation.");
}
}
cm.dispose();
}
}