Hired Merchant & Player shop fixes + Owl of Minerva

Thanks to BenjixD DietStory's dev team, many bugs found by them have
been patched (pirate quests, missing drop data, fly command, etc).
Implemented Owl of Minerva. Fixed many issues with Hired Merchant and
Player Shops. Fixed an error with the slot checking system. Added Wish
Tickets (circa-2006 GMS event) to be dropped on AmoriaPQ.
This commit is contained in:
ronancpl
2017-09-29 18:35:42 -03:00
parent de7e686a92
commit ddbd679f88
129 changed files with 4564 additions and 400 deletions
+11 -10
View File
@@ -2,15 +2,16 @@
.idea/ .idea/
# Netbeans project files # Netbeans project files
/nbproject/ nbproject/
/tools/MapleCouponInstaller/nbproject/ tools/MapleCouponInstaller/nbproject/
/tools/MapleIdRetriever/nbproject/ tools/MapleIdRetriever/nbproject/
/tools/MobBookIndexer/nbproject/ tools/MobBookIndexer/nbproject/
/tools/MobBookUpdate/nbproject/ tools/MobBookUpdate/nbproject/
# build files # build files
/build/ build/
/tools/MapleCouponInstaller/build/ tools/MapleCouponInstaller/build/
/tools/MapleIdRetriever/build/ tools/MapleIdRetriever/build/
/tools/MobBookIndexer/build/ tools/MobBookIndexer/build/
/tools/MobBookUpdate/build/ tools/MobBookUpdate/build/
dist/
+2 -1
View File
@@ -23,7 +23,8 @@ Client files & general tools: https://drive.google.com/drive/folders/0BzDsHSr-0V
--- ---
### Donation ### Donation
If you liked what you have seen on the project, donate a little something as a helping hand for my contributions towards Maple development. Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3K8KVTWRLFBQ4 If you liked what you have seen on the project, donate a little something as a helping hand for my contributions towards Maple development.
Paypal: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3K8KVTWRLFBQ4
--- ---
### Preparing the ambient ### Preparing the ambient
+1 -1
View File
@@ -1,4 +1,4 @@
#Tue, 26 Sep 2017 00:15:28 -0300 #Fri, 29 Sep 2017 17:49:16 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -1
View File
@@ -60,6 +60,7 @@ Server potentials:
* Mastery book announcer displays droppers of needed books of a player, by reading underlying DB. * Mastery book announcer displays droppers of needed books of a player, by reading underlying DB.
* Every skill/mastery book is now droppable by mobs. * Every skill/mastery book is now droppable by mobs.
* Inventory auto-gather and auto-sorting feature. * Inventory auto-gather and auto-sorting feature.
* Enhanced auto-pot system: pet uses as many potions as necessary to reach the desired threshold.
* Enhanced buff system: smartly checks for the best available buff effects to be active on the player. * Enhanced buff system: smartly checks for the best available buff effects to be active on the player.
* Enhanced AP auto-assigner: exactly matches AP with the needed for the player's current level, surplus assigned to the primary attribute. * Enhanced AP auto-assigner: exactly matches AP with the needed for the player's current level, surplus assigned to the primary attribute.
* Added Boss HP Bar for dozens of bosses (needs provided custom wz). * Added Boss HP Bar for dozens of bosses (needs provided custom wz).
@@ -67,8 +68,9 @@ Server potentials:
* Custom jail system (needs provided custom wz). * Custom jail system (needs provided custom wz).
* Delete Character 100% (requires ENABLE_PIC activated). * Delete Character 100% (requires ENABLE_PIC activated).
* Boats, elevator and other travelling mechanics fully working. * Boats, elevator and other travelling mechanics fully working.
* Eanbled Hired Merchant can be used anywhere but FM Entrance. * Enabled Hired Merchant being able to be used anywhere but FM Entrance and other few places.
* Vega's spell. * Vega's spell.
* Owl of Minerva.
* Pet item ignore. * Pet item ignore.
* Autosaver (periodically saves on DB current state of every player in-game). * Autosaver (periodically saves on DB current state of every player in-game).
+7 -2
View File
@@ -551,6 +551,11 @@ Consertado GPQ n
Adicionado Water of Life. Adicionado Water of Life.
Consertado bug com sistema novo de buffs ao entrar no cash shop e em outros cenários onde não se detectava o melhor buff corretamente. Consertado bug com sistema novo de buffs ao entrar no cash shop e em outros cenários onde não se detectava o melhor buff corretamente.
25 Setembro 2017, 25 - 27 Setembro 2017,
Adicionado proteção de acesso concorrente a ações de Hired Merchant. Adicionado proteção de acesso concorrente a ações de Hired Merchant e Player Shop.
Corrigido alguns problemas com Hired Merchant não retornando a quantidade correta de itens. Corrigido alguns problemas com Hired Merchant não retornando a quantidade correta de itens.
Adicionado Owl of Minerva.
Corrigido um bug no sistema de checagem de slots.
28 Setembro 2017,
Adidionado wish tickets à AmoriaPQ.
-1
View File
@@ -21,7 +21,6 @@ ToDo / Missing features list:
--------------------------- ---------------------------
** Basic PQs ** ** Basic PQs **
- Amoria Party Quest
--------------------------- ---------------------------
+206
View File
@@ -0,0 +1,206 @@
/**
---------------------------------------------------------------------------------------------------
* NPC Name: High Priest John - ID: 9201002.js
* @author Vcoc
* @author Ronan
---------------------------------------------------------------------------------------------------
**/
importPackage(Packages.client);
importPackage(Packages.server);
importPackage(Packages.tools);
var status;
var minLevel = 10;
var maxLevel = 200;
var mySelection = -1;
var rings = Array(1112001, 1112002, 1112003, 1112005, 1112006);
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 1) {
status++;
} else {
if (type == 1 && mode == 0)
cm.sendOk("...");
cm.dispose();
return;
}
if (cm.getPlayer().getMapId() == 680000000) {
if (status == 0) {
cm.sendSimple("Olá #h #,\r\n#bO que você gostaria de fazer hoje?#b\r\n#L0#Eu quero me casar!#l\r\n#L1#Eu quero ver meus amigos no casamento!#l\r\n#L2#Quero trocar um Bilhete Premium de casamento por 5 convites!#l\r\n#L3#Eu quero comprar um Bilhete de Casamento!#l\r\n#L4#Gostaria de obter uma licença de casamento.#l");
} else if (status == 1) {
if (selection == 0) {
if (cm.getParty() == null) { // no party
cm.sendOk("Para se casar e necessario estar em grupo com a parceira(o)!");
cm.dispose();
} else if (!cm.isLeader()) { // not party leader
cm.sendOk("Por favor, fale ao seu parceiro(a) para falar comigo.");
cm.dispose();
} else {
var party = cm.getParty().getMembers();
var mapId = cm.getPlayer().getMapId();
var levelValid = 0;
var genderRight = 0;
var alreadyMarried = 0;
for (var i = 0; i < party.size(); i++) {
var pPlayer = party.get(i);
if (pPlayer.getLevel() >= minLevel && pPlayer.getLevel() <= maxLevel)
levelValid += 1;
if (pPlayer.getGender() == 0) {
genderRight += 1;
} else if (pPlayer.getGender() == 1) {
genderRight += 2;
}
if (pPlayer.isMarried() == 1) {
alreadyMarried += 1;
}
}
if (party.size() == 2) {
if (party.get(0).getGender() == 0) { // leader.
if (levelValid == 2 || cm.partyMembersInMap() == 2) {
if (genderRight == 3) {
if (alreadyMarried == 0) {
if (cm.haveItem(4031374, 1) && cm.haveItem(5251003, 1)) {
// Kick it into action. Slate says nothing here, just warps you in.
var em = cm.getEventManager("CathedralWedding");
if (em == null) {
cm.sendOk("Indisponivel!");
} else {
// Begin the Wedding o.O
em.startInstance(cm.getParty(), cm.getPlayer().getMap());
party = cm.getPlayer().getEventInstance().getPlayers();
var hname = party.get(0).getName();
var wname = party.get(1).getName();
var StringLine = "[" + hname + " & " + wname + "] Irão se casar na Catedral, no canal (" + cm.getC().getChannel() + ").";
cm.worldMessage(5, StringLine);
var eim = cm.getChar().getEventInstance();
eim.setProperty("husband", party.get(0).getName());
eim.setProperty("wife", party.get(1).getName());
}
} else
cm.sendOk("Você não tem os itens necessários, desculpe!");
} else
cm.sendOk("Você já está casado.");
} else
cm.sendOk("O nosso servidor não suporta este tipo de casamento!");
} else
cm.sendOk("Vocês precisam estar no mesmo mapa e ser pelo menos no nível ["+minLevel+" ~ "+maxLevel+"]");
} else
cm.sendOk("Por favor faça o teu marido lider do grupo.");
} else
cm.sendOk("Somentos marido e mulher no grupo!");
cm.dispose();
}
} else if (selection == 1) {
if (cm.haveItem(5251100, 1)) {
cm.sendGetText("Por favor, insira o nome de um dos membros do casamento .");
} else {
cm.sendOk("Parece que o casal que você quer assistir não te deu um convite ainda.");
cm.dispose();
}
} else if (selection == 2) {
if (cm.haveItem(5251003, 1)) {
cm.gainItem(5251003, -1);
cm.gainItem(5251100,5);
} else {
cm.sendOk("Você não tem o Bilhete de Casamento Premium.");
}
cm.dispose();
} else if (selection == 3) {
cm.sendOk("Você pode comprar um Bilhete de Casamento com a Ria! Localizada no Mercado Livre.");
cm.dispose();
} else if (selection == 4) {
if (cm.getPlayer().getMarriageQuestLevel() == 50) {
cm.sendNext("Por favor, vá visitar a Mom eo Dad em sua casa. Eles vivem em algum lugar Henesys Hunting Ground II.");
cm.getPlayer().addMarriageQuestLevel();
} else if (cm.getPlayer().getMarriageQuestLevel() == 53) {
if (cm.haveItem(4031373, 1)) {
cm.sendNext("Pronto, aqui sua permissão!");
cm.removeAll(4031373);
cm.gainItem(4031374, 1);
cm.getPlayer().setMarriageQuestLevel(100);
} else {
cm.sendNext("Você não tem a benção de Mom e Dad!");
}
} else {
cm.sendNext("Eu não sei o que você está falando.");
}
cm.dispose();
}
} else if (status == 2) {
var chr = cm.getCharByName(cm.getText());
if (chr != null) {
if (chr.getMapId() == 680000200) {
var eim = chrr.getEventInstance();
eim.registerPlayer(cm.getPlayer());
} else {
cm.sendOk("O casamento que você gostaria de participar não foi iniciado.");
}
} else
cm.sendOk("Jogador não encontrado.");
cm.dispose();
}
} else if (cm.getPlayer().getMapId() == 680000210) {
var eim = cm.getPlayer().getEventInstance();
var husbandName = eim.getProperty("husband");
var wifeName = eim.getProperty("wife");
var husband = cm.getCharByName(husbandName);
var wife = cm.getCharByName(wifeName);
var id = cm.getPlayer().getId();
var hclicked = eim.getProperty("hclicked");
var wclicked = eim.getProperty("hclicked");
var otherChar = husband == cm.getPlayer() ? wife : husband;
if (husband != null && wife != null) {
if (status == 0) {
if (id != husband.getId() && id != husband.getId()) {
cm.sendOk("Você não está se casando!");
cm.dispose();
} else if (cm.getPlayer().isMarried() > 0) {
cm.sendOk("Você já foi casado.");
cm.dispose();
} else if (hclicked == 1 && husbandName.equals(cm.getPlayer().getName())) {
cm.sendOk("Você já aceitou casar-se com sua esposa, pergunte à sua esposa a aceitar agora");
cm.dispose();
} else if (wclicked == 1 && wifeName.equals(cm.getPlayer().getName())) {
cm.sendOk("Você já aceitou casar-se com o seu marido , pergunte ao seu marido a aceitar agora");
cm.dispose();
} else {
cm.sendYesNo("Você deseja se casar com seu parceiro?\r\n\r\nIsso será uma decisão final.");
}
} else if (status == 1) {
if (husband == cm.getPlayer())
eim.setProperty("hclicked", 1);
else if (wife == cm.getPlayer())
eim.setProperty("wclicked", 1);
else {
cm.sendOk("Como assim?");
cm.dispose();
}
if (eim.getProperty("hclicked") == 1 && eim.getProperty("hclicked") == 1) {
if (!cm.createMarriage(otherChar.getName())) {
cm.sendOk("O sistema não pode encontrar o seu parceiro.");
cm.dispose();
return;
}
cm.worldMessage(5, "Parabéns a "+husbandName+" e "+wifeName+". São recém-casados, você pode enchê-los de spam agora!");
cm.removeAll(4031374);
MapleInventoryManipulator.removeById(otherChar.getClient(), MapleInventoryType.USE, 4031374, otherChar.getItemQuantity(4031374, false), false, false);
cm.dispose();
}
}
}
}
}
+25
View File
@@ -0,0 +1,25 @@
var status = 0;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}else if (mode == 0){
cm.dispose();
return;
} else {
if (mode == 1)
status++;
else
status--;
if (status == 0) {
cm.sendOk("Wow Vickii! You look so beautiful today. Are you ready to move on to the next part of this surprise?\r\n I will be giving you a tour for our chapel.");
cm.getPlayer().startWedding();
}
}
}
+2817
View File
File diff suppressed because it is too large Load Diff
+15 -16
View File
@@ -3,29 +3,28 @@
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="1"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerLoggedinHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/RecvOpcode.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/TakeDamageHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/data/input/GenericLittleEndianAccessor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleHiredMerchant.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/HiredMerchant.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/PacketProcessor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleStatEffect.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Item.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/9030000.js</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapObject.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ExpTable.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/worker/HiredMerchantWorker.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/FredrickHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/FredrickHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/OwlWarpHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/RemoteStoreHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerInteractionHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/PlayerInteractionHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/MapleInventory.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/HiredMerchantRequest.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/UseCashItemHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AutoAssignHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/UseOwlOfMinervaHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/ItemFactory.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleTrade.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleInventoryManipulator.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleMiniGame.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MaplePlayerShop.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/data/input/LittleEndianAccessor.java</file>
</group> </group>
</open-files> </open-files>
</project-private> </project-private>
+16
View File
@@ -0,0 +1,16 @@
importPackage(Packages.server.life);
function start(ms){
if(ms.getQuestStatus(2175) == 1){
var mobId = 9300156;
var player = ms.getPlayer();
var map = player.getMap();
if(map.getMonsterById(mobId) != null){
return;
}
map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(-1027, 216));
}
}
+15
View File
@@ -0,0 +1,15 @@
importPackage(Packages.server.life);
function start(ms) {
var mobId = 9400612;
var player = ms.getPlayer();
var map = player.getMap();
if(map.getMonsterById(mobId) != null){
return;
}
map.spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(mobId), new java.awt.Point(461, 61));
player.message("Marbas has appeared!");
}
+45 -25
View File
@@ -1,31 +1,51 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* /*
NPC: Muirhat - Nautilus' Port NPC: Muirhat - Nautilus' Port
Created By: Cyndicate, shortened by Moogra Created By: Kevin
Function: No specific function, useless text. Function: When on the quest, he warps player to Black Magician's Disciple
*/ */
var status;
function start() { function start() {
cm.sendOk("The Black Magician and his followers. Kyrin and the Crew of Nautilus. \n They'll be chasing one another until one of them doesn't exist, that's for sure.");
cm.dispose(); status = -1;
action(1, 0, 0);
}
function action(mode, type, selection){
if (mode == -1){
cm.dispose();
}
else{
if (mode == 0 && status == 0){
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0){
if (cm.getQuestStatus(2175) == 1){
if (cm.getPlayer().canHold(2030019)){
cm.sendOk("Please take this #b#t2030019##k, it will make your life a lot easier. #i2030019#");
cm.gainItem(2030019, 1);
}
else{
cm.sendOk("No free inventory spot available. Please make room in your USE inventory first.");
cm.dipose();
}
}
else{
cm.sendOk("The Black Magician and his followers. Kyrin and the Crew of Nautilus. \n They'll be chasing one another until one of them doesn't exist, that's for sure.");
cm.dispose();
}
}
else if (status == 1){
cm.warp(100000006);
cm.dispose();
}
}
} }
+1 -3
View File
@@ -19,14 +19,13 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
Author: XxOsirisxX (BubblesDev 0.75) Author: Kevin (DietStory v1.02)
NPC: Bush - Abel Glasses Quest NPC: Bush - Abel Glasses Quest
*/ */
var rolled = 0; var rolled = 0;
function start(mode, type, selection){ function start(mode, type, selection){
//cm.sendGetText("Do you want to obtain a glasses?");
if(!cm.isQuestStarted(2186)) { if(!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special..."); cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose(); cm.dispose();
@@ -46,6 +45,5 @@ function action(mode, type, selection) {
} }
else cm.sendOk("You #balready have#k the glasses that was here!"); else cm.sendOk("You #balready have#k the glasses that was here!");
//cm.saveSquadMembers(cm.getText());
cm.dispose(); cm.dispose();
} }
+19 -5
View File
@@ -19,17 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
Author: XxOsirisxX (BubblesDev 0.75) Author: Kevin (DietStory v1.02)
NPC: Bush - Abel Glasses Quest NPC: Bush - Abel Glasses Quest
*/ */
var rolled = 0;
function start(mode, type, selection){ function start(mode, type, selection){
cm.sendGetText("Do you want to obtain a glasses?"); if(!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose();
return;
}
cm.sendNext("Do you want to obtain a glasses?");
} }
function action(mode, type, selection) { function action(mode, type, selection) {
if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
cm.gainItem(4031854, 1); rolled = Math.floor(Math.random() * 3);
cm.saveSquadMembers(cm.getText());
if(rolled == 0) cm.gainItem(4031853, 1);
else if(rolled == 1) cm.gainItem(4031854, 1);
else cm.gainItem(4031855, 1);
}
else cm.sendOk("You #balready have#k the glasses that was here!");
cm.dispose(); cm.dispose();
} }
+19 -5
View File
@@ -19,17 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
Author: XxOsirisxX (BubblesDev 0.75) Author: Kevin (DietStory v1.02)
NPC: Bush - Abel Glasses Quest NPC: Bush - Abel Glasses Quest
*/ */
var rolled = 0;
function start(mode, type, selection){ function start(mode, type, selection){
cm.sendGetText("Do you want to obtain a glasses?"); if(!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose();
return;
}
cm.sendNext("Do you want to obtain a glasses?");
} }
function action(mode, type, selection) { function action(mode, type, selection) {
if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
cm.gainItem(4031854, 1); rolled = Math.floor(Math.random() * 3);
cm.saveSquadMembers(cm.getText());
if(rolled == 0) cm.gainItem(4031853, 1);
else if(rolled == 1) cm.gainItem(4031854, 1);
else cm.gainItem(4031855, 1);
}
else cm.sendOk("You #balready have#k the glasses that was here!");
cm.dispose(); cm.dispose();
} }
+19 -5
View File
@@ -19,17 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
Author: XxOsirisxX (BubblesDev 0.75) Author: Kevin (DietStory v1.02)
NPC: Bush - Abel Glasses Quest NPC: Bush - Abel Glasses Quest
*/ */
var rolled = 0;
function start(mode, type, selection){ function start(mode, type, selection){
cm.sendGetText("Do you want to obtain a glasses?"); if(!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose();
return;
}
cm.sendNext("Do you want to obtain a glasses?");
} }
function action(mode, type, selection) { function action(mode, type, selection) {
if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
cm.gainItem(4031854, 1); rolled = Math.floor(Math.random() * 3);
cm.saveSquadMembers(cm.getText());
if(rolled == 0) cm.gainItem(4031853, 1);
else if(rolled == 1) cm.gainItem(4031854, 1);
else cm.gainItem(4031855, 1);
}
else cm.sendOk("You #balready have#k the glasses that was here!");
cm.dispose(); cm.dispose();
} }
+19 -5
View File
@@ -19,17 +19,31 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
Author: XxOsirisxX (BubblesDev 0.75) Author: Kevin (DietStory v1.02)
NPC: Bush - Abel Glasses Quest NPC: Bush - Abel Glasses Quest
*/ */
var rolled = 0;
function start(mode, type, selection){ function start(mode, type, selection){
cm.sendGetText("Do you want to obtain a glasses?"); if(!cm.isQuestStarted(2186)) {
cm.sendOk("Just a pile of boxes, nothing special...");
cm.dispose();
return;
}
cm.sendNext("Do you want to obtain a glasses?");
} }
function action(mode, type, selection) { function action(mode, type, selection) {
if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) if(!(cm.haveItem(4031853) || cm.haveItem(4031854) || cm.haveItem(4031855))) {
cm.gainItem(4031854, 1); rolled = Math.floor(Math.random() * 3);
cm.saveSquadMembers(cm.getText());
if(rolled == 0) cm.gainItem(4031853, 1);
else if(rolled == 1) cm.gainItem(4031854, 1);
else cm.gainItem(4031855, 1);
}
else cm.sendOk("You #balready have#k the glasses that was here!");
cm.dispose(); cm.dispose();
} }
+29 -2
View File
@@ -19,7 +19,34 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* NPC Base
Map Name (Map ID)
Extra NPC info.
*/
var status;
function start() { function start() {
cm.warp(109030001, 0); status = -1;
cm.dispose(); action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("Wedding is currently closed.");
cm.dispose();
}
}
} }
+52
View File
@@ -0,0 +1,52 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* NPC Base
Map Name (Map ID)
Extra NPC info.
*/
var status;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("Wedding is currently closed.");
cm.dispose();
}
}
}
+52
View File
@@ -0,0 +1,52 @@
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3 as published by
the Free Software Foundation. You may not use, modify or distribute
this program under any other version of the GNU Affero General Public
License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* NPC Base
Map Name (Map ID)
Extra NPC info.
*/
var status;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
} else {
if (mode == 0 && type > 0) {
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if(status == 0) {
cm.sendOk("Wedding is currently closed.");
cm.dispose();
}
}
}
+86 -2
View File
@@ -19,7 +19,91 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Mr. Sandman
Amoria - Amoria (680000000)
AmoriaPQ Extras (get wish tickets in AmoriaPQ bonus stage)
Yellow Wish Ticket - Lv1 ~ 49
Green Wish Ticket - Lv50 ~ 119
Blue Wish Ticket - Lv120+
*/
var wishPrizes = [2000000, 2010004, 2020011, 2000004, 2000006, 2022015, 2000005, 1082174, 1002579, 1032039, 1002578, 1002580, 1002577, 1102078];
var wishPrizesQty = [10, 10, 5, 5, 5, 5, 10, 1, 1, 1, 1, 1, 1, 1];
var wishPrizesCst = [10, 15, 20, 30, 30, 50, 100, 400, 450, 500, 500, 530, 550, 600];
var slctTicket;
var amntTicket;
var sel;
var advance = true;
var status;
function getTierTicket(level) {
if(level < 50) {
return 4031543;
} else if(level < 120) {
return 4031544;
} else {
return 4031545;
}
}
function start() { function start() {
cm.getPlayer().getStorage().sendStorage(cm.getClient(), 9201042); slctTicket = getTierTicket(cm.getPlayer().getLevel());
cm.dispose(); amntTicket = cm.getItemQuantity(slctTicket);
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 && advance)
status++;
else
status--;
advance = true;
if(status == 0) {
cm.sendNext("Hi there, how is it going? Since you're passing by Amoria, have you heard about the event my brother Amos is hosting? It is the #bAmorian Challenge#k, an event for everyone above level 40.\r\n\r\nThere, you may find the #i4031543# #i4031544# #i4031545# #bWish Tickets#k that can be brought here to redeem prizes.");
} else if(status == 1) {
var listStr = "";
for(var i = 0; i < wishPrizes.length; i++) {
listStr += "#b#L" + i + "#" + wishPrizesQty[i] + " #z" + wishPrizes[i] + "##k";
listStr += " - " + wishPrizesCst[i] + " wish tickets";
listStr += "#l\r\n";
}
cm.sendSimple("You currently have #b" + amntTicket + " #i" + slctTicket + "# #t" + slctTicket + "##k.\r\n\r\nPurchase a prize:\r\n\r\n" + listStr);
} else if(status == 2) {
sel = selection;
if(amntTicket < wishPrizesCst[selection]) {
cm.sendPrev("You will need #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k to purchase that! If you want this, come back another time when you have all the tickets at hand.");
advance = false;
} else {
cm.sendYesNo("You have selected #b" + wishPrizesQty[selection] + " #z" + wishPrizes[selection] + "##k, that will require #b" + wishPrizesCst[selection] + " #t" + slctTicket + "##k. Will you purchase it?");
}
} else {
if(cm.canHold(wishPrizes[sel], wishPrizesQty[sel])) {
cm.gainItem(wishPrizes[sel], wishPrizesQty[sel]);
cm.gainItem(slctTicket, -wishPrizesCst[sel]);
cm.sendOk("There you go, have a good day!");
} else {
cm.sendOk("Please have a slot available on your inventory before claiming the item.");
}
cm.dispose();
}
}
} }
+61
View File
@@ -0,0 +1,61 @@
/*
Demon's Doorway
Marbas the Demon! Quest
Victoria Road: The Tree That Grew III
*/
var status;
function start(){
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection){
if (mode == -1){
cm.dispose();
}
else{
if (mode == 0 && status ==0){
cm.dispose();
return;
}
if (mode == 1)
status++;
else
status--;
if (status == 0){
cm.sendNext("#r\t[Requirements to Enter]\r\n\r\n\t\t1.#k Job must be Magician or Blaze Wizard.\r\n\t\t#r2.#k Must be under level 40.\r\n\t\t#r3.#k Must have #b#t4032495##k.");
}
else if (status == 1){
var jobId = cm.getJobId();
if ((jobId >= 200 && jobId <= 232) || (jobId >= 1100 && jobId <= 1112)){
if (cm.getLevel() < 40){
if (cm.hasItem(4032495)){
cm.sendYesNo("#kAll conditions have been satisfied. Do you wish to enter?");
}
else{
cm.sendOk("\t\tYou do not have #b#t4032495# #i4032495#");
cm.dispose();
}
}
else{
cm.sendOk("\tYour #blevel#k is too high.");
cm.dispose();
}
}
else{
cm.sendOk("\tThis is not for you! #rBegone#k you fool!");
cm.dispose();
}
}
else if (status == 2){
cm.warp(677000000, 2);
cm.dispose();
}
}
}
+1
View File
@@ -99,6 +99,7 @@ function writeSolaxiaCommandsLv3() { //GM
comm_cursor = comm_lv3; comm_cursor = comm_lv3;
desc_cursor = desc_lv3; desc_cursor = desc_lv3;
addCommand("fly", "");
addCommand("spawn", ""); addCommand("spawn", "");
addCommand("mutemap", ""); addCommand("mutemap", "");
addCommand("checkdmg", ""); addCommand("checkdmg", "");
+3
View File
@@ -1,5 +1,8 @@
function enter(pi) { function enter(pi) {
if (pi.isQuestActive(2324)) { if (pi.isQuestActive(2324)) {
var player = pi.getPlayer();
player.gainExp(3300 * player.getExpRate());
pi.forceCompleteQuest(2324); pi.forceCompleteQuest(2324);
pi.removeAll(2430015); pi.removeAll(2430015);
pi.playerMessage(5, "Quest complete."); pi.playerMessage(5, "Quest complete.");
+18
View File
@@ -0,0 +1,18 @@
/*
Author: Kevin
Map: Mushroom Castle - Deep Inside Mushroom Forest (106020300)
Right Portal
*/
function enter(pi){
if (pi.isQuestCompleted(2316)){
if (pi.hasItem(2430014)){
pi.gainItem(2430014, -1 * pi.getPlayer().getItemQuantity(2430014, false));
}
pi.warp(106020400, 2);
return true;
}
return false;
}
+21
View File
@@ -0,0 +1,21 @@
/*
Author: Kevin
Quest: Zombie Mushroom Signal 3 (2251)
NPC: The Rememberer (1061011)
Item: Recording Charm (4032399)
*/
function end(mode, type, selection) {
if(!qm.haveItem(4032399, 20)) {
qm.sendOk("Please bring me 20 #b#t4032399##k... #i4032399#");
}
else {
qm.gainItem(4032399, -20);
qm.sendOk("Oh, you brought 20 #b#t4032399##k! Thank you.");
qm.gainExp(8000 * qm.getPlayer().getExpRate());
qm.forceCompleteQuest();
}
qm.dispose();
}
+30 -2
View File
@@ -19773,8 +19773,13 @@ USE `maplesolaxia`;
(9400300, 2290045, 1, 1, 0, 10000), (9400300, 2290045, 1, 1, 0, 10000),
(9400121, 2290081, 1, 1, 0, 10000), (9400121, 2290081, 1, 1, 0, 10000),
(9400014, 2290087, 1, 1, 0, 10000), (9400014, 2290087, 1, 1, 0, 10000),
(9400120, 2290109, 1, 1, 0, 10000); (9400120, 2290109, 1, 1, 0, 10000),
(3210100, 4001000, 1, 1, 2017, 20000),
(4300013, 4000538, 1, 1, 2288, 400000),
(2130100, 4001367, 1, 1, 28257, 10000),
(1110100, 4001369, 1, 1, 28259, 10000),
(1210101, 4001370, 1, 1, 28260, 10000),
(1110101, 4001371, 1, 1, 28261, 10000);
# (dropperid, itemid, minqty, maxqty, questid, chance) # (dropperid, itemid, minqty, maxqty, questid, chance)
# delete item drops from other mobs named Freezer # delete item drops from other mobs named Freezer
@@ -21078,6 +21083,29 @@ USE `maplesolaxia`;
(9102001, 2020002, 2, -1), (9102001, 2020002, 2, -1),
(2002018, 4161014, 1, 3099); (2002018, 4161014, 1, 3099);
# adding wish tickets on APQ boxes
INSERT INTO `reactordrops` (`reactorid`, `itemid`, `chance`, `questid`) VALUES
(6702003, 4031543, 1, -1),
(6702003, 4031544, 2, -1),
(6702004, 4031544, 1, -1),
(6702004, 4031545, 2, -1),
(6702005, 4031543, 2, -1),
(6702005, 4031545, 1, -1),
(6702006, 4031543, 1, -1),
(6702006, 4031544, 2, -1),
(6702007, 4031544, 1, -1),
(6702007, 4031545, 2, -1),
(6702008, 4031543, 2, -1),
(6702008, 4031545, 1, -1),
(6702009, 4031543, 1, -1),
(6702009, 4031544, 2, -1),
(6702010, 4031544, 1, -1),
(6702010, 4031545, 2, -1),
(6702011, 4031543, 1, -1),
(6702011, 4031545, 2, -1),
(6702012, 4031543, 2, -1),
(6702012, 4031544, 1, -1);
# updates info for all cards on monster book # updates info for all cards on monster book
DROP TABLE `monstercarddata`; DROP TABLE `monstercarddata`;
CREATE TABLE IF NOT EXISTS `monstercarddata` ( CREATE TABLE IF NOT EXISTS `monstercarddata` (
+61
View File
@@ -223,3 +223,64 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
(1337, 2340000, 1, 82), (1337, 2340000, 1, 82),
(1337, 2040807, 1, 83), (1337, 2040807, 1, 83),
(1337, 2210032, 1, 84); (1337, 2210032, 1, 84);
# Thanks to DietStory dev team
INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
(1200001, 3010001, 1000, 0, 1),
(1200001, 1092003, 2000, 0, 2),
(1200001, 1072063, 10000, 0, 3),
(1200001, 1072062, 10000, 0, 4),
(1200001, 1072017, 10000, 0, 5).
(1200001, 1072049, 5000, 0, 6),
(1200001, 1072048, 5000, 0, 7),
(1200001, 1072008, 5000, 0, 8),
(1200001, 1072005, 50, 0, 9),
(1200001, 1072038, 50, 0, 10),
(1200001, 1072037, 50, 0, 11),
(1200001, 1072001, 50, 0, 12),
(1200001, 1062001, 4800, 0, 13),
(1200001, 1062000, 4800, 0, 14),
(1200001, 1060004, 2800, 0, 15),
(1200001, 1060007, 1000, 0, 16),
(1200001, 1041012, 3000, 0, 17),
(1200001, 1041004, 3000, 0, 18),
(1200001, 1040014, 3000, 0, 19),
(1200001, 1040013, 3000, 0, 20),
(1200001, 1002001, 3000, 0, 21),
(1200001, 1002019, 2000, 0, 22),
(1200001, 1002134, 800, 0, 23),
(1200001, 1002133, 800, 0, 24),
(1200001, 1002132, 800, 0, 25),
(1200001, 1002069, 450, 0, 26),
(1200001, 1002068, 450, 0, 27),
(1200001, 1002067, 450, 0, 28),
(1200001, 1002066, 450, 0, 29),
(1200001, 1002014, 1000, 0, 30),
(1200001, 1002008, 500, 0, 31),
(1200001, 1332007, 1000, 0, 32),
(1200001, 1312000, 3000, 0, 33),
(1200001, 1302007, 3000, 0, 34),
(1200001, 1322005, 50, 0, 35),
(1200001, 1312004, 50, 0, 36),
(1200001, 1302000, 50, 0, 37),
(1203590, 2330000, 600, 0, 104),
(1203590, 2070000, 500, 0, 108),
(1203590, 2061000, 1, 0, 120),
(1203590, 2060000, 1, 0, 124),
(1203590, 2030000, 400, 0, 132),
(1203590, 2020028, 3000, 0, 136),
(1203590, 2010004, 310, 0, 140),
(1203590, 2010003, 100, 0, 144),
(1203590, 2010001, 106, 0, 148),
(1203590, 2010002, 50, 0, 152),
(1203590, 2010000, 30, 0, 156),
(1203590, 2002005, 500, 0, 160),
(1203590, 2002004, 500, 0, 164),
(1203590, 2002002, 500, 0, 168),
(1203590, 2002001, 400, 0, 172),
(1203590, 2002000, 500, 0, 176),
(1203590, 2000006, 620, 0, 180),
(1203590, 2000003, 200, 0, 184),
(1203590, 2000002, 320, 0, 188),
(1203590, 2000001, 160, 0, 192),
(1203590, 2000000, 50, 0, 196);
+49 -29
View File
@@ -84,7 +84,7 @@ import server.events.gm.MapleOla;
import server.life.MapleMonster; import server.life.MapleMonster;
import server.life.MobSkill; import server.life.MobSkill;
import server.maps.AbstractAnimatedMapleMapObject; import server.maps.AbstractAnimatedMapleMapObject;
import server.maps.HiredMerchant; import server.maps.MapleHiredMerchant;
import server.maps.MapleDoor; import server.maps.MapleDoor;
import server.maps.MapleDragon; import server.maps.MapleDragon;
import server.maps.MapleMap; import server.maps.MapleMap;
@@ -152,6 +152,7 @@ import server.maps.MapleMapItem;
public class MapleCharacter extends AbstractAnimatedMapleMapObject { public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private static NumberFormat nf = new DecimalFormat("#,###,###,###"); private static NumberFormat nf = new DecimalFormat("#,###,###,###");
private static MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
private static final String LEVEL_200 = "[Congrats] %s has reached Level 200! Congratulate %s on such an amazing achievement!"; private static final String LEVEL_200 = "[Congrats] %s has reached Level 200! Congratulate %s on such an amazing achievement!";
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "help", "helper", "alert", "notice", "maplestory", "Solaxia", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay", private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "help", "helper", "alert", "notice", "maplestory", "Solaxia", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
"nigger", "homo", "suck", "cum", "shit", "shitty", "condom", "security", "official", "rape", "nigga", "sex", "tit", "boner", "orgy", "clit", "asshole", "fatass", "bitch", "support", "gamemaster", "cock", "gaay", "gm", "nigger", "homo", "suck", "cum", "shit", "shitty", "condom", "security", "official", "rape", "nigga", "sex", "tit", "boner", "orgy", "clit", "asshole", "fatass", "bitch", "support", "gamemaster", "cock", "gaay", "gm",
@@ -190,6 +191,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private int warpToId; private int warpToId;
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1; private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses; private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
private int owlSearch;
private int married; private int married;
private long lastfametime, lastUsedCashItem, lastHealed, lastMesoDrop = -1, jailExpiration = -1; private long lastfametime, lastUsedCashItem, lastHealed, lastMesoDrop = -1, jailExpiration = -1;
private transient int localmaxhp, localmaxmp, localstr, localdex, localluk, localint_, magic, watk; private transient int localmaxhp, localmaxmp, localstr, localdex, localluk, localint_, magic, watk;
@@ -208,7 +210,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private int merchantmeso; private int merchantmeso;
private BuddyList buddylist; private BuddyList buddylist;
private EventInstanceManager eventInstance = null; private EventInstanceManager eventInstance = null;
private HiredMerchant hiredMerchant = null; private MapleHiredMerchant hiredMerchant = null;
private MapleClient client; private MapleClient client;
private MapleGuildCharacter mgc = null; private MapleGuildCharacter mgc = null;
private MaplePartyCharacter mpc = null; private MaplePartyCharacter mpc = null;
@@ -428,6 +430,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
npcCd = d; npcCd = d;
} }
public void setOwlSearch(int id) {
owlSearch = id;
}
public int getOwlSearch() {
return owlSearch;
}
public void addCooldown(int skillId, long startTime, long length) { public void addCooldown(int skillId, long startTime, long length) {
effLock.lock(); effLock.lock();
chrLock.lock(); chrLock.lock();
@@ -699,7 +709,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
int maxbasedamage; int maxbasedamage;
Item weapon_item = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11); Item weapon_item = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
if (weapon_item != null) { if (weapon_item != null) {
MapleWeaponType weapon = MapleItemInformationProvider.getInstance().getWeaponType(weapon_item.getItemId()); MapleWeaponType weapon = ii.getWeaponType(weapon_item.getItemId());
int mainstat, secondarystat; int mainstat, secondarystat;
if (getJob().isA(MapleJob.THIEF) && weapon == MapleWeaponType.DAGGER_OTHER) { if (getJob().isA(MapleJob.THIEF) && weapon == MapleWeaponType.DAGGER_OTHER) {
weapon = MapleWeaponType.DAGGER_THIEVES; weapon = MapleWeaponType.DAGGER_THIEVES;
@@ -787,7 +797,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
String medal = ""; String medal = "";
final Item medalItem = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -49); final Item medalItem = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -49);
if (medalItem != null) { if (medalItem != null) {
medal = "<" + MapleItemInformationProvider.getInstance().getName(medalItem.getItemId()) + "> "; medal = "<" + ii.getName(medalItem.getItemId()) + "> ";
} }
return medal; return medal;
} }
@@ -1342,7 +1352,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private static boolean useItem(final MapleClient c, final int id) { private static boolean useItem(final MapleClient c, final int id) {
if (id / 1000000 == 2) { if (id / 1000000 == 2) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
if (ii.isConsumeOnPickup(id)) { if (ii.isConsumeOnPickup(id)) {
if (ItemConstants.isPartyItem(id)) { if (ItemConstants.isPartyItem(id)) {
List<MapleCharacter> pchr = c.getPlayer().getPartyMembersOnSameMap(); List<MapleCharacter> pchr = c.getPlayer().getPartyMembersOnSameMap();
@@ -1396,7 +1405,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
final byte[] pickupPacket = MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), (isPet) ? 5 : 2, this.getId(), isPet, petIndex); final byte[] pickupPacket = MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), (isPet) ? 5 : 2, this.getId(), isPet, petIndex);
boolean hasSpaceInventory = true; boolean hasSpaceInventory = true;
if (mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866 || mapitem.getMeso() > 0 || MapleItemInformationProvider.getInstance().isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = MapleInventoryManipulator.checkSpace(client, mapitem.getItemId(), mapitem.getItem().getQuantity(), mapitem.getItem().getOwner()))) { if (mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866 || mapitem.getMeso() > 0 || ii.isConsumeOnPickup(mapitem.getItemId()) || (hasSpaceInventory = MapleInventoryManipulator.checkSpace(client, mapitem.getItemId(), mapitem.getItem().getQuantity(), mapitem.getItem().getOwner()))) {
if ((this.getMapId() > 209000000 && this.getMapId() < 209000016) || (this.getMapId() >= 990000500 && this.getMapId() <= 990000502)) {//happyville trees and guild PQ if ((this.getMapId() > 209000000 && this.getMapId() < 209000016) || (this.getMapId() >= 990000500 && this.getMapId() <= 990000502)) {//happyville trees and guild PQ
if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) { if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) {
if(mapitem.getMeso() > 0) { if(mapitem.getMeso() > 0) {
@@ -1460,7 +1469,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
this.gainMeso(mapitem.getMeso(), true, true, false); this.gainMeso(mapitem.getMeso(), true, true, false);
} }
} else if (mapitem.getItem().getItemId() / 10000 == 243) { } else if (mapitem.getItem().getItemId() / 10000 == 243) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
MapleItemInformationProvider.scriptedItem info = ii.getScriptedItemInfo(mapitem.getItem().getItemId()); MapleItemInformationProvider.scriptedItem info = ii.getScriptedItemInfo(mapitem.getItem().getItemId());
if (info.runOnPickup()) { if (info.runOnPickup()) {
ItemScriptManager ism = ItemScriptManager.getInstance(); ItemScriptManager ism = ItemScriptManager.getInstance();
@@ -1504,7 +1512,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public int countItem(int itemid) { public int countItem(int itemid) {
return inventory[MapleItemInformationProvider.getInstance().getInventoryType(itemid).ordinal()].countById(itemid); return inventory[ii.getInventoryType(itemid).ordinal()].countById(itemid);
} }
public boolean canHold(int itemid) { public boolean canHold(int itemid) {
@@ -1512,12 +1520,14 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public boolean canHold(int itemid, int quantity) { public boolean canHold(int itemid, int quantity) {
if(haveItem(itemid)) { int hold = getCleanItemQuantity(itemid, false);
if(getItemQuantity(itemid, false) + quantity <= MapleItemInformationProvider.getInstance().getSlotMax(client, itemid))
if(hold > 0) {
if(hold + quantity <= ii.getSlotMax(client, itemid))
return true; return true;
} }
return getInventory(MapleItemInformationProvider.getInstance().getInventoryType(itemid)).getNextFreeSlot() > -1; return getInventory(ii.getInventoryType(itemid)).getNextFreeSlot() > -1;
} }
public void decreaseBattleshipHp(int decrease) { public void decreaseBattleshipHp(int decrease) {
@@ -2824,7 +2834,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public void cancelEffect(int itemId) { public void cancelEffect(int itemId) {
cancelEffect(MapleItemInformationProvider.getInstance().getItemEffect(itemId), false, -1); cancelEffect(ii.getItemEffect(itemId), false, -1);
} }
public void cancelEffect(MapleStatEffect effect, boolean overwrite, long startTime) { public void cancelEffect(MapleStatEffect effect, boolean overwrite, long startTime) {
@@ -3534,7 +3544,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
return hair; return hair;
} }
public HiredMerchant getHiredMerchant() { public MapleHiredMerchant getHiredMerchant() {
return hiredMerchant; return hiredMerchant;
} }
@@ -3640,13 +3650,21 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public int getItemQuantity(int itemid, boolean checkEquipped) { public int getItemQuantity(int itemid, boolean checkEquipped) {
int possesed = inventory[MapleItemInformationProvider.getInstance().getInventoryType(itemid).ordinal()].countById(itemid); int possesed = inventory[ii.getInventoryType(itemid).ordinal()].countById(itemid);
if (checkEquipped) { if (checkEquipped) {
possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid); possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
} }
return possesed; return possesed;
} }
public int getCleanItemQuantity(int itemid, boolean checkEquipped) {
int possesed = inventory[ii.getInventoryType(itemid).ordinal()].countCleanById(itemid);
if (checkEquipped) {
possesed += inventory[MapleInventoryType.EQUIPPED.ordinal()].countCleanById(itemid);
}
return possesed;
}
public MapleJob getJob() { public MapleJob getJob() {
return job; return job;
} }
@@ -3967,6 +3985,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if(mps == null) return; if(mps == null) return;
if (mps.isOwner(this)) { if (mps.isOwner(this)) {
mps.setOpen(false);
client.getWorldServer().unregisterPlayerShop(mps);
for (MaplePlayerShopItem mpsi : mps.getItems()) { for (MaplePlayerShopItem mpsi : mps.getItems()) {
if (mpsi.getBundles() >= 2) { if (mpsi.getBundles() >= 2) {
Item iItem = mpsi.getItem().copy(); Item iItem = mpsi.getItem().copy();
@@ -3976,8 +3997,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
MapleInventoryManipulator.addFromDrop(this.getClient(), mpsi.getItem(), true); MapleInventoryManipulator.addFromDrop(this.getClient(), mpsi.getItem(), true);
} }
} }
this.getMap().broadcastMessage(MaplePacketCreator.removeCharBox(this)); mps.closeShop();
mps.removeVisitors();
} else { } else {
mps.removeVisitor(this); mps.removeVisitor(this);
} }
@@ -3998,7 +4018,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public void closeHiredMerchant(boolean closeMerchant) { public void closeHiredMerchant(boolean closeMerchant) {
HiredMerchant merchant = this.getHiredMerchant(); MapleHiredMerchant merchant = this.getHiredMerchant();
if(merchant == null) return; if(merchant == null) return;
if(closeMerchant) { if(closeMerchant) {
@@ -4488,8 +4508,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
return getItemQuantity(itemid, false) > 0; return getItemQuantity(itemid, false) > 0;
} }
public boolean haveCleanItem(int itemid) {
return getCleanItemQuantity(itemid, false) > 0;
}
public boolean hasEmptySlot(int itemId) { public boolean hasEmptySlot(int itemId) {
return getInventory(MapleItemInformationProvider.getInstance().getInventoryType(itemId)).getNextFreeSlot() > -1; return getInventory(ii.getInventoryType(itemId)).getNextFreeSlot() > -1;
} }
public boolean hasEmptySlot(byte invType) { public boolean hasEmptySlot(byte invType) {
@@ -4983,7 +5007,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private void commitBuffCoupon(int couponid) { private void commitBuffCoupon(int couponid) {
if(!isLoggedin() || getCashShop().isOpened()) return; if(!isLoggedin() || getCashShop().isOpened()) return;
MapleStatEffect mse = MapleItemInformationProvider.getInstance().getItemEffect(couponid); MapleStatEffect mse = ii.getItemEffect(couponid);
mse.applyTo(this); mse.applyTo(this);
} }
@@ -5536,7 +5560,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
if (possesed > 0) { if (possesed > 0) {
message("You have used a safety charm, so your EXP points have not been decreased."); message("You have used a safety charm, so your EXP points have not been decreased.");
MapleInventoryManipulator.removeById(client, MapleItemInformationProvider.getInstance().getInventoryType(charmID[i]), charmID[i], 1, true, false); MapleInventoryManipulator.removeById(client, ii.getInventoryType(charmID[i]), charmID[i], 1, true, false);
} else if (mapid > 925020000 && mapid < 925030000) { } else if (mapid > 925020000 && mapid < 925030000) {
this.dojoStage = 0; this.dojoStage = 0;
} else if (mapid > 980000100 && mapid < 980000700) { } else if (mapid > 980000100 && mapid < 980000700) {
@@ -5686,7 +5710,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.PIRATE) || job.isA(MapleJob.NIGHTWALKER1) || job.isA(MapleJob.WINDARCHER1)) { if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.PIRATE) || job.isA(MapleJob.NIGHTWALKER1) || job.isA(MapleJob.WINDARCHER1)) {
Item weapon_item = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11); Item weapon_item = getInventory(MapleInventoryType.EQUIPPED).getItem((short) -11);
if (weapon_item != null) { if (weapon_item != null) {
MapleWeaponType weapon = MapleItemInformationProvider.getInstance().getWeaponType(weapon_item.getItemId()); MapleWeaponType weapon = ii.getWeaponType(weapon_item.getItemId());
boolean bow = weapon == MapleWeaponType.BOW; boolean bow = weapon == MapleWeaponType.BOW;
boolean crossbow = weapon == MapleWeaponType.CROSSBOW; boolean crossbow = weapon == MapleWeaponType.CROSSBOW;
boolean claw = weapon == MapleWeaponType.CLAW; boolean claw = weapon == MapleWeaponType.CLAW;
@@ -5700,7 +5724,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if ((claw && ItemConstants.isThrowingStar(item.getItemId())) || (gun && ItemConstants.isBullet(item.getItemId())) || (bow && ItemConstants.isArrowForBow(item.getItemId())) || (crossbow && ItemConstants.isArrowForCrossBow(item.getItemId()))) { if ((claw && ItemConstants.isThrowingStar(item.getItemId())) || (gun && ItemConstants.isBullet(item.getItemId())) || (bow && ItemConstants.isArrowForBow(item.getItemId())) || (crossbow && ItemConstants.isArrowForCrossBow(item.getItemId()))) {
if (item.getQuantity() > 0) { if (item.getQuantity() > 0) {
// Finally there! // Finally there!
watk += MapleItemInformationProvider.getInstance().getWatkForProjectile(item.getItemId()); watk += ii.getWatkForProjectile(item.getItemId());
break; break;
} }
} }
@@ -6543,7 +6567,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
try { try {
newAmount = (int)Math.min((long)merchantmeso + add, Integer.MAX_VALUE); newAmount = (int)Math.min((long)merchantmeso + add, Integer.MAX_VALUE);
System.out.println("adding" + add + " now" + newAmount);
Connection con = DatabaseConnection.getConnection(); Connection con = DatabaseConnection.getConnection();
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET MerchantMesos = ? WHERE id = ?", Statement.RETURN_GENERATED_KEYS)) { try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET MerchantMesos = ? WHERE id = ?", Statement.RETURN_GENERATED_KEYS)) {
@@ -6576,7 +6599,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
merchantmeso = set; merchantmeso = set;
} }
public void setHiredMerchant(HiredMerchant merchant) { public void setHiredMerchant(MapleHiredMerchant merchant) {
this.hiredMerchant = merchant; this.hiredMerchant = merchant;
} }
@@ -6822,7 +6845,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public int sellAllItemsFromName(byte invTypeId, String name) { public int sellAllItemsFromName(byte invTypeId, String name) {
//player decides from which inventory items should be sold. //player decides from which inventory items should be sold.
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
MapleInventoryType type = MapleInventoryType.getByType(invTypeId); MapleInventoryType type = MapleInventoryType.getByType(invTypeId);
Item it = getInventory(type).findByName(name); Item it = getInventory(type).findByName(name);
@@ -7539,10 +7561,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void increaseEquipExp(int expGain) { public void increaseEquipExp(int expGain) {
if(expGain < 0) expGain = Integer.MAX_VALUE; if(expGain < 0) expGain = Integer.MAX_VALUE;
MapleItemInformationProvider mii = MapleItemInformationProvider.getInstance();
for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) { for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) {
Equip nEquip = (Equip) item; Equip nEquip = (Equip) item;
String itemName = mii.getName(nEquip.getItemId()); String itemName = ii.getName(nEquip.getItemId());
if (itemName == null) { if (itemName == null) {
continue; continue;
} }
@@ -7554,12 +7575,11 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
} }
public void showAllEquipFeatures() { public void showAllEquipFeatures() {
MapleItemInformationProvider mii = MapleItemInformationProvider.getInstance();
String showMsg = ""; String showMsg = "";
for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) { for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) {
Equip nEquip = (Equip) item; Equip nEquip = (Equip) item;
String itemName = mii.getName(nEquip.getItemId()); String itemName = ii.getName(nEquip.getItemId());
if (itemName == null) { if (itemName == null) {
continue; continue;
} }
+1 -3
View File
@@ -68,8 +68,6 @@ import scripting.npc.NPCConversationManager;
import scripting.npc.NPCScriptManager; import scripting.npc.NPCScriptManager;
import scripting.quest.QuestActionManager; import scripting.quest.QuestActionManager;
import scripting.quest.QuestScriptManager; import scripting.quest.QuestScriptManager;
import server.MapleMiniGame;
import server.MaplePlayerShop;
import server.life.MapleMonster; import server.life.MapleMonster;
import server.MapleTrade; import server.MapleTrade;
import server.TimerManager; import server.TimerManager;
@@ -1298,7 +1296,7 @@ public class MapleClient {
MapleTrade.cancelTrade(getPlayer()); MapleTrade.cancelTrade(getPlayer());
} }
HiredMerchant merchant = player.getHiredMerchant(); MapleHiredMerchant merchant = player.getHiredMerchant();
if (merchant != null) { if (merchant != null) {
if (merchant.isOwner(getPlayer())) { if (merchant.isOwner(getPlayer())) {
merchant.setOpen(true); merchant.setOpen(true);
+33 -1
View File
@@ -1414,6 +1414,30 @@ public class Commands {
MapleCharacter victim; MapleCharacter victim;
switch(sub[0]) { switch(sub[0]) {
case "fly":
if (sub.length < 2) {
player.yellowMessage("Syntax: !fly <on/off>");
break;
}
Integer accid = c.getAccID();
String sendStr = "";
if(sub[1].equalsIgnoreCase("on")) {
sendStr += "GM Fly feature enabled. With fly active, GM's cannot attack.";
if(!srv.canFly(accid)) sendStr += " Re-login to take effect.";
srv.changeFly(c.getAccID(), true);
} else {
player.dropMessage(6, "GM Fly feature disabled. GM's can now attack.");
if(srv.canFly(accid)) sendStr += " Re-login to take effect.";
srv.changeFly(c.getAccID(), false);
}
player.dropMessage(6, sendStr);
break;
case "spawn": case "spawn":
if (sub.length < 2) { if (sub.length < 2) {
player.yellowMessage("Syntax: !spawn <mobid>"); player.yellowMessage("Syntax: !spawn <mobid>");
@@ -1592,7 +1616,7 @@ public class Commands {
Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(5, message_)); Server.getInstance().broadcastGMMessage(MaplePacketCreator.serverNotice(5, message_));
break; break;
case "ignored": case "ignored":
for (String ign : MapleLogger.ignored){ for (String ign : MapleLogger.ignored){
player.yellowMessage(ign + " is being ignored."); player.yellowMessage(ign + " is being ignored.");
} }
@@ -2552,6 +2576,14 @@ public class Commands {
player.dropMessage(5, "Quest Cache for quest " + sub[1] + " cleared."); player.dropMessage(5, "Quest Cache for quest " + sub[1] + " cleared.");
break; break;
case "fred":
c.announce(MaplePacketCreator.fredrickMessage(Byte.valueOf(sub[1])));
break;
case "owl":
c.announce(MaplePacketCreator.getOwlMessage(Integer.valueOf(sub[1])));
break;
default: default:
return false; return false;
} }
+16
View File
@@ -128,6 +128,16 @@ public class MapleInventory implements Iterable<Item> {
return qty; return qty;
} }
public int countCleanById(int itemId) {
int qty = 0;
for (Item item : list()) {
if (item.getItemId() == itemId && item.getOwner().equals("")) {
qty += item.getQuantity();
}
}
return qty;
}
public int freeSlotCountById(int itemId, int required) { public int freeSlotCountById(int itemId, int required) {
List<Item> itemList = listById(itemId); List<Item> itemList = listById(itemId);
int openSlot = 0; int openSlot = 0;
@@ -297,6 +307,7 @@ public class MapleInventory implements Iterable<Item> {
public boolean isFull(int margin) { public boolean isFull(int margin) {
lock.lock(); lock.lock();
try { try {
//System.out.print("(" + inventory.size() + " " + margin + " <> " + slotLimit + ")");
return inventory.size() + margin >= slotLimit; return inventory.size() + margin >= slotLimit;
} finally { } finally {
lock.unlock(); lock.unlock();
@@ -306,6 +317,7 @@ public class MapleInventory implements Iterable<Item> {
public boolean isFullAfterSomeItems(int margin, int used) { public boolean isFullAfterSomeItems(int margin, int used) {
lock.lock(); lock.lock();
try { try {
//System.out.print("(" + inventory.size() + " " + margin + " <> " + slotLimit + " -" + used + ")");
return inventory.size() + margin >= slotLimit - used; return inventory.size() + margin >= slotLimit - used;
} finally { } finally {
lock.unlock(); lock.unlock();
@@ -445,8 +457,12 @@ public class MapleInventory implements Iterable<Item> {
int usedSlots = typesSlotsUsed.get(itemType); int usedSlots = typesSlotsUsed.get(itemType);
Long itemId = 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); int result = MapleInventoryManipulator.checkSpaceProgressively(c, itemId.intValue(), it.getValue(), rcvOwners.get(it.getKey()), usedSlots);
boolean hasSpace = ((result % 2) != 0); boolean hasSpace = ((result % 2) != 0);
//System.out.print(" -> hasSpace: " + hasSpace + " RESULT : " + result + "\n");
if(!hasSpace) return false; if(!hasSpace) return false;
typesSlotsUsed.set(itemType, (result >> 1)); typesSlotsUsed.set(itemType, (result >> 1));
+23
View File
@@ -2,11 +2,17 @@ package constants;
import client.MapleJob; import client.MapleJob;
import constants.skills.Aran; import constants.skills.Aran;
import server.maps.MapleMap;
import server.maps.FieldLimit;
/* /*
* @author kevintjuh93 * @author kevintjuh93
* @author Ronan
*/ */
public class GameConstants { public class GameConstants {
//public static final int[] OWL_DATA = {2000014, 2000015, 2000016};
public static final int[] OWL_DATA = new int[]{1082002, 2070005, 2070006, 1022047, 1102041, 2044705, 2340000, 2040017, 1092030, 2040804};
// Ronan's rates upgrade system // Ronan's rates upgrade system
private static final int[] DROP_RATE_GAIN = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; private static final int[] DROP_RATE_GAIN = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
private static final int[] MESO_RATE_GAIN = {1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105}; private static final int[] MESO_RATE_GAIN = {1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105};
@@ -137,6 +143,23 @@ public class GameConstants {
return skill >= 9001000 && skill <= 9101008 || skill >= 8001000 && skill <= 8001001; return skill >= 9001000 && skill <= 9101008 || skill >= 8001000 && skill <= 8001001;
} }
public static boolean isFreeMarketRoom(int mapid) {
return mapid > 910000000 && mapid < 910000023;
}
public static boolean isMerchantLocked(MapleMap map) {
if(FieldLimit.CANNOTMIGRATE.check(map.getFieldLimit())) { // maps that cannot access cash shop cannot access merchants too (except FM rooms).
return true;
}
switch(map.getId()) {
case 910000000:
return true;
}
return false;
}
public static boolean isBossRush(int mapid) { public static boolean isBossRush(int mapid) {
return mapid >= 970030100 && mapid <= 970042711; return mapid >= 970030100 && mapid <= 970042711;
} }
+1 -1
View File
@@ -43,13 +43,13 @@ public class ServerConstants {
public static final boolean USE_ITEM_SORT = true; public static final boolean USE_ITEM_SORT = true;
public static final boolean USE_ITEM_SORT_BY_NAME = false; //Item sorting based on name rather than id. public static final boolean USE_ITEM_SORT_BY_NAME = false; //Item sorting based on name rather than id.
public static final boolean USE_PARTY_SEARCH = false; public static final boolean USE_PARTY_SEARCH = false;
public static final boolean USE_MERCHANT_ANYWHERE = true; //Enables player shops and hired merchants outside FM rooms (except FM entrance).
public static final boolean USE_AUTOBAN = false; //Commands the server to detect infractors automatically. public static final boolean USE_AUTOBAN = false; //Commands the server to detect infractors automatically.
public static final boolean USE_AUTOSAVE = true; //Enables server autosaving feature (saves characters to DB each 1 hour). public static final boolean USE_AUTOSAVE = true; //Enables server autosaving feature (saves characters to DB each 1 hour).
public static final boolean USE_SERVER_AUTOASSIGNER = true; //Server-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments. public static final boolean USE_SERVER_AUTOASSIGNER = true; //Server-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments.
public static final boolean USE_REFRESH_RANK_MOVE = true; public static final boolean USE_REFRESH_RANK_MOVE = true;
public static final boolean USE_ENFORCE_UNMERCHABLE_PET = true; //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_UNMERCHABLE_PET = true; //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_MDOOR_POSITION = true; //Forces mystic door to be spawned near spawnpoints. (since things bugs out other way, and this helps players to locate the door faster) public static final boolean USE_ENFORCE_MDOOR_POSITION = true; //Forces mystic door to be spawned near spawnpoints. (since things bugs out other way, and this helps players to locate the door faster)
public static final boolean USE_ERASE_PERMIT_ON_OPENSHOP = true;//Forces "shop permit" item to be consumed when player deploy his/her player shop.
public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped. public static final boolean USE_ERASE_UNTRADEABLE_DROP = true; //Forces flagged untradeable items to disappear when dropped.
public static final boolean USE_ERASE_PET_ON_EXPIRATION = false;//Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll. public static final boolean USE_ERASE_PET_ON_EXPIRATION = false;//Forces pets to be removed from inventory when expire time comes, rather than converting it to a doll.
public static final boolean USE_BUFF_MOST_SIGNIFICANT = true; //When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats. public static final boolean USE_BUFF_MOST_SIGNIFICANT = true; //When applying buffs, the player will stick with the highest stat boost among the listed, rather than overwriting stats.
+4 -2
View File
@@ -147,7 +147,7 @@ public final class PacketProcessor {
registerHandler(RecvOpcode.USE_ITEM, new UseItemHandler()); registerHandler(RecvOpcode.USE_ITEM, new UseItemHandler());
registerHandler(RecvOpcode.USE_RETURN_SCROLL, new UseItemHandler()); registerHandler(RecvOpcode.USE_RETURN_SCROLL, new UseItemHandler());
registerHandler(RecvOpcode.USE_UPGRADE_SCROLL, new ScrollHandler()); registerHandler(RecvOpcode.USE_UPGRADE_SCROLL, new ScrollHandler());
registerHandler(RecvOpcode.USE_SUMMON_BAG, new UseSummonBag()); registerHandler(RecvOpcode.USE_SUMMON_BAG, new UseSummonBagHandler());
registerHandler(RecvOpcode.FACE_EXPRESSION, new FaceExpressionHandler()); registerHandler(RecvOpcode.FACE_EXPRESSION, new FaceExpressionHandler());
registerHandler(RecvOpcode.HEAL_OVER_TIME, new HealOvertimeHandler()); registerHandler(RecvOpcode.HEAL_OVER_TIME, new HealOvertimeHandler());
registerHandler(RecvOpcode.ITEM_PICKUP, new ItemPickupHandler()); registerHandler(RecvOpcode.ITEM_PICKUP, new ItemPickupHandler());
@@ -182,7 +182,7 @@ public final class PacketProcessor {
registerHandler(RecvOpcode.BBS_OPERATION, new BBSOperationHandler()); registerHandler(RecvOpcode.BBS_OPERATION, new BBSOperationHandler());
registerHandler(RecvOpcode.SKILL_EFFECT, new SkillEffectHandler()); registerHandler(RecvOpcode.SKILL_EFFECT, new SkillEffectHandler());
registerHandler(RecvOpcode.MESSENGER, new MessengerHandler()); registerHandler(RecvOpcode.MESSENGER, new MessengerHandler());
registerHandler(RecvOpcode.NPC_ACTION, new NPCAnimation()); registerHandler(RecvOpcode.NPC_ACTION, new NPCAnimationHandler());
registerHandler(RecvOpcode.CHECK_CASH, new TouchingCashShopHandler()); registerHandler(RecvOpcode.CHECK_CASH, new TouchingCashShopHandler());
registerHandler(RecvOpcode.CASHSHOP_OPERATION, new CashOperationHandler()); registerHandler(RecvOpcode.CASHSHOP_OPERATION, new CashOperationHandler());
registerHandler(RecvOpcode.COUPON_CODE, new CouponCodeHandler()); registerHandler(RecvOpcode.COUPON_CODE, new CouponCodeHandler());
@@ -205,6 +205,8 @@ public final class PacketProcessor {
registerHandler(RecvOpcode.SPOUSE_CHAT, new SpouseChatHandler()); registerHandler(RecvOpcode.SPOUSE_CHAT, new SpouseChatHandler());
registerHandler(RecvOpcode.PET_AUTO_POT, new PetAutoPotHandler()); registerHandler(RecvOpcode.PET_AUTO_POT, new PetAutoPotHandler());
registerHandler(RecvOpcode.PET_EXCLUDE_ITEMS, new PetExcludeItemsHandler()); registerHandler(RecvOpcode.PET_EXCLUDE_ITEMS, new PetExcludeItemsHandler());
registerHandler(RecvOpcode.OWL_ACTION, new UseOwlOfMinervaHandler());
registerHandler(RecvOpcode.OWL_WARP, new OwlWarpHandler());
registerHandler(RecvOpcode.TOUCH_MONSTER_ATTACK, new TouchMonsterDamageHandler()); registerHandler(RecvOpcode.TOUCH_MONSTER_ATTACK, new TouchMonsterDamageHandler());
registerHandler(RecvOpcode.TROCK_ADD_MAP, new TrockAddMapHandler()); registerHandler(RecvOpcode.TROCK_ADD_MAP, new TrockAddMapHandler());
registerHandler(RecvOpcode.HIRED_MERCHANT_REQUEST, new HiredMerchantRequest()); registerHandler(RecvOpcode.HIRED_MERCHANT_REQUEST, new HiredMerchantRequest());
+4 -2
View File
@@ -76,7 +76,9 @@ public enum RecvOpcode {
HIRED_MERCHANT_REQUEST(0x3F), HIRED_MERCHANT_REQUEST(0x3F),
FREDRICK_ACTION(0x40), FREDRICK_ACTION(0x40),
DUEY_ACTION(0x41), DUEY_ACTION(0x41),
ADMIN_SHOP(0x44),//oh lol OWL_ACTION(0x42), //sends most searched info to client
OWL_WARP(0x43), //handles player warp to store
ADMIN_SHOP(0x44),
ITEM_SORT(0x45), ITEM_SORT(0x45),
ITEM_SORT2(0x46), ITEM_SORT2(0x46),
ITEM_MOVE(0x47), ITEM_MOVE(0x47),
@@ -87,7 +89,7 @@ public enum RecvOpcode {
USE_MOUNT_FOOD(0x4D), USE_MOUNT_FOOD(0x4D),
SCRIPTED_ITEM(0x4E), SCRIPTED_ITEM(0x4E),
USE_CASH_ITEM(0x4F), USE_CASH_ITEM(0x4F),
//USE_OWL_ITEM(0x50), ... no idea
USE_CATCH_ITEM(0x51), USE_CATCH_ITEM(0x51),
USE_SKILL_BOOK(0x52), USE_SKILL_BOOK(0x52),
USE_TELEPORT_ROCK(0x54), USE_TELEPORT_ROCK(0x54),
+13
View File
@@ -71,6 +71,7 @@ import java.util.Calendar;
import server.quest.MapleQuest; import server.quest.MapleQuest;
public class Server implements Runnable { public class Server implements Runnable {
private static final Set<Integer> activeFly = new HashSet<>();
private static final Map<Integer, Integer> couponRates = new LinkedHashMap<>(); private static final Map<Integer, Integer> couponRates = new LinkedHashMap<>();
private static final List<Integer> activeCoupons = new LinkedList<>(); private static final List<Integer> activeCoupons = new LinkedList<>();
@@ -699,6 +700,18 @@ public class Server implements Runnable {
return false; return false;
} }
public void changeFly(Integer accountid, boolean canFly) {
if(canFly) {
activeFly.add(accountid);
} else {
activeFly.remove(accountid);
}
}
public boolean canFly(Integer accountid) {
return activeFly.contains(accountid);
}
public World getWorld(int id) { public World getWorld(int id) {
return worlds.get(id); return worlds.get(id);
} }

Some files were not shown because too many files have changed in this diff Show More