Reworked equip lvlup + Reactor quest item drop + ToT quests fix
Rebalanced the way equipment exp is gained (about 100~200 same-level range mobs to pass equip level 1 to 2). Fixed reactors dropping quest items to player if they don't have the quest started. Fixed broken Temple of Time quests.
This commit is contained in:
@@ -77,7 +77,11 @@ public class MapleDoor {
|
||||
try {
|
||||
return town.getAvailableDoorPortals().get(slot);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
return town.getAvailableDoorPortals().get(0);
|
||||
try {
|
||||
return town.getAvailableDoorPortals().get(0);
|
||||
} catch (IndexOutOfBoundsException ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -560,6 +560,10 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dropFromReactor(final MapleCharacter chr, final MapleReactor reactor, Item drop, Point dropPos, short questid) {
|
||||
spawnDrop(drop, this.calcDropPos(dropPos, reactor.getPosition()), reactor, chr, (byte)(chr.getParty() != null ? 1 : 0), questid);
|
||||
}
|
||||
|
||||
private void stopItemMonitor() {
|
||||
chrWLock.lock();
|
||||
@@ -653,14 +657,14 @@ public class MapleMap {
|
||||
droppedItemCount.decrementAndGet();
|
||||
}
|
||||
|
||||
private void spawnDrop(final Item idrop, final Point dropPos, final MapleMonster mob, final MapleCharacter chr, final byte droptype, final short questid) {
|
||||
final MapleMapItem mdrop = new MapleMapItem(idrop, dropPos, mob, chr, droptype, false, questid);
|
||||
private void spawnDrop(final Item idrop, final Point dropPos, final MapleMapObject dropper, final MapleCharacter chr, final byte droptype, final short questid) {
|
||||
final MapleMapItem mdrop = new MapleMapItem(idrop, dropPos, dropper, chr, droptype, false, questid);
|
||||
mdrop.setDropTime(System.currentTimeMillis());
|
||||
spawnAndAddRangedMapObject(mdrop, new DelayedPacketCreation() {
|
||||
@Override
|
||||
public void sendPackets(MapleClient c) {
|
||||
if (questid <= 0 || (c.getPlayer().getQuestStatus(questid) == 1 && c.getPlayer().needQuestItem(questid, idrop.getItemId()))) {
|
||||
c.announce(MaplePacketCreator.dropItemFromMapObject(mdrop, mob.getPosition(), dropPos, (byte) 1));
|
||||
c.announce(MaplePacketCreator.dropItemFromMapObject(mdrop, dropper.getPosition(), dropPos, (byte) 1));
|
||||
}
|
||||
}
|
||||
}, null);
|
||||
@@ -2591,37 +2595,39 @@ public class MapleMap {
|
||||
public void run() {
|
||||
reactor.lockReactor();
|
||||
try {
|
||||
if (reactor.getShouldCollect() == true && mapitem != null && mapitem == getMapObject(mapitem.getObjectId())) {
|
||||
mapitem.lockItem();
|
||||
try {
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
if (mapitem.isPickedUp()) {
|
||||
return;
|
||||
}
|
||||
if(reactor.getReactorType() == 100) {
|
||||
if (reactor.getShouldCollect() == true && mapitem != null && mapitem == getMapObject(mapitem.getObjectId())) {
|
||||
mapitem.lockItem();
|
||||
try {
|
||||
TimerManager tMan = TimerManager.getInstance();
|
||||
if (mapitem.isPickedUp()) {
|
||||
return;
|
||||
}
|
||||
|
||||
reactor.setShouldCollect(false);
|
||||
MapleMap.this.broadcastMessage(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition());
|
||||
MapleMap.this.removeMapObject(mapitem);
|
||||
reactor.hitReactor(c);
|
||||
reactor.setShouldCollect(false);
|
||||
MapleMap.this.broadcastMessage(MaplePacketCreator.removeItemFromMap(mapitem.getObjectId(), 0, 0), mapitem.getPosition());
|
||||
MapleMap.this.removeMapObject(mapitem);
|
||||
reactor.hitReactor(c);
|
||||
|
||||
if (reactor.getDelay() > 0) {
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
reactor.lockReactor();
|
||||
try {
|
||||
reactor.setState((byte) 0);
|
||||
reactor.resetReactorActions();
|
||||
if (reactor.getDelay() > 0) {
|
||||
tMan.schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
reactor.lockReactor();
|
||||
try {
|
||||
reactor.setState((byte) 0);
|
||||
reactor.resetReactorActions();
|
||||
|
||||
broadcastMessage(MaplePacketCreator.triggerReactor(reactor, 0));
|
||||
} finally {
|
||||
reactor.unlockReactor();
|
||||
broadcastMessage(MaplePacketCreator.triggerReactor(reactor, 0));
|
||||
} finally {
|
||||
reactor.unlockReactor();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, reactor.getDelay());
|
||||
}, reactor.getDelay());
|
||||
}
|
||||
} finally {
|
||||
mapitem.unlockItem();
|
||||
}
|
||||
} finally {
|
||||
mapitem.unlockItem();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
|
||||
@@ -271,6 +271,8 @@ public class MapleMapFactory {
|
||||
|
||||
private AbstractLoadedMapleLife loadLife(MapleData life, String id, String type) {
|
||||
AbstractLoadedMapleLife myLife = MapleLifeFactory.getLife(Integer.parseInt(id), type);
|
||||
if(life == null) System.out.println("lf null");
|
||||
if(myLife == null) System.out.println("mlf null");
|
||||
myLife.setCy(MapleDataTool.getInt(life.getChildByPath("cy")));
|
||||
MapleData dF = life.getChildByPath("f");
|
||||
if (dF != null) {
|
||||
@@ -293,11 +295,10 @@ public class MapleMapFactory {
|
||||
MapleReactor myReactor = new MapleReactor(MapleReactorFactory.getReactor(Integer.parseInt(id)), Integer.parseInt(id));
|
||||
int x = MapleDataTool.getInt(reactor.getChildByPath("x"));
|
||||
int y = MapleDataTool.getInt(reactor.getChildByPath("y"));
|
||||
myReactor.setName(MapleDataTool.getString(reactor.getChildByPath("name"), ""));
|
||||
myReactor.setPosition(new Point(x, y));
|
||||
myReactor.setDelay(MapleDataTool.getInt(reactor.getChildByPath("reactorTime")) * 1000);
|
||||
myReactor.setState((byte) 0);
|
||||
|
||||
myReactor.setName(MapleDataTool.getString(reactor.getChildByPath("name"), ""));
|
||||
myReactor.resetReactorActions();
|
||||
return myReactor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user