diff --git a/README.md b/README.md index 1036c76570..a5cb2bd5fd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# HeavenMS (MapleSolaxiaV2) +# HeavenMS --- ## Head developer: Ronan C. P. Lana @@ -22,11 +22,17 @@ Client files & general tools: https://drive.google.com/drive/folders/0BzDsHSr-0V **Important note about localhosts**: these executables are red-flagged by antivirus tools as __potentially malicious softwares__, this happens due to the reverse engineering methods that were applied onto these software artifacts. Those depicted here have been put to use for years already and posed no harm so far, so they are soundly assumed to be safe. -Recommended localhost: https://hostr.co/fuzm4X9j7TWh +Recommended localhost: https://hostr.co/MluJQNtzAnV9 -* Current revision: 'n' problem fixed and removed caps for WATK, WDEF, MDEF, ACC, AVOID. +**Change log:** - * 'n' problem fixed https://hostr.co/r5QDmhlxpp8M + * Removed "AP excess" popup and limited actions on Admin/MWLB, credits to kevintjuh93. + + * Removed "You've gained a level!" popup, credits to PrinceReborn. + + * Removed caps for WATK, WDEF, MDEF, ACC, AVOID + + * 'n' problem fixed * Fraysa's https://hostr.co/gJbLZITRVHmv @@ -127,7 +133,7 @@ The client's set-up is quite straightforward: 2. Once done, erase these files: "HShield" (folder), "ASPLauncher.exe", "MapleStory.exe" and "patcher.exe". 3. Extract into the client folder the "localhost.exe" from the provided link. 4. Overwrite the original WZ files with the ones provided from either one of those folders on the Google Drive: - - "rev???_wz" (last published RELEASE, source update of same number). + - "rev???_wz" (last published RELEASE, referring to commit of same number). - "current_wz" (latest source update). #### Editing localhost IP target diff --git a/docs/backtrack_licenses/CafePQ NPCs/old_npc_source.bmp b/docs/backtrack_licenses/CafePQ NPCs/old_npc_source.bmp new file mode 100644 index 0000000000..c74cfc0823 Binary files /dev/null and b/docs/backtrack_licenses/CafePQ NPCs/old_npc_source.bmp differ diff --git a/docs/backtrack_licenses/CafePQ NPCs/origin.txt b/docs/backtrack_licenses/CafePQ NPCs/origin.txt new file mode 100644 index 0000000000..2fcdddd6ad --- /dev/null +++ b/docs/backtrack_licenses/CafePQ NPCs/origin.txt @@ -0,0 +1,3 @@ +Change reason: New NPC files uploaded in with misleading header. + +Committed 2017-09-01 (Reworked Autoassigner & Hero's Will & Trade + Visual NX + New commands) \ No newline at end of file diff --git a/docs/backtrack_licenses/Custom NPCs/origin.txt b/docs/backtrack_licenses/Custom NPCs/origin.txt new file mode 100644 index 0000000000..53846485d6 --- /dev/null +++ b/docs/backtrack_licenses/Custom NPCs/origin.txt @@ -0,0 +1,5 @@ +Change reason: New NPC files uploaded in with misleading/missing header. + +9000017.js: Introduced before repository started, around 2015-08-05 (extracted from mychanges_ptbr.txt @ "source" commit) +9000036.js: Introduced before repository started, around 2015-07-25 (extracted from mychanges_ptbr.txt @ "source" commit) +9000041.js: Committed 2016-07-18 (Instant sell NPC + new features) \ No newline at end of file diff --git a/docs/backtrack_licenses/GuildQuest/GuildQuest_new.js b/docs/backtrack_licenses/GuildQuest/GuildQuest_new.js new file mode 100644 index 0000000000..3cb811accc --- /dev/null +++ b/docs/backtrack_licenses/GuildQuest/GuildQuest_new.js @@ -0,0 +1,281 @@ +/* + * 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 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 + * @event: Sharenian Guild PQ +*/ + +var isPq = true; +var minPlayers = 1, maxPlayers = 30; +var minLevel = 1, maxLevel = 200; +var entryMap = 990000000; +var exitMap = 990001100; +var recruitMap = 101030104; +var clearMap = 990001101; + +var minMapId = 990000000; +var maxMapId = 990001101; + +var waitTime = 3; +var eventTime = 90; // 90 minutes + +var lobbyRange = [0, 0]; + +function init() { + setEventRequirements(); +} + +function setLobbyRange() { + return lobbyRange; +} + +function setEventRequirements() { + var reqStr = ""; + + reqStr += "\r\n Number of players: "; + if(maxPlayers - minPlayers >= 1) reqStr += minPlayers + " ~ " + maxPlayers; + else reqStr += minPlayers; + + reqStr += "\r\n Level range: "; + if(maxLevel - minLevel >= 1) reqStr += minLevel + " ~ " + maxLevel; + else reqStr += minLevel; + + reqStr += "\r\n Time limit: "; + reqStr += eventTime + " minutes"; + + em.setProperty("party", reqStr); +} + +function setEventExclusives(eim) { + var itemSet = [1032033, 4001024, 4001025, 4001026, 4001027, 4001028, 4001029, 4001030, 4001031, 4001032, 4001033, 4001034, 4001035, 4001037]; + eim.setExclusiveItems(itemSet); +} + +function setEventRewards(eim) { + var itemSet, itemQty, evLevel, expStages; + + evLevel = 1; //Rewards at clear PQ + itemSet = []; + itemQty = []; + eim.setEventRewards(evLevel, itemSet, itemQty); + + expStages = []; //bonus exp given on CLEAR stage signal + eim.setEventClearStageExp(expStages); +} + +function getEligibleParty(party) { //selects, from the given party, the team that is allowed to attempt this event + var eligible = []; + var hasLeader = false; + + var guildId = 0; + + if(party.size() > 0) { + var partyList = party.toArray(); + + for(var i = 0; i < party.size(); i++) { + var ch = partyList[i]; + if(ch.isLeader()) { + guildId = ch.getGuildId(); + break; + } + } + + for(var i = 0; i < party.size(); i++) { + var ch = partyList[i]; + + if(ch.getMapId() == recruitMap && ch.getLevel() >= minLevel && ch.getLevel() <= maxLevel && ch.getGuildId() == guildId) { + if(ch.isLeader()) hasLeader = true; + eligible.push(ch); + } + } + } + + if(!(hasLeader)) eligible = []; + return eligible; +} + +function setup(level, lobbyid) { + var eim = em.newInstance("Guild" + lobbyid); + eim.setProperty("level", level); + + eim.setProperty("guild", 0); + eim.setProperty("canJoin", 1); + eim.setProperty("statusStg1", -1); + + eim.getInstanceMap(990000000).resetPQ(level); + eim.getInstanceMap(990000100).resetPQ(level); + eim.getInstanceMap(990000200).resetPQ(level); + eim.getInstanceMap(990000300).resetPQ(level); + eim.getInstanceMap(990000301).resetPQ(level); + eim.getInstanceMap(990000400).resetPQ(level); + eim.getInstanceMap(990000401).resetPQ(level); + eim.getInstanceMap(990000410).resetPQ(level); + eim.getInstanceMap(990000420).resetPQ(level); + eim.getInstanceMap(990000430).resetPQ(level); + eim.getInstanceMap(990000431).resetPQ(level); + eim.getInstanceMap(990000440).resetPQ(level); + eim.getInstanceMap(990000500).resetPQ(level); + eim.getInstanceMap(990000501).resetPQ(level); + eim.getInstanceMap(990000502).resetPQ(level); + eim.getInstanceMap(990000600).resetPQ(level); + eim.getInstanceMap(990000610).resetPQ(level); + eim.getInstanceMap(990000611).resetPQ(level); + eim.getInstanceMap(990000620).resetPQ(level); + eim.getInstanceMap(990000630).resetPQ(level); + eim.getInstanceMap(990000631).resetPQ(level); + eim.getInstanceMap(990000640).resetPQ(level); + eim.getInstanceMap(990000641).resetPQ(level); + eim.getInstanceMap(990000700).resetPQ(level); + eim.getInstanceMap(990000800).resetPQ(level); + eim.getInstanceMap(990000900).resetPQ(level); + eim.getInstanceMap(990001000).resetPQ(level); + eim.getInstanceMap(990001100).resetPQ(level); + eim.getInstanceMap(990001101).resetPQ(level); + + respawnStages(eim); + + var ts = Date.now(); + ts += (60000 * waitTime); + eim.setProperty("entryTimestamp", "" + ts); + + eim.startEventTimer(waitTime * 60000); + + setEventRewards(eim); + setEventExclusives(eim); + + return eim; +} + +/* +function isTeamAllJobs(eim) { + var eventJobs = eim.getEventPlayersJobs(); + var rangeJobs = parseInt('111110', 2); + + return ((eventJobs & rangeJobs) == rangeJobs); +} +*/ + +function afterSetup(eim) { + eim.setProperty("guild", "" + eim.getLeader().getGuildId()); +} + +function respawnStages(eim) {} + +function playerEntry(eim, player) { + var map = eim.getMapInstance(entryMap); + player.changeMap(map, map.getPortal(0)); + + var texttt = "So, here is the brief. You guys should be warned that, once out on the fortress outskirts, anyone that would not be equipping the #b#t1032033##k will die instantly due to the deteriorated state of the air around there. That being said, once your team move out to the next stage, make sure to #bhit the glowing rocks#k in that region and #bequip the dropped item#k before advancing stages. That will protect you thoroughly from the air sickness. Good luck!"; + player.getClient().getSession().write(Packages.tools.MaplePacketCreator.getNPCTalk(9040000, /*(byte)*/ 0, texttt, "00 00", /*(byte)*/ 0)); +} + +function scheduledTimeout(eim) { + if(eim.getIntProperty("canJoin") == 1) { + eim.setProperty("canJoin", 0); + + if(eim.checkEventTeamLacking(true, minPlayers)) { + end(eim); + } else { + eim.startEventTimer(eventTime * 60000); + } + } else { + end(eim); + } +} + +function playerUnregistered(eim, player) {} + +function playerExit(eim, player) { + eim.unregisterPlayer(player); + player.changeMap(exitMap, 0); +} + +function changedMap(eim, player, mapid) { + if (mapid < minMapId || mapid > maxMapId) { + if (eim.isEventTeamLackingNow(true, minPlayers, player) && eim.getIntProperty("canJoin") == 0) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); + } +} + +function changedLeader(eim, leader) {} + +function playerDead(eim, player) {} + +function playerRevive(eim, player) { // player presses ok on the death pop up. + if (eim.isEventTeamLackingNow(true, minPlayers, player) && eim.getIntProperty("canJoin") == 0) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); +} + +function playerDisconnected(eim, player) { + if (eim.isEventTeamLackingNow(true, minPlayers, player) && eim.getIntProperty("canJoin") == 0) { + eim.unregisterPlayer(player); + end(eim); + } + else + eim.unregisterPlayer(player); +} + +function leftParty(eim, player) {} + +function disbandParty(eim) { + end(eim); +} + +function monsterValue(eim, mobId) { + return 1; +} + +function end(eim) { + var party = eim.getPlayers(); + for (var i = 0; i < party.size(); i++) { + playerExit(eim, party.get(i)); + } + eim.dispose(); +} + +function giveRandomEventReward(eim, player) { + eim.giveEventReward(player); +} + +function clearPQ(eim) { + eim.stopEventTimer(); + eim.setEventCleared(); +} + +function monsterKilled(mob, eim) {} + +function allMonstersDead(eim) {} + +function cancelSchedule() {} + +function dispose(eim) { + em.schedule("reopenGuildQuest", em.getLobbyDelay() * 1.5 * 1000); +} + +function reopenGuildQuest() { + em.attemptStartGuildInstance(); +} \ No newline at end of file diff --git a/docs/backtrack_licenses/GuildQuest/GuildQuest_old.js b/docs/backtrack_licenses/GuildQuest/GuildQuest_old.js new file mode 100644 index 0000000000..60e7a4cba2 --- /dev/null +++ b/docs/backtrack_licenses/GuildQuest/GuildQuest_old.js @@ -0,0 +1,208 @@ +/* + * 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 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 Lerk + * + * Guild Quest + */ + +var exitMap; +var waitingListCurrent = 0; + +importPackage(Packages.world); +importPackage(Packages.client); +importPackage(Packages.server.maps); +importPackage(java.lang); + +function init() { + em.setProperty("shuffleReactors","false"); + em.setProperty("canEnter", "true"); + em.setProperty("gpqOpen", "true"); +} + +function monsterValue(eim, mobId) { //should only trigger on ergoth + if (mobId == 9300028) { //but, just to be safe... + var rubian = new Packages.client.inventory.Item(4001024, 0, 1); + var map = eim.getMapInstance(990000900); + var reactor = map.getReactorByName("boss"); + map.spawnItemDrop(reactor, eim.getPlayers().get(0), rubian, reactor.getPosition(), true, false); + } + return -1; +} + + + +function setup(eim) { + exitMap = em.getChannelServer().getMapFactory().getMap(990001100); //returning path + + //shuffle reactors in two maps for stage 3 + eim.getMapInstance(990000501).shuffleReactors(); + eim.getMapInstance(990000502).shuffleReactors(); + + //force no-respawn on certain map reactors + eim.getMapInstance(990000611).getReactorByName("").setDelay(-1); + eim.getMapInstance(990000620).getReactorByName("").setDelay(-1); + eim.getMapInstance(990000631).getReactorByName("").setDelay(-1); + eim.getMapInstance(990000641).getReactorByName("").setDelay(-1); + + //activate three minutes after start + eim.setProperty("entryTimestamp", Packages.java.lang.System.currentTimeMillis()); + eim.setProperty("canEnter","true"); + eim.schedule("begin", 60000); + eim.startEventTimer(60000); +} + +function begin(eim) { + eim.setProperty("canEnter","false"); + var party = eim.getPlayers(); + //if (party.size() < 6) { //not enough to start + // end(eim,"There are no longer enough players to continue, and those remaining shall be warped out."); + //} else { + var iter = party.iterator(); + while (iter.hasNext()) { + iter.next().dropMessage(6,"The quest has begun."); + } + + eim.startEventTimer(1000 * 60 * 90); + eim.schedule("timeOut", 1000 * 60 * 90); +//} +} + +function timeOut(eim) { + end(eim, "Your allotted time to finish the quest has passed."); +} + +function playerEntry(eim, player) { + var map = eim.getMapInstance(990000000); + player.changeMap(map, map.getPortal(0)); +} + +function playerRevive(eim, player) { + var returnMap = 990000200; + if (eim.getProperty("canEnter").equals("true")) { + returnMap = 990000000; + } + player.setHp(50); + player.setStance(0); + player.changeMap(eim.getMapInstance(returnMap), eim.getMapInstance(returnMap).getPortal(0)); + return false; +} + +function playerDead(eim, player) { +} + +function playerDisconnected(eim, player) { + var party = eim.getPlayers(); + if (player.getName().equals(eim.getProperty("leader"))) { //check for party leader + //boot all players and end + var iter = party.iterator(); + while (iter.hasNext()) { + var pl = iter.next(); + pl.dropMessage(6,"The leader of the instance has disconnected, and the remaining players shall be warped out."); + if (pl.equals(player)) { + removePlayer(eim, pl); + } + else { + eim.unregisterPlayer(pl); + pl.changeMap(exitMap, exitMap.getPortal(0)); + } + } + eim.dispose(); + } + else { //boot d/ced player and check if enough players left + removePlayer(eim, player); + if (party.size() < 6) { //five after player booted + end(eim,"There are no longer enough players to continue, and those remaining shall be warped out."); + } + } +} + +function leftParty(eim, player) { //ignore for GQ +} + +function disbandParty(eim) { //ignore for GQ +} + +function playerExit(eim, player) { + eim.unregisterPlayer(player); + player.changeMap(exitMap, exitMap.getPortal(0)); + var party = eim.getPlayers(); + if (party.size() < 6) { //five after player booted + end(eim,"There are no longer enough players to continue, and those remaining shall be warped out."); + } +} + +function end(eim, msg) { + var iter = eim.getPlayers().iterator(); + while (iter.hasNext()) { + var player = iter.next(); + player.dropMessage(6,msg); + eim.unregisterPlayer(player); + player.changeMap(exitMap, exitMap.getPortal(0)); + } + eim.dispose(); +} + +//for offline players +function removePlayer(eim, player) { + eim.unregisterPlayer(player); + player.getMap().removePlayer(player); + player.setMap(exitMap); +} + +function clearPQ(eim) { + var iter = eim.getPlayers().iterator(); + var bonusMap = eim.getMapInstance(990001000); + eim.startEventTimer(40000); + while (iter.hasNext()) { + var player = iter.next(); + player.changeMap(bonusMap, bonusMap.getPortal(0)); + } + eim.schedule("finish", 40000) +} + +function finish(eim) { + var iter = eim.getPlayers().iterator(); + while (iter.hasNext()) { + var player = iter.next(); + eim.unregisterPlayer(player); + player.changeMap(exitMap, exitMap.getPortal(0)); + } + eim.dispose(); +} + +function allMonstersDead(eim) { +//do nothing; GQ has nothing to do with monster killing +} + +function cancelSchedule() { +} + +function dispose(eim) { + em.schedule("openGPQ", 5000); +} + +function openGPQ() { + em.setProperty("gpqOpen", "true"); +} + + +function timeOut() { + +} \ No newline at end of file diff --git a/docs/backtrack_licenses/GuildQuest/origin.txt b/docs/backtrack_licenses/GuildQuest/origin.txt new file mode 100644 index 0000000000..baf90cfe9c --- /dev/null +++ b/docs/backtrack_licenses/GuildQuest/origin.txt @@ -0,0 +1,3 @@ +Change reason: Rewrote script file as a whole, now using methods suitable for the server's improved EventManager (queue system and such). + +Committed 2017-06-13 (GuildPQ Queue system + revamped Warp mechanic) \ No newline at end of file diff --git a/docs/backtrack_licenses/readme.txt b/docs/backtrack_licenses/readme.txt new file mode 100644 index 0000000000..426b9d1efd --- /dev/null +++ b/docs/backtrack_licenses/readme.txt @@ -0,0 +1,14 @@ +[COMMIT 198] + +Licenses for the following files are being changed due to misleading authorship: + - CafePQ NPCs: those NPC script files were not around on OdinMS server, neither before HeavenMS. + - GuildQuest.js: that event script file was completely rewritten to suit well the underlying EIM of HeavenMS. + - Custom NPCs 9000017, 9000036, 9000041: those NPC script files were not around on OdinMS server, neither on Solaxia. + +Original dates are summarized on the subfolders, for steadfast conference. + +Licenses for the following files are being added: + - Several PQs and boss battles: those event scripts are authored by myself, all following similar pattern and using +common functions introduced on this server (such as getEligibleParty, startEventTimer or isEventTeamLackingNow). + +I am expecting no infringements from this action, should any issues arise contact me asap. \ No newline at end of file diff --git a/docs/feature_list.md b/docs/feature_list.md index 1397b4852f..08d2b3b2d4 100644 --- a/docs/feature_list.md +++ b/docs/feature_list.md @@ -1,8 +1,8 @@ -#**HeavenMS _(MapleSolaxiaV2)_** +#**HeavenMS** Credits: -Ronan - Developer +Ronan - Head Developer Vcoc - Freelance Developer @@ -51,6 +51,7 @@ Player Social Network: * Beginners can create and join a "beginner-only" party (characters up to level 10). * Enhanced synchronization on Player Shops and Hired Merchants. Transactions made are instantly informed to the owner. * Game minirooms such as match cards and omok now has semi-functional password system. +* Item pickup cooldown on non-owned/non-partyowned items functional. Cash & Items: @@ -158,5 +159,7 @@ Localhost: * Removed the 'n' problem within NPC dialog. * Removed caps for MATK, WDEF, MDEF, ACC and AVOID. +* Removed "AP excess" popup and "Admin/MWLB" action block, original credits to kevintjuh93. +* Removed "You've gained a level!" popup, original credits to PrinceReborn. --------------------------- \ No newline at end of file diff --git a/docs/todo.txt b/docs/issues.txt similarity index 84% rename from docs/todo.txt rename to docs/issues.txt index ae8bb32142..0cac0338fb 100644 --- a/docs/todo.txt +++ b/docs/issues.txt @@ -1,6 +1,6 @@ ========== HeavenMS ========== Credits: -Ronan - Freelance Developer +Ronan - Head Developer Vcoc - Freelance Developer --------------------------- @@ -8,18 +8,20 @@ Known issues: - Everytime two people click on an npc at the same time, one of them dcs and the other needs to @dispose to talk to the npc. - If multiple people hit boxes/reactors at the same time, they both dc with invalid pointer error. - Passwords on minirooms are not encoded for players entering/logging into the map. +- Some criticals (e.g. from Aran skills) will not show up as crit for other players. +- Deadlocks may start appearing if the server stays online long enough with many players logged in. --------------------------- --------------------------- Missing features list: - Miniroom tooltips (such as number of players in store/host awaiting game) not showing up properly. -- Disease POISON appears MISSES to other players. --------------------------- --------------------------- ** Others ** - Marriage +- Family system --------------------------- @@ -44,7 +46,7 @@ Missing features list: --------------------------- ** Skills ** -Check autoban system +- Check autoban system --------------------------- diff --git a/docs/mychanges_ptbr.txt b/docs/mychanges_ptbr.txt index 01e7e3fda4..62575a02f7 100644 --- a/docs/mychanges_ptbr.txt +++ b/docs/mychanges_ptbr.txt @@ -919,4 +919,23 @@ Adicionado efeito visual relacionado ao map chair skill sendo usado por um jogad Status de diseases agora são visíveis para outros jogadores, mesmo trocando de mapas. Dano de poison agora é visível para outros jogadores. Corrigido preço contabilizado incorretamente para itens recarregáveis. -Corrigido recarregáveis com quantidade zero não sendo vendidos pelo NPC shop. \ No newline at end of file +Corrigido recarregáveis com quantidade zero não sendo vendidos pelo NPC shop. + +03 - 07 Maio 2018, +Modificado unitPrice para aproximar o valor do WZ, de forma que possa ser representado num ponto flutuante sem perda de dados. +Corrigido rechargeables com quantidade 0 colocados no player shop/hired merchant retornando ao dono ou ao comprador com quantidade 1. +Resolvido vários problemas de acesso concorrente com itens no mapa. +Corrigido anomalias com tempo de espera para pegar drops de outros jogadores, agora atuando de forma mais parecida com o GMS-like. +Adicionado/corrigido direitos de copyleft em arquivos de PQs de minha própria autoria. +Revisto acesso concorrente com módulos de playershop/hiredmerchant. +Corrigido problemas com recuperação de itens quando usando bundles em playershop/hiredmerchant. +Corrigido alguns exploits com playershop/hiredmerchant. +Corrigido mensagem de falta de meso numa sessão de compra/venda com NPC travando novas transações naquela sessão. +Corrigido tempo de espera para pegar drops de outros jogadores sempre que se muda de mapa. +Adicionado efeito sonoro para alguns portais scriptados que ainda não o tinham implementado. +Corrigido alguns exploits envolvendo acesso em rajada com NPC Fredrick e Duey. +Corrigido Body Pressure não mostrando valor de dano para outros jogadores. +Adicionado flag que permite town scrolls atuarem como se fossem "player banishes", permitindo ativação do antibanish scroll. + +09 Maio 2018, +Corrigido autopot handler consumindo mais pots que o necessário para pots com ganhos percentuais. \ No newline at end of file diff --git a/docs/README_wzchanges.txt b/docs/wzchanges_gist.txt similarity index 100% rename from docs/README_wzchanges.txt rename to docs/wzchanges_gist.txt diff --git a/nbproject/licenseheader.txt b/nbproject/licenseheader.txt index fb61761b80..7faa632890 100644 --- a/nbproject/licenseheader.txt +++ b/nbproject/licenseheader.txt @@ -1,7 +1,7 @@ <#if licenseFirst??> ${licenseFirst} -${licensePrefix}This file is part of the HeavenMS (MapleSolaxiaV2) Maple Story Server +${licensePrefix}This file is part of the HeavenMS Maple Story Server ${licensePrefix?replace(" +$", "", "r")} ${licensePrefix}Copyright (C) ${date?date?string("yyyy")} ${project.organization!user} ${licensePrefix?replace(" +$", "", "r")} diff --git a/scripts/NPC Base.js b/scripts/NPC Base.js index e794367b28..fdd33d0fff 100644 --- a/scripts/NPC Base.js +++ b/scripts/NPC Base.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/QUEST Base.js b/scripts/QUEST Base.js index b92a1c10d3..e8f88444ac 100644 --- a/scripts/QUEST Base.js +++ b/scripts/QUEST Base.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/REACT Base.js b/scripts/REACT Base.js index e3d81de4e8..8771d047c6 100644 --- a/scripts/REACT Base.js +++ b/scripts/REACT Base.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_bowman.js b/scripts/event/3rdJob_bowman.js index ee9e5f521d..78db216aea 100644 --- a/scripts/event/3rdJob_bowman.js +++ b/scripts/event/3rdJob_bowman.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_magician.js b/scripts/event/3rdJob_magician.js index ed55597e5b..fa57fb4476 100644 --- a/scripts/event/3rdJob_magician.js +++ b/scripts/event/3rdJob_magician.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_mount.js b/scripts/event/3rdJob_mount.js index 69748948b2..0abd5af7cd 100644 --- a/scripts/event/3rdJob_mount.js +++ b/scripts/event/3rdJob_mount.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_pirate.js b/scripts/event/3rdJob_pirate.js index dd3d047394..3f1d8f7c65 100644 --- a/scripts/event/3rdJob_pirate.js +++ b/scripts/event/3rdJob_pirate.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_thief.js b/scripts/event/3rdJob_thief.js index 4cd861b740..774c87326a 100644 --- a/scripts/event/3rdJob_thief.js +++ b/scripts/event/3rdJob_thief.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/3rdJob_warrior.js b/scripts/event/3rdJob_warrior.js index 20a3638ec5..e683c5f7b1 100644 --- a/scripts/event/3rdJob_warrior.js +++ b/scripts/event/3rdJob_warrior.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/AmoriaPQ.js b/scripts/event/AmoriaPQ.js index 0d3c85218a..369f54d1bf 100644 --- a/scripts/event/AmoriaPQ.js +++ b/scripts/event/AmoriaPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Amoria PQ diff --git a/scripts/event/Aran_2ndmount.js b/scripts/event/Aran_2ndmount.js index f05eedfc07..fa2bfcd3d2 100644 --- a/scripts/event/Aran_2ndmount.js +++ b/scripts/event/Aran_2ndmount.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/Aran_3rdmount.js b/scripts/event/Aran_3rdmount.js index 81e946883a..fce9b80a16 100644 --- a/scripts/event/Aran_3rdmount.js +++ b/scripts/event/Aran_3rdmount.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/BalrogBattle.js b/scripts/event/BalrogBattle.js index 3810a0f503..6c6c426cb5 100644 --- a/scripts/event/BalrogBattle.js +++ b/scripts/event/BalrogBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Balrog diff --git a/scripts/event/BalrogBattle_Easy.js b/scripts/event/BalrogBattle_Easy.js index 178d9a2f12..40cfb3cc14 100644 --- a/scripts/event/BalrogBattle_Easy.js +++ b/scripts/event/BalrogBattle_Easy.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Balrog diff --git a/scripts/event/BalrogQuest.js b/scripts/event/BalrogQuest.js index d9fc353c5b..67e9a3c6f8 100644 --- a/scripts/event/BalrogQuest.js +++ b/scripts/event/BalrogQuest.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/event/BossRushPQ.js b/scripts/event/BossRushPQ.js index f2ebee4d50..aefed0ef34 100644 --- a/scripts/event/BossRushPQ.js +++ b/scripts/event/BossRushPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Boss Rush PQ diff --git a/scripts/event/CWKPQ.js b/scripts/event/CWKPQ.js index b76ff37019..5977548e5c 100644 --- a/scripts/event/CWKPQ.js +++ b/scripts/event/CWKPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Crimsonwood Keep PQ diff --git a/scripts/event/CafePQ_1.js b/scripts/event/CafePQ_1.js index 3010832c38..47d9a747b6 100644 --- a/scripts/event/CafePQ_1.js +++ b/scripts/event/CafePQ_1.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 1 diff --git a/scripts/event/CafePQ_2.js b/scripts/event/CafePQ_2.js index 9c7a328bac..3f3d7a9737 100644 --- a/scripts/event/CafePQ_2.js +++ b/scripts/event/CafePQ_2.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 2 diff --git a/scripts/event/CafePQ_3.js b/scripts/event/CafePQ_3.js index bf49d76788..3912da0f27 100644 --- a/scripts/event/CafePQ_3.js +++ b/scripts/event/CafePQ_3.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 3 diff --git a/scripts/event/CafePQ_4.js b/scripts/event/CafePQ_4.js index 7d3139a848..d342f2ae60 100644 --- a/scripts/event/CafePQ_4.js +++ b/scripts/event/CafePQ_4.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 4 diff --git a/scripts/event/CafePQ_5.js b/scripts/event/CafePQ_5.js index ced009195c..b6b3c6867b 100644 --- a/scripts/event/CafePQ_5.js +++ b/scripts/event/CafePQ_5.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 5 diff --git a/scripts/event/CafePQ_6.js b/scripts/event/CafePQ_6.js index f997b049a1..ce7a70e0f7 100644 --- a/scripts/event/CafePQ_6.js +++ b/scripts/event/CafePQ_6.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Cafe PQ 6 diff --git a/scripts/event/ElementalBattle.js b/scripts/event/ElementalBattle.js index c2a94165b2..00a2a18dee 100644 --- a/scripts/event/ElementalBattle.js +++ b/scripts/event/ElementalBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Elemental Thanatos diff --git a/scripts/event/EllinPQ.js b/scripts/event/EllinPQ.js index bad05057c6..0ca98f1161 100644 --- a/scripts/event/EllinPQ.js +++ b/scripts/event/EllinPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Ellin PQ diff --git a/scripts/event/GuildQuest.js b/scripts/event/GuildQuest.js index 628c566701..d64683e064 100644 --- a/scripts/event/GuildQuest.js +++ b/scripts/event/GuildQuest.js @@ -1,14 +1,13 @@ -/* - * This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License 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. + 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 @@ -17,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - */ +*/ /** * @author: Ronan diff --git a/scripts/event/HenesysPQ.js b/scripts/event/HenesysPQ.js index 39348cbef7..cbbab892a0 100644 --- a/scripts/event/HenesysPQ.js +++ b/scripts/event/HenesysPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Henesys PQ diff --git a/scripts/event/HorntailBattle.js b/scripts/event/HorntailBattle.js index a3f923cd40..8805e159b6 100644 --- a/scripts/event/HorntailBattle.js +++ b/scripts/event/HorntailBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Horntail Battle diff --git a/scripts/event/HorntailPQ.js b/scripts/event/HorntailPQ.js index b61a8fb2a0..ccc5fdfe97 100644 --- a/scripts/event/HorntailPQ.js +++ b/scripts/event/HorntailPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Horntail PQ diff --git a/scripts/event/KerningPQ.js b/scripts/event/KerningPQ.js index ef399ac32a..c57817fde9 100644 --- a/scripts/event/KerningPQ.js +++ b/scripts/event/KerningPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Kerning PQ diff --git a/scripts/event/LatanicaBattle.js b/scripts/event/LatanicaBattle.js index e24a4a37f0..b953335aff 100644 --- a/scripts/event/LatanicaBattle.js +++ b/scripts/event/LatanicaBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Latanica diff --git a/scripts/event/LudiMazePQ.js b/scripts/event/LudiMazePQ.js index 66db27bb10..a7a1df4665 100644 --- a/scripts/event/LudiMazePQ.js +++ b/scripts/event/LudiMazePQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Ludibrium Maze PQ diff --git a/scripts/event/LudiPQ.js b/scripts/event/LudiPQ.js index 46c92c1a2c..4a4079ba06 100644 --- a/scripts/event/LudiPQ.js +++ b/scripts/event/LudiPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Ludibrium PQ diff --git a/scripts/event/MagatiaPQ_A.js b/scripts/event/MagatiaPQ_A.js index ac52682645..b26b7376ac 100644 --- a/scripts/event/MagatiaPQ_A.js +++ b/scripts/event/MagatiaPQ_A.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Magatia PQ (Alcadno) diff --git a/scripts/event/MagatiaPQ_Z.js b/scripts/event/MagatiaPQ_Z.js index a0ac6b13ed..ca62cb3fcc 100644 --- a/scripts/event/MagatiaPQ_Z.js +++ b/scripts/event/MagatiaPQ_Z.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Magatia PQ (Zenumist) diff --git a/scripts/event/OrbisPQ.js b/scripts/event/OrbisPQ.js index a15bd17d67..c7bce48ab7 100644 --- a/scripts/event/OrbisPQ.js +++ b/scripts/event/OrbisPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Orbis PQ diff --git a/scripts/event/PapulatusBattle.js b/scripts/event/PapulatusBattle.js index bbd1cdfe9a..3a1528a296 100644 --- a/scripts/event/PapulatusBattle.js +++ b/scripts/event/PapulatusBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Papulatus diff --git a/scripts/event/PinkBeanBattle.js b/scripts/event/PinkBeanBattle.js index 95efbd74df..ee61b5f6d5 100644 --- a/scripts/event/PinkBeanBattle.js +++ b/scripts/event/PinkBeanBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Pink Bean Battle diff --git a/scripts/event/PiratePQ.js b/scripts/event/PiratePQ.js index d839472ae1..2f116e00ee 100644 --- a/scripts/event/PiratePQ.js +++ b/scripts/event/PiratePQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Pirate PQ diff --git a/scripts/event/ScargaBattle.js b/scripts/event/ScargaBattle.js index f32a8aa1c4..c59de35d8c 100644 --- a/scripts/event/ScargaBattle.js +++ b/scripts/event/ScargaBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Scarga Battle diff --git a/scripts/event/ShowaBattle.js b/scripts/event/ShowaBattle.js index 56b42bc91b..15818174c8 100644 --- a/scripts/event/ShowaBattle.js +++ b/scripts/event/ShowaBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Showa Boss Battle diff --git a/scripts/event/TD_Battle1.js b/scripts/event/TD_Battle1.js index 82a97f38b3..b76ff75d6e 100644 --- a/scripts/event/TD_Battle1.js +++ b/scripts/event/TD_Battle1.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Bergamot diff --git a/scripts/event/TD_Battle2.js b/scripts/event/TD_Battle2.js index a0a04ca45b..13dff5306b 100644 --- a/scripts/event/TD_Battle2.js +++ b/scripts/event/TD_Battle2.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Dunas diff --git a/scripts/event/TD_Battle3.js b/scripts/event/TD_Battle3.js index 3403b376e6..8531792fc8 100644 --- a/scripts/event/TD_Battle3.js +++ b/scripts/event/TD_Battle3.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Aufheben diff --git a/scripts/event/TD_Battle4.js b/scripts/event/TD_Battle4.js index b59777618c..8c501f64db 100644 --- a/scripts/event/TD_Battle4.js +++ b/scripts/event/TD_Battle4.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Oberon diff --git a/scripts/event/TD_Battle5.js b/scripts/event/TD_Battle5.js index 49bfe43b71..7628080374 100644 --- a/scripts/event/TD_Battle5.js +++ b/scripts/event/TD_Battle5.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Vs Nibelung diff --git a/scripts/event/TreasurePQ.js b/scripts/event/TreasurePQ.js index de81a984b3..2353434249 100644 --- a/scripts/event/TreasurePQ.js +++ b/scripts/event/TreasurePQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Treasure PQ diff --git a/scripts/event/ZakumBattle.js b/scripts/event/ZakumBattle.js index 858161063e..f1da74768a 100644 --- a/scripts/event/ZakumBattle.js +++ b/scripts/event/ZakumBattle.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Zakum Battle diff --git a/scripts/event/ZakumPQ.js b/scripts/event/ZakumPQ.js index 57859637f9..1c5b2c36d9 100644 --- a/scripts/event/ZakumPQ.js +++ b/scripts/event/ZakumPQ.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @event: Zakum PQ diff --git a/scripts/map/onUserEnter/108010600.js b/scripts/map/onUserEnter/108010600.js index bec594dd1f..2b1b2c6227 100644 --- a/scripts/map/onUserEnter/108010600.js +++ b/scripts/map/onUserEnter/108010600.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/map/onUserEnter/108010610.js b/scripts/map/onUserEnter/108010610.js index 7a8c9f7041..da3af18719 100644 --- a/scripts/map/onUserEnter/108010610.js +++ b/scripts/map/onUserEnter/108010610.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/map/onUserEnter/108010620.js b/scripts/map/onUserEnter/108010620.js index d97d335f9e..ae0f7dbf4a 100644 --- a/scripts/map/onUserEnter/108010620.js +++ b/scripts/map/onUserEnter/108010620.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/map/onUserEnter/108010630.js b/scripts/map/onUserEnter/108010630.js index 6d5cce8b24..9cc91eaa62 100644 --- a/scripts/map/onUserEnter/108010630.js +++ b/scripts/map/onUserEnter/108010630.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/map/onUserEnter/108010640.js b/scripts/map/onUserEnter/108010640.js index 0d9205f2ed..0d02abcd99 100644 --- a/scripts/map/onUserEnter/108010640.js +++ b/scripts/map/onUserEnter/108010640.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/map/onUserEnter/926000010.js b/scripts/map/onUserEnter/926000010.js index 673d29a96d..aecec3cd48 100644 --- a/scripts/map/onUserEnter/926000010.js +++ b/scripts/map/onUserEnter/926000010.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1002007.js b/scripts/npc/1002007.js index ddf662c0fb..73d17d4f89 100644 --- a/scripts/npc/1002007.js +++ b/scripts/npc/1002007.js @@ -6,7 +6,7 @@ var mesos; function start() { if (cm.hasItem(4032313,1)) { - cm.sendOk("I see that you have a coupon to go to Henesys. One moment while I bring you right over!"); + cm.sendNext("I see that you have a coupon to go to Henesys. One moment, I'll bring you there right over!"); } else { cm.sendNext("Hello, I drive the Regular Cab. If you want to go from town to town safely and fast, then ride our cab. We'll glady take you to your destination with an affordable price."); } @@ -29,12 +29,13 @@ function action(mode, type, selection) { else status--; if (status == 1) { - if (cm.hasItem(4032313,1)) { - cm.gainItem(4032313, -1); + if (cm.hasItem(4032313,1)) { + cm.gainItem(4032313, -1); cm.warp(maps[0], 0); cm.dispose(); return; - } + } + var selStr = ""; if (cm.getJobId() == 0) selStr += "We have a special 90% discount for beginners."; diff --git a/scripts/npc/1022101.js b/scripts/npc/1022101.js index b1b46298bd..543d0cd9a3 100644 --- a/scripts/npc/1022101.js +++ b/scripts/npc/1022101.js @@ -22,24 +22,33 @@ Jan Christian Meyer /** Rooney - Happyville Warp NPC **/ - -var status = 0; - -function start() { - action(1, 0, 0); -} - -function action(mode, type, selection) { - if (status == 0) { - cm.sendYesNo("Santa told me to go to here, only he didn't told me when... I hope i'm here on the right time! Oh! By the way, I'm Rooney, I can take you to #bHappyVille#k. Are you ready to go?"); - status++; - } else { - if ((status == 1 && type == 1 && selection == -1 && mode == 0) || mode == -1) { - cm.dispose(); + +var status; + +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); } else { - cm.getPlayer().saveLocation("HAPPYVILLE"); - cm.warp(209000000, 0); - cm.dispose(); - } - } -} \ No newline at end of file + if (mode == 0 && type > 0) { + cm.dispose(); + return; + } + if (mode == 1) + status++; + else + status--; + + if(status == 0) { + cm.sendYesNo("Santa told me to go to here, only he didn't told me when... I hope I'm here on the right time! Oh! By the way, I'm Rooney, I can take you to #bHappyVille#k. Are you ready to go?"); + } else { + cm.getPlayer().saveLocation("HAPPYVILLE"); + cm.warp(209000000, 0); + cm.dispose(); + } + } +} diff --git a/scripts/npc/1040000.js b/scripts/npc/1040000.js index 5e3b244b5a..cf6a84799a 100644 --- a/scripts/npc/1040000.js +++ b/scripts/npc/1040000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1052013.js b/scripts/npc/1052013.js index 286a29d20d..4800732a10 100644 --- a/scripts/npc/1052013.js +++ b/scripts/npc/1052013.js @@ -1,8 +1,6 @@ /* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -13,8 +11,8 @@ 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. + 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 . diff --git a/scripts/npc/1052014.js b/scripts/npc/1052014.js index 6f23649b19..315221803f 100644 --- a/scripts/npc/1052014.js +++ b/scripts/npc/1052014.js @@ -1,8 +1,6 @@ /* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -13,8 +11,8 @@ 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. + 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 . diff --git a/scripts/npc/1052015.js b/scripts/npc/1052015.js index f1a0329b62..461f0299b8 100644 --- a/scripts/npc/1052015.js +++ b/scripts/npc/1052015.js @@ -1,8 +1,6 @@ /* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -13,8 +11,8 @@ 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. + 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 . diff --git a/scripts/npc/1092008.js b/scripts/npc/1092008.js new file mode 100644 index 0000000000..0bdbb4222d --- /dev/null +++ b/scripts/npc/1092008.js @@ -0,0 +1,46 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +var status; + +function start() { + status = -1; + action(1, 0, 0); +} + +function action(mode, type, selection) { + if (mode == -1) { + cm.dispose(); + } else { + if (mode == 0 && type > 0) { + cm.dispose(); + return; + } + if (mode == 1) + status++; + else + status--; + + if(status == 0) { + cm.sendOk("Hey, do you have any business with me?"); + cm.dispose(); + } + } +} diff --git a/scripts/npc/1092015.js b/scripts/npc/1092015.js index 97f5e4991b..f08dbb0c95 100644 --- a/scripts/npc/1092015.js +++ b/scripts/npc/1092015.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1092018.js b/scripts/npc/1092018.js index 86d9be6d09..0f2a3c6ee9 100644 --- a/scripts/npc/1092018.js +++ b/scripts/npc/1092018.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/11000.js b/scripts/npc/11000.js index 81cd54ad84..f2f73935a2 100644 --- a/scripts/npc/11000.js +++ b/scripts/npc/11000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1104100.js b/scripts/npc/1104100.js index d8f99a2232..415c1d44b3 100644 --- a/scripts/npc/1104100.js +++ b/scripts/npc/1104100.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1104101.js b/scripts/npc/1104101.js index 56681fffea..2f38b06e33 100644 --- a/scripts/npc/1104101.js +++ b/scripts/npc/1104101.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1104102.js b/scripts/npc/1104102.js index 2eca8ed9c2..3d7b1af5f0 100644 --- a/scripts/npc/1104102.js +++ b/scripts/npc/1104102.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1104103.js b/scripts/npc/1104103.js index 39ecef826e..ff07de9bea 100644 --- a/scripts/npc/1104103.js +++ b/scripts/npc/1104103.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1104104.js b/scripts/npc/1104104.js index 6ba011629b..f00f9d9107 100644 --- a/scripts/npc/1104104.js +++ b/scripts/npc/1104104.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1300001.js b/scripts/npc/1300001.js index d343c5b7fa..6478b9c7e0 100644 --- a/scripts/npc/1300001.js +++ b/scripts/npc/1300001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1300006.js b/scripts/npc/1300006.js index 27353fb69d..ad16701629 100644 --- a/scripts/npc/1300006.js +++ b/scripts/npc/1300006.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/1300012.js b/scripts/npc/1300012.js index 953252d064..0290ddf1b1 100644 --- a/scripts/npc/1300012.js +++ b/scripts/npc/1300012.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2013000.js b/scripts/npc/2013000.js index 9cb383cead..f909e9dbea 100644 --- a/scripts/npc/2013000.js +++ b/scripts/npc/2013000.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Wonky diff --git a/scripts/npc/2030006.js b/scripts/npc/2030006.js index 7912e09d86..dc9a8714ed 100644 --- a/scripts/npc/2030006.js +++ b/scripts/npc/2030006.js @@ -1,5 +1,5 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server + This file is part of the HeavenMS MapleStory Server Copyleft (L) 2018 RonanLana This program is free software: you can redistribute it and/or modify diff --git a/scripts/npc/2041024.js b/scripts/npc/2041024.js index c4f582b3f9..de64516268 100644 --- a/scripts/npc/2041024.js +++ b/scripts/npc/2041024.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2041026.js b/scripts/npc/2041026.js index 83bfab352f..b28b51b1de 100644 --- a/scripts/npc/2041026.js +++ b/scripts/npc/2041026.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2041029.js b/scripts/npc/2041029.js index e5c61c4643..c4a11e0c89 100644 --- a/scripts/npc/2041029.js +++ b/scripts/npc/2041029.js @@ -21,7 +21,7 @@ */ function start() { - cm.sendOk("Up ahead is the mysterious forest of Elin. Go through #bthe portal of time#k if you are ready to unveil some of the mysteries of the past of Victoria Island, as how it used to be at it's dawn."); + cm.sendOk("Up ahead is the mysterious forest of #bEllin#k. Go through #bthe portal of time#k if you are ready to unveil some of the mysteries of the past of Victoria Island, as how it used to be at it's dawn."); cm.dispose(); } \ No newline at end of file diff --git a/scripts/npc/2042000.js b/scripts/npc/2042000.js index e93563a233..d8ebe345d2 100644 --- a/scripts/npc/2042000.js +++ b/scripts/npc/2042000.js @@ -22,6 +22,10 @@ var status = 0; function start() { + cm.sendOk("The Monster Carnival is currently unavailable."); + cm.dispose(); + + /* if (cm.getPlayer().getParty() != null) cm.sendCPQMapLists(); else { @@ -49,5 +53,5 @@ function action(mode, type, selection) { cm.dispose(); } } - } + }*/ } \ No newline at end of file diff --git a/scripts/npc/2082004.js b/scripts/npc/2082004.js index 6eb8c69289..44fd4e6dcc 100644 --- a/scripts/npc/2082004.js +++ b/scripts/npc/2082004.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2083001.js b/scripts/npc/2083001.js index fe0e0dbd73..9aa191d460 100644 --- a/scripts/npc/2083001.js +++ b/scripts/npc/2083001.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Mark of the Squad diff --git a/scripts/npc/2091005.js b/scripts/npc/2091005.js index 05dfad86cc..80f03e0622 100644 --- a/scripts/npc/2091005.js +++ b/scripts/npc/2091005.js @@ -3,7 +3,7 @@ Copyright (C) 2008 Patrick Huy Matthias Butz Jan Christian Meyer - Copyleft (L) 2017 RonanLana (HeavenMS) + Copyleft (L) 2016 - 2018 RonanLana (HeavenMS) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2094000.js b/scripts/npc/2094000.js index 51062545b2..478a611f7e 100644 --- a/scripts/npc/2094000.js +++ b/scripts/npc/2094000.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Guon diff --git a/scripts/npc/2103000.js b/scripts/npc/2103000.js index f131a0b164..f64485569e 100644 --- a/scripts/npc/2103000.js +++ b/scripts/npc/2103000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103002.js b/scripts/npc/2103002.js index 5b943dd305..f9a51575b0 100644 --- a/scripts/npc/2103002.js +++ b/scripts/npc/2103002.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103003.js b/scripts/npc/2103003.js index 038dfe0c85..9b8040167f 100644 --- a/scripts/npc/2103003.js +++ b/scripts/npc/2103003.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103004.js b/scripts/npc/2103004.js index 04d7edbc77..5891f00078 100644 --- a/scripts/npc/2103004.js +++ b/scripts/npc/2103004.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103005.js b/scripts/npc/2103005.js index dcd2125181..01dc956858 100644 --- a/scripts/npc/2103005.js +++ b/scripts/npc/2103005.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103006.js b/scripts/npc/2103006.js index a6fc1177c8..a25d62b4ac 100644 --- a/scripts/npc/2103006.js +++ b/scripts/npc/2103006.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103009.js b/scripts/npc/2103009.js index 613220cf99..12d3129e1a 100644 --- a/scripts/npc/2103009.js +++ b/scripts/npc/2103009.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103010.js b/scripts/npc/2103010.js index 266095b90a..80f599e5bd 100644 --- a/scripts/npc/2103010.js +++ b/scripts/npc/2103010.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103011.js b/scripts/npc/2103011.js index 0370698289..fdbb1a86ee 100644 --- a/scripts/npc/2103011.js +++ b/scripts/npc/2103011.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2103012.js b/scripts/npc/2103012.js index e9e8e2e431..13a9f0bc9d 100644 --- a/scripts/npc/2103012.js +++ b/scripts/npc/2103012.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111010.js b/scripts/npc/2111010.js index cf277e29f1..2a072de25b 100644 --- a/scripts/npc/2111010.js +++ b/scripts/npc/2111010.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111013.js b/scripts/npc/2111013.js index f949d766ad..3d897e4788 100644 --- a/scripts/npc/2111013.js +++ b/scripts/npc/2111013.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111014.js b/scripts/npc/2111014.js index 66b13e7c7a..503554188a 100644 --- a/scripts/npc/2111014.js +++ b/scripts/npc/2111014.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111015.js b/scripts/npc/2111015.js index 0a9b2b1f98..502d617075 100644 --- a/scripts/npc/2111015.js +++ b/scripts/npc/2111015.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111017.js b/scripts/npc/2111017.js index b1d8b01141..f5ac4961fd 100644 --- a/scripts/npc/2111017.js +++ b/scripts/npc/2111017.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111018.js b/scripts/npc/2111018.js index ea12705bbf..baf03db33d 100644 --- a/scripts/npc/2111018.js +++ b/scripts/npc/2111018.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111019.js b/scripts/npc/2111019.js index e5b9247786..71da66886d 100644 --- a/scripts/npc/2111019.js +++ b/scripts/npc/2111019.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111020.js b/scripts/npc/2111020.js index efaa992b54..f9f07e7b09 100644 --- a/scripts/npc/2111020.js +++ b/scripts/npc/2111020.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111021.js b/scripts/npc/2111021.js index 3359e86116..7b8336eb75 100644 --- a/scripts/npc/2111021.js +++ b/scripts/npc/2111021.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111022.js b/scripts/npc/2111022.js index e404a67613..a6cca05dc7 100644 --- a/scripts/npc/2111022.js +++ b/scripts/npc/2111022.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2111023.js b/scripts/npc/2111023.js index 68faf968ff..0ea72a461e 100644 --- a/scripts/npc/2111023.js +++ b/scripts/npc/2111023.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2112003.js b/scripts/npc/2112003.js index 93f7658615..419372d9b3 100644 --- a/scripts/npc/2112003.js +++ b/scripts/npc/2112003.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Juliet diff --git a/scripts/npc/2112004.js b/scripts/npc/2112004.js index dca6b73e39..d889eca094 100644 --- a/scripts/npc/2112004.js +++ b/scripts/npc/2112004.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Romeo diff --git a/scripts/npc/2112007.js b/scripts/npc/2112007.js index 9eab1dad67..b834919a47 100644 --- a/scripts/npc/2112007.js +++ b/scripts/npc/2112007.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2112016.js b/scripts/npc/2112016.js index fca7a79156..d0f7d16d83 100644 --- a/scripts/npc/2112016.js +++ b/scripts/npc/2112016.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/2133000.js b/scripts/npc/2133000.js index badae533b7..51644eac1f 100644 --- a/scripts/npc/2133000.js +++ b/scripts/npc/2133000.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Ellin diff --git a/scripts/npc/9000007.js b/scripts/npc/9000007.js index ac126a322c..b250fb2838 100644 --- a/scripts/npc/9000007.js +++ b/scripts/npc/9000007.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/9000017.js b/scripts/npc/9000017.js index f7cec6fb23..08e5211ad9 100644 --- a/scripts/npc/9000017.js +++ b/scripts/npc/9000017.js @@ -1,3 +1,22 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ /* Coco Refining NPC: * Chaos scroll SYNTHETIZER (rofl) diff --git a/scripts/npc/9000036.js b/scripts/npc/9000036.js index 7fdca6a219..6968b76936 100644 --- a/scripts/npc/9000036.js +++ b/scripts/npc/9000036.js @@ -1,8 +1,6 @@ /* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/9000037.js b/scripts/npc/9000037.js index b0e26cb84c..3a23e3e129 100644 --- a/scripts/npc/9000037.js +++ b/scripts/npc/9000037.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Agent Meow diff --git a/scripts/npc/9000038.js b/scripts/npc/9000038.js index ba04e6f605..fb3a27d29c 100644 --- a/scripts/npc/9000038.js +++ b/scripts/npc/9000038.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Agent Kitty diff --git a/scripts/npc/9000041.js b/scripts/npc/9000041.js index aeb00fea05..c515697958 100644 --- a/scripts/npc/9000041.js +++ b/scripts/npc/9000041.js @@ -1,8 +1,6 @@ /* - This file is part of the OdinMS Maple Story Server - Copyright (C) 2008 Patrick Huy - Matthias Butz - Jan Christian Meyer + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/9020000.js b/scripts/npc/9020000.js index b60eee316e..a162a371c5 100644 --- a/scripts/npc/9020000.js +++ b/scripts/npc/9020000.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Lakelis diff --git a/scripts/npc/9040000.js b/scripts/npc/9040000.js index 635ad4939d..5b8c60d199 100644 --- a/scripts/npc/9040000.js +++ b/scripts/npc/9040000.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Shuang diff --git a/scripts/npc/9201048.js b/scripts/npc/9201048.js index 954eab9227..afbb84c1a8 100644 --- a/scripts/npc/9201048.js +++ b/scripts/npc/9201048.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Amos diff --git a/scripts/npc/9201106.js b/scripts/npc/9201106.js index fac3b5f407..54be6df326 100644 --- a/scripts/npc/9201106.js +++ b/scripts/npc/9201106.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/9209000.js b/scripts/npc/9209000.js index bfd3747e9b..f9a05d59e5 100644 --- a/scripts/npc/9209000.js +++ b/scripts/npc/9209000.js @@ -31,6 +31,12 @@ function action(mode, type, selection) { if (status == 0) { var greeting = "Hello, I'm #p9209000#, the Skill & Mastery Book announcer! "; + if(cm.getPlayer().isCygnus()) { + cm.sendOk(greeting + "There are no skill or mastery books available for Cygnus Knights."); + cm.dispose(); + return; + } + var jobrank = cm.getJob().getId() % 10; if(jobrank < 2) { cm.sendOk(greeting + "Keep training yourself until you reach the #r4th job#k of your class. New opportunities for improvement will arrive when you reach that feat!"); diff --git a/scripts/npc/9220018.js b/scripts/npc/9220018.js index cf240a0959..b569645330 100644 --- a/scripts/npc/9220018.js +++ b/scripts/npc/9220018.js @@ -1,3 +1,23 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + /** * @author: Ronan * @npc: Charles diff --git a/scripts/npc/9220019.js b/scripts/npc/9220019.js index 48778a7398..77cfc95eb3 100644 --- a/scripts/npc/9220019.js +++ b/scripts/npc/9220019.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/9220020.js b/scripts/npc/9220020.js index 143662a10c..6c712c30a0 100644 --- a/scripts/npc/9220020.js +++ b/scripts/npc/9220020.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/npc/credits.js b/scripts/npc/credits.js index 001f9994b0..716f82e748 100644 --- a/scripts/npc/credits.js +++ b/scripts/npc/credits.js @@ -11,6 +11,7 @@ var name_tree = []; var role_tree = []; var name_cursor, role_cursor; +// make sure the server names are lexicograffically EQUALS to the correspondent function. var servers = ["HeavenMS", "MapleSolaxia", "MoopleDEV", "MetroMS", "BubblesDEV", "ThePackII", "OdinMS", "Contributors"]; var servers_history = []; @@ -93,7 +94,7 @@ function writeAllServerStaffs() { role_cursor = []; var srvName = servers[i]; - eval("writeServerStaff_" + srvName)(); // make sure the server names are lexicograffically EQUALS to the correspondent function. + eval("writeServerStaff_" + srvName)(); name_tree.push(name_cursor); role_tree.push(role_cursor); diff --git a/scripts/portal/Depart_goFoward0.js b/scripts/portal/Depart_goFoward0.js index e2e836afea..f7c94e246b 100644 --- a/scripts/portal/Depart_goFoward0.js +++ b/scripts/portal/Depart_goFoward0.js @@ -1,25 +1,27 @@ -function enter(pi) { - if (pi.getPlayer().getMap().getId() == 103040410 && pi.isQuestCompleted(2287)) { +function enter(pi) { + var mapid = pi.getPlayer().getMap().getId(); + + if (mapid == 103040410 && pi.isQuestCompleted(2287)) { pi.playPortalSound(); pi.warp(103040420, "right00"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040420 && pi.isQuestCompleted(2288)) { + } else if (mapid == 103040420 && pi.isQuestCompleted(2288)) { pi.playPortalSound(); pi.warp(103040430, "right00"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040410 && pi.isQuestStarted(2287)) { + } else if (mapid == 103040410 && pi.isQuestStarted(2287)) { pi.playPortalSound(); pi.warp(103040420, "right00"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040420 && pi.isQuestStarted(2288)) { + } else if (mapid == 103040420 && pi.isQuestStarted(2288)) { pi.playPortalSound(); pi.warp(103040430, "right00"); return true; } else { - if (pi.getPlayer().getMap().getId() == 103040440 || pi.getPlayer().getMap().getId() == 103040450) { - pi.playPortalSound(); - pi.warp(pi.getPlayer().getMap().getId() + 10, "right00"); - return true; + if (mapid == 103040440 || mapid == 103040450) { + pi.playPortalSound(); + pi.warp(mapid + 10, "right00"); + return true; } pi.getPlayer().dropMessage(5, "You cannot access this area."); return false; diff --git a/scripts/portal/Depart_goFoward1.js b/scripts/portal/Depart_goFoward1.js index 38d8774bbd..68d1b7f2d3 100644 --- a/scripts/portal/Depart_goFoward1.js +++ b/scripts/portal/Depart_goFoward1.js @@ -1,25 +1,27 @@ -function enter(pi) { - if (pi.getPlayer().getMap().getId() == 103040410 && pi.isQuestCompleted(2287)) { +function enter(pi) { + var mapid = pi.getPlayer().getMap().getId(); + + if (mapid == 103040410 && pi.isQuestCompleted(2287)) { pi.playPortalSound(); pi.warp(103040420, "right01"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040420 && pi.isQuestCompleted(2288)) { + } else if (mapid == 103040420 && pi.isQuestCompleted(2288)) { pi.playPortalSound(); pi.warp(103040430, "right01"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040410 && pi.isQuestStarted(2287)) { + } else if (mapid == 103040410 && pi.isQuestStarted(2287)) { pi.playPortalSound(); pi.warp(103040420, "right01"); return true; - } else if (pi.getPlayer().getMap().getId() == 103040420 && pi.isQuestStarted(2288)) { + } else if (mapid == 103040420 && pi.isQuestStarted(2288)) { pi.playPortalSound(); pi.warp(103040430, "right01"); return true; } else { - if (pi.getPlayer().getMap().getId() == 103040440 || pi.getPlayer().getMap().getId() == 103040450) { - pi.playPortalSound(); - pi.warp(pi.getPlayer().getMap().getId() + 10, "right01"); - return true; + if (mapid == 103040440 || mapid == 103040450) { + pi.playPortalSound(); + pi.warp(mapid + 10, "right01"); + return true; } pi.getPlayer().dropMessage(5, "You cannot access this area."); return false; diff --git a/scripts/portal/PPinkOut.js b/scripts/portal/PPinkOut.js index f1e2c17e1c..3a1e669fed 100644 --- a/scripts/portal/PPinkOut.js +++ b/scripts/portal/PPinkOut.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/Pinkin.js b/scripts/portal/Pinkin.js index 72fa391090..08e1b26048 100644 --- a/scripts/portal/Pinkin.js +++ b/scripts/portal/Pinkin.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/ariant_Agit.js b/scripts/portal/ariant_Agit.js index 7055608d6a..4b9dedd287 100644 --- a/scripts/portal/ariant_Agit.js +++ b/scripts/portal/ariant_Agit.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/ariant_queens.js b/scripts/portal/ariant_queens.js index 2cd50836ec..8092d4c1c1 100644 --- a/scripts/portal/ariant_queens.js +++ b/scripts/portal/ariant_queens.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/end_cow.js b/scripts/portal/end_cow.js index c1c5c98a2e..9f8874863d 100644 --- a/scripts/portal/end_cow.js +++ b/scripts/portal/end_cow.js @@ -7,7 +7,7 @@ function enter(pi){ if (pi.isQuestStarted(2180) && (pi.hasItem(4031847) || pi.hasItem(4031848) || pi.hasItem(4031849) || pi.hasItem(4031850))){ if (pi.hasItem(4031850)){ - pi.warp(120000103); + pi.playPortalSound(); pi.warp(120000103); return true; } else{ diff --git a/scripts/portal/enterDisguise1.js b/scripts/portal/enterDisguise1.js index 57bc2cbb4c..ebc4163775 100644 --- a/scripts/portal/enterDisguise1.js +++ b/scripts/portal/enterDisguise1.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ function enter(pi) { return false; } - pi.warp(108010600 + (10 * jobtype), "out00"); + pi.playPortalSound(); pi.warp(108010600 + (10 * jobtype), "out00"); } else { pi.playPortalSound(); pi.warp(130010010, "out00"); } diff --git a/scripts/portal/enterDisguise2.js b/scripts/portal/enterDisguise2.js index 5d4b6e662e..7eb70ac6bf 100644 --- a/scripts/portal/enterDisguise2.js +++ b/scripts/portal/enterDisguise2.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ function enter(pi) { return false; } - pi.warp(108010600 + (10 * jobtype), "out00"); + pi.playPortalSound(); pi.warp(108010600 + (10 * jobtype), "out00"); } else { pi.playPortalSound(); pi.warp(130010020, "out00"); } diff --git a/scripts/portal/enterDisguise3.js b/scripts/portal/enterDisguise3.js index 445c149f36..06fad66aca 100644 --- a/scripts/portal/enterDisguise3.js +++ b/scripts/portal/enterDisguise3.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ function enter(pi) { return false; } - pi.warp(108010600 + (10 * jobtype), "out00"); + pi.playPortalSound(); pi.warp(108010600 + (10 * jobtype), "out00"); } else { pi.playPortalSound(); pi.warp(130010110, "out00"); } diff --git a/scripts/portal/enterDisguise4.js b/scripts/portal/enterDisguise4.js index f065ddf630..7b74961145 100644 --- a/scripts/portal/enterDisguise4.js +++ b/scripts/portal/enterDisguise4.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ function enter(pi) { return false; } - pi.warp(108010600 + (10 * jobtype), "out00"); + pi.playPortalSound(); pi.warp(108010600 + (10 * jobtype), "out00"); } else { pi.playPortalSound(); pi.warp(130010120, "out00"); } diff --git a/scripts/portal/enterDisguise5.js b/scripts/portal/enterDisguise5.js index 847140b0e4..8982871680 100644 --- a/scripts/portal/enterDisguise5.js +++ b/scripts/portal/enterDisguise5.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -37,7 +37,7 @@ function enter(pi) { return false; } - pi.warp(108010600 + (10 * jobtype), "east00"); + pi.playPortalSound(); pi.warp(108010600 + (10 * jobtype), "east00"); } else { pi.playPortalSound(); pi.warp(130020000, "east00"); } diff --git a/scripts/portal/enterMCave.js b/scripts/portal/enterMCave.js index bb549a67db..dc2052f0e5 100644 --- a/scripts/portal/enterMCave.js +++ b/scripts/portal/enterMCave.js @@ -13,11 +13,11 @@ function enter(pi) { //pi.getPlayer().announce(Packages.tools.MaplePacketCreator.questProgress(21203, "21203")); return true; } - pi.message("The mirror is blank due to all the players currently recalling their memories. Please wait and try again."); + pi.message("The mirror is blank due to many players recalling their memories. Please wait and try again."); return false; - } else if(pi.isQuestStarted(21302)) { // Third Job + } else if(pi.isQuestStarted(21302) && !pi.isQuestCompleted(21303)) { // Third Job if(pi.getPlayerCount(108010701) > 0 || pi.getPlayerCount(108010702) > 0) { - pi.message("The mirror is blank due to all the players currently recalling their memories. Please wait and try again."); + pi.message("The mirror is blank due to many players recalling their memories. Please wait and try again."); return false; } else { var map = pi.getClient().getChannelServer().getMapFactory().getMap(108010702); diff --git a/scripts/portal/enterPort.js b/scripts/portal/enterPort.js index 3017233aa5..58147bee61 100644 --- a/scripts/portal/enterPort.js +++ b/scripts/portal/enterPort.js @@ -22,7 +22,7 @@ importPackage(Packages.server.life); function enter(pi) { - if(pi.isQuestStarted(21301)) { + if(pi.isQuestStarted(21301) && pi.getQuestProgress(21301, 9001013) == 0) { if(pi.getPlayerCount(108010700) != 0) { pi.message("The portal is blocked from the other side. I wonder if someone is already fighting the Thief Crow?"); return false; @@ -34,7 +34,7 @@ function enter(pi) { pi.warp(108010700, "west00"); } } else { - pi.warp(140020300, 1); + pi.playPortalSound(); pi.warp(140020300, 1); } return true; } diff --git a/scripts/portal/enterRienFirst.js b/scripts/portal/enterRienFirst.js index 9a7cb21269..6f295bf25f 100644 --- a/scripts/portal/enterRienFirst.js +++ b/scripts/portal/enterRienFirst.js @@ -20,9 +20,11 @@ along with this program. If not, see . */ function enter(pi) { - if (pi.getPlayer().getJob().getId() == 2000 && !pi.isQuestCompleted(21014)) - pi.warp(140000000, 1); - else + if (pi.getPlayer().getJob().getId() == 2000 && !pi.isQuestCompleted(21014)) { + pi.playPortalSound(); pi.warp(140000000, "st00"); + } else { pi.playPortalSound(); pi.warp(140000000, "west00"); + } + return true; } \ No newline at end of file diff --git a/scripts/portal/enterWitch.js b/scripts/portal/enterWitch.js index ccfa23a862..f4e3770f05 100644 --- a/scripts/portal/enterWitch.js +++ b/scripts/portal/enterWitch.js @@ -1,9 +1,9 @@ function enter(pi) { if (pi.getQuestStatus(20407) == 2) { - pi.warp(924010200,0); + pi.playPortalSound(); pi.warp(924010200,0); return true; } else if (pi.getQuestStatus(20406) == 2) { - pi.warp(924010100,0); + pi.playPortalSound(); pi.warp(924010100,0); return true; } else if (pi.getQuestStatus(20404) == 2) { pi.playPortalSound(); pi.warp(924010000,0); diff --git a/scripts/portal/guyfawkes0_esc.js b/scripts/portal/guyfawkes0_esc.js index 1ce0bd996c..3548d865a7 100644 --- a/scripts/portal/guyfawkes0_esc.js +++ b/scripts/portal/guyfawkes0_esc.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/guyfawkes0_floor.js b/scripts/portal/guyfawkes0_floor.js index 6ecc924162..0628329f26 100644 --- a/scripts/portal/guyfawkes0_floor.js +++ b/scripts/portal/guyfawkes0_floor.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/inDragonEgg.js b/scripts/portal/inDragonEgg.js index 1770059bba..676ca05ab4 100644 --- a/scripts/portal/inDragonEgg.js +++ b/scripts/portal/inDragonEgg.js @@ -1,9 +1,9 @@ function enter(pi) { pi.playPortalSound(); if(pi.isQuestStarted(22005)){ - pi.warp(900020100, 0); + pi.playPortalSound(); pi.warp(900020100, 0); } else{ - pi.warp(100030301, 0); + pi.playPortalSound(); pi.warp(100030301, 0); } return true; } \ No newline at end of file diff --git a/scripts/portal/magatia_alc0.js b/scripts/portal/magatia_alc0.js index d665d7ffc7..1ebccfa85d 100644 --- a/scripts/portal/magatia_alc0.js +++ b/scripts/portal/magatia_alc0.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/obstacle.js b/scripts/portal/obstacle.js index 7ae49c2f99..cf2f265716 100644 --- a/scripts/portal/obstacle.js +++ b/scripts/portal/obstacle.js @@ -11,7 +11,7 @@ pi.message("You have used the Killer Mushroom Spore to open the way."); } - pi.warp(106020400, 2); + pi.playPortalSound(); pi.warp(106020400, 2); return true; } else if (pi.hasItem(2430015)) { pi.gainItem(2430015, -1 * pi.getPlayer().getItemQuantity(2430015, false)); diff --git a/scripts/portal/outChild.js b/scripts/portal/outChild.js index 21970f849a..13a08057c3 100644 --- a/scripts/portal/outChild.js +++ b/scripts/portal/outChild.js @@ -23,7 +23,7 @@ */ function enter(pi) { if (!pi.isQuestStarted(21001)) { - pi.warp(914000220, 2); + pi.playPortalSound(); pi.warp(914000220, 2); return true; } else { pi.playPortalSound(); pi.warp(914000400, 2); diff --git a/scripts/portal/party6_stage.js b/scripts/portal/party6_stage.js index cda79a2631..0434ca4921 100644 --- a/scripts/portal/party6_stage.js +++ b/scripts/portal/party6_stage.js @@ -1,12 +1,12 @@ function enter(pi) { switch(pi.getMapId()) { case 930000000: - pi.warp(930000100,0); + pi.playPortalSound(); pi.warp(930000100,0); return true; break; case 930000100: if (pi.getMap().getMonsters().size() == 0) { - pi.warp(930000200,0); + pi.playPortalSound(); pi.warp(930000200,0); return true; } else { pi.playerMessage(5, "Eliminate all the monsters."); diff --git a/scripts/portal/q3366in.js b/scripts/portal/q3366in.js index 6c8af6496a..039c87b3dc 100644 --- a/scripts/portal/q3366in.js +++ b/scripts/portal/q3366in.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/q3366out.js b/scripts/portal/q3366out.js index f911d738b8..6bd3d529ef 100644 --- a/scripts/portal/q3366out.js +++ b/scripts/portal/q3366out.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/q3367in.js b/scripts/portal/q3367in.js index b0d30ed219..05ec7966d1 100644 --- a/scripts/portal/q3367in.js +++ b/scripts/portal/q3367in.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/q3367out.js b/scripts/portal/q3367out.js index cf169fc507..eecf2db303 100644 --- a/scripts/portal/q3367out.js +++ b/scripts/portal/q3367out.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/q3368in.js b/scripts/portal/q3368in.js index 8e9471c07c..f532878608 100644 --- a/scripts/portal/q3368in.js +++ b/scripts/portal/q3368in.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/q3368out.js b/scripts/portal/q3368out.js index a536b67a0e..96b36725f5 100644 --- a/scripts/portal/q3368out.js +++ b/scripts/portal/q3368out.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/rankRoom.js b/scripts/portal/rankRoom.js index 213d9417ae..1d320d926b 100644 --- a/scripts/portal/rankRoom.js +++ b/scripts/portal/rankRoom.js @@ -9,16 +9,16 @@ function enter(pi) { pi.warp(130000100, 4); //or 130000101 break; case 140010100: - pi.warp(140010110, 0); //or 140010111 + pi.warp(140010110, 1); //or 140010111 break; case 120000101: - pi.warp(120000105, 0); + pi.warp(120000105, 1); break; case 103000003: - pi.warp(103000008, 0); //or 103000009 + pi.warp(103000008, 1); //or 103000009 break; case 100000201: - pi.warp(100000204, 0); //or 100000205 + pi.warp(100000204, 1); //or 100000205 break; default: pi.warp(pi.getMapId() + 1, 0); //or + 2 diff --git a/scripts/portal/secretDoor.js b/scripts/portal/secretDoor.js index d631928491..9748d0d367 100644 --- a/scripts/portal/secretDoor.js +++ b/scripts/portal/secretDoor.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/skyrom.js b/scripts/portal/skyrom.js index 28051a1bdf..6473e4e458 100644 --- a/scripts/portal/skyrom.js +++ b/scripts/portal/skyrom.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/portal/timeQuest.js b/scripts/portal/timeQuest.js index e5644ed6b8..c1c1039392 100644 --- a/scripts/portal/timeQuest.js +++ b/scripts/portal/timeQuest.js @@ -27,7 +27,7 @@ function enter(pi) { pi.playPortalSound(); var map = (mapid - 270010000) / 100; //pi.getPlayer().dropMessage(5, map + " " + pi.isQuestCompleted(3534)); - if(map < 5 && pi.isQuestCompleted(3500 + map)) { + if(map < 5 && pi.isQuestCompleted(3500 + map)) { pi.warp(mapid + 10, "out00"); } else if(map == 5 && pi.isQuestCompleted(3502 + map)) { pi.warp(270020000, "out00"); diff --git a/scripts/portal/tutorquest.js b/scripts/portal/tutorquest.js index 57d7fbc221..9b7d260685 100644 --- a/scripts/portal/tutorquest.js +++ b/scripts/portal/tutorquest.js @@ -1,21 +1,21 @@ function enter(pi) { if(pi.getPlayer().getMapId() == 130030001){ if(pi.isQuestStarted(20010)){ - pi.warp(130030002, 0); + pi.playPortalSound(); pi.warp(130030002, 0); return true; } else { pi.message("Please click on the NPC first to receive a quest."); } } else if(pi.getPlayer().getMapId() == 130030002){ if(pi.isQuestCompleted(20011)){ - pi.warp(130030003, 0); + pi.playPortalSound(); pi.warp(130030003, 0); return true; } else { pi.message("Please complete the required quest before proceeding."); } } else if(pi.getPlayer().getMapId() == 130030003){ if(pi.isQuestCompleted(20012)){ - pi.warp(130030004, 0); + pi.playPortalSound(); pi.warp(130030004, 0); return true; } else { pi.message("Please complete the required quest before proceeding."); diff --git a/scripts/quest/20010.js b/scripts/quest/20010.js index 39b48c4447..eb3d98ac80 100644 --- a/scripts/quest/20010.js +++ b/scripts/quest/20010.js @@ -2,7 +2,7 @@ var status = -1; function start(mode, type, selection) { if (mode == -1) { - qm.sendNext("Whoa, whoa! Are you really declining my offer? Well, you'll be able to #blevel-up quicker #kwith our help, so let me know if you change your mind. Even if you've declined a Quest, you can receive the Quest again if you just come and talk to me."); + qm.sendNext("Whoa, whoa! Are you really declining my offer? Well, you'll be able to #blevel-up quicker #kwith our help, so let me know if you change your mind. Even if you've declined a Quest, you can receive the Quest again if you just come and talk to me."); qm.dispose(); } else { if (mode == 1) @@ -33,18 +33,19 @@ function end(mode, type, selection) { if (status == 0) { qm.sendNext("Are you the Noblesse my brother Kimu sent? Nice to meet you! I'm Kizan. I'll give you the reward Kimu asked me to give you. Remember, you can check your Inventory by pressing the #bI key#k. Red potions help you recover HP, and blue ones help recover MP. It's a good idea to learn how to use them beforehand so you'll be ready with them when you're in danger. \r\n\r\n#fUI/UIWindow.img/Quest/reward# \r\n\r\n#v2000020# #z2000020# \r\n#v2000021# #z2000021# \r\n\r\n#fUI/UIWindow.img/QuestIcon/8/0#15 exp"); } else if (status == 1) { - if(qm.canHold(2000022) && qm.canHold(2000023)){ - if(!qm.isQuestCompleted(21010)) { - qm.gainItem(2000020, 5); - qm.gainItem(2000021, 5); - qm.gainExp(15); - } - qm.guideHint(3); - qm.forceCompleteQuest(); - } else - qm.dropMessage(1, "Your inventory is full"); - - qm.dispose(); + if(qm.canHold(2000022) && qm.canHold(2000023)){ + if(!qm.isQuestCompleted(21010)) { + qm.gainItem(2000020, 5); + qm.gainItem(2000021, 5); + qm.gainExp(15); + } + qm.guideHint(3); + qm.forceCompleteQuest(); + } else { + qm.dropMessage(1, "Your inventory is full"); + } + + qm.dispose(); } } } \ No newline at end of file diff --git a/scripts/quest/20527.js b/scripts/quest/20527.js index 14bcf7e65b..feaf651d3a 100644 --- a/scripts/quest/20527.js +++ b/scripts/quest/20527.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21201.js b/scripts/quest/21201.js index 2a4bab9290..e166b792e8 100644 --- a/scripts/quest/21201.js +++ b/scripts/quest/21201.js @@ -24,44 +24,53 @@ importPackage(Packages.client); var status = -1; function end(mode, type, selection) { - status++; - if (mode != 1){ - if (mode == 0 && type == 1) - qm.sendNext("Hey! At least say you tried!"); + if (mode == -1) { + qm.sendNext("Hey! At least say you tried!"); qm.dispose(); - return; + } else { + if(mode == 0 && type > 0) { + qm.sendNext("Hey! At least say you tried!"); + qm.dispose(); + return; + } + + if (mode == 1) + status++; + else + status--; + + if (status == 0) + qm.sendNext("First you promise to defeat the Black Mage and make me a famous weapon, then you abandon me for hundreds of years, and now you're telling me you don't remember who I am? What the...?! Do you think I will let you get away with that? You're the one who begged and pined for me!"); //Giant Polearm + else if (status == 1) + qm.sendNextPrev("I did tell #p1203000# to make a pole arm for me if I could prove my worth.", 2); + else if (status == 2) + qm.sendNextPrev("After all that begging, shouldn't you treat me with a little more love and respect? Ya know, a weapon like me's a rare and wonderful thing. I am the ultimate #p1201001# that can help you defeat the Black Mage. How could you ditch me for hundreds of years?"); + else if (status == 3) + qm.sendNextPrev("Hey, I never begged for you.", 2); + else if (status == 4) + qm.sendNextPrev("What? You never begged for me? Ha! #p1203000# told me you got on your knees, begged for me in tears, and... Wait a sec. Aran! Did you just remember who I am?"); + else if (status == 5) + qm.sendNextPrev("Maybe a little bit...", 2); + else if (status == 6) + qm.sendNextPrev("Aran, it is you! *Sniff sniff* Wait, *ahem* I didn't get emotional, it's just allergies. I know the Black Mage has stripped you of your abilities so you probably don't even have the strength to lift me... but at least you remember me! I'm glad that your memory's starting to return."); + else if (status == 7) + qm.sendAcceptDecline("Even though you've lost your memory, you're still my master. You endured some very tough training in the past, and I'm sure your body still remembers the skills you got through those hard times. Alright, I'll restore your abilities!"); + else if (status == 8) { + if(!qm.isQuestCompleted(21201)) { + if(!qm.canHold(1142130)) { + cm.sendOk("Wow, your #bequip#k inventory is full. I need you to make at least 1 empty slot to complete this quest."); + qm.dispose(); + return; + } + + qm.gainItem(1142130, true); + qm.changeJobById(2110); + + qm.completeQuest(); + } + + qm.sendNext("Your level isn't what it used to be back in your glory days, so I can't restore all of your old abilities. But the few I can restore should help you level up faster. Now hurry up and train so you can return to the old you."); + qm.dispose(); + } } - if (status == 0) - qm.sendNext("First you promise to defeat the Black Mage and make me a famous weapon, then you abandon me for hundreds of years, and now you're telling me you don't remember who I am? What the...?! Do you think I will let you get away with that? You're the one who begged and pined for me!"); //Giant Polearm - else if (status == 1) - qm.sendNextPrev("I did tell #p1203000# to make a pole arm for me if I could prove my worth.", 2); - else if (status == 2) - qm.sendNextPrev("After all that begging, shouldn't you treat me with a little more love and respect? Ya know, a weapon like me's a rare and wonderful thing. I am the ultimate #p1201001# that can help you defeat the Black Mage. How could you ditch me for hundreds of years?"); - else if (status == 3) - qm.sendNextPrev("Hey, I never begged for you.", 2); - else if (status == 4) - qm.sendNextPrev("What? You never begged for me? Ha! #p1203000# told me you got on your knees, begged for me in tears, and... Wait a sec. Aran! Did you just remember who I am?"); - else if (status == 5) - qm.sendNextPrev("Maybe a little bit...", 2); - else if (status == 6) - qm.sendNextPrev("Aran, it is you! *Sniff sniff* Wait, *ahem* I didn't get emotional, it's just allergies. I know the Black Mage has stripped you of your abilities so you probably don't even have the strength to lift me... but at least you remember me! I'm glad that your memory's starting to return."); - else if (status == 7) - qm.sendAcceptDecline("Even though you've lost your memory, you're still my master. You endured some very tough training in the past, and I'm sure your body still remembers the skills you got through those hard times. Alright, I'll restore your abilities!"); - else if (status == 8) { - if(!qm.isQuestCompleted(21201)) { - if(!qm.canHold(1142130)) { - cm.sendOk("Wow, your #bequip#k inventory is full. I need you to make at least 1 empty slot to complete this quest."); - qm.dispose(); - return; - } - - qm.gainItem(1142130, true); - qm.changeJobById(2110); - - qm.completeQuest(); - } - - qm.sendNext("Your level isn't what it used to be back in your glory days, so I can't restore all of your old abilities. But the few I can restore should help you level up faster. Now hurry up and train so you can return to the old you."); - qm.dispose(); - } } \ No newline at end of file diff --git a/scripts/quest/21202.js b/scripts/quest/21202.js index 253afb089f..bddef9d732 100644 --- a/scripts/quest/21202.js +++ b/scripts/quest/21202.js @@ -31,20 +31,21 @@ function start(mode, type, selection) { return; } if (status == 0) { - qm.sendNext("Hmm.. What's a young person like you doing in this secluded place?"); - } else if(status == 1) { - qm.sendNextPrev("I've come to get the best Polearm there is!", 2); - } else if(status == 2) { - qm.sendNextPrev("The best Polearm? You should be able to purchase it in some town or other place.."); - } else if(status == 3) { - qm.sendNextPrev("I hear you are the best blacksmith in all of Maple World! I want nothing less than a weapon made by you!", 2); - } else if(status == 4) { - qm.sendAcceptDecline("I'm too old to make weapons now, but.. I do have a Polearm that I made way back when. It's still in excellent shape. But I can't give it to you because that Polearm is extremely sharp, so sharp it could hurt its master. Do you still want it?"); - } else if(status == 5) { - qm.sendOk("Well, if you say so.. I can't object to that. I'll tell you what. I'll give you a quick test, and if you pass it, the Giant Polearm is yours. Head over to the #bTraining Center#k and take on the #rScarred Bears#k that are there. Your job is to bring back #b30 Sign of Acceptances#k."); - qm.startQuest(); - qm.dispose(); - } + qm.sendNext("Hmm.. What's a young person like you doing in this secluded place?"); + } else if(status == 1) { + qm.sendNextPrev("I've come to get the best Polearm there is!", 2); + } else if(status == 2) { + qm.sendNextPrev("The best Polearm? You should be able to purchase it in some town or other place.."); + } else if(status == 3) { + qm.sendNextPrev("I hear you are the best blacksmith in all of Maple World! I want nothing less than a weapon made by you!", 2); + } else if(status == 4) { + qm.sendAcceptDecline("I'm too old to make weapons now, but.. I do have a Polearm that I made way back when. It's still in excellent shape. But I can't give it to you because that Polearm is extremely sharp, so sharp it could hurt its master. Do you still want it?"); + } else if(status == 5) { + qm.sendOk("Well, if you say so.. I can't object to that. I'll tell you what. I'll give you a quick test, and if you pass it, the Giant Polearm is yours. Head over to the #bTraining Center#k and take on the #rScarred Bears#k that are there. Your job is to bring back #b30 Sign of Acceptances#k."); + } else { + qm.startQuest(); + qm.dispose(); + } } function end(mode, type, selection) { diff --git a/scripts/quest/21302.js b/scripts/quest/21302.js index f6df19198b..46f6bc1f5d 100644 --- a/scripts/quest/21302.js +++ b/scripts/quest/21302.js @@ -31,24 +31,29 @@ function end(mode, type, selection) { qm.dispose(); return; } - if (status == 0) + if (status == 0) { qm.sendNext("Wait.. Isn't that.. Did you remember how to make Red Jade?\r\nWow... you may be stupid and prone to amnesia, but this is why I can't abandon you. Now give me the jade!"); //Giant Polearm - else if (status == 1) + } else if (status == 1) { qm.sendNextPrev("Okay, now that I have the Red Jade back on, let me work on reawakening more of your abilities. I mean, your level's gone much higher since the last time we met, so I am sure I can work my magic a bit more this time!"); - else if (status == 2) { - if(!qm.isQuestCompleted(21302)) { - if(!qm.canHold(1142131)) { - cm.sendOk("Wow, your #bequip#k inventory is full. I need you to make at least 1 empty slot to complete this quest."); - qm.dispose(); - return; - } - - qm.gainItem(1142131, true); - qm.changeJobById(2111); - - qm.completeQuest(); - } - qm.sendNext("Come on, keep training so you can get all your abilities back, and that way we can explore together once more!"); - qm.dispose(); - } + } else if (status == 2) { + if(!qm.isQuestCompleted(21302)) { + if(!qm.canHold(1142131)) { + cm.sendOk("Wow, your #bequip#k inventory is full. I need you to make at least 1 empty slot to complete this quest."); + qm.dispose(); + return; + } + + if(qm.haveItem(4032312, 1)) { + qm.gainItem(4032312, -1); + } + + qm.gainItem(1142131, true); + qm.changeJobById(2111); + + qm.completeQuest(); + } + + qm.sendNext("Come on, keep training so you can get all your abilities back, and that way we can explore together once more!"); + qm.dispose(); + } } \ No newline at end of file diff --git a/scripts/quest/21303.js b/scripts/quest/21303.js new file mode 100644 index 0000000000..f55376b1d3 --- /dev/null +++ b/scripts/quest/21303.js @@ -0,0 +1,50 @@ +/* + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +var status = -1; + +function start(mode, type, selection) { + if (mode == -1) { + qm.dispose(); + } else { + if(mode == 0 && type > 0) { + qm.dispose(); + return; + } + + if (mode == 1) + status++; + else + status--; + + if (status == 0) { + qm.sendNext("Aaaargh... Yeti's #b#t4032339##k has just been stolen! How frustrating, Yeti worked hard to get it, just to have it stolen by that #rThief Crow#k...", 9); + } else if (status == 1) { + qm.sendNextPrev("Hey, I was just passing by and could not refrain from hearing you just now. I can lend you my strength, where did the thief go?", 3); + } else if (status == 2) { + qm.sendNextPrev("Oh, how nice of you... Thief has passed #rthrough the gate at west#k. Bring back the #b#t4032339##k, Yeti needs it to give to beloved one.", 9); + } else if (status == 3) { + qm.sendNextPrev("Ok, wait there. I will return it back to you in no time!", 3); + } else if (status == 4) { + qm.forceStartQuest(); + qm.dispose(); + } + } +} diff --git a/scripts/quest/21600.js b/scripts/quest/21600.js index 05335d6caa..7d5f2e1c3d 100644 --- a/scripts/quest/21600.js +++ b/scripts/quest/21600.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21604.js b/scripts/quest/21604.js index 1ff4020b00..611ebbd6ed 100644 --- a/scripts/quest/21604.js +++ b/scripts/quest/21604.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -38,7 +38,7 @@ function start(mode, type, selection) { qm.sendNext("You want to use a Wolf as a mount, but you don't have a #bWolf saddle#k? Why, I have just the fine solution for you! Come here in #bEl Nath#k first, I shall teach you how to mount a wolf as an extra."); } else if (status == 1) { qm.sendNext("Once here, hunt for #r50 #t4000048##k then bring them to me."); - + } else if (status == 2) { qm.forceStartQuest(); qm.dispose(); } diff --git a/scripts/quest/21613.js b/scripts/quest/21613.js index 93f4c051a5..b0d80f11bb 100644 --- a/scripts/quest/21613.js +++ b/scripts/quest/21613.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21618.js b/scripts/quest/21618.js index e32b0f569a..1f606ef1cd 100644 --- a/scripts/quest/21618.js +++ b/scripts/quest/21618.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21728.js b/scripts/quest/21728.js index 88bb7ba1fe..b212bb7c2f 100644 --- a/scripts/quest/21728.js +++ b/scripts/quest/21728.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21729.js b/scripts/quest/21729.js index f56e2b7172..cdb2afab67 100644 --- a/scripts/quest/21729.js +++ b/scripts/quest/21729.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -36,8 +36,8 @@ function start(mode, type, selection) { if (status == 0) { qm.sendNext("Okay, you should not return to #bTru#k for further details on your next steps. ... Oh wait!! I remembered something. See the #rMysterious Statue#k over there? That statue has it's origins unknwown, and there's something scribbled onto it that resembles something big, it probably is the password for the cave? #rGet the password there#k, it may help you on your journey."); + } else if (status == 1) { qm.forceStartQuest(); - qm.dispose(); } } diff --git a/scripts/quest/21733.js b/scripts/quest/21733.js index 5543134235..198d31a296 100644 --- a/scripts/quest/21733.js +++ b/scripts/quest/21733.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21734.js b/scripts/quest/21734.js index fb881b5e31..109068e345 100644 --- a/scripts/quest/21734.js +++ b/scripts/quest/21734.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21735.js b/scripts/quest/21735.js index e423faa57d..2ce1c84b51 100644 --- a/scripts/quest/21735.js +++ b/scripts/quest/21735.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21736.js b/scripts/quest/21736.js index 88b474162c..b9bda8727c 100644 --- a/scripts/quest/21736.js +++ b/scripts/quest/21736.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -39,10 +39,10 @@ function start(mode, type, selection) { } else if(status == 1) { qm.sendNextPrev("Anyway, enough small talk. I realized that it might be more effective to search for information in places outside Victoria Island as well, so I've begun investigating in Ossyria. I began with #bOrbis#k and immediately hit the jackpot."); } else if(status == 2) { - qm.sendAcceptDecline("It seems like something strange is happening in Orbis in Ossyria. It's a bit different from when we were dealing with the puppeteer, but my instincts tell me it has to do with the Black Wings. Please head over to Orbis."); + qm.sendNextPrev("It seems like something strange is happening in Orbis in Ossyria. It's a bit different from when we were dealing with the puppeteer, but my instincts tell me it has to do with the Black Wings. Please head over to Orbis."); + } else if(status == 3) { + qm.sendAcceptDecline("#bLisa the Fairy#k in Orbis should know a thing or two. Go see Lisa first, she knows someone that knows the whereabouts of the sealing stone. That person #rwill require a password from you#k, when requested use the #bThere's something strange going on in Orbis....#k keyword to talk to her. Understood?"); } else { - qm.sendNext("#bLisa the Fairy#k in Orbis should know a thing or two. Go see Lisa first, when requested use the #bThere's something strange going on in Orbis....#k keyword to talk to her."); - qm.forceStartQuest(); qm.dispose(); } diff --git a/scripts/quest/21738.js b/scripts/quest/21738.js index a44fff41c7..5e19fd7a27 100644 --- a/scripts/quest/21738.js +++ b/scripts/quest/21738.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -34,9 +34,9 @@ function start(mode, type, selection) { else status--; - if(status == 0) { + if (status == 0) { qm.sendGetText("Hm, what do you want?"); - } else { + } else if (status == 1) { var text = qm.getText(); if(text != "There's something strange going on in Orbis....") { @@ -44,10 +44,10 @@ function start(mode, type, selection) { qm.dispose(); } else { qm.sendNext("Oh, that's right. I can sense the power emanating from you, as well. So I shall entrust something to you."); - - qm.forceStartQuest(); - qm.dispose(); } + } else { + qm.forceStartQuest(); + qm.dispose(); } } } diff --git a/scripts/quest/21739.js b/scripts/quest/21739.js index e7096e427e..c8e3d0dbdd 100644 --- a/scripts/quest/21739.js +++ b/scripts/quest/21739.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21740.js b/scripts/quest/21740.js index 9708ef9d68..f5f4fd3b8a 100644 --- a/scripts/quest/21740.js +++ b/scripts/quest/21740.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21741.js b/scripts/quest/21741.js index 66657881cb..e591800988 100644 --- a/scripts/quest/21741.js +++ b/scripts/quest/21741.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21742.js b/scripts/quest/21742.js index edf16d7c67..01cb2d3988 100644 --- a/scripts/quest/21742.js +++ b/scripts/quest/21742.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -53,16 +53,18 @@ function start(mode, type, selection) { } else if (status == 8) { qm.sendNextPrev("So then I thought, well what's the point of delivering it to Mu Gong? I must first restore the writing on Hanging Scroll. That's why I need you to do something for me. The guy down there writing on Hanging Scroll... is #bJin Jin#k, the greatest artist on all of Mu Lung. I'm sure he'd be able to restore the writing on Hanging Scroll.", 9); } else { - if(qm.canHold(4220151)) { - qm.gainItem(4220151, 1); + if(!qm.haveItem(4220151, 1)) { + if(!qm.canHold(4220151, 1)) { + qm.sendOk("Please free a room on your ETC inventory.", 9); + qm.dispose(); + return; + } - qm.forceStartQuest(); - qm.dispose(); - } else { - qm.sendOk("Please free a room on your ETC inventory.", 9); - qm.dispose(); - return; + qm.gainItem(4220151, 1); } + + qm.forceStartQuest(); + qm.dispose(); } } } @@ -83,12 +85,12 @@ function end(mode, type, selection) { if (status == 0) { qm.sendNext("Oh, you brought the ink. Now let me pour it, cautiously.... Almost there, almost. ... ..... Kyaaa! Th-the letter. It says: 'I'll be there to take your Seal Rock of Mu Lung.'"); - + } else if (status == 1) { qm.gainItem(4032342, -8); qm.gainItem(4220151, -1); qm.gainExp(10000 * qm.getPlayer().getExpRate()); - qm.forceCompleteQuest(); + qm.forceCompleteQuest(); qm.dispose(); } } diff --git a/scripts/quest/21746.js b/scripts/quest/21746.js index 3da5ccb4c1..cf701c1bd4 100644 --- a/scripts/quest/21746.js +++ b/scripts/quest/21746.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -70,12 +70,12 @@ function end(mode, type, selection) { if (status == 0) { qm.sendNext("Oh, you brought the ink. Now let me pour it, cautiously.... Almost there, almost. ... ..... Kyaaa! Th-the letter. It says: 'I'll be there to take your Seal Rock of Mu Lung.'"); - + } else if (status == 1) { qm.gainItem(4032342, -8); qm.gainItem(4220151, -1); qm.gainExp(10000 * qm.getPlayer().getExpRate()); - qm.forceCompleteQuest(); + qm.forceCompleteQuest(); qm.dispose(); } } diff --git a/scripts/quest/21747.js b/scripts/quest/21747.js index f75968dc7d..c3d701502e 100644 --- a/scripts/quest/21747.js +++ b/scripts/quest/21747.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21748.js b/scripts/quest/21748.js index d8e43a2a3a..bb84505fa2 100644 --- a/scripts/quest/21748.js +++ b/scripts/quest/21748.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21749.js b/scripts/quest/21749.js index 962e18df64..24e7a4d488 100644 --- a/scripts/quest/21749.js +++ b/scripts/quest/21749.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21750.js b/scripts/quest/21750.js index 5538f24c02..ea2dd7cd7f 100644 --- a/scripts/quest/21750.js +++ b/scripts/quest/21750.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21753.js b/scripts/quest/21753.js index 0d90e5b00c..e59a01ca8a 100644 --- a/scripts/quest/21753.js +++ b/scripts/quest/21753.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21754.js b/scripts/quest/21754.js index d804957a8c..b38f50f135 100644 --- a/scripts/quest/21754.js +++ b/scripts/quest/21754.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/21757.js b/scripts/quest/21757.js index c4afbf9989..d5001fce1b 100644 --- a/scripts/quest/21757.js +++ b/scripts/quest/21757.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2214.js b/scripts/quest/2214.js index 7261d9cc31..78a1845db6 100644 --- a/scripts/quest/2214.js +++ b/scripts/quest/2214.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2215.js b/scripts/quest/2215.js index 6e0f60bc38..4f0070edbe 100644 --- a/scripts/quest/2215.js +++ b/scripts/quest/2215.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2216.js b/scripts/quest/2216.js index 0daf60319a..18b854e063 100644 --- a/scripts/quest/2216.js +++ b/scripts/quest/2216.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2217.js b/scripts/quest/2217.js index 3d05669b62..ccd59d8d95 100644 --- a/scripts/quest/2217.js +++ b/scripts/quest/2217.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2218.js b/scripts/quest/2218.js index 88dc060c71..7dcee42f48 100644 --- a/scripts/quest/2218.js +++ b/scripts/quest/2218.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2219.js b/scripts/quest/2219.js index 15d25d730e..d6ed9ec845 100644 --- a/scripts/quest/2219.js +++ b/scripts/quest/2219.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2228.js b/scripts/quest/2228.js index b5d23cdd16..fe7a66086c 100644 --- a/scripts/quest/2228.js +++ b/scripts/quest/2228.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2238.js b/scripts/quest/2238.js index c0e328a180..7ea10eb440 100644 --- a/scripts/quest/2238.js +++ b/scripts/quest/2238.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2245.js b/scripts/quest/2245.js index a84500cf39..c14537e296 100644 --- a/scripts/quest/2245.js +++ b/scripts/quest/2245.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2257.js b/scripts/quest/2257.js index 4fd5bc1ae8..94a483926f 100644 --- a/scripts/quest/2257.js +++ b/scripts/quest/2257.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2258.js b/scripts/quest/2258.js index 9765335672..78ae395217 100644 --- a/scripts/quest/2258.js +++ b/scripts/quest/2258.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2259.js b/scripts/quest/2259.js index a3bba3acbf..ac59e7278f 100644 --- a/scripts/quest/2259.js +++ b/scripts/quest/2259.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2260.js b/scripts/quest/2260.js index 0b6ad48d92..0603161acd 100644 --- a/scripts/quest/2260.js +++ b/scripts/quest/2260.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2291.js b/scripts/quest/2291.js index 33c5d4f356..48b8daa124 100644 --- a/scripts/quest/2291.js +++ b/scripts/quest/2291.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/2338.js b/scripts/quest/2338.js index e267b20ff7..b2d909564d 100644 --- a/scripts/quest/2338.js +++ b/scripts/quest/2338.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/29924.js b/scripts/quest/29924.js index 84c9c0010e..bd73b2f22d 100644 --- a/scripts/quest/29924.js +++ b/scripts/quest/29924.js @@ -2,19 +2,45 @@ var status = -1; function start(mode, type, selection) { - if (qm.canHold(1142129) && !qm.haveItem(1142129) && qm.getPlayer().getLevel() >= 10 && ((qm.getPlayer().getJob().getId() / 100) | 0) == 21) { - qm.gainItem(1142129,1); + if (qm.getPlayer().getLevel() >= 10 && ((qm.getPlayer().getJob().getId() / 100) | 0) == 21) { + if(!qm.haveItem(1142129)) { + if(qm.canHold(1142129)) { + qm.gainItem(1142129,1); + } else { + qm.dispose(); + return; + } + } + + var medalname = qm.getMedalName(); + qm.message("<" + medalname + "> has been awarded."); + qm.earnTitle("<" + medalname + "> has been awarded."); + qm.forceStartQuest(); qm.forceCompleteQuest(); } + qm.dispose(); } function end(mode, type, selection) { - if (qm.canHold(1142129) && !qm.haveItem(1142129) && qm.getPlayer().getLevel() >= 10 && ((qm.getPlayer().getJob().getId() / 100) | 0) == 21) { - qm.gainItem(1142129,1); + if (qm.getPlayer().getLevel() >= 10 && ((qm.getPlayer().getJob().getId() / 100) | 0) == 21) { + if(!qm.haveItem(1142129)) { + if(qm.canHold(1142129)) { + qm.gainItem(1142129,1); + } else { + qm.dispose(); + return; + } + } + + var medalname = qm.getMedalName(); + qm.message("<" + medalname + "> has been awarded."); + qm.earnTitle("<" + medalname + "> has been awarded."); + qm.forceStartQuest(); qm.forceCompleteQuest(); } + qm.dispose(); } \ No newline at end of file diff --git a/scripts/quest/3108.js b/scripts/quest/3108.js index 339a856c78..71e60da7c9 100644 --- a/scripts/quest/3108.js +++ b/scripts/quest/3108.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3311.js b/scripts/quest/3311.js index 6912a7dabb..5f382b58c0 100644 --- a/scripts/quest/3311.js +++ b/scripts/quest/3311.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3314.js b/scripts/quest/3314.js index 5fb8e21f26..ba26a7611b 100644 --- a/scripts/quest/3314.js +++ b/scripts/quest/3314.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3320.js b/scripts/quest/3320.js index 3dfd93b5bd..107d5c19ef 100644 --- a/scripts/quest/3320.js +++ b/scripts/quest/3320.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3321.js b/scripts/quest/3321.js index fe20981846..577995ea74 100644 --- a/scripts/quest/3321.js +++ b/scripts/quest/3321.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3345.js b/scripts/quest/3345.js index 898353c76e..a136643d35 100644 --- a/scripts/quest/3345.js +++ b/scripts/quest/3345.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3353.js b/scripts/quest/3353.js index a28b158cd5..62498918b4 100644 --- a/scripts/quest/3353.js +++ b/scripts/quest/3353.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3354.js b/scripts/quest/3354.js index 14c9c76165..64721224b5 100644 --- a/scripts/quest/3354.js +++ b/scripts/quest/3354.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3529.js b/scripts/quest/3529.js index ab1d00ab59..7e2c07ba54 100644 --- a/scripts/quest/3529.js +++ b/scripts/quest/3529.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3714.js b/scripts/quest/3714.js index c0fb077e58..fce4608172 100644 --- a/scripts/quest/3714.js +++ b/scripts/quest/3714.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3926.js b/scripts/quest/3926.js index 59cfa66bc9..e0ecac3644 100644 --- a/scripts/quest/3926.js +++ b/scripts/quest/3926.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3929.js b/scripts/quest/3929.js index 2dc8f53920..463bcc2335 100644 --- a/scripts/quest/3929.js +++ b/scripts/quest/3929.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3933.js b/scripts/quest/3933.js index e5eb3d02dd..86dc102299 100644 --- a/scripts/quest/3933.js +++ b/scripts/quest/3933.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3941.js b/scripts/quest/3941.js index 2a9fed9724..93be8f435f 100644 --- a/scripts/quest/3941.js +++ b/scripts/quest/3941.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/3953.js b/scripts/quest/3953.js index 0c243f4684..78f7af11d8 100644 --- a/scripts/quest/3953.js +++ b/scripts/quest/3953.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/6030.js b/scripts/quest/6030.js index 4678603378..b82fe1822e 100644 --- a/scripts/quest/6030.js +++ b/scripts/quest/6030.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/6031.js b/scripts/quest/6031.js index d4c19d5071..0372bffbd0 100644 --- a/scripts/quest/6031.js +++ b/scripts/quest/6031.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/6032.js b/scripts/quest/6032.js index 003715abeb..0a7a52ee17 100644 --- a/scripts/quest/6032.js +++ b/scripts/quest/6032.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/6033.js b/scripts/quest/6033.js index 0681d30213..090401b065 100644 --- a/scripts/quest/6033.js +++ b/scripts/quest/6033.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/quest/6036.js b/scripts/quest/6036.js index 28009760e1..b1bab49ef2 100644 --- a/scripts/quest/6036.js +++ b/scripts/quest/6036.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1020000.js b/scripts/reactor/1020000.js index 010625cc00..a68d191a7f 100644 --- a/scripts/reactor/1020000.js +++ b/scripts/reactor/1020000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1020001.js b/scripts/reactor/1020001.js index 1240852870..e429663b33 100644 --- a/scripts/reactor/1020001.js +++ b/scripts/reactor/1020001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1020002.js b/scripts/reactor/1020002.js index ecab666900..72cde24501 100644 --- a/scripts/reactor/1020002.js +++ b/scripts/reactor/1020002.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1021000.js b/scripts/reactor/1021000.js index 6d181e4ff6..ed9383ef78 100644 --- a/scripts/reactor/1021000.js +++ b/scripts/reactor/1021000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1021001.js b/scripts/reactor/1021001.js index ec4e6e43ee..36c8761480 100644 --- a/scripts/reactor/1021001.js +++ b/scripts/reactor/1021001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1021002.js b/scripts/reactor/1021002.js index 5ae54c93c2..a57e1cf176 100644 --- a/scripts/reactor/1021002.js +++ b/scripts/reactor/1021002.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1022000.js b/scripts/reactor/1022000.js index 5ae3a13613..0039d5fffb 100644 --- a/scripts/reactor/1022000.js +++ b/scripts/reactor/1022000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1022001.js b/scripts/reactor/1022001.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/1022001.js +++ b/scripts/reactor/1022001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/1032000.js b/scripts/reactor/1032000.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/1032000.js +++ b/scripts/reactor/1032000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200000.js b/scripts/reactor/200000.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200000.js +++ b/scripts/reactor/200000.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200001.js b/scripts/reactor/200001.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200001.js +++ b/scripts/reactor/200001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200002.js b/scripts/reactor/200002.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200002.js +++ b/scripts/reactor/200002.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200003.js b/scripts/reactor/200003.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200003.js +++ b/scripts/reactor/200003.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200004.js b/scripts/reactor/200004.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200004.js +++ b/scripts/reactor/200004.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200005.js b/scripts/reactor/200005.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200005.js +++ b/scripts/reactor/200005.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200006.js b/scripts/reactor/200006.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200006.js +++ b/scripts/reactor/200006.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200007.js b/scripts/reactor/200007.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200007.js +++ b/scripts/reactor/200007.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200008.js b/scripts/reactor/200008.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200008.js +++ b/scripts/reactor/200008.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/200009.js b/scripts/reactor/200009.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/200009.js +++ b/scripts/reactor/200009.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/2052001.js b/scripts/reactor/2052001.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/2052001.js +++ b/scripts/reactor/2052001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/2112015.js b/scripts/reactor/2112015.js index 9371dcfa5c..aba1ec101f 100644 --- a/scripts/reactor/2112015.js +++ b/scripts/reactor/2112015.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/6741001.js b/scripts/reactor/6741001.js index 088d9bea75..2d1a4b5df5 100644 --- a/scripts/reactor/6741001.js +++ b/scripts/reactor/6741001.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/6741015.js b/scripts/reactor/6741015.js index 193b5bfd7f..72ff27e2ea 100644 --- a/scripts/reactor/6741015.js +++ b/scripts/reactor/6741015.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/scripts/reactor/6742014.js b/scripts/reactor/6742014.js index b343b07cde..6ea47b163f 100644 --- a/scripts/reactor/6742014.js +++ b/scripts/reactor/6742014.js @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/sql/db_database.sql b/sql/db_database.sql index 2963528138..d23b666677 100644 --- a/sql/db_database.sql +++ b/sql/db_database.sql @@ -11432,7 +11432,6 @@ INSERT IGNORE INTO `temp_data` (`id`, `dropperid`, `itemid`, `minimum_quantity`, (11213, 9001005, 4031857, 1, 1, 2192, 300000), (11214, 9001012, 4032311, 1, 1, 0, 300000), (11215, 9001012, 4032311, 1, 1, 0, 300000), -(11216, 9001013, 4032312, 1, 1, 0, 999999), (11217, 9001013, 4032339, 1, 1, 21303, 999999), (11219, 4230113, 1452016, 1, 1, 0, 700), (11220, 4230103, 1452016, 1, 1, 0, 700), diff --git a/sql/db_drops.sql b/sql/db_drops.sql index fe1e71e264..ad4f8bcc27 100644 --- a/sql/db_drops.sql +++ b/sql/db_drops.sql @@ -20093,9 +20093,6 @@ USE `heavenms`; (1210100, 4032379, 1, 1, 2409, 40000), (2130100, 4001344, 1, 1, 0, 7000), (7220002, 4031789, 1, 1, 3844, 999999), -(9300102, 4031507, 1, 1, 6002, 999999), -(9300061, 4001101, 1, 1, 0, 999999), -(9300093, 4031495, 1, 1, 6192, 999999), (8830007, 1302112, 1, 1, 0, 4000), (8830007, 1302113, 1, 1, 0, 4000), (8830007, 1312042, 1, 1, 0, 4000), @@ -21497,7 +21494,10 @@ USE `heavenms`; (9300343, 4030012, 1, 1, 0, 10000), (9300343, 4031846, 1, 1, 2173, 50000), (9300343, 4032130, 1, 1, 20707, 10000), -(9300343, 4032340, 1, 1, 21710, 200000); +(9300343, 4032340, 1, 1, 21710, 200000), +(9300102, 4031507, 1, 1, 6002, 999999), +(9300061, 4001101, 1, 1, 0, 999999), +(9300093, 4031495, 1, 1, 6192, 999999); -- Copying drops from some mobs to other versions of them diff --git a/sql/readme.txt b/sql/readme.txt index fc0add2a06..4134491a53 100644 --- a/sql/readme.txt +++ b/sql/readme.txt @@ -1,4 +1,4 @@ ----- HeavenMS (MapleSolaxiaV2) MySQL Database ---- +---- HeavenMS MySQL Database ---- These SQL files must be executed IN ORDER to set up the database: - db_database.sql diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java index 9ee3d46644..1b378a0dba 100644 --- a/src/client/MapleCharacter.java +++ b/src/client/MapleCharacter.java @@ -22,6 +22,7 @@ package client; import java.awt.Point; +import java.lang.ref.WeakReference; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -45,7 +46,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.Comparator; -import tools.locks.MonitoredReentrantLock; import java.util.concurrent.locks.Lock; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.atomic.AtomicInteger; @@ -106,6 +106,7 @@ import tools.FilePrinter; import tools.MaplePacketCreator; import tools.Pair; import tools.Randomizer; +import tools.locks.MonitoredReentrantLock; import client.autoban.AutobanManager; import client.inventory.Equip; import client.inventory.Item; @@ -242,6 +243,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { private SavedLocation savedLocations[]; private SkillMacro[] skillMacros = new SkillMacro[5]; private List lastmonthfameids; + private List> lastVisitedMaps = new LinkedList<>(); private final Map quests; private Set controlled = new LinkedHashSet<>(); private Map entered = new LinkedHashMap<>(); @@ -1176,7 +1178,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { this.banishTime = 0; } - private void setBanishPlayerData(int banishMap, int banishSp, long banishTime) { + public void setBanishPlayerData(int banishMap, int banishSp, long banishTime) { this.banishMap = banishMap; this.banishSp = banishSp; this.banishTime = banishTime; @@ -1319,6 +1321,74 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { return false; } + public void updateMapDropsUponPartyOperation(List exPartyMembers) { + List> mapids; + + petLock.lock(); + try { + mapids = new LinkedList<>(lastVisitedMaps); + } finally { + petLock.unlock(); + } + + List partyMembers = new LinkedList<>(); + for(MapleCharacter mc : (exPartyMembers != null) ? exPartyMembers : this.getPartyMembers()) { + if(mc.isLoggedinWorld()) { + partyMembers.add(mc); + } + } + + MapleCharacter partyLeaver = null; + if(exPartyMembers != null) { + partyMembers.remove(this); + partyLeaver = this; + } + + int partyId = exPartyMembers != null ? 0 : this.getPartyId(); + for(WeakReference mapRef : mapids) { + MapleMap mapObj = mapRef.get(); + + if(mapObj != null) { + mapObj.updatePlayerItemDrops(partyId, id, partyMembers, partyLeaver); + } + } + } + + private Integer getVisitedMapIndex(MapleMap map) { + int idx = 0; + + for(WeakReference mapRef : lastVisitedMaps) { + if(map.equals(mapRef.get())) { + return idx; + } + + idx++; + } + + return -1; + } + + public void visitMap(MapleMap map) { + petLock.lock(); + try { + int idx = getVisitedMapIndex(map); + + if(idx == -1) { + if(lastVisitedMaps.size() == ServerConstants.MAP_VISITED_SIZE) { + lastVisitedMaps.remove(0); + } + } else { + WeakReference mapRef = lastVisitedMaps.remove(idx); + lastVisitedMaps.add(mapRef); + return; + } + + lastVisitedMaps.add(new WeakReference<>(map)); + } finally { + petLock.unlock(); + } + } + private void changeMapInternal(final MapleMap to, final Point pos, final byte[] warpPacket) { if(!canWarpMap) return; @@ -1335,6 +1405,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { map = to; setPosition(pos); map.addPlayer(this); + visitMap(map); prtLock.lock(); try { @@ -1522,50 +1593,55 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { return; } - boolean isPet = petIndex > -1; - final byte[] pickupPacket = MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), (isPet) ? 5 : 2, this.getId(), isPet, petIndex); - - boolean hasSpaceInventory = true; - if (mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866 || mapitem.getMeso() > 0 || ii.isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = MapleInventoryManipulator.checkSpace(client, mapitem.getItemId(), mapitem.getItem().getQuantity(), mapitem.getItem().getOwner()))) { - if ((this.getMapId() > 209000000 && this.getMapId() < 209000016) || (this.getMapId() >= 990000500 && this.getMapId() <= 990000502)) {//happyville trees and guild PQ - if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) { - if(mapitem.getMeso() > 0) { - this.gainMeso(mapitem.getMeso(), true, true, false); - this.getMap().pickItemDrop(pickupPacket, mapitem); - } else if(mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866) { - // Add NX to account, show effect and make item disappear - int nxGain = mapitem.getItemId() == 4031865 ? 100 : 250; - this.getCashShop().gainCash(1, nxGain); - - showHint("You have earned #e#b" + nxGain + " NX#k#n. (" + this.getCashShop().getCash(1) + " NX)", 300); - - this.getMap().pickItemDrop(pickupPacket, mapitem); - } else if (MapleInventoryManipulator.addFromDrop(client, mapitem.getItem(), true)) { - this.getMap().pickItemDrop(pickupPacket, mapitem); - } else { - client.announce(MaplePacketCreator.enableActions()); - return; - } - } else { - client.announce(MaplePacketCreator.showItemUnavailable()); - client.announce(MaplePacketCreator.enableActions()); - return; - } + mapitem.lockItem(); + try { + if(mapitem.isPickedUp()) { + client.announce(MaplePacketCreator.showItemUnavailable()); client.announce(MaplePacketCreator.enableActions()); return; } + + boolean isPet = petIndex > -1; + final byte[] pickupPacket = MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), (isPet) ? 5 : 2, this.getId(), isPet, petIndex); + + boolean hasSpaceInventory = true; + if (mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866 || mapitem.getMeso() > 0 || ii.isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = MapleInventoryManipulator.checkSpace(client, mapitem.getItemId(), mapitem.getItem().getQuantity(), mapitem.getItem().getOwner()))) { + int mapId = this.getMapId(); + + if ((mapId > 209000000 && mapId < 209000016) || (mapId >= 990000500 && mapId <= 990000502)) {//happyville trees and guild PQ + if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) { + if(mapitem.getMeso() > 0) { + this.gainMeso(mapitem.getMeso(), true, true, false); + this.getMap().pickItemDrop(pickupPacket, mapitem); + } else if(mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866) { + // Add NX to account, show effect and make item disappear + int nxGain = mapitem.getItemId() == 4031865 ? 100 : 250; + this.getCashShop().gainCash(1, nxGain); + + showHint("You have earned #e#b" + nxGain + " NX#k#n. (" + this.getCashShop().getCash(1) + " NX)", 300); + + this.getMap().pickItemDrop(pickupPacket, mapitem); + } else if (MapleInventoryManipulator.addFromDrop(client, mapitem.getItem(), true)) { + this.getMap().pickItemDrop(pickupPacket, mapitem); + } else { + client.announce(MaplePacketCreator.enableActions()); + return; + } + } else { + client.announce(MaplePacketCreator.showItemUnavailable()); + client.announce(MaplePacketCreator.enableActions()); + return; + } + client.announce(MaplePacketCreator.enableActions()); + return; + } - synchronized (mapitem) { if (mapitem.getQuest() > 0 && !this.needQuestItem(mapitem.getQuest(), mapitem.getItemId())) { client.announce(MaplePacketCreator.showItemUnavailable()); client.announce(MaplePacketCreator.enableActions()); return; } - if (mapitem.isPickedUp()) { - client.announce(MaplePacketCreator.showItemUnavailable()); - client.announce(MaplePacketCreator.enableActions()); - return; - } + if (mapitem.getMeso() > 0) { prtLock.lock(); try { @@ -1628,10 +1704,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { } this.getMap().pickItemDrop(pickupPacket, mapitem); + } else if(!hasSpaceInventory) { + client.announce(MaplePacketCreator.getInventoryFull()); + client.announce(MaplePacketCreator.getShowInventoryFull()); } - } else if(!hasSpaceInventory) { - client.announce(MaplePacketCreator.getInventoryFull()); - client.announce(MaplePacketCreator.getShowInventoryFull()); + } finally { + mapitem.unlockItem(); } } client.announce(MaplePacketCreator.enableActions()); @@ -4746,7 +4824,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { e.printStackTrace(); } } - + public void handleEnergyChargeGain() { // to get here energychargelevel has to be > 0 Skill energycharge = isCygnus() ? SkillFactory.getSkill(ThunderBreaker.ENERGY_CHARGE) : SkillFactory.getSkill(Marauder.ENERGY_CHARGE); MapleStatEffect ceffect; @@ -6111,8 +6189,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { try { if (party != null) { int channel = client.getChannel(); + int mapId = getMapId(); + for (MaplePartyCharacter partychar : party.getMembers()) { - if (partychar.getMapId() == getMapId() && partychar.getChannel() == channel) { + if (partychar.getMapId() == mapId && partychar.getChannel() == channel) { MapleCharacter other = Server.getInstance().getWorld(world).getChannel(channel).getPlayerStorage().getCharacterByName(partychar.getName()); if (other != null) { client.announce(MaplePacketCreator.updatePartyMemberHP(other.getId(), other.getHp(), other.getCurrentMaxHp())); @@ -6983,6 +7063,23 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { } merchantmeso = set; } + + public synchronized void withdrawMerchantMesos() { + int merchantMeso = this.getMerchantMeso(); + if (merchantMeso > 0) { + int possible = Integer.MAX_VALUE - merchantMeso; + + if (possible > 0) { + if (possible < merchantMeso) { + this.gainMeso(possible, false); + this.setMerchantMeso(merchantMeso - possible); + } else { + this.gainMeso(merchantMeso, false); + this.setMerchantMeso(0); + } + } + } + } public void setHiredMerchant(MapleHiredMerchant merchant) { this.hiredMerchant = merchant; @@ -7264,7 +7361,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { if (item == null){ //Basic check return(0); } - if (ItemConstants.isRechargable(item.getItemId())) { + if (ItemConstants.isRechargeable(item.getItemId())) { quantity = item.getQuantity(); } if (quantity < 0) { @@ -7540,8 +7637,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { private void updatePartyMemberHPInternal() { if (party != null) { int channel = client.getChannel(); + int mapId = getMapId(); + for (MaplePartyCharacter partychar : party.getMembers()) { - if (partychar.getMapId() == getMapId() && partychar.getChannel() == channel) { + if (partychar.getMapId() == mapId && partychar.getChannel() == channel) { MapleCharacter other = Server.getInstance().getWorld(world).getChannel(channel).getPlayerStorage().getCharacterByName(partychar.getName()); if (other != null) { other.client.announce(MaplePacketCreator.updatePartyMemberHP(getId(), this.hp, maxhp)); diff --git a/src/client/MapleClient.java b/src/client/MapleClient.java index ba5c7464b1..a34578940d 100644 --- a/src/client/MapleClient.java +++ b/src/client/MapleClient.java @@ -106,6 +106,7 @@ public class MapleClient { private byte gender = -1; private boolean disconnecting = false; private final Lock lock = new MonitoredReentrantLock(MonitoredLockType.CLIENT, true); + private static final Lock loginLock = new MonitoredReentrantLock(MonitoredLockType.CLIENT, true); private int votePoints; private int voteTime = -1; private long lastNpcClick; @@ -420,13 +421,17 @@ public class MapleClient { } public int finishLogin() { - synchronized (MapleClient.class) { - if (getLoginState() > LOGIN_NOTLOGGEDIN) { // 0 = LOGIN_NOTLOGGEDIN, 1= LOGIN_SERVER_TRANSITION, 2 = LOGIN_LOGGEDIN - loggedIn = false; - return 7; - } - updateLoginState(LOGIN_LOGGEDIN); - } + loginLock.lock(); + try { + if (getLoginState() > LOGIN_NOTLOGGEDIN) { // 0 = LOGIN_NOTLOGGEDIN, 1= LOGIN_SERVER_TRANSITION, 2 = LOGIN_LOGGEDIN + loggedIn = false; + return 7; + } + updateLoginState(LOGIN_LOGGEDIN); + } finally { + loginLock.unlock(); + } + return 0; } diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java index 6af1b4918d..6b903ffc84 100644 --- a/src/client/command/Commands.java +++ b/src/client/command/Commands.java @@ -1202,7 +1202,7 @@ public class Commands { case "heal": player.setHpMp(30000); break; - + case "item": case "drop": if (sub.length < 2){ @@ -2533,23 +2533,31 @@ public class Commands { case "forcevac": List items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM)); for (MapleMapObject item : items) { - MapleMapItem mapItem = (MapleMapItem) item; - if (mapItem.getMeso() > 0) { - player.gainMeso(mapItem.getMeso(), true); - } else if(mapItem.getItemId() == 4031865 || mapItem.getItemId() == 4031866) { - // Add NX to account, show effect and make item disappear - player.getCashShop().gainCash(1, mapItem.getItemId() == 4031865 ? 100 : 250); - } else if (mapItem.getItem().getItemId() >= 5000000 && mapItem.getItem().getItemId() <= 5000100) { - int petId = MaplePet.createPet(mapItem.getItem().getItemId()); - if (petId == -1) { - continue; - } - MapleInventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId); - } else { - MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true); - } - - player.getMap().pickItemDrop(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem); + MapleMapItem mapItem = (MapleMapItem) item; + + mapItem.lockItem(); + try { + if(mapItem.isPickedUp()) continue; + + if (mapItem.getMeso() > 0) { + player.gainMeso(mapItem.getMeso(), true); + } else if(mapItem.getItemId() == 4031865 || mapItem.getItemId() == 4031866) { + // Add NX to account, show effect and make item disappear + player.getCashShop().gainCash(1, mapItem.getItemId() == 4031865 ? 100 : 250); + } else if (mapItem.getItem().getItemId() >= 5000000 && mapItem.getItem().getItemId() <= 5000100) { + int petId = MaplePet.createPet(mapItem.getItem().getItemId()); + if (petId == -1) { + continue; + } + MapleInventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId); + } else { + MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true); + } + + player.getMap().pickItemDrop(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem); + } finally { + mapItem.unlockItem(); + } } break; diff --git a/src/client/inventory/MapleInventory.java b/src/client/inventory/MapleInventory.java index f7eb7bfcab..b0ffdeb651 100644 --- a/src/client/inventory/MapleInventory.java +++ b/src/client/inventory/MapleInventory.java @@ -146,7 +146,7 @@ public class MapleInventory implements Iterable { List itemList = listById(itemId); int openSlot = 0; - if(!ItemConstants.isRechargable(itemId)) { + if(!ItemConstants.isRechargeable(itemId)) { for (Item item : itemList) { required -= item.getQuantity(); @@ -246,7 +246,7 @@ public class MapleInventory implements Iterable { source.setPosition(dSlot); inventory.put(dSlot, source); inventory.remove(sSlot); - } else if (target.getItemId() == source.getItemId() && !ItemConstants.isRechargable(source.getItemId()) && isSameOwner(source, target)) { + } else if (target.getItemId() == source.getItemId() && !ItemConstants.isRechargeable(source.getItemId()) && isSameOwner(source, target)) { if (type.getType() == MapleInventoryType.EQUIP.getType() || type.getType() == MapleInventoryType.CASH.getType()) { swap(target, source); } else if (source.getQuantity() + target.getQuantity() > slotMax) { diff --git a/src/client/newyear/NewYearCardRecord.java b/src/client/newyear/NewYearCardRecord.java index 75d06c7cbe..532044a746 100644 --- a/src/client/newyear/NewYearCardRecord.java +++ b/src/client/newyear/NewYearCardRecord.java @@ -1,21 +1,22 @@ /* - * This file is part of the HeavenMS (MapleSolaxiaV2) Maple Story Server - * - * Copyright (C) 2017 RonanLana - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ package client.newyear; import client.MapleCharacter; diff --git a/src/client/processor/DueyProcessor.java b/src/client/processor/DueyProcessor.java new file mode 100644 index 0000000000..3babdac6ef --- /dev/null +++ b/src/client/processor/DueyProcessor.java @@ -0,0 +1,493 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + Copyleft (L) 2016 - 2018 RonanLana (HeavenMS) + + 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 . +*/ +package client.processor; + +import client.MapleCharacter; +import client.MapleClient; +import client.autoban.AutobanFactory; +import client.inventory.Equip; +import client.inventory.Item; +import client.inventory.MapleInventoryType; +import constants.ItemConstants; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Calendar; +import java.util.LinkedList; +import java.util.List; +import net.server.channel.Channel; +import server.DueyPackages; +import server.MapleInventoryManipulator; +import server.MapleItemInformationProvider; +import tools.DatabaseConnection; +import tools.FilePrinter; +import tools.MaplePacketCreator; + +/** + * + * @author RonanLana (synchronization of Duey modules) + */ +public class DueyProcessor { + + public enum Actions { + TOSERVER_SEND_ITEM(0x02), + TOSERVER_CLAIM_PACKAGE(0x04), + TOSERVER_REMOVE_PACKAGE(0x05), + TOSERVER_CLOSE_DUEY(0x07), + TOCLIENT_OPEN_DUEY(0x08), + TOCLIENT_SEND_ENABLE_ACTIONS(0x09), + TOCLIENT_SEND_NOT_ENOUGH_MESOS(0x0A), + TOCLIENT_SEND_INCORRECT_REQUEST(0x0B), + TOCLIENT_SEND_NAME_DOES_NOT_EXIST(0x0C), + TOCLIENT_SEND_SAMEACC_ERROR(0x0D), + TOCLIENT_SEND_RECEIVER_STORAGE_FULL(0x0E), + TOCLIENT_SEND_RECEIVER_UNABLE_TO_RECV(0x0F), + TOCLIENT_SEND_RECEIVER_STORAGE_WITH_UNIQUE(0x10), + TOCLIENT_SEND_MESO_LIMIT(0x11), + TOCLIENT_SEND_SUCCESSFULLY_SENT(0x12), + TOCLIENT_RECV_UNKNOWN_ERROR(0x13), + TOCLIENT_RECV_ENABLE_ACTIONS(0x14), + TOCLIENT_RECV_NO_FREE_SLOTS(0x15), + TOCLIENT_RECV_RECEIVER_WITH_UNIQUE(0x16), + TOCLIENT_RECV_SUCCESSFUL_MSG(0x17), + TOCLIENT_RECV_PACKAGE_MSG(0x1B); + final byte code; + + private Actions(int code) { + this.code = (byte) code; + } + + public byte getCode() { + return code; + } + } + + private static int getAccIdFromCNAME(String name, boolean accountid) { + try { + PreparedStatement ps; + String text = "SELECT id,accountid FROM characters WHERE name = ?"; + Connection con = DatabaseConnection.getConnection(); + ps = con.prepareStatement(text); + ps.setString(1, name); + int id_; + try (ResultSet rs = ps.executeQuery()) { + if (!rs.next()) { + rs.close(); + ps.close(); + return -1; + } + id_ = accountid ? rs.getInt("accountid") : rs.getInt("id"); + } + ps.close(); + con.close(); + return id_; + } catch (SQLException e) { + e.printStackTrace(); + } + return -1; + } + + private static String getCurrentDate() { + String date = ""; + Calendar cal = Calendar.getInstance(); + int day = cal.get(Calendar.DATE) - 1; // instant duey ? + int month = cal.get(Calendar.MONTH) + 1; // its an array of months. + int year = cal.get(Calendar.YEAR); + date += day < 9 ? "0" + day + "-" : "" + day + "-"; + date += month < 9 ? "0" + month + "-" : "" + month + "-"; + date += year; + + return date; + } + + private static void removeItemFromDB(int packageid) { + Connection con = null; + try { + con = DatabaseConnection.getConnection(); + + PreparedStatement ps = con.prepareStatement("DELETE FROM dueypackages WHERE PackageId = ?"); + ps.setInt(1, packageid); + ps.executeUpdate(); + ps.close(); + ps = con.prepareStatement("DELETE FROM dueyitems WHERE PackageId = ?"); + ps.setInt(1, packageid); + ps.executeUpdate(); + ps.close(); + con.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + private static DueyPackages getItemByPID(ResultSet rs) { + try { + DueyPackages dueypack; + if (rs.getInt("type") == 1) { + Equip eq = new Equip(rs.getInt("itemid"), (byte) 0, -1); + eq.setUpgradeSlots((byte) rs.getInt("upgradeslots")); + eq.setLevel((byte) rs.getInt("level")); + eq.setStr((short) rs.getInt("str")); + eq.setDex((short) rs.getInt("dex")); + eq.setInt((short) rs.getInt("int")); + eq.setLuk((short) rs.getInt("luk")); + eq.setHp((short) rs.getInt("hp")); + eq.setMp((short) rs.getInt("mp")); + eq.setWatk((short) rs.getInt("watk")); + eq.setMatk((short) rs.getInt("matk")); + eq.setWdef((short) rs.getInt("wdef")); + eq.setMdef((short) rs.getInt("mdef")); + eq.setAcc((short) rs.getInt("acc")); + eq.setAvoid((short) rs.getInt("avoid")); + eq.setHands((short) rs.getInt("hands")); + eq.setSpeed((short) rs.getInt("speed")); + eq.setJump((short) rs.getInt("jump")); + eq.setOwner(rs.getString("owner")); + dueypack = new DueyPackages(rs.getInt("PackageId"), eq); + } else if (rs.getInt("type") == 2) { + Item newItem = new Item(rs.getInt("itemid"), (short) 0, (short) rs.getInt("quantity")); + newItem.setOwner(rs.getString("owner")); + dueypack = new DueyPackages(rs.getInt("PackageId"), newItem); + } else { + dueypack = new DueyPackages(rs.getInt("PackageId")); + } + return dueypack; + } catch (SQLException se) { + se.printStackTrace(); + return null; + } + } + + private static void showDueyNotification(MapleClient c, MapleCharacter player) { + Connection con = null; + PreparedStatement ps = null; + PreparedStatement pss = null; + ResultSet rs = null; + try { + con = DatabaseConnection.getConnection(); + ps = con.prepareStatement("SELECT Mesos FROM dueypackages WHERE RecieverId = ? and Checked = 1"); + ps.setInt(1, player.getId()); + rs = ps.executeQuery(); + if (rs.next()) { + try { + Connection con2 = DatabaseConnection.getConnection(); + pss = con2.prepareStatement("UPDATE dueypackages SET Checked = 0 where RecieverId = ?"); + pss.setInt(1, player.getId()); + pss.executeUpdate(); + pss.close(); + con2.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + + c.announce(MaplePacketCreator.sendDueyNotification(false)); + } + } catch (SQLException e) { + e.printStackTrace(); + } finally { + try { + if (rs != null) { + rs.close(); + } + if (pss != null) { + pss.close(); + } + if (ps != null) { + ps.close(); + } + if (con != null) { + con.close(); + } + } catch (SQLException ex) { + ex.printStackTrace(); + } + } + } + + private static int getFee(int meso) { + int fee = 0; + if (meso >= 10000000) { + fee = meso / 25; + } else if (meso >= 5000000) { + fee = meso * 3 / 100; + } else if (meso >= 1000000) { + fee = meso / 50; + } else if (meso >= 100000) { + fee = meso / 100; + } else if (meso >= 50000) { + fee = meso / 200; + } + return fee; + } + + private static void addMesoToDB(int mesos, String sName, int recipientID) { + addItemToDB(null, 1, mesos, sName, recipientID); + } + + private static void addItemToDB(Item item, int quantity, int mesos, String sName, int recipientID) { + Connection con = null; + try { + con = DatabaseConnection.getConnection(); + try (PreparedStatement ps = con.prepareStatement("INSERT INTO dueypackages (RecieverId, SenderName, Mesos, TimeStamp, Checked, Type) VALUES (?, ?, ?, ?, ?, ?)")) { + ps.setInt(1, recipientID); + ps.setString(2, sName); + ps.setInt(3, mesos); + ps.setString(4, getCurrentDate()); + ps.setInt(5, 1); + if (item == null) { + ps.setInt(6, 3); + ps.executeUpdate(); + } else { + ps.setInt(6, item.getItemType()); + + ps.executeUpdate(); + try (ResultSet rs = ps.getGeneratedKeys()) { + rs.next(); + PreparedStatement ps2; + if (item.getInventoryType().equals(MapleInventoryType.EQUIP)) { + ps2 = con.prepareStatement("INSERT INTO dueyitems (PackageId, itemid, quantity, upgradeslots, level, str, dex, `int`, luk, hp, mp, watk, matk, wdef, mdef, acc, avoid, hands, speed, jump, owner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + Equip eq = (Equip) item; + ps2.setInt(2, eq.getItemId()); + ps2.setInt(3, 1); + ps2.setInt(4, eq.getUpgradeSlots()); + ps2.setInt(5, eq.getLevel()); + ps2.setInt(6, eq.getStr()); + ps2.setInt(7, eq.getDex()); + ps2.setInt(8, eq.getInt()); + ps2.setInt(9, eq.getLuk()); + ps2.setInt(10, eq.getHp()); + ps2.setInt(11, eq.getMp()); + ps2.setInt(12, eq.getWatk()); + ps2.setInt(13, eq.getMatk()); + ps2.setInt(14, eq.getWdef()); + ps2.setInt(15, eq.getMdef()); + ps2.setInt(16, eq.getAcc()); + ps2.setInt(17, eq.getAvoid()); + ps2.setInt(18, eq.getHands()); + ps2.setInt(19, eq.getSpeed()); + ps2.setInt(20, eq.getJump()); + ps2.setString(21, eq.getOwner()); + } else { + ps2 = con.prepareStatement("INSERT INTO dueyitems (PackageId, itemid, quantity, owner) VALUES (?, ?, ?, ?)"); + ps2.setInt(2, item.getItemId()); + ps2.setInt(3, quantity); + ps2.setString(4, item.getOwner()); + } + ps2.setInt(1, rs.getInt(1)); + ps2.executeUpdate(); + ps2.close(); + } + } + } + + con.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + private static List loadItems(MapleCharacter chr) { + List packages = new LinkedList<>(); + Connection con = null; + try { + con = DatabaseConnection.getConnection(); + try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp LEFT JOIN dueyitems di ON dp.PackageId=di.PackageId WHERE RecieverId = ?")) { + ps.setInt(1, chr.getId()); + try (ResultSet rs = ps.executeQuery()) { + while (rs.next()) { + DueyPackages dueypack = getItemByPID(rs); + dueypack.setSender(rs.getString("SenderName")); + dueypack.setMesos(rs.getInt("Mesos")); + dueypack.setSentTime(rs.getString("TimeStamp")); + packages.add(dueypack); + } + } + } + + con.close(); + return packages; + } catch (SQLException e) { + e.printStackTrace(); + return null; + } + } + + public static void dueySendItem(MapleClient c, byte inventId, short itemPos, short amount, int mesos, String recipient) { + c.lockClient(); + try { + final int fee = 5000; + if (mesos < 0 || ((long) mesos + fee + getFee(mesos)) > Integer.MAX_VALUE || (amount < 1 && mesos == 0)) { + AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with duey."); + FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount + "\r\n"); + c.disconnect(true, false); + return; + } + int finalcost = mesos + fee + getFee(mesos); + boolean send = false; + if (c.getPlayer().getMeso() >= finalcost) { + int accid = getAccIdFromCNAME(recipient, true); + if (accid != -1) { + if (accid != c.getAccID()) { + send = true; + } else { + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode())); + } + } else { + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode())); + } + } else { + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode())); + } + + MapleClient rClient = null; + + int channel = c.getWorldServer().find(recipient); + if (channel > -1) { + Channel rcserv = c.getWorldServer().getChannel(channel); + rClient = rcserv.getPlayerStorage().getCharacterByName(recipient).getClient(); + } + + if (send) { + if (inventId > 0) { + MapleInventoryType inv = MapleInventoryType.getByType(inventId); + Item item = c.getPlayer().getInventory(inv).getItem(itemPos); + if (item != null && c.getPlayer().getItemQuantity(item.getItemId(), false) >= amount) { + c.getPlayer().gainMeso(-finalcost, false); + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SUCCESSFULLY_SENT.getCode())); + + if (ItemConstants.isRechargeable(item.getItemId())) { + MapleInventoryManipulator.removeFromSlot(c, inv, itemPos, item.getQuantity(), true); + } else { + MapleInventoryManipulator.removeFromSlot(c, inv, itemPos, amount, true, false); + } + + addItemToDB(item, amount, mesos, c.getPlayer().getName(), getAccIdFromCNAME(recipient, false)); + } else { + if (item != null) { + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_INCORRECT_REQUEST.getCode())); + } + return; + } + } else { + c.getPlayer().gainMeso(-finalcost, false); + c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SUCCESSFULLY_SENT.getCode())); + + addMesoToDB(mesos, c.getPlayer().getName(), getAccIdFromCNAME(recipient, false)); + } + + if (rClient != null && rClient.isLoggedIn() && !rClient.getPlayer().isAwayFromWorld()) { + showDueyNotification(rClient, rClient.getPlayer()); + } + } + } finally { + c.unlockClient(); + } + } + + public static void dueyRemovePackage(MapleClient c, int packageid) { + c.lockClient(); + try { + removeItemFromDB(packageid); + c.announce(MaplePacketCreator.removeItemFromDuey(true, packageid)); + } finally { + c.unlockClient(); + } + } + + public static void dueyClaimPackage(MapleClient c, int packageid) { + c.lockClient(); + try { + List packages = new LinkedList<>(); + DueyPackages dp = null; + Connection con = null; + try { + con = DatabaseConnection.getConnection(); + DueyPackages dueypack; + try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages LEFT JOIN dueyitems USING (PackageId) WHERE PackageId = ?")) { + ps.setInt(1, packageid); + try (ResultSet rs = ps.executeQuery()) { + dueypack = null; + if (rs.next()) { + dueypack = getItemByPID(rs); + dueypack.setSender(rs.getString("SenderName")); + dueypack.setMesos(rs.getInt("Mesos")); + dueypack.setSentTime(rs.getString("TimeStamp")); + + packages.add(dueypack); + } + } + } + dp = dueypack; + if(dp == null) { + c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_UNKNOWN_ERROR.getCode())); + FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid + "\r\n"); + return; + } + + if (dp.getItem() != null) { + if (!MapleInventoryManipulator.checkSpace(c, dp.getItem().getItemId(), dp.getItem().getQuantity(), dp.getItem().getOwner())) { + int itemid = dp.getItem().getItemId(); + if(MapleItemInformationProvider.getInstance().isPickupRestricted(itemid) && c.getPlayer().getInventory(ItemConstants.getInventoryType(itemid)).findById(itemid) != null) { + c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_RECEIVER_WITH_UNIQUE.getCode())); + } else { + c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_NO_FREE_SLOTS.getCode())); + } + + return; + } else { + MapleInventoryManipulator.addFromDrop(c, dp.getItem(), false); + } + } + + long gainmesos = 0; + long totalmesos = (long) dp.getMesos() + (long) c.getPlayer().getMeso(); + + if (totalmesos < 0 || dp.getMesos() < 0) gainmesos = 0; + else { + totalmesos = Math.min(totalmesos, Integer.MAX_VALUE); + gainmesos = totalmesos - c.getPlayer().getMeso(); + } + c.getPlayer().gainMeso((int)gainmesos, false); + + removeItemFromDB(packageid); + c.announce(MaplePacketCreator.removeItemFromDuey(false, packageid)); + + con.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } finally { + c.unlockClient(); + } + } + + public static void dueySendTalk(MapleClient c) { + c.lockClient(); + try { + c.announce(MaplePacketCreator.sendDuey((byte) 8, loadItems(c.getPlayer()))); + } finally { + c.unlockClient(); + } + } +} diff --git a/src/client/processor/FredrickProcessor.java b/src/client/processor/FredrickProcessor.java new file mode 100644 index 0000000000..a30de71483 --- /dev/null +++ b/src/client/processor/FredrickProcessor.java @@ -0,0 +1,111 @@ +/* + This file is part of the OdinMS Maple Story Server + Copyright (C) 2008 Patrick Huy + Matthias Butz + Jan Christian Meyer + + Copyleft (L) 2016 - 2018 RonanLana (HeavenMS) + + 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 . +*/ +package client.processor; + +import client.MapleCharacter; +import client.MapleClient; +import client.inventory.Item; +import client.inventory.ItemFactory; +import client.inventory.MapleInventory; +import client.inventory.MapleInventoryType; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.List; +import server.MapleInventoryManipulator; +import server.MapleItemInformationProvider; +import server.maps.MapleHiredMerchant; +import tools.DatabaseConnection; +import tools.FilePrinter; +import tools.MaplePacketCreator; +import tools.Pair; + +/** + * + * @author RonanLana (synchronization of Fredrick modules) + */ +public class FredrickProcessor { + private static boolean canRetrieveFromFredrick(MapleCharacter chr, List> items) { + if (chr.getMeso() + chr.getMerchantMeso() < 0) { + return false; + } + return MapleInventory.checkSpotsAndOwnership(chr, items); + } + + private static boolean deleteFredrickItems(int cid) { + try { + Connection con = DatabaseConnection.getConnection(); + try (PreparedStatement ps = con.prepareStatement("DELETE FROM `inventoryitems` WHERE `type` = ? AND `characterid` = ?")) { + ps.setInt(1, ItemFactory.MERCHANT.getValue()); + ps.setInt(2, cid); + ps.execute(); + } + con.close(); + return true; + } catch (SQLException e) { + e.printStackTrace(); + return false; + } + } + + public static void fredrickRetrieveItems(MapleClient c) { // thanks Gustav for pointing out the dupe on Fredrick handling + c.lockClient(); + try { + MapleCharacter chr = c.getPlayer(); + + List> items; + try { + items = ItemFactory.MERCHANT.loadItems(chr.getId(), false); + if (!canRetrieveFromFredrick(chr, items)) { + chr.announce(MaplePacketCreator.fredrickMessage((byte) 0x21)); + return; + } + + chr.withdrawMerchantMesos(); + + if (deleteFredrickItems(chr.getId())) { + MapleHiredMerchant merchant = chr.getHiredMerchant(); + + if(merchant != null) + merchant.clearItems(); + + for (Pair it : items) { + Item item = it.getLeft(); + MapleInventoryManipulator.addFromDrop(chr.getClient(), item, false); + String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId()); + FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n"); + } + + chr.announce(MaplePacketCreator.fredrickMessage((byte) 0x1E)); + } else { + chr.message("An unknown error has occured."); + } + } catch (SQLException ex) { + ex.printStackTrace(); + } + } finally { + c.unlockClient(); + } + } +} diff --git a/src/constants/EquipType.java b/src/constants/EquipType.java index e79e642ed1..0ba3600744 100644 --- a/src/constants/EquipType.java +++ b/src/constants/EquipType.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/constants/GameConstants.java b/src/constants/GameConstants.java index 8eeb0c4708..ccd2ddd814 100644 --- a/src/constants/GameConstants.java +++ b/src/constants/GameConstants.java @@ -35,7 +35,7 @@ public class GameConstants { private static final int[] DEFAULT_TYPE = {4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 5, 6, 6, 6, 6, 6, 6, 5, 4, 5, 4, 4, 4, 4, 4}; private static final int[] DEFAULT_ACTION = {0, 106, 10, 1, 12, 13, 18, 24, 8, 5, 4, 19, 14, 15, 2, 17, 11, 3, 20, 16, 9, 50, 51, 6, 7, 53, 100, 101, 102, 103, 104, 105, 54, 22, 52, 21, 25, 26, 23, 27}; - // MapleSolaxiaV2 custom keyset + // HeavenMS custom keyset private static final int[] CUSTOM_KEY = {2, 3, 4, 5, 31, 56, 59, 32, 42, 6, 17, 29, 30, 41, 50, 60, 61, 62, 63, 64, 65, 16, 7, 9, 13, 8}; private static final int[] CUSTOM_TYPE = {4, 4, 4, 4, 5, 5, 6, 5, 5, 4, 4, 4, 5, 4, 4, 6, 6, 6, 6, 6, 6, 4, 4, 4, 4, 4}; private static final int[] CUSTOM_ACTION = {1, 0, 3, 2, 53, 54, 100, 52, 51, 19, 5, 9, 50, 7, 22, 101, 102, 103, 104, 105, 106, 8, 17, 26, 20, 4}; diff --git a/src/constants/ItemConstants.java b/src/constants/ItemConstants.java index 738d4c0e2f..17f74f3c47 100644 --- a/src/constants/ItemConstants.java +++ b/src/constants/ItemConstants.java @@ -73,7 +73,7 @@ public final class ItemConstants { return isPotion(itemId) || isFood(itemId); } - public static boolean isRechargable(int itemId) { + public static boolean isRechargeable(int itemId) { return isThrowingStar(itemId) || isBullet(itemId); } @@ -110,7 +110,7 @@ public final class ItemConstants { } public static boolean isTownScroll(int itemId) { - return itemId >= 2030000 && itemId < 2030021; + return itemId >= 2030000 && itemId < 2030100; } public static boolean isAntibanishScroll(int itemId) { @@ -184,4 +184,8 @@ public final class ItemConstants { public static boolean isEquipment(int itemId) { return itemId < 2000000 && itemId != 0; } + + public static boolean isMedal(int itemId) { + return itemId >= 1140000 && itemId < 1143000; + } } diff --git a/src/constants/ServerConstants.java b/src/constants/ServerConstants.java index 970ade8f67..088fda3b24 100644 --- a/src/constants/ServerConstants.java +++ b/src/constants/ServerConstants.java @@ -15,7 +15,6 @@ public class ServerConstants { //World And Version public static short VERSION = 83; - public static String TIMEZONE = "-GMT3"; public static String[] WORLD_NAMES = {"Scania", "Bera", "Broa", "Windia", "Khaini", "Bellocan", "Mardia", "Kradia", "Yellonde", "Demethos", "Galicia", "El Nido", "Zenith", "Arcenia", "Kastia", "Judis", "Plana", "Kalluna", "Stius", "Croa", "Medere"}; //Login Configuration @@ -72,6 +71,7 @@ public class ServerConstants { public static final boolean USE_MAKER_FEE_HEURISTICS = true; //Apply compiled values for stimulants and reagents into the Maker fee calculations (max error revolves around 50k mesos). Set false to use basic constant values instead (results are never higher than requested by the client-side). public static final boolean USE_QUEST_RATE = false; //Exp/Meso gained by quests uses fixed server exp/meso rate times quest rate as multiplier, instead of player rates. public static final boolean USE_MULTIPLE_SAME_EQUIP_DROP = true;//Enables multiple drops by mobs of the same equipment, number of possible drops based on the quantities provided at the drop data. + public static final boolean USE_BANISHABLE_TOWN_SCROLL = true; //Enables town scrolls to act as if it's a "player banish", rendering the antibanish scroll effect available. //Announcement Configuration public static final boolean USE_ANNOUNCE_SHOPITEMSOLD = false; //Automatic message sent to owner when an item from the Player Shop or Hired Merchant is sold. @@ -99,6 +99,8 @@ public class ServerConstants { public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system. public static final long BLOCK_NPC_RACE_CONDT = (long)(0.5 * 1000); //Time the player client must wait before reopening a conversation with an NPC. public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //Time the pet must wait before trying to pick items up. + public static boolean USE_UNITPRICE_WITH_COMMA = true; //Set this accordingly with the layout of the unitPrices on Item.wz XML's, whether it's using commas or dots to represent fractions. + public static String TIMEZONE = "-GMT3"; //Dangling Items/Locks Configuration public static final int ITEM_EXPIRE_TIME = 3 * 60 * 1000; //Time before items start disappearing. Recommended to be set up to 3 minutes. @@ -106,6 +108,7 @@ public class ServerConstants { public static final int LOCK_MONITOR_TIME = 30 * 1000; //Waiting time for a lock to be released. If it reach timed out, a critical server deadlock has made present. public static final int ITEM_EXPIRE_CHECK = 10 * 1000; //Interval between item expiring tasks on maps, which checks and makes disappear expired items. public static final int ITEM_LIMIT_ON_MAP = 200; //Max number of items allowed on a map. + public static final int MAP_VISITED_SIZE = 5; //Max length for last mapids visited by a player. This is used to recover and update drops on these maps accordingly with player actions. //Some Gameplay Enhancing Configurations //Scroll Configuration diff --git a/src/net/MapleServerHandler.java b/src/net/MapleServerHandler.java index 94d4b6d1f3..a8d4c17340 100644 --- a/src/net/MapleServerHandler.java +++ b/src/net/MapleServerHandler.java @@ -56,7 +56,7 @@ import server.TimerManager; import tools.locks.MonitoredLockType; public class MapleServerHandler extends IoHandlerAdapter { - private final static Set ignoredDebugRecvPackets = new HashSet<>(Arrays.asList((short) 167, (short) 197, (short) 89, (short) 91, (short) 41)); + private final static Set ignoredDebugRecvPackets = new HashSet<>(Arrays.asList((short) 167, (short) 197, (short) 89, (short) 91, (short) 41, (short) 188, (short) 107)); private PacketProcessor processor; private int world = -1, channel = -1; diff --git a/src/net/PacketProcessor.java b/src/net/PacketProcessor.java index 793729d974..0e5b367c26 100644 --- a/src/net/PacketProcessor.java +++ b/src/net/PacketProcessor.java @@ -165,7 +165,7 @@ public final class PacketProcessor { registerHandler(RecvOpcode.GIVE_FAME, new GiveFameHandler()); registerHandler(RecvOpcode.PARTY_OPERATION, new PartyOperationHandler()); registerHandler(RecvOpcode.DENY_PARTY_REQUEST, new DenyPartyRequestHandler()); - registerHandler(RecvOpcode.PARTYCHAT, new PartyChatHandler()); + registerHandler(RecvOpcode.MULTI_CHAT, new MultiChatHandler()); registerHandler(RecvOpcode.USE_DOOR, new DoorHandler()); registerHandler(RecvOpcode.ENTER_MTS, new EnterMTSHandler()); registerHandler(RecvOpcode.ENTER_CASHSHOP, new EnterCashShopHandler()); diff --git a/src/net/RecvOpcode.java b/src/net/RecvOpcode.java index 0d4fab95e2..fe28e7213f 100644 --- a/src/net/RecvOpcode.java +++ b/src/net/RecvOpcode.java @@ -120,7 +120,7 @@ public enum RecvOpcode { USE_REMOTE(0x74), WATER_OF_LIFE(0x75), ADMIN_CHAT(0x76), - PARTYCHAT(0x77), + MULTI_CHAT(0x77), WHISPER(0x78), MESSENGER(0x7A), PLAYER_INTERACTION(0x7B), diff --git a/src/net/server/audit/ThreadTracker.java b/src/net/server/audit/ThreadTracker.java index 8b99d6f342..50e0d49f1a 100644 --- a/src/net/server/audit/ThreadTracker.java +++ b/src/net/server/audit/ThreadTracker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/channel/handlers/AbstractDealDamageHandler.java b/src/net/server/channel/handlers/AbstractDealDamageHandler.java index ac8f2f8d42..f2f552da61 100644 --- a/src/net/server/channel/handlers/AbstractDealDamageHandler.java +++ b/src/net/server/channel/handlers/AbstractDealDamageHandler.java @@ -113,7 +113,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl public int numAttacked, numDamage, numAttackedAndDamage, skill, skilllevel, stance, direction, rangedirection, charge, display; public Map> allDamage; - public boolean isHH = false, isTempest = false, ranged, magic; + public boolean ranged, magic; public int speed = 4; public Point position = new Point(); public MapleStatEffect getAttackEffect(MapleCharacter chr, Skill theSkill) { @@ -205,17 +205,29 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl if (mapitem.getMeso() == 0) { //Maybe it is possible some how? return; } - synchronized (mapitem) { + + mapitem.lockItem(); + try { if (mapitem.isPickedUp()) { return; } TimerManager.getInstance().schedule(new Runnable() { @Override public void run() { - map.pickItemDrop(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 4, 0), mapitem); + mapitem.lockItem(); + try { + if (mapitem.isPickedUp()) { + return; + } + map.pickItemDrop(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 4, 0), mapitem); + } finally { + mapitem.unlockItem(); + } } }, delay); delay += 100; + } finally { + mapitem.unlockItem(); } } else if (mapobject != null && mapobject.getType() != MapleMapObjectType.MONSTER) { return; @@ -464,34 +476,45 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl if (attackEffect.makeChanceResult()) { monster.applyStatus(player, new MonsterStatusEffect(attackEffect.getMonsterStati(), theSkill, null, false), attackEffect.isPoison(), attackEffect.getDuration()); } - } - if (attack.isHH && !monster.isBoss()) { - map.damageMonster(player, monster, monster.getHp() - 1); - } else if (attack.isHH) { - int HHDmg = (player.calculateMaxBaseDamage(player.getTotalWatk()) * (SkillFactory.getSkill(Paladin.HEAVENS_HAMMER).getEffect(player.getSkillLevel(SkillFactory.getSkill(Paladin.HEAVENS_HAMMER))).getDamage() / 100)); - map.damageMonster(player, monster, (int) (Math.floor(Math.random() * (HHDmg / 5) + HHDmg * .8))); - } else if(attack.isTempest && !monster.isBoss()) { - map.damageMonster(player, monster, monster.getHp()); - } else if(attack.isTempest) { - int TmpDmg = (player.calculateMaxBaseDamage(player.getTotalWatk()) * (SkillFactory.getSkill(Aran.COMBO_TEMPEST).getEffect(player.getSkillLevel(SkillFactory.getSkill(Aran.COMBO_TEMPEST))).getDamage() / 100)); - map.damageMonster(player, monster, (int) (Math.floor(Math.random() * (TmpDmg / 5) + TmpDmg * .8))); + } + if (attack.skill == Paladin.HEAVENS_HAMMER) { + if(!monster.isBoss()) { + map.damageMonster(player, monster, monster.getHp() - 1); + } else { + int HHDmg = (player.calculateMaxBaseDamage(player.getTotalWatk()) * (SkillFactory.getSkill(Paladin.HEAVENS_HAMMER).getEffect(player.getSkillLevel(SkillFactory.getSkill(Paladin.HEAVENS_HAMMER))).getDamage() / 100)); + map.damageMonster(player, monster, (int) (Math.floor(Math.random() * (HHDmg / 5) + HHDmg * .8))); + } + } else if (attack.skill == Aran.COMBO_TEMPEST) { + if(!monster.isBoss()) { + map.damageMonster(player, monster, monster.getHp()); + } else { + int TmpDmg = (player.calculateMaxBaseDamage(player.getTotalWatk()) * (SkillFactory.getSkill(Aran.COMBO_TEMPEST).getEffect(player.getSkillLevel(SkillFactory.getSkill(Aran.COMBO_TEMPEST))).getDamage() / 100)); + map.damageMonster(player, monster, (int) (Math.floor(Math.random() * (TmpDmg / 5) + TmpDmg * .8))); + } } else { + if(attack.skill == Aran.BODY_PRESSURE) { + map.broadcastMessage(MaplePacketCreator.damageMonster(monster.getObjectId(), totDamageToOneMonster)); + } + map.damageMonster(player, monster, totDamageToOneMonster); - - } + } if (monster.isBuffed(MonsterStatus.WEAPON_REFLECT)) { - for (int i = 0; i < monster.getSkills().size(); i++) { - if (monster.getSkills().get(i).left == 145) { - MobSkill toUse = MobSkillFactory.getMobSkill(monster.getSkills().get(i).left, monster.getSkills().get(i).right); + List> mobSkills = monster.getSkills(); + + for (Pair ms : mobSkills) { + if (ms.left == 145) { + MobSkill toUse = MobSkillFactory.getMobSkill(ms.left, ms.right); player.addHP(-toUse.getX()); map.broadcastMessage(player, MaplePacketCreator.damagePlayer(0, monster.getId(), player.getId(), toUse.getX(), 0, 0, false, 0, true, monster.getObjectId(), 0, 0), true); } } } if (monster.isBuffed(MonsterStatus.MAGIC_REFLECT)) { - for (int i = 0; i < monster.getSkills().size(); i++) { - if (monster.getSkills().get(i).left == 145) { - MobSkill toUse = MobSkillFactory.getMobSkill(monster.getSkills().get(i).left, monster.getSkills().get(i).right); + List> mobSkills = monster.getSkills(); + + for (Pair ms : mobSkills) { + if (ms.left == 145) { + MobSkill toUse = MobSkillFactory.getMobSkill(ms.left, ms.right); player.addMP(-toUse.getY()); } } @@ -525,11 +548,6 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl } else { ret.charge = 0; } - if (ret.skill == Paladin.HEAVENS_HAMMER) { - ret.isHH = true; - } else if(ret.skill == Aran.COMBO_TEMPEST) { - ret.isTempest = true; - } lea.skip(8); ret.display = lea.readByte(); ret.direction = lea.readByte(); diff --git a/src/net/server/channel/handlers/DueyHandler.java b/src/net/server/channel/handlers/DueyHandler.java index 620cfdd946..72a61948c2 100644 --- a/src/net/server/channel/handlers/DueyHandler.java +++ b/src/net/server/channel/handlers/DueyHandler.java @@ -21,92 +21,16 @@ */ package net.server.channel.handlers; -import client.MapleCharacter; import client.MapleClient; -import client.autoban.AutobanFactory; -import client.inventory.Equip; -import client.inventory.Item; -import client.inventory.MapleInventoryType; -import constants.ItemConstants; +import client.processor.DueyProcessor; import constants.ServerConstants; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Calendar; -import java.util.LinkedList; -import java.util.List; - import net.AbstractMaplePacketHandler; -import net.server.channel.Channel; -import server.DueyPackages; -import server.MapleInventoryManipulator; -import server.MapleItemInformationProvider; -import tools.DatabaseConnection; -import tools.FilePrinter; import tools.MaplePacketCreator; import tools.data.input.SeekableLittleEndianAccessor; public final class DueyHandler extends AbstractMaplePacketHandler { - private enum Actions { - TOSERVER_SEND_ITEM(0x02), - TOSERVER_CLAIM_PACKAGE(0x04), - TOSERVER_REMOVE_PACKAGE(0x05), - TOSERVER_CLOSE_DUEY(0x07), - TOCLIENT_OPEN_DUEY(0x08), - TOCLIENT_SEND_ENABLE_ACTIONS(0x09), - TOCLIENT_SEND_NOT_ENOUGH_MESOS(0x0A), - TOCLIENT_SEND_INCORRECT_REQUEST(0x0B), - TOCLIENT_SEND_NAME_DOES_NOT_EXIST(0x0C), - TOCLIENT_SEND_SAMEACC_ERROR(0x0D), - TOCLIENT_SEND_RECEIVER_STORAGE_FULL(0x0E), - TOCLIENT_SEND_RECEIVER_UNABLE_TO_RECV(0x0F), - TOCLIENT_SEND_RECEIVER_STORAGE_WITH_UNIQUE(0x10), - TOCLIENT_SEND_MESO_LIMIT(0x11), - TOCLIENT_SEND_SUCCESSFULLY_SENT(0x12), - TOCLIENT_RECV_UNKNOWN_ERROR(0x13), - TOCLIENT_RECV_ENABLE_ACTIONS(0x14), - TOCLIENT_RECV_NO_FREE_SLOTS(0x15), - TOCLIENT_RECV_RECEIVER_WITH_UNIQUE(0x16), - TOCLIENT_RECV_SUCCESSFUL_MSG(0x17), - TOCLIENT_RECV_PACKAGE_MSG(0x1B); - final byte code; - - private Actions(int code) { - this.code = (byte) code; - } - - public byte getCode() { - return code; - } - } - - private static int getAccIdFromCNAME(String name, boolean accountid) { - try { - PreparedStatement ps; - String text = "SELECT id,accountid FROM characters WHERE name = ?"; - Connection con = DatabaseConnection.getConnection(); - ps = con.prepareStatement(text); - ps.setString(1, name); - int id_; - try (ResultSet rs = ps.executeQuery()) { - if (!rs.next()) { - rs.close(); - ps.close(); - return -1; - } - id_ = accountid ? rs.getInt("accountid") : rs.getInt("id"); - } - ps.close(); - con.close(); - return id_; - } catch (SQLException e) { - e.printStackTrace(); - } - return -1; - } - + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { if (!ServerConstants.USE_DUEY){ @@ -115,364 +39,22 @@ public final class DueyHandler extends AbstractMaplePacketHandler { } byte operation = slea.readByte(); - if (operation == Actions.TOSERVER_SEND_ITEM.getCode()) { - final int fee = 5000; + if (operation == DueyProcessor.Actions.TOSERVER_SEND_ITEM.getCode()) { byte inventId = slea.readByte(); short itemPos = slea.readShort(); short amount = slea.readShort(); int mesos = slea.readInt(); String recipient = slea.readMapleAsciiString(); - if (mesos < 0 || ((long) mesos + fee + getFee(mesos)) > Integer.MAX_VALUE || (amount < 1 && mesos == 0)) { - AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with duey."); - FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount + "\r\n"); - c.disconnect(true, false); - return; - } - int finalcost = mesos + fee + getFee(mesos); - boolean send = false; - if (c.getPlayer().getMeso() >= finalcost) { - int accid = getAccIdFromCNAME(recipient, true); - if (accid != -1) { - if (accid != c.getAccID()) { - send = true; - } else { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode())); - } - } else { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode())); - } - } else { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode())); - } - - MapleClient rClient = null; - int channel = c.getWorldServer().find(recipient); - if (channel > -1) { - Channel rcserv = c.getWorldServer().getChannel(channel); - rClient = rcserv.getPlayerStorage().getCharacterByName(recipient).getClient(); - } - if (send) { - if (inventId > 0) { - MapleInventoryType inv = MapleInventoryType.getByType(inventId); - Item item = c.getPlayer().getInventory(inv).getItem(itemPos); - if (item != null && c.getPlayer().getItemQuantity(item.getItemId(), false) >= amount) { - c.getPlayer().gainMeso(-finalcost, false); - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_SUCCESSFULLY_SENT.getCode())); - - if (ItemConstants.isRechargable(item.getItemId())) { - MapleInventoryManipulator.removeFromSlot(c, inv, itemPos, item.getQuantity(), true); - } else { - MapleInventoryManipulator.removeFromSlot(c, inv, itemPos, amount, true, false); - } - - addItemToDB(item, amount, mesos, c.getPlayer().getName(), getAccIdFromCNAME(recipient, false)); - } else { - if (item != null) { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_INCORRECT_REQUEST.getCode())); - } - return; - } - } else { - c.getPlayer().gainMeso(-finalcost, false); - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_SEND_SUCCESSFULLY_SENT.getCode())); - - addMesoToDB(mesos, c.getPlayer().getName(), getAccIdFromCNAME(recipient, false)); - } - - if (rClient != null && rClient.isLoggedIn() && !rClient.getPlayer().isAwayFromWorld()) { - showDueyNotification(rClient, rClient.getPlayer()); - } - } - } else if (operation == Actions.TOSERVER_REMOVE_PACKAGE.getCode()) { + DueyProcessor.dueySendItem(c, inventId, itemPos, amount, mesos, recipient); + } else if (operation == DueyProcessor.Actions.TOSERVER_REMOVE_PACKAGE.getCode()) { int packageid = slea.readInt(); - removeItemFromDB(packageid); - c.announce(MaplePacketCreator.removeItemFromDuey(true, packageid)); - } else if (operation == Actions.TOSERVER_CLAIM_PACKAGE.getCode()) { + + DueyProcessor.dueyRemovePackage(c, packageid); + } else if (operation == DueyProcessor.Actions.TOSERVER_CLAIM_PACKAGE.getCode()) { int packageid = slea.readInt(); - List packages = new LinkedList<>(); - DueyPackages dp = null; - Connection con = null; - try { - con = DatabaseConnection.getConnection(); - DueyPackages dueypack; - try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages LEFT JOIN dueyitems USING (PackageId) WHERE PackageId = ?")) { - ps.setInt(1, packageid); - try (ResultSet rs = ps.executeQuery()) { - dueypack = null; - if (rs.next()) { - dueypack = getItemByPID(rs); - dueypack.setSender(rs.getString("SenderName")); - dueypack.setMesos(rs.getInt("Mesos")); - dueypack.setSentTime(rs.getString("TimeStamp")); - - packages.add(dueypack); - } - } - } - dp = dueypack; - if(dp == null) { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_UNKNOWN_ERROR.getCode())); - FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid + "\r\n"); - return; - } - - if (dp.getItem() != null) { - if (!MapleInventoryManipulator.checkSpace(c, dp.getItem().getItemId(), dp.getItem().getQuantity(), dp.getItem().getOwner())) { - int itemid = dp.getItem().getItemId(); - if(MapleItemInformationProvider.getInstance().isPickupRestricted(itemid) && c.getPlayer().getInventory(ItemConstants.getInventoryType(itemid)).findById(itemid) != null) { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_RECEIVER_WITH_UNIQUE.getCode())); - } else { - c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_NO_FREE_SLOTS.getCode())); - } - - return; - } else { - MapleInventoryManipulator.addFromDrop(c, dp.getItem(), false); - } - } - - long gainmesos = 0; - long totalmesos = (long) dp.getMesos() + (long) c.getPlayer().getMeso(); - - if (totalmesos < 0 || dp.getMesos() < 0) gainmesos = 0; - else { - totalmesos = Math.min(totalmesos, Integer.MAX_VALUE); - gainmesos = totalmesos - c.getPlayer().getMeso(); - } - c.getPlayer().gainMeso((int)gainmesos, false); - - removeItemFromDB(packageid); - c.announce(MaplePacketCreator.removeItemFromDuey(false, packageid)); - - con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - } - - private static void addMesoToDB(int mesos, String sName, int recipientID) { - addItemToDB(null, 1, mesos, sName, recipientID); - } - - public static void addItemToDB(Item item, int quantity, int mesos, String sName, int recipientID) { - Connection con = null; - try { - con = DatabaseConnection.getConnection(); - try (PreparedStatement ps = con.prepareStatement("INSERT INTO dueypackages (RecieverId, SenderName, Mesos, TimeStamp, Checked, Type) VALUES (?, ?, ?, ?, ?, ?)")) { - ps.setInt(1, recipientID); - ps.setString(2, sName); - ps.setInt(3, mesos); - ps.setString(4, getCurrentDate()); - ps.setInt(5, 1); - if (item == null) { - ps.setInt(6, 3); - ps.executeUpdate(); - } else { - ps.setInt(6, item.getItemType()); - - ps.executeUpdate(); - try (ResultSet rs = ps.getGeneratedKeys()) { - rs.next(); - PreparedStatement ps2; - if (item.getInventoryType().equals(MapleInventoryType.EQUIP)) { - ps2 = con.prepareStatement("INSERT INTO dueyitems (PackageId, itemid, quantity, upgradeslots, level, str, dex, `int`, luk, hp, mp, watk, matk, wdef, mdef, acc, avoid, hands, speed, jump, owner) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - Equip eq = (Equip) item; - ps2.setInt(2, eq.getItemId()); - ps2.setInt(3, 1); - ps2.setInt(4, eq.getUpgradeSlots()); - ps2.setInt(5, eq.getLevel()); - ps2.setInt(6, eq.getStr()); - ps2.setInt(7, eq.getDex()); - ps2.setInt(8, eq.getInt()); - ps2.setInt(9, eq.getLuk()); - ps2.setInt(10, eq.getHp()); - ps2.setInt(11, eq.getMp()); - ps2.setInt(12, eq.getWatk()); - ps2.setInt(13, eq.getMatk()); - ps2.setInt(14, eq.getWdef()); - ps2.setInt(15, eq.getMdef()); - ps2.setInt(16, eq.getAcc()); - ps2.setInt(17, eq.getAvoid()); - ps2.setInt(18, eq.getHands()); - ps2.setInt(19, eq.getSpeed()); - ps2.setInt(20, eq.getJump()); - ps2.setString(21, eq.getOwner()); - } else { - ps2 = con.prepareStatement("INSERT INTO dueyitems (PackageId, itemid, quantity, owner) VALUES (?, ?, ?, ?)"); - ps2.setInt(2, item.getItemId()); - ps2.setInt(3, quantity); - ps2.setString(4, item.getOwner()); - } - ps2.setInt(1, rs.getInt(1)); - ps2.executeUpdate(); - ps2.close(); - } - } - } - con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - public static List loadItems(MapleCharacter chr) { - List packages = new LinkedList<>(); - Connection con = null; - try { - con = DatabaseConnection.getConnection(); - try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp LEFT JOIN dueyitems di ON dp.PackageId=di.PackageId WHERE RecieverId = ?")) { - ps.setInt(1, chr.getId()); - try (ResultSet rs = ps.executeQuery()) { - while (rs.next()) { - DueyPackages dueypack = getItemByPID(rs); - dueypack.setSender(rs.getString("SenderName")); - dueypack.setMesos(rs.getInt("Mesos")); - dueypack.setSentTime(rs.getString("TimeStamp")); - packages.add(dueypack); - } - } - } - - con.close(); - return packages; - } catch (SQLException e) { - e.printStackTrace(); - return null; - } - } - - private static String getCurrentDate() { - String date = ""; - Calendar cal = Calendar.getInstance(); - int day = cal.get(Calendar.DATE) - 1; // instant duey ? - int month = cal.get(Calendar.MONTH) + 1; // its an array of months. - int year = cal.get(Calendar.YEAR); - date += day < 9 ? "0" + day + "-" : "" + day + "-"; - date += month < 9 ? "0" + month + "-" : "" + month + "-"; - date += year; - - return date; - } - - private static int getFee(int meso) { - int fee = 0; - if (meso >= 10000000) { - fee = meso / 25; - } else if (meso >= 5000000) { - fee = meso * 3 / 100; - } else if (meso >= 1000000) { - fee = meso / 50; - } else if (meso >= 100000) { - fee = meso / 100; - } else if (meso >= 50000) { - fee = meso / 200; - } - return fee; - } - - private static void removeItemFromDB(int packageid) { - Connection con = null; - try { - con = DatabaseConnection.getConnection(); - - PreparedStatement ps = con.prepareStatement("DELETE FROM dueypackages WHERE PackageId = ?"); - ps.setInt(1, packageid); - ps.executeUpdate(); - ps.close(); - ps = con.prepareStatement("DELETE FROM dueyitems WHERE PackageId = ?"); - ps.setInt(1, packageid); - ps.executeUpdate(); - ps.close(); - con.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - } - - private static DueyPackages getItemByPID(ResultSet rs) { - try { - DueyPackages dueypack; - if (rs.getInt("type") == 1) { - Equip eq = new Equip(rs.getInt("itemid"), (byte) 0, -1); - eq.setUpgradeSlots((byte) rs.getInt("upgradeslots")); - eq.setLevel((byte) rs.getInt("level")); - eq.setStr((short) rs.getInt("str")); - eq.setDex((short) rs.getInt("dex")); - eq.setInt((short) rs.getInt("int")); - eq.setLuk((short) rs.getInt("luk")); - eq.setHp((short) rs.getInt("hp")); - eq.setMp((short) rs.getInt("mp")); - eq.setWatk((short) rs.getInt("watk")); - eq.setMatk((short) rs.getInt("matk")); - eq.setWdef((short) rs.getInt("wdef")); - eq.setMdef((short) rs.getInt("mdef")); - eq.setAcc((short) rs.getInt("acc")); - eq.setAvoid((short) rs.getInt("avoid")); - eq.setHands((short) rs.getInt("hands")); - eq.setSpeed((short) rs.getInt("speed")); - eq.setJump((short) rs.getInt("jump")); - eq.setOwner(rs.getString("owner")); - dueypack = new DueyPackages(rs.getInt("PackageId"), eq); - } else if (rs.getInt("type") == 2) { - Item newItem = new Item(rs.getInt("itemid"), (short) 0, (short) rs.getInt("quantity")); - newItem.setOwner(rs.getString("owner")); - dueypack = new DueyPackages(rs.getInt("PackageId"), newItem); - } else { - dueypack = new DueyPackages(rs.getInt("PackageId")); - } - return dueypack; - } catch (SQLException se) { - se.printStackTrace(); - return null; - } - } - - private static void showDueyNotification(MapleClient c, MapleCharacter player) { - Connection con = null; - PreparedStatement ps = null; - PreparedStatement pss = null; - ResultSet rs = null; - try { - con = DatabaseConnection.getConnection(); - ps = con.prepareStatement("SELECT Mesos FROM dueypackages WHERE RecieverId = ? and Checked = 1"); - ps.setInt(1, player.getId()); - rs = ps.executeQuery(); - if (rs.next()) { - try { - Connection con2 = DatabaseConnection.getConnection(); - pss = con2.prepareStatement("UPDATE dueypackages SET Checked = 0 where RecieverId = ?"); - pss.setInt(1, player.getId()); - pss.executeUpdate(); - pss.close(); - con2.close(); - } catch (SQLException e) { - e.printStackTrace(); - } - - c.announce(MaplePacketCreator.sendDueyNotification(false)); - } - } catch (SQLException e) { - e.printStackTrace(); - } finally { - try { - if (rs != null) { - rs.close(); - } - if (pss != null) { - pss.close(); - } - if (ps != null) { - ps.close(); - } - if (con != null) { - con.close(); - } - } catch (SQLException ex) { - ex.printStackTrace(); - } + DueyProcessor.dueyClaimPackage(c, packageid); } } } diff --git a/src/net/server/channel/handlers/FredrickHandler.java b/src/net/server/channel/handlers/FredrickHandler.java index cbc983c36b..ef516098a0 100644 --- a/src/net/server/channel/handlers/FredrickHandler.java +++ b/src/net/server/channel/handlers/FredrickHandler.java @@ -23,23 +23,9 @@ package net.server.channel.handlers; import client.MapleCharacter; import client.MapleClient; -import client.inventory.Item; -import client.inventory.ItemFactory; -import client.inventory.MapleInventory; -import client.inventory.MapleInventoryType; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.List; +import client.processor.FredrickProcessor; import net.AbstractMaplePacketHandler; -import server.MapleInventoryManipulator; -import server.MapleItemInformationProvider; -import tools.DatabaseConnection; -import tools.FilePrinter; -import tools.MaplePacketCreator; -import tools.Pair; import tools.data.input.SeekableLittleEndianAccessor; /** @@ -58,62 +44,11 @@ public class FredrickHandler extends AbstractMaplePacketHandler { //c.announce(MaplePacketCreator.getFredrick((byte) 0x24)); break; case 0x1A: - List> items; - try { - items = ItemFactory.MERCHANT.loadItems(chr.getId(), false); - if (!check(chr, items)) { - c.announce(MaplePacketCreator.fredrickMessage((byte) 0x21)); - return; - } - chr.gainMeso(chr.getMerchantMeso(), false); - chr.setMerchantMeso(0); - if (deleteItems(chr)) { - if(chr.getHiredMerchant() != null) - chr.getHiredMerchant().clearItems(); - - for (int i = 0; i < items.size(); i++) { - Item item = items.get(i).getLeft(); - MapleInventoryManipulator.addFromDrop(c, item, false); - String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId()); - FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n"); - } - c.announce(MaplePacketCreator.fredrickMessage((byte) 0x1E)); - - } else { - chr.message("An unknown error has occured."); - } - break; - } catch (SQLException ex) { - ex.printStackTrace(); - } + FredrickProcessor.fredrickRetrieveItems(c); break; case 0x1C: //Exit break; default: } } - - private static boolean check(MapleCharacter chr, List> items) { - if (chr.getMeso() + chr.getMerchantMeso() < 0) { - return false; - } - return MapleInventory.checkSpotsAndOwnership(chr, items); - } - - private static boolean deleteItems(MapleCharacter chr) { - try { - Connection con = DatabaseConnection.getConnection(); - try (PreparedStatement ps = con.prepareStatement("DELETE FROM `inventoryitems` WHERE `type` = ? AND `characterid` = ?")) { - ps.setInt(1, ItemFactory.MERCHANT.getValue()); - ps.setInt(2, chr.getId()); - ps.execute(); - } - con.close(); - return true; - } catch (SQLException e) { - e.printStackTrace(); - return false; - } - - } } diff --git a/src/net/server/channel/handlers/HealOvertimeHandler.java b/src/net/server/channel/handlers/HealOvertimeHandler.java index 576f0f3315..04b426c268 100644 --- a/src/net/server/channel/handlers/HealOvertimeHandler.java +++ b/src/net/server/channel/handlers/HealOvertimeHandler.java @@ -30,7 +30,7 @@ import tools.data.input.SeekableLittleEndianAccessor; import tools.MaplePacketCreator; public final class HealOvertimeHandler extends AbstractMaplePacketHandler { - + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { MapleCharacter chr = c.getPlayer(); AutobanManager abm = chr.getAutobanManager(); diff --git a/src/net/server/channel/handlers/InnerPortalHandler.java b/src/net/server/channel/handlers/InnerPortalHandler.java index 9dd4a31a4f..ca305b3af7 100644 --- a/src/net/server/channel/handlers/InnerPortalHandler.java +++ b/src/net/server/channel/handlers/InnerPortalHandler.java @@ -30,6 +30,7 @@ import tools.data.input.SeekableLittleEndianAccessor; * @author BubblesDev */ public final class InnerPortalHandler extends AbstractMaplePacketHandler { + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { } } \ No newline at end of file diff --git a/src/net/server/channel/handlers/ItemPickupHandler.java b/src/net/server/channel/handlers/ItemPickupHandler.java index 92f33f18d5..2990e26d5c 100644 --- a/src/net/server/channel/handlers/ItemPickupHandler.java +++ b/src/net/server/channel/handlers/ItemPickupHandler.java @@ -26,6 +26,8 @@ import server.maps.MapleMapObject; import tools.data.input.SeekableLittleEndianAccessor; import client.MapleCharacter; import client.MapleClient; +import java.awt.Point; +import tools.FilePrinter; /** * @@ -43,6 +45,13 @@ public final class ItemPickupHandler extends AbstractMaplePacketHandler { MapleCharacter chr = c.getPlayer(); MapleMapObject ob = chr.getMap().getMapObject(oid); + Point charPos = chr.getPosition(); + Point obPos = ob.getPosition(); + if (Math.abs(charPos.getX() - obPos.getX()) > 800 || Math.abs(charPos.getY() - obPos.getY()) > 600) { + FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to pick up an item too far away. Mapid: " + chr.getMapId() + " Player pos: " + charPos + " Object pos: " + obPos + "\r\n"); + return; + } + chr.pickupItem(ob); } } diff --git a/src/net/server/channel/handlers/MobDamageMobFriendlyHandler.java b/src/net/server/channel/handlers/MobDamageMobFriendlyHandler.java index 8d43442d31..7072ebc2a5 100644 --- a/src/net/server/channel/handlers/MobDamageMobFriendlyHandler.java +++ b/src/net/server/channel/handlers/MobDamageMobFriendlyHandler.java @@ -52,17 +52,13 @@ public final class MobDamageMobFriendlyHandler extends AbstractMaplePacketHandle if (monster.getHp() - damage < 1) { // friendly dies if(monster.getId() == 9300102) { monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Watch Hog has been injured by the aliens. Better luck next time...")); - } - else if (monster.getId() == 9300061) { //moon bunny + } else if (monster.getId() == 9300061) { //moon bunny monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "The Moon Bunny went home because he was sick.")); - } - else if(monster.getId() == 9300093) { //tylus + } else if(monster.getId() == 9300093) { //tylus monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Tylus has fallen by the overwhelming forces of the ambush.")); - } - else if(monster.getId() == 9300137) { //juliet + } else if(monster.getId() == 9300137) { //juliet monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Juliet has fainted on the middle of the combat.")); - } - else if(monster.getId() == 9300138) { //romeo + } else if(monster.getId() == 9300138) { //romeo monster.getMap().broadcastMessage(MaplePacketCreator.serverNotice(6, "Romeo has fainted on the middle of the combat.")); } diff --git a/src/net/server/channel/handlers/MobDamageMobHandler.java b/src/net/server/channel/handlers/MobDamageMobHandler.java index 9c6f53713d..2e6b55f762 100644 --- a/src/net/server/channel/handlers/MobDamageMobHandler.java +++ b/src/net/server/channel/handlers/MobDamageMobHandler.java @@ -24,6 +24,7 @@ package net.server.channel.handlers; import client.MapleClient; import net.AbstractMaplePacketHandler; import server.maps.MapleMap; +import tools.MaplePacketCreator; import tools.data.input.SeekableLittleEndianAccessor; /** @@ -31,6 +32,7 @@ import tools.data.input.SeekableLittleEndianAccessor; * @author Jay Estrella */ public final class MobDamageMobHandler extends AbstractMaplePacketHandler { + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { int from = slea.readInt(); slea.readInt(); @@ -40,6 +42,7 @@ public final class MobDamageMobHandler extends AbstractMaplePacketHandler { MapleMap map = c.getPlayer().getMap(); if (map.getMonsterByOid(from) != null && map.getMonsterByOid(to) != null) { map.damageMonster(c.getPlayer(), map.getMonsterByOid(to), dmg); + map.broadcastMessage(MaplePacketCreator.damageMonster(to, dmg)); } } } diff --git a/src/net/server/channel/handlers/PartyChatHandler.java b/src/net/server/channel/handlers/MultiChatHandler.java similarity index 92% rename from src/net/server/channel/handlers/PartyChatHandler.java rename to src/net/server/channel/handlers/MultiChatHandler.java index 8bf97793e9..587cb90a12 100644 --- a/src/net/server/channel/handlers/PartyChatHandler.java +++ b/src/net/server/channel/handlers/MultiChatHandler.java @@ -31,12 +31,14 @@ import tools.FilePrinter; import tools.MaplePacketCreator; import tools.data.input.SeekableLittleEndianAccessor; -public final class PartyChatHandler extends AbstractMaplePacketHandler { +public final class MultiChatHandler extends AbstractMaplePacketHandler { + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { MapleCharacter player = c.getPlayer(); - if(player.getAutobanManager().getLastSpam(7) + 200 > System.currentTimeMillis()) { - return; - } + if(player.getAutobanManager().getLastSpam(7) + 200 > System.currentTimeMillis()) { + return; + } + int type = slea.readByte(); // 0 for buddys, 1 for partys int numRecipients = slea.readByte(); int recipients[] = new int[numRecipients]; @@ -63,6 +65,6 @@ public final class PartyChatHandler extends AbstractMaplePacketHandler { Server.getInstance().allianceMessage(allianceId, MaplePacketCreator.multiChat(player.getName(), chattext, 3), player.getId(), -1); } } - player.getAutobanManager().spam(7); + player.getAutobanManager().spam(7); } } diff --git a/src/net/server/channel/handlers/NPCTalkHandler.java b/src/net/server/channel/handlers/NPCTalkHandler.java index 52fc2cd900..3364f18e4c 100644 --- a/src/net/server/channel/handlers/NPCTalkHandler.java +++ b/src/net/server/channel/handlers/NPCTalkHandler.java @@ -22,6 +22,7 @@ package net.server.channel.handlers; import client.MapleClient; +import client.processor.DueyProcessor; import constants.ServerConstants; import net.AbstractMaplePacketHandler; import scripting.npc.NPCScriptManager; @@ -53,7 +54,7 @@ public final class NPCTalkHandler extends AbstractMaplePacketHandler { if (npc.getId() == 9010009) { //is duey c.getPlayer().setNpcCooldown(System.currentTimeMillis()); - c.announce(MaplePacketCreator.sendDuey((byte) 8, DueyHandler.loadItems(c.getPlayer()))); + DueyProcessor.dueySendTalk(c); } else { if (c.getCM() != null || c.getQM() != null) { c.announce(MaplePacketCreator.enableActions()); diff --git a/src/net/server/channel/handlers/NewYearCardHandler.java b/src/net/server/channel/handlers/NewYearCardHandler.java index 347d684751..ac25447d59 100644 --- a/src/net/server/channel/handlers/NewYearCardHandler.java +++ b/src/net/server/channel/handlers/NewYearCardHandler.java @@ -1,22 +1,22 @@ /* - * This file is part of the HeavenMS (MapleSolaxiaV2) Maple Story Server - * - * Copyright (C) 2017 RonanLana - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation version 3 as published by + the Free Software Foundation. You may not use, modify or distribute + this program under any other version of the GNU Affero General Public + License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ package net.server.channel.handlers; import constants.ItemConstants; diff --git a/src/net/server/channel/handlers/OwlWarpHandler.java b/src/net/server/channel/handlers/OwlWarpHandler.java index b7d95fdf34..318cc9530b 100644 --- a/src/net/server/channel/handlers/OwlWarpHandler.java +++ b/src/net/server/channel/handlers/OwlWarpHandler.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/channel/handlers/PartyOperationHandler.java b/src/net/server/channel/handlers/PartyOperationHandler.java index eebdcc8bb0..1100099cb2 100644 --- a/src/net/server/channel/handlers/PartyOperationHandler.java +++ b/src/net/server/channel/handlers/PartyOperationHandler.java @@ -31,6 +31,7 @@ import tools.data.input.SeekableLittleEndianAccessor; import client.MapleCharacter; import client.MapleClient; import constants.ServerConstants; +import java.util.List; import scripting.event.EventInstanceManager; import server.maps.MapleMap; @@ -81,34 +82,41 @@ public final class PartyOperationHandler extends AbstractMaplePacketHandler { player.setMPC(partyplayer); player.getMap().addPartyMember(player); player.silentPartyUpdate(); - c.announce(MaplePacketCreator.partyCreated(partyplayer)); + c.announce(MaplePacketCreator.partyCreated(partyplayer, party.getId())); + + player.updateMapDropsUponPartyOperation(null); } else { c.announce(MaplePacketCreator.serverNotice(5, "You can't create a party as you are already in one.")); } break; } case 2: { // leave/disband + List partymembers = player.getPartyMembers(); + leaveParty(party, partyplayer, c); + player.updateMapDropsUponPartyOperation(partymembers); break; } case 3: { // join int partyid = slea.readInt(); - if (c.getPlayer().getParty() == null) { - party = world.getParty(partyid); - if (party != null) { - if (party.getMembers().size() < 6) { - partyplayer = new MaplePartyCharacter(player); - player.getMap().addPartyMember(player); - - world.updateParty(party.getId(), PartyOperation.JOIN, partyplayer); - player.receivePartyMemberHP(); - player.updatePartyMemberHP(); - } else { - c.announce(MaplePacketCreator.partyStatusMessage(17)); - } + if (player.getParty() == null) { + party = world.getParty(partyid); + if (party != null) { + if (party.getMembers().size() < 6) { + partyplayer = new MaplePartyCharacter(player); + player.getMap().addPartyMember(player); + + world.updateParty(party.getId(), PartyOperation.JOIN, partyplayer); + player.receivePartyMemberHP(); + player.updatePartyMemberHP(); + + player.updateMapDropsUponPartyOperation(null); } else { - c.announce(MaplePacketCreator.serverNotice(5, "The person you have invited to the party is already in one.")); + c.announce(MaplePacketCreator.partyStatusMessage(17)); } + } else { + c.announce(MaplePacketCreator.serverNotice(5, "The person you have invited to the party is already in one.")); + } } else { c.announce(MaplePacketCreator.serverNotice(5, "You can't join the party as you are already in one.")); } @@ -139,7 +147,9 @@ public final class PartyOperationHandler extends AbstractMaplePacketHandler { player.setParty(party); player.setMPC(partyplayer); player.getMap().addPartyMember(player); - c.announce(MaplePacketCreator.partyCreated(partyplayer)); + c.announce(MaplePacketCreator.partyCreated(partyplayer, party.getId())); + + player.updateMapDropsUponPartyOperation(null); } if (party.getMembers().size() < 6) { invited.getClient().announce(MaplePacketCreator.partyInvite(player)); @@ -161,6 +171,8 @@ public final class PartyOperationHandler extends AbstractMaplePacketHandler { if (expelled != null) { MapleCharacter emc = expelled.getPlayer(); if(emc != null) { + List partyMembers = emc.getPartyMembers(); + MapleMap map = emc.getMap(); if(map != null) map.removePartyMember(emc); @@ -170,9 +182,12 @@ public final class PartyOperationHandler extends AbstractMaplePacketHandler { } emc.setParty(null); + world.updateParty(party.getId(), PartyOperation.EXPEL, expelled); + + emc.updateMapDropsUponPartyOperation(partyMembers); + } else { + world.updateParty(party.getId(), PartyOperation.EXPEL, expelled); } - - world.updateParty(party.getId(), PartyOperation.EXPEL, expelled); } } break; diff --git a/src/net/server/channel/handlers/PetAutoPotHandler.java b/src/net/server/channel/handlers/PetAutoPotHandler.java index 93b4cfdc26..84db16aea7 100644 --- a/src/net/server/channel/handlers/PetAutoPotHandler.java +++ b/src/net/server/channel/handlers/PetAutoPotHandler.java @@ -3,7 +3,8 @@ Copyright (C) 2008 Patrick Huy Matthias Butz Jan Christian Meyer - Copyleft (L) 2017 RonanLana (HeavenMS) + + Copyleft (L) 2016 - 2018 RonanLana (HeavenMS) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -96,10 +97,10 @@ public final class PetAutoPotHandler extends AbstractMaplePacketHandler { maxMp = maxHpMp.right; incHp = stat.getHp(); - if(incHp <= 0 && hasHpGain) incHp = (short)((maxHp * stat.getHpRate()) / 100.0); + if(incHp <= 0 && hasHpGain) incHp = (short)(maxHp * stat.getHpRate()); incMp = stat.getMp(); - if(incMp <= 0 && hasMpGain) incMp = (short)((maxMp * stat.getMpRate()) / 100.0); + if(incMp <= 0 && hasMpGain) incMp = (short)(maxMp * stat.getMpRate()); curHp = chr.getHp(); curMp = chr.getMp(); @@ -114,12 +115,12 @@ public final class PetAutoPotHandler extends AbstractMaplePacketHandler { curMp += incMp; //System.out.println(); - //System.out.println("hp: " + hasHpGain + " player hp " + curHp + " maxhp " + maxHp); - //System.out.println("mp: " + hasMpGain + " player mp " + curMp + " maxmp " + maxMp); - //System.out.println("redo? " + (shouldReusePot(chr) && toUse.getQuantity() > 0)); - } while(shouldReusePot(chr) && toUse.getQuantity() > 0); + //System.out.println("hp: " + hasHpGain + " hpgain " + incHp + " player hp " + curHp + " maxhp " + maxHp); + //System.out.println("mp: " + hasMpGain + " mpgain " + incMp + " player mp " + curMp + " maxmp " + maxMp); + //System.out.println("redo? " + (shouldReusePot() && toUse.getQuantity() > 0)); + } while(shouldReusePot() && toUse.getQuantity() > 0); - if(toUse.getQuantity() == 0 && shouldReusePot(chr)) { + if(toUse.getQuantity() == 0 && shouldReusePot()) { // depleted out the current slot, fetch for more if(!cursorOnNextAvailablePot(chr)) { @@ -170,7 +171,7 @@ public final class PetAutoPotHandler extends AbstractMaplePacketHandler { return new Pair<>(hp, mp); } - private boolean shouldReusePot(MapleCharacter chr) { + private boolean shouldReusePot() { return (hasHpGain && curHp < ServerConstants.PET_AUTOHP_RATIO * maxHp) || (hasMpGain && curMp < ServerConstants.PET_AUTOMP_RATIO * maxMp); } } diff --git a/src/net/server/channel/handlers/PlayerInteractionHandler.java b/src/net/server/channel/handlers/PlayerInteractionHandler.java index f8ebe4d2eb..10ee894bec 100644 --- a/src/net/server/channel/handlers/PlayerInteractionHandler.java +++ b/src/net/server/channel/handlers/PlayerInteractionHandler.java @@ -25,7 +25,6 @@ import client.MapleCharacter; import client.MapleClient; import client.autoban.AutobanFactory; import client.inventory.Item; -import client.inventory.MapleInventory; import client.inventory.MapleInventoryType; import constants.ItemConstants; import constants.ServerConstants; @@ -71,6 +70,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { ADD_ITEM(0x16), BUY(0x17), UPDATE_MERCHANT(0x19), + UPDATE_PLAYERSHOP(0x1A), REMOVE_ITEM(0x1B), BAN_PLAYER(0x1C), MERCHANT_THING(0x1D), @@ -113,7 +113,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { byte mode = slea.readByte(); - MapleCharacter chr = c.getPlayer(); + final MapleCharacter chr = c.getPlayer(); if (mode == Action.CREATE.getCode()) { byte createType = slea.readByte(); @@ -175,7 +175,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { if (GameConstants.isFreeMarketRoom(chr.getMapId()) || itemId > 5030000 && itemId < 5030012 || itemId > 5140000 && itemId < 5140006) { if (createType == 4) { - MaplePlayerShop shop = new MaplePlayerShop(c.getPlayer(), desc); + MaplePlayerShop shop = new MaplePlayerShop(chr, desc); chr.setPlayerShop(shop); chr.getMap().addMapObject(shop); shop.sendShop(c); @@ -207,6 +207,8 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { return; } } else { + if (isTradeOpen(chr)) return; + int oid = slea.readInt(); MapleMapObject ob = chr.getMap().getMapObject(oid); if (ob instanceof MaplePlayerShop) { @@ -217,9 +219,9 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { String pw = slea.available() > 1 ? slea.readMapleAsciiString() : ""; MapleMiniGame game = (MapleMiniGame) ob; - if(game.checkPassword(pw) || game.checkPassword(c.getPlayer().getName())) { - if (game.hasFreeSlot() && !game.isVisitor(c.getPlayer())) { - game.addVisitor(c.getPlayer()); + if(game.checkPassword(pw) || game.checkPassword(chr.getName())) { + if (game.hasFreeSlot() && !game.isVisitor(chr)) { + game.addVisitor(chr); chr.setMiniGame(game); switch (game.getGameType()) { case "omok": @@ -237,7 +239,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } else if (ob instanceof MapleHiredMerchant && chr.getHiredMerchant() == null) { MapleHiredMerchant merchant = (MapleHiredMerchant) ob; - if (merchant.isOwner(c.getPlayer())) { + if (merchant.isOwner(chr)) { merchant.setOpen(false); merchant.removeAllVisitors(); @@ -245,11 +247,11 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } else if (!merchant.isOpen()) { chr.getClient().announce(MaplePacketCreator.getMiniRoomError(18)); return; - } else if (!merchant.addVisitor(c.getPlayer())) { + } else if (!merchant.addVisitor(chr)) { chr.getClient().announce(MaplePacketCreator.getMiniRoomError(2)); return; } else { - c.announce(MaplePacketCreator.getHiredMerchant(c.getPlayer(), merchant, false)); + c.announce(MaplePacketCreator.getHiredMerchant(chr, merchant, false)); } chr.setHiredMerchant(merchant); } @@ -269,20 +271,22 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { game.chat(c, slea.readMapleAsciiString()); } } else if (merchant != null) { - merchant.sendMessage(c.getPlayer(), slea.readMapleAsciiString()); + merchant.sendMessage(chr, slea.readMapleAsciiString()); } } else if (mode == Action.EXIT.getCode()) { if (chr.getTrade() != null) { - MapleTrade.cancelTrade(c.getPlayer()); + MapleTrade.cancelTrade(chr); } else { chr.closePlayerShop(); chr.closeMiniGame(); chr.closeHiredMerchant(true); } } else if (mode == Action.OPEN.getCode()) { + if (isTradeOpen(chr)) return; + MaplePlayerShop shop = chr.getPlayerShop(); MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (shop != null && shop.isOwner(c.getPlayer())) { + if (shop != null && shop.isOwner(chr)) { slea.readByte();//01 if(ServerConstants.USE_ERASE_PERMIT_ON_OPENSHOP) { @@ -291,9 +295,9 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } catch(RuntimeException re) {} // fella does not have a player shop permit... } - chr.getMap().broadcastMessage(MaplePacketCreator.addCharBox(c.getPlayer(), 4)); + chr.getMap().broadcastMessage(MaplePacketCreator.addCharBox(chr, 4)); shop.setOpen(true); - } else if (merchant != null && merchant.isOwner(c.getPlayer())) { + } else if (merchant != null && merchant.isOwner(chr)) { chr.setHasMerchant(true); merchant.setOpen(true); chr.getMap().addMapObject(merchant); @@ -321,14 +325,14 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } else if (mode == Action.GIVE_UP.getCode()) { MapleMiniGame game = chr.getMiniGame(); if (game.getGameType().equals("omok")) { - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcast(MaplePacketCreator.getMiniGameOwnerForfeit(game)); } else { game.broadcast(MaplePacketCreator.getMiniGameVisitorForfeit(game)); } } if (game.getGameType().equals("matchcard")) { - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcast(MaplePacketCreator.getMatchCardVisitorWin(game)); } else { game.broadcast(MaplePacketCreator.getMatchCardOwnerWin(game)); @@ -336,7 +340,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } else if (mode == Action.REQUEST_TIE.getCode()) { MapleMiniGame game = chr.getMiniGame(); - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcastToVisitor(MaplePacketCreator.getMiniGameRequestTie(game)); } else { game.getOwner().getClient().announce(MaplePacketCreator.getMiniGameRequestTie(game)); @@ -352,7 +356,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } else if (mode == Action.SKIP.getCode()) { MapleMiniGame game = chr.getMiniGame(); - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcast(MaplePacketCreator.getMiniGameSkipOwner(game)); } else { game.broadcast(MaplePacketCreator.getMiniGameSkipVisitor(game)); @@ -361,7 +365,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { int x = slea.readInt(); // x point int y = slea.readInt(); // y point int type = slea.readByte(); // piece ( 1 or 2; Owner has one piece, visitor has another, it switches every game.) - chr.getMiniGame().setPiece(x, y, type, c.getPlayer()); + chr.getMiniGame().setPiece(x, y, type, chr); } else if (mode == Action.SELECT_CARD.getCode()) { int turn = slea.readByte(); // 1st turn = 1; 2nd turn = 0 int slot = slea.readByte(); // slot @@ -369,20 +373,20 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { int firstslot = game.getFirstSlot(); if (turn == 1) { game.setFirstSlot(slot); - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcastToVisitor(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, turn)); } else { game.getOwner().getClient().announce(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, turn)); } } else if ((game.getCardId(firstslot + 1)) == (game.getCardId(slot + 1))) { - if (game.isOwner(c.getPlayer())) { + if (game.isOwner(chr)) { game.broadcast(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, 2)); game.setOwnerPoints(); } else { game.broadcast(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, 3)); game.setVisitorPoints(); } - } else if (game.isOwner(c.getPlayer())) { + } else if (game.isOwner(chr)) { game.broadcast(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, 0)); } else { game.broadcast(MaplePacketCreator.getMatchCardSelect(game, turn, slot, firstslot, 1)); @@ -401,7 +405,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { return; } if (chr.getTrade() != null) { - if ((quantity <= item.getQuantity() && quantity >= 0) || ItemConstants.isRechargable(item.getItemId())) { + if ((quantity <= item.getQuantity() && quantity >= 0) || ItemConstants.isRechargeable(item.getItemId())) { if (ii.isDropRestricted(item.getItemId())) { // ensure that undroppable items do not make it to the trade window if (!((item.getFlag() & ItemConstants.KARMA) == ItemConstants.KARMA)) { c.announce(MaplePacketCreator.serverNotice(1, "That item is untradeable.")); @@ -410,7 +414,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } Item tradeItem = item.copy(); - if (ItemConstants.isRechargable(item.getItemId())) { + if (ItemConstants.isRechargeable(item.getItemId())) { tradeItem.setQuantity(item.getQuantity()); MapleInventoryManipulator.removeFromSlot(c, ivType, item.getPosition(), item.getQuantity(), true); } else { @@ -422,98 +426,105 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } } else if (mode == Action.CONFIRM.getCode()) { - MapleTrade.completeTrade(c.getPlayer()); + MapleTrade.completeTrade(chr); } else if (mode == Action.ADD_ITEM.getCode() || mode == Action.PUT_ITEM.getCode()) { + if (isTradeOpen(chr)) return; + MapleInventoryType ivType = MapleInventoryType.getByType(slea.readByte()); short slot = slea.readShort(); short bundles = slea.readShort(); - if (chr.getInventory(ivType).getItem(slot) == null || chr.getItemQuantity(chr.getInventory(ivType).getItem(slot).getItemId(), false) < bundles || chr.getInventory(ivType).getItem(slot).getFlag() == ItemConstants.UNTRADEABLE) { + Item ivItem = chr.getInventory(ivType).getItem(slot); + + if (ivItem == null || ivItem.getFlag() == ItemConstants.UNTRADEABLE) { c.announce(MaplePacketCreator.serverNotice(1, "Could not perform shop operation with that item.")); c.announce(MaplePacketCreator.enableActions()); return; } + short perBundle = slea.readShort(); - int price = slea.readInt(); - if (perBundle <= 0 || perBundle * bundles > 2000 || bundles <= 0 || price <= 0 || price > Integer.MAX_VALUE) { - AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with hired merchants."); - FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " might of possibly packet edited Hired Merchants\nperBundle: " + perBundle + "\nperBundle * bundles (This multiplied cannot be greater than 2000): " + perBundle * bundles + "\nbundles: " + bundles + "\nprice: " + price); + + if (ItemConstants.isRechargeable(ivItem.getItemId())) { + perBundle = 1; + bundles = 1; + } else if (chr.getItemQuantity(ivItem.getItemId(), false) < perBundle * bundles) { + c.announce(MaplePacketCreator.serverNotice(1, "Could not perform shop operation with that item.")); + c.announce(MaplePacketCreator.enableActions()); return; } - Item ivItem = chr.getInventory(ivType).getItem(slot); - Item sellItem = ivItem.copy(); - if (chr.getItemQuantity(ivItem.getItemId(), false) < perBundle * bundles) { + + int price = slea.readInt(); + if (perBundle <= 0 || perBundle * bundles > 2000 || bundles <= 0 || price <= 0 || price > Integer.MAX_VALUE) { + AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with hired merchants."); + FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " might of possibly packet edited Hired Merchants\nperBundle: " + perBundle + "\nperBundle * bundles (This multiplied cannot be greater than 2000): " + perBundle * bundles + "\nbundles: " + bundles + "\nprice: " + price); return; - } else if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(ivItem.getItemId())) { + } + Item sellItem = ivItem.copy(); + if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(ivItem.getItemId())) { c.announce(MaplePacketCreator.serverNotice(1, "Pets are not allowed to be sold on the Player Shop.")); return; } - sellItem.setQuantity(perBundle); + + if(!ItemConstants.isRechargeable(ivItem.getItemId())) { + sellItem.setQuantity(perBundle); + } + MaplePlayerShopItem shopItem = new MaplePlayerShopItem(sellItem, bundles, price); MaplePlayerShop shop = chr.getPlayerShop(); MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (shop != null && shop.isOwner(c.getPlayer())) { - if (ivItem != null && ivItem.getQuantity() >= bundles * perBundle) { - shop.addItem(shopItem); - c.announce(MaplePacketCreator.getPlayerShopItemUpdate(shop)); + if (shop != null && shop.isOwner(chr)) { + if (shop.isOpen()) { + c.announce(MaplePacketCreator.serverNotice(1, "You can't sell it anymore.")); + return; } - } else if (merchant != null && merchant.isOwner(c.getPlayer())) { + + shop.addItem(shopItem); + c.announce(MaplePacketCreator.getPlayerShopItemUpdate(shop)); + } else if (merchant != null && merchant.isOwner(chr)) { + if (merchant.isOpen()) { + c.announce(MaplePacketCreator.serverNotice(1, "You can't sell it anymore.")); + return; + } + merchant.addItem(shopItem); - c.announce(MaplePacketCreator.updateHiredMerchant(merchant, c.getPlayer())); + c.announce(MaplePacketCreator.updateHiredMerchant(merchant, chr)); } - if (ItemConstants.isRechargable(ivItem.getItemId())) { + if (ItemConstants.isRechargeable(ivItem.getItemId())) { MapleInventoryManipulator.removeFromSlot(c, ivType, slot, ivItem.getQuantity(), true); } else { MapleInventoryManipulator.removeFromSlot(c, ivType, slot, (short) (bundles * perBundle), true); } } else if (mode == Action.REMOVE_ITEM.getCode()) { + if (isTradeOpen(chr)) return; + MaplePlayerShop shop = chr.getPlayerShop(); - if (shop != null && shop.isOwner(c.getPlayer())) { + if (shop != null && shop.isOwner(chr)) { + if (shop.isOpen()) { + c.announce(MaplePacketCreator.serverNotice(1, "You can't take it with the store open.")); + return; + } + int slot = slea.readShort(); if (slot >= shop.getItems().size() || slot < 0) { - AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with a player shop."); - FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to remove item at slot " + slot + "\r\n"); - c.disconnect(true, false); - return; + AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a player shop."); + FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot + "\r\n"); + c.disconnect(true, false); + return; } - MaplePlayerShopItem shopItem = shop.getItems().get(slot); - Item ivItem = shopItem.getItem().copy(); - shop.removeItem(slot); - ivItem.setQuantity(shopItem.getBundles()); - MapleInventoryManipulator.addFromDrop(c, ivItem, false); - c.announce(MaplePacketCreator.getPlayerShopItemUpdate(shop)); + + shop.takeItemBack(slot, chr); } - } else if (mode == Action.MERCHANT_MESO.getCode()) {//Hmmmm - /*if (!chr.getHiredMerchant().isOwner(chr) || chr.getMerchantMeso() < 1) return; - int possible = Integer.MAX_VALUE - chr.getMerchantMeso(); - if (possible > 0) { - if (possible < chr.getMerchantMeso()) { - chr.gainMeso(possible, false); - chr.setMerchantMeso(chr.getMerchantMeso() - possible); - } else { - chr.gainMeso(chr.getMerchantMeso(), false); - chr.setMerchantMeso(0); - } - c.announce(MaplePacketCreator.updateHiredMerchant(chr.getHiredMerchant(), chr)); - }*/ + } else if (mode == Action.MERCHANT_MESO.getCode()) { + MapleHiredMerchant merchant = chr.getHiredMerchant(); + if (merchant == null) return; + + merchant.withdrawMesos(chr); } else if (mode == Action.MERCHANT_ORGANIZE.getCode()) { MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (!merchant.isOwner(chr)) return; + if (merchant == null || !merchant.isOwner(chr)) return; + + merchant.withdrawMesos(chr); + merchant.clearInexistentItems(); - if (chr.getMerchantMeso() > 0) { - int possible = Integer.MAX_VALUE - chr.getMerchantMeso(); - if (possible > 0) { - if (possible < chr.getMerchantMeso()) { - chr.gainMeso(possible, false); - chr.setMerchantMeso(chr.getMerchantMeso() - possible); - } else { - chr.gainMeso(chr.getMerchantMeso(), false); - chr.setMerchantMeso(0); - } - } - } - for (int i = 0; i < merchant.getItems().size(); i++) { - if (!merchant.getItems().get(i).isExist()) merchant.removeFromSlot(i); - } if (merchant.getItems().isEmpty()) { c.announce(MaplePacketCreator.hiredMerchantOwnerLeave()); c.announce(MaplePacketCreator.leaveHiredMerchant(0x00, 0x03)); @@ -524,57 +535,65 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { c.announce(MaplePacketCreator.updateHiredMerchant(merchant, chr)); } else if (mode == Action.BUY.getCode() || mode == Action.MERCHANT_BUY.getCode()) { + if (isTradeOpen(chr)) return; + int itemid = slea.readByte(); short quantity = slea.readShort(); if (quantity < 1) { - AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with a hired merchant and or player shop."); - FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to buy item " + itemid + " with quantity " + quantity + "\r\n"); + AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a hired merchant and or player shop."); + FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to buy item " + itemid + " with quantity " + quantity + "\r\n"); c.disconnect(true, false); return; } MaplePlayerShop shop = chr.getPlayerShop(); MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (shop != null && shop.isVisitor(c.getPlayer())) { + if (shop != null && shop.isVisitor(chr)) { shop.buy(c, itemid, quantity); shop.broadcast(MaplePacketCreator.getPlayerShopItemUpdate(shop)); } else if (merchant != null && !merchant.isOwner(chr)) { merchant.buy(c, itemid, quantity); - merchant.broadcastToVisitorsThreadsafe(MaplePacketCreator.updateHiredMerchant(merchant, c.getPlayer())); + merchant.broadcastToVisitorsThreadsafe(MaplePacketCreator.updateHiredMerchant(merchant, chr)); } } else if (mode == Action.TAKE_ITEM_BACK.getCode()) { + if (isTradeOpen(chr)) return; + MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (merchant != null && merchant.isOwner(c.getPlayer())) { + if (merchant != null && merchant.isOwner(chr)) { + if (merchant.isOpen()) { + c.announce(MaplePacketCreator.serverNotice(1, "You can't take it with the store open.")); + return; + } + int slot = slea.readShort(); - MaplePlayerShopItem shopItem = merchant.getItems().get(slot); - if (!MapleInventory.checkSpot(chr, shopItem.getItem())) { - c.announce(MaplePacketCreator.serverNotice(1, "Have a slot available on your inventory to claim back the item.")); - c.announce(MaplePacketCreator.enableActions()); - return; + if (slot >= merchant.getItems().size() || slot < 0) { + AutobanFactory.PACKET_EDIT.alert(chr, chr.getName() + " tried to packet edit with a hired merchant."); + FilePrinter.printError(FilePrinter.EXPLOITS + chr.getName() + ".txt", chr.getName() + " tried to remove item at slot " + slot + "\r\n"); + c.disconnect(true, false); + return; } - if (shopItem.getBundles() > 0) { - Item iitem = shopItem.getItem(); - iitem.setQuantity((short) (shopItem.getItem().getQuantity() * shopItem.getBundles())); - MapleInventoryManipulator.addFromDrop(c, iitem, true); - } - merchant.removeFromSlot(slot); - c.announce(MaplePacketCreator.updateHiredMerchant(merchant, c.getPlayer())); + + merchant.takeItemBack(slot, chr); } } else if (mode == Action.CLOSE_MERCHANT.getCode()) { + if (isTradeOpen(chr)) return; + MapleHiredMerchant merchant = chr.getHiredMerchant(); - if (merchant != null && merchant.isOwner(c.getPlayer())) { + if (merchant != null && merchant.isOwner(chr)) { c.announce(MaplePacketCreator.hiredMerchantOwnerLeave()); c.announce(MaplePacketCreator.leaveHiredMerchant(0x00, 0x03)); merchant.closeShop(c, false); chr.setHasMerchant(false); } } else if (mode == Action.MAINTENANCE_OFF.getCode()) { + if (isTradeOpen(chr)) return; + MapleHiredMerchant merchant = chr.getHiredMerchant(); if(merchant != null) { - if (merchant.getItems().isEmpty() && merchant.isOwner(c.getPlayer())) { + if (merchant.getItems().isEmpty() && merchant.isOwner(chr)) { merchant.closeShop(c, false); chr.setHasMerchant(false); } - if (merchant.isOwner(c.getPlayer())) { + if (merchant.isOwner(chr)) { merchant.clearMessages(); merchant.setOpen(true); } @@ -585,7 +604,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } else if (mode == Action.BAN_PLAYER.getCode()) { slea.skip(1); - if (chr.getPlayerShop() != null && chr.getPlayerShop().isOwner(c.getPlayer())) { + if (chr.getPlayerShop() != null && chr.getPlayerShop().isOwner(chr)) { chr.getPlayerShop().banPlayer(slea.readMapleAsciiString()); } } else if (mode == Action.EXPEL.getCode()) { @@ -600,4 +619,14 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler { } } } + + private static boolean isTradeOpen(MapleCharacter chr) { + if (chr.getTrade() != null) { // thanks to Rien dev team + //Apparently there is a dupe exploit that causes racing conditions when saving/retrieving from the db with stuff like trade open. + chr.announce(MaplePacketCreator.enableActions()); + return true; + } + + return false; + } } diff --git a/src/net/server/channel/handlers/PlayerLoggedinHandler.java b/src/net/server/channel/handlers/PlayerLoggedinHandler.java index b3410e1502..b9240c4ce6 100644 --- a/src/net/server/channel/handlers/PlayerLoggedinHandler.java +++ b/src/net/server/channel/handlers/PlayerLoggedinHandler.java @@ -148,6 +148,8 @@ public final class PlayerLoggedinHandler extends AbstractMaplePacketHandler { player.announce(MaplePacketCreator.sendAutoMpPot(player.getKeymap().get(92).getAction())); player.getMap().addPlayer(player); + player.visitMap(player.getMap()); + World world = server.getWorld(c.getWorld()); world.getPlayerStorage().addPlayer(player); diff --git a/src/net/server/channel/handlers/RemoteStoreHandler.java b/src/net/server/channel/handlers/RemoteStoreHandler.java index 0f6aaa8877..cec72139e6 100644 --- a/src/net/server/channel/handlers/RemoteStoreHandler.java +++ b/src/net/server/channel/handlers/RemoteStoreHandler.java @@ -34,6 +34,7 @@ import tools.data.input.SeekableLittleEndianAccessor; * @author kevintjuh93 :3 */ public class RemoteStoreHandler extends AbstractMaplePacketHandler { + @Override public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { MapleCharacter chr = c.getPlayer(); MapleHiredMerchant hm = getMerchant(c); @@ -54,7 +55,7 @@ public class RemoteStoreHandler extends AbstractMaplePacketHandler { c.announce(MaplePacketCreator.enableActions()); } - private MapleHiredMerchant getMerchant(MapleClient c) { + private static MapleHiredMerchant getMerchant(MapleClient c) { if (c.getPlayer().hasMerchant()) { return c.getWorldServer().getHiredMerchant(c.getPlayer().getId()); } diff --git a/src/net/server/channel/handlers/StorageHandler.java b/src/net/server/channel/handlers/StorageHandler.java index 593907bec5..45057e2548 100644 --- a/src/net/server/channel/handlers/StorageHandler.java +++ b/src/net/server/channel/handlers/StorageHandler.java @@ -116,8 +116,8 @@ public final class StorageHandler extends AbstractMaplePacketHandler { } else { MapleInventoryType invType = ItemConstants.getInventoryType(itemId); Item item = chr.getInventory(invType).getItem(slot).copy(); - if (item.getItemId() == itemId && (item.getQuantity() >= quantity || ItemConstants.isRechargable(itemId))) { - if (ItemConstants.isRechargable(itemId)) { + if (item.getItemId() == itemId && (item.getQuantity() >= quantity || ItemConstants.isRechargeable(itemId))) { + if (ItemConstants.isRechargeable(itemId)) { quantity = item.getQuantity(); } chr.gainMeso(meso, false, true, false); diff --git a/src/net/server/channel/handlers/UseItemHandler.java b/src/net/server/channel/handlers/UseItemHandler.java index 2ef6104c63..c0cf69b2ca 100644 --- a/src/net/server/channel/handlers/UseItemHandler.java +++ b/src/net/server/channel/handlers/UseItemHandler.java @@ -21,11 +21,13 @@ */ package net.server.channel.handlers; +import client.MapleCharacter; import client.MapleClient; import client.MapleDisease; import client.inventory.Item; import client.inventory.MapleInventoryType; import constants.ItemConstants; +import constants.ServerConstants; import net.AbstractMaplePacketHandler; import server.MapleInventoryManipulator; import server.MapleItemInformationProvider; @@ -38,7 +40,9 @@ import tools.data.input.SeekableLittleEndianAccessor; public final class UseItemHandler extends AbstractMaplePacketHandler { @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { - if (!c.getPlayer().isAlive()) { + MapleCharacter chr = c.getPlayer(); + + if (!chr.isAlive()) { c.announce(MaplePacketCreator.enableActions()); return; } @@ -46,47 +50,52 @@ public final class UseItemHandler extends AbstractMaplePacketHandler { slea.readInt(); short slot = slea.readShort(); int itemId = slea.readInt(); - Item toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot); + Item toUse = chr.getInventory(MapleInventoryType.USE).getItem(slot); if (toUse != null && toUse.getQuantity() > 0 && toUse.getItemId() == itemId) { if (itemId == 2022178 || itemId == 2050004) { - c.getPlayer().dispelDebuffs(); + chr.dispelDebuffs(); remove(c, slot); return; - } - else if (itemId == 2050001) { - c.getPlayer().dispelDebuff(MapleDisease.DARKNESS); + } else if (itemId == 2050001) { + chr.dispelDebuff(MapleDisease.DARKNESS); remove(c, slot); return; } else if (itemId == 2050002) { - c.getPlayer().dispelDebuff(MapleDisease.WEAKEN); - c.getPlayer().dispelDebuff(MapleDisease.SLOW); + chr.dispelDebuff(MapleDisease.WEAKEN); + chr.dispelDebuff(MapleDisease.SLOW); remove(c, slot); return; } else if (itemId == 2050003) { - c.getPlayer().dispelDebuff(MapleDisease.SEAL); - c.getPlayer().dispelDebuff(MapleDisease.CURSE); + chr.dispelDebuff(MapleDisease.SEAL); + chr.dispelDebuff(MapleDisease.CURSE); remove(c, slot); return; - } - else if (ItemConstants.isTownScroll(itemId)) { - if (ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer())) { + } else if (ItemConstants.isTownScroll(itemId)) { + int banMap = chr.getMapId(); + int banSp = chr.getMap().findClosestPlayerSpawnpoint(chr.getPosition()).getId(); + long banTime = System.currentTimeMillis(); + + if (ii.getItemEffect(toUse.getItemId()).applyTo(chr)) { + if(ServerConstants.USE_BANISHABLE_TOWN_SCROLL) { + chr.setBanishPlayerData(banMap, banSp, banTime); + } + remove(c, slot); } return; - } - else if (ItemConstants.isAntibanishScroll(itemId)) { - if (ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer())) { + } else if (ItemConstants.isAntibanishScroll(itemId)) { + if (ii.getItemEffect(toUse.getItemId()).applyTo(chr)) { remove(c, slot); } else { - c.getPlayer().dropMessage(5, "You cannot recover from a banish state at the moment."); + chr.dropMessage(5, "You cannot recover from a banish state at the moment."); } return; } remove(c, slot); - ii.getItemEffect(toUse.getItemId()).applyTo(c.getPlayer()); - c.getPlayer().checkBerserk(c.getPlayer().isHidden()); + ii.getItemEffect(toUse.getItemId()).applyTo(chr); + chr.checkBerserk(chr.isHidden()); } } diff --git a/src/net/server/channel/handlers/UseOwlOfMinervaHandler.java b/src/net/server/channel/handlers/UseOwlOfMinervaHandler.java index ef5cfac1ff..a22c7074b0 100644 --- a/src/net/server/channel/handlers/UseOwlOfMinervaHandler.java +++ b/src/net/server/channel/handlers/UseOwlOfMinervaHandler.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/BaseWorker.java b/src/net/server/worker/BaseWorker.java index 685ded7993..283415f478 100644 --- a/src/net/server/worker/BaseWorker.java +++ b/src/net/server/worker/BaseWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/CharacterAutosaverWorker.java b/src/net/server/worker/CharacterAutosaverWorker.java index 1b57afd67e..7f582d963e 100644 --- a/src/net/server/worker/CharacterAutosaverWorker.java +++ b/src/net/server/worker/CharacterAutosaverWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/CharacterDiseaseWorker.java b/src/net/server/worker/CharacterDiseaseWorker.java index 8d94656a35..8d222f639a 100644 --- a/src/net/server/worker/CharacterDiseaseWorker.java +++ b/src/net/server/worker/CharacterDiseaseWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/CouponWorker.java b/src/net/server/worker/CouponWorker.java index 14b6a024de..8e460c14ba 100644 --- a/src/net/server/worker/CouponWorker.java +++ b/src/net/server/worker/CouponWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/HiredMerchantWorker.java b/src/net/server/worker/HiredMerchantWorker.java index 9c0af652e9..67a066ac56 100644 --- a/src/net/server/worker/HiredMerchantWorker.java +++ b/src/net/server/worker/HiredMerchantWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/MountTirednessWorker.java b/src/net/server/worker/MountTirednessWorker.java index 175b844443..a0244af19d 100644 --- a/src/net/server/worker/MountTirednessWorker.java +++ b/src/net/server/worker/MountTirednessWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/net/server/worker/PetFullnessWorker.java b/src/net/server/worker/PetFullnessWorker.java index 8d039d97a6..23c9f2b23a 100644 --- a/src/net/server/worker/PetFullnessWorker.java +++ b/src/net/server/worker/PetFullnessWorker.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/provider/wz/XMLDomMapleData.java b/src/provider/wz/XMLDomMapleData.java index 151a04c2fd..980ced48cc 100644 --- a/src/provider/wz/XMLDomMapleData.java +++ b/src/provider/wz/XMLDomMapleData.java @@ -21,6 +21,7 @@ */ package provider.wz; +import constants.ServerConstants; import java.awt.Point; import java.io.File; import java.io.FileInputStream; @@ -60,12 +61,12 @@ public class XMLDomMapleData implements MapleData { throw new RuntimeException(e); } this.imageDataDir = imageDataDir; - this.nf = NumberFormat.getInstance(Locale.FRANCE); + this.nf = NumberFormat.getInstance(ServerConstants.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK); } private XMLDomMapleData(Node node) { this.node = node; - this.nf = NumberFormat.getInstance(Locale.FRANCE); + this.nf = NumberFormat.getInstance(ServerConstants.USE_UNITPRICE_WITH_COMMA ? Locale.FRANCE : Locale.UK); } @Override diff --git a/src/scripting/reactor/ReactorActionManager.java b/src/scripting/reactor/ReactorActionManager.java index 76282c1bae..1653a47ca0 100644 --- a/src/scripting/reactor/ReactorActionManager.java +++ b/src/scripting/reactor/ReactorActionManager.java @@ -43,8 +43,10 @@ import server.TimerManager; import server.life.MapleLifeFactory; import server.life.MapleMonster; import server.maps.MapMonitor; +import server.maps.MapleMap; import server.maps.MapleReactor; import server.maps.ReactorDropEntry; +import tools.MaplePacketCreator; /** * @author Lerk @@ -253,10 +255,13 @@ public class ReactorActionManager extends AbstractPlayerInteraction { } public void hitMonsterWithReactor(int id, int hitsToKill) { // until someone comes with a better solution, why not? - MapleMonster mm = reactor.getMap().getMonsterById(id); + MapleMap map = reactor.getMap(); + MapleMonster mm = map.getMonsterById(id); if(mm != null) { int damage = (int)Math.ceil(mm.getMaxHp() / hitsToKill); - reactor.getMap().damageMonster(this.getPlayer(), mm, damage); + + map.damageMonster(this.getPlayer(), mm, damage); + map.broadcastMessage(MaplePacketCreator.damageMonster(mm.getObjectId(), damage)); } } diff --git a/src/server/MapleInventoryManipulator.java b/src/server/MapleInventoryManipulator.java index 5163945ee3..14c52a6a8e 100644 --- a/src/server/MapleInventoryManipulator.java +++ b/src/server/MapleInventoryManipulator.java @@ -70,7 +70,7 @@ public class MapleInventoryManipulator { if (!type.equals(MapleInventoryType.EQUIP)) { short slotMax = ii.getSlotMax(c, itemId); List existing = c.getPlayer().getInventory(type).listById(itemId); - if (!ItemConstants.isRechargable(itemId) && petid == -1) { + if (!ItemConstants.isRechargeable(itemId) && petid == -1) { if (existing.size() > 0) { // first update all existing slots to slotMax Iterator i = existing.iterator(); while (quantity > 0) { @@ -89,7 +89,7 @@ public class MapleInventoryManipulator { } } } - while (quantity > 0 || ItemConstants.isRechargable(itemId)) { + while (quantity > 0 || ItemConstants.isRechargeable(itemId)) { short newQ = (short) Math.min(quantity, slotMax); if (newQ != 0) { quantity -= newQ; @@ -106,7 +106,7 @@ public class MapleInventoryManipulator { nItem.setOwner(owner); } c.announce(MaplePacketCreator.modifyInventory(true, Collections.singletonList(new ModifyInventory(0, nItem)))); - if ((ItemConstants.isRechargable(itemId)) && quantity == 0) { + if ((ItemConstants.isRechargeable(itemId)) && quantity == 0) { break; } } else { @@ -166,7 +166,7 @@ public class MapleInventoryManipulator { if (!type.equals(MapleInventoryType.EQUIP)) { short slotMax = ii.getSlotMax(c, item.getItemId()); List existing = c.getPlayer().getInventory(type).listById(item.getItemId()); - if (!ItemConstants.isRechargable(item.getItemId()) && petId == -1) { + if (!ItemConstants.isRechargeable(item.getItemId()) && petId == -1) { if (existing.size() > 0) { // first update all existing slots to slotMax Iterator i = existing.iterator(); while (quantity > 0) { @@ -248,7 +248,7 @@ public class MapleInventoryManipulator { if (!type.equals(MapleInventoryType.EQUIP)) { short slotMax = ii.getSlotMax(c, itemid); List existing = c.getPlayer().getInventory(type).listById(itemid); - if (!ItemConstants.isRechargable(itemid)) { + if (!ItemConstants.isRechargeable(itemid)) { if (existing.size() > 0) // first update all existing slots to slotMax { for (Item eItem : existing) { @@ -266,7 +266,7 @@ public class MapleInventoryManipulator { final int numSlotsNeeded; if (slotMax > 0) { numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax)); - } else if (ItemConstants.isRechargable(itemid)) { + } else if (ItemConstants.isRechargeable(itemid)) { numSlotsNeeded = 1; } else { numSlotsNeeded = 1; @@ -293,7 +293,7 @@ public class MapleInventoryManipulator { if (!type.equals(MapleInventoryType.EQUIP)) { short slotMax = ii.getSlotMax(c, itemid); - if (!ItemConstants.isRechargable(itemid)) { + if (!ItemConstants.isRechargeable(itemid)) { List existing = c.getPlayer().getInventory(type).listById(itemid); if (existing.size() > 0) // first update all existing slots to slotMax @@ -313,7 +313,7 @@ public class MapleInventoryManipulator { final int numSlotsNeeded; if (slotMax > 0) { numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax)); - } else if (ItemConstants.isRechargable(itemid)) { + } else if (ItemConstants.isRechargeable(itemid)) { numSlotsNeeded = 1; } else { numSlotsNeeded = 1; @@ -337,7 +337,7 @@ public class MapleInventoryManipulator { public static void removeFromSlot(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop, boolean consume) { Item item = c.getPlayer().getInventory(type).getItem(slot); - boolean allowZero = consume && ItemConstants.isRechargable(item.getItemId()); + boolean allowZero = consume && ItemConstants.isRechargeable(item.getItemId()); c.getPlayer().getInventory(type).removeItem(slot, quantity, allowZero); if (item.getQuantity() == 0 && !allowZero) { c.announce(MaplePacketCreator.modifyInventory(fromDrop, Collections.singletonList(new ModifyInventory(3, item)))); @@ -396,7 +396,7 @@ public class MapleInventoryManipulator { short slotMax = ii.getSlotMax(c, source.getItemId()); c.getPlayer().getInventory(type).move(src, dst, slotMax); final List mods = new ArrayList<>(); - if (!(type.equals(MapleInventoryType.EQUIP) || type.equals(MapleInventoryType.CASH)) && initialTarget != null && initialTarget.getItemId() == source.getItemId() && !ItemConstants.isRechargable(source.getItemId()) && isSameOwner(source, initialTarget)) { + if (!(type.equals(MapleInventoryType.EQUIP) || type.equals(MapleInventoryType.CASH)) && initialTarget != null && initialTarget.getItemId() == source.getItemId() && !ItemConstants.isRechargeable(source.getItemId()) && isSameOwner(source, initialTarget)) { if ((olddstQ + oldsrcQ) > slotMax) { mods.add(new ModifyInventory(1, source)); mods.add(new ModifyInventory(1, initialTarget)); @@ -562,11 +562,11 @@ public class MapleInventoryManipulator { c.getPlayer().setChalkboard(null); } } - if ((!ItemConstants.isRechargable(itemId) && source.getQuantity() < quantity) || quantity < 0) { + if ((!ItemConstants.isRechargeable(itemId) && source.getQuantity() < quantity) || quantity < 0) { return; } Point dropPos = new Point(c.getPlayer().getPosition()); - if (quantity < source.getQuantity() && !ItemConstants.isRechargable(itemId)) { + if (quantity < source.getQuantity() && !ItemConstants.isRechargeable(itemId)) { Item target = source.copy(); target.setQuantity(quantity); source.setQuantity((short) (source.getQuantity() - quantity)); diff --git a/src/server/MapleItemInformationProvider.java b/src/server/MapleItemInformationProvider.java index 12486dc805..b71d6d2852 100644 --- a/src/server/MapleItemInformationProvider.java +++ b/src/server/MapleItemInformationProvider.java @@ -421,6 +421,41 @@ public class MapleItemInformationProvider { return pEntry; } + private static double getRoundedUnitPrice(double unitPrice, int max) { + double intPart = Math.floor(unitPrice); + double fractPart = unitPrice - intPart; + if(fractPart == 0.0) return intPart; + + double fractMask = 0.0; + double lastFract, curFract = 1.0; + int i = 1; + + do { + lastFract = curFract; + curFract /= 2; + + if(fractPart == curFract) { + break; + } else if(fractPart > curFract) { + fractMask += curFract; + fractPart -= curFract; + } + + i++; + } while(i <= max); + + if(i > max) { + lastFract = curFract; + curFract = 0.0; + } + + if(Math.abs(fractPart - curFract) < Math.abs(fractPart - lastFract)) { + return intPart + fractMask + curFract; + } else { + return intPart + fractMask + lastFract; + } + } + private Pair getItemPriceData(int itemId) { MapleData item = getItemData(itemId); if (item == null) { @@ -439,7 +474,7 @@ public class MapleItemInformationProvider { pData = item.getChildByPath("info/unitPrice"); if (pData != null) { try { - fEntry = MapleDataTool.getDouble(pData); + fEntry = getRoundedUnitPrice(MapleDataTool.getDouble(pData), 5); } catch (Exception e) { fEntry = (double) MapleDataTool.getInt(pData); } @@ -472,7 +507,7 @@ public class MapleItemInformationProvider { return -1; } - if(!ItemConstants.isRechargable(itemId)) { + if(!ItemConstants.isRechargeable(itemId)) { retPrice *= quantity; } else { retPrice += Math.ceil(quantity * getUnitPrice(itemId)); @@ -481,38 +516,6 @@ public class MapleItemInformationProvider { return retPrice; } - public static boolean canSell(Item item, short quantity) { - if (item == null) { //Basic check - return false; - } - - short iQuant = item.getQuantity(); - if (iQuant == 0xFFFF) { - iQuant = 1; - } else if(iQuant < 0) { - return false; - } - - if (!ItemConstants.isRechargable(item.getItemId())) { - if (iQuant == 0 || quantity > iQuant) { - return false; - } - } - - return true; - } - - public static short getSellingQuantity(Item item, short quantity) { - if (ItemConstants.isRechargable(item.getItemId())) { - quantity = item.getQuantity(); - if (quantity == 0xFFFF) { - quantity = 1; - } - } - - return quantity; - } - protected String getEquipmentSlot(int itemId) { if (equipmentSlotCache.containsKey(itemId)) { return equipmentSlotCache.get(itemId); diff --git a/src/server/MapleShop.java b/src/server/MapleShop.java index a6b9e32017..12c0a5a14f 100644 --- a/src/server/MapleShop.java +++ b/src/server/MapleShop.java @@ -91,7 +91,7 @@ public class MapleShop { if (item.getPrice() > 0) { if (c.getPlayer().getMeso() >= (long) item.getPrice() * quantity) { if (MapleInventoryManipulator.checkSpace(c, itemId, quantity, "")) { - if (!ItemConstants.isRechargable(itemId)) { //Pets can't be bought from shops + if (!ItemConstants.isRechargeable(itemId)) { //Pets can't be bought from shops MapleInventoryManipulator.addById(c, itemId, quantity); c.getPlayer().gainMeso(-(item.getPrice() * quantity), false); } else { @@ -110,7 +110,7 @@ public class MapleShop { } else if (item.getPitch() > 0) { if (c.getPlayer().getInventory(MapleInventoryType.ETC).countById(4310000) >= (long) item.getPitch() * quantity) { if (MapleInventoryManipulator.checkSpace(c, itemId, quantity, "")) { - if (!ItemConstants.isRechargable(itemId)) { + if (!ItemConstants.isRechargeable(itemId)) { MapleInventoryManipulator.addById(c, itemId, quantity); MapleInventoryManipulator.removeById(c, MapleInventoryType.ETC, 4310000, item.getPitch() * quantity, false, false); } else { @@ -149,6 +149,37 @@ public class MapleShop { } } + private static boolean canSell(Item item, short quantity) { + if (item == null) { //Basic check + return false; + } + + short iQuant = item.getQuantity(); + if (iQuant == 0xFFFF) { + iQuant = 1; + } else if(iQuant < 0) { + return false; + } + + if (!ItemConstants.isRechargeable(item.getItemId())) { + if (iQuant == 0 || quantity > iQuant) { + return false; + } + } + + return true; + } + + private static short getSellingQuantity(Item item, short quantity) { + if (ItemConstants.isRechargeable(item.getItemId())) { + quantity = item.getQuantity(); + if (quantity == 0xFFFF) { + quantity = 1; + } + } + + return quantity; + } public void sell(MapleClient c, MapleInventoryType type, short slot, short quantity) { if (quantity == 0xFFFF || quantity == 0) { @@ -158,8 +189,8 @@ public class MapleShop { } Item item = c.getPlayer().getInventory(type).getItem((short) slot); - if(MapleItemInformationProvider.canSell(item, quantity)) { - quantity = MapleItemInformationProvider.getSellingQuantity(item, quantity); + if(canSell(item, quantity)) { + quantity = getSellingQuantity(item, quantity); MapleInventoryManipulator.removeFromSlot(c, type, (byte) slot, quantity, false); MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); @@ -168,13 +199,15 @@ public class MapleShop { c.getPlayer().gainMeso(recvMesos, false); } c.announce(MaplePacketCreator.shopTransaction((byte) 0x8)); + } else { + c.announce(MaplePacketCreator.shopTransaction((byte) 0x5)); } } public void recharge(MapleClient c, short slot) { MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); Item item = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot); - if (item == null || !ItemConstants.isRechargable(item.getItemId())) { + if (item == null || !ItemConstants.isRechargeable(item.getItemId())) { return; } short slotMax = ii.getSlotMax(c, item.getItemId()); @@ -189,8 +222,7 @@ public class MapleShop { c.getPlayer().gainMeso(-price, false, true, false); c.announce(MaplePacketCreator.shopTransaction((byte) 0x8)); } else { - c.announce(MaplePacketCreator.serverNotice(1, "You do not have enough mesos.")); - c.announce(MaplePacketCreator.enableActions()); + c.announce(MaplePacketCreator.shopTransaction((byte) 0x2)); } } } @@ -228,7 +260,7 @@ public class MapleShop { rs = ps.executeQuery(); List recharges = new ArrayList<>(rechargeableItems); while (rs.next()) { - if (ItemConstants.isRechargable(rs.getInt("itemid"))) { + if (ItemConstants.isRechargeable(rs.getInt("itemid"))) { MapleShopItem starItem = new MapleShopItem((short) 1, rs.getInt("itemid"), rs.getInt("price"), rs.getInt("pitch")); ret.addItem(starItem); if (rechargeableItems.contains(starItem.getItemId())) { diff --git a/src/server/MapleStorageInventory.java b/src/server/MapleStorageInventory.java index 5a466530e4..b9702b8667 100644 --- a/src/server/MapleStorageInventory.java +++ b/src/server/MapleStorageInventory.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -230,7 +230,7 @@ public class MapleStorageInventory { source.setPosition(dSlot); inventory.put(dSlot, source); inventory.remove(sSlot); - } else if (target.getItemId() == source.getItemId() && !ItemConstants.isRechargable(source.getItemId()) && !MapleItemInformationProvider.getInstance().isPickupRestricted(source.getItemId()) && isSameOwner(source, target)) { + } else if (target.getItemId() == source.getItemId() && !ItemConstants.isRechargeable(source.getItemId()) && !MapleItemInformationProvider.getInstance().isPickupRestricted(source.getItemId()) && isSameOwner(source, target)) { if (isEquipOrCash(source)) { swap(target, source); } else if (source.getQuantity() + target.getQuantity() > slotMax) { diff --git a/src/server/maps/MapleDoorObject.java b/src/server/maps/MapleDoorObject.java index 39770c8336..99fa6f0c62 100644 --- a/src/server/maps/MapleDoorObject.java +++ b/src/server/maps/MapleDoorObject.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/server/maps/MapleHiredMerchant.java b/src/server/maps/MapleHiredMerchant.java index da43730786..fda133f27c 100644 --- a/src/server/maps/MapleHiredMerchant.java +++ b/src/server/maps/MapleHiredMerchant.java @@ -165,6 +165,37 @@ public class MapleHiredMerchant extends AbstractMapleMapObject { } } + public void withdrawMesos(MapleCharacter chr) { + if (isOwner(chr)) { + synchronized (items) { + chr.withdrawMerchantMesos(); + } + } + } + + public void takeItemBack(int slot, MapleCharacter chr) { + synchronized (items) { + MaplePlayerShopItem shopItem = items.get(slot); + if(shopItem.isExist()) { + if (shopItem.getBundles() > 0) { + Item iitem = shopItem.getItem().copy(); + iitem.setQuantity((short) (shopItem.getItem().getQuantity() * shopItem.getBundles())); + + if (!MapleInventory.checkSpot(chr, iitem)) { + chr.announce(MaplePacketCreator.serverNotice(1, "Have a slot available on your inventory to claim back the item.")); + chr.announce(MaplePacketCreator.enableActions()); + return; + } + + MapleInventoryManipulator.addFromDrop(chr.getClient(), iitem, true); + } + + removeFromSlot(slot); + chr.announce(MaplePacketCreator.updateHiredMerchant(this, chr)); + } + } + } + private static boolean canBuy(MapleClient c, Item newItem) { return MapleInventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner()) && MapleInventoryManipulator.addFromDrop(c, newItem, false); } @@ -172,21 +203,19 @@ public class MapleHiredMerchant extends AbstractMapleMapObject { public void buy(MapleClient c, int item, short quantity) { synchronized (items) { MaplePlayerShopItem pItem = items.get(item); - Item newItem = pItem.getItem().copy(); + newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity))); - if ((newItem.getFlag() & ItemConstants.KARMA) == ItemConstants.KARMA) { - newItem.setFlag((byte) (newItem.getFlag() ^ ItemConstants.KARMA)); - } - if (quantity < 1 || pItem.getBundles() < 1 || !pItem.isExist() || pItem.getBundles() < quantity) { + if (quantity < 1 || !pItem.isExist() || pItem.getBundles() < quantity) { c.announce(MaplePacketCreator.enableActions()); return; } else if (newItem.getInventoryType().equals(MapleInventoryType.EQUIP) && newItem.getQuantity() > 1) { c.announce(MaplePacketCreator.enableActions()); return; - } else if (!pItem.isExist()) { - c.announce(MaplePacketCreator.enableActions()); - return; + } + + if ((newItem.getFlag() & ItemConstants.KARMA) == ItemConstants.KARMA) { + newItem.setFlag((byte) (newItem.getFlag() ^ ItemConstants.KARMA)); } int price = (int) Math.min((long)pItem.getPrice() * quantity, Integer.MAX_VALUE); @@ -196,7 +225,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject { if(ServerConstants.USE_ANNOUNCE_SHOPITEMSOLD) announceItemSold(newItem, price); // idea thanks to vcoc synchronized (sold) { - sold.add(new SoldItem(c.getPlayer().getName(), pItem.getItem().getItemId(), quantity, price)); + sold.add(new SoldItem(c.getPlayer().getName(), pItem.getItem().getItemId(), newItem.getQuantity(), price)); } pItem.setBundles((short) (pItem.getBundles() - quantity)); @@ -224,7 +253,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject { c.getPlayer().dropMessage(1, "Your inventory is full. Please clean a slot before buying this item."); } } else { - c.getPlayer().dropMessage(1, "You do not have enough mesos."); + c.getPlayer().dropMessage(1, "You don't have enough mesos to purchase this item."); } try { this.saveItems(false); @@ -388,10 +417,24 @@ public class MapleHiredMerchant extends AbstractMapleMapObject { } } - public void removeFromSlot(int slot) { - synchronized (items) { - items.remove(slot); + public void clearInexistentItems() { + synchronized(items) { + for (int i = items.size() - 1; i >= 0; i--) { + if (!items.get(i).isExist()) { + items.remove(i); + } + } + + try { + this.saveItems(false); + } catch (SQLException ex) { + ex.printStackTrace(); + } } + } + + private void removeFromSlot(int slot) { + items.remove(slot); try { this.saveItems(false); diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java index 2f578adf35..93f9556742 100644 --- a/src/server/maps/MapleMap.java +++ b/src/server/maps/MapleMap.java @@ -650,6 +650,7 @@ public class MapleMap { if (mob.dropsDisabled() || !dropsOn) { return; } + final byte droptype = (byte) (mob.getStats().isExplosiveReward() ? 3 : mob.getStats().isFfaLoot() ? 2 : chr.getParty() != null ? 1 : 0); final int mobpos = mob.getPosition().x; int chRate = chr.getDropRate(); @@ -793,7 +794,7 @@ public class MapleMap { objectWLock.lock(); try { - if(!everlast) registerItemDrop(mdrop); + registerItemDrop(mdrop); registeredDrops.add(new WeakReference<>((MapleMapObject) mdrop)); } finally { objectWLock.unlock(); @@ -803,13 +804,23 @@ public class MapleMap { } private void registerItemDrop(MapleMapItem mdrop) { - droppedItems.put(mdrop, System.currentTimeMillis() + ServerConstants.ITEM_EXPIRE_TIME); + droppedItems.put(mdrop, !everlast ? System.currentTimeMillis() + ServerConstants.ITEM_EXPIRE_TIME : Long.MAX_VALUE); + } + + private void unregisterItemDrop(MapleMapItem mdrop) { + objectWLock.lock(); + try { + droppedItems.remove(mdrop); + } finally { + objectWLock.unlock(); + } } private void makeDisappearExpiredItemDrops() { - objectWLock.lock(); + List toDisappear = new LinkedList<>(); + + objectRLock.lock(); try { - List toDisappear = new LinkedList<>(); long timeNow = System.currentTimeMillis(); for(Entry it : droppedItems.entrySet()) { @@ -817,9 +828,17 @@ public class MapleMap { toDisappear.add(it.getKey()); } } - + } finally { + objectRLock.unlock(); + } + + for(MapleMapItem mmi : toDisappear) { + makeDisappearItemFromMap(mmi); + } + + objectWLock.lock(); + try { for(MapleMapItem mmi : toDisappear) { - makeDisappearItemFromMap(mmi); droppedItems.remove(mmi); } } finally { @@ -827,12 +846,64 @@ public class MapleMap { } } - public void pickItemDrop(byte[] pickupPacket, MapleMapItem mdrop) { + private List getDroppedItems() { + objectRLock.lock(); + try { + return new LinkedList<>(droppedItems.keySet()); + } finally { + objectRLock.unlock(); + } + } + + public void pickItemDrop(byte[] pickupPacket, MapleMapItem mdrop) { // mdrop must be already locked and not-pickedup checked by now broadcastMessage(pickupPacket, mdrop.getPosition()); droppedItemCount.decrementAndGet(); this.removeMapObject(mdrop); mdrop.setPickedUp(true); + unregisterItemDrop(mdrop); + } + + private static boolean shouldShowQuestItem(MapleCharacter chr, int questid, int itemid) { + return questid <= 0 || (chr.getQuestStatus(questid) == 1 && chr.needQuestItem(questid, itemid)); + } + + public void updatePlayerItemDrops(int partyid, int charid, List partyMembers, MapleCharacter partyLeaver) { + for(MapleMapItem mdrop : getDroppedItems()) { + if(mdrop.getOwnerId() == charid) { + mdrop.lockItem(); + try { + if(mdrop.isPickedUp()) return; + + mdrop.setPartyOwnerId(partyid); + + byte[] removePacket = MaplePacketCreator.silentRemoveItemFromMap(mdrop.getObjectId()); + byte[] updatePacket = MaplePacketCreator.updateMapItemObject(mdrop, partyLeaver == null); + + for(MapleCharacter mc : partyMembers) { + if(this.equals(mc.getMap())) { + mc.announce(removePacket); + + if(shouldShowQuestItem(mc, mdrop.getQuest(), mdrop.getItemId())) { + mc.announce(updatePacket); + } + } + } + + if(partyLeaver != null) { + if(this.equals(partyLeaver.getMap())) { + partyLeaver.announce(removePacket); + + if(shouldShowQuestItem(partyLeaver, mdrop.getQuest(), mdrop.getItemId())) { + partyLeaver.announce(MaplePacketCreator.updateMapItemObject(mdrop, true)); + } + } + } + } finally { + mdrop.unlockItem(); + } + } + } } private void spawnDrop(final Item idrop, final Point dropPos, final MapleMapObject dropper, final MapleCharacter chr, final byte droptype, final short questid) { @@ -841,8 +912,15 @@ public class MapleMap { spawnAndAddRangedMapObject(mdrop, new DelayedPacketCreation() { @Override public void sendPackets(MapleClient c) { - if (questid <= 0 || (c.getPlayer().getQuestStatus(questid) == 1 && c.getPlayer().needQuestItem(questid, idrop.getItemId()))) { - c.announce(MaplePacketCreator.dropItemFromMapObject(mdrop, dropper.getPosition(), dropPos, (byte) 1)); + MapleCharacter chr = c.getPlayer(); + + if (shouldShowQuestItem(chr, questid, idrop.getItemId())) { + mdrop.lockItem(); + try { + c.announce(MaplePacketCreator.dropItemFromMapObject(chr.getParty() != null, mdrop, dropper.getPosition(), dropPos, (byte) 1)); + } finally { + mdrop.unlockItem(); + } } } }, null); @@ -859,7 +937,12 @@ public class MapleMap { spawnAndAddRangedMapObject(mdrop, new DelayedPacketCreation() { @Override public void sendPackets(MapleClient c) { - c.announce(MaplePacketCreator.dropItemFromMapObject(mdrop, dropper.getPosition(), droppos, (byte) 1)); + mdrop.lockItem(); + try { + c.announce(MaplePacketCreator.dropItemFromMapObject(c.getPlayer().getParty() != null, mdrop, dropper.getPosition(), droppos, (byte) 1)); + } finally { + mdrop.unlockItem(); + } } }, null); @@ -868,8 +951,14 @@ public class MapleMap { public final void disappearingItemDrop(final MapleMapObject dropper, final MapleCharacter owner, final Item item, final Point pos) { final Point droppos = calcDropPos(pos, pos); - final MapleMapItem drop = new MapleMapItem(item, droppos, dropper, owner, owner.getClient(), (byte) 1, false); - broadcastMessage(MaplePacketCreator.dropItemFromMapObject(drop, dropper.getPosition(), droppos, (byte) 3), drop.getPosition()); + final MapleMapItem mdrop = new MapleMapItem(item, droppos, dropper, owner, owner.getClient(), (byte) 1, false); + + mdrop.lockItem(); + try { + broadcastItemDropMessage(mdrop, dropper.getPosition(), droppos, (byte) 3, mdrop.getPosition()); + } finally { + mdrop.unlockItem(); + } } public MapleMonster getMonsterById(int id) { @@ -1918,11 +2007,22 @@ public class MapleMap { spawnAndAddRangedMapObject(mdrop, new DelayedPacketCreation() { @Override public void sendPackets(MapleClient c) { - c.announce(MaplePacketCreator.dropItemFromMapObject(mdrop, dropper.getPosition(), droppos, (byte) 1)); + mdrop.lockItem(); + try { + c.announce(MaplePacketCreator.dropItemFromMapObject(c.getPlayer().getParty() != null, mdrop, dropper.getPosition(), droppos, (byte) 1)); + } finally { + mdrop.unlockItem(); + } } }, null); - broadcastMessage(MaplePacketCreator.dropItemFromMapObject(mdrop, dropper.getPosition(), droppos, (byte) 0)); - + + mdrop.lockItem(); + try { + broadcastItemDropMessage(mdrop, dropper.getPosition(), droppos, (byte) 0); + } finally { + mdrop.unlockItem(); + } + instantiateItemDrop(mdrop); activateItemReactors(mdrop, owner.getClient()); } @@ -1997,8 +2097,13 @@ public class MapleMap { objectRLock.lock(); try { for(MapleMapItem mmi : droppedItems.keySet()) { - if(!mmi.isPickedUp()) { - list.add(mmi); + mmi.lockItem(); + try { + if(!mmi.isPickedUp()) { + list.add(mmi); + } + } finally { + mmi.unlockItem(); } } } finally { @@ -2435,18 +2540,6 @@ public class MapleMap { } } - public void dropMessage(int type, String message) { - broadcastStringMessage(type, message); - } - - public void broadcastStringMessage(int type, String message) { - broadcastMessage(MaplePacketCreator.serverNotice(type, message)); - } - - public void broadcastBossHpMessage(MapleMonster mm, int bossHash, final byte[] packet) { - broadcastBossHpMessage(mm, bossHash, null, packet, Double.POSITIVE_INFINITY, null); - } - public void broadcastMessage(final byte[] packet) { broadcastMessage(null, packet, Double.POSITIVE_INFINITY, null); } @@ -2488,10 +2581,6 @@ public class MapleMap { broadcastMessage(null, packet, getRangedDistance(), rangedFrom); } - public void broadcastBossHpMessage(MapleMonster mm, int bossHash, final byte[] packet, Point rangedFrom) { - broadcastBossHpMessage(mm, bossHash, null, packet, getRangedDistance(), rangedFrom); - } - /** * Always ranged from point. Does not repeat to source. * @@ -2522,6 +2611,14 @@ public class MapleMap { } } + public void broadcastBossHpMessage(MapleMonster mm, int bossHash, final byte[] packet) { + broadcastBossHpMessage(mm, bossHash, null, packet, Double.POSITIVE_INFINITY, null); + } + + public void broadcastBossHpMessage(MapleMonster mm, int bossHash, final byte[] packet, Point rangedFrom) { + broadcastBossHpMessage(mm, bossHash, null, packet, getRangedDistance(), rangedFrom); + } + private void broadcastBossHpMessage(MapleMonster mm, int bossHash, MapleCharacter source, final byte[] packet, double rangeSq, Point rangedFrom) { chrRLock.lock(); try { @@ -2541,6 +2638,41 @@ public class MapleMap { } } + private void broadcastItemDropMessage(MapleMapItem mdrop, Point dropperPos, Point dropPos, byte mod, Point rangedFrom) { + broadcastItemDropMessage(mdrop, dropperPos, dropPos, mod, getRangedDistance(), rangedFrom); + } + + private void broadcastItemDropMessage(MapleMapItem mdrop, Point dropperPos, Point dropPos, byte mod) { + broadcastItemDropMessage(mdrop, dropperPos, dropPos, mod, Double.POSITIVE_INFINITY, null); + } + + private void broadcastItemDropMessage(MapleMapItem mdrop, Point dropperPos, Point dropPos, byte mod, double rangeSq, Point rangedFrom) { + chrRLock.lock(); + try { + for (MapleCharacter chr : characters) { + final byte[] packet = MaplePacketCreator.dropItemFromMapObject(chr.getParty() != null, mdrop, dropperPos, dropPos, mod); + + if (rangeSq < Double.POSITIVE_INFINITY) { + if (rangedFrom.distanceSq(chr.getPosition()) <= rangeSq) { + chr.announce(packet); + } + } else { + chr.announce(packet); + } + } + } finally { + chrRLock.unlock(); + } + } + + public void dropMessage(int type, String message) { + broadcastStringMessage(type, message); + } + + public void broadcastStringMessage(int type, String message) { + broadcastMessage(MaplePacketCreator.serverNotice(type, message)); + } + private boolean isNonRangedType(MapleMapObjectType type) { switch (type) { case NPC: @@ -2982,6 +3114,7 @@ public class MapleMap { return; } mapitem.setPickedUp(true); + unregisterItemDrop(mapitem); reactor.setShouldCollect(false); MapleMap.this.broadcastMessage(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition()); diff --git a/src/server/maps/MapleMapItem.java b/src/server/maps/MapleMapItem.java index 01fa8cce23..281f20974d 100644 --- a/src/server/maps/MapleMapItem.java +++ b/src/server/maps/MapleMapItem.java @@ -97,8 +97,24 @@ public class MapleMapItem extends AbstractMapleMapObject { return character_ownerid; } + public final int getPartyOwnerId() { + return party_ownerid; + } + + public final void setPartyOwnerId(int partyid) { + party_ownerid = partyid; + } + + public final boolean isFFADrop() { + return type == 2 || type == 3 || hasExpiredOwnershipTime(); + } + + public final boolean hasExpiredOwnershipTime() { + return System.currentTimeMillis() - dropTime >= 15 * 1000; + } + public final boolean canBePickedBy(MapleCharacter chr) { - if (character_ownerid <= 0) return true; + if (character_ownerid <= 0 || isFFADrop()) return true; if (party_ownerid == -1) { if (chr.getId() == character_ownerid) { @@ -116,7 +132,7 @@ public class MapleMapItem extends AbstractMapleMapObject { } } - return System.currentTimeMillis() - dropTime >= 15 * 1000; + return hasExpiredOwnershipTime(); } public final MapleClient getOwnerClient() { @@ -166,8 +182,15 @@ public class MapleMapItem extends AbstractMapleMapObject { @Override public void sendSpawnData(final MapleClient client) { - if (questid <= 0 || (client.getPlayer().getQuestStatus(questid) == 1 && client.getPlayer().needQuestItem(questid, item.getItemId()))) { - client.announce(MaplePacketCreator.dropItemFromMapObject(this, null, getPosition(), (byte) 2)); + MapleCharacter chr = client.getPlayer(); + + if (questid <= 0 || (chr.getQuestStatus(questid) == 1 && chr.needQuestItem(questid, item.getItemId()))) { + this.lockItem(); + try { + client.announce(MaplePacketCreator.dropItemFromMapObject(chr.getParty() != null, this, null, getPosition(), (byte) 2)); + } finally { + this.unlockItem(); + } } } diff --git a/src/server/maps/MapleMiniDungeon.java b/src/server/maps/MapleMiniDungeon.java index 59bf1f018d..fc96b27674 100644 --- a/src/server/maps/MapleMiniDungeon.java +++ b/src/server/maps/MapleMiniDungeon.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/server/maps/MaplePlayerShop.java b/src/server/maps/MaplePlayerShop.java index b65d5e6a77..d885270b2b 100644 --- a/src/server/maps/MaplePlayerShop.java +++ b/src/server/maps/MaplePlayerShop.java @@ -24,7 +24,9 @@ package server.maps; import client.MapleCharacter; import client.MapleClient; import client.inventory.Item; +import client.inventory.MapleInventory; import client.inventory.MapleInventoryType; +import constants.ItemConstants; import constants.ServerConstants; import java.util.ArrayList; import java.util.Collections; @@ -53,6 +55,7 @@ public class MaplePlayerShop extends AbstractMapleMapObject { private MapleCharacter owner; private MapleCharacter[] visitors = new MapleCharacter[3]; private List items = new ArrayList<>(); + private List sold = new LinkedList<>(); private String description; private int boughtnumber = 0; private List bannedList = new ArrayList<>(); @@ -182,16 +185,37 @@ public class MaplePlayerShop extends AbstractMapleMapObject { } } - public void removeItem(int item) { - synchronized (items) { - items.remove(item); - } + private void removeFromSlot(int slot) { + items.remove(slot); } private static boolean canBuy(MapleClient c, Item newItem) { return MapleInventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner()) && MapleInventoryManipulator.addFromDrop(c, newItem, false); } + public void takeItemBack(int slot, MapleCharacter chr) { + synchronized (items) { + MaplePlayerShopItem shopItem = items.get(slot); + if(shopItem.isExist()) { + if (shopItem.getBundles() > 0) { + Item iitem = shopItem.getItem().copy(); + iitem.setQuantity((short) (shopItem.getItem().getQuantity() * shopItem.getBundles())); + + if (!MapleInventory.checkSpot(chr, iitem)) { + chr.announce(MaplePacketCreator.serverNotice(1, "Have a slot available on your inventory to claim back the item.")); + chr.announce(MaplePacketCreator.enableActions()); + return; + } + + MapleInventoryManipulator.addFromDrop(chr.getClient(), iitem, true); + } + + removeFromSlot(slot); + chr.announce(MaplePacketCreator.getPlayerShopItemUpdate(this)); + } + } + } + /** * no warnings for now o.o * @param c @@ -203,13 +227,22 @@ public class MaplePlayerShop extends AbstractMapleMapObject { if (isVisitor(c.getPlayer())) { MaplePlayerShopItem pItem = items.get(item); Item newItem = pItem.getItem().copy(); - newItem.setQuantity(newItem.getQuantity()); - if (quantity < 1 || pItem.getBundles() < 1 || newItem.getQuantity() > pItem.getBundles() || !pItem.isExist()) { + + newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity))); + if (quantity < 1 || !pItem.isExist() || pItem.getBundles() < quantity) { + c.announce(MaplePacketCreator.enableActions()); return; } else if (newItem.getInventoryType().equals(MapleInventoryType.EQUIP) && newItem.getQuantity() > 1) { + c.announce(MaplePacketCreator.enableActions()); return; } - synchronized (c.getPlayer()) { + + if ((newItem.getFlag() & ItemConstants.KARMA) == ItemConstants.KARMA) { + newItem.setFlag((byte) (newItem.getFlag() ^ ItemConstants.KARMA)); + } + + visitorLock.lock(); + try { int price = (int) Math.min((long)pItem.getPrice() * quantity, Integer.MAX_VALUE); if (c.getPlayer().getMeso() >= price) { @@ -219,6 +252,13 @@ public class MaplePlayerShop extends AbstractMapleMapObject { if(ServerConstants.USE_ANNOUNCE_SHOPITEMSOLD) announceItemSold(newItem, price); // idea thanks to vcoc owner.gainMeso(price, true); + SoldItem soldItem = new SoldItem(c.getPlayer().getName(), pItem.getItem().getItemId(), quantity, price); + owner.announce(MaplePacketCreator.getPlayerShopOwnerUpdate(soldItem, item)); + + synchronized (sold) { + sold.add(soldItem); + } + pItem.setBundles((short) (pItem.getBundles() - quantity)); if (pItem.getBundles() < 1) { pItem.setDoesExist(false); @@ -232,7 +272,11 @@ public class MaplePlayerShop extends AbstractMapleMapObject { } else { c.getPlayer().dropMessage(1, "Your inventory is full. Please clean a slot before buying this item."); } + } else { + c.getPlayer().dropMessage(1, "You don't have enough mesos to purchase this item."); } + } finally { + visitorLock.unlock(); } } } @@ -489,6 +533,12 @@ public class MaplePlayerShop extends AbstractMapleMapObject { } return list; } + + public List getSold() { + synchronized (sold) { + return Collections.unmodifiableList(sold); + } + } @Override public void sendDestroyData(MapleClient client) { @@ -504,4 +554,34 @@ public class MaplePlayerShop extends AbstractMapleMapObject { public MapleMapObjectType getType() { return MapleMapObjectType.SHOP; } + + public class SoldItem { + + int itemid, mesos; + short quantity; + String buyer; + + public SoldItem(String buyer, int itemid, short quantity, int mesos) { + this.buyer = buyer; + this.itemid = itemid; + this.quantity = quantity; + this.mesos = mesos; + } + + public String getBuyer() { + return buyer; + } + + public int getItemId() { + return itemid; + } + + public short getQuantity() { + return quantity; + } + + public int getMesos() { + return mesos; + } + } } \ No newline at end of file diff --git a/src/server/quest/MapleQuestRequirementType.java b/src/server/quest/MapleQuestRequirementType.java index f96991773c..ced6f1d847 100644 --- a/src/server/quest/MapleQuestRequirementType.java +++ b/src/server/quest/MapleQuestRequirementType.java @@ -78,8 +78,8 @@ public enum MapleQuestRequirementType { return COMPLETED_QUEST; } else if(name.equals("start")) { return START; - } else if(name.equals("end")) { - return END; + /*} else if(name.equals("end")) { already coded + return END;*/ } else if(name.equals("daybyday")) { return DAY_BY_DAY; } else if (name.equals("money")) { diff --git a/src/server/quest/requirements/BuffExceptRequirement.java b/src/server/quest/requirements/BuffExceptRequirement.java index 081ca72091..10840f273e 100644 --- a/src/server/quest/requirements/BuffExceptRequirement.java +++ b/src/server/quest/requirements/BuffExceptRequirement.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/server/quest/requirements/BuffRequirement.java b/src/server/quest/requirements/BuffRequirement.java index a0708fb95a..a1d9c2b5c0 100644 --- a/src/server/quest/requirements/BuffRequirement.java +++ b/src/server/quest/requirements/BuffRequirement.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/server/quest/requirements/ItemRequirement.java b/src/server/quest/requirements/ItemRequirement.java index 3e65be404e..665965e09e 100644 --- a/src/server/quest/requirements/ItemRequirement.java +++ b/src/server/quest/requirements/ItemRequirement.java @@ -74,7 +74,7 @@ public class ItemRequirement extends MapleQuestRequirement { count += item.getQuantity(); } //Weird stuff, nexon made some quests only available when wearing gm clothes. This enables us to accept it >< - if (iType.equals(MapleInventoryType.EQUIP)) { + if (iType.equals(MapleInventoryType.EQUIP) && !ItemConstants.isMedal(itemId)) { if(chr.isGM()) { for (Item item : chr.getInventory(MapleInventoryType.EQUIPPED).listById(itemId)) { count += item.getQuantity(); diff --git a/src/server/quest/requirements/MesoRequirement.java b/src/server/quest/requirements/MesoRequirement.java index 0510100eed..97ee20346f 100644 --- a/src/server/quest/requirements/MesoRequirement.java +++ b/src/server/quest/requirements/MesoRequirement.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/tools/MaplePacketCreator.java b/src/tools/MaplePacketCreator.java index af9ede9375..982722b603 100644 --- a/src/tools/MaplePacketCreator.java +++ b/src/tools/MaplePacketCreator.java @@ -400,7 +400,7 @@ public class MaplePacketCreator { mplew.writeMapleAsciiString(item.getOwner()); mplew.writeShort(item.getFlag()); // flag - if (ItemConstants.isRechargable(item.getItemId())) { + if (ItemConstants.isRechargeable(item.getItemId())) { mplew.writeInt(2); mplew.write(new byte[]{(byte) 0x54, 0, 0, (byte) 0x34}); } @@ -1738,18 +1738,37 @@ public class MaplePacketCreator { mplew.write(animation); return mplew.getPacket(); } + + public static byte[] updateMapItemObject(MapleMapItem drop, boolean giveOwnership) { + final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); + mplew.writeShort(SendOpcode.DROP_ITEM_FROM_MAPOBJECT.getValue()); + mplew.write(2); + mplew.writeInt(drop.getObjectId()); + mplew.writeBool(drop.getMeso() > 0); + mplew.writeInt(drop.getItemId()); + mplew.writeInt(giveOwnership ? 0 : -1); + mplew.write(drop.getDropType()); + mplew.writePos(drop.getPosition()); + mplew.writeInt(giveOwnership ? 0 : -1); - public static byte[] dropItemFromMapObject(MapleMapItem drop, Point dropfrom, Point dropto, byte mod) { + if (drop.getMeso() == 0) { + addExpirationTime(mplew, drop.getItem().getExpiration()); + } + mplew.write(drop.isPlayerDrop() ? 0 : 1); + return mplew.getPacket(); + } + + public static byte[] dropItemFromMapObject(boolean recvrInParty, MapleMapItem drop, Point dropfrom, Point dropto, byte mod) { final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.DROP_ITEM_FROM_MAPOBJECT.getValue()); mplew.write(mod); mplew.writeInt(drop.getObjectId()); mplew.writeBool(drop.getMeso() > 0); // 1 mesos, 0 item, 2 and above all item meso bag, mplew.writeInt(drop.getItemId()); // drop object ID - mplew.writeInt(drop.getOwnerId()); // owner charid/partyid :) + mplew.writeInt(!drop.isFFADrop() ? (recvrInParty ? drop.getPartyOwnerId() : drop.getOwnerId()) : 0); // owner charid/partyid :) mplew.write(drop.getDropType()); // 0 = timeout for non-owner, 1 = timeout for non-owner's party, 2 = FFA, 3 = explosive/FFA mplew.writePos(dropto); - mplew.writeInt(drop.getDropType() == 0 ? drop.getOwnerId() : 0); //test + mplew.writeInt(!drop.isFFADrop() ? drop.getOwnerId() : 0); // owner charid if (mod != 2) { mplew.writePos(dropfrom); @@ -1761,7 +1780,7 @@ public class MaplePacketCreator { mplew.write(drop.isPlayerDrop() ? 0 : 1); //pet EQP pickup return mplew.getPacket(); } - + /** * Gets a packet spawning a player as a mapobject to other clients. * @@ -2273,7 +2292,7 @@ public class MaplePacketCreator { mplew.writeInt(item.getPrice() == 0 ? item.getPitch() : 0); //Perfect Pitch mplew.writeInt(0); //Can be used x minutes after purchase mplew.writeInt(0); //Hmm - if (!ItemConstants.isRechargable(item.getItemId())) { + if (!ItemConstants.isRechargeable(item.getItemId())) { mplew.writeShort(1); // stacksize o.o mplew.writeShort(item.getBuyable()); } else { @@ -2383,6 +2402,10 @@ public class MaplePacketCreator { return mplew.getPacket(); } + public static byte[] silentRemoveItemFromMap(int oid) { + return removeItemFromMap(oid, 1, 0); + } + /** * animation: 0 - expire
1 - without animation
2 - pickup
4 - * explode
cid is ignored for 0 and 1 @@ -3020,7 +3043,18 @@ public class MaplePacketCreator { } return mplew.getPacket(); } - + + public static byte[] getPlayerShopOwnerUpdate(MaplePlayerShop.SoldItem item, int position) { + final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); + mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue()); + mplew.write(PlayerInteractionHandler.Action.UPDATE_PLAYERSHOP.getCode()); + mplew.write(position); + mplew.writeShort(item.getQuantity()); + mplew.writeMapleAsciiString(item.getBuyer()); + + return mplew.getPacket(); + } + /** * * @param c @@ -3035,7 +3069,20 @@ public class MaplePacketCreator { mplew.write(4); mplew.write(4); mplew.write(owner ? 0 : 1); - mplew.write(0); + + if (owner) { + List sold = shop.getSold(); + mplew.write(sold.size()); + for (MaplePlayerShop.SoldItem s : sold) { + mplew.writeInt(s.getItemId()); + mplew.writeShort(s.getQuantity()); + mplew.writeInt(s.getMesos()); + mplew.writeMapleAsciiString(s.getBuyer()); + } + } else { + mplew.write(0); + } + addCharLook(mplew, shop.getOwner(), false); mplew.writeMapleAsciiString(shop.getOwner().getName()); @@ -3051,7 +3098,7 @@ public class MaplePacketCreator { mplew.write(0xFF); mplew.writeMapleAsciiString(shop.getDescription()); List items = shop.getItems(); - mplew.write(0x10); + mplew.write(0x10); //TODO SLOTS, which is 16 for most stores...slotMax mplew.write(items.size()); for (MaplePlayerShopItem item : items) { mplew.writeShort(item.getBundles()); @@ -3518,12 +3565,11 @@ public class MaplePacketCreator { return mplew.getPacket(); } - public static byte[] partyCreated(MaplePartyCharacter partychar) { + public static byte[] partyCreated(MaplePartyCharacter partychar, int partyId) { final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.PARTY_OPERATION.getValue()); mplew.write(8); - mplew.writeShort(0x8b); - mplew.writeShort(1); + mplew.writeInt(partyId); if (partychar.getDoors().size() > 0) { boolean deployedPortal = false; @@ -3674,7 +3720,7 @@ public class MaplePacketCreator { case EXPEL: case LEAVE: mplew.write(0x0C); - mplew.writeInt(40546); + mplew.writeInt(party.getId()); mplew.writeInt(target.getId()); if (op == PartyOperation.DISBAND) { mplew.write(0); @@ -3692,7 +3738,7 @@ public class MaplePacketCreator { break; case JOIN: mplew.write(0xF); - mplew.writeInt(40546); + mplew.writeInt(party.getId()); mplew.writeMapleAsciiString(target.getName()); addPartyStatus(forChannel, party, mplew, false); break; @@ -5365,19 +5411,19 @@ public class MaplePacketCreator { if (hm.isOwner(chr)) { mplew.writeInt(hm.getTimeLeft()); mplew.write(firstTime ? 1 : 0); - //List sold = hm.getSold(); - mplew.write(0);//sold.size() - /*for (SoldItem s : sold) { fix this - mplew.writeInt(s.getItemId()); - mplew.writeShort(s.getQuantity()); - mplew.writeInt(s.getMesos()); - mplew.writeMapleAsciiString(s.getBuyer()); - }*/ + List sold = hm.getSold(); + mplew.write(sold.size()); + for (MapleHiredMerchant.SoldItem s : sold) { + mplew.writeInt(s.getItemId()); + mplew.writeShort(s.getQuantity()); + mplew.writeInt(s.getMesos()); + mplew.writeMapleAsciiString(s.getBuyer()); + } mplew.writeInt(chr.getMerchantMeso());//:D? } mplew.writeMapleAsciiString(hm.getDescription()); mplew.write(0x10); //TODO SLOTS, which is 16 for most stores...slotMax - mplew.writeInt(chr.getMeso()); + mplew.writeInt(hm.isOwner(chr) ? chr.getMerchantMeso() : chr.getMeso()); mplew.write(hm.getItems().size()); if (hm.getItems().isEmpty()) { mplew.write(0);//Hmm?? @@ -5396,7 +5442,7 @@ public class MaplePacketCreator { final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(); mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue()); mplew.write(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode()); - mplew.writeInt(chr.getMeso()); + mplew.writeInt(hm.isOwner(chr) ? chr.getMerchantMeso() : chr.getMeso()); mplew.write(hm.getItems().size()); for (MaplePlayerShopItem item : hm.getItems()) { mplew.writeShort(item.getBundles()); diff --git a/src/tools/locks/MonitoredLockType.java b/src/tools/locks/MonitoredLockType.java index 6dc0d330e2..fee7c5ca6e 100644 --- a/src/tools/locks/MonitoredLockType.java +++ b/src/tools/locks/MonitoredLockType.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/tools/locks/MonitoredReadLock.java b/src/tools/locks/MonitoredReadLock.java index d1c37a22f5..8c3853e91a 100644 --- a/src/tools/locks/MonitoredReadLock.java +++ b/src/tools/locks/MonitoredReadLock.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/tools/locks/MonitoredReentrantLock.java b/src/tools/locks/MonitoredReentrantLock.java index 235ccbe4eb..ce931eb210 100644 --- a/src/tools/locks/MonitoredReentrantLock.java +++ b/src/tools/locks/MonitoredReentrantLock.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/tools/locks/MonitoredReentrantReadWriteLock.java b/src/tools/locks/MonitoredReentrantReadWriteLock.java index 15745ef405..e917a4c17c 100644 --- a/src/tools/locks/MonitoredReentrantReadWriteLock.java +++ b/src/tools/locks/MonitoredReentrantReadWriteLock.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/src/tools/locks/MonitoredWriteLock.java b/src/tools/locks/MonitoredWriteLock.java index 8da5bb2e5f..76bc5b6b93 100644 --- a/src/tools/locks/MonitoredWriteLock.java +++ b/src/tools/locks/MonitoredWriteLock.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleArrowFetcher/src/maplearrowfetcher/MapleArrowFetcher.java b/tools/MapleArrowFetcher/src/maplearrowfetcher/MapleArrowFetcher.java index 98fcef0d3b..480fe86581 100644 --- a/tools/MapleArrowFetcher/src/maplearrowfetcher/MapleArrowFetcher.java +++ b/tools/MapleArrowFetcher/src/maplearrowfetcher/MapleArrowFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleBossHpBarFetcher/src/maplebosshpbarfetcher/MapleBossHpBarFetcher.java b/tools/MapleBossHpBarFetcher/src/maplebosshpbarfetcher/MapleBossHpBarFetcher.java index 507d41ad20..55f4cd774c 100644 --- a/tools/MapleBossHpBarFetcher/src/maplebosshpbarfetcher/MapleBossHpBarFetcher.java +++ b/tools/MapleBossHpBarFetcher/src/maplebosshpbarfetcher/MapleBossHpBarFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleCashDropFetcher/src/maplecashdropfetcher/MapleCashDropFetcher.java b/tools/MapleCashDropFetcher/src/maplecashdropfetcher/MapleCashDropFetcher.java index 3c9509f89d..c1f4861205 100644 --- a/tools/MapleCashDropFetcher/src/maplecashdropfetcher/MapleCashDropFetcher.java +++ b/tools/MapleCashDropFetcher/src/maplecashdropfetcher/MapleCashDropFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleCouponInstaller/src/maplecouponinstaller/MapleCouponInstaller.java b/tools/MapleCouponInstaller/src/maplecouponinstaller/MapleCouponInstaller.java index 16ef955620..dbfa3fc17d 100644 --- a/tools/MapleCouponInstaller/src/maplecouponinstaller/MapleCouponInstaller.java +++ b/tools/MapleCouponInstaller/src/maplecouponinstaller/MapleCouponInstaller.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java b/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java index f14ec5440c..6d69f68bf4 100644 --- a/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java +++ b/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleInvalidItemIdFetcher/src/maplenoitemidfetcher/MapleNoItemIdFetcher.java b/tools/MapleInvalidItemIdFetcher/src/maplenoitemidfetcher/MapleNoItemIdFetcher.java index 585015e692..fa43c8062c 100644 --- a/tools/MapleInvalidItemIdFetcher/src/maplenoitemidfetcher/MapleNoItemIdFetcher.java +++ b/tools/MapleInvalidItemIdFetcher/src/maplenoitemidfetcher/MapleNoItemIdFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleMapInfoRetriever/src/maplemapinforetriever/MapleMapInfoRetriever.java b/tools/MapleMapInfoRetriever/src/maplemapinforetriever/MapleMapInfoRetriever.java index 597104c163..b568f88f25 100644 --- a/tools/MapleMapInfoRetriever/src/maplemapinforetriever/MapleMapInfoRetriever.java +++ b/tools/MapleMapInfoRetriever/src/maplemapinforetriever/MapleMapInfoRetriever.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleMesoFetcher/src/maplemesofetcher/MapleMesoFetcher.java b/tools/MapleMesoFetcher/src/maplemesofetcher/MapleMesoFetcher.java index 2bdab3d8a8..687152fd2d 100644 --- a/tools/MapleMesoFetcher/src/maplemesofetcher/MapleMesoFetcher.java +++ b/tools/MapleMesoFetcher/src/maplemesofetcher/MapleMesoFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleMobBookIndexer/src/maplemobbookindexer/MapleMobBookIndexer.java b/tools/MapleMobBookIndexer/src/maplemobbookindexer/MapleMobBookIndexer.java index 0ff70f9c8a..cf6cf84dcc 100644 --- a/tools/MapleMobBookIndexer/src/maplemobbookindexer/MapleMobBookIndexer.java +++ b/tools/MapleMobBookIndexer/src/maplemobbookindexer/MapleMobBookIndexer.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleMobBookUpdate/src/maplemobbookupdate/MapleMobBookUpdate.java b/tools/MapleMobBookUpdate/src/maplemobbookupdate/MapleMobBookUpdate.java index c31bb0b9c6..cafe668526 100644 --- a/tools/MapleMobBookUpdate/src/maplemobbookupdate/MapleMobBookUpdate.java +++ b/tools/MapleMobBookUpdate/src/maplemobbookupdate/MapleMobBookUpdate.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleQuestItemCountFetcher/src/maplequestitemcountfetcher/MapleQuestItemCountFetcher.java b/tools/MapleQuestItemCountFetcher/src/maplequestitemcountfetcher/MapleQuestItemCountFetcher.java index d1ce0d366f..9e4795f27d 100644 --- a/tools/MapleQuestItemCountFetcher/src/maplequestitemcountfetcher/MapleQuestItemCountFetcher.java +++ b/tools/MapleQuestItemCountFetcher/src/maplequestitemcountfetcher/MapleQuestItemCountFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleQuestItemFetcher/src/maplequestitemfetcher/MapleQuestItemFetcher.java b/tools/MapleQuestItemFetcher/src/maplequestitemfetcher/MapleQuestItemFetcher.java index e6879b655a..47e1c9ad84 100644 --- a/tools/MapleQuestItemFetcher/src/maplequestitemfetcher/MapleQuestItemFetcher.java +++ b/tools/MapleQuestItemFetcher/src/maplequestitemfetcher/MapleQuestItemFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -56,7 +56,7 @@ import tools.Pair; * and update the questid from items that are labeled as "Quest Item" on the DB. * * To test a server instance with this feature, MapleQuestItemFetcher must be set - * just like it is displayed on the HeavenMS (MapleSolaxiaV2) source: 2 folders ahead + * just like it is displayed on the HeavenMS source: 2 folders ahead * of the root of the main source. * * Running it should generate a report file under "lib" folder with the search results. diff --git a/tools/MapleQuestMesoFetcher/src/maplequestmesofetcher/MapleQuestMesoFetcher.java b/tools/MapleQuestMesoFetcher/src/maplequestmesofetcher/MapleQuestMesoFetcher.java index 395a1a1479..2e59c1583f 100644 --- a/tools/MapleQuestMesoFetcher/src/maplequestmesofetcher/MapleQuestMesoFetcher.java +++ b/tools/MapleQuestMesoFetcher/src/maplequestmesofetcher/MapleQuestMesoFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleQuestlineFetcher/src/maplequestlinefetcher/MapleQuestlineFetcher.java b/tools/MapleQuestlineFetcher/src/maplequestlinefetcher/MapleQuestlineFetcher.java index d29de492b0..928d2a2b91 100644 --- a/tools/MapleQuestlineFetcher/src/maplequestlinefetcher/MapleQuestlineFetcher.java +++ b/tools/MapleQuestlineFetcher/src/maplequestlinefetcher/MapleQuestlineFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleReactorDropFetcher/src/maplereactordropfetcher/MapleReactorDropFetcher.java b/tools/MapleReactorDropFetcher/src/maplereactordropfetcher/MapleReactorDropFetcher.java index 8a317fee3f..f63c05f75a 100644 --- a/tools/MapleReactorDropFetcher/src/maplereactordropfetcher/MapleReactorDropFetcher.java +++ b/tools/MapleReactorDropFetcher/src/maplereactordropfetcher/MapleReactorDropFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleMakerItemEntry.java b/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleMakerItemEntry.java index 68fae0d520..6589e8249a 100644 --- a/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleMakerItemEntry.java +++ b/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleMakerItemEntry.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleSkillMakerFetcher.java b/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleSkillMakerFetcher.java index c62a65c5fa..947931965d 100644 --- a/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleSkillMakerFetcher.java +++ b/tools/MapleSkillMakerFetcher/src/mapleskillmakerfetcher/MapleSkillMakerFetcher.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/tools/MapleSkillMakerReagentIndexer/src/mapleskillmakerreagentindexer/MapleSkillMakerReagentIndexer.java b/tools/MapleSkillMakerReagentIndexer/src/mapleskillmakerreagentindexer/MapleSkillMakerReagentIndexer.java index 6fe8490f30..1c7bf9306e 100644 --- a/tools/MapleSkillMakerReagentIndexer/src/mapleskillmakerreagentindexer/MapleSkillMakerReagentIndexer.java +++ b/tools/MapleSkillMakerReagentIndexer/src/mapleskillmakerreagentindexer/MapleSkillMakerReagentIndexer.java @@ -1,6 +1,6 @@ /* - This file is part of the HeavenMS (MapleSolaxiaV2) MapleStory Server - Copyleft (L) 2017 RonanLana + This file is part of the HeavenMS MapleStory Server + Copyleft (L) 2016 - 2018 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/wz/Quest.wz/Check.img.xml b/wz/Quest.wz/Check.img.xml index f9f7f46f00..8f4fb08f00 100644 --- a/wz/Quest.wz/Check.img.xml +++ b/wz/Quest.wz/Check.img.xml @@ -20126,13 +20126,7 @@ - - - - - - diff --git a/wz/Quest.wz/QuestInfo.img.xml b/wz/Quest.wz/QuestInfo.img.xml index 8f8e4edea1..571b160919 100644 --- a/wz/Quest.wz/QuestInfo.img.xml +++ b/wz/Quest.wz/QuestInfo.img.xml @@ -11938,7 +11938,7 @@ Can proceed to the "The Secrets Behind the Ring?" quest. - +