Rename and clean up MapleJob
This commit is contained in:
@@ -156,7 +156,7 @@ public class Character extends AbstractCharacterObject {
|
||||
private MapleGuildCharacter mgc = null;
|
||||
private MaplePartyCharacter mpc = null;
|
||||
private Inventory[] inventory;
|
||||
private MapleJob job = MapleJob.BEGINNER;
|
||||
private Job job = Job.BEGINNER;
|
||||
private MapleMessenger messenger = null;
|
||||
private MapleMiniGame miniGame;
|
||||
private MapleRockPaperScissor rps;
|
||||
@@ -322,37 +322,37 @@ public class Character extends AbstractCharacterObject {
|
||||
setPosition(new Point(0, 0));
|
||||
}
|
||||
|
||||
private static MapleJob getJobStyleInternal(int jobid, byte opt) {
|
||||
private static Job getJobStyleInternal(int jobid, byte opt) {
|
||||
int jobtype = jobid / 100;
|
||||
|
||||
if (jobtype == MapleJob.WARRIOR.getId() / 100 || jobtype == MapleJob.DAWNWARRIOR1.getId() / 100 || jobtype == MapleJob.ARAN1.getId() / 100) {
|
||||
return (MapleJob.WARRIOR);
|
||||
} else if (jobtype == MapleJob.MAGICIAN.getId() / 100 || jobtype == MapleJob.BLAZEWIZARD1.getId() / 100 || jobtype == MapleJob.EVAN1.getId() / 100) {
|
||||
return (MapleJob.MAGICIAN);
|
||||
} else if (jobtype == MapleJob.BOWMAN.getId() / 100 || jobtype == MapleJob.WINDARCHER1.getId() / 100) {
|
||||
if (jobid / 10 == MapleJob.CROSSBOWMAN.getId() / 10) {
|
||||
return (MapleJob.CROSSBOWMAN);
|
||||
if (jobtype == Job.WARRIOR.getId() / 100 || jobtype == Job.DAWNWARRIOR1.getId() / 100 || jobtype == Job.ARAN1.getId() / 100) {
|
||||
return (Job.WARRIOR);
|
||||
} else if (jobtype == Job.MAGICIAN.getId() / 100 || jobtype == Job.BLAZEWIZARD1.getId() / 100 || jobtype == Job.EVAN1.getId() / 100) {
|
||||
return (Job.MAGICIAN);
|
||||
} else if (jobtype == Job.BOWMAN.getId() / 100 || jobtype == Job.WINDARCHER1.getId() / 100) {
|
||||
if (jobid / 10 == Job.CROSSBOWMAN.getId() / 10) {
|
||||
return (Job.CROSSBOWMAN);
|
||||
} else {
|
||||
return (MapleJob.BOWMAN);
|
||||
return (Job.BOWMAN);
|
||||
}
|
||||
} else if (jobtype == MapleJob.THIEF.getId() / 100 || jobtype == MapleJob.NIGHTWALKER1.getId() / 100) {
|
||||
return (MapleJob.THIEF);
|
||||
} else if (jobtype == MapleJob.PIRATE.getId() / 100 || jobtype == MapleJob.THUNDERBREAKER1.getId() / 100) {
|
||||
} else if (jobtype == Job.THIEF.getId() / 100 || jobtype == Job.NIGHTWALKER1.getId() / 100) {
|
||||
return (Job.THIEF);
|
||||
} else if (jobtype == Job.PIRATE.getId() / 100 || jobtype == Job.THUNDERBREAKER1.getId() / 100) {
|
||||
if (opt == (byte) 0x80) {
|
||||
return (MapleJob.BRAWLER);
|
||||
return (Job.BRAWLER);
|
||||
} else {
|
||||
return (MapleJob.GUNSLINGER);
|
||||
return (Job.GUNSLINGER);
|
||||
}
|
||||
}
|
||||
|
||||
return (MapleJob.BEGINNER);
|
||||
return (Job.BEGINNER);
|
||||
}
|
||||
|
||||
public MapleJob getJobStyle(byte opt) {
|
||||
public Job getJobStyle(byte opt) {
|
||||
return getJobStyleInternal(this.getJob().getId(), opt);
|
||||
}
|
||||
|
||||
public MapleJob getJobStyle() {
|
||||
public Job getJobStyle() {
|
||||
return getJobStyle((byte) ((this.getStr() > this.getDex()) ? 0x80 : 0x40));
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ public class Character extends AbstractCharacterObject {
|
||||
ret.int_ = 4;
|
||||
ret.luk = 4;
|
||||
ret.map = null;
|
||||
ret.job = MapleJob.BEGINNER;
|
||||
ret.job = Job.BEGINNER;
|
||||
ret.level = 1;
|
||||
ret.accountid = c.getAccID();
|
||||
ret.buddylist = new BuddyList(20);
|
||||
@@ -693,7 +693,7 @@ public class Character extends AbstractCharacterObject {
|
||||
|
||||
public int calculateMaxBaseDamage(int watk, WeaponType weapon) {
|
||||
int mainstat, secondarystat;
|
||||
if (getJob().isA(MapleJob.THIEF) && weapon == WeaponType.DAGGER_OTHER) {
|
||||
if (getJob().isA(Job.THIEF) && weapon == WeaponType.DAGGER_OTHER) {
|
||||
weapon = WeaponType.DAGGER_THIEVES;
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ public class Character extends AbstractCharacterObject {
|
||||
if (weapon_item != null) {
|
||||
maxbasedamage = calculateMaxBaseDamage(watk, ii.getWeaponType(weapon_item.getItemId()));
|
||||
} else {
|
||||
if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
double weapMulti = 3;
|
||||
if (job.getId() % 100 != 0) {
|
||||
weapMulti = 4.2;
|
||||
@@ -1040,7 +1040,7 @@ public class Character extends AbstractCharacterObject {
|
||||
}, 777);
|
||||
}
|
||||
|
||||
public synchronized void changeJob(MapleJob newJob) {
|
||||
public synchronized void changeJob(Job newJob) {
|
||||
if (newJob == null) {
|
||||
return;//the fuck you doing idiot!
|
||||
}
|
||||
@@ -1783,7 +1783,7 @@ public class Character extends AbstractCharacterObject {
|
||||
berserkSchedule.cancel(false);
|
||||
}
|
||||
final Character chr = this;
|
||||
if (job.equals(MapleJob.DARKKNIGHT)) {
|
||||
if (job.equals(Job.DARKKNIGHT)) {
|
||||
Skill BerserkX = SkillFactory.getSkill(DarkKnight.BERSERK);
|
||||
final int skilllevel = getSkillLevel(BerserkX);
|
||||
if (skilllevel > 0) {
|
||||
@@ -4227,7 +4227,7 @@ public class Character extends AbstractCharacterObject {
|
||||
recalcMseList.add(re.getValue().getLeft());
|
||||
}
|
||||
|
||||
boolean mageJob = this.getJobStyle() == MapleJob.MAGICIAN;
|
||||
boolean mageJob = this.getJobStyle() == Job.MAGICIAN;
|
||||
do {
|
||||
List<MapleStatEffect> mseList = recalcMseList;
|
||||
recalcMseList = new LinkedList<>();
|
||||
@@ -4564,7 +4564,7 @@ public class Character extends AbstractCharacterObject {
|
||||
updateLocalStats();
|
||||
}
|
||||
|
||||
private static int getJobMapChair(MapleJob job) {
|
||||
private static int getJobMapChair(Job job) {
|
||||
switch (job.getId() / 1000) {
|
||||
case 0:
|
||||
return Beginner.MAP_CHAIR;
|
||||
@@ -5143,7 +5143,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return count;
|
||||
}
|
||||
|
||||
public MapleJob getJob() {
|
||||
public Job getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
@@ -6220,7 +6220,7 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
private int getChangedJobSp(MapleJob newJob) {
|
||||
private int getChangedJobSp(Job newJob) {
|
||||
int curSp = getUsedSp(newJob) + getJobRemainingSp(newJob);
|
||||
int spGain = 0;
|
||||
int expectedSp = getJobLevelSp(level - 10, newJob, GameConstants.getJobBranch(newJob));
|
||||
@@ -6231,7 +6231,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return getSpGain(spGain, curSp, newJob);
|
||||
}
|
||||
|
||||
private int getUsedSp(MapleJob job) {
|
||||
private int getUsedSp(Job job) {
|
||||
int jobId = job.getId();
|
||||
int spUsed = 0;
|
||||
|
||||
@@ -6245,21 +6245,21 @@ public class Character extends AbstractCharacterObject {
|
||||
return spUsed;
|
||||
}
|
||||
|
||||
private int getJobLevelSp(int level, MapleJob job, int jobBranch) {
|
||||
if (getJobStyleInternal(job.getId(), (byte) 0x40) == MapleJob.MAGICIAN) {
|
||||
private int getJobLevelSp(int level, Job job, int jobBranch) {
|
||||
if (getJobStyleInternal(job.getId(), (byte) 0x40) == Job.MAGICIAN) {
|
||||
level += 2; // starts earlier, level 8
|
||||
}
|
||||
|
||||
return 3 * level + GameConstants.getChangeJobSpUpgrade(jobBranch);
|
||||
}
|
||||
|
||||
private int getJobMaxSp(MapleJob job) {
|
||||
private int getJobMaxSp(Job job) {
|
||||
int jobBranch = GameConstants.getJobBranch(job);
|
||||
int jobRange = GameConstants.getJobUpgradeLevelRange(jobBranch);
|
||||
return getJobLevelSp(jobRange, job, jobBranch);
|
||||
}
|
||||
|
||||
private int getJobRemainingSp(MapleJob job) {
|
||||
private int getJobRemainingSp(Job job) {
|
||||
int skillBook = GameConstants.getSkillBook(job.getId());
|
||||
|
||||
int ret = 0;
|
||||
@@ -6270,12 +6270,12 @@ public class Character extends AbstractCharacterObject {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private int getSpGain(int spGain, MapleJob job) {
|
||||
private int getSpGain(int spGain, Job job) {
|
||||
int curSp = getUsedSp(job) + getJobRemainingSp(job);
|
||||
return getSpGain(spGain, curSp, job);
|
||||
}
|
||||
|
||||
private int getSpGain(int spGain, int curSp, MapleJob job) {
|
||||
private int getSpGain(int spGain, int curSp, Job job) {
|
||||
int maxSp = getJobMaxSp(job);
|
||||
|
||||
spGain = Math.min(spGain, maxSp - curSp);
|
||||
@@ -6344,46 +6344,46 @@ public class Character extends AbstractCharacterObject {
|
||||
if (isBeginner) {
|
||||
addhp += Randomizer.rand(12, 16);
|
||||
addmp += Randomizer.rand(10, 12);
|
||||
} else if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
|
||||
} else if (job.isA(Job.WARRIOR) || job.isA(Job.DAWNWARRIOR1)) {
|
||||
improvingMaxHP = isCygnus() ? SkillFactory.getSkill(DawnWarrior.MAX_HP_INCREASE) : SkillFactory.getSkill(Warrior.IMPROVED_MAXHP);
|
||||
if (job.isA(MapleJob.CRUSADER)) {
|
||||
if (job.isA(Job.CRUSADER)) {
|
||||
improvingMaxMP = SkillFactory.getSkill(1210000);
|
||||
} else if (job.isA(MapleJob.DAWNWARRIOR2)) {
|
||||
} else if (job.isA(Job.DAWNWARRIOR2)) {
|
||||
improvingMaxMP = SkillFactory.getSkill(11110000);
|
||||
}
|
||||
improvingMaxHPLevel = getSkillLevel(improvingMaxHP);
|
||||
addhp += Randomizer.rand(24, 28);
|
||||
addmp += Randomizer.rand(4, 6);
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if (job.isA(Job.MAGICIAN) || job.isA(Job.BLAZEWIZARD1)) {
|
||||
improvingMaxMP = isCygnus() ? SkillFactory.getSkill(BlazeWizard.INCREASING_MAX_MP) : SkillFactory.getSkill(Magician.IMPROVED_MAX_MP_INCREASE);
|
||||
improvingMaxMPLevel = getSkillLevel(improvingMaxMP);
|
||||
addhp += Randomizer.rand(10, 14);
|
||||
addmp += Randomizer.rand(22, 24);
|
||||
} else if (job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.THIEF) || (job.getId() > 1299 && job.getId() < 1500)) {
|
||||
} else if (job.isA(Job.BOWMAN) || job.isA(Job.THIEF) || (job.getId() > 1299 && job.getId() < 1500)) {
|
||||
addhp += Randomizer.rand(20, 24);
|
||||
addmp += Randomizer.rand(14, 16);
|
||||
} else if (job.isA(MapleJob.GM)) {
|
||||
} else if (job.isA(Job.GM)) {
|
||||
addhp += 30000;
|
||||
addmp += 30000;
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
improvingMaxHP = isCygnus() ? SkillFactory.getSkill(ThunderBreaker.IMPROVE_MAX_HP) : SkillFactory.getSkill(Brawler.IMPROVE_MAX_HP);
|
||||
improvingMaxHPLevel = getSkillLevel(improvingMaxHP);
|
||||
addhp += Randomizer.rand(22, 28);
|
||||
addmp += Randomizer.rand(18, 23);
|
||||
} else if (job.isA(MapleJob.ARAN1)) {
|
||||
} else if (job.isA(Job.ARAN1)) {
|
||||
addhp += Randomizer.rand(44, 48);
|
||||
int aids = Randomizer.rand(4, 8);
|
||||
addmp += aids + Math.floor(aids * 0.1);
|
||||
}
|
||||
if (improvingMaxHPLevel > 0 && (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.PIRATE) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.THUNDERBREAKER1))) {
|
||||
if (improvingMaxHPLevel > 0 && (job.isA(Job.WARRIOR) || job.isA(Job.PIRATE) || job.isA(Job.DAWNWARRIOR1) || job.isA(Job.THUNDERBREAKER1))) {
|
||||
addhp += improvingMaxHP.getEffect(improvingMaxHPLevel).getX();
|
||||
}
|
||||
if (improvingMaxMPLevel > 0 && (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.CRUSADER) || job.isA(MapleJob.BLAZEWIZARD1))) {
|
||||
if (improvingMaxMPLevel > 0 && (job.isA(Job.MAGICIAN) || job.isA(Job.CRUSADER) || job.isA(Job.BLAZEWIZARD1))) {
|
||||
addmp += improvingMaxMP.getEffect(improvingMaxMPLevel).getX();
|
||||
}
|
||||
|
||||
if (YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (getJobStyle() == MapleJob.MAGICIAN) {
|
||||
if (getJobStyle() == Job.MAGICIAN) {
|
||||
addmp += localint_ / 20;
|
||||
} else {
|
||||
addmp += localint_ / 10;
|
||||
@@ -6855,7 +6855,7 @@ public class Character extends AbstractCharacterObject {
|
||||
// skipping pets, probably unneeded here
|
||||
|
||||
ret.level = rs.getInt("level");
|
||||
ret.job = MapleJob.getById(rs.getInt("job"));
|
||||
ret.job = Job.getById(rs.getInt("job"));
|
||||
ret.str = rs.getInt("str");
|
||||
ret.dex = rs.getInt("dex");
|
||||
ret.int_ = rs.getInt("int");
|
||||
@@ -6994,7 +6994,7 @@ public class Character extends AbstractCharacterObject {
|
||||
ret.setGMLevel(rs.getInt("gm"));
|
||||
ret.skinColor = MapleSkinColor.getById(rs.getInt("skincolor"));
|
||||
ret.gender = rs.getInt("gender");
|
||||
ret.job = MapleJob.getById(rs.getInt("job"));
|
||||
ret.job = Job.getById(rs.getInt("job"));
|
||||
ret.finishedDojoTutorial = rs.getInt("finishedDojoTutorial") == 1;
|
||||
ret.vanquisherKills = rs.getInt("vanquisherKills");
|
||||
ret.omokwins = rs.getInt("omokwins");
|
||||
@@ -7580,7 +7580,7 @@ public class Character extends AbstractCharacterObject {
|
||||
message("You have used a safety charm, so your EXP points have not been decreased.");
|
||||
InventoryManipulator.removeById(client, ItemConstants.getInventoryType(charmID[i]), charmID[i], 1, true, false);
|
||||
usedSafetyCharm = true;
|
||||
} else if (getJob() != MapleJob.BEGINNER) { //Hmm...
|
||||
} else if (getJob() != Job.BEGINNER) { //Hmm...
|
||||
if (!FieldLimit.NO_EXP_DECREASE.check(getMap().getFieldLimit())) { // thanks Conrad for noticing missing FieldLimit check
|
||||
int XPdummy = ExpTable.getExpNeededForLevel(getLevel());
|
||||
|
||||
@@ -7787,11 +7787,11 @@ public class Character extends AbstractCharacterObject {
|
||||
localint_ += getInt() * mwarr / 100;
|
||||
localluk += getLuk() * mwarr / 100;
|
||||
}
|
||||
if (job.isA(MapleJob.BOWMAN)) {
|
||||
if (job.isA(Job.BOWMAN)) {
|
||||
Skill expert = null;
|
||||
if (job.isA(MapleJob.MARKSMAN)) {
|
||||
if (job.isA(Job.MARKSMAN)) {
|
||||
expert = SkillFactory.getSkill(3220004);
|
||||
} else if (job.isA(MapleJob.BOWMASTER)) {
|
||||
} else if (job.isA(Job.BOWMASTER)) {
|
||||
expert = SkillFactory.getSkill(3120005);
|
||||
}
|
||||
if (expert != null) {
|
||||
@@ -7828,7 +7828,7 @@ public class Character extends AbstractCharacterObject {
|
||||
localmagic += blessing * 2;
|
||||
}
|
||||
|
||||
if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.PIRATE) || job.isA(MapleJob.NIGHTWALKER1) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
if (job.isA(Job.THIEF) || job.isA(Job.BOWMAN) || job.isA(Job.PIRATE) || job.isA(Job.NIGHTWALKER1) || job.isA(Job.WINDARCHER1)) {
|
||||
Item weapon_item = getInventory(InventoryType.EQUIPPED).getItem((short) -11);
|
||||
if (weapon_item != null) {
|
||||
WeaponType weapon = ii.getWeaponType(weapon_item.getItemId());
|
||||
@@ -9152,7 +9152,7 @@ public class Character extends AbstractCharacterObject {
|
||||
this.itemEffect = itemEffect;
|
||||
}
|
||||
|
||||
public void setJob(MapleJob job) {
|
||||
public void setJob(Job job) {
|
||||
this.job = job;
|
||||
}
|
||||
|
||||
@@ -11178,7 +11178,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return;
|
||||
}
|
||||
addReborns();
|
||||
changeJob(MapleJob.BEGINNER);
|
||||
changeJob(Job.BEGINNER);
|
||||
setLevel(0);
|
||||
levelUp(true);
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public class Family {
|
||||
family = new Family(familyid, world);
|
||||
Server.getInstance().getWorld(world).addFamily(familyid, family);
|
||||
}
|
||||
FamilyEntry familyEntry = new FamilyEntry(family, cid, name, level, MapleJob.getById(jobID));
|
||||
FamilyEntry familyEntry = new FamilyEntry(family, cid, name, level, Job.getById(jobID));
|
||||
family.addEntry(familyEntry);
|
||||
if (seniorid <= 0) {
|
||||
family.setLeader(familyEntry);
|
||||
|
||||
@@ -56,9 +56,9 @@ public class FamilyEntry {
|
||||
// cached values for offline players
|
||||
private String charName;
|
||||
private int level;
|
||||
private MapleJob job;
|
||||
private Job job;
|
||||
|
||||
public FamilyEntry(Family family, int characterID, String charName, int level, MapleJob job) {
|
||||
public FamilyEntry(Family family, int characterID, String charName, int level, Job job) {
|
||||
this.family = family;
|
||||
this.characterID = characterID;
|
||||
this.charName = charName;
|
||||
@@ -247,7 +247,7 @@ public class FamilyEntry {
|
||||
}
|
||||
}
|
||||
|
||||
public MapleJob getJob() {
|
||||
public Job getJob() {
|
||||
Character chr = character;
|
||||
if (chr != null) {
|
||||
return chr.getJob();
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package client;
|
||||
|
||||
public enum MapleJob {
|
||||
public enum Job {
|
||||
BEGINNER(0),
|
||||
|
||||
WARRIOR(100),
|
||||
@@ -58,17 +58,17 @@ public enum MapleJob {
|
||||
|
||||
LEGEND(2000), EVAN(2001),
|
||||
ARAN1(2100), ARAN2(2110), ARAN3(2111), ARAN4(2112),
|
||||
|
||||
|
||||
EVAN1(2200), EVAN2(2210), EVAN3(2211), EVAN4(2212), EVAN5(2213), EVAN6(2214),
|
||||
EVAN7(2215), EVAN8(2216), EVAN9(2217), EVAN10(2218);
|
||||
|
||||
final int jobid;
|
||||
final static int maxId = 22; // maxId = (EVAN / 100);
|
||||
|
||||
private MapleJob(int id) {
|
||||
|
||||
Job(int id) {
|
||||
jobid = id;
|
||||
}
|
||||
|
||||
|
||||
public static int getMax() {
|
||||
return maxId;
|
||||
}
|
||||
@@ -77,8 +77,8 @@ public enum MapleJob {
|
||||
return jobid;
|
||||
}
|
||||
|
||||
public static MapleJob getById(int id) {
|
||||
for (MapleJob l : MapleJob.values()) {
|
||||
public static Job getById(int id) {
|
||||
for (Job l : Job.values()) {
|
||||
if (l.getId() == id) {
|
||||
return l;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public enum MapleJob {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MapleJob getBy5ByteEncoding(int encoded) {
|
||||
public static Job getBy5ByteEncoding(int encoded) {
|
||||
switch (encoded) {
|
||||
case 2:
|
||||
return WARRIOR;
|
||||
@@ -114,12 +114,12 @@ public enum MapleJob {
|
||||
return BEGINNER;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isA(MapleJob basejob) { // thanks Steve (kaito1410) for pointing out an improvement here
|
||||
|
||||
public boolean isA(Job basejob) { // thanks Steve (kaito1410) for pointing out an improvement here
|
||||
int basebranch = basejob.getId() / 10;
|
||||
return (getId() / 10 == basebranch && getId() >= basejob.getId()) || (basebranch % 10 == 0 && getId() / 100 == basejob.getId() / 100);
|
||||
}
|
||||
|
||||
|
||||
public int getJobNiche() {
|
||||
return (jobid / 100) % 10;
|
||||
|
||||
@@ -25,7 +25,7 @@ package client.command.commands.gm2;
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.command.Command;
|
||||
|
||||
public class JobCommand extends Command {
|
||||
@@ -43,7 +43,7 @@ public class JobCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
player.changeJob(MapleJob.getById(jobid));
|
||||
player.changeJob(Job.getById(jobid));
|
||||
player.equipChanged();
|
||||
} else if (params.length == 2) {
|
||||
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
@@ -55,7 +55,7 @@ public class JobCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
victim.changeJob(MapleJob.getById(jobid));
|
||||
victim.changeJob(Job.getById(jobid));
|
||||
player.equipChanged();
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found.");
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MaxSkillCommand extends Command {
|
||||
} catch (NullPointerException npe) { }
|
||||
}
|
||||
|
||||
if (player.getJob().isA(MapleJob.ARAN1) || player.getJob().isA(MapleJob.LEGEND)) {
|
||||
if (player.getJob().isA(Job.ARAN1) || player.getJob().isA(Job.LEGEND)) {
|
||||
Skill skill = SkillFactory.getSkill(5001005);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
} else {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ResetSkillCommand extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getJob().isA(MapleJob.ARAN1) || player.getJob().isA(MapleJob.LEGEND)) {
|
||||
if (player.getJob().isA(Job.ARAN1) || player.getJob().isA(Job.LEGEND)) {
|
||||
Skill skill = SkillFactory.getSkill(5001005);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
package client.creator;
|
||||
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -37,7 +37,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
* @author RonanLana
|
||||
*/
|
||||
public class CharacterFactoryRecipe {
|
||||
private MapleJob job;
|
||||
private Job job;
|
||||
private int level, map, top, bottom, shoes, weapon;
|
||||
private int str = 4, dex = 4, int_ = 4, luk = 4;
|
||||
private int maxHp = 50, maxMp = 5;
|
||||
@@ -48,7 +48,7 @@ public class CharacterFactoryRecipe {
|
||||
private List<Pair<Item, InventoryType>> itemsWithType = new LinkedList<>();
|
||||
private Map<InventoryType, AtomicInteger> runningTypePosition = new LinkedHashMap<>();
|
||||
|
||||
public CharacterFactoryRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
public CharacterFactoryRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
this.job = job;
|
||||
this.level = level;
|
||||
this.map = map;
|
||||
@@ -121,7 +121,7 @@ public class CharacterFactoryRecipe {
|
||||
itemsWithType.add(new Pair<>(new Item(itemid, (short) p.getAndIncrement(), (short) quantity), itemType));
|
||||
}
|
||||
|
||||
public MapleJob getJob() {
|
||||
public Job getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.novice;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -31,7 +31,7 @@ import client.inventory.InventoryType;
|
||||
*/
|
||||
public class BeginnerCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
giveItem(recipe, 4161001, 1, InventoryType.ETC);
|
||||
return recipe;
|
||||
@@ -42,7 +42,7 @@ public class BeginnerCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.BEGINNER, 1, 10000, top, bottom, shoes, weapon));
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BEGINNER, 1, 10000, top, bottom, shoes, weapon));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.novice;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -31,7 +31,7 @@ import client.inventory.InventoryType;
|
||||
*/
|
||||
public class LegendCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
giveItem(recipe, 4161048, 1, InventoryType.ETC);
|
||||
return recipe;
|
||||
@@ -42,7 +42,7 @@ public class LegendCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.LEGEND, 1, 914000000, top, bottom, shoes, weapon));
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.LEGEND, 1, 914000000, top, bottom, shoes, weapon));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.novice;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -31,7 +31,7 @@ import client.inventory.InventoryType;
|
||||
*/
|
||||
public class NoblesseCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
giveItem(recipe, 4161047, 1, InventoryType.ETC);
|
||||
return recipe;
|
||||
@@ -42,7 +42,7 @@ public class NoblesseCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int top, int bottom, int shoes, int weapon, int gender) {
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.NOBLESSE, 1, 130030000, top, bottom, shoes, weapon));
|
||||
int status = createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.NOBLESSE, 1, 130030000, top, bottom, shoes, weapon));
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.veteran;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -36,7 +36,7 @@ public class BowmanCreator extends CharacterFactory {
|
||||
private static int[] weapons = {1452005, 1462000};
|
||||
private static int[] startingHpMp = {797, 404};
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -70,6 +70,6 @@ public class BowmanCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.BOWMAN, 30, 100000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.BOWMAN, 30, 100000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.veteran;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.creator.CharacterFactory;
|
||||
@@ -40,7 +40,7 @@ public class MagicianCreator extends CharacterFactory {
|
||||
private static int[] startingHpMp = {405, 729};
|
||||
private static int[] mpGain = {0, 40, 80, 118, 156, 194, 230, 266, 302, 336, 370};
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -93,6 +93,6 @@ public class MagicianCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.MAGICIAN, 30, 101000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.MAGICIAN, 30, 101000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.veteran;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -36,7 +36,7 @@ public class PirateCreator extends CharacterFactory {
|
||||
private static int[] weapons = {1482004, 1492004};
|
||||
private static int[] startingHpMp = {846, 503};
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -74,6 +74,6 @@ public class PirateCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.PIRATE, 30, 120000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.PIRATE, 30, 120000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.veteran;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -36,7 +36,7 @@ public class ThiefCreator extends CharacterFactory {
|
||||
private static int[] weapons = {1472008, 1332012};
|
||||
private static int[] startingHpMp = {794, 407};
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -72,6 +72,6 @@ public class ThiefCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.THIEF, 30, 103000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.THIEF, 30, 103000000, equips[gender], equips[2 + gender], equips[4], weapons[0]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package client.creator.veteran;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.creator.CharacterFactory;
|
||||
@@ -40,7 +40,7 @@ public class WarriorCreator extends CharacterFactory {
|
||||
private static int[] startingHpMp = {905, 208};
|
||||
private static int[] hpGain = {0, 72, 144, 212, 280, 348, 412, 476, 540, 600, 660};
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(MapleJob job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
@@ -93,6 +93,6 @@ public class WarriorCreator extends CharacterFactory {
|
||||
}
|
||||
|
||||
public static int createCharacter(Client c, String name, int face, int hair, int skin, int gender, int improveSp) {
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(MapleJob.WARRIOR, 30, 102000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
|
||||
return createNewCharacter(c, name, face, hair, skin, gender, createRecipe(Job.WARRIOR, 30, 102000000, equips[gender], equips[2 + gender], equips[4], weapons[0], gender, improveSp));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public class AssignAPProcessor {
|
||||
//c.getPlayer().message("SDL: s" + eqpStr + " d" + eqpDex + " l" + eqpLuk + " BASE STATS --> STR: " + chr.getStr() + " DEX: " + chr.getDex() + " INT: " + chr.getInt() + " LUK: " + chr.getLuk());
|
||||
//c.getPlayer().message("SUM EQUIP STATS -> STR: " + str + " DEX: " + dex + " LUK: " + luk + " INT: " + int_);
|
||||
|
||||
MapleJob stance = c.getPlayer().getJobStyle(opt);
|
||||
Job stance = c.getPlayer().getJobStyle(opt);
|
||||
int prStat = 0, scStat = 0, trStat = 0, temp, tempAp = remainingAp, CAP;
|
||||
if (tempAp < 1) return;
|
||||
|
||||
@@ -413,8 +413,8 @@ public class AssignAPProcessor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static MapleStat getQuaternaryStat(MapleJob stance) {
|
||||
if(stance != MapleJob.MAGICIAN) return MapleStat.INT;
|
||||
private static MapleStat getQuaternaryStat(Job stance) {
|
||||
if(stance != Job.MAGICIAN) return MapleStat.INT;
|
||||
return MapleStat.STR;
|
||||
}
|
||||
|
||||
@@ -520,14 +520,14 @@ public class AssignAPProcessor {
|
||||
|
||||
int mp = player.getMaxMp();
|
||||
int level = player.getLevel();
|
||||
MapleJob job = player.getJob();
|
||||
Job job = player.getJob();
|
||||
|
||||
boolean canWash = true;
|
||||
if (job.isA(MapleJob.SPEARMAN) && mp < 4 * level + 156) {
|
||||
if (job.isA(Job.SPEARMAN) && mp < 4 * level + 156) {
|
||||
canWash = false;
|
||||
} else if ((job.isA(MapleJob.FIGHTER) || job.isA(MapleJob.ARAN1)) && mp < 4 * level + 56) {
|
||||
} else if ((job.isA(Job.FIGHTER) || job.isA(Job.ARAN1)) && mp < 4 * level + 56) {
|
||||
canWash = false;
|
||||
} else if (job.isA(MapleJob.THIEF) && job.getId() % 100 > 0 && mp < level * 14 - 4) {
|
||||
} else if (job.isA(Job.THIEF) && job.getId() % 100 > 0 && mp < level * 14 - 4) {
|
||||
canWash = false;
|
||||
} else if (mp < level * 14 + 148) {
|
||||
canWash = false;
|
||||
@@ -619,12 +619,12 @@ public class AssignAPProcessor {
|
||||
}
|
||||
|
||||
private static int calcHpChange(Character player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
Job job = player.getJob();
|
||||
int MaxHP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
|
||||
if (job.isA(Job.WARRIOR) || job.isA(Job.DAWNWARRIOR1)) {
|
||||
if(!usedAPReset) {
|
||||
Skill increaseHP = SkillFactory.getSkill(job.isA(MapleJob.DAWNWARRIOR1) ? DawnWarrior.MAX_HP_INCREASE : Warrior.IMPROVED_MAXHP);
|
||||
Skill increaseHP = SkillFactory.getSkill(job.isA(Job.DAWNWARRIOR1) ? DawnWarrior.MAX_HP_INCREASE : Warrior.IMPROVED_MAXHP);
|
||||
int sLvl = player.getSkillLevel(increaseHP);
|
||||
|
||||
if(sLvl > 0)
|
||||
@@ -640,7 +640,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxHP += 20;
|
||||
}
|
||||
} else if(job.isA(MapleJob.ARAN1)) {
|
||||
} else if(job.isA(Job.ARAN1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 20;
|
||||
@@ -650,7 +650,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxHP += 28;
|
||||
}
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if (job.isA(Job.MAGICIAN) || job.isA(Job.BLAZEWIZARD1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 6;
|
||||
@@ -660,7 +660,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxHP += 6;
|
||||
}
|
||||
} else if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
} else if (job.isA(Job.THIEF) || job.isA(Job.NIGHTWALKER1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 16;
|
||||
@@ -670,7 +670,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxHP += 16;
|
||||
}
|
||||
} else if(job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
} else if(job.isA(Job.BOWMAN) || job.isA(Job.WINDARCHER1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if (usedAPReset) {
|
||||
MaxHP += 16;
|
||||
@@ -680,9 +680,9 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxHP += 16;
|
||||
}
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
if(!usedAPReset) {
|
||||
Skill increaseHP = SkillFactory.getSkill(job.isA(MapleJob.PIRATE) ? Brawler.IMPROVE_MAX_HP : ThunderBreaker.IMPROVE_MAX_HP);
|
||||
Skill increaseHP = SkillFactory.getSkill(job.isA(Job.PIRATE) ? Brawler.IMPROVE_MAX_HP : ThunderBreaker.IMPROVE_MAX_HP);
|
||||
int sLvl = player.getSkillLevel(increaseHP);
|
||||
|
||||
if(sLvl > 0)
|
||||
@@ -712,10 +712,10 @@ public class AssignAPProcessor {
|
||||
}
|
||||
|
||||
private static int calcMpChange(Character player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
Job job = player.getJob();
|
||||
int MaxMP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||
if (job.isA(Job.WARRIOR) || job.isA(Job.DAWNWARRIOR1) || job.isA(Job.ARAN1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(2, 4) + (player.getInt() / 10));
|
||||
@@ -725,9 +725,9 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxMP += 3;
|
||||
}
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if (job.isA(Job.MAGICIAN) || job.isA(Job.BLAZEWIZARD1)) {
|
||||
if(!usedAPReset) {
|
||||
Skill increaseMP = SkillFactory.getSkill(job.isA(MapleJob.BLAZEWIZARD1) ? BlazeWizard.INCREASING_MAX_MP : Magician.IMPROVED_MAX_MP_INCREASE);
|
||||
Skill increaseMP = SkillFactory.getSkill(job.isA(Job.BLAZEWIZARD1) ? BlazeWizard.INCREASING_MAX_MP : Magician.IMPROVED_MAX_MP_INCREASE);
|
||||
int sLvl = player.getSkillLevel(increaseMP);
|
||||
|
||||
if(sLvl > 0)
|
||||
@@ -743,7 +743,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxMP += 18;
|
||||
}
|
||||
} else if (job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
} else if (job.isA(Job.BOWMAN) || job.isA(Job.WINDARCHER1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(6, 8) + (player.getInt() / 10));
|
||||
@@ -753,7 +753,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxMP += 10;
|
||||
}
|
||||
} else if(job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
} else if(job.isA(Job.THIEF) || job.isA(Job.NIGHTWALKER1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(6, 8) + (player.getInt() / 10));
|
||||
@@ -763,7 +763,7 @@ public class AssignAPProcessor {
|
||||
} else {
|
||||
MaxMP += 10;
|
||||
}
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
if(YamlConfig.config.server.USE_RANDOMIZE_HPMP_GAIN) {
|
||||
if(!usedAPReset) {
|
||||
MaxMP += (Randomizer.rand(7, 9) + (player.getInt() / 10));
|
||||
@@ -788,18 +788,18 @@ public class AssignAPProcessor {
|
||||
return MaxMP;
|
||||
}
|
||||
|
||||
private static int takeHp(MapleJob job) {
|
||||
private static int takeHp(Job job) {
|
||||
int MaxHP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||
if (job.isA(Job.WARRIOR) || job.isA(Job.DAWNWARRIOR1) || job.isA(Job.ARAN1)) {
|
||||
MaxHP += 54;
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if (job.isA(Job.MAGICIAN) || job.isA(Job.BLAZEWIZARD1)) {
|
||||
MaxHP += 10;
|
||||
} else if (job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
} else if (job.isA(Job.THIEF) || job.isA(Job.NIGHTWALKER1)) {
|
||||
MaxHP += 20;
|
||||
} else if(job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
} else if(job.isA(Job.BOWMAN) || job.isA(Job.WINDARCHER1)) {
|
||||
MaxHP += 20;
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
MaxHP += 42;
|
||||
} else {
|
||||
MaxHP += 12;
|
||||
@@ -808,18 +808,18 @@ public class AssignAPProcessor {
|
||||
return MaxHP;
|
||||
}
|
||||
|
||||
private static int takeMp(MapleJob job) {
|
||||
private static int takeMp(Job job) {
|
||||
int MaxMP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||
if (job.isA(Job.WARRIOR) || job.isA(Job.DAWNWARRIOR1) || job.isA(Job.ARAN1)) {
|
||||
MaxMP += 4;
|
||||
} else if (job.isA(MapleJob.MAGICIAN) || job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if (job.isA(Job.MAGICIAN) || job.isA(Job.BLAZEWIZARD1)) {
|
||||
MaxMP += 31;
|
||||
} else if (job.isA(MapleJob.BOWMAN) || job.isA(MapleJob.WINDARCHER1)) {
|
||||
} else if (job.isA(Job.BOWMAN) || job.isA(Job.WINDARCHER1)) {
|
||||
MaxMP += 12;
|
||||
} else if(job.isA(MapleJob.THIEF) || job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
} else if(job.isA(Job.THIEF) || job.isA(Job.NIGHTWALKER1)) {
|
||||
MaxMP += 12;
|
||||
} else if (job.isA(MapleJob.PIRATE) || job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if (job.isA(Job.PIRATE) || job.isA(Job.THUNDERBREAKER1)) {
|
||||
MaxMP += 16;
|
||||
} else {
|
||||
MaxMP += 8;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package constants.game;
|
||||
|
||||
import client.Disease;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import config.YamlConfig;
|
||||
import constants.skills.Aran;
|
||||
import provider.*;
|
||||
@@ -307,7 +307,7 @@ public class GameConstants {
|
||||
String name = jobNames.get(jobid);
|
||||
|
||||
if(name == null) {
|
||||
MapleJob job = MapleJob.getById(jobid);
|
||||
Job job = Job.getById(jobid);
|
||||
|
||||
if(job != null) {
|
||||
name = job.name().toLowerCase();
|
||||
@@ -364,40 +364,40 @@ public class GameConstants {
|
||||
}
|
||||
}
|
||||
|
||||
public static byte getHallOfFameBranch(MapleJob job, int mapid) {
|
||||
public static byte getHallOfFameBranch(Job job, int mapid) {
|
||||
if(!isHallOfFameMap(mapid)) {
|
||||
return (byte) (26 + 4 * (mapid / 100000000)); // custom, 400 pnpcs available per continent
|
||||
}
|
||||
|
||||
if(job.isA(MapleJob.WARRIOR)) {
|
||||
if(job.isA(Job.WARRIOR)) {
|
||||
return 10;
|
||||
} else if(job.isA(MapleJob.MAGICIAN)) {
|
||||
} else if(job.isA(Job.MAGICIAN)) {
|
||||
return 11;
|
||||
} else if(job.isA(MapleJob.BOWMAN)) {
|
||||
} else if(job.isA(Job.BOWMAN)) {
|
||||
return 12;
|
||||
} else if(job.isA(MapleJob.THIEF)) {
|
||||
} else if(job.isA(Job.THIEF)) {
|
||||
return 13;
|
||||
} else if(job.isA(MapleJob.PIRATE)) {
|
||||
} else if(job.isA(Job.PIRATE)) {
|
||||
return 14;
|
||||
} else if(job.isA(MapleJob.DAWNWARRIOR1)) {
|
||||
} else if(job.isA(Job.DAWNWARRIOR1)) {
|
||||
return 15;
|
||||
} else if(job.isA(MapleJob.BLAZEWIZARD1)) {
|
||||
} else if(job.isA(Job.BLAZEWIZARD1)) {
|
||||
return 16;
|
||||
} else if(job.isA(MapleJob.WINDARCHER1)) {
|
||||
} else if(job.isA(Job.WINDARCHER1)) {
|
||||
return 17;
|
||||
} else if(job.isA(MapleJob.NIGHTWALKER1)) {
|
||||
} else if(job.isA(Job.NIGHTWALKER1)) {
|
||||
return 18;
|
||||
} else if(job.isA(MapleJob.THUNDERBREAKER1)) {
|
||||
} else if(job.isA(Job.THUNDERBREAKER1)) {
|
||||
return 19;
|
||||
} else if(job.isA(MapleJob.ARAN1)) {
|
||||
} else if(job.isA(Job.ARAN1)) {
|
||||
return 20;
|
||||
} else if(job.isA(MapleJob.EVAN1)) {
|
||||
} else if(job.isA(Job.EVAN1)) {
|
||||
return 21;
|
||||
} else if(job.isA(MapleJob.BEGINNER)) {
|
||||
} else if(job.isA(Job.BEGINNER)) {
|
||||
return 22;
|
||||
} else if(job.isA(MapleJob.NOBLESSE)) {
|
||||
} else if(job.isA(Job.NOBLESSE)) {
|
||||
return 23;
|
||||
} else if(job.isA(MapleJob.LEGEND)) {
|
||||
} else if(job.isA(Job.LEGEND)) {
|
||||
return 24;
|
||||
} else {
|
||||
return 25;
|
||||
@@ -425,7 +425,7 @@ public class GameConstants {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getHallOfFameMapid(MapleJob job) {
|
||||
public static int getHallOfFameMapid(Job job) {
|
||||
int jobid = job.getId();
|
||||
|
||||
if(isCygnus(jobid)) {
|
||||
@@ -433,15 +433,15 @@ public class GameConstants {
|
||||
} else if(isAran(jobid)) {
|
||||
return 140010110;
|
||||
} else {
|
||||
if(job.isA(MapleJob.WARRIOR)) {
|
||||
if(job.isA(Job.WARRIOR)) {
|
||||
return 102000004;
|
||||
} else if(job.isA(MapleJob.MAGICIAN)) {
|
||||
} else if(job.isA(Job.MAGICIAN)) {
|
||||
return 101000004;
|
||||
} else if(job.isA(MapleJob.BOWMAN)) {
|
||||
} else if(job.isA(Job.BOWMAN)) {
|
||||
return 100000204;
|
||||
} else if(job.isA(MapleJob.THIEF)) {
|
||||
} else if(job.isA(Job.THIEF)) {
|
||||
return 103000008;
|
||||
} else if(job.isA(MapleJob.PIRATE)) {
|
||||
} else if(job.isA(Job.PIRATE)) {
|
||||
return 120000105;
|
||||
} else {
|
||||
return 130000110; // beginner explorers are allotted with the Cygnus, available map lul
|
||||
@@ -449,7 +449,7 @@ public class GameConstants {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getJobBranch(MapleJob job) {
|
||||
public static int getJobBranch(Job job) {
|
||||
int jobid = job.getId();
|
||||
|
||||
if(jobid % 1000 == 0) {
|
||||
@@ -461,7 +461,7 @@ public class GameConstants {
|
||||
}
|
||||
}
|
||||
|
||||
public static int getJobMaxLevel(MapleJob job) {
|
||||
public static int getJobMaxLevel(Job job) {
|
||||
int jobBranch = getJobBranch(job);
|
||||
|
||||
switch(jobBranch) {
|
||||
@@ -619,7 +619,7 @@ public class GameConstants {
|
||||
return MapleQuest.getInstance(questid).getMedalRequirement() != -1;
|
||||
}
|
||||
|
||||
public static boolean hasSPTable(MapleJob job) {
|
||||
public static boolean hasSPTable(Job job) {
|
||||
switch (job) {
|
||||
case EVAN:
|
||||
case EVAN1:
|
||||
|
||||
@@ -195,7 +195,7 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
if(attack.magic)
|
||||
distanceToDetect += 200000;
|
||||
|
||||
if(player.getJob().isA(MapleJob.ARAN1))
|
||||
if(player.getJob().isA(Job.ARAN1))
|
||||
distanceToDetect += 200000; // Arans have extra range over normal warriors.
|
||||
|
||||
if(attack.skill == Aran.COMBO_SMASH || attack.skill == Aran.BODY_PRESSURE)
|
||||
@@ -625,19 +625,19 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
|
||||
if (magic) {
|
||||
// Since the skill is magic based, use the magic formula
|
||||
if(chr.getJob() == MapleJob.IL_ARCHMAGE || chr.getJob() == MapleJob.IL_MAGE) {
|
||||
if(chr.getJob() == Job.IL_ARCHMAGE || chr.getJob() == Job.IL_MAGE) {
|
||||
int skillLvl = chr.getSkillLevel(ILMage.ELEMENT_AMPLIFICATION);
|
||||
if(skillLvl > 0)
|
||||
calcDmgMax = calcDmgMax * SkillFactory.getSkill(ILMage.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100;
|
||||
} else if(chr.getJob() == MapleJob.FP_ARCHMAGE || chr.getJob() == MapleJob.FP_MAGE) {
|
||||
} else if(chr.getJob() == Job.FP_ARCHMAGE || chr.getJob() == Job.FP_MAGE) {
|
||||
int skillLvl = chr.getSkillLevel(FPMage.ELEMENT_AMPLIFICATION);
|
||||
if(skillLvl > 0)
|
||||
calcDmgMax = calcDmgMax * SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100;
|
||||
} else if(chr.getJob() == MapleJob.BLAZEWIZARD3 || chr.getJob() == MapleJob.BLAZEWIZARD4) {
|
||||
} else if(chr.getJob() == Job.BLAZEWIZARD3 || chr.getJob() == Job.BLAZEWIZARD4) {
|
||||
int skillLvl = chr.getSkillLevel(BlazeWizard.ELEMENT_AMPLIFICATION);
|
||||
if(skillLvl > 0)
|
||||
calcDmgMax = calcDmgMax * SkillFactory.getSkill(BlazeWizard.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100;
|
||||
} else if(chr.getJob() == MapleJob.EVAN7 || chr.getJob() == MapleJob.EVAN8 || chr.getJob() == MapleJob.EVAN9 || chr.getJob() == MapleJob.EVAN10) {
|
||||
} else if(chr.getJob() == Job.EVAN7 || chr.getJob() == Job.EVAN8 || chr.getJob() == Job.EVAN9 || chr.getJob() == Job.EVAN10) {
|
||||
int skillLvl = chr.getSkillLevel(Evan.MAGIC_AMPLIFICATION);
|
||||
if(skillLvl > 0)
|
||||
calcDmgMax = calcDmgMax * SkillFactory.getSkill(Evan.MAGIC_AMPLIFICATION).getEffect(skillLvl).getY() / 100;
|
||||
@@ -717,7 +717,7 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
}
|
||||
|
||||
boolean canCrit = false;
|
||||
if(chr.getJob().isA((MapleJob.BOWMAN)) || chr.getJob().isA(MapleJob.THIEF) || chr.getJob().isA(MapleJob.NIGHTWALKER1) || chr.getJob().isA(MapleJob.WINDARCHER1) || chr.getJob() == MapleJob.ARAN3 || chr.getJob() == MapleJob.ARAN4 || chr.getJob() == MapleJob.MARAUDER || chr.getJob() == MapleJob.BUCCANEER) {
|
||||
if(chr.getJob().isA((Job.BOWMAN)) || chr.getJob().isA(Job.THIEF) || chr.getJob().isA(Job.NIGHTWALKER1) || chr.getJob().isA(Job.WINDARCHER1) || chr.getJob() == Job.ARAN3 || chr.getJob() == Job.ARAN4 || chr.getJob() == Job.MARAUDER || chr.getJob() == Job.BUCCANEER) {
|
||||
canCrit = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import scripting.npc.NPCScriptManager;
|
||||
@@ -35,7 +35,7 @@ import scripting.npc.NPCScriptManager;
|
||||
public class ClickGuideHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
if (c.getPlayer().getJob().equals(MapleJob.NOBLESSE)) {
|
||||
if (c.getPlayer().getJob().equals(Job.NOBLESSE)) {
|
||||
NPCScriptManager.getInstance().start(c, 1101008, null);
|
||||
} else {
|
||||
NPCScriptManager.getInstance().start(c, 1202000, null);
|
||||
|
||||
@@ -109,7 +109,7 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
|
||||
chr.getMap().broadcastMessage(chr, PacketCreator.giveForeignBuff(chr.getId(), stat), false);
|
||||
}
|
||||
}
|
||||
} else if (chr.getSkillLevel(chr.isCygnus() ? SkillFactory.getSkill(15100004) : SkillFactory.getSkill(5110001)) > 0 && (chr.getJob().isA(MapleJob.MARAUDER) || chr.getJob().isA(MapleJob.THUNDERBREAKER2))) {
|
||||
} else if (chr.getSkillLevel(chr.isCygnus() ? SkillFactory.getSkill(15100004) : SkillFactory.getSkill(5110001)) > 0 && (chr.getJob().isA(Job.MARAUDER) || chr.getJob().isA(Job.THUNDERBREAKER2))) {
|
||||
for (int i = 0; i < attack.numAttacked; i++) {
|
||||
chr.handleEnergyChargeGain();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package net.server.coordinator.partysearch;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import config.YamlConfig;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.MonitoredReadLock;
|
||||
@@ -47,8 +47,8 @@ import java.util.Map.Entry;
|
||||
*/
|
||||
public class MaplePartySearchCoordinator {
|
||||
|
||||
private Map<MapleJob, PartySearchStorage> storage = new HashMap<>();
|
||||
private Map<MapleJob, PartySearchEchelon> upcomers = new HashMap<>();
|
||||
private Map<Job, PartySearchStorage> storage = new HashMap<>();
|
||||
private Map<Job, PartySearchEchelon> upcomers = new HashMap<>();
|
||||
|
||||
private List<Character> leaderQueue = new LinkedList<>();
|
||||
private final MonitoredReentrantReadWriteLock leaderQueueLock = new MonitoredReentrantReadWriteLock(MonitoredLockType.WORLD_PARTY_SEARCH_QUEUE, true);
|
||||
@@ -63,7 +63,7 @@ public class MaplePartySearchCoordinator {
|
||||
private int updateCount = 0;
|
||||
|
||||
private static Map<Integer, Set<Integer>> mapNeighbors = fetchNeighbouringMaps();
|
||||
private static Map<Integer, MapleJob> jobTable = instantiateJobTable();
|
||||
private static Map<Integer, Job> jobTable = instantiateJobTable();
|
||||
|
||||
private static Map<Integer, Set<Integer>> fetchNeighbouringMaps() {
|
||||
Map<Integer, Set<Integer>> mapLinks = new HashMap<>();
|
||||
@@ -104,33 +104,33 @@ public class MaplePartySearchCoordinator {
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<Integer, MapleJob> instantiateJobTable() {
|
||||
Map<Integer, MapleJob> table = new HashMap<>();
|
||||
private static Map<Integer, Job> instantiateJobTable() {
|
||||
Map<Integer, Job> table = new HashMap<>();
|
||||
|
||||
List<Pair<Integer, Integer>> jobSearchTypes = new LinkedList<Pair<Integer, Integer>>() {{
|
||||
add(new Pair<>(MapleJob.MAPLELEAF_BRIGADIER.getId(), 0));
|
||||
add(new Pair<>(Job.MAPLELEAF_BRIGADIER.getId(), 0));
|
||||
add(new Pair<>(0, 0));
|
||||
add(new Pair<>(MapleJob.ARAN1.getId(), 0));
|
||||
add(new Pair<>(Job.ARAN1.getId(), 0));
|
||||
add(new Pair<>(100, 3));
|
||||
add(new Pair<>(MapleJob.DAWNWARRIOR1.getId(), 0));
|
||||
add(new Pair<>(Job.DAWNWARRIOR1.getId(), 0));
|
||||
add(new Pair<>(200, 3));
|
||||
add(new Pair<>(MapleJob.BLAZEWIZARD1.getId(), 0));
|
||||
add(new Pair<>(Job.BLAZEWIZARD1.getId(), 0));
|
||||
add(new Pair<>(500, 2));
|
||||
add(new Pair<>(MapleJob.THUNDERBREAKER1.getId(), 0));
|
||||
add(new Pair<>(Job.THUNDERBREAKER1.getId(), 0));
|
||||
add(new Pair<>(400, 2));
|
||||
add(new Pair<>(MapleJob.NIGHTWALKER1.getId(), 0));
|
||||
add(new Pair<>(Job.NIGHTWALKER1.getId(), 0));
|
||||
add(new Pair<>(300, 2));
|
||||
add(new Pair<>(MapleJob.WINDARCHER1.getId(), 0));
|
||||
add(new Pair<>(MapleJob.EVAN1.getId(), 0));
|
||||
add(new Pair<>(Job.WINDARCHER1.getId(), 0));
|
||||
add(new Pair<>(Job.EVAN1.getId(), 0));
|
||||
}};
|
||||
|
||||
int i = 0;
|
||||
for (Pair<Integer, Integer> p : jobSearchTypes) {
|
||||
table.put(i, MapleJob.getById(p.getLeft()));
|
||||
table.put(i, Job.getById(p.getLeft()));
|
||||
i++;
|
||||
|
||||
for (int j = 1; j <= p.getRight(); j++) {
|
||||
table.put(i, MapleJob.getById(p.getLeft() + 10 * j));
|
||||
table.put(i, Job.getById(p.getLeft() + 10 * j));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -141,18 +141,18 @@ public class MaplePartySearchCoordinator {
|
||||
private class LeaderSearchMetadata {
|
||||
private int minLevel;
|
||||
private int maxLevel;
|
||||
private List<MapleJob> searchedJobs;
|
||||
private List<Job> searchedJobs;
|
||||
|
||||
private int reentryCount;
|
||||
|
||||
private List<MapleJob> decodeSearchedJobs(int jobsSelected) {
|
||||
List<MapleJob> searchedJobs = new LinkedList<>();
|
||||
private List<Job> decodeSearchedJobs(int jobsSelected) {
|
||||
List<Job> searchedJobs = new LinkedList<>();
|
||||
|
||||
int topByte = (int)((Math.log(jobsSelected) / Math.log(2)) + 1e-5);
|
||||
|
||||
for (int i = 0; i <= topByte; i++) {
|
||||
if (jobsSelected % 2 == 1) {
|
||||
MapleJob job = jobTable.get(i);
|
||||
Job job = jobTable.get(i);
|
||||
if (job != null) {
|
||||
searchedJobs.add(job);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public class MaplePartySearchCoordinator {
|
||||
}
|
||||
|
||||
public MaplePartySearchCoordinator() {
|
||||
for (MapleJob job : jobTable.values()) {
|
||||
for (Job job : jobTable.values()) {
|
||||
storage.put(job, new PartySearchStorage());
|
||||
upcomers.put(job, new PartySearchEchelon());
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public class MaplePartySearchCoordinator {
|
||||
}
|
||||
|
||||
public void detachPlayer(Character chr) {
|
||||
MapleJob psJob = getPartySearchJob(chr.getJob());
|
||||
Job psJob = getPartySearchJob(chr.getJob());
|
||||
|
||||
if (!upcomers.get(psJob).detachPlayer(chr)) {
|
||||
storage.get(psJob).detachPlayer(chr);
|
||||
@@ -196,24 +196,24 @@ public class MaplePartySearchCoordinator {
|
||||
}
|
||||
|
||||
public void updatePartySearchStorage() {
|
||||
for (Entry<MapleJob, PartySearchEchelon> psUpdate : upcomers.entrySet()) {
|
||||
for (Entry<Job, PartySearchEchelon> psUpdate : upcomers.entrySet()) {
|
||||
storage.get(psUpdate.getKey()).updateStorage(psUpdate.getValue().exportEchelon());
|
||||
}
|
||||
}
|
||||
|
||||
private static MapleJob getPartySearchJob(MapleJob job) {
|
||||
private static Job getPartySearchJob(Job job) {
|
||||
if (job.getJobNiche() == 0) {
|
||||
return MapleJob.BEGINNER;
|
||||
return Job.BEGINNER;
|
||||
} else if (job.getId() < 600) { // explorers
|
||||
return MapleJob.getById((job.getId() / 10) * 10);
|
||||
return Job.getById((job.getId() / 10) * 10);
|
||||
} else if (job.getId() >= 1000) {
|
||||
return MapleJob.getById((job.getId() / 100) * 100);
|
||||
return Job.getById((job.getId() / 100) * 100);
|
||||
} else {
|
||||
return MapleJob.MAPLELEAF_BRIGADIER;
|
||||
return Job.MAPLELEAF_BRIGADIER;
|
||||
}
|
||||
}
|
||||
|
||||
private Character fetchPlayer(int callerCid, int callerMapid, MapleJob job, int minLevel, int maxLevel) {
|
||||
private Character fetchPlayer(int callerCid, int callerMapid, Job job, int minLevel, int maxLevel) {
|
||||
return storage.get(getPartySearchJob(job)).callPlayer(callerCid, callerMapid, minLevel, maxLevel);
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public class MaplePartySearchCoordinator {
|
||||
|
||||
int leaderCid = leader.getId();
|
||||
int leaderMapid = leader.getMapId();
|
||||
for (MapleJob searchJob : settings.searchedJobs) {
|
||||
for (Job searchJob : settings.searchedJobs) {
|
||||
Character chr = fetchPlayer(leaderCid, leaderMapid, searchJob, minLevel, maxLevel);
|
||||
if (chr != null) {
|
||||
return chr;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package net.server.task;
|
||||
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import config.YamlConfig;
|
||||
import net.server.Server;
|
||||
import tools.DatabaseConnection;
|
||||
@@ -96,7 +96,7 @@ public class RankingLoginTask implements Runnable {
|
||||
|
||||
for (int j = 0; j < Server.getInstance().getWorldsSize(); j++) {
|
||||
updateRanking(-1, j); //overall ranking
|
||||
for (int i = 0; i <= MapleJob.getMax(); i++) {
|
||||
for (int i = 0; i <= Job.getMax(); i++) {
|
||||
updateRanking(i, j);
|
||||
}
|
||||
con.commit();
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package net.server.world;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
|
||||
public class MaplePartyCharacter {
|
||||
private String name;
|
||||
@@ -32,7 +32,7 @@ public class MaplePartyCharacter {
|
||||
private int jobid;
|
||||
private int mapid;
|
||||
private boolean online;
|
||||
private MapleJob job;
|
||||
private Job job;
|
||||
private Character character;
|
||||
|
||||
public MaplePartyCharacter(Character maplechar) {
|
||||
@@ -56,7 +56,7 @@ public class MaplePartyCharacter {
|
||||
return character;
|
||||
}
|
||||
|
||||
public MapleJob getJob() {
|
||||
public Job getJob() {
|
||||
return job;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class AbstractPlayerInteraction {
|
||||
return getPlayer().getJob().getId();
|
||||
}
|
||||
|
||||
public MapleJob getJob(){
|
||||
public Job getJob(){
|
||||
return getPlayer().getJob();
|
||||
}
|
||||
|
||||
|
||||
@@ -353,10 +353,10 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
public void changeJobById(int a) {
|
||||
getPlayer().changeJob(MapleJob.getById(a));
|
||||
getPlayer().changeJob(Job.getById(a));
|
||||
}
|
||||
|
||||
public void changeJob(MapleJob job) {
|
||||
public void changeJob(Job job) {
|
||||
getPlayer().changeJob(job);
|
||||
}
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
// thanks GMChuck for detecting player sensitive data being cached into getSlotMax
|
||||
if (ItemConstants.isThrowingStar(itemId)) {
|
||||
if(c.getPlayer().getJob().isA(MapleJob.NIGHTWALKER1)) {
|
||||
if(c.getPlayer().getJob().isA(Job.NIGHTWALKER1)) {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(NightWalker.CLAW_MASTERY)) * 10;
|
||||
} else {
|
||||
ret += c.getPlayer().getSkillLevel(SkillFactory.getSkill(Assassin.CLAW_MASTERY)) * 10;
|
||||
@@ -1587,7 +1587,7 @@ public class MapleItemInformationProvider {
|
||||
return items;
|
||||
}
|
||||
Collection<Item> itemz = new LinkedList<>();
|
||||
if (chr.getJob() == MapleJob.SUPERGM || chr.getJob() == MapleJob.GM) {
|
||||
if (chr.getJob() == Job.SUPERGM || chr.getJob() == Job.GM) {
|
||||
for (Item item : items) {
|
||||
Equip equip = (Equip) item;
|
||||
equip.wear(true);
|
||||
@@ -1609,7 +1609,7 @@ public class MapleItemInformationProvider {
|
||||
ex.printStackTrace();
|
||||
}*/
|
||||
int tdex = chr.getDex(), tstr = chr.getStr(), tint = chr.getInt(), tluk = chr.getLuk(), fame = chr.getFame();
|
||||
if (chr.getJob() != MapleJob.SUPERGM || chr.getJob() != MapleJob.GM) {
|
||||
if (chr.getJob() != Job.SUPERGM || chr.getJob() != Job.GM) {
|
||||
for (Item item : inv.list()) {
|
||||
Equip equip = (Equip) item;
|
||||
tdex += equip.getDex();
|
||||
@@ -1675,7 +1675,7 @@ public class MapleItemInformationProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chr.getJob() == MapleJob.SUPERGM || chr.getJob() == MapleJob.GM) {
|
||||
if (chr.getJob() == Job.SUPERGM || chr.getJob() == Job.GM) {
|
||||
equip.wear(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1395,10 +1395,10 @@ public class MapleStatEffect {
|
||||
if (primary) {
|
||||
if (mpCon != 0) {
|
||||
double mod = 1.0;
|
||||
boolean isAFpMage = applyfrom.getJob().isA(MapleJob.FP_MAGE);
|
||||
boolean isCygnus = applyfrom.getJob().isA(MapleJob.BLAZEWIZARD2);
|
||||
boolean isEvan = applyfrom.getJob().isA(MapleJob.EVAN7);
|
||||
if (isAFpMage || isCygnus || isEvan || applyfrom.getJob().isA(MapleJob.IL_MAGE)) {
|
||||
boolean isAFpMage = applyfrom.getJob().isA(Job.FP_MAGE);
|
||||
boolean isCygnus = applyfrom.getJob().isA(Job.BLAZEWIZARD2);
|
||||
boolean isEvan = applyfrom.getJob().isA(Job.EVAN7);
|
||||
if (isAFpMage || isCygnus || isEvan || applyfrom.getJob().isA(Job.IL_MAGE)) {
|
||||
Skill amp = isAFpMage ? SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION) : (isCygnus ? SkillFactory.getSkill(BlazeWizard.ELEMENT_AMPLIFICATION) : (isEvan ? SkillFactory.getSkill(Evan.MAGIC_AMPLIFICATION) : SkillFactory.getSkill(ILMage.ELEMENT_AMPLIFICATION)));
|
||||
int ampLevel = applyfrom.getSkillLevel(amp);
|
||||
if (ampLevel > 0) {
|
||||
@@ -1421,7 +1421,7 @@ public class MapleStatEffect {
|
||||
}
|
||||
|
||||
private int alchemistModifyVal(Character chr, int val, boolean withX) {
|
||||
if (!skill && (chr.getJob().isA(MapleJob.HERMIT) || chr.getJob().isA(MapleJob.NIGHTWALKER3))) {
|
||||
if (!skill && (chr.getJob().isA(Job.HERMIT) || chr.getJob().isA(Job.NIGHTWALKER3))) {
|
||||
MapleStatEffect alchemistEffect = getAlchemistEffect(chr);
|
||||
if (alchemistEffect != null) {
|
||||
return (int) (val * ((withX ? alchemistEffect.getX() : alchemistEffect.getY()) / 100.0));
|
||||
|
||||
@@ -1204,7 +1204,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
overtimeAction = new DamageTask(poisonDamage, from, status, 0);
|
||||
overtimeDelay = 1000;
|
||||
} else if (venom) {
|
||||
if (from.getJob() == MapleJob.NIGHTLORD || from.getJob() == MapleJob.SHADOWER || from.getJob().isA(MapleJob.NIGHTWALKER3)) {
|
||||
if (from.getJob() == Job.NIGHTLORD || from.getJob() == Job.SHADOWER || from.getJob().isA(Job.NIGHTWALKER3)) {
|
||||
int poisonLevel, matk, jobid = from.getJob().getId();
|
||||
int skillid = (jobid == 412 ? NightLord.VENOMOUS_STAR : (jobid == 422 ? Shadower.VENOMOUS_STAB : NightWalker.VENOM));
|
||||
poisonLevel = from.getSkillLevel(SkillFactory.getSkill(skillid));
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.actions;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import provider.MapleData;
|
||||
@@ -114,7 +114,7 @@ public class SkillAction extends MapleQuestAction {
|
||||
return masterLevel;
|
||||
}
|
||||
|
||||
public boolean jobsContains(MapleJob job) {
|
||||
public boolean jobsContains(Job job) {
|
||||
return jobs.contains(job.getId());
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
package server.quest.requirements;
|
||||
|
||||
import client.Character;
|
||||
import client.MapleJob;
|
||||
import client.Job;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataTool;
|
||||
import server.quest.MapleQuest;
|
||||
@@ -58,7 +58,7 @@ public class JobRequirement extends MapleQuestRequirement {
|
||||
@Override
|
||||
public boolean check(Character chr, Integer npcid) {
|
||||
for(Integer job : jobs) {
|
||||
if (chr.getJob().equals(MapleJob.getById(job)) || chr.isGM()) {
|
||||
if (chr.getJob().equals(Job.getById(job)) || chr.isGM()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1915,7 +1915,7 @@ public class PacketCreator {
|
||||
p.writeShort(chr.getJob().getId());
|
||||
|
||||
/* replace "p.writeShort(chr.getJob().getId())" with this snippet for 3rd person FJ animation on all classes
|
||||
if (chr.getJob().isA(MapleJob.HERMIT) || chr.getJob().isA(MapleJob.DAWNWARRIOR2) || chr.getJob().isA(MapleJob.NIGHTWALKER2)) {
|
||||
if (chr.getJob().isA(Job.HERMIT) || chr.getJob().isA(Job.DAWNWARRIOR2) || chr.getJob().isA(Job.NIGHTWALKER2)) {
|
||||
p.writeShort(chr.getJob().getId());
|
||||
} else {
|
||||
p.writeShort(412);
|
||||
|
||||
Reference in New Issue
Block a user