Hello,
I put reborn in my server but the mobs don't give all exp.
For exemple, I'm level 160 and killed Pianus but I didn't receive all exp that it would give me.
Could anyone help me?
Hello,
I put reborn in my server but the mobs don't give all exp.
For exemple, I'm level 160 and killed Pianus but I didn't receive all exp that it would give me.
Could anyone help me?
"I didn't receive all exp that it would give me."
So according to what you said, you received only some of the EXP ? 0.0
Some players say: "as the boss hold exp".
For exemple, when I killed Pianus in level 160 I received 1 level and 99,98% exp.
Last edited by deregudegu; 13-05-12 at 08:42 PM.
Oh lol, you just don't have Multi Level in your server :)
Change your gainExp method and add to it:
PHP Code:while (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
}
GainExp method was as follows:
PHP Code:public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
int equip = (gain / 10) * pendantExp;
int total = gain + equip;
if (level < getMaxLevel()) {
if ((long) this.exp.get() + (long) total > (long) Integer.MAX_VALUE) {
int gainFirst = ExpTable.getExpNeededForLevel(level) - this.exp.get();
total -= gainFirst + 1;
this.gainExp(gainFirst + 1, false, inChat, white);
}
updateSingleStat(MapleStat.EXP, this.exp.addAndGet(total));
if (show && gain != 0) {
client.announce(MaplePacketCreator.getShowExpGain(gain, equip, inChat, white));
}
if (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
int need = ExpTable.getExpNeededForLevel(level);
if (exp.get() >= need) {
setExp(need - 1);
updateSingleStat(MapleStat.EXP, need);
}
}
while (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
}
}
}
If you are using MoopleDev (that's what u said) than your gainExp method suppose to look like that:
PHP Code:public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
int equip = (gain / 10) * pendantExp;
int total = gain + equip;
if (level < getMaxLevel()) {
if ((long) this.exp.get() + (long) total > (long) Integer.MAX_VALUE) {
int gainFirst = ExpTable.getExpNeededForLevel(level) - this.exp.get();
total -= gainFirst + 1;
this.gainExp(gainFirst + 1, false, inChat, white);
}
updateSingleStat(MapleStat.EXP, this.exp.addAndGet(total));
if (show && gain != 0) {
client.announce(MaplePacketCreator.getShowExpGain(gain, equip, inChat, white));
}
if (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
int need = ExpTable.getExpNeededForLevel(level);
if (exp.get() >= need) {
setExp(need - 1);
updateSingleStat(MapleStat.EXP, need);
}
}
}
}
If you changed it, you MUST COMPILE!
I know I have to compile.
I'll test and post results here.
Thanks.
Don't use the code I posted in the last comment lol 0.0
It was just to show you how your code is suppose to look according to what you said.
If you are using MoopleDev just add:
To your gainExp method.PHP Code:while (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
}
I use this code:
PHP Code:public void gainExp(int gain, boolean show, boolean inChat, boolean white) {
int equip = (gain / 10) * pendantExp;
int total = gain + equip;
if (level < getMaxLevel()) {
if ((long) this.exp.get() + (long) total > (long) Integer.MAX_VALUE) {
int gainFirst = ExpTable.getExpNeededForLevel(level) - this.exp.get();
total -= gainFirst + 1;
this.gainExp(gainFirst + 1, false, inChat, white);
}
updateSingleStat(MapleStat.EXP, this.exp.addAndGet(total));
if (show && gain != 0) {
client.announce(MaplePacketCreator.getShowExpGain(gain, equip, inChat, white));
}
while (exp.get() >= ExpTable.getExpNeededForLevel(level)) {
levelUp(true);
}
}
}
Then your multi-level should work if u compiled after the change.