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;
import com.rs2.game.players.Player;
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,
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
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,6 +98,7 @@ public abstract class Player {
public byte buffer[] = null;
public String lastConnectedFrom;
public static int xpRate;
private Compost compost = new Compost(this);
private Allotments allotment = new Allotments(this);
private Flowers flower = new Flowers(this);
@@ -166,6 +167,10 @@ public abstract class Player {
private DoubleGates doubleGates = new DoubleGates();
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() {
return preaching;
}
@@ -92,6 +92,8 @@ public class PlayerSave {
case "character-rights":
player.playerRights = Integer.parseInt(token2);
break;
case "xp-rate":
player.xpRate = Integer.parseInt(token2);
case "last-ip":
player.lastConnectedFrom = token2;
break;
@@ -593,6 +595,8 @@ public class PlayerSave {
characterfile.newLine();
characterfile.write("character-rights = " + player.playerRights);
characterfile.newLine();
characterfile.write("xp-rate = " + player.xpRate);
characterfile.newLine();
characterfile.write("last-ip = " + player.connectedFrom);
characterfile.newLine();
characterfile.write("isBot = " + player.isBot);