MapleJob.java
上传用户:gwt600
上传日期:2021-06-03
资源大小:704k
文件大小:5k
- /*
- This file is part of the OdinMS Maple Story Server
- Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
- Matthias Butz <matze@odinms.de>
- Jan Christian Meyer <vimes@odinms.de>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License version 3
- as published by the Free Software Foundation. You may not use, modify
- or distribute this program under any other version of the
- GNU Affero General Public License.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- package net.sf.odinms.client;
- public enum MapleJob {
- BEGINNER(0),
- WARRIOR(100),
- FIGHTER(110),
- CRUSADER(111),
- HERO(112),
- PAGE(120),
- WHITEKNIGHT(121),
- PALADIN(122),
- SPEARMAN(130),
- DRAGONKNIGHT(131),
- DARKKNIGHT(132),
- MAGICIAN(200),
- FP_WIZARD(210),
- FP_MAGE(211),
- FP_ARCHMAGE(212),
- IL_WIZARD(220),
- IL_MAGE(221),
- IL_ARCHMAGE(222),
- CLERIC(230),
- PRIEST(231),
- BISHOP(232),
- BOWMAN(300),
- HUNTER(310),
- RANGER(311),
- BOWMASTER(312),
- CROSSBOWMAN(320),
- SNIPER(321),
- CROSSBOWMASTER(322),
- THIEF(400),
- ASSASSIN(410),
- HERMIT(411),
- NIGHTLORD(412),
- BANDIT(420),
- CHIEFBANDIT(421),
- SHADOWER(422),
- PIRATE(500),
- BRAWLER(510),
- MARAUDER(511),
- BUCCANEER(512),
- GUNSLINGER(520),
- OUTLAW(521),
- CORSAIR(522),
- GM(900),
- SUPERGM(910);
- final int jobid;
- private MapleJob(int id) {
- jobid = id;
- }
- public int getId() {
- return jobid;
- }
- public static MapleJob getById(int id) {
- for (MapleJob l : MapleJob.values()) {
- if (l.getId() == id) {
- return l;
- }
- }
- return null;
- }
- public static MapleJob getBy5ByteEncoding(int encoded) {
- switch (encoded) {
- case 2:
- return WARRIOR;
- case 4:
- return MAGICIAN;
- case 8:
- return BOWMAN;
- case 16:
- return THIEF;
- case 32: // ??
- return PIRATE;
- default:
- return BEGINNER;
- }
- }
- public boolean isA(MapleJob basejob) {
- return getId() >= basejob.getId() && getId() / 100 == basejob.getId() / 100;
- }
-
- public static String getJobName(int id) {
- switch (id) {
- case 0: return "新人";
- case 100: return "战士";
- case 110: return "剑客";
- case 111: return "勇士";
- case 112: return "英雄";
- case 120: return "准骑士";
- case 121: return "骑士";
- case 122: return "圣骑士";
- case 130: return "枪骑士";
- case 131: return "龙骑士";
- case 132: return "黑骑士";
- case 200: return "魔法师";
- case 210: return "火毒法师";
- case 211: return "火毒巫师";
- case 212: return "火毒魔导士";
- case 220: return "冰雷法师";
- case 221: return "冰雷巫师";
- case 222: return "冰雷魔导士";
- case 230: return "牧师";
- case 231: return "祭司";
- case 232: return "主教";
- case 300: return "弓箭手";
- case 310: return "猎人";
- case 320: return "弩弓手";
- case 311: return "射手";
- case 321: return "游侠";
- case 312: return "神箭";
- case 322: return "箭神";
- case 400: return "飞侠";
- case 410: return "刺客";
- case 420: return "侠客";
- case 411: return "无影人";
- case 421: return "独行客";
- case 412: return "隐士";
- case 422: return "侠盗";
- case 500: return "海盗";
- case 510: return "拳手";
- case 511: return "斗士";
- case 512: return "冲锋队长";
- case 520: return "火枪手";
- case 521: return "大副";
- case 522: return "船长";
- case 900: return "GM";
- case 910: return "超级GM";
- default: return "";
- }
- }
- }