Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
Antibanish mechanics + Limited drops on map + SQL tidy-up
Browse files Browse the repository at this point in the history
Added antibanish mechanics: as like other "diseases" that can be treated
with some useable items, banish will be able to be recovered as well.
Fixed some SQL issues introduced on the last commit, as well as
lingering inexistent ids on drop data. Fixed some concurrency issues
with MapleMapFactory. Set a ceiling for simultaneous items available per
map, where old ones are promptly discarded. Patched MWLB attack block
for higher level GMs.
  • Loading branch information
ronancpl committed Aug 5, 2017
1 parent 0a2e382 commit f78defe
Show file tree
Hide file tree
Showing 112 changed files with 441 additions and 112 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Credits are to be given too to Nexon(Duh!), the original MapleSolaxia staff and

Regarding distributability and usage of the code presented here: like it was before, this MapleStory server is open-source. By that, it is meant that anyone is free to install, use, modify and redistribute the contents, as long as there is no kind of commercial trading involved and the credits to the original creators are maintained within the codes.

This is a NetBeans 8.0.2 Project, that must be built and run under JDK/JRE 7 in order to run properly. This means that it's easier to install the project via opening the server project folder inside NetBeans' IDE. Once installed, build this project on your machine and run the server using the "launch.bat" application.
This is a NetBeans 8.0.2 Project, that MUST be built and run under JDK/JRE 7 in order to run properly. This means that it's easier to install the project via opening the server project folder inside NetBeans' IDE. Once installed, build this project on your machine and run the server using the "launch.bat" application.

In this project, many gameplay-wise issues generated from either the original WZ files and the server sources have been partially or completely solved. Considering the use of the provided edited WZ's and server-side wz.xml files should be of the greatest importance when dealing with this instance of private server, in order to perceive it at it's full potential. My opinion, though! Refer to "README_wzchanges.txt" for more information on what have been changed from Nexon's v83 WZ files.

Expand Down
2 changes: 1 addition & 1 deletion build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu, 03 Aug 2017 23:09:50 -0300
#Sat, 05 Aug 2017 19:11:00 -0300


C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
Binary file modified build/classes/client/MapleCharacter$1.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$10.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$11.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$12.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$13.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$14.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$15.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$16.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$17.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$18.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$19.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$2.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$20.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$3.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$4.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$5.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$6.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$7.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$8.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$9.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$CancelCooldownAction.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$FameStatus.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter$SkillEntry.class
Binary file not shown.
Binary file modified build/classes/client/MapleCharacter.class
Binary file not shown.
Binary file modified build/classes/client/command/Commands.class
Binary file not shown.
Binary file modified build/classes/constants/ServerConstants.class
Binary file not shown.
Binary file modified build/classes/net/server/Server.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/net/server/channel/handlers/MoveLifeHandler.class
Binary file not shown.
Binary file modified build/classes/net/server/channel/handlers/TakeDamageHandler.class
Binary file not shown.
Binary file modified build/classes/net/server/channel/handlers/UseItemHandler.class
Binary file not shown.
Binary file modified build/classes/server/MapleStatEffect$CancelEffectAction.class
Binary file not shown.
Binary file modified build/classes/server/MapleStatEffect.class
Binary file not shown.
Binary file modified build/classes/server/life/MobSkill.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$1.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$10.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$11.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$12.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$13.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$14.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$15.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$16.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$17.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$18.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$19.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$2.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$20.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$21.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$22.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$23.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$24.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$25.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$26.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$27.class
Binary file not shown.
Binary file removed build/classes/server/maps/MapleMap$28$1.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$28.class
Binary file not shown.
Binary file added build/classes/server/maps/MapleMap$29$1.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$29.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$3.class
Binary file not shown.
Binary file added build/classes/server/maps/MapleMap$30.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$4.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$5.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$6.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$7.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$8.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$9.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$ActivateItemReactor$1.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$ActivateItemReactor.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap$ExpireMapItemJob.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMap.class
Binary file not shown.
Binary file modified build/classes/server/maps/MapleMapFactory.class
Binary file not shown.
Binary file modified dist/MapleSolaxia.jar
Binary file not shown.
File renamed without changes.
3 changes: 2 additions & 1 deletion feature_list.txt → docs/feature_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ Quests:
Player Social Network:
* Guild and Alliance system fully functional.

Cash:
Cash & Items:
* EXP/DROP/Cosmetic Coupons 100%.
* EXP/DROP coupons now appears as a buff effect when on active time.
* Great deal of cash items functional.
* New scroll: antibanish. Used only in cases where bosses send a player back to town.

PQ potentials:
* Lobby system - Multiple PQ instances on same channel.
Expand Down
8 changes: 7 additions & 1 deletion mychanges_ptbr.txt → docs/mychanges_ptbr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,4 +427,10 @@ Consertado quests n

03 Agosto 2017,
Quests agora retiram itens antes de entregar recompensas.
Ap�s a primeira inicializa��o, PQs inicializar�o mais r�pido, uma vez que h� um sistema preparador de EIMs ativo.
Ap�s a primeira inicializa��o, PQs inicializar�o mais r�pido, uma vez que h� um sistema preparador de EIMs ativo.

04 - 05 Agosto 2017,
Novo scroll: antibanish. Retorna ao local de onde foi banido pela ultima vez.
Resolvido alguns problemas de concorr�ncia com MapleMapFactory.
Removidos drops inexistentes da DB.
Resolvido problema com GMs de level alto recebendo bloqueio MWLB.
File renamed without changes.
3 changes: 2 additions & 1 deletion handbook/Use.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2000000 - Red Potion - A potion made out of red herbs.\nRecovers 50 HP.
2000000 - Red Potion - A potion made out of red herbs.\nRecovers 50 HP.
2000001 - Orange Potion - A concentrated potion made out of red herbs.\nRecovers 150 HP.
2000002 - White Potion - A highly-concentrated potion made out of red herbs.\nRecovers 300 HP.
2000003 - Blue Potion - A potion made out of blue herbs.\nRecovers 100 MP.
Expand Down Expand Up @@ -381,6 +381,7 @@
2030016 - Phyllia's Warp Powder - Warp powder made by fairy Phyllia. Teleports you to Magatia when used inside the Nihal desert region.
2030019 - Nautilus Return Scroll - This scroll enables you to return to the Pirate village, Nautilus. This is a one use item and will disappear after use.
2030020 - Return to New Leaf City Scroll - Use this scroll to venture back to New Leaf City whenever you want!
2030100 - Return Scroll - Banished Area - Returns you to the map where you were last banished. Requires immediate use and not have changed maps.
2031000 - Masked Man's Invitation - An invitation from the Masked Man to the Halloween Party at the Haunted Mansion. Double-click to move straight to the mansion.
2031001 - Studio Invitation - An invitation to the studio for the event "For Guild Only".
2040000 - Scroll for Helmet for DEF - Improves the helmet's weapon def.\nSuccess rate:100%, weapon def. +1
Expand Down
11 changes: 5 additions & 6 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
<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">
<group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapFactory.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventScriptManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/TimerManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventInstanceManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapMonitor.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMapItem.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.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/net/server/RankingWorker.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/event/EventManager.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AbstractDealDamageHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/Channel.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/reactor/ReactorActionManager.java</file>
</group>
</open-files>
</project-private>
2 changes: 1 addition & 1 deletion scripts/event/HorntailPQ.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var isPq = true;
var minPlayers = 6, maxPlayers = 6;
var minLevel = 120, maxLevel = 255;
var entryMap = 240050100;
var exitMap = 240050500;
var exitMap = 240050000;
var recruitMap = 240050000;
var clearMap = 240050400;

Expand Down
6 changes: 3 additions & 3 deletions sql/db_database.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#YOU MUST EXECUTE NEXT SQL: 'db_drops.sql'
#EXECUTE THIS FIRST, THEN NEXT SQL: 'db_drops.sql'

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
Expand Down Expand Up @@ -21180,8 +21180,8 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `position`) VALUES
( 57, 3992038, 500, 115),

-- missing CBD shop data
(9270027, 2022213, 6800, 0, 104),
(9270027, 2022212, 3200, 0, 108);
(9270027, 2022213, 6800, 104),
(9270027, 2022212, 3200, 108);

CREATE TABLE IF NOT EXISTS `skillmacros` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down
52 changes: 50 additions & 2 deletions sql/db_drops.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
 #THIS SQL MUST BE USED AFTER 'db_database.sql'
#THIS SQL MUST BE USED AFTER 'db_database.sql'
#NEXT SQL 'db_shopupdate.sql' IS OPTIONAL

USE `maplesolaxia`;

INSERT IGNORE INTO temp_data (`dropperid`, `itemid`, `minimum_quantity`, `maximum_quantity`, `questid`, `chance`) VALUES
#-- copy+paste inside here as many drop data as possible from the spider (drop generator) files --
Expand Down Expand Up @@ -20050,4 +20053,49 @@
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

INSERT INTO `monstercarddata` (`cardid`, `mobid`) (SELECT itemid, min(dropperid) FROM drop_data where itemid>=2380000 and itemid<2390000 group by itemid);
INSERT INTO `monstercarddata` (`cardid`, `mobid`) (SELECT itemid, min(dropperid) FROM drop_data where itemid>=2380000 and itemid<2390000 group by itemid);

# delete all unused content on drop data
DELETE FROM `drop_data` WHERE itemid=400000;
DELETE FROM `drop_data` WHERE itemid=400001;
DELETE FROM `drop_data` WHERE itemid=400002;
DELETE FROM `drop_data` WHERE itemid=400003;
DELETE FROM `drop_data` WHERE itemid=400004;
DELETE FROM `drop_data` WHERE itemid=400005;
DELETE FROM `drop_data` WHERE itemid=400006;
DELETE FROM `drop_data` WHERE itemid=400009;
DELETE FROM `drop_data` WHERE itemid=400010;
DELETE FROM `drop_data` WHERE itemid=400011;
DELETE FROM `drop_data` WHERE itemid=401000;
DELETE FROM `drop_data` WHERE itemid=404000;
DELETE FROM `drop_data` WHERE itemid=1002926;
DELETE FROM `drop_data` WHERE itemid=1002927;
DELETE FROM `drop_data` WHERE itemid=1027090;
DELETE FROM `drop_data` WHERE itemid=1302096;
DELETE FROM `drop_data` WHERE itemid=2002205;
DELETE FROM `drop_data` WHERE itemid=2040033;
DELETE FROM `drop_data` WHERE itemid=2040536;
DELETE FROM `drop_data` WHERE itemid=2040827;
DELETE FROM `drop_data` WHERE itemid=2040913;
DELETE FROM `drop_data` WHERE itemid=2040935;
DELETE FROM `drop_data` WHERE itemid=2043109;
DELETE FROM `drop_data` WHERE itemid=2043309;
DELETE FROM `drop_data` WHERE itemid=2043709;
DELETE FROM `drop_data` WHERE itemid=2044009;
DELETE FROM `drop_data` WHERE itemid=2044209;
DELETE FROM `drop_data` WHERE itemid=2044309;
DELETE FROM `drop_data` WHERE itemid=2044609;
DELETE FROM `drop_data` WHERE itemid=2049212;
DELETE FROM `drop_data` WHERE itemid=2049214;
DELETE FROM `drop_data` WHERE itemid=4000306;
DELETE FROM `drop_data` WHERE itemid=4000343;
DELETE FROM `drop_data` WHERE itemid=4000420;
DELETE FROM `drop_data` WHERE itemid=4000429;
DELETE FROM `drop_data` WHERE itemid=4000430;
DELETE FROM `drop_data` WHERE itemid=4000431;
DELETE FROM `drop_data` WHERE itemid=4000432;
DELETE FROM `drop_data` WHERE itemid=4000433;
DELETE FROM `drop_data` WHERE itemid=4000434;
DELETE FROM `drop_data` WHERE itemid=4000435;
DELETE FROM `drop_data` WHERE itemid=4032192;
DELETE FROM `drop_data` WHERE itemid=8143000;
37 changes: 36 additions & 1 deletion sql/db_shopupdate.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
UPDATE shopitems SET itemid=1812005, price=1000 WHERE shopitemid=18;
#THIS SQL IS OPTIONAL, TO BE USED AFTER 'db_drops.sql'
#THIS REQUIRES PROVIDED WZ FILES

USE `maplesolaxia`;

UPDATE shopitems SET itemid=1812005, price=1000 WHERE shopitemid=18;
UPDATE shopitems SET itemid=1812004, price=1000 WHERE shopitemid=19;
UPDATE shopitems SET itemid=2120000, price=100 WHERE shopitemid=20;
UPDATE shopitems SET itemid=1812000, price=1000 WHERE shopitemid=21;
Expand Down Expand Up @@ -102,3 +107,33 @@ INSERT IGNORE INTO `shopitems` (`shopid`, `itemid`, `price`, `pitch`, `position`
(9110002, 3010008, 1000000, 0, 92),
(9110002, 3010007, 1000000, 0, 96),
(9110002, 3011000, 4200000, 0, 100);

# adding antibanish scrolls
INSERT IGNORE INTO `shopitems` (`shopid`, `itemid`, `price`, `pitch`, `position`) VALUES
(1001100, 2030100, 450, 0, 130),
(1011100, 2030100, 450, 0, 142),
(1021100, 2030100, 450, 0, 142),
(1031100, 2030100, 450, 0, 146),
(1051002, 2030100, 450, 0, 142),
(1061001, 2030100, 450, 0, 126),
(1061002, 2030100, 450, 0, 130),
(1091002, 2030100, 450, 0, 130),
(1100002, 2030100, 450, 0, 138),
(2012005, 2030100, 450, 0, 126),
(2022001, 2030100, 450, 0, 126),
(2030009, 2030100, 450, 0, 126),
(2040051, 2030100, 450, 0, 102),
(2041006, 2030100, 450, 0, 134),
(2051000, 2030100, 450, 0, 134),
(2060004, 2030100, 450, 0, 134),
(2070001, 2030100, 450, 0, 134),
(2080001, 2030100, 450, 0, 134),
(2090003, 2030100, 450, 0, 126),
(2093002, 2030100, 450, 0, 126),
(2100004, 2030100, 450, 0, 130),
(2110001, 2030100, 450, 0, 130),
(2130000, 2030100, 450, 0, 126),
(9201060, 2030100, 450, 0, 114),
(9270021, 2030100, 450, 0, 118),
(9270022, 2030100, 450, 0, 114),
(1338, 2030100, 450, 0, 114);
2 changes: 1 addition & 1 deletion sql/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
These SQL files must be executed IN ORDER to set up the database:
- db_database.sql
- db_drops.sql
- db_shopupdate.sql (optional)
- db_shopupdate.sql (optional & require provided WZs)
57 changes: 43 additions & 14 deletions src/client/MapleCharacter.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
private short extraRecInterval;
private int targetHpBarHash = 0;
private long targetHpBarTime = 0;
private int banishMap = -1;
private int banishSp = -1;
private long banishTime = 0;

private MapleCharacter() {
useCS = false;
Expand Down Expand Up @@ -1192,10 +1195,42 @@ private void eventChangedMap(int map) {
if (getEventInstance() != null) getEventInstance().changedMap(this, map);
}

public boolean canRecoverLastBanish() {
return System.currentTimeMillis() - this.banishTime < 5 * 60 * 1000;
}

public Pair<Integer, Integer> getLastBanishData() {
return new Pair<>(this.banishMap, this.banishSp);
}

private void clearBanishPlayerData() {
this.banishMap = -1;
this.banishSp = -1;
this.banishTime = 0;
}

private void setBanishPlayerData(int banishMap, int banishSp, long banishTime) {
this.banishMap = banishMap;
this.banishSp = banishSp;
this.banishTime = banishTime;
}

public void changeMapBanish(int mapid, String portal, String msg) {
if(ServerConstants.USE_SPIKES_AVOID_BANISH) {
for(Item it: this.getInventory(MapleInventoryType.EQUIPPED).list()) {
if((it.getFlag() & ItemConstants.SPIKES) == ItemConstants.SPIKES) return;
}
}

int banMap = this.getMapId();
int banSp = this.getMap().findClosestPlayerSpawnpoint(this.getPosition()).getId();
long banTime = System.currentTimeMillis();

dropMessage(5, msg);
MapleMap map_ = client.getChannelServer().getMapFactory().getMap(mapid);
changeMap(map_, map_.getPortal(portal));

setBanishPlayerData(banMap, banSp, banTime);
}

public void changeMap(int map) {
Expand Down Expand Up @@ -1298,6 +1333,7 @@ private boolean buffMapProtection() {
private void changeMapInternal(final MapleMap to, final Point pos, final byte[] warpPacket) {
if(!canWarpMap) return;

this.clearBanishPlayerData();
this.closePlayerInteractions();
this.resetPlayerAggro();

Expand Down Expand Up @@ -1468,19 +1504,13 @@ public final void pickupItem(MapleMapObject ob, int petIndex) { // yes, one
if (!mapitem.isPlayerDrop() || mapitem.getDropper().getObjectId() == client.getPlayer().getObjectId()) {
if(mapitem.getMeso() > 0) {
this.gainMeso(mapitem.getMeso(), true, true, false);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else if(mapitem.getItemId() == 4031865 || mapitem.getItemId() == 4031866) {
// Add NX to account, show effect and make item disappear
this.getCashShop().gainCash(1, mapitem.getItemId() == 4031865 ? 100 : 250);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else if (MapleInventoryManipulator.addFromDrop(client, mapitem.getItem(), true)) {
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);
mapitem.setPickedUp(true);
this.getMap().pickItemDrop(pickupPacket, mapitem);
} else {
client.announce(MaplePacketCreator.enableActions());
return;
Expand Down Expand Up @@ -1558,9 +1588,8 @@ public final void pickupItem(MapleMapObject ob, int petIndex) { // yes, one
client.announce(MaplePacketCreator.enableActions());
return;
}
mapitem.setPickedUp(true);
this.getMap().broadcastMessage(pickupPacket, mapitem.getPosition());
this.getMap().removeMapObject(ob);

this.getMap().pickItemDrop(pickupPacket, mapitem);
}
} else if(!hasSpaceInventory) {
client.announce(MaplePacketCreator.getInventoryFull());
Expand Down Expand Up @@ -5473,13 +5502,13 @@ public synchronized void saveToDB() {
}
psf.close();
ps = con.prepareStatement("UPDATE accounts SET gm = ? WHERE id = ?");
ps.setInt(1, gmLevel);
ps.setInt(1, gmLevel > 1 ? 1 : 0);
ps.setInt(2, client.getAccID());
ps.executeUpdate();
ps.close();

con.commit();
con.setAutoCommit(true);
con.setAutoCommit(true);

if (cashshop != null) {
cashshop.save(con);
Expand Down
5 changes: 2 additions & 3 deletions src/client/command/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -1961,9 +1961,8 @@ public static boolean executeSolaxiaCommandLv4(Channel cserv, Server srv, MapleC
} else {
MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true);
}
mapItem.setPickedUp(true);
player.getMap().removeMapObject(item);
player.getMap().broadcastMessage(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem.getPosition());

player.getMap().pickItemDrop(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem);
}
break;

Expand Down
Loading

0 comments on commit f78defe

Please sign in to comment.