mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c61ba69f3 | |||
| 8d0000de0b | |||
| 8ee88848a3 | |||
| 3aaf413bc7 | |||
| d3f5ebc7a2 | |||
| 736b3b0ea3 | |||
| 24e5ad9415 | |||
| 79357215c7 | |||
| 6d23a5b536 | |||
| 790cc51d81 | |||
| 49a2810e3e | |||
| c7a6cb2811 | |||
| c47d9a4b15 | |||
| 83eb0be61a | |||
| 8761116b9b | |||
| c15722c766 | |||
| 5ed9394f44 | |||
| 375cc1ac6f | |||
| 2fc416c3e1 | |||
| f64b0469c2 | |||
| 5c02c34569 | |||
| d2faea6f71 | |||
| 38140d8665 | |||
| 8a10201637 | |||
| bdd5297a94 | |||
| 8ab31771b3 | |||
| 8fc1e17a25 | |||
| 1c5b400f00 | |||
| 00932b82ee | |||
| ccc0353bad | |||
| 45450dbb9c | |||
| ba7f84fc45 | |||
| f30a936ff6 | |||
| abe34d86b1 | |||
| d23b176a28 | |||
| c1202e8989 |
@@ -12,3 +12,6 @@
|
|||||||
2006Scape Client/bin/
|
2006Scape Client/bin/
|
||||||
*.prefs
|
*.prefs
|
||||||
*.classpath
|
*.classpath
|
||||||
|
|
||||||
|
# Ignore any json files in the server root (should only be config files, the sample file should still be updated)
|
||||||
|
2006Scape Server/*.json
|
||||||
|
|||||||
@@ -18,12 +18,24 @@ public class ClientSettings {
|
|||||||
public final static String SERVER_WEBSITE = "www.2006Scape.org";
|
public final static String SERVER_WEBSITE = "www.2006Scape.org";
|
||||||
/**
|
/**
|
||||||
* The Servers Ip
|
* The Servers Ip
|
||||||
*
|
|
||||||
* 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 = "www.2006Scape.org";
|
||||||
|
/**
|
||||||
|
* The Servers World
|
||||||
|
* This Determines The Port The Server Will Connect On
|
||||||
|
* World 1 Will Connect On Port 43594
|
||||||
|
* World 2 Will Connect On Port 43598
|
||||||
|
*/
|
||||||
|
public static int SERVER_WORLD = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables/Disables FileServer CRC Checking For Cache Updates
|
||||||
|
* FileServer Must Be Running Before Starting The Client If This Is True
|
||||||
|
*/
|
||||||
|
public static boolean CHECK_CRC = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Npc Bits for the Server
|
* The Npc Bits for the Server
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.text.DecimalFormat;
|
|||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.zip.CRC32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
|
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
|
||||||
@@ -3429,11 +3430,12 @@ public class Game extends RSApplet {
|
|||||||
}
|
}
|
||||||
} catch (Exception _ex) {
|
} catch (Exception _ex) {
|
||||||
}
|
}
|
||||||
if (abyte0 != null) {
|
if(abyte0 != null && ClientSettings.CHECK_CRC) {
|
||||||
// aCRC32_930.reset();
|
aCRC32_930.reset();
|
||||||
// aCRC32_930.update(abyte0);
|
aCRC32_930.update(abyte0);
|
||||||
// int i1 = (int)aCRC32_930.getValue();
|
int i1 = (int)aCRC32_930.getValue();
|
||||||
// if(i1 != j)
|
if(i1 != j)
|
||||||
|
abyte0 = null;
|
||||||
}
|
}
|
||||||
if (abyte0 != null) {
|
if (abyte0 != null) {
|
||||||
StreamLoader streamLoader = new StreamLoader(abyte0);
|
StreamLoader streamLoader = new StreamLoader(abyte0);
|
||||||
@@ -3480,12 +3482,20 @@ public class Game extends RSApplet {
|
|||||||
} catch (Exception _ex) {
|
} catch (Exception _ex) {
|
||||||
decompressors[0] = null;
|
decompressors[0] = null;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* if(abyte0 != null) { aCRC32_930.reset();
|
if(abyte0 != null && ClientSettings.CHECK_CRC)
|
||||||
* aCRC32_930.update(abyte0); int i3 =
|
{
|
||||||
* (int)aCRC32_930.getValue(); if(i3 != j) { abyte0 = null;
|
aCRC32_930.reset();
|
||||||
* j1++; s2 = "Checksum error: " + i3; } }
|
aCRC32_930.update(abyte0);
|
||||||
*/
|
int i3 = (int)aCRC32_930.getValue();
|
||||||
|
if(i3 != j)
|
||||||
|
{
|
||||||
|
abyte0 = null;
|
||||||
|
j1++;
|
||||||
|
s2 = "Checksum error: " + i3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
if (s2.equals("Unknown error")) {
|
if (s2.equals("Unknown error")) {
|
||||||
s2 = "Connection error";
|
s2 = "Connection error";
|
||||||
@@ -5021,7 +5031,7 @@ public class Game extends RSApplet {
|
|||||||
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx") || inputString.equals("::togglerender") || inputString.equals("::togglegfx")) {
|
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx") || inputString.equals("::togglerender") || inputString.equals("::togglegfx")) {
|
||||||
graphicsEnabled = !graphicsEnabled;
|
graphicsEnabled = !graphicsEnabled;
|
||||||
}
|
}
|
||||||
if (myPrivilege >= 0) {
|
if (myPrivilege >= 2) {
|
||||||
if (inputString.equals("::noclip"))
|
if (inputString.equals("::noclip"))
|
||||||
for (int k1 = 0; k1 < 4; k1++)
|
for (int k1 = 0; k1 < 4; k1++)
|
||||||
for (int i2 = 1; i2 < 103; i2++)
|
for (int i2 = 1; i2 < 103; i2++)
|
||||||
@@ -5060,6 +5070,7 @@ public class Game extends RSApplet {
|
|||||||
onDemandFetcher.method563((byte) 1, 2, j1);
|
onDemandFetcher.method563((byte) 1, 2, j1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (inputString.startsWith("::dd")) {
|
if (inputString.startsWith("::dd")) {
|
||||||
String[] args = inputString.split(" ");
|
String[] args = inputString.split(" ");
|
||||||
int distance = 25;
|
int distance = 25;
|
||||||
@@ -5078,7 +5089,6 @@ public class Game extends RSApplet {
|
|||||||
if (inputString.equals("::dataon")) {
|
if (inputString.equals("::dataon")) {
|
||||||
showInfo = !showInfo;
|
showInfo = !showInfo;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (inputString.startsWith("::")) {
|
if (inputString.startsWith("::")) {
|
||||||
stream.createFrame(103);
|
stream.createFrame(103);
|
||||||
stream.writeWordBigEndian(inputString.length() - 1);
|
stream.writeWordBigEndian(inputString.length() - 1);
|
||||||
@@ -5927,7 +5937,7 @@ public class Game extends RSApplet {
|
|||||||
loginMessage2 = "Connecting to server...";
|
loginMessage2 = "Connecting to server...";
|
||||||
drawLoginScreen(true);
|
drawLoginScreen(true);
|
||||||
}
|
}
|
||||||
socketStream = new RSSocket(this, openSocket(43594 + portOff));
|
socketStream = new RSSocket(this, openSocket((ClientSettings.SERVER_WORLD == 1) ? 43594 : 43596 + ClientSettings.SERVER_WORLD + portOff));
|
||||||
long l = TextClass.longForName(s);
|
long l = TextClass.longForName(s);
|
||||||
int i = (int) (l >> 16 & 31L);
|
int i = (int) (l >> 16 & 31L);
|
||||||
stream.currentOffset = 0;
|
stream.currentOffset = 0;
|
||||||
@@ -12046,8 +12056,9 @@ public class Game extends RSApplet {
|
|||||||
bigX = new int[4000];
|
bigX = new int[4000];
|
||||||
bigY = new int[4000];
|
bigY = new int[4000];
|
||||||
anInt1289 = -1;
|
anInt1289 = -1;
|
||||||
|
aCRC32_930 = new CRC32();
|
||||||
}
|
}
|
||||||
|
public CRC32 aCRC32_930;
|
||||||
public static String server;
|
public static String server;
|
||||||
public int ignoreCount;
|
public int ignoreCount;
|
||||||
public long aLong824;
|
public long aLong824;
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ public final class Main {
|
|||||||
DEAR DEVELOPER!
|
DEAR DEVELOPER!
|
||||||
|
|
||||||
If you want to run the client locally, the easiest way to do that is run the class "Client.java" instead!
|
If you want to run the client locally, the easiest way to do that is run the class "Client.java" instead!
|
||||||
|
|
||||||
If you REALLY want to use this class, add program arguments "-s localhost".
|
If you REALLY want to use this class, add program arguments "-s localhost".
|
||||||
But seriously, Client.java is just a copy-paste of this class and does it locally. Use that instead!
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@@ -25,6 +22,16 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,6 +52,10 @@ public final class Main {
|
|||||||
case "-password":
|
case "-password":
|
||||||
game.myPassword = args[++i];
|
game.myPassword = args[++i];
|
||||||
break;
|
break;
|
||||||
|
case "-w":
|
||||||
|
case "-world":
|
||||||
|
ClientSettings.SERVER_WORLD = Integer.parseInt(args[++i]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"server_name": "2006Scape",
|
||||||
|
"website_link": "https://2006Scape.org",
|
||||||
|
"server_debug": false,
|
||||||
|
"file_server": true,
|
||||||
|
"world_id": 1,
|
||||||
|
"xp_rate": 1.0,
|
||||||
|
"variable_xp_rate": false,
|
||||||
|
"variable_xp_rates": [1, 2, 5, 10],
|
||||||
|
"members_only": false,
|
||||||
|
"tutorial_island_enabled": false,
|
||||||
|
"party_room_enabled": true,
|
||||||
|
"clues_enabled": true,
|
||||||
|
"admin_can_trade": false,
|
||||||
|
"admin_can_sell": false,
|
||||||
|
"respawn_x": 3222,
|
||||||
|
"respawn_y": 3218,
|
||||||
|
"save_timer": 120,
|
||||||
|
"timeout": 60,
|
||||||
|
"item_requirements": true,
|
||||||
|
"max_players": 200,
|
||||||
|
"website_total_characters_integration": false
|
||||||
|
}
|
||||||
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
Vendored
@@ -1 +0,0 @@
|
|||||||
{"token":""}
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package plugin.quests.cooksassistant
|
||||||
|
|
||||||
|
import com.rs2.event.EventContext
|
||||||
|
import com.rs2.event.EventSubscriber
|
||||||
|
import com.rs2.event.SubscribesTo
|
||||||
|
import com.rs2.event.impl.NpcFirstClickEvent
|
||||||
|
import com.rs2.game.players.Player
|
||||||
|
import plugin.quests.cooksassistant.dialogue.LumbridgeCookDialogue
|
||||||
|
|
||||||
|
|
||||||
|
@SubscribesTo(NpcFirstClickEvent::class)
|
||||||
|
class FirstClick : EventSubscriber<NpcFirstClickEvent> {
|
||||||
|
|
||||||
|
override fun subscribe(context: EventContext, player: Player, event: NpcFirstClickEvent) {
|
||||||
|
|
||||||
|
when(event.npc) {
|
||||||
|
//Lumbridge Cook (278)
|
||||||
|
278 -> {
|
||||||
|
if (player.playerRights >= 3) {
|
||||||
|
player.packetSender.sendMessage("[click= npc], [type = first/quest], [id= ${event.npc}], [Type= ${event.npc}]")
|
||||||
|
}
|
||||||
|
player.dialogueFactory.sendDialogue(LumbridgeCookDialogue())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+151
@@ -0,0 +1,151 @@
|
|||||||
|
package plugin.quests.cooksassistant.dialogue
|
||||||
|
|
||||||
|
import com.rs2.game.content.quests.QuestAssistant
|
||||||
|
import com.rs2.game.content.quests.QuestRewards
|
||||||
|
import com.rs2.game.dialogues.DialogueFactoryPlugin
|
||||||
|
import com.rs2.game.dialogues.DialoguePlugin
|
||||||
|
import com.rs2.game.dialogues.ExpressionPlugin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Dialogue For The Lumbridge Castle Cook/Cooks Assistant Quest
|
||||||
|
*/
|
||||||
|
class LumbridgeCookDialogue : DialoguePlugin() {
|
||||||
|
|
||||||
|
override fun sendDialogues(factory: DialogueFactoryPlugin) {
|
||||||
|
if (factory.player.cookAss == 0) {
|
||||||
|
factory
|
||||||
|
.sendNPCChat(ExpressionPlugin.ANXIOUS, "What am I to do?")
|
||||||
|
.sendOption("What's wrong?", {
|
||||||
|
factory
|
||||||
|
.onAction {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("What's wrong?")
|
||||||
|
.sendNPCChat(
|
||||||
|
"Oh dear, oh dear, oh dear, I'm in a terrible terrible",
|
||||||
|
"mess! It's the Duke's birthday today, and I should be",
|
||||||
|
"making him a lovely big birthday cake!"
|
||||||
|
)
|
||||||
|
.sendNPCChat(
|
||||||
|
"I've forgotten to buy the ingredients. I'll never get",
|
||||||
|
"them in time now. He'll sack me! What will I do? I have",
|
||||||
|
"four children and a goat to look after. Would you help",
|
||||||
|
"me? Please?"
|
||||||
|
)
|
||||||
|
.sendOption("I'm always happy to help a cook in distress", {
|
||||||
|
factory.onAction {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("Yes, I'll help you.")
|
||||||
|
.sendNPCChat(
|
||||||
|
"Oh thank you, thank you. I need milk, an egg, and",
|
||||||
|
"flour. I'd be very grateful if you can get them for me."
|
||||||
|
)
|
||||||
|
.sendPlayerChat("So where do I find these ingredients then?")
|
||||||
|
.sendNPCChat(
|
||||||
|
"You can find flour in any of the shops here.",
|
||||||
|
"You can find eggs by killing chickens.",
|
||||||
|
"You can find milk by using a bucket on a cow"
|
||||||
|
)
|
||||||
|
.execute()
|
||||||
|
.player.cookAss = 1
|
||||||
|
QuestAssistant.sendStages(factory.player)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"I can't right now, Maybe later.", {
|
||||||
|
factory.onAction {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("I can't right now, Maybe later.")
|
||||||
|
.sendNPCChat("Oh please! Hurry then!")
|
||||||
|
.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, "Can you cook me a cake?", {
|
||||||
|
factory
|
||||||
|
.onAction {
|
||||||
|
factory
|
||||||
|
.sendNPCChat("Does it look like I have the time?")
|
||||||
|
.execute()
|
||||||
|
}
|
||||||
|
}, "You don't look very happy.", {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat(ExpressionPlugin.ANXIOUS, "You don't look so happy.")
|
||||||
|
.sendNPCChat(
|
||||||
|
"Oh dear, oh dear, oh dear, I'm in a terrible terrible",
|
||||||
|
"mess! It's the Duke's birthday today, and I should be",
|
||||||
|
"making him a lovely big birthday cake!"
|
||||||
|
)
|
||||||
|
.sendNPCChat(
|
||||||
|
"I've forgotten to buy the ingredients. I'll never get",
|
||||||
|
"them in time now. He'll sack me! What will I do? I have",
|
||||||
|
"four children and a goat to look after. Would you help",
|
||||||
|
"me? Please?"
|
||||||
|
)
|
||||||
|
.sendOption("I'm always happy to help a cook in distress", {
|
||||||
|
factory.onAction {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("Yes, I'll help you.")
|
||||||
|
.sendNPCChat(
|
||||||
|
"Oh thank you, thank you. I need milk, an egg, and",
|
||||||
|
"flour. I'd be very grateful if you can get them for me."
|
||||||
|
)
|
||||||
|
.sendPlayerChat("So where do I find these ingredients then?")
|
||||||
|
.sendNPCChat(
|
||||||
|
"You can find flour in any of the shops here.",
|
||||||
|
"You can find eggs by killing chickens.",
|
||||||
|
"You can find milk by using a bucket on a cow"
|
||||||
|
)
|
||||||
|
.execute()
|
||||||
|
.player.cookAss = 1
|
||||||
|
QuestAssistant.sendStages(factory.player)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"I can't right now, Maybe later.", {
|
||||||
|
factory.onAction {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("I can't right now, Maybe later.")
|
||||||
|
.sendNPCChat("Oh please! Hurry then!")
|
||||||
|
.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}, "Nice hat.") {
|
||||||
|
factory
|
||||||
|
.sendNPCChat("I don't have time for your jibber-jabber!")
|
||||||
|
}
|
||||||
|
.execute()
|
||||||
|
} else if(factory.player.cookAss == 1) {
|
||||||
|
factory
|
||||||
|
.sendNPCChat("How are you getting on with finding the ingredients?")
|
||||||
|
if (factory.player.itemAssistant.playerHasItem(1944, 1)
|
||||||
|
&& factory.player.itemAssistant.playerHasItem(1927, 1)
|
||||||
|
&& factory.player.itemAssistant.playerHasItem(1933, 1)
|
||||||
|
) {
|
||||||
|
factory.sendPlayerChat("Here's all the items!")
|
||||||
|
factory.player.itemAssistant.deleteItem(1944, 1)
|
||||||
|
factory.player.itemAssistant.deleteItem(1927, 1)
|
||||||
|
factory.player.itemAssistant.deleteItem(1933, 1)
|
||||||
|
factory.player.cookAss = 2
|
||||||
|
factory.sendNPCChat("You brought me everything I need! I'm saved!", "Thank you!")
|
||||||
|
.sendPlayerChat("So do I get to go to the Duke's Party?")
|
||||||
|
.sendNPCChat("I'm afraid not, only the big cheeses get to dine with the", "Duke.")
|
||||||
|
.sendPlayerChat("Well, maybe one day I'll be important enough to sit on", "the Duke's table")
|
||||||
|
.sendNPCChat("Maybe, but I won't be holding my breath.")
|
||||||
|
QuestRewards.cookReward(factory.player)
|
||||||
|
} else {
|
||||||
|
factory.sendPlayerChat("I don't have all the items yet.")
|
||||||
|
.sendNPCChat("Oh please! Hurry then!")
|
||||||
|
.execute()
|
||||||
|
}
|
||||||
|
} else if(factory.player.cookAss == 2) {
|
||||||
|
factory
|
||||||
|
.sendPlayerChat("So do I get to go to the Duke's Party?")
|
||||||
|
.sendNPCChat("I'm afraid not, only the big cheeses get to dine with the", "Duke.")
|
||||||
|
.sendPlayerChat("Well, maybe one day I'll be important enough to sit on", "the Duke's table")
|
||||||
|
.sendNPCChat("Maybe, but I won't be holding my breath.")
|
||||||
|
QuestRewards.cookReward(factory.player)
|
||||||
|
} else if(factory.player.cookAss == 3) {
|
||||||
|
factory.sendNPCChat("Thanks for helping me out friend!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -160,6 +160,12 @@
|
|||||||
<artifactId>google-collections</artifactId>
|
<artifactId>google-collections</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty</artifactId>
|
||||||
|
<version>3.6.6.Final</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.rs2;
|
||||||
|
|
||||||
|
import com.rs2.integrations.PlayersOnlineWebsite;
|
||||||
|
import com.rs2.integrations.RegisteredAccsWebsite;
|
||||||
|
import com.rs2.integrations.discord.JavaCord;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
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);
|
||||||
|
|
||||||
|
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("website_link"))
|
||||||
|
GameConstants.WEBSITE_LINK = obj.getString("website_link");
|
||||||
|
if(obj.has("debug"))
|
||||||
|
GameConstants.SERVER_DEBUG = obj.getBoolean("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("website_total_characters_integration"))
|
||||||
|
GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION = obj.getBoolean("website_total_characters_integration");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initialize() {
|
||||||
|
JSONObject main = new JSONObject();
|
||||||
|
main
|
||||||
|
.put("bot-token", "")
|
||||||
|
.put("websitepass", "")
|
||||||
|
.put("erssecret", "");
|
||||||
|
try {
|
||||||
|
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
|
||||||
|
br.write(main.toString());
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadSecrets() throws IOException {
|
||||||
|
if (!new File("data/secrets.json").exists()) {
|
||||||
|
initialize();
|
||||||
|
System.out.println("Please open \"data/secrets.json\" file and enter your discord token bot there!");
|
||||||
|
System.out.println("Please open \"data/secrets.json\" file and enter your Website Password there!");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
|
||||||
|
String out = br.lines().collect(Collectors.joining("\n"));
|
||||||
|
JSONObject obj = new JSONObject(out);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets External Services Vars
|
||||||
|
*/
|
||||||
|
if(obj.has("bot-token"))
|
||||||
|
JavaCord.token = obj.getString("bot-token");
|
||||||
|
if(obj.has("websitepass"))
|
||||||
|
PlayersOnlineWebsite.password = obj.getString("websitepass");
|
||||||
|
RegisteredAccsWebsite.password = obj.getString("websitepass");
|
||||||
|
if(obj.has("erssecret"))
|
||||||
|
GameEngine.ersSecret = obj.getString("erssecret");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,43 +2,57 @@ package com.rs2;
|
|||||||
|
|
||||||
public class GameConstants {
|
public class GameConstants {
|
||||||
|
|
||||||
public final static boolean SERVER_DEBUG = false;
|
/**
|
||||||
|
* The Variables Below Can Be Also Changed On Server Startup By Using The ConfigLoader
|
||||||
|
*
|
||||||
|
* SERVER_NAME Sets The Name The Server Will Use
|
||||||
|
* WEBSITE_LINK Defines The Server Website Links
|
||||||
|
* WORLD Sets The Servers World ID
|
||||||
|
* 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
|
||||||
|
* 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
|
||||||
|
* CLUES_ENABLED Enables/Disables Clue Scrolls
|
||||||
|
* ITEM_REQUIREMENTS Enables/Disables Item Requirements for All Players
|
||||||
|
* ADMIN_CAN_TRADE Defines Whether Admins Can Trade
|
||||||
|
* ADMIN_DROP_ITEMS Defines Whether Admins Can Drop Items
|
||||||
|
* ADMIN_CAN_SELL_ITEMS Defines Whether Admins Can Sell Items
|
||||||
|
* 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)
|
||||||
|
* XP_RATE Sets The XP Rate Multiplier For All Players/Skills If VARIABLE_XP_RATES is false
|
||||||
|
*/
|
||||||
|
public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org";
|
||||||
|
public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120,
|
||||||
|
RESPAWN_X = 3222, RESPAWN_Y = 3218;
|
||||||
|
public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false,
|
||||||
|
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
|
||||||
|
ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false,
|
||||||
|
WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false;
|
||||||
|
public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10};
|
||||||
|
public static double TEST_VERSION = 2.3, XP_RATE = 1.0;
|
||||||
|
|
||||||
public final static String SERVER_NAME = "2006Scape", SERVER_VERSION = "Server Stage v " + GameConstants.TEST_VERSION + ".";
|
|
||||||
|
|
||||||
public final static String WEBSITE_LINK = "https://2006Scape.org";
|
/**
|
||||||
public final static boolean WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false;
|
* The Variables Below Should Only Be Changed If You Understand What You Are Doing
|
||||||
public final static double TEST_VERSION = 2.3;
|
*/
|
||||||
|
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE,
|
||||||
|
IPS_ALLOWED = 250, CONNECTION_DELAY = 100;
|
||||||
|
|
||||||
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE, CLIENT_VERSION = 999999,
|
public final static boolean sendServerPackets = false, SOUND = true, GUILDS = true;
|
||||||
WORLD = 1, IPS_ALLOWED = 250, CONNECTION_DELAY = 100,
|
|
||||||
MESSAGE_DELAY = 6000, MAX_PLAYERS = 200, REQ_AMOUNT = 150;
|
|
||||||
|
|
||||||
public final static boolean SOUND = true,
|
|
||||||
GUILDS = true,
|
|
||||||
PARTY_ROOM_DISABLED = false,
|
|
||||||
PRINT_OBJECT_ID = false, EXPERIMENTS = false;
|
|
||||||
|
|
||||||
public static int[] SIDEBARS = { 2423, 3917, 638, 3213, 1644, 5608, 1151,
|
public static int[] SIDEBARS = { 2423, 3917, 638, 3213, 1644, 5608, 1151,
|
||||||
18128, 5065, 5715, 2449, 904, 147, 962 };
|
18128, 5065, 5715, 2449, 904, 147, 962 };
|
||||||
|
|
||||||
public static boolean TUTORIAL_ISLAND = false,
|
|
||||||
MEMBERS_ONLY = false, sendServerPackets = false,
|
|
||||||
CLUES_ENABLED = true;
|
|
||||||
|
|
||||||
public final static int[] FUN_WEAPONS = { 2460, 2461, 2462, 2463, 2464,
|
public final static int[] FUN_WEAPONS = { 2460, 2461, 2462, 2463, 2464,
|
||||||
2465, 2466, 2467, 2468, 2469, 2470, 2471, 2471, 2473, 2474, 2475,
|
2465, 2466, 2467, 2468, 2469, 2470, 2471, 2471, 2473, 2474, 2475,
|
||||||
2476, 2477 }; // fun weapons for dueling
|
2476, 2477 }; // fun weapons for dueling
|
||||||
|
|
||||||
public static boolean ADMIN_CAN_TRADE = false; // can admins trade?
|
|
||||||
|
|
||||||
public final static boolean ADMIN_DROP_ITEMS = false;
|
|
||||||
|
|
||||||
public final static boolean ADMIN_CAN_SELL_ITEMS = false;
|
|
||||||
|
|
||||||
public final static int RESPAWN_X = 3222; // when dead respawn here
|
|
||||||
|
|
||||||
public final static int RESPAWN_Y = 3218;
|
|
||||||
|
|
||||||
public final static int DUELING_RESPAWN_X = 3362;
|
public final static int DUELING_RESPAWN_X = 3362;
|
||||||
|
|
||||||
@@ -46,16 +60,6 @@ public class GameConstants {
|
|||||||
|
|
||||||
public final static int NO_TELEPORT_WILD_LEVEL = 20;
|
public final static int NO_TELEPORT_WILD_LEVEL = 20;
|
||||||
|
|
||||||
public final static boolean ITEM_REQUIREMENTS = true;
|
|
||||||
|
|
||||||
public final static int CASTLE_WARS_X = 2439;
|
|
||||||
|
|
||||||
public final static int CASTLE_WARS_Y = 3087;
|
|
||||||
|
|
||||||
public static double XP_RATE = 1;
|
|
||||||
|
|
||||||
public final static int SAVE_TIMER = 120; // save every x seconds
|
|
||||||
|
|
||||||
public final static int NPC_RANDOM_WALK_DISTANCE = 5;
|
public final static int NPC_RANDOM_WALK_DISTANCE = 5;
|
||||||
|
|
||||||
public final static int NPC_FOLLOW_DISTANCE = 10;
|
public final static int NPC_FOLLOW_DISTANCE = 10;
|
||||||
@@ -69,8 +73,6 @@ public class GameConstants {
|
|||||||
"skorge", "tortured soul", "undead chicken", "undead cow", "undead one", "undead troll", "zombie", "zombie rat", "zogre"
|
"skorge", "tortured soul", "undead chicken", "undead cow", "undead one", "undead troll", "zombie", "zombie rat", "zogre"
|
||||||
};
|
};
|
||||||
|
|
||||||
public final static int TIMEOUT = 60;
|
|
||||||
|
|
||||||
public final static int CYCLE_TIME = 600;
|
public final static int CYCLE_TIME = 600;
|
||||||
|
|
||||||
public final static int BUFFER_SIZE = 10000;
|
public final static int BUFFER_SIZE = 10000;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import com.rs2.game.players.PlayerSave;
|
|||||||
import com.rs2.game.shops.ShopHandler;
|
import com.rs2.game.shops.ShopHandler;
|
||||||
import com.rs2.integrations.PlayersOnlineWebsite;
|
import com.rs2.integrations.PlayersOnlineWebsite;
|
||||||
import com.rs2.integrations.RegisteredAccsWebsite;
|
import com.rs2.integrations.RegisteredAccsWebsite;
|
||||||
import com.rs2.integrations.SettingsLoader;
|
|
||||||
import com.rs2.integrations.discord.DiscordActivity;
|
import com.rs2.integrations.discord.DiscordActivity;
|
||||||
import com.rs2.integrations.discord.JavaCord;
|
import com.rs2.integrations.discord.JavaCord;
|
||||||
import com.rs2.net.ConnectionHandler;
|
import com.rs2.net.ConnectionHandler;
|
||||||
@@ -49,6 +48,7 @@ import com.rs2.world.ObjectHandler;
|
|||||||
import com.rs2.world.ObjectManager;
|
import com.rs2.world.ObjectManager;
|
||||||
import com.rs2.world.clip.ObjectDefinition;
|
import com.rs2.world.clip.ObjectDefinition;
|
||||||
import com.rs2.world.clip.RegionFactory;
|
import com.rs2.world.clip.RegionFactory;
|
||||||
|
import org.apollo.jagcached.FileServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server.java
|
* Server.java
|
||||||
@@ -131,16 +131,31 @@ public class GameEngine {
|
|||||||
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();
|
||||||
|
|
||||||
/**
|
|
||||||
* Port and Cycle rate.
|
|
||||||
*/
|
|
||||||
static {
|
static {
|
||||||
serverlistenerPort = 43594;
|
|
||||||
shutdownServer = false;
|
shutdownServer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
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++) {
|
||||||
|
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
|
||||||
|
switch(args[i]) {
|
||||||
|
case "-c":
|
||||||
|
case "-config":
|
||||||
|
try {
|
||||||
|
//TODO Load A Default Config File When Arg Not Used
|
||||||
|
System.out.println("Loading External Config..");
|
||||||
|
ConfigLoader.loadSettings(args[++i]);
|
||||||
|
System.out.println("Loaded Config File " + args[i]);
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("Config File Not Found");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
serverlistenerPort = (GameConstants.WORLD == 1) ? 43594 : 43596 + GameConstants.WORLD;
|
||||||
|
|
||||||
System.out.println("Starting game engine..");
|
System.out.println("Starting game engine..");
|
||||||
if (GameConstants.SERVER_DEBUG) {
|
if (GameConstants.SERVER_DEBUG) {
|
||||||
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
|
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
|
||||||
@@ -163,12 +178,24 @@ public class GameEngine {
|
|||||||
/**
|
/**
|
||||||
* Starting Up Server
|
* Starting Up Server
|
||||||
*/
|
*/
|
||||||
System.out.println("Launching " + GameConstants.SERVER_NAME + "...");
|
System.out.println("Launching " + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "...");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts The File Server If Enabled In GameConstants
|
||||||
|
*/
|
||||||
|
if(GameConstants.FILE_SERVER) {
|
||||||
|
FileServer fs = new FileServer();
|
||||||
|
try {
|
||||||
|
fs.start();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start Integration Services
|
* Start Integration Services
|
||||||
**/
|
**/
|
||||||
SettingsLoader.loadSettings();
|
ConfigLoader.loadSecrets();
|
||||||
JavaCord.init();
|
JavaCord.init();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -670,7 +670,9 @@ public final class DialogueFactoryPlugin {
|
|||||||
private final String[] splitLines(String... text) {
|
private final String[] splitLines(String... text) {
|
||||||
|
|
||||||
if(text.length > 1){
|
if(text.length > 1){
|
||||||
|
if(GameConstants.SERVER_DEBUG) {
|
||||||
logger.log(Level.INFO, "Detected more than 1 Dialogue line. Assuming Dialogues have been split already.");
|
logger.log(Level.INFO, "Detected more than 1 Dialogue line. Assuming Dialogues have been split already.");
|
||||||
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
int characters = text[0].length();
|
int characters = text[0].length();
|
||||||
|
|||||||
@@ -317,140 +317,6 @@ public class DialogueHandler {
|
|||||||
player.nextChat = 0;
|
player.nextChat = 0;
|
||||||
player.ptjob = 2;
|
player.ptjob = 2;
|
||||||
break;
|
break;
|
||||||
case 50:
|
|
||||||
sendNpcChat1("What am I to do?", player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 51;
|
|
||||||
break;
|
|
||||||
case 51:
|
|
||||||
sendOption("What's wrong?", "Can you cook me a cake?",
|
|
||||||
"You don't look very happy.", "Nice hat.");
|
|
||||||
player.dialogueAction = 52;
|
|
||||||
break;
|
|
||||||
case 52:
|
|
||||||
sendPlayerChat("What's wrong?");
|
|
||||||
player.nextChat = 54;
|
|
||||||
break;
|
|
||||||
case 54:
|
|
||||||
sendNpcChat3(
|
|
||||||
"Oh dear, oh dear, oh dear, I'm in a terrible terrible",
|
|
||||||
"mess! It's the Duke's birthday today, and I should be",
|
|
||||||
"making him a lovely big birthday cake!",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 55;
|
|
||||||
break;
|
|
||||||
case 55:
|
|
||||||
sendNpcChat4(
|
|
||||||
"I've forgotten to buy the ingredients. I'll never get",
|
|
||||||
"them in time now. He'll sack me! What will I do? I have",
|
|
||||||
"four children and a goat to look after. Would you help",
|
|
||||||
"me? Please?", player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 56;
|
|
||||||
break;
|
|
||||||
case 56:
|
|
||||||
sendOption("I'm always happy to help a cook in distress.",
|
|
||||||
"I can't right now, Maybe later.");
|
|
||||||
player.dialogueAction = 57;
|
|
||||||
break;
|
|
||||||
case 57:
|
|
||||||
sendPlayerChat("Yes, I'll help you.");// 9157
|
|
||||||
player.nextChat = 60;
|
|
||||||
break;
|
|
||||||
case 58:
|
|
||||||
sendPlayerChat("I can't right now, Maybe later.");// 9158
|
|
||||||
player.nextChat = 59;
|
|
||||||
break;
|
|
||||||
case 59:
|
|
||||||
sendNpcChat1("Oh please! Hurry then!", player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 0;
|
|
||||||
break;
|
|
||||||
case 60:
|
|
||||||
sendNpcChat2("Oh thank you, thank you. I need milk, an egg, and",
|
|
||||||
"flour. I'd be very grateful if you can get them for me.",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.cookAss = 1;
|
|
||||||
QuestAssistant.sendStages(player);
|
|
||||||
player.nextChat = 61;
|
|
||||||
break;
|
|
||||||
case 61:
|
|
||||||
sendPlayerChat("So where do I find these ingredients then?");
|
|
||||||
player.nextChat = 62;
|
|
||||||
break;
|
|
||||||
case 62:
|
|
||||||
sendNpcChat3("You can find flour in any of the shops here.",
|
|
||||||
"You can find eggs by killing chickens.",
|
|
||||||
"You can find milk by using a bucket on a cow",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 0;
|
|
||||||
break;
|
|
||||||
case 63:
|
|
||||||
sendNpcChat1("I don't have time for your jibber-jabber!",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 0;
|
|
||||||
break;
|
|
||||||
case 64:
|
|
||||||
sendNpcChat1("Does it look like I have the time?",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 0;
|
|
||||||
break;
|
|
||||||
case 65:
|
|
||||||
sendPlayerChat("You don't look so happy.");
|
|
||||||
player.nextChat = 54;
|
|
||||||
break;
|
|
||||||
case 66:
|
|
||||||
sendNpcChat1(
|
|
||||||
"How are you getting on with finding the ingredients?",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 67;
|
|
||||||
break;
|
|
||||||
case 67:
|
|
||||||
if (player.getItemAssistant().playerHasItem(1944, 1)
|
|
||||||
&& player.getItemAssistant().playerHasItem(1927, 1)
|
|
||||||
&& player.getItemAssistant().playerHasItem(1933, 1)) {
|
|
||||||
sendPlayerChat("Here's all the items!");
|
|
||||||
player.nextChat = 68;
|
|
||||||
} else {
|
|
||||||
sendPlayerChat("I don't have all the items yet.");
|
|
||||||
player.nextChat = 59;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 68:
|
|
||||||
player.getItemAssistant().deleteItem(1944, 1);
|
|
||||||
player.getItemAssistant().deleteItem(1927, 1);
|
|
||||||
player.getItemAssistant().deleteItem(1933, 1);
|
|
||||||
player.cookAss = 2;
|
|
||||||
sendNpcChat2("You brought me everything I need! I'm saved!",
|
|
||||||
"Thank you!", player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 69;
|
|
||||||
break;
|
|
||||||
case 69:
|
|
||||||
sendPlayerChat("So do I get to go to the Duke's Party?");
|
|
||||||
player.nextChat = 70;
|
|
||||||
break;
|
|
||||||
case 70:
|
|
||||||
sendNpcChat2(
|
|
||||||
"I'm afraid not, only the big cheeses get to dine with the",
|
|
||||||
"Duke.", player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 72;
|
|
||||||
break;
|
|
||||||
case 72:
|
|
||||||
sendPlayerChat(
|
|
||||||
"Well, maybe one day I'll be important enough to sit on",
|
|
||||||
"the Duke's table");
|
|
||||||
player.nextChat = 74;
|
|
||||||
break;
|
|
||||||
case 74:
|
|
||||||
sendNpcChat1("Maybe, but I won't be holding my breath.",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 75;
|
|
||||||
break;
|
|
||||||
case 75:
|
|
||||||
QuestRewards.cookReward(player);
|
|
||||||
break;
|
|
||||||
case 76:
|
|
||||||
sendNpcChat1("Thanks for helping me out friend!",
|
|
||||||
player.talkingNpc, "Cook");
|
|
||||||
player.nextChat = 0;
|
|
||||||
break;
|
|
||||||
case 84:
|
case 84:
|
||||||
sendNpcChat1("How are you getting on finding all my supplies",
|
sendNpcChat1("How are you getting on finding all my supplies",
|
||||||
player.talkingNpc, "Doric");
|
player.talkingNpc, "Doric");
|
||||||
@@ -6119,10 +5985,14 @@ public class DialogueHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3116:
|
case 3116:
|
||||||
|
if(GameConstants.VARIABLE_XP_RATE) {
|
||||||
|
player.getDialogueHandler().sendDialogues(10001, -1);
|
||||||
|
} else {
|
||||||
player.getPacketSender().showInterface(3559);
|
player.getPacketSender().showInterface(3559);
|
||||||
player.canChangeAppearance = true;
|
player.canChangeAppearance = true;
|
||||||
player.closeTutorialInterface = true;
|
player.closeTutorialInterface = true;
|
||||||
player.nextChat = 0;
|
player.nextChat = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3117:
|
case 3117:
|
||||||
@@ -7556,6 +7426,34 @@ public class DialogueHandler {
|
|||||||
);
|
);
|
||||||
player.dialogueAction = 10000;
|
player.dialogueAction = 10000;
|
||||||
break;
|
break;
|
||||||
|
case 10001:
|
||||||
|
sendNpcChat(2244, ChatEmotes.HAPPY_JOYFUL, "Please select the XP rate you'd like.", "this can be increased, but not decreased later on.");
|
||||||
|
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]);
|
||||||
|
player.dialogueAction = 10002;
|
||||||
|
break;
|
||||||
|
case 10003:
|
||||||
|
sendNpcChat(2244, ChatEmotes.HAPPY_JOYFUL, "Are you sure x" + player.getXPRate() + " is the XP rate you'd like?");
|
||||||
|
player.nextChat = 10004;
|
||||||
|
break;
|
||||||
|
case 10004:
|
||||||
|
sendOption("Yes", "No");
|
||||||
|
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]);
|
||||||
|
player.dialogueAction = 10005;
|
||||||
|
break;
|
||||||
|
case 10006:
|
||||||
|
sendOption("x" + GameConstants.VARIABLE_XP_RATES[2], "x" + GameConstants.VARIABLE_XP_RATES[3]);
|
||||||
|
player.dialogueAction = 10006;
|
||||||
|
break;
|
||||||
|
case 10007:
|
||||||
|
sendOption("x" + GameConstants.VARIABLE_XP_RATES[3], "Don't Change");
|
||||||
|
player.dialogueAction = 10007;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void chatboxText(String text, String text1, String text2,
|
public void chatboxText(String text, String text1, String text2,
|
||||||
|
|||||||
@@ -12,22 +12,333 @@ import com.rs2.game.players.Player;
|
|||||||
* Dialogue Options
|
* Dialogue Options
|
||||||
* @author Andrew (Mr Extremez)
|
* @author Andrew (Mr Extremez)
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* Handles Dialogue Options between NPCs and Players
|
|
||||||
* @Deprecated Consider using {@link DialogueFactoryPlugin} instead to implement dialogues.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public class DialogueOptions {
|
public class DialogueOptions {
|
||||||
|
|
||||||
public static void handleDialogueOptions(Player player, int buttonId) {
|
public static void handleDialogueOptions(Player player, int buttonId) {
|
||||||
switch (buttonId) {
|
switch (buttonId) {
|
||||||
|
case 9167:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 63:
|
||||||
|
player.getDialogueHandler().sendDialogues(166, player.npcType);
|
||||||
|
return;
|
||||||
|
case 64:
|
||||||
|
player.getDialogueHandler().sendDialogues(173, player.npcType);
|
||||||
|
return;
|
||||||
|
case 60:
|
||||||
|
player.getDialogueHandler().sendDialogues(277, player.npcType);
|
||||||
|
return;
|
||||||
|
case 61:
|
||||||
|
player.getDialogueHandler().sendDialogues(295, player.npcType);
|
||||||
|
return;
|
||||||
|
case 129:
|
||||||
|
player.getDialogueHandler().sendDialogues(231, player.npcType);
|
||||||
|
return;
|
||||||
|
case 58:
|
||||||
|
player.getDialogueHandler().sendDialogues(540, player.npcType);
|
||||||
|
return;
|
||||||
|
case 68:
|
||||||
|
player.getDialogueHandler().sendDialogues(39, player.npcType);
|
||||||
|
return;
|
||||||
|
case 124:
|
||||||
|
player.getDialogueHandler().sendDialogues(194, player.npcType);
|
||||||
|
return;
|
||||||
|
case 230:
|
||||||
|
player.getDialogueHandler().sendDialogues(1053, player.npcType);
|
||||||
|
return;
|
||||||
|
case 251:
|
||||||
|
player.getPacketSender().openUpBank();
|
||||||
|
player.nextChat = 0;
|
||||||
|
return;
|
||||||
|
case 144:
|
||||||
|
player.getDialogueHandler().sendDialogues(1314, player.npcType);
|
||||||
|
return;
|
||||||
|
case 502:
|
||||||
|
player.getDialogueHandler().sendDialogues(1026, player.npcType);
|
||||||
|
return;
|
||||||
|
case 1301: // first option haircut.
|
||||||
|
player.getDialogueHandler().sendDialogues(1302, 598);
|
||||||
|
return;
|
||||||
|
case 53:
|
||||||
|
if (player.objectId == 1293 || player.objectId == 1317) {
|
||||||
|
player.getPlayerAssistant().startTeleport(2542, 3169, 0, "modern");
|
||||||
|
} else {
|
||||||
|
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case 159:
|
||||||
|
player.getDialogueHandler().sendDialogues(3161, player.npcType);
|
||||||
|
return;
|
||||||
|
case 167:
|
||||||
|
player.getDialogueHandler().sendDialogues(1343, player.npcType);
|
||||||
|
return;
|
||||||
|
case 222:
|
||||||
|
player.getDialogueHandler().sendDialogues(911, player.npcType);
|
||||||
|
player.dialogueAction = -1;
|
||||||
|
return;
|
||||||
|
case 182:
|
||||||
|
player.getDialogueHandler().sendNpcChat1("No, I was hoping someone could help me find it though.", player.talkingNpc, "Squire");
|
||||||
|
player.nextChat = 0;
|
||||||
|
return;
|
||||||
|
case 188:
|
||||||
|
player.getDialogueHandler().sendDialogues(3129, 945);
|
||||||
|
return;
|
||||||
|
case 185:
|
||||||
|
player.getDialogueHandler().sendDialogues(629, player.npcType);
|
||||||
|
return;
|
||||||
|
case 186: // Shield of Arrav
|
||||||
|
player.getDialogueHandler().sendDialogues(629, player.npcType);
|
||||||
|
return;
|
||||||
|
case 702:
|
||||||
|
player.getDialogueHandler().sendDialogues(3567, player.npcType);
|
||||||
|
return;
|
||||||
|
case 7555: //lostCity 1
|
||||||
|
player.getDialogueHandler().sendDialogues(3701, player.npcType);
|
||||||
|
return;
|
||||||
|
case 10000: // Shop
|
||||||
|
if (!player.inPlayerShopArea()) {
|
||||||
|
player.getDialogueHandler().sendStatement("You need to be in a bank zone or trade area for this.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.getDialogueHandler().sendStatement("You summoned your shop!");
|
||||||
|
BotHandler.playerShop(player);
|
||||||
|
return;
|
||||||
|
case 10005:
|
||||||
|
player.setXPRate(GameConstants.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();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
player.dialogueAction = 0;
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
break;
|
||||||
|
|
||||||
/*
|
case 9168:
|
||||||
* TWO OPTIONS
|
switch (player.dialogueAction) {
|
||||||
*/
|
case 63:
|
||||||
|
player.getDialogueHandler().sendDialogues(167, player.npcType);
|
||||||
|
return;
|
||||||
|
case 64:
|
||||||
|
player.getDialogueHandler().sendDialogues(174, player.npcType);
|
||||||
|
return;
|
||||||
|
case 60:
|
||||||
|
player.getDialogueHandler().sendDialogues(279, player.npcType);
|
||||||
|
return;
|
||||||
|
case 61:
|
||||||
|
player.getDialogueHandler().sendDialogues(297, player.npcType);
|
||||||
|
return;
|
||||||
|
case 124:
|
||||||
|
player.getDialogueHandler().sendDialogues(192, player.npcType);
|
||||||
|
return;
|
||||||
|
case 126:
|
||||||
|
player.getDialogueHandler().sendDialogues(203, player.npcType);
|
||||||
|
return;
|
||||||
|
case 58:
|
||||||
|
player.getDialogueHandler().sendDialogues(538, player.npcType);
|
||||||
|
return;
|
||||||
|
case 68:
|
||||||
|
player.getDialogueHandler().sendDialogues(40, player.npcType);
|
||||||
|
return;
|
||||||
|
case 230:
|
||||||
|
player.getDialogueHandler().sendDialogues(1049, player.npcType);
|
||||||
|
break;
|
||||||
|
case 251:
|
||||||
|
player.getBankPin().bankPinSettings();
|
||||||
|
player.nextChat = 0;
|
||||||
|
return;
|
||||||
|
case 502:
|
||||||
|
player.getDialogueHandler().sendDialogues(1022, player.npcType);
|
||||||
|
return;
|
||||||
|
case 1301:
|
||||||
|
player.getDialogueHandler().sendDialogues(1308, 598);
|
||||||
|
return;
|
||||||
|
case 144:
|
||||||
|
player.getDialogueHandler().sendDialogues(1315, player.npcType);
|
||||||
|
return;
|
||||||
|
case 53:
|
||||||
|
if (player.objectId == 1294 || player.objectId == 1317) {
|
||||||
|
player.getPlayerAssistant().startTeleport(2461, 3444, 0,
|
||||||
|
"modern");
|
||||||
|
} else {
|
||||||
|
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case 159:
|
||||||
|
player.getDialogueHandler().sendDialogues(3195, player.npcType);
|
||||||
|
return;
|
||||||
|
case 167:
|
||||||
|
player.getDialogueHandler().sendDialogues(1344, player.npcType);
|
||||||
|
return;
|
||||||
|
case 222:
|
||||||
|
player.getDialogueHandler().sendDialogues(912, player.npcType);
|
||||||
|
player.dialogueAction = -1;
|
||||||
|
return;
|
||||||
|
case 182:
|
||||||
|
player.getDialogueHandler().sendDialogues(615, player.npcType);
|
||||||
|
return;
|
||||||
|
case 188:
|
||||||
|
player.getDialogueHandler().sendDialogues(3130, 945);
|
||||||
|
return;
|
||||||
|
case 185:
|
||||||
|
player.getDialogueHandler().sendDialogues(628, player.npcType);
|
||||||
|
return;
|
||||||
|
case 186: // Shield of Arrav
|
||||||
|
player.getDialogueHandler().sendDialogues(628, player.npcType);
|
||||||
|
return;
|
||||||
|
case 702:
|
||||||
|
player.getDialogueHandler().sendDialogues(3568, player.npcType);
|
||||||
|
return;
|
||||||
|
case 7555:
|
||||||
|
player.getDialogueHandler().sendDialogues(3597, player.npcType);
|
||||||
|
return;
|
||||||
|
case 10000:
|
||||||
|
player.getDialogueHandler().sendStatement("You close your shop!");
|
||||||
|
BotHandler.closeShop(player);
|
||||||
|
return;
|
||||||
|
case 10005:
|
||||||
|
player.setXPRate(GameConstants.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;
|
||||||
|
}
|
||||||
|
player.dialogueAction = 0;
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
break;
|
||||||
|
|
||||||
// First
|
case 9169:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 63:
|
||||||
|
player.getDialogueHandler().sendDialogues(168, player.npcType);
|
||||||
|
return;
|
||||||
|
case 64:
|
||||||
|
player.getDialogueHandler().sendDialogues(175, player.npcType);
|
||||||
|
return;
|
||||||
|
case 60:
|
||||||
|
player.getDialogueHandler().sendDialogues(278, player.npcType);
|
||||||
|
return;
|
||||||
|
case 61:
|
||||||
|
player.getDialogueHandler().sendDialogues(296, player.npcType);
|
||||||
|
return;
|
||||||
|
case 53:
|
||||||
|
if (player.objectId == 1294 || player.objectId == 1293) {
|
||||||
|
player.getPlayerAssistant().startTeleport(3179, 3507, 0,
|
||||||
|
"modern");
|
||||||
|
} else {
|
||||||
|
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
case 129:
|
||||||
|
player.getDialogueHandler().sendDialogues(232, player.npcType);
|
||||||
|
return;
|
||||||
|
case 126:
|
||||||
|
player.getDialogueHandler().sendDialogues(204, player.npcType);
|
||||||
|
return;
|
||||||
|
case 144:
|
||||||
|
player.getDialogueHandler().sendDialogues(1316, player.npcType);
|
||||||
|
return;
|
||||||
|
case 124:
|
||||||
|
player.getDialogueHandler().sendDialogues(3193, 741);
|
||||||
|
return;
|
||||||
|
case 58:
|
||||||
|
player.getDialogueHandler().sendDialogues(539, player.npcType);
|
||||||
|
return;
|
||||||
|
case 68:
|
||||||
|
player.getDialogueHandler().sendDialogues(41, player.npcType);
|
||||||
|
return;
|
||||||
|
case 230:
|
||||||
|
player.getDialogueHandler().sendDialogues(1050, player.npcType);
|
||||||
|
break;
|
||||||
|
case 251:
|
||||||
|
player.getDialogueHandler().sendDialogues(1015, 494);
|
||||||
|
return;
|
||||||
|
case 502:
|
||||||
|
player.getDialogueHandler().sendDialogues(1025, player.npcType);
|
||||||
|
return;
|
||||||
|
case 1301:
|
||||||
|
player.getDialogueHandler().sendDialogues(1306, 598);
|
||||||
|
return;
|
||||||
|
case 222:
|
||||||
|
player.getDialogueHandler().sendDialogues(913, player.npcType);
|
||||||
|
player.dialogueAction = -1;
|
||||||
|
return;
|
||||||
|
case 167:
|
||||||
|
player.getDialogueHandler().sendDialogues(1342, player.npcType);
|
||||||
|
return;
|
||||||
|
case 159:
|
||||||
|
player.getDialogueHandler().sendDialogues(3160, player.npcType);
|
||||||
|
return;
|
||||||
|
case 182:
|
||||||
|
player.getDialogueHandler().sendNpcChat1("Of course he is angry...", player.talkingNpc, "Squire");
|
||||||
|
player.nextChat = 0;
|
||||||
|
return;
|
||||||
|
case 188:
|
||||||
|
player.getDialogueHandler().sendDialogues(3131, 945);
|
||||||
|
return;
|
||||||
|
case 185:
|
||||||
|
player.getDialogueHandler().sendDialogues(630, player.npcType);
|
||||||
|
return;
|
||||||
|
case 186: // Shield of Arrav
|
||||||
|
player.getDialogueHandler().sendDialogues(691, player.npcType);
|
||||||
|
return;
|
||||||
|
case 702:
|
||||||
|
player.getDialogueHandler().sendDialogues(3569, player.npcType);
|
||||||
|
return;
|
||||||
|
case 7555:
|
||||||
|
player.getDialogueHandler().sendDialogues(3599, player.npcType);
|
||||||
|
return;
|
||||||
|
case 10000:
|
||||||
|
player.getDialogueHandler().sendStatement("You withdraw " + Bot.formatSellPrice(BotHandler.checkCoins(player)) + " from your shop!");
|
||||||
|
BotHandler.takeCoins(player);
|
||||||
|
return;
|
||||||
|
case 10005:
|
||||||
|
player.setXPRate(GameConstants.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;
|
||||||
|
}
|
||||||
|
player.dialogueAction = 0;
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
break;
|
||||||
|
case 9190:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 112:
|
||||||
|
player.getDialogueHandler().sendDialogues(3533, player.npcType);//4
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9191:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 112:
|
||||||
|
player.getDialogueHandler().sendDialogues(3540, player.npcType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9192:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 112:
|
||||||
|
player.getDialogueHandler().sendDialogues(3548, player.npcType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9193:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 112:
|
||||||
|
player.getDialogueHandler().sendDialogues(3550, player.npcType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9194:
|
||||||
|
switch (player.dialogueAction) {
|
||||||
|
case 112:
|
||||||
|
player.getDialogueHandler().sendDialogues(3553, player.npcType);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 9157:// barrows tele to tunnels
|
case 9157:// barrows tele to tunnels
|
||||||
if (player.dialogueAction == 1) {
|
if (player.dialogueAction == 1) {
|
||||||
int r = 4;
|
int r = 4;
|
||||||
@@ -82,9 +393,6 @@ public class DialogueOptions {
|
|||||||
} else if (player.dialogueAction == 56) {
|
} else if (player.dialogueAction == 56) {
|
||||||
player.getDialogueHandler().sendDialogues(96, player.npcType);
|
player.getDialogueHandler().sendDialogues(96, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 57) {
|
|
||||||
player.getDialogueHandler().sendDialogues(57, player.npcType);
|
|
||||||
return;
|
|
||||||
} else if (player.dialogueAction == 3222) {
|
} else if (player.dialogueAction == 3222) {
|
||||||
player.getBarrows().checkCoffins();
|
player.getBarrows().checkCoffins();
|
||||||
player.getPacketSender().closeAllWindows();
|
player.getPacketSender().closeAllWindows();
|
||||||
@@ -308,25 +616,57 @@ public class DialogueOptions {
|
|||||||
} else if (player.dialogueAction == 3575) {
|
} else if (player.dialogueAction == 3575) {
|
||||||
player.getDialogueHandler().sendDialogues(3577, player.npcType);
|
player.getDialogueHandler().sendDialogues(3577, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7556) {
|
}
|
||||||
|
else if (player.dialogueAction == 7556)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3710, player.npcType);
|
player.getDialogueHandler().sendDialogues(3710, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7557) {
|
}
|
||||||
|
else if (player.dialogueAction == 7557)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3586, player.npcType);
|
player.getDialogueHandler().sendDialogues(3586, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7558) {
|
}
|
||||||
|
else if (player.dialogueAction == 7558)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3586, player.npcType);
|
player.getDialogueHandler().sendDialogues(3586, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7559) {
|
}
|
||||||
|
else if (player.dialogueAction == 7559) {
|
||||||
player.getDialogueHandler().sendDialogues(3864, player.npcType);
|
player.getDialogueHandler().sendDialogues(3864, player.npcType);
|
||||||
return;
|
return;
|
||||||
|
} else if (player.dialogueAction == 10004) {
|
||||||
|
if(!player.closeTutorialInterface) {
|
||||||
|
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().showInterface(3559);
|
||||||
|
player.canChangeAppearance = true;
|
||||||
|
player.closeTutorialInterface = true;
|
||||||
|
return;
|
||||||
|
} else if (player.getXPRate() != + GameConstants.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;
|
||||||
|
} else {
|
||||||
|
player.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you now have the highest XP rate.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if(player.dialogueAction == 10006) {
|
||||||
|
player.setXPRate(GameConstants.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.getPacketSender().sendMessage("Your XP rate is now set to x" + player.getXPRate() + " you now have the highest XP rate.");
|
||||||
|
player.getPacketSender().closeAllWindows();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
player.dialogueAction = 0;
|
player.dialogueAction = 0;
|
||||||
player.getPacketSender().closeAllWindows();
|
player.getPacketSender().closeAllWindows();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Second
|
|
||||||
case 9158:
|
case 9158:
|
||||||
if (player.dialogueAction == 8) {
|
if (player.dialogueAction == 8) {
|
||||||
player.getPlayerAssistant().fixAllBarrows();
|
player.getPlayerAssistant().fixAllBarrows();
|
||||||
@@ -349,9 +689,6 @@ public class DialogueOptions {
|
|||||||
} else if (player.dialogueAction == 74) {
|
} else if (player.dialogueAction == 74) {
|
||||||
player.getDialogueHandler().sendDialogues(535, player.npcType);
|
player.getDialogueHandler().sendDialogues(535, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 57) {
|
|
||||||
player.getDialogueHandler().sendDialogues(58, player.npcType);
|
|
||||||
return;
|
|
||||||
} else if (player.dialogueAction == 62) {
|
} else if (player.dialogueAction == 62) {
|
||||||
player.getDialogueHandler().sendDialogues(309, player.npcType);
|
player.getDialogueHandler().sendDialogues(309, player.npcType);
|
||||||
return;
|
return;
|
||||||
@@ -535,294 +872,33 @@ public class DialogueOptions {
|
|||||||
} else if (player.dialogueAction == 3575) {
|
} else if (player.dialogueAction == 3575) {
|
||||||
player.getDialogueHandler().sendDialogues(3576, player.npcType);
|
player.getDialogueHandler().sendDialogues(3576, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7556) {
|
} else if (player.dialogueAction == 7556)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3702, player.npcType);
|
player.getDialogueHandler().sendDialogues(3702, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7557) {
|
} else if (player.dialogueAction == 7557)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3704, player.npcType);
|
player.getDialogueHandler().sendDialogues(3704, player.npcType);
|
||||||
return;
|
return;
|
||||||
} else if (player.dialogueAction == 7559) {
|
}
|
||||||
|
else if (player.dialogueAction == 7559)
|
||||||
|
{
|
||||||
player.getDialogueHandler().sendDialogues(3865, player.npcType);
|
player.getDialogueHandler().sendDialogues(3865, player.npcType);
|
||||||
return;
|
return;
|
||||||
}
|
} else if (player.dialogueAction == 10004) {
|
||||||
player.dialogueAction = 0;
|
player.getDialogueHandler().sendDialogues(10002, 2244);
|
||||||
|
return;
|
||||||
|
} else if(player.dialogueAction == 10006) {
|
||||||
|
player.setXPRate(GameConstants.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();
|
player.getPacketSender().closeAllWindows();
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* THREE OPTIONS
|
|
||||||
*/
|
|
||||||
|
|
||||||
// First
|
|
||||||
case 9167:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 63:
|
|
||||||
player.getDialogueHandler().sendDialogues(166, player.npcType);
|
|
||||||
return;
|
|
||||||
case 64:
|
|
||||||
player.getDialogueHandler().sendDialogues(173, player.npcType);
|
|
||||||
return;
|
|
||||||
case 60:
|
|
||||||
player.getDialogueHandler().sendDialogues(277, player.npcType);
|
|
||||||
return;
|
|
||||||
case 61:
|
|
||||||
player.getDialogueHandler().sendDialogues(295, player.npcType);
|
|
||||||
return;
|
|
||||||
case 129:
|
|
||||||
player.getDialogueHandler().sendDialogues(231, player.npcType);
|
|
||||||
return;
|
|
||||||
case 58:
|
|
||||||
player.getDialogueHandler().sendDialogues(540, player.npcType);
|
|
||||||
return;
|
|
||||||
case 68:
|
|
||||||
player.getDialogueHandler().sendDialogues(39, player.npcType);
|
|
||||||
return;
|
|
||||||
case 124:
|
|
||||||
player.getDialogueHandler().sendDialogues(194, player.npcType);
|
|
||||||
return;
|
|
||||||
case 230:
|
|
||||||
player.getDialogueHandler().sendDialogues(1053, player.npcType);
|
|
||||||
return;
|
|
||||||
case 144:
|
|
||||||
player.getDialogueHandler().sendDialogues(1314, player.npcType);
|
|
||||||
return;
|
|
||||||
case 502:
|
|
||||||
player.getDialogueHandler().sendDialogues(1026, player.npcType);
|
|
||||||
return;
|
|
||||||
case 1301: // first option haircut.
|
|
||||||
player.getDialogueHandler().sendDialogues(1302, 598);
|
|
||||||
return;
|
|
||||||
case 53:
|
|
||||||
if (player.objectId == 1293 || player.objectId == 1317) {
|
|
||||||
player.getPlayerAssistant().startTeleport(2542, 3169, 0, "modern");
|
|
||||||
} else {
|
|
||||||
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
|
||||||
player.getPacketSender().closeAllWindows();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case 159:
|
|
||||||
player.getDialogueHandler().sendDialogues(3161, player.npcType);
|
|
||||||
return;
|
|
||||||
case 167:
|
|
||||||
player.getDialogueHandler().sendDialogues(1343, player.npcType);
|
|
||||||
return;
|
|
||||||
case 222:
|
|
||||||
player.getDialogueHandler().sendDialogues(911, player.npcType);
|
|
||||||
player.dialogueAction = -1;
|
|
||||||
return;
|
|
||||||
case 182:
|
|
||||||
player.getDialogueHandler().sendNpcChat1("No, I was hoping someone could help me find it though.", player.talkingNpc, "Squire");
|
|
||||||
player.nextChat = 0;
|
|
||||||
return;
|
|
||||||
case 188:
|
|
||||||
player.getDialogueHandler().sendDialogues(3129, 945);
|
|
||||||
return;
|
|
||||||
case 185:
|
|
||||||
player.getDialogueHandler().sendDialogues(629, player.npcType);
|
|
||||||
return;
|
|
||||||
case 186: // Shield of Arrav
|
|
||||||
player.getDialogueHandler().sendDialogues(629, player.npcType);
|
|
||||||
return;
|
|
||||||
case 702:
|
|
||||||
player.getDialogueHandler().sendDialogues(3567, player.npcType);
|
|
||||||
return;
|
|
||||||
case 7555: //lostCity 1
|
|
||||||
player.getDialogueHandler().sendDialogues(3701, player.npcType);
|
|
||||||
return;
|
|
||||||
case 10000: // Shop
|
|
||||||
if (!player.inPlayerShopArea()) {
|
|
||||||
player.getDialogueHandler().sendStatement("You need to be in a bank zone or trade area for this.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.getDialogueHandler().sendStatement("You summoned your shop!");
|
|
||||||
BotHandler.playerShop(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.dialogueAction = 0;
|
|
||||||
player.getPacketSender().closeAllWindows();
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Second
|
|
||||||
case 9168:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 63:
|
|
||||||
player.getDialogueHandler().sendDialogues(167, player.npcType);
|
|
||||||
return;
|
|
||||||
case 64:
|
|
||||||
player.getDialogueHandler().sendDialogues(174, player.npcType);
|
|
||||||
return;
|
|
||||||
case 60:
|
|
||||||
player.getDialogueHandler().sendDialogues(279, player.npcType);
|
|
||||||
return;
|
|
||||||
case 61:
|
|
||||||
player.getDialogueHandler().sendDialogues(297, player.npcType);
|
|
||||||
return;
|
|
||||||
case 124:
|
|
||||||
player.getDialogueHandler().sendDialogues(192, player.npcType);
|
|
||||||
return;
|
|
||||||
case 126:
|
|
||||||
player.getDialogueHandler().sendDialogues(203, player.npcType);
|
|
||||||
return;
|
|
||||||
case 58:
|
|
||||||
player.getDialogueHandler().sendDialogues(538, player.npcType);
|
|
||||||
return;
|
|
||||||
case 68:
|
|
||||||
player.getDialogueHandler().sendDialogues(40, player.npcType);
|
|
||||||
return;
|
|
||||||
case 230:
|
|
||||||
player.getDialogueHandler().sendDialogues(1049, player.npcType);
|
|
||||||
break;
|
|
||||||
case 502:
|
|
||||||
player.getDialogueHandler().sendDialogues(1022, player.npcType);
|
|
||||||
return;
|
|
||||||
case 1301:
|
|
||||||
player.getDialogueHandler().sendDialogues(1308, 598);
|
|
||||||
return;
|
|
||||||
case 144:
|
|
||||||
player.getDialogueHandler().sendDialogues(1315, player.npcType);
|
|
||||||
return;
|
|
||||||
case 53:
|
|
||||||
if (player.objectId == 1294 || player.objectId == 1317) {
|
|
||||||
player.getPlayerAssistant().startTeleport(2461, 3444, 0,
|
|
||||||
"modern");
|
|
||||||
} else {
|
|
||||||
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
|
||||||
player.getPacketSender().closeAllWindows();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case 159:
|
|
||||||
player.getDialogueHandler().sendDialogues(3195, player.npcType);
|
|
||||||
return;
|
|
||||||
case 167:
|
|
||||||
player.getDialogueHandler().sendDialogues(1344, player.npcType);
|
|
||||||
return;
|
|
||||||
case 222:
|
|
||||||
player.getDialogueHandler().sendDialogues(912, player.npcType);
|
|
||||||
player.dialogueAction = -1;
|
|
||||||
return;
|
|
||||||
case 182:
|
|
||||||
player.getDialogueHandler().sendDialogues(615, player.npcType);
|
|
||||||
return;
|
|
||||||
case 188:
|
|
||||||
player.getDialogueHandler().sendDialogues(3130, 945);
|
|
||||||
return;
|
|
||||||
case 185:
|
|
||||||
player.getDialogueHandler().sendDialogues(628, player.npcType);
|
|
||||||
return;
|
|
||||||
case 186: // Shield of Arrav
|
|
||||||
player.getDialogueHandler().sendDialogues(628, player.npcType);
|
|
||||||
return;
|
|
||||||
case 702:
|
|
||||||
player.getDialogueHandler().sendDialogues(3568, player.npcType);
|
|
||||||
return;
|
|
||||||
case 7555:
|
|
||||||
player.getDialogueHandler().sendDialogues(3597, player.npcType);
|
|
||||||
return;
|
|
||||||
case 10000:
|
|
||||||
player.getDialogueHandler().sendStatement("You close your shop!");
|
|
||||||
BotHandler.closeShop(player);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player.dialogueAction = 0;
|
player.dialogueAction = 0;
|
||||||
player.getPacketSender().closeAllWindows();
|
player.getPacketSender().closeAllWindows();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Third
|
|
||||||
case 9169:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 63:
|
|
||||||
player.getDialogueHandler().sendDialogues(168, player.npcType);
|
|
||||||
return;
|
|
||||||
case 64:
|
|
||||||
player.getDialogueHandler().sendDialogues(175, player.npcType);
|
|
||||||
return;
|
|
||||||
case 60:
|
|
||||||
player.getDialogueHandler().sendDialogues(278, player.npcType);
|
|
||||||
return;
|
|
||||||
case 61:
|
|
||||||
player.getDialogueHandler().sendDialogues(296, player.npcType);
|
|
||||||
return;
|
|
||||||
case 53:
|
|
||||||
if (player.objectId == 1294 || player.objectId == 1293) {
|
|
||||||
player.getPlayerAssistant().startTeleport(3179, 3507, 0,
|
|
||||||
"modern");
|
|
||||||
} else {
|
|
||||||
player.getPacketSender().sendMessage("You can't teleport there, because you are already there!");
|
|
||||||
player.getPacketSender().closeAllWindows();
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
case 129:
|
|
||||||
player.getDialogueHandler().sendDialogues(232, player.npcType);
|
|
||||||
return;
|
|
||||||
case 126:
|
|
||||||
player.getDialogueHandler().sendDialogues(204, player.npcType);
|
|
||||||
return;
|
|
||||||
case 144:
|
|
||||||
player.getDialogueHandler().sendDialogues(1316, player.npcType);
|
|
||||||
return;
|
|
||||||
case 124:
|
|
||||||
player.getDialogueHandler().sendDialogues(3193, 741);
|
|
||||||
return;
|
|
||||||
case 58:
|
|
||||||
player.getDialogueHandler().sendDialogues(539, player.npcType);
|
|
||||||
return;
|
|
||||||
case 68:
|
|
||||||
player.getDialogueHandler().sendDialogues(41, player.npcType);
|
|
||||||
return;
|
|
||||||
case 230:
|
|
||||||
player.getDialogueHandler().sendDialogues(1050, player.npcType);
|
|
||||||
break;
|
|
||||||
case 502:
|
|
||||||
player.getDialogueHandler().sendDialogues(1025, player.npcType);
|
|
||||||
return;
|
|
||||||
case 1301:
|
|
||||||
player.getDialogueHandler().sendDialogues(1306, 598);
|
|
||||||
return;
|
|
||||||
case 222:
|
|
||||||
player.getDialogueHandler().sendDialogues(913, player.npcType);
|
|
||||||
player.dialogueAction = -1;
|
|
||||||
return;
|
|
||||||
case 167:
|
|
||||||
player.getDialogueHandler().sendDialogues(1342, player.npcType);
|
|
||||||
return;
|
|
||||||
case 159:
|
|
||||||
player.getDialogueHandler().sendDialogues(3160, player.npcType);
|
|
||||||
return;
|
|
||||||
case 182:
|
|
||||||
player.getDialogueHandler().sendNpcChat1("Of course he is angry...", player.talkingNpc, "Squire");
|
|
||||||
player.nextChat = 0;
|
|
||||||
return;
|
|
||||||
case 188:
|
|
||||||
player.getDialogueHandler().sendDialogues(3131, 945);
|
|
||||||
return;
|
|
||||||
case 185:
|
|
||||||
player.getDialogueHandler().sendDialogues(630, player.npcType);
|
|
||||||
return;
|
|
||||||
case 186: // Shield of Arrav
|
|
||||||
player.getDialogueHandler().sendDialogues(691, player.npcType);
|
|
||||||
return;
|
|
||||||
case 702:
|
|
||||||
player.getDialogueHandler().sendDialogues(3569, player.npcType);
|
|
||||||
return;
|
|
||||||
case 7555:
|
|
||||||
player.getDialogueHandler().sendDialogues(3599, player.npcType);
|
|
||||||
return;
|
|
||||||
case 10000:
|
|
||||||
player.getDialogueHandler().sendStatement("You withdraw " + Bot.formatSellPrice(BotHandler.checkCoins(player)) + " from your shop!");
|
|
||||||
BotHandler.takeCoins(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.dialogueAction = 0;
|
|
||||||
player.getPacketSender().closeAllWindows();
|
|
||||||
break;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FOUR OPTIONS
|
|
||||||
*/
|
|
||||||
|
|
||||||
// First
|
|
||||||
case 9178:
|
case 9178:
|
||||||
if (player.dialogueAction == 2) {
|
if (player.dialogueAction == 2) {
|
||||||
player.getPlayerAssistant().startTeleport(3428, 3538, 0, "modern");
|
player.getPlayerAssistant().startTeleport(3428, 3538, 0, "modern");
|
||||||
@@ -862,9 +938,6 @@ public class DialogueOptions {
|
|||||||
if (player.dialogueAction == 113) {
|
if (player.dialogueAction == 113) {
|
||||||
player.getDialogueHandler().sendDialogues(3540, player.npcType);
|
player.getDialogueHandler().sendDialogues(3540, player.npcType);
|
||||||
}
|
}
|
||||||
if (player.dialogueAction == 52) {
|
|
||||||
player.getDialogueHandler().sendDialogues(52, player.npcType);
|
|
||||||
}
|
|
||||||
if (player.dialogueAction == 1000) {
|
if (player.dialogueAction == 1000) {
|
||||||
player.getDialogueHandler().sendDialogues(3524,player.npcType);
|
player.getDialogueHandler().sendDialogues(3524,player.npcType);
|
||||||
}
|
}
|
||||||
@@ -892,10 +965,12 @@ public class DialogueOptions {
|
|||||||
if (player.dialogueAction == 701) {
|
if (player.dialogueAction == 701) {
|
||||||
player.getDialogueHandler().sendDialogues(3561, player.npcType);
|
player.getDialogueHandler().sendDialogues(3561, player.npcType);
|
||||||
}
|
}
|
||||||
|
if (player.dialogueAction == 10002) {
|
||||||
|
player.setXPRate(GameConstants.VARIABLE_XP_RATES[0]);
|
||||||
|
player.getDialogueHandler().sendDialogues(10003, player.npcType);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Second
|
|
||||||
case 9179:
|
case 9179:
|
||||||
if (player.dialogueAction == 2) {
|
if (player.dialogueAction == 2) {
|
||||||
player.getPlayerAssistant().startTeleport(2884, 3395, 0, "modern");
|
player.getPlayerAssistant().startTeleport(2884, 3395, 0, "modern");
|
||||||
@@ -933,9 +1008,6 @@ public class DialogueOptions {
|
|||||||
player.getPlayerAssistant().gloryTeleport(3293, 3174, 0, "modern");
|
player.getPlayerAssistant().gloryTeleport(3293, 3174, 0, "modern");
|
||||||
Teles.necklaces(player);
|
Teles.necklaces(player);
|
||||||
}
|
}
|
||||||
if (player.dialogueAction == 52) {
|
|
||||||
player.getDialogueHandler().sendDialogues(64, player.npcType);
|
|
||||||
}
|
|
||||||
if (player.dialogueAction == 1000) {
|
if (player.dialogueAction == 1000) {
|
||||||
player.getDialogueHandler().sendDialogues(3523, player.npcType);
|
player.getDialogueHandler().sendDialogues(3523, player.npcType);
|
||||||
}
|
}
|
||||||
@@ -963,10 +1035,12 @@ public class DialogueOptions {
|
|||||||
if (player.dialogueAction == 701) {
|
if (player.dialogueAction == 701) {
|
||||||
player.getDialogueHandler().sendDialogues(3562, player.npcType);
|
player.getDialogueHandler().sendDialogues(3562, player.npcType);
|
||||||
}
|
}
|
||||||
|
if (player.dialogueAction == 10002) {
|
||||||
|
player.setXPRate(GameConstants.VARIABLE_XP_RATES[1]);
|
||||||
|
player.getDialogueHandler().sendDialogues(10003, player.npcType);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Third
|
|
||||||
case 9180:
|
case 9180:
|
||||||
if (player.dialogueAction == 2) {
|
if (player.dialogueAction == 2) {
|
||||||
player.getPlayerAssistant().startTeleport(2471, 10137, 0, "modern");
|
player.getPlayerAssistant().startTeleport(2471, 10137, 0, "modern");
|
||||||
@@ -1007,9 +1081,6 @@ public class DialogueOptions {
|
|||||||
player.getPlayerAssistant().gloryTeleport(2911, 3152, 0, "modern");
|
player.getPlayerAssistant().gloryTeleport(2911, 3152, 0, "modern");
|
||||||
Teles.necklaces(player);
|
Teles.necklaces(player);
|
||||||
}
|
}
|
||||||
if (player.dialogueAction == 52) {
|
|
||||||
player.getDialogueHandler().sendDialogues(65, player.npcType);
|
|
||||||
}
|
|
||||||
if (player.dialogueAction == 1000) {
|
if (player.dialogueAction == 1000) {
|
||||||
player.getDialogueHandler().sendDialogues(3523,player.npcType);
|
player.getDialogueHandler().sendDialogues(3523,player.npcType);
|
||||||
}
|
}
|
||||||
@@ -1037,10 +1108,12 @@ public class DialogueOptions {
|
|||||||
if (player.dialogueAction == 701) {
|
if (player.dialogueAction == 701) {
|
||||||
player.getDialogueHandler().sendDialogues(3563, player.npcType);
|
player.getDialogueHandler().sendDialogues(3563, player.npcType);
|
||||||
}
|
}
|
||||||
|
if (player.dialogueAction == 10002) {
|
||||||
|
player.setXPRate(GameConstants.VARIABLE_XP_RATES[2]);
|
||||||
|
player.getDialogueHandler().sendDialogues(10003, player.npcType);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Fourth
|
|
||||||
case 9181:
|
case 9181:
|
||||||
if (player.dialogueAction == 2) {
|
if (player.dialogueAction == 2) {
|
||||||
player.getPlayerAssistant().startTeleport(2669, 3714, 0, "modern");
|
player.getPlayerAssistant().startTeleport(2669, 3714, 0, "modern");
|
||||||
@@ -1066,9 +1139,6 @@ public class DialogueOptions {
|
|||||||
player.getPlayerAssistant().gloryTeleport(3103, 3249, 0, "modern");
|
player.getPlayerAssistant().gloryTeleport(3103, 3249, 0, "modern");
|
||||||
Teles.necklaces(player);
|
Teles.necklaces(player);
|
||||||
}
|
}
|
||||||
if (player.dialogueAction == 52) {
|
|
||||||
player.getDialogueHandler().sendDialogues(63, player.npcType);
|
|
||||||
}
|
|
||||||
if (player.dialogueAction == 1000) {
|
if (player.dialogueAction == 1000) {
|
||||||
player.getDialogueHandler().sendDialogues(3523, player.npcType);
|
player.getDialogueHandler().sendDialogues(3523, player.npcType);
|
||||||
}
|
}
|
||||||
@@ -1096,63 +1166,12 @@ public class DialogueOptions {
|
|||||||
if (player.dialogueAction == 701) {
|
if (player.dialogueAction == 701) {
|
||||||
player.getDialogueHandler().sendDialogues(3564, player.npcType);
|
player.getDialogueHandler().sendDialogues(3564, player.npcType);
|
||||||
}
|
}
|
||||||
|
if (player.dialogueAction == 10002) {
|
||||||
break;
|
player.setXPRate(GameConstants.VARIABLE_XP_RATES[3]);
|
||||||
|
player.getDialogueHandler().sendDialogues(10003, player.npcType);
|
||||||
|
|
||||||
/*
|
|
||||||
* FIVE OPTIONS
|
|
||||||
*/
|
|
||||||
|
|
||||||
// First
|
|
||||||
case 9190:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 112:
|
|
||||||
player.getDialogueHandler().sendDialogues(3533, player.npcType);//4
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Second
|
|
||||||
case 9191:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 112:
|
|
||||||
player.getDialogueHandler().sendDialogues(3540, player.npcType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Third
|
|
||||||
case 9192:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 112:
|
|
||||||
player.getDialogueHandler().sendDialogues(3548, player.npcType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Fourth
|
|
||||||
case 9193:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 112:
|
|
||||||
player.getDialogueHandler().sendDialogues(3550, player.npcType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Fifth
|
|
||||||
case 9194:
|
|
||||||
switch (player.dialogueAction) {
|
|
||||||
case 112:
|
|
||||||
player.getDialogueHandler().sendDialogues(3553, player.npcType);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -724,18 +724,6 @@ public class NpcActions {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 278:
|
|
||||||
if (player.cookAss == 0) {
|
|
||||||
player.getDialogueHandler().sendDialogues(50, npcType);
|
|
||||||
} else if (player.cookAss == 1) {
|
|
||||||
player.getDialogueHandler().sendDialogues(67, npcType);
|
|
||||||
} else if (player.cookAss == 2) {
|
|
||||||
player.getDialogueHandler().sendDialogues(69, npcType);
|
|
||||||
} else if (player.cookAss == 3) {
|
|
||||||
player.getDialogueHandler().sendDialogues(76, npcType);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 608:
|
case 608:
|
||||||
if (player.blackKnight == 0 && player.questPoints >= 12) {
|
if (player.blackKnight == 0 && player.questPoints >= 12) {
|
||||||
player.getDialogueHandler().sendDialogues(3902, npcType);
|
player.getDialogueHandler().sendDialogues(3902, npcType);
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public abstract class Player {
|
|||||||
|
|
||||||
public byte buffer[] = null;
|
public byte buffer[] = null;
|
||||||
public String lastConnectedFrom;
|
public String lastConnectedFrom;
|
||||||
|
public static int xpRate = 1;
|
||||||
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);
|
||||||
@@ -150,6 +151,10 @@ public abstract class Player {
|
|||||||
private DoubleGates doubleGates = new DoubleGates();
|
private DoubleGates doubleGates = new DoubleGates();
|
||||||
public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits
|
public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits
|
||||||
|
|
||||||
|
public int getXPRate() { return xpRate; }
|
||||||
|
|
||||||
|
public void setXPRate(int xpRate) { this.xpRate = xpRate; }
|
||||||
|
|
||||||
public boolean isPreaching() {
|
public boolean isPreaching() {
|
||||||
return preaching;
|
return preaching;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import com.rs2.game.content.music.sound.SoundList;
|
|||||||
import com.rs2.game.content.randomevents.RandomEventHandler;
|
import com.rs2.game.content.randomevents.RandomEventHandler;
|
||||||
import com.rs2.game.content.skills.SkillData;
|
import com.rs2.game.content.skills.SkillData;
|
||||||
import com.rs2.game.content.skills.SkillHandler;
|
import com.rs2.game.content.skills.SkillHandler;
|
||||||
import com.rs2.game.content.skills.smithing.Superheat;
|
|
||||||
import com.rs2.game.items.GameItem;
|
import com.rs2.game.items.GameItem;
|
||||||
import com.rs2.game.items.ItemAssistant;
|
import com.rs2.game.items.ItemAssistant;
|
||||||
import com.rs2.game.items.ItemConstants;
|
import com.rs2.game.items.ItemConstants;
|
||||||
@@ -95,7 +94,7 @@ public class PlayerAssistant {
|
|||||||
|
|
||||||
public void loginScreen() {
|
public void loginScreen() {
|
||||||
player.getPacketSender().showInterface(15244);
|
player.getPacketSender().showInterface(15244);
|
||||||
player.getPacketSender().sendString("Welcome to " + GameConstants.SERVER_NAME + "\\n", 15257);
|
player.getPacketSender().sendString("Welcome to " + GameConstants.SERVER_NAME + " World: " + GameConstants.WORLD + "\\n", 15257);
|
||||||
int currentDay = player.getLastLogin() - player.lastLoginDate;
|
int currentDay = player.getLastLogin() - player.lastLoginDate;
|
||||||
|
|
||||||
if (player.playerLevel[GameConstants.HERBLORE] < 3) {
|
if (player.playerLevel[GameConstants.HERBLORE] < 3) {
|
||||||
@@ -1833,7 +1832,7 @@ public class PlayerAssistant {
|
|||||||
player.getItemAssistant().clearBank();
|
player.getItemAssistant().clearBank();
|
||||||
player.getPlayerAssistant().addStarter();
|
player.getPlayerAssistant().addStarter();
|
||||||
player.getPlayerAssistant().movePlayer(3233, 3229, 0);
|
player.getPlayerAssistant().movePlayer(3233, 3229, 0);
|
||||||
player.getPacketSender().sendMessage("Welcome to @blu@" + GameConstants.SERVER_NAME + "@bla@ - we are currently in Server Stage v@blu@" + GameConstants.TEST_VERSION + "@bla@.");
|
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("@red@Did you know?@bla@ We're open source and pull requests are welcome!");
|
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("Source code: github.com/2006-Scape/2006Scape");
|
||||||
player.getPacketSender().sendMessage("Discord: https://discord.gg/hZ6VfWG");
|
player.getPacketSender().sendMessage("Discord: https://discord.gg/hZ6VfWG");
|
||||||
@@ -2033,7 +2032,11 @@ public class PlayerAssistant {
|
|||||||
if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && GameConstants.TUTORIAL_ISLAND) {
|
if (player.tutorialProgress < 36 && player.playerLevel[skill] == 3 && GameConstants.TUTORIAL_ISLAND) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (GameConstants.VARIABLE_XP_RATE){
|
||||||
|
amount *= player.getXPRate();
|
||||||
|
} else {
|
||||||
amount *= GameConstants.XP_RATE;
|
amount *= GameConstants.XP_RATE;
|
||||||
|
}
|
||||||
int oldLevel = getLevelForXP(player.playerXP[skill]);
|
int oldLevel = getLevelForXP(player.playerXP[skill]);
|
||||||
player.playerXP[skill] += amount;
|
player.playerXP[skill] += amount;
|
||||||
if (oldLevel < getLevelForXP(player.playerXP[skill])) {
|
if (oldLevel < getLevelForXP(player.playerXP[skill])) {
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ public class PlayerSave {
|
|||||||
case "character-rights":
|
case "character-rights":
|
||||||
player.playerRights = Integer.parseInt(token2);
|
player.playerRights = Integer.parseInt(token2);
|
||||||
break;
|
break;
|
||||||
|
case "xp-rate":
|
||||||
|
player.xpRate = Integer.parseInt(token2);
|
||||||
case "last-ip":
|
case "last-ip":
|
||||||
player.lastConnectedFrom = token2;
|
player.lastConnectedFrom = token2;
|
||||||
break;
|
break;
|
||||||
@@ -593,6 +595,8 @@ public class PlayerSave {
|
|||||||
characterfile.newLine();
|
characterfile.newLine();
|
||||||
characterfile.write("character-rights = " + player.playerRights);
|
characterfile.write("character-rights = " + player.playerRights);
|
||||||
characterfile.newLine();
|
characterfile.newLine();
|
||||||
|
characterfile.write("xp-rate = " + player.xpRate);
|
||||||
|
characterfile.newLine();
|
||||||
characterfile.write("last-ip = " + player.connectedFrom);
|
characterfile.write("last-ip = " + player.connectedFrom);
|
||||||
characterfile.newLine();
|
characterfile.newLine();
|
||||||
characterfile.write("isBot = " + player.isBot);
|
characterfile.write("isBot = " + player.isBot);
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import com.rs2.game.players.PlayerHandler;
|
|||||||
|
|
||||||
public class PlayersOnlineWebsite {
|
public class PlayersOnlineWebsite {
|
||||||
|
|
||||||
static String password;
|
public static String password;
|
||||||
private static boolean hasntwared = true;
|
private static boolean hasntwared = true;
|
||||||
|
|
||||||
private static void setWebsitePlayersOnline(int amount) throws IOException {
|
private static void setWebsitePlayersOnline(int amount) throws IOException {
|
||||||
URL url;
|
URL url;
|
||||||
url = new URL(GameConstants.WEBSITE_LINK + "/playersonline.php?pass=" + password + "&amount=" + amount);
|
url = new URL(GameConstants.WEBSITE_LINK + "/playersonline.php?pass=" + password + "&amount=" + amount + "&world=" + GameConstants.WORLD);
|
||||||
url.openStream().close();
|
url.openStream().close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import java.net.URL;
|
|||||||
import com.rs2.GameConstants;
|
import com.rs2.GameConstants;
|
||||||
|
|
||||||
public class RegisteredAccsWebsite {
|
public class RegisteredAccsWebsite {
|
||||||
static String password;
|
public static String password;
|
||||||
private static boolean hasntwarned = true;
|
private static boolean hasntwarned = true;
|
||||||
|
|
||||||
private static void setAccountsRegistered(int amount) throws IOException {
|
private static void setAccountsRegistered(int amount) throws IOException {
|
||||||
URL url;
|
URL url;
|
||||||
url = new URL(GameConstants.WEBSITE_LINK + "/accountsregistered.php?pass=" + password + "&amount=" + amount);
|
url = new URL(GameConstants.WEBSITE_LINK + "/accountsregistered.php?pass=" + password + "&amount=" + amount + "&world=" + GameConstants.WORLD);
|
||||||
url.openStream().close();
|
url.openStream().close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
package com.rs2.integrations;
|
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import com.rs2.GameEngine;
|
|
||||||
import com.rs2.integrations.discord.JavaCord;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public class SettingsLoader {
|
|
||||||
private static void initialize() {
|
|
||||||
JSONObject main = new JSONObject();
|
|
||||||
main
|
|
||||||
.put("bot-token", "")
|
|
||||||
.put("websitepass", "")
|
|
||||||
.put("erssecret", "");
|
|
||||||
try {
|
|
||||||
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
|
|
||||||
br.write(main.toString());
|
|
||||||
br.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadSettings() throws IOException {
|
|
||||||
if (!new File("data/secrets.json").exists()) {
|
|
||||||
initialize();
|
|
||||||
System.out.println("Please open \"data/secrets.json\" file and enter your discord token bot there!");
|
|
||||||
System.out.println("Please open \"data/secrets.json\" file and enter your Website Password there!");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
|
|
||||||
String out = br.lines().collect(Collectors.joining("\n"));
|
|
||||||
JSONObject obj = new JSONObject(out);
|
|
||||||
|
|
||||||
JavaCord.token = obj.getString("bot-token");
|
|
||||||
PlayersOnlineWebsite.password = obj.getString("websitepass");
|
|
||||||
RegisteredAccsWebsite.password = obj.getString("websitepass");
|
|
||||||
GameEngine.ersSecret = obj.getString("erssecret");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.rs2.integrations.discord;
|
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.admin.GameKick;
|
||||||
|
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;
|
||||||
import org.javacord.api.entity.message.MessageBuilder;
|
import org.javacord.api.entity.message.MessageBuilder;
|
||||||
import org.javacord.api.util.logging.ExceptionLogger;
|
import org.javacord.api.util.logging.ExceptionLogger;
|
||||||
import com.rs2.integrations.discord.commands.*;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
@@ -17,6 +20,7 @@ import java.io.IOException;
|
|||||||
public class JavaCord {
|
public class JavaCord {
|
||||||
|
|
||||||
public static String serverName = GameConstants.SERVER_NAME;
|
public static String serverName = GameConstants.SERVER_NAME;
|
||||||
|
public static String commandPrefix = "::w" + GameConstants.WORLD;
|
||||||
public static String token;
|
public static String token;
|
||||||
public static DiscordApi api = null;
|
public static DiscordApi api = null;
|
||||||
|
|
||||||
@@ -34,19 +38,14 @@ public class JavaCord {
|
|||||||
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
|
||||||
|
api.addListener(new GameKick());
|
||||||
|
api.addListener(new MoveHome());
|
||||||
|
api.addListener(new Update());
|
||||||
if(!DiscordActivity.playerCount) {
|
if(!DiscordActivity.playerCount) {
|
||||||
api.updateActivity(GameConstants.WEBSITE_LINK);
|
api.updateActivity(GameConstants.WEBSITE_LINK);
|
||||||
}
|
}
|
||||||
api.addMessageCreateListener(event -> {
|
api.addMessageCreateListener(event -> {
|
||||||
|
|
||||||
if (event.getMessageContent().startsWith("::movehome")) {
|
|
||||||
if (event.getMessageAuthor().isServerAdmin()) {
|
|
||||||
System.out.println("perms");
|
|
||||||
event.getChannel().sendMessage("perms");
|
|
||||||
} else {
|
|
||||||
event.getChannel().sendMessage("You do not have permission to preform this command");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -8,22 +9,20 @@ public class Commands 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("::commands")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " commands")) {
|
||||||
event.getChannel().sendMessage("```fix"
|
event.getChannel().sendMessage("```fix"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::forum/::forums"
|
JavaCord.commandPrefix + " forum/" + JavaCord.commandPrefix + " forums"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::hiscores/::highscores"
|
JavaCord.commandPrefix + " hiscores/" + JavaCord.commandPrefix + " highscores"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::issues/::bugs"
|
JavaCord.commandPrefix + " issues/" + JavaCord.commandPrefix + " bugs"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::online"
|
JavaCord.commandPrefix + " online"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::players"
|
JavaCord.commandPrefix + " vote"
|
||||||
+ System.lineSeparator() +
|
+ System.lineSeparator() +
|
||||||
"::vote"
|
JavaCord.commandPrefix + " website/" + JavaCord.commandPrefix + " site"
|
||||||
+ System.lineSeparator() +
|
|
||||||
"::website/::site"
|
|
||||||
+ "```");
|
+ "```");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -10,7 +11,7 @@ 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("::forum") || message.getContent().equalsIgnoreCase("::forums")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forum") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forums")) {
|
||||||
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/forums/index.php");
|
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/forums/index.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -10,7 +11,7 @@ public class Hiscores 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("::hiscores") || message.getContent().equalsIgnoreCase("::highscores")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " hiscores") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " highscores")) {
|
||||||
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/hiscores.html");
|
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/hiscores.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -8,7 +9,7 @@ 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("::issues") || message.getContent().equalsIgnoreCase("::bugs")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " issues") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix+ " bugs")) {
|
||||||
event.getChannel().sendMessage("https://github.com/2006-Scape/2006Scape/issues");
|
event.getChannel().sendMessage("https://github.com/2006-Scape/2006Scape/issues");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.rs2.integrations.discord.commands;
|
package com.rs2.integrations.discord.commands;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -10,8 +11,8 @@ public class Online 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("::online")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " online")) {
|
||||||
event.getChannel().sendMessage(":tada: " + JavaCord.serverName + " is Online! :tada:");
|
event.getChannel().sendMessage(":tada: " + JavaCord.serverName + " World:" + GameConstants.WORLD + " is Online! :tada:");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
package com.rs2.integrations.discord.commands;
|
package com.rs2.integrations.discord.commands;
|
||||||
|
|
||||||
|
import com.rs2.game.players.PlayerHandler;
|
||||||
|
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;
|
||||||
|
|
||||||
import com.rs2.game.players.PlayerHandler;
|
|
||||||
|
|
||||||
public class Players implements MessageCreateListener {
|
public class Players 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("::players")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " players")) {
|
||||||
if (PlayerHandler.getPlayerCount() != 1) {
|
if (PlayerHandler.getPlayerCount() != 1) {
|
||||||
event.getChannel().sendMessage("There are currently " + PlayerHandler.getPlayerCount() + " players online (" + PlayerHandler.getNonPlayerCount() + " staff online).");
|
event.getChannel().sendMessage("There are currently " + PlayerHandler.getPlayerCount() + " players online (" + PlayerHandler.getNonPlayerCount() + " staff online).");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -10,7 +11,7 @@ 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("::vote")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " vote")) {
|
||||||
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,5 +1,6 @@
|
|||||||
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;
|
||||||
@@ -10,7 +11,7 @@ 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("::website") || message.getContent().equalsIgnoreCase("::site")) {
|
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " website") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " site")) {
|
||||||
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK);
|
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.rs2.integrations.discord.commands.admin;
|
||||||
|
|
||||||
|
import com.rs2.game.players.Client;
|
||||||
|
import com.rs2.game.players.Player;
|
||||||
|
import com.rs2.game.players.PlayerHandler;
|
||||||
|
import com.rs2.integrations.discord.JavaCord;
|
||||||
|
import org.javacord.api.event.message.MessageCreateEvent;
|
||||||
|
import org.javacord.api.listener.message.MessageCreateListener;
|
||||||
|
|
||||||
|
public class GameKick implements MessageCreateListener {
|
||||||
|
@Override
|
||||||
|
public void onMessageCreate(MessageCreateEvent event) {
|
||||||
|
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " gamekick")) {
|
||||||
|
if (event.getMessageAuthor().isServerAdmin()) {
|
||||||
|
String playerToKick = event.getMessageContent().replace( JavaCord.commandPrefix + " gamekick ", "");
|
||||||
|
for (Player player2 : PlayerHandler.players) {
|
||||||
|
if (player2 != null) {
|
||||||
|
if (player2.playerName.equalsIgnoreCase(playerToKick)) {
|
||||||
|
Client c2 = (Client) player2;
|
||||||
|
event.getChannel().sendMessage( playerToKick+ " was kicked by " + event.getMessageAuthor().getDisplayName() + ".");
|
||||||
|
c2.disconnected = true;
|
||||||
|
c2.logout(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.rs2.integrations.discord.commands.admin;
|
||||||
|
|
||||||
|
import com.rs2.GameConstants;
|
||||||
|
import com.rs2.game.players.Client;
|
||||||
|
import com.rs2.game.players.PlayerHandler;
|
||||||
|
import com.rs2.integrations.discord.JavaCord;
|
||||||
|
import org.javacord.api.event.message.MessageCreateEvent;
|
||||||
|
import org.javacord.api.listener.message.MessageCreateListener;
|
||||||
|
|
||||||
|
public class MoveHome implements MessageCreateListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMessageCreate(MessageCreateEvent event) {
|
||||||
|
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " movehome")) {
|
||||||
|
if (event.getMessageAuthor().isServerAdmin()) {
|
||||||
|
String teleToMe = event.getMessageContent().replace( JavaCord.commandPrefix + " movehome ", "");
|
||||||
|
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
||||||
|
if (PlayerHandler.players[i] != null) {
|
||||||
|
if (PlayerHandler.players[i].playerName.equalsIgnoreCase(teleToMe)) {
|
||||||
|
Client p = (Client) PlayerHandler.players[i];
|
||||||
|
event.getChannel().sendMessage(p.playerName + " has been moved to Lumbridge.");
|
||||||
|
p.getPlayerAssistant().movePlayer(GameConstants.RESPAWN_X, GameConstants.RESPAWN_Y, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.rs2.integrations.discord.commands.admin;
|
||||||
|
|
||||||
|
import com.rs2.game.players.PlayerHandler;
|
||||||
|
import com.rs2.integrations.discord.JavaCord;
|
||||||
|
import org.javacord.api.event.message.MessageCreateEvent;
|
||||||
|
import org.javacord.api.listener.message.MessageCreateListener;
|
||||||
|
|
||||||
|
public class Update implements MessageCreateListener {
|
||||||
|
@Override
|
||||||
|
public void onMessageCreate(MessageCreateEvent event) {
|
||||||
|
if(event.getMessageAuthor().isServerAdmin()) {
|
||||||
|
String seconds = event.getMessageContent().replace(JavaCord.commandPrefix + " update ", "");
|
||||||
|
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " update")) {
|
||||||
|
PlayerHandler.updateSeconds = Integer.parseInt(seconds);
|
||||||
|
PlayerHandler.updateAnnounced = false;
|
||||||
|
PlayerHandler.updateRunning = true;
|
||||||
|
PlayerHandler.updateStartTime = System.currentTimeMillis();
|
||||||
|
event.getChannel().sendMessage("Server update will begin in " + seconds + " seconds.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -116,7 +116,7 @@ public class PacketSender {
|
|||||||
if (player.tutorialProgress > 35) {
|
if (player.tutorialProgress > 35) {
|
||||||
player.getPlayerAssistant().sendSidebars();
|
player.getPlayerAssistant().sendSidebars();
|
||||||
Weight.updateWeight(player);
|
Weight.updateWeight(player);
|
||||||
player.getPacketSender().sendMessage("Welcome to @blu@" + GameConstants.SERVER_NAME + "@bla@ - we are currently in Server Stage v@blu@" + GameConstants.TEST_VERSION + "@bla@.");
|
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("@red@Did you know?@bla@ We're open source! Pull requests are welcome");
|
player.getPacketSender().sendMessage("@red@Did you know?@bla@ We're open source! Pull requests are welcome");
|
||||||
player.getPacketSender().sendMessage("Source code at github.com/2006-Scape/2006Scape");
|
player.getPacketSender().sendMessage("Source code at github.com/2006-Scape/2006Scape");
|
||||||
player.getPacketSender().sendMessage("Join our Discord: https://discord.gg/hZ6VfWG");
|
player.getPacketSender().sendMessage("Join our Discord: https://discord.gg/hZ6VfWG");
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ClickingButtons implements PacketType {
|
|||||||
SilverCrafting.makeSilver(player, actionButtonId, 0);
|
SilverCrafting.makeSilver(player, actionButtonId, 0);
|
||||||
Climbing.handleLadderButtons(player, actionButtonId);
|
Climbing.handleLadderButtons(player, actionButtonId);
|
||||||
Specials.specialClicking(player, actionButtonId);
|
Specials.specialClicking(player, actionButtonId);
|
||||||
DialogueOptions.handleDialogueOptions(player, actionButtonId);
|
//DialogueOptions.handleDialogueOptions(player, actionButtonId);
|
||||||
DairyChurn.churnItem(player, actionButtonId);
|
DairyChurn.churnItem(player, actionButtonId);
|
||||||
if (EnchantStaff.staffButtons(player, actionButtonId)) {
|
if (EnchantStaff.staffButtons(player, actionButtonId)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import com.rs2.Connection;
|
|||||||
import com.rs2.GameConstants;
|
import com.rs2.GameConstants;
|
||||||
import com.rs2.GameEngine;
|
import com.rs2.GameEngine;
|
||||||
import com.rs2.game.bots.BotHandler;
|
import com.rs2.game.bots.BotHandler;
|
||||||
import com.rs2.game.content.combat.magic.SpellTeleport;
|
|
||||||
import com.rs2.game.npcs.NpcHandler;
|
import com.rs2.game.npcs.NpcHandler;
|
||||||
import com.rs2.game.players.*;
|
import com.rs2.game.players.*;
|
||||||
import com.rs2.game.players.antimacro.AntiSpam;
|
import com.rs2.game.players.antimacro.AntiSpam;
|
||||||
@@ -45,6 +44,34 @@ 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 "myxprate":
|
||||||
|
case "checkxprate":
|
||||||
|
if(GameConstants.VARIABLE_XP_RATE) {
|
||||||
|
player.getPacketSender().sendMessage("Your current XP rate is x" + player.getXPRate());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "xprate":
|
||||||
|
if(GameConstants.VARIABLE_XP_RATE) {
|
||||||
|
if (player.getXPRate() == GameConstants.VARIABLE_XP_RATES[0]) {
|
||||||
|
player.getDialogueHandler().sendDialogues(10005, 2244);
|
||||||
|
return;
|
||||||
|
} else if (player.getXPRate() == GameConstants.VARIABLE_XP_RATES[1]) {
|
||||||
|
player.getDialogueHandler().sendDialogues(10006, 2244);
|
||||||
|
return;
|
||||||
|
} else if (player.getXPRate() == GameConstants.VARIABLE_XP_RATES[2]) {
|
||||||
|
player.getDialogueHandler().sendDialogues(10007, 2244);
|
||||||
|
return;
|
||||||
|
} else if (player.getXPRate() == GameConstants.VARIABLE_XP_RATES[3]) {
|
||||||
|
player.getPacketSender().sendMessage("You already have the highest XP rate.");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
player.getDialogueHandler().sendDialogues(10001, 2244);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.getPacketSender().sendMessage("You can't use this command in this world.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "toggleyell":
|
case "toggleyell":
|
||||||
case "tglyell":
|
case "tglyell":
|
||||||
case "hideyell":
|
case "hideyell":
|
||||||
@@ -257,9 +284,6 @@ public class Commands implements PacketType {
|
|||||||
"::loc, ::pos, ::coord",
|
"::loc, ::pos, ::coord",
|
||||||
"Get your current world position",
|
"Get your current world position",
|
||||||
"",
|
"",
|
||||||
"::stuck",
|
|
||||||
"Return to Lumbridge when stuck",
|
|
||||||
"",
|
|
||||||
"::randomtoggle",
|
"::randomtoggle",
|
||||||
"Enable/Disable random events",
|
"Enable/Disable random events",
|
||||||
"",
|
"",
|
||||||
@@ -280,6 +304,8 @@ public class Commands implements PacketType {
|
|||||||
"",
|
"",
|
||||||
"::snow",
|
"::snow",
|
||||||
"Add some snow in your mainscreen(works only in december)",
|
"Add some snow in your mainscreen(works only in december)",
|
||||||
|
(GameConstants.VARIABLE_XP_RATE ? "\\n" + "::xprate\\n" + "Opens dialogue for the player to set/increase their XP rate." : ""),
|
||||||
|
(GameConstants.VARIABLE_XP_RATE ? "\\n" + "::checkxprate(::myxprate)\\n" + "Displays the players currently set XP rate." : ""),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Clear all lines
|
// Clear all lines
|
||||||
@@ -294,17 +320,6 @@ public class Commands implements PacketType {
|
|||||||
}
|
}
|
||||||
player.getPacketSender().showInterface(8134);
|
player.getPacketSender().showInterface(8134);
|
||||||
break;
|
break;
|
||||||
case "stuck":
|
|
||||||
if (player.getCombatAssistant().inCombat()) {
|
|
||||||
player.getPacketSender().sendMessage("You cannot do that while in combat.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.getPlayerAssistant().movePlayer(SpellTeleport.LUMBRIDGE.getDestX(), SpellTeleport.LUMBRIDGE.getDestY(), 0);
|
|
||||||
player.getPacketSender().sendMessage("How did you manage that one...");
|
|
||||||
player.getPacketSender().sendMessage("If it's bug related, please report on Github/Discord!");
|
|
||||||
player.gfx100(80);
|
|
||||||
player.startAnimation(404);
|
|
||||||
break;
|
|
||||||
case "randomtoggle":
|
case "randomtoggle":
|
||||||
case "togglerandom":
|
case "togglerandom":
|
||||||
case "random":
|
case "random":
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ public class DialoguePacket implements PacketType {
|
|||||||
to the new system. Expect to see flickering in some Astraeus Dialogues as the old
|
to the new system. Expect to see flickering in some Astraeus Dialogues as the old
|
||||||
dialogue handler activates before it.
|
dialogue handler activates before it.
|
||||||
*/
|
*/
|
||||||
if (player.nextChat > 0) {
|
/*if (player.nextChat > 0) {
|
||||||
player.getDialogueHandler().sendDialogues(player.nextChat, player.talkingNpc);
|
player.getDialogueHandler().sendDialogues(player.nextChat, player.talkingNpc);
|
||||||
} else {
|
} else {
|
||||||
player.getDialogueHandler().sendDialogues(0, -1);
|
player.getDialogueHandler().sendDialogues(0, -1);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// New Dialogue System
|
// New Dialogue System
|
||||||
player.getDialogueFactory().execute();
|
player.getDialogueFactory().execute();
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ public final class Constants {
|
|||||||
/**
|
/**
|
||||||
* The directory of the file system.
|
* The directory of the file system.
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SYSTEM_DIR = "./cache/";
|
public static final String FILE_SYSTEM_DIR = "./data/cache/";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default private constructor to prevent instantiation.
|
* Default private constructor to prevent instantiation.
|
||||||
+5
-4
@@ -69,14 +69,15 @@ public final class FileServer {
|
|||||||
* @throws Exception if an error occurs.
|
* @throws Exception if an error occurs.
|
||||||
*/
|
*/
|
||||||
public void start() throws Exception {
|
public void start() throws Exception {
|
||||||
if (!new File("cache").exists())
|
if (!new File(Constants.FILE_SYSTEM_DIR).exists())
|
||||||
{
|
{
|
||||||
|
System.out.println("Working Directory = " + System.getProperty("user.dir"));
|
||||||
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 /cache folder. You are LIKELY running this in the wrong directory!");
|
System.out.println("WARNING: I could not find the data/cache folder. You are LIKELY running this in the wrong directory!");
|
||||||
System.out.println("In IntelliJ, fix it by clicking \"FileServer\" > Edit Configurations at the top of your screen");
|
System.out.println("In IntelliJ, fix it by clicking \"GameEngine\" > Edit Configurations at the top of your screen");
|
||||||
System.out.println("Then changing the \"Working Directory\" to be in \"2006Scape/2006Scape file_server\", instead of just \"2006Scape\"");
|
System.out.println("Then changing the \"Working Directory\" to be in \"2006Scape/2006Scape Server\", instead of just \"2006Scape\"");
|
||||||
System.out.println("************************************");
|
System.out.println("************************************");
|
||||||
System.out.println("************************************");
|
System.out.println("************************************");
|
||||||
System.out.println("************************************");
|
System.out.println("************************************");
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/bin/
|
|
||||||
*.iml
|
|
||||||
/target/
|
|
||||||
file_server-1.0-jar-with-dependencies.jar
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,118 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<parent>
|
|
||||||
<artifactId>2006Scape</artifactId>
|
|
||||||
<groupId>com.rs2</groupId>
|
|
||||||
<version>1.0</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>file_server</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>libs-local</id>
|
|
||||||
<name>libs</name>
|
|
||||||
<url>file://${project.basedir}/libs</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.1</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.apache.mina/mina-core -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.mina</groupId>
|
|
||||||
<artifactId>mina-core</artifactId>
|
|
||||||
<version>1.1.7</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<version>8.0.16</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/io.netty/netty -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.netty</groupId>
|
|
||||||
<artifactId>netty</artifactId>
|
|
||||||
<version>3.6.6.Final</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
<version>1.5.8</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-nop</artifactId>
|
|
||||||
<version>1.5.8</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
|
||||||
<artifactId>xstream</artifactId>
|
|
||||||
<version>1.4.17</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javac</groupId>
|
|
||||||
<artifactId>javac</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/libs/javac++.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.xmlpull.v1</groupId>
|
|
||||||
<artifactId>xpp3</artifactId>
|
|
||||||
<version>1.1.4c</version>
|
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/libs/xpp3-1.1.4c.jar</systemPath>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<source>8</source>
|
|
||||||
<target>8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<archive>
|
|
||||||
<manifest>
|
|
||||||
<mainClass>org.apollo.jagcached.FileServer</mainClass>
|
|
||||||
</manifest>
|
|
||||||
</archive>
|
|
||||||
<descriptorRefs>
|
|
||||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
|
||||||
</descriptorRefs>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-assembly</id> <!-- this is used for inheritance merges -->
|
|
||||||
<phase>package</phase> <!-- bind to the packaging phase -->
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
echo This is meant to be run by the live server admin! You probably don\'t want to do this!
|
|
||||||
for i in {0..50}
|
|
||||||
do
|
|
||||||
cp target/file_server-1.0-jar-with-dependencies.jar ./fserver.jar
|
|
||||||
java -jar fserver.jar
|
|
||||||
done
|
|
||||||
@@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
## How to Play
|
## How to Play
|
||||||
|
|
||||||
### Client (non-bottable download): https://github.com/2006-Scape/2006Scape/releases/
|
### Client/Launcher Download: https://2006Scape.org/
|
||||||
### Parabot client (recommended): https://www.parabot.org/community/
|
|
||||||
### Rune-Server project thread: [Project thread](https://www.rune-server.ee/runescape-development/rs2-server/projects/686444-2006rebotted-remake-server-will-allow-supply-creatable-bots.html)
|
### Rune-Server project thread: [Project thread](https://www.rune-server.ee/runescape-development/rs2-server/projects/686444-2006rebotted-remake-server-will-allow-supply-creatable-bots.html)
|
||||||
|
|
||||||
# Installation + Running (Developers)
|
# Installation + Running (Developers)
|
||||||
@@ -14,17 +13,16 @@
|
|||||||
|
|
||||||
2. Hit File > Project Settings > Set SDK to Java 8 (Download [Java 8 SDK](https://adoptopenjdk.net/?variant=openjdk8) if you don't have one already)
|
2. Hit File > Project Settings > Set SDK to Java 8 (Download [Java 8 SDK](https://adoptopenjdk.net/?variant=openjdk8) if you don't have one already)
|
||||||
|
|
||||||
2. Navigate to `2006Scape file_server` > `src` > `main` > `java` > `org.apollo.jagcached`, right click FileServer and hit Run [Image](https://i.imgur.com/tsg9q1Z.png)
|
|
||||||
|
|
||||||
3. Navigate to `2006Scape Server` > `src` > `main` > `java` > `com.rs2`, right click GameEngine and hit Run [Image](https://i.imgur.com/HHooeVu.png)
|
3. Navigate to `2006Scape Server` > `src` > `main` > `java` > `com.rs2`, right click GameEngine and hit Run [Image](https://i.imgur.com/HHooeVu.png)
|
||||||
|
|
||||||
4. Navigate to `2006Scape Client` > `src` > `main` > `java`, right click Client and hit Run [Image](https://i.imgur.com/gSmqGLn.png)
|
[(You Can Also Run The Server With The -c/-config Argument)](https://wiki.2006scape.org/books/getting-setup/page/server-arguments)
|
||||||
|
5. Navigate to `2006Scape Client` > `src` > `main` > `java`, right click Client and hit Run [Image](https://i.imgur.com/gSmqGLn.png)
|
||||||
|
|
||||||
*Advanced*
|
*Advanced*
|
||||||
|
|
||||||
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:
|
## Using Parabot with your local server: (OUTDATED)
|
||||||
- **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 `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))
|
||||||
- **2:** Download the latest `Provider-version.jar` file from [here](http://v3.bdn.parabot.org/api/bot/download/default-provider?nightly=false)
|
- **2:** Download the latest `Provider-version.jar` file from [here](http://v3.bdn.parabot.org/api/bot/download/default-provider?nightly=false)
|
||||||
- **3:** Create a file called `localhost.json` in `{user}\Documents\Parabot\servers`
|
- **3:** Create a file called `localhost.json` in `{user}\Documents\Parabot\servers`
|
||||||
@@ -55,7 +53,6 @@ java -jar Client-2.8.1.jar -login username password -loadlocal -v -clearcache
|
|||||||
- `2006Scape Server` contains all the server code; mark `src` as the Sources directory
|
- `2006Scape Server` contains all the server code; mark `src` as the Sources directory
|
||||||
- `2006Scape Client` contains all the client code; likewise mark `src`
|
- `2006Scape Client` contains all the client code; likewise mark `src`
|
||||||
- If more than 2 arguments are passed in (can be anything), the client runs locally
|
- If more than 2 arguments are passed in (can be anything), the client runs locally
|
||||||
- `2006Scape file_server` contains the file server code that is *required* to be running before a client can connect to a server. It must be running locally before a client can connect. `src` is the Sources directory
|
|
||||||
|
|
||||||
## Building from command line
|
## Building from command line
|
||||||
|
|
||||||
|
|||||||
+3
-15
@@ -10,26 +10,14 @@ services:
|
|||||||
working_dir: /usr/src/2006scape
|
working_dir: /usr/src/2006scape
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
||||||
rsps-2006scape-file-server:
|
|
||||||
image: openjdk:8-alpine
|
|
||||||
container_name: rsps-2006scape-file-server
|
|
||||||
command: ["java", "-jar", "target/file_server-1.0-jar-with-dependencies.jar"]
|
|
||||||
volumes:
|
|
||||||
- ./2006Scape file_server:/usr/src/fileserver
|
|
||||||
working_dir: /usr/src/fileserver
|
|
||||||
ports:
|
|
||||||
- 8080:8080 # web panel
|
|
||||||
- 43595-43596:43595-43596 # File Server
|
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
rsps-2006scape-server:
|
rsps-2006scape-server:
|
||||||
image: openjdk:8-alpine
|
image: openjdk:8-alpine
|
||||||
container_name: rsps-2006scape-server
|
container_name: rsps-2006scape-server
|
||||||
command: ["java", "-jar", "target/server-1.0-jar-with-dependencies.jar"]
|
command: ["java", "-jar", "target/server-1.0-jar-with-dependencies.jar", "-c", "ServerConfig.json"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./2006Scape Server:/usr/src/server
|
- ./2006Scape Server:/usr/src/server
|
||||||
working_dir: /usr/src/server
|
working_dir: /usr/src/server
|
||||||
ports:
|
ports: # You will need to open other ports if your world ID is not 1 (43598 for world 2)
|
||||||
- 43594:43594 # Server
|
- 43594:43594 # Server
|
||||||
- 43594:43594/udp # Server
|
- 43595-43596:43595-43596 # File Server
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Reference in New Issue
Block a user