Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3b567953d | ||
|
|
5064ee936a |
@@ -112,6 +112,8 @@ import static java.util.concurrent.TimeUnit.MINUTES;
|
|||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||||
|
private static final int EXPLODED_MESO_SPREAD_DELAY = 100;
|
||||||
|
private static final int EXPLODED_MESO_MAX_DELAY = 1000;
|
||||||
|
|
||||||
public static class AttackInfo {
|
public static class AttackInfo {
|
||||||
|
|
||||||
@@ -936,7 +938,7 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeExplodedMesos(MapleMap map, AttackInfo attack) {
|
private void removeExplodedMesos(MapleMap map, AttackInfo attack) {
|
||||||
short delay = attack.attackDelay;
|
int index = 0;
|
||||||
for (Integer mesoId : attack.explodedMesos) {
|
for (Integer mesoId : attack.explodedMesos) {
|
||||||
MapObject mapobject = map.getMapObject(mesoId);
|
MapObject mapobject = map.getMapObject(mesoId);
|
||||||
if (!(mapobject instanceof MapItem mapItem)) {
|
if (!(mapobject instanceof MapItem mapItem)) {
|
||||||
@@ -951,11 +953,12 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
|||||||
if (mapItem.isPickedUp()) {
|
if (mapItem.isPickedUp()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
map.pickItemDrop(PacketCreator.removeExplodedMesoFromMap(mapItem.getObjectId(), delay), mapItem);
|
int delay = attack.attackDelay + (index++ % 5) * EXPLODED_MESO_SPREAD_DELAY;
|
||||||
|
delay = Math.min(delay, EXPLODED_MESO_MAX_DELAY);
|
||||||
|
map.pickItemDrop(PacketCreator.removeExplodedMesoFromMap(mapItem.getObjectId(), (short) delay), mapItem);
|
||||||
} finally {
|
} finally {
|
||||||
mapItem.unlockItem();
|
mapItem.unlockItem();
|
||||||
}
|
}
|
||||||
delay += 100;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user