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.
This commit is contained in:
ronancpl
2017-12-12 11:16:34 -02:00
parent 1386891182
commit b141efdbf2
8 changed files with 28 additions and 21 deletions

View File

@@ -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.
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".

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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();

View File

@@ -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;

View File

@@ -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:

View File

@@ -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<MapleMapObject> 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));
}