diff --git a/build/built-jar.properties b/build/built-jar.properties index 86bc43705f..49c99bf7cd 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Sun, 04 Jun 2017 22:54:17 -0300 +#Mon, 05 Jun 2017 18:49:35 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/client/command/Commands$1.class b/build/classes/client/command/Commands$1.class index c487a6b1b3..d837825cda 100644 Binary files a/build/classes/client/command/Commands$1.class and b/build/classes/client/command/Commands$1.class differ diff --git a/build/classes/client/command/Commands.class b/build/classes/client/command/Commands.class index ff2234012a..809ceafcab 100644 Binary files a/build/classes/client/command/Commands.class and b/build/classes/client/command/Commands.class differ diff --git a/build/classes/constants/GameConstants$1.class b/build/classes/constants/GameConstants$1.class index a90c55a7d8..98b1548010 100644 Binary files a/build/classes/constants/GameConstants$1.class and b/build/classes/constants/GameConstants$1.class differ diff --git a/build/classes/constants/GameConstants.class b/build/classes/constants/GameConstants.class index 627f9a2b43..0875f6693f 100644 Binary files a/build/classes/constants/GameConstants.class and b/build/classes/constants/GameConstants.class differ diff --git a/build/classes/constants/skills/Hermit.class b/build/classes/constants/skills/Hermit.class index d081caf490..d917bf560e 100644 Binary files a/build/classes/constants/skills/Hermit.class and b/build/classes/constants/skills/Hermit.class differ diff --git a/build/classes/net/server/channel/handlers/ItemSortHandler.class b/build/classes/net/server/channel/handlers/ItemSortHandler.class index 144a666097..0e088c8d2a 100644 Binary files a/build/classes/net/server/channel/handlers/ItemSortHandler.class and b/build/classes/net/server/channel/handlers/ItemSortHandler.class differ diff --git a/build/classes/scripting/npc/NPCConversationManager.class b/build/classes/scripting/npc/NPCConversationManager.class index 55ad1a9684..c4b17f7b1d 100644 Binary files a/build/classes/scripting/npc/NPCConversationManager.class and b/build/classes/scripting/npc/NPCConversationManager.class differ diff --git a/build/classes/server/MapleItemInformationProvider$1.class b/build/classes/server/MapleItemInformationProvider$1.class index 78b1e2e6e9..c1720a4b6f 100644 Binary files a/build/classes/server/MapleItemInformationProvider$1.class and b/build/classes/server/MapleItemInformationProvider$1.class differ diff --git a/build/classes/server/MapleItemInformationProvider$RewardItem.class b/build/classes/server/MapleItemInformationProvider$RewardItem.class index cc7d6d36de..b1484b85c7 100644 Binary files a/build/classes/server/MapleItemInformationProvider$RewardItem.class and b/build/classes/server/MapleItemInformationProvider$RewardItem.class differ diff --git a/build/classes/server/MapleItemInformationProvider$scriptedItem.class b/build/classes/server/MapleItemInformationProvider$scriptedItem.class index 8215b2c515..f8ca9b5ab5 100644 Binary files a/build/classes/server/MapleItemInformationProvider$scriptedItem.class and b/build/classes/server/MapleItemInformationProvider$scriptedItem.class differ diff --git a/build/classes/server/MapleItemInformationProvider.class b/build/classes/server/MapleItemInformationProvider.class index 2f20343a9c..975fd3e446 100644 Binary files a/build/classes/server/MapleItemInformationProvider.class and b/build/classes/server/MapleItemInformationProvider.class differ diff --git a/build/classes/server/life/MapleMonsterInformationProvider.class b/build/classes/server/life/MapleMonsterInformationProvider.class index 3cb432d520..284d110ec6 100644 Binary files a/build/classes/server/life/MapleMonsterInformationProvider.class and b/build/classes/server/life/MapleMonsterInformationProvider.class differ diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar index a2e20fde2e..2c3d52e6bf 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index 28041b43ff..a00b96ba92 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -290,4 +290,8 @@ Equips apenas cosm Otimizados o método de ganho de stats de equips ao nivelar. Diversos ajustes finos nos comandos existentes. Adicionados novos comandos: proitem, seteqstats, buffme, buffmap. -Vários ajustes finos \ No newline at end of file +Vários ajustes finos em alguns comandos. + +05 Junho 2016, +Novo NPC Skillbook announcer: Abdula. +Consertada a função que retorna se uma skill pertence ou não à árvore de habilidades do jogador. \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index b701fc2280..6d8d3ad834 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -11,19 +11,6 @@ - - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/ItemIdSortHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Equip.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleStat.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/MapleServerHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleStatEffect.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Item.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/life/MobSkill.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java - + diff --git a/scripts/npc/9010001.js b/scripts/npc/9010001.js new file mode 100644 index 0000000000..1524ce2db3 --- /dev/null +++ b/scripts/npc/9010001.js @@ -0,0 +1,9 @@ +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + cm.sendNext("Hi, I'm #p9010001#."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/9010002.js b/scripts/npc/9010002.js new file mode 100644 index 0000000000..d52b10c883 --- /dev/null +++ b/scripts/npc/9010002.js @@ -0,0 +1,9 @@ +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + cm.sendNext("Hi, I'm #p9010002#."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/9010003.js b/scripts/npc/9010003.js index c6fa8d198f..1392ab4c85 100644 --- a/scripts/npc/9010003.js +++ b/scripts/npc/9010003.js @@ -1,70 +1,9 @@ -/* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer - - 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 . -*/ -var status = 0; - function start() { - cm.dispose(); - /*var em = cm.getEventManager("lolcastle"); - if (em == null || !em.getProperty("entryPossible").equals("true")) { - cm.sendOk("I am Ria."); - cm.dispose(); - } else - cm.sendNext("I am Ria. For a small fee of #b1000000 meso#k I can send you to the #rField of Judgement#k."); -*/ + status = -1; + action(1, 0, 0); } function action(mode, type, selection) { - cm.dispose(); - /* if (mode == -1) - cm.dispose(); - else { - if (mode == 0) { - cm.sendOk("All right, see you next time."); - cm.dispose(); - return; - } - status++; - if (status == 1) - cm.sendYesNo("Do you wish to enter #rField of Judgement#k now?"); - else if (status == 2) { - var em = cm.getEventManager("lolcastle"); - if (cm.getMeso() < 1000000) { - cm.sendOk("You do not have enough mesos."); - cm.dispose(); - } else if (cm.getPlayer().getLevel() < 21) { - cm.sendOk("You have to be at least level 21 to enter #rField of Judgement.#k"); - cm.dispose(); - } else if (cm.getPlayer().getLevel() >= 21 && cm.getPlayer().getLevel() < 31) - em.getInstance("lolcastle1").registerPlayer(cm.getPlayer()); - else if (cm.getPlayer().getLevel() >= 31 && cm.getPlayer().getLevel() < 51) - em.getInstance("lolcastle2").registerPlayer(cm.getPlayer()); - else if (cm.getPlayer().getLevel() >= 51 && cm.getPlayer().getLevel() < 71) - em.getInstance("lolcastle3").registerPlayer(cm.getPlayer()); - else if (cm.getPlayer().getLevel() >= 71 && cm.getPlayer().getLevel() < 91) - em.getInstance("lolcastle4").registerPlayer(cm.getPlayer()); - else - em.getInstance("lolcastle5").registerPlayer(cm.getPlayer()); - cm.gainMeso(-1000000); - cm.dispose(); - } - }*/ -} + cm.sendNext("Hi, I'm #p9010003#."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/9010004.js b/scripts/npc/9010004.js new file mode 100644 index 0000000000..92572d934e --- /dev/null +++ b/scripts/npc/9010004.js @@ -0,0 +1,9 @@ +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + cm.sendNext("Hi, I'm #p9010004#."); + cm.dispose(); +} \ No newline at end of file diff --git a/scripts/npc/9209000.js b/scripts/npc/9209000.js index d20c84c109..7785f506bf 100644 --- a/scripts/npc/9209000.js +++ b/scripts/npc/9209000.js @@ -1,88 +1,86 @@ -/* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer - - 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 . +/** + * @author: Ronan + * @npc: Abdula + * @map: Multiple cities on Maplestory + * @func: Job Skill / Mastery Book Drop Announcer */ -status = -1; -var sel; -var pickup = -1; +var status; +var selected = 0; +var skillbook = [], masterybook = [], table = []; function start() { - cm.sendSimple("I'm Abdula, and I am a merchant intermediary who deals with rare goods. What do you have for me?#b\r\n#L0#I want to sell goods.\r\n#L1#I want to know about current market prices.\r\n#L2#A merchant intermediary? What is that?"); + status = -1; + selected = 0; + action(1, 0, 0); } function action(mode, type, selection) { - status++; - if(mode != 1){ - if(mode == 0 && status == 0){ - cm.dispose(); - return; - }else if(mode == 0 && sel == 0 && status == 2){ - cm.sendNext("You don't want to sell it right now? You can sell it later, but remember the Special Items are only valuable for a week."); - cm.dispose(); - return; - }else if(mode == 0 && sel == 2) - status -= 2; - } - if(status == 0){ - if(sel == undefined) - sel = selection; - if (selection == 0){ - var text = "Let's see what you brought...#b"; - for(var i = 0; i < 5; i++) - text += "\r\n#L" + i + "##t" + (3994090 + i) + "#"; - cm.sendSimple(text); - }else if (selection == 1){ - var text = ""; - for(var i = 0; i < 5; i++) - text += "The current market price for #t" + (i + 3994090) + "# is #rNOT DONE#k mesos\r\n"; - cm.sendNext(text); - cm.dispose(); - }else - cm.sendNext("I buy the products at the Maple 7th Day Market and sell them in other towns. I trade memorabilia, spices, taxidermy shark, and more... but no Lazy Daisy's eggs."); - }else if(status == 1){ - if(sel == 0){ - if(cm.haveItem(3994090 + selection)){ - pickup = 3994090 + selection; - cm.sendYesNo("The current price is 180 mesos. Would you like to sell it now?"); //Make a price changer by hour. - }else{ - cm.sendNext("You don't have anything. Stop wasting my time... I'm a busy person."); - cm.dispose(); - } - }else - cm.sendNextPrev("Maple 7th Day Market Sundays are my days off. If you need to see me, you're going to have to come Monday to Friday..."); - }else if(status == 2){ - if(sel == 0) - cm.sendGetNumber("How many would you like to sell?", 0, 0, 200); - else{ - cm.sendPrev("Oh, and the prices are subject to change. I can't get the short end of the stick, I have to stay in business! Check back with me frequently, my prices change by the hour!"); - } - }else if(status == 3){ - if(sel == 0) - if(selection != 1) - cm.sendNext("Something's not right. Check again."); - else{ - cm.sendNext("The transaction has been completed. See you next time."); - cm.gainMeso(180); - cm.gainItem(pickup, -1); - } + if (mode == -1) { cm.dispose(); + } else { + if (mode == 0 && status == 0) { + cm.dispose(); + return; + } + if (mode == 1) + status++; + else + status--; + + if (status == 0) { + var greeting = "Hello, I'm #p9209000#, the Skill & Mastery Book announcer! "; + skillbook = cm.getAvailableSkillBooks(); + masterybook = cm.getAvailableMasteryBooks(); + + if(skillbook.length == 0 && masterybook.length == 0) { + cm.sendOk(greeting + "There are no more books available to further improve your job skills for now. Either you maxed out everything or you didn't reach the minimum requisites for some skill books yet."); + cm.dispose(); + + } else if(skillbook.length > 0 && masterybook.length > 0) { + var sendStr = greeting + "New opportunities for skill improvement have been located for you to improve your skills! Pick a type to take a look onto.\r\n\r\n#b"; + + sendStr += "#L1# Skill Book#l\r\n"; + sendStr += "#L2# Mastery Book#l\r\n"; + + cm.sendSimple(sendStr); + } else if(skillbook.length > 0) { + selected = 1; + cm.sendNext(greeting + "New opportunities for skill improvement have been located for you to improve your skills! Only skill learns available for now."); + } else { + selected = 2; + cm.sendNext(greeting + "New opportunities for skill improvement have been located for you to improve your skills! Only skill upgrades available."); + } + + } else if(status == 1) { + var sendStr = "The following books are currently available:\r\n\r\n"; + if(selected == 0) selected = selection; + + table = (selected == 1) ? skillbook : masterybook; + for(var i = 0; i < table.length; i++) { + sendStr += " #L" + i + "# #i" + table[i] + "# #t" + table[i] + "##l\r\n"; + } + + cm.sendSimple(sendStr); + + } else if(status == 2) { + selected = selection; + var mobList = cm.getNamesWhoDropsItem(table[selected]); + + var sendStr; + if(mobList.length == 0) { + sendStr = "No mobs drop '#b#t" + table[selected] + "##k'."; + + } else { + sendStr = "The following mobs drop '#b#t" + table[selected] + "##k':\r\n\r\n"; + + for(var i = 0; i < mobList.length; i++) { + sendStr += " #L" + i + "# " + mobList[i] + "#l\r\n"; + } + } + + cm.sendOk(sendStr); + cm.dispose(); + } } -} \ No newline at end of file +} diff --git a/scripts/npc/9209000_old.js b/scripts/npc/9209000_old.js new file mode 100644 index 0000000000..d20c84c109 --- /dev/null +++ b/scripts/npc/9209000_old.js @@ -0,0 +1,88 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + 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 . +*/ + +status = -1; +var sel; +var pickup = -1; + +function start() { + cm.sendSimple("I'm Abdula, and I am a merchant intermediary who deals with rare goods. What do you have for me?#b\r\n#L0#I want to sell goods.\r\n#L1#I want to know about current market prices.\r\n#L2#A merchant intermediary? What is that?"); +} + +function action(mode, type, selection) { + status++; + if(mode != 1){ + if(mode == 0 && status == 0){ + cm.dispose(); + return; + }else if(mode == 0 && sel == 0 && status == 2){ + cm.sendNext("You don't want to sell it right now? You can sell it later, but remember the Special Items are only valuable for a week."); + cm.dispose(); + return; + }else if(mode == 0 && sel == 2) + status -= 2; + } + if(status == 0){ + if(sel == undefined) + sel = selection; + if (selection == 0){ + var text = "Let's see what you brought...#b"; + for(var i = 0; i < 5; i++) + text += "\r\n#L" + i + "##t" + (3994090 + i) + "#"; + cm.sendSimple(text); + }else if (selection == 1){ + var text = ""; + for(var i = 0; i < 5; i++) + text += "The current market price for #t" + (i + 3994090) + "# is #rNOT DONE#k mesos\r\n"; + cm.sendNext(text); + cm.dispose(); + }else + cm.sendNext("I buy the products at the Maple 7th Day Market and sell them in other towns. I trade memorabilia, spices, taxidermy shark, and more... but no Lazy Daisy's eggs."); + }else if(status == 1){ + if(sel == 0){ + if(cm.haveItem(3994090 + selection)){ + pickup = 3994090 + selection; + cm.sendYesNo("The current price is 180 mesos. Would you like to sell it now?"); //Make a price changer by hour. + }else{ + cm.sendNext("You don't have anything. Stop wasting my time... I'm a busy person."); + cm.dispose(); + } + }else + cm.sendNextPrev("Maple 7th Day Market Sundays are my days off. If you need to see me, you're going to have to come Monday to Friday..."); + }else if(status == 2){ + if(sel == 0) + cm.sendGetNumber("How many would you like to sell?", 0, 0, 200); + else{ + cm.sendPrev("Oh, and the prices are subject to change. I can't get the short end of the stick, I have to stay in business! Check back with me frequently, my prices change by the hour!"); + } + }else if(status == 3){ + if(sel == 0) + if(selection != 1) + cm.sendNext("Something's not right. Check again."); + else{ + cm.sendNext("The transaction has been completed. See you next time."); + cm.gainMeso(180); + cm.gainItem(pickup, -1); + } + cm.dispose(); + } +} \ No newline at end of file diff --git a/src/client/MapleJob.java b/src/client/MapleJob.java index 9c1287f3e4..4a7eb9c64b 100644 --- a/src/client/MapleJob.java +++ b/src/client/MapleJob.java @@ -59,8 +59,8 @@ public enum MapleJob { LEGEND(2000), EVAN(2001), ARAN1(2100),ARAN2(2110), ARAN3(2111), ARAN4(2112), - EVAN1(2200), EVAN2(2210), EVAN3(2211), EVAN4(2212), EVAN5(2213), EVAN6(2214), - EVAN7(2215), EVAN8(2216), EVAN9(2217), EVAN10(2218); + EVAN1(2200), EVAN2(2210), EVAN3(2211), EVAN4(2212), EVAN5(2213), EVAN6(2214), + EVAN7(2215), EVAN8(2216), EVAN9(2217), EVAN10(2218); final int jobid; final static int maxId = 22; // maxId = (EVAN / 100); diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java index d02fc02e50..13018ebf09 100644 --- a/src/client/command/Commands.java +++ b/src/client/command/Commands.java @@ -99,6 +99,10 @@ import client.inventory.MaplePet; import constants.GameConstants; import constants.ItemConstants; import constants.ServerConstants; +import constants.skills.Assassin; +import constants.skills.Cleric; +import constants.skills.Priest; +import constants.skills.Spearman; import java.util.ArrayList; import server.maps.FieldLimit; @@ -768,17 +772,17 @@ public class Commands { victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp()); } } else if (sub[0].equals("empowerme")) { - final int[] array = {9001000, 9001001, 9101002, 9101003, 9101008, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002}; + final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002}; for (int i : array) { SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player); } } else if (sub[0].equals("buffme")) { //GM Skills : Haste(Super) - Holy Symbol - Bless - Hyper Body - Echo of Hero - SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player); - SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player); - SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player); - SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(1301007).getEffect(SkillFactory.getSkill(1301007).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(2301004).getEffect(SkillFactory.getSkill(2301004).getMaxLevel()).applyTo(player); SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(player); player.setHp(player.getMaxHp()); player.updateSingleStat(MapleStat.HP, player.getMaxHp()); @@ -787,10 +791,10 @@ public class Commands { } else if (sub[0].equals("buffmap")) { for (MapleCharacter chr : player.getMap().getCharacters()){ //GM Skills : Haste(Super) - Holy Symbol - Bless - Hyper Body - Echo of Hero - SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(chr); - SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(chr); - SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(chr); - SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(1301007).getEffect(SkillFactory.getSkill(1301007).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(2301004).getEffect(SkillFactory.getSkill(2301004).getMaxLevel()).applyTo(chr); SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(chr); chr.setHp(chr.getMaxHp()); chr.updateSingleStat(MapleStat.HP, chr.getMaxHp()); @@ -808,7 +812,7 @@ public class Commands { if(skill != null) skill.getEffect(skill.getMaxLevel()).applyTo(player); } else if (sub[0].equals("proitem")) { if (sub.length < 3) { - player.dropMessage("Syntax: !proitem "); + player.yellowMessage("Syntax: !proitem "); return true; } @@ -831,63 +835,39 @@ public class Commands { } else if (sub[0].equals("seteqstat")) { if (sub.length < 2) { - player.dropMessage("Syntax: !seteqstat "); + player.yellowMessage("Syntax: !seteqstat "); return true; } - int val = Integer.parseInt(sub[1]); - + int newStat = Integer.parseInt(sub[1]); MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP); - for (byte i = 0; i < 101; i++) { - try { - Equip eu = (Equip) equip.getItem(i); - int item = equip.getItem(i).getItemId(); - short hand = eu.getHands(); - byte level = eu.getLevel(); - Equip nItem = new Equip(item, i); - nItem.setStr(eu.getStr()); // STR - nItem.setDex(eu.getDex()); // DEX - nItem.setInt(eu.getInt()); // INT - nItem.setLuk(eu.getLuk()); //LUK - nItem.setWatk(eu.getWatk()); //WA - - //All Previous stats excluding the top 5 - nItem.setWdef(eu.getWdef()); - nItem.setAcc(eu.getHands()); - nItem.setAvoid(eu.getAvoid()); - nItem.setExpiration(eu.getExpiration()); - nItem.setJump(eu.getJump()); - nItem.setLevel(eu.getLevel()); - nItem.setMatk(eu.getMatk()); - nItem.setMdef(eu.getMdef()); - nItem.setMp(eu.getMp()); - nItem.setOwner(eu.getOwner()); - nItem.setSpeed(eu.getSpeed()); - nItem.setUpgradeSlots((byte) eu.getUpgradeSlots()); - nItem.setHands(eu.getHands()); - nItem.setLevel(eu.getLevel()); - short incval= (short)val; - nItem.setWdef(incval); - nItem.setAcc(incval); - nItem.setAvoid(incval); - nItem.setJump(incval); - nItem.setMatk(incval); - nItem.setMdef(incval); - nItem.setMp(incval); - nItem.setSpeed(incval); - nItem.setUpgradeSlots((byte) eu.getUpgradeSlots()); - nItem.setHands(incval); - nItem.setWatk(incval); - nItem.setDex(incval); - nItem.setInt(incval); - nItem.setStr(incval); - nItem.setLuk(incval); - Item tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i); - MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte)i, tempItem.getQuantity(), false, true); - player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem); - } catch(Exception e){} + + for (byte i = 1; i <= equip.getSlotLimit(); i++) { + try { + Equip eu = (Equip) equip.getItem(i); + if(eu == null) continue; + + short incval= (short)newStat; + eu.setWdef(incval); + eu.setAcc(incval); + eu.setAvoid(incval); + eu.setJump(incval); + eu.setMatk(incval); + eu.setMdef(incval); + eu.setMp(incval); + eu.setSpeed(incval); + eu.setHands(incval); + eu.setWatk(incval); + eu.setDex(incval); + eu.setInt(incval); + eu.setStr(incval); + eu.setLuk(incval); + player.forceUpdateItem(eu); + } catch(Exception e){ + e.printStackTrace(); + } } - c.getSession().write(MaplePacketCreator.getCharInfo(player)); + //c.getSession().write(MaplePacketCreator.getCharInfo(player)); //player.getMap().removePlayer(player); //player.getMap().addPlayer(player); } else if (sub[0].equals("spawn")) { @@ -1369,6 +1349,7 @@ public class Commands { } else if (sub[0].equals("maxstat")) { final String[] s = {"setall", String.valueOf(Short.MAX_VALUE)}; executeGMCommand(c, s, heading); + player.gainExp(-player.getExp(), false, false); player.setLevel(255); player.setFame(13337); player.setMaxHp(30000); @@ -1377,6 +1358,9 @@ public class Commands { player.updateSingleStat(MapleStat.FAME, 13337); player.updateSingleStat(MapleStat.MAXHP, 30000); player.updateSingleStat(MapleStat.MAXMP, 30000); + player.revertPlayerRates(); + player.setPlayerRates(); + player.yellowMessage("Stats maxed out."); } else if (sub[0].equals("maxskills")) { for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img").getChildren()) { try { @@ -1388,10 +1372,10 @@ public class Commands { nfe.printStackTrace(); break; } catch (NullPointerException npe) { - npe.printStackTrace(); continue; } } + player.yellowMessage("Skills maxed out."); } else if (sub[0].equals("mesos")) { if (sub.length >= 2) { player.gainMeso(Integer.parseInt(sub[1]), true); diff --git a/src/constants/GameConstants.java b/src/constants/GameConstants.java index 28455552c5..3cecc83e8a 100644 --- a/src/constants/GameConstants.java +++ b/src/constants/GameConstants.java @@ -70,12 +70,37 @@ public class GameConstants { return job == 2000 || (job >= 2100 && job <= 2112); } + private static boolean isInBranchJobTree(int skillJobId, int jobId, int branchType) { + int branch = (int)(Math.pow(10, branchType)); + + int skillBranch = (int)(skillJobId / branch) * branch; + int jobBranch = (int)(jobId / branch) * branch; + + return skillBranch == jobBranch; + } + + private static boolean hasDivergedBranchJobTree(int skillJobId, int jobId, int branchType) { + int branch = (int)(Math.pow(10, branchType)); + + int skillBranch = (int)(skillJobId / branch); + int jobBranch = (int)(jobId / branch); + + return skillBranch != jobBranch && skillBranch % 10 != 0; + } + public static boolean isInJobTree(int skillId, int jobId) { - int skill = skillId / 10000; - if ((jobId - skill) + skill == jobId) { - return true; - } - return false; + int skillJob = skillId / 10000; + + if(!isInBranchJobTree(skillJob, jobId, 0)) { + for(int i = 1; i <= 3; i++) { + if(hasDivergedBranchJobTree(skillJob, jobId, i)) return false; + if(isInBranchJobTree(skillJob, jobId, i)) return true; + } + } else { + return true; + } + + return false; } public static boolean isPqSkill(final int skill) { diff --git a/src/constants/skills/Hermit.java b/src/constants/skills/Hermit.java index e2eff0ff36..fae114363b 100644 --- a/src/constants/skills/Hermit.java +++ b/src/constants/skills/Hermit.java @@ -32,5 +32,5 @@ public class Hermit { public static final int SHADOW_WEB = 4111003; public static final int SHADOW_MESO = 4111004; public static final int AVENGER = 4111005; - public static final int FLASH_JUML = 4111006; + public static final int FLASH_JUMP = 4111006; } diff --git a/src/net/server/channel/handlers/ItemSortHandler.java b/src/net/server/channel/handlers/ItemSortHandler.java index 24a53b8470..b8902553f8 100644 --- a/src/net/server/channel/handlers/ItemSortHandler.java +++ b/src/net/server/channel/handlers/ItemSortHandler.java @@ -42,58 +42,58 @@ public final class ItemSortHandler extends AbstractMaplePacketHandler { MapleInventoryType inventoryType = MapleInventoryType.getByType(slea.readByte()); if(!ServerConstants.USE_ITEM_SORT) { - c.announce(MaplePacketCreator.enableActions()); - return; + c.announce(MaplePacketCreator.enableActions()); + return; } MapleInventory inventory = c.getPlayer().getInventory(inventoryType); //------------------- RonanLana's SLOT MERGER ----------------- - - MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); - Item srcItem, dstItem; - - for(short dst = 0; dst <= inventory.getSlotLimit(); dst++) { - dstItem = inventory.getItem(dst); - if(dstItem == null) continue; - - for(short src = (short)(dst + 1); src <= inventory.getSlotLimit(); src++) { - srcItem = inventory.getItem(src); - if(srcItem == null) continue; - - if(dstItem.getItemId() != srcItem.getItemId()) continue; - if(dstItem.getQuantity() == ii.getSlotMax(c, inventory.getItem(dst).getItemId())) break; - - MapleInventoryManipulator.move(c, inventoryType, src, dst); - } - } + + MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); + Item srcItem, dstItem; + + for(short dst = 1; dst <= inventory.getSlotLimit(); dst++) { + dstItem = inventory.getItem(dst); + if(dstItem == null) continue; + + for(short src = (short)(dst + 1); src <= inventory.getSlotLimit(); src++) { + srcItem = inventory.getItem(src); + if(srcItem == null) continue; + + if(dstItem.getItemId() != srcItem.getItemId()) continue; + if(dstItem.getQuantity() == ii.getSlotMax(c, inventory.getItem(dst).getItemId())) break; + + MapleInventoryManipulator.move(c, inventoryType, src, dst); + } + } //------------------------------------------------------------ - inventory = c.getPlayer().getInventory(inventoryType); - boolean sorted = false; - - while (!sorted) { - short freeSlot = inventory.getNextFreeSlot(); - - if (freeSlot != -1) { - short itemSlot = -1; - for (short i = (short) (freeSlot + 1); i <= inventory.getSlotLimit(); i = (short) (i + 1)) { - if (inventory.getItem(i) != null) { - itemSlot = i; - break; - } - } - if (itemSlot > 0) { - MapleInventoryManipulator.move(c, inventoryType, itemSlot, freeSlot); - } else { - sorted = true; - } - } else { - sorted = true; - } - } - c.announce(MaplePacketCreator.finishedSort(inventoryType.getType())); - c.announce(MaplePacketCreator.enableActions()); + inventory = c.getPlayer().getInventory(inventoryType); + boolean sorted = false; + + while (!sorted) { + short freeSlot = inventory.getNextFreeSlot(); + + if (freeSlot != -1) { + short itemSlot = -1; + for (short i = (short) (freeSlot + 1); i <= inventory.getSlotLimit(); i = (short) (i + 1)) { + if (inventory.getItem(i) != null) { + itemSlot = i; + break; + } + } + if (itemSlot > 0) { + MapleInventoryManipulator.move(c, inventoryType, itemSlot, freeSlot); + } else { + sorted = true; + } + } else { + sorted = true; + } + } + c.announce(MaplePacketCreator.finishedSort(inventoryType.getType())); + c.announce(MaplePacketCreator.enableActions()); } } \ No newline at end of file diff --git a/src/net/server/channel/handlers/SkillBookHandler.java b/src/net/server/channel/handlers/SkillBookHandler.java index d816d451a0..6f953afbbd 100644 --- a/src/net/server/channel/handlers/SkillBookHandler.java +++ b/src/net/server/channel/handlers/SkillBookHandler.java @@ -59,7 +59,7 @@ public final class SkillBookHandler extends AbstractMaplePacketHandler { if (skilldata == null) { return; } - Skill skill2 = SkillFactory.getSkill(skilldata.get("skillid")); + Skill skill2 = SkillFactory.getSkill(skilldata.get("skillid")); if (skilldata.get("skillid") == 0) { canuse = false; } else if ((player.getSkillLevel(skill2) >= skilldata.get("reqSkillLevel") || skilldata.get("reqSkillLevel") == 0) && player.getMasterLevel(skill2) < skilldata.get("masterLevel")) { diff --git a/src/scripting/npc/NPCConversationManager.java b/src/scripting/npc/NPCConversationManager.java index 28d9cfa305..37cf70e74f 100644 --- a/src/scripting/npc/NPCConversationManager.java +++ b/src/scripting/npc/NPCConversationManager.java @@ -63,6 +63,8 @@ import client.inventory.MapleInventoryType; import client.inventory.MaplePet; import constants.ExpTable; import constants.ServerConstants; +import java.util.Map; +import java.util.Set; /** * @@ -457,4 +459,17 @@ public class NPCConversationManager extends AbstractPlayerInteraction { dispose(); return true; } + + public Object[] getAvailableMasteryBooks() { + return MapleItemInformationProvider.getInstance().usableMasteryBooks(this.getPlayer()).toArray(); + } + + public Object[] getAvailableSkillBooks() { + return MapleItemInformationProvider.getInstance().usableSkillBooks(this.getPlayer()).toArray(); + } + + public Object[] getNamesWhoDropsItem(Integer itemId) { + return MapleItemInformationProvider.getInstance().getWhoDrops(itemId).toArray(); + } + } diff --git a/src/server/MapleItemInformationProvider.java b/src/server/MapleItemInformationProvider.java index cc940b6319..91aba8ebf6 100644 --- a/src/server/MapleItemInformationProvider.java +++ b/src/server/MapleItemInformationProvider.java @@ -33,6 +33,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; +import java.util.HashSet; import net.server.Server; import provider.MapleData; @@ -49,6 +51,7 @@ import tools.Randomizer; import client.MapleCharacter; import client.MapleClient; import client.MapleJob; +import client.Skill; import client.SkillFactory; import client.autoban.AutobanFactory; import client.inventory.Equip; @@ -62,6 +65,7 @@ import constants.ItemConstants; import constants.skills.Assassin; import constants.skills.Gunslinger; import constants.skills.NightWalker; +import server.life.MapleMonsterInformationProvider; /** * @@ -1509,6 +1513,58 @@ public class MapleItemInformationProvider { return list; } + + public Set getWhoDrops(Integer itemId) { + Set list = new HashSet<>(); + + try { + PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement("SELECT * FROM drop_data WHERE itemid = ? LIMIT 50"); + ps.setInt(1, itemId); + ResultSet rs = ps.executeQuery(); + while(rs.next()) { + String resultName = MapleMonsterInformationProvider.getMobNameFromId(rs.getInt("dropperid")); + if (resultName != null) { + list.add(resultName); + } + } + rs.close(); + ps.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + return list; + } + + private boolean canUseSkillBook(MapleCharacter player, Integer skillBookId) { + Map skilldata = MapleItemInformationProvider.getInstance().getSkillStats(skillBookId, player.getJob().getId()); + if(skilldata == null || skilldata.get("skillid") == 0) return false; + + Skill skill2 = SkillFactory.getSkill(skilldata.get("skillid")); + return (skilldata.get("skillid") != 0 && ((player.getSkillLevel(skill2) >= skilldata.get("reqSkillLevel") || skilldata.get("reqSkillLevel") == 0) && player.getMasterLevel(skill2) < skilldata.get("masterLevel"))); + } + + public List usableMasteryBooks(MapleCharacter player) { + List masterybook = new LinkedList<>(); + for(Integer i = 2290000; i <= 2290125; i++) { + if(canUseSkillBook(player, i)) { + masterybook.add(i); + } + } + + return masterybook; + } + + public List usableSkillBooks(MapleCharacter player) { + List skillbook = new LinkedList<>(); + for(Integer i = 2280000; i <= 2280012; i++) { + if(canUseSkillBook(player, i)) { + skillbook.add(i); + } + } + + return skillbook; + } public class scriptedItem { diff --git a/src/server/life/MapleMonsterInformationProvider.java b/src/server/life/MapleMonsterInformationProvider.java index 13cf59916f..d5d25658f7 100644 --- a/src/server/life/MapleMonsterInformationProvider.java +++ b/src/server/life/MapleMonsterInformationProvider.java @@ -109,12 +109,12 @@ public class MapleMonsterInformationProvider { while (rs.next()) { ret.add( - new MonsterDropEntry( - rs.getInt("itemid"), - rs.getInt("chance"), - rs.getInt("minimum_quantity"), - rs.getInt("maximum_quantity"), - rs.getShort("questid"))); + new MonsterDropEntry( + rs.getInt("itemid"), + rs.getInt("chance"), + rs.getInt("minimum_quantity"), + rs.getInt("maximum_quantity"), + rs.getShort("questid"))); } } catch (SQLException e) { e.printStackTrace(); @@ -155,7 +155,25 @@ public class MapleMonsterInformationProvider { return retMobs; } - public static String getMobNameFromID(int id) + public static String getMobNameFromId(int id) + { + try + { + return MapleLifeFactory.getMonster(id).getName(); + } + catch (NullPointerException npe) + { + return null; //nonexistant mob + } + catch (Exception e) + { + e.printStackTrace(); + System.err.println("Nonexistant mob id " + id); + return null; //nonexistant mob + } + } + + public static String getMobNameFromID(int id) { try {