I've spent a few hours looking why Town Scrolls aren't working and yet Return to Nearest Town scroll works. After my investigations, I found out that there was something wrong with the code under Source > src > server > MapleStatEffect.java and look for this code.
The issue with the code wasCode:if (moveTo != -1) { if (applyto.getMap().getReturnMapId() != applyto.getMapId()) { MapleMap target; if (moveTo == 999999999) { target = applyto.getMap().getReturnMap(); } else { target = applyto.getClient().getWorldServer().getChannel(applyto.getClient().getChannel()).getMapFactory().getMap(moveTo); int targetid = target.getId() / 10000000; if (targetid != 60 && applyto.getMapId() / 10000000 != 61 && targetid != applyto.getMapId() / 10000000 && targetid != 21 && targetid != 20) { return false; } } applyto.changeMap(target); } else { return false; } }
"applyto.getMap().getReturnMapId()" & "applyto.getMapId()" always returns the map where the player is located at. For example, if the player who use the scroll is at Henesys (Map ID: 100000000), both of them will return 100000000. Anyways, here's the fix, replace it with the following code and it should be working.Code:if (applyto.getMap().getReturnMapId() != applyto.getMapId()) {
All the maps that I've tested are working so if you find any bugs, tell me so I could investigate further!Code:if (moveTo != -1) { if (moveTo != applyto.getMapId()) { MapleMap target; if (moveTo == 999999999) { target = applyto.getMap().getReturnMap(); } else { target = applyto.getClient().getWorldServer().getChannel(applyto.getClient().getChannel()).getMapFactory().getMap(moveTo); int targetid = target.getId() / 10000000; if (targetid != 10 && targetid != 60 && applyto.getMapId() / 10000000 != 61 && targetid != applyto.getMapId() / 10000000 && targetid != 21 && targetid != 20) { return false; } } applyto.changeMap(target); } else { return false; } }


Reply With Quote

