Various Changes (#614)

* Clean Old Log Files

* Various Changes

* Moved minutes.log to log folder
* Made SERVER_LOG_DIR constant
* Moved FILE_SYSTEM_DIR to GameConstants & Deleted org.apollo.jagcached.Constants
* Removed unused minutes.log from data/data
* Removed Duplicate RSAKeyGen
* Moved RSAKeyGen from com.rs2.net.rsa to com.rs2.util.rsa

* Removed data/net.xml & Created Moved NetworkConstants.java

* Add HTTP & Jaggrab Port's to ConfigLoader

* IntelliJ Reformat ConfigLoader.java

* Fix Mistake

* Attempt #2

* Woops, wrong port
This commit is contained in:
Josh Shippam
2023-02-09 01:05:06 +00:00
committed by GitHub
parent 88a9562e03
commit 55ca851d07
201 changed files with 1264 additions and 12570 deletions
@@ -12,62 +12,66 @@ import java.util.stream.Collectors;
public class ConfigLoader {
public static void loadSettings(String config) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(config));
String out = br.lines().collect(Collectors.joining("\n"));
JSONObject obj = new JSONObject(out);
BufferedReader br = new BufferedReader(new FileReader(config));
String out = br.lines().collect(Collectors.joining("\n"));
JSONObject obj = new JSONObject(out);
if(obj.has("server_name"))
GameConstants.SERVER_NAME = obj.getString("server_name");
if(obj.has("server_test_version"))
GameConstants.TEST_VERSION = obj.getDouble("server_test_version");
if(obj.has("gui_enabled"))
GameConstants.GUI_ENABLED = obj.getBoolean("gui_enabled");
if(obj.has("website_link"))
GameConstants.WEBSITE_LINK = obj.getString("website_link");
if(obj.has("server_debug"))
GameConstants.SERVER_DEBUG = obj.getBoolean("server_debug");
if(obj.has("file_server"))
GameConstants.FILE_SERVER = obj.getBoolean("file_server");
if(obj.has("world_id"))
GameConstants.WORLD = obj.getInt("world_id");
if(obj.has("members_only"))
GameConstants.MEMBERS_ONLY = obj.getBoolean("members_only");
if(obj.has("tutorial_island_enabled"))
GameConstants.TUTORIAL_ISLAND = obj.getBoolean("tutorial_island_enabled");
if(obj.has("party_room_enabled"))
GameConstants.PARTY_ROOM_DISABLED = !obj.getBoolean("party_room_enabled");
if(obj.has("clues_enabled"))
GameConstants.CLUES_ENABLED = obj.getBoolean("clues_enabled");
if(obj.has("admin_can_trade"))
GameConstants.ADMIN_CAN_TRADE = obj.getBoolean("admin_can_trade");
if(obj.has("admin_can_drop_items"))
GameConstants.ADMIN_DROP_ITEMS = obj.getBoolean("admin_can_drop_items");
if(obj.has("admin_can_sell"))
GameConstants.ADMIN_CAN_SELL_ITEMS = obj.getBoolean("admin_can_sell");
if(obj.has("respawn_x"))
GameConstants.RESPAWN_X = obj.getInt("respawn_x");
if(obj.has("respawn_y"))
GameConstants.RESPAWN_Y = obj.getInt("respawn_y");
if(obj.has("save_timer"))
GameConstants.SAVE_TIMER = obj.getInt("save_timer");
if(obj.has("timeout"))
GameConstants.TIMEOUT = obj.getInt("timeout");
if(obj.has("item_requirements"))
GameConstants.ITEM_REQUIREMENTS = obj.getBoolean("item_requirements");
if(obj.has("variable_xp_rate"))
GameConstants.VARIABLE_XP_RATE = obj.getBoolean("variable_xp_rate");
if(obj.has("xp_rate"))
GameConstants.XP_RATE = obj.getDouble("xp_rate");
if(obj.has("max_players"))
GameConstants.MAX_PLAYERS = obj.getInt("max_players");
if (obj.has("variable_xp_rates")) {
JSONArray rates = obj.optJSONArray("variable_xp_rates");
for (int i = 0; i < rates.length(); ++i) {
GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i);
}
if (obj.has("server_name"))
Constants.SERVER_NAME = obj.getString("server_name");
if (obj.has("server_test_version"))
Constants.TEST_VERSION = obj.getDouble("server_test_version");
if (obj.has("gui_enabled"))
Constants.GUI_ENABLED = obj.getBoolean("gui_enabled");
if (obj.has("website_link"))
Constants.WEBSITE_LINK = obj.getString("website_link");
if (obj.has("server_debug"))
Constants.SERVER_DEBUG = obj.getBoolean("server_debug");
if (obj.has("file_server"))
Constants.FILE_SERVER = obj.getBoolean("file_server");
if (obj.has("http_port"))
Constants.HTTP_PORT = obj.getInt("http_port");
if (obj.has("jaggrab_port"))
Constants.JAGGRAB_PORT = obj.getInt("jaggrab_port");
if (obj.has("world_id"))
Constants.WORLD = obj.getInt("world_id");
if (obj.has("members_only"))
Constants.MEMBERS_ONLY = obj.getBoolean("members_only");
if (obj.has("tutorial_island_enabled"))
Constants.TUTORIAL_ISLAND = obj.getBoolean("tutorial_island_enabled");
if (obj.has("party_room_enabled"))
Constants.PARTY_ROOM_DISABLED = !obj.getBoolean("party_room_enabled");
if (obj.has("clues_enabled"))
Constants.CLUES_ENABLED = obj.getBoolean("clues_enabled");
if (obj.has("admin_can_trade"))
Constants.ADMIN_CAN_TRADE = obj.getBoolean("admin_can_trade");
if (obj.has("admin_can_drop_items"))
Constants.ADMIN_DROP_ITEMS = obj.getBoolean("admin_can_drop_items");
if (obj.has("admin_can_sell"))
Constants.ADMIN_CAN_SELL_ITEMS = obj.getBoolean("admin_can_sell");
if (obj.has("respawn_x"))
Constants.RESPAWN_X = obj.getInt("respawn_x");
if (obj.has("respawn_y"))
Constants.RESPAWN_Y = obj.getInt("respawn_y");
if (obj.has("save_timer"))
Constants.SAVE_TIMER = obj.getInt("save_timer");
if (obj.has("timeout"))
Constants.TIMEOUT = obj.getInt("timeout");
if (obj.has("item_requirements"))
Constants.ITEM_REQUIREMENTS = obj.getBoolean("item_requirements");
if (obj.has("variable_xp_rate"))
Constants.VARIABLE_XP_RATE = obj.getBoolean("variable_xp_rate");
if (obj.has("xp_rate"))
Constants.XP_RATE = obj.getDouble("xp_rate");
if (obj.has("max_players"))
Constants.MAX_PLAYERS = obj.getInt("max_players");
if (obj.has("variable_xp_rates")) {
JSONArray rates = obj.optJSONArray("variable_xp_rates");
for (int i = 0; i < rates.length(); ++i) {
Constants.VARIABLE_XP_RATES[i] = rates.optInt(i);
}
if(obj.has("website_integration"))
GameConstants.WEBSITE_INTEGRATION = obj.getBoolean("website_integration");
}
if (obj.has("website_integration"))
Constants.WEBSITE_INTEGRATION = obj.getBoolean("website_integration");
}
private static void initialize() {
@@ -99,12 +103,12 @@ public class ConfigLoader {
/*
* Sets External Services Vars
*/
if(obj.has("bot-token"))
if (obj.has("bot-token"))
JavaCord.token = obj.getString("bot-token");
if(obj.has("websitepass"))
if (obj.has("websitepass"))
PlayersOnlineWebsite.password = obj.getString("websitepass");
RegisteredAccsWebsite.password = obj.getString("websitepass");
if(obj.has("erssecret"))
RegisteredAccsWebsite.password = obj.getString("websitepass");
if (obj.has("erssecret"))
GameEngine.ersSecret = obj.getString("erssecret");
}
@@ -1,6 +1,8 @@
package com.rs2;
public class GameConstants {
import java.math.BigInteger;
public class Constants {
/**
* The Variables Below Can Be Also Changed On Server Startup By Using The ConfigLoader
@@ -8,14 +10,16 @@ public class GameConstants {
* SERVER_NAME Sets The Name The Server Will Use
* WEBSITE_LINK Defines The Server Website Links
* WORLD Sets The Servers World ID
* The HTTP Server port.
* The JAGGRAB Server port.
* GUI_ENABLED Enables/Disables The Server Control Panel
* MAX_PLAYERS Sets The Maximum Amount Of Players Allow To Be Logged In At Once
* TIMEOUT Sets The Amount Of Time Before A Player Timeouts From A Bad Connection
* SAVE_TIMER Sets In Seconds How Often The Server Shouls Auto-Save All Characters
* RESPAWN_X Sets The X Coordinate That You Will Respawn At After Death
* RESPAWN_Y Sets The Y Coordinate That You Will Respawn At After Death
* FILE_SERVER Sets Whether The FileServer Should Run With The Server
* SERVER_DEBUG Sets Whether The Server Should Start In Debug Mode
* The Amount Of Time Before A Player Timeouts From A Bad Connection
* MEMBERS_ONLY Sets Whether The World Is Members Only
* TUTORIAL_ISLAND Enables/Disables Tutorial Island For Players On First Login
* PARTY_ROOM_DISABLED Enables/Disables The Party Room Should Be Disabled
@@ -30,8 +34,7 @@ public class GameConstants {
* WEBSITE_INTEGRATION Enables/Disables Website Features(Total Accounts Registered & Players Online)
*/
public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org";
public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120,
RESPAWN_X = 3222, RESPAWN_Y = 3218;
public static int WORLD = 1, HTTP_PORT = 8080, JAGGRAB_PORT = 43595, MAX_PLAYERS = 200, SAVE_TIMER = 120, TIMEOUT = 60, RESPAWN_X = 3222, RESPAWN_Y = 3218;
public static boolean GUI_ENABLED = false, 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, VARIABLE_XP_RATE = false,
@@ -39,7 +42,6 @@ public class GameConstants {
public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10};
public static double TEST_VERSION = 2.3, XP_RATE = 1.0;
/**
* The Variables Below Should Only Be Changed If You Understand What You Are Doing
*/
@@ -79,6 +81,24 @@ public class GameConstants {
public final static int BUFFER_SIZE = 10000;
/**
* The directory of the file system.
*/
public static final String FILE_SYSTEM_DIR = "./data/cache/";
public final static String SERVER_LOG_DIR = "./data/logs/";
/**
* The exponent used when decrypting the RSA block.
*/
public static final BigInteger RSA_EXPONENT = new BigInteger("33280025241734061313051117678670856264399753710527826596057587687835856000539511539311834363046145710983857746766009612538140077973762171163294453513440619295457626227183742315140865830778841533445402605660729039310637444146319289077374748018792349647460850308384280105990607337322160553135806205784213241305");;
/**
* The modulus used when decrypting the RSA block.
*/
public static final BigInteger RSA_MODULUS = new BigInteger("91553247461173033466542043374346300088148707506479543786501537350363031301992107112953015516557748875487935404852620239974482067336878286174236183516364787082711186740254168914127361643305190640280157664988536979163450791820893999053469529344247707567448479470137716627440246788713008490213212272520901741443");;
public final static int ATTACK = 0, DEFENCE = 1, STRENGTH = 2,
HITPOINTS = 3, RANGED = 4, PRAYER = 5, MAGIC = 6, COOKING = 7,
WOODCUTTING = 8, FLETCHING = 9, FISHING = 10, FIREMAKING = 11,
@@ -6,7 +6,6 @@ import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.file.Paths;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -19,12 +18,9 @@ import com.rs2.gui.ControlPanel;
import org.apollo.cache.IndexedFileSystem;
import org.apollo.cache.decoder.ItemDefinitionDecoder;
import org.apollo.cache.decoder.ObjectDefinitionDecoder;
import org.apollo.cache.def.ObjectDefinition;
import org.apollo.jagcached.Constants;
import org.apollo.jagcached.FileServer;
import com.rs2.game.bots.BotHandler;
import com.google.common.base.Stopwatch;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.minigames.FightCaves;
import com.rs2.game.content.minigames.FightPits;
@@ -54,6 +50,7 @@ import com.rs2.world.clip.RegionFactory;
import io.netty.util.ResourceLeakDetector;
import io.netty.util.ResourceLeakDetector.Level;
import org.apollo.net.NetworkConstants;
/**
* Server.java
@@ -72,7 +69,7 @@ public class GameEngine {
private static void startMinutesCounter() {
try {
minuteFile = new BufferedReader(new FileReader(
"./data/minutes.log"));
Constants.SERVER_LOG_DIR + "minutes.log"));
minutesCounter = Long.parseLong(minuteFile.readLine());
} catch (Exception e) {
e.printStackTrace();
@@ -83,7 +80,7 @@ public class GameEngine {
private static void setMinutesCounter(long minutesCounter) {
try {
BufferedWriter minuteCounter = new BufferedWriter(new FileWriter(
"./data/minutes.log"));
Constants.SERVER_LOG_DIR + "minutes.log"));
minuteCounter.write(Long.toString(minutesCounter));
minuteCounter.close();
} catch (IOException e) {
@@ -126,9 +123,14 @@ public class GameEngine {
public static void main(java.lang.String[] args)
throws NullPointerException, IOException {
if (NetworkConstants.RSA_EXPONENT != Constants.RSA_EXPONENT) {
NetworkConstants.RSA_EXPONENT = Constants.RSA_EXPONENT;
NetworkConstants.RSA_MODULUS = Constants.RSA_MODULUS;
}
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-gui"))
GameConstants.GUI_ENABLED = true;
Constants.GUI_ENABLED = true;
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch (args[i]) {
case "-c":
@@ -146,7 +148,7 @@ public class GameEngine {
}
System.out.println("Starting game engine..");
if (GameConstants.SERVER_DEBUG) {
if (Constants.SERVER_DEBUG) {
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
}
@@ -166,7 +168,7 @@ public class GameEngine {
/**
* Starting Up Server
*/
System.out.println("Launching " + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "...");
System.out.println("Launching " + Constants.SERVER_NAME + " World: " + Constants.WORLD + "...");
/**
* Start Integration Services
@@ -218,7 +220,7 @@ public class GameEngine {
/**
* Makes Visible Control Panel If Enabled
*/
if(GameConstants.GUI_ENABLED) {
if(Constants.GUI_ENABLED) {
ControlPanel panel = new ControlPanel();
panel.initComponents();
panel.setVisible(true);
@@ -255,7 +257,7 @@ public class GameEngine {
objectHandler.process();
MageTrainingArena.process();
CycleEventHandler.getSingleton().process();
if (GameConstants.WEBSITE_INTEGRATION) {
if (Constants.WEBSITE_INTEGRATION) {
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
}
@@ -292,7 +294,7 @@ public class GameEngine {
}
//TODO debug System.out.println("Cycle took " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms.");
}
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
}, 0, Constants.CYCLE_TIME, TimeUnit.MILLISECONDS);
/*
* I'd recommend disabling this until I can be bothered to implement it
@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.NoSuchElementException;
import java.util.Scanner;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.console.commands.ListPlayers;
import com.rs2.console.commands.Stop;
@@ -33,7 +33,7 @@ public class CommandConsole implements Runnable {
@Override
public void run() {
System.out.println("Welcome to " + GameConstants.SERVER_NAME + ".");
System.out.println("Welcome to " + Constants.SERVER_NAME + ".");
while (true) {
System.out.print("> ");
String input = null;
@@ -5,7 +5,7 @@ import static com.rs2.game.players.PlayerSave.loadPlayerInfo;
import java.text.DecimalFormat;
import java.util.*;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Client;
@@ -20,7 +20,7 @@ public class Bot {
public Bot(String username, Integer x, Integer y, Integer z) {
botClient = new Client(null);
inStream = new Stream(new byte[GameConstants.BUFFER_SIZE]);
inStream = new Stream(new byte[Constants.BUFFER_SIZE]);
inStream.currentOffset = 0;
botClient.playerName = username;
botClient.playerName2 = botClient.playerName;
@@ -3,11 +3,10 @@ package com.rs2.game.bots;
import java.io.File;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Client;
import com.rs2.game.players.Player;
import com.rs2.game.players.PlayerHandler;
@@ -24,7 +23,7 @@ public class BotHandler {
public static Bot connectBot(String username, Integer x, Integer y, Integer z) {
Bot bot;
if (PlayerHandler.playerCount >= GameConstants.MAX_PLAYERS) {
if (PlayerHandler.playerCount >= Constants.MAX_PLAYERS) {
System.out.println("Bot could not be connected, server is full.");
return null;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.game.content.combat.magic.CastOnOther;
import com.rs2.game.content.combat.magic.MagicData;
@@ -95,8 +95,8 @@ public class CombatAssistant {
if (Misc.random(4) == 1 && player.lastArrowUsed == 9242 && damage > 0) {
NpcHandler.npcs[i].gfx0(754);
damage = NpcHandler.npcs[i].HP / 5;
player.handleHitMask(player.playerLevel[GameConstants.HITPOINTS] / 10);
player.dealDamage(player.playerLevel[GameConstants.HITPOINTS] / 10);
player.handleHitMask(player.playerLevel[Constants.HITPOINTS] / 10);
player.dealDamage(player.playerLevel[Constants.HITPOINTS] / 10);
player.gfx0(754);
}
if (player.lastWeaponUsed == 11235 || player.bowSpecShot == 1) {
@@ -122,14 +122,14 @@ public class CombatAssistant {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE / 2, 4);
player.getPlayerAssistant().addSkillXP(damage / 2, 1);
player.getPlayerAssistant().addSkillXP(damage / 3, 3);
player.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);//defense
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);//hp
player.getPlayerAssistant().refreshSkill(GameConstants.RANGED);//range
player.getPlayerAssistant().refreshSkill(Constants.DEFENCE);//defense
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);//hp
player.getPlayerAssistant().refreshSkill(Constants.RANGED);//range
} else {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE, 4);
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE /3, 3);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.RANGED);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.RANGED);
}
if (damage > 0) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
@@ -201,8 +201,8 @@ public class CombatAssistant {
if (MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1161 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1153 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1157 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1542 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1543 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1562) {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MAGIC_EXP_RATE / 3, 3);
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
if (damage > 0) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
player.pcDamage += damage;
@@ -227,12 +227,12 @@ public class CombatAssistant {
case 12911:
case 12929:
int heal = Misc.random(damage / 2);
if (player.playerLevel[GameConstants.HITPOINTS] + heal >= player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
if (player.playerLevel[Constants.HITPOINTS] + heal >= player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
} else {
player.playerLevel[GameConstants.HITPOINTS] += heal;
player.playerLevel[Constants.HITPOINTS] += heal;
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
break;
}
}
@@ -302,15 +302,15 @@ public class CombatAssistant {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE / 3, 2);
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE / 3, 3);
player.getPlayerAssistant().refreshSkill(0);
player.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
player.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
player.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
} else {
if (NpcHandler.npcs[i].npcType != 2459 && NpcHandler.npcs[i].npcType != 2460 && NpcHandler.npcs[i].npcType != 2461 && NpcHandler.npcs[i].npcType != 2462) {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE, player.fightMode);
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE / 3, 3);
player.getPlayerAssistant().refreshSkill(player.fightMode);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
}
if (damage > 0) {
@@ -319,11 +319,11 @@ public class CombatAssistant {
}
}
if (damage > 0 && guthansEffect) {
player.playerLevel[GameConstants.HITPOINTS] += damage;
if (player.playerLevel[GameConstants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
player.playerLevel[Constants.HITPOINTS] += damage;
if (player.playerLevel[Constants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
NpcHandler.npcs[i].gfx0(398);
}
NpcHandler.npcs[i].underAttack = true;
@@ -332,15 +332,15 @@ public class CombatAssistant {
switch (player.specEffect) {
case 4:
if (damage > 0) {
if (player.playerLevel[GameConstants.HITPOINTS] + damage > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
if (player.playerLevel[GameConstants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
if (player.playerLevel[Constants.HITPOINTS] + damage > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
if (player.playerLevel[Constants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
} else {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
}
} else {
player.playerLevel[GameConstants.HITPOINTS] += damage;
player.playerLevel[Constants.HITPOINTS] += damage;
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
break;
@@ -825,7 +825,7 @@ public class CombatAssistant {
}
if (player.duelRule[9]) {
boolean canUseWeapon = false;
for (int funWeapon : GameConstants.FUN_WEAPONS) {
for (int funWeapon : Constants.FUN_WEAPONS) {
if (player.playerEquipment[player.playerWeapon] == funWeapon) {
canUseWeapon = true;
}
@@ -1098,7 +1098,7 @@ public class CombatAssistant {
public void playerDelayedHit(int i) {
if (PlayerHandler.players[i] != null) {
if (PlayerHandler.players[i].isDead || player.isDead || PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] <= 0 || player.playerLevel[GameConstants.HITPOINTS] <= 0) {
if (PlayerHandler.players[i].isDead || player.isDead || PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] <= 0 || player.playerLevel[Constants.HITPOINTS] <= 0) {
player.playerIndex = 0;
return;
}
@@ -1146,8 +1146,8 @@ public class CombatAssistant {
if (Misc.random(4) == 1 && player.lastArrowUsed == 9242 && damage > 0) {
PlayerHandler.players[i].gfx0(754);
damage = NpcHandler.npcs[i].HP / 5;
player.handleHitMask(player.playerLevel[GameConstants.HITPOINTS] / 10);
player.dealDamage(player.playerLevel[GameConstants.HITPOINTS] / 10);
player.handleHitMask(player.playerLevel[Constants.HITPOINTS] / 10);
player.dealDamage(player.playerLevel[Constants.HITPOINTS] / 10);
player.gfx0(754);
}
if (player.lastWeaponUsed == 11235 || player.bowSpecShot == 1) {
@@ -1165,11 +1165,11 @@ public class CombatAssistant {
damage2 = damage2 * 60 / 100;
}
}
if (PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS];
if (PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[Constants.HITPOINTS];
}
if (PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] - damage - damage2 < 0) {
damage2 = PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] - damage;
if (PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] - damage - damage2 < 0) {
damage2 = PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] - damage;
}
if (damage < 0) {
damage = 0;
@@ -1187,14 +1187,14 @@ public class CombatAssistant {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE / 3, 4);
player.getPlayerAssistant().addSkillXP(damage / 3, 1);
player.getPlayerAssistant().addSkillXP(damage / 3, 3);
player.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.RANGED);
player.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.RANGED);
} else {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE, 4);
player.getPlayerAssistant().addSkillXP(damage / 3, 3);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.RANGED);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.RANGED);
}
boolean dropArrows = true;
for (int noArrowId : RangeData.NO_ARROW_DROP) {
@@ -1220,7 +1220,7 @@ public class CombatAssistant {
PlayerHandler.players[i].handleHitMask(damage2);
}
o.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
o.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
PlayerHandler.players[i].updateRequired = true;
applySmite(i, damage);
if (damage2 != -1) {
@@ -1239,8 +1239,8 @@ public class CombatAssistant {
if (o.getPrayer().prayerActive[16] && System.currentTimeMillis() - o.protMageDelay > 1500) { // if prayer active reduce damage
damage = damage * 60 / 100;
}
if (PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS];
if (PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[Constants.HITPOINTS];
}
if (damage > 0) {
applyRecoil(player, damage, i);
@@ -1249,8 +1249,8 @@ public class CombatAssistant {
if (MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1161 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1153 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1157 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1542 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1543 && MagicData.MAGIC_SPELLS[player.oldSpellId][0] != 1562) {
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[player.oldSpellId][7] + damage / 3, 3);
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
if (MagicSpells.getEndGfxHeight(player) == 100 && !player.magicFailed) { // end GFX
PlayerHandler.players[i].gfx100(MagicData.MAGIC_SPELLS[player.oldSpellId][5]);
@@ -1269,7 +1269,7 @@ public class CombatAssistant {
case 13011:
case 12999:
case 13023:
PlayerHandler.players[i].playerLevel[GameConstants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.ATTACK]) * 10 / 100;
PlayerHandler.players[i].playerLevel[Constants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.ATTACK]) * 10 / 100;
break;
}
}
@@ -1293,51 +1293,51 @@ public class CombatAssistant {
case 12911:
case 12929:
int heal = damage / 4;
if (player.playerLevel[GameConstants.HITPOINTS] + heal > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
if (player.playerLevel[Constants.HITPOINTS] + heal > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
} else {
player.playerLevel[GameConstants.HITPOINTS] += heal;
player.playerLevel[Constants.HITPOINTS] += heal;
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
break;
case 1153:
PlayerHandler.players[i].playerLevel[GameConstants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.ATTACK]) * 5 / 100;
PlayerHandler.players[i].playerLevel[Constants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.ATTACK]) * 5 / 100;
o.getPacketSender().sendMessage("Your attack level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(0);
break;
case 1157:
PlayerHandler.players[i].playerLevel[GameConstants.STRENGTH] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.STRENGTH]) * 5 / 100;
PlayerHandler.players[i].playerLevel[Constants.STRENGTH] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.STRENGTH]) * 5 / 100;
o.getPacketSender().sendMessage("Your strength level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
o.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
break;
case 1161:
PlayerHandler.players[i].playerLevel[GameConstants.DEFENCE] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.DEFENCE]) * 5 / 100;
PlayerHandler.players[i].playerLevel[Constants.DEFENCE] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.DEFENCE]) * 5 / 100;
o.getPacketSender().sendMessage("Your defence level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
o.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
break;
case 1542:
PlayerHandler.players[i].playerLevel[GameConstants.DEFENCE] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.DEFENCE]) * 10 / 100;
PlayerHandler.players[i].playerLevel[Constants.DEFENCE] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.DEFENCE]) * 10 / 100;
o.getPacketSender().sendMessage("Your defence level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
o.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
break;
case 1543:
PlayerHandler.players[i].playerLevel[GameConstants.STRENGTH] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.STRENGTH]) * 10 / 100;
PlayerHandler.players[i].playerLevel[Constants.STRENGTH] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.STRENGTH]) * 10 / 100;
o.getPacketSender().sendMessage("Your strength level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
o.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
break;
case 1562:
PlayerHandler.players[i].playerLevel[GameConstants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[GameConstants.ATTACK]) * 10 / 100;
PlayerHandler.players[i].playerLevel[Constants.ATTACK] -= o.getPlayerAssistant().getLevelForXP(PlayerHandler.players[i].playerXP[Constants.ATTACK]) * 10 / 100;
o.getPacketSender().sendMessage("Your attack level has been reduced!");
PlayerHandler.players[i].reduceSpellDelay[player.reduceSpellId] = System.currentTimeMillis();
o.getPlayerAssistant().refreshSkill(0);
@@ -1358,7 +1358,7 @@ public class CombatAssistant {
}
applySmite(i, damage);
player.killedBy = PlayerHandler.players[i].playerId;
o.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
o.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
PlayerHandler.players[i].updateRequired = true;
player.usingMagic = false;
player.castingMagic = false;
@@ -1378,8 +1378,8 @@ public class CombatAssistant {
}
}
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
player.oldSpellId = 0;
}
}
@@ -1434,15 +1434,15 @@ public class CombatAssistant {
damage = damage * 60 / 100;
}
if (damage > 0 && guthansEffect) {
player.playerLevel[GameConstants.HITPOINTS] += damage;
if (player.playerLevel[GameConstants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
player.playerLevel[Constants.HITPOINTS] += damage;
if (player.playerLevel[Constants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
o.gfx0(398);
}
if (PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[GameConstants.HITPOINTS];
if (PlayerHandler.players[i].playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = PlayerHandler.players[i].playerLevel[Constants.HITPOINTS];
}
if (damage > 0) {
applyRecoil(player, damage, i);
@@ -1478,24 +1478,24 @@ public class CombatAssistant {
break;
case 3:
if (damage > 0) {
o.playerLevel[GameConstants.DEFENCE] -= damage;
o.playerLevel[Constants.DEFENCE] -= damage;
o.getPacketSender().sendMessage("You feel weak.");
if (o.playerLevel[GameConstants.DEFENCE] < 1) {
o.playerLevel[GameConstants.DEFENCE] = 1;
if (o.playerLevel[Constants.DEFENCE] < 1) {
o.playerLevel[Constants.DEFENCE] = 1;
}
o.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
o.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
}
break;
case 4:
if (damage > 0) {
if (player.playerLevel[GameConstants.HITPOINTS] + damage > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
if (player.playerLevel[GameConstants.HITPOINTS] < player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
if (player.playerLevel[Constants.HITPOINTS] + damage > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
if (player.playerLevel[Constants.HITPOINTS] < player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
}
} else {
player.playerLevel[GameConstants.HITPOINTS] += damage;
player.playerLevel[Constants.HITPOINTS] += damage;
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
break;
}
@@ -1506,14 +1506,14 @@ public class CombatAssistant {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE / 3, 2);
player.getPlayerAssistant().addSkillXP(damage / 3, 3);
player.getPlayerAssistant().refreshSkill(0);
player.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
player.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
player.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
} else {
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE, player.fightMode);
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.MELEE_EXP_RATE/3, 3);
player.getPlayerAssistant().refreshSkill(player.fightMode);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
PlayerHandler.players[i].logoutDelay = System.currentTimeMillis();
PlayerHandler.players[i].underAttackBy = player.playerId;
@@ -1530,7 +1530,7 @@ public class CombatAssistant {
PlayerHandler.players[i].damageTaken[player.playerId] += damage;
player.totalPlayerDamageDealt += damage;
PlayerHandler.players[i].updateRequired = true;
o.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
o.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
break;
case 2:
@@ -1539,7 +1539,7 @@ public class CombatAssistant {
player.totalPlayerDamageDealt += damage;
PlayerHandler.players[i].updateRequired = true;
player.doubleHit = false;
o.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
o.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
break;
}
PlayerHandler.players[i].handleHitMask(damage);
@@ -1554,12 +1554,12 @@ public class CombatAssistant {
}
if (PlayerHandler.players[index] != null) {
Client c2 = (Client) PlayerHandler.players[index];
c2.playerLevel[GameConstants.PRAYER] -= damage / 4;
if (c2.playerLevel[GameConstants.PRAYER] <= 0) {
c2.playerLevel[GameConstants.PRAYER] = 0;
c2.playerLevel[Constants.PRAYER] -= damage / 4;
if (c2.playerLevel[Constants.PRAYER] <= 0) {
c2.playerLevel[Constants.PRAYER] = 0;
PrayerDrain.resetPrayers(c2);
}
c2.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
c2.getPlayerAssistant().refreshSkill(Constants.PRAYER);
}
}
@@ -2,10 +2,8 @@ package com.rs2.game.content.combat;
import java.util.HashMap;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.StaticNpcList;
import com.rs2.game.content.combat.range.RangeData;
import com.rs2.game.content.music.sound.CombatSounds;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Client;
@@ -212,10 +210,10 @@ public class Specials {
if (o.getPrayer().prayerActive[18] && System.currentTimeMillis() - o.protMeleeDelay > 1500) {
damage *= .6;
}
if (o.playerLevel[GameConstants.HITPOINTS] - damage <= 0) {
damage = o.playerLevel[GameConstants.HITPOINTS];
if (o.playerLevel[Constants.HITPOINTS] - damage <= 0) {
damage = o.playerLevel[Constants.HITPOINTS];
}
if (o.playerLevel[GameConstants.HITPOINTS] > 0) {
if (o.playerLevel[Constants.HITPOINTS] > 0) {
o.handleHitMask(damage);
player.startAnimation(1667);
o.gfx100(337);
@@ -278,8 +276,8 @@ public class Specials {
player2.forcedChat("Raarrrrrgggggghhhhhhh!");
player2.startAnimation(1056);
player2.specAmount -= 5;
player2.playerLevel[GameConstants.STRENGTH] = player2.getPlayerAssistant().getLevelForXP(player2.playerXP[GameConstants.STRENGTH]) + player2.getPlayerAssistant().getLevelForXP(player2.playerXP[GameConstants.STRENGTH]) * 15 / 100;
player2.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
player2.playerLevel[Constants.STRENGTH] = player2.getPlayerAssistant().getLevelForXP(player2.playerXP[Constants.STRENGTH]) + player2.getPlayerAssistant().getLevelForXP(player2.playerXP[Constants.STRENGTH]) * 15 / 100;
player2.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
player2.getItemAssistant().updateSpecialBar();
} else {
player2.getPacketSender().sendMessage("You don't have the required special energy to use this attack.");
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.magic;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class CastRequirements {
@@ -42,7 +42,7 @@ public class CastRequirements {
}
public static boolean hasRequiredLevel(Player c, int i) {
return c.playerLevel[GameConstants.MAGIC] >= i;
return c.playerLevel[Constants.MAGIC] >= i;
}
public static final int FIRE = 554,
@@ -3,7 +3,7 @@ package com.rs2.game.content.combat.magic;
import java.util.HashMap;
import java.util.Map;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class Enchanting {
@@ -209,7 +209,7 @@ public class Enchanting {
if (enc == null || ens == null) {
return;
}
if (c.playerLevel[GameConstants.MAGIC] < ens.getLevelReq()) {
if (c.playerLevel[Constants.MAGIC] < ens.getLevelReq()) {
c.getPacketSender().sendMessage(
"You need a magic level of at least "
+ ens.getLevelReq() + " to cast this spell.");
@@ -230,7 +230,7 @@ public class Enchanting {
}
// Everything is fine, Enchant the item
c.getItemAssistant().replaceItem(enc.getUnenchanted(), enc.getEnchanted());
c.getPlayerAssistant().addSkillXP(ens.getXp(), GameConstants.MAGIC);
c.getPlayerAssistant().addSkillXP(ens.getXp(), Constants.MAGIC);
CastRequirements.deleteRunes(c, getRequiredRunes(ens));
c.startAnimation(ens.getAnim());
c.gfx100(ens.getGFX());
@@ -1,14 +1,14 @@
package com.rs2.game.content.combat.magic;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class MagicMaxHit {
public static int mageAttackBonus(Player c) {
int magicBonus = c.playerLevel[GameConstants.MAGIC];
int magicBonus = c.playerLevel[Constants.MAGIC];
if (MagicData.fullVoidMage(c)) {
magicBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.MAGIC]) * 0.2;
magicBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.MAGIC]) * 0.2;
}
if (c.getPrayer().prayerActive[4]) {
magicBonus *= 1.05;
@@ -21,17 +21,17 @@ public class MagicMaxHit {
}
public static int mageDefenceBonus(Player c) {
int defenceBonus = c.playerLevel[GameConstants.DEFENCE] / 2 + c.playerLevel[GameConstants.MAGIC] / 2;
int defenceBonus = c.playerLevel[Constants.DEFENCE] / 2 + c.playerLevel[Constants.MAGIC] / 2;
if (c.getPrayer().prayerActive[0]) {
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.05;
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.05;
} else if (c.getPrayer().prayerActive[3]) {
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.1;
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.1;
} else if (c.getPrayer().prayerActive[9]) {
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.15;
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.15;
} else if (c.getPrayer().prayerActive[18]) {
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.2;
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.2;
} else if (c.getPrayer().prayerActive[19]) {
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.25;
defenceBonus += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.25;
}
return defenceBonus + c.playerBonus[8] + c.playerBonus[8] / 3;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.magic;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
import com.rs2.game.players.PlayerHandler;
@@ -95,7 +95,7 @@ public class MagicRequirements {
}
// check magic level
if (c.playerLevel[GameConstants.MAGIC] < MagicData.MAGIC_SPELLS[spell][1]) {
if (c.playerLevel[Constants.MAGIC] < MagicData.MAGIC_SPELLS[spell][1]) {
c.getPacketSender().sendMessage(
"You need to have a magic level of "
+ MagicData.MAGIC_SPELLS[spell][1]
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.magic;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.CombatConstants;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.players.Client;
@@ -31,19 +31,19 @@ public class MagicSpells extends MagicData {
if (c2.getPrayer().prayerActive[12]) {
damage *= (int) .60;
}
if (c2.playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = c2.playerLevel[GameConstants.HITPOINTS];
if (c2.playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = c2.playerLevel[Constants.HITPOINTS];
}
c.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[c.oldSpellId][7] + damage * CombatConstants.MAGIC_EXP_RATE, 6);
c.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[c.oldSpellId][7] + damage / 3, 3);
// Server.playerHandler.players[playerId].setHitDiff(damage);
// Server.playerHandler.players[playerId].setHitUpdateRequired(true);
PlayerHandler.players[playerId].handleHitMask(damage);
// Server.playerHandler.players[playerId].playerLevel[GameConstants.HITPOINTS] -=
// Server.playerHandler.players[playerId].playerLevel[Constants.HITPOINTS] -=
// damage;
PlayerHandler.players[playerId].dealDamage(damage);
PlayerHandler.players[playerId].damageTaken[c.playerId] += damage;
c2.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c2.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
c.totalPlayerDamageDealt += damage;
multiSpellEffect(c, playerId, damage);
} else {
@@ -63,21 +63,21 @@ public class MagicSpells extends MagicData {
- PlayerHandler.players[playerId].reduceStat > 35000) {
PlayerHandler.players[playerId].reduceStat = System
.currentTimeMillis();
PlayerHandler.players[playerId].playerLevel[GameConstants.ATTACK] -= PlayerHandler.players[playerId].getPlayerAssistant()
.getLevelForXP(PlayerHandler.players[playerId].playerXP[GameConstants.ATTACK]) * 10 / 100;
PlayerHandler.players[playerId].playerLevel[Constants.ATTACK] -= PlayerHandler.players[playerId].getPlayerAssistant()
.getLevelForXP(PlayerHandler.players[playerId].playerXP[Constants.ATTACK]) * 10 / 100;
}
break;
case 12919: // blood spells
case 12929:
int heal = damage / 4;
if (c.playerLevel[GameConstants.HITPOINTS] + heal >= c.getPlayerAssistant()
.getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(
c.playerXP[GameConstants.HITPOINTS]);
if (c.playerLevel[Constants.HITPOINTS] + heal >= c.getPlayerAssistant()
.getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(
c.playerXP[Constants.HITPOINTS]);
} else {
c.playerLevel[GameConstants.HITPOINTS] += heal;
c.playerLevel[Constants.HITPOINTS] += heal;
}
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
break;
case 12891:
case 12881:
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.magic;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.randomevents.RandomEventHandler;
import com.rs2.game.players.Player;
@@ -27,7 +27,7 @@ public class MagicTeleports {
player.getPacketSender().sendMessage("You can't teleport above level 20 wilderness.");
return;
}
if (player.playerLevel[GameConstants.MAGIC] < teleport.getRequiredLevel()) {
if (player.playerLevel[Constants.MAGIC] < teleport.getRequiredLevel()) {
player.getPacketSender().sendMessage("You need a magic level of " + teleport.getRequiredLevel() + " to cast this spell.");
return;
}
@@ -38,6 +38,6 @@ public class MagicTeleports {
RandomEventHandler.addRandom(player);
CastRequirements.deleteRunes(player, teleport.getRequiredRunes());
player.getPlayerAssistant().startTeleport(teleport.getDestX(), teleport.getDestY(), teleport.getDestZ(), teleport.getType());
player.getPlayerAssistant().addSkillXP(teleport.getExperienceGained(), GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(teleport.getExperienceGained(), Constants.MAGIC);
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.melee;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.magic.MagicData;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.items.ItemConstants;
@@ -20,21 +20,21 @@ public class MeleeData {
}
public static int calculateMeleeAttack(Player c) {
int attackLevel = c.playerLevel[GameConstants.ATTACK];
int attackLevel = c.playerLevel[Constants.ATTACK];
// 2, 5, 11, 18, 19
if (c.getPrayer().prayerActive[2]) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.05;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.05;
} else if (c.getPrayer().prayerActive[7]) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.1;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.1;
} else if (c.getPrayer().prayerActive[15]) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.15;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.15;
} else if (c.getPrayer().prayerActive[24]) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.15;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.15;
} else if (c.getPrayer().prayerActive[25]) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.2;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.2;
}
if (fullVoidMelee(c)) {
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 0.1;
attackLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 0.1;
}
attackLevel *= c.specAccuracy;
// c.sendMessage("Attack: " + (attackLevel +
@@ -62,18 +62,18 @@ public class MeleeData {
}
public static int calculateMeleeDefence(Player c) {
int defenceLevel = c.playerLevel[GameConstants.DEFENCE];
int defenceLevel = c.playerLevel[Constants.DEFENCE];
int i = c.playerBonus[bestMeleeDef(c)];
if (c.getPrayer().prayerActive[0]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.05;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.05;
} else if (c.getPrayer().prayerActive[5]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.1;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.1;
} else if (c.getPrayer().prayerActive[13]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.15;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.15;
} else if (c.getPrayer().prayerActive[24]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.2;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.2;
} else if (c.getPrayer().prayerActive[25]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.25;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.25;
}
return (int) (defenceLevel + defenceLevel * 0.15 + (i + i * 0.05));
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.melee;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class MeleeMaxHit {
@@ -8,8 +8,8 @@ public class MeleeMaxHit {
public static int calculateMeleeMaxHit(Player c) {
double maxHit = 0;
int strBonus = c.playerBonus[10];
int strength = c.playerLevel[GameConstants.STRENGTH];
int lvlForXP = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]);
int strength = c.playerLevel[Constants.STRENGTH];
int lvlForXP = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]);
if (c.getPrayer().prayerActive[1]) {
strength += (int) (lvlForXP * .05);
} else if (c.getPrayer().prayerActive[6]) {
@@ -32,7 +32,7 @@ public class MeleeMaxHit {
&& c.playerEquipment[c.playerHat] == 4716
&& c.playerEquipment[c.playerChest] == 4720
&& c.playerEquipment[c.playerLegs] == 4722) {
maxHit += (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) - c.playerLevel[GameConstants.HITPOINTS]) / 2;
maxHit += (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) - c.playerLevel[Constants.HITPOINTS]) / 2;
}
if (c.specDamage > 1) {
maxHit = (int) (maxHit * c.specDamage);
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.npcs;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.CombatConstants;
import com.rs2.game.content.combat.melee.MeleeData;
import com.rs2.game.content.minigames.FightCaves;
@@ -63,7 +63,7 @@ public class NpcCombat {
c.gfx0(NpcHandler.npcs[i].endGfx);
}
}
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
}
}
@@ -330,9 +330,9 @@ public class NpcCombat {
}
break;
case 134:
if (c.playerLevel[GameConstants.PRAYER] > 0) {
c.playerLevel[GameConstants.PRAYER]--;
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
if (c.playerLevel[Constants.PRAYER] > 0) {
c.playerLevel[Constants.PRAYER]--;
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
c.getPlayerAssistant().appendPoison(5);
c.getCombatAssistant().resetPlayerAttack();
}
@@ -557,8 +557,8 @@ public class NpcCombat {
damage = 0;
}
if (NpcData.cantKillYou(NpcHandler.npcs[i].npcType)) {
if (damage >= c.playerLevel[GameConstants.HITPOINTS]) {
damage = c.playerLevel[GameConstants.HITPOINTS] - 1;
if (damage >= c.playerLevel[Constants.HITPOINTS]) {
damage = c.playerLevel[Constants.HITPOINTS] - 1;
}
}
if (c.getPrayer().prayerActive[18] && !(NpcHandler.npcs[i].npcType == 2030)) { // protect from melee
@@ -574,8 +574,8 @@ public class NpcCombat {
damage = 0;
}
}
if (c.playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[GameConstants.HITPOINTS];
if (c.playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[Constants.HITPOINTS];
}
}
@@ -588,15 +588,15 @@ public class NpcCombat {
damage = 0;
}
if (NpcData.cantKillYou(NpcHandler.npcs[i].npcType)) {
if (damage >= c.playerLevel[GameConstants.HITPOINTS]) {
damage = c.playerLevel[GameConstants.HITPOINTS] - 1;
if (damage >= c.playerLevel[Constants.HITPOINTS]) {
damage = c.playerLevel[Constants.HITPOINTS] - 1;
}
}
if (c.getPrayer().prayerActive[17]) { // protect from range
damage = 0;
}
if (c.playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[GameConstants.HITPOINTS];
if (c.playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[Constants.HITPOINTS];
}
}
@@ -608,8 +608,8 @@ public class NpcCombat {
magicFailed = true;
}
if (NpcData.cantKillYou(NpcHandler.npcs[i].npcType)) {
if (damage >= c.playerLevel[GameConstants.HITPOINTS]) {
damage = c.playerLevel[GameConstants.HITPOINTS] - 1;
if (damage >= c.playerLevel[Constants.HITPOINTS]) {
damage = c.playerLevel[Constants.HITPOINTS] - 1;
}
}
if(c.getPrayer().prayerActive[16]) { // protect from magic
@@ -620,8 +620,8 @@ public class NpcCombat {
damage = 0;
}
magicFailed = true;
if (c.playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[GameConstants.HITPOINTS];
if (c.playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[Constants.HITPOINTS];
}
if(NpcHandler.npcs[i].endGfx > 0 && (!magicFailed || FightCaves.isFightCaveNpc(i))) {
c.gfx100(NpcHandler.npcs[i].endGfx);
@@ -656,18 +656,18 @@ public class NpcCombat {
if (c.getPlayerAssistant().savePlayer()) {
c.getPlayerAssistant().handleROL();
} else {
int difference = c.playerLevel[GameConstants.HITPOINTS] - damage;
if (difference <= c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) / 10 && difference > 0) {
int difference = c.playerLevel[Constants.HITPOINTS] - damage;
if (difference <= c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) / 10 && difference > 0) {
c.appendRedemption();
}
if (c.playerLevel[GameConstants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[GameConstants.HITPOINTS];
if (c.playerLevel[Constants.HITPOINTS] - damage < 0) {
damage = c.playerLevel[Constants.HITPOINTS];
}
NpcHandler.handleSpecialEffects(c, i, damage);
c.logoutDelay = System.currentTimeMillis(); // logout delay
c.handleHitMask(damage);
c.playerLevel[GameConstants.HITPOINTS] -= damage;
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c.playerLevel[Constants.HITPOINTS] -= damage;
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
FightCaves.tzKihEffect(c, i, damage);
if (damage > 0)
{
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.prayer;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.players.Player;
@@ -19,13 +19,13 @@ public class ActivatePrayers {
"Prayer has been disabled in this duel!");
return;
}
if (i == 24 && player.playerLevel[GameConstants.DEFENCE] < 65) {
if (i == 24 && player.playerLevel[Constants.DEFENCE] < 65) {
player.getPacketSender().sendConfig(player.getPrayer().PRAYER_GLOW[i], 0);
player.getPacketSender().sendMessage(
"You may not use this prayer yet.");
return;
}
if (i == 25 && player.playerLevel[GameConstants.DEFENCE] < 70) {
if (i == 25 && player.playerLevel[Constants.DEFENCE] < 70) {
player.getPacketSender().sendConfig(player.getPrayer().PRAYER_GLOW[i], 0);
player.getPacketSender().sendMessage(
"You may not use this prayer yet.");
@@ -37,8 +37,8 @@ public class ActivatePrayers {
int[] rangePrayer = { 3, 11, 19 };
int[] magePrayer = { 4, 12, 20 };
if (player.playerLevel[GameConstants.PRAYER] > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.PRAYER]) >= player
if (player.playerLevel[Constants.PRAYER] > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.PRAYER]) >= player
.getPrayer().PRAYER_LEVEL_REQUIRED[i]) {
boolean headIcon = false;
switch (i) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.prayer;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class PrayerDrain {
@@ -26,16 +26,16 @@ public class PrayerDrain {
}
public static void reducePrayerLevel(Player c) {
if (c.playerLevel[GameConstants.PRAYER] - 1 > 0) {
c.playerLevel[GameConstants.PRAYER] -= 1;
if (c.playerLevel[Constants.PRAYER] - 1 > 0) {
c.playerLevel[Constants.PRAYER] -= 1;
} else {
c.getPacketSender().sendMessage(
"You have run out of prayer points!");
c.playerLevel[GameConstants.PRAYER] = 0;
c.playerLevel[Constants.PRAYER] = 0;
resetPrayers(c);
c.getPrayer().prayerId = -1;
}
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
}
public static void resetPrayers(Player player) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.combat.range;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -79,7 +79,7 @@ public class DwarfCannon {
player.getItemAssistant().deleteItem(StaticItemList.STEEL_BAR, 1);
player.getItemAssistant().addItem(2, 4);
player.getPacketSender().sendMessage("You make some cannonballs.");
player.getPlayerAssistant().addSkillXP(26, GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(26, Constants.SMITHING);
player.getPacketSender().sendSound(352, 100, 0);
}
}
@@ -432,7 +432,7 @@ public class DwarfCannon {
target.hitUpdateRequired2 = true;
target.updateRequired = true;
myBalls -= 1;
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE, GameConstants.RANGED);
player.getPlayerAssistant().addSkillXP(damage * CombatConstants.RANGE_EXP_RATE, Constants.RANGED);
}
}
@@ -503,7 +503,7 @@ public class DwarfCannon {
}
public boolean canAttackSlayer(int i){
return player.playerLevel[GameConstants.SLAYER] >= player.getSlayer().getRequiredLevel(NpcHandler.npcs[i].npcType);
return player.playerLevel[Constants.SLAYER] >= player.getSlayer().getRequiredLevel(NpcHandler.npcs[i].npcType);
}
private void cannonProjectile(Npc n) {
@@ -1,31 +1,31 @@
package com.rs2.game.content.combat.range;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class RangeMaxHit {
public static int calculateRangeDefence(Player c) {
int defenceLevel = c.playerLevel[GameConstants.DEFENCE];
int defenceLevel = c.playerLevel[Constants.DEFENCE];
if (c.getPrayer().prayerActive[0]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.05;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.05;
} else if (c.getPrayer().prayerActive[5]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.1;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.1;
} else if (c.getPrayer().prayerActive[13]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.15;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.15;
} else if (c.getPrayer().prayerActive[24]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.2;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.2;
} else if (c.getPrayer().prayerActive[25]) {
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 0.25;
defenceLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 0.25;
}
return defenceLevel + c.playerBonus[9] + c.playerBonus[9] / 2;
}
public static int calculateRangeAttack(Player c) {
int rangeLevel = c.playerLevel[GameConstants.RANGED];
int rangeLevel = c.playerLevel[Constants.RANGED];
rangeLevel *= c.specAccuracy;
if (RangeData.fullVoidRange(c)) {
rangeLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.RANGED]) * 0.1;
rangeLevel += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.RANGED]) * 0.1;
}
if (c.getPrayer().prayerActive[3]) {
rangeLevel *= 1.05;
@@ -42,7 +42,7 @@ public class RangeMaxHit {
}
public static int rangeMaxHit(Player c) {
int rangeLevel = c.playerLevel[GameConstants.RANGED];
int rangeLevel = c.playerLevel[Constants.RANGED];
int itemUsed = getRangeStr(c.usingBow ? c.lastArrowUsed : c.lastWeaponUsed);
double modifier = 1.00;
if (c.getPrayer().prayerActive[3]) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.consumables;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.*;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -129,50 +129,50 @@ public class Beverages {
switch (id) {
case 1917:
case 7740://beer
double beerEffectStrength = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]) * .04 + c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]);
double beerEffectAttack = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * .07;
if (c.playerLevel[GameConstants.STRENGTH] < beerEffectStrength) {
c.playerLevel[GameConstants.STRENGTH] = (int) beerEffectStrength;
double beerEffectStrength = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]) * .04 + c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]);
double beerEffectAttack = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * .07;
if (c.playerLevel[Constants.STRENGTH] < beerEffectStrength) {
c.playerLevel[Constants.STRENGTH] = (int) beerEffectStrength;
}
if (c.playerLevel[GameConstants.ATTACK] > 0) {
c.playerLevel[GameConstants.ATTACK] -= beerEffectAttack;
if (c.playerLevel[Constants.ATTACK] > 0) {
c.playerLevel[Constants.ATTACK] -= beerEffectAttack;
}
if (c.playerLevel[GameConstants.ATTACK] <= 0) {
c.playerLevel[GameConstants.ATTACK] = 1;
if (c.playerLevel[Constants.ATTACK] <= 0) {
c.playerLevel[Constants.ATTACK] = 1;
}
c.getPlayerAssistant().refreshSkill(0);
c.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
c.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
break;
case 1913: //dwarven stout
c.playerLevel[GameConstants.MINING] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.MINING]) + 1;
c.playerLevel[GameConstants.SMITHING] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.SMITHING]) + 1;
c.getPlayerAssistant().refreshSkill(GameConstants.MINING);
c.getPlayerAssistant().refreshSkill(GameConstants.SMITHING);
c.playerLevel[Constants.MINING] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.MINING]) + 1;
c.playerLevel[Constants.SMITHING] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.SMITHING]) + 1;
c.getPlayerAssistant().refreshSkill(Constants.MINING);
c.getPlayerAssistant().refreshSkill(Constants.SMITHING);
break;
case 1907://wizard's mind bomb
if (c.playerLevel[GameConstants.MAGIC] < 50) {
c.playerLevel[GameConstants.MAGIC] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.MAGIC]) + 2;
if (c.playerLevel[Constants.MAGIC] < 50) {
c.playerLevel[Constants.MAGIC] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.MAGIC]) + 2;
} else {
c.playerLevel[GameConstants.MAGIC] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.MAGIC]) + 3;
c.playerLevel[Constants.MAGIC] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.MAGIC]) + 3;
}
c.playerLevel[GameConstants.STRENGTH] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]) - 3;
c.playerLevel[GameConstants.DEFENCE] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) - 3;
c.playerLevel[GameConstants.ATTACK] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) - 4;
c.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
c.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
c.getPlayerAssistant().refreshSkill(GameConstants.ATTACK);
c.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
c.playerLevel[Constants.STRENGTH] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]) - 3;
c.playerLevel[Constants.DEFENCE] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) - 3;
c.playerLevel[Constants.ATTACK] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) - 4;
c.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
c.getPlayerAssistant().refreshSkill(Constants.MAGIC);
c.getPlayerAssistant().refreshSkill(Constants.ATTACK);
c.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
break;
case 1915://grog
c.playerLevel[GameConstants.STRENGTH] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]) + 3;
if (c.playerLevel[GameConstants.ATTACK] > 0) {
c.playerLevel[GameConstants.ATTACK] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) - 2;
c.playerLevel[Constants.STRENGTH] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]) + 3;
if (c.playerLevel[Constants.ATTACK] > 0) {
c.playerLevel[Constants.ATTACK] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) - 2;
}
if (c.playerLevel[GameConstants.ATTACK] <= 0) {
c.playerLevel[GameConstants.ATTACK] = 1;
if (c.playerLevel[Constants.ATTACK] <= 0) {
c.playerLevel[Constants.ATTACK] = 1;
}
c.getPlayerAssistant().refreshSkill(0);
c.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
c.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
break;
}
}
@@ -2,7 +2,7 @@ package com.rs2.game.content.consumables;
import java.util.HashMap;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.items.impl.RareProtection;
import com.rs2.game.players.Player;
@@ -209,7 +209,7 @@ public class Food {
}
public static void eat(Player player, int id, int slot) {
if (player.isDead || player.playerLevel[GameConstants.HITPOINTS] <= 0) {
if (player.isDead || player.playerLevel[Constants.HITPOINTS] <= 0) {
return;
}
if (player.duelRule[6]) {
@@ -219,7 +219,7 @@ public class Food {
if (!RareProtection.eatDupedItem(player, id)) {
return;
}
if (System.currentTimeMillis() - player.foodDelay >= 1800 && player.playerLevel[GameConstants.HITPOINTS] > 0) {
if (System.currentTimeMillis() - player.foodDelay >= 1800 && player.playerLevel[Constants.HITPOINTS] > 0) {
player.getCombatAssistant().resetPlayerAttack();
player.attackTimer += 2;
player.startAnimation(829);
@@ -256,14 +256,14 @@ public class Food {
player.getPacketSender().sendSound(SoundList.DRINK, 100, 0);
}
player.foodDelay = System.currentTimeMillis();
if (player.playerLevel[GameConstants.HITPOINTS] < player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] += f.getHeal();
if (player.playerLevel[Constants.HITPOINTS] < player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] += f.getHeal();
player.getPacketSender().sendMessage("It heals some health.");
if (player.playerLevel[GameConstants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) {
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]);
if (player.playerLevel[Constants.HITPOINTS] > player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) {
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]);
}
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
}
@@ -274,33 +274,33 @@ public class Food {
player.forcedChat("Aaah, nothing like a nice cuppa tea!");
break;
case 1907:
if (player.playerLevel[GameConstants.MAGIC] < 50) {
player.playerLevel[GameConstants.MAGIC] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.MAGIC]) + 2;
if (player.playerLevel[Constants.MAGIC] < 50) {
player.playerLevel[Constants.MAGIC] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.MAGIC]) + 2;
} else {
player.playerLevel[GameConstants.MAGIC] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.MAGIC]) + 3;
player.playerLevel[Constants.MAGIC] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.MAGIC]) + 3;
}
if (player.playerLevel[GameConstants.STRENGTH] < 4) {
player.playerLevel[GameConstants.STRENGTH] = 1;
if (player.playerLevel[Constants.STRENGTH] < 4) {
player.playerLevel[Constants.STRENGTH] = 1;
}
if (player.playerLevel[GameConstants.ATTACK] < 5) {
player.playerLevel[GameConstants.ATTACK] = 1;
if (player.playerLevel[Constants.ATTACK] < 5) {
player.playerLevel[Constants.ATTACK] = 1;
} else {
player.playerLevel[GameConstants.ATTACK] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.ATTACK]) - 4;
player.playerLevel[Constants.ATTACK] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.ATTACK]) - 4;
}
if (player.playerLevel[GameConstants.DEFENCE] < 4) {
player.playerLevel[GameConstants.DEFENCE] = 1;
if (player.playerLevel[Constants.DEFENCE] < 4) {
player.playerLevel[Constants.DEFENCE] = 1;
} else {
player.playerLevel[GameConstants.DEFENCE] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.DEFENCE]) - 3;
player.playerLevel[Constants.DEFENCE] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.DEFENCE]) - 3;
}
if (player.playerLevel[GameConstants.STRENGTH] < 4) {
player.playerLevel[GameConstants.STRENGTH] = 1;
if (player.playerLevel[Constants.STRENGTH] < 4) {
player.playerLevel[Constants.STRENGTH] = 1;
} else {
player.playerLevel[GameConstants.STRENGTH] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.STRENGTH]) - 3;
player.playerLevel[Constants.STRENGTH] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.STRENGTH]) - 3;
}
player.getPlayerAssistant().refreshSkill(0);
player.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
player.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
player.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
break;
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.consumables;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -51,10 +51,10 @@ public class Kebabs {
} else if (Misc.random(100.0f) <= eff2) { // 61.24% heals 10% of HP
c.getPacketSender()
.sendMessage("It restores some life points.");
if (c.playerLevel[GameConstants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) * 0.10;
if (c.playerLevel[GameConstants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]);
if (c.playerLevel[Constants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) * 0.10;
if (c.playerLevel[Constants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]);
}
}
@@ -62,10 +62,10 @@ public class Kebabs {
} else if (Misc.random(100.0f) <= eff3) { // 21.12% + 10-20 HP
c.getPacketSender().sendMessage(
"That was a good kebab. You feel a lot better. ");
if (c.playerLevel[GameConstants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] += Misc.random(20);
if (c.playerLevel[GameConstants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]);
if (c.playerLevel[Constants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] += Misc.random(20);
if (c.playerLevel[Constants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]);
}
}
@@ -74,16 +74,16 @@ public class Kebabs {
c.getPacketSender()
.sendMessage(
"Wow, that was an amazing kebab! You feel really invigorated.");
c.playerLevel[GameConstants.DEFENCE] += 2 + Misc.random(1); // def
c.playerLevel[GameConstants.STRENGTH] += 2 + Misc.random(1); // str
c.playerLevel[GameConstants.ATTACK] += 2 + Misc.random(1); // atk
c.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
c.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
if (c.playerLevel[GameConstants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] += Misc.random(30);
if (c.playerLevel[GameConstants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]);
c.playerLevel[Constants.DEFENCE] += 2 + Misc.random(1); // def
c.playerLevel[Constants.STRENGTH] += 2 + Misc.random(1); // str
c.playerLevel[Constants.ATTACK] += 2 + Misc.random(1); // atk
c.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
c.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
if (c.playerLevel[Constants.HITPOINTS] < c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] += Misc.random(30);
if (c.playerLevel[Constants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]);
}
}
@@ -105,8 +105,8 @@ public class Kebabs {
*/
public static void eat(Player player, int slot) {
if (System.currentTimeMillis() - player.foodDelay >= 1500
&& player.playerLevel[GameConstants.HITPOINTS] > 0) {
if (player.playerLevel[GameConstants.HITPOINTS] == player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS])) { // If
&& player.playerLevel[Constants.HITPOINTS] > 0) {
if (player.playerLevel[Constants.HITPOINTS] == player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS])) { // If
// full
// health,
// does
@@ -120,7 +120,7 @@ public class Kebabs {
player.getItemAssistant().deleteItem(Kebab, slot, 1);
player.getPacketSender().sendSound(317, 100, 0);
player.foodDelay = System.currentTimeMillis();
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
return;
}
player.getCombatAssistant().resetPlayerAttack();
@@ -131,7 +131,7 @@ public class Kebabs {
player.getItemAssistant().deleteItem(Kebab, slot, 1);
player.getPacketSender().sendSound(317, 100, 0);
player.foodDelay = System.currentTimeMillis();
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
}
}
@@ -1,8 +1,8 @@
package com.rs2.game.content.consumables;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -23,7 +23,7 @@ public class Potions {
"You may not drink potions in this duel.");
return;
}
if (c.isDead || c.playerLevel[GameConstants.HITPOINTS] <= 0) {
if (c.isDead || c.playerLevel[Constants.HITPOINTS] <= 0) {
return;
}
if (System.currentTimeMillis() - c.potDelay >= 1200) {
@@ -330,14 +330,14 @@ public class Potions {
// c.startAnimation(829);
c.playerItems[slot] = replaceItem + 1;
c.getItemAssistant().resetItems(3214);
c.playerLevel[GameConstants.PRAYER] += c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER]) * .33;
c.playerLevel[Constants.PRAYER] += c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER]) * .33;
if (rest) {
c.playerLevel[GameConstants.PRAYER] += 1;
c.playerLevel[Constants.PRAYER] += 1;
}
if (c.playerLevel[GameConstants.PRAYER] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER])) {
c.playerLevel[GameConstants.PRAYER] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER]);
if (c.playerLevel[Constants.PRAYER] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER])) {
c.playerLevel[Constants.PRAYER] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER]);
}
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
if (rest) {
restoreStats();
}
@@ -374,21 +374,21 @@ public class Potions {
c.getPacketSender().setSkillLevel(tD, c.playerLevel[tD],
c.playerXP[tD]);
}
c.playerLevel[GameConstants.ATTACK] += getBrewStat(0, .20);
if (c.playerLevel[GameConstants.ATTACK] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 1.2 + 1) {
c.playerLevel[GameConstants.ATTACK] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.ATTACK]) * 1.2);
c.playerLevel[Constants.ATTACK] += getBrewStat(0, .20);
if (c.playerLevel[Constants.ATTACK] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 1.2 + 1) {
c.playerLevel[Constants.ATTACK] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.ATTACK]) * 1.2);
}
c.playerLevel[GameConstants.STRENGTH] += getBrewStat(2, .12);
if (c.playerLevel[GameConstants.STRENGTH] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]) * 1.2 + 1) {
c.playerLevel[GameConstants.STRENGTH] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.STRENGTH]) * 1.2);
c.playerLevel[Constants.STRENGTH] += getBrewStat(2, .12);
if (c.playerLevel[Constants.STRENGTH] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]) * 1.2 + 1) {
c.playerLevel[Constants.STRENGTH] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.STRENGTH]) * 1.2);
}
c.playerLevel[GameConstants.PRAYER] += getBrewStat(5, .10);
if (c.playerLevel[GameConstants.PRAYER] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER]) * 1.2 + 1) {
c.playerLevel[GameConstants.PRAYER] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER]) * 1.2);
c.playerLevel[Constants.PRAYER] += getBrewStat(5, .10);
if (c.playerLevel[Constants.PRAYER] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER]) * 1.2 + 1) {
c.playerLevel[Constants.PRAYER] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER]) * 1.2);
}
c.getPlayerAssistant().refreshSkill(0);
c.getPlayerAssistant().refreshSkill(GameConstants.STRENGTH);
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
c.getPlayerAssistant().refreshSkill(Constants.STRENGTH);
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
c.hitUpdateRequired = true;
c.hitDiff = 9;
}
@@ -412,17 +412,17 @@ public class Potions {
c.getPacketSender().setSkillLevel(tD, c.playerLevel[tD],
c.playerXP[tD]);
}
c.playerLevel[GameConstants.DEFENCE] += getBrewStat(1, .20);
if (c.playerLevel[GameConstants.DEFENCE] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 1.2 + 1) {
c.playerLevel[GameConstants.DEFENCE] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.DEFENCE]) * 1.2);
c.playerLevel[Constants.DEFENCE] += getBrewStat(1, .20);
if (c.playerLevel[Constants.DEFENCE] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 1.2 + 1) {
c.playerLevel[Constants.DEFENCE] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.DEFENCE]) * 1.2);
}
c.getPlayerAssistant().refreshSkill(GameConstants.DEFENCE);
c.getPlayerAssistant().refreshSkill(Constants.DEFENCE);
c.playerLevel[GameConstants.HITPOINTS] += getBrewStat(3, .15);
if (c.playerLevel[GameConstants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) * 1.17 + 1) {
c.playerLevel[GameConstants.HITPOINTS] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) * 1.17);
c.playerLevel[Constants.HITPOINTS] += getBrewStat(3, .15);
if (c.playerLevel[Constants.HITPOINTS] > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) * 1.17 + 1) {
c.playerLevel[Constants.HITPOINTS] = (int) (c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) * 1.17);
}
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
public void enchanceStat(int skillID, boolean sup) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.guilds;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.quests.QuestAssistant;
import com.rs2.game.globalworldobjects.PassDoor;
import com.rs2.game.objects.impl.Climbing;
@@ -17,7 +17,7 @@ public class Guilds {
private static boolean hasCompletedLegends = false;
public static void attemptGuild(Player player, int objectId) {
if (!GameConstants.GUILDS) {
if (!Constants.GUILDS) {
player.getPacketSender().sendMessage("Guilds are currently disabled.");
return;
}
@@ -131,35 +131,35 @@ public class Guilds {
}
break;
case 2641: // Prayer Guild
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.PRAYER]) < 31) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.PRAYER]) < 31) {
player.getDialogueHandler().sendStatement("You need 31 prayer to enter this guild!");
player.nextChat = 0;
return false;
}
break;
case 2712: // Cooking Guild
if (player.playerLevel[GameConstants.COOKING] < 32 || player.playerEquipment[player.playerHat] != 1949) {
if (player.playerLevel[Constants.COOKING] < 32 || player.playerEquipment[player.playerHat] != 1949) {
player.getDialogueHandler().sendStatement("You need 32 cooking and a chefs hat to enter this guild!");
player.nextChat = 0;
return false;
}
break;
case 2647: // Crafting Guild
if (player.playerLevel[GameConstants.CRAFTING] < 40 || player.playerEquipment[player.playerChest] != 1757) {
if (player.playerLevel[Constants.CRAFTING] < 40 || player.playerEquipment[player.playerChest] != 1757) {
player.getDialogueHandler().sendStatement("You need 40 Crafting and a Brown Apron to enter this guild!");
player.nextChat = 0;
return false;
}
break;
case 2113: // Mining Guild
if (player.playerLevel[GameConstants.MINING] < 60) {
if (player.playerLevel[Constants.MINING] < 60) {
player.getDialogueHandler().sendStatement("You need 60 Mining to enter this guild!");
player.nextChat = 0;
return false;
}
break;
case 2025: // Fishing Guild
if (player.playerLevel[GameConstants.FISHING] < 68) {
if (player.playerLevel[Constants.FISHING] < 68) {
player.getDialogueHandler().sendStatement("You need 68 Fishing to enter this guild!");
player.nextChat = 0;
return false;
@@ -167,14 +167,14 @@ public class Guilds {
break;
case 1600:
case 1601: // Wizards Guild
if (player.playerLevel[GameConstants.MAGIC] < 66) {
if (player.playerLevel[Constants.MAGIC] < 66) {
player.getDialogueHandler().sendStatement("You need 66 Magic to enter this guild!");
player.nextChat = 0;
return false;
}
break;
case 2514:
if (player.playerLevel[GameConstants.RANGED] < 40) { // Ranging Guild
if (player.playerLevel[Constants.RANGED] < 40) { // Ranging Guild
player.getDialogueHandler().sendStatement("You need 40 Range to enter this guild!");
player.nextChat = 0;
return false;
@@ -2,15 +2,14 @@ package com.rs2.game.content.minigames;
import java.util.concurrent.CopyOnWriteArrayList;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.game.content.combat.prayer.PrayerDrain;
import com.rs2.game.content.minigames.castlewars.CastleWars;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.items.GameItem;
import com.rs2.game.items.ItemData;
import com.rs2.game.items.ItemConstants;
import com.rs2.game.items.impl.RareProtection;
import com.rs2.game.players.Client;
@@ -154,8 +153,8 @@ public class Dueling {
} else {
player.getOutStream().writeByte(item.amount);
}
if (item.id > GameConstants.ITEM_LIMIT || item.id < 0) {
item.id = GameConstants.ITEM_LIMIT;
if (item.id > Constants.ITEM_LIMIT || item.id < 0) {
item.id = Constants.ITEM_LIMIT;
}
player.getOutStream().writeWordBigEndianA(item.id + 1);
@@ -183,8 +182,8 @@ public class Dueling {
} else {
player.getOutStream().writeByte(item.amount);
}
if (item.id > GameConstants.ITEM_LIMIT || item.id < 0) {
item.id = GameConstants.ITEM_LIMIT;
if (item.id > Constants.ITEM_LIMIT || item.id < 0) {
item.id = Constants.ITEM_LIMIT;
}
player.getOutStream().writeWordBigEndianA(item.id + 1);
current++;
@@ -579,7 +578,7 @@ public class Dueling {
Client opponent = (Client) PlayerHandler.players[player.duelingWith];
opponent.getDueling().duelVictory();
player.getDueling().resetDuel();
player.getPlayerAssistant().movePlayer(GameConstants.DUELING_RESPAWN_X + Misc.random(5), GameConstants.DUELING_RESPAWN_Y + Misc.random(5), 0);
player.getPlayerAssistant().movePlayer(Constants.DUELING_RESPAWN_X + Misc.random(5), Constants.DUELING_RESPAWN_Y + Misc.random(5), 0);
player.getPacketSender().sendMessage("You have lost the duel!");
}
@@ -607,14 +606,14 @@ public class Dueling {
player.headIconPk = -1;
player.getPlayerAssistant().requestUpdates();
}
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
duelRewardInterface();
player.getPacketSender().showInterface(6733);
player.getPacketSender().sendMessage("You have won the duel!");
if (player.getPlayerAssistant().isPlayer()) {
GameLogger.writeLog(player.playerName, "duelingkiller", player.playerName + " killed " + opponent.playerName + " in the duel arena.");
}
player.getPlayerAssistant().movePlayer(GameConstants.DUELING_RESPAWN_X + Misc.random(5), GameConstants.DUELING_RESPAWN_Y + Misc.random(5), 0);
player.getPlayerAssistant().movePlayer(Constants.DUELING_RESPAWN_X + Misc.random(5), Constants.DUELING_RESPAWN_Y + Misc.random(5), 0);
player.getPlayerAssistant().requestUpdates();
player.getPacketSender().showOption(3, 0, "Challenge", 3);
player.getPacketSender().createPlayerHints(10, -1);
@@ -640,8 +639,8 @@ public class Dueling {
} else {
player.getOutStream().writeByte(item.amount);
}
if (item.id > GameConstants.ITEM_LIMIT || item.id < 0) {
item.id = GameConstants.ITEM_LIMIT;
if (item.id > Constants.ITEM_LIMIT || item.id < 0) {
item.id = Constants.ITEM_LIMIT;
}
player.getOutStream().writeWordBigEndianA(item.id + 1);
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.minigames;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -185,9 +185,9 @@ public class FightCaves {
public static void tzKihEffect(Client player, int i, int damage) {
if (NpcHandler.npcs[i].npcType == TZ_KIH) {
if (player != null) {
if (player.playerLevel[GameConstants.PRAYER] > 0) {
player.playerLevel[GameConstants.PRAYER] -= 1 + damage;
player.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
if (player.playerLevel[Constants.PRAYER] > 0) {
player.playerLevel[Constants.PRAYER] -= 1 + damage;
player.getPlayerAssistant().refreshSkill(Constants.PRAYER);
}
}
}
@@ -3,7 +3,7 @@ package com.rs2.game.content.minigames.castlewars;
import java.util.HashMap;
import java.util.Iterator;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -109,7 +109,7 @@ public class CastleWars {
&& teamPlayer.absX < COLLAPSE_ROCKS[cave][1]
&& teamPlayer.absY > COLLAPSE_ROCKS[cave][2]
&& teamPlayer.absY < COLLAPSE_ROCKS[cave][3]) {
int dmg = teamPlayer.playerLevel[GameConstants.HITPOINTS];
int dmg = teamPlayer.playerLevel[Constants.HITPOINTS];
teamPlayer.handleHitMask(dmg);
teamPlayer.dealDamage(99);// 99 damage?
}
@@ -2,7 +2,7 @@ package com.rs2.game.content.minigames.magetrainingarena;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.magic.MagicData;
import com.rs2.game.content.combat.magic.MagicRequirements;
import com.rs2.game.content.music.sound.SoundList;
@@ -93,7 +93,7 @@ public class Alchemy {
player.getItemAssistant().deleteItem(995, coins);
player.alchemyPoints += points;
player.getItemAssistant().addItemToBank(995, toBank);
player.getPlayerAssistant().addSkillXP(bonusExp, GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(bonusExp, Constants.MAGIC);
warned = false;
}
@@ -2,7 +2,7 @@ package com.rs2.game.content.minigames.magetrainingarena;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.magic.CastRequirements;
import com.rs2.game.content.combat.magic.Enchanting.EnchantSpell;
import com.rs2.game.items.DeprecatedItems;
@@ -24,7 +24,7 @@ public class Enchanting {
public void enchantItem(int itemID, int spellID) {
EnchantSpell spell = EnchantSpell.forId(spellID);
if (player.playerLevel[GameConstants.MAGIC] < spell.getLevelReq()) {
if (player.playerLevel[Constants.MAGIC] < spell.getLevelReq()) {
player.getPacketSender().sendMessage("You need a magic level of at least " + spell.getLevelReq() + " to cast this spell.");
return;
}
@@ -54,7 +54,7 @@ public class Enchanting {
player.enchantmentPoints += points;
player.getItemAssistant().replaceItem(itemID, 6902);
player.getPlayerAssistant().addSkillXP(spell.getXp() * 0.75, GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(spell.getXp() * 0.75, Constants.MAGIC);
CastRequirements.deleteRunes(player, player.getEnchanting().getRequiredRunes(spell));
player.startAnimation(spell.getAnim());
player.gfx100(spell.getGFX());
@@ -2,11 +2,9 @@ package com.rs2.game.content.minigames.magetrainingarena;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.magic.MagicData;
import com.rs2.game.content.combat.magic.MagicRequirements;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Player;
import com.rs2.game.players.PlayerHandler;
import com.rs2.world.Boundary;
@@ -38,8 +36,8 @@ public class Graveyard {
player.boneDelay = System.currentTimeMillis();
player.startAnimation(MagicData.MAGIC_SPELLS[spellID][2]);
player.gfx100(MagicData.MAGIC_SPELLS[spellID][3]);
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[spellID][7], GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[spellID][7], Constants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
player.getPacketSender().sendShowTab(6);
player.getPacketSender().sendSound(SoundList.BONES_TO_BANNAS, 100, 0);
int amount = 0;
@@ -3,7 +3,7 @@ package com.rs2.game.content.minigames.magetrainingarena;
import java.awt.Point;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -133,8 +133,8 @@ public class Telekinetic {
player.gfx100(MagicData.MAGIC_SPELLS[51][3]);
player.getPlayerAssistant().createPlayersStillGfx(144, itemX, itemY, 0, 72);
player.getPlayerAssistant().createPlayersProjectile(player.getX(), player.getY(), offX, offY, 50, 70, MagicData.MAGIC_SPELLS[51][4], 50, 10, 0, 50);
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[51][7], GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(MagicData.MAGIC_SPELLS[51][7], Constants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
player.stopMovement();
Maze maze = Maze.getMaze(itemX, itemY, player.heightLevel);
@@ -162,8 +162,8 @@ public class Telekinetic {
if (player.telekineticMazesSolved % 5 == 0) {
player.telekineticPoints += 8;
player.getItemAssistant().addOrDropItem(563, 10);
player.getPlayerAssistant().addSkillXP(1000, GameConstants.MAGIC);
player.getPlayerAssistant().refreshSkill(GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(1000, Constants.MAGIC);
player.getPlayerAssistant().refreshSkill(Constants.MAGIC);
}
resetStatue(newPosition.x, newPosition.y);
@@ -3,7 +3,7 @@ package com.rs2.game.content.minigames.trawler;
import java.util.ArrayList;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -485,7 +485,7 @@ public class Trawler extends GroupMinigame {
return;
}
p.startAnimation(net_interaction);
if (skillCheck(p.playerLevel[GameConstants.CRAFTING], 1, 0)) {
if (skillCheck(p.playerLevel[Constants.CRAFTING], 1, 0)) {
p.getItemAssistant().deleteItem(rope, 1);
net_ripped = false;
playerUpdates();
@@ -662,24 +662,24 @@ public class Trawler extends GroupMinigame {
public int chanceByLevel(Player p, int fish) {
switch (fish) {
case 381:
if (p.playerLevel[GameConstants.FISHING] >= 81
&& p.playerLevel[GameConstants.FISHING] < 90) {
if (p.playerLevel[Constants.FISHING] >= 81
&& p.playerLevel[Constants.FISHING] < 90) {
return 5;
} else if (p.playerLevel[GameConstants.FISHING] >= 90
&& p.playerLevel[GameConstants.FISHING] < 99) {
} else if (p.playerLevel[Constants.FISHING] >= 90
&& p.playerLevel[Constants.FISHING] < 99) {
return 9;
} else if (p.playerLevel[GameConstants.FISHING] == 99) {
} else if (p.playerLevel[Constants.FISHING] == 99) {
return 13;
}
return 0;
case 395:
if (p.playerLevel[GameConstants.FISHING] >= 79
&& p.playerLevel[GameConstants.FISHING] < 85) {
if (p.playerLevel[Constants.FISHING] >= 79
&& p.playerLevel[Constants.FISHING] < 85) {
return 8;
} else if (p.playerLevel[GameConstants.FISHING] >= 85
&& p.playerLevel[GameConstants.FISHING] < 95) {
} else if (p.playerLevel[Constants.FISHING] >= 85
&& p.playerLevel[Constants.FISHING] < 95) {
return 13;
} else if (p.playerLevel[GameConstants.FISHING] >= 95) {
} else if (p.playerLevel[Constants.FISHING] >= 95) {
return 17;
}
return 0;
@@ -782,31 +782,31 @@ public class Trawler extends GroupMinigame {
int xpToAdd = 0;
if (manta > 0) {
toReturn.add(new GameItem(389, manta));
if (p.playerLevel[GameConstants.FISHING] >= 81) {
if (p.playerLevel[Constants.FISHING] >= 81) {
xpToAdd += (manta * 46);
}
}
if (turt > 0) {
toReturn.add(new GameItem(395, turt));
if (p.playerLevel[GameConstants.FISHING] >= 79) {
if (p.playerLevel[Constants.FISHING] >= 79) {
xpToAdd += (manta * 38);
}
}
if (lobs > 0) {
toReturn.add(new GameItem(377, lobs));
if (p.playerLevel[GameConstants.FISHING] >= 40) {
if (p.playerLevel[Constants.FISHING] >= 40) {
xpToAdd += (manta * 90);
}
}
if (swordFish > 0) {
toReturn.add(new GameItem(371, swordFish));
if (p.playerLevel[GameConstants.FISHING] >= 50) {
if (p.playerLevel[Constants.FISHING] >= 50) {
xpToAdd += (manta * 100);
}
}
if (junk > 0)
toReturn.add(new GameItem(685, junk));
p.getPlayerAssistant().addSkillXP(xpToAdd, GameConstants.FISHING);
p.getPlayerAssistant().addSkillXP(xpToAdd, Constants.FISHING);
return toReturn;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.quests;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
/**
@@ -34,7 +34,7 @@ public class QuestRewards {
questReward(player, "Knight's Sword Quest", "1 Quest Point", "12,725 Smithing XP", "", "", "", "", 0);
QUEST_NAME = "The Knight's Sword";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7346);
player.getPlayerAssistant().addSkillXP(12725, GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(12725, Constants.SMITHING);
player.questPoints ++;
player.knightS = 9;
}
@@ -46,7 +46,7 @@ public class QuestRewards {
player.getItemAssistant().addOrDropItem(1897, 1);
player.getItemAssistant().addOrDropItem(2003, 1);
player.getItemAssistant().addOrDropItem(1560, 1);
player.getPlayerAssistant().addSkillXP(1525, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(1525, Constants.COOKING);
player.questPoints++;
player.gertCat = 7;
}
@@ -64,7 +64,7 @@ public class QuestRewards {
questReward(client, "Witch's Potion", "1 Quest Point", "325 Magic XP", "", "", "", "", 325);
QUEST_NAME = "Witch's Potion";
client.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7348);
client.getPlayerAssistant().addSkillXP(325, GameConstants.MAGIC);
client.getPlayerAssistant().addSkillXP(325, Constants.MAGIC);
client.questPoints++;
client.witchspot = 3;
}
@@ -81,7 +81,7 @@ public class QuestRewards {
questReward(client, "Restless Ghost", "1 Quest Point", "125 Prayer XP", "", "", "", "", 0);
QUEST_NAME = "Restless Ghost";
client.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7337);
client.getPlayerAssistant().addSkillXP(125, GameConstants.PRAYER);
client.getPlayerAssistant().addSkillXP(125, Constants.PRAYER);
client.questPoints++;
client.restGhost = 5;
}
@@ -90,7 +90,7 @@ public class QuestRewards {
questReward(player, "Vampyre Slayer", "3 Quest Points", "4,825 Attack XP", "", "", "", "", 0);
QUEST_NAME = "Vampyre Slayer";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7347);
player.getPlayerAssistant().addSkillXP(4825, GameConstants.ATTACK);
player.getPlayerAssistant().addSkillXP(4825, Constants.ATTACK);
player.questPoints += 3;
player.vampSlayer = 5;
}
@@ -109,7 +109,7 @@ public class QuestRewards {
QUEST_NAME = "Sheep Shearer";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7344);
player.getItemAssistant().addOrDropItem(995, 60);
player.getPlayerAssistant().addSkillXP(150, GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(150, Constants.CRAFTING);
player.questPoints++;
player.sheepShear = 2;
}
@@ -119,7 +119,7 @@ public class QuestRewards {
QUEST_NAME = "Doric's Quest";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7336);
player.getItemAssistant().addOrDropItem(995, 180);
player.getPlayerAssistant().addSkillXP(1300, GameConstants.MINING);
player.getPlayerAssistant().addSkillXP(1300, Constants.MINING);
player.questPoints++;
player.doricQuest = 3;
}
@@ -129,7 +129,7 @@ public class QuestRewards {
QUEST_NAME = "Imp Catcher";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7340);
player.getItemAssistant().addOrDropItem(1478, 1);
player.getPlayerAssistant().addSkillXP(875, GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(875, Constants.MAGIC);
player.questPoints++;
player.impsC = 2;
}
@@ -139,7 +139,7 @@ public class QuestRewards {
QUEST_NAME = "Cook's Assistant";
player.getPacketSender().sendString("@gre@" + QUEST_NAME + "", 7333);
player.getItemAssistant().addOrDropItem(995, 500);
player.getPlayerAssistant().addSkillXP(300, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(300, Constants.COOKING);
player.questPoints++;
player.cookAss = 3;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.PlayerHandler;
/**
@@ -23,7 +23,7 @@ public enum HolidayDrops {
// amount
public static int dropAmount() {
int amount = DROP_AMOUNT;
if (GameConstants.SERVER_DEBUG) {
if (Constants.SERVER_DEBUG) {
return amount * 60;
}
return amount;
@@ -1,15 +1,13 @@
package com.rs2.game.content.random;
import java.awt.Point;
import java.util.ArrayList;
import java.util.Random;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.game.items.ItemConstants;
import com.rs2.game.objects.Objects;
import com.rs2.game.players.Player;
import com.rs2.game.players.PlayerHandler;
import com.rs2.world.Boundary;
@@ -121,7 +119,7 @@ public class PartyRoom {
}
public static void open(Player player) {
if (!GameConstants.PARTY_ROOM_DISABLED) {
if (!Constants.PARTY_ROOM_DISABLED) {
updateGlobal(player);
updateDeposit(player);
player.getItemAssistant().resetItems(5064); // Player inventory
@@ -1,6 +1,6 @@
package com.rs2.game.content.randomevents;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -18,7 +18,7 @@ public class RiverTroll {
for (int[] element : riverTroll) {
if (hasRiverTroll == false) {
if (client.combatLevel >= element[0] && client.combatLevel <= element[1] && hasRiverTroll == false) {
NpcHandler.spawnNpc(client, element[2], client.absX + Misc.random(1), client.absY + Misc.random(1), client.heightLevel, 0, element[3], element[4], client.playerLevel[GameConstants.ATTACK] * 2, client.playerLevel[GameConstants.DEFENCE] * 2, true, false);
NpcHandler.spawnNpc(client, element[2], client.absX + Misc.random(1), client.absY + Misc.random(1), client.heightLevel, 0, element[3], element[4], client.playerLevel[Constants.ATTACK] * 2, client.playerLevel[Constants.DEFENCE] * 2, true, false);
client.randomActions = 0;
hasRiverTroll = true;
NpcHandler.npcs[element[2]].forceChat("Fishies be mine! Leave dem fishies!");
@@ -1,6 +1,6 @@
package com.rs2.game.content.randomevents;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Client;
import com.rs2.game.players.Player;
@@ -15,9 +15,9 @@ public class Swarm {
private static int checkStats(Player c, boolean bot) {
if (bot) {
return c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) * 3;
return c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) * 3;
} else {
return c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]) * 2;
return c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]) * 2;
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.randomevents;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -14,7 +14,7 @@ public class TreeSpirit {
{ 91, 110, 442, 130, 5 }, { 111, 138, 443, 160, 7 }, };
private static int checkStats(Player p) {
return p.getPlayerAssistant().getLevelForXP(p.playerXP[GameConstants.HITPOINTS]) * 2;
return p.getPlayerAssistant().getLevelForXP(p.playerXP[Constants.HITPOINTS]) * 2;
}
public static void spawnTreeSpirit(Player p) {
@@ -23,7 +23,7 @@ public class TreeSpirit {
if (p.combatLevel >= element[0] && p.combatLevel <= element[1]) {
NpcHandler.spawnNpc(p, element[2], p.absX + Misc.random(1),
p.absY + Misc.random(1), p.heightLevel, 0, element[3],
element[4], checkStats(p), p.playerLevel[GameConstants.DEFENCE] * 2, true,
element[4], checkStats(p), p.playerLevel[Constants.DEFENCE] * 2, true,
false);
NpcHandler.npcs[element[2]]
.forceChat("Leave these woods and never return!");
@@ -2,7 +2,7 @@ package com.rs2.game.content.skills;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.skills.cooking.Cooking;
import com.rs2.game.content.skills.core.Fishing;
@@ -40,13 +40,13 @@ public class SkillHandler {
public static boolean isSkilling(Player player) {
if (player.playerSkilling[GameConstants.FISHING] || player.playerStun || player.playerSkilling[GameConstants.CRAFTING]
if (player.playerSkilling[Constants.FISHING] || player.playerStun || player.playerSkilling[Constants.CRAFTING]
|| player.playerIsFletching || player.isFletching || player.playerIsCooking
|| player.isMining || player.isWoodcutting || player.isSmithing
|| player.isSmelting || player.isSpinning || player.isPotionMaking
|| player.isPotCrafting || player.isFiremaking
|| player.playerSkilling[GameConstants.HERBLORE]
|| player.playerSkilling[GameConstants.SMITHING]) {
|| player.playerSkilling[Constants.HERBLORE]
|| player.playerSkilling[Constants.SMITHING]) {
return true;
}
return false;
@@ -64,7 +64,7 @@ public class SkillHandler {
player.isSmithing = false;
} else if (isSkilling[12]) {// crafting
isSkilling[12] = false;
} else if (player.isSmelting || player.playerSkilling[GameConstants.SMITHING]) {// smelting
} else if (player.isSmelting || player.playerSkilling[Constants.SMITHING]) {// smelting
Smelting.resetSmelting(player);
} else if (player.isCrafting) {
player.isCrafting = false;
@@ -83,7 +83,7 @@ public class SkillHandler {
public static void resetSkills(Player player) {// call when walking, dropping,
// picking up, leveling up
if (player.playerSkilling[GameConstants.FISHING]) {// fishing
if (player.playerSkilling[Constants.FISHING]) {// fishing
Fishing.resetFishing(player);
} else if (player.isMining) {// mining
Mining.resetMining(player);
@@ -95,7 +95,7 @@ public class SkillHandler {
player.isSmithing = false;
} else if (isSkilling[12]) {// crafting
isSkilling[12] = false;
} else if (player.isSmelting || player.playerSkilling[GameConstants.SMITHING]) {// smelting
} else if (player.isSmelting || player.playerSkilling[Constants.SMITHING]) {// smelting
Smelting.resetSmelting(player);
} else if (player.isCrafting) {
player.isCrafting = false;
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -79,7 +79,7 @@ public class Agility {
if (player.stopPlayerPacket) {
return;
}
if (player.playerLevel[GameConstants.AGILITY] < 12) {
if (player.playerLevel[Constants.AGILITY] < 12) {
player.getDialogueHandler().sendStatement("You need 12 agility to use these stepping stones");
player.nextChat = 0;
return;
@@ -97,7 +97,7 @@ public class Agility {
@Override
public void stop() {
// c.getPlayerAssistant().addSkillXP(100, GameConstants.AGILITY);
// c.getPlayerAssistant().addSkillXP(100, Constants.AGILITY);
}
}, 1);
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@@ -122,7 +122,7 @@ public class Agility {
@Override
public void stop() {
// c.getPlayerAssistant().addSkillXP(300, GameConstants.AGILITY);
// c.getPlayerAssistant().addSkillXP(300, Constants.AGILITY);
setAnimationBack(player);
player.stopPlayerPacket = false;
}
@@ -500,7 +500,7 @@ public class Agility {
public void lapFinished() {
if (agilityProgress[5]) {
c.getPlayerAssistant().addSkillXP(lapBonus, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(lapBonus, Constants.AGILITY);
c.getPacketSender().sendMessage("You received some bonus experience for completing the track!");
resetAgilityProgress();
}
@@ -550,7 +550,7 @@ public class Agility {
moveY = 2851;
moveH = 1;
walk(1, 0, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -559,7 +559,7 @@ public class Agility {
moveY = 2832;
moveH = 1;
walk(-1, 0, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -568,7 +568,7 @@ public class Agility {
moveY = 2832;
moveH = 1;
walk(-1, 0, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -577,7 +577,7 @@ public class Agility {
moveY = 2841;
moveH = 2;
walk(0, 1, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -586,7 +586,7 @@ public class Agility {
moveY = 2849;
moveH = 2;
walk(0, 1, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -595,7 +595,7 @@ public class Agility {
moveY = 2849;
moveH = 2;
walk(1, 0, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -604,7 +604,7 @@ public class Agility {
moveY = 2836;
moveH = 2;
walk(0, -1, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -613,7 +613,7 @@ public class Agility {
moveY = 2834;
moveH = 2;
walk(-1, 0, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -622,7 +622,7 @@ public class Agility {
moveY = 2847;
moveH = 3;
walk(0, 1, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
agilityTimer = 2;
}
@@ -631,7 +631,7 @@ public class Agility {
moveY = 2840;
moveH = 3;
walk(0, -1, 2753, -1);
c.getPlayerAssistant().addSkillXP(14, GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(14, Constants.AGILITY);
}
if (agilityTimer > 0) {
@@ -650,7 +650,7 @@ public class Agility {
}
public boolean checkLevel(int objectId) {
if (getLevelRequired(objectId) > c.playerLevel[GameConstants.AGILITY]) {
if (getLevelRequired(objectId) > c.playerLevel[Constants.AGILITY]) {
c.getPacketSender().sendMessage(
"You need atleast " + getLevelRequired(objectId)
+ " agility to do this.");
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
/**
@@ -13,7 +13,7 @@ public class AgilityShortcut {
private static final int WALK = 1, MOVE = 2, AGILITY = 3, DOWN = 4, UP = 5;
private static void handleAgility(Player player, int x, int y, int levelReq, int anim, int walk, String message) {
if (player.playerLevel[GameConstants.AGILITY] < levelReq) {
if (player.playerLevel[Constants.AGILITY] < levelReq) {
player.getPacketSender().sendMessage("You need " + levelReq + " agility to use this shortcut.");
return;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -38,7 +38,7 @@ public class ApeAtollAgility {
c.getAgility().walk(-2, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
}
@@ -58,7 +58,7 @@ public class ApeAtollAgility {
"You managed to climb up the Tree.");
c.getAgility().climbUpTropicalTree(c.getX(), c.getY(), 2);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[0]) {
c.getAgility().agilityProgress[1] = true;
}
@@ -81,7 +81,7 @@ public class ApeAtollAgility {
c.getAgility().walk(-5, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -101,7 +101,7 @@ public class ApeAtollAgility {
c.getAgility().walk(-5, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getPacketSender().sendMessage("You climb your way up");
if (c.getAgility().agilityProgress[2]) {
c.getAgility().agilityProgress[3] = true;
@@ -122,7 +122,7 @@ public class ApeAtollAgility {
c.getAgility().walk(1, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[3]) {
c.getAgility().agilityProgress[4] = true;
}
@@ -161,7 +161,7 @@ public class ApeAtollAgility {
c.getAgility().tropicalTreeUpdate = 2;
c.getAgility().moveHeight = 0;
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId),
GameConstants.AGILITY);
Constants.AGILITY);
if (c.getAgility().agilityProgress[4]) {
c.getAgility().agilityProgress[5] = true;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -29,7 +29,7 @@ public class BarbarianAgility {
c.getAgility().walk(0, -1,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@@ -56,7 +56,7 @@ public class BarbarianAgility {
}
if (c.getAgility().hotSpot(2551, 3546)) {
c.getAgility().walk(-10, 0, c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[0]) {
c.getAgility().agilityProgress[1] = true;
}
@@ -72,7 +72,7 @@ public class BarbarianAgility {
if (c.absX == 2539 && c.absY > 3544 && c.absY < 3547) {
c.getAgility().climbUp(c.getX() - 1, c.getY(), 1);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId),
GameConstants.AGILITY);
Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -90,7 +90,7 @@ public class BarbarianAgility {
c.getAgility().walk(-4, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[2]) {
c.getAgility().agilityProgress[3] = true;
}
@@ -100,7 +100,7 @@ public class BarbarianAgility {
return true;
case BARBARIAN_LADDER_OBJECT:
if (c.playerLevel[GameConstants.AGILITY] < 35 && c.objectX != 2776
if (c.playerLevel[Constants.AGILITY] < 35 && c.objectX != 2776
&& c.objectY != 3121) {
c.getPacketSender().sendMessage(
"You need 35 agility to use this ladder.");
@@ -123,7 +123,7 @@ public class BarbarianAgility {
c.getAgility().walk(2, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[4]) {
c.getAgility().agilityProgress[5] = true;
}
@@ -137,7 +137,7 @@ public class BarbarianAgility {
c.getAgility().walk(3, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
} else if (c.absX == 2542 && c.absY == 3553) {
c.getAgility().walk(1, 0,
c.getAgility().getAnimation(objectId), -1);
@@ -146,7 +146,7 @@ public class BarbarianAgility {
c.getAgility().walk(2, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
return true;
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class GnomeAgility {
@@ -27,14 +27,14 @@ public class GnomeAgility {
} else if (c.absX == 2474 && c.absY > 3429 && c.absY < 3436) {
c.getPlayerAssistant().movePlayer(2474, 3429, 0);
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
return true;
case NET1_OBJECT:
c.getAgility().climbUp(c.getX(), c.getY() - 2, 1);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[0]) {
c.getAgility().agilityProgress[1] = true;
}
@@ -42,7 +42,7 @@ public class GnomeAgility {
case TREE_OBJECT:
c.getAgility().climbUp(c.getX(), c.getY() - 3, 2);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -58,7 +58,7 @@ public class GnomeAgility {
// cheat
c.getPlayerAssistant().movePlayer(2483, 3420, 2);
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[2]) {
c.getAgility().agilityProgress[3] = true;
}
@@ -66,7 +66,7 @@ public class GnomeAgility {
case TREE_BRANCH_OBJECT:
c.getAgility().climbDown(c.getX(), c.getY(), 0);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[3]) {
c.getAgility().agilityProgress[4] = true;
}
@@ -78,7 +78,7 @@ public class GnomeAgility {
}
if (c.getY() == 3425 && System.currentTimeMillis() - clickTimer > 1800) {
c.getAgility().climbUp(c.getX(), c.getY() + 2, 0);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
clickTimer = System.currentTimeMillis();
if (c.getAgility().agilityProgress[4]) {
c.getAgility().agilityProgress[5] = true;
@@ -90,12 +90,12 @@ public class GnomeAgility {
if (c.getAgility().hotSpot(2484, 3430)) {
c.getAgility().walk(0, 7, c.getAgility().getAnimation(objectId), 748);
if (c.getAgility().agilityProgress[5]) {
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().lapBonus = 1400 / 30;
c.getAgility().lapFinished();
} else {
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
c.getAgility().resetAgilityProgress();
} else if (c.absY > 3430 && c.absY < 3436 && System.currentTimeMillis() - clickTimer > 1800) {
@@ -108,12 +108,12 @@ public class GnomeAgility {
c.getAgility().walk(0, 7, c.getAgility().getAnimation(objectId), 748);
if (c.getAgility().agilityProgress[5]) {
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().lapBonus = 1400 / 30;
c.getAgility().lapFinished();
} else {
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
c.getAgility().resetAgilityProgress();
} else if (c.absY > 3430 && c.absY < 3436) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -45,7 +45,7 @@ public class PyramidAgility {
} else {
c.getAgility().climbUp(c.getX() + 3, c.getY() - 6, 0);
c.getAgility().agilityProgress[5] = true;
c.getAgility().lapBonus = 30 + c.playerLevel[GameConstants.AGILITY] * 8;
c.getAgility().lapBonus = 30 + c.playerLevel[Constants.AGILITY] * 8;
c.getAgility().lapFinished();
c.getPacketSender()
.sendMessage(
@@ -91,7 +91,7 @@ public class PyramidAgility {
c.getAgility().walk(0, 5,
c.getAgility().getAnimation(objectId), -1);
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
return true;
case PyramidAgility.PYRAMID_WALL_OBJECT:
@@ -103,21 +103,21 @@ public class PyramidAgility {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
if (c.getAgility().hotSpot(3371, 2834)
|| c.getAgility().hotSpot(3371, 2833)) {
c.getAgility().walk(-2, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
if (c.getAgility().hotSpot(3359, 2838)
|| c.getAgility().hotSpot(3358, 2838)) {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
return true;
@@ -132,7 +132,7 @@ public class PyramidAgility {
c.getAgility().walk(1, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -152,7 +152,7 @@ public class PyramidAgility {
if (c.getAgility().hotSpot(3372, 2832) || c.getAgility().hotSpot(3372, 2831)) {
c.getAgility().walk(-1, 0,
c.getAgility().getAnimation(1603), -1);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
@@ -174,7 +174,7 @@ public class PyramidAgility {
c.getAgility().walk(-1, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -195,7 +195,7 @@ public class PyramidAgility {
c.getAgility().walk(0, 5,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -216,7 +216,7 @@ public class PyramidAgility {
c.getAgility().walk(0, 3,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -238,7 +238,7 @@ public class PyramidAgility {
c.getAgility().walk(5, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -259,7 +259,7 @@ public class PyramidAgility {
c.getAgility().walk(0, 0,
c.getAgility().getAnimation(10859), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -280,7 +280,7 @@ public class PyramidAgility {
c.getAgility().walk(0, 1,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -301,7 +301,7 @@ public class PyramidAgility {
c.getAgility().walk(0, -1,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -322,7 +322,7 @@ public class PyramidAgility {
c.getAgility().walk(0, -1,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -349,13 +349,13 @@ public class PyramidAgility {
c.getAgility().walk(0, -6,
c.getAgility().getAnimation(2295), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
if (c.getAgility().hotSpot(3370, 2835) || c.getAgility().hotSpot(3371, 2835)) {
c.getAgility().walk(-6, 0,
c.getAgility().getAnimation(2295), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
}
return true;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -31,42 +31,42 @@ public class WerewolfAgility {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
} else if (c.getAgility().hotSpot(3538, 9875)) {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
} else if (c.getAgility().hotSpot(3538, 9876)) {
c.getAgility().walk(1, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
} else if (c.getAgility().hotSpot(3538, 9877)) {
c.getAgility().walk(2, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
} else if (c.getAgility().hotSpot(3540, 9877)) {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
} else if (c.getAgility().hotSpot(3540, 9879)) {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
}
@@ -82,7 +82,7 @@ public class WerewolfAgility {
c.getAgility().walk(0, 2,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[0]) {
c.getAgility().agilityProgress[1] = true;
}
@@ -113,7 +113,7 @@ public class WerewolfAgility {
c.getAgility().walk(0, 6,
c.getAgility().getAnimation(objectId), 748);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -121,7 +121,7 @@ public class WerewolfAgility {
c.getAgility().walk(0, 6,
c.getAgility().getAnimation(objectId), 748);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -129,7 +129,7 @@ public class WerewolfAgility {
c.getAgility().walk(0, 6,
c.getAgility().getAnimation(objectId), 748);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[1]) {
c.getAgility().agilityProgress[2] = true;
}
@@ -144,7 +144,7 @@ public class WerewolfAgility {
c.getAgility().walk(-3, 0,
c.getAgility().getAnimation(objectId), -1);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[2]) {
c.getAgility().agilityProgress[3] = true;
}
@@ -159,7 +159,7 @@ public class WerewolfAgility {
c.getAgility().getAnimation(
WerewolfAgility.WEREWOLF_SLING_OBJECT), 743);
c.getPlayerAssistant().addSkillXP(
c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getAgility().getXp(objectId), Constants.AGILITY);
if (c.getAgility().agilityProgress[3]) {
c.getAgility().agilityProgress[4] = true;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.agility;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -36,7 +36,7 @@ public class WildernessAgility {
} else if ((c.absX >= 3003 && c.absX <= 3005) && (c.absY > 3937 && c.absY < 3950)) {
c.getPlayerAssistant().movePlayer(3004, 3950, 0);
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().resetAgilityProgress();
c.getAgility().agilityProgress[0] = true;
return true;
@@ -50,7 +50,7 @@ public class WildernessAgility {
if (c.getAgility().agilityProgress[0]) {
c.getAgility().agilityProgress[1] = true;
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -79,7 +79,7 @@ public class WildernessAgility {
} else if (c.absX > 2996 && c.absX < 3002 && c.absY == 3960) {
c.getPlayerAssistant().movePlayer(2996, 3960, 0);
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().steppingStone = 6;
c.getAgility().steppingStoneTimer = 2;
c.getAgility().steppingStone--;
@@ -106,7 +106,7 @@ public class WildernessAgility {
if (c.getAgility().agilityProgress[3]) {
c.getAgility().agilityProgress[5] = true;
}
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
} else if (c.absX > 2994 && c.absX < 3002 && c.absY == 3945) {
c.getPlayerAssistant().movePlayer(2994, 3945, 0);
}
@@ -118,11 +118,11 @@ public class WildernessAgility {
}
c.getAgility().walk(0, -4, c.getAgility().getAnimation(objectId), -1);
if (c.getAgility().agilityProgress[5]) {
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
c.getAgility().lapBonus = 2400 / 30;
c.getAgility().lapFinished();
} else {
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), GameConstants.AGILITY);
c.getPlayerAssistant().addSkillXP(c.getAgility().getXp(objectId), Constants.AGILITY);
}
return true;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.cooking;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -128,7 +128,7 @@ public class Cooking extends SkillHandler {
}
public static void cookingAddon(Player c, int itemID1, int itemID2, int giveItem, int requiredLevel, int expGained) {
if (c.playerLevel[GameConstants.COOKING] >= requiredLevel) {
if (c.playerLevel[Constants.COOKING] >= requiredLevel) {
if (c.getItemAssistant().playerHasItem(itemID1) && c.getItemAssistant().playerHasItem(itemID2)) {
c.getItemAssistant().deleteItem(itemID1, 1);
c.getItemAssistant().deleteItem(itemID2, 1);
@@ -155,7 +155,7 @@ public class Cooking extends SkillHandler {
public static boolean startCooking(Player c, int itemId, int objectId) {
CookingItems item = forId(itemId);
if (item != null) {
if (c.playerLevel[GameConstants.COOKING] < item.getLevelReq()) {
if (c.playerLevel[Constants.COOKING] < item.getLevelReq()) {
c.getPacketSender().closeAllWindows();
c.getDialogueHandler().sendStatement("You need a Cooking level of " + item.getLevelReq() + " to cook this.");
c.nextChat = 0;
@@ -179,11 +179,11 @@ public class Cooking extends SkillHandler {
}
private static boolean getSuccess(Player c, int burnBonus, int levelReq, int stopBurn) {
if (c.playerLevel[GameConstants.COOKING] >= stopBurn) {
if (c.playerLevel[Constants.COOKING] >= stopBurn) {
return true;
}
double burn_chance = 55.0 - burnBonus;
double cook_level = c.playerLevel[GameConstants.COOKING];
double cook_level = c.playerLevel[Constants.COOKING];
double lev_needed = levelReq;
double burn_stop = stopBurn;
double multi_a = burn_stop - lev_needed;
@@ -232,10 +232,10 @@ public class Cooking extends SkillHandler {
player.getItemAssistant().getItemSlot(itemId), 1);
if (!burn) {
player.getPacketSender().sendMessage("You successfully cook the " + item.getName().toLowerCase() + ".");
if (GameConstants.SOUND) {
if (Constants.SOUND) {
player.getPacketSender().sendSound(SoundList.COOK_ITEM, 100, 0);
}
player.getPlayerAssistant().addSkillXP(item.getXp(), GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(item.getXp(), Constants.COOKING);
player.getItemAssistant().addItem(item.getCookedItem(), 1);
} else {
player.getPacketSender().sendMessage(
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.cooking;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -35,22 +35,22 @@ public class CookingTutorialIsland extends SkillHandler {
if (!hasRequiredLevel(c, 7, levelRequired, "cooking", "cook this")) {
return;
}
int chance = c.playerLevel[GameConstants.COOKING];
int chance = c.playerLevel[Constants.COOKING];
if (c.playerEquipment[c.playerHands] == StaticItemList.COOKING_GAUNTLETS) {
chance = c.playerLevel[GameConstants.COOKING] + 8;
chance = c.playerLevel[Constants.COOKING] + 8;
}
if (chance <= 0) {
chance = Misc.random(5);
}
c.playerSkillProp[GameConstants.COOKING][0] = itemID;
c.playerSkillProp[GameConstants.COOKING][1] = xpRecieved;
c.playerSkillProp[GameConstants.COOKING][2] = levelRequired;
c.playerSkillProp[GameConstants.COOKING][3] = burntFish;
c.playerSkillProp[GameConstants.COOKING][4] = cookedFish;
c.playerSkillProp[GameConstants.COOKING][5] = object;
c.playerSkillProp[GameConstants.COOKING][6] = chance;
c.playerSkillProp[Constants.COOKING][0] = itemID;
c.playerSkillProp[Constants.COOKING][1] = xpRecieved;
c.playerSkillProp[Constants.COOKING][2] = levelRequired;
c.playerSkillProp[Constants.COOKING][3] = burntFish;
c.playerSkillProp[Constants.COOKING][4] = cookedFish;
c.playerSkillProp[Constants.COOKING][5] = object;
c.playerSkillProp[Constants.COOKING][6] = chance;
c.stopPlayerSkill = false;
int item = c.getItemAssistant().getItemAmount(c.playerSkillProp[GameConstants.COOKING][0]);
int item = c.getItemAssistant().getItemAmount(c.playerSkillProp[Constants.COOKING][0]);
if (item == 1) {
c.doAmount = 1;
cookTutFish(c);
@@ -60,7 +60,7 @@ public class CookingTutorialIsland extends SkillHandler {
}
public static void getAmount(Player player, int amount) {
int item = player.getItemAssistant().getItemAmount(player.playerSkillProp[GameConstants.COOKING][0]);
int item = player.getItemAssistant().getItemAmount(player.playerSkillProp[Constants.COOKING][0]);
if (amount > item) {
amount = item;
}
@@ -69,10 +69,10 @@ public class CookingTutorialIsland extends SkillHandler {
}
public static void resetCooking(Player c) {
c.playerSkilling[GameConstants.COOKING] = false;
c.playerSkilling[Constants.COOKING] = false;
c.stopPlayerSkill = false;
for (int i = 0; i < 6; i++) {
c.playerSkillProp[GameConstants.COOKING][i] = -1;
c.playerSkillProp[Constants.COOKING][i] = -1;
}
}
@@ -84,19 +84,19 @@ public class CookingTutorialIsland extends SkillHandler {
}
private static void cookTutFish(final Player c) {
if (c.playerSkilling[GameConstants.COOKING]) {
if (c.playerSkilling[Constants.COOKING]) {
return;
}
if (c.tutorialProgress == 6) {
c.playerSkilling[GameConstants.COOKING] = true;
c.playerSkilling[Constants.COOKING] = true;
c.stopPlayerSkill = true;
c.getPacketSender().closeAllWindows();
if (c.playerSkillProp[GameConstants.COOKING][5] > 0) {
// c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897 :
if (c.playerSkillProp[Constants.COOKING][5] > 0) {
// c.startAnimation(c.playerSkillProp[Constants.COOKING][5] == StaticObjectList.FIRE ? 897 :
// 896);
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897
: c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.STOVE_12269 ? 897 : 896);
if (GameConstants.SOUND) {
c.startAnimation(c.playerSkillProp[Constants.COOKING][5] == StaticObjectList.FIRE ? 897
: c.playerSkillProp[Constants.COOKING][5] == StaticObjectList.STOVE_12269 ? 897 : 896);
if (Constants.SOUND) {
c.getPacketSender().sendSound(SoundList.COOK_ITEM, 100,
0);
}
@@ -107,9 +107,9 @@ public class CookingTutorialIsland extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
c.getItemAssistant().deleteItem(
c.playerSkillProp[GameConstants.COOKING][0],
c.playerSkillProp[Constants.COOKING][0],
c.getItemAssistant().getItemSlot(
c.playerSkillProp[GameConstants.COOKING][0]), 1);
c.playerSkillProp[Constants.COOKING][0]), 1);
if (c.cookStage1 == 1) {
c.getPacketSender().chatbox(6180);
c.getDialogueHandler()
@@ -122,7 +122,7 @@ public class CookingTutorialIsland extends SkillHandler {
c.getPacketSender().chatbox(6179);
c.cookStage1 = 0;
c.getItemAssistant()
.addItem(c.playerSkillProp[GameConstants.COOKING][3], 1);
.addItem(c.playerSkillProp[Constants.COOKING][3], 1);
} else {
c.getPacketSender().chatbox(6180);
c.getDialogueHandler()
@@ -136,14 +136,14 @@ public class CookingTutorialIsland extends SkillHandler {
c.getPacketSender().createArrow(3089, 3092,
c.getH(), 2);
c.getPlayerAssistant().addSkillXP(
c.playerSkillProp[GameConstants.COOKING][1], 7);
c.playerSkillProp[Constants.COOKING][1], 7);
c.getItemAssistant()
.addItem(c.playerSkillProp[GameConstants.COOKING][4], 1);
.addItem(c.playerSkillProp[Constants.COOKING][4], 1);
c.tutorialProgress = 7;
}
deleteTime(c);
if (!c.getItemAssistant().playerHasItem(
c.playerSkillProp[GameConstants.COOKING][0], 1)
c.playerSkillProp[Constants.COOKING][0], 1)
|| c.doAmount <= 0) {
container.stop();
}
@@ -161,10 +161,10 @@ public class CookingTutorialIsland extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
if (c.playerSkillProp[GameConstants.COOKING][5] > 0) {
if (c.playerSkillProp[Constants.COOKING][5] > 0) {
// c.getPacketSender().sendSound(357, 100, 1); //
// cook sound
c.startAnimation(c.playerSkillProp[GameConstants.COOKING][5] == StaticObjectList.FIRE ? 897
c.startAnimation(c.playerSkillProp[Constants.COOKING][5] == StaticObjectList.FIRE ? 897
: 896);
}
if (!c.stopPlayerSkill) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.cooking;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -76,7 +76,7 @@ public class DairyChurn {
if (churnData == null || player.getStatedInterface() != "dairyChurn") {
return;
}
if (player.playerLevel[GameConstants.COOKING] < churnData.getLevel()) {
if (player.playerLevel[Constants.COOKING] < churnData.getLevel()) {
player.getDialogueHandler().sendStatement("You need a cooking level of " + churnData.getLevel() + " to make this.");
return;
}
@@ -105,7 +105,7 @@ public class DairyChurn {
player.getItemAssistant().deleteItem(churnData.getUsed()[i], 1);
player.getItemAssistant().addItem(churnData.getResult(), 1);
player.getItemAssistant().addItem(StaticItemList.BUCKET, 1);
player.getPlayerAssistant().addSkillXP(churnData.getExperience(), GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(churnData.getExperience(), Constants.COOKING);
}
@Override
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.cooking;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.StaticItemList;
import com.rs2.game.content.randomevents.RandomEventHandler;
import com.rs2.game.content.skills.SkillHandler;
@@ -101,12 +101,12 @@ public class Potatoes extends SkillHandler {
return false;
}
if (c.getItemAssistant().playerHasItem(potato.getIngredient(), 1)) {
if (c.playerLevel[GameConstants.COOKING] >= potato.getReq()) {
if (c.playerLevel[Constants.COOKING] >= potato.getReq()) {
c.getItemAssistant().deleteItem(potato.getIngredient(), 1);
c.getItemAssistant().deleteItem(StaticItemList.POTATO_WITH_BUTTER, 1);
c.getPacketSender().sendMessage("You put the topping on.");
c.getItemAssistant().addItem(potato.getNewPotatoID(), 1);
c.getPlayerAssistant().addSkillXP(potato.getXP(), GameConstants.COOKING);
c.getPlayerAssistant().addSkillXP(potato.getXP(), Constants.COOKING);
RandomEventHandler.addRandom(c);
} else {
c.getPacketSender().sendMessage("You need a cooking level of " + potato.getReq() + " to make this potato.");
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.core;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -58,8 +58,8 @@ public class Fishing extends SkillHandler {
c.getPacketSender().sendMessage(c.disabled());
return;
}
if (c.playerSkillProp[GameConstants.FISHING][4] > 0) {
c.playerSkilling[GameConstants.FISHING] = false;
if (c.playerSkillProp[Constants.FISHING][4] > 0) {
c.playerSkilling[Constants.FISHING] = false;
return;
}
if (!noInventorySpace(c, "fishing")) {
@@ -68,7 +68,7 @@ public class Fishing extends SkillHandler {
resetFishing(c);
for (int i = 0; i < data.length; i++) {
if (npcId == data[i][0]) {
if (c.playerLevel[GameConstants.FISHING] < data[i][1]) {
if (c.playerLevel[Constants.FISHING] < data[i][1]) {
c.getDialogueHandler().sendStatement(
"You need a fishing level of at least "
+ data[i][1]
@@ -88,24 +88,24 @@ public class Fishing extends SkillHandler {
return;
}
}
c.playerSkillProp[GameConstants.FISHING][0] = data[i][6]; // ANIM
c.playerSkillProp[GameConstants.FISHING][1] = data[i][4]; // FISH
c.playerSkillProp[GameConstants.FISHING][2] = data[i][5]; // XP
c.playerSkillProp[GameConstants.FISHING][3] = data[i][3]; // BAIT
c.playerSkillProp[GameConstants.FISHING][4] = data[i][2]; // EQUIP
c.playerSkillProp[GameConstants.FISHING][5] = data[i][7]; // sFish
c.playerSkillProp[GameConstants.FISHING][6] = data[i][8]; // sLvl
c.playerSkillProp[GameConstants.FISHING][7] = data[i][4]; // FISH
c.playerSkillProp[GameConstants.FISHING][8] = data[i][9]; // sXP
c.playerSkillProp[GameConstants.FISHING][9] = Misc.random(1) == 0 ? 7 : 5;
c.playerSkillProp[GameConstants.FISHING][10] = data[i][0]; // INDEX
c.playerSkillProp[Constants.FISHING][0] = data[i][6]; // ANIM
c.playerSkillProp[Constants.FISHING][1] = data[i][4]; // FISH
c.playerSkillProp[Constants.FISHING][2] = data[i][5]; // XP
c.playerSkillProp[Constants.FISHING][3] = data[i][3]; // BAIT
c.playerSkillProp[Constants.FISHING][4] = data[i][2]; // EQUIP
c.playerSkillProp[Constants.FISHING][5] = data[i][7]; // sFish
c.playerSkillProp[Constants.FISHING][6] = data[i][8]; // sLvl
c.playerSkillProp[Constants.FISHING][7] = data[i][4]; // FISH
c.playerSkillProp[Constants.FISHING][8] = data[i][9]; // sXP
c.playerSkillProp[Constants.FISHING][9] = Misc.random(1) == 0 ? 7 : 5;
c.playerSkillProp[Constants.FISHING][10] = data[i][0]; // INDEX
if (c.playerSkilling[GameConstants.FISHING]) {
if (c.playerSkilling[Constants.FISHING]) {
return;
}
c.playerSkilling[GameConstants.FISHING] = true;
c.playerSkilling[Constants.FISHING] = true;
if (c.tutorialProgress == 6) { // if tutorial prog = 6
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
c.stopPlayerSkill = true;
c.getPacketSender().drawHeadicon(0, 0, 0, 0); // deletes
// headicon
@@ -121,9 +121,9 @@ public class Fishing extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
if (c.playerSkillProp[GameConstants.FISHING][5] > 0) {
if (c.playerLevel[GameConstants.FISHING] >= c.playerSkillProp[GameConstants.FISHING][6]) {
c.playerSkillProp[GameConstants.FISHING][1] = c.playerSkillProp[GameConstants.FISHING][Misc
if (c.playerSkillProp[Constants.FISHING][5] > 0) {
if (c.playerLevel[Constants.FISHING] >= c.playerSkillProp[Constants.FISHING][6]) {
c.playerSkillProp[Constants.FISHING][1] = c.playerSkillProp[Constants.FISHING][Misc
.random(1) == 0 ? 7 : 5];
}
}
@@ -131,12 +131,12 @@ public class Fishing extends SkillHandler {
if (!c.stopPlayerSkill) {
container.stop();
}
if (!c.playerSkilling[GameConstants.FISHING]) {
if (!c.playerSkilling[Constants.FISHING]) {
container.stop();
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0) {
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
if (c.playerSkillProp[Constants.FISHING][1] > 0) {
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
}
}
@@ -152,20 +152,20 @@ public class Fishing extends SkillHandler {
@Override
public void execute(
CycleEventContainer container) {
if (c.playerSkillProp[GameConstants.FISHING][5] > 0) {
if (c.playerLevel[GameConstants.FISHING] >= c.playerSkillProp[GameConstants.FISHING][6]) {
c.playerSkillProp[GameConstants.FISHING][1] = c.playerSkillProp[GameConstants.FISHING][Misc
if (c.playerSkillProp[Constants.FISHING][5] > 0) {
if (c.playerLevel[Constants.FISHING] >= c.playerSkillProp[Constants.FISHING][6]) {
c.playerSkillProp[Constants.FISHING][1] = c.playerSkillProp[Constants.FISHING][Misc
.random(1) == 0 ? 7 : 5];
}
}
if (c.playerSkillProp[GameConstants.FISHING][2] > 0) {
if (c.playerSkillProp[Constants.FISHING][2] > 0) {
c.getPlayerAssistant().addSkillXP(
c.playerSkillProp[GameConstants.FISHING][2],
GameConstants.FISHING);
c.playerSkillProp[Constants.FISHING][2],
Constants.FISHING);
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0) {
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.FISHING][1], 1);
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
if (c.playerSkillProp[Constants.FISHING][1] > 0) {
c.getItemAssistant().addItem(c.playerSkillProp[Constants.FISHING][1], 1);
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
c.getDialogueHandler().sendDialogues(3019, -1);
container.stop();
}
@@ -175,7 +175,7 @@ public class Fishing extends SkillHandler {
if (!c.stopPlayerSkill) {
container.stop();
}
if (!c.playerSkilling[GameConstants.FISHING]) {
if (!c.playerSkilling[Constants.FISHING]) {
container.stop();
}
}
@@ -192,41 +192,41 @@ public class Fishing extends SkillHandler {
c.getPacketSender().sendMessage("" + messages(c));
// c.getPA().sendSound(379, 100, 1); // fishing
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
c.stopPlayerSkill = true;
CycleEventHandler.getSingleton().addEvent(eventId, c,
new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if (c.playerSkillProp[GameConstants.FISHING][3] > 0) {
if (c.playerSkillProp[Constants.FISHING][3] > 0) {
if (!c.getItemAssistant().playerHasItem(
c.playerSkillProp[GameConstants.FISHING][3])) {
c.playerSkillProp[Constants.FISHING][3])) {
c.getPacketSender()
.sendMessage(
"You don't have any "
+ DeprecatedItems
.getItemName(c.playerSkillProp[GameConstants.FISHING][3])
.getItemName(c.playerSkillProp[Constants.FISHING][3])
+ " left!");
c.getPacketSender()
.sendMessage(
"You need "
+ DeprecatedItems
.getItemName(c.playerSkillProp[GameConstants.FISHING][3])
.getItemName(c.playerSkillProp[Constants.FISHING][3])
+ " to fish here.");
resetFishing(c);
container.stop();
}
}
if (c.playerSkillProp[GameConstants.FISHING][5] > 0) {
if (c.playerLevel[GameConstants.FISHING] >= c.playerSkillProp[GameConstants.FISHING][6]) {
c.playerSkillProp[GameConstants.FISHING][1] = c.playerSkillProp[GameConstants.FISHING][Misc
if (c.playerSkillProp[Constants.FISHING][5] > 0) {
if (c.playerLevel[Constants.FISHING] >= c.playerSkillProp[Constants.FISHING][6]) {
c.playerSkillProp[Constants.FISHING][1] = c.playerSkillProp[Constants.FISHING][Misc
.random(1) == 0 ? 7 : 5];
}
}
if (!hasFishingEquipment(c,
c.playerSkillProp[GameConstants.FISHING][4])) {
c.playerSkillProp[Constants.FISHING][4])) {
resetFishing(c);
container.stop();
}
@@ -237,12 +237,12 @@ public class Fishing extends SkillHandler {
if (!c.stopPlayerSkill) {
container.stop();
}
if (!c.playerSkilling[GameConstants.FISHING]) {
if (!c.playerSkilling[Constants.FISHING]) {
resetFishing(c);
container.stop();
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0) {
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
if (c.playerSkillProp[Constants.FISHING][1] > 0) {
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
// c.getPA().sendSound(379, 100, 1); //
// fishing
}
@@ -258,70 +258,70 @@ public class Fishing extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
if (c.playerSkillProp[GameConstants.FISHING][5] > 0) {
if (c.playerLevel[GameConstants.FISHING] >= c.playerSkillProp[GameConstants.FISHING][6]) {
c.playerSkillProp[GameConstants.FISHING][1] = c.playerSkillProp[GameConstants.FISHING][Misc
if (c.playerSkillProp[Constants.FISHING][5] > 0) {
if (c.playerLevel[Constants.FISHING] >= c.playerSkillProp[Constants.FISHING][6]) {
c.playerSkillProp[Constants.FISHING][1] = c.playerSkillProp[Constants.FISHING][Misc
.random(1) == 0 ? 7 : 5];
}
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0) {
if (c.playerSkillProp[Constants.FISHING][1] > 0) {
c.getPacketSender()
.sendMessage(
"You catch "
+ (c.playerSkillProp[GameConstants.FISHING][1] == RAW_ANCHOVIES
|| c.playerSkillProp[GameConstants.FISHING][1] == RAW_SHRIMPS
|| c.playerSkillProp[GameConstants.FISHING][1] == RAW_MONKFISH ? "some "
+ (c.playerSkillProp[Constants.FISHING][1] == RAW_ANCHOVIES
|| c.playerSkillProp[Constants.FISHING][1] == RAW_SHRIMPS
|| c.playerSkillProp[Constants.FISHING][1] == RAW_MONKFISH ? "some "
: "a ")
+ DeprecatedItems
.getItemName(
c.playerSkillProp[GameConstants.FISHING][1])
c.playerSkillProp[Constants.FISHING][1])
.toLowerCase()
.replace(
"raw ",
"")
+ ".");
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0 && c.randomEventsEnabled) {
if (c.playerSkillProp[Constants.FISHING][1] > 0 && c.randomEventsEnabled) {
randomEvents(c);
}
if (c.playerSkillProp[GameConstants.FISHING][1] > 0) {
c.getItemAssistant().deleteItem(c.playerSkillProp[GameConstants.FISHING][3], c.getItemAssistant().getItemSlot(c.playerSkillProp[GameConstants.FISHING][3]), 1);
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.FISHING][1], 1);
c.startAnimation(c.playerSkillProp[GameConstants.FISHING][0]);
if (c.playerSkillProp[Constants.FISHING][1] > 0) {
c.getItemAssistant().deleteItem(c.playerSkillProp[Constants.FISHING][3], c.getItemAssistant().getItemSlot(c.playerSkillProp[Constants.FISHING][3]), 1);
c.getItemAssistant().addItem(c.playerSkillProp[Constants.FISHING][1], 1);
c.startAnimation(c.playerSkillProp[Constants.FISHING][0]);
}
if (c.playerSkillProp[GameConstants.FISHING][5] > 0
&& c.playerLevel[GameConstants.FISHING] >= c.playerSkillProp[GameConstants.FISHING][6]) {
if (c.playerSkillProp[Constants.FISHING][5] > 0
&& c.playerLevel[Constants.FISHING] >= c.playerSkillProp[Constants.FISHING][6]) {
c.getPlayerAssistant().addSkillXP(
c.playerSkillProp[GameConstants.FISHING][8],
GameConstants.FISHING);
} else if (c.playerSkillProp[GameConstants.FISHING][7] > 0) {
c.playerSkillProp[Constants.FISHING][8],
Constants.FISHING);
} else if (c.playerSkillProp[Constants.FISHING][7] > 0) {
c.getPlayerAssistant().addSkillXP(
c.playerSkillProp[GameConstants.FISHING][2],
GameConstants.FISHING);
c.playerSkillProp[Constants.FISHING][2],
Constants.FISHING);
}
if (c.playerSkillProp[GameConstants.FISHING][3] > 0) {
if (c.playerSkillProp[Constants.FISHING][3] > 0) {
if (!c.getItemAssistant().playerHasItem(
c.playerSkillProp[GameConstants.FISHING][3])) {
c.playerSkillProp[Constants.FISHING][3])) {
c.getDialogueHandler()
.sendStatement(
"You have run out of "
+ DeprecatedItems
.getItemName(
c.playerSkillProp[GameConstants.FISHING][3])
c.playerSkillProp[Constants.FISHING][3])
.toLowerCase()
.toLowerCase()
+ ".");
// c.getPacketDispatcher().sendMessage("You don't have any "+
// ItemAssistant.getItemName(c.playerSkillProp[GameConstants.FISHING][3])
// ItemAssistant.getItemName(c.playerSkillProp[Constants.FISHING][3])
// +" left!");
// c.getPacketDispatcher().sendMessage("You need "+
// ItemAssistant.getItemName(c.playerSkillProp[GameConstants.FISHING][3])
// ItemAssistant.getItemName(c.playerSkillProp[Constants.FISHING][3])
// +" to fish here.");
container.stop();
}
}
if (!hasFishingEquipment(c,
c.playerSkillProp[GameConstants.FISHING][4])) {
c.playerSkillProp[Constants.FISHING][4])) {
resetFishing(c);
container.stop();
}
@@ -332,7 +332,7 @@ public class Fishing extends SkillHandler {
if (!c.stopPlayerSkill) {
container.stop();
}
if (!c.playerSkilling[GameConstants.FISHING]) {
if (!c.playerSkilling[Constants.FISHING]) {
resetFishing(c);
container.stop();
}
@@ -371,32 +371,32 @@ public class Fishing extends SkillHandler {
public static void resetFishing(Player player) {
player.startAnimation(65535);
player.stopPlayerSkill = false;
player.playerSkilling[GameConstants.FISHING] = false;
player.playerSkilling[Constants.FISHING] = false;
player.fishingWhirlPool = false;
stopEvents(player, eventId);
for (int i = 0; i < 11; i++) {
player.playerSkillProp[GameConstants.FISHING][i] = -1;
player.playerSkillProp[Constants.FISHING][i] = -1;
}
}
public static String messages(Player c) {
if (c.playerSkillProp[GameConstants.FISHING][10] == 1 || c.playerSkillProp[GameConstants.FISHING][10] == 9) {
if (c.playerSkillProp[Constants.FISHING][10] == 1 || c.playerSkillProp[Constants.FISHING][10] == 9) {
// etc
return messages[0][0];
}
if (c.playerSkillProp[GameConstants.FISHING][10] == 2 || c.playerSkillProp[GameConstants.FISHING][10] == 3
|| c.playerSkillProp[GameConstants.FISHING][10] == 4
|| c.playerSkillProp[GameConstants.FISHING][10] == 5
|| c.playerSkillProp[GameConstants.FISHING][10] == 6) {
if (c.playerSkillProp[Constants.FISHING][10] == 2 || c.playerSkillProp[Constants.FISHING][10] == 3
|| c.playerSkillProp[Constants.FISHING][10] == 4
|| c.playerSkillProp[Constants.FISHING][10] == 5
|| c.playerSkillProp[Constants.FISHING][10] == 6) {
return messages[1][0];
}
if (c.playerSkillProp[GameConstants.FISHING][10] == 7 || c.playerSkillProp[GameConstants.FISHING][10] == 10) {
if (c.playerSkillProp[Constants.FISHING][10] == 7 || c.playerSkillProp[Constants.FISHING][10] == 10) {
return messages[2][0];
}
if (c.playerSkillProp[GameConstants.FISHING][10] == 8) {
if (c.playerSkillProp[Constants.FISHING][10] == 8) {
return messages[3][0];
}
@@ -404,7 +404,7 @@ public class Fishing extends SkillHandler {
}
private static int playerFishingLevel(Player c) {
return 10 - (int) Math.floor(c.playerLevel[GameConstants.FISHING] / 10);
return 10 - (int) Math.floor(c.playerLevel[Constants.FISHING] / 10);
}
private final static int getTimer(Player c, int npcId) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.core;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -181,7 +181,7 @@ public class Mining {
CycleEventHandler.getSingleton().stopEvents(player, "miningEvent".hashCode());
if (player.isMining || player.miningRock)
return;
int miningLevel = player.playerLevel[GameConstants.MINING];
int miningLevel = player.playerLevel[Constants.MINING];
rockData rock = rockData.getRock(objectID);
player.miningAxe = -1;
player.turnPlayerTo(objectX, objectY);
@@ -236,7 +236,7 @@ public class Mining {
if (player.isMining) {
if (!giveGem(player)) {
player.getItemAssistant().addItem(oreID, 1);
player.getPlayerAssistant().addSkillXP(rock.getXp(), GameConstants.MINING);
player.getPlayerAssistant().addSkillXP(rock.getXp(), Constants.MINING);
player.getPacketSender().sendMessage("You manage to mine some " + DeprecatedItems.getItemName(oreID).toLowerCase() + ".");
} else {
obtainGem(player);
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -52,7 +52,7 @@ public class BattleStaffs {
if (player.isCrafting == true) {
return;
}
if (player.playerLevel[GameConstants.CRAFTING] < b.getLevelReq()) {
if (player.playerLevel[Constants.CRAFTING] < b.getLevelReq()) {
player.getPacketSender().sendMessage("You need level " + b.getLevelReq() + " crafting to do that.");
return;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -19,7 +19,7 @@ public class GemCutting extends CraftingData {
final int itemId = itemUsed == 1755 ? usedWith : itemUsed;
for (final cutGemData g : cutGemData.values()) {
if (itemId == g.getUncut()) {
if (player.playerLevel[GameConstants.CRAFTING] < g.getLevel()) {
if (player.playerLevel[Constants.CRAFTING] < g.getLevel()) {
player.getPacketSender().sendMessage(
"You need a crafting level of " + g.getLevel()
+ " to cut this gem.");
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.*;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
@@ -82,7 +82,7 @@ public class GlassBlowing {
}
public void makeItem(final int id, final int amount, final int slot) {
if(c.playerLevel[GameConstants.CRAFTING] < data[slot][2]) {
if(c.playerLevel[Constants.CRAFTING] < data[slot][2]) {
c.getPacketSender().sendMessage("You need a crafting level of "+data[slot][2]+" make a "+DeprecatedItems.getItemName(id)+"");
return;
}
@@ -100,7 +100,7 @@ public class GlassBlowing {
if(c.getItemAssistant().playerHasItem(1785)) {
c.getItemAssistant().deleteItem(1775, 1);
c.getItemAssistant().addItem(id, 1);
c.getPlayerAssistant().addSkillXP(data[slot][3], GameConstants.CRAFTING);
c.getPlayerAssistant().addSkillXP(data[slot][3], Constants.CRAFTING);
c.startAnimation(884);
made++;
if(made >= amount) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
@@ -136,7 +136,7 @@ public class JewelryMaking {
if (!isRing && !isNeck && !isAmulet) {
return;
}
if (player.playerLevel[GameConstants.CRAFTING] >= lvl) {
if (player.playerLevel[Constants.CRAFTING] >= lvl) {
if (DeprecatedItems.getItemName(itemAdd).toLowerCase().contains("gold")
&& !player.getItemAssistant().playerHasItem(GOLD_BAR, 1)
|| !player.getItemAssistant().playerHasItem(GOLD_BAR, 1)) {
@@ -157,8 +157,8 @@ public class JewelryMaking {
player.getItemAssistant().deleteItem(gem, 1);
player.getItemAssistant().deleteItem(GOLD_BAR, 1);
player.getItemAssistant().addItem(itemAdd, 1);
player.getPlayerAssistant().addSkillXP(xp, GameConstants.CRAFTING);
player.getPlayerAssistant().refreshSkill(GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(xp, Constants.CRAFTING);
player.getPlayerAssistant().refreshSkill(Constants.CRAFTING);
done++;
}
if (done == 1) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -69,7 +69,7 @@ public class LeatherMaking extends CraftingData {
for (final leatherData l : leatherData.values()) {
if (buttonId == l.getButtonId(buttonId)) {
if (player.leatherType == l.getLeather()) {
if (player.playerLevel[GameConstants.CRAFTING] < l.getLevel()) {
if (player.playerLevel[Constants.CRAFTING] < l.getLevel()) {
player.getPacketSender().sendMessage(
"You need a crafting level of " + l.getLevel()
+ " to make this.");
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -55,14 +55,14 @@ public class Pottery {
c.doAmount = amount;
c.isPotCrafting = true;
if (c.getItemAssistant().playerHasItem(softClay)
&& c.playerLevel[GameConstants.CRAFTING] >= level && c.isPotCrafting) {
&& c.playerLevel[Constants.CRAFTING] >= level && c.isPotCrafting) {
c.startAnimation(unFire);
c.getItemAssistant().deleteItem(softClay, 1);
c.getItemAssistant().addItem(id, 1);
c.getPacketSender().sendMessage(
"You make the soft clay into a "
+ DeprecatedItems.getItemName(id) + ".");
c.getPlayerAssistant().addSkillXP(xp, GameConstants.CRAFTING);
c.getPlayerAssistant().addSkillXP(xp, Constants.CRAFTING);
c.doAmount--;
}
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@@ -70,17 +70,17 @@ public class Pottery {
@Override
public void execute(CycleEventContainer container) {
if (c.getItemAssistant().playerHasItem(softClay)
&& c.playerLevel[GameConstants.CRAFTING] >= level && !(c.doAmount <= 0)
&& c.playerLevel[Constants.CRAFTING] >= level && !(c.doAmount <= 0)
&& c.isPotCrafting) {
c.startAnimation(unFire);
c.getItemAssistant().deleteItem(softClay, 1);
c.getItemAssistant().addItem(id, 1);
c.getPacketSender().sendMessage("You make the soft clay into a " + DeprecatedItems.getItemName(id) + ".");
c.getPlayerAssistant().addSkillXP(xp, GameConstants.CRAFTING);
c.getPlayerAssistant().addSkillXP(xp, Constants.CRAFTING);
c.doAmount--;
}
if (c.playerLevel[GameConstants.CRAFTING] < level) {
if (c.playerLevel[Constants.CRAFTING] < level) {
container.stop();
c.getPacketSender().sendMessage("You need a crafting level of " + level + " to make this.");
}
@@ -114,22 +114,22 @@ public class Pottery {
player.doAmount = amount;
player.isPotCrafting = true;
if (player.getItemAssistant().playerHasItem(startId)
&& player.playerLevel[GameConstants.CRAFTING] >= level && player.isPotCrafting) {
&& player.playerLevel[Constants.CRAFTING] >= level && player.isPotCrafting) {
player.getItemAssistant().deleteItem(startId, 1);
player.getItemAssistant().addItem(finishId, 1);
player.startAnimation(Fire);
player.getPacketSender().sendSound(469, 100, 0);
player.getPacketSender().sendMessage("You put a " + DeprecatedItems.getItemName(startId) + " into the oven.");
player.getPacketSender().sendMessage("You retrieve the " + DeprecatedItems.getItemName(finishId) + " from the oven.");
player.getPlayerAssistant().addSkillXP(xp, GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(xp, Constants.CRAFTING);
player.doAmount--;
}
if (player.playerLevel[GameConstants.CRAFTING] < level) {
if (player.playerLevel[Constants.CRAFTING] < level) {
player.getPacketSender().sendMessage("You need a crafting level of " + level + " to make this.");
}
if (!player.getItemAssistant().playerHasItem(startId) && player.playerLevel[GameConstants.CRAFTING] >= level) {
if (!player.getItemAssistant().playerHasItem(startId) && player.playerLevel[Constants.CRAFTING] >= level) {
player.getPacketSender().sendMessage("You need an " + DeprecatedItems.getItemName(startId) + " to do this.");
}
@@ -137,20 +137,20 @@ public class Pottery {
@Override
public void execute(CycleEventContainer container) {
if (player.getItemAssistant().playerHasItem(startId) && player.playerLevel[GameConstants.CRAFTING] >= level && player.isPotCrafting && !(player.doAmount <= 0)) {
if (player.getItemAssistant().playerHasItem(startId) && player.playerLevel[Constants.CRAFTING] >= level && player.isPotCrafting && !(player.doAmount <= 0)) {
player.getItemAssistant().deleteItem(startId, 1);
player.getItemAssistant().addItem(finishId, 1);
player.startAnimation(Fire);
player.getPacketSender().sendSound(469, 100, 0);
player.getPacketSender().sendMessage("You put a " + DeprecatedItems.getItemName(startId) + " into the oven.");
player.getPacketSender().sendMessage("You retrieve the " + DeprecatedItems.getItemName(finishId) + " from the oven.");
player.getPlayerAssistant().addSkillXP(xp, GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(xp, Constants.CRAFTING);
player.doAmount--;
}
if (player.isPotCrafting == false
|| !player.getItemAssistant().playerHasItem(startId)
|| player.playerLevel[GameConstants.CRAFTING] < level) {
|| player.playerLevel[Constants.CRAFTING] < level) {
container.stop();
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.crafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -43,14 +43,14 @@ public class Spinning extends CraftingData {
public void execute(CycleEventContainer container) {
if (player.isSpinning == true) {
if (player.getItemAssistant().playerHasItem(before)) {
if (player.playerLevel[GameConstants.CRAFTING] < level) {
if (player.playerLevel[Constants.CRAFTING] < level) {
player.getDialogueHandler().sendStatement("You need a crafting level of " + level + " to do this.");
return;
}
player.startAnimation(896);
player.getItemAssistant().deleteItem(before, 1);
player.getItemAssistant().addItem(after, 1);
player.getPlayerAssistant().addSkillXP(exp, GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(exp, Constants.CRAFTING);
player.getPacketSender().sendMessage("You spin the " + DeprecatedItems.getItemName(before) + " into a " + DeprecatedItems.getItemName(after) + ".");
player.doAmount--;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.firemaking;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -43,7 +43,7 @@ public class Firemaking {
for (final LogData l : LogData.values()) {
final int logId = usedWith == firemakingItems[i] ? itemUsed : usedWith;
if (logId == l.getLogId()) {
if (c.playerLevel[GameConstants.FIREMAKING] < l.getLevel()) {
if (c.playerLevel[Constants.FIREMAKING] < l.getLevel()) {
c.getPacketSender().sendMessage("You need a firemaking level of " + l.getLevel() + " to light " + DeprecatedItems.getItemName(logId));
return;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.fletching;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -93,7 +93,7 @@ public class ArrowMaking {
if (player.isWoodcutting) {
return false;
}
if (player.playerLevel[GameConstants.FLETCHING] < arrowData.getLevel()) {
if (player.playerLevel[Constants.FLETCHING] < arrowData.getLevel()) {
player.getDialogueHandler().sendStatement(
"You need a fletching level of " + arrowData.getLevel()
+ " to do this");
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.fletching;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -26,7 +26,7 @@ public class LogCutting {
public static void cutLog(final Player player, final int product, final int level, final double xp, int amount) {
player.doAmount = amount;
player.getPacketSender().closeAllWindows();
if (player.playerLevel[GameConstants.FLETCHING] < level) {
if (player.playerLevel[Constants.FLETCHING] < level) {
player.getPacketSender().sendMessage("You need a fletching level of " + level + " to make this.");
return;
}
@@ -55,7 +55,7 @@ public class LogCutting {
player.getPacketSender().sendMessage("You carefully cut the " + DeprecatedItems.getItemName(player.getFletching().log) + " into a " + DeprecatedItems.getItemName(product) + ".");
}
player.getPlayerAssistant().addSkillXP(xp, GameConstants.FLETCHING);
player.getPlayerAssistant().addSkillXP(xp, Constants.FLETCHING);
player.doAmount--;
player.getPacketSender().sendSound(CUT_SOUND, 100, 0);
}
@@ -297,13 +297,13 @@ public class LogCutting {
c.startAnimation(1248);
c.getItemAssistant().deleteItem(2859, amount);
c.getItemAssistant().addItem(2861, makeAmount);
c.getPlayerAssistant().addSkillXP(3 * amount, GameConstants.FLETCHING);
c.getPlayerAssistant().addSkillXP(3 * amount, Constants.FLETCHING);
c.getPacketSender().sendMessage("You turn your " + DeprecatedItems.getItemName(2859) + " into " + DeprecatedItems.getItemName(2861) + ".");
}
}
public static void flightedArrow(Player c) {// to do
if (c.playerLevel[GameConstants.FLETCHING] < 5) {
if (c.playerLevel[Constants.FLETCHING] < 5) {
c.getDialogueHandler().sendStatement("You need 5 fletching to fletch this.");
c.nextChat = 0;
return;
@@ -328,7 +328,7 @@ public class LogCutting {
}
public static void ogreArrow(Player c) {
if (c.playerLevel[GameConstants.FLETCHING] < 5) {
if (c.playerLevel[Constants.FLETCHING] < 5) {
c.getDialogueHandler().sendStatement("You need 5 fletching to fletch this.");
c.nextChat = 0;
return;
@@ -343,21 +343,21 @@ public class LogCutting {
if (wolfBoneArrow == flightedArrow) {
c.startAnimation(1248);
c.getItemAssistant().addItem(2866, wolfBoneArrow);
c.getPlayerAssistant().addSkillXP(1 * wolfBoneArrow, GameConstants.FLETCHING);
c.getPlayerAssistant().addSkillXP(1 * wolfBoneArrow, Constants.FLETCHING);
c.getItemAssistant().deleteItem(2861, wolfBoneArrow);
c.getItemAssistant().deleteItem(2865, wolfBoneArrow);
c.getPacketSender().sendMessage("You turn your " + DeprecatedItems.getItemName(2865) + " (s) into " + DeprecatedItems.getItemName(2866) + "(s).");
} else if (wolfBoneArrow > flightedArrow) {
c.startAnimation(1248);
c.getItemAssistant().addItem(2866, flightedArrow);
c.getPlayerAssistant().addSkillXP(1 * flightedArrow, GameConstants.FLETCHING);
c.getPlayerAssistant().addSkillXP(1 * flightedArrow, Constants.FLETCHING);
c.getItemAssistant().deleteItem(2861, flightedArrow);
c.getItemAssistant().deleteItem(2865, flightedArrow);
c.getPacketSender().sendMessage("You turn your " + DeprecatedItems.getItemName(2865) + " (s) into " + DeprecatedItems.getItemName(2866) + "(s).");
} else if (wolfBoneArrow < flightedArrow) {
c.startAnimation(1248);
c.getItemAssistant().addItem(2866, wolfBoneArrow);
c.getPlayerAssistant().addSkillXP(1 * wolfBoneArrow, GameConstants.FLETCHING);
c.getPlayerAssistant().addSkillXP(1 * wolfBoneArrow, Constants.FLETCHING);
c.getItemAssistant().deleteItem(2861, wolfBoneArrow);
c.getItemAssistant().deleteItem(2865, wolfBoneArrow);
c.getPacketSender().sendMessage("You turn your " + DeprecatedItems.getItemName(2865) + " (s) into " + DeprecatedItems.getItemName(2866) + "(s).");
@@ -377,7 +377,7 @@ public class LogCutting {
c.startAnimation(1248);
c.getItemAssistant().deleteItem(2862, amount);
c.getItemAssistant().addItem(2864, makeAmount);
c.getPlayerAssistant().addSkillXP(2 * amount, GameConstants.FLETCHING);
c.getPlayerAssistant().addSkillXP(2 * amount, Constants.FLETCHING);
c.getPacketSender().sendMessage("You turn your " + DeprecatedItems.getItemName(2862) + " (s) into " + DeprecatedItems.getItemName(2864) + "(s).");
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.fletching;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -74,7 +74,7 @@ public class Stringing {
if (loadData == null) {
return false;
}
if (player.playerLevel[GameConstants.FLETCHING] < loadData.getLevel()) {
if (player.playerLevel[Constants.FLETCHING] < loadData.getLevel()) {
player.getDialogueHandler().sendStatement("You need a fletching level of " + loadData.getLevel() + " to do this");
return false;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.fletching;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -71,7 +71,7 @@ public class TipMaking {
if (itemData == null) {
return false;
}
if (player.playerLevel[GameConstants.FLETCHING] < itemData.getLevel()) {
if (player.playerLevel[Constants.FLETCHING] < itemData.getLevel()) {
player.getDialogueHandler().sendStatement(
"You need a fletching level of " + itemData.getLevel()
+ " to do this");
@@ -113,7 +113,7 @@ public class TipMaking {
+ itemData.getQuantity()
+ " "
+ DeprecatedItems.getItemName(itemData.getProduct()) + ".");
player.getPlayerAssistant().addSkillXP(itemData.getQuantity() * itemData.getXp(), GameConstants.FLETCHING);
player.getPlayerAssistant().addSkillXP(itemData.getQuantity() * itemData.getXp(), Constants.FLETCHING);
}
@Override
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.herblore;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
@@ -40,7 +40,7 @@ public class GrindingAction {
player.getItemAssistant().deleteItem(d.getId(), 1);
player.getItemAssistant().addItem(d.getEnd(), 1);
player.getPacketSender().sendMessage("You carefully grind the " + DeprecatedItems.getItemName(d.getId()) + ".");
player.getPlayerAssistant().addSkillXP(1, GameConstants.HERBLORE);
player.getPlayerAssistant().addSkillXP(1, Constants.HERBLORE);
}
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.herblore;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -28,7 +28,7 @@ public class Herblore extends SkillHandler {
final int itemSlot) {
for (int[] element : CLEAN_DATA) {
if (itemId == element[0]) {
if (c.playerLevel[GameConstants.HERBLORE] < element[2]) {
if (c.playerLevel[Constants.HERBLORE] < element[2]) {
c.getPacketSender().sendMessage("You need a higher herblore level to clean this herb.");
return;
}
@@ -66,7 +66,7 @@ public class Herblore extends SkillHandler {
for (int[] element : POTION_DATA) {
if (useItem == element[0] && itemUsed == element[1]
|| useItem == element[1] && itemUsed == element[0]) {
if (c.playerLevel[GameConstants.HERBLORE] < element[3]) {
if (c.playerLevel[Constants.HERBLORE] < element[3]) {
c.getPacketSender().sendMessage("You need an herblore level of " + element[3] + " to mix this potion.");
return;
}
@@ -81,14 +81,14 @@ public class Herblore extends SkillHandler {
}
public static void makePotion(final Player c, int amount) {
if (c.playerSkilling[GameConstants.HERBLORE]) {
if (c.playerSkilling[Constants.HERBLORE]) {
return;
}
if (itemToDelete <= 0 || itemToDelete2 <= 0) {
return;
}
c.doAmount = amount;
c.playerSkilling[GameConstants.HERBLORE] = true;
c.playerSkilling[Constants.HERBLORE] = true;
c.getPacketSender().closeAllWindows();
c.startAnimation(ANIM);
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@@ -99,7 +99,7 @@ public class Herblore extends SkillHandler {
c.getItemAssistant().deleteItem(itemToDelete2, c.getItemAssistant().getItemSlot(itemToDelete2), 1);
c.getItemAssistant().addItem(itemToAdd, 1);
c.getPacketSender().sendMessage("You make a " + DeprecatedItems.getItemName(itemToAdd).toLowerCase() + ".");
c.getPlayerAssistant().addSkillXP(potExp, GameConstants.HERBLORE);
c.getPlayerAssistant().addSkillXP(potExp, Constants.HERBLORE);
deleteTime(c);
if (!c.getItemAssistant().playerHasItem(itemToDelete2, 1) || !c.getItemAssistant().playerHasItem(itemToDelete, 1) || c.doAmount <= 0) {
container.stop();
@@ -119,7 +119,7 @@ public class Herblore extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
c.startAnimation(ANIM);
if (!c.playerSkilling[GameConstants.HERBLORE] || !c.isPotionMaking) {
if (!c.playerSkilling[Constants.HERBLORE] || !c.isPotionMaking) {
container.stop();
}
}
@@ -137,7 +137,7 @@ public class Herblore extends SkillHandler {
potExp = -1;
player.isGrinding = false;
player.isPotionMaking = false;
player.playerSkilling[GameConstants.HERBLORE] = false;
player.playerSkilling[Constants.HERBLORE] = false;
}
public static boolean isHerb(int item) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.prayer;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -182,7 +182,7 @@ public class Ectofuntus {
player.getItemAssistant().replaceItem(ectofuntus.getBonemealId(), 1931);
player.getItemAssistant().replaceItem(BUCKET_OF_SLIME, 1925);// Bucket
player.startAnimation(WORSHIP);
player.getPlayerAssistant().addSkillXP(ectofuntus.getWorshipExperience(), GameConstants.PRAYER);
player.getPlayerAssistant().addSkillXP(ectofuntus.getWorshipExperience(), Constants.PRAYER);
player.getPacketSender().sendMessage("You pray to the ectofuntus.");
player.ectofuntusWorshipped++;
if (player.isMoving || !player.getItemAssistant().playerHasItem(ectofuntus.getBonemealId()) || !player.getItemAssistant().playerHasItem(BUCKET_OF_SLIME)) {
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.runecrafting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.content.randomevents.RandomEventHandler;
import com.rs2.game.content.skills.SkillHandler;
@@ -155,7 +155,7 @@ public class Runecrafting {
c.getPacketSender().sendMessage("This skill is currently disabled.");
return false;
}
if (c.playerLevel[GameConstants.RUNECRAFTING] >= ad.levelReq) {
if (c.playerLevel[Constants.RUNECRAFTING] >= ad.levelReq) {
getMultiSupport(obj);
c.startAnimation(791);
c.gfx100(186);
@@ -174,18 +174,18 @@ public class Runecrafting {
if (amount2 > 0 && amount > 0) {
c.getItemAssistant().deleteItem(7936, c.getItemAssistant().getItemAmount(7936));
c.getItemAssistant().addItem(ad.rewardedRune, amount * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount, GameConstants.RUNECRAFTING);
c.getPlayerAssistant().addSkillXP(ad.xp * amount, Constants.RUNECRAFTING);
c.getItemAssistant().deleteItem(1436, c.getItemAssistant().getItemAmount(1436));
c.getItemAssistant().addItem(ad.rewardedRune, amount2 * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, GameConstants.RUNECRAFTING);
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, Constants.RUNECRAFTING);
} else if (amount > 0) {
c.getItemAssistant().deleteItem(7936, c.getItemAssistant().getItemAmount(7936));
c.getItemAssistant().addItem(ad.rewardedRune, amount * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount, GameConstants.RUNECRAFTING);
c.getPlayerAssistant().addSkillXP(ad.xp * amount, Constants.RUNECRAFTING);
} else if (amount2 > 0) {
c.getItemAssistant().deleteItem(1436, c.getItemAssistant().getItemAmount(1436));
c.getItemAssistant().addItem(ad.rewardedRune, amount2 * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, GameConstants.RUNECRAFTING);
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, Constants.RUNECRAFTING);
} else {
c.getPacketSender().sendMessage("You don't have any essence left.");
}
@@ -196,7 +196,7 @@ public class Runecrafting {
int temp = 1;
for (int[] multiRune : ad.multiRunes) {
for (int j = 0; j < multiRune.length; j++) {
if (c.playerLevel[GameConstants.RUNECRAFTING] >= multiRune[0]) {
if (c.playerLevel[Constants.RUNECRAFTING] >= multiRune[0]) {
temp++;
}
}
@@ -2,7 +2,7 @@ package com.rs2.game.content.skills.slayer;
import java.util.ArrayList;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.npcs.NpcHandler;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -165,7 +165,7 @@ public class Slayer {
}
public boolean canAttackNpc(int i) {
if (c.playerLevel[GameConstants.SLAYER] < getRequiredLevel(NpcHandler.npcs[i].npcType)) {
if (c.playerLevel[Constants.SLAYER] < getRequiredLevel(NpcHandler.npcs[i].npcType)) {
c.getPacketSender().sendMessage("You need a slayer level of " + getRequiredLevel(NpcHandler.npcs[i].npcType) + " to attack this npc.");
c.getCombatAssistant().resetPlayerAttack();
return false;
@@ -184,27 +184,27 @@ public class Slayer {
}
for (Task slayerTask : Task.values()) {
if (slayerTask.getDifficulty() == EASY_TASK) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
easyTask.add(slayerTask.getNpcId());
}
continue;
} else if (slayerTask.getDifficulty() == VERY_EASY_TASK) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
veryEasyTask.add(slayerTask.getNpcId());
}
continue;
} else if (slayerTask.getDifficulty() == MEDIUM_TASK) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
mediumTask.add(slayerTask.getNpcId());
}
continue;
} else if (slayerTask.getDifficulty() == HARD_TASK) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
hardTask.add(slayerTask.getNpcId());
}
continue;
} else if (slayerTask.getDifficulty() == VERY_HARD_TASK) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
veryHardTask.add(slayerTask.getNpcId());
}
continue;
@@ -335,7 +335,7 @@ public class Slayer {
int taskLevel = getSlayerDifficulty(c);
for (Task slayerTask : Task.values()) {
if (slayerTask.getDifficulty() == taskLevel) {
if (c.playerLevel[GameConstants.SLAYER] >= slayerTask.getLevelReq()) {
if (c.playerLevel[Constants.SLAYER] >= slayerTask.getLevelReq()) {
resizeTable(taskLevel);
if (!c.needsNewTask) {
int task = getRandomTask(taskLevel);
@@ -2,7 +2,7 @@ package com.rs2.game.content.skills.smithing;
import java.util.HashMap;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -98,7 +98,7 @@ public class SilverCrafting {
player.getDialogueHandler().sendStatement("You need a silver bar to do this.");
return;
}
if (player.playerLevel[GameConstants.CRAFTING] < silverCraft.getLevel()) {
if (player.playerLevel[Constants.CRAFTING] < silverCraft.getLevel()) {
player.getDialogueHandler().sendStatement("You need a crafting level of " + silverCraft.getLevel() + " to make this.");
return;
}
@@ -131,7 +131,7 @@ public class SilverCrafting {
player.getItemAssistant().addItem(silverCraft.getResult(),
1);
player.getPlayerAssistant().addSkillXP(
silverCraft.getExperience(), GameConstants.CRAFTING);
silverCraft.getExperience(), Constants.CRAFTING);
amnt--;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.smithing;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -75,7 +75,7 @@ public class Smelting extends SkillHandler {
for (int i = 0; i < data.length; i++) {
if (bartype == data[i][0]) {
// Check player has the correct smithing level
if (c.playerLevel[GameConstants.SMITHING] < data[i][1]) { // Smithing level
if (c.playerLevel[Constants.SMITHING] < data[i][1]) { // Smithing level
c.getDialogueHandler().sendStatement("You need a smithing level of at least "+ data[i][1] + " in order smelt this bar.");
return;
}
@@ -95,20 +95,20 @@ public class Smelting extends SkillHandler {
}
}
if (c.playerSkilling[GameConstants.SMITHING]) {
if (c.playerSkilling[Constants.SMITHING]) {
return;
}
c.playerSkilling[GameConstants.SMITHING] = true;
c.playerSkilling[Constants.SMITHING] = true;
c.stopPlayerSkill = true;
c.playerSkillProp[GameConstants.SMITHING][0] = data[i][0];// index
c.playerSkillProp[GameConstants.SMITHING][1] = data[i][1];// Level required
c.playerSkillProp[GameConstants.SMITHING][2] = data[i][2];// XP
c.playerSkillProp[GameConstants.SMITHING][3] = data[i][3];// primary item required
c.playerSkillProp[GameConstants.SMITHING][4] = data[i][4];// secondary item required
c.playerSkillProp[GameConstants.SMITHING][5] = data[i][5];// secondary item amount
c.playerSkillProp[GameConstants.SMITHING][6] = data[i][6];// output item
c.playerSkillProp[Constants.SMITHING][0] = data[i][0];// index
c.playerSkillProp[Constants.SMITHING][1] = data[i][1];// Level required
c.playerSkillProp[Constants.SMITHING][2] = data[i][2];// XP
c.playerSkillProp[Constants.SMITHING][3] = data[i][3];// primary item required
c.playerSkillProp[Constants.SMITHING][4] = data[i][4];// secondary item required
c.playerSkillProp[Constants.SMITHING][5] = data[i][5];// secondary item amount
c.playerSkillProp[Constants.SMITHING][6] = data[i][6];// output item
c.getPacketSender().closeAllWindows();
c.startAnimation(899);
@@ -119,36 +119,36 @@ public class Smelting extends SkillHandler {
public void execute(CycleEventContainer container) {
deleteTime(c);
// Remove primary item
c.getItemAssistant().deleteItem(c.playerSkillProp[GameConstants.SMITHING][3], 1);
c.getItemAssistant().deleteItem(c.playerSkillProp[Constants.SMITHING][3], 1);
// Check if required and remove secondary items
if (c.playerSkillProp[GameConstants.SMITHING][4] > 0 && c.playerSkillProp[GameConstants.SMITHING][5] > 0) {
c.getItemAssistant().deleteItem(c.playerSkillProp[GameConstants.SMITHING][4], c.playerSkillProp[GameConstants.SMITHING][5]);
if (c.playerSkillProp[Constants.SMITHING][4] > 0 && c.playerSkillProp[Constants.SMITHING][5] > 0) {
c.getItemAssistant().deleteItem(c.playerSkillProp[Constants.SMITHING][4], c.playerSkillProp[Constants.SMITHING][5]);
}
if (c.playerSkillProp[GameConstants.SMITHING][3] == IRON && c.playerSkillProp[GameConstants.SMITHING][4] == -1 && c.isSmelting) {
if (c.playerSkillProp[Constants.SMITHING][3] == IRON && c.playerSkillProp[Constants.SMITHING][4] == -1 && c.isSmelting) {
// Ring of forging
if (c.playerEquipment[c.playerRing] == 2568) {
c.getPacketSender().sendMessage("You receive an " + DeprecatedItems.getItemName(c.playerSkillProp[GameConstants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[GameConstants.SMITHING][2], GameConstants.SMITHING);
c.getPacketSender().sendMessage("You receive an " + DeprecatedItems.getItemName(c.playerSkillProp[Constants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[Constants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[Constants.SMITHING][2], Constants.SMITHING);
} else {
if (Misc.random(100) >= 50) {
c.getPacketSender().sendMessage("You receive an " + DeprecatedItems.getItemName(c.playerSkillProp[GameConstants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[GameConstants.SMITHING][2], GameConstants.SMITHING);
c.getPacketSender().sendMessage("You receive an " + DeprecatedItems.getItemName(c.playerSkillProp[Constants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[Constants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[Constants.SMITHING][2], Constants.SMITHING);
} else {
c.getPacketSender().sendMessage("You failed to smelt the iron bar.");
}
}
} else if (c.playerSkillProp[GameConstants.SMITHING][3] == GOLD && c.playerEquipment[c.playerHands] == 776 && c.isSmelting) {
c.getPacketSender().sendMessage("You receive a " + DeprecatedItems.getItemName(c.playerSkillProp[GameConstants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(56.2, GameConstants.SMITHING);
} else if (c.playerSkillProp[Constants.SMITHING][3] == GOLD && c.playerEquipment[c.playerHands] == 776 && c.isSmelting) {
c.getPacketSender().sendMessage("You receive a " + DeprecatedItems.getItemName(c.playerSkillProp[Constants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[Constants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(56.2, Constants.SMITHING);
} else if (c.isSmelting){
c.getPacketSender().sendMessage("You receive a " + DeprecatedItems.getItemName(c.playerSkillProp[GameConstants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[GameConstants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[GameConstants.SMITHING][2], GameConstants.SMITHING);
c.getPacketSender().sendMessage("You receive a " + DeprecatedItems.getItemName(c.playerSkillProp[Constants.SMITHING][6]).toLowerCase() + ".");
c.getItemAssistant().addItem(c.playerSkillProp[Constants.SMITHING][6], 1);// item
c.getPlayerAssistant().addSkillXP(c.playerSkillProp[Constants.SMITHING][2], Constants.SMITHING);
}
////////////////////// CHECKING //////////////////////
@@ -156,7 +156,7 @@ public class Smelting extends SkillHandler {
resetSmelting(c);
container.stop();
}
if (!c.playerSkilling[GameConstants.SMITHING]) {
if (!c.playerSkilling[Constants.SMITHING]) {
resetSmelting(c);
container.stop();
}
@@ -164,13 +164,13 @@ public class Smelting extends SkillHandler {
resetSmelting(c);
container.stop();
}
if (!c.getItemAssistant().playerHasItem(c.playerSkillProp[GameConstants.SMITHING][3], 1)) {
if (!c.getItemAssistant().playerHasItem(c.playerSkillProp[Constants.SMITHING][3], 1)) {
c.getPacketSender().sendMessage("You don't have enough ores to continue smelting!");
resetSmelting(c);
container.stop();
}
if (c.playerSkillProp[GameConstants.SMITHING][4] > 0) {
if (!c.getItemAssistant().playerHasItem(c.playerSkillProp[GameConstants.SMITHING][4], c.playerSkillProp[GameConstants.SMITHING][5])) {
if (c.playerSkillProp[Constants.SMITHING][4] > 0) {
if (!c.getItemAssistant().playerHasItem(c.playerSkillProp[Constants.SMITHING][4], c.playerSkillProp[Constants.SMITHING][5])) {
c.getPacketSender().sendMessage("You don't have enough ores to continue smelting!");
resetSmelting(c);
container.stop();
@@ -189,7 +189,7 @@ public class Smelting extends SkillHandler {
@Override
public void execute(CycleEventContainer container) {
if (!c.playerSkilling[GameConstants.SMITHING]) {
if (!c.playerSkilling[Constants.SMITHING]) {
resetSmelting(c);
container.stop();
return;
@@ -327,11 +327,11 @@ public class Smelting extends SkillHandler {
* Resets Smelting
*/
public static void resetSmelting(Player player) {
player.playerSkilling[GameConstants.SMITHING] = false;
player.playerSkilling[Constants.SMITHING] = false;
player.stopPlayerSkill = false;
player.isSmelting = false;
for (int i = 0; i < 7; i++) {
player.playerSkillProp[GameConstants.SMITHING][i] = -1;
player.playerSkillProp[Constants.SMITHING][i] = -1;
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.smithing;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -35,7 +35,7 @@ public class Smithing {
private void checkBar(Player player, int level, int amountToMake, int type) {
SmithingData item = SmithingData.forId(type);
if (item != null) {
if (player.playerLevel[GameConstants.SMITHING] >= item.getLvl()) {
if (player.playerLevel[Constants.SMITHING] >= item.getLvl()) {
if (type == item.getId()) {
addItem = item.getId();
removeAmount = item.getAmount();
@@ -92,7 +92,7 @@ public class Smithing {
} else {
player.getItemAssistant().addItem(addItem, 1);
}
player.getPlayerAssistant().addSkillXP(XP, GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(XP, Constants.SMITHING);
player.doAmount--;
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.smithing;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.players.Player;
public class SmithingInterface {
@@ -667,7 +667,7 @@ public class SmithingInterface {
}
private String GetForlvl(int i, Player c) {
if (c.playerLevel[GameConstants.SMITHING] >= i) {
if (c.playerLevel[Constants.SMITHING] >= i) {
return "@whi@";
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.smithing;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.combat.magic.CastRequirements;
import com.rs2.game.content.music.sound.SoundList;
import com.rs2.game.items.DeprecatedItems;
@@ -40,15 +40,15 @@ public class Superheat {
return false;
}
if (itemID == 444 && player.playerEquipment[player.playerHands] == 776) {
player.getPlayerAssistant().addSkillXP(56.2, GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(56.2, Constants.SMITHING);
} else {
player.getPlayerAssistant().addSkillXP(smelt[7], GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(smelt[7], Constants.SMITHING);
}
if (player.playerLevel[GameConstants.SMITHING] < smelt[6]) {
if (player.playerLevel[Constants.SMITHING] < smelt[6]) {
player.getPacketSender().sendMessage("You need a smithing level of " + smelt[6] + " to superheat this ore.");
return false;
}
if (player.playerLevel[GameConstants.MAGIC] < 43) {
if (player.playerLevel[Constants.MAGIC] < 43) {
player.getPacketSender().sendMessage("You need a magic level of 43 to superheat this ore.");
return false;
}
@@ -56,12 +56,12 @@ public class Superheat {
player.getItemAssistant().deleteItem(smelt[2], smelt[3]);
CastRequirements.deleteRunes(player, new int[][]{{554, 4}, {561, 1}});
player.getItemAssistant().addItem(smelt[4], 1);
player.getPlayerAssistant().addSkillXP(53, GameConstants.MAGIC);
player.getPlayerAssistant().addSkillXP(53, Constants.MAGIC);
player.startAnimation(722);
player.gfx0(148);
player.getPacketSender().sendSound(SoundList.SUPERHEAT, 100, 0);
if (itemID != 444) {
player.getPlayerAssistant().addSkillXP(smelt[7], GameConstants.SMITHING);
player.getPlayerAssistant().addSkillXP(smelt[7], Constants.SMITHING);
}
player.getPacketSender().sendShowTab(6);
return true;
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.thieving;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -222,13 +222,13 @@ public class Pickpocket extends SkillHandler {
}
for (final npcData n : npcData.values()) {
if (npcId == n.getNpc(npcId)) {
if (player.playerLevel[GameConstants.THIEVING] < n.getLevel()) {
if (player.playerLevel[Constants.THIEVING] < n.getLevel()) {
player.getDialogueHandler().sendStatement("You need a Thieving level of " + n.getLevel() + " to pickpocket the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + ".");
return;
}
player.getPacketSender().sendMessage("You attempt to pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.");
player.startAnimation(881);
if (Misc.random(player.playerLevel[GameConstants.THIEVING] + 5) < Misc.random(n.getLevel())) {
if (Misc.random(player.playerLevel[Constants.THIEVING] + 5) < Misc.random(n.getLevel())) {
RandomEventHandler.addRandom(player);
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@Override
@@ -240,8 +240,8 @@ public class Pickpocket extends SkillHandler {
player.playerStun = true;
player.setHitDiff(n.getDamage());
player.setHitUpdateRequired(true);
player.playerLevel[GameConstants.HITPOINTS] -= n.getDamage();
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.playerLevel[Constants.HITPOINTS] -= n.getDamage();
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.gfx100(80);
player.startAnimation(404);
player.getPacketSender().sendSound(SoundList.STUNNED, 100, 0);
@@ -290,7 +290,7 @@ public class Pickpocket extends SkillHandler {
public void execute(CycleEventContainer container) {
player.getPacketSender().sendMessage(message2);
player.getPlayerAssistant().addSkillXP((int) n.getXp(),
GameConstants.THIEVING);
Constants.THIEVING);
int[] random = n.getPickPockets()[Misc.random(n.getPickPockets().length - 1)];
player.getItemAssistant().addItem(random[0], random[1] + (random.length > 2 ? Misc.random(random[2]) : 0));
container.stop();
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.thieving;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -66,14 +66,14 @@ public class SearchForTraps {
if (ThieveOther.thievingEnabled(client)) {
for (final chestsWithTraps chest : chestsWithTraps.values()) {
if (chest.getChestId() == chestId) {
if (client.playerLevel[GameConstants.THIEVING] < chest.getLevelReq()) {
if (client.playerLevel[Constants.THIEVING] < chest.getLevelReq()) {
client.getDialogueHandler().sendStatement("You must have a thieving level of " + chest.getLevelReq() + " to steal from this chest.");
return;
}
if (System.currentTimeMillis() < chest.resetTime) {
long timeFirstSearchForTraps = chest.resetTime - (GameConstants.CYCLE_TIME * getChestResetTime(chest.getChestId()));
if (client.hasSearchedForTraps() || System.currentTimeMillis() - timeFirstSearchForTraps >= GameConstants.CYCLE_TIME) {
long timeFirstSearchForTraps = chest.resetTime - (Constants.CYCLE_TIME * getChestResetTime(chest.getChestId()));
if (client.hasSearchedForTraps() || System.currentTimeMillis() - timeFirstSearchForTraps >= Constants.CYCLE_TIME) {
client.getPacketSender().sendMessage("This chest has already been looted");
return;
}
@@ -85,8 +85,8 @@ public class SearchForTraps {
int resetTime = getChestResetTime(chest.getChestId());
client.getPacketSender().sendMessage("You find a trap on the chest...");
client.getPacketSender().sendMessage("You disable the trap");
client.getPlayerAssistant().addSkillXP((int) chest.getXp(), GameConstants.THIEVING);
chest.resetTime = System.currentTimeMillis() + (resetTime * GameConstants.CYCLE_TIME);
client.getPlayerAssistant().addSkillXP((int) chest.getXp(), Constants.THIEVING);
chest.resetTime = System.currentTimeMillis() + (resetTime * Constants.CYCLE_TIME);
client.getPacketSender().sendMessage("You open the chest");
client.startAnimation(536);
@@ -1,8 +1,8 @@
package com.rs2.game.content.skills.thieving;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -131,21 +131,21 @@ public class Stalls {
if(objectId == s.getObject()) {
// Wait for respawn
if (System.currentTimeMillis() < s.respawnTime) {
long timeFirstStealFromStall = s.respawnTime - (GameConstants.CYCLE_TIME * getRespawnTime(s.objectId));
long timeFirstStealFromStall = s.respawnTime - (Constants.CYCLE_TIME * getRespawnTime(s.objectId));
// If stealing from stall at the same tick as another player
if(p.hasThievedStall() || System.currentTimeMillis() - timeFirstStealFromStall >= GameConstants.CYCLE_TIME) {
if(p.hasThievedStall() || System.currentTimeMillis() - timeFirstStealFromStall >= Constants.CYCLE_TIME) {
p.getPacketSender().sendMessage("You need to wait longer before you can thieve this stall!");
return;
}
}
// Thieving level too low
if (p.playerLevel[GameConstants.THIEVING] < s.getLevel()) {
if (p.playerLevel[Constants.THIEVING] < s.getLevel()) {
p.getDialogueHandler().sendStatement("You must have a thieving level of " + s.getLevel() + " to steal from this stall.");
return;
}
// Failed, was caught red handed
if(Misc.random(4) == 1 && p.playerLevel[GameConstants.THIEVING] < 99) {
if(Misc.random(4) == 1 && p.playerLevel[Constants.THIEVING] < 99) {
failGuards(p);
return;
}
@@ -153,9 +153,9 @@ public class Stalls {
RandomEventHandler.addRandom(p);
int respawnTime = getRespawnTime(s.getObject());
GameEngine.objectHandler.createAnObject(p, 634, x, y, 0, getSpecialFace(p, s));
p.getPlayerAssistant().addSkillXP((int) s.getXp(), GameConstants.THIEVING);
p.getPlayerAssistant().addSkillXP((int) s.getXp(), Constants.THIEVING);
int[] random = s.getStalls()[Misc.random(s.getStalls().length-1)];
s.respawnTime = System.currentTimeMillis() + (respawnTime * GameConstants.CYCLE_TIME);
s.respawnTime = System.currentTimeMillis() + (respawnTime * Constants.CYCLE_TIME);
p.getPacketSender().sendMessage("You steal a " + ItemDefinition.lookup(random[0]).getName() + " from the stall.");
p.getItemAssistant().addItem(random[0], random[1]);
p.setHasThievedStall(true);
@@ -1,11 +1,10 @@
package com.rs2.game.content.skills.thieving;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
import com.rs2.game.content.skills.SkillHandler;
import com.rs2.game.items.ItemAssistant;
import com.rs2.game.players.Player;
import com.rs2.util.Misc;
@@ -55,7 +54,7 @@ public class ThieveOther {
}
client.getPlayerAssistant().movePlayer(x, y, client.heightLevel);
client.getPacketSender().sendMessage("You manage to pick the lock.");
client.getPlayerAssistant().addSkillXP(exp, GameConstants.THIEVING);
client.getPlayerAssistant().addSkillXP(exp, Constants.THIEVING);
container.stop();
}
@Override
@@ -67,7 +66,7 @@ public class ThieveOther {
}
public static boolean playerHasRequiredThievingLevel(final Player client, int level) {
if (client.playerLevel[GameConstants.THIEVING] < level) {
if (client.playerLevel[Constants.THIEVING] < level) {
client.getPacketSender().sendMessage("You need " + level + " thieving to thieve this chest.");
return false;
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.skills.woodcutting;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -127,7 +127,7 @@ public class Woodcutting {
public static void handleCanoe(final Player player, final int objectId) {
Boolean gotAxe = false;
if (player.playerLevel[GameConstants.WOODCUTTING] < 12) {
if (player.playerLevel[Constants.WOODCUTTING] < 12) {
player.getPacketSender().sendMessage("You need a woodcutting level of at least 12 to use the canoe station.");
return;
}
@@ -148,7 +148,7 @@ public class Woodcutting {
int type = axes[0];
int level = axes[1];
int anim = axes[3];
if (player.playerLevel[GameConstants.WOODCUTTING] >= level && player.getItemAssistant().playerHasItem(type) || player.playerLevel[GameConstants.WOODCUTTING] >= level && player.playerEquipment[player.playerWeapon] == type) {
if (player.playerLevel[Constants.WOODCUTTING] >= level && player.getItemAssistant().playerHasItem(type) || player.playerLevel[Constants.WOODCUTTING] >= level && player.playerEquipment[player.playerWeapon] == type) {
player.turnPlayerTo(player.objectX, player.objectY);
player.startAnimation(anim);
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@@ -240,7 +240,7 @@ public class Woodcutting {
p.getPacketSender().sendMessage("This skill is currently disabled.");
return;
}
int wcLevel = p.playerLevel[GameConstants.WOODCUTTING];
int wcLevel = p.playerLevel[Constants.WOODCUTTING];
p.woodcuttingAxe = -1;
treeData tree = treeData.getTree(objectId);
p.turnPlayerTo(x, y);
@@ -1,6 +1,6 @@
package com.rs2.game.content.traveling;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -65,7 +65,7 @@ public class DesertCactus {
int fail = Misc.random(2);
if (fail == 1) {
c.getPacketSender().sendMessage("You failed to cut the cactus.");
c.getPlayerAssistant().addSkillXP(1, GameConstants.WOODCUTTING);
c.getPlayerAssistant().addSkillXP(1, Constants.WOODCUTTING);
return;
}
c.startAnimation(CUTTING_ANIMATION);
@@ -75,7 +75,7 @@ public class DesertCactus {
if (c.getItemAssistant().playerHasItem(element[0])) {
c.getItemAssistant().deleteItem(element[0], c.getItemAssistant().getItemSlot(element[0]), 1);
c.getItemAssistant().addItem(element[1], 1);
c.getPlayerAssistant().addSkillXP(10, GameConstants.WOODCUTTING);
c.getPlayerAssistant().addSkillXP(10, Constants.WOODCUTTING);
}
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.content.traveling;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -52,7 +52,7 @@ public class DesertHeat {
player.getPacketSender().sendMessage("You should get a waterskin for any traveling in the desert.");
player.handleHitMask(DAMAGE);
player.dealDamage(DAMAGE);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
private static int getClothes(Player player) {
@@ -79,7 +79,7 @@ public class DesertHeat {
public static void callHeat(final Player player) {
if (!Boundary.isIn(player, Boundary.DESERT)
|| player.playerLevel[GameConstants.HITPOINTS] <= 0
|| player.playerLevel[Constants.HITPOINTS] <= 0
|| preventHeat(player)) {
return;
}
@@ -87,7 +87,7 @@ public class DesertHeat {
@Override
public void execute(CycleEventContainer container) {
if (!Boundary.isIn(player, Boundary.DESERT)
|| player.playerLevel[GameConstants.HITPOINTS] <= 0
|| player.playerLevel[Constants.HITPOINTS] <= 0
|| player.disconnected
|| preventHeat(player)) {
container.stop();
@@ -99,7 +99,7 @@ public class DesertHeat {
doDamage(player);
}
container.stop();
} else if (player.playerLevel[GameConstants.HITPOINTS] <= 0) {
} else if (player.playerLevel[Constants.HITPOINTS] <= 0) {
player.isDead = true;
container.stop();
}
@@ -1,6 +1,6 @@
package com.rs2.game.dialogues;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.game.bots.Bot;
import com.rs2.game.bots.BotHandler;
@@ -157,7 +157,7 @@ public class DialogueHandler {
case 14: // lumby guide
sendNpcChat1(
"Greetings, welcome to " + GameConstants.SERVER_NAME + ".",
"Greetings, welcome to " + Constants.SERVER_NAME + ".",
player.talkingNpc, "Lumbridge Guide");
player.nextChat = 0;
break;
@@ -3962,7 +3962,7 @@ public class DialogueHandler {
player.nextChat = 1016;
break;
case 1016:
sendNpcChat2("This is the bank of " + GameConstants.SERVER_NAME + ".", "We have many branches in many towns.", player.talkingNpc, "Banker");
sendNpcChat2("This is the bank of " + Constants.SERVER_NAME + ".", "We have many branches in many towns.", player.talkingNpc, "Banker");
player.nextChat = 0;
break;
/**
@@ -5023,7 +5023,7 @@ public class DialogueHandler {
chatboxText(
"To start the tutorial use your left mouse button to click on the",
"" + GameConstants.SERVER_NAME
"" + Constants.SERVER_NAME
+ " in this room. He is indicated by a flashing",
"yellow arrow above his head. If you can't see him, use your",
"keyboard's arrow keys to rotate the view.",
@@ -5783,7 +5783,7 @@ public class DialogueHandler {
chatboxText(
"Follow the path and you will come to the front of the building.",
"This is the Bank of " + GameConstants.SERVER_NAME
"This is the Bank of " + Constants.SERVER_NAME
+ ", where you can store all your",
"most valued items. To open your bank box just right click on an",
"open booth indicated and select 'use'.", "Banking");
@@ -5837,7 +5837,7 @@ public class DialogueHandler {
case 3085:
sendNpcChat3(
"Now, the next way to earn money quickly is by quests.",
"Many people on " + GameConstants.SERVER_NAME
"Many people on " + Constants.SERVER_NAME
+ " have things they need",
"doing, which they will reward you for.",
player.talkingNpc, "Financial Advisor");
@@ -6117,7 +6117,7 @@ public class DialogueHandler {
case 3114:
sendNpcChat3(
"If all else fails, visit the " + GameConstants.SERVER_NAME
"If all else fails, visit the " + Constants.SERVER_NAME
+ " website for a whole",
"chestload of information on quests, skills, and minigames",
"as well as a very good starter's guide.",
@@ -6137,7 +6137,7 @@ public class DialogueHandler {
break;
case 3116:
if(GameConstants.VARIABLE_XP_RATE) {
if(Constants.VARIABLE_XP_RATE) {
player.getDialogueHandler().sendDialogues(10001, -1);
} else {
player.getPacketSender().showInterface(3559);
@@ -7603,7 +7603,7 @@ public class DialogueHandler {
player.nextChat = 10002;
break;
case 10002:
sendOption("x" + GameConstants.VARIABLE_XP_RATES[0], "x" + GameConstants.VARIABLE_XP_RATES[1], "x" + GameConstants.VARIABLE_XP_RATES[2], "x" + GameConstants.VARIABLE_XP_RATES[3]);
sendOption("x" + Constants.VARIABLE_XP_RATES[0], "x" + Constants.VARIABLE_XP_RATES[1], "x" + Constants.VARIABLE_XP_RATES[2], "x" + Constants.VARIABLE_XP_RATES[3]);
player.dialogueAction = 10002;
break;
case 10003:
@@ -7615,15 +7615,15 @@ public class DialogueHandler {
player.dialogueAction = 10004;
break;
case 10005:
sendOption("x" + GameConstants.VARIABLE_XP_RATES[1], "x" + GameConstants.VARIABLE_XP_RATES[2], "x" + GameConstants.VARIABLE_XP_RATES[3]);
sendOption("x" + Constants.VARIABLE_XP_RATES[1], "x" + Constants.VARIABLE_XP_RATES[2], "x" + Constants.VARIABLE_XP_RATES[3]);
player.dialogueAction = 10005;
break;
case 10006:
sendOption("x" + GameConstants.VARIABLE_XP_RATES[2], "x" + GameConstants.VARIABLE_XP_RATES[3]);
sendOption("x" + Constants.VARIABLE_XP_RATES[2], "x" + Constants.VARIABLE_XP_RATES[3]);
player.dialogueAction = 10006;
break;
case 10007:
sendOption("x" + GameConstants.VARIABLE_XP_RATES[3], "Don't Change");
sendOption("x" + Constants.VARIABLE_XP_RATES[3], "Don't Change");
player.dialogueAction = 10007;
break;
}
@@ -1,6 +1,6 @@
package com.rs2.game.dialogues;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.bots.Bot;
import com.rs2.game.bots.BotHandler;
import com.rs2.game.content.skills.crafting.JewelryMaking;
@@ -105,7 +105,7 @@ public class DialogueOptions {
BotHandler.playerShop(player);
return;
case 10005:
player.setXPRate(GameConstants.VARIABLE_XP_RATES[1]);
player.setXPRate(Constants.VARIABLE_XP_RATES[1]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you can increase your rate in the future by using");
player.getPacketSender().sendMessage("::xprate");
player.getPacketSender().closeAllWindows();
@@ -199,7 +199,7 @@ public class DialogueOptions {
BotHandler.closeShop(player);
return;
case 10005:
player.setXPRate(GameConstants.VARIABLE_XP_RATES[2]);
player.setXPRate(Constants.VARIABLE_XP_RATES[2]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you can increase your rate in the future by using");
player.getPacketSender().sendMessage("::xprate");
player.getPacketSender().closeAllWindows();
@@ -296,7 +296,7 @@ public class DialogueOptions {
BotHandler.takeCoins(player);
return;
case 10005:
player.setXPRate(GameConstants.VARIABLE_XP_RATES[3]);
player.setXPRate(Constants.VARIABLE_XP_RATES[3]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you now have the highest XP rate.");
player.getPacketSender().closeAllWindows();
return;
@@ -600,7 +600,7 @@ public class DialogueOptions {
player.getItemAssistant().addItem(1953, 1);
player.getItemAssistant().addItem(1925, 1);
player.getItemAssistant().addItem(1931, 1);
player.getPlayerAssistant().addSkillXP(1, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(1, Constants.COOKING);
player.nextChat = 0;
} else if (player.dialogueAction == 3205) {
player.getItemAssistant().deleteItem(1933, 1);
@@ -608,7 +608,7 @@ public class DialogueOptions {
player.getItemAssistant().addItem(1953, 1);
player.getItemAssistant().addItem(1925, 1);
player.getItemAssistant().addItem(1935, 1);
player.getPlayerAssistant().addSkillXP(1, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(1, Constants.COOKING);
player.nextChat = 0;
} else if (player.dialogueAction == 189) {
player.getDialogueHandler().sendDialogues(3210, player.npcType);
@@ -646,7 +646,7 @@ public class DialogueOptions {
player.canChangeAppearance = true;
player.closeTutorialInterface = true;
return;
} else if (player.getXPRate() != + GameConstants.VARIABLE_XP_RATES[3]) {
} else if (player.getXPRate() != + Constants.VARIABLE_XP_RATES[3]) {
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you can increase your rate in the future by using");
player.getPacketSender().sendMessage("::xprate");
return;
@@ -655,13 +655,13 @@ public class DialogueOptions {
return;
}
} else if(player.dialogueAction == 10006) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[2]);
player.setXPRate(Constants.VARIABLE_XP_RATES[2]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you can increase your rate in the future by using");
player.getPacketSender().sendMessage("::xprate");
player.getPacketSender().closeAllWindows();
return;
} else if(player.dialogueAction == 10007) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[3]);
player.setXPRate(Constants.VARIABLE_XP_RATES[3]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you now have the highest XP rate.");
player.getPacketSender().closeAllWindows();
return;
@@ -856,7 +856,7 @@ public class DialogueOptions {
player.getItemAssistant().addItem(2307, 1);
player.getItemAssistant().addItem(1925, 1);
player.getItemAssistant().addItem(1931, 1);
player.getPlayerAssistant().addSkillXP(1, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(1, Constants.COOKING);
player.nextChat = 0;
} else if (player.dialogueAction == 3205) {
player.getItemAssistant().deleteItem(1933, 1);
@@ -864,7 +864,7 @@ public class DialogueOptions {
player.getItemAssistant().addItem(1953, 1);
player.getItemAssistant().addItem(1925, 1);
player.getItemAssistant().addItem(1935, 1);
player.getPlayerAssistant().addSkillXP(1, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(1, Constants.COOKING);
player.nextChat = 0;
} else if (player.dialogueAction == 189) {
player.getDialogueHandler().sendDialogues(3212, player.npcType);
@@ -895,7 +895,7 @@ public class DialogueOptions {
player.getDialogueHandler().sendDialogues(10002, 2244);
return;
} else if(player.dialogueAction == 10006) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[3]);
player.setXPRate(Constants.VARIABLE_XP_RATES[3]);
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you now have the highest XP rate.");
player.getPacketSender().sendMessage("::xprate");
player.getPacketSender().closeAllWindows();
@@ -975,7 +975,7 @@ public class DialogueOptions {
player.getDialogueHandler().sendDialogues(3561, player.npcType);
}
if (player.dialogueAction == 10002) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[0]);
player.setXPRate(Constants.VARIABLE_XP_RATES[0]);
player.getDialogueHandler().sendDialogues(10003, player.npcType);
}
break;
@@ -1048,7 +1048,7 @@ public class DialogueOptions {
player.getDialogueHandler().sendDialogues(3562, player.npcType);
}
if (player.dialogueAction == 10002) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[1]);
player.setXPRate(Constants.VARIABLE_XP_RATES[1]);
player.getDialogueHandler().sendDialogues(10003, player.npcType);
}
break;
@@ -1124,7 +1124,7 @@ public class DialogueOptions {
player.getDialogueHandler().sendDialogues(3563, player.npcType);
}
if (player.dialogueAction == 10002) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[2]);
player.setXPRate(Constants.VARIABLE_XP_RATES[2]);
player.getDialogueHandler().sendDialogues(10003, player.npcType);
}
break;
@@ -1185,7 +1185,7 @@ public class DialogueOptions {
player.getDialogueHandler().sendDialogues(3564, player.npcType);
}
if (player.dialogueAction == 10002) {
player.setXPRate(GameConstants.VARIABLE_XP_RATES[3]);
player.setXPRate(Constants.VARIABLE_XP_RATES[3]);
player.getDialogueHandler().sendDialogues(10003, player.npcType);
}
break;
@@ -2,7 +2,6 @@ package com.rs2.game.items;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.game.players.Player;
@@ -1,8 +1,8 @@
package com.rs2.game.items;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.game.content.minigames.castlewars.CastleWars;
import com.rs2.game.content.skills.runecrafting.Tiaras;
@@ -494,11 +494,11 @@ public class ItemAssistant {
if (player.playerItems[i] == item + 1 && ItemDefinition.lookup(item).isStackable()
&& player.playerItems[i] > 0) {
player.playerItems[i] = item + 1;
if (player.playerItemsN[i] + amount < GameConstants.MAXITEM_AMOUNT
if (player.playerItemsN[i] + amount < Constants.MAXITEM_AMOUNT
&& player.playerItemsN[i] + amount > -1) {
player.playerItemsN[i] += amount;
} else {
player.playerItemsN[i] = GameConstants.MAXITEM_AMOUNT;
player.playerItemsN[i] = Constants.MAXITEM_AMOUNT;
}
if (player.getOutStream() != null && player != null) {
player.getOutStream().createFrameVarSizeWord(34);
@@ -522,14 +522,14 @@ public class ItemAssistant {
for (int i = 0; i < player.playerItems.length; i++) {
if (player.playerItems[i] <= 0) {
player.playerItems[i] = item + 1;
if (amount < GameConstants.MAXITEM_AMOUNT && amount > -1) {
if (amount < Constants.MAXITEM_AMOUNT && amount > -1) {
player.playerItemsN[i] = 1;
if (amount > 1) {
addItem(item, amount - 1);
return true;
}
} else {
player.playerItemsN[i] = GameConstants.MAXITEM_AMOUNT;
player.playerItemsN[i] = Constants.MAXITEM_AMOUNT;
}
resetItems(3214);
i = 30;
@@ -1340,7 +1340,7 @@ public class ItemAssistant {
return false;
}
if (GameConstants.ITEM_REQUIREMENTS) {
if (Constants.ITEM_REQUIREMENTS) {
// Check if slot is armor
if (targetSlot == ItemConstants.FEET
|| targetSlot == ItemConstants.LEGS
@@ -1349,32 +1349,32 @@ public class ItemAssistant {
|| targetSlot == ItemConstants.HAT
|| targetSlot == ItemConstants.HANDS) {
if (player.defenceLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.DEFENCE]) < player.defenceLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.DEFENCE]) < player.defenceLevelReq) {
player.getPacketSender().sendMessage("You need a defence level of " + player.defenceLevelReq + " to wear this item.");
canWearItem = false;
}
}
if (player.rangeLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.RANGED]) < player.rangeLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.RANGED]) < player.rangeLevelReq) {
player.getPacketSender().sendMessage("You need a range level of " + player.rangeLevelReq + " to wear this item.");
canWearItem = false;
}
}
if (player.magicLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.MAGIC]) < player.magicLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.MAGIC]) < player.magicLevelReq) {
player.getPacketSender().sendMessage("You need a magic level of " + player.magicLevelReq + " to wear this item.");
canWearItem = false;
}
}
}
if (player.slayerLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.SLAYER]) < player.slayerLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.SLAYER]) < player.slayerLevelReq) {
player.getPacketSender().sendMessage("You need a slayer level of " + player.slayerLevelReq + " to wear this item.");
canWearItem = false;
}
}
if (player.agilityLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.AGILITY]) < player.agilityLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.AGILITY]) < player.agilityLevelReq) {
player.getPacketSender().sendMessage("You need a agility level of " + player.agilityLevelReq + " to wear this item.");
canWearItem = false;
}
@@ -1382,19 +1382,19 @@ public class ItemAssistant {
// Weapon
if (targetSlot == ItemConstants.WEAPON) {
if (player.attackLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.ATTACK]) < player.attackLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.ATTACK]) < player.attackLevelReq) {
player.getPacketSender().sendMessage("You need an attack level of " + player.attackLevelReq + " to wield this weapon.");
canWearItem = false;
}
}
if (player.rangeLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.RANGED]) < player.rangeLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.RANGED]) < player.rangeLevelReq) {
player.getPacketSender().sendMessage("You need a range level of " + player.rangeLevelReq + " to wield this weapon.");
canWearItem = false;
}
}
if (player.magicLevelReq > 0) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.MAGIC]) < player.magicLevelReq) {
if (player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.MAGIC]) < player.magicLevelReq) {
player.getPacketSender().sendMessage("You need a magic level of " + player.magicLevelReq + " to wield this weapon.");
canWearItem = false;
}
@@ -1713,7 +1713,7 @@ public class ItemAssistant {
}
public void resetBank() {
player.getPacketSender().sendString("The Bank of " + GameConstants.SERVER_NAME, 5383, true);
player.getPacketSender().sendString("The Bank of " + Constants.SERVER_NAME, 5383, true);
if (player.getOutStream() != null) {
player.getOutStream().createFrameVarSizeWord(53);
player.getOutStream().writeWord(5382); // bank
@@ -1731,8 +1731,8 @@ public class ItemAssistant {
if (player.bankItemsN[i] < 1) {
player.bankItems[i] = 0;
}
if (player.bankItems[i] > GameConstants.ITEM_LIMIT || player.bankItems[i] < 0) {
player.bankItems[i] = GameConstants.ITEM_LIMIT;
if (player.bankItems[i] > Constants.ITEM_LIMIT || player.bankItems[i] < 0) {
player.bankItems[i] = Constants.ITEM_LIMIT;
}
if (player.getOutStream() != null) {
player.getOutStream().writeWordBigEndianA(player.bankItems[i]);
@@ -1767,8 +1767,8 @@ public class ItemAssistant {
player.getOutStream().writeByte(player.playerItemsN[i]);
}
}
if (player.playerItems[i] > GameConstants.ITEM_LIMIT || player.playerItems[i] < 0) {
player.playerItems[i] = GameConstants.ITEM_LIMIT;
if (player.playerItems[i] > Constants.ITEM_LIMIT || player.playerItems[i] < 0) {
player.playerItems[i] = Constants.ITEM_LIMIT;
}
if (player.getOutStream() != null) {
player.getOutStream().writeWordBigEndianA(player.playerItems[i]);
@@ -1838,7 +1838,7 @@ public class ItemAssistant {
if (player.playerItemsN[fromSlot] < amount) {
amount = player.playerItemsN[fromSlot];
}
if (player.bankItemsN[toBankSlot] + amount <= GameConstants.MAXITEM_AMOUNT
if (player.bankItemsN[toBankSlot] + amount <= Constants.MAXITEM_AMOUNT
&& player.bankItemsN[toBankSlot] + amount > -1) {
player.bankItemsN[toBankSlot] += amount;
} else {
@@ -1850,7 +1850,7 @@ public class ItemAssistant {
resetBank();
return true;
} else if (alreadyInBank) {
if (player.bankItemsN[toBankSlot] + amount <= GameConstants.MAXITEM_AMOUNT
if (player.bankItemsN[toBankSlot] + amount <= Constants.MAXITEM_AMOUNT
&& player.bankItemsN[toBankSlot] + amount > -1) {
player.bankItemsN[toBankSlot] += amount;
} else {
@@ -1965,7 +1965,7 @@ public class ItemAssistant {
if (player.playerItemsN[fromSlot] < amount) {
amount = player.playerItemsN[fromSlot];
}
if (player.bankItemsN[toBankSlot] + amount <= GameConstants.MAXITEM_AMOUNT && player.bankItemsN[toBankSlot] + amount > -1) {
if (player.bankItemsN[toBankSlot] + amount <= Constants.MAXITEM_AMOUNT && player.bankItemsN[toBankSlot] + amount > -1) {
player.bankItemsN[toBankSlot] += amount;
} else {
return false;
@@ -1975,7 +1975,7 @@ public class ItemAssistant {
resetBank();
return true;
} else if (alreadyInBank) {
if (player.bankItemsN[toBankSlot] + amount <= GameConstants.MAXITEM_AMOUNT && player.bankItemsN[toBankSlot] + amount > -1) {
if (player.bankItemsN[toBankSlot] + amount <= Constants.MAXITEM_AMOUNT && player.bankItemsN[toBankSlot] + amount > -1) {
player.bankItemsN[toBankSlot] += amount;
} else {
return false;
@@ -4,10 +4,9 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import com.rs2.Constants;
import org.apollo.cache.def.ItemDefinition;
import com.rs2.GameConstants;
public class ItemData {
public static int capes[] = { 2731, 2677, 2683, 2680, 2701, 2686, 2689,
@@ -193,7 +192,7 @@ public class ItemData {
return false;
}
public static int[] targetSlots = new int[GameConstants.ITEM_LIMIT];
public static int[] targetSlots = new int[Constants.ITEM_LIMIT];
static {
int counter = 0;
int c;
@@ -1,7 +1,7 @@
package com.rs2.game.items;
import com.rs2.Constants;
import com.rs2.event.impl.ItemOnItemEvent;
import com.rs2.GameConstants;
import com.rs2.game.content.skills.cooking.Cooking;
import com.rs2.game.content.skills.crafting.BattleStaffs;
import com.rs2.game.content.skills.crafting.GemCutting;
@@ -183,19 +183,19 @@ public class UseItem {
LogCutting.wolfBoneArrow(player);
}
if (itemUsed == 771 && useWith == 946
&& player.playerLevel[GameConstants.CRAFTING] > 30) {
&& player.playerLevel[Constants.CRAFTING] > 30) {
player.getItemAssistant().deleteItem(771, 1);
player.getItemAssistant().addItem(772, 1);
} else if (player.playerLevel[GameConstants.CRAFTING] < 31 && itemUsed == 771
} else if (player.playerLevel[Constants.CRAFTING] < 31 && itemUsed == 771
&& useWith == 946) {
player.getPacketSender().sendMessage(
"You need 31 crafting to make this.");
}
if (itemUsed == 946 && useWith == 771
&& player.playerLevel[GameConstants.CRAFTING] > 30) {
&& player.playerLevel[Constants.CRAFTING] > 30) {
player.getItemAssistant().deleteItem(771, 1);
player.getItemAssistant().addItem(772, 1);
} else if (player.playerLevel[GameConstants.CRAFTING] < 31 && itemUsed == 946
} else if (player.playerLevel[Constants.CRAFTING] < 31 && itemUsed == 946
&& useWith == 771) {
player.getPacketSender().sendMessage(
"You need 31 crafting to make this.");
@@ -247,12 +247,12 @@ public class UseItem {
player.getItemAssistant().deleteItem(4548, 1);
}
if (itemUsed == 1095 && useWith == 2370 || itemUsed == 2370
&& useWith == 1095 && player.playerLevel[GameConstants.CRAFTING] > 43) {// chaps
&& useWith == 1095 && player.playerLevel[Constants.CRAFTING] > 43) {// chaps
player.getItemAssistant().deleteItem(2370, 1);
player.getItemAssistant().deleteItem(1095, 1);
player.getItemAssistant().addItem(1097, 1);
player.getPlayerAssistant().addSkillXP(42, GameConstants.CRAFTING);
} else if (itemUsed == 1095 && useWith == 2370 || itemUsed == 2370 && useWith == 1095 && player.playerLevel[GameConstants.CRAFTING] < 44) {
player.getPlayerAssistant().addSkillXP(42, Constants.CRAFTING);
} else if (itemUsed == 1095 && useWith == 2370 || itemUsed == 2370 && useWith == 1095 && player.playerLevel[Constants.CRAFTING] < 44) {
player.getPacketSender().sendMessage("You need 44 crafting to make this.");
}
if (itemUsed == 946 && useWith == 1963 || itemUsed == 1963 && useWith == 946) {
@@ -265,12 +265,12 @@ public class UseItem {
player.getItemAssistant().addItem(1975, 1);
player.getPacketSender().sendMessage("You slice your chocolate bar.");
}
if (itemUsed == 1129 && useWith == 2370 || itemUsed == 2370 && useWith == 1129 && player.playerLevel[GameConstants.CRAFTING] > 40) {// body
if (itemUsed == 1129 && useWith == 2370 || itemUsed == 2370 && useWith == 1129 && player.playerLevel[Constants.CRAFTING] > 40) {// body
player.getItemAssistant().deleteItem(2370, 1);
player.getItemAssistant().deleteItem(1129, 1);
player.getItemAssistant().addItem(1133, 1);
player.getPlayerAssistant().addSkillXP(40, GameConstants.CRAFTING);
} else if (itemUsed == 1129 && useWith == 2370 || itemUsed == 2370 && useWith == 1129 && player.playerLevel[GameConstants.CRAFTING] < 41) {
player.getPlayerAssistant().addSkillXP(40, Constants.CRAFTING);
} else if (itemUsed == 1129 && useWith == 2370 || itemUsed == 2370 && useWith == 1129 && player.playerLevel[Constants.CRAFTING] < 41) {
player.getPacketSender().sendMessage("You need 41 crafting to make this.");
}
if (itemUsed == 4593 && useWith == 4591 || useWith == 4591 && itemUsed == 4593) {
@@ -375,11 +375,11 @@ public class UseItem {
if (itemUsed == 1987 && useWith == 1937 || itemUsed == 1937
&& useWith == 1987) {
if (player.playerLevel[GameConstants.COOKING] >= 35) {
if (player.playerLevel[Constants.COOKING] >= 35) {
player.getItemAssistant().addItem(1993, 1);
player.getItemAssistant().deleteItem(1937, 1);
player.getItemAssistant().deleteItem(1987, 1);
player.getPlayerAssistant().addSkillXP(200, GameConstants.COOKING);
player.getPlayerAssistant().addSkillXP(200, Constants.COOKING);
} else {
player.getPacketSender().sendMessage(
"You need grapes and a jug of water to make wine.");
@@ -1,6 +1,6 @@
package com.rs2.game.items.impl;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.items.DeprecatedItems;
import com.rs2.game.players.Player;
@@ -73,7 +73,7 @@ public enum Dye {
player.getItemAssistant().deleteItem(itemUsed, 1);
player.getItemAssistant().deleteItem(useWith, 1);
player.getItemAssistant().addItem(cape.getReward(), 1);
player.getPlayerAssistant().addSkillXP(2.5, GameConstants.CRAFTING);
player.getPlayerAssistant().addSkillXP(2.5, Constants.CRAFTING);
}
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.npcs;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.game.content.StaticNpcList;
import com.rs2.game.content.quests.QuestAssistant;
import com.rs2.game.content.skills.core.Fishing;
@@ -207,10 +207,10 @@ public class NpcActions {
player.getDialogueHandler().sendDialogues(1349, npcType);
break;
case MARTIN_THWAIT:
if (player.playerLevel[GameConstants.THIEVING] > 98) {
if (player.playerLevel[Constants.THIEVING] > 98) {
player.getShopAssistant().openShop(118);
} else if (player.playerLevel[GameConstants.THIEVING] > 49
&& player.playerLevel[GameConstants.AGILITY] > 49) {
} else if (player.playerLevel[Constants.THIEVING] > 49
&& player.playerLevel[Constants.AGILITY] > 49) {
player.getShopAssistant().openShop(118);
} else {
player.getPacketSender().sendMessage(
@@ -524,7 +524,7 @@ public class NpcActions {
}
break;
case GERTRUDE:
if (player.playerLevel[GameConstants.FISHING] < 4) {
if (player.playerLevel[Constants.FISHING] < 4) {
player.getDialogueHandler().sendStatement(
"You don't have the requirements to do this quest.");
return;
@@ -1017,10 +1017,10 @@ public class NpcActions {
Tanning.sendTanningInterface(player);
break;
case MARTIN_THWAIT:
if (player.playerLevel[GameConstants.THIEVING] > 98) {
if (player.playerLevel[Constants.THIEVING] > 98) {
player.getShopAssistant().openShop(118);
} else if (player.playerLevel[GameConstants.THIEVING] > 49
&& player.playerLevel[GameConstants.AGILITY] > 49) {
} else if (player.playerLevel[Constants.THIEVING] > 49
&& player.playerLevel[Constants.AGILITY] > 49) {
player.getShopAssistant().openShop(118);
} else {
player.getPacketSender().sendMessage(
@@ -1126,7 +1126,7 @@ public class NpcActions {
player.getPlayerAssistant().startTeleport(2911, 4832, 0, type);
break;
case MAGE_OF_ZAMORAK:
if (player.playerLevel[GameConstants.RUNECRAFTING] < 35) {
if (player.playerLevel[Constants.RUNECRAFTING] < 35) {
player.getPacketSender().sendMessage("You need a Runecrafting level of 35 to enter the Abyss.");
return;
}
@@ -2,7 +2,7 @@ package com.rs2.game.npcs;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -159,7 +159,7 @@ public class NpcHandler {
public static boolean isUndead(int index) {
String name = getNpcListName(npcs[index].npcType);
for (String s : GameConstants.UNDEAD) {
for (String s : Constants.UNDEAD) {
if (s.equalsIgnoreCase(name)) {
return true;
}
@@ -615,13 +615,13 @@ public class NpcHandler {
npcs[i].killerId = 0;
if (npcs[i].spawnedBy == 0) {
if (npcs[i].absX > npcs[i].makeX
+ GameConstants.NPC_RANDOM_WALK_DISTANCE
+ Constants.NPC_RANDOM_WALK_DISTANCE
|| npcs[i].absX < npcs[i].makeX
- GameConstants.NPC_RANDOM_WALK_DISTANCE
- Constants.NPC_RANDOM_WALK_DISTANCE
|| npcs[i].absY > npcs[i].makeY
+ GameConstants.NPC_RANDOM_WALK_DISTANCE
+ Constants.NPC_RANDOM_WALK_DISTANCE
|| npcs[i].absY < npcs[i].makeY
- GameConstants.NPC_RANDOM_WALK_DISTANCE) {
- Constants.NPC_RANDOM_WALK_DISTANCE) {
npcs[i].walkingHome = true;
}
}
@@ -787,8 +787,8 @@ public class NpcHandler {
}
if (npcs[i].npcType > 3726 && npcs[i].npcType < 3732) {
int damage = 10 + Misc.random(10);
player.playerLevel[GameConstants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[GameConstants.HITPOINTS]) - damage;
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.playerLevel[Constants.HITPOINTS] = player.getPlayerAssistant().getLevelForXP(player.playerXP[Constants.HITPOINTS]) - damage;
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.handleHitMask(damage);
}
if (npcs[i].npcType == 655) {
@@ -1117,7 +1117,7 @@ public class NpcHandler {
{
scroll = 2679;
}
if (scroll >= 0 && GameConstants.CLUES_ENABLED) {
if (scroll >= 0 && Constants.CLUES_ENABLED) {
GameEngine.itemHandler.createGroundItem(c, scroll, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
}
@@ -1232,10 +1232,10 @@ public class NpcHandler {
int y = npc.absY;
Player player = PlayerHandler.players[playerId];
if (npcs[i].spawnedBy > 0
|| x < npc.makeX + GameConstants.NPC_FOLLOW_DISTANCE
&& x > npc.makeX - GameConstants.NPC_FOLLOW_DISTANCE
&& y < npc.makeY + GameConstants.NPC_FOLLOW_DISTANCE
&& y > npc.makeY - GameConstants.NPC_FOLLOW_DISTANCE) {
|| x < npc.makeX + Constants.NPC_FOLLOW_DISTANCE
&& x > npc.makeX - Constants.NPC_FOLLOW_DISTANCE
&& y < npc.makeY + Constants.NPC_FOLLOW_DISTANCE
&& y > npc.makeY - Constants.NPC_FOLLOW_DISTANCE) {
if (npc.heightLevel == player.heightLevel) {
if (player != null && npc != null) {
if (playerX > x && playerY < y) {
@@ -1394,9 +1394,9 @@ public class NpcHandler {
|| npcs[i].npcType == 1160) {
if (damage > 0) {
if (c != null) {
if (c.playerLevel[GameConstants.PRAYER] > 0) {
c.playerLevel[GameConstants.PRAYER]--;
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
if (c.playerLevel[Constants.PRAYER] > 0) {
c.playerLevel[Constants.PRAYER]--;
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
c.getPlayerAssistant().appendPoison(12);
}
}
@@ -1,6 +1,6 @@
package com.rs2.game.objects;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -314,7 +314,7 @@ public class ObjectsActions {
//if (c.objectX == 2675 && c.objectY == 3170) {
//c.getDH().sendDialogues(79, 0);
//} else {
if (player.playerLevel[GameConstants.FISHING] <= 50) {
if (player.playerLevel[Constants.FISHING] <= 50) {
player.getPacketSender().sendMessage("You need a fishing level of 50 or higher to play Fishing Trawler.");
return;
}
@@ -433,16 +433,16 @@ public class ObjectsActions {
case 2112:
if (player.absY == 9756
&& player.playerLevel[GameConstants.MINING] >= 60) {
&& player.playerLevel[Constants.MINING] >= 60) {
player.getPlayerAssistant().movePlayer(3046, 9757, 0);
player.getPacketSender()
.sendMessage("You enter the guild.");
} else if (player.absY == 9757
&& player.playerLevel[GameConstants.MINING] >= 60) {
&& player.playerLevel[Constants.MINING] >= 60) {
player.getPlayerAssistant().movePlayer(3046, 9756, 0);
player.getPacketSender()
.sendMessage("You enter the guild.");
} else if (player.playerLevel[GameConstants.MINING] < 60) {
} else if (player.playerLevel[Constants.MINING] < 60) {
player.getPacketSender().sendMessage(
"You need 60 mining to enter this guild");
}
@@ -673,7 +673,7 @@ public class ObjectsActions {
break;
case 10596:
if (player.playerLevel[GameConstants.SLAYER] < 72) {
if (player.playerLevel[Constants.SLAYER] < 72) {
player.getPacketSender().sendMessage(
"You need 72 slayer to enter.");
return;
@@ -784,14 +784,14 @@ public class ObjectsActions {
case 2634:
if (player.absX == 2837
&& player.playerLevel[GameConstants.MINING] >= 50) {
&& player.playerLevel[Constants.MINING] >= 50) {
player.getPlayerAssistant().movePlayer(player.absX + 3,
player.absY, 0);
} else if (player.absX == 2840
&& player.playerLevel[GameConstants.MINING] >= 50) {
&& player.playerLevel[Constants.MINING] >= 50) {
player.getPlayerAssistant().movePlayer(player.absX - 3,
player.absY, 0);
} else if (player.playerLevel[GameConstants.MINING] < 50) {
} else if (player.playerLevel[Constants.MINING] < 50) {
player.getDialogueHandler().sendStatement("You need 50 mining to pass to this rock slide.");
player.nextChat = 0;
return;
@@ -1400,7 +1400,7 @@ public class ObjectsActions {
break;
case 9295:
if (player.playerLevel[GameConstants.AGILITY] < 51) {
if (player.playerLevel[Constants.AGILITY] < 51) {
player.getPacketSender().sendMessage(
"You need 51 agility to use this shortcut.");
return;
@@ -1512,7 +1512,7 @@ public class ObjectsActions {
break;
case 2287:
if (player.playerLevel[GameConstants.AGILITY] < 35) {
if (player.playerLevel[Constants.AGILITY] < 35) {
player.getPacketSender().sendMessage(
"You need 35 agility to enter here!");
return;
@@ -1664,21 +1664,21 @@ public class ObjectsActions {
case 2320:
long clickTimer = 0;
if (player.absY <= 9963 && player.playerLevel[GameConstants.AGILITY] > 14 && System.currentTimeMillis() - clickTimer > 2000) {
if (player.absY <= 9963 && player.playerLevel[Constants.AGILITY] > 14 && System.currentTimeMillis() - clickTimer > 2000) {
player.getPlayerAssistant().movePlayer(3120, 9970, 0);
player.startAnimation(744);
player.turnPlayerTo(player.objectX, player.objectY);
player.getPacketSender().sendMessage("You swing on the monkey bars.");
player.getPlayerAssistant().addSkillXP(25, GameConstants.AGILITY);
player.getPlayerAssistant().addSkillXP(25, Constants.AGILITY);
clickTimer = System.currentTimeMillis();
} else if (player.absY <= 9970 && player.playerLevel[GameConstants.AGILITY] > 14 && System.currentTimeMillis() - clickTimer > 2000) {
} else if (player.absY <= 9970 && player.playerLevel[Constants.AGILITY] > 14 && System.currentTimeMillis() - clickTimer > 2000) {
player.getPlayerAssistant().movePlayer(3120, 9963, 0);
player.startAnimation(744);
player.turnPlayerTo(player.objectX, player.objectY);
player.getPacketSender().sendMessage("You swing on the monkey bars.");
player.getPlayerAssistant().addSkillXP(25, GameConstants.AGILITY);
player.getPlayerAssistant().addSkillXP(25, Constants.AGILITY);
clickTimer = System.currentTimeMillis();
} else if (player.playerLevel[GameConstants.AGILITY] < 15) {
} else if (player.playerLevel[Constants.AGILITY] < 15) {
player.getPacketSender().sendMessage("You need 15 agility to use these monkey bars.");
} else {
player.getPacketSender().sendMessage("You can't do the monkey bars here.");
@@ -1889,7 +1889,7 @@ public class ObjectsActions {
player.getItemAssistant().addItem(2130, 1);
player.getItemAssistant().deleteItem(1927, 1);
player.getPlayerAssistant()
.addSkillXP(18, GameConstants.COOKING);
.addSkillXP(18, Constants.COOKING);
} else {
player.getPacketSender().sendMessage(
"You need a bucket of milk to do this.");
@@ -2164,7 +2164,7 @@ public class ObjectsActions {
break;
case 9398:// deposit box
player.getPacketSender().sendString("The Bank of " + GameConstants.SERVER_NAME + " - Deposit Box", 7421);
player.getPacketSender().sendString("The Bank of " + Constants.SERVER_NAME + " - Deposit Box", 7421);
player.getPacketSender().sendFrame248(4465, 197);
player.getItemAssistant().resetItems(7423);
break;
@@ -2538,14 +2538,14 @@ public class ObjectsActions {
case 10638:
case 411:
case 412:
if (player.playerLevel[GameConstants.PRAYER] < player.getPlayerAssistant()
.getLevelForXP(player.playerXP[GameConstants.PRAYER])) {
if (player.playerLevel[Constants.PRAYER] < player.getPlayerAssistant()
.getLevelForXP(player.playerXP[Constants.PRAYER])) {
player.startAnimation(645);
player.playerLevel[GameConstants.PRAYER] = player.getPlayerAssistant()
.getLevelForXP(player.playerXP[GameConstants.PRAYER]);
player.playerLevel[Constants.PRAYER] = player.getPlayerAssistant()
.getLevelForXP(player.playerXP[Constants.PRAYER]);
player.getPacketSender().sendMessage(
"You recharge your prayer points.");
player.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
player.getPlayerAssistant().refreshSkill(Constants.PRAYER);
} else {
player.getPacketSender().sendMessage(
"You already have full prayer points.");
@@ -2558,14 +2558,14 @@ public class ObjectsActions {
"You can't use this in the wilderness.");
return;
}
if (player.playerLevel[GameConstants.PRAYER] < player.getPlayerAssistant()
.getLevelForXP(player.playerXP[GameConstants.PRAYER])) {
if (player.playerLevel[Constants.PRAYER] < player.getPlayerAssistant()
.getLevelForXP(player.playerXP[Constants.PRAYER])) {
player.startAnimation(645);
player.playerLevel[GameConstants.PRAYER] = player.getPlayerAssistant()
.getLevelForXP(player.playerXP[GameConstants.PRAYER]) + 2;
player.playerLevel[Constants.PRAYER] = player.getPlayerAssistant()
.getLevelForXP(player.playerXP[Constants.PRAYER]) + 2;
player.getPacketSender().sendMessage(
"You recharge your prayer points.");
player.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
player.getPlayerAssistant().refreshSkill(Constants.PRAYER);
} else {
player.getPacketSender().sendMessage(
"You already have full prayer points.");
@@ -1,6 +1,6 @@
package com.rs2.game.objects.impl;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
import com.rs2.event.CycleEventHandler;
@@ -372,10 +372,10 @@ public class Climbing {
break;
case 2408:
if (client.playerLevel[GameConstants.PRAYER] > 0) {
client.playerLevel[GameConstants.PRAYER] = 0;
if (client.playerLevel[Constants.PRAYER] > 0) {
client.playerLevel[Constants.PRAYER] = 0;
}
client.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
client.getPlayerAssistant().refreshSkill(Constants.PRAYER);
client.getPacketSender().sendMessage(
"Your prayer is drained as you enter the dungeon.");
client.getPlayerAssistant().movePlayer(2823, 9771, 0);
@@ -445,7 +445,7 @@ public class Climbing {
} else if (client.objectX == 3258 && client.objectY == 3487) {
client.getPlayerAssistant().movePlayer(3257, 3487, 1);
client.resetWalkingQueue();
} else if (client.objectX == 3144 && client.objectY == 3447 && client.playerLevel[GameConstants.COOKING] > 31 && client.playerEquipment[client.playerHat] == 1949) {
} else if (client.objectX == 3144 && client.objectY == 3447 && client.playerLevel[Constants.COOKING] > 31 && client.playerEquipment[client.playerHat] == 1949) {
client.getPlayerAssistant().movePlayer(3143, 3448, 1);
client.resetWalkingQueue();
} else if (client.objectX == 3010 && client.objectY == 3515) {
@@ -580,7 +580,7 @@ public class Climbing {
"You go down the trapdoor.");
client.startAnimation(827);
client.getPlayerAssistant().addSkillXP(.5,
GameConstants.THIEVING);
Constants.THIEVING);
client.getPacketSender().closeAllWindows();
} else if (!client.getItemAssistant().playerHasItem(1523, 1)
&& Misc.random(5) < 2) {
@@ -589,7 +589,7 @@ public class Climbing {
"You go down the trapdoor.");
client.startAnimation(827);
client.getPlayerAssistant().addSkillXP(.5,
GameConstants.THIEVING);
Constants.THIEVING);
client.getPacketSender().closeAllWindows();
client.resetWalkingQueue();
} else if (client.getItemAssistant().playerHasItem(1523, 1)
@@ -599,9 +599,9 @@ public class Climbing {
client.getPacketSender()
.sendMessage(
"Your thieving has been drained, your fingers feel numb.");
client.playerLevel[GameConstants.THIEVING] = client.getPlayerAssistant()
.getLevelForXP(client.playerXP[GameConstants.THIEVING]) - 1;
client.getPlayerAssistant().refreshSkill(GameConstants.THIEVING);
client.playerLevel[Constants.THIEVING] = client.getPlayerAssistant()
.getLevelForXP(client.playerXP[Constants.THIEVING]) - 1;
client.getPlayerAssistant().refreshSkill(Constants.THIEVING);
client.getItemAssistant().deleteItem(1523, 1);
} else if (!client.getItemAssistant().playerHasItem(1523, 1)
&& Misc.random(5) > 2) {
@@ -610,9 +610,9 @@ public class Climbing {
client.getPacketSender()
.sendMessage(
"Your thieving has been drained, your fingers feel numb.");
client.playerLevel[GameConstants.THIEVING] = client.getPlayerAssistant()
.getLevelForXP(client.playerXP[GameConstants.THIEVING]) - 1;
client.getPlayerAssistant().refreshSkill(GameConstants.THIEVING);
client.playerLevel[Constants.THIEVING] = client.getPlayerAssistant()
.getLevelForXP(client.playerXP[Constants.THIEVING]) - 1;
client.getPlayerAssistant().refreshSkill(Constants.THIEVING);
}
break;
@@ -1,8 +1,8 @@
package com.rs2.game.objects.impl;
import com.rs2.Constants;
import org.apollo.cache.def.ObjectDefinition;
import com.rs2.GameConstants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -201,7 +201,7 @@ public class OtherObjects {
player.updateRequired = true;
player.poisonMask = 2;
player.dealDamage(nettlesDamage);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
player.getPacketSender().sendMessage("You have been stung by the nettles.");
player.stopPlayer(false);
}
@@ -220,7 +220,7 @@ public class OtherObjects {
} else if (random == 9) {
player.handleHitMask(damage);
player.dealDamage(damage);
player.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
player.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
container.stop();
} else {
player.getPacketSender().sendMessage("You find nothing of interest.");
@@ -2,19 +2,17 @@ package com.rs2.game.players;
import org.apollo.game.session.GameSession;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.util.Stream;
import io.netty.channel.Channel;
public class Client extends Player {
public Client(GameSession s, int _playerId) {
super(_playerId);
session = s;
outStream = new Stream(new byte[GameConstants.BUFFER_SIZE]);
outStream = new Stream(new byte[Constants.BUFFER_SIZE]);
outStream.currentOffset = 0;
buffer = new byte[GameConstants.BUFFER_SIZE];
buffer = new byte[Constants.BUFFER_SIZE];
}
//bots
@@ -22,7 +20,7 @@ public class Client extends Player {
super(-1);
isBot = true;
session = null;
buffer = new byte[GameConstants.BUFFER_SIZE];
buffer = new byte[Constants.BUFFER_SIZE];
}
public void setSession(GameSession session) {
@@ -1,7 +1,7 @@
package com.rs2.game.players;
import com.everythingrs.hiscores.Hiscores;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.*;
import com.rs2.game.content.BankPin;
@@ -54,7 +54,6 @@ import com.rs2.game.objects.ObjectsActions;
import com.rs2.game.shops.ShopAssistant;
import com.rs2.gui.ControlPanel;
import com.rs2.net.Packet;
import com.rs2.net.Packet.Type;
import com.rs2.net.PacketSender;
import com.rs2.net.packets.PacketHandler;
import com.rs2.net.packets.impl.ChallengePlayer;
@@ -64,7 +63,6 @@ import com.rs2.util.Stream;
import com.rs2.world.Boundary;
import com.rs2.world.ObjectManager;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.*;
@@ -561,7 +559,7 @@ public abstract class Player {
if (session == null) {
return;
}
if(GameConstants.GUI_ENABLED)
if(Constants.GUI_ENABLED)
ControlPanel.removeEntity(playerName);
if (getCannon().hasCannon()) {
getCannon().removeObject(cannonX, cannonY);
@@ -854,7 +852,7 @@ public abstract class Player {
public Client getClient(String name) {
name = name.toLowerCase();
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
if (validClient(i)) {
Client client = getClient(i);
if (client.playerName.toLowerCase().equalsIgnoreCase(name)) {
@@ -870,7 +868,7 @@ public abstract class Player {
}
public boolean validClient(int id) {
if (id < 0 || id > GameConstants.MAX_PLAYERS) {
if (id < 0 || id > Constants.MAX_PLAYERS) {
return false;
}
return validClient(getClient(id));
@@ -921,7 +919,7 @@ public abstract class Player {
forcedChat("" + --duelCount);
duelDelay = System.currentTimeMillis();
} else {
damageTaken = new int[GameConstants.MAX_PLAYERS];
damageTaken = new int[Constants.MAX_PLAYERS];
forcedChat("FIGHT!");
duelCount = 0;
}
@@ -1061,7 +1059,7 @@ public abstract class Player {
}
}
if (timeOutCounter > GameConstants.TIMEOUT) {
if (timeOutCounter > Constants.TIMEOUT) {
if (!isBot)
logout(true);
}
@@ -1148,7 +1146,7 @@ public abstract class Player {
* : SOUND DELAY
*/
public void playSound(Client c, int SOUNDID, int delay) {
if (GameConstants.SOUND) {
if (Constants.SOUND) {
if (soundVolume <= -1) {
return;
}
@@ -1969,7 +1967,7 @@ public abstract class Player {
heightLevel = 0;
if (GameConstants.TUTORIAL_ISLAND) {
if (Constants.TUTORIAL_ISLAND) {
teleportToX = 3094;
teleportToY = 3107;
} else {
@@ -1983,11 +1981,11 @@ public abstract class Player {
resetWalkingQueue();
}
public static final int maxPlayerListSize = GameConstants.MAX_PLAYERS;
public static final int maxPlayerListSize = Constants.MAX_PLAYERS;
public Player playerList[] = new Player[maxPlayerListSize];
public int playerListSize = 0;
public byte playerInListBitmap[] = new byte[GameConstants.MAX_PLAYERS + 7 >> 3];
public byte playerInListBitmap[] = new byte[Constants.MAX_PLAYERS + 7 >> 3];
public static final int maxNPCListSize = NpcHandler.MAX_NPCS;
public Npc npcList[] = new Npc[maxNPCListSize];
@@ -2336,7 +2334,7 @@ public abstract class Player {
}
}
public byte cachedPropertiesBitmap[] = new byte[GameConstants.MAX_PLAYERS + 7 >> 3];
public byte cachedPropertiesBitmap[] = new byte[Constants.MAX_PLAYERS + 7 >> 3];
public void addNewNPC(Npc npc, Stream str, Stream updateBlock) {
int id = npc.npcId;
@@ -2543,13 +2541,13 @@ public abstract class Player {
if (isBot) {
return 0;
}
int j = playerAssistant.getLevelForXP(playerXP[GameConstants.ATTACK]);
int k = playerAssistant.getLevelForXP(playerXP[GameConstants.DEFENCE]);
int l = playerAssistant.getLevelForXP(playerXP[GameConstants.STRENGTH]);
int i1 = playerAssistant.getLevelForXP(playerXP[GameConstants.HITPOINTS]);
int j1 = playerAssistant.getLevelForXP(playerXP[GameConstants.PRAYER]);
int k1 = playerAssistant.getLevelForXP(playerXP[GameConstants.RANGED]);
int l1 = playerAssistant.getLevelForXP(playerXP[GameConstants.MAGIC]);
int j = playerAssistant.getLevelForXP(playerXP[Constants.ATTACK]);
int k = playerAssistant.getLevelForXP(playerXP[Constants.DEFENCE]);
int l = playerAssistant.getLevelForXP(playerXP[Constants.STRENGTH]);
int i1 = playerAssistant.getLevelForXP(playerXP[Constants.HITPOINTS]);
int j1 = playerAssistant.getLevelForXP(playerXP[Constants.PRAYER]);
int k1 = playerAssistant.getLevelForXP(playerXP[Constants.RANGED]);
int l1 = playerAssistant.getLevelForXP(playerXP[Constants.MAGIC]);
int combatLevel = (int) ((k + i1 + Math.floor(j1 / 2)) * 0.25D) + 1;
double d = (j + l) * 0.32500000000000001D;
double d1 = Math.floor(k1 * 1.5D) * 0.32500000000000001D;
@@ -2697,12 +2695,12 @@ public abstract class Player {
} else {
str.writeByteA(0); // 0: red hitting - 1: blue hitting
}
if (playerLevel[GameConstants.HITPOINTS] <= 0) {
playerLevel[GameConstants.HITPOINTS] = 0;
if (playerLevel[Constants.HITPOINTS] <= 0) {
playerLevel[Constants.HITPOINTS] = 0;
isDead = true;
}
str.writeByteC(playerLevel[GameConstants.HITPOINTS]); // Their current hp, for HP bar
str.writeByte(playerAssistant.getLevelForXP(playerXP[GameConstants.HITPOINTS]));
str.writeByteC(playerLevel[Constants.HITPOINTS]); // Their current hp, for HP bar
str.writeByte(playerAssistant.getLevelForXP(playerXP[Constants.HITPOINTS]));
}
protected void appendHitUpdate2(Stream str) {
@@ -2715,12 +2713,12 @@ public abstract class Player {
} else {
str.writeByteS(0); // 0: red hitting - 1: blue hitting
}
if (playerLevel[GameConstants.HITPOINTS] <= 0) {
playerLevel[GameConstants.HITPOINTS] = 0;
if (playerLevel[Constants.HITPOINTS] <= 0) {
playerLevel[Constants.HITPOINTS] = 0;
isDead = true;
}
str.writeByte(playerLevel[GameConstants.HITPOINTS]); // Their current hp, for HP bar
str.writeByteC(playerAssistant.getLevelForXP(playerXP[GameConstants.HITPOINTS])); // Their max hp, for HP
str.writeByte(playerLevel[Constants.HITPOINTS]); // Their current hp, for HP bar
str.writeByteC(playerAssistant.getLevelForXP(playerXP[Constants.HITPOINTS])); // Their max hp, for HP
}
public void appendPlayerUpdateBlock(Stream str) {
@@ -3100,9 +3098,9 @@ public abstract class Player {
public void dealDamage(int damage) {
if (teleTimer <= 0) {
playerLevel[GameConstants.HITPOINTS] -= damage;
int difference = playerLevel[GameConstants.HITPOINTS] - damage;
if (difference <= playerAssistant.getLevelForXP(playerXP[GameConstants.HITPOINTS]) / 10 && difference > 0)
playerLevel[Constants.HITPOINTS] -= damage;
int difference = playerLevel[Constants.HITPOINTS] - damage;
if (difference <= playerAssistant.getLevelForXP(playerXP[Constants.HITPOINTS]) / 10 && difference > 0)
appendRedemption();
getPlayerAssistant().handleROL();
} else {
@@ -3113,21 +3111,21 @@ public abstract class Player {
hitUpdateRequired2 = false;
}
}
getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
}
public void appendRedemption() {
Client c = (Client) PlayerHandler.players[playerId];
if (c.getPrayer().prayerActive[22]) {
int added = c.playerLevel[GameConstants.HITPOINTS] += (int)(c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.PRAYER]) * .25);
if (added > c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS])) {
c.playerLevel[GameConstants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[GameConstants.HITPOINTS]);
int added = c.playerLevel[Constants.HITPOINTS] += (int)(c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.PRAYER]) * .25);
if (added > c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS])) {
c.playerLevel[Constants.HITPOINTS] = c.getPlayerAssistant().getLevelForXP(c.playerXP[Constants.HITPOINTS]);
} else {
c.playerLevel[GameConstants.HITPOINTS] += (int)(playerAssistant.getLevelForXP(c.playerXP[GameConstants.PRAYER]) * .25);
c.playerLevel[Constants.HITPOINTS] += (int)(playerAssistant.getLevelForXP(c.playerXP[Constants.PRAYER]) * .25);
}
c.playerLevel[GameConstants.PRAYER] = 0;
c.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
c.getPlayerAssistant().refreshSkill(GameConstants.PRAYER);
c.playerLevel[Constants.PRAYER] = 0;
c.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
c.getPlayerAssistant().refreshSkill(Constants.PRAYER);
c.gfx0(436);
PrayerDrain.resetPrayers(c);
}
@@ -3,7 +3,8 @@ package com.rs2.game.players;
import java.util.ArrayList;
import java.util.Optional;
import java.util.Random;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.event.CycleEvent;
import com.rs2.event.CycleEventContainer;
@@ -40,7 +41,7 @@ public class PlayerAssistant {
}
public boolean savePlayer() {
return (player.wildLevel < 20 && player.playerEquipment[ItemConstants.RING] == 2570 && player.playerLevel[GameConstants.HITPOINTS] > 0 && player.playerLevel[GameConstants.HITPOINTS] <= getLevelForXP(player.playerXP[GameConstants.HITPOINTS]) / 10 && player.underAttackBy > 0);
return (player.wildLevel < 20 && player.playerEquipment[ItemConstants.RING] == 2570 && player.playerLevel[Constants.HITPOINTS] > 0 && player.playerLevel[Constants.HITPOINTS] <= getLevelForXP(player.playerXP[Constants.HITPOINTS]) / 10 && player.underAttackBy > 0);
}
public void handleROL() {
@@ -94,14 +95,14 @@ public class PlayerAssistant {
public void loginScreen() {
player.getPacketSender().showInterface(15244);
player.getPacketSender().sendString("Welcome to " + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "\\n", 15257);
player.getPacketSender().sendString("Welcome to " + Constants.SERVER_NAME + " World: " + Constants.WORLD + "\\n", 15257);
int currentDay = player.getLastLogin() - player.lastLoginDate;
if (player.playerLevel[GameConstants.HERBLORE] < 3) {
if (player.playerLevel[Constants.HERBLORE] < 3) {
player.playerLevel[GameConstants.HERBLORE] = 3;
player.playerXP[GameConstants.HERBLORE] = 175;
player.getPlayerAssistant().refreshSkill(GameConstants.HERBLORE);
player.playerLevel[Constants.HERBLORE] = 3;
player.playerXP[Constants.HERBLORE] = 175;
player.getPlayerAssistant().refreshSkill(Constants.HERBLORE);
}
if (player.lastLoginDate <= 0) {
player.getPacketSender().sendString("This is your first time logging in!", 15258);
@@ -110,7 +111,7 @@ public class PlayerAssistant {
} else {
player.getPacketSender().sendString("You last logged in @red@" + (currentDay > 1 ? (currentDay + " @bla@days ago") : ("earlier today")) + " @bla@ from: @red@" + player.lastConnectedFrom, 15258);
}
player.getPacketSender().sendString("" +GameConstants.SERVER_NAME + " will NEVER email you.\\n We use the forums or we \\nWill contact you through game.", 15260);
player.getPacketSender().sendString("" + Constants.SERVER_NAME + " will NEVER email you.\\n We use the forums or we \\nWill contact you through game.", 15260);
player.getPacketSender().sendString("You have 0 unread messages\\nin your message centre.", 15261);
player.getPacketSender().sendString("You have @gre@unlimited@yel@ days of member credit.", 15262);
player.getPacketSender().sendString("CLICK HERE TO PLAY", 15263);
@@ -125,7 +126,7 @@ public class PlayerAssistant {
}
private String[][] welcomeMessages = {
{"Remember to vote daily to help " + GameConstants.SERVER_NAME + "", "Every vote counts! :)"},
{"Remember to vote daily to help " + Constants.SERVER_NAME + "", "Every vote counts! :)"},
{"Not a member of our discord community?", "Join our discord at: https://discord.gg/hZ6VfWG"},
{"Do you have any bugs that you would like to report?", "Report them on our discord or message a staff member. :)"},
{"Want to help the server grow?", "Remember to vote daily and invite your friends!"}
@@ -177,31 +178,31 @@ public class PlayerAssistant {
int xpToAdd = 0;
if (manta > 0) {
toReturn.add(new GameItem(389, manta));
if (player.playerLevel[GameConstants.FISHING] >= 81) {
if (player.playerLevel[Constants.FISHING] >= 81) {
xpToAdd += (manta * 46);
}
}
if (turt > 0) {
toReturn.add(new GameItem(395, turt));
if (player.playerLevel[GameConstants.FISHING] >= 79) {
if (player.playerLevel[Constants.FISHING] >= 79) {
xpToAdd += (manta * 38);
}
}
if (lobs > 0) {
toReturn.add(new GameItem(377, lobs));
if (player.playerLevel[GameConstants.FISHING] >= 40) {
if (player.playerLevel[Constants.FISHING] >= 40) {
xpToAdd += (manta * 90);
}
}
if (swordFish > 0) {
toReturn.add(new GameItem(371, swordFish));
if (player.playerLevel[GameConstants.FISHING] >= 50) {
if (player.playerLevel[Constants.FISHING] >= 50) {
xpToAdd += (manta * 100);
}
}
if (junk > 0)
toReturn.add(new GameItem(685, junk));
player.getPlayerAssistant().addSkillXP(xpToAdd, GameConstants.FISHING);
player.getPlayerAssistant().addSkillXP(xpToAdd, Constants.FISHING);
return toReturn;
}
@@ -350,8 +351,8 @@ public class PlayerAssistant {
}
public void sendSidebars() {
for (int i = 0; i < GameConstants.SIDEBARS.length; i++) {
player.getPacketSender().setSidebarInterface(i, GameConstants.SIDEBARS[i]);
for (int i = 0; i < Constants.SIDEBARS.length; i++) {
player.getPacketSender().setSidebarInterface(i, Constants.SIDEBARS[i]);
}
player.getPacketSender().setSidebarInterface(6, player.playerMagicBook == 0 ? 1151 : 12855);
}
@@ -401,7 +402,7 @@ public class PlayerAssistant {
public int raiseTimer() {
// calculations from https://oldschool.runescape.wiki/w/Energy
double seconds = 60 / (8 + Math.floor(player.playerLevel[GameConstants.AGILITY] / 6));
double seconds = 60 / (8 + Math.floor(player.playerLevel[Constants.AGILITY] / 6));
return (int) Math.floor(seconds * 1000);
}
@@ -628,8 +629,8 @@ public class PlayerAssistant {
player.getPacketSender().sendMessage("You can't teleport from a Fight pits Game!");
return;
}
if (player.inWild() && player.wildLevel > GameConstants.NO_TELEPORT_WILD_LEVEL) {
player.getPacketSender().sendMessage("You can't teleport above level " + GameConstants.NO_TELEPORT_WILD_LEVEL + " wilderness.");
if (player.inWild() && player.wildLevel > Constants.NO_TELEPORT_WILD_LEVEL) {
player.getPacketSender().sendMessage("You can't teleport above level " + Constants.NO_TELEPORT_WILD_LEVEL + " wilderness.");
return;
}
if (player.tutorialProgress < 36) {
@@ -689,7 +690,7 @@ public class PlayerAssistant {
}
player.teleHeight = height;
player.isTeleporting = true;
if (GameConstants.SOUND) {
if (Constants.SOUND) {
player.getPacketSender().sendSound(SoundList.TELEPORT, 100, 700);
}
if (teleportType.equalsIgnoreCase("modern")) {
@@ -757,7 +758,7 @@ public class PlayerAssistant {
player.getPacketSender().sendMessage("You can't teleport as a monkey.");
return;
}
if (GameConstants.SOUND) {
if (Constants.SOUND) {
player.getPacketSender().sendSound(SoundList.TELEPORT, 100, 0);
}
if (!player.isDead && player.teleTimer == 0) {
@@ -820,7 +821,7 @@ public class PlayerAssistant {
"You are teleblocked and can't teleport.");
return;
}
if (GameConstants.SOUND) {
if (Constants.SOUND) {
player.getPacketSender().sendSound(SoundList.TELEPORT, 100, 0);
}
if (player.inWild() && player.wildLevel > 30) {
@@ -940,11 +941,11 @@ public class PlayerAssistant {
Client t = (Client) player;
if (t.absX >= x1 && t.absX <= x2 && t.absY >= y1
&& t.absY <= y2) {
int hit = t.playerLevel[GameConstants.HITPOINTS] / hp;
int hit = t.playerLevel[Constants.HITPOINTS] / hp;
t.setHitDiff2(hit);
t.setHitUpdateRequired2(true);
t.playerLevel[GameConstants.HITPOINTS] -= hit;
t.getPlayerAssistant().refreshSkill(GameConstants.HITPOINTS);
t.playerLevel[Constants.HITPOINTS] -= hit;
t.getPlayerAssistant().refreshSkill(Constants.HITPOINTS);
t.updateRequired = true;
}
}
@@ -1023,7 +1024,7 @@ public class PlayerAssistant {
for (Player p : PlayerHandler.players) {
if (p != null && p.isActive) {
Client o = (Client) p;
o.getPlayerAssistant().updatePM(player.playerId, GameConstants.WORLD);
o.getPlayerAssistant().updatePM(player.playerId, Constants.WORLD);
}
}
boolean pmLoaded = false;
@@ -1041,7 +1042,7 @@ public class PlayerAssistant {
&& o.getPlayerAssistant()
.isInPM(Misc
.playerNameToInt64(player.playerName))) {
player.getPacketSender().loadPM(friend, GameConstants.WORLD);
player.getPacketSender().loadPM(friend, Constants.WORLD);
pmLoaded = true;
}
break;
@@ -1056,7 +1057,7 @@ public class PlayerAssistant {
Player p = PlayerHandler.players[i1];
if (p != null && p.isActive) {
Client o = (Client) p;
o.getPlayerAssistant().updatePM(player.playerId, GameConstants.WORLD);
o.getPlayerAssistant().updatePM(player.playerId, Constants.WORLD);
}
}
}
@@ -1408,8 +1409,8 @@ public class PlayerAssistant {
player.clickedVamp = false;
} else if (player.isWoodcutting) {
player.isWoodcutting = false;
} else if (player.playerSkilling[GameConstants.FISHING]) {
player.playerSkilling[GameConstants.FISHING] = false;
} else if (player.playerSkilling[Constants.FISHING]) {
player.playerSkilling[Constants.FISHING] = false;
} else if(player.clickedTree) {
player.clickedTree = false;
}
@@ -1500,7 +1501,7 @@ public class PlayerAssistant {
// duel
// repawn to
// wildy
movePlayer(GameConstants.RESPAWN_X, GameConstants.RESPAWN_Y, 0);
movePlayer(Constants.RESPAWN_X, Constants.RESPAWN_Y, 0);
player.isSkulled = false;
player.skullTimer = 0;
player.attackedPlayers.clear();
@@ -1518,14 +1519,14 @@ public class PlayerAssistant {
}
player.getPacketSender().sendSound(122, 100, 0);
player.getPlayerAssistant().movePlayer(
GameConstants.DUELING_RESPAWN_X + 5,
GameConstants.DUELING_RESPAWN_Y + 5, 0);
Constants.DUELING_RESPAWN_X + 5,
Constants.DUELING_RESPAWN_Y + 5, 0);
assert o != null;
if (o != null) {
o.getPacketSender().sendSound(122, 100, 0);
o.getPlayerAssistant().movePlayer(
GameConstants.DUELING_RESPAWN_X + 5,
GameConstants.DUELING_RESPAWN_Y + 5, 0);
Constants.DUELING_RESPAWN_X + 5,
Constants.DUELING_RESPAWN_Y + 5, 0);
}
if (player.duelStatus != 6) { // if we have won but have died,
// don't reset the duel status.
@@ -1630,7 +1631,7 @@ public class PlayerAssistant {
if (player.freezeTimer > 0) {
return;
}
if (player.isDead || player.playerLevel[GameConstants.HITPOINTS] <= 0) {
if (player.isDead || player.playerLevel[Constants.HITPOINTS] <= 0) {
return;
}
@@ -1813,7 +1814,7 @@ public class PlayerAssistant {
}
public void firstTimeTutorial() {
if (GameConstants.TUTORIAL_ISLAND && player.tutorialProgress == 0) {
if (Constants.TUTORIAL_ISLAND && player.tutorialProgress == 0) {
player.getItemAssistant().deleteAllItems();
player.getPlayerAssistant().hideAllSideBars();
movePlayer(3094, 3107, 0);
@@ -1823,7 +1824,7 @@ public class PlayerAssistant {
player.autoRet = 1;
sendAutoRetalitate();
LightSources.saveBrightness(player);
} else if (player.tutorialProgress == 0 && !GameConstants.TUTORIAL_ISLAND) {
} else if (player.tutorialProgress == 0 && !Constants.TUTORIAL_ISLAND) {
player.getPlayerAssistant().sendSidebars();
PlayerAssistant.removeHintIcon(player);
player.getPacketSender().walkableInterface(-1);
@@ -1832,7 +1833,7 @@ public class PlayerAssistant {
player.getItemAssistant().clearBank();
player.getPlayerAssistant().addStarter();
player.getPlayerAssistant().movePlayer(3233, 3229, 0);
player.getPacketSender().sendMessage("Welcome to @blu@" + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "@bla@ - we are currently in Server Stage v@blu@" + GameConstants.TEST_VERSION + "@bla@.");
player.getPacketSender().sendMessage("Welcome to @blu@" + Constants.SERVER_NAME + " World: " + Constants.WORLD + "@bla@ - we are currently in Server Stage v@blu@" + Constants.TEST_VERSION + "@bla@.");
player.getPacketSender().sendMessage("@red@Did you know?@bla@ We're open source and pull requests are welcome!");
player.getPacketSender().sendMessage("Source code: github.com/2006-Scape/2006Scape");
player.getPacketSender().sendMessage("Discord: https://discord.gg/hZ6VfWG");
@@ -1986,7 +1987,7 @@ public class PlayerAssistant {
player.getPacketSender().sendString("" + player.playerXP[skill] + "", data.get().getFrame6());
player.getPacketSender().sendString("" + getXPForLevel(getLevelForXP(player.playerXP[skill]) + 1) + "", data.get().getFrame7());
if (skill == 5) {
player.getPacketSender().sendString("" + player.playerLevel[GameConstants.PRAYER] + "/" + getLevelForXP(player.playerXP[GameConstants.PRAYER]) + "", 687);// Prayer
player.getPacketSender().sendString("" + player.playerLevel[Constants.PRAYER] + "/" + getLevelForXP(player.playerXP[Constants.PRAYER]) + "", 687);// Prayer
}
// Update skill data
player.getPacketSender().setSkillLevel(skill, player.playerLevel[skill], player.playerXP[skill]);
@@ -2024,13 +2025,13 @@ public class PlayerAssistant {
}
return false;
}
if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && GameConstants.TUTORIAL_ISLAND) {
if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && Constants.TUTORIAL_ISLAND) {
return false;
}
if (GameConstants.VARIABLE_XP_RATE){
if (Constants.VARIABLE_XP_RATE){
amount *= player.getXPRate();
} else {
amount *= GameConstants.XP_RATE;
amount *= Constants.XP_RATE;
}
int oldLevel = getLevelForXP(player.playerXP[skill]);
player.playerXP[skill] += amount;
@@ -1,7 +1,8 @@
package com.rs2.game.players;
import java.net.InetSocketAddress;
import com.rs2.GameConstants;
import com.rs2.Constants;
import com.rs2.GameEngine;
import com.rs2.game.content.minigames.castlewars.CastleWars;
import com.rs2.game.npcs.Npc;
@@ -12,9 +13,9 @@ import com.rs2.world.GlobalDropsHandler;
public class PlayerHandler {
public static Player players[] = new Player[GameConstants.MAX_PLAYERS];
public static Player players[] = new Player[Constants.MAX_PLAYERS];
public static int playerCount = 0, playerShopCount = 0;
public static String playersCurrentlyOn[] = new String[GameConstants.MAX_PLAYERS];
public static String playersCurrentlyOn[] = new String[Constants.MAX_PLAYERS];
public static boolean updateAnnounced;
public static boolean updateRunning;
public static int updateSeconds;
@@ -22,14 +23,14 @@ public class PlayerHandler {
private boolean kickAllPlayers = false;
static {
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
players[i] = null;
}
}
public boolean newPlayerClient(Client client1) {
int slot = -1;
for (int i = 1; i < GameConstants.MAX_PLAYERS; i++) {
for (int i = 1; i < Constants.MAX_PLAYERS; i++) {
if (players[i] == null || players[i].disconnected) {
slot = i;
break;
@@ -43,7 +44,7 @@ public class PlayerHandler {
players[slot] = client1;
players[slot].isActive = true;
players[slot].connectedFrom = client1.isBot ? "127.0.0.1" : ((InetSocketAddress) client1.getSession().getRemoteAddress()).getAddress().getHostAddress();
if (GameConstants.SERVER_DEBUG) {
if (Constants.SERVER_DEBUG) {
Misc.println("Player Slot " + slot + " slot 0 " + players[0]
+ " Player Hit " + players[slot]);
}
@@ -56,7 +57,7 @@ public class PlayerHandler {
public static int getNonPlayerCount() {
int count = 0;
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
if (players[i] != null) {
if (players[i].playerRights >= 1) {
count++;
@@ -73,7 +74,7 @@ public class PlayerHandler {
public void updatePlayerNames() {
playerShopCount = 0;
playerCount = 0;
for (int i = 0; i < GameConstants.MAX_PLAYERS; i++) {
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
if (players[i] != null) {
playersCurrentlyOn[i] = players[i].playerName;
if (players[i].isBot)
@@ -331,7 +332,7 @@ public class PlayerHandler {
}
private final Stream updateBlock = new Stream(
new byte[GameConstants.BUFFER_SIZE]);
new byte[Constants.BUFFER_SIZE]);
public void updatePlayer(Player plr, Stream outStr) {
// synchronized(plr) {

Some files were not shown because too many files have changed in this diff Show More