From b141efdbf21adfcd0a7ec88652409705821be260 Mon Sep 17 00:00:00 2001 From: ronancpl Date: Tue, 12 Dec 2017 11:16:34 -0200 Subject: [PATCH] Fixed drop count on maps Fixed an issue with map drop count displaying errouneous info after items are "picked-up" by reactors or commands like cleardrops. --- docs/mychanges_ptbr.txt | 5 ++++- scripts/quest/20101.js | 8 ++++---- scripts/quest/20102.js | 8 ++++---- scripts/quest/20103.js | 8 ++++---- scripts/quest/20105.js | 8 ++++---- src/net/server/channel/handlers/CancelBuffHandler.java | 2 -- src/net/server/channel/handlers/SkillEffectHandler.java | 3 ++- src/server/maps/MapleMap.java | 7 ++++++- 8 files changed, 28 insertions(+), 21 deletions(-) diff --git a/docs/mychanges_ptbr.txt b/docs/mychanges_ptbr.txt index e1ab506f35..e3fa0db244 100644 --- a/docs/mychanges_ptbr.txt +++ b/docs/mychanges_ptbr.txt @@ -718,4 +718,7 @@ Corrigido 3o job de Cygnus. 08 - 09 Dezembro 2017, Removido UI que aponta erroneamente "Stat Upgrade" nos níveis 15, 20, 25 e 30. -Adicionado comando "droplimit", cuja funcionalidade é informar ao jogador a quantidade de drops no mapa em contraste com o limite permitido. \ No newline at end of file +Adicionado comando "droplimit", cuja funcionalidade é informar ao jogador a quantidade de drops no mapa em contraste com o limite permitido. + +11 Dezembro 2017, +Resolvido bug onde contador do drops do mapa não atualizaria seu valor em casos onde reatores consomem itens ou ao se aplicar comandos como "cleardrops". \ No newline at end of file diff --git a/scripts/quest/20101.js b/scripts/quest/20101.js index 2b0cacb025..a5e933e90f 100644 --- a/scripts/quest/20101.js +++ b/scripts/quest/20101.js @@ -1,5 +1,5 @@ /* - * Cygnus 1st Job advancement - Soul + * Cygnus 1st Job advancement - Dawn Warrior */ importPackage(Packages.client); @@ -18,9 +18,9 @@ function end(mode, type, selection) { status++; } if (status == 0) { - qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Soul Master?"); + qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Dawn Warrior?"); } else if (status == 1) { - qm.sendNext("I have just molded your body to make it perfect for a Soul Master. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); + qm.sendNext("I have just molded your body to make it perfect for a Dawn Warrior. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); if (qm.getPlayer().getJob().getId() != 1100) { qm.gainItem(1302077, 1); qm.gainItem(1142066, 1); @@ -33,7 +33,7 @@ function end(mode, type, selection) { } else if (status == 3) { qm.sendNextPrev("I have also given you a hint of #bSP#k, so open the #bSkill Menu#k to acquire new skills. Of course, you can't raise them at all once, and there are some skills out there where you won't be able to acquire them unless you master the basic skills first."); } else if (status == 4) { - qm.sendNextPrev("Unlike your time as a Nobless, once you become the Soul Master, you will lost a portion of your EXP when you run out of HP, okay?"); + qm.sendNextPrev("Unlike your time as a Nobless, once you become the Dawn Warrior, you will lost a portion of your EXP when you run out of HP, okay?"); } else if (status == 5) { qm.sendNextPrev("Now... I want you to go out there and show the world how the Knights of Cygnus operate."); qm.dispose(); diff --git a/scripts/quest/20102.js b/scripts/quest/20102.js index d377d73926..b744f39d81 100644 --- a/scripts/quest/20102.js +++ b/scripts/quest/20102.js @@ -1,5 +1,5 @@ /* - * Cygnus 1st Job advancement - Flame Wizard + * Cygnus 1st Job advancement - Blaze Wizard */ importPackage(Packages.client); @@ -18,9 +18,9 @@ function end(mode, type, selection) { status++; } if (status == 0) { - qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Flame Wizard?"); + qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Blaze Wizard?"); } else if (status == 1) { - qm.sendNext("I have just molded your body to make it perfect for a Flame Wizard. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); + qm.sendNext("I have just molded your body to make it perfect for a Blaze Wizard. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); if (qm.getPlayer().getJob().getId() != 1200) { qm.gainItem(1372043, 1); qm.gainItem(1142066, 1); @@ -33,7 +33,7 @@ function end(mode, type, selection) { } else if (status == 3) { qm.sendNextPrev("I have also given you a hint of #bSP#k, so open the #bSkill Menu#k to acquire new skills. Of course, you can't raise them at all once, and there are some skills out there where you won't be able to acquire them unless you master the basic skills first."); } else if (status == 4) { - qm.sendNextPrev("Unlike your time as a Nobless, once you become the Flame Wizard, you will lost a portion of your EXP when you run out of HP, okay?"); + qm.sendNextPrev("Unlike your time as a Nobless, once you become the Blaze Wizard, you will lost a portion of your EXP when you run out of HP, okay?"); } else if (status == 5) { qm.sendNextPrev("Now... I want you to go out there and show the world how the Knights of Cygnus operate."); qm.dispose(); diff --git a/scripts/quest/20103.js b/scripts/quest/20103.js index 7a3b8f7db9..c50653c82e 100644 --- a/scripts/quest/20103.js +++ b/scripts/quest/20103.js @@ -1,5 +1,5 @@ /* - * Cygnus 1st Job advancement - Wind Breaker + * Cygnus 1st Job advancement - Wind Archer */ importPackage(Packages.client); @@ -17,9 +17,9 @@ function end(mode, type, selection) { status++; } if (status == 0) { - qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Wind Breaker?"); + qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Wind Archer?"); } else if (status == 1) { - qm.sendNext("I have just molded your body to make it perfect for a Wind Breaker. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); + qm.sendNext("I have just molded your body to make it perfect for a Wind Archer. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); if (qm.getPlayer().getJob().getId() != 1300) { qm.gainItem(2060000, 2000); qm.gainItem(1452051, 1); @@ -33,7 +33,7 @@ function end(mode, type, selection) { } else if (status == 3) { qm.sendNextPrev("I have also given you a hint of #bSP#k, so open the #bSkill Menu#k to acquire new skills. Of course, you can't raise them at all once, and there are some skills out there where you won't be able to acquire them unless you master the basic skills first."); } else if (status == 4) { - qm.sendNextPrev("Unlike your time as a Nobless, once you become the Wind Breaker, you will lost a portion of your EXP when you run out of HP, okay?"); + qm.sendNextPrev("Unlike your time as a Nobless, once you become the Wind Archer, you will lost a portion of your EXP when you run out of HP, okay?"); } else if (status == 5) { qm.sendNextPrev("Now... I want you to go out there and show the world how the Knights of Cygnus operate."); qm.dispose(); diff --git a/scripts/quest/20105.js b/scripts/quest/20105.js index 8da03e22f2..b102c52d9d 100644 --- a/scripts/quest/20105.js +++ b/scripts/quest/20105.js @@ -1,5 +1,5 @@ /* - * Cygnus 1st Job advancement - Striker + * Cygnus 1st Job advancement - Thunder Breaker */ importPackage(Packages.client); @@ -18,9 +18,9 @@ function end(mode, type, selection) { status++; } if (status == 0) { - qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Striker?"); + qm.sendYesNo("Have you made your decision? The decision will be final, so think carefully before deciding what to do. Are you sure you want to become a Thunder Breaker?"); } else if (status == 1) { - qm.sendNext("I have just molded your body to make it perfect for a Striker. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); + qm.sendNext("I have just molded your body to make it perfect for a Thunder Breaker. If you wish to become more powerful, use Stat Window (S) to raise the appropriate stats. If you aren't sure what to raise, just click on #bAuto#k."); if (qm.getPlayer().getJob().getId() != 1500) { qm.gainItem(1482014, 1); qm.gainItem(1142066, 1); @@ -33,7 +33,7 @@ function end(mode, type, selection) { } else if (status == 3) { qm.sendNextPrev("I have also given you a hint of #bSP#k, so open the #bSkill Menu#k to acquire new skills. Of course, you can't raise them at all once, and there are some skills out there where you won't be able to acquire them unless you master the basic skills first."); } else if (status == 4) { - qm.sendNextPrev("Unlike your time as a Nobless, once you become the Striker, you will lost a portion of your EXP when you run out of HP, okay?"); + qm.sendNextPrev("Unlike your time as a Nobless, once you become the Thunder Breaker, you will lost a portion of your EXP when you run out of HP, okay?"); } else if (status == 5) { qm.sendNextPrev("Now... I want you to go out there and show the world how the Knights of Cygnus operate."); qm.dispose(); diff --git a/src/net/server/channel/handlers/CancelBuffHandler.java b/src/net/server/channel/handlers/CancelBuffHandler.java index a77203666b..69cda11d49 100644 --- a/src/net/server/channel/handlers/CancelBuffHandler.java +++ b/src/net/server/channel/handlers/CancelBuffHandler.java @@ -21,7 +21,6 @@ */ package net.server.channel.handlers; -import client.MapleBuffStat; import client.MapleClient; import client.SkillFactory; import constants.skills.Bishop; @@ -32,7 +31,6 @@ import constants.skills.FPArchMage; import constants.skills.ILArchMage; import constants.skills.Marksman; import constants.skills.WindArcher; -import constants.skills.NightWalker; import net.AbstractMaplePacketHandler; import net.MaplePacketHandler; import tools.MaplePacketCreator; diff --git a/src/net/server/channel/handlers/SkillEffectHandler.java b/src/net/server/channel/handlers/SkillEffectHandler.java index f2ff99bff3..d0d3679485 100644 --- a/src/net/server/channel/handlers/SkillEffectHandler.java +++ b/src/net/server/channel/handlers/SkillEffectHandler.java @@ -44,6 +44,7 @@ import tools.MaplePacketCreator; import tools.data.input.SeekableLittleEndianAccessor; public final class SkillEffectHandler extends AbstractMaplePacketHandler { + @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { int skillId = slea.readInt(); int level = slea.readByte(); @@ -57,7 +58,7 @@ public final class SkillEffectHandler extends AbstractMaplePacketHandler { case Bishop.BIG_BANG: case Bowmaster.HURRICANE: case Marksman.PIERCING_ARROW: - case ChiefBandit.CHAKRA: + case ChiefBandit.CHAKRA: case Brawler.CORKSCREW_BLOW: case Gunslinger.GRENADE: case Corsair.RAPID_FIRE: diff --git a/src/server/maps/MapleMap.java b/src/server/maps/MapleMap.java index 744ce68a0a..58897f6401 100644 --- a/src/server/maps/MapleMap.java +++ b/src/server/maps/MapleMap.java @@ -764,9 +764,9 @@ public class MapleMap { public void pickItemDrop(byte[] pickupPacket, MapleMapItem mdrop) { broadcastMessage(pickupPacket, mdrop.getPosition()); + droppedItemCount.decrementAndGet(); this.removeMapObject(mdrop); mdrop.setPickedUp(true); - droppedItemCount.decrementAndGet(); } private void spawnDrop(final Item idrop, final Point dropPos, final MapleMapObject dropper, final MapleCharacter chr, final byte droptype, final short questid) { @@ -2853,7 +2853,10 @@ public class MapleMap { reactor.setShouldCollect(false); MapleMap.this.broadcastMessage(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition()); + + droppedItemCount.decrementAndGet(); MapleMap.this.removeMapObject(mapitem); + reactor.hitReactor(c); if (reactor.getDelay() > 0) { @@ -3164,6 +3167,7 @@ public class MapleMap { public void clearDrops(MapleCharacter player) { List items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM)); for (MapleMapObject i : items) { + droppedItemCount.decrementAndGet(); player.getMap().removeMapObject(i); player.getMap().broadcastMessage(MaplePacketCreator.removeItemFromMap(i.getObjectId(), 0, player.getId())); } @@ -3171,6 +3175,7 @@ public class MapleMap { public void clearDrops() { for (MapleMapObject i : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM))) { + droppedItemCount.decrementAndGet(); removeMapObject(i); this.broadcastMessage(MaplePacketCreator.removeItemFromMap(i.getObjectId(), 0, 0)); }