Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From player class.
- public void incExp(int i, int amount, boolean useFatigue, boolean multiplied) {
- int baseAmount = amount;
- boolean safe = false;
- if (isDonatorsB())
- safe = true;
- if (GameVars.useFatigue && !safe) {
- if (useFatigue) {
- if (fatigue >= 100) {
- actionSender
- .sendMessage("@gre@You are too tired to gain experience, get some rest!");
- return;
- }
- if (fatigue >= 96) {
- actionSender
- .sendMessage("@gre@You start to feel tired, maybe you should rest soon.");
- }
- }
- }
- if (multiplied)
- amount *= GameVars.expMultiplier * 5;
- if (getLocation().inWilderness())
- amount = baseAmount * 3;
- if (isDonatorsB())
- amount *= 2;
- exp[i] += amount * 5;
- if (exp[i] < 2) {
- exp[i] = 2;
- }
- int level = Formulae.experienceToLevel(exp[i]);
- if (level != maxStat[i]) {
- int advanced = level - maxStat[i];
- incCurStat(i, advanced);
- incMaxStat(i, advanced);
- actionSender.sendStat(i);
- actionSender.sendMessage("@gre@You just advanced " + advanced + " "
- + Formulae.statArray[i] + " level!");
- actionSender.sendSound("advance");
- world.getDelayedEventHandler().add(new MiniEvent(this) {
- public void action() {
- owner.getActionSender().sendScreenshot();
- }
- });
- int comb = Formulae.getCombatlevel(maxStat);
- if (comb != getCombatLevel()) {
- setCombatLevel(comb);
- }
- }
- }
- // destroy
- public int[] getExps() {
- return exp;
- }
- public int getExp(int id) {
- return exp[id];
- }
- public void setExp(int id, int lvl) {
- if (lvl < 0) {
- lvl = 3;
- }
- exp[id] = lvl;
- }
- public void setExp(int[] lvls) {
- exp = lvls;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement