Instant sell NPC + new features

Donation Box NPC sells instantly items from inventory. Minor patches.
This commit is contained in:
ronancpl
2016-07-18 13:46:28 -03:00
parent 7e32e5a762
commit d7a2243319
28 changed files with 290 additions and 67 deletions

View File

@@ -139,9 +139,9 @@ function action(mode, type, selection) {
qty = selection;
if (selectedType == 2){ //helmet refine
var itemSet = new Array(1002042,1002041,1002002,1002044,1002003,1002040,1002007,1002052,1002011,1002058,1002009,1002056,1002087,1002088,1002049,1002050,1002047,1002048,1002099,1002098,1002085,1002028,1002022,1002101);
var itemSet = new Array(1002042,1002041,1002002,1002044,1002003,1002040,1002007,1002052,1002011,1002058,1002009,1002056,1002087,1002088,1002050,1002049,1002047,1002048,1002099,1002098,1002085,1002028,1002022,1002101);
var matSet = new Array(new Array(1002001,4011002),new Array(1002001,4021006),new Array(1002043,4011001),new Array(1002043,4011002),new Array(1002039,4011001),new Array(1002039,4011002),new Array(1002051,4011001),new Array(1002051,4011002),new Array(1002059,4011001),new Array(1002059,4011002),
new Array(1002055,4011001),new Array(1002055,4011002),new Array(1002027,4011002),new Array(1002027,4011006),new Array(1002005,4011006),new Array(1002005,4011005),new Array(1002004,4021000),new Array(1002004,4021005),new Array(1002021,4011002),new Array(1002021,4011006),new Array(1002086,4011002),
new Array(1002055,4011001),new Array(1002055,4011002),new Array(1002027,4011002),new Array(1002027,4011006),new Array(1002005,4011005),new Array(1002005,4011006),new Array(1002004,4021000),new Array(1002004,4021005),new Array(1002021,4011002),new Array(1002021,4011006),new Array(1002086,4011002),
new Array(1002086,4011004),new Array(1002100,4011007,4011001),new Array(1002100,4011007,4011002));
var matQtySet = new Array(new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,1),new Array(1,2),new Array(1,2),new Array(1,3),new Array(1,3),new Array(1,3),new Array(1,3),new Array(1,4),new Array(1,4),new Array(1,5),new Array(1,5),new Array(1,3),new Array(1,3),
new Array(1,5),new Array(1,6),new Array(1,5),new Array(1,4),new Array(1,1,7),new Array(1,1,7));

View File

@@ -55,10 +55,11 @@ function action(mode, type, selection) {
cm.sendNextPrev("You'll be able to acquire a marble called #b#t4031013##k while knocking down those monsters. It is a special marble made out of their sinister, evil minds. Collect 30 of those, and then go talk to a colleague of mine in there. That's how you pass the test.");
else if (status == 3)
cm.sendYesNo("Once you go inside, you can't leave until you take care of your mission. If you die, your experience level will decrease..so you better really buckle up and get ready...well, do you want to go for it now?");
else if (status == 4)
else if (status == 4) {
cm.sendNext("Alright I'll let you in! Defeat the monsters inside, collect 30 Dark Marbles, then strike up a conversation with a colleague of mine inside. He'll give you #bThe Proof of a Hero#k, the proof that you've passed the test. Best of luck to you.");
cm.startQuest(100004);
cm.gainItem(4031008, -1);
}
else if (status == 5) {
cm.warp(108000300, 0);
cm.dispose();

View File

@@ -239,14 +239,12 @@ function action(mode, type, selection) {
}
}
else {
if (cm.haveItem(mats[i],matQty[i]*qty))complete=false;
if (!cm.haveItem(mats[i],matQty[i]*qty)) complete=false;
}
}
}
else {
if (!cm.haveItem(mats, matQty * qty))complete=false;
if (!cm.haveItem(mats, matQty * qty)) complete=false;
}
}

View File

@@ -30,7 +30,9 @@ importPackage(Packages.server.maps);
var disabled = false;
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
var belt_level = Array(25, 35, 45, 60, 75);
var belt_points = Array(200, 1800, 4000, 9200, 17000);
/* var belt_points = Array(200, 1800, 4000, 9200, 17000); */
var belt_points = Array(5, 45, 100, 230, 425); /* Watered down version */
var status = -1;
var selectedMenu = -1;

View File

@@ -42,7 +42,7 @@ var maxEqp = 0;
function start() {
cm.getPlayer().setCS(true);
var selStr = "Hello, I am the #bAccessory NPC Crafter#k! My works are widely recognized to be too fine, to the point which all my items mimic not only the appearance but too the attributes of them! Everything I charge is some 'ingredients' to make them and, of course, a fee for my services. On what kind of equipment will you take a look?#b"
var selStr = "Hello, I am the #bAccessory NPC Crafter#k! My works are widely recognized to be too fine, to the point which all my items mimic not only the appearance but too the attributes of them! Everything I charge is some 'ingredients' to make them and, of course, a fee for my services. On what kind of equipment will you take a look?#b";
var options = ["Pendants","Face accessories","Eye accessories","Belts & medals","Rings","#t4032496#"];
for (var i = 0; i < options.length; i++)
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
@@ -51,7 +51,7 @@ function start() {
function action(mode, type, selection) {
status++;
if (mode != 1){
if (mode != 1) {
cm.dispose();
return;
}
@@ -109,7 +109,7 @@ function action(mode, type, selection) {
var matQtySet = [[20, 20, 5, 1], [5, 5, 10, 1], [10, 4, 20, 4], [20, 8, 20, 8], [10, 4, 20, 4], [15, 6, 30, 6], [20, 8, 40, 8], [15, 6, 30, 6], [1, 1, 1]];
var costSet = [150000, 500000, 200000, 400000, 200000, 300000, 400000, 300000, 2500000];
}else if (selectedType == 1) { //face accessory refine
var matSet = [[4001343, 4003004],[4001343, 4003004,4000026],[4001343, 4003004,4000026,4000082,4003002],[4001343, 4003005],[4001343, 4003005,4000026],[4001343, 4003005,4000026,4000082,4003002],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008]];
var matSet = [[4006000, 4003004],[4006000, 4003004,4000026],[4006000, 4003004,4000026,4000082,4003002],[4006000, 4003005],[4006000, 4003005,4000026],[4006000, 4003005,4000026,4000082,4003002],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008],[4001006, 4011008]];
var matQtySet = [[5,5],[5,5,5],[5,5,5,5,1],[5,5],[5,5,5],[5,5,5,5,1],[1,1],[1,1],[1,1],[1,1]];
var costSet = [100000,200000,300000,125000,250000,375000,500000,500000,500000,500000, 25000, 25000, 25000, 25000];
}else if (selectedType == 2) { //eye accessory refine
@@ -121,7 +121,7 @@ function action(mode, type, selection) {
var matQtySet = [[2, 5, 10], [7777, 7777]];
var costSet = [15000, 7777];
}else if (selectedType == 4) { //ring refine
var matSet = [[4003001, 4001344, 4001343], [4003001, 4001344, 4001343], [4021004, 4011008], [4011008, 4001006], [1112405, 2022039], [1112413, 4000176], [4011007, 4021009]];
var matSet = [[4003001, 4001344, 4006000], [4003001, 4001344, 4006000], [4021004, 4011008], [4011008, 4001006], [1112405, 2022039], [1112413, 4000176], [4011007, 4021009]];
var matQtySet = [[2, 2, 2], [2, 2, 2], [1, 1], [1, 1], [1, 1], [1, 1], [1, 1]];
var costSet = [10000, 10000, 10000, 20000, 15000, 15000, 10000];
}else if (selectedType == 5) { //necklace refine

View File

@@ -0,0 +1,79 @@
/*
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/>.
*/
/* NPC: Donation Box (9000041)
Victoria Road : Henesys
NPC Bazaar:
* By Ronan Lana
*/
var options = ["EQUIP","USE","SET-UP","ETC"];
var name;
var status;
var selectedType = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
status++;
if (mode != 1) {
cm.dispose();
return;
}
if (status == 0) {
var selStr = "Hello, I am the #bBazaar NPC#k! Sell to me any item on your inventory you don't need. #rWARNING#b: Make sure you have your items ready to sell at the slots #rAFTER#b the item you have selected to sell.#k Any items #bunder#k the item selected will be sold thoroughly.";
for (var i = 0; i < options.length; i++)
selStr += "\r\n#L" + i + "# " + options[i] + "#l";
cm.sendSimple(selStr);
}
else if (status == 1) {
selectedType = selection;
cm.sendGetText("From what item on your #r" + options[selectedType] + "#k inventory do you want to start the transaction?");
}
else if (status == 2) {
name = cm.getText();
var res = false;
if (selectedType == 0) {
res = cm.getPlayer().sellAllItemsFromName(Packages.client.inventory.MapleInventoryType.EQUIP, name);
}else if (selectedType == 1) {
res = cm.getPlayer().sellAllItemsFromName(Packages.client.inventory.MapleInventoryType.USE, name);
}else if (selectedType == 2) {
res = cm.getPlayer().sellAllItemsFromName(Packages.client.inventory.MapleInventoryType.SETUP, name);
}else if (selectedType == 3) {
res = cm.getPlayer().sellAllItemsFromName(Packages.client.inventory.MapleInventoryType.ETC, name);
}else if (selectedType == 4) {
res = cm.getPlayer().sellAllItemsFromName(Packages.client.inventory.MapleInventoryType.CASH, name);
}
if(res) cm.sendOk("Transaction complete!");
else cm.sendOk("#b'" + name + "'#k is not a #b" + options[selectedType] + "#k item!");
cm.dispose();
}
}

View File

@@ -11,9 +11,14 @@ function action(mode, type, selection) {
return;
}
if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001){
if(cm.getMeso() >= 5000){
var item = 4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000);
if(!cm.canHold(item)) {
cm.sendNext("You don't have a etc. slot available.");
}
else if(cm.getMeso() >= 5000){
cm.gainMeso(-5000);
cm.gainItem(4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000), 1);
cm.gainItem(item, 1);
cm.sendNext("There you go.");
}else
cm.sendNext("You don't have enough mesos.");

View File

@@ -72,14 +72,14 @@ function start() {
function action(mode, type, selection) {
if (mode == 0) {
cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know when you have a change of heart.");
cm.sendOk("Hmmm...it shouldn't be a bad deal for you. Come see me at the right time and you may get a much better item to be offered. Anyway, let me know when you have a change of mind.");
cm.dispose();
return;
}
status++;
if (status == 0) { // first interaction with NPC
cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it's been difficult to getting good items ... What do you think? Do you want to do some business with me?");
cm.sendNext("Hey, got a little bit of time? Well, my job is to collect items here and sell them elsewhere, but these days the monsters have become much more hostile so it have been difficult to get good items... What do you think? Do you want to do some business with me?");
} else if (status == 1) {
cm.sendYesNo("The deal is simple. You get me something I need, I get you something you need. The problem is, I deal with a whole bunch of people, so the items I have to offer may change every time you see me. What do you think? Still want to do it?");
} else if (status == 2) {
@@ -89,10 +89,10 @@ function action(mode, type, selection) {
lastSelection = selection;
requiredItem = eQuestChoices[selection];
if(selection / 4 == 0) qnt = 50;
if(selection < 4) qnt = 50;
else qnt=25;
cm.sendYesNo("Let's see, you want to trade your #b" + qnt + " #t" + requiredItem + "##k with my stuff right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?");
cm.sendYesNo("Let's see, you want to trade your #b" + qnt + " #t" + requiredItem + "##k with my stuff, right? Before trading make sure you have an empty slot available on your use or etc. inventory. Now, do you want to trade with me?");
}else if (status == 4){
itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length));
reward = eQuestPrizes[lastSelection];
@@ -103,13 +103,13 @@ function action(mode, type, selection) {
} else if(prizeItem == 0) {
cm.gainItem(requiredItem,-qnt);
cm.gainMeso(prizeQuantity);
cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's #b" + prizeQuantity + " mesos#k. What do you think? Do you like the items I gave you in return? I plan on being here for a while, so if you gather up more items, I'm always open for a trade ...");
cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's #b" + prizeQuantity + " mesos#k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade...");
} else if(!cm.canHold(prizeItem)){
cm.sendOk("Your use and etc. inventory seems to be full. You need the free spaces to trade with me! Make room, and then find me.");
} else {
cm.gainItem(requiredItem,-qnt);
cm.gainItem(prizeItem, prizeQuantity);
cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's my #b"+prizeQuantity+" #t"+prizeItem+"##k. What do you think? Do you like the items I gave you in return? I plan on being here for a while, so if you gather up more items, I'm always open for a trade ...");
cm.sendOk("For your #b" + qnt + " #t"+requiredItem+"##k, here's my #b"+prizeQuantity+" #t"+prizeItem+"##k. What do you think? Did you like the items I gave you in return? I plan on being here for awhile, so if you gather up more items, I'm always open for a trade...");
}
cm.dispose();
}

53
scripts/quest/3454.js Normal file
View File

@@ -0,0 +1,53 @@
/*
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 : Ronan
NPC Name: Dr. Kim
Map(s): Omega Sector
Description: Quest - Wave Translator
Quest ID: 3454
*/
function end(mode, type, selection) {
if(qm.getPlayer().getInventory(Packages.client.inventory.MapleInventoryType.ETC).getNumFreeSlot() < 1) {
qm.sendOk("Make room on your ETC inventory first.");
qm.dispose();
return;
}
qm.gainItem(4000125, -1);
qm.gainItem(4031926, -10);
qm.gainItem(4000119, -30);
qm.gainItem(4000118, -30);
rnd = Math.random();
if(rnd < 1.0) {
qm.gainItem(4031928, 1);
}
else {
qm.gainItem(4031927, 1);
}
qm.sendOk("Now, go meet Alien Gray and use this undercover to read through their plans. If this fails, we will need to gather some materials once again.");
qm.forceCompleteQuest();
qm.dispose();
}

View File

@@ -27,5 +27,8 @@
*/
function act(){
rm.warp(922000009);
if(rm.isQuestActive(3238)) {
rm.warp(922000020);
}
else rm.warp(922000009);
}

View File

@@ -26,6 +26,11 @@
*
*/
function act(){
//rm.dropItems(true, 2, 105, 140);
rm.dropItems();
}