I Know this has to do something with adding a 'While' Statment But im just not catching on correctly :junglejane:
I need to add in "Multi Leveling" for my server. Anyone Got a clue?
My GainEXP Method in MapleCharacter
I need to add in "Multi Leveling" for my server. Anyone Got a clue?
My GainEXP Method in MapleCharacter
Code:
public void gainExp(final int total, final boolean show, final boolean inChat, final boolean white) {
try {
int prevexp = getExp();
int needed = getNeededExp();
if (total > 0) {
stats.checkEquipLevels(this, total); //gms like
}
if ((level >= 200 || (GameConstants.isKOC(job) && level >= 200)) && !isIntern()) {
setExp(0);
//if (exp + total > needed) {
// setExp(needed);
//} else {
// exp += total;
//}
} else {
boolean leveled = false;
long tot = exp + total;
if (tot >= needed) {
exp += total;
levelUp();
leveled = true;
if ((level >= 200 || (GameConstants.isKOC(job) && level >= 200)) && !isIntern()) {
setExp(0);
} else {
needed = getNeededExp();
if (exp >= needed) {
setExp(needed - 1);
}
}
} else {
exp += total;
}
if (total > 0) {
familyRep(prevexp, needed, leveled);
}
}
if (total != 0) {
if (exp < 0) { // After adding, and negative
if (total > 0) {
setExp(needed);
} else if (total < 0) {
setExp(0);
}
}
updateSingleStat(MapleStat.EXP, getExp());
if (show) { // still show the expgain even if it's not there
client.getSession().write(InfoPacket.GainEXP_Others(total, inChat, white));
}
}
} catch (Exception e) {
FileoutputUtil.outputFileError(FileoutputUtil.ScriptEx_Log, e); //all jobs throw errors :(
}
}