Simple @advance command[NOW v111]
Basically, when you reach level 70+ and later 120+ you can get advanced to your next job.THIS IS MY FIRST RELEASE!!!
v111:
Just put this in your commands.java:
If you aren't using ChickenMS (mooplev111) then replace the "sub" with "splitted" and replace every "chr." with "player."
PHP Code:
}else if (sub[0].equals("advance")) {
String advanced = "You have advanced.";
int job_ = chr.getJob().getId();
if (chr.getLevel() >= 160){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 120){
if (chr.is3rdJob() || (chr.isAran() || (chr.isEvan() || (chr.isCygnus() || (chr.isDualBlade() || (chr.isElf() || (chr.isDemonSlayer() || (chr.isCannon())))))))) {
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 100){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 80){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 70){
if (chr.is2ndJob() || (chr.isAran() || (chr.isEvan() || (chr.isCygnus() || (chr.isDualBlade() || (chr.isElf() || (chr.isDemonSlayer() || (chr.isCannon())))))))) {
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
}} else if (chr.getLevel() >= 60){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 55){
if (chr.isDualBlade()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 50){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} } else if (chr.getLevel() >= 40){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
} }else if (chr.getLevel() >= 30){
if (chr.isEvan()) {
chr.changeJob(MapleJob.getById(job_ + 1));
chr.dropMessage(advanced);
}else if ((chr.isAran() || (chr.isCygnus() || (chr.isDualBlade() || (chr.isElf() || (chr.isDemonSlayer() || (chr.isCannon()))))))){
chr.changeJob(MapleJob.getById(job_ + 10));
}else{ chr.dropMessage("Pick a 2nd job from your job person");
} }else if (chr.getLevel() >= 20){
if (chr.isEvan()){
chr.changeJob(MapleJob.getById(job_ + 10));
chr.dropMessage(advanced);
} }else {
chr.dropMessage("You are not high level enough. Or it is not your job's time to advance.");}
Heres isCannon if you need it:
PHP Code:
public boolean isCannon(){
if (getJob().getId() >= 501 && getJob().getId() <= 532 || GameConstants.isCannon(job.getId())) {
return true;
}
return false;
}
Heres some others if you need it:
PHP Code:
public boolean isMechanic() {
return getJob().getId() >= MapleJob.MECHANIC1.getId() && getJob().getId() <= MapleJob.MECHANIC4.getId();
}
public boolean isResistance() {
return getJob().getId() >= MapleJob.CITIZEN.getId() && getJob().getId() <= MapleJob.MECHANIC4.getId();
}
public boolean isEvan() {
return getJob().getId() >= MapleJob.EVAN.getId() && getJob().getId() <= MapleJob.EVAN10.getId();
}
public boolean isWarrior() {
return getJob().getId() == MapleJob.WARRIOR.getId();
}
public boolean isMagician() {
return getJob().getId() == MapleJob.MAGICIAN.getId();
}
public boolean isThief() {
return getJob().getId() == MapleJob.THIEF.getId();
}
public boolean isPirate() {
return getJob().getId() == MapleJob.PIRATE.getId();
}
public boolean isBowman() {
return getJob().getId() == MapleJob.BOWMAN.getId();
}
public boolean isDualBlade() {
return getJob().getId() >= MapleJob.DUALBLADE.getId() && getJob().getId() <= MapleJob.DUALBLADE4.getId();
}
public boolean is2ndJob() {
return getJob().getId()%10 == 0 && getJob().getId()%100 != 0;
}
public boolean is3rdJob() {
return getJob().getId()%10 == 1;
}
public boolean isCannon(){
if (getJob().getId() >= 501 && getJob().getId() <= 532 || GameConstants.isCannon(job.getId())) {
return true;
}
return false;
public boolean isAran() {
return getJob().getId() >= 2000 && getJob().getId() <= 2112;
}
V97:
Put this in your playercommand.java:
PHP Code:
}else if (splitted[0].equals("advance")) {
String advanced = "You have advanced.";
if (player.getLevel() >= 20){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
}}else if (player.getLevel() >= 30){
if (player.isEvan() || (player.isAran() || (player.isCygnus() || (player.isDualBlade())))){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 40){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 50){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 55){
if (player.isDualBlade()){
player.autoJob();
player.dropMessage(advanced);
}} else if (player.getLevel() >= 60){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 70){
if (player.is2ndJob() || (player.isAran() || (player.isEvan() || (player.isCygnus() || (player.isDualBlade() ))))) {
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 80){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 100){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 120){
if (player.is2ndJob() || (player.isAran() || (player.isEvan() || (player.isCygnus() || (player.isDualBlade() ))))) {
player.autoJob();
player.dropMessage(advanced);
} } else if (player.getLevel() >= 160){
if (player.isEvan()){
player.autoJob();
player.dropMessage(advanced);
} }else {
player.dropMessage("You are not high level enough. Or it is not your job's time to advance.");}
}
This into maplecharacter.java:
PHP Code:
public void autoJob() {
int job_ = getJob().getId();
if (isDualBlade()) {
switch (getLevel()) {
case 20:
changeJob(MapleJob.BLADE_RECRUIT);
break;
case 30:
changeJob(MapleJob.BLADE_ACOLYTE);
break;
case 55:
changeJob(MapleJob.BLADE_SPECIALIST);
break;
case 70:
changeJob(MapleJob.BLADE_LORD);
break;
case 120:
changeJob(MapleJob.BLADE_MASTER);
break;
}
} else if (getJob().getId() >= MapleJob.BATTLEMAGE1.getId() && getJob().getId() <= MapleJob.BATTLEMAGE4.getId()) {
switch (getLevel()) {
case 30:
changeJob(MapleJob.BATTLEMAGE2);
break;
case 70:
changeJob(MapleJob.BATTLEMAGE3);
break;
case 120:
changeJob(MapleJob.BATTLEMAGE4);
break;
}
} else if (isEvan()) {
switch (getLevel()) {
case 10:
changeJob(MapleJob.EVAN1);
break;
case 20:
changeJob(MapleJob.EVAN2);
break;
case 30:
changeJob(MapleJob.EVAN3);
break;
case 40:
changeJob(MapleJob.EVAN4);
break;
case 50:
changeJob(MapleJob.EVAN5);
break;
case 60:
changeJob(MapleJob.EVAN6);
break;
case 80:
changeJob(MapleJob.EVAN7);
break;
case 100:
changeJob(MapleJob.EVAN8);
break;
case 120:
changeJob(MapleJob.EVAN9);
break;
case 160:
changeJob(MapleJob.EVAN10);
break;
default:
break;
}
} else if (getJob().getId() >= MapleJob.WILDHUNTER1.getId() && getJob().getId() <= MapleJob.WILDHUNTER4.getId()) {
switch (getLevel()) {
case 30:
changeJob(MapleJob.WILDHUNTER2);
break;
case 70:
changeJob(MapleJob.WILDHUNTER3);
break;
case 120:
changeJob(MapleJob.WILDHUNTER4);
break;
}
} else if (isMechanic()) {
switch (getLevel()) {
case 30:
changeJob(MapleJob.MECHANIC2);
break;
case 70:
changeJob(MapleJob.MECHANIC3);
break;
case 120:
changeJob(MapleJob.MECHANIC4);
break;
}
} else {
if (!isAran() && level == 9 || !isAran() && !isCygnus() && level == 29) {
NPCScriptManager.getInstance().start(getClient(), 2003, null, null);
} else if (isAran() && level == 9) {
changeJob(MapleJob.getById(2100));
} else if (isAran() && level == 29) {
changeJob(MapleJob.getById(2110));
} else if (isCygnus() && level == 29) {
changeJob(MapleJob.getById(job_ + 10));
} else if (isCygnus() && level == 69) {
changeJob(MapleJob.getById(job_ + 1));
} else if (isAran() && level == 69) {
changeJob(MapleJob.getById(2111));
} else if (isAran() && level == 119) {
changeJob(MapleJob.getById(2112));
}
if (!isAran() && !isCygnus() && level == 69) {
if (is2ndJob()) {
changeJob(MapleJob.getById(job_ + 1));
} else {
NPCScriptManager.getInstance().start(getClient(), 2003, null, null);
}
} else if (!isCygnus() && !isAran() && level == 119) {
if (is3rdJob()) {
changeJob(MapleJob.getById(job_ + 1));
} else if (is2ndJob()) {
} else {
NPCScriptManager.getInstance().start(getClient(), 2003, null, null);
}
}
}
}
Credits:
V97: I only take credit in writing the actual command. The method has already been implemented in XeonMS v97.
V111: I take full credit in writing the whole command.
Re: Simple @advance command
The command is pretty horrible, not to shoot you down on your first release, but its pretty obvious for the most part (as to why).
Posted via Mobile Device
Re: Simple @advance command
Evan can be done in the levelup function.
Re: Simple @advance command
wasnt this already in xeon? the second part?
Re: Simple @advance command
You could make this alot shorter by using logic like in the job advancer npc by osiris or moogra (?) where an object array is used and push the possible jobs based on player current job.
Re: Simple @advance command
Can be done easier but for your first release it's decent. My first release was a leech ;)
Re: Simple @advance command
I'm pretty sure you could easily do this in the Levelup function.
Re: Simple @advance command
What is this I don't even...
Posted via Mobile Device
Re: Simple @advance command
Quote:
Originally Posted by
shakar96
What is this I don't even...
Posted via Mobile Device
Hey...atleast it works!
Re: Simple @advance command
Quote:
Originally Posted by
lordpeter
Hey...atleast it works!
you'll never get good if you think like this. you should alway make sure it's noob friendly so that could just add for example their ids into an array or something and it would work. learned this from someone.
Re: Simple @advance command
Quote:
Originally Posted by
lordpeter
Hey...atleast it works!
LOL.
Anyway there were hundreds of threads like this in the 'Help' section (Teehee).
Re: Simple @advance command
Quote:
Originally Posted by
shakar96
LOL.
Anyway there were hundreds of threads like this in the 'Help' section
(Teehee).
never saw it
Re: Simple @advance command
Quote:
Originally Posted by
oxysoft
you'll never get good if you think like this. you should alway make sure it's noob friendly so that could just add for example their ids into an array or something and it would work. learned this from someone.
Asking for somebody who doesn't understand the concept of future proofing to future proof something is not reasonable. Its better to do it this way first so later you are able to understand why you would want to make something more dynamic. Skipping the "hard code" step means that you don't truley know how to make something dynamic because you never understood that was wrong in the first place.
Re: Simple @advance command
Quote:
Originally Posted by
SoBrisk
Asking for somebody who doesn't understand the concept of future proofing to future proof something is not reasonable. Its better to do it this way first so later you are able to understand why you would want to make something more dynamic. Skipping the "hard code" step means that you don't truley know how to make something dynamic because you never understood that was wrong in the first place.
Thanks for understanding. Hopefully this will help me learn.