Use Either VARIABLE_SKILL_RATE OR XP_RATE Not Both

TODO(Convert Player.xpRate Into An Array For Easier Rate Changes)
This commit is contained in:
Dark98
2021-12-11 22:26:28 +00:00
parent 8761116b9b
commit 83eb0be61a
2 changed files with 6 additions and 3 deletions
@@ -26,7 +26,7 @@ public class GameConstants {
* ADMIN_DROP_ITEMS Defines Whether Admins Can Drop Items * ADMIN_DROP_ITEMS Defines Whether Admins Can Drop Items
* ADMIN_CAN_SELL_ITEMS Defines Whether Admins Can Sell Items * ADMIN_CAN_SELL_ITEMS Defines Whether Admins Can Sell Items
* VARIABLE_XP_RATE Allows Players To Choose An XP Rate(x1,x2,x5,x10) * VARIABLE_XP_RATE Allows Players To Choose An XP Rate(x1,x2,x5,x10)
* XP_RATE Sets The XP Rate Multiplier For All Players/Skills * XP_RATE Sets The XP Rate Multiplier For All Players/Skills If VARIABLE_XP_RATES is false
*/ */
public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org"; public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org";
public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120, public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120,
@@ -2033,8 +2033,11 @@ public class PlayerAssistant {
if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && GameConstants.TUTORIAL_ISLAND) { if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && GameConstants.TUTORIAL_ISLAND) {
return false; return false;
} }
if (GameConstants.VARIABLE_XP_RATE){
amount *= GameConstants.XP_RATE * player.getXPRate(); amount *= player.getXPRate();
} else {
amount *= GameConstants.XP_RATE;
}
int oldLevel = getLevelForXP(player.playerXP[skill]); int oldLevel = getLevelForXP(player.playerXP[skill]);
player.playerXP[skill] += amount; player.playerXP[skill] += amount;
if (oldLevel < getLevelForXP(player.playerXP[skill])) { if (oldLevel < getLevelForXP(player.playerXP[skill])) {