마을 명령어
public static class 마을 extends CommandExecute {
private static final HashMap<String, Integer> gotomaps = new HashMap<>();
static {
gotomaps.put("헤네시스", 100000000);
gotomaps.put("엘리니아", 101000000);
gotomaps.put("페리온", 102000000);
gotomaps.put("커닝시티", 103000000);
gotomaps.put("리스항구", 104000000);
gotomaps.put("슬리피우드", 105000000);
gotomaps.put("오르비스", 200000000);
gotomaps.put("행복한마을", 209000000);
gotomaps.put("엘나스", 211000000);
gotomaps.put("루디브리엄", 220000000);
gotomaps.put("지구방위본부", 221000000);
gotomaps.put("아랫마을", 222000000);
gotomaps.put("아쿠아로드", 230000000);
gotomaps.put("리프레", 240000000);
gotomaps.put("무릉", 250000000);
gotomaps.put("백초마을", 251000000);
gotomaps.put("아리안트", 260000000);
gotomaps.put("마가티아", 26100000);
gotomaps.put("시간의신전", 270000000);
gotomaps.put("코크타운", 219000000);
gotomaps.put("엘린숲", 300000000);
gotomaps.put("태국", 500000000);
gotomaps.put("대만", 740000000);
gotomaps.put("중국", 701000000);
gotomaps.put("일본", 800000000);
gotomaps.put("자시", 910000000);
}
@Override
public int execute(MapleClient c, String[] splitted) {
if (splitted.length < 2) {
c.getPlayer().dropMessage(6, "사용법: !마을 <맵이름>");
} else {
if (gotomaps.containsKey(splitted[1])) {
MapleMap target = c.getChannelServer().getMapFactory().getMap(gotomaps.get(splitted[1]));
if (target == null) {
c.getPlayer().dropMessage(6, "그 맵으로는 이동할 수 없습니다.");
return 0;
}
MaplePortal targetPortal = target.getPortal(0);
c.getPlayer().changeMap(target, targetPortal);
} else {
if (splitted[1].equals("검색")) {
c.getPlayer().dropMessage(6, "[!마을 검색] 을 입력하면 이동가능한 목록을 볼 수 있습니다.:");
StringBuilder sb = new StringBuilder();
for (String s : gotomaps.keySet()) {
sb.append(s).append(", ");
}
c.getPlayer().dropMessage(6, sb.substring(0, sb.length() - 2));
} else {
c.getPlayer().dropMessage(6, "문법이 올바르지 않습니다. !마을 검색 을 입력하면 이동가능한 목록을 볼 수 있습니다.");
}
}
}
return 1;
}
}

cksals33 님의 최근 댓글
감사용 2017 04.03