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
+5 -4
View File
@@ -2,16 +2,17 @@ MapleSolaxiaV2
Freelance developer: Ronan C. P. Lana Freelance developer: Ronan C. P. Lana
Credits about are to be given to the original MapleSolaxia staff and other colaborators, as some minor Credits about are to be given to the original MapleSolaxia staff and other colaborators, as just some minor
changes/patches on the game were applied by me. changes/patches on the game were applied by myself.
This is a NetBeans 8.0.2 Project. This means that it's easier to install the project via "NetBeans' import This is a NetBeans 8.0.2 Project. This means that it's easier to install the project via "NetBeans' import
new project using existing code". Once installed, build this project on your machine and run the server using new project using existing code". Once installed, build this project on your machine and run the server using
the "launch.bat" application. the "launch.bat" application.
Note that the project uses the IP 25.15.163.31. Therefore, change the IP wherever it applies to run properly Note that the project uses the IP 25.75.212.150. Therefore, change the IP wherever it applies (Ctrl+f the
the program. Eventually, I will change the settings on this repository to run at localhost (127.0.0.1). entire project) to run properly the program. Eventually, I will change the settings on this repository to run
at localhost (127.0.0.1).
------------------------------------------------ ------------------------------------------------
+1 -1
View File
@@ -1,4 +1,4 @@
HOST=25.15.163.31 HOST=25.75.212.150
URL=jdbc:mysql://localhost:3306/maplesolaxia URL=jdbc:mysql://localhost:3306/maplesolaxia
DB_USER=root DB_USER=root
DB_PASS= DB_PASS=
+7 -1
View File
@@ -87,4 +87,10 @@ Correcao de bug em scripts que fazia o jogador ficar preso num mapa de transicao
Correcao de bug, onde o sistema nao contabilizava corretamente queda de HP em determinados mapas. Correcao de bug, onde o sistema nao contabilizava corretamente queda de HP em determinados mapas.
03 Janeiro 2016, 03 Janeiro 2016,
Correcao de bug, onde clientes podiam congelar apos acessar o Cash Shop. Correcao de bug, onde clientes podiam congelar apos acessar o Cash Shop.
16 Julho 2016,
Correcao de bug.
18 Julho 2016,
Bazaar NPC (Donation Box): venda automatica de um item designado e todos os itens que estiverem imediatamente após.
+23 -15
View File
@@ -3,25 +3,33 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/world/World.java</file> <file>file:/C:/Nexon/MapleSolaxia/scripts/npc/world0/9000036.js</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/MapleStatEffect.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/scripting/reactor/ReactorActionManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/MapleServerHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/scripting/npc/NPCConversationManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/inventory/MapleInventory.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/scripting/npc/NPCScriptManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/MapleClient.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/client/MapleClient.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/PlayerStorage.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/server/MapleItemInformationProvider.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/command/Commands.java</file> <file>file:/C:/Nexon/MapleSolaxia/wz/Quest.wz/QuestInfo.img.xml</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/MonsterBook.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/scripting/event/EventInstanceManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/MapleStorage.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/MapleShop.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/inventory/MapleInventoryType.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/inventory/Item.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/maps/MapleReactorStats.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/scripting/AbstractScriptManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/provider/MapleData.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/provider/MapleDataProvider.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/MapleServerHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/client/MapleCharacter.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/ChangeMapSpecialHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/tools/MaplePacketCreator.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/tools/MaplePacketCreator.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/EnterMTSHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/logs/29-07-2015/error/saveToDB.txt</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/Channel.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/scripting/AbstractPlayerInteraction.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/EnterCashShopHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/net/server/RankingWorker.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/ChangeMapHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/StorageHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/PlayerLoggedinHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/PacketProcessor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/net/server/channel/handlers/ChangeChannelHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/constants/ServerConstants.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/src/server/maps/MapleMap.java</file> <file>file:/C:/Nexon/MapleSolaxia/src/server/maps/MapleReactor.java</file>
</group> </group>
</open-files> </open-files>
</project-private> </project-private>
+2 -2
View File
@@ -139,9 +139,9 @@ function action(mode, type, selection) {
qty = selection; qty = selection;
if (selectedType == 2){ //helmet refine 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), 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)); 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), 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)); 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));
+2 -1
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."); 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) 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?"); 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.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.startQuest(100004);
cm.gainItem(4031008, -1); cm.gainItem(4031008, -1);
}
else if (status == 5) { else if (status == 5) {
cm.warp(108000300, 0); cm.warp(108000300, 0);
cm.dispose(); cm.dispose();
+2 -4
View File
@@ -239,14 +239,12 @@ function action(mode, type, selection) {
} }
} }
else { else {
if (!cm.haveItem(mats[i],matQty[i]*qty)) complete=false;
if (cm.haveItem(mats[i],matQty[i]*qty))complete=false;
} }
} }
} }
else { else {
if (!cm.haveItem(mats, matQty * qty))complete=false; if (!cm.haveItem(mats, matQty * qty)) complete=false;
} }
} }
+3 -1
View File
@@ -30,7 +30,9 @@ importPackage(Packages.server.maps);
var disabled = false; var disabled = false;
var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004); var belts = Array(1132000, 1132001, 1132002, 1132003, 1132004);
var belt_level = Array(25, 35, 45, 60, 75); 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 status = -1;
var selectedMenu = -1; var selectedMenu = -1;
+4 -4
View File
@@ -42,7 +42,7 @@ var maxEqp = 0;
function start() { function start() {
cm.getPlayer().setCS(true); 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#"]; var options = ["Pendants","Face accessories","Eye accessories","Belts & medals","Rings","#t4032496#"];
for (var i = 0; i < options.length; i++) for (var i = 0; i < options.length; i++)
selStr += "\r\n#L" + i + "# " + options[i] + "#l"; selStr += "\r\n#L" + i + "# " + options[i] + "#l";
@@ -51,7 +51,7 @@ function start() {
function action(mode, type, selection) { function action(mode, type, selection) {
status++; status++;
if (mode != 1){ if (mode != 1) {
cm.dispose(); cm.dispose();
return; 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 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]; var costSet = [150000, 500000, 200000, 400000, 200000, 300000, 400000, 300000, 2500000];
}else if (selectedType == 1) { //face accessory refine }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 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]; var costSet = [100000,200000,300000,125000,250000,375000,500000,500000,500000,500000, 25000, 25000, 25000, 25000];
}else if (selectedType == 2) { //eye accessory refine }else if (selectedType == 2) { //eye accessory refine
@@ -121,7 +121,7 @@ function action(mode, type, selection) {
var matQtySet = [[2, 5, 10], [7777, 7777]]; var matQtySet = [[2, 5, 10], [7777, 7777]];
var costSet = [15000, 7777]; var costSet = [15000, 7777];
}else if (selectedType == 4) { //ring refine }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 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]; var costSet = [10000, 10000, 10000, 20000, 15000, 15000, 10000];
}else if (selectedType == 5) { //necklace refine }else if (selectedType == 5) { //necklace refine
+79
View File
@@ -0,0 +1,79 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
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();
}
}
+7 -2
View File
@@ -11,9 +11,14 @@ function action(mode, type, selection) {
return; return;
} }
if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001){ 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.gainMeso(-5000);
cm.gainItem(4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000), 1); cm.gainItem(item, 1);
cm.sendNext("There you go."); cm.sendNext("There you go.");
}else }else
cm.sendNext("You don't have enough mesos."); cm.sendNext("You don't have enough mesos.");
+6 -6
View File
@@ -72,14 +72,14 @@ function start() {
function action(mode, type, selection) { function action(mode, type, selection) {
if (mode == 0) { 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(); cm.dispose();
return; return;
} }
status++; status++;
if (status == 0) { // first interaction with NPC 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) { } 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?"); 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) { } else if (status == 2) {
@@ -89,10 +89,10 @@ function action(mode, type, selection) {
lastSelection = selection; lastSelection = selection;
requiredItem = eQuestChoices[selection]; requiredItem = eQuestChoices[selection];
if(selection / 4 == 0) qnt = 50; if(selection < 4) qnt = 50;
else qnt=25; 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){ }else if (status == 4){
itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length)); itemSet = (Math.floor(Math.random() * eQuestPrizes[lastSelection].length));
reward = eQuestPrizes[lastSelection]; reward = eQuestPrizes[lastSelection];
@@ -103,13 +103,13 @@ function action(mode, type, selection) {
} else if(prizeItem == 0) { } else if(prizeItem == 0) {
cm.gainItem(requiredItem,-qnt); cm.gainItem(requiredItem,-qnt);
cm.gainMeso(prizeQuantity); 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)){ } 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."); 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 { } else {
cm.gainItem(requiredItem,-qnt); cm.gainItem(requiredItem,-qnt);
cm.gainItem(prizeItem, prizeQuantity); 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(); cm.dispose();
} }
+53
View File
@@ -0,0 +1,53 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
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();
}
+4 -1
View File
@@ -27,5 +27,8 @@
*/ */
function act(){ function act(){
rm.warp(922000009); if(rm.isQuestActive(3238)) {
rm.warp(922000020);
}
else rm.warp(922000009);
} }
+5
View File
@@ -26,6 +26,11 @@
* *
*/ */
function act(){ function act(){
//rm.dropItems(true, 2, 105, 140); //rm.dropItems(true, 2, 105, 140);
rm.dropItems();
} }
+7 -8
View File
@@ -559,7 +559,6 @@
(1210101, 1072285, 1, 1, 0, 700), (1210101, 1072285, 1, 1, 0, 700),
(9300059, 1072285, 1, 1, 0, 700), (9300059, 1072285, 1, 1, 0, 700),
(9400242, 1072285, 1, 1, 0, 700), (9400242, 1072285, 1, 1, 0, 700),
(1110101, 1012031, 1, 1, 0, 700),
(1110101, 4030009, 1, 1, 0, 10000), (1110101, 4030009, 1, 1, 0, 10000),
(1110101, 4001344, 1, 1, 0, 7000), (1110101, 4001344, 1, 1, 0, 7000),
(1110101, 4001356, 1, 1, 0, 7000), (1110101, 4001356, 1, 1, 0, 7000),
@@ -3718,11 +3717,6 @@
(9500307, 4000018, 1, 1, 0, 200000), (9500307, 4000018, 1, 1, 0, 200000),
(9500338, 4000018, 1, 1, 0, 200000), (9500338, 4000018, 1, 1, 0, 200000),
(9303001, 4000018, 1, 1, 0, 200000), (9303001, 4000018, 1, 1, 0, 200000),
(3220000, 1012031, 1, 1, 0, 40000),
(9300185, 1012031, 1, 1, 0, 40000),
(9500307, 1012031, 1, 1, 0, 40000),
(9500338, 1012031, 1, 1, 0, 40000),
(9303001, 1012031, 1, 1, 0, 700),
(3220000, 4003001, 1, 1, 0, 7000), (3220000, 4003001, 1, 1, 0, 7000),
(9300185, 4003001, 1, 1, 0, 7000), (9300185, 4003001, 1, 1, 0, 7000),
(9500307, 4003001, 1, 1, 0, 7000), (9500307, 4003001, 1, 1, 0, 7000),
@@ -18746,7 +18740,9 @@
(9400578, 2001000, 1, 1, 0, 800), (9400578, 2001000, 1, 1, 0, 800),
(9400578, 1032032, 1, 1, 0, 1200), (9400578, 1032032, 1, 1, 0, 1200),
(9400578, 1032013, 1, 1, 0, 1200), (9400578, 1032013, 1, 1, 0, 1200),
(9400578, 1372009, 1, 1, 0, 1200); (9400578, 1372009, 1, 1, 0, 1200),
(9400578, 1372009, 1, 1, 0, 1200),
(9300011, 4031130, 1, 1, 0, 10000);
UPDATE IGNORE temp_data SET dropperid=9000002 WHERE dropperid=9000000; UPDATE IGNORE temp_data SET dropperid=9000002 WHERE dropperid=9000000;
@@ -18769,7 +18765,8 @@
`maximum_quantity` int(11) NOT NULL DEFAULT '1', `maximum_quantity` int(11) NOT NULL DEFAULT '1',
`questid` int(11) NOT NULL DEFAULT '0', `questid` int(11) NOT NULL DEFAULT '0',
`chance` int(11) NOT NULL DEFAULT '0', `chance` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`dropperid`, `itemid`), PRIMARY KEY (`id`),
UNIQUE KEY (`dropperid`, `itemid`),
KEY `mobid` (`dropperid`) KEY `mobid` (`dropperid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
@@ -18803,8 +18800,10 @@
UPDATE drop_data SET questid=77777 WHERE itemid=4001358; #id 77777 for ALL quest items with no v83 quest. UPDATE drop_data SET questid=77777 WHERE itemid=4001358; #id 77777 for ALL quest items with no v83 quest.
UPDATE drop_data SET questid=77777 WHERE itemid=4001359; UPDATE drop_data SET questid=77777 WHERE itemid=4001359;
UPDATE drop_data SET questid=77777 WHERE itemid=4001342; UPDATE drop_data SET questid=77777 WHERE itemid=4001342;
UPDATE drop_data SET chance=0 WHERE itemid=2050099;
#update quest reactor items #update quest reactor items
UPDATE reactordrops SET questid=2086 WHERE itemid=4031165;
UPDATE reactordrops SET questid=3407 WHERE itemid=4031141; UPDATE reactordrops SET questid=3407 WHERE itemid=4031141;
UPDATE reactordrops SET questid=3407 WHERE itemid=4031142; UPDATE reactordrops SET questid=3407 WHERE itemid=4031142;
UPDATE reactordrops SET questid=3407 WHERE itemid=4031143; UPDATE reactordrops SET questid=3407 WHERE itemid=4031143;
+3
View File
@@ -3,6 +3,9 @@ UPDATE shopitems SET itemid=1812004, price=1000 WHERE shopitemid=19;
UPDATE shopitems SET itemid=2120000, price=100 WHERE shopitemid=20; UPDATE shopitems SET itemid=2120000, price=100 WHERE shopitemid=20;
UPDATE shopitems SET itemid=1812000, price=1000 WHERE shopitemid=21; UPDATE shopitems SET itemid=1812000, price=1000 WHERE shopitemid=21;
UPDATE shopitems SET itemid=1812001, price=1000 WHERE shopitemid=22; UPDATE shopitems SET itemid=1812001, price=1000 WHERE shopitemid=22;
INSERT IGNORE INTO `shopitems` (`shopitemid`, `shopid`, `itemid`, `price`, `pitch`, `position`, `chance`) VALUES
(995032, SHOPID, 2040025, 500000, 0, 0),
UPDATE shopitems SET itemid=2040025, price=500000 WHERE shopitemid=995032; UPDATE shopitems SET itemid=2040025, price=500000 WHERE shopitemid=995032;
UPDATE shopitems SET itemid=2040029, price=500000 WHERE shopitemid=995033; UPDATE shopitems SET itemid=2040029, price=500000 WHERE shopitemid=995033;
UPDATE shopitems SET itemid=2040301, price=400000 WHERE shopitemid=995034; UPDATE shopitems SET itemid=2040301, price=400000 WHERE shopitemid=995034;
+3 -2
View File
@@ -1,3 +1,4 @@
These 2 SQL files must be executed IN ORDER to set up: These SQL files must be executed IN ORDER to set up:
- db_database.sql - db_database.sql
- db_drops.sql - db_drops.sql
- db_shopupdate.sql (optional)
+52 -1
View File
@@ -2971,7 +2971,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public static MapleCharacter loadCharFromDB(int charid, MapleClient client, boolean channelserver) throws SQLException { public static MapleCharacter loadCharFromDB(int charid, MapleClient client, boolean channelserver) throws SQLException {
try { try {
MapleCharacter ret = new MapleCharacter(); MapleCharacter ret = new MapleCharacter();
ret.client = client; ret.client = client;
ret.id = charid; ret.id = charid;
Connection con = DatabaseConnection.getConnection(); Connection con = DatabaseConnection.getConnection();
@@ -4701,7 +4701,58 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
return false; return false;
} }
public boolean sellAllItemsFromName(MapleInventoryType type, String name) {
//player decides from which inventory items should be sold.
Item it = getInventory(type).findByName(name);
if(it == null) return(false);
sellAllItemsFromPosition(type, it.getPosition());
return(true);
}
public void sellAllItemsFromPosition(MapleInventoryType type, short pos) {
for(short i = pos; i <= getInventory(type).getSlotLimit(); i++) {
if(getInventory(type).getItem(i) == null) continue;
standaloneSell(getClient(), type, i, getInventory(type).getItem(i).getQuantity());
}
}
private void standaloneSell(MapleClient c, MapleInventoryType type, short slot, short quantity) {
if (quantity == 0xFFFF || quantity == 0) {
quantity = 1;
}
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
Item item = getInventory(type).getItem((short) slot);
if (item == null){ //Basic check
return;
}
if (ItemConstants.isRechargable(item.getItemId())) {
quantity = item.getQuantity();
}
if (quantity < 0) {
return;
}
short iQuant = item.getQuantity();
if (iQuant == 0xFFFF) {
iQuant = 1;
}
if (quantity <= iQuant && iQuant > 0) {
MapleInventoryManipulator.removeFromSlot(c, type, (byte) slot, quantity, false);
double price;
if (ItemConstants.isRechargable(item.getItemId())) {
price = ii.getWholePrice(item.getItemId()) / (double) ii.getSlotMax(c, item.getItemId());
} else {
price = ii.getPrice(item.getItemId());
}
int recvMesos = (int) Math.max(Math.ceil(price * quantity), 0);
if (price != -1 && recvMesos > 0) {
gainMeso(recvMesos, false);
}
}
}
public void setShop(MapleShop shop) { public void setShop(MapleShop shop) {
this.shop = shop; this.shop = shop;
} }
+10
View File
@@ -32,6 +32,7 @@ import java.util.Map;
import tools.Pair; import tools.Pair;
import client.MapleCharacter; import client.MapleCharacter;
import constants.ItemConstants; import constants.ItemConstants;
import server.MapleItemInformationProvider;
/** /**
* *
@@ -73,6 +74,15 @@ public class MapleInventory implements Iterable<Item> {
} }
return null; return null;
} }
public Item findByName(String name) {
for (Item item : inventory.values()) {
if (name.compareToIgnoreCase(MapleItemInformationProvider.getInstance().getName(item.getItemId())) == 0) {
return item;
}
}
return null;
}
public int countById(int itemId) { public int countById(int itemId) {
int possesed = 0; int possesed = 0;
+1 -1
View File
@@ -22,7 +22,7 @@
package constants; package constants;
public final class ExpTable { public final class ExpTable {
private static final int[] exp = {1, 15, 34, 57, 92, 135, 372, 560, 840, 1242, 1144, 1573, 2144, 2800, 3640, 4700, 5893, 7360, 9144, 11120, 13477, 16268, 19320, 22880, 27008, 31477, 36600, 42444, 48720, 55813, 63800, 86784, 98208, 110932, 124432, 139372, 155865, 173280, 192400, 213345, 235372, 259392, 285532, 312928, 342624, 374760, 408336, 445544, 483532, 524160, 567772, 598886, 631704, 666321, 702836, 741351, 781976, 824828, 870028, 917625, 967995, 1021041, 1076994, 1136013, 1198266, 1263930, 1333194, 1406252, 1483314, 1564600, 1650340, 1740778, 1836173, 1936794, 2042930, 2154882, 2272970, 2397528, 2528912, 2667496, 2813674, 2967863, 3130502, 3302053, 3483005, 3673873, 3875201, 4087562, 4311559, 4547832, 4797053, 5059931, 5337215, 5629694, 5938202, 6263614, 6606860, 6968915, 7350811, 7753635, 8178534, 8626718, 9099462, 9598112, 10124088, 10678888, 11264090, 11881362, 12532461, 13219239, 13943653, 14707765, 15513750, 16363902, 17260644, 18206527, 19204245, 20256637, 21366700, 22537594, 23772654, 25075395, 26449526, 27898960, 29427822, 31040466, 32741483, 34535716, 36428273, 38424542, 40530206, 42751262, 45094030, 47565183, 50171755, 52921167, 55821246, 58880250, 62106888, 65510344, 69100311, 72887008, 76881216, 81094306, 85594273, 90225770, 95170142, 100385466, 105886589, 111689174, 117809740, 124265714, 131075474, 138258410, 145834970, 153826726, 162256430, 171148082, 180526997, 190419876, 200854885, 211861732, 223471711, 223471711, 248635353, 262260570, 276632449, 291791906, 307782102, 324648562, 342439302, 361204976, 380999008, 401877754, 423900654, 447130410, 471633156, 497478653, 524740482, 553496261, 583827855, 615821622, 649568646, 685165008, 722712050, 762316670, 804091623, 848155844, 894634784, 943660770, 995373379, 1049919840, 1107455447, 1168144006, 1232158297, 1299680571, 1370903066, 1446028554, 1525246918, 1608855764, 1697021059}; private static final int[] exp = {1, 15, 34, 57, 92, 135, 372, 560, 840, 1144, 1242, 1573, 2144, 2800, 3640, 4700, 5893, 7360, 9144, 11120, 13477, 16268, 19320, 22880, 27008, 31477, 36600, 42444, 48720, 55813, 63800, 86784, 98208, 110932, 124432, 139372, 155865, 173280, 192400, 213345, 235372, 259392, 285532, 312928, 342624, 374760, 408336, 445544, 483532, 524160, 567772, 598886, 631704, 666321, 702836, 741351, 781976, 824828, 870028, 917625, 967995, 1021041, 1076994, 1136013, 1198266, 1263930, 1333194, 1406252, 1483314, 1564600, 1650340, 1740778, 1836173, 1936794, 2042930, 2154882, 2272970, 2397528, 2528912, 2667496, 2813674, 2967863, 3130502, 3302053, 3483005, 3673873, 3875201, 4087562, 4311559, 4547832, 4797053, 5059931, 5337215, 5629694, 5938202, 6263614, 6606860, 6968915, 7350811, 7753635, 8178534, 8626718, 9099462, 9598112, 10124088, 10678888, 11264090, 11881362, 12532461, 13219239, 13943653, 14707765, 15513750, 16363902, 17260644, 18206527, 19204245, 20256637, 21366700, 22537594, 23772654, 25075395, 26449526, 27898960, 29427822, 31040466, 32741483, 34535716, 36428273, 38424542, 40530206, 42751262, 45094030, 47565183, 50171755, 52921167, 55821246, 58880250, 62106888, 65510344, 69100311, 72887008, 76881216, 81094306, 85594273, 90225770, 95170142, 100385466, 105886589, 111689174, 117809740, 124265714, 131075474, 138258410, 145834970, 153826726, 162256430, 171148082, 180526997, 190419876, 200854885, 211861732, 223471711, 223471711, 248635353, 262260570, 276632449, 291791906, 307782102, 324648562, 342439302, 361204976, 380999008, 401877754, 423900654, 447130410, 471633156, 497478653, 524740482, 553496261, 583827855, 615821622, 649568646, 685165008, 722712050, 762316670, 804091623, 848155844, 894634784, 943660770, 995373379, 1049919840, 1107455447, 1168144006, 1232158297, 1299680571, 1370903066, 1446028554, 1525246918, 1608855764, 1697021059};
private static final int[] pet = {1, 1, 3, 6, 14, 31, 60, 108, 181, 287, 434, 632, 891, 1224, 1642, 2161, 2793, 3557, 4467, 5542, 6801, 8263, 9950, 11882, 14084, 16578, 19391, 22547, 26074, 30000, 2147483647}; private static final int[] pet = {1, 1, 3, 6, 14, 31, 60, 108, 181, 287, 434, 632, 891, 1224, 1642, 2161, 2793, 3557, 4467, 5542, 6801, 8263, 9950, 11882, 14084, 16578, 19391, 22547, 26074, 30000, 2147483647};
private static final int[] mount = {1, 24, 50, 105, 134, 196, 254, 263, 315, 367, 430, 543, 587, 679, 725, 897, 1146, 1394, 1701, 2247, 2543, 2898, 3156, 3313, 3584, 3923, 4150, 4305, 4550}; private static final int[] mount = {1, 24, 50, 105, 134, 196, 254, 263, 315, 367, 430, 543, 587, 679, 725, 897, 1146, 1394, 1701, 2247, 2543, 2898, 3156, 3313, 3584, 3923, 4150, 4305, 4550};
+2 -2
View File
@@ -13,7 +13,7 @@ public class ServerConstants {
public static final long RANKING_INTERVAL = 60 * 60 * 1000;//60 minutes, 3600000 public static final long RANKING_INTERVAL = 60 * 60 * 1000;//60 minutes, 3600000
public static final boolean ENABLE_PIC = false; public static final boolean ENABLE_PIC = false;
//Event Configuration //Event Configuration
public static final boolean PERFECT_PITCH = false; //for lvl 30 or above, each lvlup player gains 1 perfect pitch. public static final boolean PERFECT_PITCH = true; //for lvl 30 or above, each lvlup player gains 1 perfect pitch.
// IP Configuration // IP Configuration
public static String HOST; public static String HOST;
//Database Configuration //Database Configuration
@@ -24,7 +24,7 @@ public class ServerConstants {
public static boolean JAVA_8; public static boolean JAVA_8;
public static boolean SHUTDOWNHOOK; public static boolean SHUTDOWNHOOK;
//Gameplay Configurations //Gameplay Configurations
public static final boolean USE_DEBUG = false; public static final boolean USE_DEBUG = true;
public static final boolean USE_MTS = false; public static final boolean USE_MTS = false;
public static final boolean USE_FAMILY_SYSTEM = false; public static final boolean USE_FAMILY_SYSTEM = false;
public static final boolean USE_DUEY = true; public static final boolean USE_DUEY = true;
@@ -440,6 +440,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
return true; return true;
} }
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace();
return false; return false;
} }
if (getPlayer().getMerchantMeso() == 0) { if (getPlayer().getMerchantMeso() == 0) {
@@ -69,7 +69,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
Iterator<ReactorDropEntry> iter = chances.iterator(); Iterator<ReactorDropEntry> iter = chances.iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
ReactorDropEntry d = iter.next(); ReactorDropEntry d = iter.next();
if (Math.random() < (1 / (double) d.chance)) { if (Math.random() < (c.getPlayer().getDropRate() / (double) d.chance)) {
numItems++; numItems++;
items.add(d); items.add(d);
} }
+4 -2
View File
@@ -151,9 +151,9 @@ public class MapleReactor extends AbstractMapleMapObject {
if(!this.isAlive()) { if(!this.isAlive()) {
return; return;
} }
if(ServerConstants.USE_DEBUG == true) c.getPlayer().dropMessage(5, "Hitted REACTOR " + this.getId()); if(ServerConstants.USE_DEBUG == true) c.getPlayer().dropMessage(5, "Hitted REACTOR " + this.getId() + " with POS " + charPos + " , STANCE " + stance + " , SkillID " + skillid);
if (stats.getType(state) < 999 && stats.getType(state) != -1) {//type 2 = only hit from right (kerning swamp plants), 00 is air left 02 is ground left if (stats.getType(state) < 999 && stats.getType(state) != -1) {//type 2 = only hit from right (kerning swamp plants), 00 is air left 02 is ground left
if (!(stats.getType(state) == 2 && (charPos == 0 || charPos == 2))) { //get next state if (!(stats.getType(state) == 2 && (stance == 0 || stance == 2))) { //get next state
for (byte b = 0; b < stats.getStateSize(state); b++) {//YAY? for (byte b = 0; b < stats.getStateSize(state); b++) {//YAY?
List<Integer> activeSkills = stats.getActiveSkills(state, b); List<Integer> activeSkills = stats.getActiveSkills(state, b);
if (activeSkills != null) { if (activeSkills != null) {
@@ -170,6 +170,8 @@ public class MapleReactor extends AbstractMapleMapObject {
} else {//item-triggered on final step } else {//item-triggered on final step
map.broadcastMessage(MaplePacketCreator.triggerReactor(this, stance)); map.broadcastMessage(MaplePacketCreator.triggerReactor(this, stance));
} }
if(ServerConstants.USE_DEBUG == true) c.getPlayer().dropMessage(5, "REACTOR " + this.getId() + " activated");
ReactorScriptManager.getInstance().act(c, this); ReactorScriptManager.getInstance().act(c, this);
} else { //reactor not broken yet } else { //reactor not broken yet
map.broadcastMessage(MaplePacketCreator.triggerReactor(this, stance)); map.broadcastMessage(MaplePacketCreator.triggerReactor(this, stance));
@@ -33,13 +33,10 @@ import server.quest.MapleQuestRequirementType;
*/ */
public class NpcRequirement extends MapleQuestRequirement { public class NpcRequirement extends MapleQuestRequirement {
private int reqNPC; private int reqNPC;
private final boolean autoComplete, autoStart;
public NpcRequirement(MapleQuest quest, MapleData data) { public NpcRequirement(MapleQuest quest, MapleData data) {
super(MapleQuestRequirementType.NPC); super(MapleQuestRequirementType.NPC);
processData(data); processData(data);
this.autoComplete = quest.isAutoComplete();
this.autoStart = quest.isAutoStart();
} }
@Override @Override
@@ -50,6 +47,6 @@ public class NpcRequirement extends MapleQuestRequirement {
@Override @Override
public boolean check(MapleCharacter chr, Integer npcid) { public boolean check(MapleCharacter chr, Integer npcid) {
return npcid != null && npcid == reqNPC && (autoComplete || autoStart || chr.getMap().containsNPC(npcid)); return npcid != null && npcid == reqNPC;
} }
} }
+1 -1
View File
@@ -21699,7 +21699,7 @@
<imgdir name="item"> <imgdir name="item">
<imgdir name="0"> <imgdir name="0">
<int name="id" value="4031118" /> <int name="id" value="4031118" />
<int name="count" value="3" /> <int name="count" value="1" />
</imgdir> </imgdir>
</imgdir> </imgdir>
</imgdir> </imgdir>
+1 -3
View File
@@ -43616,6 +43616,7 @@
<int name="count" value="10" /> <int name="count" value="10" />
</imgdir> </imgdir>
</imgdir> </imgdir>
<string name="endscript" value="q3454e" />
</imgdir> </imgdir>
<imgdir name="0"> <imgdir name="0">
<int name="npc" value="2050001" /> <int name="npc" value="2050001" />
@@ -43649,7 +43650,6 @@
<imgdir name="0"> <imgdir name="0">
<int name="npc" value="2050002" /> <int name="npc" value="2050002" />
<int name="interval" value="0" /> <int name="interval" value="0" />
<string name="startscript" value="q3455s" />
<imgdir name="quest"> <imgdir name="quest">
<imgdir name="0"> <imgdir name="0">
<int name="id" value="3457" /> <int name="id" value="3457" />
@@ -49954,8 +49954,6 @@
<imgdir name="4306"> <imgdir name="4306">
<imgdir name="1"> <imgdir name="1">
<int name="npc" value="9120003" /> <int name="npc" value="9120003" />
<string name="start" value="2000010100" />
<string name="end" value="2000010200" />
<imgdir name="item"> <imgdir name="item">
<imgdir name="0"> <imgdir name="0">
<int name="id" value="4000222" /> <int name="id" value="4000222" />