diff --git a/.gitignore b/.gitignore
index b810f781b8..505c52f286 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,6 +55,10 @@
/tools/MapleEventMethodFiller/dist/
/tools/MapleEventMethodFiller/nbproject/
+/tools/MapleGachaponItemidRetriever/build/
+/tools/MapleGachaponItemidRetriever/dist/
+/tools/MapleGachaponItemidRetriever/nbproject/
+
/tools/MapleIdRetriever/build/
/tools/MapleIdRetriever/dist/
/tools/MapleIdRetriever/nbproject/
diff --git a/README.md b/README.md
index f20ff2a3da..e3411185f3 100644
--- a/README.md
+++ b/README.md
@@ -23,13 +23,15 @@ Java7 SDK: https://www.oracle.com/technetwork/java/javase/downloads/java-archive
**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.
- Latest localhost: https://hostr.co/tsYsQzzV6xT0
+ Latest localhost: https://hostr.co/itrvrHapvtEg
The following list, in bottom-up chronological order, holds information regarding all changes that were applied from the starting localhost used in this development. Some lines have a link attached, that will lead you to a snapshot of the localhost at that version of the artifact. Naturally, later versions holds all previous changes along with the proposed changes.
**Change log:**
- * Fixed some 'rn' problems with quest icons & removed "tab" from party leader changed message.
+ * Fixed Monster Magnet crashing the caster when trying to pull-in bosses.
+
+ * Fixed some 'rn' problems with quest icons & removed "tab" from party leader changed message. https://hostr.co/tsYsQzzV6xT0
* Removed block on applying attack-based strengthening gems on non-weapon equipments. https://hostr.co/m2bVtnizCtmD
diff --git a/docs/issues.txt b/docs/issues.txt
index 81001fc17d..ccff9e18d8 100644
--- a/docs/issues.txt
+++ b/docs/issues.txt
@@ -15,6 +15,7 @@ Known issues:
- On low-end connections, things such as command summoning a player that is currently logging in (already visible to other players) may cause the player to freeze, consequently freezing the account as well since the server-side disconnection doesn't happen.
- Reportedly, there are cases where mob positions fail to sync between player's client-view.
- Visual equip EXP watch value will present stuttering for early levels requirement (EXP needed less than 100), and requirement at level 200 will not progress at all due to the level cap in client.
+- Monster Magnet will crash the player when trying to pull fixed monsters.
---------------------------
---------------------------
diff --git a/docs/localhost_minimum_specs.txt b/docs/localhost_minimum_specs.txt
new file mode 100644
index 0000000000..27a1515b39
--- /dev/null
+++ b/docs/localhost_minimum_specs.txt
@@ -0,0 +1,14 @@
+-- Thanks MikeyJacobs for prompting out minimum specs search for pre-BB MapleStory.
+-- Minimum specs gathered thanks to AkatsukiLog, source: https://www.clubedohardware.com.br/forums/topic/1081421-maplestory-reinicia-meu-pc-direto-ajuda/
+
+MapleStory pre-BB specs:
+
+Minimum Requirement | Recommended Setting
+
+OS: Windows XP or later | Windows XP or later
+Processor: Pentium 4 or equivalent | Pentium Dual Core or equivalent
+Memory: 1GB RAM | 1GB RAM
+Hard Drive: At least 7GB of free space | At least 7GB of free space
+Graphics: Video Card with 128MB or higher | GeForce FX5000 / ATI Radeon 9600 or higher (any video card with Shader model 2.0 or higher)
+Sound: DirectX compatible sound card | DirectX compatible sound card
+Network: Broadband internet connection | Broadband internet connection
\ No newline at end of file
diff --git a/docs/mychanges_ptbr.txt b/docs/mychanges_ptbr.txt
index 4c5584f724..97c3bc975e 100644
--- a/docs/mychanges_ptbr.txt
+++ b/docs/mychanges_ptbr.txt
@@ -7,8 +7,8 @@
Abdula -> 9209000 *
CUSTOM NPC SHOPS (db_shopupdate.sql):
- Asia -> 2082014 *
- T-1337 -> 9201101 *
+ Asia -> 2082014
+ T-1337 -> 9201101
* : those won't get disabled when USE_ENABLE_CUSTOM_NPC_SCRIPTS = false
@@ -1873,5 +1873,80 @@ Corrigido pets sendo indevidamente removido da DB ao realizar operações de ret
15 Maio 2019,
Revisado, via testes unitários, robustez dos registros/buscas de jogadores e fluidez do sistema de Party Search.
+18 - 19 Maio 2019,
+Corrigido glitch de inventário ao colocar itens no storage, problema que foi introduzido recentemente.
+Finalmente aprendido como funciona a mecânica por trás dos nodos "infoEx/infoNumber" amplamente usado pelas quests! :D
+Implementado sistema de "crescimento de itens" na fonte.
+
+20 - 24 Maio 2019,
+Ajustado "Party Search". Ao invés de expirar sessões de busca após N tentativas, líderes são colocados em espera por alguns minutos e podem voltar a buscar automaticamente mais tarde.
+Corrigido itens armazenados no Fredrick não sendo deletados ao deletar personagem, acarretando em inconsistências com cid inexistente.
+Corrigido livros de upgrade de skills stackados em quantidade maior que 1 não podendo ser utilizados.
+Nova ferramenta: MapleGachaponItemidRetriever. A ferramenta lê o arquivo-receita com nomes de itens designados para os diversos gachapons do jogo e, analisando a tabela da DB "handbook" (descrito pela ferramenta MapleIdRetriever), gera diversos arquivos (um para cada gachapon) contendo os ids dos itens especificados (ou próprio nome do item, se não encontrado).
+Revisado script itens da região de Mushroom Empire. Ao invés dos efeitos dos itens atuarem ao acessar portais, agora ao utilizar os próprios itens pelo inventário as regiões anteriormente inacessíveis se tornam exploráveis, seguindo a descrição dos mesmos.
+Revisado transições em 2 mapas da região de Mushroom Empire (um deles agora podendo ser atravessado ao utilizar um ETC, como previsto). Ambas transições projetadas para atuar após uso dos itens designados.
+Corrigido script "secretroom" sempre requerendo o ETC adquirido via questline, algo que tornava a área interna inacessível ao tentar fazê-la múltiplas vezes.
+Reelaborado completamente sistema de loots dos gachapons. Nova lista de loots de cada cidade disponível tenta seguir conteúdos encontrados na Web, supostamente legítimos (vide fontes mencionadas no fonte).
+Adicionado gachapons para El Nath e Ludibrium.
+Corrigido presença de PIN e PIC nulos (modificado para strings vazias).
+Corrigido skill "Monster Magnet" desconectando jogadores ao utilizá-la. Isso ocorria devido a um problema no lado-cliente ao "falhar" em capturar o mob. Nova skill foi remodelada para solucionar isso (além de MP e range, árvore de atributos varia por quantidade máxima de mobs).
+
26 Maio 2019,
-Normalizado comentários de créditos.
\ No newline at end of file
+Ajustado portal que acessa área do NPC Nein Spirit's Baby Dragon, para permitir acesso aos jogadores que concluem a rachadura do ovo, ao invés de somente após completar quest.
+Normalizado comentários de créditos.
+
+31 Maio 2019,
+Implementado método/comando que permite visualizar itens que podem ser ganhos pelo gachapons.
+Corrigido Mystic Doors crashando jogadores ao tentar cancelar o buff da skill excessivamente cedo.
+Corrigido tentativa de acessar boss Prime Minister acarretando em exceções de nulos ao tentar entrar em party.
+Corrigido evento de acesso ao boss Prime Minister não realizando disposes corretamente (assim que evento fica sem jogadores, após mudar de mapa, reviver, desconectar, etc).
+Refatorado estruturas de "ignored" e "monitored" dos comandos, agora utilizando conjuntos e checagem de inteiros ao invés de nomes.
+Refatorado referências aos métodos da família "startQuest" e "completeQuest", com funcionalidade repetida para diversas subclasses de AbstractPlayerInteraction.
+
+01 Junho 2019,
+Corrigido métodos de chegagem por espaço de inventários não avaliando corretamente quantidade de slots necessário para acomodar itens recarregáveis.
+Corrigido minigames não retirando referências dos jogadores devidamente, problema que veio a ocorrer após atualizações recentes.
+Implementado requisição de saída de minigames após fim de partida.
+Corrigido possibilidade de minigames entregando mais de um resultado cada partida (jogadores podem decidir desistir em conjunto, somando pontos).
+Corrigido negação de empate em minigame pelo outro jogador não permitindo o mesmo lançar um pedido de empate em sequência.
+
+02 - 03 Junho 2019,
+Tentativa de correção de mais casos de skill "Monster Magnet" desconectando jogadores ao utilizá-la (tentativa não foi bem-sucedida, mas apresenta resultados para bosses ou mobs fixos, mutuamente exclusivos).
+
+04 Junho 2019,
+Aprimorado sistema de update de buffs condicionais, não mais atualizando todos os buffs ao mudar de mapas.
+
+05 Junho 2019,
+Refatorado uso da DB pelo Duey. Itens registrados pelo Duey agora compartilham da mesma tabela de itens e equipamentos que os demais.
+Revisado levemente transação de itens pelas diversas interações disponíveis (trades, shops, Duey, até checagem de item ao anunciar pelo megafone), adotando uso das server flags.
+Corrigido caso de unlock não-encapsulado no hitLock de reatores.
+
+07 - 08 Junho 2019,
+Corrigido NPCs de cosméticos desconectando jogadores ao tentar mostrar ao jogador uma lista sem opções.
+Corrigido caso de deadlock ao realizar update de buffs durante transição de mapas.
+
+09 Junho 2019,
+Corrigido falhas na detecção de objetos dentro do alcançe de mob skills, código anterior levava em conta atributo "facingLeft" desnecessário para cálculo da área de efeito.
+Revisado sistema de aggro não mais retirando perseguição de boss sobre jogadores após expirar contagem de aggro.
+Refatorado checagem desnecessária por mapas onde itens não expiram (não havia efeito na checagem, itens expiráveis são determinados mais à frente com tempo de expiração máximo).
+Corrigido chalkboard removendo unidade do inventário ao usar (usa-se à vontade, por um curto período).
+Corrigido detecção de "mob virado para um lado" atuando incorretamente para mobs fixos não-viráveis (resultado deveria ser sempre a mesma orientação para esse caso).
+
+10 Junho 2019,
+Refatorado MapleMapFactory, buscando normalizar o padrão de design "Factory" que fora implementado inicialmente. Com a adição de novas funcionalidades o padrão implementado perdeu um pouco de sua coesão, agora revisado.
+Adicionado sistema de recuperação de MP para mobs, evitando assim possibilidade de mobs faltarem com MP em lutas muito longas.
+Adicionado no sistema de buff condicionais suporte para condicional de "caçando em grupo" (dois ou mais membros de grupo no mesmo mapa).
+Corrigido indisponibilidade de certos loots de mobs para jogadores que poderiam obter o mesmo mas que não fazem parte do grupo que lidou o golpe final (somente o grupo citado era levado em consideração).
+Corrigido loots one-of-a-kind se tornando indisponível uma vez que o jogador possui o mesmo em seu inventário.
+
+11 - 12 Junho 2019,
+Refatorado objeto construtor de intervalos para fora da classe encarregada com "Party Search", agora servindo como objeto de propósito-geral.
+Revisado sistema de distribuição de EXP, agora seguindo cálculos mais chegados ao GMS-like.
+
+13 Junho 2019,
+Ajustado novamente portal que acessa área do NPC Nein Spirit's Baby Dragon. Somente acessa a área quem completou a quest inicial do NPC.
+Ajustado interação com mapa do NPC Nein Spirit's Baby Dragon. Acesso à área é restrita para um jogador por vez, tempo limitado, e somente se o mesmo pode/já interagiu com o NPC.
+Normalizado uso de lobbyids em início de eventos nos scripts.
+
+15 Junho 2019,
+Corrigido limites de requisitos de nível para acessar expedições nos scripts de NPCs que as gerenciam.
diff --git a/docs/npcmarkups.txt b/docs/npcmarkups.txt
index 40b59731b0..fed88871ac 100644
--- a/docs/npcmarkups.txt
+++ b/docs/npcmarkups.txt
@@ -1,4 +1,4 @@
-Source: http://metropi.forumotion.net/t32-npc-scripting-guide-from-ragezone
+Source: http://forum.ragezone.com/f428/add-npc-scripting-605225/
NPC Markups:
#b = Blue text.
diff --git a/handbook/Equip/Weapon.txt b/handbook/Equip/Weapon.txt
index 1c0a089baa..cf013b98d5 100644
--- a/handbook/Equip/Weapon.txt
+++ b/handbook/Equip/Weapon.txt
@@ -402,7 +402,7 @@
1402044 - Pumpkin Lantern - (no description)
1402045 - Tiger's Fang - (no description)
1402046 - Timeless Nibleheim - (no description)
-1402048 - Raven's Wing - (no description)
+1402048 - Raven's Wing - (no description)
1402049 - Night Raven's Wing - (no description)
1402050 - Dawn Raven's Wing - (no description)
1402051 - Dusk Raven's Wing - (no description)
diff --git a/handbook/Use.txt b/handbook/Use.txt
index 6d47efaca2..37f96fee60 100644
--- a/handbook/Use.txt
+++ b/handbook/Use.txt
@@ -446,10 +446,10 @@
2040303 - Scroll for Earring for INT - Improves INT on ear accessory.\nSuccess rate:30%, magic attack +5, INT+3, magic def. +1
2040304 - Dark scroll for Earring for INT - Improves INT on ear accessory.\nSuccess rate:70%, magic attack +2, INT+1nIf failed, the item will be destroyed at a 50% rate.
2040305 - Dark scroll for Earring for INT - Improves INT on ear accessory.\nSuccess rate:30%, magic attack +5, INT+3, magic def. +1nIf failed, the item will be destroyed at a 50% rate.
-2040306 - Dark scroll for Earring for DEX - Improves DEX on ear accesrroy.\nSuccess rate: 70%. DEX + 2nIf failed, the item will be destroyed at a 50% rate.
+2040306 - Dark scroll for Earring for DEX - Improves DEX on ear accessory.\nSuccess rate: 70%. DEX + 2nIf failed, the item will be destroyed at a 50% rate.
2040307 - Dark scroll for Earring for DEX - Improves DEX on ear accessorynSuccess rate: 30%. DEX + 3nIf failed, the item will be destroyed at a 50% rate.
-2040308 - Dark Scroll for Earrings for DEF - Improves DEF on earringsnSuccess Rate 70%, weapon defense+1, magic defense+1nIf failed, the item will be destroyed at a 50% rate.
-2040309 - Dark Scroll for Earrings for DEF - Improves DEF on earringsnSuccess Rate 30%, weapon defense+3, magic defense+3, accuracy+1nIf failed, the item will be destroyed at a 50% rate.
+2040308 - Dark Scroll for Earring for DEF - Improves DEF on earringsnSuccess Rate 70%, weapon defense+1, magic defense+1nIf failed, the item will be destroyed at a 50% rate.
+2040309 - Dark Scroll for Earring for DEF - Improves DEF on earringsnSuccess Rate 30%, weapon defense+3, magic defense+3, accuracy+1nIf failed, the item will be destroyed at a 50% rate.
2040310 - Scroll for Earring for DEF - Improves DEF on earrings.\nSuccess Rate 10%, weapon defense+3, magic defense+3, Accuracy+1. The success rate of this scroll can be enhanced by Vega's Spell.
2040311 - Scroll for Earring for DEF - Improves DEF on earrings.\nSuccess Rate 60%, weapon defense+1, magic defense+1. The success rate of this scroll can be enhanced by Vega's Spell.
2040312 - Scroll for Earring for DEF - Improves DEF on earringsnSuccess Rate 100%, weapon defense+1
@@ -952,8 +952,8 @@
2070009 - Wooden Top - When thrown, it spins fast and flies at great speed. Once they are all used up, they need to be recharged.\nLevel Limit : 10, Attack + 19
2070010 - Icicle - Sharp icicles. Once they run out, they need to be recharged.rnLevel Limit : 10, Attack + 21
2070011 - Maple Throwing-Stars - Maple-shaped steel throwing-stars. Once they run out, they need to be recharged.rnLevel Limit : 10, Attack + 21
-2070012 - Paper Fighter Plane - A paper plane that can be thrown at things. Once they run out, they need to be recharged. Attack +20
-2070013 - Orange - A tasty orange that can be thrown at things. Attack + 20
+2070012 - Paper Fighter Plane - A paper plane that can be thrown at things. Once they run out, they need to be recharged.\nAttack +20
+2070013 - Orange - A tasty orange that can be thrown at things.\nAttack + 20
2070014 - Devil Rain Throwing Star - Throwing Star
2070015 - A Beginner Thief's Throwing Stars - These are steel throwing stars given by Dark Lord for Beginner Thieves. Unlike normal throwing stars, you can't recharge it. \nAttack + 15
2070016 - Crystal Ilbi Throwing-Stars - A throwing-star made of crystal. Once they run out, they need to be recharged. rnAttack + 29
@@ -1810,8 +1810,8 @@
2044812 - Scroll for Knuckles for ATT 15% - Improves ATT on Knuckles.\nSuccess Rate:15%, Weapon Att+5, STR+3, Weapon DEF+1
2044813 - Scroll for Knuckles for Accuracy 65% - Improves Accuracy on Knuckles.\nSuccess Rate:65%, Accuracy+3, DEX+2, Weapon Att+1
2044814 - Scroll for Knuckles for Accuracy 15% - Improves Accuracy on Knuckles.\nSuccess Rate:15%, Accuracy+5, DEX+3, Weapon Att+3
-2044906 - Gun ATT Scroll 65% - Improves ATT on guns.\nSuccess Rate:65%, Weapon Att.+2, Accuracy+1
-2044907 - Gun ATT Scroll 15% - Improves ATT on guns.\nSuccess Rate:15%, Weapon Att.+5, Accuracy+3, DEX+1
+2044906 - Scroll for Gun for ATT 65% - Improves ATT on guns.\nSuccess Rate:65%, Weapon Att.+2, Accuracy+1
+2044907 - Scroll for Gun for ATT 15% - Improves ATT on guns.\nSuccess Rate:15%, Weapon Att.+5, Accuracy+3, DEX+1
2049103 - Beach Sandals Scroll 100% - Used on limited-edition beach sandals, with the options of improving/decreasing the stats.\nSuccess rate:100%
2100073 - Mu Lung Dojo Summon Package3_Deo - Summon Deo
2100074 - Mu Lung Dojo Summon Package4_King Slime - Summon King Slime
@@ -2017,7 +2017,7 @@
2044015 - Scroll for Two-Handed Swords for ATT 10% - Improves ATT on Two-Handed Swords. nSuccess rate: 10%, Weapons ATT +5, STR +3, Weapons Defense +1
2049105 - [6th Anniversary] Dark Scroll for Gloves for ATT 70% - Improves ATT on Gloves. nSuccess rate: 70%, Weapons ATT +1nIf unsuccessful, item has a 50% chance of being destroyed.
2049106 - [6th Anniversary] Dark Scroll for Gloves for ATT 30% - Improves ATT on Gloves. nSucces rate: 30%, Weapons ATT +2nIf unsuccessful, item has an 80% chance of being destroyed.
-2049107 - [6th Anniversary] Dark Scroll for Gloves for STR 70% [ - Improves STR on Gloves. nSuccess rate: 70%, Accuracy +2, STR +1nIf unsuccessful, item has a 50% chance of being destroyed.
+2049107 - [6th Anniversary] Dark Scroll for Gloves for STR 70% - Improves STR on Gloves. nSuccess rate: 70%, Accuracy +2, STR +1nIf unsuccessful, item has a 50% chance of being destroyed.
2049108 - [6th Anniversary] Dark Scroll for Gloves for LUK 70% - Improves LUK on Gloves. nSuccess rate: 70%, Accuracy +2, LUK +1nIf unsuccessful, item has a 50% chance of being destroyed.
2049109 - [6th Anniversary] Dark Scroll for Gloves for INT 70% - Improves INT on Gloves. nSuccess rate: 70%, Accuracy +2, INT +1nIf unsuccessful, item has a 50% chance of being destroyed.
2049110 - [6th Anniversary] Dark Scroll for Gloves for DEX 70% - Improves DEX on Gloves. nSuccess rate: 70%, Accuracy +2, DEX +1nIf unsuccessful, item has a 50% chance of being destroyed.
diff --git a/scripts/event/MK_PrimeMinister.js b/scripts/event/MK_PrimeMinister.js
index 01ddf963f9..d29be7e5ed 100644
--- a/scripts/event/MK_PrimeMinister.js
+++ b/scripts/event/MK_PrimeMinister.js
@@ -86,29 +86,38 @@ function scheduledTimeout(eim){
eim.dispose();
}
-function playerRevive(eim, player){
- player.respawn(eim, entryMap);
- return false;
+function playerRevive(eim, player) { // player presses ok on the death pop up.
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
}
function playerDead(eim, player){}
function playerDisconnected(eim, player){
- var party = eim.getPlayers();
-
- for(var i = 0; i < party.size(); i++){
- if(party.get(i).equals(player))
- removePlayer(eim, player);
- else
- playerExit(eim, party.get(i));
- }
- eim.dispose();
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
}
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 leftParty(eim, player){}
function disbandParty(eim){}
@@ -120,8 +129,15 @@ function playerExit(eim, player){
player.changeMap(exitMap, 2);
}
-function changedMap(eim, chr, mapid) {
- if(mapid < minMapId || mapid > maxMapId) playerExit(eim, chr);
+function changedMap(eim, player, mapid) {
+ if (mapid < minMapId || mapid > maxMapId) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
+ }
}
function removePlayer(eim, player){
diff --git a/scripts/event/MK_PrimeMinister2.js b/scripts/event/MK_PrimeMinister2.js
index 7c31952e76..32e2788366 100644
--- a/scripts/event/MK_PrimeMinister2.js
+++ b/scripts/event/MK_PrimeMinister2.js
@@ -77,29 +77,38 @@ function scheduledTimeout(eim){
eim.dispose();
}
-function playerRevive(eim, player){
- player.respawn(eim, entryMap);
- return false;
+function playerRevive(eim, player) { // player presses ok on the death pop up.
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
}
function playerDead(eim, player){}
function playerDisconnected(eim, player){
- var party = eim.getPlayers();
-
- for(var i = 0; i < party.size(); i++){
- if(party.get(i).equals(player))
- removePlayer(eim, player);
- else
- playerExit(eim, party.get(i));
- }
- eim.dispose();
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
}
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 leftParty(eim, player){}
function disbandParty(eim){}
@@ -112,7 +121,14 @@ function playerExit(eim, player){
}
function changedMap(eim, chr, mapid) {
- if(mapid < minMapId || mapid > maxMapId) playerExit(eim, chr);
+ if (mapid < minMapId || mapid > maxMapId) {
+ if (eim.isEventTeamLackingNow(true, minPlayers, player)) {
+ eim.unregisterPlayer(player);
+ end(eim);
+ }
+ else
+ eim.unregisterPlayer(player);
+ }
}
function removePlayer(eim, player){
diff --git a/scripts/event/NineSpirit.js b/scripts/event/NineSpirit.js
new file mode 100644
index 0000000000..2b47f24e13
--- /dev/null
+++ b/scripts/event/NineSpirit.js
@@ -0,0 +1,105 @@
+var minPlayers = 1;
+var timeLimit = 5; //5 minutes
+var eventTimer = 1000 * 60 * timeLimit;
+var exitMap = 240040610;
+var eventMap = 240040611;
+
+var minMapId = 240040611;
+var maxMapId = 240040611;
+
+function init(){}
+
+function setup(difficulty, lobbyId){
+ var eim = em.newInstance("NineSpirit_" +lobbyId);
+ eim.getInstanceMap(eventMap).resetFully();
+ eim.getInstanceMap(eventMap).allowSummonState(false);
+ respawn(eim);
+ eim.startEventTimer(eventTimer);
+ return eim;
+}
+
+function afterSetup(eim){}
+
+function respawn(eim){}
+
+function playerEntry(eim, player){
+ var nest = eim.getMapInstance(eventMap);
+ if (!player.haveItem(4001094)) {
+ eim.spawnNpc(2081008, nest.getReactorById(2406000).getPosition(), nest);
+ }
+
+ player.changeMap(nest, 1);
+}
+
+function scheduledTimeout(eim){
+ var party = eim.getPlayers();
+
+ for(var i = 0; i < party.size(); i++)
+ playerExit(eim, party.get(i));
+
+ eim.dispose();
+}
+
+function playerRevive(eim, player){
+ player.respawn(eim, exitMap);
+ return false;
+}
+
+function playerDead(eim, player){}
+
+function playerDisconnected(eim, player){
+ var party = eim.getPlayers();
+
+ for(var i = 0; i < party.size(); i++){
+ if(party.get(i).equals(player))
+ removePlayer(eim, player);
+ else
+ playerExit(eim, party.get(i));
+ }
+ eim.dispose();
+}
+
+function monsterValue(eim, mobId){
+ return -1;
+}
+
+function leftParty(eim, player){}
+
+function disbandParty(eim){}
+
+function playerUnregistered(eim, player){}
+
+function playerExit(eim, player){
+ eim.unregisterPlayer(player);
+ player.changeMap(exitMap);
+}
+
+function changedMap(eim, chr, mapid){
+ if(mapid < minMapId || mapid > maxMapId){
+ removePlayer(eim, chr);
+ eim.stopEventTimer();
+ eim.setEventCleared();
+ eim.dispose();
+ }
+}
+
+function removePlayer(eim, player){
+ eim.unregisterPlayer(player);
+ player.getMap().removePlayer(player);
+ player.setMap(exitMap);
+}
+
+function cancelSchedule(){}
+
+function dispose(){}
+
+function clearPQ(eim){}
+
+function monsterKilled(mob, eim){}
+
+function allMonstersDead(eim){}
+
+// ---------- FILLER FUNCTIONS ----------
+
+function changedLeader(eim, leader) {}
+
diff --git a/scripts/event/Puppeteer.js b/scripts/event/Puppeteer.js
index 7ea0cd5bb4..35baa8c0dc 100644
--- a/scripts/event/Puppeteer.js
+++ b/scripts/event/Puppeteer.js
@@ -4,6 +4,9 @@ var eventTimer = 1000 * 60 * timeLimit;
var exitMap = 105070300;
var eventMap = 910510000;
+var minMapId = 910510000;
+var maxMapId = 910510000;
+
function init(){}
function setup(difficulty, lobbyId){
@@ -67,9 +70,9 @@ function playerExit(eim, player){
player.changeMap(exitMap);
}
-function changedMap(eim, player){
- if(player.getMap().getId() < eventMap || player.getMap().getId() > next){
- removePlayer(eim, player);
+function changedMap(eim, chr, mapid){
+ if(mapid < minMapId || mapid > maxMapId){
+ removePlayer(eim, chr);
eim.stopEventTimer();
eim.setEventCleared();
eim.dispose();
diff --git a/scripts/item/killarmush.js b/scripts/item/killarmush.js
new file mode 100644
index 0000000000..bb676f4a2f
--- /dev/null
+++ b/scripts/item/killarmush.js
@@ -0,0 +1,55 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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) {
+ im.dispose();
+ } else {
+ if (mode == 0 && type > 0) {
+ im.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if (im.getMapId() == 106020300) {
+ var portal = im.getMap().getPortal("obstacle");
+ if (portal != null && portal.getPosition().distance(im.getPlayer().getPosition()) < 210) {
+ if(!(im.isQuestStarted(100202) || im.isQuestCompleted(100202))) im.startQuest(100202);
+ im.removeAll(2430014);
+
+ im.message("You have used the Killer Mushroom Spore to open the way.");
+ }
+ }
+
+ im.dispose();
+ }
+ }
+}
diff --git a/scripts/item/openTreasure.txt b/scripts/item/openTreasure.txt
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/scripts/item/removethorns.js b/scripts/item/removethorns.js
new file mode 100644
index 0000000000..aaec889080
--- /dev/null
+++ b/scripts/item/removethorns.js
@@ -0,0 +1,58 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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) {
+ im.dispose();
+ } else {
+ if (mode == 0 && type > 0) {
+ im.dispose();
+ return;
+ }
+ if (mode == 1)
+ status++;
+ else
+ status--;
+
+ if(status == 0) {
+ if (im.getMapId() == 106020400 && im.isQuestActive(2324)) {
+ var player = im.getPlayer();
+
+ var portal = im.getMap().getPortal("right00");
+ if (portal != null && portal.getPosition().distance(player.getPosition()) < 210) {
+ player.gainExp(3300 * player.getExpRate());
+
+ im.forceCompleteQuest(2324);
+ im.removeAll(2430015);
+ im.playerMessage(5, "You have used the Thorn Remover to clear the path.");
+ }
+ }
+
+ im.dispose();
+ }
+ }
+}
diff --git a/scripts/npc/1061014.js b/scripts/npc/1061014.js
index 0ce5d45458..545218e1e1 100644
--- a/scripts/npc/1061014.js
+++ b/scripts/npc/1061014.js
@@ -58,7 +58,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/1300013.js b/scripts/npc/1300013.js
index e2c1aca7d6..29bd5ec7c8 100644
--- a/scripts/npc/1300013.js
+++ b/scripts/npc/1300013.js
@@ -48,7 +48,7 @@ function action(mode, type, selection){
var party = cm.getPlayer().getParty();
if (party != null) {
- if (!em.startInstance(party, cm.getMap())) {
+ if (!em.startInstance(party, cm.getMap(), 1)) {
cm.sendOk("Another party is already challenging the boss in this channel.");
}
} else {
diff --git a/scripts/npc/2030008.js b/scripts/npc/2030008.js
index c836e0234d..9a5429bf7a 100644
--- a/scripts/npc/2030008.js
+++ b/scripts/npc/2030008.js
@@ -59,7 +59,12 @@ function action(mode, type, selection) {
}
if(!(cm.isQuestStarted(100200) || cm.isQuestCompleted(100200))) { // thanks Vcoc for finding out a need of reapproval from the masters for Zakum expeditions
- cm.sendOk("Beware, for the power of olde has not been forgotten... ");
+ if (cm.getPlayer().getLevel() >= 50) { // thanks Z1peR for noticing not-so-clear unmet requirements message here.
+ cm.sendOk("Beware, for the power of olde has not been forgotten... If you seek to defeat #rZakum#k someday, earn the #bChief's Residence Council#k approval foremost and then #bface the trials#k, only then you will become eligible to fight.");
+ } else {
+ cm.sendOk("Beware, for the power of olde has not been forgotten...");
+ }
+
cm.dispose();
return;
}
diff --git a/scripts/npc/2030013.js b/scripts/npc/2030013.js
index db793791d9..d62e8f1ee2 100644
--- a/scripts/npc/2030013.js
+++ b/scripts/npc/2030013.js
@@ -59,7 +59,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/2082014_script.js b/scripts/npc/2082014.js
similarity index 71%
rename from scripts/npc/2082014_script.js
rename to scripts/npc/2082014.js
index b15e251c2b..1ad06b94b2 100644
--- a/scripts/npc/2082014_script.js
+++ b/scripts/npc/2082014.js
@@ -39,7 +39,14 @@ function action(mode, type, selection) {
status--;
if(status == 0) {
- cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission.");
+ if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
+ cm.openShopNPC(2082014);
+ } else if (cm.isQuestStarted(3749)) {
+ cm.sendOk("We've already located the enemy's ultimate weapon! Follow along the ship's bow area ahead and you will find my sister #b#p2082013##k. Report to her for futher instructions on the mission.");
+ } else {
+ cm.sendDefault();
+ }
+
cm.dispose();
}
}
diff --git a/scripts/npc/2083004.js b/scripts/npc/2083004.js
index c8bb6c0190..b0501ee64d 100644
--- a/scripts/npc/2083004.js
+++ b/scripts/npc/2083004.js
@@ -57,7 +57,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/2141001.js b/scripts/npc/2141001.js
index 77bbe35f65..12bdba353a 100644
--- a/scripts/npc/2141001.js
+++ b/scripts/npc/2141001.js
@@ -60,7 +60,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/9120201.js b/scripts/npc/9120201.js
index ac660b742d..fd201e1de3 100644
--- a/scripts/npc/9120201.js
+++ b/scripts/npc/9120201.js
@@ -58,7 +58,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/9201101.js b/scripts/npc/9201101.js
index da8f052d3e..c2fecb4580 100644
--- a/scripts/npc/9201101.js
+++ b/scripts/npc/9201101.js
@@ -4,11 +4,12 @@
*/
function start() {
- if(Packages.server.MapleShopFactory.getInstance().getShop(9201101) != null) {
+ if (Packages.constants.ServerConstants.USE_ENABLE_CUSTOM_NPC_SCRIPT) {
cm.openShopNPC(9201101);
} else {
- cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city.");
+ //cm.sendOk("The patrol in New Leaf City is always ready. No creatures are able to break through to the city.");
+ cm.sendDefault();
}
-
+
cm.dispose();
}
diff --git a/scripts/npc/9201113.js b/scripts/npc/9201113.js
index 67f6147b29..fa7b31b743 100644
--- a/scripts/npc/9201113.js
+++ b/scripts/npc/9201113.js
@@ -54,7 +54,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < cwkpq.getMinLevel() && player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < cwkpq.getMinLevel() || player.getLevel() > cwkpq.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to take attempt Crimsonwood Keep Party Quest!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/9270047.js b/scripts/npc/9270047.js
index 1f1a745553..a660524100 100644
--- a/scripts/npc/9270047.js
+++ b/scripts/npc/9270047.js
@@ -59,7 +59,7 @@ function action(mode, type, selection) {
}
if (status == 0) {
- if (player.getLevel() < exped.getMinLevel() && player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement
+ if (player.getLevel() < exped.getMinLevel() || player.getLevel() > exped.getMaxLevel()) { //Don't fit requirement, thanks Conrad
cm.sendOk("You do not meet the criteria to battle " + expedBoss + "!");
cm.dispose();
} else if (expedition == null) { //Start an expedition
diff --git a/scripts/npc/9977777.js b/scripts/npc/9977777.js
index 46f94db9e2..e07fedd126 100644
--- a/scripts/npc/9977777.js
+++ b/scripts/npc/9977777.js
@@ -60,6 +60,7 @@ function writeFeatureTab_Skills() {
addFeature("Maker skill features properly developed.");
addFeature("Chair Mastery - map chair boosts HP/MP rec.");
addFeature("Mu Lung Dojo skills functional.");
+ addFeature("Monster Magnet skill no longer crashes players.");
}
function writeFeatureTab_Quests() {
@@ -72,6 +73,7 @@ function writeFeatureTab_Quests() {
addFeature("Reviewed several 4th job skill questlines.");
addFeature("Rewarding system now looks up for item stacking.");
addFeature("3rd job quiz with all 40-question pool available.");
+ addFeature("Item raising functional.");
}
function writeFeatureTab_PlayerSocialNetwork() {
@@ -113,6 +115,7 @@ function writeFeatureTab_CashItems() {
addFeature("Reviewed an pet position issue within CASH inventory.");
addFeature("Reviewed fashion-related contents, almost GMS-like.");
addFeature("Plastic surgeons/stylists no longer stuck characters.");
+ addFeature("Reworked gachapon loots, website-lists lookalike.");
addFeature("Scroll for Spikes on Shoes.");
addFeature("Scroll for Cold Protection.");
addFeature("Vega's spell.");
diff --git a/scripts/npc/gachapon.js b/scripts/npc/gachapon.js
index a83e4c8661..5913301043 100644
--- a/scripts/npc/gachapon.js
+++ b/scripts/npc/gachapon.js
@@ -26,12 +26,12 @@
var status;
var ticketId = 5220000;
-var mapName = ["Henesys", "Ellinia", "Perion", "Kerning City", "Sleepywood", "Mushroom Shrine", "Showa Spa (M)", "Showa Spa (F)", "New Leaf City", "Nautilus"];
+var mapName = ["Henesys", "Ellinia", "Perion", "Kerning City", "Sleepywood", "Mushroom Shrine", "Showa Spa (M)", "Showa Spa (F)", "Ludibrium", "New Leaf City", "El Nath", "Nautilus"];
var curMapName = "";
function start() {
status = -1;
- curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 8 : 9];
+ curMapName = mapName[(cm.getNpc() != 9100117 && cm.getNpc() != 9100109) ? (cm.getNpc() - 9100100) : cm.getNpc() == 9100109 ? 9 : 11];
action(1, 0, 0);
}
diff --git a/scripts/npc/gachaponInfo.js b/scripts/npc/gachaponInfo.js
new file mode 100644
index 0000000000..9b1aeccc1f
--- /dev/null
+++ b/scripts/npc/gachaponInfo.js
@@ -0,0 +1,60 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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: Pio
+ * @func: Gachapon Loot Announcer
+*/
+
+var status;
+var gachaMessages;
+
+function start() {
+ gachaMessages = Packages.server.gachapon.MapleGachapon.Gachapon.getLootInfo();
+ gachas = Packages.server.gachapon.MapleGachapon.Gachapon.values();
+
+ 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) {
+ var sendStr = "Hi, #r#p" + cm.getNpc() + "##k here! I'm announcing all obtainable loots from the Gachapons. Which Gachapon machine would you like to look?\r\n\r\n#b" + gachaMessages[0] + "#k";
+ cm.sendSimple(sendStr);
+ } else if(status == 1) {
+ var sendStr = "Loots from #b" + gachas[selection].name() + "#k:\r\n\r\n" + gachaMessages[selection + 1];
+ cm.sendPrev(sendStr);
+ } else if(status == 2) {
+ cm.dispose();
+ }
+ }
+}
\ No newline at end of file
diff --git a/scripts/portal/TD_MC_enterboss2.js b/scripts/portal/TD_MC_enterboss2.js
index be984738d4..de76ba2802 100644
--- a/scripts/portal/TD_MC_enterboss2.js
+++ b/scripts/portal/TD_MC_enterboss2.js
@@ -22,17 +22,20 @@ function enter(pi) {
else if(pi.isQuestStarted(2332) && pi.hasItem(4032388)){
pi.forceCompleteQuest(2332, 1300002);
pi.getPlayer().message("You've found the princess!");
- pi.giveCharacterExp(4400 * 1.5, pi.getPlayer());
+ pi.giveCharacterExp(4400, pi.getPlayer());
var em = pi.getEventManager("MK_PrimeMinister");
var party = pi.getPlayer().getParty();
if (party != null) {
- if (em.startInstance(party, pi.getMap())) {
- pi.playPortalSound();
- return true;
- } else {
- pi.message("Another party is already challenging the boss in this channel.");
- return false;
+ var eli = em.getEligibleParty(pi.getParty()); // thanks Conrad for pointing out missing eligible party declaration here
+ if(eli.size() > 0) {
+ if (em.startInstance(party, pi.getMap(), 1)) {
+ pi.playPortalSound();
+ return true;
+ } else {
+ pi.message("Another party is already challenging the boss in this channel.");
+ return false;
+ }
}
} else {
if (em.startInstance(pi.getPlayer())) { // thanks RedHat for noticing an issue here
@@ -49,12 +52,15 @@ function enter(pi) {
var party = pi.getPlayer().getParty();
if (party != null) {
- if (em.startInstance(1, party, pi.getMap())) {
- pi.playPortalSound();
- return true;
- } else {
- pi.message("Another party is already challenging the boss in this channel.");
- return false;
+ var eli = em.getEligibleParty(pi.getParty());
+ if(eli.size() > 0) {
+ if (em.startInstance(party, pi.getMap(), 1)) {
+ pi.playPortalSound();
+ return true;
+ } else {
+ pi.message("Another party is already challenging the boss in this channel.");
+ return false;
+ }
}
} else {
if (em.startInstance(pi.getPlayer())) {
diff --git a/scripts/portal/dragonNest.js b/scripts/portal/dragonNest.js
index 98c0285d21..db3f4b75bd 100644
--- a/scripts/portal/dragonNest.js
+++ b/scripts/portal/dragonNest.js
@@ -20,11 +20,20 @@
along with this program. If not, see .
*/
function enter(pi) {
- if(!pi.isQuestCompleted(3706)) {
- pi.playPortalSound(); pi.warp(240040611, "out00");
+ if (pi.isQuestCompleted(3706)) {
+ pi.playPortalSound(); pi.warp(240040612, "out00");
+ return true;
+ } else if (pi.isQuestStarted(100203) || pi.getPlayer().haveItem(4001094)) {
+ var em = pi.getEventManager("NineSpirit");
+ if (!em.startInstance(pi.getPlayer())) {
+ pi.message("There is currently someone in this map, come back later.");
+ return false;
} else {
- pi.playPortalSound(); pi.warp(240040612, "out00");
+ pi.playPortalSound();
+ return true;
}
-
- return true;
+ } else {
+ pi.message("A strange force is blocking you from entering.");
+ return false;
+ }
}
\ No newline at end of file
diff --git a/scripts/portal/go_secretroom.js b/scripts/portal/go_secretroom.js
index cd87306ea9..e8c99de379 100644
--- a/scripts/portal/go_secretroom.js
+++ b/scripts/portal/go_secretroom.js
@@ -1,13 +1,12 @@
function enter(pi) {
-
- if(!pi.isQuestStarted(2335) || (pi.isQuestStarted(2335) && !pi.hasItem(4032405))){
+ if(!pi.isQuestCompleted(2335) && !(pi.isQuestStarted(2335) && pi.hasItem(4032405))){
pi.getPlayer().message("The door is locked securely. I will need a key if I want to go in there.");
return false;
}
- if(pi.isQuestStarted(2335) && pi.hasItem(4032405)){
+ if(pi.isQuestStarted(2335)){
pi.forceCompleteQuest(2335, 1300002);
- pi.giveCharacterExp(5000 * 1.5, pi.getPlayer());
+ pi.giveCharacterExp(5000, pi.getPlayer());
pi.gainItem(4032405, -1);
}
pi.playPortalSound();
diff --git a/scripts/portal/gotocastle.js b/scripts/portal/gotocastle.js
index c705ef85a4..a4603d74da 100644
--- a/scripts/portal/gotocastle.js
+++ b/scripts/portal/gotocastle.js
@@ -1,12 +1,9 @@
function enter(pi) {
- if (pi.isQuestActive(2324)) {
- var player = pi.getPlayer();
- player.gainExp(3300 * player.getExpRate());
-
- pi.forceCompleteQuest(2324);
- pi.removeAll(2430015);
- pi.playerMessage(5, "You have used the Thorn Remover to clear the path.");
- }
- pi.playPortalSound(); pi.warp(106020501,0);
- return true;
+ if (pi.isQuestCompleted(2324)) {
+ pi.playPortalSound(); pi.warp(106020501,0);
+ return true;
+ } else {
+ pi.playerMessage(5, "The path ahead is covered with sprawling vine thorns, only a Thorn Remover to clear this out...");
+ return false;
+ }
}
\ No newline at end of file
diff --git a/scripts/portal/obstacle.js b/scripts/portal/obstacle.js
index cf2f265716..6a0b0476ae 100644
--- a/scripts/portal/obstacle.js
+++ b/scripts/portal/obstacle.js
@@ -5,17 +5,12 @@
*/
function enter(pi){
- if (pi.isQuestCompleted(2316)) {
- if (pi.hasItem(2430014)) {
- pi.gainItem(2430014, -1 * pi.getPlayer().getItemQuantity(2430014, false));
- pi.message("You have used the Killer Mushroom Spore to open the way.");
- }
-
+ if (pi.isQuestStarted(100202)) {
pi.playPortalSound(); pi.warp(106020400, 2);
return true;
- } else if (pi.hasItem(2430015)) {
- pi.gainItem(2430015, -1 * pi.getPlayer().getItemQuantity(2430015, false));
- pi.message("You have used the Thorn Remover to clean the way.");
+ } else if (pi.hasItem(4000507)) {
+ pi.gainItem(4000507, -1);
+ pi.message("You have used a Poison Spore to pass through the barrier.");
pi.playPortalSound(); pi.warp(106020400, 2);
return true;
diff --git a/scripts/quest/2332.js b/scripts/quest/2332.js
index 432a2f9858..ad81c409a6 100644
--- a/scripts/quest/2332.js
+++ b/scripts/quest/2332.js
@@ -8,7 +8,7 @@ var status = -1;
function start(mode, type, selection){
if(qm.hasItem(4032388) && !qm.isQuestStarted(2332)){
qm.forceStartQuest();
- qm.getPlayer().showHint("I must find Violetta. (quest started)");
+ qm.getPlayer().showHint("I must find Violetta!! (#bquest started#k)");
}
qm.dispose();
}
diff --git a/scripts/reactor/2406000.js b/scripts/reactor/2406000.js
index b2827ae5e6..2297187d04 100644
--- a/scripts/reactor/2406000.js
+++ b/scripts/reactor/2406000.js
@@ -3,9 +3,9 @@ Dragon nest
*/
function sendToHeaven() {
- rm.destroyNpc(2081008);
- rm.mapMessage(6, "In a flicker of light, Nine Spirit's Little Dragon returns to the place it belongs, high above the skies.");
- rm.getReactor().getMap().resetReactors();
+ rm.spawnNpc(2081008);
+ rm.startQuest(100203);
+ rm.mapMessage(6, "In a flicker of light the egg has matured and cracked, thus born a radiant baby dragon.");
}
function touch() {
@@ -18,6 +18,5 @@ function touch() {
function untouch() {}
function act() {
- rm.spawnNpc(2081008);
- rm.schedule("sendToHeaven", 12 * 1000);
+ sendToHeaven(); // thanks Conrad for pointing out the GMS-like way of Nine Spirit's Nest
}
\ No newline at end of file
diff --git a/sql/db_database.sql b/sql/db_database.sql
index 05b2fdae1d..857857152e 100644
--- a/sql/db_database.sql
+++ b/sql/db_database.sql
@@ -16,8 +16,8 @@ CREATE TABLE IF NOT EXISTS `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(13) NOT NULL DEFAULT '',
`password` varchar(128) NOT NULL DEFAULT '',
- `pin` varchar(10) DEFAULT NULL,
- `pic` varchar(26) DEFAULT NULL,
+ `pin` varchar(10) NOT NULL DEFAULT '',
+ `pic` varchar(26) NOT NULL DEFAULT '',
`loggedin` tinyint(4) NOT NULL DEFAULT '0',
`lastlogin` timestamp NULL DEFAULT NULL,
`createdat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -9474,7 +9474,7 @@ INSERT IGNORE INTO `temp_data` (`dropperid`, `itemid`, `minimum_quantity`, `maxi
(3300001, 4130009, 1, 1, 0, 6000),
(3300001, 4130021, 1, 1, 0, 6000),
(3300001, 4000500, 1, 1, 0, 600000),
-(3300001, 4000507, 1, 1, 0, 600000),
+(3300001, 4000507, 1, 1, 0, 100000),
(3300001, 2044024, 1, 1, 0, 300),
(3300001, 2044116, 1, 1, 0, 300),
(3300001, 2382093, 1, 1, 0, 20000),
@@ -12800,30 +12800,9 @@ INSERT INTO `drop_data_global` (`id`, `continent`, `itemid`, `minimum_quantity`,
CREATE TABLE IF NOT EXISTS `dueyitems` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`PackageId` int(10) unsigned NOT NULL DEFAULT '0',
- `itemid` int(10) unsigned NOT NULL DEFAULT '0',
- `quantity` int(10) unsigned NOT NULL DEFAULT '0',
- `upgradeslots` int(11) DEFAULT '0',
- `level` int(11) DEFAULT '0',
- `itemlevel` int(11) DEFAULT '0',
- `itemexp` int(11) DEFAULT '0',
- `str` int(11) DEFAULT '0',
- `dex` int(11) DEFAULT '0',
- `int` int(11) DEFAULT '0',
- `luk` int(11) DEFAULT '0',
- `hp` int(11) DEFAULT '0',
- `mp` int(11) DEFAULT '0',
- `watk` int(11) DEFAULT '0',
- `matk` int(11) DEFAULT '0',
- `wdef` int(11) DEFAULT '0',
- `mdef` int(11) DEFAULT '0',
- `acc` int(11) DEFAULT '0',
- `avoid` int(11) DEFAULT '0',
- `hands` int(11) DEFAULT '0',
- `speed` int(11) DEFAULT '0',
- `jump` int(11) DEFAULT '0',
- `flag` int(11) DEFAULT '0',
- `owner` varchar(13) DEFAULT NULL,
+ `inventoryitemid` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
+ KEY `INVENTORYITEMID` (`inventoryitemid`),
KEY `PackageId` (`PackageId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
@@ -12833,8 +12812,8 @@ CREATE TABLE IF NOT EXISTS `dueypackages` (
`SenderName` varchar(13) NOT NULL,
`Mesos` int(10) unsigned DEFAULT '0',
`TimeStamp` varchar(10) NOT NULL,
+ `Message` varchar(200) NOT NULL DEFAULT "",
`Checked` tinyint(1) unsigned DEFAULT '1',
- `Type` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`PackageId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
@@ -12909,33 +12888,6 @@ CREATE TABLE IF NOT EXISTS `guilds` (
INDEX (guildid, name)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-CREATE TABLE IF NOT EXISTS `hiredmerchant` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `ownerid` int(11) DEFAULT '0',
- `itemid` int(10) unsigned NOT NULL DEFAULT '0',
- `quantity` int(10) unsigned NOT NULL DEFAULT '0',
- `upgradeslots` int(11) DEFAULT '0',
- `level` int(11) DEFAULT '0',
- `str` int(11) DEFAULT '0',
- `dex` int(11) DEFAULT '0',
- `int` int(11) DEFAULT '0',
- `luk` int(11) DEFAULT '0',
- `hp` int(11) DEFAULT '0',
- `mp` int(11) DEFAULT '0',
- `watk` int(11) DEFAULT '0',
- `matk` int(11) DEFAULT '0',
- `wdef` int(11) DEFAULT '0',
- `mdef` int(11) DEFAULT '0',
- `acc` int(11) DEFAULT '0',
- `avoid` int(11) DEFAULT '0',
- `hands` int(11) DEFAULT '0',
- `speed` int(11) DEFAULT '0',
- `jump` int(11) DEFAULT '0',
- `owner` varchar(13) DEFAULT '',
- `type` tinyint(1) unsigned NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-
CREATE TABLE IF NOT EXISTS `hwidaccounts` (
`accountid` int(11) NOT NULL DEFAULT '0',
`hwid` varchar(40) NOT NULL DEFAULT '',
diff --git a/sql/db_drops.sql b/sql/db_drops.sql
index 67d0abe1b9..568041c086 100644
--- a/sql/db_drops.sql
+++ b/sql/db_drops.sql
@@ -2751,7 +2751,7 @@ USE `heavenms`;
(3300000, 1082046, 1, 1, 0, 700),
(3300000, 1002622, 1, 1, 0, 700),
(3300001, 4000500, 1, 1, 0, 200000),
-(3300001, 4000507, 1, 1, 0, 200000),
+(3300001, 4000507, 1, 1, 0, 100000),
(3300001, 4130021, 1, 1, 0, 3000),
(3300001, 2382093, 1, 1, 0, 20000),
(3300001, 2044701, 1, 1, 0, 750),
diff --git a/sql/db_shopupdate.sql b/sql/db_shopupdate.sql
index 1e2c7bcb42..4766373811 100644
--- a/sql/db_shopupdate.sql
+++ b/sql/db_shopupdate.sql
@@ -182,80 +182,81 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
(1337, 2100003, 1, 9),
(1337, 2100002, 1, 10),
(1337, 2100001, 1, 11),
-(1337, 1002140, 1, 12),
-(1337, 1042003, 1, 13),
-(1337, 1062007, 1, 14),
-(1337, 1322013, 1, 15),
-(1337, 1072010, 1, 16),
-(1337, 2022179, 1, 17),
-(1337, 2022273, 1, 18),
-(1337, 2041200, 1, 19),
-(1337, 4006001, 1, 20),
-(1337, 4001017, 1, 21),
-(1337, 4031179, 1, 22),
-(1337, 2070018, 1, 23),
-(1337, 2060004, 1, 24),
-(1337, 2061004, 1, 25),
-(1337, 2330005, 1, 26),
-(1337, 2332000, 1, 27),
-(1337, 2331000, 1, 28),
-(1337, 5072000, 1, 29),
-(1337, 5390000, 1, 30),
-(1337, 5390001, 1, 31),
-(1337, 5390002, 1, 32),
-(1337, 5390005, 1, 33),
-(1337, 5390006, 1, 34),
-(1337, 1492013, 1, 35),
-(1337, 1482013, 1, 36),
-(1337, 1452044, 1, 37),
-(1337, 1472052, 1, 38),
-(1337, 1462039, 1, 39),
-(1337, 1332050, 1, 40),
-(1337, 1312031, 1, 41),
-(1337, 1322052, 1, 42),
-(1337, 1302059, 1, 43),
-(1337, 1442045, 1, 44),
-(1337, 1432038, 1, 45),
-(1337, 1382036, 1, 46),
-(1337, 1412026, 1, 47),
-(1337, 1422028, 1, 48),
-(1337, 1402036, 1, 49),
-(1337, 1372032, 1, 50),
-(1337, 1122000, 1, 51),
-(1337, 1082149, 1, 52),
-(1337, 1912000, 1, 53),
-(1337, 1902000, 1, 54),
-(1337, 1902001, 1, 55),
-(1337, 1902002, 1, 56),
-(1337, 1912005, 1, 57),
-(1337, 1902005, 1, 58),
-(1337, 1902006, 1, 59),
-(1337, 1902007, 1, 60),
-(1337, 1912011, 1, 61),
-(1337, 1902015, 1, 62),
-(1337, 1902016, 1, 63),
-(1337, 1902017, 1, 64),
-(1337, 1902018, 1, 65),
-(1337, 2044908, 1, 66),
-(1337, 2044815, 1, 67),
-(1337, 2044512, 1, 68),
-(1337, 2044712, 1, 69),
-(1337, 2044612, 1, 70),
-(1337, 2043312, 1, 71),
-(1337, 2043117, 1, 72),
-(1337, 2043217, 1, 73),
-(1337, 2043023, 1, 74),
-(1337, 2044417, 1, 75),
-(1337, 2044317, 1, 76),
-(1337, 2043812, 1, 77),
-(1337, 2044117, 1, 78),
-(1337, 2044217, 1, 79),
-(1337, 2044025, 1, 80),
-(1337, 2043712, 1, 81),
-(1337, 2340000, 1, 82),
-(1337, 2040807, 1, 83),
-(1337, 2210032, 1, 84),
-(1337, 2050004, 1, 85);
+(1337, 1002959, 1, 12),
+(1337, 1002140, 1, 13),
+(1337, 1042003, 1, 14),
+(1337, 1062007, 1, 15),
+(1337, 1322013, 1, 16),
+(1337, 1072010, 1, 17),
+(1337, 2022179, 1, 18),
+(1337, 2022273, 1, 19),
+(1337, 2041200, 1, 20),
+(1337, 4006001, 1, 21),
+(1337, 4001017, 1, 22),
+(1337, 4031179, 1, 23),
+(1337, 2070018, 1, 24),
+(1337, 2060004, 1, 25),
+(1337, 2061004, 1, 26),
+(1337, 2330005, 1, 27),
+(1337, 2332000, 1, 28),
+(1337, 2331000, 1, 29),
+(1337, 5072000, 1, 30),
+(1337, 5390000, 1, 31),
+(1337, 5390001, 1, 32),
+(1337, 5390002, 1, 33),
+(1337, 5390005, 1, 34),
+(1337, 5390006, 1, 35),
+(1337, 1492013, 1, 36),
+(1337, 1482013, 1, 37),
+(1337, 1452044, 1, 38),
+(1337, 1472052, 1, 39),
+(1337, 1462039, 1, 40),
+(1337, 1332050, 1, 41),
+(1337, 1312031, 1, 42),
+(1337, 1322052, 1, 43),
+(1337, 1302059, 1, 44),
+(1337, 1442045, 1, 45),
+(1337, 1432038, 1, 46),
+(1337, 1382036, 1, 47),
+(1337, 1412026, 1, 48),
+(1337, 1422028, 1, 49),
+(1337, 1402036, 1, 50),
+(1337, 1372032, 1, 51),
+(1337, 1122000, 1, 52),
+(1337, 1082149, 1, 53),
+(1337, 1912000, 1, 54),
+(1337, 1902000, 1, 55),
+(1337, 1902001, 1, 56),
+(1337, 1902002, 1, 57),
+(1337, 1912005, 1, 58),
+(1337, 1902005, 1, 59),
+(1337, 1902006, 1, 60),
+(1337, 1902007, 1, 61),
+(1337, 1912011, 1, 62),
+(1337, 1902015, 1, 63),
+(1337, 1902016, 1, 64),
+(1337, 1902017, 1, 65),
+(1337, 1902018, 1, 66),
+(1337, 2044908, 1, 67),
+(1337, 2044815, 1, 68),
+(1337, 2044512, 1, 69),
+(1337, 2044712, 1, 70),
+(1337, 2044612, 1, 71),
+(1337, 2043312, 1, 72),
+(1337, 2043117, 1, 73),
+(1337, 2043217, 1, 74),
+(1337, 2043023, 1, 75),
+(1337, 2044417, 1, 76),
+(1337, 2044317, 1, 77),
+(1337, 2043812, 1, 78),
+(1337, 2044117, 1, 79),
+(1337, 2044217, 1, 80),
+(1337, 2044025, 1, 81),
+(1337, 2043712, 1, 82),
+(1337, 2340000, 1, 83),
+(1337, 2040807, 1, 84),
+(1337, 2210032, 1, 85),
+(1337, 2050004, 1, 86);
-- Thanks to DietStory v1.02 dev team
INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `pitch`, `position`) VALUES
diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java
index 906d02c5b2..9c52ef0594 100644
--- a/src/client/MapleCharacter.java
+++ b/src/client/MapleCharacter.java
@@ -84,13 +84,12 @@ import server.events.gm.MapleFitness;
import server.events.gm.MapleOla;
import server.life.MapleMonster;
import server.life.MobSkill;
-import server.loot.MapleLootManager;
import server.maps.MapleHiredMerchant;
import server.maps.MapleDoor;
import server.maps.MapleDragon;
import server.maps.MapleMap;
import server.maps.MapleMapEffect;
-import server.maps.MapleMapFactory;
+import server.maps.MapleMapManager;
import server.maps.MapleMapObject;
import server.maps.MapleMapObjectType;
import server.maps.MapleMiniGame;
@@ -206,7 +205,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
private transient int localstr, localdex, localluk, localint_, localmagic, localwatk;
private transient int equipmaxhp, equipmaxmp, equipstr, equipdex, equipluk, equipint_, equipmagic, equipwatk, localchairhp, localchairmp;
private int localchairrate;
- private boolean hidden, equipchanged = true, canDoor = true, berserk, hasMerchant, hasSandboxItem = false, whiteChat = false, canRecvPartySearchInvite = true;
+ private boolean hidden, equipchanged = true, berserk, hasMerchant, hasSandboxItem = false, whiteChat = false, canRecvPartySearchInvite = true;
private boolean equippedMesoMagnet = false, equippedItemPouch = false, equippedPetItemIgnore = false;
private int linkedLevel = 0;
private String linkedName = null;
@@ -961,7 +960,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
public boolean canDoor() {
- return canDoor;
+ MapleDoor door = getPlayerDoor();
+ return door == null || (door.isActive() && door.getElapsedDeployTime() > 5000);
}
public void setHasSandboxItem() {
@@ -2297,6 +2297,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
deleteQuestProgressWhereCharacterId(con, cid);
+ FredrickProcessor.removeFredrickLog(cid); // thanks maple006 for pointing out the player's Fredrick items are not being deleted at character deletion
try (PreparedStatement ps = con.prepareStatement("SELECT id FROM mts_cart WHERE cid = ?")) {
ps.setInt(1, cid);
@@ -2521,19 +2522,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}, healInterval, healInterval);
}
- public void disableDoorSpawn() {
- canDoor = false;
-
- Runnable r = new Runnable() {
- @Override
- public void run() {
- canDoor = true;
- }
- };
-
- client.getChannelServer().registerOverallAction(mapid, r, 5000);
- }
-
public void disbandGuild() {
if (guildid < 1 || guildRank != 1) {
return;
@@ -3500,7 +3488,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
for(Entry> bpl: buffEffects.entrySet()) {
MapleBuffStatValueHolder mbsvhi = bpl.getValue().get(mbs);
if(mbsvhi != null) {
- if(!mbsvhi.effect.isActive(mapid)) {
+ if(!mbsvhi.effect.isActive(this)) {
continue;
}
@@ -3725,17 +3713,57 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
}
- public void updateActiveEffects() {
- chrLock.lock();
+ private static MapleStatEffect getEffectFromBuffSource(Map buffSource) {
try {
- effects.clear();
- updateEffects(buffEffectsCount.keySet());
+ return buffSource.entrySet().iterator().next().getValue().effect;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ private boolean isUpdatingEffect(Set activeEffects, MapleStatEffect mse) {
+ if (mse == null) return false;
+
+ // thanks xinyifly for noticing "Speed Infusion" crashing game when updating buffs during map transition
+ boolean active = mse.isActive(this);
+ if (active) {
+ return !activeEffects.contains(mse);
+ } else {
+ return activeEffects.contains(mse);
+ }
+ }
+
+ public void updateActiveEffects() {
+ effLock.lock(); // thanks davidlafriniere, maple006, RedHat for pointing a deadlock occurring here
+ try {
+ Set updatedBuffs = new LinkedHashSet<>();
+ Set activeEffects = new LinkedHashSet<>();
+
+ for (MapleBuffStatValueHolder mse : effects.values()) {
+ activeEffects.add(mse.effect);
+ }
+
+ for (Map buff : buffEffects.values()) {
+ MapleStatEffect mse = getEffectFromBuffSource(buff);
+ if (isUpdatingEffect(activeEffects, mse)) {
+ for (Pair p : mse.getStatups()) {
+ updatedBuffs.add(p.getLeft());
+ }
+ }
+ }
+
+ for (MapleBuffStat mbs : updatedBuffs) {
+ effects.remove(mbs);
+ }
+
+ updateEffects(updatedBuffs);
} finally {
- chrLock.unlock();
+ effLock.unlock();
}
}
private void updateEffects(Set removedStats) {
+ effLock.lock();
chrLock.lock();
try {
Set retrievedStats = new LinkedHashSet<>();
@@ -3754,6 +3782,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
propagateBuffEffectUpdates(new LinkedHashMap>(), retrievedStats, removedStats);
} finally {
chrLock.unlock();
+ effLock.unlock();
}
}
@@ -3783,29 +3812,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
if (effect.isMagicDoor()) {
- MapleDoor destroyDoor = removePartyDoor(false);
-
- if (destroyDoor != null) {
- destroyDoor.getTarget().removeMapObject(destroyDoor.getAreaDoor());
- destroyDoor.getTown().removeMapObject(destroyDoor.getTownDoor());
-
- for (MapleCharacter chr : destroyDoor.getTarget().getCharacters()) {
- destroyDoor.getAreaDoor().sendDestroyData(chr.getClient());
- }
-
- Collection townChars = destroyDoor.getTown().getCharacters();
- for (MapleCharacter chr : townChars) {
- destroyDoor.getTownDoor().sendDestroyData(chr.getClient());
- }
- if (destroyDoor.getTownPortal().getId() == 0x80) {
- for (MapleCharacter chr : townChars) {
- MapleDoor door = chr.getMainTownDoor();
- if (door != null) {
- destroyDoor.getTownDoor().sendSpawnData(chr.getClient());
- }
- }
- }
- }
+ MapleDoor.attemptRemoveDoor(this);
} else if (effect.isMapChair()) {
stopChairTask();
}
@@ -4202,6 +4209,12 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
case COUPON_DRP1:
case COUPON_DRP2:
case COUPON_DRP3:
+ case MESO_UP_BY_ITEM:
+ case ITEM_UP_BY_ITEM:
+ case RESPECT_PIMMUNE:
+ case RESPECT_MIMMUNE:
+ case DEFENSE_ATT:
+ case DEFENSE_STATE:
case WATK:
case WDEF:
case MATK:
@@ -4347,7 +4360,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
appliedStatups.put(ps.getLeft(), new MapleBuffStatValueHolder(effect, starttime, ps.getRight()));
}
- boolean active = effect.isActive(mapid);
+ boolean active = effect.isActive(this);
if(ServerConstants.USE_BUFF_MOST_SIGNIFICANT) {
toDeploy = new LinkedHashMap<>();
Map> retrievedEffects = new LinkedHashMap<>();
@@ -4559,7 +4572,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
silentPartyUpdateInternal(chrParty);
}
- private MapleDoor removePartyDoor(boolean partyUpdate) {
+ public MapleDoor removePartyDoor(boolean partyUpdate) {
MapleDoor ret = null;
MapleParty chrParty;
@@ -5322,20 +5335,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
return false;
}
- public List retrieveRelevantDrops(int monsterId) {
- List pchars = new LinkedList<>();
- for (MapleCharacter chr : getPartyMembers()) {
- if (chr.isLoggedinWorld()) {
- pchars.add(chr);
- }
- }
-
- if (pchars.isEmpty()) {
- pchars.add(this);
- }
- return MapleLootManager.retrieveRelevantDrops(monsterId, pchars);
- }
-
public MaplePlayerShop getPlayerShop() {
return playerShop;
}
@@ -5356,7 +5355,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
closeNpcShop();
closeTrade();
closePlayerShop();
- closeMiniGame();
+ closeMiniGame(true);
closeHiredMerchant(false);
closePlayerMessenger();
@@ -5398,18 +5397,16 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
this.setPlayerShop(null);
}
- public void closeMiniGame() {
+ public void closeMiniGame(boolean forceClose) {
MapleMiniGame game = this.getMiniGame();
if (game == null) {
return;
}
- this.setMiniGame(null);
if (game.isOwner(this)) {
- this.getMap().broadcastMessage(MaplePacketCreator.removeMinigameBox(this));
- game.broadcastToVisitor(MaplePacketCreator.getMiniGameClose(3));
+ game.closeRoom(forceClose);
} else {
- game.removeVisitor(this);
+ game.removeVisitor(forceClose, this);
}
}
@@ -6542,9 +6539,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
public void updateCouponRates() {
+ MapleInventory cashInv = this.getInventory(MapleInventoryType.CASH);
+ if (cashInv == null) return;
+
if (cpnLock.tryLock()) {
- MapleInventory cashInv = this.getInventory(MapleInventoryType.CASH);
-
effLock.lock();
chrLock.lock();
cashInv.lockInventory();
@@ -6979,11 +6977,11 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
ret.commitExcludedItems();
if (channelserver) {
- MapleMapFactory mapFactory = client.getChannelServer().getMapFactory();
- ret.map = mapFactory.getMap(ret.mapid);
+ MapleMapManager mapManager = client.getChannelServer().getMapFactory();
+ ret.map = mapManager.getMap(ret.mapid);
if (ret.map == null) {
- ret.map = mapFactory.getMap(100000000);
+ ret.map = mapManager.getMap(100000000);
}
MaplePortal portal = ret.map.getPortal(ret.initialSpawnPoint);
if (portal == null) {
diff --git a/src/client/MapleClient.java b/src/client/MapleClient.java
index 3145bc2a45..67589efabb 100644
--- a/src/client/MapleClient.java
+++ b/src/client/MapleClient.java
@@ -109,11 +109,11 @@ public class MapleClient {
private Map engines = new HashMap<>();
private byte characterSlots = 3;
private byte loginattempt = 0;
- private String pin = null;
+ private String pin = "";
private int pinattempt = 0;
- private String pic = null;
- private String hwid = null;
+ private String pic = "";
private int picattempt = 0;
+ private String hwid = null;
private byte csattempt = 0;
private byte gender = -1;
private boolean disconnecting = false;
@@ -480,6 +480,10 @@ public class MapleClient {
}
public boolean checkPin(String other) {
+ if (!(ServerConstants.ENABLE_PIN && !canBypassPin())) {
+ return true;
+ }
+
pinattempt++;
if (pinattempt > 5) {
MapleSessionCoordinator.getInstance().closeSession(session, false);
@@ -521,7 +525,7 @@ public class MapleClient {
if (picattempt > 5) {
MapleSessionCoordinator.getInstance().closeSession(session, false);
}
- if (pic.equals(other)) {
+ if (pic.equals(other)) { // thanks ryantpayton (HeavenClient) for noticing null pics being checked here
picattempt = 0;
MapleLoginBypassCoordinator.getInstance().registerLoginBypassEntry(getNibbleHWID(), accId, true);
return true;
@@ -1485,6 +1489,8 @@ public class MapleClient {
player.getMap().removePlayer(player);
player.clearBanishPlayerData();
player.getClient().getChannelServer().removePlayer(player);
+
+ player.saveCharToDB();
player.getClient().updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION);
player.setSessionTransitionState();
diff --git a/src/client/autoban/AutobanFactory.java b/src/client/autoban/AutobanFactory.java
index 92894c0fe1..04f0f672c5 100644
--- a/src/client/autoban/AutobanFactory.java
+++ b/src/client/autoban/AutobanFactory.java
@@ -85,7 +85,7 @@ public enum AutobanFactory {
public void alert(MapleCharacter chr, String reason) {
if(ServerConstants.USE_AUTOBAN == true) {
- if (chr != null && MapleLogger.ignored.contains(chr.getName())){
+ if (chr != null && MapleLogger.ignored.contains(chr.getId())){
return;
}
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), MaplePacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
diff --git a/src/client/autoban/AutobanManager.java b/src/client/autoban/AutobanManager.java
index b9579daae1..14d8f25370 100644
--- a/src/client/autoban/AutobanManager.java
+++ b/src/client/autoban/AutobanManager.java
@@ -119,9 +119,9 @@ public class AutobanManager {
FilePrinter.print(FilePrinter.EXPLOITS, "Player " + chr + " was caught spamming TYPE " + type + " and has been disconnected.");
}
- return;
+ } else {
+ this.timestamp[type] = time;
+ this.timestampcounter[type] = 0;
}
- this.timestamp[type] = time;
- this.timestampcounter[type] = 0;
}
}
diff --git a/src/client/command/CommandsExecutor.java b/src/client/command/CommandsExecutor.java
index c0c9bdaef1..cc889cbfa1 100644
--- a/src/client/command/CommandsExecutor.java
+++ b/src/client/command/CommandsExecutor.java
@@ -93,6 +93,10 @@ public class CommandsExecutor {
}
private void handleInternal(MapleClient client, String message){
+ if (client.getPlayer().getMapId() == 300000012) {
+ client.getPlayer().yellowMessage("You not have permission to use this command while in jail.");
+ return;
+ }
final String splitRegex = "[ ]";
String[] splitedMessage = message.substring(1).split(splitRegex, 2);
if (splitedMessage.length < 2) {
@@ -259,6 +263,7 @@ public class CommandsExecutor {
addCommand("job", 2, JobCommand.class);
addCommand("unbug", 2, UnBugCommand.class);
addCommand("id", 2, IdCommand.class);
+ addCommand("gachalist", GachaListCommand.class);
commandsNameDesc.add(levelCommandsCursor);
}
diff --git a/src/client/command/commands/gm1/GotoCommand.java b/src/client/command/commands/gm1/GotoCommand.java
index 8ced9abf25..7e9e5a9d22 100644
--- a/src/client/command/commands/gm1/GotoCommand.java
+++ b/src/client/command/commands/gm1/GotoCommand.java
@@ -33,7 +33,7 @@ import net.server.Server;
import server.MaplePortal;
import server.maps.FieldLimit;
import server.maps.MapleMap;
-import server.maps.MapleMapFactory;
+import server.maps.MapleMapManager;
import server.maps.MapleMiniDungeonInfo;
import java.util.Comparator;
@@ -47,18 +47,18 @@ public class GotoCommand extends Command {
{
setDescription("");
- MapleMapFactory mapFactory = Server.getInstance().getWorlds().get(0).getChannels().get(0).getMapFactory();
+ MapleMapManager mapManager = Server.getInstance().getWorlds().get(0).getChannels().get(0).getMapFactory();
List> towns = new ArrayList<>(GameConstants.GOTO_TOWNS.entrySet());
sortGotoEntries(towns);
for (Map.Entry e : towns) {
- GOTO_TOWNS_INFO += ("'" + e.getKey() + "' - #b" + (mapFactory.getMap(e.getValue()).getMapName()) + "#k\r\n");
+ GOTO_TOWNS_INFO += ("'" + e.getKey() + "' - #b" + (mapManager.getMap(e.getValue()).getMapName()) + "#k\r\n");
}
List> areas = new ArrayList<>(GameConstants.GOTO_AREAS.entrySet());
sortGotoEntries(areas);
for (Map.Entry e : areas) {
- GOTO_AREAS_INFO += ("'" + e.getKey() + "' - #b" + (mapFactory.getMap(e.getValue()).getMapName()) + "#k\r\n");
+ GOTO_AREAS_INFO += ("'" + e.getKey() + "' - #b" + (mapManager.getMap(e.getValue()).getMapName()) + "#k\r\n");
}
}
@@ -103,6 +103,7 @@ public class GotoCommand extends Command {
HashMap gotomaps;
if (player.isGM()) {
gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc
+ gotomaps.putAll(GameConstants.GOTO_TOWNS); // thanks Halcyon for pointing out duplicates on listed entries functionality
} else {
gotomaps = new HashMap<>(GameConstants.GOTO_TOWNS);
}
diff --git a/src/client/command/commands/gm2/GachaListCommand.java b/src/client/command/commands/gm2/GachaListCommand.java
new file mode 100644
index 0000000000..1ffff8fcb5
--- /dev/null
+++ b/src/client/command/commands/gm2/GachaListCommand.java
@@ -0,0 +1,38 @@
+/*
+ This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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.command.commands.gm2;
+
+import client.MapleClient;
+import client.command.Command;
+
+/**
+ *
+ * @author Ronan
+ */
+public class GachaListCommand extends Command {
+ {
+ setDescription("");
+ }
+
+ @Override
+ public void execute(MapleClient c, String[] params) {
+ c.getAbstractPlayerInteraction().openNpc(10000, "gachaponInfo");
+ }
+}
diff --git a/src/client/command/commands/gm3/IgnoreCommand.java b/src/client/command/commands/gm3/IgnoreCommand.java
index bf71c3516e..b2a6affd7f 100644
--- a/src/client/command/commands/gm3/IgnoreCommand.java
+++ b/src/client/command/commands/gm3/IgnoreCommand.java
@@ -47,11 +47,11 @@ public class IgnoreCommand extends Command {
player.message("Player '" + params[0] + "' could not be found on this world.");
return;
}
- boolean monitored_ = MapleLogger.ignored.contains(victim.getName());
+ boolean monitored_ = MapleLogger.ignored.contains(victim.getId());
if (monitored_) {
- MapleLogger.ignored.remove(victim.getName());
+ MapleLogger.ignored.remove(victim.getId());
} else {
- MapleLogger.ignored.add(victim.getName());
+ MapleLogger.ignored.add(victim.getId());
}
player.yellowMessage(victim.getName() + " is " + (!monitored_ ? "now being ignored." : "no longer being ignored."));
String message_ = player.getName() + (!monitored_ ? " has started ignoring " : " has stopped ignoring ") + victim.getName() + ".";
diff --git a/src/client/command/commands/gm3/IgnoredCommand.java b/src/client/command/commands/gm3/IgnoredCommand.java
index 66b4adc7ff..e22e17e6e7 100644
--- a/src/client/command/commands/gm3/IgnoredCommand.java
+++ b/src/client/command/commands/gm3/IgnoredCommand.java
@@ -36,8 +36,8 @@ public class IgnoredCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
- for (String ign : MapleLogger.ignored) {
- player.yellowMessage(ign + " is being ignored.");
+ for (Integer cid : MapleLogger.ignored) {
+ player.yellowMessage(MapleCharacter.getNameById(cid) + " is being ignored.");
}
}
}
diff --git a/src/client/command/commands/gm3/MonitorCommand.java b/src/client/command/commands/gm3/MonitorCommand.java
index 59f641ba7d..e7fb5c8a28 100644
--- a/src/client/command/commands/gm3/MonitorCommand.java
+++ b/src/client/command/commands/gm3/MonitorCommand.java
@@ -47,14 +47,14 @@ public class MonitorCommand extends Command {
player.message("Player '" + params[0] + "' could not be found on this world.");
return;
}
- boolean monitored = MapleLogger.monitored.contains(victim.getName());
+ boolean monitored = MapleLogger.monitored.contains(victim.getId());
if (monitored) {
- MapleLogger.monitored.remove(victim.getName());
+ MapleLogger.monitored.remove(victim.getId());
} else {
- MapleLogger.monitored.add(victim.getName());
+ MapleLogger.monitored.add(victim.getId());
}
- player.yellowMessage(victim.getName() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
- String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getName() + ".";
+ player.yellowMessage(victim.getId() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
+ String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getId() + ".";
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message));
}
diff --git a/src/client/command/commands/gm3/MonitorsCommand.java b/src/client/command/commands/gm3/MonitorsCommand.java
index d7e90a1986..d4d5f27857 100644
--- a/src/client/command/commands/gm3/MonitorsCommand.java
+++ b/src/client/command/commands/gm3/MonitorsCommand.java
@@ -36,8 +36,8 @@ public class MonitorsCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
- for (String ign : MapleLogger.monitored) {
- player.yellowMessage(ign + " is being monitored.");
+ for (Integer cid : MapleLogger.monitored) {
+ player.yellowMessage(MapleCharacter.getNameById(cid) + " is being monitored.");
}
}
}
diff --git a/src/client/inventory/ItemFactory.java b/src/client/inventory/ItemFactory.java
index b41946469f..4dab3c2a7b 100644
--- a/src/client/inventory/ItemFactory.java
+++ b/src/client/inventory/ItemFactory.java
@@ -46,13 +46,16 @@ public enum ItemFactory {
CASH_ARAN(5, true),
MERCHANT(6, false),
CASH_OVERALL(7, true),
- MARRIAGE_GIFTS(8, false);
+ MARRIAGE_GIFTS(8, false),
+ DUEY(9, false);
private final int value;
private final boolean account;
- private static final Lock locks[] = new Lock[200]; // thanks Masterrulax for pointing out a bottleneck issue here
+
+ private static final int lockCount = 400;
+ private static final Lock locks[] = new Lock[lockCount]; // thanks Masterrulax for pointing out a bottleneck issue here
static {
- for (int i = 0; i < 200; i++) {
+ for (int i = 0; i < lockCount; i++) {
locks[i] = MonitoredReentrantLockFactory.createLock(MonitoredLockType.ITEM, true);
}
}
@@ -75,7 +78,9 @@ public enum ItemFactory {
saveItems(items, null, id, con);
}
- public synchronized void saveItems(List> items, List bundlesList, int id, Connection con) throws SQLException {
+ public void saveItems(List> items, List bundlesList, int id, Connection con) throws SQLException {
+ // thanks Arufonsu, MedicOP, BHB for pointing a "synchronized" bottleneck here
+
if(value != 6) saveItemsCommon(items, id, con);
else saveItemsMerchant(items, bundlesList, id, con);
}
@@ -199,7 +204,7 @@ public enum ItemFactory {
PreparedStatement pse = null;
ResultSet rs = null;
- Lock lock = locks[id % 200];
+ Lock lock = locks[id % lockCount];
lock.lock();
try {
StringBuilder query = new StringBuilder();
@@ -365,7 +370,7 @@ public enum ItemFactory {
PreparedStatement pse = null;
ResultSet rs = null;
- Lock lock = locks[id % 200];
+ Lock lock = locks[id % lockCount];
lock.lock();
try {
ps = con.prepareStatement("DELETE FROM `inventorymerchant` WHERE `characterid` = ?");
diff --git a/src/client/inventory/MapleInventory.java b/src/client/inventory/MapleInventory.java
index fbc1fea6f7..7255677ddc 100644
--- a/src/client/inventory/MapleInventory.java
+++ b/src/client/inventory/MapleInventory.java
@@ -463,31 +463,41 @@ public class MapleInventory implements Iterable- {
public static boolean checkSpots(MapleCharacter chr, List> items, List typesSlotsUsed, boolean useProofInv) {
// assumption: no "UNDEFINED" or "EQUIPPED" items shall be tested here, all counts are >= 0.
- Map rcvItems = new LinkedHashMap<>();
+ Map> rcvItems = new LinkedHashMap<>();
Map rcvTypes = new LinkedHashMap<>();
for (Pair
- item : items) {
Integer itemId = item.left.getItemId();
- Short qty = rcvItems.get(itemId);
+ List qty = rcvItems.get(itemId);
if(qty == null) {
- rcvItems.put(itemId, item.left.getQuantity());
+ List itemQtyList = new LinkedList<>();
+ itemQtyList.add((int) item.left.getQuantity());
+
+ rcvItems.put(itemId, itemQtyList);
rcvTypes.put(itemId, item.right.getType());
} else {
- rcvItems.put(itemId, (short)(qty + item.left.getQuantity()));
+ if (!ItemConstants.isRechargeable(itemId)) {
+ qty.set(0, qty.get(0) + item.left.getQuantity());
+ } else {
+ qty.add((int) item.left.getQuantity());
+ }
}
}
MapleClient c = chr.getClient();
- for(Entry it: rcvItems.entrySet()) {
+ for(Entry> it: rcvItems.entrySet()) {
int itemType = rcvTypes.get(it.getKey()) - 1;
- int usedSlots = typesSlotsUsed.get(itemType);
- int result = MapleInventoryManipulator.checkSpaceProgressively(c, it.getKey(), it.getValue(), "", usedSlots, useProofInv);
- boolean hasSpace = ((result % 2) != 0);
-
- if(!hasSpace) return false;
- typesSlotsUsed.set(itemType, (result >> 1));
+ for (Integer itValue : it.getValue()) {
+ int usedSlots = typesSlotsUsed.get(itemType);
+
+ int result = MapleInventoryManipulator.checkSpaceProgressively(c, it.getKey(), itValue, "", usedSlots, useProofInv);
+ boolean hasSpace = ((result % 2) != 0);
+
+ if(!hasSpace) return false;
+ typesSlotsUsed.set(itemType, (result >> 1));
+ }
}
return true;
@@ -525,38 +535,48 @@ public class MapleInventory implements Iterable
- {
public static boolean checkSpotsAndOwnership(MapleCharacter chr, List> items, List typesSlotsUsed, boolean useProofInv) {
//assumption: no "UNDEFINED" or "EQUIPPED" items shall be tested here, all counts are >= 0 and item list to be checked is a legal one.
- Map rcvItems = new LinkedHashMap<>();
+ Map> rcvItems = new LinkedHashMap<>();
Map rcvTypes = new LinkedHashMap<>();
Map rcvOwners = new LinkedHashMap<>();
for (Pair
- item : items) {
Long itemHash = hashKey(item.left.getItemId(), item.left.getOwner());
- Short qty = rcvItems.get(itemHash);
+ List qty = rcvItems.get(itemHash);
if(qty == null) {
- rcvItems.put(itemHash, item.left.getQuantity());
+ List itemQtyList = new LinkedList<>();
+ itemQtyList.add((int) item.left.getQuantity());
+
+ rcvItems.put(itemHash, itemQtyList);
rcvTypes.put(itemHash, item.right.getType());
rcvOwners.put(itemHash, item.left.getOwner());
} else {
- rcvItems.put(itemHash, (short)(qty + item.left.getQuantity()));
+ // thanks BHB88 for pointing out an issue with rechargeable items being stacked on inventory check
+ if (!ItemConstants.isRechargeable(item.left.getItemId())) {
+ qty.set(0, qty.get(0) + item.left.getQuantity());
+ } else {
+ qty.add((int) item.left.getQuantity());
+ }
}
}
MapleClient c = chr.getClient();
- for(Entry it: rcvItems.entrySet()) {
+ for(Entry> it: rcvItems.entrySet()) {
int itemType = rcvTypes.get(it.getKey()) - 1;
- int usedSlots = typesSlotsUsed.get(itemType);
+ int itemId = (int) (it.getKey() >> 32L);
- Long itemId = it.getKey() >> 32L;
-
- //System.out.print("inserting " + itemId.intValue() + " with type " + itemType + " qty " + it.getValue() + " owner '" + rcvOwners.get(it.getKey()) + "' current usedSlots:");
- //for(Integer i : typesSlotsUsed) System.out.print(" " + i);
- int result = MapleInventoryManipulator.checkSpaceProgressively(c, itemId.intValue(), it.getValue(), rcvOwners.get(it.getKey()), usedSlots, useProofInv);
- boolean hasSpace = ((result % 2) != 0);
- //System.out.print(" -> hasSpace: " + hasSpace + " RESULT : " + result + "\n");
-
- if(!hasSpace) return false;
- typesSlotsUsed.set(itemType, (result >> 1));
+ for (Integer itValue : it.getValue()) {
+ int usedSlots = typesSlotsUsed.get(itemType);
+
+ //System.out.print("inserting " + itemId.intValue() + " with type " + itemType + " qty " + it.getValue() + " owner '" + rcvOwners.get(it.getKey()) + "' current usedSlots:");
+ //for(Integer i : typesSlotsUsed) System.out.print(" " + i);
+ int result = MapleInventoryManipulator.checkSpaceProgressively(c, itemId, itValue, rcvOwners.get(it.getKey()), usedSlots, useProofInv);
+ boolean hasSpace = ((result % 2) != 0);
+ //System.out.print(" -> hasSpace: " + hasSpace + " RESULT : " + result + "\n");
+
+ if(!hasSpace) return false;
+ typesSlotsUsed.set(itemType, (result >> 1));
+ }
}
return true;
diff --git a/src/client/inventory/manipulator/MapleInventoryManipulator.java b/src/client/inventory/manipulator/MapleInventoryManipulator.java
index 3427402004..d2f41d82a4 100644
--- a/src/client/inventory/manipulator/MapleInventoryManipulator.java
+++ b/src/client/inventory/manipulator/MapleInventoryManipulator.java
@@ -316,7 +316,11 @@ public class MapleInventoryManipulator {
if (!type.equals(MapleInventoryType.EQUIP)) {
short slotMax = ii.getSlotMax(c, itemid);
List
- existing = inv.listById(itemid);
- if (!ItemConstants.isRechargeable(itemid)) {
+
+ final int numSlotsNeeded;
+ if (ItemConstants.isRechargeable(itemid)) {
+ numSlotsNeeded = 1;
+ } else {
if (existing.size() > 0) // first update all existing slots to slotMax
{
for (Item eItem : existing) {
@@ -330,15 +334,14 @@ public class MapleInventoryManipulator {
}
}
}
+
+ if (slotMax > 0) {
+ numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
+ } else {
+ numSlotsNeeded = 1;
+ }
}
- final int numSlotsNeeded;
- if (slotMax > 0) {
- numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
- } else if (ItemConstants.isRechargeable(itemid)) {
- numSlotsNeeded = 1;
- } else {
- numSlotsNeeded = 1;
- }
+
return !inv.isFull(numSlotsNeeded - 1);
} else {
return !inv.isFull();
@@ -367,7 +370,11 @@ public class MapleInventoryManipulator {
if (!type.equals(MapleInventoryType.EQUIP)) {
short slotMax = ii.getSlotMax(c, itemid);
- if (!ItemConstants.isRechargeable(itemid)) {
+ final int numSlotsNeeded;
+
+ if (ItemConstants.isRechargeable(itemid)) {
+ numSlotsNeeded = 1;
+ } else {
List
- existing = inv.listById(itemid);
if (existing.size() > 0) // first update all existing slots to slotMax
@@ -383,14 +390,12 @@ public class MapleInventoryManipulator {
}
}
}
- }
- final int numSlotsNeeded;
- if (slotMax > 0) {
- numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
- } else if (ItemConstants.isRechargeable(itemid)) {
- numSlotsNeeded = 1;
- } else {
- numSlotsNeeded = 1;
+
+ if (slotMax > 0) {
+ numSlotsNeeded = (int) (Math.ceil(((double) quantity) / slotMax));
+ } else {
+ numSlotsNeeded = 1;
+ }
}
returnValue = ((numSlotsNeeded + usedSlots) << 1);
@@ -708,7 +713,7 @@ public class MapleInventoryManipulator {
source.setQuantity((short) (source.getQuantity() - quantity));
c.announce(MaplePacketCreator.modifyInventory(true, Collections.singletonList(new ModifyInventory(1, source))));
- if(ItemConstants.isNewYearCardEtc(itemId)) {
+ if (ItemConstants.isNewYearCardEtc(itemId)) {
if(itemId == 4300000) {
NewYearCardRecord.removeAllNewYearCard(true, chr);
c.getAbstractPlayerInteraction().removeAll(4300000);
@@ -718,13 +723,9 @@ public class MapleInventoryManipulator {
}
} else if (ItemConstants.isWeddingRing(source.getItemId())) {
map.disappearingItemDrop(chr, chr, target, dropPos);
- } else if (map.getEverlast()) {
- if (ii.isDropRestricted(target.getItemId()) || ii.isCash(target.getItemId()) || isDroppedItemRestricted(target)) {
- map.disappearingItemDrop(chr, chr, target, dropPos);
- } else {
- map.spawnItemDrop(chr, chr, target, dropPos, true, true);
- }
- } else if (ii.isDropRestricted(target.getItemId()) || ii.isCash(target.getItemId()) || isDroppedItemRestricted(target)) {
+ }
+
+ if (ii.isDropRestricted(target.getItemId()) || ii.isCash(target.getItemId()) || isDroppedItemRestricted(target)) {
map.disappearingItemDrop(chr, chr, target, dropPos);
} else {
map.spawnItemDrop(chr, chr, target, dropPos, true, true);
@@ -745,24 +746,20 @@ public class MapleInventoryManipulator {
c.announce(MaplePacketCreator.modifyInventory(true, Collections.singletonList(new ModifyInventory(3, source))));
if (src < 0) {
chr.equipChanged();
- } else if(ItemConstants.isNewYearCardEtc(itemId)) {
- if(itemId == 4300000) {
+ } else if (ItemConstants.isNewYearCardEtc(itemId)) {
+ if (itemId == 4300000) {
NewYearCardRecord.removeAllNewYearCard(true, chr);
c.getAbstractPlayerInteraction().removeAll(4300000);
} else {
NewYearCardRecord.removeAllNewYearCard(false, chr);
c.getAbstractPlayerInteraction().removeAll(4301000);
}
+ } else if (ItemConstants.isWeddingRing(source.getItemId())) {
+ map.disappearingItemDrop(chr, chr, source, dropPos);
}
- if (map.getEverlast()) {
- if (ii.isDropRestricted(itemId) || ii.isCash(itemId) || isDroppedItemRestricted(source)) {
- map.disappearingItemDrop(chr, chr, source, dropPos);
- } else {
- map.spawnItemDrop(chr, chr, source, dropPos, true, true);
- }
- } else if (ii.isDropRestricted(itemId) || ii.isCash(itemId) || isDroppedItemRestricted(source)) {
- map.disappearingItemDrop(chr, chr, source, dropPos);
+ if (ii.isDropRestricted(itemId) || ii.isCash(itemId) || isDroppedItemRestricted(source)) {
+ map.disappearingItemDrop(chr, chr, source, dropPos);
} else {
map.spawnItemDrop(chr, chr, source, dropPos, true, true);
}
diff --git a/src/client/processor/DueyProcessor.java b/src/client/processor/DueyProcessor.java
index 2768742ea4..230e5927f6 100644
--- a/src/client/processor/DueyProcessor.java
+++ b/src/client/processor/DueyProcessor.java
@@ -26,26 +26,31 @@ package client.processor;
import client.MapleCharacter;
import client.MapleClient;
import client.autoban.AutobanFactory;
-import client.inventory.Equip;
import client.inventory.Item;
+import client.inventory.ItemFactory;
+import client.inventory.MapleInventory;
import client.inventory.MapleInventoryType;
import client.inventory.manipulator.MapleInventoryManipulator;
import client.inventory.manipulator.MapleKarmaManipulator;
import constants.ItemConstants;
+import constants.ServerConstants;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Calendar;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import net.server.channel.Channel;
-import server.DueyPackages;
+import server.DueyPackage;
import server.MapleItemInformationProvider;
import server.MapleTrade;
import tools.DatabaseConnection;
import tools.FilePrinter;
import tools.MaplePacketCreator;
+import tools.Pair;
/**
*
@@ -86,21 +91,17 @@ public class DueyProcessor {
}
}
- private static int getAccIdFromCNAME(String name, boolean accountid) {
+ private static Pair getAccountCharacterIdFromCNAME(String name) {
try {
- PreparedStatement ps;
- String text = "SELECT id,accountid FROM characters WHERE name = ?";
Connection con = DatabaseConnection.getConnection();
- ps = con.prepareStatement(text);
+ PreparedStatement ps = con.prepareStatement("SELECT id,accountid FROM characters WHERE name = ?");
ps.setString(1, name);
- int id_;
+
+ Pair id_ = null;
try (ResultSet rs = ps.executeQuery()) {
- if (!rs.next()) {
- rs.close();
- ps.close();
- return -1;
+ if (rs.next()) {
+ id_ = new Pair<>(rs.getInt("accountid"), rs.getInt("id"));
}
- id_ = accountid ? rs.getInt("accountid") : rs.getInt("id");
}
ps.close();
con.close();
@@ -108,7 +109,7 @@ public class DueyProcessor {
} catch (SQLException e) {
e.printStackTrace();
}
- return -1;
+ return null;
}
private static String getCurrentDate() {
@@ -123,67 +124,6 @@ public class DueyProcessor {
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.setItemLevel((byte) rs.getInt("itemlevel"));
- eq.setItemExp(rs.getInt("itemexp"));
- 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.setFlag((byte) rs.getInt("flag"));
- 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.setFlag((byte) rs.getInt("flag"));
- 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;
@@ -230,70 +170,21 @@ public class DueyProcessor {
}
}
}
-
- 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;
+ private static void deletePackageFromInventoryDB(Connection con, int packageId) throws SQLException {
+ ItemFactory.DUEY.saveItems(new LinkedList>(), packageId, con);
+ }
+
+ private static void removePackageFromDB(int packageId) {
try {
- con = DatabaseConnection.getConnection();
- try (PreparedStatement ps = con.prepareStatement("INSERT INTO dueypackages (ReceiverId, 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, itemlevel, itemexp, str, dex, `int`, luk, hp, mp, watk, matk, wdef, mdef, acc, avoid, hands, speed, jump, flag, 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.getItemLevel());
- ps2.setInt(7, eq.getItemExp());
- ps2.setInt(8, eq.getStr());
- ps2.setInt(9, eq.getDex());
- ps2.setInt(10, eq.getInt());
- ps2.setInt(11, eq.getLuk());
- ps2.setInt(12, eq.getHp());
- ps2.setInt(13, eq.getMp());
- ps2.setInt(14, eq.getWatk());
- ps2.setInt(15, eq.getMatk());
- ps2.setInt(16, eq.getWdef());
- ps2.setInt(17, eq.getMdef());
- ps2.setInt(18, eq.getAcc());
- ps2.setInt(19, eq.getAvoid());
- ps2.setInt(20, eq.getHands());
- ps2.setInt(21, eq.getSpeed());
- ps2.setInt(22, eq.getJump());
- ps2.setInt(23, eq.getFlag());
- ps2.setString(24, eq.getOwner());
- } else {
- ps2 = con.prepareStatement("INSERT INTO dueyitems (PackageId, itemid, quantity, flag, owner) VALUES (?, ?, ?, ?, ?)");
- ps2.setInt(2, item.getItemId());
- ps2.setInt(3, quantity);
- ps2.setInt(4, item.getFlag());
- ps2.setString(5, item.getOwner());
- }
- ps2.setInt(1, rs.getInt(1));
- ps2.executeUpdate();
- ps2.close();
- }
- }
- }
+ Connection con = DatabaseConnection.getConnection();
+
+ PreparedStatement ps = con.prepareStatement("DELETE FROM dueypackages WHERE PackageId = ?");
+ ps.setInt(1, packageId);
+ ps.executeUpdate();
+ ps.close();
+
+ deletePackageFromInventoryDB(con, packageId);
con.close();
} catch (SQLException e) {
@@ -301,49 +192,181 @@ public class DueyProcessor {
}
}
- private static List loadItems(MapleCharacter chr) {
- List packages = new LinkedList<>();
- Connection con = null;
+ private static DueyPackage getPackageFromDB(ResultSet rs) {
try {
- con = DatabaseConnection.getConnection();
- try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp LEFT JOIN dueyitems di ON dp.PackageId=di.PackageId WHERE ReceiverId = ?")) {
+ int packageId = rs.getInt("PackageId");
+
+ List> dueyItems = ItemFactory.DUEY.loadItems(packageId, false);
+ DueyPackage dueypack;
+
+ if (!dueyItems.isEmpty()) { // in a duey package there's only one item
+ dueypack = new DueyPackage(packageId, dueyItems.get(0).getLeft());
+ } else {
+ dueypack = new DueyPackage(packageId);
+ }
+
+ dueypack.setSender(rs.getString("SenderName"));
+ dueypack.setMesos(rs.getInt("Mesos"));
+ dueypack.setSentTime(rs.getString("TimeStamp"));
+ dueypack.setMessage(rs.getString("Message"));
+
+ return dueypack;
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ return null;
+ }
+ }
+
+ private static List loadPackages(MapleCharacter chr) {
+ List packages = new LinkedList<>();
+ try {
+ Connection con = DatabaseConnection.getConnection();
+ try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp WHERE ReceiverId = ?")) {
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"));
+ DueyPackage dueypack = getPackageFromDB(rs);
+ if (dueypack == null) continue;
+
packages.add(dueypack);
}
}
}
con.close();
- return packages;
} catch (SQLException e) {
e.printStackTrace();
- return null;
+ }
+
+ return packages;
+ }
+
+ private static int createPackage(int mesos, String message, String sender, int toCid) {
+ try {
+ Connection con = null;
+ PreparedStatement ps = null;
+ ResultSet rs = null;
+
+ try {
+ con = DatabaseConnection.getConnection();
+ ps = con.prepareStatement("INSERT INTO `dueypackages` (ReceiverId, SenderName, Mesos, TimeStamp, Message, Checked) VALUES (?, ?, ?, ?, ?, 1)", Statement.RETURN_GENERATED_KEYS);
+ ps.setInt(1, toCid);
+ ps.setString(2, sender);
+ ps.setInt(3, mesos);
+ ps.setString(4, getCurrentDate());
+ ps.setString(5, message);
+
+ int updateRows = ps.executeUpdate();
+ if (updateRows < 1) {
+ FilePrinter.printError(FilePrinter.INSERT_CHAR, "Error trying to create package [mesos: " + mesos + ", " + sender + ", to CharacterId: " + toCid + "]");
+ return -1;
+ }
+
+ int packageId;
+ rs = ps.getGeneratedKeys();
+ if (rs.next()) {
+ packageId = rs.getInt(1);
+ } else {
+ FilePrinter.printError(FilePrinter.INSERT_CHAR, "Failed inserting package [mesos: " + mesos + ", " + sender + ", to CharacterId: " + toCid + "]");
+ return -1;
+ }
+
+ return packageId;
+ } finally {
+ if (rs != null && !rs.isClosed()) {
+ rs.close();
+ }
+
+ if (ps != null && !ps.isClosed()) {
+ ps.close();
+ }
+
+ if (con != null && !con.isClosed()) {
+ con.close();
+ }
+ }
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+
+ return -1;
+ }
+
+ private static boolean insertPackageItem(int packageId, Item item) {
+ try {
+ Pair
- dueyItem = new Pair<>(item, MapleInventoryType.getByType(item.getItemType()));
+ Connection con = DatabaseConnection.getConnection();
+ ItemFactory.DUEY.saveItems(Collections.singletonList(dueyItem), packageId, con);
+ con.close();
+
+ return true;
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+
+ return false;
}
}
- public static void dueySendItem(MapleClient c, byte inventId, short itemPos, short amount, int mesos, String recipient) {
+ private static int addPackageItemFromInventory(int packageId, MapleClient c, byte invTypeId, short itemPos, short amount) {
+ if (invTypeId > 0) {
+ MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
+
+ MapleInventoryType invType = MapleInventoryType.getByType(invTypeId);
+ MapleInventory inv = c.getPlayer().getInventory(invType);
+
+ Item item;
+ inv.lockInventory();
+ try {
+ item = inv.getItem(itemPos);
+ if (item != null && item.getQuantity() >= amount) {
+ if (item.isUntradeable() || ii.isUnmerchable(item.getItemId())) {
+ return -1;
+ }
+
+ if (ItemConstants.isRechargeable(item.getItemId())) {
+ MapleInventoryManipulator.removeFromSlot(c, invType, itemPos, item.getQuantity(), true);
+ } else {
+ MapleInventoryManipulator.removeFromSlot(c, invType, itemPos, amount, true, false);
+ }
+
+ item = item.copy();
+ } else {
+ return -2;
+ }
+ } finally {
+ inv.unlockInventory();
+ }
+
+ MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
+ item.setQuantity(amount);
+
+ if (!insertPackageItem(packageId, item)) {
+ return 1;
+ }
+ }
+
+ return 0;
+ }
+
+ public static void dueySendItem(MapleClient c, byte invTypeId, short itemPos, short amount, int sendMesos, String sendMessage, String recipient) {
if (c.tryacquireClient()) {
try {
- final int fee = 5000;
- final long sendMesos = (long) mesos + fee;
- if (mesos < 0 || sendMesos > Integer.MAX_VALUE || (amount < 1 && mesos == 0)) {
+ final int fee = 5000 + MapleTrade.getFee(sendMesos);
+
+ long finalcost = (long) sendMesos + fee;
+ if (finalcost < 0 || finalcost > Integer.MAX_VALUE || (amount < 1 && sendMesos == 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);
+ FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + sendMesos + " and amount " + amount);
c.disconnect(true, false);
return;
}
-
- int finalcost = mesos + fee;
+
+ Pair accIdCid;
if (c.getPlayer().getMeso() >= finalcost) {
- int accid = getAccIdFromCNAME(recipient, true);
- if (accid != -1) {
- if (accid == c.getAccID()) {
+ accIdCid = getAccountCharacterIdFromCNAME(recipient);
+ int recipientAccId = accIdCid.getLeft();
+ if (recipientAccId != -1) {
+ if (recipientAccId == c.getAccID()) {
c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SAMEACC_ERROR.getCode()));
return;
}
@@ -355,7 +378,29 @@ public class DueyProcessor {
c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NOT_ENOUGH_MESOS.getCode()));
return;
}
-
+
+ int recipientCid = accIdCid.getRight();
+ if (recipientCid == -1) {
+ c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_NAME_DOES_NOT_EXIST.getCode()));
+ return;
+ }
+
+ int packageId = createPackage(sendMesos, sendMessage, c.getPlayer().getName(), recipientCid);
+ if (packageId == -1) {
+ c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_ENABLE_ACTIONS.getCode()));
+ return;
+ }
+ c.getPlayer().gainMeso((int) -finalcost, false);
+
+ int res = addPackageItemFromInventory(packageId, c, invTypeId, itemPos, amount);
+ if (res == 0) {
+ c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_SUCCESSFULLY_SENT.getCode()));
+ } else if (res > 0) {
+ c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_ENABLE_ACTIONS.getCode()));
+ } else {
+ c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_INCORRECT_REQUEST.getCode()));
+ }
+
MapleClient rClient = null;
int channel = c.getWorldServer().find(recipient);
if (channel > -1) {
@@ -367,40 +412,7 @@ public class DueyProcessor {
}
}
}
-
- 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) {
- if (item.isUntradeable()) {
- c.announce(MaplePacketCreator.sendDueyMSG(DueyProcessor.Actions.TOCLIENT_SEND_INCORRECT_REQUEST.getCode()));
- return;
- }
-
- 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);
- }
-
- MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
- addItemToDB(item, amount, mesos - MapleTrade.getFee(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 - MapleTrade.getFee(mesos), c.getPlayer().getName(), getAccIdFromCNAME(recipient, false));
- }
-
+
if (rClient != null && rClient.isLoggedIn() && !rClient.getPlayer().isAwayFromWorld()) {
showDueyNotification(rClient, rClient.getPlayer());
}
@@ -410,55 +422,50 @@ public class DueyProcessor {
}
}
- public static void dueyRemovePackage(MapleClient c, int packageid) {
+ public static void dueyRemovePackage(MapleClient c, int packageid, boolean playerRemove) {
if (c.tryacquireClient()) {
try {
- removeItemFromDB(packageid);
- c.announce(MaplePacketCreator.removeItemFromDuey(true, packageid));
+ removePackageFromDB(packageid);
+ c.announce(MaplePacketCreator.removeItemFromDuey(playerRemove, packageid));
} finally {
c.releaseClient();
}
}
}
- public static void dueyClaimPackage(MapleClient c, int packageid) {
+ public static void dueyClaimPackage(MapleClient c, int packageId) {
if (c.tryacquireClient()) {
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);
+ DueyPackage dp = null;
+
+ Connection con = DatabaseConnection.getConnection();
+ try (PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp 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 = getPackageFromDB(rs);
}
}
}
- dp = dueypack;
+ con.close();
+
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);
+ FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageId);
return;
}
- if (dp.getItem() != null) {
+ Item dpItem = dp.getItem();
+ if (dpItem != null) {
if (!c.getPlayer().canHoldMeso(dp.getMesos())) {
c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_UNKNOWN_ERROR.getCode()));
return;
}
- if (!MapleInventoryManipulator.checkSpace(c, dp.getItem().getItemId(), dp.getItem().getQuantity(), dp.getItem().getOwner())) {
- int itemid = dp.getItem().getItemId();
+ if (!MapleInventoryManipulator.checkSpace(c, dpItem.getItemId(), dpItem.getQuantity(), dpItem.getOwner())) {
+ int itemid = dpItem.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 {
@@ -467,16 +474,13 @@ public class DueyProcessor {
return;
} else {
- MapleInventoryManipulator.addFromDrop(c, dp.getItem(), false);
+ MapleInventoryManipulator.addFromDrop(c, dpItem, false);
}
}
-
+
c.getPlayer().gainMeso(dp.getMesos(), false);
-
- removeItemFromDB(packageid);
- c.announce(MaplePacketCreator.removeItemFromDuey(false, packageid));
-
- con.close();
+
+ dueyRemovePackage(c, packageId, false);
} catch (SQLException e) {
e.printStackTrace();
}
@@ -489,10 +493,17 @@ public class DueyProcessor {
public static void dueySendTalk(MapleClient c) {
if (c.tryacquireClient()) {
try {
- c.announce(MaplePacketCreator.sendDuey((byte) 8, loadItems(c.getPlayer())));
+ c.announce(MaplePacketCreator.sendDuey((byte) 8, loadPackages(c.getPlayer())));
} finally {
c.releaseClient();
}
}
}
+
+ public static void dueyCreatePackage(Item item, int mesos, String sender, int recipientCid) {
+ int packageId = createPackage(mesos, "", sender, recipientCid);
+ if (packageId != -1) {
+ insertPackageItem(packageId, item);
+ }
+ }
}
diff --git a/src/client/processor/FredrickProcessor.java b/src/client/processor/FredrickProcessor.java
index 6848dc8d53..e359949b6b 100644
--- a/src/client/processor/FredrickProcessor.java
+++ b/src/client/processor/FredrickProcessor.java
@@ -100,7 +100,7 @@ public class FredrickProcessor {
return msg;
}
- private static void removeFredrickLog(int cid) {
+ public static void removeFredrickLog(int cid) {
try {
Connection con = DatabaseConnection.getConnection();
removeFredrickLog(con, cid);
diff --git a/src/client/processor/StorageProcessor.java b/src/client/processor/StorageProcessor.java
index 59672063b9..b2f5f4aa0e 100644
--- a/src/client/processor/StorageProcessor.java
+++ b/src/client/processor/StorageProcessor.java
@@ -139,6 +139,8 @@ public class StorageProcessor {
c.announce(MaplePacketCreator.enableActions());
return;
}
+
+ item = item.copy(); // thanks Robin Schulz & BHB88 for noticing a inventory glitch when storing items
} finally {
inv.unlockInventory();
}
diff --git a/src/constants/GameConstants.java b/src/constants/GameConstants.java
index 75c7e03954..b7e64813d4 100644
--- a/src/constants/GameConstants.java
+++ b/src/constants/GameConstants.java
@@ -92,8 +92,6 @@ public class GameConstants {
// used by the "goto" command for only-GMs
public static final HashMap GOTO_AREAS = new HashMap() {{
- putAll(GOTO_TOWNS);
-
put("gmmap", 180000000);
put("excavation", 990000000);
put("mushmom", 100000005);
diff --git a/src/constants/ServerConstants.java b/src/constants/ServerConstants.java
index 2092456d12..a64db14a65 100644
--- a/src/constants/ServerConstants.java
+++ b/src/constants/ServerConstants.java
@@ -37,7 +37,7 @@ public class ServerConstants {
public static final boolean AUTOMATIC_REGISTER = true; //Automatically register players when they login with a nonexistent username.
public static final boolean BCRYPT_MIGRATION = true; //Performs a migration from old SHA-1 and SHA-512 password to bcrypt.
public static final boolean COLLECTIVE_CHARSLOT = false; //Available character slots are contabilized globally rather than per world server.
- public static final boolean DETERRED_MULTICLIENT = false; //Enables multi-client and suspicious remote IP detection on the login system.
+ public static final boolean DETERRED_MULTICLIENT = false; //Enables detection of multi-client and suspicious remote IP on the login system.
//Besides blocking logging in with several client sessions on the same machine, this also blocks suspicious login attempts for players that tries to login on an account using several diferent remote addresses.
@@ -98,6 +98,7 @@ public class ServerConstants {
public static final boolean USE_ENFORCE_UNMERCHABLE_PET = false; //Forces players to not sell pets via merchants. (since non-named pets gets dirty name and other possible DB-related issues)
public static final boolean USE_ENFORCE_MERCHANT_SAVE = true; //Forces automatic DB save on merchant owners, at every item movement on shop.
public static final boolean USE_ENFORCE_MDOOR_POSITION = false; //Forces mystic door to be spawned near spawnpoints.
+ public static final boolean USE_SPAWN_CLEAN_MDOOR = false; //Makes mystic doors to be spawned without deploy animation. This clears disconnecting issues that may happen when trying to cancel doors a couple seconds after deployment.
public static final boolean USE_SPAWN_LOOT_ON_ANIMATION = false;//Makes loot appear some time after the mob has been killed (following the mob death animation, instead of instantly).
public static final boolean USE_SPAWN_RELEVANT_LOOT = true; //Forces to only spawn loots that are collectable by the player or any of their party members.
public static final boolean USE_ERASE_PERMIT_ON_OPENSHOP = true;//Forces "shop permit" item to be consumed when player deploy his/her player shop.
@@ -149,15 +150,18 @@ public class ServerConstants {
public static final int TRAVEL_RATE = 10; //Means of transportation rides/departs using 1/N of the default time.
public static final double EQUIP_EXP_RATE = 1.0; //Rate for equipment exp gain, grows linearly. Set 1.0 for default (about 100~200 same-level range mobs killed to pass equip from level 1 to 2).
- public static final float PARTY_BONUS_EXP_RATE = 1.0f; //Rate for the party exp bonus reward.
public static final double PQ_BONUS_EXP_RATE = 0.5; //Rate for the PQ exp reward.
+ public static final byte EXP_SPLIT_LEVEL_INTERVAL = 5; //Non-contributing players must be within N level between the mob to receive EXP.
+ public static final byte EXP_SPLIT_LEECH_INTERVAL = 5; //Non-contributing players must be within N level between any contributing party member to receive EXP.
+ public static final float EXP_SPLIT_MVP_MOD = 0.2f;
+ public static final float EXP_SPLIT_COMMON_MOD = 0.8f;
+ public static final float PARTY_BONUS_EXP_RATE = 1.0f; //Rate for the party exp bonus reward.
+
//Miscellaneous Configuration
public static String TIMEZONE = "GMT-3";
public static boolean USE_DISPLAY_NUMBERS_WITH_COMMA = true; //Enforce comma on displayed strings (use this when USE_UNITPRICE_WITH_COMMA is active and you still want to display comma-separated values).
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 final byte MIN_UNDERLEVEL_TO_EXP_GAIN = 20; //Characters are unable to get EXP from a mob if their level are under this threshold, only if "USE_ENFORCE_MOB_LEVEL_RANGE" is enabled. For bosses, this attribute is doubled.
- public static final byte MIN_RANGELEVEL_TO_EXP_LEECH = 40; //Characters are unable to leech EXP from party member kills whose level difference are past this limit.
public static final byte MAX_MONITORED_BUFFSTATS = 5; //Limits accounting for "dormant" buff effects, that should take place when stronger stat buffs expires.
public static final int MAX_AP = 32767; //Max AP allotted on the auto-assigner.
public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system.
diff --git a/src/net/PacketProcessor.java b/src/net/PacketProcessor.java
index bbea92c5a3..0e03f0d0e7 100644
--- a/src/net/PacketProcessor.java
+++ b/src/net/PacketProcessor.java
@@ -263,7 +263,8 @@ public final class PacketProcessor {
registerHandler(RecvOpcode.WATER_OF_LIFE, new UseWaterOfLifeHandler());
registerHandler(RecvOpcode.ADMIN_CHAT, new AdminChatHandler());
registerHandler(RecvOpcode.MOVE_DRAGON, new MoveDragonHandler());
- registerHandler(RecvOpcode.USE_ITEMUI, new UseItemCanvasHandler());
+ registerHandler(RecvOpcode.OPEN_ITEMUI, new RaiseUIStateHandler());
+ registerHandler(RecvOpcode.USE_ITEMUI, new RaiseIncExpHandler());
}
}
}
\ No newline at end of file
diff --git a/src/net/server/Server.java b/src/net/server/Server.java
index cd45f00249..b32e2d12ca 100644
--- a/src/net/server/Server.java
+++ b/src/net/server/Server.java
@@ -495,15 +495,12 @@ public class Server {
return true;
}
- private void resetServerWorlds() {
+ private void resetServerWorlds() { // thanks maple006 for noticing proprietary lists assigned to null
wldWLock.lock();
try {
worlds.clear();
- worlds = null;
channels.clear();
- channels = null;
worldRecommendedList.clear();
- worldRecommendedList = null;
} finally {
wldWLock.unlock();
}
diff --git a/src/net/server/audit/ThreadTracker.java b/src/net/server/audit/ThreadTracker.java
index 21f21d3546..a7bb1c850d 100644
--- a/src/net/server/audit/ThreadTracker.java
+++ b/src/net/server/audit/ThreadTracker.java
@@ -239,7 +239,10 @@ public class ThreadTracker {
}
else {
AtomicInteger c = lockCount.get(lockOid);
- c.decrementAndGet();
+ if (c != null) { // thanks BHB for detecting an NPE here
+ c.decrementAndGet();
+ }
+
lockUpdate.put(lockOid, 0);
List list = threadTracker.get(tid);
diff --git a/src/net/server/audit/locks/MonitoredLockType.java b/src/net/server/audit/locks/MonitoredLockType.java
index faac688de1..8aa3eb773c 100644
--- a/src/net/server/audit/locks/MonitoredLockType.java
+++ b/src/net/server/audit/locks/MonitoredLockType.java
@@ -26,6 +26,7 @@ package net.server.audit.locks;
public enum MonitoredLockType {
UNDEFINED,
+ INTERVAL,
CHARACTER_CHR,
CHARACTER_CPN,
CHARACTER_EFF,
@@ -96,7 +97,7 @@ public enum MonitoredLockType {
VISITOR_MERCH,
MAP_CHRS,
MAP_OBJS,
- MAP_FACTORY,
+ MAP_MANAGER,
MAP_ITEM,
MAP_LOOT,
MAP_BOUNDS,
diff --git a/src/net/server/channel/Channel.java b/src/net/server/channel/Channel.java
index 71ab69ea0e..17ffdc03a7 100644
--- a/src/net/server/channel/Channel.java
+++ b/src/net/server/channel/Channel.java
@@ -26,7 +26,6 @@ import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.HashSet;
@@ -64,7 +63,6 @@ import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.transport.socket.SocketSessionConfig;
import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
-import provider.MapleDataProviderFactory;
import scripting.event.EventScriptManager;
import server.TimerManager;
import server.events.gm.MapleEvent;
@@ -72,7 +70,7 @@ import server.expeditions.MapleExpedition;
import server.expeditions.MapleExpeditionType;
import server.maps.MapleHiredMerchant;
import server.maps.MapleMap;
-import server.maps.MapleMapFactory;
+import server.maps.MapleMapManager;
import server.maps.MapleMiniDungeon;
import tools.MaplePacketCreator;
import tools.Pair;
@@ -88,7 +86,7 @@ public final class Channel {
private int world, channel;
private IoAcceptor acceptor;
private String ip, serverMessage;
- private MapleMapFactory mapFactory;
+ private MapleMapManager mapManager;
private EventScriptManager eventSM;
private MobStatusScheduler mobStatusSchedulers[] = new MobStatusScheduler[ServerConstants.CHANNEL_LOCKS];
private MobAnimationScheduler mobAnimationSchedulers[] = new MobAnimationScheduler[ServerConstants.CHANNEL_LOCKS];
@@ -108,8 +106,6 @@ public final class Channel {
private int usedDojo = 0;
private Set usedMC = new HashSet<>();
- private ScheduledFuture> respawnTask;
-
private int[] dojoStage;
private long[] dojoFinishTime;
private ScheduledFuture>[] dojoTask;
@@ -142,7 +138,7 @@ public final class Channel {
this.channel = channel;
this.ongoingStartTime = startTime + 10000; // rude approach to a world's last channel boot time, placeholder for the 1st wedding reservation ever
- this.mapFactory = new MapleMapFactory(null, MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Map.wz")), MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")), world, channel);
+ this.mapManager = new MapleMapManager(null, world, channel);
try {
eventSM = new EventScriptManager(this, getEvents());
port = 7575 + this.channel - 1;
@@ -151,7 +147,6 @@ public final class Channel {
IoBuffer.setUseDirectBuffer(false);
IoBuffer.setAllocator(new SimpleBufferAllocator());
acceptor = new NioSocketAcceptor();
- respawnTask = TimerManager.getInstance().register(new respawnMaps(), ServerConstants.RESPAWN_INTERVAL);
acceptor.setHandler(new MapleServerHandler(world, channel));
acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE, 30);
acceptor.getFilterChain().addLast("codec", (IoFilter) new ProtocolCodecFilter(new MapleCodecFactory()));
@@ -204,13 +199,8 @@ public final class Channel {
disconnectAwayPlayers();
players.disconnectAll();
- if(respawnTask != null) {
- respawnTask.cancel(false);
- respawnTask = null;
- }
-
- mapFactory.dispose();
- mapFactory = null;
+ mapManager.dispose();
+ mapManager = null;
eventSM.cancel();
eventSM = null;
@@ -315,8 +305,8 @@ public final class Channel {
}
}
- public MapleMapFactory getMapFactory() {
- return mapFactory;
+ public MapleMapManager getMapFactory() {
+ return mapManager;
}
public int getWorld() {
@@ -417,16 +407,6 @@ public final class Channel {
}
}
- public class respawnMaps implements Runnable {
-
- @Override
- public void run() {
- for (MapleMap map : mapFactory.getMaps().values()) {
- map.respawn();
- }
- }
- }
-
public Map getHiredMerchants() {
merchRlock.lock();
try {
diff --git a/src/net/server/channel/handlers/DueyHandler.java b/src/net/server/channel/handlers/DueyHandler.java
index 72a61948c2..ae2fc17a6e 100644
--- a/src/net/server/channel/handlers/DueyHandler.java
+++ b/src/net/server/channel/handlers/DueyHandler.java
@@ -45,12 +45,12 @@ public final class DueyHandler extends AbstractMaplePacketHandler {
short amount = slea.readShort();
int mesos = slea.readInt();
String recipient = slea.readMapleAsciiString();
-
- DueyProcessor.dueySendItem(c, inventId, itemPos, amount, mesos, recipient);
+ String message = slea.readByte() != 0 ? slea.readMapleAsciiString() : "";
+ DueyProcessor.dueySendItem(c, inventId, itemPos, amount, mesos, message, recipient);
} else if (operation == DueyProcessor.Actions.TOSERVER_REMOVE_PACKAGE.getCode()) {
int packageid = slea.readInt();
- DueyProcessor.dueyRemovePackage(c, packageid);
+ DueyProcessor.dueyRemovePackage(c, packageid, true);
} else if (operation == DueyProcessor.Actions.TOSERVER_CLAIM_PACKAGE.getCode()) {
int packageid = slea.readInt();
diff --git a/src/net/server/channel/handlers/PlayerInteractionHandler.java b/src/net/server/channel/handlers/PlayerInteractionHandler.java
index cb86025992..f2c895e8ef 100644
--- a/src/net/server/channel/handlers/PlayerInteractionHandler.java
+++ b/src/net/server/channel/handlers/PlayerInteractionHandler.java
@@ -94,7 +94,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
ANSWER_TIE(0x33),
GIVE_UP(0x34),
EXIT_AFTER_GAME(0x38),
- CANCEL_EXIT(0x39),
+ CANCEL_EXIT_AFTER_GAME(0x39),
READY(0x3A),
UN_READY(0x3B),
EXPEL(0x3C),
@@ -344,7 +344,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
MapleTrade.cancelTrade(chr, MapleTrade.TradeResult.PARTNER_CANCEL);
} else {
chr.closePlayerShop();
- chr.closeMiniGame();
+ chr.closeMiniGame(false);
chr.closeHiredMerchant(true);
}
} else if (mode == Action.OPEN_STORE.getCode() || mode == Action.OPEN_CASH.getCode()) {
@@ -495,13 +495,14 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
return;
}
- if(ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH && ii.isCash(item.getItemId())) {
- c.announce(MaplePacketCreator.serverNotice(1, "Cash items are not allowed to be traded."));
- return;
- }
-
- if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(item.getItemId())) {
- c.announce(MaplePacketCreator.serverNotice(1, "Pets are not allowed to be traded."));
+ if (ii.isUnmerchable(item.getItemId())) {
+ if (ItemConstants.isPet(item.getItemId())) {
+ c.announce(MaplePacketCreator.serverNotice(1, "Pets are not allowed to be traded."));
+ } else {
+ c.announce(MaplePacketCreator.serverNotice(1, "Cash items are not allowed to be traded."));
+ }
+
+ c.announce(MaplePacketCreator.enableActions());
return;
}
@@ -567,6 +568,15 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
if (ivItem == null || ivItem.isUntradeable()) {
c.announce(MaplePacketCreator.serverNotice(1, "Could not perform shop operation with that item."));
+ c.announce(MaplePacketCreator.enableActions());
+ return;
+ } else if (MapleItemInformationProvider.getInstance().isUnmerchable(ivItem.getItemId())) {
+ if (ItemConstants.isPet(ivItem.getItemId())) {
+ c.announce(MaplePacketCreator.serverNotice(1, "Pets are not allowed to be sold on the Player Store."));
+ } else {
+ c.announce(MaplePacketCreator.serverNotice(1, "Cash items are not allowed to be sold on the Player Store."));
+ }
+
c.announce(MaplePacketCreator.enableActions());
return;
}
@@ -588,17 +598,7 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
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;
}
-
- if(ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH && MapleItemInformationProvider.getInstance().isCash(ivItem.getItemId())) {
- c.announce(MaplePacketCreator.serverNotice(1, "Cash items are not allowed to be sold on the Player Store."));
- return;
- }
- 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 Store."));
- return;
- }
-
Item sellItem = ivItem.copy();
if(!ItemConstants.isRechargeable(ivItem.getItemId())) {
sellItem.setQuantity(perBundle);
@@ -608,8 +608,6 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
MaplePlayerShop shop = chr.getPlayerShop();
MapleHiredMerchant merchant = chr.getHiredMerchant();
if (shop != null && shop.isOwner(chr)) {
- System.out.println(shopItem.getItem().getPet() + " " + shopItem.getItem().getPetId());
- System.out.println(ivItem.getPet() + " " + ivItem.getPetId());
if (shop.isOpen() || !shop.addItem(shopItem)) { // thanks Vcoc for pointing an exploit with unlimited shop slots
c.announce(MaplePacketCreator.serverNotice(1, "You can't sell it anymore."));
return;
@@ -770,10 +768,20 @@ public final class PlayerInteractionHandler extends AbstractMaplePacketHandler {
MapleCharacter visitor = miniGame.getVisitor();
if(visitor != null) {
- visitor.closeMiniGame();
- visitor.announce(MaplePacketCreator.getMiniGameClose(5));
+ visitor.closeMiniGame(false);
+ visitor.announce(MaplePacketCreator.getMiniGameClose(true, 5));
}
}
+ } else if (mode == Action.EXIT_AFTER_GAME.getCode()) {
+ MapleMiniGame miniGame = chr.getMiniGame();
+ if(miniGame != null) {
+ miniGame.setQuitAfterGame(chr, true);
+ }
+ } else if (mode == Action.CANCEL_EXIT_AFTER_GAME.getCode()) {
+ MapleMiniGame miniGame = chr.getMiniGame();
+ if(miniGame != null) {
+ miniGame.setQuitAfterGame(chr, false);
+ }
}
} finally {
c.releaseClient();
diff --git a/src/net/server/channel/handlers/RaiseIncExpHandler.java b/src/net/server/channel/handlers/RaiseIncExpHandler.java
new file mode 100644
index 0000000000..68261b42c0
--- /dev/null
+++ b/src/net/server/channel/handlers/RaiseIncExpHandler.java
@@ -0,0 +1,59 @@
+package net.server.channel.handlers;
+
+import java.util.Map;
+
+import client.MapleClient;
+import client.inventory.MapleInventory;
+import client.inventory.MapleInventoryType;
+import net.AbstractMaplePacketHandler;
+import client.inventory.manipulator.MapleInventoryManipulator;
+import server.MapleItemInformationProvider;
+import server.MapleItemInformationProvider.QuestConsItem;
+import tools.data.input.SeekableLittleEndianAccessor;
+
+/**
+ *
+ * @author Xari
+ * @author Ronan - added concurrency protection and quest progress limit
+ */
+public class RaiseIncExpHandler extends AbstractMaplePacketHandler {
+
+ @Override
+ public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
+ byte inventorytype = slea.readByte();//nItemIT
+ short slot = slea.readShort();//nSlotPosition
+ int itemid = slea.readInt();//nItemID
+
+ if (c.tryacquireClient()) {
+ try {
+ MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
+ QuestConsItem consItem = ii.getQuestConsumablesInfo(itemid);
+ if (consItem == null) {
+ return;
+ }
+
+ int questid = consItem.questid;
+ Map consumables = consItem.items;
+
+ int consId;
+ MapleInventory inv = c.getPlayer().getInventory(MapleInventoryType.getByType(inventorytype));
+ inv.lockInventory();
+ try {
+ consId = inv.getItem(slot).getItemId();
+ if (!consumables.containsKey(consId) || !c.getPlayer().haveItem(consId)) {
+ return;
+ }
+
+ MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.getByType(inventorytype), (short) slot, (short) 1, false, true);
+ } finally {
+ inv.unlockInventory();
+ }
+
+ int nextValue = Math.min(consumables.get(consId) + Integer.parseInt(c.getPlayer().getQuestInfo(questid)), consItem.exp * consItem.grade);
+ c.getPlayer().updateQuestInfo(questid, "" + nextValue);
+ } finally {
+ c.releaseClient();
+ }
+ }
+ }
+}
diff --git a/src/net/server/channel/handlers/RaiseUIStateHandler.java b/src/net/server/channel/handlers/RaiseUIStateHandler.java
new file mode 100644
index 0000000000..d5add73e1e
--- /dev/null
+++ b/src/net/server/channel/handlers/RaiseUIStateHandler.java
@@ -0,0 +1,37 @@
+package net.server.channel.handlers;
+
+import client.MapleClient;
+import client.MapleQuestStatus;
+import net.AbstractMaplePacketHandler;
+import server.quest.MapleQuest;
+import tools.MaplePacketCreator;
+import tools.data.input.SeekableLittleEndianAccessor;
+
+/**
+ *
+ * @author Xari
+ */
+public class RaiseUIStateHandler extends AbstractMaplePacketHandler {
+
+ @Override
+ public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
+ int questid = slea.readShort();
+
+ if (c.tryacquireClient()) {
+ try {
+ MapleQuest quest = MapleQuest.getInstance(questid);
+ MapleQuestStatus mqs = c.getPlayer().getQuest(quest);
+ if (mqs.getStatus() == MapleQuestStatus.Status.NOT_STARTED) {
+ quest.forceStart(c.getPlayer(), 22000);
+ c.getPlayer().updateQuestInfo(quest.getId(), "0");
+ } else if (mqs.getStatus() == MapleQuestStatus.Status.STARTED) {
+ c.announce(MaplePacketCreator.updateQuest(mqs, false));
+ } else {
+ //c.announce(MaplePacketCreator.updateQuestInfo(mqs.getQuestID(), 22000, "0"));
+ }
+ } finally {
+ c.releaseClient();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/net/server/channel/handlers/RingActionHandler.java b/src/net/server/channel/handlers/RingActionHandler.java
index dc7676c39a..35e81c7919 100644
--- a/src/net/server/channel/handlers/RingActionHandler.java
+++ b/src/net/server/channel/handlers/RingActionHandler.java
@@ -422,8 +422,8 @@ public final class RingActionHandler extends AbstractMaplePacketHandler {
Item weddingTicket = new Item(newItemId, (short) 0, (short) 1);
weddingTicket.setExpiration(expiration);
-
- DueyProcessor.addItemToDB(weddingTicket, 1, 0, groom, guest);
+
+ DueyProcessor.dueyCreatePackage(weddingTicket, 0, groom, guest);
}
} else {
c.getPlayer().dropMessage(5, "Wedding is already under way. You cannot invite any more guests for the event.");
diff --git a/src/net/server/channel/handlers/SkillBookHandler.java b/src/net/server/channel/handlers/SkillBookHandler.java
index 919d9c5fa8..0fdca86ff1 100644
--- a/src/net/server/channel/handlers/SkillBookHandler.java
+++ b/src/net/server/channel/handlers/SkillBookHandler.java
@@ -26,6 +26,7 @@ import client.MapleClient;
import client.Skill;
import client.SkillFactory;
import client.inventory.Item;
+import client.inventory.MapleInventory;
import client.inventory.MapleInventoryType;
import java.util.Map;
import net.AbstractMaplePacketHandler;
@@ -41,38 +42,57 @@ public final class SkillBookHandler extends AbstractMaplePacketHandler {
c.announce(MaplePacketCreator.enableActions());
return;
}
+
slea.readInt();
short slot = (short) slea.readShort();
int itemId = slea.readInt();
+
+ boolean canuse;
+ boolean success = false;
+ int skill = 0;
+ int maxlevel = 0;
+
MapleCharacter player = c.getPlayer();
- Item toUse = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot);
- if (toUse != null && toUse.getQuantity() == 1) {
- if (toUse.getItemId() != itemId) {
- return;
- }
- Map skilldata = MapleItemInformationProvider.getInstance().getSkillStats(toUse.getItemId(), c.getPlayer().getJob().getId());
- boolean canuse;
- boolean success = false;
- int skill = 0;
- int maxlevel = 0;
- if (skilldata == null) {
- return;
- }
- Skill skill2 = SkillFactory.getSkill(skilldata.get("skillid"));
- if (skilldata.get("skillid") == 0) {
- canuse = false;
- } else if ((player.getSkillLevel(skill2) >= skilldata.get("reqSkillLevel") || skilldata.get("reqSkillLevel") == 0) && player.getMasterLevel(skill2) < skilldata.get("masterLevel")) {
- canuse = true;
- if (MapleItemInformationProvider.rollSuccessChance(skilldata.get("success"))) {
- success = true;
- player.changeSkillLevel(skill2, player.getSkillLevel(skill2), Math.max(skilldata.get("masterLevel"), player.getMasterLevel(skill2)), -1);
- } else {
- success = false;
- //player.dropMessage("The skill book lights up, but the skill winds up as if nothing happened.");
+ if (c.tryacquireClient()) {
+ try {
+ MapleInventory inv = c.getPlayer().getInventory(MapleInventoryType.USE);
+ Item toUse = inv.getItem(slot);
+ if (toUse == null || toUse.getItemId() != itemId) {
+ return;
}
- MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
- } else {
- canuse = false;
+ Map skilldata = MapleItemInformationProvider.getInstance().getSkillStats(toUse.getItemId(), c.getPlayer().getJob().getId());
+ if (skilldata == null) {
+ return;
+ }
+ Skill skill2 = SkillFactory.getSkill(skilldata.get("skillid"));
+ if (skilldata.get("skillid") == 0) {
+ canuse = false;
+ } else if ((player.getSkillLevel(skill2) >= skilldata.get("reqSkillLevel") || skilldata.get("reqSkillLevel") == 0) && player.getMasterLevel(skill2) < skilldata.get("masterLevel")) {
+ inv.lockInventory();
+ try {
+ Item used = inv.getItem(slot);
+ if (used != toUse || toUse.getQuantity() < 1) { // thanks ClouD for noticing skillbooks not being usable when stacked
+ return;
+ }
+
+ MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, slot, (short) 1, false);
+ } finally {
+ inv.unlockInventory();
+ }
+
+ canuse = true;
+ if (MapleItemInformationProvider.rollSuccessChance(skilldata.get("success"))) {
+ success = true;
+ player.changeSkillLevel(skill2, player.getSkillLevel(skill2), Math.max(skilldata.get("masterLevel"), player.getMasterLevel(skill2)), -1);
+ } else {
+ success = false;
+ //player.dropMessage("The skill book lights up, but the skill winds up as if nothing happened.");
+ }
+ } else {
+ canuse = false;
+ }
+ } finally {
+ c.releaseClient();
}
// thanks Vcoc for noting skill book result not showing for all in area
diff --git a/src/net/server/channel/handlers/SpecialMoveHandler.java b/src/net/server/channel/handlers/SpecialMoveHandler.java
index b40b5ab874..46e0020c8b 100644
--- a/src/net/server/channel/handlers/SpecialMoveHandler.java
+++ b/src/net/server/channel/handlers/SpecialMoveHandler.java
@@ -101,6 +101,7 @@ public final class SpecialMoveHandler extends AbstractMaplePacketHandler {
monster.aggroClearDamages();
monster.aggroMonsterDamage(chr, 1);
+ // thanks onechord for pointing out Magnet disconnecting the caster (issue would actually happen upon failing to catch mob)
monster.aggroSwitchController(chr, true);
}
}
@@ -133,12 +134,20 @@ public final class SpecialMoveHandler extends AbstractMaplePacketHandler {
} else {
skill.getEffect(skillLevel).applyEchoOfHero(chr);
}
- } else if(chr.canDoor()) {
- //update door lists
- chr.cancelMagicDoor();
- skill.getEffect(skillLevel).applyTo(chr, pos);
} else {
- chr.message("Please wait 5 seconds before casting Mystic Door again.");
+ if (c.tryacquireClient()) {
+ try {
+ if (chr.canDoor()) {
+ chr.cancelMagicDoor();
+ skill.getEffect(skillLevel).applyTo(chr, pos);
+ } else {
+ chr.message("Please wait 5 seconds before casting Mystic Door again.");
+ }
+ } finally {
+ c.releaseClient();
+ }
+ }
+
c.announce(MaplePacketCreator.enableActions());
}
} else {
diff --git a/src/net/server/channel/handlers/UseCashItemHandler.java b/src/net/server/channel/handlers/UseCashItemHandler.java
index 11e8a63ca8..9b03ecf0ef 100644
--- a/src/net/server/channel/handlers/UseCashItemHandler.java
+++ b/src/net/server/channel/handlers/UseCashItemHandler.java
@@ -36,6 +36,7 @@ import client.inventory.ModifyInventory;
import client.inventory.manipulator.MapleInventoryManipulator;
import client.inventory.manipulator.MapleKarmaManipulator;
import client.processor.AssignAPProcessor;
+import client.processor.DueyProcessor;
import constants.GameConstants;
import constants.ItemConstants;
import constants.ServerConstants;
@@ -47,7 +48,6 @@ import java.util.List;
import net.AbstractMaplePacketHandler;
import net.server.Server;
-import scripting.npc.NPCScriptManager;
import server.MapleItemInformationProvider;
import server.MapleShop;
import server.MapleShopFactory;
@@ -130,7 +130,7 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
if (victim != null) {
MapleMap targetMap = victim.getMap();
if (!FieldLimit.CANNOTVIPROCK.check(targetMap.getFieldLimit()) && (targetMap.getForcedReturnId() == 999999999 || targetMap.getId() < 100000000)) {
- if (victim.gmLevel() <= player.gmLevel()) {
+ if (!victim.isGM() || victim.gmLevel() <= player.gmLevel()) { // thanks Yoboes for noticing non-GM's being unreachable through rocks
player.forceChangeMap(targetMap, targetMap.findClosestPlayerSpawnpoint(victim.getPosition()));
success = true;
} else {
@@ -294,7 +294,7 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
if (item == null) //hack
{
return;
- } else if (item.isUntradeable()) {
+ } else if (item.isUntradeable() || ii.isUnmerchable(item.getItemId())) {
player.dropMessage(1, "You cannot trade this item.");
c.announce(MaplePacketCreator.enableActions());
return;
@@ -398,7 +398,7 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
ii.getItemEffect(itemId).applyTo(player);
remove(c, position, itemId);
} else if (itemType == 533) {
- NPCScriptManager.getInstance().start(c, 9010009, null);
+ DueyProcessor.dueySendTalk(c);
} else if (itemType == 537) {
if (GameConstants.isFreeMarketRoom(player.getMapId())) {
player.dropMessage(5, "You cannot use the chalkboard here.");
@@ -409,7 +409,7 @@ public final class UseCashItemHandler extends AbstractMaplePacketHandler {
player.setChalkboard(slea.readMapleAsciiString());
player.getMap().broadcastMessage(MaplePacketCreator.useChalkboard(player, false));
player.getClient().announce(MaplePacketCreator.enableActions());
- remove(c, position, itemId);
+ //remove(c, position, itemId); thanks Conrad for noticing chalkboards shouldn't be depleted upon use
} else if (itemType == 539) {
List strLines = new LinkedList<>();
for (int i = 0; i < 4; i++) {
diff --git a/src/net/server/channel/handlers/UseItemCanvasHandler.java b/src/net/server/channel/handlers/UseItemCanvasHandler.java
deleted file mode 100644
index c266d97b4d..0000000000
--- a/src/net/server/channel/handlers/UseItemCanvasHandler.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package net.server.channel.handlers;
-
-import client.MapleClient;
-import net.AbstractMaplePacketHandler;
-import tools.data.input.SeekableLittleEndianAccessor;
-import tools.MaplePacketCreator;
-
-public final class UseItemCanvasHandler extends AbstractMaplePacketHandler {
-
- @Override
- public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
- c.announce(MaplePacketCreator.enableActions());
- }
-}
\ No newline at end of file
diff --git a/src/net/server/coordinator/MapleMonsterAggroCoordinator.java b/src/net/server/coordinator/MapleMonsterAggroCoordinator.java
index 97a485cd1b..64452f58c5 100644
--- a/src/net/server/coordinator/MapleMonsterAggroCoordinator.java
+++ b/src/net/server/coordinator/MapleMonsterAggroCoordinator.java
@@ -237,7 +237,9 @@ public class MapleMonsterAggroCoordinator {
}
if (mobAggro.isEmpty()) { // all aggro on this mob expired
- am.getLeft().aggroResetAggro();
+ if (!am.getLeft().isBoss()) {
+ am.getLeft().aggroResetAggro();
+ }
}
}
diff --git a/src/net/server/coordinator/MaplePartySearchCoordinator.java b/src/net/server/coordinator/MaplePartySearchCoordinator.java
index bf3ec62aef..28bbd78918 100644
--- a/src/net/server/coordinator/MaplePartySearchCoordinator.java
+++ b/src/net/server/coordinator/MaplePartySearchCoordinator.java
@@ -64,6 +64,10 @@ public class MaplePartySearchCoordinator {
private Map searchLeaders = new HashMap<>();
private Map searchSettings = new HashMap<>();
+ private Map timeoutLeaders = new HashMap<>();
+
+ private int updateCount = 0;
+
private static Map> mapNeighbors = fetchNeighbouringMaps();
private static Map jobTable = instantiateJobTable();
@@ -245,11 +249,21 @@ public class MaplePartySearchCoordinator {
addQueueLeader(leader);
}
+ private void registerPartyLeader(MapleCharacter leader, LeaderSearchMetadata settings) {
+ if (searchLeaders.containsKey(leader.getId())) return;
+
+ searchSettings.put(leader.getId(), settings);
+ searchLeaders.put(leader.getId(), leader);
+ addQueueLeader(leader);
+ }
+
public void unregisterPartyLeader(MapleCharacter leader) {
MapleCharacter toRemove = searchLeaders.remove(leader.getId());
if (toRemove != null) {
removeQueueLeader(toRemove);
searchSettings.remove(leader.getId());
+ } else {
+ unregisterLongTermPartyLeader(leader);
}
}
@@ -307,6 +321,41 @@ public class MaplePartySearchCoordinator {
return new Pair<>(queuedLeaders, nextLeaders);
}
+ private void registerLongTermPartyLeaders(List> recycledLeaders) {
+ leaderQueueRLock.lock();
+ try {
+ for (Pair p : recycledLeaders) {
+ timeoutLeaders.put(p.getLeft(), p.getRight());
+ }
+ } finally {
+ leaderQueueRLock.unlock();
+ }
+ }
+
+ private void unregisterLongTermPartyLeader(MapleCharacter leader) {
+ leaderQueueRLock.lock();
+ try {
+ timeoutLeaders.remove(leader);
+ } finally {
+ leaderQueueRLock.unlock();
+ }
+ }
+
+ private void reinstateLongTermPartyLeaders() {
+ Map timeoutLeadersCopy;
+ leaderQueueWLock.lock();
+ try {
+ timeoutLeadersCopy = new HashMap<>(timeoutLeaders);
+ timeoutLeaders.clear();
+ } finally {
+ leaderQueueWLock.unlock();
+ }
+
+ for (Entry e : timeoutLeadersCopy.entrySet()) {
+ registerPartyLeader(e.getKey(), e.getValue());
+ }
+ }
+
public void runPartySearch() {
Pair
, List> queuedLeaders = fetchQueuedLeaders();
@@ -356,10 +405,28 @@ public class MaplePartySearchCoordinator {
}
}
+ List> recycledLeaders = new LinkedList<>();
for (MapleCharacter leader : expiredLeaders) {
- if (leader.isLoggedinWorld()) leader.dropMessage(5, "Your Party Search token session expired, please stop your Party Search and retry again later.");
searchLeaders.remove(leader.getId());
- searchSettings.remove(leader.getId());
+ LeaderSearchMetadata settings = searchSettings.remove(leader.getId());
+
+ if (leader.isLoggedinWorld()) {
+ if (settings != null) {
+ recycledLeaders.add(new Pair<>(leader, settings));
+ if (ServerConstants.USE_DEBUG && leader.isGM()) leader.dropMessage(5, "Your Party Search token session is now on waiting queue for up to 7 minutes, to get it working right away please stop your Party Search and retry again later.");
+ } else {
+ leader.dropMessage(5, "Your Party Search token session expired, please stop your Party Search and retry again later.");
+ }
+ }
+ }
+
+ if (!recycledLeaders.isEmpty()) {
+ registerLongTermPartyLeaders(recycledLeaders);
+ }
+
+ updateCount++;
+ if (updateCount % 77 == 0) {
+ reinstateLongTermPartyLeaders();
}
}
diff --git a/src/net/server/coordinator/partysearch/PartySearchStorage.java b/src/net/server/coordinator/partysearch/PartySearchStorage.java
index 4b9d06b32d..4127af9b5f 100644
--- a/src/net/server/coordinator/partysearch/PartySearchStorage.java
+++ b/src/net/server/coordinator/partysearch/PartySearchStorage.java
@@ -34,8 +34,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.MonitoredReentrantReadWriteLock;
-
-import java.awt.geom.Line2D;
+import tools.IntervalBuilder;
/**
*
@@ -44,84 +43,7 @@ import java.awt.geom.Line2D;
public class PartySearchStorage {
private List storage = new ArrayList<>(20);
- private PartySearchEmptyIntervals emptyManager = new PartySearchEmptyIntervals();
-
- private class PartySearchEmptyIntervals {
-
- private List emptyLimits = new ArrayList<>();
-
- private void refitEmptyIntervals(int st, int en, int minLevel, int maxLevel) {
- List checkLimits = new ArrayList<>(emptyLimits.subList(st, en));
-
- float newLimitX1, newLimitX2;
- if (!checkLimits.isEmpty()) {
- Line2D firstLimit = checkLimits.get(0);
- Line2D lastLimit = checkLimits.get(checkLimits.size() - 1);
-
- newLimitX1 = (float) ((minLevel < firstLimit.getX1()) ? minLevel : firstLimit.getX1());
- newLimitX2 = (float) ((maxLevel > lastLimit.getX2()) ? maxLevel : lastLimit.getX2());
-
- for (Line2D limit : checkLimits) {
- emptyLimits.remove(st);
- }
- } else {
- newLimitX1 = minLevel;
- newLimitX2 = maxLevel;
- }
-
- emptyLimits.add(st, new Line2D.Float((float) newLimitX1, 0, (float) newLimitX2, 0));
- }
-
- private int bsearchInterval(int level) {
- int st = 0, en = emptyLimits.size() - 1;
-
- int mid, idx;
- while (en >= st) {
- idx = (st + en) / 2;
- mid = (int) emptyLimits.get(idx).getX1();
-
- if (mid == level) {
- return idx;
- } else if (mid < level) {
- st = idx + 1;
- } else {
- en = idx - 1;
- }
- }
-
- return en;
- }
-
- public void addEmptyInterval(int fromLevel, int toLevel) {
- synchronized (emptyLimits) { // adding intervals occurs on a same-thread process, so this is actually not performance grinding
- int st = bsearchInterval(fromLevel);
- if (st < 0) {
- st = 0;
- } else if (emptyLimits.get(st).getX2() < fromLevel) {
- st += 1;
- }
-
- int en = bsearchInterval(toLevel);
- if (en < st) en = st - 1;
-
- refitEmptyIntervals(st, en + 1, fromLevel, toLevel);
- }
- }
-
- public boolean isInEmptyInterval(int minLevel, int maxLevel) {
- synchronized (emptyLimits) {
- int idx = bsearchInterval(minLevel);
- return idx >= 0 && maxLevel <= emptyLimits.get(idx).getX2();
- }
- }
-
- public void clearEmptyInterval() {
- synchronized (emptyLimits) {
- emptyLimits.clear();
- }
- }
-
- }
+ private IntervalBuilder emptyIntervals = new IntervalBuilder();
private final ReentrantReadWriteLock psLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.WORLD_PARTY_SEARCH_STORAGE, true);
private final ReadLock psRLock = psLock.readLock();
@@ -183,7 +105,7 @@ public class PartySearchStorage {
psWLock.unlock();
}
- emptyManager.clearEmptyInterval();
+ emptyIntervals.clear();
}
private static int bsearchStorage(List storage, int level) {
@@ -207,7 +129,7 @@ public class PartySearchStorage {
}
public MapleCharacter callPlayer(int callerCid, int callerMapid, int minLevel, int maxLevel) {
- if (emptyManager.isInEmptyInterval(minLevel, maxLevel)) {
+ if (emptyIntervals.inInterval(minLevel, maxLevel)) {
return null;
}
@@ -230,7 +152,7 @@ public class PartySearchStorage {
}
}
- emptyManager.addEmptyInterval(minLevel, maxLevel);
+ emptyIntervals.addInterval(minLevel, maxLevel);
return null;
}
diff --git a/src/net/server/handlers/login/AfterLoginHandler.java b/src/net/server/handlers/login/AfterLoginHandler.java
index 925d9aeca2..5b2536e16c 100644
--- a/src/net/server/handlers/login/AfterLoginHandler.java
+++ b/src/net/server/handlers/login/AfterLoginHandler.java
@@ -37,7 +37,7 @@ public final class AfterLoginHandler extends AbstractMaplePacketHandler {
c3 = slea.readByte();
}
if (c2 == 1 && c3 == 1) {
- if (c.getPin() == null) {
+ if (c.getPin() == null || c.getPin().equals("")) {
c.announce(MaplePacketCreator.registerPin());
} else {
c.announce(MaplePacketCreator.requestPin());
diff --git a/src/scripting/AbstractPlayerInteraction.java b/src/scripting/AbstractPlayerInteraction.java
index 1d118e8c67..2fe19c8f1f 100644
--- a/src/scripting/AbstractPlayerInteraction.java
+++ b/src/scripting/AbstractPlayerInteraction.java
@@ -457,6 +457,64 @@ public class AbstractPlayerInteraction {
getClient().announce(MaplePacketCreator.updateQuest(getPlayer().getQuest(MapleQuest.getInstance(qid)), false));
}
+ public boolean forceStartQuest(int id) {
+ return forceStartQuest(id, 9010000);
+ }
+
+ public boolean forceStartQuest(int id, int npc) {
+ return startQuest(id, npc);
+ }
+
+ public boolean forceCompleteQuest(int id) {
+ return forceCompleteQuest(id, 9010000);
+ }
+
+ public boolean forceCompleteQuest(int id, int npc) {
+ return completeQuest(id, npc);
+ }
+
+ public boolean startQuest(short id) {
+ return startQuest((int) id);
+ }
+
+ public boolean completeQuest(short id) {
+ return completeQuest((int) id);
+ }
+
+ public boolean startQuest(int id) {
+ return startQuest(id, 9010000);
+ }
+
+ public boolean completeQuest(int id) {
+ return completeQuest(id, 9010000);
+ }
+
+ public boolean startQuest(short id, int npcId) {
+ return startQuest((int) id, npcId);
+ }
+
+ public boolean completeQuest(short id, int npcId) {
+ return completeQuest((int) id, npcId);
+ }
+
+ public boolean startQuest(int id, int npcId) {
+ try {
+ return MapleQuest.getInstance(id).forceStart(getPlayer(), npcId);
+ } catch (NullPointerException ex) {
+ ex.printStackTrace();
+ return false;
+ }
+ }
+
+ public boolean completeQuest(int id, int npcId) {
+ try {
+ return MapleQuest.getInstance(id).forceComplete(getPlayer(), npcId);
+ } catch (NullPointerException ex) {
+ ex.printStackTrace();
+ return false;
+ }
+ }
+
public Item evolvePet(byte slot, int afterId) {
MaplePet evolved = null;
MaplePet target;
diff --git a/src/scripting/event/EventInstanceManager.java b/src/scripting/event/EventInstanceManager.java
index 695e4d4962..c710dc1f71 100644
--- a/src/scripting/event/EventInstanceManager.java
+++ b/src/scripting/event/EventInstanceManager.java
@@ -21,7 +21,6 @@
*/
package scripting.event;
-import java.io.File;
import tools.Pair;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -40,14 +39,13 @@ import net.server.audit.locks.MonitoredReentrantReadWriteLock;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
import net.server.world.MapleParty;
import net.server.world.MaplePartyCharacter;
-import provider.MapleDataProviderFactory;
import server.MaplePortal;
import server.TimerManager;
import server.MapleStatEffect;
import server.expeditions.MapleExpedition;
import server.life.MapleMonster;
import server.maps.MapleMap;
-import server.maps.MapleMapFactory;
+import server.maps.MapleMapManager;
import server.maps.MapleReactor;
import client.MapleCharacter;
import client.SkillFactory;
@@ -82,7 +80,7 @@ public class EventInstanceManager {
private Map killCount = new HashMap<>();
private EventManager em;
private EventScriptScheduler ess;
- private MapleMapFactory mapFactory;
+ private MapleMapManager mapManager;
private String name;
private Properties props = new Properties();
private Map objectProps = new HashMap<>();
@@ -125,8 +123,7 @@ public class EventInstanceManager {
this.em = em;
this.name = name;
this.ess = new EventScriptScheduler();
- mapFactory = new MapleMapFactory(this, MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Map.wz")), MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")), (byte) 0, (byte) 1);//Fk this
- mapFactory.setChannel(em.getChannelServer().getId());
+ this.mapManager = new MapleMapManager(this, em.getWorldServer().getId(), em.getChannelServer().getId());
}
public void setName(String name) {
@@ -647,10 +644,10 @@ public class EventInstanceManager {
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
- mapFactory.dispose(); // issues from instantly disposing some event objects found thanks to MedicOP
+ mapManager.dispose(); // issues from instantly disposing some event objects found thanks to MedicOP
wL.lock();
try {
- mapFactory = null;
+ mapManager = null;
em = null;
} finally {
wL.unlock();
@@ -675,8 +672,8 @@ public class EventInstanceManager {
sL = sL.dispose();
}
- public MapleMapFactory getMapFactory() {
- return mapFactory;
+ public MapleMapManager getMapFactory() {
+ return mapManager;
}
public void schedule(final String methodName, long delay) {
@@ -706,10 +703,10 @@ public class EventInstanceManager {
}
public MapleMap getMapInstance(int mapId) {
- MapleMap map = mapFactory.getMap(mapId);
+ MapleMap map = mapManager.getMap(mapId);
map.setEventInstance(this);
- if (!mapFactory.isMapLoaded(mapId)) {
+ if (!mapManager.isMapLoaded(mapId)) {
sL.lock();
try {
if (em.getProperty("shuffleReactors") != null && em.getProperty("shuffleReactors").equals("true")) {
diff --git a/src/scripting/npc/NPCConversationManager.java b/src/scripting/npc/NPCConversationManager.java
index f341b4b77c..0caf491768 100644
--- a/src/scripting/npc/NPCConversationManager.java
+++ b/src/scripting/npc/NPCConversationManager.java
@@ -41,10 +41,9 @@ import server.gachapon.MapleGachapon;
import server.gachapon.MapleGachapon.MapleGachaponItem;
import server.life.MaplePlayerNPC;
import server.maps.MapleMap;
-import server.maps.MapleMapFactory;
+import server.maps.MapleMapManager;
import server.partyquest.Pyramid;
import server.partyquest.Pyramid.PyramidMode;
-import server.quest.MapleQuest;
import tools.LogHelper;
import tools.MaplePacketCreator;
import client.MapleCharacter;
@@ -63,9 +62,11 @@ import constants.LanguageConstants;
import net.server.PlayerStorage;
import net.server.channel.Channel;
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
+import server.MapleMarriage;
import server.MapleSkillbookInformationProvider;
import server.MapleSkillbookInformationProvider.SkillBookEntry;
import server.TimerManager;
+import server.life.MapleLifeFactory;
import server.maps.MapleMapObject;
import server.maps.MapleMapObjectType;
import server.expeditions.MapleExpedition;
@@ -77,10 +78,11 @@ import tools.packets.Wedding;
import java.awt.Point;
import java.util.Arrays;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
-import server.MapleMarriage;
/**
*
@@ -95,6 +97,18 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
private boolean itemScript;
private List otherParty;
+ private static Map npcDefaultTalks = new HashMap<>();
+
+ private static String getDefaultTalk(int npcid) {
+ String talk = npcDefaultTalks.get(npcid);
+ if (talk == null) {
+ talk = MapleLifeFactory.getNPCDefaultTalk(npcid);
+ npcDefaultTalks.put(npcid, talk);
+ }
+
+ return talk;
+ }
+
public NPCConversationManager(MapleClient c, int npc, String scriptName) {
this(c, npc, -1, scriptName, false);
}
@@ -154,6 +168,10 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
public void sendOk(String text) {
getClient().announce(MaplePacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00", (byte) 0));
}
+
+ public void sendDefault() {
+ sendOk(getDefaultTalk(npc));
+ }
public void sendYesNo(String text) {
getClient().announce(MaplePacketCreator.getNPCTalk(npc, (byte) 1, text, "", (byte) 0));
@@ -196,7 +214,12 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
public void sendStyle(String text, int styles[]) {
- getClient().announce(MaplePacketCreator.getNPCTalkStyle(npc, text, styles));
+ if (styles.length > 0) {
+ getClient().announce(MaplePacketCreator.getNPCTalkStyle(npc, text, styles));
+ } else { // thanks Conrad for noticing empty styles crashing players
+ sendOk("Sorry, there are no options of cosmetics available for you here at the moment.");
+ dispose();
+ }
}
public void sendGetNumber(String text, int def, int min, int max) {
@@ -236,76 +259,34 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
return getPlayer().getJob();
}
- public void startQuest(short id) {
- try {
- MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
- }
-
- public void completeQuest(short id) {
- try {
- MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
- }
-
+ @Override
public boolean forceStartQuest(int id) {
- return MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
+ return forceStartQuest(id, npc);
}
-
+
+ @Override
public boolean forceCompleteQuest(int id) {
- return MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
+ return forceCompleteQuest(id, npc);
}
- public void startQuest(int id) {
- try {
- MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
- }
-
- public void completeQuest(int id) {
- try {
- MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
- }
-
- public void startQuest(short id, int npcId) {
- try {
- MapleQuest.getInstance(id).forceStart(getPlayer(), npcId);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
+ @Override
+ public boolean startQuest(short id) {
+ return startQuest((int) id);
}
- public void startQuest(int id, int npcId) {
- try {
- MapleQuest.getInstance(id).forceStart(getPlayer(), npcId);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
+ @Override
+ public boolean completeQuest(short id) {
+ return completeQuest((int) id);
}
- public void completeQuest(short id, int npcId) {
- try {
- MapleQuest.getInstance(id).forceComplete(getPlayer(), npcId);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
+ @Override
+ public boolean startQuest(int id) {
+ return startQuest(id, npc);
}
- public void completeQuest(int id, int npcId) {
- try {
- MapleQuest.getInstance(id).forceComplete(getPlayer(), npcId);
- } catch (NullPointerException ex) {
- ex.printStackTrace();
- }
+ @Override
+ public boolean completeQuest(int id) {
+ return completeQuest(id, npc);
}
public int getMeso() {
@@ -538,7 +519,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
PyramidMode mod = PyramidMode.valueOf(mode);
MapleParty partyz = getPlayer().getParty();
- MapleMapFactory mf = c.getChannelServer().getMapFactory();
+ MapleMapManager mapManager = c.getChannelServer().getMapFactory();
MapleMap map = null;
int mapid = 926010100;
@@ -548,7 +529,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
mapid += (mod.getMode() * 1000);
for (byte b = 0; b < 5; b++) {//They cannot warp to the next map before the timer ends (:
- map = mf.getMap(mapid + b);
+ map = mapManager.getMap(mapid + b);
if (map.getCharacters().size() > 0) {
continue;
} else {
diff --git a/src/scripting/npc/NPCScriptManager.java b/src/scripting/npc/NPCScriptManager.java
index ecda65e399..910f49bd9b 100644
--- a/src/scripting/npc/NPCScriptManager.java
+++ b/src/scripting/npc/NPCScriptManager.java
@@ -92,14 +92,8 @@ public class NPCScriptManager extends AbstractScriptManager {
cms.put(c, cm);
Invocable iv = null;
iv = getInvocable("npc/" + filename + ".js", c);
- NPCScriptManager npcsm = NPCScriptManager.getInstance();
- if (iv == null || NPCScriptManager.getInstance() == null) {
- c.getPlayer().dropMessage(1, npc + "");
- cm.dispose();
- return;
- }
- if (iv == null || npcsm == null) {
+ if (iv == null) {
c.getPlayer().dropMessage(1, npc + "");
cm.dispose();
return;
@@ -147,7 +141,7 @@ public class NPCScriptManager extends AbstractScriptManager {
iv = getInvocable("npc/" + npc + ".js", c);
cm.resetItemScript();
}
- if (iv == null || NPCScriptManager.getInstance() == null) {
+ if (iv == null) {
dispose(c);
return false;
}
@@ -166,7 +160,6 @@ public class NPCScriptManager extends AbstractScriptManager {
} else {
c.announce(MaplePacketCreator.enableActions());
}
-
return true;
} catch (final UndeclaredThrowableException | ScriptException ute) {
FilePrinter.printError(FilePrinter.NPC + npc + ".txt", ute);
diff --git a/src/scripting/portal/PortalPlayerInteraction.java b/src/scripting/portal/PortalPlayerInteraction.java
index 8ed88997a8..15b770555e 100644
--- a/src/scripting/portal/PortalPlayerInteraction.java
+++ b/src/scripting/portal/PortalPlayerInteraction.java
@@ -82,22 +82,6 @@ public class PortalPlayerInteraction extends AbstractPlayerInteraction {
return getPlayer().getLevel() >= 30;
}
- public boolean forceStartQuest(int id) {
- return forceStartQuest(id, 9010000);
- }
-
- public boolean forceStartQuest(int id, int npc) {
- return MapleQuest.getInstance(id).forceStart(getPlayer(), npc);
- }
-
- public boolean forceCompleteQuest(int id) {
- return forceCompleteQuest(id, 9010000);
- }
-
- public boolean forceCompleteQuest(int id, int npc) {
- return MapleQuest.getInstance(id).forceComplete(getPlayer(), npc);
- }
-
public void blockPortal() {
c.getPlayer().blockPortal(getPortal().getScriptName());
}
diff --git a/src/server/DueyPackages.java b/src/server/DueyPackage.java
similarity index 87%
rename from src/server/DueyPackages.java
rename to src/server/DueyPackage.java
index 868c160eae..0aba4868f8 100644
--- a/src/server/DueyPackages.java
+++ b/src/server/DueyPackage.java
@@ -24,21 +24,22 @@ package server;
import client.inventory.Item;
import java.util.Calendar;
-public class DueyPackages {
+public class DueyPackage {
private String sender = null;
private Item item = null;
private int mesos = 0;
+ private String message = "";
private int day;
private int month;
private int year;
private int packageId = 0;
- public DueyPackages(int pId, Item item) {
+ public DueyPackage(int pId, Item item) {
this.item = item;
packageId = pId;
}
- public DueyPackages(int pId) { // Meso only package.
+ public DueyPackage(int pId) { // Meso only package.
this.packageId = pId;
}
@@ -61,6 +62,14 @@ public class DueyPackages {
public void setMesos(int set) {
mesos = set;
}
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String m) {
+ message = m;
+ }
public int getPackageId() {
return packageId;
diff --git a/src/server/MapleItemInformationProvider.java b/src/server/MapleItemInformationProvider.java
index af56453398..1e1d5f2770 100644
--- a/src/server/MapleItemInformationProvider.java
+++ b/src/server/MapleItemInformationProvider.java
@@ -136,6 +136,7 @@ public class MapleItemInformationProvider {
protected Map> skillUpgradeCache = new HashMap<>();
protected Map skillUpgradeInfoCache = new HashMap<>();
protected Map>> cashPetFoodCache = new HashMap<>();
+ protected Map questItemConsCache = new HashMap<>();
private MapleItemInformationProvider() {
loadCardIdData();
@@ -1381,12 +1382,6 @@ public class MapleItemInformationProvider {
return partyquestItem;
}
- public int getQuestIdFromItem(int itemId) {
- MapleData data = getItemData(itemId);
- int questItem = MapleDataTool.getIntConvert("info/quest", data, 0);
- return questItem;
- }
-
private void loadCardIdData() {
PreparedStatement ps = null;
ResultSet rs = null;
@@ -1440,9 +1435,10 @@ public class MapleItemInformationProvider {
if ((itemId / 10000) != 243) {
return null;
}
- ScriptedItem script = new ScriptedItem(MapleDataTool.getInt("spec/npc", getItemData(itemId), 0),
- MapleDataTool.getString("spec/script", getItemData(itemId), ""),
- MapleDataTool.getInt("spec/runOnPickup", getItemData(itemId), 0) == 1);
+ MapleData itemInfo = getItemData(itemId);
+ ScriptedItem script = new ScriptedItem(MapleDataTool.getInt("spec/npc", itemInfo, 0),
+ MapleDataTool.getString("spec/script", itemInfo, ""),
+ MapleDataTool.getInt("spec/runOnPickup", itemInfo, 0) == 1);
scriptedItemCache.put(itemId, script);
return scriptedItemCache.get(itemId);
}
@@ -1594,6 +1590,18 @@ public class MapleItemInformationProvider {
eq.getWatk() > 0 || eq.getMatk() > 0 || eq.getWdef() > 0 || eq.getMdef() > 0 || eq.getAcc() > 0 ||
eq.getAvoid() > 0 || eq.getSpeed() > 0 || eq.getJump() > 0 || eq.getHp() > 0 || eq.getMp() > 0);
}
+
+ public boolean isUnmerchable(int itemId) {
+ if(ServerConstants.USE_ENFORCE_UNMERCHABLE_CASH && isCash(itemId)) {
+ return true;
+ }
+
+ if (ServerConstants.USE_ENFORCE_UNMERCHABLE_PET && ItemConstants.isPet(itemId)) {
+ return true;
+ }
+
+ return false;
+ }
public Collection- canWearEquipment(MapleCharacter chr, Collection
- items) {
MapleInventory inv = chr.getInventory(MapleInventoryType.EQUIPPED);
@@ -2125,6 +2133,35 @@ public class MapleItemInformationProvider {
return skillbook;
}
+
+ public final QuestConsItem getQuestConsumablesInfo(final int itemId) {
+ if (questItemConsCache.containsKey(itemId)) {
+ return questItemConsCache.get(itemId);
+ }
+ MapleData data = getItemData(itemId);
+
+ MapleData infoData = data.getChildByPath("info");
+ MapleData ciData = infoData.getChildByPath("consumeItem");
+ QuestConsItem qcItem = null;
+ if (ciData != null) {
+ qcItem = new QuestConsItem();
+ qcItem.exp = MapleDataTool.getInt("exp", infoData);
+ qcItem.grade = MapleDataTool.getInt("grade", infoData);
+ qcItem.questid = MapleDataTool.getInt("questId", infoData);
+ qcItem.items = new HashMap<>(2);
+
+ Map cItems = qcItem.items;
+ for (MapleData ciItem : ciData.getChildren()) {
+ int itemid = MapleDataTool.getInt("0", ciItem);
+ int qty = MapleDataTool.getInt("1", ciItem);
+
+ cItems.put(itemid, qty);
+ }
+ }
+
+ questItemConsCache.put(itemId, qcItem);
+ return qcItem;
+ }
public class ScriptedItem {
@@ -2157,4 +2194,15 @@ public class MapleItemInformationProvider {
public short prob, quantity;
public String effect, worldmsg;
}
+
+ public static final class QuestConsItem {
+
+ public int questid, exp, grade;
+ public Map items;
+
+ public Integer getItemRequirement(int itemid) {
+ return items.get(itemid);
+ }
+
+ }
}
diff --git a/src/server/MapleStatEffect.java b/src/server/MapleStatEffect.java
index 2e8ac01bc8..00affc1e20 100644
--- a/src/server/MapleStatEffect.java
+++ b/src/server/MapleStatEffect.java
@@ -150,12 +150,14 @@ public class MapleStatEffect {
private static class CardItemupStats {
protected int itemCode, prob;
+ protected boolean party;
private List> areas;
- private CardItemupStats(int code, int prob, List> areas) {
+ private CardItemupStats(int code, int prob, List> areas, boolean inParty) {
this.itemCode = code;
this.prob = prob;
this.areas = areas;
+ this.party = inParty;
}
private boolean isInArea(int mapid) {
@@ -173,8 +175,22 @@ public class MapleStatEffect {
}
}
- public boolean isActive(int mapid) {
- return cardStats == null || cardStats.isInArea(mapid);
+ private boolean isEffectActive(int mapid, boolean partyHunting) {
+ if (cardStats == null) return true;
+
+ if (!cardStats.isInArea(mapid)) {
+ return false;
+ }
+
+ if (cardStats.party && !partyHunting) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public boolean isActive(MapleCharacter applyto) {
+ return isEffectActive(applyto.getMapId(), applyto.getPartyMembersOnSameMap().size() > 1);
}
public int getCardRate(int mapid, int itemid) {
@@ -354,16 +370,27 @@ public class MapleStatEffect {
} else if (isMonsterCard(sourceid)) {
int prob = 0, itemupCode = Integer.MAX_VALUE;
List> areas = null;
+ boolean inParty = false;
MapleData con = source.getChildByPath("con");
if (con != null) {
areas = new ArrayList<>(3);
for (MapleData conData : con.getChildren()) {
- int startMap = MapleDataTool.getInt("sMap", conData, 0);
- int endMap = MapleDataTool.getInt("eMap", conData, 0);
+ int type = MapleDataTool.getInt("type", conData, -1);
+
+ if (type == 0) {
+ int startMap = MapleDataTool.getInt("sMap", conData, 0);
+ int endMap = MapleDataTool.getInt("eMap", conData, 0);
- areas.add(new Pair<>(startMap, endMap));
+ areas.add(new Pair<>(startMap, endMap));
+ } else if (type == 2) {
+ inParty = true;
+ }
+ }
+
+ if (areas.isEmpty()) {
+ areas = null;
}
}
@@ -409,7 +436,7 @@ public class MapleStatEffect {
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.MAP_PROTECTION, thaw > 0 ? 1 : 2);
}
- ret.cardStats = new CardItemupStats(itemupCode, prob, areas);
+ ret.cardStats = new CardItemupStats(itemupCode, prob, areas, inParty);
} else if (isExpIncrease(sourceid)) {
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.EXP_INCREASE, MapleDataTool.getInt("expinc", source, 0));
}
@@ -1045,8 +1072,6 @@ public class MapleStatEffect {
door.getTarget().spawnDoor(door.getAreaDoor());
door.getTown().spawnDoor(door.getTownDoor());
-
- applyto.disableDoorSpawn();
} else {
MapleInventoryManipulator.addFromDrop(applyto.getClient(), new Item(4006000, (short) 0, (short) 1), false);
@@ -1182,15 +1207,9 @@ public class MapleStatEffect {
}
private Rectangle calculateBoundingBox(Point posFrom, boolean facingLeft) {
- Point mylt;
- Point myrb;
- if (facingLeft) {
- mylt = new Point(lt.x + posFrom.x, lt.y + posFrom.y);
- myrb = new Point(rb.x + posFrom.x, rb.y + posFrom.y);
- } else {
- myrb = new Point(-lt.x + posFrom.x, rb.y + posFrom.y);
- mylt = new Point(-rb.x + posFrom.x, lt.y + posFrom.y);
- }
+ int multiplier = facingLeft ? 1 : -1;
+ Point mylt = new Point(lt.x * multiplier + posFrom.x, lt.y + posFrom.y);
+ Point myrb = new Point(rb.x * multiplier + posFrom.x, rb.y + posFrom.y);
Rectangle bounds = new Rectangle(mylt.x, mylt.y, myrb.x - mylt.x, myrb.y - mylt.y);
return bounds;
}
@@ -1315,7 +1334,7 @@ public class MapleStatEffect {
if (localstatups.size() > 0) {
byte[] buff = null;
byte[] mbuff = null;
- if (getSummonMovementType() == null && this.isActive(applyto.getMapId())) {
+ if (getSummonMovementType() == null && this.isActive(applyto)) {
buff = MaplePacketCreator.giveBuff((skill ? sourceid : -sourceid), localDuration, localstatups);
}
if (isDash()) {
diff --git a/src/server/gachapon/ElNath.java b/src/server/gachapon/ElNath.java
new file mode 100644
index 0000000000..523be056bb
--- /dev/null
+++ b/src/server/gachapon/ElNath.java
@@ -0,0 +1,65 @@
+package server.gachapon;
+
+/**
+*
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
+*/
+
+public class ElNath extends GachaponItems {
+
+ @Override
+ public int[] getCommonItems() {
+ return new int [] {
+
+ /* Scroll */
+ 2041012, 2048003, 2043800, 2043301, 2040301, 2043101, 2043201, 2043001, 2044301, 2043801, 2044201, 2043701, 2044502,
+ 2041011, 2041014, 2044602, 2043302, 2043202, 2043002, 2048005, 2044402, 2044302, 2043802, 2044102, 2044202, 2043702,
+ 2044812,
+
+ /* Useable drop */
+ 2000004, 2000005,
+
+ /* Common equipment */
+ 1402010, 1032003, 1442013, 1432009, 1302022, 1302029, 1322021, 1302026, 1442017, 1322023, 1102011, 1032008, 1322026,
+ 1442016, 1312000, 1032007, 1322025, 1322027, 1032020, 1442015, 1432017, 1302027, 1302049, 1372006, 1032022, 1032021,
+ 1372004, 1332020, 1322007, 1032006, 1302028, 1322003, 1302007, 1092030, 1302021, 1322024, 1322012, 1032005, 1322022,
+ 1032013, 1302025, 1302013, 1032017, 1032002, 1032001, 1302017, 1432018, 1442012, 1302000, 1032000, 1102013, 1442022,
+ 1372005, 1442021, 1032009, 1302016,
+
+ /* Warrior equipment */
+ 1442003, 1312007, 1402008, 1312008, 1412008, 1442009, 1302004, 1312006, 1442016, 1402012, 1302003, 1312005, 1432002,
+ 1432001, 1302008, 1040030, 1402015, 1322015, 1432006, 1322002, 1302010, 1322017, 1402003, 1402006, 1322000, 1422001,
+ 1442001, 1422004, 1412004, 1322009, 1322011, 1442000, 1412005, 1402002, 1432004, 1442010, 1422008, 1442007, 1422009,
+ 1322019, 1412003, 1412007, 1302009, 1412000, 1322014, 1402001, 1402007, 1432005,
+
+ /* Magician equipment */
+ 1382001, 1372007, 1382010, 1382007, 1372000, 1372003, 1382011, 1382006, 1382000,
+
+ /* Bowman equipment */
+ 1452004, 1452000, 1452010, 1452015, 1452014, 1462012, 1462010, 1452017, 1462000, 1452008, 1452006, 1462006, 1452007,
+ 1452002, 1402001,
+
+ /* Thief equipment */
+ 1472006, 1472010, 1332022, 1332011, 1472015, 1472016, 1472023, 1472028, 1472022, 1472011, 1472026, 1332024, 1332009,
+ 1472017, 1472013, 1472029, 1472021, 1332015, 1332031, 1332023, 1332004, 1472000, 1332019, 1472027, 1332018, 1472007,
+ 1332012, 1332016, 1472024, 1332017, 1332003, 1472012, 1472014, 1472005, 1472018, 1472001,
+
+ /* Pirate equipment */
+ 1072294, 1492009
+
+ };
+ }
+
+ @Override
+ public int[] getUncommonItems() {
+ return new int [] {2022439, 2040804, 2040805, 2340000};
+ }
+
+ @Override
+ public int[] getRareItems() {
+ return new int [] {2043803, 1102085};
+ }
+
+}
diff --git a/src/server/gachapon/Ellinia.java b/src/server/gachapon/Ellinia.java
index e053d1a5f5..2e631ce096 100644
--- a/src/server/gachapon/Ellinia.java
+++ b/src/server/gachapon/Ellinia.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class Ellinia extends GachaponItems {
@@ -10,95 +13,54 @@ public class Ellinia extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int[] {
- //warriorEquips = {
- 1082025, 1060028, 1051011, 1060016, 1051001,
- 1422001, 1002025, 1082000, 1302002, 1412012,
- //magicianEquips = {
- 1002013, 1002016, 1002017, 1002034, 1002035,
- 1002036, 1002037, 1002038, 1002064, 1002065,
- 1002072, 1002073, 1002074, 1002075, 1002102,
- 1002103, 1002104, 1002105, 1002106, 1002141,
- 1002142, 1002143, 1002144, 1002145, 1002151,
- 1002152, 1002153, 1002154, 1002155, 1002215,
- 1002216, 1002217, 1002218, 1002242, 1002243,
- 1002244, 1002245, 1002246, 1002252, 1002253,
- 1002254, 1002271, 1002272, 1002273, 1002274,
- 1002363, 1002364, 1002365, 1002366, 1002398,
- 1002399, 1002400, 1002401, 1002579, 1002773,
- 1040004, 1040017, 1040018,
- 1040019, 1040020, 1041015, 1041016, 1041017,
- 1041018, 1041025, 1041026, 1041029, 1041030,
- 1041031, 1041041, 1041042, 1041043, 1041051,
- 1041052, 1041053, 1050001, 1050002, 1050003,
- 1050008, 1050009, 1050010, 1050023, 1050024,
- 1050025, 1050026, 1050027, 1050028, 1050029,
- 1050030, 1050031, 1050035, 1050036, 1050037,
- 1050038, 1050039, 1050045, 1050046, 1050047,
- 1050048, 1050049, 1050053, 1050054, 1050055,
- 1050056, 1050067, 1050068, 1050069, 1050070,
- 1050072, 1050073, 1050074, 1050092, 1050093,
- 1050094, 1050095, 1050102, 1050103, 1050104,
- 1050105, 1051003, 1051004, 1051005, 1051023,
- 1051024, 1051025, 1051026, 1051027, 1051030,
- 1051031, 1051032, 1051033, 1051034, 1051044,
- 1051045, 1051046, 1051047, 1051052, 1051053,
- 1051054, 1051055, 1051056, 1051057, 1051058,
- 1051094, 1051095, 1051096, 1051097, 1051101,
- 1051102, 1051103, 1051104, 1052076,
- 1060012, 1060013, 1060014, 1060015,
- 1061010, 1061011, 1061012, 1061013, 1061021,
- 1061022, 1061027, 1061028, 1061034, 1061035,
- 1061036, 1061047, 1061048, 1061049, 1072006,
- 1072019, 1072020, 1072021, 1072023, 1072024,
- 1072044, 1072045, 1072072, 1072073, 1072074,
- 1072075, 1072076, 1072077, 1072078, 1072089,
- 1072090, 1072091, 1072114, 1072115, 1072116,
- 1072117, 1072136, 1072137, 1072138, 1072139,
- 1072140, 1072141, 1072142, 1072143, 1072157,
- 1072158, 1072159, 1072160, 1072169, 1072177,
- 1072178, 1072179, 1072206, 1072207, 1072208,
- 1072209, 1072223, 1072224, 1072225, 1072226,
- 1072268, 1082019, 1082020,
- 1082021, 1082022, 1082026, 1082027, 1082028,
- 1082051, 1082052, 1082053, 1082054, 1082055,
- 1082056, 1082062, 1082063, 1082064, 1082080,
- 1082081, 1082082, 1082086, 1082087, 1082088,
- 1082098, 1082099, 1082100, 1082121, 1082122,
- 1082123, 1082131, 1082132, 1082133, 1082134,
- 1082151, 1082152, 1082153, 1082154, 1082164,
- 1092021, 1092029, 1092057,
- 1372000, 1372001, 1372002, 1372003, 1372004,
- 1372007, 1372008, 1372009, 1372010, 1372011,
- 1372012, 1372014, 1372015, 1372016, 1372032,
- 1382000, 1382001, 1382002, 1382003, 1382004,
- 1382005, 1382006, 1382007, 1382008, 1382010,
- 1382011, 1382014, 1382015, 1382016, 1382017,
- 1382018, 1382019, 1382035, 1382036, 1382037,
- 1382041, 1382053, 1382054, 1382055, 1382056,
- 1382060,
- //bowmanEquips = {
- 1040003, 1462005, 1002157, 1002119, 1062002,
- 1062004, 1041083, 1061082, 1082017, 1041061,
- //thiefEquips = {
- 1002174, 1040063, 1072108, 1082044, 1061071,
- 1060052, 1072029, 1472002, 1082031, 1060023,
- //pirateEquips = {
+
+ /* Scroll */
+ 2043302, 2040002, 2043102, 2043002, 2044402, 2044302, 2043802, 2044002, 2041017, 2044902,
+
+ /* Useable drop */
+ 2000004, 2000005, 2022025, 2022026,
+
+ /* Common equipment */
+ 1402010, 1442013, 1432009, 1002060, 1002063, 1322023, 1002042, 1050018, 1082147, 1002026, 1002392, 1062024, 1442016, 1322025,
+ 1322027, 1302027, 1372006, 1302019, 1092022, 1302021, 1041004, 1002395, 1322024, 1082148, 1002012, 1322012, 1032028, 1102012,
+ 1322022, 1051017, 1302013, 1082146, 1442014, 1302017, 1102013, 1102003, 1002041, 1002097, 1302016, 1082145,
+
+ /* Warrior equipment */
+ 1412006, 1040029, 1040086, 1050005, 1060028, 1002059, 1060008, 1061088, 1402012, 1302003, 1432002, 1312011, 1302008, 1040030,
+ 1002004, 1402015, 1322028, 1322015, 1432006, 1442006, 1322000, 1002085, 1002056, 1092013, 1002058, 1002050, 1060011, 1322009,
+ 1322011, 1442000, 1051011, 1061016, 1060018, 1041024, 1061020, 1302005, 1402002, 1002030, 1092004, 1041023, 1422008, 1060009,
+ 1051000, 1002021, 1442005, 1412003, 1412007, 1422007, 1302009, 1402000, 1402001, 1402007, 1432005,
+
+ /* Magician equipment */
+ 1382001, 1002037, 1060014, 1040018, 1061027, 1050002, 1002152, 1051027, 1050035, 1050056, 1051047, 1051030, 1002274, 1050074,
+ 1002218, 1002254, 1082088, 1382007, 1002013, 1082087, 1372008, 1382008, 1372002, 1372003, 1382011, 1382004, 1050047, 1040019,
+ 1041041, 1061034, 1041051, 1051045, 1051024, 1082081, 1041030, 1040018, 1002073, 1382003, 1082086, 1382014, 1050055, 1050025,
+ 1002155, 1060015,
+
+ /* Bowman equipment */
+ 1452004, 1462003, 1060070, 1002118, 1061058, 1040003, 1002160, 1002121, 1040068, 1061063, 1040080, 1462004, 1041008, 1061006,
+ 1061009, 1040022, 1002168, 1040067, 1060056, 1041054, 1041067, 1060063, 1002213, 1002119, 1462005, 1452001, 1462000, 1040025,
+ 1002166, 1002161, 1040069, 1051039, 1452006, 1462006, 1452007, 1402001, 1041062,
+
+ /* Thief equipment */
+ 1472010, 1472006, 1332011, 1472031, 1041048, 1472019, 1041095, 1040095, 1002128, 1061077, 1060025, 1041040, 1061033, 1472028,
+ 1472022, 1472011, 1040096, 1062002, 1002129, 1472026, 1332009, 1060043, 1002249, 1472021, 1040084, 1332015, 1002173, 1002148,
+ 1332004, 1332018, 1472009, 1061069, 1002176, 1041044, 1061037, 1060032, 1472020, 1040060, 1472018, 1332013, 1332002, 1402001,
+
+ /* Pirate equipment */
1002625, 1002616, 1482005, 1052098, 1482003,
1482001, 1492004, 1002622, 1492005, 1082195
- };
+ };
}
@Override
public int[] getUncommonItems() {
- return new int [] { 1372035, 1372036, 1372037, 1372038, 1372039,
- 1372040, 1372041, 1372042, 1382045, 1382046,
- 1382047, 1382048, 1382049, 1382050, 1382051,
- 1382052 };
+ return new int [] {1082149, 1002391, 1002419};
}
@Override
public int[] getRareItems() {
- return new int [] {1382059, 1382057, 1072362, 1002791, 1052161, 1082240};
+ return new int [] {};
}
}
diff --git a/src/server/gachapon/Global.java b/src/server/gachapon/Global.java
index 8e28f8f0a5..e2042bcaf1 100644
--- a/src/server/gachapon/Global.java
+++ b/src/server/gachapon/Global.java
@@ -3,6 +3,7 @@ package server.gachapon;
/**
*
* @author Alan (SharpAceX)
+* @author Ronan - added ores, reworked global loots
*/
public class Global extends GachaponItems {
@@ -10,50 +11,36 @@ public class Global extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int[] {
- /* Gloves */ 1082002, 1082147, 1082148, 1082146, 1082145, 1082150,
- /* Capes */ 1102040, 1102043, 1102087, 1102079, 1102080, 1102081, 1102082, 1102083, 1102053, 1102054,
- 1102055, 1102056, 1102176, 1102177, 1102178, 1102179, 1102000, 1102001, 1102002, 1102003,
- 1102004, 1102011, 1102012, 1102013, 1102014, 1102015, 1102016, 1102017, 1102018, 1102021,
- 1102022, 1102023, 1102024, 1102026, 1102027, 1102028,
- /* Tube Eqp */ 1322026, 1322025, 1322024, 1322022, 1322021,
- /* Umbrellas */ 1302026, 1302027, 1302028, 1302017,
- /* Snowboards */ 1442017, 1442016, 1442014, 1442012,
- /* Skis */ 1432017, 1432016, 1432015,
- /* Beginner Eqp */ 1442018, 1422011,
- /* Potions */ 2000004, 2000005, 2001002, 2001001, 2020012, 2020013, 2020014, 2020015, 2022182, 2022245,
- 2022284, 2022285, 2022439,
- /* Other Scrolls */ 2049000, 2049001, 2049002, 2041058, 2040727,
- /* 10% Scrolls */ 2041002, 2040402, 2040702, 2040805, 2040026, 2040031, 2040318, 2040323, 2040328, 2040419,
- 2040422, 2040427, 2040534, 2040619, 2040622, 2040627, 2040825, 2040925, 2040928, 2040933,
- 2040016,
- /* 60% Scrolls */ 2040001, 2040321, 2040425, 2040625, 2040931, 2048013, 2040025, 2040326, 2040532, 2040824,
- 2048010, 2040029, 2040418, 2040618, 2040924, 2048011, 2040317, 2040421, 2040621, 2040927,
- 2048012,
- /* 100% Scrolls */ 2040923, 2040027, 2040417, 2040617, 2040000, 2040202, 2040400, 2040512, 2040700, 2040803,
- 2041000, 2041012, 2048000, 2040926, 2040316, 2040420, 2040620, 2040003, 2040207, 2040414,
- 2040515, 2040703, 2040818, 2041003, 2041015, 2048003, 2040929, 2040319, 2040423, 2040623,
- 2040102, 2040300, 2040500, 2040600, 2040706, 2040900, 2041006, 2041018, 2040024, 2040324,
- 2040530, 2040823, 2040107, 2040312, 2040503, 2040614, 2040800, 2040918, 2041009, 2041021
+ /* Potions */
+ 2000004, 2000005, 2001002, 2001001, 2020012, 2020013, 2020014, 2020015,
+
+ /* Ores */
+ 4004000, 4004001, 4004002, 4004003, 4004004,
+ 4006000, 4006001,
+ 4010000, 4010001, 4010002, 4010003, 4010004, 4010005, 4010006, 4010007,
+ 4020000, 4020001, 4020002, 4020003, 4020004, 4020005, 4020006, 4020007, 4020008
};
}
@Override
public int[] getUncommonItems() {
return new int[] {
- /* Capes */ 1102180,
- /* Potions */ 2022179, 2022273, 2022282, 2022283,
- /* Scrolls */ 2049003,
- /* Skis */ 1432018
+ /* Potions */
+ 2022179, 2022273, 2022282, 2022283, 2022285, 2022245, 2022182,
+
+ /* Scrolls */
+ 2049003
};
}
@Override
public int[] getRareItems() {
return new int[] {
- /* Gloves */ 1082149,
- /* Capes */ 1102041, 1102042, 1102084, 1102085,
- /* Scrolls */ 2049100, 2340000,
- /* Chairs */ 3010046, 3010047
+ /* Scrolls */
+ 2049100, 2340000,
+
+ /* Chairs */
+ 3010063, 3010064
};
}
diff --git a/src/server/gachapon/Henesys.java b/src/server/gachapon/Henesys.java
index 2b31cccb52..cf3d075e14 100644
--- a/src/server/gachapon/Henesys.java
+++ b/src/server/gachapon/Henesys.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class Henesys extends GachaponItems {
@@ -10,31 +13,49 @@ public class Henesys extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int [] {
- /* Common Eqps */ 1432009, 1302022, 1322027, 1062000, 1002033, 1092022, 1302021, 1322009, 1002012, 1322012,
- /* Warrior Eqps */ 1312007, 1002093, 1051016, 1040030, 1060009, 1060000, 1082025, 1402002, 1092000, 1072041,
- /* Mage Equips */ 1051023, 1002035, 1061028, 1040019, 1002152, 1002155, 1041018, 1050031, 1002102, 1082028,
- /* Bowman Equips */ 1002010, 1002057, 1002112, 1002113, 1002114, 1002115, 1002116, 1002117, 1002118, 1002119,
- 1002120, 1002121, 1002135, 1002136, 1002137, 1002138, 1002139, 1002156, 1002157, 1002158,
- 1002159, 1002160, 1002161, 1002162, 1002163, 1002164, 1002165, 1002166, 1002167, 1002168,
- 1002169, 1002170, 1002211, 1002212, 1002213, 1002214, 1002267, 1002268, 1002269, 1002270,
- 1002275, 1002276, 1002277, 1002278, 1002286, 1002287, 1002288, 1002289, 1002402, 1002403,
- 1002404, 1002405, 1002406, 1002407, 1002408, 1002580, 1002749
- };
+
+ /* Scroll */
+ 2040001, 2041002, 2040702, 2043802, 2040402, 2043702, 2044813,
+
+ /* Useable Drops */
+ 2000004, 2000005, 2020012, 2030007,
+
+ /* Common equipment */
+ 1432009, 1302022, 1322021, 1302026, 1442017, 1082147, 1102043, 1322026, 1442016, 1402012, 1322025, 1322027, 1302027,
+ 1312012, 1062000, 1332020, 1302028, 1372002, 1002033, 1092022, 1302021, 1322009, 1322024, 1082148, 1002012, 1322012,
+ 1322022, 1002020, 1302013, 1082146, 1442014, 1002096, 1302017, 1442012,
+
+ /* Warrior equipment */
+ 1092011, 1092014, 1302003, 1432001, 1312011, 1002088, 1041020, 1322015, 1442004, 1422008, 1302056, 1432000, 1442005,
+
+ /* Magician equipment */
+ 1382001, 1041053, 1041029, 1050053, 1051032, 1050073, 1061036, 1002253, 1002034, 1051025, 1050067, 1051052, 1002072,
+ 1002144, 1051054, 1050069, 1372007, 1050056, 1050074, 1002254, 1002274, 1002218, 1051055, 1382010, 1002246, 1050039,
+ 1382007, 1372000, 1002013, 1050072, 1002036, 1002244, 1372008, 1382008, 1382011, 1092021, 1051034, 1050047, 1040019,
+ 1041031, 1051033, 1002153, 1002252, 1051024, 1051053, 1050068, 1382003, 1382006, 1050055, 1051031, 1050025, 1002155,
+ 1002245, 1372001,
+
+ /* Bowman equipment */
+ 1452004, 1452023, 1060057, 1432001, 1040071, 1002137, 1462009, 1452017, 1040025, 1041027, 1452005, 1452007, 1061057,
+
+ /* Thief equipment */
+ 1472006, 1472019, 1060084, 1472028, 1472004, 1002179, 1082074, 1472029, 1040100, 1332015, 1432001, 1040097, 1060071,
+ 1472007, 1472002, 1051009, 1041044, 1041003, 1332016, 1472020, 1332003,
+
+ /* Pirate equipment */
+ 1002622, 1082204, 1082213, 1082198, 1002631, 1052122, 1482012, 1052131, 1482007, 1482004, 1072318, 1492007
+
+ };
}
@Override
public int[] getUncommonItems() {
- return new int[] {
- /* 110 Equips */ 1002547
- };
+ return new int[] {2040805, 1102041, 1102042, 1442018};
}
@Override
public int[] getRareItems() {
- return new int[] {
- /* Reverse Eqps */ 1002792,
- 1462052, 1462053, 1462054, 1462055,
- };
+ return new int[] {};
}
}
diff --git a/src/server/gachapon/KerningCity.java b/src/server/gachapon/KerningCity.java
index 26f0f77c32..e9601fc06c 100644
--- a/src/server/gachapon/KerningCity.java
+++ b/src/server/gachapon/KerningCity.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class KerningCity extends GachaponItems {
@@ -10,112 +13,47 @@ public class KerningCity extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int [] {
- //warriorEquips = {
- 1002023, 1082001, 1041084, 1060017, 1422008,
- 1402018, 1060019, 1072047, 1040009, 1060060,
- //magicianEquips = {
- 1050029, 1072045, 1050028, 1372001, 1051024,
- 1061049, 1072091, 1041030, 1041042, 1002036,
- //bowmanEquips = {
- 1072103, 1072034, 1072069, 1062004, 1082050,
- 1040003, 1061064, 1040074, 1061051, 1040079,
- //thiefEquips = {
- 1002107, 1002108, 1002109, 1002110, 1002111,
- 1002122, 1002123, 1002124, 1002125, 1002126,
- 1002127, 1002128, 1002129, 1002130, 1002131,
- 1002146, 1002147, 1002148, 1002149, 1002150,
- 1002171, 1002172, 1002173, 1002174, 1002175,
- 1002176, 1002177, 1002178, 1002179, 1002180,
- 1002181, 1002182, 1002183, 1002184, 1002185,
- 1002207, 1002208, 1002209, 1002210, 1002247,
- 1002248, 1002249, 1002281, 1002282, 1002283,
- 1002284, 1002285, 1002323, 1002324, 1002325,
- 1002326, 1002327, 1002328, 1002329, 1002330,
- 1002380, 1002381, 1002382, 1002383, 1002550,
- 1002577, 1002656, 1002750,
- 1040031, 1040032, 1040033, 1040034, 1040035,
- 1040042, 1040043, 1040044, 1040048, 1040049,
- 1040050, 1040057, 1040058, 1040059, 1040060,
- 1040061, 1040062, 1040063, 1040082, 1040083,
- 1040084, 1040094, 1040095, 1040096, 1040097,
- 1040098, 1040099, 1040100, 1040105, 1040106,
- 1040107, 1040108, 1040109, 1040110, 1040115,
- 1040116, 1040117, 1040118, 1041003, 1041036,
- 1041037, 1041038, 1041039, 1041040, 1041044,
- 1041045, 1041047, 1041048, 1041049, 1041050,
- 1041057, 1041058, 1041059, 1041060, 1041074,
- 1041075, 1041076, 1041077, 1041078, 1041079,
- 1041080, 1041094, 1041095, 1041096, 1041100,
- 1041101, 1041102, 1041103, 1041105, 1041106,
- 1041107, 1041115, 1041116, 1041117, 1041118,
- 1050096, 1050097, 1050098, 1050099, 1051006,
- 1051007, 1051008, 1051009, 1051090, 1051091,
- 1051092, 1051093, 1052072, 1052163,
- 1060021, 1060022, 1060023, 1060024, 1060025,
- 1060031, 1060032, 1060033, 1060037, 1060038,
- 1060039, 1060043, 1060044, 1060045, 1060046,
- 1060050, 1060051, 1060052, 1060071, 1060072,
- 1060073, 1060083, 1060084, 1060085, 1060086,
- 1060087, 1060088, 1060089, 1060093, 1060094,
- 1060095, 1060097, 1060098, 1060099, 1060104,
- 1060105, 1060106, 1060107, 1061003, 1061029,
- 1061030, 1061031, 1061032, 1061033, 1061037,
- 1061038, 1061040, 1061041, 1061042, 1061043,
- 1061044, 1061045, 1061046, 1061053, 1061054,
- 1061055, 1061056, 1061069, 1061070, 1061071,
- 1061076, 1061077, 1061078, 1061079, 1061093,
- 1061094, 1061095, 1061099, 1061100, 1061101,
- 1061102, 1061104, 1061105, 1061106, 1061114,
- 1061115, 1061116, 1061117, 1072022, 1072028,
- 1072029, 1072030, 1072031, 1072032, 1072033,
- 1072035, 1072036, 1072065, 1072066, 1072070,
- 1072071, 1072084, 1072085, 1072086, 1072087,
- 1072104, 1072105, 1072106, 1072107, 1072108,
- 1072109, 1072110, 1072128, 1072129, 1072130,
- 1072131, 1072150, 1072151, 1072152, 1072161,
- 1072162, 1072163, 1072171, 1072172, 1072173,
- 1072174, 1072192, 1072193, 1072194, 1072195,
- 1072213, 1072214, 1072215, 1072216, 1072272,
- 1072346, 1082029, 1082030,
- 1082031, 1082032, 1082033, 1082034, 1082037,
- 1082038, 1082039, 1082042, 1082043, 1082044,
- 1082045, 1082046, 1082047, 1082065, 1082066,
- 1082067, 1082074, 1082075, 1082076, 1082092,
- 1082093, 1082094, 1082095, 1082096, 1082097,
- 1082118, 1082119, 1082120, 1082135, 1082136,
- 1082137, 1082138, 1082142, 1082143, 1082144,
- 1082167, 1082242, 1092018, 1092019,
- 1092020, 1302001,
- 1312002, 1332000, 1332001, 1332002, 1332003,
- 1332004, 1332011, 1332012, 1332013, 1332014,
- 1332015, 1332018, 1332023, 1332024, 1332027,
- 1332031, 1332050, 1332052, 1332054,
- 1332067, 1332068, 1332069, 1332070, 1332071,
- 1332072, 1332077,
- 1472000, 1472001, 1472002,
- 1472003, 1472004, 1472005, 1472006, 1472007,
- 1472008, 1472009, 1472010, 1472011, 1472012,
- 1472013, 1472014, 1472015, 1472016, 1472017,
- 1472018, 1472019, 1472020, 1472021, 1472022,
- 1472023, 1472024, 1472025, 1472026, 1472027,
- 1472028, 1472029, 1472031, 1472033, 1472051,
- 1472052,
- 1472069, 1472072, 1472074,
- 1472075,
- ///pirateEquips = {
- 1082192, 1072288, 1492003, 1052113, 1052104,
- 1492002, 1052095, 1492001, 1002613, 1492004,
- };
+
+ /* Scroll */
+ 2041016, 2043302, 2040902, 2044804, 2044906,
+
+ /* Useable drop */
+ 2000004, 2000005, 2022025, 2022027,
+
+ /* Common equipment */
+ 1442013, 1432009, 1322021, 1050018, 1002392, 1002394, 1442004, 1372002, 1002418, 1002033, 1092008,
+ 1082148, 1062001, 1302017, 1032023, 1102013, 1102040, 1002041, 1002097,
+
+ /* Warrior equipment */
+ 1332026, 1051010, 1432001, 1422005, 1332019, 1302010, 1002056, 1060011, 1322011, 1432004, 1002028,
+ 1051000, 1442007, 1302002,
+
+ /* Magician equipment */
+ 1002037, 1002034, 1082020, 1050039, 1372000, 1002215, 1051034, 1040019, 1061034, 1382003, 1382006,
+ 1050025,
+
+ /* Bowman equipment */
+ 1002118, 1061081, 1452011, 1462012, 1452006, 1452007,
+
+ /* Thief equipment */
+ 1472010, 1472029, 1041048, 1041095, 1060031, 1061033, 1041049, 1472011, 1040096, 1472033, 1332026,
+ 1051006, 1082074, 1472025, 1061106, 1040084, 1332015, 1472000, 1332019, 1002183, 1002209, 1092020,
+ 1332029, 1092019, 1061099, 1060106, 1040032, 1040059, 1332003, 1040060, 1060046, 1472005, 1332027,
+
+ /* Pirate equipment */
+ 1082192, 1072288, 1492003, 1052113, 1052104,
+ 1492002, 1052095, 1492001, 1002613, 1492004
+ };
}
@Override
public int[] getUncommonItems() {
- return new int[] {1472053, 1332064, 1092050, 1472054};
+ return new int[] {2040805, 1082149, 1102041};
}
@Override
public int[] getRareItems() {
- return new int[] {1472073, 1092049, 1002793, 1332079, 1072364, 1472062, 1332078, 1332080};
+ return new int[] {};
}
}
diff --git a/src/server/gachapon/Ludibrium.java b/src/server/gachapon/Ludibrium.java
new file mode 100644
index 0000000000..bb09839fde
--- /dev/null
+++ b/src/server/gachapon/Ludibrium.java
@@ -0,0 +1,56 @@
+package server.gachapon;
+
+/**
+*
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
+*/
+
+public class Ludibrium extends GachaponItems {
+
+ @Override
+ public int[] getCommonItems() {
+ return new int [] {
+
+ /* Scroll */
+ 2048000, 2040601, 2041019, 2041007, 2041016, 2041022, 2041001, 2041010, 2041013, 2041004, 2044701, 2043301, 2040301, 2048004, 2048001, 2040901, 2040701, 2040704, 2040707, 2040602, 2041020, 2041008, 2041017, 2041023, 2041002, 2041011, 2041014, 2041005, 2044702, 2043302, 2040302, 2040002, 2044402, 2048005, 2048002, 2040702, 2040705, 2040708, 2044302, 2043802, 2040402, 2043702, 2044811,
+
+ /* Useable drop */
+ 2000004, 2000005, 4006000, 4006001,
+
+ /* Common equipment */
+ 1032003, 1432009, 1302022, 1302029, 1102014, 1102018, 1312014, 1302026, 1102015, 1032011, 1312013, 1032008, 1032019, 1032007, 1332030, 1032020, 1032004, 1302027, 1032022, 1312012, 1032021, 1032006, 1302028, 1322003, 1032016, 1032015, 1302024, 1092008, 1032018, 1302021, 1032014, 1332021, 1322012, 1032005, 1032013, 1102012, 1302025, 1302013, 1032002, 1032001, 1032012, 1302017, 1032010, 1402014, 1102017, 1102013, 1442021, 1032009,
+
+ /* Beginner equipment */
+ 1332021, 1422011,
+
+ /* Warrior equipment */
+ 1402017, 1422005, 1002023, 1332016, 1432005,
+
+ /* Magician equipment */
+ 1002037, 1002034, 1002064, 1002038, 1002013, 1002036, 1382011, 1002035, 1002065, 1382014, 1372001,
+
+ /* Bowman equipment */
+ 1452026, 1002162, 1002164, 1462018, 1002165, 1452014, 1002163, 1452012, 1002161, 1452009, 1462007,
+
+ /* Thief Equipment */
+ 1332022, 1002175, 1002172, 1002174, 1040096, 1472033, 1002173, 1332054, 1472054, 1002171, 1332016,
+
+ /* Pirate equipment */
+ 1002646
+
+ };
+ }
+
+ @Override
+ public int[] getUncommonItems() {
+ return new int [] {2040805, 1002419, 1442018};
+ }
+
+ @Override
+ public int[] getRareItems() {
+ return new int [] {};
+ }
+
+}
diff --git a/src/server/gachapon/MapleGachapon.java b/src/server/gachapon/MapleGachapon.java
index 49dcf4dc09..75825bd52e 100644
--- a/src/server/gachapon/MapleGachapon.java
+++ b/src/server/gachapon/MapleGachapon.java
@@ -21,6 +21,7 @@
*/
package server.gachapon;
+import server.MapleItemInformationProvider;
import tools.Randomizer;
/**
@@ -46,9 +47,11 @@ public class MapleGachapon {
MUSHROOM_SHRINE(9100105, 90, 8, 2, new MushroomShrine()),
SHOWA_SPA_MALE(9100106, 90, 8, 2, new ShowaSpaMale()),
SHOWA_SPA_FEMALE(9100107, 90, 8, 2, new ShowaSpaFemale()),
+ LUDIBRIUM(9100108, 90, 8, 2, new Ludibrium()),
NEW_LEAF_CITY(9100109, 90, 8, 2, new NewLeafCity()),
+ EL_NATH(9100110, 90, 8, 2, new ElNath()),
NAUTILUS_HARBOR(9100117, 90, 8, 2, new NautilusHarbor());
-
+
private static final Gachapon[] values = Gachapon.values();
private GachaponItems gachapon;
@@ -71,8 +74,9 @@ public class MapleGachapon {
return 2; //Rare
} else if (chance > common) {
return 1; //Uncommon
- }
- return 0; //Common
+ } else {
+ return 0; //Common
+ }
}
public int [] getItems(int tier){
@@ -94,6 +98,44 @@ public class MapleGachapon {
}
return null;
}
+
+ public static String[] getLootInfo() {
+ MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
+
+ String[] strList = new String[values.length + 1];
+
+ String menuStr = "";
+ int j = 0;
+ for (Gachapon gacha : values) {
+ menuStr += "#L" + j + "#" + gacha.name() + "#l\r\n";
+ j++;
+
+ String str = "";
+ for (int i = 0; i < 3; i++) {
+ int[] gachaItems = gacha.getItems(i);
+
+ if (gachaItems.length > 0) {
+ str += (" #rTier " + i + "#k:\r\n");
+ for (int itemid : gachaItems) {
+ String itemName = ii.getName(itemid);
+ if (itemName == null) {
+ itemName = "MISSING NAME #" + itemid;
+ }
+
+ str += (" " + itemName + "\r\n");
+ }
+
+ str += "\r\n";
+ }
+ }
+ str += "\r\n";
+
+ strList[j] = str;
+ }
+ strList[0] = menuStr;
+
+ return strList;
+ }
}
public MapleGachaponItem process(int npcId) {
diff --git a/src/server/gachapon/MushroomShrine.java b/src/server/gachapon/MushroomShrine.java
index b34c69c3dd..f805f9b6de 100644
--- a/src/server/gachapon/MushroomShrine.java
+++ b/src/server/gachapon/MushroomShrine.java
@@ -2,39 +2,57 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class MushroomShrine extends GachaponItems {
@Override
public int[] getCommonItems() {
- return new int []{
- 1382011, 1332024, 1302022, 1302021, 1462006, 1402009, 1402010, 1322012, 1312013, 1472008,
- 1432008, 1050100, 1051098,
- };
+ return new int [] {
+
+ /* Scroll */
+ 2040305, 2040306, 2040308, 2044604, 2041039, 2041037, 2041035, 2041034, 2041041, 2040608, 2040605, 2040604, 2040611,
+ 2040610, 2040813, 2040808, 2043004, 2040017, 2040015, 2040011, 2040013, 2040405, 2040406, 2040410, 2040511, 2040509,
+ 2040508, 2040519, 2040521, 2040108, 2040904, 2040908, 2043104, 2044104, 2043005, 2043004, 2043006, 2044004, 2044205,
+ 2043304, 2040607, 2040715, 2040713, 2044305, 2044904,
+
+ /* Common equipment */
+ 1102040, 1002392, 1432009, 1002393, 1002394, 1082147, 1082148, 1032028, 1002585, 1002586, 1432013, 1022047, 1322027,
+ 1012056, 1432018,
+
+ /* Beginner equipment */
+ 1072264, 1072262, 1072263,
+
+ /* Warrior equipment */
+ 1060074, 1322002, 1002340, 1442004, 1402037, 1422008, 1050022,
+
+ /* Mage equipment */
+ 1382037, 1060014, 1051026, 1050056, 1050029, 1051030, 1382036, 1372032, 1041015, 1382015, 1372008, 1382008,
+
+ /* Bowman equipment */
+ 1452018, 1041068, 1462007,
+
+ /* Thief equipment */
+ 1060052, 1472013, 1002180, 1002170, 1060073, 1060099,
+
+ /* Pirate equipment */
+ 1492004, 1492012, 1482009, 1072303, 1002637, 1052107, 1082189, 1052116, 1072309
+
+ };
}
@Override
public int[] getUncommonItems() {
- //All Scrolls
- return new int [] {
- 2043015, 2043017, 2043019, 2044000, 2044001, 2044002, 2044004, 2044005, 2044010, 2044012,
- 2044014, 2043200, 2043201, 2043202, 2043204, 2043205, 2043210, 2043212, 2043214, 2044200,
- 2044201, 2044202, 2044204, 2044205, 2044210, 2044212, 2044214, 2044300, 2044301, 2044302,
- 2044304, 2044305, 2044310, 2044312, 2044314, 2044400, 2044401, 2044402, 2044404, 2044405,
- 2044410, 2044412, 2044414,
- 2043800, 2043801, 2043802, 2043804, 2043805, 2043700, 2043701, 2043702, 2043704, 2043705,
- 2044605, 2044604, 2044602, 2044601, 2044600, 2044505, 2044504, 2044502, 2044501, 2044500,
- 2044700, 2044701, 2044702, 2044704, 2044705, 2043300, 2043301, 2043302, 2043304, 2043305,
- 2044800, 2044801, 2044802, 2044803, 2044804, 2044805, 2044807, 2044809, 2044900, 2044901,
- 2044902, 2044903, 2044904,
- };
+ return new int [] {2040811, 2040810, 2040815, 1102041, 1102042, 1082149};
}
@Override
public int[] getRareItems() {
- return new int [] {};
+ return new int [] {1102084, 3010019};
}
}
diff --git a/src/server/gachapon/NautilusHarbor.java b/src/server/gachapon/NautilusHarbor.java
index 9477ac325d..dff11518c4 100644
--- a/src/server/gachapon/NautilusHarbor.java
+++ b/src/server/gachapon/NautilusHarbor.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate items
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class NautilusHarbor extends GachaponItems {
@@ -10,40 +13,54 @@ public class NautilusHarbor extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int[] {
- /* Warrior Equips*/ 1060017, 1302008, 1002055, 1041064, 1072127, 1072047, 1072002, 1040028, 1072041, 1092000,
- /* Mage Equips */ 1050010, 1072006, 1061022, 1051003, 1072074, 1050008, 1082053, 1051026, 1382015, 1002013,
- /* Bowman Equips */ 1082048, 1041056, 1002157, 1462048, 1041054, 1061061, 1002161, 1002162, 1002158, 1002120,
- /* Thief Equips */ 1040061, 1072031, 1051009, 1072036, 1002182, 1060073, 1472013, 1472009, 1002184, 1061055,
- /* Pirate Equips */ 1002610, 1002616, 1002622, 1002628, 1002634, 1002640, 1002646, 1052095, 1052101, 1052107,
- 1052113, 1052119, 1052125, 1052131, 1072285, 1072291, 1072297, 1072303, 1072309, 1072315,
- 1082180, 1082186, 1082192, 1082198, 1082204, 1082210, 1482001, 1482003, 1482005, 1482007,
- 1482009, 1482011, 1492000, 1492002, 1492004, 1492006, 1492008, 1492010, 1492012, 1002613,
- 1002619, 1002625, 1002631, 1002637, 1002643, 1052098, 1052104, 1052110, 1052116, 1052122,
- 1052128, 1072288, 1072294, 1072300, 1072306, 1072312, 1072318, 1072338, 1082183, 1082189,
- 1082195, 1082201, 1082207, 1082213, 1482000, 1482002, 1482004, 1482006, 1482008, 1482010,
- 1482012, 1492001, 1492003, 1492005, 1492007, 1492009, 1492011,
- /*KnucklerScrolls*/ 2044800, 2044801, 2044802, 2044803, 2044804, 2044805, 2044806, 2044807, 2044808, 2044809,
- /* Gun Scrolls */ 2044900, 2044901, 2044902, 2044903, 2044904,
- /* Bullets */ 2330005, 2330004
- };
+ /* Scroll */
+ 2040605, 2040626, 2040609, 2040607, 2041029, 2041027, 2041031, 2041037, 2041033, 2041039, 2041041, 2041035,
+ 2040809, 2040813, 2040015, 2040009, 2040011, 2040013, 2040509, 2040521, 2040519, 2040507, 2040905, 2040909,
+ 2040907, 2040713, 2040715, 2040717, 2040405, 2040409, 2040407, 2040426, 2040303, 2040307, 2040309, 2044505,
+ 2044705, 2044605, 2043305, 2043105, 2043205, 2043005, 2043007, 2044405, 2044305, 2043805, 2044105, 2044205,
+ 2044005, 2043705, 2044901,
+
+ /* Useable drop */
+ 2012000, 2000004, 2020008, 2000005, 2012002, 2101004, 2101005, 2101002, 2101003, 4006000,
+
+ /* Warrior equipment */
+ 1092014, 1402017,
+
+ /* Magician equipment */
+ 1002037, 1002034, 1002064, 1002038, 1382037, 1372000, 1002013, 1002035, 1002065, 1382000,
+
+ /* Bowman equipment */
+ 1452018,
+
+ /* Thief equipment */
+ 1472010, 1002175, 1472017, 1472025,
+
+ /* Pirate equipment */
+ 1002610, 1002616, 1002622, 1002628, 1002634, 1002640, 1002646, 1052095, 1052101, 1052107,
+ 1052113, 1052119, 1052125, 1052131, 1072285, 1072291, 1072297, 1072303, 1072309, 1072315,
+ 1082180, 1082186, 1082192, 1082198, 1082204, 1082210, 1482001, 1482003, 1482005, 1482007,
+ 1482009, 1482011, 1492000, 1492002, 1492004, 1492006, 1492008, 1492010, 1492012, 1002613,
+ 1002619, 1002625, 1002631, 1002637, 1002643, 1052098, 1052104, 1052110, 1052116, 1052122,
+ 1052128, 1072288, 1072294, 1072300, 1072306, 1072312, 1072318, 1072338, 1082183, 1082189,
+ 1082195, 1082201, 1082207, 1082213, 1482000, 1482002, 1482004, 1482006, 1482008, 1482010,
+ 1482012, 1492001, 1492003, 1492005, 1492007, 1492009, 1492011,
+
+ /* Knuckler Scrolls */
+ 2044800, 2044801, 2044802, 2044803, 2044804, 2044805, 2044806, 2044807, 2044808, 2044809,
+
+ /* Gun Scrolls */
+ 2044900, 2044901, 2044902, 2044903, 2044904
+ };
}
@Override
public int[] getUncommonItems() {
- return new int[] {
- /* Pirate Equips */ 1072321, 1082216, 1482013, 1002649, 1052134, 1492013,
- /* Mastery Books */ 2290097, 2290098, 2290099, 2290100, 2290101, 2290102, 2290103, 2290104, 2290105, 2290106,
- 2290107, 2290108, 2290110, 2290111, 2290111, 2290113, 2290114, 2290115, 2290116, 2290117,
- 2290118, 2290119, 2290120, 2290121, 2290122, 2290123, 2290124
- };
+ return new int[] {2040811, 2040815, 2101001};
}
@Override
public int[] getRareItems() {
- return new int[] {
- /* Pirate Equips */ 1082243, 1482024, 1002794, 1052164, 1072365,
- 1482034, 1492025
- };
+ return new int[] {};
}
}
diff --git a/src/server/gachapon/NewLeafCity.java b/src/server/gachapon/NewLeafCity.java
index 10bfad789e..2f7f6a7aa1 100644
--- a/src/server/gachapon/NewLeafCity.java
+++ b/src/server/gachapon/NewLeafCity.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
+* @author Ronan - parsed MapleSEA loots, thanks Vcoc for noticing somewhat unbalanced loots in NLC
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class NewLeafCity extends GachaponItems {
@@ -10,57 +13,43 @@ public class NewLeafCity extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int[] {
- /* Warrior Equips*/ 1002338, 1002339, 1002340, 1002377, 1002378, 1002379, 1002528, 1002529, 1002530, 1002531,
- 1002532, 1040111, 1040112, 1040113, 1040120, 1040121, 1040122, 1041119, 1041120, 1041121,
- 1041122, 1041123, 1041124, 1050080, 1050081, 1050082, 1050083, 1051077, 1051078, 1051079,
- 1051080, 1060100, 1060101, 1060102, 1060109, 1060110, 1060111, 1061118, 1061119, 1061120,
- 1061121, 1061122, 1061123, 1072196, 1072197, 1072198, 1072210, 1072211, 1072212, 1072220,
- 1072221, 1072222, 1082114, 1082115, 1082116, 1082117, 1082128, 1082129, 1082130, 1082139,
- 1082140, 1082141, 1092023, 1092024, 1092025, 1092026, 1092027, 1092028, 1092036, 1092037,
- 1092038, 1092061, 1302018, 1302023, 1302056, 1312011, 1312015, 1312030, 1322020, 1322028,
- 1322029, 1322045, 1402004, 1402005, 1402015, 1402016, 1402035,
- 1412009, 1412010, 1412021, 1412040, 1422012, 1422013, 1422027, 1432010,
- 1432011, 1432030, 1432056, 1442019, 1442020, 1442044,
- /* Mage Equips */ 1002271, 1002272, 1002273, 1002274, 1002363, 1002364, 1002365, 1002366, 1002398, 1002399,
- 1002400, 1002401, 1050072, 1050073, 1050074, 1050092, 1050093, 1050094, 1050095, 1050102,
- 1050103, 1050104, 1050105, 1051056, 1051057, 1051058, 1051094, 1051095, 1051096, 1051097,
- 1051101, 1051102, 1051103, 1051104, 1072177, 1072178, 1072179, 1072206, 1072207, 1072208,
- 1072209, 1072223, 1072224, 1072225, 1072226, 1082121, 1082122, 1082123, 1082131, 1082132,
- 1082133, 1082134, 1082151, 1082152, 1082153, 1082154, 1372009, 1372010, 1372016, 1382008,
- 1382010, 1382016, 1382035, 1382056, 1382060,
- /* Bowman Equips */ 1002275, 1002276, 1002277, 1002275, 1002278, 1002402, 1002403, 1002404, 1002405, 1002406,
- 1002407, 1002408, 1050075, 1050076, 1050077, 1050078, 1050088, 1050089, 1050090, 1050091,
- 1050106, 1050107, 1050108, 1002275, 1051066, 1051067, 1051068, 1051069, 1051082, 1051083,
- 1051084, 1051085, 1051105, 1051106, 1051107, 1072182, 1072183, 1072184, 1072185, 1072203,
- 1072204, 1072205, 1072227, 1072228, 1072229, 1082109, 1082110, 1082111, 1082112, 1082125,
- 1082126, 1082127, 1082158, 1082159, 1082160, 1452012, 1452013, 1452014, 1452015, 1452017,
- 1452019, 1452020, 1452021, 1452025, 1452026, 1452060, 1462010, 1452017, 1462011, 1462012,
- 1462013, 1462015, 1462016, 1462017, 1462018, 1462021, 1462022, 1462049,
- /* Thief Equips */ 1002323, 1002324, 1002325, 1002326, 1002327, 1002328, 1002329, 1002330, 1002380, 1002381,
- 1002382, 1002383, 1040108, 1040109, 1040110, 1040115, 1040117, 1040118, 1041105, 1041106,
- 1041107, 1041115, 1041116, 1041117, 1041118, 1050096, 1050097, 1050098, 1050099, 1051090,
- 1051091, 1051092, 1051093, 1060097, 1060098, 1060099, 1060104, 1060105, 1060106, 1060107,
- 1061104, 1061105, 1061106, 1061114, 1061115, 1061116, 1061117, 1072172, 1072173, 1072174,
- 1072192, 1072193, 1072194, 1072195, 1072213, 1072214, 1072215, 1072216, 1082118, 1082119,
- 1082120, 1082135, 1082136, 1082137, 1082138, 1082143, 1082144, 1092050, 1332023, 1332027,
- 1332052, 1332069, 1332072, 1472031, 1472033, 1472053,
- /* Pirate Equips */ 1002640, 1002643, 1002646, 1052125, 1052128, 1052131, 1072312, 1072315, 1072318, 1082207,
- 1082210, 1082213, 1482010, 1482011, 1002640, 1482012, 1492010, 1492011, 1492012
- };
+
+ /* Scroll */
+ 2040406, 2040408, 2040404, 2040411, 2040409, 2044405, 2040610, 2040607, 2040812, 2041039, 2041040, 2041034,
+ 2041030, 2041037, 2043105, 2043304, 2040103, 2040605, 2040611, 2043004, 2043204, 2044204, 2044005, 2040521,
+ 2040510, 2043304, 2040908, 2040904, 2040907, 2040809, 2040812, 2040014, 2040714, 2040712, 2044004, 2043705,
+ 2044505, 2040519, 2040204, 2040104, 2040109, 2044704, 2040906, 2044304, 2043007, 2040307, 2040304, 2040309,
+ 2040208, 2040209, 2044803,
+
+ /* Common equipment */
+ 1102040, 1102086, 1082145, 1032027, 1082146, 1002395, 1002083, 1002392, 1002587, 1022047,
+
+ /* Warrior equipment */
+ 1312002, 1432013, 1060030, 1422008, 1050022, 1050011, 1402013, 1402017, 1302012,
+
+ /* Mage equipment */
+ 1002074, 1050029, 1040093, 1050056, 1050039, 1382008,
+
+ /* Bowman equipment */
+ 1002159, 1061051, 1040023,
+
+ /* Thief equipment */
+ 1061054, 1061106, 1002249, 1040084, 1060052, 1472054,
+
+ /* Pirate equipment */
+ 1002640, 1002643, 1002646, 1052125, 1052128, 1052131, 1072312, 1072315, 1072318, 1082207, 1082210, 1082213,
+ 1482010, 1482011, 1002640, 1482012, 1492010, 1492011, 1492012
+ };
}
@Override
public int[] getUncommonItems() {
- return new int[] {
- 2022179
- };
+ return new int[] {2022284, 2040811, 2040815, 2040811, 1102041, 1102042, 1082149};
}
@Override
public int[] getRareItems() {
- return new int[] {
- 2049100
- };
+ return new int[] {};
}
}
diff --git a/src/server/gachapon/Perion.java b/src/server/gachapon/Perion.java
index a1600c3a5d..23eaf6f4f2 100644
--- a/src/server/gachapon/Perion.java
+++ b/src/server/gachapon/Perion.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class Perion extends GachaponItems {
@@ -10,128 +13,45 @@ public class Perion extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int [] {
- //warriorEquips = {
- 1002002, 1002003, 1002004, 1002005, 1002007,
- 1002009, 1002011, 1002021, 1002022, 1002023,
- 1002024, 1002025, 1002027, 1002028, 1002029,
- 1002030, 1002039, 1002040, 1002043, 1002044,
- 1002045, 1002046, 1002047, 1002048, 1002049,
- 1002050, 1002051, 1002052, 1002055, 1002056,
- 1002058, 1002059, 1002084, 1002085, 1002086,
- 1002087, 1002088, 1002091, 1002092, 1002093,
- 1002094, 1002095, 1002098, 1002099, 1002100,
- 1002101, 1002338, 1002339, 1002340, 1002377,
- 1002378, 1002379, 1002528, 1002529, 1002530,
- 1002531, 1002532, 1002551, 1002578,
- 1002790, 1040000, 1040009, 1040012, 1040015,
- 1040016, 1040021, 1040026, 1040028, 1040029,
- 1040030, 1040037, 1040038, 1040039, 1040040,
- 1040041, 1040085, 1040086, 1040087, 1040088,
- 1040089, 1040090, 1040091, 1040092, 1040093,
- 1040102, 1040103, 1040104, 1040111, 1040112,
- 1040113, 1040120, 1040121, 1040122, 1041014,
- 1041019, 1041020, 1041021, 1041022, 1041023,
- 1041024, 1041064, 1041084, 1041085, 1041086,
- 1041087, 1041088, 1041089, 1041091, 1041092,
- 1041093, 1041097, 1041098, 1041099, 1041119,
- 1041120, 1041121, 1041122, 1041123, 1041124,
- 1050000, 1050005, 1050006, 1050007, 1050011,
- 1050021, 1050022, 1050080, 1050081, 1050082,
- 1050083, 1051000, 1051001, 1051010, 1051011,
- 1051012, 1051013, 1051014, 1051015, 1051016,
- 1051077, 1051078, 1051079, 1051080, 1052075,
- 1052160, 1060000, 1060008, 1060009,
- 1060010, 1060011, 1060016, 1060017, 1060018,
- 1060019, 1060020, 1060027, 1060028, 1060029,
- 1060030, 1060060, 1060074, 1060075, 1060076,
- 1060077, 1060078, 1060079, 1060080, 1060081,
- 1060082, 1060090, 1060091, 1060092, 1060100,
- 1060101, 1060102, 1060109, 1060110, 1060111,
- 1061014, 1061015, 1061016, 1061017, 1061018,
- 1061019, 1061020, 1061023, 1061083, 1061084,
- 1061085, 1061086, 1061087, 1061088, 1061090,
- 1061091, 1061092, 1061096, 1061097, 1061098,
- 1061118, 1061119, 1061120, 1061121, 1061122,
- 1061123, 1072000, 1072002, 1072003, 1072007,
- 1072009, 1072011, 1072039, 1072040, 1072041,
- 1072046, 1072047, 1072050, 1072051, 1072052,
- 1072053, 1072112, 1072113, 1072126, 1072127,
- 1072132, 1072133, 1072134, 1072135, 1072147,
- 1072148, 1072149, 1072154, 1072155, 1072156,
- 1072168, 1072196, 1072197, 1072198, 1072210,
- 1072211, 1072212, 1072220, 1072221, 1072222,
- 1072273, 1082000, 1082001,
- 1082003, 1082004, 1082005, 1082006, 1082007,
- 1082008, 1082009, 1082010, 1082011, 1082023,
- 1082024, 1082025, 1082035, 1082036, 1082059,
- 1082060, 1082061, 1082103, 1082104, 1082105,
- 1082114, 1082115, 1082116, 1082117, 1082128,
- 1082129, 1082130, 1082139, 1082140, 1082141,
- 1082168, 1082218, 1082239, 1092000,
- 1092001, 1092002, 1092004, 1092005, 1092006,
- 1092007, 1092009, 1092010, 1092011, 1092012,
- 1092013, 1092014, 1092015, 1092016, 1092017,
- 1092023, 1092024, 1092025, 1092026, 1092027,
- 1092028, 1092036, 1092037, 1092038,
- 1092060, 1092061, 1302002, 1302004, 1302005,
- 1302008, 1302009, 1302010, 1302011, 1302012,
- 1302015, 1302018, 1302019, 1302023, 1302037,
- 1302056, 1302059, 1302068, 1302079,
- 1312001, 1312003, 1312005,
- 1312006, 1312007, 1312008, 1312009, 1312010,
- 1312011, 1312015, 1312016, 1312030, 1312031,
- 1322014, 1322015,
- 1322016, 1322017, 1322018, 1322019, 1322020,
- 1322028, 1322029, 1322045, 1322052, 1322059,
- 1322062, 1402000,
- 1402002, 1402003, 1402004, 1402005, 1402006,
- 1402007, 1402008, 1402011, 1402012, 1402015,
- 1402016, 1402017, 1402018, 1402035, 1402036,
- 1412000, 1412002,
- 1412003, 1412004, 1412005, 1412006, 1412007,
- 1412008, 1412009, 1412010, 1412012, 1412021,
- 1412026, 1412032, 1412040,
- 1422001, 1422002, 1422003, 1422005,
- 1422007, 1422008, 1422009, 1422010, 1422012,
- 1422013, 1422027, 1422028, 1422030, 1422031,
- 1422038, 1422044, 1432002, 1432003,
- 1432004, 1432005, 1432006, 1432007, 1432010,
- 1432011, 1432030, 1432038, 1432045,
- 1432048, 1432056, 1442001, 1442002,
- 1442003, 1442005, 1442006, 1442007, 1442008,
- 1442009, 1442010, 1442019, 1442020, 1442044,
- 1442045, 1442060, 1442067,
- //magicianEquips = {
- 1002075, 1050035, 1002151, 1051023, 1072089,
- 1072115, 1072076, 1040018, 1382017, 1072072,
- //bowmanEquips = {
- 1040011, 1041061, 1040076, 1040003, 1072059,
- 1082017, 1002114, 1041066, 1060057, 1040007,
- //thiefEquips = {
- 1072032, 1472011, 1082037, 1040059, 1040084,
- 1040043, 1072085, 1040031, 1332031, 1082075,
- //pirateEquips = {
- 1482001, 1492002, 1052113, 1002616, 1072294,
- 1492004, 1482006, 1082192, 1082189, 1082195,
- };
+
+ /* Scrolls */
+ 2044907, 2044802,
+
+ /* Useable drop */
+ 2000004, 2000005,
+
+ /* Common equipment */
+ 1402010, 1302022, 1002060, 1322021, 1082147, 1002006, 1002026, 1002392, 1322025, 1322027, 1102000, 1082150,
+ 1332020, 1322007, 1302021, 1002395, 1082148, 1322012, 1302017, 1322010, 1032000, 1102013, 1002097,
+
+ /* Warrior equipment */
+ 1322020, 1312007, 1312008, 1302004, 1312006, 1082036, 1082117, 1061088, 1302008, 1422005, 1002048, 1061087,
+ 1302018, 1322017, 1422001, 1040103, 1060077, 1002022, 1002050, 1442000, 1432030, 1402037, 1092002, 1041092,
+ 1050006, 1432004, 1061019, 1432000, 1060009, 1051000, 1002021, 1322014, 1432005,
+
+ /* Magician equipment */
+ 1051032, 1040018, 1051027, 1372007, 1050049, 1002036, 1382012, 1002217, 1051033, 1382006, 1050048,
+
+ /* Bowman equipment */
+ 1061061, 1060062, 1040075, 1462013, 1041065, 1452006,
+
+ /* Thief equipment */
+ 1040095, 1060084, 1002182, 1041049, 1002247, 1332024, 1332009, 1060024, 1332015, 1041060, 1061032, 1041074,
+ 1041003, 1332016, 1472020, 1332003, 1041059,
+
+ /* Pirate equipment */
+ 1482001, 1492002, 1052113, 1002616, 1072294, 1492004, 1482006, 1082192, 1082189, 1082195
+ };
}
@Override
public int[] getUncommonItems() {
- //All Scrolls
- return new int [] {
- 2043000, 2043001, 2043002, 2043004, 2043005, 2043006, 2043007, 2043008, 2043009, 2043010,
- 2043015, 2043017, 2043019, 2044000, 2044001, 2044002, 2044004, 2044005, 2044010, 2044012,
- 2044014, 2043200, 2043201, 2043202, 2043204, 2043205, 2043210, 2043212, 2043214, 2044200,
- 2044201, 2044202, 2044204, 2044205, 2044210, 2044212, 2044214, 2044300, 2044301, 2044302,
- 2044304, 2044305, 2044310, 2044312, 2044314, 2044400, 2044401, 2044402, 2044404, 2044405,
- 2044410, 2044412, 2044414,
- };
+ return new int [] {1082149, 1002391, 1002419, 1102041};
}
@Override
public int[] getRareItems() {
- return new int [] {1402037, 1402049, 1072361, 1402048, 1402049, 1402050, 1402051};
+ return new int [] {};
}
}
diff --git a/src/server/gachapon/ShowaSpaFemale.java b/src/server/gachapon/ShowaSpaFemale.java
index ba4a9fcf6d..be6ca227a7 100644
--- a/src/server/gachapon/ShowaSpaFemale.java
+++ b/src/server/gachapon/ShowaSpaFemale.java
@@ -2,24 +2,57 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/06/gachapon-showa-towns-sauna-female-spa.html
*/
public class ShowaSpaFemale extends GachaponItems {
@Override
public int[] getCommonItems() {
- return new int [] {};
+ return new int [] {
+
+ /* Scroll */
+ 2048005, 2048002, 2043202, 2044602, 2043214, 2041307, 2041035, 2044104, 2044505, 2044305, 2043304, 2041309,
+ 2044010, 2044803, 2044814, 2044904, 2044902, 2044901,
+
+ /* Useable drop */
+ 2022016, 2000005, 2022025, 2022027,
+
+ /* Common equipment */
+ 1402000, 1402013, 1002418, 1022047, 1082145, 1082147, 1082146, 1082178, 1082175,
+
+ /* Common setup */
+ 3010073, 3010099,
+
+ /* Warrior equipment */
+ 1422013, 1432030,
+
+ /* Magician equipment */
+ 1372002, 1382003,
+
+ /* Bowman equipment */
+ 1040023,
+
+ /* Thief equipment */
+ 1332003, 1002209,
+
+ /* Pirate equipment */
+ 1082198, 1082213, 1482007, 1492004, 1002646
+
+ };
}
@Override
public int[] getUncommonItems() {
- return new int [] {};
+ return new int [] {2040916, 1102042};
}
@Override
public int[] getRareItems() {
- return new int [] {1022082, 1022060};
+ return new int [] {};
}
}
diff --git a/src/server/gachapon/ShowaSpaMale.java b/src/server/gachapon/ShowaSpaMale.java
index d55f802cb9..18c983c1d9 100644
--- a/src/server/gachapon/ShowaSpaMale.java
+++ b/src/server/gachapon/ShowaSpaMale.java
@@ -2,24 +2,59 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots src: http://maplesecrets.blogspot.com/2011/05/gachapon-showa-towns-sauna.html
*/
public class ShowaSpaMale extends GachaponItems {
@Override
public int[] getCommonItems() {
- return new int [] {};
+ return new int [] {
+
+ /* Scroll */
+ 2048005, 2048002, 2043202, 2044602, 2043214, 2041307, 2041035, 2044104, 2044505, 2044305, 2043304, 2044902,
+ 2044901, 2044811, 2044903, 2044804,
+
+ /* Useable drop */
+ 2022016, 2000005, 2022025, 2022027,
+
+ /* Common equipment */
+ 1332020, 1312004, 1332032, 1322023, 1322026, 1322022, 1322012, 1302014, 1302049, 1302017, 1332007, 1432009,
+ 1432016, 1432017, 1432009, 1402013, 1402044, 1442014, 1442017, 1442016, 1442025, 1002418, 1082178, 1082179,
+ 1082148, 1032027, 1032032, 1102028, 1102086,
+
+ /* Common setup */
+ 3010073, 3010111,
+
+ /* Warrior equipment */
+ 1412005, 1402048, 1402049, 1322011, 1302003, 1302004, 1302008,
+
+ /* Magician equipment */
+ 1372000, 1372009, 1372001, 1372011, 1382006, 1382014,
+
+ /* Bowman equipment */
+ 1452018, 1452006, 1452008, 1452005, 1462002, 1462007, 1462003, 1002169,
+
+ /* Thief equipment */
+ 1472023, 1332012, 1332017, 1332022, 1332006, 1332029, 1040097,
+
+ /* Pirate equipment */
+ 1052107, 1082204, 1072318, 1002637, 1482009, 1492007
+
+ };
}
@Override
public int[] getUncommonItems() {
- return new int [] {};
+ return new int [] {2040916, 1102042};
}
@Override
public int[] getRareItems() {
- return new int [] {1022082, 1022060};
+ return new int [] {};
}
}
diff --git a/src/server/gachapon/Sleepywood.java b/src/server/gachapon/Sleepywood.java
index 0205674bf5..62bfe12d7b 100644
--- a/src/server/gachapon/Sleepywood.java
+++ b/src/server/gachapon/Sleepywood.java
@@ -2,7 +2,10 @@ package server.gachapon;
/**
*
-* @author Alan (SharpAceX)
+* @author Alan (SharpAceX) - gachapon source classes stub & pirate equipment
+* @author Ronan - parsed MapleSEA loots
+*
+* MapleSEA-like loots thanks to AyumiLove, src: https://ayumilovemaple.wordpress.com/maplestory-gachapon-guide/
*/
public class Sleepywood extends GachaponItems {
@@ -10,97 +13,47 @@ public class Sleepywood extends GachaponItems {
@Override
public int[] getCommonItems() {
return new int [] {
- //warriorEquips = {
- 1002022, 1002024, 1002028, 1002029, 1002030,
- 1002045, 1002046, 1002084, 1002085, 1002086,
- 1002091, 1002094, 1002095, 1002100, 1002101,
- 1040087, 1040088, 1040089, 1040090, 1040091,
- 1040092, 1040093, 1040102, 1040103, 1040104,
- 1041087, 1041088, 1041089, 1041091, 1041092,
- 1041093, 1041097, 1041098, 1041099, 1060076,
- 1060077, 1060078, 1060079, 1060080, 1060081,
- 1060082, 1060090, 1060091, 1060092, 1061086,
- 1061087, 1061088, 1061090, 1061091, 1061092,
- 1061096, 1061097, 1061098, 1072132, 1072133,
- 1072134, 1072135, 1072147, 1072148, 1072149,
- 1072154, 1072155, 1072156, 1082009, 1082010,
- 1082011, 1082059, 1082060, 1082061, 1082103,
- 1082104, 1082105, 1082218, 1092004, 1092009,
- 1092010, 1092011, 1092015, 1092016, 1092017,
- 1302010, 1302011, 1302012, 1302015, 1302019,
- 1302037, 1302079, 1312008, 1312009,
- 1312010, 1322017, 1322018, 1322019, 1322059,
- 1402003, 1402011, 1402012, 1402017, 1412003,
- 1412007, 1412008, 1412032, 1422005, 1422009,
- 1422010, 1432004, 1432006, 1432007, 1432045,
- 1442005, 1442008, 1442010, 1442060,
- //magicianEquips = {
- 1002215, 1002216, 1002217, 1002218, 1002242,
- 1002243, 1002244, 1002245, 1002246, 1002252,
- 1002253, 1002254, 1050045, 1050046, 1050047,
- 1050048, 1050049, 1050053, 1050054, 1050055,
- 1050056, 1050067, 1050068, 1050069, 1050070,
- 1051030, 1051031, 1051032, 1051033, 1051034,
- 1051044, 1051045, 1051046, 1051047, 1051052,
- 1051053, 1051054, 1051055, 1072136, 1072137,
- 1072138, 1072139, 1072140, 1072141, 1072142,
- 1072143, 1072157, 1072158, 1072159, 1072160,
- 1082080, 1082081, 1082082, 1082086, 1082087,
- 1082088, 1082098, 1082099, 1082100, 1372007,
- 1372008, 1372011, 1372014, 1372015, 1372035,
- 1372036, 1372037, 1372038, 1382001, 1382006,
- 1382007, 1382011, 1382014, 1382041,
- //bowmanEquips = {
- 1002211, 1002212, 1002213, 1002214, 1002267,
- 1002268, 1002269, 1002270, 1002286, 1002287,
- 1002288, 1002289, 1002749, 1050051, 1050052,
- 1050058, 1050059, 1050060, 1050061, 1050062,
- 1050063, 1050064, 1051037, 1051038, 1051039,
- 1051041, 1051042, 1051043, 1051062, 1051063,
- 1051064, 1051065, 1072122, 1072123, 1072124,
- 1072125, 1072144, 1072145, 1072146, 1072164,
- 1072165, 1072166, 1072167, 1072345, 1082083,
- 1082084, 1082085, 1082089, 1082090, 1082091,
- 1082106, 1082107, 1082108, 1452004, 1452008,
- 1452009, 1452010, 1452011, 1452018, 1452023,
- 1452052, 1462006, 1462007, 1462008, 1462009,
- 1462046,
- //thiefEquips = {
- 1002207, 1002208, 1002209, 1002210, 1002247,
- 1002248, 1002249, 1002281, 1002282, 1002283,
- 1002284, 1002285, 1002656, 1002750, 1040094,
- 1040095, 1040096, 1040097, 1040098, 1040099,
- 1040100, 1040105, 1040106, 1040107, 1041077,
- 1041078, 1041079, 1041080, 1041094, 1041095,
- 1041096, 1041100, 1041101, 1041102, 1041103,
- 1060083, 1060084, 1060085, 1060086, 1060087,
- 1060088, 1060089, 1060093, 1060094, 1060095,
- 1061076, 1061077, 1061078, 1061079, 1061093,
- 1061094, 1061095, 1061099, 1061100, 1061101,
- 1061102, 1072128, 1072129, 1072130, 1072131,
- 1072150, 1072151, 1072152, 1072161, 1072162,
- 1072163, 1072346, 1082065, 1082066, 1082067,
- 1082092, 1082093, 1082094, 1082095, 1082096,
- 1082097, 1332003, 1332015, 1332018, 1332024,
- 1332054, 1332064, 1472018, 1472019, 1472020,
- 1472021, 1472022, 1472023, 1472024, 1472025,
- 1472026, 1472027, 1472028, 1472029, 1472054,
- 1472062,
- //pirateEquips = {
- 1002631, 1002634, 1002637, 1052116, 1052119,
- 1052122, 1072303, 1072306, 1072309, 1082198,
- 1082201, 1082204, 1482007, 1482008, 1482009,
- };
+
+ /* Scroll */
+ 2048003, 2048000, 2040601, 2044501, 2041019, 2041016, 2041022, 2041010, 2041013, 2043301, 2040301, 2040801, 2040001,
+ 2040004, 2043101, 2043201, 2043001, 2040504, 2040501, 2048004, 2048001, 2044401, 2040901, 2040701, 2040704, 2040707,
+ 2044301, 2043801, 2044101, 2044201, 2044001, 2040602, 2044502, 2041020, 2041017, 2041023, 2041014, 2041005, 2044702,
+ 2044602, 2043302, 2040302, 2040802, 2040005, 2043202, 2043002, 2040505, 2040502, 2048005, 2048002, 2044402, 2040902,
+ 2040702, 2040705, 2040708, 2044302, 2043802, 2044202, 2044002, 2044801, 2044903, 2044814,
+
+ /* Useable drop */
+ 2012000, 2012003, 2020007, 2000004, 2012001, 2020008, 2070006, 2020012, 2000005, 2030007, 2012002, 2002001, 2070005,
+
+ /* Common equipment */
+ 1032003, 1432009, 1102014, 1102018, 1002392, 1322026, 1032022, 1312012, 1332020, 1092030, 1032016, 1032015, 1032014,
+ 1322024, 1032013, 1322022, 1102016, 1032012, 1032023, 1402014, 1032000, 1102017,
+
+ /* Warrior equipment */
+ 1402017, 1051010, 1432011, 1442006, 1322002, 1422004, 1432010, 1051011, 1060018, 1432000, 1422003, 1412003, 1422000,
+
+ /* Magician equipment */
+ 1002034, 1002142, 1382010, 1002013, 1382008, 1382011, 1050047, 1002065,
+
+ /* Bowman equipment */
+ 1452003, 1002165, 1040068, 1462013, 1462011, 1462012, 1061050, 1462010, 1002161,
+
+ /* Thief equipment */
+ 1332022, 1002175, 1040042, 1472004, 1040057, 1332031, 1332023, 1332010, 1002171, 1060046,
+
+ /* Pirate equipment */
+ 1002631, 1002634, 1002637, 1052116, 1052119, 1052122, 1072303, 1072306, 1072309, 1082198, 1082201, 1082204, 1482007,
+ 1482008, 1482009
+ };
}
@Override
public int[] getUncommonItems() {
- return new int [] {};
+ return new int [] {2040804, 2040817, 2040805, 2340000, 1082149, 1442018};
}
@Override
public int[] getRareItems() {
- return new int [] {1302068, 2070007, 1022082, 1022058};
+ return new int [] {};
}
}
diff --git a/src/server/life/MapleLifeFactory.java b/src/server/life/MapleLifeFactory.java
index 0869588060..b691581503 100644
--- a/src/server/life/MapleLifeFactory.java
+++ b/src/server/life/MapleLifeFactory.java
@@ -21,6 +21,7 @@ along with this program. If not, see .
*/
package server.life;
+import java.awt.Point;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
@@ -216,6 +217,14 @@ public class MapleLifeFactory {
stats.setBanishInfo(new BanishInfo(MapleDataTool.getString("banMsg", banishData), MapleDataTool.getInt("banMap/0/field", banishData, -1), MapleDataTool.getString("banMap/0/portal", banishData, "sp")));
}
+ int noFlip = MapleDataTool.getInt("noFlip", monsterInfoData, 0);
+ if (noFlip > 0) {
+ Point origin = MapleDataTool.getPoint("stand/0/origin", monsterData, null);
+ if (origin != null) {
+ stats.setFixedStance(origin.getX() < 1 ? 5 : 4); // fixed left/right
+ }
+ }
+
return new Pair<>(stats, attackInfos);
}
@@ -269,6 +278,10 @@ public class MapleLifeFactory {
public static MapleNPC getNPC(int nid) {
return new MapleNPC(nid, new MapleNPCStats(MapleDataTool.getString(nid + "/name", npcStringData, "MISSINGNO")));
}
+
+ public static String getNPCDefaultTalk(int nid) {
+ return MapleDataTool.getString(nid + "/d0", npcStringData, "(...)");
+ }
public static class BanishInfo {
diff --git a/src/server/life/MapleMonster.java b/src/server/life/MapleMonster.java
index e1492fa3b7..26a389e837 100644
--- a/src/server/life/MapleMonster.java
+++ b/src/server/life/MapleMonster.java
@@ -56,7 +56,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import net.server.audit.locks.MonitoredReentrantLock;
import net.server.channel.Channel;
-import net.server.world.World;
import net.server.world.MapleParty;
import net.server.world.MaplePartyCharacter;
import scripting.event.EventInstanceManager;
@@ -64,6 +63,7 @@ import server.TimerManager;
import server.life.MapleLifeFactory.BanishInfo;
import server.maps.MapleMap;
import server.maps.MapleMapObjectType;
+import tools.IntervalBuilder;
import tools.MaplePacketCreator;
import tools.Pair;
import tools.Randomizer;
@@ -72,6 +72,7 @@ import net.server.audit.locks.MonitoredLockType;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
import net.server.coordinator.MapleMonsterAggroCoordinator;
import server.MapleStatEffect;
+import server.loot.MapleLootManager;
import server.maps.MapleSummon;
public class MapleMonster extends AbstractLoadedMapleLife {
@@ -94,12 +95,11 @@ public class MapleMonster extends AbstractLoadedMapleLife {
private Map, Integer> skillsUsed = new HashMap<>();
private Set usedAttacks = new HashSet<>();
private Set calledMobOids = null;
- private int calledMobCount = 0;
private WeakReference callerMob = new WeakReference<>(null);
private List stolenItems = new ArrayList<>();
private int team;
private int parentMobOid = 0;
- private final HashMap takenDamage = new HashMap<>();
+ private final HashMap takenDamage = new HashMap<>();
private Runnable removeAfterAction = null;
private boolean availablePuppetUpdate = true;
@@ -160,13 +160,17 @@ public class MapleMonster extends AbstractLoadedMapleLife {
this.parentMobOid = parentMobId;
}
- public int countAvailableMobSummons(int limit, int skillLimit) { // limit prop for summons has another conotation, found thanks to MedicOP
+ public int countAvailableMobSummons(int summonsSize, int skillLimit) { // limit prop for summons has another conotation, found thanks to MedicOP
+ int summonsCount;
+
Set calledOids = this.calledMobOids;
if(calledOids != null) {
- limit -= calledOids.size();
+ summonsCount = calledOids.size();
+ } else {
+ summonsCount = 0;
}
- return Math.min(limit, skillLimit - this.calledMobCount);
+ return Math.min(summonsSize, skillLimit - summonsCount);
}
public void addSummonedMob(MapleMonster mob) {
@@ -178,7 +182,6 @@ public class MapleMonster extends AbstractLoadedMapleLife {
calledOids.add(mob.getObjectId());
mob.setSummonerMob(this);
- this.calledMobCount += 1;
}
private void removeSummonedMob(int mobOid) {
@@ -442,7 +445,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
dispatchMonsterDamaged(from, trueDamage);
if (!takenDamage.containsKey(from.getId())) {
- takenDamage.put(from.getId(), new AtomicInteger(trueDamage));
+ takenDamage.put(from.getId(), new AtomicLong(trueDamage));
} else {
takenDamage.get(from.getId()).addAndGet(trueDamage);
}
@@ -475,98 +478,85 @@ public class MapleMonster extends AbstractLoadedMapleLife {
return takenDamage.containsKey(chr.getId());
}
- private void distributeExperienceToParty(int pid, float exp, int mostDamageCid, int minThresholdLevel, int killerLevel, Set underleveled, Map partyExpReward, Set participants) {
- MapleCharacter pchar = getMap().getAnyCharacterFromParty(pid); // thanks G h o s t, Alfred, Vcoc, BHB for poiting out a bug in detecting party members after membership transactions in a party took place
-
- List members;
- if (pchar != null) {
- members = pchar.getPartyMembersOnSameMap();
- } else {
- members = new LinkedList<>();
+ private static boolean isWhiteExpGain(MapleCharacter chr, Map personalRatio, double sdevRatio) {
+ Float pr = personalRatio.get(chr.getId());
+ if (pr == null) {
+ return false;
}
- List expSharers = new LinkedList<>();
- int expParticipantsMaxLevel = 1;
- boolean hasMostDamageCid = false;
- for (MapleCharacter mc : members) {
- if (mc.getId() == mostDamageCid) {
- hasMostDamageCid = true;
- }
-
- if (mc.getLevel() >= minThresholdLevel) { //NO EXP WILL BE GIVEN for those who are underleveled!
- if (Math.abs(killerLevel - mc.getLevel()) < ServerConstants.MIN_RANGELEVEL_TO_EXP_LEECH) {
- // thanks Thora for pointing out leech level limitation
-
- if (expParticipantsMaxLevel < mc.getLevel() && participants.contains(mc)) {
- expParticipantsMaxLevel = mc.getLevel();
- }
- expSharers.add(mc);
- }
- } else {
- underleveled.add(mc);
- }
- }
-
- int numExpSharers = expSharers.size();
-
- // PARTY BONUS: 2p -> +5% , 3p -> +6.25% , 4p -> +7.5% , 5p -> +8.75% , 6p -> +10%
- // MOST DAMAGE BONUS: 1.5x bonus
-
- // thanks Crypter for reporting an insufficiency on party exp bonuses
- final float partyModifier = numExpSharers <= 1 ? 0.0f : 0.05f + (0.0125f * (numExpSharers - 1));
- final float mostDamageModifier = hasMostDamageCid ? 1.5f : 1.0f;
- final float partyExp = exp * partyModifier * mostDamageModifier;
-
- for (MapleCharacter mc : expSharers) {
- float levelPenaltyModifier = (float) Math.min(1.0, Math.sqrt(((float) mc.getLevel()) / expParticipantsMaxLevel));
- partyExpReward.put(mc, partyExp * levelPenaltyModifier);
- }
- }
-
- private int calcThresholdLevel(boolean isPqMob) {
- if(!ServerConstants.USE_ENFORCE_MOB_LEVEL_RANGE) {
- return 0;
- } else if (isPqMob) {
- double thresholdLevel = getLevel();
- thresholdLevel /= 32.55916838;
- thresholdLevel = Math.log(thresholdLevel) / 0.02058204546;
-
- return (int) Math.ceil(thresholdLevel);
- } else {
- return getLevel() - (!isBoss() ? ServerConstants.MIN_UNDERLEVEL_TO_EXP_GAIN : 2 * ServerConstants.MIN_UNDERLEVEL_TO_EXP_GAIN);
- }
+ return pr >= sdevRatio;
}
- private static double calcExperienceStandDevThreshold(Map personalExpReward, float exp2) {
+ private static double calcExperienceStandDevThreshold(List entryExpRatio, int totalEntries) {
float avgExpReward = 0.0f;
- for (Float exp : personalExpReward.values()) {
+ for (Float exp : entryExpRatio) {
avgExpReward += exp;
}
// thanks Simon for finding an issue with solo party player gaining yellow EXP when soloing mobs
- float realAvgExpReward = avgExpReward;
- avgExpReward -= exp2; // clear out the 20% raw exp from last hitting
- avgExpReward /= personalExpReward.size();
+ avgExpReward /= totalEntries;
float varExpReward = 0.0f;
- for (Float exp : personalExpReward.values()) {
- varExpReward += Math.pow(exp - realAvgExpReward, 2);
+ for (Float exp : entryExpRatio) {
+ varExpReward += Math.pow(exp - avgExpReward, 2);
}
- varExpReward /= personalExpReward.size();
+ varExpReward /= entryExpRatio.size();
return avgExpReward + Math.sqrt(varExpReward);
}
- private void propagateExperienceGains(Map personalExpReward, Map partyExpReward, float exp2) {
- Set expRewardPlayers = new HashSet<>(personalExpReward.keySet());
- expRewardPlayers.addAll(partyExpReward.keySet());
+ private void distributePlayerExperience(MapleCharacter chr, float exp, float partyBonusMod, int totalPartyLevel, boolean highestPartyDamager, boolean whiteExpGain) {
+ float playerExp = (ServerConstants.EXP_SPLIT_COMMON_MOD * chr.getLevel()) / totalPartyLevel;
+ if (highestPartyDamager) playerExp += ServerConstants.EXP_SPLIT_MVP_MOD;
- double sdevExp = calcExperienceStandDevThreshold(personalExpReward, exp2);
- for (MapleCharacter chr : expRewardPlayers) {
- Float personalExp = personalExpReward.get(chr);
- Float partyExp = partyExpReward.get(chr);
+ playerExp *= exp;
+ float bonusExp = partyBonusMod * playerExp;
+
+ this.giveExpToCharacter(chr, playerExp, bonusExp, whiteExpGain);
+ }
+
+ private void distributePartyExperience(Map partyParticipation, float expPerDmg, Set underleveled, Map personalRatio, double sdevRatio) {
+ IntervalBuilder leechInterval = new IntervalBuilder();
+ leechInterval.addInterval(this.getLevel() - ServerConstants.EXP_SPLIT_LEVEL_INTERVAL, this.getLevel() + ServerConstants.EXP_SPLIT_LEVEL_INTERVAL);
+
+ long maxDamage = 0, partyDamage = 0;
+ MapleCharacter participationMvp = null;
+ for (Entry e : partyParticipation.entrySet()) {
+ long entryDamage = e.getValue();
+ partyDamage += entryDamage;
- this.giveExpToCharacter(chr, personalExp, partyExp, personalExp != null && personalExp >= sdevExp);
+ if (maxDamage < entryDamage) {
+ maxDamage = entryDamage;
+ participationMvp = e.getKey();
+ }
+
+ // thanks Thora for pointing out leech level limitation
+ int chrLevel = e.getKey().getLevel();
+ leechInterval.addInterval(chrLevel - ServerConstants.EXP_SPLIT_LEECH_INTERVAL, chrLevel + ServerConstants.EXP_SPLIT_LEECH_INTERVAL);
+ }
+
+ List expMembers = new LinkedList<>();
+ int totalPartyLevel = 0;
+
+ // thanks G h o s t, Alfred, Vcoc, BHB for poiting out a bug in detecting party members after membership transactions in a party took place
+ for (MapleCharacter member : partyParticipation.keySet().iterator().next().getPartyMembersOnSameMap()) {
+ if (!leechInterval.inInterval(member.getLevel())) {
+ underleveled.add(member);
+ continue;
+ }
+
+ totalPartyLevel += member.getLevel();
+ expMembers.add(member);
+ }
+
+ int membersSize = expMembers.size();
+ float participationExp = partyDamage * expPerDmg;
+
+ // thanks Crypter for reporting an insufficiency on party exp bonuses
+ float partyBonusMod = (membersSize > 1) ? 0.05f * membersSize : 0.0f;
+
+ for (MapleCharacter mc : expMembers) {
+ distributePlayerExperience(mc, participationExp, partyBonusMod, totalPartyLevel, mc == participationMvp, isWhiteExpGain(mc, personalRatio, sdevRatio));
}
}
@@ -575,84 +565,89 @@ public class MapleMonster extends AbstractLoadedMapleLife {
return;
}
- Map personalExpReward = new HashMap<>();
- Map partyExpReward = new HashMap<>();
+ Map> partyExpDist = new HashMap<>();
+ Map soloExpDist = new HashMap<>();
+
+ Map mapPlayers = map.getMapAllPlayers();
+
+ int totalEntries = 0; // counts "participant parties", players who no longer are available in the map is an "independent party"
+ for (Entry e : takenDamage.entrySet()) {
+ MapleCharacter chr = mapPlayers.get(e.getKey());
+ if (chr != null) {
+ long damage = e.getValue().longValue();
+
+ MapleParty p = chr.getParty();
+ if (p != null) {
+ Map partyParticipation = partyExpDist.get(p);
+ if (partyParticipation == null) {
+ partyParticipation = new HashMap<>(6);
+ partyExpDist.put(p, partyParticipation);
+
+ totalEntries += 1;
+ }
+
+ partyParticipation.put(chr, damage);
+ } else {
+ soloExpDist.put(chr, damage);
+ totalEntries += 1;
+ }
+ } else {
+ totalEntries += 1;
+ }
+ }
+
+ long totalDamage = maxHpPlusHeal.get();
+ int mobExp = getExp();
+ float expPerDmg = ((float) mobExp) / totalDamage;
+
+ Map personalRatio = new HashMap<>();
+ List entryExpRatio = new LinkedList<>();
+ for (Entry e : soloExpDist.entrySet()) {
+ float ratio = ((float) e.getValue()) / totalDamage;
+
+ personalRatio.put(e.getKey().getId(), ratio);
+ entryExpRatio.add(ratio);
+ }
+
+ for (Map m : partyExpDist.values()) {
+ float ratio = 0.0f;
+ for (Entry e : m.entrySet()) {
+ float chrRatio = ((float) e.getValue()) / totalDamage;
+
+ personalRatio.put(e.getKey().getId(), chrRatio);
+ ratio += chrRatio;
+ }
+
+ entryExpRatio.add(ratio);
+ }
+
+ double sdevRatio = calcExperienceStandDevThreshold(entryExpRatio, totalEntries);
+
+ // GMS-like player and party split calculations found thanks to Russt, KaidaTan, Dusk, AyumiLove. Src: https://ayumilovemaple.wordpress.com/maplestory_calculator_formula/
+ Set underleveled = new HashSet<>();
+ for (Entry chrParticipation : soloExpDist.entrySet()) {
+ float exp = chrParticipation.getValue() * expPerDmg;
+ MapleCharacter chr = chrParticipation.getKey();
+
+ distributePlayerExperience(chr, exp, 0.0f, chr.getLevel(), true, isWhiteExpGain(chr, personalRatio, sdevRatio));
+ }
+
+ for (Map partyParticipation : partyExpDist.values()) {
+ distributePartyExperience(partyParticipation, expPerDmg, underleveled, personalRatio, sdevRatio);
+ }
EventInstanceManager eim = getMap().getEventInstance();
- int minThresholdLevel = calcThresholdLevel(eim != null), killerLevel = Integer.MAX_VALUE;
- int exp = getExp();
- long totalHealth = maxHpPlusHeal.get();
- Map expDist = new HashMap<>();
- Map partyExp = new HashMap<>();
-
- float exp8perHp = (0.8f * exp) / totalHealth; // 80% of pool is split amongst all the damagers
- float exp2 = (0.2f * exp); // 20% of pool goes to the killer or his/her party
-
- for (Entry damage : takenDamage.entrySet()) {
- expDist.put(damage.getKey(), exp8perHp * damage.getValue().get());
- }
-
- Set underleveled = new HashSet<>();
- Collection mapChrs = map.getCharacters();
- for (MapleCharacter mc : mapChrs) {
- Float mcExp = expDist.remove(mc.getId());
- if (mcExp != null) {
- float xp = mcExp;
- boolean isKiller = (mc.getId() == killerId);
- if (isKiller) {
- if (eim != null) {
- eim.monsterKilled(mc, this);
- }
-
- killerLevel = mc.getLevel();
- xp += exp2;
- }
-
- if(mc.getLevel() >= minThresholdLevel) {
- //NO EXP WILL BE GIVEN for those who are underleveled!
- personalExpReward.put(mc, xp);
-
- MapleParty p = mc.getParty();
- if (p != null) { // for party bonus exp
- int pID = p.getId();
- float pXP = xp + (partyExp.containsKey(pID) ? partyExp.get(pID) : 0);
- partyExp.put(pID, pXP);
- }
- } else {
- underleveled.add(mc);
- }
+ if (eim != null) {
+ MapleCharacter chr = mapPlayers.get(killerId);
+ if (chr != null) {
+ eim.monsterKilled(chr, this);
}
}
- if(!expDist.isEmpty()) { // locate on world server the partyid of the missing characters
- World wserv = map.getWorldServer();
-
- for (Entry ed : expDist.entrySet()) {
- boolean isKiller = (ed.getKey() == killerId);
- float xp = ed.getValue();
- if (isKiller) {
- xp += exp2;
- }
-
- Integer pID = wserv.getCharacterPartyid(ed.getKey());
- if (pID != null) {
- float pXP = xp + (partyExp.containsKey(pID) ? partyExp.get(pID) : 0);
- partyExp.put(pID, pXP);
- }
- }
- }
-
- Set participants = personalExpReward.keySet();
- int mostDamageCid = this.getHighestDamagerId();
- for (Entry party : partyExp.entrySet()) {
- distributeExperienceToParty(party.getKey(), party.getValue(), mostDamageCid, minThresholdLevel, killerLevel, underleveled, partyExpReward, participants);
- }
-
for(MapleCharacter mc : underleveled) {
mc.showUnderleveledInfo(this);
}
- propagateExperienceGains(personalExpReward, partyExpReward, killerLevel != Integer.MAX_VALUE ? exp2 : 0.0f);
}
private float getStatusExpMultiplier(MapleCharacter attacker) {
@@ -718,6 +713,20 @@ public class MapleMonster extends AbstractLoadedMapleLife {
attacker.updateQuestMobCount(getId());
}
}
+
+ public List retrieveRelevantDrops() {
+ Map pchars = map.getMapAllPlayers();
+
+ List lootChars = new LinkedList<>();
+ for (Integer cid : takenDamage.keySet()) {
+ MapleCharacter chr = pchars.get(cid);
+ if (chr != null && chr.isLoggedinWorld()) {
+ lootChars.add(chr);
+ }
+ }
+
+ return MapleLootManager.retrieveRelevantDrops(this.getId(), lootChars);
+ }
public MapleCharacter killBy(final MapleCharacter killer) {
distributeExperience(killer != null ? killer.getId() : 0);
@@ -904,9 +913,9 @@ public class MapleMonster extends AbstractLoadedMapleLife {
public int getHighestDamagerId() {
int curId = 0;
- int curDmg = 0;
+ long curDmg = 0;
- for (Entry damage : takenDamage.entrySet()) {
+ for (Entry damage : takenDamage.entrySet()) {
curId = damage.getValue().get() >= curDmg ? damage.getKey() : curId;
curDmg = damage.getKey() == curId ? damage.getValue().get() : curDmg;
}
@@ -1012,6 +1021,16 @@ public class MapleMonster extends AbstractLoadedMapleLife {
return stats.isMobile();
}
+ @Override
+ public boolean isFacingLeft() {
+ int fixedStance = stats.getFixedStance(); // thanks DimDiDima for noticing inconsistency on some AOE mobskills
+ if (fixedStance != 0) {
+ return Math.abs(fixedStance) % 2 == 1;
+ }
+
+ return super.isFacingLeft();
+ }
+
public ElementalEffectiveness getElementalEffectiveness(Element e) {
statiLock.lock();
try {
diff --git a/src/server/life/MapleMonsterStats.java b/src/server/life/MapleMonsterStats.java
index bf8073b4ab..94d3a07038 100644
--- a/src/server/life/MapleMonsterStats.java
+++ b/src/server/life/MapleMonsterStats.java
@@ -50,6 +50,7 @@ public class MapleMonsterStats {
public BanishInfo banish = null;
public List loseItem = null;
public selfDestruction selfDestruction = null;
+ public int fixedStance = 0;
public boolean friendly;
public void setChange(boolean change) {
@@ -339,6 +340,14 @@ public class MapleMonsterStats {
this.MDDamage = MDDamage;
}
+ public int getFixedStance() {
+ return this.fixedStance;
+ }
+
+ public void setFixedStance(int stance) {
+ this.fixedStance = stance;
+ }
+
public MapleMonsterStats copy() {
MapleMonsterStats copy = new MapleMonsterStats();
try {
diff --git a/src/server/life/MobSkill.java b/src/server/life/MobSkill.java
index 03606d2e5e..55c6e6436d 100644
--- a/src/server/life/MobSkill.java
+++ b/src/server/life/MobSkill.java
@@ -197,7 +197,7 @@ public class MobSkill {
}
break;
case 131: // Mist
- monster.getMap().spawnMist(new MapleMist(calculateBoundingBox(monster.getPosition(), true), monster, this), x * 100, false, false, false);
+ monster.getMap().spawnMist(new MapleMist(calculateBoundingBox(monster.getPosition(), monster.isFacingLeft()), monster, this), x * 100, false, false, false);
break;
case 132:
disease = MapleDisease.CONFUSE;
@@ -253,9 +253,9 @@ public class MobSkill {
List summons = getSummons();
int summonLimit = monster.countAvailableMobSummons(summons.size(), skillLimit);
if (summonLimit >= 1) {
- Collections.shuffle(summons);
boolean bossRushMap = GameConstants.isBossRush(map.getId());
-
+
+ Collections.shuffle(summons);
for (Integer mobId : summons.subList(0, summonLimit)) {
MapleMonster toSpawn = MapleLifeFactory.getMonster(mobId);
if (toSpawn != null) {
@@ -412,12 +412,11 @@ public class MobSkill {
int multiplier = facingLeft ? 1 : -1;
Point mylt = new Point(lt.x * multiplier + posFrom.x, lt.y + posFrom.y);
Point myrb = new Point(rb.x * multiplier + posFrom.x, rb.y + posFrom.y);
- return new Rectangle(mylt.x, mylt.y, myrb.x - mylt.x, myrb.y - mylt.y);
+ Rectangle bounds = new Rectangle(mylt.x, mylt.y, myrb.x - mylt.x, myrb.y - mylt.y);
+ return bounds;
}
private List getObjectsInRange(MapleMonster monster, MapleMapObjectType objectType) {
- List objectTypes = new ArrayList();
- objectTypes.add(objectType);
- return monster.getMap().getMapObjectsInBox(calculateBoundingBox(monster.getPosition(), monster.isFacingLeft()), objectTypes);
+ return monster.getMap().getMapObjectsInBox(calculateBoundingBox(monster.getPosition(), monster.isFacingLeft()), Collections.singletonList(objectType));
}
}
diff --git a/src/server/loot/MapleLootManager.java b/src/server/loot/MapleLootManager.java
index 48f60392d6..d988869823 100644
--- a/src/server/loot/MapleLootManager.java
+++ b/src/server/loot/MapleLootManager.java
@@ -23,7 +23,7 @@ import client.MapleCharacter;
import java.util.LinkedList;
import java.util.List;
-import server.MapleItemInformationProvider;
+//import server.MapleItemInformationProvider;
import server.life.MapleMonsterInformationProvider;
import server.life.MonsterDropEntry;
import server.quest.MapleQuest;
@@ -34,7 +34,7 @@ import server.quest.MapleQuest;
*/
public class MapleLootManager {
- private static boolean isRelevantDrop(MonsterDropEntry dropEntry, List partyMembers, List partyInv) {
+ private static boolean isRelevantDrop(MonsterDropEntry dropEntry, List players, List playersInv) {
int qStartAmount = 0, qCompleteAmount = 0;
MapleQuest quest = MapleQuest.getInstance(dropEntry.questid);
if (quest != null) {
@@ -42,12 +42,12 @@ public class MapleLootManager {
qCompleteAmount = quest.getCompleteItemAmountNeeded(dropEntry.itemId);
}
- boolean restricted = MapleItemInformationProvider.getInstance().isPickupRestricted(dropEntry.itemId);
- for (int i = 0; i < partyMembers.size(); i++) {
- MapleLootInventory chrInv = partyInv.get(i);
+ //boolean restricted = MapleItemInformationProvider.getInstance().isPickupRestricted(dropEntry.itemId);
+ for (int i = 0; i < players.size(); i++) {
+ MapleLootInventory chrInv = playersInv.get(i);
if (dropEntry.questid > 0) {
- int qItemAmount, chrQuestStatus = partyMembers.get(i).getQuestStatus(dropEntry.questid);
+ int qItemAmount, chrQuestStatus = players.get(i).getQuestStatus(dropEntry.questid);
if (chrQuestStatus == 0) {
qItemAmount = qStartAmount;
} else if (chrQuestStatus != 1) {
@@ -63,12 +63,12 @@ public class MapleLootManager {
int qItemStatus = chrInv.hasItem(dropEntry.itemId, qItemAmount);
if (qItemStatus == 2) {
continue;
- } else if (restricted && qItemStatus == 1) {
+ } /*else if (restricted && qItemStatus == 1) {
continue;
- }
- } else if (restricted && chrInv.hasItem(dropEntry.itemId, 1) > 0) {
+ }*/
+ } /*else if (restricted && chrInv.hasItem(dropEntry.itemId, 1) > 0) { // thanks Conrad, Legalize for noticing eligible loots not being available to drop for non-killer parties
continue;
- }
+ }*/
return true;
}
@@ -76,19 +76,19 @@ public class MapleLootManager {
return false;
}
- public static List retrieveRelevantDrops(int monsterId, List partyMembers) {
+ public static List retrieveRelevantDrops(int monsterId, List players) {
List loots = MapleMonsterInformationProvider.getInstance().retrieveEffectiveDrop(monsterId);
if(loots.isEmpty()) return loots;
- List partyInv = new LinkedList<>();
- for(MapleCharacter chr : partyMembers) {
+ List playersInv = new LinkedList<>();
+ for(MapleCharacter chr : players) {
MapleLootInventory lootInv = new MapleLootInventory(chr);
- partyInv.add(lootInv);
+ playersInv.add(lootInv);
}
List effectiveLoot = new LinkedList<>();
for(MonsterDropEntry mde : loots) {
- if(isRelevantDrop(mde, partyMembers, partyInv)) {
+ if(isRelevantDrop(mde, players, playersInv)) {
effectiveLoot.add(mde);
}
}
diff --git a/src/server/maps/MapleDoor.java b/src/server/maps/MapleDoor.java
index 7da336de0d..abbb4c79e7 100644
--- a/src/server/maps/MapleDoor.java
+++ b/src/server/maps/MapleDoor.java
@@ -22,6 +22,7 @@
package server.maps;
import java.awt.Point;
+import java.util.Collection;
import tools.Pair;
import server.MaplePortal;
@@ -39,6 +40,8 @@ public class MapleDoor {
private MaplePortal townPortal;
private MapleMap target;
private Pair posStatus = null;
+ private long deployTime;
+ private boolean active;
private MapleDoorObject townDoor;
private MapleDoorObject areaDoor;
@@ -55,6 +58,8 @@ public class MapleDoor {
if(posStatus == null) {
this.town = this.target.getReturnMap();
this.townPortal = getTownDoorPortal(owner.getDoorSlot());
+ this.deployTime = System.currentTimeMillis();
+ this.active = true;
if(townPortal != null) {
this.areaDoor = new MapleDoorObject(ownerId, town, target, townPortal.getId(), targetPosition, townPortal.getPosition());
@@ -83,6 +88,57 @@ public class MapleDoor {
}
}
+ private void broadcastRemoveDoor(MapleCharacter owner) {
+ MapleDoorObject areaDoor = this.getAreaDoor();
+ MapleDoorObject townDoor = this.getTownDoor();
+
+ MapleMap target = this.getTarget();
+ MapleMap town = this.getTown();
+
+ Collection targetChars = target.getCharacters();
+ Collection townChars = town.getCharacters();
+
+ target.removeMapObject(areaDoor);
+ town.removeMapObject(townDoor);
+
+ for (MapleCharacter chr : targetChars) {
+ areaDoor.sendDestroyData(chr.getClient());
+ }
+
+ for (MapleCharacter chr : townChars) {
+ townDoor.sendDestroyData(chr.getClient());
+ }
+
+ owner.removePartyDoor(false);
+
+ if (this.getTownPortal().getId() == 0x80) {
+ for (MapleCharacter chr : townChars) {
+ MapleDoor door = chr.getMainTownDoor();
+ if (door != null) {
+ townDoor.sendSpawnData(chr.getClient());
+ }
+ }
+ }
+ }
+
+ public static void attemptRemoveDoor(final MapleCharacter owner) {
+ final MapleDoor destroyDoor = owner.getPlayerDoor();
+ if (destroyDoor != null && destroyDoor.dispose()) {
+ long effectTimeLeft = 3000 - destroyDoor.getElapsedDeployTime(); // portal deployment effect duration
+ if (effectTimeLeft > 0) {
+ MapleMap town = destroyDoor.getTown();
+ town.getChannelServer().registerOverallAction(town.getId(), new Runnable() {
+ @Override
+ public void run() {
+ destroyDoor.broadcastRemoveDoor(owner); // thanks BHB88 for noticing doors crashing players when instantly cancelling buff
+ }
+ }, effectTimeLeft);
+ } else {
+ destroyDoor.broadcastRemoveDoor(owner);
+ }
+ }
+ }
+
private MaplePortal getTownDoorPortal(int doorid) {
return town.getDoorPortal(doorid);
}
@@ -114,4 +170,21 @@ public class MapleDoor {
public Pair getDoorStatus() {
return posStatus;
}
+
+ public long getElapsedDeployTime() {
+ return System.currentTimeMillis() - deployTime;
+ }
+
+ private boolean dispose() {
+ if (active) {
+ active = false;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isActive() {
+ return active;
+ }
}
diff --git a/src/server/maps/MapleDoorObject.java b/src/server/maps/MapleDoorObject.java
index 553743a6aa..10bf1dd40f 100644
--- a/src/server/maps/MapleDoorObject.java
+++ b/src/server/maps/MapleDoorObject.java
@@ -100,15 +100,20 @@ public class MapleDoorObject extends AbstractMapleMapObject {
@Override
public void sendSpawnData(MapleClient client) {
+ sendSpawnData(client, true);
+ }
+
+ public void sendSpawnData(MapleClient client, boolean launched) {
MapleCharacter chr = client.getPlayer();
- if (from.getId() == chr.getMapId()) {
- MapleParty party = chr.getParty();
- if (party != null && (ownerId == chr.getId() || party.getMemberById(ownerId) != null)) {
- client.announce(MaplePacketCreator.partyPortal(this.getFrom().getId(), this.getTo().getId(), this.toPosition()));
+ if (this.getFrom().getId() == chr.getMapId()) {
+ if (chr.getParty() != null && (this.getOwnerId() == chr.getId() || chr.getParty().getMemberById(this.getOwnerId()) != null)) {
+ chr.announce(MaplePacketCreator.partyPortal(this.getFrom().getId(), this.getTo().getId(), this.toPosition()));
+ }
+
+ chr.announce(MaplePacketCreator.spawnPortal(this.getFrom().getId(), this.getTo().getId(), this.toPosition()));
+ if (!this.inTown()) {
+ chr.announce(MaplePacketCreator.spawnDoor(this.getOwnerId(), this.getPosition(), launched));
}
-
- client.announce(MaplePacketCreator.spawnPortal(this.getFrom().getId(), this.getTo().getId(), this.toPosition()));
- if(!this.inTown()) client.announce(MaplePacketCreator.spawnDoor(this.getOwnerId(), this.getPosition(), true));
}
}
diff --git a/src/server/maps/MapleHiredMerchant.java b/src/server/maps/MapleHiredMerchant.java
index f8e5a89f2c..f4f40a6b2d 100644
--- a/src/server/maps/MapleHiredMerchant.java
+++ b/src/server/maps/MapleHiredMerchant.java
@@ -238,8 +238,7 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
}
}
- private static boolean canBuy(MapleClient c, Item newItem) {
- System.out.println(newItem.getPet().getName());
+ private static boolean canBuy(MapleClient c, Item newItem) { // thanks xiaokelvin (Conrad) for noticing a leaked test code here
return MapleInventoryManipulator.checkSpace(c, newItem.getItemId(), newItem.getQuantity(), newItem.getOwner()) && MapleInventoryManipulator.addFromDrop(c, newItem, false);
}
diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java
index 50675f9d51..2bc9ca9a0c 100644
--- a/src/server/maps/MapleMap.java
+++ b/src/server/maps/MapleMap.java
@@ -85,8 +85,6 @@ import server.life.MonsterDropEntry;
import server.life.MonsterGlobalDropEntry;
import server.life.SpawnPoint;
import scripting.event.EventInstanceManager;
-import server.expeditions.MapleExpedition;
-import server.expeditions.MapleExpeditionType;
import server.life.MaplePlayerNPC;
import server.life.MonsterListener;
import server.partyquest.GuardianSpawnPoint;
@@ -744,7 +742,7 @@ public class MapleMap {
final List dropEntry = new ArrayList<>();
final List visibleQuestEntry = new ArrayList<>();
final List otherQuestEntry = new ArrayList<>();
- sortDropEntries(ServerConstants.USE_SPAWN_RELEVANT_LOOT ? chr.retrieveRelevantDrops(mob.getId()) : mi.retrieveEffectiveDrop(mob.getId()), dropEntry, visibleQuestEntry, otherQuestEntry, chr);
+ sortDropEntries(ServerConstants.USE_SPAWN_RELEVANT_LOOT ? mob.retrieveRelevantDrops() : mi.retrieveEffectiveDrop(mob.getId()), dropEntry, visibleQuestEntry, otherQuestEntry, chr);
registerMobItemDrops(droptype, mobpos, chRate, pos, dropEntry, visibleQuestEntry, otherQuestEntry, globalEntry, chr, mob);
}
@@ -1281,6 +1279,15 @@ public class MapleMap {
return character;
}
+ public Map getMapAllPlayers() {
+ Map pchars = new HashMap<>();
+ for (MapleCharacter chr : this.getAllPlayers()) {
+ pchars.put(chr.getId(), chr);
+ }
+
+ return pchars;
+ }
+
public List getPlayersInRange(Rectangle box, List targets) {
List character = new LinkedList<>();
chrRLock.lock();
@@ -2131,18 +2138,7 @@ public class MapleMap {
spawnAndAddRangedMapObject(door, new DelayedPacketCreation() {
@Override
public void sendPackets(MapleClient c) {
- if (door.getFrom().getId() == c.getPlayer().getMapId()) {
- if (c.getPlayer().getParty() != null && (door.getOwnerId() == c.getPlayer().getId() || c.getPlayer().getParty().getMemberById(door.getOwnerId()) != null)) {
- c.announce(MaplePacketCreator.partyPortal(door.getFrom().getId(), door.getTo().getId(), door.toPosition()));
- }
-
- c.announce(MaplePacketCreator.spawnPortal(door.getFrom().getId(), door.getTo().getId(), door.toPosition()));
- if (!door.inTown()) {
- c.announce(MaplePacketCreator.spawnDoor(door.getOwnerId(), door.getPosition(), false));
- }
- }
-
- c.announce(MaplePacketCreator.enableActions());
+ door.sendSpawnData(c, false);
}
}, new SpawnCondition() {
@Override
@@ -3735,6 +3731,14 @@ public class MapleMap {
}
}
+ public void mobMpRecovery() {
+ for (MapleMonster mob : this.getAllMonsters()) {
+ if (mob.isAlive()) {
+ mob.heal(0, mob.getLevel());
+ }
+ }
+ }
+
public final int getNumPlayersInArea(final int index) {
return getNumPlayersInRect(getArea(index));
}
diff --git a/src/server/maps/MapleMapFactory.java b/src/server/maps/MapleMapFactory.java
index af9c2a8f87..e3c33db3fa 100644
--- a/src/server/maps/MapleMapFactory.java
+++ b/src/server/maps/MapleMapFactory.java
@@ -23,23 +23,18 @@ package server.maps;
import java.awt.Point;
import java.awt.Rectangle;
+import java.io.File;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
-import net.server.audit.locks.MonitoredLockType;
-import net.server.audit.locks.MonitoredReentrantReadWriteLock;
import provider.MapleData;
import provider.MapleDataProvider;
+import provider.MapleDataProviderFactory;
import provider.MapleDataTool;
import server.PortalFactory;
import server.life.AbstractLoadedMapleLife;
@@ -54,40 +49,17 @@ import tools.StringUtil;
public class MapleMapFactory {
- private static Map mapRecoveryRate = new HashMap<>();
-
- private MapleDataProvider source;
- private MapleData nameData;
- private EventInstanceManager event;
- private Map maps = new HashMap<>();
- private ReadLock mapsRLock;
- private WriteLock mapsWLock;
- private int channel, world;
-
- public MapleMapFactory(EventInstanceManager eim, MapleDataProvider source, MapleDataProvider stringSource, int world, int channel) {
- this.source = source;
- this.nameData = stringSource.getData("Map.img");
- this.world = world;
- this.channel = channel;
- this.event = eim;
-
- ReentrantReadWriteLock rrwl = new MonitoredReentrantReadWriteLock(MonitoredLockType.MAP_FACTORY);
- this.mapsRLock = rrwl.readLock();
- this.mapsWLock = rrwl.writeLock();
+ private static Map mapRecoveryRateCache = new HashMap<>();
+
+ private static MapleData nameData;
+ private static MapleDataProvider mapSource;
+
+ static {
+ nameData = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")).getData("Map.img");
+ mapSource = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Map.wz"));
}
- public MapleMap resetMap(int mapid) {
- mapsWLock.lock();
- try {
- maps.remove(Integer.valueOf(mapid));
- } finally {
- mapsWLock.unlock();
- }
-
- return getMap(mapid);
- }
-
- private void loadLifeFromWz(MapleMap map, MapleData mapData) {
+ private static void loadLifeFromWz(MapleMap map, MapleData mapData) {
for (MapleData life : mapData.getChildByPath("life")) {
life.getName();
String id = MapleDataTool.getString(life.getChildByPath("id"));
@@ -115,7 +87,7 @@ public class MapleMapFactory {
}
}
- private void loadLifeFromDb(MapleMap map) {
+ private static void loadLifeFromDb(MapleMap map) {
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT * FROM plife WHERE map = ? and world = ?");
@@ -148,7 +120,7 @@ public class MapleMapFactory {
}
}
- private void loadLifeRaw(MapleMap map, int id, String type, int cy, int f, int fh, int rx0, int rx1, int x, int y, int hide, int mobTime, int team) {
+ private static void loadLifeRaw(MapleMap map, int id, String type, int cy, int f, int fh, int rx0, int rx1, int x, int y, int hide, int mobTime, int team) {
AbstractLoadedMapleLife myLife = loadLife(id, type, cy, f, fh, rx0, rx1, x, y, hide);
if (myLife instanceof MapleMonster) {
MapleMonster monster = (MapleMonster) myLife;
@@ -166,30 +138,17 @@ public class MapleMapFactory {
}
}
- private synchronized MapleMap loadMapFromWz(int mapid, Integer omapid, boolean cache) {
+ public static MapleMap loadMapFromWz(int mapid, int world, int channel, EventInstanceManager event) {
MapleMap map;
-
- if (cache) {
- mapsRLock.lock();
- try {
- map = maps.get(omapid);
- } finally {
- mapsRLock.unlock();
- }
-
- if (map != null) {
- return map;
- }
- }
-
+
String mapName = getMapName(mapid);
- MapleData mapData = source.getData(mapName); // source.getData issue with giving nulls in rare ocasions found thanks to MedicOP
+ MapleData mapData = mapSource.getData(mapName); // source.getData issue with giving nulls in rare ocasions found thanks to MedicOP
MapleData infoData = mapData.getChildByPath("info");
String link = MapleDataTool.getString(infoData.getChildByPath("link"), "");
if (!link.equals("")) { //nexon made hundreds of dojo maps so to reduce the size they added links.
mapName = getMapName(Integer.parseInt(link));
- mapData = source.getData(mapName);
+ mapData = mapSource.getData(mapName);
}
float monsterRate = 0;
MapleData mobRate = infoData.getChildByPath("mobRate");
@@ -288,7 +247,7 @@ public class MapleMapFactory {
try {
Connection con = DatabaseConnection.getConnection();
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM playernpcs WHERE map = ? AND world = ?")) {
- ps.setInt(1, omapid);
+ ps.setInt(1, mapid);
ps.setInt(2, world);
try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) {
@@ -352,12 +311,12 @@ public class MapleMapFactory {
}
}
try {
- map.setMapName(MapleDataTool.getString("mapName", nameData.getChildByPath(getMapStringName(omapid)), ""));
- map.setStreetName(MapleDataTool.getString("streetName", nameData.getChildByPath(getMapStringName(omapid)), ""));
+ map.setMapName(MapleDataTool.getString("mapName", nameData.getChildByPath(getMapStringName(mapid)), ""));
+ map.setStreetName(MapleDataTool.getString("streetName", nameData.getChildByPath(getMapStringName(mapid)), ""));
} catch (Exception e) {
- if (omapid / 1000 != 1020) { // explorer job introducion scenes
+ if (mapid / 1000 != 1020) { // explorer job introduction scenes
e.printStackTrace();
- System.err.println("Not found mapid " + omapid);
+ System.err.println("Not found mapid " + mapid);
}
map.setMapName("");
@@ -365,8 +324,8 @@ public class MapleMapFactory {
}
map.setClock(mapData.getChildByPath("clock") != null);
- map.setEverlast(infoData.getChildByPath("everlast") != null);
- map.setTown(infoData.getChildByPath("town") != null);
+ map.setEverlast(MapleDataTool.getIntConvert("everlast", infoData, 0) != 0); // thanks davidlafriniere for noticing value 0 accounting as true
+ map.setTown(MapleDataTool.getIntConvert("town", infoData, 0) != 0);
map.setHPDec(MapleDataTool.getIntConvert("decHP", infoData, 0));
map.setHPDecProtect(MapleDataTool.getIntConvert("protectItem", infoData, 0));
map.setForcedReturnMap(MapleDataTool.getInt(infoData.getChildByPath("forcedReturn"), 999999999));
@@ -378,7 +337,7 @@ public class MapleMapFactory {
MapleData recData = infoData.getChildByPath("recovery");
if (recData != null) {
float recoveryRate = MapleDataTool.getFloat(recData);
- mapRecoveryRate.put(mapid, recoveryRate);
+ mapRecoveryRateCache.put(mapid, recoveryRate);
}
HashMap backTypes = new HashMap<>();
@@ -397,46 +356,10 @@ public class MapleMapFactory {
map.setBackgroundTypes(backTypes);
map.generateMapDropRangeCache();
- if (cache) {
- mapsWLock.lock();
- try {
- maps.put(omapid, map);
- } finally {
- mapsWLock.unlock();
- }
- }
-
return map;
}
-
- public MapleMap getMap(int mapid) {
- Integer omapid = Integer.valueOf(mapid);
- MapleMap map;
-
- mapsRLock.lock();
- try {
- map = maps.get(omapid);
- } finally {
- mapsRLock.unlock();
- }
-
- return (map != null) ? map : loadMapFromWz(mapid, omapid, true);
- }
- public MapleMap getDisposableMap(int mapid) {
- return loadMapFromWz(mapid, mapid, false);
- }
-
- public boolean isMapLoaded(int mapId) {
- mapsRLock.lock();
- try {
- return maps.containsKey(mapId);
- } finally {
- mapsRLock.unlock();
- }
- }
-
- private AbstractLoadedMapleLife loadLife(int id, String type, int cy, int f, int fh, int rx0, int rx1, int x, int y, int hide) {
+ private static AbstractLoadedMapleLife loadLife(int id, String type, int cy, int f, int fh, int rx0, int rx1, int x, int y, int hide) {
AbstractLoadedMapleLife myLife = MapleLifeFactory.getLife(id, type);
myLife.setCy(cy);
myLife.setF(f);
@@ -450,7 +373,7 @@ public class MapleMapFactory {
return myLife;
}
- private MapleReactor loadReactor(MapleData reactor, String id, final byte FacingDirection) {
+ private static MapleReactor loadReactor(MapleData reactor, String id, final byte FacingDirection) {
MapleReactor myReactor = new MapleReactor(MapleReactorFactory.getReactor(Integer.parseInt(id)), Integer.parseInt(id));
int x = MapleDataTool.getInt(reactor.getChildByPath("x"));
int y = MapleDataTool.getInt(reactor.getChildByPath("y"));
@@ -462,7 +385,7 @@ public class MapleMapFactory {
return myReactor;
}
- private String getMapName(int mapid) {
+ private static String getMapName(int mapid) {
String mapName = StringUtil.getLeftPaddedStr(Integer.toString(mapid), '0', 9);
StringBuilder builder = new StringBuilder("Map/Map");
int area = mapid / 100000000;
@@ -474,7 +397,7 @@ public class MapleMapFactory {
return mapName;
}
- private String getMapStringName(int mapid) {
+ private static String getMapStringName(int mapid) {
StringBuilder builder = new StringBuilder();
if (mapid < 100000000) {
builder.append("maple");
@@ -513,35 +436,8 @@ public class MapleMapFactory {
return builder.toString();
}
- public void setChannel(int channel) {
- this.channel = channel;
- }
-
- public void setWorld(int world) {
- this.channel = world;
- }
-
- public Map getMaps() {
- mapsRLock.lock();
- try {
- return new HashMap<>(maps);
- } finally {
- mapsRLock.unlock();
- }
- }
-
- public void dispose() {
- Collection mapValues = getMaps().values();
-
- for (MapleMap map : mapValues) {
- map.dispose();
- }
-
- this.event = null;
- }
-
public static float getMapRecoveryRate(int mapid) {
- Float recRate = mapRecoveryRate.get(mapid);
+ Float recRate = mapRecoveryRateCache.get(mapid);
return recRate != null ? recRate : 1.0f;
}
}
diff --git a/src/server/maps/MapleMapManager.java b/src/server/maps/MapleMapManager.java
new file mode 100644
index 0000000000..7c5958954c
--- /dev/null
+++ b/src/server/maps/MapleMapManager.java
@@ -0,0 +1,162 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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 server.maps;
+
+import constants.ServerConstants;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
+import net.server.audit.locks.MonitoredLockType;
+import net.server.audit.locks.MonitoredReentrantReadWriteLock;
+import scripting.event.EventInstanceManager;
+import server.TimerManager;
+
+public class MapleMapManager {
+
+ private int channel, world;
+ private EventInstanceManager event;
+
+ private Map maps = new HashMap<>();
+
+ private ScheduledFuture> updateTask;
+
+ private ReadLock mapsRLock;
+ private WriteLock mapsWLock;
+
+ public MapleMapManager(EventInstanceManager eim, int world, int channel) {
+ this.world = world;
+ this.channel = channel;
+ this.event = eim;
+
+ ReentrantReadWriteLock rrwl = new MonitoredReentrantReadWriteLock(MonitoredLockType.MAP_MANAGER);
+ this.mapsRLock = rrwl.readLock();
+ this.mapsWLock = rrwl.writeLock();
+
+ updateTask = TimerManager.getInstance().register(new Runnable() {
+ @Override
+ public void run() {
+ updateMaps();
+ }
+ }, ServerConstants.RESPAWN_INTERVAL);
+ }
+
+ public MapleMap resetMap(int mapid) {
+ mapsWLock.lock();
+ try {
+ maps.remove(mapid);
+ } finally {
+ mapsWLock.unlock();
+ }
+
+ return getMap(mapid);
+ }
+
+ private synchronized MapleMap loadMapFromWz(int mapid, boolean cache) {
+ MapleMap map;
+
+ if (cache) {
+ mapsRLock.lock();
+ try {
+ map = maps.get(mapid);
+ } finally {
+ mapsRLock.unlock();
+ }
+
+ if (map != null) {
+ return map;
+ }
+ }
+
+ map = MapleMapFactory.loadMapFromWz(mapid, world, channel, event);
+
+ if (cache) {
+ mapsWLock.lock();
+ try {
+ maps.put(mapid, map);
+ } finally {
+ mapsWLock.unlock();
+ }
+ }
+
+ return map;
+ }
+
+ public MapleMap getMap(int mapid) {
+ MapleMap map;
+
+ mapsRLock.lock();
+ try {
+ map = maps.get(mapid);
+ } finally {
+ mapsRLock.unlock();
+ }
+
+ return (map != null) ? map : loadMapFromWz(mapid, true);
+ }
+
+ public MapleMap getDisposableMap(int mapid) {
+ return loadMapFromWz(mapid, false);
+ }
+
+ public boolean isMapLoaded(int mapId) {
+ mapsRLock.lock();
+ try {
+ return maps.containsKey(mapId);
+ } finally {
+ mapsRLock.unlock();
+ }
+ }
+
+ public Map getMaps() {
+ mapsRLock.lock();
+ try {
+ return new HashMap<>(maps);
+ } finally {
+ mapsRLock.unlock();
+ }
+ }
+
+ private void updateMaps() {
+ for (MapleMap map : getMaps().values()) {
+ map.respawn();
+ map.mobMpRecovery();
+ }
+ }
+
+ public void dispose() {
+ if (updateTask != null) {
+ updateTask.cancel(false);
+ updateTask = null;
+ }
+
+ for (MapleMap map : getMaps().values()) {
+ map.dispose();
+ }
+
+ this.event = null;
+ }
+
+ public static float getMapRecoveryRate(int mapid) {
+ return MapleMapFactory.getMapRecoveryRate(mapid);
+ }
+}
diff --git a/src/server/maps/MapleMiniGame.java b/src/server/maps/MapleMiniGame.java
index 499b76bf41..b0fd6c843b 100644
--- a/src/server/maps/MapleMiniGame.java
+++ b/src/server/maps/MapleMiniGame.java
@@ -50,6 +50,7 @@ public class MapleMiniGame extends AbstractMapleMapObject {
private int firstslot = 0;
private int visitorpoints = 0, visitorscore = 0, visitorforfeits = 0, lastvisitor = -1;
private int ownerpoints = 0, ownerscore = 0, ownerforfeits = 0;
+ private boolean visitorquit, ownerquit;
private long nextavailabletie = 0;
private int matchestowin = 0;
@@ -112,10 +113,33 @@ public class MapleMiniGame extends AbstractMapleMapObject {
owner.getMap().broadcastMessage(MaplePacketCreator.addMatchCardBox(owner, 2, 0));
}
}
-
- public void removeVisitor(MapleCharacter challenger) {
- if (visitor == challenger) {
+
+ public void closeRoom(boolean forceClose) {
+ owner.getMap().broadcastMessage(MaplePacketCreator.removeMinigameBox(owner));
+
+ if (forceClose) {
+ this.broadcastToOwner(MaplePacketCreator.getMiniGameClose(false, 4));
+ }
+ this.broadcastToVisitor(MaplePacketCreator.getMiniGameClose(true, 3));
+
+ if (visitor != null) {
+ visitor.setMiniGame(null);
visitor = null;
+ }
+
+ owner.setMiniGame(null);
+ owner = null;
+ }
+
+ public void removeVisitor(boolean forceClose, MapleCharacter challenger) {
+ if (visitor == challenger) {
+ if (forceClose) {
+ visitor.announce(MaplePacketCreator.getMiniGameClose(true, 4));
+ }
+
+ challenger.setMiniGame(null);
+ visitor = null;
+
this.getOwner().getClient().announce(MaplePacketCreator.getMiniGameRemoveVisitor());
if (GameType == MiniGameType.OMOK) {
this.getOwner().getMap().broadcastMessage(MaplePacketCreator.addOmokBox(owner, 1, 0));
@@ -154,13 +178,37 @@ public class MapleMiniGame extends AbstractMapleMapObject {
this.getOwner().getMap().broadcastMessage(MaplePacketCreator.addOmokBox(owner, visitor != null ? 2 : 1, inprogress));
}
+ private synchronized boolean minigameMatchFinish() {
+ if (isMatchInProgress()) {
+ inprogress = 0;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
private void minigameMatchFinished() {
- inprogress = 0;
updateMiniGameBox();
+
+ if (ownerquit) {
+ owner.closeMiniGame(true);
+ } else if (visitorquit) {
+ visitor.closeMiniGame(true);
+ }
}
public void minigameMatchStarted() {
inprogress = 1;
+ ownerquit = false;
+ visitorquit = false;
+ }
+
+ public void setQuitAfterGame(MapleCharacter player, boolean quit) {
+ if (isOwner(player)) {
+ ownerquit = quit;
+ } else {
+ visitorquit = quit;
+ }
}
public boolean isMatchInProgress() {
@@ -177,33 +225,43 @@ public class MapleMiniGame extends AbstractMapleMapObject {
public boolean isTieDenied(MapleCharacter chr) {
if (this.isOwner(chr)) {
- return ((inprogress >> 1) % 2) == 1;
- } else {
return ((inprogress >> 2) % 2) == 1;
+ } else {
+ return ((inprogress >> 1) % 2) == 1;
}
}
public void minigameMatchOwnerWins(boolean forfeit) {
+ if (!minigameMatchFinish()) return;
+
owner.setMiniGamePoints(visitor, 1, this.isOmok());
+
if (visitorforfeits < 4 || !forfeit) ownerscore += 50;
visitorscore += (15 * (forfeit ? -1 : 1));
if (forfeit) visitorforfeits++;
this.broadcast(MaplePacketCreator.getMiniGameOwnerWin(this, forfeit));
+
minigameMatchFinished();
}
public void minigameMatchVisitorWins(boolean forfeit) {
+ if (!minigameMatchFinish()) return;
+
owner.setMiniGamePoints(visitor, 2, this.isOmok());
+
if (ownerforfeits < 4 || !forfeit) visitorscore += 50;
ownerscore += (15 * (forfeit ? -1 : 1));
if (forfeit) ownerforfeits++;
this.broadcast(MaplePacketCreator.getMiniGameVisitorWin(this, forfeit));
+
minigameMatchFinished();
}
public void minigameMatchDraw() {
+ if (!minigameMatchFinish()) return;
+
owner.setMiniGamePoints(visitor, 3, this.isOmok());
long timeNow = Server.getInstance().getCurrentTime();
@@ -215,6 +273,7 @@ public class MapleMiniGame extends AbstractMapleMapObject {
}
this.broadcast(MaplePacketCreator.getMiniGameTie(this));
+
minigameMatchFinished();
}
diff --git a/src/server/maps/MapleReactor.java b/src/server/maps/MapleReactor.java
index 42179421d5..38f2128d7e 100644
--- a/src/server/maps/MapleReactor.java
+++ b/src/server/maps/MapleReactor.java
@@ -194,7 +194,7 @@ public class MapleReactor extends AbstractMapleMapObject {
}
private void tryForceHitReactor(final byte newState) { // weak hit state signal, if already changed reactor state before timeout then drop this
- if (!this.reactorLock.tryLock()) {
+ if (!reactorLock.tryLock()) {
return;
}
@@ -202,7 +202,7 @@ public class MapleReactor extends AbstractMapleMapObject {
this.resetReactorActions(newState);
map.broadcastMessage(MaplePacketCreator.triggerReactor(this, (short) 0));
} finally {
- this.reactorLock.unlock();
+ reactorLock.unlock();
}
}
@@ -311,9 +311,8 @@ public class MapleReactor extends AbstractMapleMapObject {
}
} finally {
this.unlockReactor();
+ hitLock.unlock(); // non-encapsulated unlock found thanks to MiLin
}
-
- hitLock.unlock();
}
} catch (Exception e) {
e.printStackTrace();
diff --git a/src/tools/IntervalBuilder.java b/src/tools/IntervalBuilder.java
new file mode 100644
index 0000000000..1b578515b5
--- /dev/null
+++ b/src/tools/IntervalBuilder.java
@@ -0,0 +1,132 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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 tools;
+
+import java.awt.geom.Line2D;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
+import net.server.audit.locks.MonitoredLockType;
+import net.server.audit.locks.MonitoredReentrantReadWriteLock;
+
+/**
+ *
+ * @author Ronan
+ */
+public class IntervalBuilder {
+
+ private List intervalLimits = new ArrayList<>();
+
+ protected ReadLock intervalRlock;
+ protected WriteLock intervalWlock;
+
+ public IntervalBuilder() {
+ ReentrantReadWriteLock locks = new MonitoredReentrantReadWriteLock(MonitoredLockType.INTERVAL, true);
+ intervalRlock = locks.readLock();
+ intervalWlock = locks.writeLock();
+ }
+
+ private void refitOverlappedIntervals(int st, int en, int newFrom, int newTo) {
+ List checkLimits = new ArrayList<>(intervalLimits.subList(st, en));
+
+ float newLimitX1, newLimitX2;
+ if (!checkLimits.isEmpty()) {
+ Line2D firstLimit = checkLimits.get(0);
+ Line2D lastLimit = checkLimits.get(checkLimits.size() - 1);
+
+ newLimitX1 = (float) ((newFrom < firstLimit.getX1()) ? newFrom : firstLimit.getX1());
+ newLimitX2 = (float) ((newTo > lastLimit.getX2()) ? newTo : lastLimit.getX2());
+
+ for (Line2D limit : checkLimits) {
+ intervalLimits.remove(st);
+ }
+ } else {
+ newLimitX1 = newFrom;
+ newLimitX2 = newTo;
+ }
+
+ intervalLimits.add(st, new Line2D.Float((float) newLimitX1, 0, (float) newLimitX2, 0));
+ }
+
+ private int bsearchInterval(int point) {
+ int st = 0, en = intervalLimits.size() - 1;
+
+ int mid, idx;
+ while (en >= st) {
+ idx = (st + en) / 2;
+ mid = (int) intervalLimits.get(idx).getX1();
+
+ if (mid == point) {
+ return idx;
+ } else if (mid < point) {
+ st = idx + 1;
+ } else {
+ en = idx - 1;
+ }
+ }
+
+ return en;
+ }
+
+ public void addInterval(int from, int to) {
+ intervalWlock.lock();
+ try {
+ int st = bsearchInterval(from);
+ if (st < 0) {
+ st = 0;
+ } else if (intervalLimits.get(st).getX2() < from) {
+ st += 1;
+ }
+
+ int en = bsearchInterval(to);
+ if (en < st) en = st - 1;
+
+ refitOverlappedIntervals(st, en + 1, from, to);
+ } finally {
+ intervalWlock.unlock();
+ }
+ }
+
+ public boolean inInterval(int point) {
+ return inInterval(point, point);
+ }
+
+ public boolean inInterval(int from, int to) {
+ intervalRlock.lock();
+ try {
+ int idx = bsearchInterval(from);
+ return idx >= 0 && to <= intervalLimits.get(idx).getX2();
+ } finally {
+ intervalRlock.unlock();
+ }
+ }
+
+ public void clear() {
+ intervalWlock.lock();
+ try {
+ intervalLimits.clear();
+ } finally {
+ intervalWlock.unlock();
+ }
+ }
+
+}
diff --git a/src/tools/MapleLogger.java b/src/tools/MapleLogger.java
index 2ee01e1041..7f2f0b8a6e 100644
--- a/src/tools/MapleLogger.java
+++ b/src/tools/MapleLogger.java
@@ -20,10 +20,11 @@
*/
package tools;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
import net.opcodes.RecvOpcode;
+import client.MapleCharacter;
import client.MapleClient;
/**
@@ -34,14 +35,15 @@ import client.MapleClient;
public class MapleLogger {
- public static List monitored = new ArrayList<>();
- public static List ignored = new ArrayList<>();
+ public static Set monitored = new HashSet<>();
+ public static Set ignored = new HashSet<>();
public static void logRecv(MapleClient c, short packetId, Object message) {
- if (c.getPlayer() == null){
+ MapleCharacter chr = c.getPlayer();
+ if (chr == null){
return;
}
- if (!monitored.contains(c.getPlayer().getName())){
+ if (!monitored.contains(chr.getId())){
return;
}
RecvOpcode op = getOpcodeFromValue(packetId);
@@ -49,7 +51,7 @@ public class MapleLogger {
return;
}
String packet = op.toString() + "\r\n" + HexTool.toString((byte[]) message);
- FilePrinter.printError(FilePrinter.PACKET_LOGS + c.getAccountName() + "-" + c.getPlayer().getName() + ".txt", packet);
+ FilePrinter.printError(FilePrinter.PACKET_LOGS + c.getAccountName() + "-" + chr.getName() + ".txt", packet);
}
private static final boolean isRecvBlocked(RecvOpcode op){
diff --git a/src/tools/MaplePacketCreator.java b/src/tools/MaplePacketCreator.java
index 4e4d9f56eb..06c00ed1d1 100644
--- a/src/tools/MaplePacketCreator.java
+++ b/src/tools/MaplePacketCreator.java
@@ -51,7 +51,7 @@ import net.server.world.PartyOperation;
import server.CashShop.CashItem;
import server.CashShop.CashItemFactory;
import server.CashShop.SpecialCashItem;
-import server.DueyPackages;
+import server.DueyPackage;
import server.MTSItemInfo;
import server.MapleItemInformationProvider;
import server.MapleShopItem;
@@ -719,7 +719,7 @@ public class MaplePacketCreator {
mplew.writeInt(1); // 1: Remove the "Select the world you want to play in"
mplew.write(ServerConstants.ENABLE_PIN && !c.canBypassPin() ? 0 : 1); // 0 = Pin-System Enabled, 1 = Disabled
- mplew.write(ServerConstants.ENABLE_PIC && !c.canBypassPic() ? (c.getPic() == null ? 0 : 1) : 2); // 0 = Register PIC, 1 = Ask for PIC, 2 = Disabled
+ mplew.write(ServerConstants.ENABLE_PIC && !c.canBypassPic() ? (c.getPic() == null || c.getPic().equals("") ? 0 : 1) : 2); // 0 = Register PIC, 1 = Ask for PIC, 2 = Disabled
return mplew.getPacket();
}
@@ -905,7 +905,7 @@ public class MaplePacketCreator {
addCharEntry(mplew, chr, false);
}
- mplew.write(ServerConstants.ENABLE_PIC && !c.canBypassPic() ? (c.getPic() == null ? 0 : 1) : 2);
+ mplew.write(ServerConstants.ENABLE_PIC && !c.canBypassPic() ? (c.getPic() == null || c.getPic().equals("") ? 0 : 1) : 2);
mplew.writeInt(ServerConstants.COLLECTIVE_CHARSLOT ? chars.size() + c.getAvailableCharacterSlots() : c.getCharacterSlots());
return mplew.getPacket();
}
@@ -5252,7 +5252,7 @@ public class MaplePacketCreator {
mplew.write(1);
return mplew.getPacket();
}
-
+
private static byte[] getMiniGameResult(MapleMiniGame game, int tie, int result, int forfeit) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
@@ -5312,12 +5312,12 @@ public class MaplePacketCreator {
public static byte[] getMiniGameTie(MapleMiniGame game) {
return getMiniGameResult(game, 1, 3, 0);
}
-
- public static byte[] getMiniGameClose(int type) {
+
+ public static byte[] getMiniGameClose(boolean visitor, int type) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(5);
mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
mplew.write(PlayerInteractionHandler.Action.EXIT.getCode());
- mplew.write(1);
+ mplew.writeBool(visitor);
mplew.write(type); /* 2 : CRASH 3 : The room has been closed 4 : You have left the room 5 : You have been expelled */
return mplew.getPacket();
}
@@ -7039,26 +7039,35 @@ public class MaplePacketCreator {
return sendDuey(operation, null);
}
- public static byte[] sendDuey(byte operation, List packages) {
+ public static byte[] sendDuey(byte operation, List packages) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PARCEL.getValue());
mplew.write(operation);
if (operation == 8) {
mplew.write(0);
mplew.write(packages.size());
- for (DueyPackages dp : packages) {
+ for (DueyPackage dp : packages) {
mplew.writeInt(dp.getPackageId());
mplew.writeAsciiString(dp.getSender());
for (int i = dp.getSender().length(); i < 13; i++) {
mplew.write(0);
}
+
mplew.writeInt(dp.getMesos());
mplew.writeLong(getTime(dp.sentTimeInMilliseconds()));
- mplew.writeLong(0); // Contains message o____o.
- for (int i = 0; i < 48; i++) {
- mplew.writeInt(Randomizer.nextInt(Integer.MAX_VALUE));
+
+ String msg = dp.getMessage();
+ if (!msg.isEmpty()) {
+ mplew.writeInt(1);
+ mplew.writeAsciiString(msg);
+ for (int i = msg.length(); i < 200; i++) {
+ mplew.write(0);
+ }
+ } else {
+ mplew.writeInt(0);
+ mplew.skip(200);
}
- mplew.writeInt(0);
+
mplew.write(0);
if (dp.getItem() != null) {
mplew.write(1);
diff --git a/tools/MapleCouponInstaller/dist/MapleCouponInstaller.jar b/tools/MapleCouponInstaller/dist/MapleCouponInstaller.jar
index adf4a40e18..89ae398f6e 100644
Binary files a/tools/MapleCouponInstaller/dist/MapleCouponInstaller.jar and b/tools/MapleCouponInstaller/dist/MapleCouponInstaller.jar differ
diff --git a/tools/MapleCouponInstaller/nbproject/private/private.properties b/tools/MapleCouponInstaller/nbproject/private/private.properties
index adc8a8f46a..67c9c27960 100644
--- a/tools/MapleCouponInstaller/nbproject/private/private.properties
+++ b/tools/MapleCouponInstaller/nbproject/private/private.properties
@@ -3,4 +3,4 @@ do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
-user.properties.file=C:\\Users\\USER\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
+user.properties.file=C:\\Users\\RonanLana\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapon_items.txt b/tools/MapleGachaponItemidRetriever/lib/gachapon_items.txt
new file mode 100644
index 0000000000..b8b6fe60af
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapon_items.txt
@@ -0,0 +1,1763 @@
+Gachapon 1 � Henesys
+
+Scroll
+Scroll for Helmet for Def. (60%)
+Scroll for Cape for Magic Def. (10%)
+Scroll for Gloves for Attack (10%) - uncommon
+Scroll for Shoes for DEX (10%)
+Scroll for Staff for Magic Att. (10%)
+Scroll for Topwear for Def. (10%)
+Scroll for Wand for Magic Att. (10%)
+.
+Useable Drops
+Elixir
+Power Elixir
+Melting Cheese
+Return Scroll for Dead Mine
+.
+Common equipment
+Bamboo Spear
+Bamboo Sword
+Black Tube
+Black Umbrella
+Blood Snowboard
+Blue Work Gloves
+Brown Adventurer Cape
+Colorful Tube
+Dark Snowboard
+Doombringer
+Emergency Rescue Tube
+Frying Pan
+Green Umbrella
+Hula Hoop
+Ice Jeans
+Korean Fan
+Light Purple Umbrella
+Metal Wand
+Old Wisconsin
+Palette
+Pico-Pico Hammer
+Pink Adventurer Cape - uncommon
+Plunger
+Purple Adventurer Cape - uncommon
+Purple Tube
+Purple Work Gloves
+Red Baseball Cap
+Red Brick
+Red Flowery Tube
+Red Starry Bandana
+Red Whip
+Red Work Gloves
+Silver Snowboard
+Sky Blue Starry Bandana
+Sky Blue Umbrella
+Sky Snowboard
+.
+Beginner equipment
+Frozen Tuna - uncommon
+.
+Warrior equipment
+Adamantium Legend Shield
+Adamantium Tower Shield
+Eloon
+Fork on a Stick
+Gaea
+Gold Sharp Helm
+Green Lamelle
+Heavy Hammer
+Janitor�s Mop
+Sledgehammer
+Sparta
+Spear
+The Nine Dragons
+.
+Magician equipment
+Arc Staff
+Black Amoria Top
+Black Split
+Blue Anakamoon
+Blue Calaf
+Blue Enigmatic
+Blue Fairy Skirt
+Blue Infinium Circlet
+Blue Jester
+Blue Moonlight
+Blue Requiem
+Blue Requierre
+Blue Wizardry Hat
+Brown Matty
+Brown Requierre
+Brown Requiem
+Cromi
+Dark Anakamoon
+Dark Enigmatic
+Dark Infinium Circlet
+Dark Galaxy
+Dark Golden Circlet
+Dark Requierre
+Dark Ritual
+Dark Seraphis
+Dark Starlight
+Evil Wings
+Fairy Wand
+Golden Pride
+Green Enigmatic
+Green Jester
+Green Seraphis
+Hinomaru Fan
+Kage
+Mystic Cane
+Mystic Shield
+Orange Calaf
+Orange Calas
+Orange Split Piece
+Purple Split
+Red Calaf
+Red Guiltian
+Red Infinium Circlet
+Red Moonlight
+Red Requierre
+Red Requiem
+Sapphire Staff
+Thorns
+White Anakamoon
+White Calaf
+White Doros Robe
+White Guiltian
+White Seraphis
+Wizard Wand
+.
+Bowman equipment
+Asianic Bow
+Cao Cao Bow
+Dark Hunter�s Pants
+Fork on a Stick
+Green Archer Top
+Green Pole-Feather Hat
+Gross Jaeger
+Metus
+Red Bennis Chainmail
+Red Shivermail
+Ryden
+Vaulter 2000
+Yellow Avelin Skirt
+.
+Thief equipment
+Adamantium Igor
+Blood Slain
+Blue China Pants
+Blue Scarab
+Bronze Igor
+Brown Burgler
+Dark Cleave
+Black Scarab
+Dark Scorpio
+Deadly Fin
+Fork on a Stick
+Green China
+Khaki Shadow Pants
+Meba
+Mithril Titans
+Purple Avenger
+Red Nightshift
+Red Qi Pao
+Sai
+Sapphire Slain
+Shinkita
+.
+Pirate Scroll
+Scroll for Knuckles for Accuracy 65%
+.
+Pirate equipment
+White Oceania Cap
+Black Bisk
+Black Skellduke
+Brown Royce
+.
+
+.
+
+Gachapon 2 � Ellinia
+
+Scroll
+Scroll for Dagger for Att. (10%)
+Scroll for Helmet for Def. (10%)
+Scroll for One-Handed Axe for Att. (10%)
+Scroll for One-Handed Sword for Att. (10%)
+Scroll for Pole Arm for Att. (10%)
+Scroll for Spear for Att. (10%)
+Scroll for Staff for Magic Att. (10%)
+Scroll for Two-Handed Sword for Att. (10%)
+Scroll for Cape for INT
+.
+Useable drop
+Elixir
+Power Elixir
+Takoyaki (jumbo)
+Yakisoba
+.
+Common equipment
+Aluminum Baseball Bat
+Aqua Snowboard
+Bamboo Spear
+Black Baseball Cap
+Blue Baseball Cap
+Blue Flowery Tube
+Blue Metal Gear
+Blue Sauna Robe
+Blue Work Gloves
+Brown Bamboo Hat
+Brown Bandana
+Brown Work Gloves - uncommon
+Camouflaged Army Pants
+Dark Snowboard
+Emergency Rescue Tube
+Frying Pan
+Green Bandana - uncommon
+Green Umbrella
+Hardwood Wand
+Mark of the Beta - uncommon
+Nameless Sword
+Palette
+Pico-Pico Hammer
+Pink Starry Shirt
+Purple Bandana
+Purple Tube
+Purple Work Gloves
+Red Baseball Cap
+Red Brick
+Red Emerald Earrings
+Red Justice Cape
+Red Flowery Tube
+Red Sauna Robe
+Red Whip
+Red Work Gloves
+Silver Snowboard
+Sky Blue Umbrella
+White Justice Cape
+White Napoleon
+Yellow Metal Gear
+Yellow Starry Bandana
+Yellow Umbrella
+Yellow Work Gloves
+.
+Warrior equipment
+Blue Axe
+Blue Dragon
+Blue Jangoon Armor
+Blue Kendo Robe
+Blue Lolico Pants
+Bronze Viking Helm
+Brown Lolico Pants
+Dark Shouldermail Pants
+Doombringer
+Eloon
+Forked Spear
+Gaea
+Gladius
+Gold Dragon
+Great Brown Helmet
+Heaven�s Gate
+Heaven�s Justice
+Heavy Hammer
+Holy Spear
+Iron Ball
+Mace
+Mithril Crusader Helm
+Mithril Football Helmet
+Mithril Tower Shield
+Mithril Viking Helm
+Orihalcon Burgernet Helm
+Orihalcon Master Sergeant Kilt
+Plunger
+Pointed Shovel
+Pole Arm
+Red Engrit
+Red Ramel Skirt
+Red Martial Arts Pants
+Red Shark
+Red Shark Skirt
+Sabre
+Scimitar
+Silver Planet
+Skull Shield
+Sky Shark
+Sledgehammer
+Steel Corporal Pants
+Steel Fitted Mail
+Steel Nordic Helm
+The Nine Dragons
+The Rising
+The Shining
+Titan
+Traus
+Two-Handed Sword
+Wooden Sword
+Zard
+Zeco
+.
+Magician equipment
+Arc Staff
+Black Jester
+Black Split Pants
+Black Split Piece
+Black Split Skirt
+Blood Chaos Robe
+Blue Guiltian
+Brown Moonlight
+Brown Starlight
+Dark Anakamoon
+Dark Anakarune
+Dark Calaf
+Dark Galaxy
+Dark Enigmatic
+Dark Golden Circlet
+Dark Infinium Circlet
+Dark Manute
+Evil Wings
+Golden Pride
+Gold Manute
+Hinomaru Fan
+Kage
+Metal Wand
+Mithril Wand
+Mystic Cane
+Old Wooden Staff
+Orange Calas
+Orange Split Piece
+Purple Fairy Top
+Purple Fairy Skirt
+Red Amoria Top
+Red Anakarune
+Red Moonlight
+Red Pennance
+Red Split
+Black Split Piece
+Red Wizardry Hat
+Sapphire Staff
+Steel Manute
+Sun Quan Staff
+White Anakamoon
+White Doros Robe
+White Guiltian
+White Split Pants
+.
+Bowman equipment
+Asianic Bow
+Balanche
+Blue Piette Pants
+Blue Robin Hat
+Brown Able Skirt
+Brown Hard Leather Top
+Brown Hunter
+Brown Robin Hat
+Dark Hunter�s Armor
+Dark Legolia Pants
+Dark Piette
+Eagle Crow
+Green Able Armor
+Green Able Armor Skirt
+Green Avelin Skirt
+Green Bennis Chainmail
+Green Distinction
+Green Hunter�s Armor
+Green Hunter�s Pants
+Green Huntress Armor
+Green Legolia
+Green Legolier Pants
+Green Maro
+Green Robin Hat
+Heckler
+Hunter�s Bow
+Mountain Crossbow
+Red Bennis Chainmail
+Red Distinction
+Red Hawkeye
+Red Hunter�s Armor
+Red Lumati
+Red Viper
+Silver Crow
+Vaulter 2000
+Wooden Sword
+Yellow Able Armor
+.
+Thief equipment
+Adamantium Guards
+Adamantium Igor
+Bazlud | Black Mamba
+Black Steal
+Blood Slain
+Bloody Mantis
+Blue China
+Blue Loosecap
+Blue Moon Pants
+Blue Nightshift Pants
+Blue Qi Pao
+Blue Qi Pao Pants
+Blue Scarab
+Bronze Gigantic
+Bronze Guardian
+Brown China
+Brown Hard Leather Pants
+Brown Loosecap
+Brown Scarab
+Cass
+Dark Brown Stealer Pants
+Dark Identity
+Dark Slain
+Dark Shadow
+Deadly Fin
+Green Guise
+Green Tiberian
+Forked Dagger
+Kandine
+Mithril Guards
+Purple Shadow Pants
+Red Burgler
+Red Nightshift
+Red Nightshift Pants
+Red Pao Bottom
+Sapphire Slain
+Silver Black Stealer
+Steel Slain
+Stinger
+Triple-Tipped Zamadar
+Wooden Sword
+.
+Pirate Scroll
+Scroll for Gun for ATT
+.
+Pirate equipment
+Brown Pollard
+Yellow Tartis
+Green Plasteer
+Black Voyson Shoes
+.
+
+.
+
+Gachapon 3 � Perion
+
+Useable drop
+Elixir
+Power Elixir
+.
+Common equipment
+Aluminum Baseball Bat
+Bamboo Sword
+Black Baseball Cap
+Black Tube
+Blue Work Gloves
+Bone Helm
+Brown Bamboo Hat
+Brown Bandana
+Brown Work Gloves - uncommon
+Emergency Rescue Tube
+Frying Pan
+Green Bandana - uncommon | Green Napoleon | Grey Work Gloves
+Korean Fan
+Leather Purse
+Mark of the Beta - uncommon
+Pico-Pico Hammer
+Pink Adventurer Cape - uncommon
+Purple Bandana
+Purple Work Gloves
+Red Brick
+Sky Blue Umbrella
+Square Shovel
+Weighted Earrings
+White Justice Cape
+Yellow Starry Bandana
+.
+Warrior equipment
+Bent Judgement
+Blue Counter
+Buck
+Cutlus
+Dankke
+Dark Briggon
+Dark Emperor
+Dark Shouldermail Pants
+Gladius
+Golden Mole
+Great Blue Helmet
+Ivory Shouldermail Pants
+Khan
+Knuckle Mace
+Mithril Maul
+Mithril Platine
+Oaker Shouldermail Pants
+Old Steel Nordic Helm
+Orihalcon Burgernet Helm
+Pole Arm
+Pinaka
+Stonetooth Sword
+Red Cross Shield
+Red Ice Queen
+Red Kendo Robe
+Serpent�s Tongue
+Sky Shark Skirt
+Spear
+Steel Corporal Pants
+Steel Fitted Mail
+Steel Nordic Helm
+War Hammer
+Zeco
+.
+Magician equipment
+Blue Calaf | Black Split Piece | Brown Moonlight
+Cromi
+Dark Calas
+Green Jester
+Maple Lama Staff
+Orange Golden Circlet
+Red Calaf
+Thorns
+White Calas
+.
+Bowman equipment
+Blue Legolia Pants
+Blue Legolier Pants
+Dark Legolier
+Dark Raven
+Red Legolia
+Red Viper
+.
+Thief equipment
+Blue China
+Blue China Pants
+Blue Pilfer
+Blue Steal
+Bronze Identity
+Bushido
+Cass
+Dark Nightshift Pants
+Deadly Fin
+Gold Sneak
+Purple Qi Pao Pants
+Purple Shadow
+Red Qi Pao
+Sai
+Sapphire Slain
+Shinkita
+Sky Sneak
+.
+Pirate Scroll
+Scroll for Gun for ATT 15%
+Scroll for Knuckler for ATT
+.
+Pirate equipment
+Brown Leather Ocean Hat
+Red Viska
+King Cent
+.
+
+.
+
+Gachapon 4 � Kerning City
+
+Scroll
+Scroll for Cape for INT (60%)
+Scroll for Dagger for Att. (10%)
+Scroll for Gloves for Attack (10%) - uncommon
+Scroll for Shield for Def. (10%)
+.
+Useable drop
+Elixir
+Power Elixir
+Takoyaki (Jumbo)
+Yakisoba (x2)
+.
+Common equipment
+Aqua Snowboard
+Bamboo Spear
+Black Tube
+Blue Sauna Robe
+Brown Bandana
+Brown Work Gloves - uncommon
+Grey Bandana
+Janitor�s Mop
+Metal Wand
+Newspaper Hat
+Old Wisconsin
+Pan Lid
+Pink Adventurer Cape - uncommon
+Purple Work Gloves
+Sandblasted Jeans
+Sky Blue Umbrella
+Strawberry Earrings
+White Justice Cape
+Yellow Adventurer Cape
+Yellow Metal Gear
+Yellow Starry Bandana
+.
+Warrior equipment
+Cursayer
+Dark Engrit
+Fork on a Stick
+Golden Mole
+Golden River
+Jeweled Katar
+Mithril Football Helmet
+Orihalcon Master Sergeant Kilt
+Pointed Shovel
+Serpent�s Tongue
+Silver Crusader Helm
+Steel Fitted Mail
+Studded Polearm
+Viking Sword
+.
+Magician equipment
+Black Jester
+Blue Jester
+Blue Morrican
+Dark Starlight
+Fairy Wand
+Flame Golden Circlet
+Orange Calaf
+Orange Split Piece
+Purple Fairy Skirt
+Sapphire Staff
+Thorns
+White Doros Robe
+.
+Bowman equipment
+Blue Robin Hat
+Brown Piettra Skirt
+Golden Hinkel
+Golden Raven
+Red Viper
+Vaulter 2000
+.
+Thief equipment
+Adamantium Guards
+Black Scarab
+Black Steal
+Bloody Mantis
+Blue Pao Bottom
+Blue Qi Pao Pants
+Blue Steal
+Bronze Guardian
+Brown China
+Casters
+Cursayer
+Dark Avenger
+Dark Cleave
+Dark Gigantic
+Dark Pirate Skirt
+Dark Shadow
+Deadly Fin
+Garnier
+Golden River
+Green Pilfer
+Green Sonata
+Jurgen Wristguard
+Liu Bei Dagger
+Nimble Wristguard
+Purple Mystique Pants | Purple Osfa Pants
+Red Cloth Vest | Red Gold Stealer
+Shinkita
+Silver Black Stealer
+Silver / Black Stealer Pants
+Steel Igor
+Varkit
+.
+Pirate Scroll
+Scroll for Knuckler for Attack 30%
+Scroll for Gun for ATT 65%
+.
+Pirate equipment
+Prime Hands
+Black Duke Barkin Shoes
+Mr. Rasfelt
+.
+
+.
+
+Gachapon 5 � Sleepywood
+
+Scroll
+Scroll for Pet Equip. for Jump (100%)
+Scroll for Pet Equip. for Speed (100%)
+Scroll for Bottomwear for Def. (60%)
+Scroll for Bow for Att. (60%)
+Scroll for Cape for DEX (60%)
+Scroll for Cape for INT (60%)
+Scroll for Cape for LUK (60%)
+Scroll for Cape for MP (60%)
+Scroll for Cape for STR (60%)
+Scroll for Dagger for Att. (60%)
+Scroll for Earring for INT (60%)
+Scroll for Gloves for Attack (60%) - uncommon
+Scroll for Gloves for DEX (60%)
+Scroll for Gloves for Magic Att. (60%) - uncommon
+Scroll for Helmet for Def. (60%)
+Scroll for Helmet for HP (60%)
+Scroll for One-Handed Axe for Att. (60%)
+Scroll for One-Handed Blunt Weapon for Att. (60%)
+Scroll for One-Handed Sword for Att. (60%)
+Scroll for Overall Armor for Def. (60%)
+Scroll for Overall Armor for DEX (60%)
+Scroll for Pet Equip. for Jump (60%)
+Scroll for Pet Equip. for Speed (60%)
+Scroll for Pole Arm for Att. (60%)
+Scroll for Shield for Def. (60%)
+Scroll for Shoes for DEX (60%)
+Scroll for Shoes for Jump (60%)
+Scroll for Shoes for Speed (60%)
+Scroll for Spear for Att. (60%)
+Scroll for Staff for Magic Att. (60%)
+Scroll for Two-handed Axe for Att. (60%)
+Scroll for Two-handed Blunt Weapon for Att. (60%)
+Scroll for Two-handed Sword for Att. (60%)
+Scroll for Bottomwear for Def. (10%)
+Scroll for Bow for Att. (10%)
+Scroll for Cape for DEX (10%)
+Scroll for Cape for INT (10%)
+Scroll for Cape for LUK (10%)
+Scroll for Cape for STR (10%)
+Scroll for Cape for Weapon Def. (10%)
+Scroll for Claw for Att. (10%)
+Scroll for Crossbow for Att. (10%)
+Scroll for Dagger for Att. (10%)
+Scroll for Earring for INT (10%)
+Scroll for Gloves for Attack (10%) - uncommon
+Scroll for Gloves for DEX (10%)
+Scroll for Helmet for HP (10%)
+Scroll for One-Handed Blunt Weapon for Att. (10%)
+Scroll for One-Handed Sword for Att. (10%)
+Scroll for Overall Armor for Def. (10%)
+Scroll for Overall Armor for DEX (10%)
+Scroll for Pet Equip. for Jump (10%)
+Scroll for Pet Equip. for Speed (10%)
+Scroll for Pole Arm for Att. (10%)
+Scroll for Shield for Def. (10%)
+Scroll for Shoes for DEX (10%)
+Scroll for Shoes for Jump (10%)
+Scroll for Shoes for Speed (10%)
+Scroll for Spear for Att. (10%)
+Scroll for Staff for Magic Att. (10%)
+Scroll for Two-Handed Blunt Weapon for Att. (10%)
+Scroll for Two-Handed Sword for Att. (10%)
+.
+Useable drop
+White Scroll - uncommon
+Drake�s Blood
+Drake�s Meat
+Dried Squid
+Elixir
+Fairy�s Honey
+Fat Sausage
+Ilbi Throwing-Stars
+Melting Cheese
+Power Elixir
+Return Scroll for Dead Mine
+Sap of Ancient Tree
+Speed Potion
+Steely Throwing-Knives
+.
+Common equipment
+Amethyst Earrings
+Bamboo Spear
+Black Justice Cape
+Black Magic Cape
+Brown Bandana
+Brown Work Gloves - uncommon
+Colorful Tube
+Half Earrings
+Hula Hoop
+Korean Fan
+Maple Shield
+Metal Heart Earrings
+Metal Silver Earrings
+Pink-Flowered Earrings
+Purple Tube
+Red-Hearted Earrings
+Red Flowery Tube
+Red Magic Cape
+Skull Earrings
+Strawberry Earrings
+Thermometer
+Weighted Earrings
+White Magic Cape
+.
+Beginner equipment
+Frozen Tuna - uncommon
+.
+Warrior equipment
+Daiwa Sword
+Dark Engrit
+Fairfrozen
+Iron Ball
+Iron Mace
+Monkey Wrench
+Omega Spear
+Red Engrit
+Red Martial Arts Pants
+Spear
+Square Hammer
+The Rising
+Wooden Mallet
+.
+Magician equipment
+Blue Jester
+Blue Matty
+Dark Ritual
+Golden Pride
+Kage
+Mystic Cane
+Orange Calas
+Steel Pride
+.
+Bowman equipment
+Composite Bow
+Dark Hawkeye
+Dark Hunter�s Armor
+Dark Raven
+Fire Raven
+Golden Raven
+Green Huntress Pants
+Marine Raven
+Red Hawkeye
+.
+Thief equipment
+Angelic Betrayal
+Dark Guise
+Blue Pao
+Bronze Igor
+Dark Brown Stealer
+Dragon Toenail
+Dragon�s Tail
+Iron Dagger
+Red Guise
+Silver / Black Stealer Pants
+.
+Pirate Scroll
+Scroll for Knuckler for Attack 60%
+Scroll for Gun for Attack 70%
+Scroll for Knuckles for Accuracy 15%
+.
+Pirate equipment
+Red Belly Duke
+Fury Claw
+.
+
+.
+
+Gachapon 6 � El Nath
+
+Scroll
+Scroll for Cape for STR (100%)
+Scroll for Pet Equip. for Jump (100%)
+Scroll for Staff for Magic Att. (100%)
+Scroll for Dagger for Att. (60%)
+Scroll for Earring for INT (60%)
+Scroll for Gloves for Attack (60%) - uncommon
+Scroll for One-Handed Axe for Att. (60%)
+Scroll for One-Handed Blunt Weapon for Att. (60%)
+Scroll for One-Handed Sword for Att. (60%)
+Scroll for Spear for Att. (60%)
+Scroll for Staff for Magic Att. (60%)
+Scroll for Two-handed Blunt Weapon for Att. (60%)
+Scroll for Wand for Magic Att. (60%)
+Scroll for Bow for Att. (10%)
+Scroll for Cape for MP (10%)
+Scroll for Cape for STR (10%)
+Scroll for Crossbow for Att. (10%)
+Scroll for Dagger for Att. (10%)
+Scroll for Gloves for Attack (10%) - uncommon
+Scroll for One-Handed Blunt Weapon for Att. (10%)
+Scroll for One-Handed Sword for Att. (10%)
+Scroll for Pet Equip. for Jump (10%)
+Scroll for Pole Arm for Att. (10%)
+Scroll for Spear for Att. (10%)
+Scroll for Staff for Magic Att. (10%)
+Scroll for Two-handed Axe for Att. (10%)
+Scroll for Two-Handed Blunt Weapon for Att. (10%)
+Scroll for Wand for Magic Att. (10%)
+.
+Useable drop
+White Scroll - uncommon
+Elixir
+Power Elixir
+.
+Common equipment
+Aluminum Baseball Bat
+Amethyst Earrings
+Aqua Snowboard
+Bamboo Spear
+Bamboo Sword
+Beige Umbrella
+Black Tube
+Black Umbrella
+Blood Snowboard
+Blue Flowery Tube
+Blue Justice Cape
+Cat�s Eye
+Colorful Tube
+Dark Snowboard
+Double Axe
+Emerald Earrings
+Emergency Rescue Tube
+Frying Pan
+Gold Drop Earrings
+Golden Snowboard
+Green Ski
+Green Umbrella
+Glowing Whip
+Hardwood Wand
+Half Earrings
+Holy Cross Earrings
+Ice Wand
+Korean Fan
+Leather Purse
+Lightning Earrings
+Light Purple Umbrella
+Lollipop
+Long Sword
+Maple Shield
+Pico-Pico Hammer
+Purple Tube
+Red Brick
+Red Cross Earrings
+Red Flowery Tube
+Red-Hearted Earrings
+Red Umbrella
+Red Whip
+Rose Earrings
+Sapphire Earrings
+Single Earring
+Sky Blue Umbrella
+Sky Ski
+Sky Snowboard
+Sword
+Weighted Earrings
+White Justice Cape
+White Mop
+Wooden Wand
+Yellow Mop
+Yellow Square
+Yellow Umbrella
+.
+Warrior equipment
+Axe Pole Arm
+Blue Counter
+Broadsword
+Buck
+Chrono
+Crescent Polearm
+Cutlus
+Dankke
+Dark Snowboard
+Doombringer
+Eloon
+Fireman�s Axe
+Forked Spear
+Fork on a Stick
+Gladius
+Gold Dragon
+Heaven�s Gate
+Heavy Hammer
+Holy Spear
+Iron Mace
+Jeweled Katar
+Knuckle Mace
+Lion�s Fang
+Lionheart
+Mace
+Mithril Maul
+Mithril Pole Arm
+Monkey Wrench
+Niam
+Plunger
+Pointed Shovel
+Pole Arm
+Sabretooth
+Scimitar
+Serpent�s Tongue
+Skylar
+Sledgehammer
+Studded Polearm
+The Blessing
+The Judgement
+The Rising
+The Shining
+Traus
+Two-Handed Axe
+War Hammer
+Wooden Sword
+Zard
+Zeco
+.
+Magician equipment
+Arc Staff
+Cromi
+Dark Ritual
+Evil Wings
+Fairy Wand
+Mithril Wand
+Mystic Cane
+Thorns
+Wooden Staff
+.
+Bowman equipment
+Asianic Bow
+Battle Bow
+Blue Hinkel
+Dark Arund
+Golden Arund
+Golden Raven
+Marine Raven
+Metus
+Mountain Crossbow
+Olympus
+Red Viper
+Silver Crow
+Vaulter 2000
+War Bow | Wooden Sword
+.
+Thief equipment
+Adamantium Igor
+Adamantium Guards
+Angelic Betrayal
+Bazlud
+Blood Avarice
+Adamantium Avarice
+Blood Gigantic
+Blue Scarab
+Bronze Gigantic
+Bronze Guardian
+Brown Scarab
+Bushido
+Cass
+Dark Avarice
+Dark Guardian
+Black Scarab
+Dark Slain
+Deadly Fin
+Dragon Toenail
+Dragon�s Tail
+Forked Dagger
+Garnier
+Golden River
+Green Scarab
+Kandine
+Meba
+Reef Claw
+Sai
+Sapphire Gigantic
+Serpent�s Coil
+Shinkita
+Silver Guardian
+Steel Avarice
+Steel Igor
+Steel Slain
+Steel Titans
+.
+Pirate Scroll
+Scroll for Knuckles for ATT 15%
+.
+Pirate equipment
+Brown Paulie Boots
+Abyss Shooter
+.
+
+.
+
+Gachapon 8 � Aquarium
+
+Scroll
+Scroll for Bottomwear for Def. (30%)
+Scroll for Bottomwear for DEX (30%)
+Scroll for Bottomwear for HP (30%)
+Scroll for Bottomwear for Jump (30%)
+Scroll for Cape for Weapon Def. (30%)
+Scroll for Cape for Magic Def. (30%)
+Scroll for Cape for HP (30%)
+Scroll for Cape for INT (30%)
+Scroll for Cape for MP (30%)
+Scroll for Cape for DEX (30%)
+Scroll for Cape for LUK (30%) | Scroll for Cape for STR (30%)
+Scroll for Gloves for Attack (30%) - uncommon
+Scroll for Gloves for DEX (30%)
+Scroll for Gloves for HP (30%)
+Scroll for Gloves for Magic Att. (30%) - uncommon
+Scroll for Helmet for Accuracy (30%)
+Scroll for Helmet for Def. (30%)
+Scroll for Helmet for HP (30%)
+Scroll for Helmet for INT (30%)
+Scroll for Overall Armor for DEX (30%)
+Scroll for Overall Armor for LUK (30%)
+Scroll for Overall Armor for INT (30%)
+Scroll for Overall Armor for Def. (30%)
+Scroll for Shield for Def. (30%)
+Scroll for Shield for HP (30%)
+Scroll for Shield for LUK (30%)
+Scroll for Shoes for DEX (30%)
+Scroll for Shoes for Jump (30%)
+Scroll for Shoes for Speed (30%)
+Scroll for Topwear for Def. (30%)
+Scroll for Topwear for HP (30%)
+Scroll for Topwear for STR (30%)
+Scroll for Topwear for LUK (30%)
+Scroll for Earring for INT (30%)
+Scroll for Earring for DEX (30%)
+Scroll for Earring for Def. (30%)
+Scroll for Bow for Att. (30%)
+Scroll for Claw for Att. (30%)
+Scroll for Crossbow for Att. (30%)
+Scroll for Dagger for Att. (30%)
+Scroll for One-Handed Axe for Att. (30%)
+Scroll for One-Handed BW for Att. (30%)
+Scroll for One-Handed Sword for Att. (30%)
+Scroll for One-Handed Sword for Magic Att. (30%)
+Scroll for Pole Arm for Att. (30%)
+Scroll for Spear for Att. (30%)
+Scroll for Staff for Magic Att. (30%)
+Scroll for Two-handed Axe for Att. (30%)
+Scroll for Two-handed BW for Att. (30%)
+Scroll for Two-handed Sword for Att. (30%)
+Scroll for Wand for Magic Att. (30%)
+.
+Useable drop
+Drake�s Blood
+Elixir
+Fat Sausage
+Power Elixir
+Sap of Ancient Tree
+Summoning Crimson Balrog - uncommon
+Summoning Superslime
+Summoning Tauromacis
+Summoning Werewolf
+Summoning Yeti & Pepe
+The Magic Rock
+.
+Warrior equipment
+Adamantium Tower Shield
+Daiwa Sword
+.
+Magician equipment
+Black Jester
+Blue Jester
+Bronze Pride
+Brown Jester
+Doomsday Staff
+Fairy Wand
+Golden Pride
+Pink Jester
+Steel Pride
+Wooden Staff
+.
+Bowman equipment
+Bow of Magical Destruction
+.
+Thief equipment
+Adamantium Guards
+Dark Guise
+Dark Avarice
+Dark Gigantic
+.
+Pirate Scroll
+Scroll for Gun for Attack 60%
+.
+Pirate equipment
+Black Pirate's Bandana
+.
+
+.
+
+Gachapon 9 � Ludibrium
+
+Scroll
+Scroll for Pet Equip. for Speed (100%)
+Scroll for Bottomwear for Def. (60%)
+Scroll for Cape for DEX (60%)
+Scroll for Cape for HP (60%)
+Scroll for Cape for INT (60%)
+Scroll for Cape for LUK (60%)
+Scroll for Cape for Magic Def. (60%)
+Scroll for Cape for MP (60%)
+Scroll for Cape for STR (60%)
+Scroll for Cape for Weapon Def. (60%)
+Scroll for Claw for Att. (60%)
+Scroll for Dagger for Att. (60%)
+Scroll for Earring for INT (60%)
+Scroll for Pet Equip. for Jump (60%)
+Scroll for Pet Equip. for Speed (60%)
+Scroll for Shield for Def. (60%)
+Scroll for Shoes for DEX (60%)
+Scroll for Shoes for Jump (60%)
+Scroll for Shoes for Speed (60%)
+Scroll for Bottomwear for Def. (10%)
+Scroll for Cape for DEX (10%)
+Scroll for Cape for HP (10%)
+Scroll for Cape for INT (10%)
+Scroll for Cape for LUK (10%)
+Scroll for Cape for Magic Def. (10%)
+Scroll for Cape for MP (10%)
+Scroll for Cape for STR (10%)
+Scroll for Cape for Weapon Def. (10%)
+Scroll for Claw for Att. (10%)
+Scroll for Dagger for Att. (10%)
+Scroll for Earring for INT (10%)
+Scroll for Gloves for Attack (10%) - uncommon
+Scroll for Helmet for Def. (10%)
+Scroll for Pole Arm for Att. (10%)
+Scroll for Pet Equip. for Jump (10%)
+Scroll for Pet Equip. for Speed (10%)
+Scroll for Shoes for DEX (10%)
+Scroll for Shoes for Jump (10%)
+Scroll for Shoes for Speed (10%)
+Scroll for Spear for Att. (10%)
+Scroll for Staff for Magic Att. (10%)
+Scroll for Topwear for Def. (10%)
+Scroll for Wand for Magic Att. (10%)
+.
+Useable drop
+Elixir
+Power Elixir
+The Magic Rock
+The Summoning Rock
+.
+Common equipment
+Amethyst Earrings
+Bamboo Spear
+Bamboo Sword
+Beige Umbrella
+Black Justice Cape
+Black Magic Cape
+Black Paint Brush
+Black Umbrella
+Blue Magic Cape
+Blue Moon
+Green Paint Brush
+Cat�s Eye
+Crystal Flower Earrings
+Emerald Earrings
+Fan
+Gold Drop Earrings
+Gold Earrings
+Green Umbrella
+Half Earrings
+Hula Hoop
+Holy Cross Earrings
+Lightning Earrings
+Light Purple Umbrella
+Lollipop
+Mark of the Beta - uncommon
+Metal Heart Earrings
+Metal Silver Earrings
+Newspaper Sword
+Pan Lid
+Pansy Earrings
+Pico-Pico Hammer
+Pink-Flowered Earrings
+Plastic Bottle
+Red Brick
+Red Cross Earrings
+Red-Hearted Earrings
+Red Justice Cape
+Red Umbrella
+Red Whip
+Sapphire Earrings
+Single Earring
+Skull Earrings
+Sky Blue Umbrella
+Star Earrings
+Thermometer
+White Magic Cape
+White Justice Cape
+Yellow Mop
+Yellow Square
+.
+Beginner equipment
+Frozen Tuna - uncommon
+Plastic Bottle
+Sake Bottle
+.
+Warrior equipment
+Daiwa Sword
+Golden Mole
+Jousting Helmet
+Sai
+Zeco
+.
+Magician equipment
+Black Jester
+Blue Jester
+Bronze Pride
+Brown Jester
+Golden Pride
+Green Jester
+Mystic Cane
+Pink Jester
+Steel Pride
+Sun Quan Staff
+Wizard Wand
+.
+Bowman equipment
+Black Metus
+Blue Hawkeye
+Brown Hawkeye
+Casa Crow
+Dark Hawkeye
+Golden Arund
+Green Hawkeye
+Marine Arund
+Red Hawkeye
+Red Hinkel
+Rower
+.
+Thief Equipment
+Angelic Betrayal
+Dark Guise
+Blue Guise
+Brown Guise
+Brown China
+Casters
+Green Guise
+Diamond Dagger
+Shinobi Bracer
+Red Guise
+Sai
+.
+Pirate Scroll
+Scroll for Knuckles for ATT 65%
+.
+Pirate equipment
+Black Polax Hat
+.
+
+.
+
+Gachapon � Leafre
+
+Scroll
+Dark Scroll for Topwear for STR
+Dark Scroll for Topwear for HP
+Dark Scroll for Topwear for DEF
+Dark Scroll for Topwear for LUK
+Dark Scroll for Topwear for HP
+Dark Scroll for Pole Arm for ATT
+Dark Scroll for Bottomwear for DEX
+Dark Scroll for Bottomwear for Jump
+Dark Scroll for Gloves for HP
+Dark Scroll for Cape for DEX
+Dark Scroll for Cape for LUK
+Dark Scroll for Cape for STR
+Dark Scroll for Cape for HP
+Dark Scroll for Cape for INT
+Dark Scroll for One-Handed Axe for ATT
+Dark Scroll for Dagger for ATT
+Dark Scroll for Face Eqp. for HP
+Dark Scroll for Bottomwear for DEF
+Dark Scroll for Bottomwear for DEX
+Dark Scroll for One-Handed Sword for ATT
+Dark Scroll for One-Handed BW for ATT
+Dark Scroll for Two-Handed BW for ATT
+Dark Scroll for Two-Handed Sword for ATT
+Dark Scroll for Overall Armor for LUK (30%)
+Dark Scroll for Overall Armor for DEF
+Dark Scroll for Dagger for ATT
+Dark Scroll for Shield for HP
+Dark Scroll for Shield for DEF
+Dark Scroll for Shield for LUK
+Dark Scroll for Gloves for DEX
+Dark Scroll for Gloves for HP
+Dark Scroll for Gloves for ATT (30%) - uncommon
+Dark Scroll for Helmet for Accuracy
+Dark Scroll for Shoes for Jump
+Dark Scroll for Shoes for DEX
+Dark Scroll for Two-Handed Sword for ATT
+Dark Scroll for Wand for Magic Att.
+Dark Scroll for Bow for ATT
+Dark Scroll for Overall Armor for INT
+Dark Scroll for Eye Eqp. for Accuracy
+Dark Scroll for Face Eqp. for HP
+Dark Scroll for Face Eqp. for Avoidability
+Dark Scroll for Claw for ATT
+Dark Scroll for Shield for LUK
+Dark Scroll for Gloves for Magic Att. - uncommon
+Dark Scroll for Spear for ATT
+Dark Scroll for One-Handed Sword for Magic Att.
+Dark Scroll for Earring for DEX (30%)
+Dark Scroll for Earring for INT
+Dark Scroll for Earring for DEF
+Dark Scroll for Gloves for ATT (30%) - uncommon
+Dark Scroll for Eye Eqp. for INT (30%)
+Dark Scroll for Eye Eqp. for INT (70%)
+.
+Useable drop
+n/a
+.
+Common equipment
+Yellow Adventurer Cape
+Pink Adventurer Cape - uncommon
+Purple Adventurer Cape - uncommon
+Purple Gaia Cape
+Yellow Work Gloves
+Black Emerald Earrings
+Red Work Gloves
+Purple Bandana
+Black Bandana
+Brown Bandana
+Brown Work Gloves - uncommon
+Black Old Wisconsin
+Owl Ball Mask
+.
+Beginner equipment
+n/a
+.
+Warrior equipment
+Scythe
+Pumpkin Spear
+Dark Master Sergeant Kilt
+SledgeHammer
+Dark Crusader Chainmail
+Black Dragon Robe
+Japanese Map
+Daiwa Sword
+Red Katana
+.
+Mage equipment
+Blue Apprentice Hat
+Dark Chaos Robe
+Dark Orientican
+Dark Anakamoon
+Dark Starlight
+Kage
+.
+Bowman equipment
+Black Hunter
+Black Huntress Pants
+Black Bennis Chainmail
+.
+Thief equipment
+Blood Sneak Pants
+Dark Pirate Skirt
+Dark Identity
+Dark Shadow
+Black Knucklevest Pants
+Shinobi Bracer
+.
+Pirate Scroll
+Scroll for Knuckler for Attack 70%
+.
+Pirate equipment
+Beia Crash
+Brown Double Boots
+.
+
+.
+
+Gachapon � Mushroom Shrine
+
+Scroll
+Dark Scroll for Earring for INT
+Dark Scroll for Earring for DEX (70%)
+Dark Scroll for Earring for DEF
+Dark Scroll for Crossbow for ATT (70%)
+Dark Scroll for Cape for DEX (30%)
+Dark Scroll for Cape for INT (30%)
+Dark Scroll for Cape for STR (30%)
+Dark Scroll for Cape for STR (70%)
+Dark Scroll for Cape for LUK (30%)
+Dark Scroll for Bottomwear for HP (70%)
+Dark Scroll for Bottomwear for DEF (30%)
+Dark Scroll for Bottomwear for DEF (70%)
+Dark Scroll for Bottomwear for DEX (30%)
+Dark Scroll for Bottomwear for DEX (70%)
+Dark Scroll for Gloves for ATT (30%) - uncommon
+Dark Scroll for Gloves for ATT (70%) - uncommon
+Dark Scroll for Gloves for HP
+Dark Scroll for Gloves for Magic Att. - uncommon
+Dark Scroll for Gloves for DEX
+Dark Scroll for One-Handed Sword for ATT (70%)
+Dark Scroll for Helmet for Accuracy (60%)
+Dark Scroll for Helmet for Accuracy (30%)
+Dark Scroll for Helmet for HP (30%)
+Dark Scroll for Helmet for INT
+Dark Scroll for Topwear for DEF (30%)
+Dark Scroll for Topwear for STR
+Dark Scroll for Topwear for LUK
+Dark Scroll for Overall Armor for DEF (30%)
+Dark Scroll for Overall Armor for DEX (30%)
+Dark Scroll for Overall Armor for DEX (70%)
+Dark Scroll for Overall Armor for INT (30%)
+Dark Scroll for Overall Armor for LUK
+Dark Scroll for Face Eqp. for Avoidability
+Dark Scroll for Shield for DEF (70%)
+Dark Scroll for Shield for HP
+Dark Scroll for 1-Handed Axe for ATT
+Dark Scroll for 2-Handed Axe for ATT
+Dark Scroll for 1-Handed Sword for ATT (30%)
+Dark Scroll for 1-Handed Sword for ATT (70%)
+Dark Scroll for 1-Handed Sword for Magic Att.
+Dark Scroll for 2-Handed Sword for ATT
+Dark Scroll for 2-Handed BW for ATT
+Dark Scroll for Dagger for ATT
+Dark Scroll for Bottomwear for Jump
+Dark Scroll for Shoes for Jump
+Dark Scroll for Shoes for DEX (30%)
+Dark Scroll for Spear for ATT
+.
+Useable drop
+.
+Common equipment
+Pink Adventurer Cape - uncommon
+Purple Adventurer Cape - uncommon
+Yellow Adventurer Cape
+Pink Gaia Cape
+Brown Bandana
+Bamboo Spear
+Pink Bandana
+Grey Bandana
+Brown Work Gloves - uncommon
+Blue Work Gloves
+Purple Work Gloves
+Red Emerald Earrings
+Blue Old Wisconsin
+Purple Old Wisconsin
+Pumpkin Spear
+Owl Ball Mask
+Frying Pan
+Sky Ski
+.
+Beginner equipment
+Silver Strap Shoes
+Black Strap Shoes
+Green Strap Shoes
+.
+Warrior equipment
+White Jangoon Pants
+Iron Mace
+Dark Dragon Babuta
+Janitor�s Mop
+Stonetooth Sword
+Sledgehammer
+Dark Crusader Chainmail
+.
+Mage equipment
+Doomsday Staff
+Black Split Pants
+Dark Moonlight
+Dark Anakamoon
+Dark Chaos Robe
+Dark Calaf
+Dragon Staff
+Dragon Wand
+Black Armine
+Poison Mushroom
+Hinomaru Fan
+Kage
+.
+Bowman equipment
+Bow of Magical Destruction
+Dark Legolia
+Rower
+.
+Thief equipment
+Black Knucklevest Pants
+Dark Guardian
+Dark Burgler
+Dark Distinction
+Dark Shadow Pants
+Dark Pirate Pants
+.
+Pirate Scroll
+Scroll for Gun for Attack 30%
+.
+Pirate equipment
+Cold Mind
+Concerto
+.
+
+.
+
+Gachapon 10 � Showa Spa Female
+
+Scroll
+Scroll for Pet equip. for JUMP 10%
+Scroll for Pet equip. for SPEED 10%
+Scroll for One-handed BW for ATT 10%
+Scroll for Crossbow for ATT 10%
+Scroll for One-handed BW For Accuracy 10%
+Scroll for Belts for DEX 60%
+Scroll for Shield for Weapon att 70% - uncommon
+Scroll for cape for STR 30%
+Scroll for Two-handed Axe for ATT 70%
+Scroll for Bow for att 30%
+Scroll for Spear for att 30%
+Scroll for Dagger for att 70%
+Scroll for Belts for LUK 100%
+Scroll for Two-Handed Sword for Accuracy 100%
+.
+Useable drop
+Maple Special Bento
+Power Elixir
+Takoyaki (jumbo)
+Yakisoba (x2)
+.
+Common equipment
+Two-handed sword
+Japanese map
+Newspaper hat
+Owl Ball Mask
+Purple adventurer cape - uncommon
+Yellow work gloves
+Blue work gloves
+Red work gloves
+Pink Marker
+Red marker
+.
+Common setup
+Giant Pink Bean Cushion
+Cuddly Polar Bear
+.
+Beginner equipment
+.
+Warrior equipment
+Leomite
+Pinaka
+.
+Magician equipment
+Metal Wand
+Sapphire Staff
+.
+Bowman equipment
+Black Bennis Chainmail
+.
+Thief equipment
+Shinkita
+Green Sonata
+.
+Pirate Scroll
+Scroll for Knuckler for Attack 70%
+Scroll for Knuckles for Accuracy 15%
+Scroll for Gun for Attack 30%
+Scroll for Gun for ATT 10%
+Scroll for Gun for attack 60%
+.
+Pirate equipment
+Brown Royce
+Black Skellduke
+Fury Claw
+Cold Mind
+Black Polax Hat
+.
+
+.
+
+Gachapon 11 � Showa Spa Male
+
+Scroll
+Scroll for Pet equip. for JUMP 10%
+Scroll for Pet equip. for SPEED 10%
+Scroll for One-handed BW for ATT 10%
+Scroll for Crossbow for ATT 10%
+Scroll for One-handed BW For Accuracy 10%
+Scroll for Belts for DEX 60%
+Scroll for Shield for Weapon att 70% - uncommon
+Scroll for cape for STR 30%
+Scroll for Two-handed Axe for ATT 70%
+Scroll for Bow for att 30%
+Scroll for Spear for att 30%
+Scroll for Dagger for att 70%
+.
+Useable drop
+Maple Special Bento
+Power Elixir
+Takoyaki (jumbo)
+Yakisoba (x2)
+.
+Common equipment
+Korean Fan
+Hand axe
+Christmas Tree
+Blue Flowery Tube
+Colorful Tube
+Red Flowery Tube
+Red Brick
+Old Gladius
+Glowing Whip
+Sky blue umbrella
+Fruit Knife
+Bamboo Spear
+Orange ski
+Green ski
+Bamboo Spear
+Japanese map
+Pumpkin lantern
+Silver Snowboard
+Blood snowboard
+Dark snowboard
+Guan Yu Pole Arm
+Newspaper hat
+Pink marker
+Yellow Marker
+Purple work gloves
+Black Emerald Earrings
+Fallen Leaf Earrings
+Red Seraph Cape
+Purple Gaia cape
+Purple Adventurer Cape - uncommon
+.
+Common setup
+Giant Pink Bean Cushion
+Tiger Skin Chair
+.
+Beginner equipment
+.
+Warrior equipment
+Sabretooth
+Raven's wing
+Night raven's wing
+Pointed Shovel
+Eloon
+Cutlus
+Gladius
+.
+Magician equipment
+Fairy Wand
+Magicodar
+Wizard Wand
+Zhu-Ge-Liang Wand
+Thorns
+Sun quan Staff
+.
+Bowman equipment
+Bow Of Magical Destruction
+Red viper
+Olympus
+Ryden
+Battle Crossbow
+Rower
+Balanche
+Brown Distinction
+.
+Thief equipment
+Blood gigantic
+Reef claw
+Serpent's Coil
+Angelic Betrayal
+Field Dagger
+Liu bei Dagger
+Green China
+.
+Pirate Scroll
+Scroll for Gun for ATT 10%
+Scroll for Gun for attack 60%
+Scroll for Knuckles for ATT 65%
+Scroll for Gun for Attack 70%
+Scroll for Knuckler for Attack 30%
+.
+Pirate equipment
+Brown Pollard
+Black Bisk
+Black Duke Barkin Shoes
+Black Pirate's Bandana
+Beia Crash
+Mr. Rasfelt
+.
+
+.
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/aquarium.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/aquarium.txt
new file mode 100644
index 0000000000..d96deb4d5c
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/aquarium.txt
@@ -0,0 +1,98 @@
+
+Scroll:
+2040605
+2040626
+2040609
+2040607
+2041029
+2041027
+2041031
+2041037
+2041033
+2041039
+2041041
+2041035
+2040811 - uncommon
+2040809
+2040813
+2040815 - uncommon
+2040015
+2040009
+2040011
+2040013
+2040509
+2040521
+2040519
+2040507
+2040905
+2040909
+2040907
+2040713
+2040715
+2040717
+2040405
+2040409
+2040407
+2040426
+2040303
+2040307
+2040309
+2044505
+2044705
+2044605
+2043305
+2043105
+2043205
+2043005
+2043007
+2044405
+2044305
+2043805
+2044105
+2044205
+2044005
+2043705
+
+Useable drop:
+2012000
+2000004 2000012 2002012 2022175 2022456
+2020008
+2000005 2000019 2002013 2022176 2022457
+2012002
+2101001 - uncommon
+2101004
+2101005
+2101002
+2101003
+4006000
+
+Warrior equipment:
+1092014
+1402017
+
+Magician equipment:
+1002037
+1002034
+1002064
+1002038
+1382037
+1372000
+1002013
+1002035
+1002065
+1382000
+
+Bowman equipment:
+1452018
+
+Thief equipment:
+1472010 1472034 1472039 1472045
+1002175
+1472017
+1472025 1472036 1472041 1472047
+
+Pirate Scroll:
+2044901
+
+Pirate equipment:
+1002637
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/el_nath.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/el_nath.txt
new file mode 100644
index 0000000000..2060fce7e0
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/el_nath.txt
@@ -0,0 +1,216 @@
+
+Scroll:
+2041012
+2048003
+[2043800 2043803 2043812 ]
+2043301
+2040301
+[2040804 2040826 ]- uncommon
+2043101
+2043201
+2043001
+2044301
+2043801
+2044201
+2043701
+2044502
+2041011
+2041014
+2044602
+2043302
+2040805 - uncommon
+2043202
+2043002
+2048005
+2044402
+2044302
+2043802
+2044102
+2044202
+2043702
+
+Useable drop:
+2340000 - uncommon
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+
+Common equipment:
+1402010
+1032003
+1442013
+1432009
+1302022
+1302029
+1322021
+1302026
+1442017
+1322023
+1102011
+1032008 4031568
+1322026
+1442016
+1312000
+1032007
+1322025
+1322027
+1032020
+1442015
+1432017
+1302027
+1302049
+1372006
+1032022
+1032021
+1372004
+1332020
+1322007
+1032006
+1302028
+1322003 1702020
+1302007
+1092030
+1302021
+1322024
+1322012
+1032005
+1322022
+1032013
+1302025
+1302013
+1032017
+1032002
+1032001
+1302017
+1432018
+1442012
+1302000
+1032000
+1102013
+1442022
+1372005
+1442021
+1032009
+1302016
+
+Warrior equipment:
+1442003
+1312007
+1402008
+1312008 1312018 1312022 1312026
+1412008 1412015 1412019 1412024
+1442009
+1302004
+1312006
+1442016
+1402012 1402022 1402027 1402033
+1302003
+1312005
+1432002 1432019 1432024 1432031
+1432001
+1302008 1302038 1302043 1302050
+1040030
+1402015 1402023 1402028 1402034
+1322015
+1432006 1432021 1432026 1432033
+1322002
+1302010 1302039 1302044 1302051
+1322017 1322036 1322041 1322047
+1402003 1402020 1402025 1402031
+1402006
+1322000
+1422001
+1442001
+1422004
+1412004
+1322009
+1322011
+1442000
+1412005
+1402002 1402019 1402024 1402030
+1432004 1432020 1432025 1432032
+1442010 1442032 1442036 1442041
+1422008
+1442007
+1422009 1422016 1422020 1422024
+1322019 1322038 1322043 1322049
+1412003 1412013 1412017 1412022
+1412007 1412014 1412018 1412023
+1302009
+1412000
+1322014 1322035 1322040 1322046
+1402001
+1402007
+1432005
+
+Magician equipment:
+1382001 1382020 1382025 1382030
+1372007 1372019 1372023 1372028
+1382010 1382023 1382028 1382033
+1382007 1382022 1382027 1382032
+1372000
+1372003
+1382011
+1382006 1382021 1382026 1382031
+1382000
+
+Bowman equipment:
+1452004 1452029 1452034 1452040
+1452000
+1452010
+1452015 1452031 1452036 1452042
+1452014
+1462012
+1462010
+1452017
+1462000 1462023 1462028 1462033
+1452008 1452028 1452033 1452039
+1452006
+1462006
+1452007
+1452002
+1402001
+
+Thief equipment:
+1472006
+1472010 1472034 1472039 1472045
+1332022
+1332011
+1472015
+1472016
+1472023
+1472028
+1472022
+1472011
+1472026
+1332024
+1332009
+1472017
+1472013
+1472029 1472037 1472042 1472048
+1472021 1472035 1472040 1472046
+1332015 1332035 1332040 1332045
+1332031
+1332023 1332037 1332042 1332047
+1332004
+1472000
+1332019
+1472027
+1332018 1332036 1332041 1332046
+1472007
+1332012 1332033 1332038 1332043
+1332016
+1472024
+1332017
+1332003 1332034 1332039 1332044
+1472012
+1472014
+1472005
+1472018
+1472001
+
+Pirate Scroll:
+2044812
+
+Pirate equipment:
+1072294
+1492009 1492018
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/ellinia.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/ellinia.txt
new file mode 100644
index 0000000000..2bf74ba510
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/ellinia.txt
@@ -0,0 +1,255 @@
+
+Scroll:
+2043302
+2040002
+2043102
+2043002
+2044402
+2044302
+2043802
+2044002
+2041017 2041053 2041016 2041052 2041015
+
+Useable drop:
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+2022025
+2022026
+
+Common equipment:
+1402010
+1442013
+1432009
+1002060
+1002063
+1322023
+1002042
+1050018
+1082147
+1002026
+1002392
+1082149 - uncommon
+1062024
+1442016
+1322025
+1322027
+1002391 - uncommon
+1302027
+1372006
+1002419 - uncommon
+1302019
+1092022
+1302021
+1041004
+1002395 1002448
+1322024
+1082148
+1002012
+1322012
+1032028
+1102012
+1322022
+1051017
+1302013
+1082146
+1442014
+1302017
+1102013
+1102003
+1002041
+1002097
+1302016
+1082145
+
+Warrior equipment:
+1412006
+1040029 5000032
+1040086
+1050005
+1060028
+1002059
+1060008
+1061088
+1402012 1402022 1402027 1402033
+1302003
+1432002 1432019 1432024 1432031
+1312011 1312021 1312025 1312029
+1302008 1302038 1302043 1302050
+1040030
+1002004
+1402015 1402023 1402028 1402034
+1322028 1322039 1322044 1322050
+1322015
+1432006 1432021 1432026 1432033
+1442006
+1322000
+1002085
+1002056
+1092013
+1002058
+1002050
+1060011
+1322009
+1322011
+1442000
+1051011
+1061016
+1060018
+1041024
+1061020
+1302005
+1402002 1402019 1402024 1402030
+1002030
+1092004
+1041023
+1422008
+1060009
+1051000
+1002021
+1442005 1442031 1442035 1442040
+1412003 1412013 1412017 1412022
+1412007 1412014 1412018 1412023
+1422007
+1302009
+1402000
+1402001
+1402007
+1432005
+
+Magician equipment:
+1382001 1382020 1382025 1382030
+1002037
+1060014
+1040018
+1061027
+1050002
+1002152
+1051027
+1050035
+1050056
+1051047
+1051030
+1002274
+1050074
+1002218
+1002254
+1082088
+1382007 1382022 1382027 1382032
+1002013
+1082087
+1372008
+1382008 1382024 1382029 1382034
+1372002
+1372003
+1382011
+1382004
+1050047
+1040019
+1041041
+1061034
+1041051
+1051045
+1051024
+1082081
+1041030
+1040018
+1002073
+1382003
+1082086
+1382014 1702033
+1050055
+1050025
+1002155
+1060015
+
+Bowman equipment:
+1452004 1452029 1452034 1452040
+1462003
+1060070
+1002118
+1061058
+1040003
+1002160
+1002121
+1040068
+1061063
+1040080
+1462004
+1041008
+1061006
+1061009
+1040022 1041032
+1002168
+1040067
+1060056
+1041054
+1041067
+1060063
+1002213
+1002119
+1462005
+1452001
+1462000 1462023 1462028 1462033
+1040025 1041033
+1002166
+1002161
+1040069
+1051039
+1452006
+1462006
+1452007
+1402001
+1041062
+
+Thief equipment:
+1472010 1472034 1472039 1472045
+1472006
+1332011
+1472031 1472038 1472043 1472049
+1041048
+1472019
+1041095
+1040095
+1002128
+1061077
+1060025
+1041040
+1061033
+1472028
+1472022
+1472011
+1040096
+1062002
+1002129
+1472026
+1332009
+1060043
+1002249
+1472021 1472035 1472040 1472046
+1040084 1041076
+1332015 1332035 1332040 1332045
+1002173
+1002148
+1332004
+1332018 1332036 1332041 1332046
+1472009
+1061069
+1002176
+1041044
+1061037
+1060032
+1472020
+1040060
+1472018
+1332013
+1332002
+1402001
+
+Pirate Scroll:
+2044902 2044907 2044904 2044901 2044906 2044903 [2044900 2044908 ]
+
+Pirate equipment:
+1052107
+1082189
+1052116
+1072309
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/henesys.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/henesys.txt
new file mode 100644
index 0000000000..f6fa09f500
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/henesys.txt
@@ -0,0 +1,174 @@
+
+Scroll:
+2040001
+2041002
+2040805 - uncommon
+2040702
+2043802
+2040402
+2043702
+
+Useable Drops:
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+2020012
+2030007
+
+Common equipment:
+1432009
+1302022
+1322021
+1302026
+1442017
+1082147
+1102043
+1322026
+1442016
+1402012 1402022 1402027 1402033
+1322025
+1322027
+1302027
+1312012
+1062000
+1332020
+1302028
+1372002
+1002033
+1092022
+1302021
+1102041 - uncommon
+1322009
+1102042 - uncommon
+1322024
+1082148
+1002012
+1322012
+1322022
+1002020 1002454
+1302013
+1082146
+1442014
+1002096
+1302017
+1442012
+
+Beginner equipment:
+1442018 1442039 - uncommon
+
+Warrior equipment:
+1092011
+1092014
+1302003
+1432001
+1312011 1312021 1312025 1312029
+1002088
+1041020
+1322015
+1442004
+1422008
+1302056 1402011 1402021 1402026 1402032
+1432000
+1442005 1442031 1442035 1442040
+
+Magician equipment:
+1382001 1382020 1382025 1382030
+1041053
+1041029
+1050053
+1051032
+1050073
+1061036
+1002253
+1002034
+1051025
+1050067
+1051052
+1002072
+1002144
+1051054
+1050069
+1372007 1372019 1372023 1372028
+1050056
+1050074
+1002254
+1002274
+1002218
+1051055
+1382010 1382023 1382028 1382033
+1002246
+1050039
+1382007 1382022 1382027 1382032
+1372000
+1002013
+1050072
+1002036
+1002244
+1372008
+1382008 1382024 1382029 1382034
+1382011
+1092021
+1051034
+1050047
+1040019
+1041031
+1051033
+1002153
+1002252
+1051024
+1051053
+1050068
+1382003
+1382006 1382021 1382026 1382031
+1050055
+1051031
+1050025
+1002155
+1002245
+1372001 1372018 1372022 1372027
+
+Bowman equipment:
+1452004 1452029 1452034 1452040
+1452023 1702035
+1060057
+1432001
+1040071
+1002137
+1462009 1462026 1462031 1462036
+1452017
+1040025 1041033
+1041027
+1452005 1452027 1452032 1452038
+1452007
+1061057
+
+Thief equipment:
+1472006
+1472019
+1060084
+1472028
+1472004
+1002179
+1082074
+1472029 1472037 1472042 1472048
+1040100
+1332015 1332035 1332040 1332045
+1432001
+1040097
+1060071
+1472007
+1472002
+1051009
+1041044
+1041003
+1332016
+1472020
+1332003 1332034 1332039 1332044
+
+Pirate Scroll:
+2044813
+
+Pirate equipment:
+1002622
+1082204
+1082213
+1082198
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/kerning_city.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/kerning_city.txt
new file mode 100644
index 0000000000..c47981fd21
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/kerning_city.txt
@@ -0,0 +1,117 @@
+
+Scroll:
+2041016
+2043302
+2040805 - uncommon
+2040902
+
+Useable drop:
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+2022025
+2022027
+
+Common equipment:
+1442013
+1432009
+1322021
+1050018
+1002392
+1082149 - uncommon
+1002394
+1442004
+1372002
+1002418
+1002033
+1092008
+1102041 - uncommon
+1082148
+1062001
+1302017
+1032023
+1102013
+1102040
+1002041
+1002097
+
+Warrior equipment:
+1332026
+1051010
+1432001
+1422005 1422015 1422019 1422023
+1332019
+1302010 1302039 1302044 1302051
+1002056
+1060011
+1322011
+1432004 1432020 1432025 1432032
+1002028
+1051000
+1442007
+1302002
+
+Magician equipment:
+1002037
+1002034
+1082020
+1050039
+1372000
+1002215
+1051034
+1040019
+1061034
+1382003
+1382006 1382021 1382026 1382031
+1050025
+
+Bowman equipment:
+1002118
+1061081
+1452011 1452030 1452035 1452041
+1462012
+1452006
+1452007
+
+Thief equipment:
+1472010 1472034 1472039 1472045
+1472029 1472037 1472042 1472048
+1041048
+1041095
+1060031
+1061033
+1041049
+1472011
+1040096
+1472033
+1332026
+1051006
+1082074
+1472025 1472036 1472041 1472047
+1061106
+1040084 1041076
+1332015 1332035 1332040 1332045
+1472000
+1332019
+1002183
+1002209
+1092020
+1332029
+1092019
+1061099
+1060106 1061116
+1040032 1041036
+1040059
+1332003 1332034 1332039 1332044
+1040060
+1060046
+1472005
+1332027
+
+Pirate Scroll:
+2044804
+2044906
+
+Pirate equipment:
+1482004 1482015
+1072318
+1492007 1492016
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/leafre.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/leafre.txt
new file mode 100644
index 0000000000..4d85851b1b
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/leafre.txt
@@ -0,0 +1,113 @@
+
+Scroll:
+2040407 2040406
+2040409 2040408
+2040405 2040404
+2040411 2040410
+2040409 2040408
+2044405 2044404
+2040611 2040610
+2040607 2040606
+2040813 2040812
+2041039 2041038
+2041041 2041040
+2041035 2041034
+2041031 2041030
+2041037 2041036
+2043105 2043104
+2043305 2043304
+2040103 2040104
+2040605 2040604
+2040611 2040610
+2043005 2043004
+2043205 2043204
+2044205 2044204
+2044005 2044004
+2040521
+2040511 2040510
+2043305 2043304
+2040909 2040908
+2040905 2040904
+2040907 2040906
+2040809 2040808
+2040813 2040812
+2040811 - uncommon
+2040015 2040014
+2040715 2040714
+2040713 2040712
+2044005 2044004
+2043705 2043704
+2044505 2044504
+2040519 2040518
+2040203 2040204
+2040103 2040104
+2040108 2040109
+2044705 2044704
+2040907 2040906
+2040815 2040814 - uncommon
+2044305 2044304
+2043007 2043006
+2040307
+2040305 2040304
+2040309 2040308
+2040811 - uncommon
+2040208
+2040209
+
+Useable drop:
+
+Common equipment:
+1102040
+1102041 - uncommon
+1102042 - uncommon
+1102086
+1082145
+1032027
+1082146
+1002395 1002448
+1002083
+1002392
+1082149 - uncommon
+1002587
+1022047
+
+Beginner equipment:
+
+Warrior equipment:
+1312002
+1432013
+1060030
+1422008
+1050022
+1050011
+1402013
+1402017
+1302012 1302041 1302046 1302053
+
+Mage equipment:
+1002074
+1050029
+1040093
+1050056
+1050039
+1382008 1382024 1382029 1382034
+
+Bowman equipment:
+1002159
+1061051
+1040023
+
+Thief equipment:
+1061054
+1061106
+1002249
+1040084 1041076
+1060052
+1472054
+
+Pirate Scroll:
+2044803
+
+Pirate equipment:
+1482009 1482018
+1072303
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/ludibrium.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/ludibrium.txt
new file mode 100644
index 0000000000..26b5c0d7a7
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/ludibrium.txt
@@ -0,0 +1,159 @@
+
+Scroll:
+2048000
+2040601
+2041019
+2041007
+2041016
+2041022
+2041001
+2041010
+2041013
+2041004
+2044701
+2043301
+2040301
+2048004
+2048001
+2040901
+2040701
+2040704
+2040707
+2040602
+2041020
+2041008
+2041017
+2041023
+2041002
+2041011
+2041014
+2041005
+2044702
+2043302
+[2040302 2040330 ]
+2040805 - uncommon
+2040002
+2044402
+2048005
+2048002
+2040702
+2040705
+2040708
+2044302
+2043802
+2040402
+2043702
+
+Useable drop:
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+4006000
+4006001
+
+Common equipment:
+1032003
+1432009
+1302022
+1302029
+1102014
+1102018
+1312014
+1302026
+1102015
+1032011 1041078
+1312013
+1032008 4031568
+1032019
+1032007
+1332030
+1032020
+1032004
+1302027
+1032022
+1312012
+1032021
+1032006
+1302028
+1322003 1702020
+1002419 - uncommon
+1032016
+1032015
+1302024
+1092008
+1032018
+1302021
+1032014
+1332021
+1322012
+1032005
+1032013
+1102012
+1302025
+1302013
+1032002
+1032001
+1032012
+1302017
+1032010
+1402014
+1102017
+1102013
+1442021
+1032009
+
+Beginner equipment:
+1442018 1442039 - uncommon
+1332021
+1422011
+
+Warrior equipment:
+1402017
+1422005 1422015 1422019 1422023
+1002023
+1332016
+1432005
+
+Magician equipment:
+1002037
+1002034
+1002064
+1002038
+1002013
+1002036
+1382011
+1002035
+1002065
+1382014 1702033
+1372001 1372018 1372022 1372027
+
+Bowman equipment:
+1452026
+1002162
+1002164
+1462018
+1002165
+1452014
+1002163
+1452012
+1002161
+1452009
+1462007 1462024 1462029 1462034
+
+Thief Equipment:
+1332022
+1002175
+1002172
+1002174
+1040096
+1472033
+1002173
+1332054
+1472054
+1002171
+1332016
+
+Pirate Scroll:
+2044811
+
+Pirate equipment:
+1002646
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/mushroom_shrine.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/mushroom_shrine.txt
new file mode 100644
index 0000000000..068c099704
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/mushroom_shrine.txt
@@ -0,0 +1,119 @@
+
+Scroll:
+2040305 2040304
+2040306
+2040309 2040308
+2044604
+2041039
+2041037
+2041035
+2041034
+2041041
+2040608
+2040605
+2040604
+2040611
+2040610
+2040811 - uncommon
+2040810 - uncommon
+2040813 2040812
+2040815 2040814 - uncommon
+2040809 2040808
+2043004
+2040017
+2040015
+2040011
+2040013 2040012
+2040405
+2040407 2040406
+2040411 2040410
+2040511
+2040509
+2040508
+2040519
+2040521 2040520
+2040108 2040109
+2040904
+2040909 2040908
+2043105 2043104
+2044105 2044104
+2043005
+2043004
+2043007 2043006
+2044005 2044004
+2044205 2044204
+2043305 2043304
+2040607 2040606
+2040715 2040714
+2040713
+2044305 2044304
+
+Useable drop:
+
+Common equipment:
+1102041 - uncommon
+1102042 - uncommon
+1102040
+1102084
+1002392
+1432009
+1002393 1002903
+1002394
+1082149 - uncommon
+1082147
+1082148
+1032028
+1002585
+1002586
+1432013
+1022047
+1322027
+1432018
+
+Beginner equipment:
+1072264
+1072262
+1072263
+
+Warrior equipment:
+1060074
+1322002
+1002340
+1442004
+1402037
+1422008
+1050022
+
+Mage equipment:
+1382037
+1060014
+1051026
+1050056
+1050029
+1051030
+1382036
+1372032
+1041015
+1382015 3300001
+1372008
+1382008 1382024 1382029 1382034
+
+Bowman equipment:
+1452018
+1041068
+1462007 1462024 1462029 1462034
+
+Thief equipment:
+1060052
+1472013
+1002180
+1002170
+1060073 1061071
+1060099
+
+Pirate Scroll:
+2044904
+
+Pirate equipment:
+1492004 1492015
+1492012
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/perion.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/perion.txt
new file mode 100644
index 0000000000..a64db932f0
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/perion.txt
@@ -0,0 +1,117 @@
+
+Useable drop:
+2000004 2000012 2002012 2022175 2022456
+2000005 2000019 2002013 2022176 2022457
+
+Common equipment:
+1402010
+1302022
+1002060
+1322021
+1082147
+1002006
+1002026
+1002392
+1082149 - uncommon
+1322025
+1322027
+1002391 - uncommon
+1102000
+1082150
+1332020
+1322007
+1002419 - uncommon
+1302021
+1102041 - uncommon
+1002395 1002448
+1082148
+1322012
+1302017
+1322010
+1032000
+1102013
+1002097
+
+Warrior equipment:
+1322020
+1312007
+1312008 1312018 1312022 1312026
+1302004
+1312006
+1082036
+1082117
+1061088
+1302008 1302038 1302043 1302050
+1422005 1422015 1422019 1422023
+1002048
+1061087
+1302018 1302042 1302047 1302054
+1322017 1322036 1322041 1322047
+1422001
+1040103
+1060077
+1002022
+1002050
+1442000
+1432030
+1402037
+1092002
+1041092
+1050006
+1432004 1432020 1432025 1432032
+1061019
+1432000
+1060009
+1051000
+1002021
+1322014 1322035 1322040 1322046
+1432005
+
+Magician equipment:
+1051032
+1040018
+1051027
+1372007 1372019 1372023 1372028
+1050049
+1002036
+1382012
+1002217
+1051033
+1382006 1382021 1382026 1382031
+1050048
+
+Bowman equipment:
+1061061
+1060062
+1040075
+1462013 1462027 1462032 1462037
+1041065
+1452006
+
+Thief equipment:
+1040095
+1060084
+1002182
+1041049
+1002247
+1332024
+1332009
+1060024
+1332015 1332035 1332040 1332045
+1041060
+1061032
+1041074
+1041003
+1332016
+1472020
+1332003 1332034 1332039 1332044
+1041059
+
+Pirate Scroll:
+2044907
+2044802 2044804 2044801 2044803 [2044800 2044815 ]
+
+Pirate equipment:
+1002631
+1052122
+1482012
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_female.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_female.txt
new file mode 100644
index 0000000000..acecbf0b79
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_female.txt
@@ -0,0 +1,69 @@
+
+Scroll:
+2048005
+2048002
+2043202
+2044602
+2043214
+2041307
+2040916 - uncommon
+2041035
+2044104
+2044505
+2044305
+2043304
+2041309
+2044010
+
+Useable drop:
+2022016
+2000005 2000019 2002013 2022176 2022457
+2022025
+2022027
+
+Common equipment:
+1402000
+1402013
+1002418
+1022047
+1102042 - uncommon
+1082145
+1082147
+1082146
+1082178
+1082175
+
+Common setup:
+3010073
+3010099
+
+Beginner equipment:
+
+Warrior equipment:
+1422013
+1432030
+
+Magician equipment:
+1372002
+1382003
+
+Bowman equipment:
+1040023
+
+Thief equipment:
+1332003 1332034 1332039 1332044
+1002209
+
+Pirate Scroll:
+2044803
+2044814
+2044904
+2044902
+2044901
+
+Pirate equipment:
+1082198
+1082213
+1482007 1482016
+1492004 1492015
+1002646
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_male.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_male.txt
new file mode 100644
index 0000000000..521dea07cf
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/showa_spa_male.txt
@@ -0,0 +1,109 @@
+
+Scroll:
+2048005
+2048002
+2043202
+2044602
+2043214
+2041307
+2040916 - uncommon
+2041035
+2044104
+2044505
+2044305
+2043304
+
+Useable drop:
+2022016
+2000005 2000019 2002013 2022176 2022457
+2022025
+2022027
+
+Common equipment:
+1332020
+1312004
+1332032 5010034 9250053
+1322023
+1322026
+1322022
+1322012
+1302014
+1302049
+1302017
+1332007
+1432009
+1432016
+1432017
+1432009
+1402013
+1402044
+1442014
+1442017
+1442016
+1442025
+1002418
+1082178
+1082179
+1082148
+1032027
+1032032
+1102028
+1102086
+1102042 - uncommon
+
+Common setup:
+3010073
+3010111
+
+Beginner equipment:
+
+Warrior equipment:
+1412005
+1402048
+1402049
+1322011
+1302003
+1302004
+1302008 1302038 1302043 1302050
+
+Magician equipment:
+1372000
+1372009
+1372001 1372018 1372022 1372027
+1372011 1702032
+1382006 1382021 1382026 1382031
+1382014 1702033
+
+Bowman equipment:
+1452018
+1452006
+1452008 1452028 1452033 1452039
+1452005 1452027 1452032 1452038
+1462002
+1462007 1462024 1462029 1462034
+1462003
+1002169
+
+Thief equipment:
+1472023
+1332012 1332033 1332038 1332043
+1332017
+1332022
+1332006
+1332029
+1040097
+
+Pirate Scroll:
+2044902
+2044901
+2044811
+2044903
+2044804
+
+Pirate equipment:
+1052107
+1082204
+1072318
+1002637
+1482009 1482018
+1492007 1492016
diff --git a/tools/MapleGachaponItemidRetriever/lib/gachapons/sleepywood.txt b/tools/MapleGachaponItemidRetriever/lib/gachapons/sleepywood.txt
new file mode 100644
index 0000000000..e9f5dad0a1
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/lib/gachapons/sleepywood.txt
@@ -0,0 +1,165 @@
+
+Scroll:
+2048003
+2048000
+2040601
+2044501
+2041019
+2041016
+2041022
+2041010
+2041013
+2043301
+2040301
+[2040804 2040826 ]- uncommon
+2040801
+2040817 - uncommon
+2040001
+2040004
+2043101
+2043201
+2043001
+2040504
+2040501
+2048004
+2048001
+2044401
+2040901
+2040701
+2040704
+2040707
+2044301
+2043801
+2044101
+2044201
+2044001
+2040602
+2044502
+2041020
+2041017
+2041023
+2041014
+2041005
+2044702
+2044602
+2043302
+[2040302 2040330 ]
+2040805 - uncommon
+2040802
+2040005
+2043202
+2043002
+2040505
+2040502
+2048005
+2048002
+2044402
+2040902
+2040702
+2040705
+2040708
+2044302
+2043802
+2044202
+2044002
+
+Useable drop:
+2340000 - uncommon
+2012000
+2012003
+2020007
+2000004 2000012 2002012 2022175 2022456
+2012001
+2020008
+2070006
+2020012
+2000005 2000019 2002013 2022176 2022457
+2030007
+2012002
+2002001
+2070005
+
+Common equipment:
+1032003
+1432009
+1102014
+1102018
+1002392
+1082149 - uncommon
+1322026
+1032022
+1312012
+1332020
+1092030
+1032016
+1032015
+1032014
+1322024
+1032013
+1322022
+1102016
+1032012
+1032023
+1402014
+1032000
+1102017
+
+Beginner equipment:
+1442018 1442039 - uncommon
+
+Warrior equipment:
+1402017
+1051010
+1432011
+1442006
+1322002
+1422004
+1432010 1432023 1432028 1432035
+1051011
+1060018
+1432000
+1422003
+1412003 1412013 1412017 1412022
+1422000
+
+Magician equipment:
+1002034
+1002142
+1382010 1382023 1382028 1382033
+1002013
+1382008 1382024 1382029 1382034
+1382011
+1050047
+1002065
+
+Bowman equipment:
+1452003
+1002165
+1040068
+1462013 1462027 1462032 1462037
+1462011
+1462012
+1061050
+1462010
+1002161
+
+Thief equipment:
+1332022
+1002175
+1040042
+1472004
+1040057
+1332031
+1332023 1332037 1332042 1332047
+1332010
+1002171
+1060046
+
+Pirate Scroll:
+2044801
+2044903
+2044814
+
+Pirate equipment:
+1052131
+1482007 1482016
diff --git a/tools/MapleGachaponItemidRetriever/lib/mysql-connector-java-bin.jar b/tools/MapleGachaponItemidRetriever/lib/mysql-connector-java-bin.jar
new file mode 100644
index 0000000000..0539039f71
Binary files /dev/null and b/tools/MapleGachaponItemidRetriever/lib/mysql-connector-java-bin.jar differ
diff --git a/tools/MapleGachaponItemidRetriever/manifest.mf b/tools/MapleGachaponItemidRetriever/manifest.mf
new file mode 100644
index 0000000000..328e8e5bc3
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/manifest.mf
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
diff --git a/tools/MapleGachaponItemidRetriever/nbbuild.xml b/tools/MapleGachaponItemidRetriever/nbbuild.xml
new file mode 100644
index 0000000000..6949c94b99
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/nbbuild.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+ Builds, tests, and runs the project MapleGachaponItemidRetriever.
+
+
+
diff --git a/tools/MapleGachaponItemidRetriever/src/maplegachaponitemidretriever/MapleGachaponItemidRetriever.java b/tools/MapleGachaponItemidRetriever/src/maplegachaponitemidretriever/MapleGachaponItemidRetriever.java
new file mode 100644
index 0000000000..f91a633a36
--- /dev/null
+++ b/tools/MapleGachaponItemidRetriever/src/maplegachaponitemidretriever/MapleGachaponItemidRetriever.java
@@ -0,0 +1,375 @@
+/*
+ This file is part of the HeavenMS MapleStory Server
+ Copyleft (L) 2016 - 2018 RonanLana
+
+ 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 maplegachaponitemidretriever;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ *
+ * @author RonanLana
+ *
+ * This application reads metadata for the gachapons found on the "gachapon_items.txt"
+ * recipe file, then checks up the Handbook DB (installed through MapleIdRetriever)
+ * and translates the item names from the recipe file into their respective itemids.
+ * The translated itemids are then stored in specific gachapon files inside the
+ * "lib/gachapons" folder.
+ *
+ * Estimated parse time: 1 minute
+ */
+public class MapleGachaponItemidRetriever {
+
+ static String host = "jdbc:mysql://localhost:3306/heavenms";
+ static String driver = "com.mysql.jdbc.Driver";
+ static String username = "root";
+ static String password = "";
+
+ static Connection con = null;
+ static InputStreamReader fileReader = null;
+ static BufferedReader bufferedReader = null;
+ static PrintWriter printWriter = null;
+
+ // ------- SET-UP section arguments --------
+
+ static String directoryName = "./handbook/";
+
+ // ------- SEARCH section arguments --------
+
+ static String inputName = "lib/gachapon_items.txt";
+ static String outputPath = "lib/gachapons/";
+
+ static Pattern p = Pattern.compile("(\\d*)%");
+ static int[] scrollsChances = new int[]{10, 15, 30, 60, 65, 70, 100};
+
+ static Map> scrollItemids = new HashMap<>();
+
+ private static void insertGachaponScrollItemid(Integer id, String name, String description, boolean both) {
+ GachaponScroll gachaScroll = getGachaponScroll(name, description, both);
+
+ List list = scrollItemids.get(gachaScroll);
+ if (list == null) {
+ list = new LinkedList<>();
+ scrollItemids.put(gachaScroll, list);
+ }
+
+ list.add(id);
+ }
+
+ private static void loadHandbookUseNames() throws SQLException {
+ PreparedStatement ps = con.prepareStatement("SELECT * FROM `handbook` WHERE `id` >= 2040000 AND `id` < 2050000 ORDER BY `id` ASC;");
+ ResultSet rs = ps.executeQuery();
+
+ while(rs.next()) {
+ Integer id = rs.getInt("id");
+ String name = rs.getString("name");
+
+ if (isUpgradeScroll(name)) {
+ String description = rs.getString("description");
+ insertGachaponScrollItemid(id, name, description, false);
+ insertGachaponScrollItemid(id, name, description, true);
+ }
+ }
+
+ rs.close();
+ ps.close();
+
+ /*
+ for (Entry> e : scrollItemids.entrySet()) {
+ System.out.println(e);
+ }
+ System.out.println("------------");
+ */
+ }
+
+ private static class GachaponScroll {
+ private String header;
+ private String target;
+ private String buff;
+ private int prop;
+
+ private GachaponScroll(GachaponScroll from, int prop) {
+ this.header = from.header;
+ this.target = from.target;
+ this.buff = from.buff;
+ this.prop = prop;
+ }
+
+ private GachaponScroll(String name, String description, boolean both) {
+ String[] params = name.split(" for ");
+ if (params.length < 3) {
+ return;
+ }
+
+ String header = both ? "scroll" : " " + params[0];
+ String target = params[1];
+
+ int prop = 0;
+ String buff = params[2];
+
+ Matcher m = p.matcher(buff);
+ if (m.find()) {
+ prop = Integer.valueOf(m.group(1));
+ buff = buff.substring(0, m.start() - 1).trim();
+ } else {
+ m = p.matcher(description);
+
+ if (m.find()) {
+ prop = Integer.valueOf(m.group(1));
+ }
+ }
+
+ int idx = buff.indexOf(" ("); // remove percentage & dots from name checking
+ if (idx > -1) {
+ buff = buff.substring(0, idx);
+ }
+ buff = buff.replace(".", "");
+
+ this.header = header;
+ this.target = target;
+ this.buff = buff;
+ this.prop = prop;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = (int) (prop ^ (prop >>> 32));
+ result = 31 * result + (header != null ? header.hashCode() : 0);
+ result = 31 * result + (target != null ? target.hashCode() : 0);
+ result = 31 * result + (buff != null ? buff.hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ GachaponScroll sc = (GachaponScroll) o;
+ if (header != null ? !header.equals(sc.header) : sc.header != null) return false;
+ if (target != null ? !target.equals(sc.target) : sc.target != null) return false;
+ if (buff != null ? !buff.equals(sc.buff) : sc.buff != null) return false;
+ if (prop != sc.prop) return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return header + " for " + target + " for " + buff + " - " + prop + "%";
+ }
+
+ }
+
+ private static String getGachaponScrollResults(String line, boolean both) {
+ String str = "";
+ List gachaScrollList;
+
+ GachaponScroll gachaScroll = getGachaponScroll(line, "", both);
+ if (gachaScroll.prop != 0) {
+ gachaScrollList = Collections.singletonList(gachaScroll);
+ } else {
+ gachaScrollList = new ArrayList<>(scrollsChances.length);
+
+ for (int prop : scrollsChances) {
+ gachaScrollList.add(new GachaponScroll(gachaScroll, prop));
+ }
+ }
+
+ for (GachaponScroll gs : gachaScrollList) {
+ List gachaItemids = scrollItemids.get(gs);
+ if (gachaItemids != null) {
+ String listStr = "";
+ for (Integer id : gachaItemids) {
+ listStr += id.toString();
+ listStr += " ";
+ }
+
+ if (gachaItemids.size() > 1) {
+ str += "[" + listStr + "]";
+ } else {
+ str += listStr;
+ }
+ }
+ }
+
+ return str;
+ }
+
+ private static GachaponScroll getGachaponScroll(String name, String description, boolean both) {
+ name = name.toLowerCase();
+ name = name.replace("for acc ", "for accuracy ");
+ name = name.replace("blunt weapon", "bw");
+ name = name.replace("eye eqp.", "eye accessory");
+ name = name.replace("face eqp.", "face accessory");
+ name = name.replace("for attack", "for att");
+ name = name.replace("1-handed", "one-handed");
+ name = name.replace("2-handed", "two-handed");
+
+ return new GachaponScroll(name, description, both);
+ }
+
+ private static boolean isUpgradeScroll(String name) {
+ return name.matches("^(([D|d]ark )?[S|s]croll for).*");
+ }
+
+ private static void fetchLineOnMapleHandbook(String line, String rarity) throws SQLException {
+ String str = "";
+ if (!isUpgradeScroll(line)) {
+ PreparedStatement ps = con.prepareStatement("SELECT `id` FROM `handbook` WHERE `name` LIKE ? COLLATE latin1_general_ci ORDER BY `id` ASC;");
+ ps.setString(1, line);
+
+ ResultSet rs = ps.executeQuery();
+ while(rs.next()) {
+ Integer id = rs.getInt("id");
+
+ str += id.toString();
+ str += " ";
+ }
+
+ rs.close();
+ ps.close();
+ } else {
+ str += getGachaponScrollResults(line, false);
+ if (str.isEmpty()) {
+ str += getGachaponScrollResults(line, true);
+
+ if (str.isEmpty()) {
+ System.out.println("NONE for '" + line + "' : " + getGachaponScroll(line, "", false));
+ }
+ }
+ }
+
+ if (str.isEmpty()) {
+ str += line;
+ }
+
+ if (rarity != null) {
+ str += ("- " + rarity);
+ }
+
+ printWriter.println(str);
+ }
+
+ private static void fetchDataOnMapleHandbook() throws SQLException {
+ String line;
+
+ try {
+ fileReader = new InputStreamReader(new FileInputStream(inputName), "UTF-8");
+ bufferedReader = new BufferedReader(fileReader);
+
+ int skip = 0;
+ boolean lineHeader = false;
+ while((line = bufferedReader.readLine()) != null) {
+ if (skip > 0) {
+ skip--;
+
+ if (lineHeader) {
+ if (!line.isEmpty()) {
+ lineHeader = false;
+ printWriter.println();
+ printWriter.println(line + ":");
+ }
+ }
+ } else if (line.isEmpty()) {
+ printWriter.println("");
+ } else if (line.startsWith("Gachapon ")) {
+ String s[] = line.split("� ");
+ String gachaponName = s[s.length - 1];
+ gachaponName = gachaponName.replace(" ", "_");
+ gachaponName = gachaponName.toLowerCase();
+
+ if (printWriter != null) printWriter.close();
+ printWriter = new PrintWriter(outputPath + gachaponName + ".txt", "UTF-8");
+
+ skip = 2;
+ lineHeader = true;
+ } else if (line.startsWith(".")) {
+ skip = 1;
+ lineHeader = true;
+ } else {
+ line = line.replace("�", "'");
+ for (String item : line.split("\\s\\|\\s")) {
+ item = item.trim();
+ if (!item.contentEquals("n/a")) {
+ String[] itemInfo = item.split(" - ");
+ fetchLineOnMapleHandbook(itemInfo[0], itemInfo.length > 1 ? itemInfo[1] : null);
+ }
+ }
+ }
+ }
+
+ if (printWriter != null) printWriter.close();
+ bufferedReader.close();
+ fileReader.close();
+ }
+ catch(FileNotFoundException ex) {
+ System.out.println(ex.getMessage());
+ }
+ catch(IOException ex) {
+ System.out.println(ex.getMessage());
+ }
+ }
+
+ public static void main(String[] args) {
+
+ try {
+ Class.forName(driver).newInstance();
+ con = DriverManager.getConnection(host, username, password);
+
+ loadHandbookUseNames();
+ fetchDataOnMapleHandbook();
+
+ con.close();
+ }
+
+ catch(SQLException e) {
+ System.out.println("Error: invalid SQL syntax");
+ System.out.println(e.getMessage());
+ }
+
+ catch(ClassNotFoundException e) {
+ System.out.println("Error: could not find class");
+ System.out.println(e.getMessage());
+ }
+
+ catch(InstantiationException | IllegalAccessException e) {
+ System.out.println("Error: instantiation failure");
+ System.out.println(e.getMessage());
+ }
+ }
+
+}
diff --git a/tools/MapleIdRetriever/dist/MapleIdRetriever.jar b/tools/MapleIdRetriever/dist/MapleIdRetriever.jar
index be0554cadc..3d54825cb4 100644
Binary files a/tools/MapleIdRetriever/dist/MapleIdRetriever.jar and b/tools/MapleIdRetriever/dist/MapleIdRetriever.jar differ
diff --git a/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java b/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java
index aa6381fd98..31d51163b3 100644
--- a/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java
+++ b/tools/MapleIdRetriever/src/mapleidretriever/MapleIdRetriever.java
@@ -82,10 +82,10 @@ public class MapleIdRetriever {
}
private static void parseMapleHandbookLine(String line) throws SQLException {
- String[] tokens = line.split(" - ");
+ String[] tokens = line.split(" - ", 3);
if(tokens.length > 1) {
- PreparedStatement ps = con.prepareStatement("INSERT INTO `handbook` (`id`, `name`) VALUES (?, ?)");
+ PreparedStatement ps = con.prepareStatement("INSERT INTO `handbook` (`id`, `name`, `description`) VALUES (?, ?, ?)");
try {
ps.setInt(1, Integer.parseInt(tokens[0]));
} catch (NumberFormatException npe) { // odd...
@@ -93,7 +93,10 @@ public class MapleIdRetriever {
ps.setInt(1, Integer.parseInt(num));
}
ps.setString(2, tokens[1]);
+ ps.setString(3, tokens.length > 2 ? tokens[2] : "");
ps.execute();
+
+ ps.close();
}
}
@@ -124,14 +127,17 @@ public class MapleIdRetriever {
private static void setupSqlTable() throws SQLException {
PreparedStatement ps = con.prepareStatement("DROP TABLE IF EXISTS `handbook`;");
ps.execute();
+ ps.close();
ps = con.prepareStatement("CREATE TABLE `handbook` ("
+ "`key` int(10) unsigned NOT NULL AUTO_INCREMENT,"
+ "`id` int(10) DEFAULT NULL,"
+ "`name` varchar(200) DEFAULT NULL,"
+ + "`description` varchar(1000) DEFAULT '',"
+ "PRIMARY KEY (`key`)"
+ ") ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;");
ps.execute();
+ ps.close();
}
private static void parseMapleHandbook() throws SQLException {
@@ -175,6 +181,9 @@ public class MapleIdRetriever {
str += " ";
}
+ rs.close();
+ ps.close();
+
printWriter.println(str);
}
diff --git a/wz/Map.wz/Map/Map2/211000102.img.xml b/wz/Map.wz/Map/Map2/211000102.img.xml
index 617dfa366e..9f86421c37 100644
--- a/wz/Map.wz/Map/Map2/211000102.img.xml
+++ b/wz/Map.wz/Map/Map2/211000102.img.xml
@@ -1,394 +1,401 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
@@ -396,7 +403,7 @@
-
+
@@ -408,23 +415,15 @@
-
+
-
+
-
-
-
-
-
-
-
-
-
+
@@ -432,83 +431,91 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
@@ -519,40 +526,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/wz/Map.wz/Map/Map2/220000305.img.xml b/wz/Map.wz/Map/Map2/220000305.img.xml
index 0c1392e83b..727816e0e2 100644
--- a/wz/Map.wz/Map/Map2/220000305.img.xml
+++ b/wz/Map.wz/Map/Map2/220000305.img.xml
@@ -1,519 +1,539 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
-
-
-
+
+
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
@@ -521,15 +541,23 @@
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -542,10 +570,10 @@
-
-
-
-
+
+
+
+
@@ -553,7 +581,7 @@
-
+
@@ -561,14 +589,6 @@
-
-
-
-
-
-
-
-
@@ -577,43 +597,41 @@
-
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
@@ -622,35 +640,30 @@
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/wz/Quest.wz/Act.img.xml b/wz/Quest.wz/Act.img.xml
index b257813231..e612835194 100644
--- a/wz/Quest.wz/Act.img.xml
+++ b/wz/Quest.wz/Act.img.xml
@@ -15773,7 +15773,7 @@
-
+
@@ -21426,10 +21426,6 @@
-
-
-
-
diff --git a/wz/Quest.wz/Check.img.xml b/wz/Quest.wz/Check.img.xml
index 8868940095..dda18b6107 100644
--- a/wz/Quest.wz/Check.img.xml
+++ b/wz/Quest.wz/Check.img.xml
@@ -40747,9 +40747,12 @@
-
-
-
+
+
+
+
+
+
diff --git a/wz/Quest.wz/Say.img.xml b/wz/Quest.wz/Say.img.xml
index 63ab21999a..5eb5b41717 100644
--- a/wz/Quest.wz/Say.img.xml
+++ b/wz/Quest.wz/Say.img.xml
@@ -21951,7 +21951,7 @@
-
+
diff --git a/wz/Skill.wz/112.img.xml b/wz/Skill.wz/112.img.xml
index 28c9ce6679..94f849c520 100644
--- a/wz/Skill.wz/112.img.xml
+++ b/wz/Skill.wz/112.img.xml
@@ -1137,212 +1137,212 @@
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/wz/Skill.wz/122.img.xml b/wz/Skill.wz/122.img.xml
index df7be51ff0..669871cbff 100644
--- a/wz/Skill.wz/122.img.xml
+++ b/wz/Skill.wz/122.img.xml
@@ -892,212 +892,212 @@
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/wz/Skill.wz/132.img.xml b/wz/Skill.wz/132.img.xml
index 9d8cf844b1..9163936bde 100644
--- a/wz/Skill.wz/132.img.xml
+++ b/wz/Skill.wz/132.img.xml
@@ -2663,212 +2663,212 @@
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/wz/String.wz/Consume.img.xml b/wz/String.wz/Consume.img.xml
index a1782e3a6c..39f3c90f2c 100644
--- a/wz/String.wz/Consume.img.xml
+++ b/wz/String.wz/Consume.img.xml
@@ -1745,18 +1745,18 @@
-
+
-
+
-
+
@@ -3769,11 +3769,11 @@
-
+
-
+
@@ -6520,11 +6520,11 @@
-
+
-
+
@@ -7348,7 +7348,7 @@
-
+
diff --git a/wz/String.wz/Eqp.img.xml b/wz/String.wz/Eqp.img.xml
index 06181f5d92..17b4b26524 100644
--- a/wz/String.wz/Eqp.img.xml
+++ b/wz/String.wz/Eqp.img.xml
@@ -19455,7 +19455,7 @@
-
+
diff --git a/wz/String.wz/Skill.img.xml b/wz/String.wz/Skill.img.xml
index 76726b3dfb..0eab03f30a 100644
--- a/wz/String.wz/Skill.img.xml
+++ b/wz/String.wz/Skill.img.xml
@@ -4853,36 +4853,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -5171,36 +5171,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -5517,36 +5517,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+