Add xpRate Var & Include With XPRate Calculations

This commit is contained in:
Dark98
2021-11-23 01:08:13 +00:00
parent 8ab31771b3
commit bdd5297a94
3 changed files with 48 additions and 37 deletions
@@ -1,5 +1,7 @@
package com.rs2; package com.rs2;
import com.rs2.game.players.Player;
public class GameConstants { public class GameConstants {
/** /**
@@ -31,7 +33,7 @@ public class GameConstants {
public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false, public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false,
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true, PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false; ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false;
public static double XP_RATE = 1; public static double XP_RATE = 1 * Player.xpRate;
/** /**
@@ -98,7 +98,8 @@ public abstract class Player {
public byte buffer[] = null; public byte buffer[] = null;
public String lastConnectedFrom; public String lastConnectedFrom;
private Compost compost = new Compost(this); public static int xpRate;
private Compost compost = new Compost(this);
private Allotments allotment = new Allotments(this); private Allotments allotment = new Allotments(this);
private Flowers flower = new Flowers(this); private Flowers flower = new Flowers(this);
private Herbs herb = new Herbs(this); private Herbs herb = new Herbs(this);
@@ -166,6 +167,10 @@ public abstract class Player {
private DoubleGates doubleGates = new DoubleGates(); private DoubleGates doubleGates = new DoubleGates();
public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits
public int getXPRate() { return xpRate; }
public void setXPRate(int xpRate) { this.xpRate = xpRate; }
public boolean isPreaching() { public boolean isPreaching() {
return preaching; return preaching;
} }
@@ -92,6 +92,8 @@ public class PlayerSave {
case "character-rights": case "character-rights":
player.playerRights = Integer.parseInt(token2); player.playerRights = Integer.parseInt(token2);
break; break;
case "xp-rate":
player.xpRate = Integer.parseInt(token2);
case "last-ip": case "last-ip":
player.lastConnectedFrom = token2; player.lastConnectedFrom = token2;
break; break;
@@ -593,6 +595,8 @@ public class PlayerSave {
characterfile.newLine(); characterfile.newLine();
characterfile.write("character-rights = " + player.playerRights); characterfile.write("character-rights = " + player.playerRights);
characterfile.newLine(); characterfile.newLine();
characterfile.write("xp-rate = " + player.xpRate);
characterfile.newLine();
characterfile.write("last-ip = " + player.connectedFrom); characterfile.write("last-ip = " + player.connectedFrom);
characterfile.newLine(); characterfile.newLine();
characterfile.write("isBot = " + player.isBot); characterfile.write("isBot = " + player.isBot);