Compare commits

...

13 Commits

Author SHA1 Message Date
Dark98 997ccce97f Update Readme For Local Bot Client Use 2022-10-26 04:22:31 +01:00
dependabot[bot] cb3686a9f5 Bump jackson-databind from 2.10.5.1 to 2.13.4.1 in /2006Scape Server
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.10.5.1 to 2.13.4.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 04:22:30 +01:00
dependabot[bot] 374b03a691 Bump gson from 2.8.6 to 2.8.9 in /2006Scape Server
Bumps [gson](https://github.com/google/gson) from 2.8.6 to 2.8.9.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.6...gson-parent-2.8.9)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 04:22:30 +01:00
Dark98 7bc2b8bf7a Setup GH Actions For Windows Single-Player 2022-10-26 04:22:30 +01:00
Josh Shippam fab3c3eac7 Various Changes (#533)
* Add Shield Blocking Emote For Two NPC's

* Fix KARAMBWAN HP Restore Amount

* Add Link Command To Discord Bot

* Github Actions Update
2022-10-26 04:22:30 +01:00
Olivier f254773b39 Merge pull request #527
* Various Fixes

* Sea Turtle can be cooked, fixed xp received when cooking Manta Ray
* Al kharid warrior has correct emote when fighting
* Drop tables only roll once for items that do not have 100% drop rate (Prevents multiple items from rolling and dropping on same npc)
* Nerfed Tree Spirit (Lost City) max hit (From 20 to 10)
* Nerfed Abyssal Demon max hit (From 16 to 8)
2022-10-26 04:22:30 +01:00
darkaidz98@gmail.com 0481b9327d Revert Library Updates To Fix Server 2022-10-26 04:22:30 +01:00
Josh Shippam 860adc8194 Various Changes (#523)
* Discord Bot Update

Updated JavaCord To Latest
Changed Some Commands To No Longer Be World Specific
Added An "AdminCommands" Command

* Update Some Server Libs

* Added Purge & Pin/Un-Pin To Commands Discord Bot

* Fixed -dev & -no-crc Client Args

* Add Discord User ID Linking Support(Useless For Now)

* Added Support For User's Kicking Own Accounts Through Discord Bot

* Merge Website Integration Stuff Into One Var
2022-10-26 04:22:30 +01:00
Teddy 8b3bdc8045 East falador staircase was falling into the last if which was teleporting the player to a void (#522)
Co-authored-by: Sad Emu <wcpro111@gmail.com>
2022-10-26 04:22:30 +01:00
Teddy d061f18128 Added jad ranged attack projectile (#521)
Co-authored-by: Sad Emu <wcpro111@gmail.com>
2022-10-26 04:22:30 +01:00
Dark98 3e00708936 Added Current World To Client Title 2022-10-26 04:22:30 +01:00
Dark98 315d103f01 Added/Fixed Right Click Banking For Fadli(Duel Arena Banker) 2022-10-26 04:22:30 +01:00
Dark98 5f4a5ef8b6 Fix Discord Bot Derp 2022-10-26 04:22:30 +01:00
36 changed files with 326 additions and 129 deletions
+16 -4
View File
@@ -1,4 +1,4 @@
# This workflow will build a Java project with Maven # This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven name: Java CI with Maven
@@ -11,9 +11,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 1.8 - name: Set up JDK 1.8
@@ -21,4 +19,18 @@ jobs:
with: with:
java-version: 1.8 java-version: 1.8
- name: Build with Maven - name: Build with Maven
run: mvn -B clean install id: build
run: |
mvn -B clean package
mkdir -p ~/artifacts
cp "2006Scape Client/target/client-1.0-jar-with-dependencies.jar" ~/artifacts/Client.jar
cp "2006Scape Server/target/server-1.0-jar-with-dependencies.jar" ~/artifacts/Server.jar
cp "2006Scape Server/ServerConfig.Sample.json" ~/artifacts/ServerConfig.json
cp SinglePlayer.bat ~/artifacts/
cp -r "2006Scape Server/plugins" ~/artifacts/
cp -r "2006Scape Server/data" ~/artifacts/
- name: Publish build to GH Actions
uses: actions/upload-artifact@v2
with:
path: ~/artifacts/*
name: 2006Scape-Build
@@ -21,7 +21,7 @@ public class ClientSettings {
* You don't have to change this, the client will automatically connect to the server * You don't have to change this, the client will automatically connect to the server
* on localhost (Assuming you're running Client and LocalGame respectively) * on localhost (Assuming you're running Client and LocalGame respectively)
*/ */
public static String SERVER_IP = "www.2006Scape.org"; public static String SERVER_IP = "server.2006Scape.org";
/** /**
* The Servers World * The Servers World
* This Determines The Port The Server Will Connect On * This Determines The Port The Server Will Connect On
+12 -10
View File
@@ -15,6 +15,18 @@ public final class Main {
try { try {
// Process server/ip address to connect to // Process server/ip address to connect to
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
switch(args[i]) {
case "-dev" :
case "-local":
case "-offline":
ClientSettings.SERVER_IP = "localhost";
ClientSettings.CHECK_CRC = false;
break;
case "-no-crc":
case "-no-cache-crc":
ClientSettings.CHECK_CRC = false;
break;
}
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) { if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch(args[i]) { switch(args[i]) {
case "-s": case "-s":
@@ -22,16 +34,6 @@ public final class Main {
case "-ip": case "-ip":
ClientSettings.SERVER_IP = args[++i]; ClientSettings.SERVER_IP = args[++i];
break; break;
case "-no-crc":
case "-no-cache-crc":
ClientSettings.CHECK_CRC = false;
break;
case "-dev" :
case "-local":
case "-offline":
ClientSettings.SERVER_IP = "localhost";
ClientSettings.CHECK_CRC = false;
break;
} }
} }
} }
+1 -2
View File
@@ -4,12 +4,11 @@
import java.awt.*; import java.awt.*;
@SuppressWarnings("serial")
final class RSFrame extends Frame { final class RSFrame extends Frame {
public RSFrame(RSApplet RSApplet_, int i, int j) { public RSFrame(RSApplet RSApplet_, int i, int j) {
rsApplet = RSApplet_; rsApplet = RSApplet_;
setTitle(ClientSettings.SERVER_NAME); setTitle(ClientSettings.SERVER_NAME + " World: " + ClientSettings.SERVER_WORLD);
setResizable(false); setResizable(false);
setMinimumSize(new Dimension(i + 8, j + 28)); setMinimumSize(new Dimension(i + 8, j + 28));
setVisible(true); setVisible(true);
+1 -1
View File
@@ -19,5 +19,5 @@
"timeout": 60, "timeout": 60,
"item_requirements": true, "item_requirements": true,
"max_players": 200, "max_players": 200,
"website_total_characters_integration": false "website_integration": false
} }
+9 -9
View File
@@ -10970,7 +10970,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3425, "x": 3425,
@@ -10980,7 +10980,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3428, "x": 3428,
@@ -10990,7 +10990,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3425, "x": 3425,
@@ -11000,7 +11000,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3423, "x": 3423,
@@ -11010,7 +11010,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3427, "x": 3427,
@@ -11020,7 +11020,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3416, "x": 3416,
@@ -11030,7 +11030,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3413, "x": 3413,
@@ -11040,7 +11040,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3410, "x": 3410,
@@ -11050,7 +11050,7 @@
"height": 2 "height": 2
}, },
{ {
"maxHit": 16, "maxHit": 8,
"strength": 150, "strength": 150,
"attack": 250, "attack": 250,
"x": 3413, "x": 3413,
@@ -0,0 +1,17 @@
package plugin.npc.fadli
import com.rs2.event.EventContext
import com.rs2.event.EventSubscriber
import com.rs2.event.SubscribesTo
import com.rs2.event.impl.NpcSecondClickEvent
import com.rs2.game.players.Player
@SubscribesTo(NpcSecondClickEvent::class)
class SecondClick : EventSubscriber<NpcSecondClickEvent> {
override fun subscribe(context: EventContext, player: Player, event: NpcSecondClickEvent) {
if (event.npc == 958) {
player.packetSender.openUpBank()
}
}
}
+6 -6
View File
@@ -10,8 +10,8 @@
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<kotlin.version>1.5.31</kotlin.version> <kotlin.version>1.6.10</kotlin.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental> <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties> </properties>
<repositories> <repositories>
@@ -50,7 +50,7 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.10.5.1</version> <version>2.13.4.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.json/json --> <!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency> <dependency>
@@ -134,19 +134,19 @@
<dependency> <dependency>
<groupId>org.javacord</groupId> <groupId>org.javacord</groupId>
<artifactId>javacord-api</artifactId> <artifactId>javacord-api</artifactId>
<version>3.1.1</version> <version>3.3.2</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.javacord/javacord-core --> <!-- https://mvnrepository.com/artifact/org.javacord/javacord-core -->
<dependency> <dependency>
<groupId>org.javacord</groupId> <groupId>org.javacord</groupId>
<artifactId>javacord-core</artifactId> <artifactId>javacord-core</artifactId>
<version>3.1.1</version> <version>3.3.2</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson --> <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.8.6</version> <version>2.8.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.everythingrs</groupId> <groupId>com.everythingrs</groupId>
@@ -64,8 +64,8 @@ public class ConfigLoader {
GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i); GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i);
} }
} }
if(obj.has("website_total_characters_integration")) if(obj.has("website_integration"))
GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION = obj.getBoolean("website_total_characters_integration"); GameConstants.WEBSITE_INTEGRATION = obj.getBoolean("website_integration");
} }
private static void initialize() { private static void initialize() {
@@ -26,6 +26,7 @@ public class GameConstants {
* VARIABLE_XP_RATE Allows Players To Choose An XP Rate Set In VARIABLE_XP_RATES * VARIABLE_XP_RATE Allows Players To Choose An XP Rate Set In VARIABLE_XP_RATES
* VARIABLE_XP_RATES Defines The XP Rates That Should Be Available To Players When VARIABLE_XP_RATES is true(Array Must Contain Four Entries) * VARIABLE_XP_RATES Defines The XP Rates That Should Be Available To Players When VARIABLE_XP_RATES is true(Array Must Contain Four Entries)
* XP_RATE Sets The XP Rate Multiplier For All Players/Skills If VARIABLE_XP_RATES is false * XP_RATE Sets The XP Rate Multiplier For All Players/Skills If VARIABLE_XP_RATES is false
* WEBSITE_INTEGRATION Enables/Disables Website Features(Total Accounts Registered & Players Online)
*/ */
public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org"; public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org";
public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120, public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120,
@@ -33,7 +34,7 @@ public class GameConstants {
public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false, public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false,
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true, PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false, ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false,
WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false; WEBSITE_INTEGRATION = false;
public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10}; public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10};
public static double TEST_VERSION = 2.3, XP_RATE = 1.0; public static double TEST_VERSION = 2.3, XP_RATE = 1.0;
@@ -52,7 +52,7 @@ import org.apollo.jagcached.FileServer;
/** /**
* Server.java * Server.java
* *
* @author Sanity * @author Sanity
* @author Graham * @author Graham
* @author Blake * @author Blake
@@ -60,10 +60,10 @@ import org.apollo.jagcached.FileServer;
* @author Integration Julian. * @author Integration Julian.
*/ */
public class GameEngine { public class GameEngine {
private static long minutesCounter; private static long minutesCounter;
private static void startMinutesCounter() { private static void startMinutesCounter() {
try { try {
minuteFile = new BufferedReader(new FileReader( minuteFile = new BufferedReader(new FileReader(
@@ -102,13 +102,12 @@ public class GameEngine {
public static void schedule(Tick tick) { public static void schedule(Tick tick) {
getScheduler().schedule(tick); getScheduler().schedule(tick);
} }
public static String ersSecret; public static String ersSecret;
public static int[] cannonsX = new int [50]; public static int[] cannonsX = new int[50];
public static int[] cannonsY = new int [50]; public static int[] cannonsY = new int[50];
public static String[] cannonsO = new String [50]; public static String[] cannonsO = new String[50];
public static boolean sleeping; public static boolean sleeping;
public static boolean updateServer = false; public static boolean updateServer = false;
public static long lastMassSave = System.currentTimeMillis(); public static long lastMassSave = System.currentTimeMillis();
@@ -127,7 +126,7 @@ public class GameEngine {
public static ObjectManager objectManager = new ObjectManager(); public static ObjectManager objectManager = new ObjectManager();
public static FightCaves fightCaves = new FightCaves(); public static FightCaves fightCaves = new FightCaves();
private static PestControl pestControl = new PestControl(); private static PestControl pestControl = new PestControl();
public static Trawler trawler = new Trawler(); public static Trawler trawler = new Trawler();
private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); private final static ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
private final static Lock lock = new ReentrantLock(); private final static Lock lock = new ReentrantLock();
@@ -138,12 +137,11 @@ public class GameEngine {
public static void main(java.lang.String[] args) public static void main(java.lang.String[] args)
throws NullPointerException, IOException { throws NullPointerException, IOException {
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) { if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
switch(args[i]) { switch (args[i]) {
case "-c": case "-c":
case "-config": case "-config":
try { try {
//TODO Load A Default Config File When Arg Not Used
System.out.println("Loading External Config.."); System.out.println("Loading External Config..");
ConfigLoader.loadSettings(args[++i]); ConfigLoader.loadSettings(args[++i]);
System.out.println("Loaded Config File " + args[i]); System.out.println("Loaded Config File " + args[i]);
@@ -161,9 +159,8 @@ public class GameEngine {
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@"); System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
} }
if (!new File("data").exists()) if (!new File("data").exists()) {
{ System.out.println("************************************");
System.out.println("************************************");
System.out.println("************************************"); System.out.println("************************************");
System.out.println("************************************"); System.out.println("************************************");
System.out.println("WARNING: I could not find the /data folder. You are LIKELY running this in the wrong directory!"); System.out.println("WARNING: I could not find the /data folder. You are LIKELY running this in the wrong directory!");
@@ -183,7 +180,7 @@ public class GameEngine {
/** /**
* Starts The File Server If Enabled In GameConstants * Starts The File Server If Enabled In GameConstants
*/ */
if(GameConstants.FILE_SERVER) { if (GameConstants.FILE_SERVER) {
FileServer fs = new FileServer(); FileServer fs = new FileServer();
try { try {
fs.start(); fs.start();
@@ -194,7 +191,7 @@ public class GameEngine {
/** /**
* Start Integration Services * Start Integration Services
**/ **/
ConfigLoader.loadSecrets(); ConfigLoader.loadSecrets();
JavaCord.init(); JavaCord.init();
@@ -240,11 +237,11 @@ public class GameEngine {
/** /**
* Main Server Tick * Main Server Tick
* *
* This scheduler will tick once every 600ms. If the previous tick takes * This scheduler will tick once every 600ms. If the previous tick takes
* 300ms to execute, this scheduler will wait 300ms only before the next * 300ms to execute, this scheduler will wait 300ms only before the next
* tick. * tick.
* *
* scheduleAtFixedRate() does not invoke concurrent Runnables. * scheduleAtFixedRate() does not invoke concurrent Runnables.
*/ */
scheduler.scheduleAtFixedRate(new Runnable() { scheduler.scheduleAtFixedRate(new Runnable() {
@@ -267,11 +264,11 @@ public class GameEngine {
objectHandler.process(); objectHandler.process();
MageTrainingArena.process(); MageTrainingArena.process();
CycleEventHandler.getSingleton().process(); CycleEventHandler.getSingleton().process();
PlayersOnlineWebsite.addUpdatePlayersOnlineTask(); if (GameConstants.WEBSITE_INTEGRATION) {
if(GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION) { PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
RegisteredAccsWebsite.addUpdateRegisteredUsersTask(); RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
} }
if(DiscordActivity.playerCount) { if (DiscordActivity.playerCount) {
DiscordActivity.updateActivity(); DiscordActivity.updateActivity();
} }
if (System.currentTimeMillis() - lastMassSave > 300000) { if (System.currentTimeMillis() - lastMassSave > 300000) {
@@ -304,13 +301,13 @@ public class GameEngine {
} }
} }
}, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS); }, 0, GameConstants.CYCLE_TIME, TimeUnit.MILLISECONDS);
/* /*
* I'd recommend disabling this until I can be bothered to implement it * I'd recommend disabling this until I can be bothered to implement it
* properly. * properly.
*/ */
// CommandConsole.getInstance(); // CommandConsole.getInstance();
try { try {
while (!scheduler.awaitTermination(60, TimeUnit.SECONDS)) { while (!scheduler.awaitTermination(60, TimeUnit.SECONDS)) {
// TODO // TODO
@@ -319,7 +316,7 @@ public class GameEngine {
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
acceptor = null; acceptor = null;
connectionHandler = null; connectionHandler = null;
sac = null; sac = null;
@@ -328,6 +325,4 @@ public class GameEngine {
public static boolean playerExecuted = false; public static boolean playerExecuted = false;
private static BufferedReader minuteFile; private static BufferedReader minuteFile;
}
}
@@ -508,8 +508,7 @@ public class NpcCombat {
NpcHandler.npcs[i].projectileId = 448; NpcHandler.npcs[i].projectileId = 448;
} else if (r3 == 1) { } else if (r3 == 1) {
NpcHandler.npcs[i].attackType = 1; NpcHandler.npcs[i].attackType = 1;
NpcHandler.npcs[i].endGfx = 451; NpcHandler.npcs[i].projectileId = 451;
NpcHandler.npcs[i].projectileId = -1;
} else if (r3 == 2) { } else if (r3 == 2) {
NpcHandler.npcs[i].attackType = 0; NpcHandler.npcs[i].attackType = 0;
NpcHandler.npcs[i].projectileId = -1; NpcHandler.npcs[i].projectileId = -1;
@@ -11,7 +11,9 @@ import com.rs2.game.players.Player;
public enum NpcEmotes { public enum NpcEmotes {
MAN(new int[] {1, 2, 3, 4, 5, 6}, 422, 1834, 836), MAN(new int[] {1, 2, 3, 4, 5, 6}, 422, 1834, 836),
GUARD(new int[] {9, 10}, 412, 404, 836), AL_KHARID_WARRIOR(new int[] {18}, 451, 1156, 836),
GUARD(new int[] {9}, 412, 1156, 836),
GUARD_NO_SHIELD(new int[] {10}, 412, 404, 836),
GARGOYLE(new int[] {1610, 1611}, 1517, 1519, 1518), GARGOYLE(new int[] {1610, 1611}, 1517, 1519, 1518),
SKELETAL_WYVERN(new int[] {3068}, 2989, 2988, 2987), SKELETAL_WYVERN(new int[] {3068}, 2989, 2988, 2987),
BAT(new int[] {412, 78}, 30, 31, 36), BAT(new int[] {412, 78}, 30, 31, 36),
@@ -24,7 +24,7 @@ public class Food {
MANTA(391, 22, "Manta Ray", 0, "Food", false), MANTA(391, 22, "Manta Ray", 0, "Food", false),
SHARK(385, 20, "Shark", 0, "Food", false), SHARK(385, 20, "Shark", 0, "Food", false),
LOBSTER(379, 12, "Lobster", 0, "Food", false), LOBSTER(379, 12, "Lobster", 0, "Food", false),
KARAMBWAN(3144, 2 + Misc.random(4), "Karambwan", 0, "Food", false), KARAMBWAN(3144, 18, "Karambwan", 0, "Food", false),
TROUT(333, 7, "Trout", 0, "Food", false), TROUT(333, 7, "Trout", 0, "Food", false),
SALMON(329, 9, "Salmon", 0, "Food", false), SALMON(329, 9, "Salmon", 0, "Food", false),
SWORDFISH(373, 14, "Swordfish", 0, "Food", false), SWORDFISH(373, 14, "Swordfish", 0, "Food", false),
@@ -38,8 +38,9 @@ public class Cooking extends SkillHandler {
LOBSTER(377, 379, 381, 40, 120, 74, 68, "lobster"), LOBSTER(377, 379, 381, 40, 120, 74, 68, "lobster"),
SWORDFISH(371, 373, 375, 50, 140, 86, 81, "swordfish"), SWORDFISH(371, 373, 375, 50, 140, 86, 81, "swordfish"),
MONKFISH(7944, 7946, 7948, 62, 150, 92, 90, "monkfish"), MONKFISH(7944, 7946, 7948, 62, 150, 92, 90, "monkfish"),
SHARK(383, 385, 387, 76, 210, 100, 94, "shark"), SHARK(383, 385, 387, 76, 210, 100, 94, "shark"),
MANTA_RAY(389, 391, 393, 91, 169, 100, 100, "manta ray"), SEA_TURTLE(395, 397, 399, 82, 211, 100, 100, "sea turtle"),
MANTA_RAY(389, 391, 393, 91, 216, 100, 100, "manta ray"),
SEAWEED(401, 1781, 1781, 1, 1, 1, 1, "sea weed"), SEAWEED(401, 1781, 1781, 1, 1, 1, 1, "sea weed"),
CURRY(2009, 2011, 2013, 60, 280, 74, 74, "curry"); CURRY(2009, 2011, 2013, 60, 280, 74, 74, "curry");
@@ -1049,10 +1049,14 @@ public class NpcHandler {
// These npcs shouldn't have drops // These npcs shouldn't have drops
return; return;
} }
boolean isDropped = false;
for (ItemDrop possible_drop : NPCDropsHandler.getNpcDrops(getNpcListName(npcs[i].npcType).toLowerCase().replace(" ", "_"), npcs[i].npcType)) { for (ItemDrop possible_drop : NPCDropsHandler.getNpcDrops(getNpcListName(npcs[i].npcType).toLowerCase().replace(" ", "_"), npcs[i].npcType)) {
if (Misc.random(possible_drop.getChance()) == 0) { if (Misc.random(possible_drop.getChance()) == 0 && !isDropped) {
int amt = possible_drop.getAmount(); int amt = possible_drop.getAmount();
GameEngine.itemHandler.createGroundItem(c, possible_drop.getItemID(), npcs[i].absX, npcs[i].absY, amt, c.playerId); GameEngine.itemHandler.createGroundItem(c, possible_drop.getItemID(), npcs[i].absX, npcs[i].absY, amt, c.playerId);
//Making sure items that always drop don't cost us our drop table roll
if (possible_drop.getChance() > 1)
isDropped = true;
} }
} }
switch (npcs[i].npcType) { switch (npcs[i].npcType) {
@@ -229,6 +229,8 @@ public class Climbing {
} else if (client.objectX == 2603 && client.objectY == 3078) { } else if (client.objectX == 2603 && client.objectY == 3078) {
client.getPlayerAssistant().feature("using this staircase"); client.getPlayerAssistant().feature("using this staircase");
client.resetWalkingQueue(); client.resetWalkingQueue();
} else if (client.objectX == 3058 && client.objectY == 3376) {
client.resetWalkingQueue();
} else if (client.absX != 3186) { } else if (client.absX != 3186) {
client.getPlayerAssistant().movePlayer(client.absX, client.getPlayerAssistant().movePlayer(client.absX,
client.absY + 6393, 0); client.absY + 6393, 0);
@@ -75,6 +75,7 @@ public abstract class Player {
public byte buffer[] = null; public byte buffer[] = null;
public String lastConnectedFrom; public String lastConnectedFrom;
public static int xpRate = 1; public static int xpRate = 1;
public String discordCode;
private Compost compost = new Compost(this); private Compost compost = new Compost(this);
private Allotments allotment = new Allotments(this); private Allotments allotment = new Allotments(this);
private Flowers flower = new Flowers(this); private Flowers flower = new Flowers(this);
@@ -155,6 +156,10 @@ public abstract class Player {
public void setXPRate(int xpRate) { this.xpRate = xpRate; } public void setXPRate(int xpRate) { this.xpRate = xpRate; }
public String getDiscordCode() { return discordCode; }
public void setDiscordCode(String code) { this.discordCode = code; }
public boolean isPreaching() { public boolean isPreaching() {
return preaching; return preaching;
} }
@@ -433,6 +433,9 @@ public class PlayerSave {
case "unlocked-bones-to-peaches": case "unlocked-bones-to-peaches":
player.unlockedBonesToPeaches = Boolean.parseBoolean(token2); player.unlockedBonesToPeaches = Boolean.parseBoolean(token2);
break; break;
case "discord-user-id":
player.discordCode = token2;
break;
} }
break; break;
case 3: case 3:
@@ -823,6 +826,8 @@ public class PlayerSave {
} }
characterfile.write("void = " + voidStatus.trim()); characterfile.write("void = " + voidStatus.trim());
characterfile.newLine(); characterfile.newLine();
characterfile.write("discord-user-id = " + player.discordCode);
characterfile.newLine();
characterfile.newLine(); characterfile.newLine();
/* EQUIPMENT */ /* EQUIPMENT */
@@ -2,9 +2,7 @@ package com.rs2.integrations.discord;
import com.rs2.GameConstants; import com.rs2.GameConstants;
import com.rs2.integrations.discord.commands.*; import com.rs2.integrations.discord.commands.*;
import com.rs2.integrations.discord.commands.admin.GameKick; import com.rs2.integrations.discord.commands.admin.*;
import com.rs2.integrations.discord.commands.admin.MoveHome;
import com.rs2.integrations.discord.commands.admin.Update;
import org.javacord.api.DiscordApi; import org.javacord.api.DiscordApi;
import org.javacord.api.DiscordApiBuilder; import org.javacord.api.DiscordApiBuilder;
import org.javacord.api.entity.channel.TextChannel; import org.javacord.api.entity.channel.TextChannel;
@@ -34,14 +32,20 @@ public class JavaCord {
api.addListener(new Forum()); api.addListener(new Forum());
api.addListener(new Hiscores()); api.addListener(new Hiscores());
api.addListener(new Issues()); api.addListener(new Issues());
api.addListener(new Link());
api.addListener(new Online()); api.addListener(new Online());
api.addListener(new Players()); api.addListener(new Players());
api.addListener(new Vote()); api.addListener(new Vote());
api.addListener(new Website()); api.addListener(new Website());
//Admin Commands //Admin Commands
api.addListener(new AdminCommands());
api.addListener(new GameKick()); api.addListener(new GameKick());
api.addListener(new MoveHome()); api.addListener(new MoveHome());
api.addListener(new Update()); api.addListener(new Update());
api.addListener(new Pin());
api.addListener(new Purge());
//api.addListener(new Link());
//api.addListener(new WelcomeMessage());
if(!DiscordActivity.playerCount) { if(!DiscordActivity.playerCount) {
api.updateActivity(GameConstants.WEBSITE_LINK); api.updateActivity(GameConstants.WEBSITE_LINK);
} }
@@ -0,0 +1,16 @@
package com.rs2.integrations.discord;
import com.rs2.GameConstants;
import org.javacord.api.event.server.member.ServerMemberJoinEvent;
import org.javacord.api.listener.server.member.ServerMemberJoinListener;
public class WelcomeMessage implements ServerMemberJoinListener {
@Override
public void onServerMemberJoin(ServerMemberJoinEvent event) {
String welcomeMessageChannel = "655143683083206667";
if (GameConstants.WORLD == 1) {
event.getApi().getTextChannelById(welcomeMessageChannel).get().
sendMessage("Hello " + event.getUser().getMentionTag() + " And Welcome To " + JavaCord.serverName + ".");
}
}
}
@@ -12,17 +12,21 @@ public class Commands implements MessageCreateListener {
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " commands")) { if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " commands")) {
event.getChannel().sendMessage("```fix" event.getChannel().sendMessage("```fix"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " forum/" + JavaCord.commandPrefix + " forums" "::link"
+ System.lineSeparator() +
"::forum/::forums"
+ System.lineSeparator() +
JavaCord.commandPrefix + " gamekick(if account id linked)"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " hiscores/" + JavaCord.commandPrefix + " highscores" JavaCord.commandPrefix + " hiscores/" + JavaCord.commandPrefix + " highscores"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " issues/" + JavaCord.commandPrefix + " bugs" "::issues/::bugs"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " online" JavaCord.commandPrefix + " online"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " vote" "::vote"
+ System.lineSeparator() + + System.lineSeparator() +
JavaCord.commandPrefix + " website/" + JavaCord.commandPrefix + " site" "::website/::site"
+ "```"); + "```");
} }
} }
@@ -1,6 +1,5 @@
package com.rs2.integrations.discord.commands; package com.rs2.integrations.discord.commands;
import com.rs2.integrations.discord.JavaCord;
import org.javacord.api.entity.message.Message; import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent; import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener; import org.javacord.api.listener.message.MessageCreateListener;
@@ -11,8 +10,10 @@ public class Forum implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage(); Message message = event.getMessage();
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forum") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forums")) { if (message.getContent().equalsIgnoreCase("::forum") || message.getContent().equalsIgnoreCase("::forums")) {
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/forums/index.php"); if (GameConstants.WORLD == 1) {
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/forums/index.php");
}
} }
} }
} }
@@ -1,6 +1,6 @@
package com.rs2.integrations.discord.commands; package com.rs2.integrations.discord.commands;
import com.rs2.integrations.discord.JavaCord; import com.rs2.GameConstants;
import org.javacord.api.entity.message.Message; import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent; import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener; import org.javacord.api.listener.message.MessageCreateListener;
@@ -9,8 +9,10 @@ public class Issues implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage(); Message message = event.getMessage();
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " issues") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix+ " bugs")) { if (message.getContent().equalsIgnoreCase("::issues") || message.getContent().equalsIgnoreCase("::bugs")) {
event.getChannel().sendMessage("https://github.com/2006-Scape/2006Scape/issues"); if (GameConstants.WORLD == 1) {
event.getChannel().sendMessage("https://github.com/2006-Scape/2006Scape/issues");
}
} }
} }
} }
@@ -0,0 +1,18 @@
package com.rs2.integrations.discord.commands;
import org.javacord.api.entity.message.Message;
import org.javacord.api.entity.user.User;
import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener;
public class Link implements MessageCreateListener {
@Override
public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage();
User user = message.getAuthor().asUser().get();
if (message.getContent().equalsIgnoreCase("::link")) {
event.getChannel().sendMessage(user.getMentionTag() + ", Please check your DM's to continue.");
user.sendMessage("Please copy/paste the following in-game to link your Discord account: \n ```::link " + user.getIdAsString() + "```");
}
}
}
@@ -1,6 +1,5 @@
package com.rs2.integrations.discord.commands; package com.rs2.integrations.discord.commands;
import com.rs2.integrations.discord.JavaCord;
import org.javacord.api.entity.message.Message; import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent; import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener; import org.javacord.api.listener.message.MessageCreateListener;
@@ -11,8 +10,10 @@ public class Vote implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage(); Message message = event.getMessage();
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " vote")) { if (message.getContent().equalsIgnoreCase("::vote")) {
if (GameConstants.WORLD == 1) {
event.getChannel().sendMessage("Visit " + GameConstants.WEBSITE_LINK + "/vote.html then type \"::claimvote\" in-game to receive your reward!"); event.getChannel().sendMessage("Visit " + GameConstants.WEBSITE_LINK + "/vote.html then type \"::claimvote\" in-game to receive your reward!");
}
} }
} }
} }
@@ -1,6 +1,5 @@
package com.rs2.integrations.discord.commands; package com.rs2.integrations.discord.commands;
import com.rs2.integrations.discord.JavaCord;
import org.javacord.api.entity.message.Message; import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent; import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener; import org.javacord.api.listener.message.MessageCreateListener;
@@ -11,8 +10,10 @@ public class Website implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage(); Message message = event.getMessage();
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " website") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " site")) { if (message.getContent().equalsIgnoreCase("::website") || message.getContent().equalsIgnoreCase("::site")) {
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK); if (GameConstants.WORLD == 1) {
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK);
}
} }
} }
} }
@@ -0,0 +1,31 @@
package com.rs2.integrations.discord.commands.admin;
import com.rs2.integrations.discord.JavaCord;
import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener;
public class AdminCommands implements MessageCreateListener {
@Override
public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage();
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " admincommands")) {
if (event.getMessageAuthor().isServerAdmin()) {
event.getChannel().sendMessage("```fix"
+ System.lineSeparator() +
"::pin/::unpin(Pins/Un-Pins The Replied Mesage)"
+ System.lineSeparator() +
"::purge(Purges The Specified Amount Of Messages From Discord Channel)"
+ System.lineSeparator() +
JavaCord.commandPrefix + " gamekick(Kicks The Specified Player From The GameServer)"
+ System.lineSeparator() +
JavaCord.commandPrefix + " movehome(Moves The Specified Player To Lumbridge)"
+ System.lineSeparator() +
JavaCord.commandPrefix + " update(Triggers A GameServer Update In The Specified Amount Of Seconds)"
+ "```");
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
}
}
}
}
@@ -7,25 +7,27 @@ import com.rs2.integrations.discord.JavaCord;
import org.javacord.api.event.message.MessageCreateEvent; import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener; import org.javacord.api.listener.message.MessageCreateListener;
import java.util.Objects;
public class GameKick implements MessageCreateListener { public class GameKick implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " gamekick")) { if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " gamekick")) {
if (event.getMessageAuthor().isServerAdmin()) { String playerToKick = event.getMessageContent().replace( JavaCord.commandPrefix + " gamekick ", "");
String playerToKick = event.getMessageContent().replace( JavaCord.commandPrefix + " gamekick ", ""); for (Player player2 : PlayerHandler.players) {
for (Player player2 : PlayerHandler.players) { if (player2 != null) {
if (player2 != null) { if (player2.playerName.equalsIgnoreCase(playerToKick)) {
if (player2.playerName.equalsIgnoreCase(playerToKick)) { Client c2 = (Client) player2;
Client c2 = (Client) player2; if (event.getMessageAuthor().isServerAdmin() || Objects.equals(event.getMessageAuthor().getIdAsString(), c2.discordCode)) {
event.getChannel().sendMessage( playerToKick+ " was kicked by " + event.getMessageAuthor().getDisplayName() + "."); event.getChannel().sendMessage(playerToKick + " was kicked by " + event.getMessageAuthor().getDisplayName() + ".");
c2.disconnected = true; c2.disconnected = true;
c2.logout(true); c2.logout(true);
break; } else {
event.getChannel().sendMessage("You do not have permission to perform this command");
} }
break;
} }
} }
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
} }
} }
} }
@@ -0,0 +1,39 @@
package com.rs2.integrations.discord.commands.admin;
import com.rs2.GameConstants;
import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener;
public class Pin implements MessageCreateListener {
@Override
public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage();
if (message.getContent().startsWith("::pin")) {
if (event.getMessageAuthor().isServerAdmin()) {
if(GameConstants.WORLD == 1) {
if (message.getReferencedMessage().isPresent()) {
Message messageToPin = message.getReferencedMessage().get();
messageToPin.pin();
}
}
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
}
}
if (message.getContent().startsWith("::unpin")) {
if (event.getMessageAuthor().isServerAdmin()) {
if(GameConstants.WORLD == 1) {
if (message.getReferencedMessage().isPresent()) {
Message messageToUnpin = message.getReferencedMessage().get();
messageToUnpin.unpin();
event.getChannel().sendMessage("Un-Pinned Message: " + messageToUnpin.getLink());
}
}
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
}
}
}
}
@@ -0,0 +1,40 @@
package com.rs2.integrations.discord.commands.admin;
import com.rs2.GameConstants;
import org.javacord.api.entity.message.Message;
import org.javacord.api.event.message.MessageCreateEvent;
import org.javacord.api.listener.message.MessageCreateListener;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
public class Purge implements MessageCreateListener {
@Override
public void onMessageCreate(MessageCreateEvent event) {
Message message = event.getMessage();
if (message.getContent().startsWith("::purge")) {
if (event.getMessageAuthor().isServerAdmin()) {
if(GameConstants.WORLD == 1) {
int messagesToPurge = Integer.parseInt(event.getMessageContent().replace("::purge ", ""));
if (messagesToPurge > 50) {
event.getChannel().sendMessage("Can't purge more than 50 messages at once.");
return;
}
try {
event.getChannel().sendMessage("Purging " + messagesToPurge + " Messages.");
message.getMessagesBefore(messagesToPurge).get().deleteAll();
Message Purge = message.getMessagesAfter(1).get().getNewestMessage().get();
Purge.edit("Purged " + messagesToPurge + " Messages.");
TimeUnit.SECONDS.sleep(5);
message.delete();
Purge.delete();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
}
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
}
}
}
}
@@ -8,17 +8,17 @@ import org.javacord.api.listener.message.MessageCreateListener;
public class Update implements MessageCreateListener { public class Update implements MessageCreateListener {
@Override @Override
public void onMessageCreate(MessageCreateEvent event) { public void onMessageCreate(MessageCreateEvent event) {
if(event.getMessageAuthor().isServerAdmin()) { String seconds = event.getMessageContent().replace(JavaCord.commandPrefix + " update ", "");
String seconds = event.getMessageContent().replace(JavaCord.commandPrefix + " update ", ""); if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " update")) {
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " update")) { if (event.getMessageAuthor().isServerAdmin()) {
PlayerHandler.updateSeconds = Integer.parseInt(seconds); PlayerHandler.updateSeconds = Integer.parseInt(seconds);
PlayerHandler.updateAnnounced = false; PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true; PlayerHandler.updateRunning = true;
PlayerHandler.updateStartTime = System.currentTimeMillis(); PlayerHandler.updateStartTime = System.currentTimeMillis();
event.getChannel().sendMessage("Server update will begin in " + seconds + " seconds."); event.getChannel().sendMessage("Server update will begin in " + seconds + " seconds.");
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
} }
} else {
event.getChannel().sendMessage("You do not have permission to perform this command");
} }
} }
} }
@@ -154,7 +154,7 @@ public class ClickObject implements PacketType {
if (player.spiritTree == false && player.clickedTree == false) { if (player.spiritTree == false && player.clickedTree == false) {
player.getPacketSender().sendMessage("You attempt to chop the tree, and a tree spirit appears !"); player.getPacketSender().sendMessage("You attempt to chop the tree, and a tree spirit appears !");
player.getPacketSender().sendSound(300, 100, 1); player.getPacketSender().sendSound(300, 100, 1);
NpcHandler.spawnNpc(player, 655, player.getX(), player.getY(), 0, 0, 225, 20, 80, 80, true, true); NpcHandler.spawnNpc(player, 655, player.getX(), player.getY(), 0, 0, 85, 10, 80, 80, true, true);
player.clickedTree = true; player.clickedTree = true;
} else if (player.spiritTree && player.lostCity >= 2) { } else if (player.spiritTree && player.lostCity >= 2) {
Woodcutting.startWoodcutting(player, player.objectId, player.objectX, player.objectY, player.clickObjectType); Woodcutting.startWoodcutting(player, player.objectId, player.objectX, player.objectY, player.clickObjectType);
@@ -44,6 +44,11 @@ public class Commands implements PacketType {
public static void playerCommands(Player player, String playerCommand, String[] arguments) { public static void playerCommands(Player player, String playerCommand, String[] arguments) {
switch (playerCommand.toLowerCase()) { switch (playerCommand.toLowerCase()) {
case "link":
player.setDiscordCode(arguments[0]);
player.getPacketSender().sendMessage("Your Account has now been linked with Discord User ID:");
player.getPacketSender().sendMessage(player.getDiscordCode());
break;
case "myxprate": case "myxprate":
case "checkxprate": case "checkxprate":
if(GameConstants.VARIABLE_XP_RATE) { if(GameConstants.VARIABLE_XP_RATE) {
+7 -24
View File
@@ -22,31 +22,14 @@
To compile any module from the command line, run `mvn clean install` To compile any module from the command line, run `mvn clean install`
## Using Parabot with your local server: (OUTDATED) ## Using Parabot with your local server:
- **1:** Download the latest `localhost_2006Scape.jar` from [here](https://github.com/2006-Scape/2006Scape/releases) (or, if testing server changes, compile it yourself like [this](https://i.imgur.com/uDrF0gl.png)) - **1:** Download the latest `2006-Scape Fork Of Parabot` from [here](https://github.com/2006-Scape/Parabot/actions/workflows/maven.yml)
- **2:** Download the latest `Provider-version.jar` file from [here](http://v3.bdn.parabot.org/api/bot/download/default-provider?nightly=false) - **2:** Run the parabot client with the following args:
- **3:** Create a file called `localhost.json` in `{user}\Documents\Parabot\servers`
- **4:** Put the following in the file
```json
{
"name": "localhost",
"author": "RedSparr0w",
"version": 1.0,
"client-class": "LocalGame",
"locations":{
"provider": "pathToYourJar/Provider-1.21.5.jar",
"server": "pathToYourJar/localhost_2006Scape.jar",
"hooks": "http://bdn.parabot.org/data/hooks/carmeuses/2006rebotted_hooks.xml"
}
}
```
_(you will need to put the path to the jar files yourself)_
- 5: Run the parabot client with the following args:
```fix ```fix
java -jar Client-2.8.1.jar -login username password -loadlocal -v -clearcache java -jar Parabot-V3.0.0.jar -login username password -loadlocal -v -clearcache
``` ```
- **6:** ??? - **3:** ???
- **7:** PROFIT - **4:** PROFIT
### Server source layout ### Server source layout
@@ -56,4 +39,4 @@ java -jar Client-2.8.1.jar -login username password -loadlocal -v -clearcache
## Building from command line ## Building from command line
Run `mvn -B clean install` Run `mvn -B clean package`
+6
View File
@@ -0,0 +1,6 @@
:: Runs The Server & FileServer
start cmd /k java -jar Server.jar -c ServerConfig.json
:: Used To Wait 6 Seconds Before Running The Client
PING localhost -n 6 >NUL
:: Starts The Client
start cmd /k java -jar Client.jar -s localhost