Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. From player class.
  2.  
  3. public void incExp(int i, int amount, boolean useFatigue, boolean multiplied) {
  4. int baseAmount = amount;
  5. boolean safe = false;
  6. if (isDonatorsB())
  7. safe = true;
  8. if (GameVars.useFatigue && !safe) {
  9. if (useFatigue) {
  10. if (fatigue >= 100) {
  11. actionSender
  12. .sendMessage("@gre@You are too tired to gain experience, get some rest!");
  13. return;
  14. }
  15. if (fatigue >= 96) {
  16. actionSender
  17. .sendMessage("@gre@You start to feel tired, maybe you should rest soon.");
  18. }
  19. }
  20. }
  21. if (multiplied)
  22. amount *= GameVars.expMultiplier * 5;
  23. if (getLocation().inWilderness())
  24. amount = baseAmount * 3;
  25. if (isDonatorsB())
  26. amount *= 2;
  27.  
  28. exp[i] += amount * 5;
  29. if (exp[i] < 2) {
  30. exp[i] = 2;
  31. }
  32. int level = Formulae.experienceToLevel(exp[i]);
  33. if (level != maxStat[i]) {
  34. int advanced = level - maxStat[i];
  35. incCurStat(i, advanced);
  36. incMaxStat(i, advanced);
  37. actionSender.sendStat(i);
  38. actionSender.sendMessage("@gre@You just advanced " + advanced + " "
  39. + Formulae.statArray[i] + " level!");
  40. actionSender.sendSound("advance");
  41. world.getDelayedEventHandler().add(new MiniEvent(this) {
  42. public void action() {
  43. owner.getActionSender().sendScreenshot();
  44. }
  45. });
  46. int comb = Formulae.getCombatlevel(maxStat);
  47. if (comb != getCombatLevel()) {
  48. setCombatLevel(comb);
  49. }
  50. }
  51. }
  52.  
  53. // destroy
  54. public int[] getExps() {
  55. return exp;
  56. }
  57.  
  58. public int getExp(int id) {
  59. return exp[id];
  60. }
  61.  
  62. public void setExp(int id, int lvl) {
  63. if (lvl < 0) {
  64. lvl = 3;
  65. }
  66. exp[id] = lvl;
  67. }
  68.  
  69. public void setExp(int[] lvls) {
  70. exp = lvls;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement