Merge remote-tracking branch 'upstream/master'

This commit is contained in:
skelsoft
2021-07-28 09:15:20 +10:00
222 changed files with 3454 additions and 2975 deletions
@@ -13,8 +13,10 @@ import ms.world.WorldDatabase;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
/**
@@ -138,7 +140,7 @@ public final class Management {
Runtime.getRuntime().addShutdownHook(new ShutdownSequence());
System.out.println("Status: ready.");
System.out.println("Use -commands for a list of commands!");
Scanner s = new Scanner(System.in);
Scanner s = new Scanner(new InputStreamReader(System.in, StandardCharsets.UTF_8));
while (s.hasNext()) {
try {
String command = s.nextLine();
@@ -30,7 +30,7 @@ public class ClassLoadServer extends Thread {
/**
* Holds classes and resources already added in the server
*/
protected static HashMap<String, byte[]> resourceCache = new HashMap<String, byte[]>();
protected final static HashMap<String, byte[]> resourceCache = new HashMap<String, byte[]>();
/**
* New socket
@@ -60,7 +60,9 @@ public class ClassLoadServer extends Thread {
//System.out.println("New Connection from : " + clientSocket.getInetAddress());
WorkerThread wcs = new WorkerThread(clientSocket);
wcs.start();
} catch (Exception e) {}
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -55,7 +55,7 @@ public class IoSession {
/**
* The writing lock.
*/
private Lock writingLock = new ReentrantLock();
private final Lock writingLock = new ReentrantLock();
/**
* The name hash.
@@ -137,15 +137,15 @@ public class IoSession {
*/
public void queue(ByteBuffer buffer) {
try {
writingLock.tryLock(1000L, TimeUnit.MILLISECONDS);
if(writingLock.tryLock(1000L, TimeUnit.MILLISECONDS)){
writingQueue.add(buffer);
writingLock.unlock();
write();
}
} catch (Exception e){
System.out.println(e);
e.printStackTrace();
writingLock.unlock();
return;
}
writingQueue.add(buffer);
writingLock.unlock();
write();
}
/**
@@ -168,10 +168,11 @@ public class IoSession {
}
writingQueue.remove(0);
}
writingLock.unlock();
} catch (IOException e) {
disconnect();
writingLock.unlock();
}
writingLock.unlock();
}
/**
@@ -1,6 +1,7 @@
package ms.net.packet;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import ms.system.util.ByteBufferUtils;
@@ -301,7 +302,7 @@ public class IoBuffer {
* @return
*/
public IoBuffer putString(String val) {
buf.put(val.getBytes());
buf.put(val.getBytes(StandardCharsets.UTF_8));
buf.put((byte) 0);
return this;
}
@@ -313,7 +314,7 @@ public class IoBuffer {
*/
public IoBuffer putJagString(String val) {
buf.put((byte) 0);
buf.put(val.getBytes());
buf.put(val.getBytes(StandardCharsets.UTF_8));
buf.put((byte) 0);
return this;
}
@@ -557,18 +558,6 @@ public class IoBuffer {
return buf.getLong();
}
/**
*
* @return
*/
public int getSmart() {
int peek = buf.get(buf.position());
if (peek <= Byte.MAX_VALUE) {
return buf.get() & 0xFF;
}
return (buf.getShort() & 0xFFFF) - 32768;
}
/**
*
* @return
@@ -42,7 +42,7 @@ object WorldPacketRepository {
* @param message The message to send.
*/
@JvmStatic
fun sendPlayerMessage(player: PlayerSession?, message: String?) {
fun sendPlayerMessage(player: PlayerSession?, message: String) {
if (player == null) {
return
}
@@ -52,7 +52,7 @@ object WorldPacketRepository {
player.world.session.write(buffer)
}
fun sendPlayerMessage(player: PlayerSession?, messages: Array<String?>) {
fun sendPlayerMessage(player: PlayerSession?, messages: Array<String>) {
if (player == null) {
return
}
@@ -98,7 +98,7 @@ object WorldPacketRepository {
@JvmStatic
fun sendContactUpdate(
player: PlayerSession,
contact: String?,
contact: String,
block: Boolean,
remove: Boolean,
worldId: Int,
@@ -127,7 +127,7 @@ object WorldPacketRepository {
* @param type The message type.
*/
@JvmStatic
fun sendMessage(player: PlayerSession, p: PlayerSession, type: Int, message: String?) {
fun sendMessage(player: PlayerSession, p: PlayerSession, type: Int, message: String) {
val buffer = IoBuffer(5, PacketHeader.BYTE)
buffer.putString(player.username)
buffer.putString(p.username)
@@ -184,7 +184,7 @@ object WorldPacketRepository {
* @param names The names.
*/
@JvmStatic
fun notifyPlayers(server: GameServer, player: PlayerSession, names: List<String?>) {
fun notifyPlayers(server: GameServer, player: PlayerSession, names: List<String>) {
val buffer = IoBuffer(8, PacketHeader.SHORT)
buffer.putString(player.username)
buffer.put(player.worldId)
@@ -227,7 +227,7 @@ object WorldPacketRepository {
* @param duration The duration of the punishment.
*/
@JvmStatic
fun sendPunishUpdate(world: GameServer, key: String?, type: Int, duration: Long) {
fun sendPunishUpdate(world: GameServer, key: String, type: Int, duration: Long) {
val buffer = IoBuffer(11, PacketHeader.BYTE)
buffer.putString(key)
buffer.put(type)
@@ -79,8 +79,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return;
case 2:
ban(player.getIpAddress(), type);
@@ -152,8 +153,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@@ -175,8 +177,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@@ -239,8 +242,9 @@ public final class PunishmentStorage {
e.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
SQLManager.close(connection);
return true;
}
@@ -252,9 +256,9 @@ public final class PunishmentStorage {
private static String getDuration(long end) {
String time = "indefinite time";
if (end != Long.MAX_VALUE) {
int days = (int) ((end -= System.currentTimeMillis()) / (24 * 60 * 60_000));
int hours = (int) ((end -= (days * 24 * 60 * 60_000)) / (60 * 60_000));
int minutes = (int) ((end -= (hours * (60 * 60_000))) / 60_000);
int days = (int) ((System.currentTimeMillis()) / (24 * 60 * 60_000));
int hours = (int) (((24L * days * 60 * 60_000)) / (60 * 60_000));
int minutes = (int) (((hours * (60 * 60_000))) / 60_000);
time = days + "d, " + hours + "h, " + minutes + "m";
}
return time;
@@ -141,14 +141,20 @@ public final class CommunicationInfo {
public void save(PreparedStatement statement) throws SQLException {
String contacts = "";
String blocked = "";
StringBuilder blockedBuilder = new StringBuilder();
for (int i = 0; i < this.blocked.size(); i++) {
blocked += (i == 0 ? "" : ",") + this.blocked.get(i);
String blockline = (i == 0 ? "" : ",") + this.blocked.get(i);
blockedBuilder.append(blockline);
}
blocked = blockedBuilder.toString();
int count = 0;
StringBuilder contactBuilder = new StringBuilder();
for (Entry<String, ClanRank> entry : this.contacts.entrySet()) {
contacts += "{" + entry.getKey() + "," + entry.getValue().ordinal() + "}" + (count == this.contacts.size() - 1 ? "" : "~");
String contactLine = "{" + entry.getKey() + "," + entry.getValue().ordinal() + "}" + (count == this.contacts.size() - 1 ? "" : "~");
contactBuilder.append(contactLine);
count++;
}
contacts = contactBuilder.toString();
statement.setString(3, contacts);
statement.setString(4, blocked);
statement.setString(5, clanName);
@@ -211,6 +217,8 @@ public final class CommunicationInfo {
case 3:
lootRequirement = rank;
break;
default:
break;
}
}
}
@@ -239,9 +247,9 @@ public final class CommunicationInfo {
*/
public void save(ByteBuffer buffer) {
buffer.put((byte) contacts.size());
for (String name : contacts.keySet()) {
ByteBufferUtils.putString(name, buffer);
buffer.put((byte) contacts.get(name).ordinal());
for(Entry<String,ClanRank> contact : contacts.entrySet()){
ByteBufferUtils.putString(contact.getKey(), buffer);
buffer.put((byte) contact.getValue().ordinal());
}
buffer.put((byte) blocked.size());
for (String name : blocked) {
@@ -52,12 +52,4 @@ public final class SQLTable {
return updated;
}
/**
* Gets the columns.
* @return The columns.
*/
public SQLColumn[] getColumns() {
return columns;
}
}
@@ -31,12 +31,16 @@ public final class WorldListSQLHandler extends SQLEntryHandler<GameServer> {
* Clears the world list.
*/
public static void clearWorldList() {
Connection connection = SQLManager.getConnection();
if(connection == null) return;
try {
Connection connection = SQLManager.getConnection();
PreparedStatement statement = connection.prepareStatement("DELETE FROM " + TABLE);
statement.executeUpdate();
} catch (SQLException e) {
} catch (Exception e) {
e.printStackTrace();
SQLManager.close(connection);
} finally {
SQLManager.close(connection);
}
}
@@ -1,6 +1,7 @@
package ms.system.util;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
/**
@@ -30,7 +31,7 @@ public final class ByteBufferUtils {
* @param buffer The byte buffer.
*/
public static void putString(String s, ByteBuffer buffer) {
buffer.put(s.getBytes()).put((byte) 0);
buffer.put(s.getBytes(StandardCharsets.UTF_8)).put((byte) 0);
}
/**
@@ -484,7 +484,7 @@ public class EncryptionManager {
* @return the decoded value of x
*/
private static byte char64(char x) {
if ((int)x < 0 || (int)x > index_64.length)
if ((int)x > index_64.length)
return -1;
return index_64[(int)x];
}
@@ -14,26 +14,16 @@ public final class StringUtils {
/**
* The valid characters to be used in names/messages/...
*/
public static final char[] VALID_CHARS = {
private static final char[] VALID_CHARS = {
'_', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
};
/**
* Character mapping.
*/
public static char[] mapping = {
'\n',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ' ' };
/**
* The an int array241.
*/
public static int[] anIntArray241 = { 215, 203, 83, 158, 104, 101, 93, 84,
private final static int[] anIntArray241 = { 215, 203, 83, 158, 104, 101, 93, 84,
107, 103, 109, 95, 94, 98, 89, 86, 70, 41, 32, 27, 24, 23, -1, -2,
26, -3, -4, 31, 30, -5, -6, -7, 37, 38, 36, -8, -9, -10, 40, -11,
-12, 55, 48, 46, 47, -13, -14, -15, 52, 51, -16, -17, 54, -18, -19,
@@ -173,7 +163,7 @@ public final class StringUtils {
boolean wasSpace = true;
for (int i = 0; i < name.length(); i++) {
if (wasSpace) {
newName.append((new String() + name.charAt(i)).toUpperCase());
newName.append(("" + name.charAt(i)).toUpperCase());
wasSpace = false;
} else {
newName.append(name.charAt(i));
@@ -306,9 +296,8 @@ public final class StringUtils {
* @return The string value.
*/
public static String getString(String s) {
String string = s.replaceAll("\\<.*?>", "").replaceAll("&#160;", "")
return s.replaceAll("\\<.*?>", "").replaceAll("&#160;", "")
.replaceAll("Discontinued Item:", "");
return string;
}
/**
* Characters used to convert a String to a Long.
@@ -319,7 +308,7 @@ public final class StringUtils {
't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2',
'3', '4', '5', '6', '7', '8', '9'
};
public static int[] anIntArray233 = {
private final static int[] anIntArray233 = {
0, 1024, 2048, 3072, 4096, 5120,
6144, 8192, 9216, 12288, 10240, 11264, 16384, 18432, 17408, 20480,
21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696,
@@ -362,7 +351,7 @@ public final class StringUtils {
301188096, 301189120, 301190144, 301191168, 301193216, 301195264,
301194240, 301197312, 301198336, 301199360, 301201408, 301202432
};
public static byte[] aByteArray235 = {
private final static byte[] aByteArray235 = {
22, 22, 22, 22, 22, 22, 21, 22, 22,
20, 22, 22, 22, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
22, 22, 22, 22, 22, 22, 3, 8, 22, 16, 22, 16, 17, 7, 13, 13, 13,
@@ -387,16 +376,16 @@ public final class StringUtils {
try {
i_27_ += i_25_;
int i_29_ = 0;
int i_30_ = i_26_ << -2116795453;
int i_30_ = i_26_ << 3;
for (; i_27_ > i_25_; i_25_++) {
int i_31_ = 0xff & is_28_[i_25_];
int i_32_ = anIntArray233[i_31_];
int i_33_ = aByteArray235[i_31_];
int i_34_ = i_30_ >> -1445887805;
int i_34_ = i_30_ >> 3;
int i_35_ = i_30_ & 0x7;
i_29_ &= (-i_35_ >> 473515839);
i_29_ &= (-i_35_ >> 31);
i_30_ += i_33_;
int i_36_ = ((-1 + (i_35_ - -i_33_)) >> -1430991229) + i_34_;
int i_36_ = ((-1 + (i_35_ - -i_33_)) >> 3) + i_34_;
i_35_ += 24;
is[i_34_] = (byte) (i_29_ = (i_29_ | (i_32_ >>> i_35_)));
if ((i_36_ ^ 0xffffffff) < (i_34_ ^ 0xffffffff)) {
@@ -132,6 +132,8 @@ public final class PlayerSession {
ex.printStackTrace();
SQLManager.close(connection);
return false;
} finally {
SQLManager.close(connection);
}
return true;
}
@@ -160,6 +162,8 @@ public final class PlayerSession {
} catch (SQLException e) {
e.printStackTrace();
SQLManager.close(connection);
} finally {
SQLManager.close(connection);
}
communication.clear();
}
@@ -201,6 +205,8 @@ public final class PlayerSession {
} catch (SQLException e) {
e.printStackTrace();
SQLManager.close(connection);
} finally {
SQLManager.close(connection);
}
}
@@ -459,7 +465,9 @@ public final class PlayerSession {
@Override
public boolean equals(Object o) {
return username.equals(((PlayerSession) o).username);
if(o instanceof PlayerSession) {
return username.equals(((PlayerSession) o).username);
} else return false;
}
@Override
@@ -19,7 +19,7 @@ public class WorldDatabase {
/**
* The game servers.
*/
public static final GameServer[] DATABASE = new GameServer[ServerConstants.WORLD_LIMIT];
private static final GameServer[] DATABASE = new GameServer[ServerConstants.WORLD_LIMIT];
/**
* The update time stamp.
@@ -102,6 +102,8 @@ public class UIDInfo {
case 4:
serial = ByteBufferUtils.getString(buffer);
break;
default:
break;
}
}
}
@@ -112,7 +114,7 @@ public class UIDInfo {
* @return the string.
*/
private String parseFormat(String string) {
if (string == null || string == "") {
if (string == null || string.equals("")) {
return null;
}
StringTokenizer token = new StringTokenizer(string, "|");
+12 -10
View File
@@ -12,7 +12,7 @@ compileJava {
compileKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
freeCompilerArgs = ['-Xjsr305=strict', '-XXLanguage:-NewInference','-Xms2560m','-Xmx4096m', '-XX:MaxPermSize=350m','-XX:ReservedCodeCacheSize=225m','-XX:+UseCompressedOops']
freeCompilerArgs += '-XXLanguage:-NewInference'
}
}
@@ -21,16 +21,18 @@ repositories {
}
dependencies {
implementation("com.github.ajalt.mordant:mordant:2.0.0-alpha2")
implementation "org.jetbrains:markdown-jvm:0.2.4"
implementation 'com.google.guava:guava:29.0-jre'
implementation 'mysql:mysql-connector-java:8.0.21'
implementation 'io.github.classgraph:classgraph:4.8.98'
implementation 'org.jetbrains.kotlin:kotlin-reflect'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.5.20'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
implementation files("libs/ConstLib-1.2.jar")
implementation files("libs/PrimitiveExtensions-1.0.jar")
implementation files(
"libs/PrimitiveExtensions-1.0.jar",
"libs/ConstLib-1.2.jar",
"libs/json-simple-1.1.1.jar",
"libs/markdown-jvm-0.2.4.jar",
"libs/classgraph-4.8.98.jar",
"libs/mysql-connector-java-8.0.21.jar",
"libs/mordant-jvm-2.0.0-alpha2.jar",
"libs/colormath-jvm-2.0.0.jar"
)
}
/*sourceSets {
+122 -85
View File
@@ -7863,7 +7863,32 @@
"maxAmount": "1"
}
],
"charm": [],
"charm": [
{
"minAmount": "1",
"weight": "85.0",
"id": "12158",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "7.0",
"id": "12159",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "7.0",
"id": "12160",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "1.0",
"id": "12163",
"maxAmount": "1"
}
],
"ids": "117,4689,4690,4691,4692,4693",
"description": "",
"main": [
@@ -8552,7 +8577,7 @@
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "8.0",
"id": "1207",
"maxAmount": "1"
},
@@ -8576,13 +8601,13 @@
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "1241",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "1295",
"maxAmount": "1"
},
@@ -8606,13 +8631,13 @@
},
{
"minAmount": "2",
"weight": "25.0",
"weight": "8.0",
"id": "564",
"maxAmount": "2"
},
{
"minAmount": "3",
"weight": "25.0",
"weight": "8.0",
"id": "562",
"maxAmount": "3"
},
@@ -8624,7 +8649,7 @@
},
{
"minAmount": "2",
"weight": "25.0",
"weight": "8.0",
"id": "563",
"maxAmount": "2"
},
@@ -8632,7 +8657,7 @@
"minAmount": "4",
"weight": "50.0",
"id": "5318",
"maxAmount": "8"
"maxAmount": "4"
},
{
"minAmount": "4",
@@ -8648,25 +8673,25 @@
},
{
"minAmount": "3",
"weight": "50.0",
"weight": "25.0",
"id": "5320",
"maxAmount": "3"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "25.0",
"id": "5323",
"maxAmount": "2"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "8.0",
"id": "5294",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "8.0",
"id": "5293",
"maxAmount": "1"
},
@@ -8684,85 +8709,85 @@
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5306",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5311",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5104",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5105",
"maxAmount": "2"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5106",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5280",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5281",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5100",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5296",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "12176",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5292",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5297",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "5299",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "5301",
"maxAmount": "1"
},
@@ -8774,7 +8799,7 @@
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "5295",
"maxAmount": "1"
},
@@ -8804,37 +8829,37 @@
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "25.0",
"id": "205",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "211",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "209",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "207",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "213",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "215",
"maxAmount": "1"
},
@@ -8873,6 +8898,36 @@
"weight": "5.0",
"id": "31",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "5300",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "5304",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "8.0",
"id": "1987",
"maxAmount": "3"
},
{
"minAmount": "1",
"weight": "8.0",
"id": "1",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "50.0",
"id": "995",
"maxAmount": "62"
}
]
},
@@ -26189,16 +26244,10 @@
},
{
"minAmount": "1",
"weight": "25.0",
"weight": "8.0",
"id": "4131",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "1185",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "50.0",
@@ -26217,63 +26266,45 @@
"id": "1353",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "1303",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "1373",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "1319",
"maxAmount": "1"
},
{
"minAmount": "5",
"weight": "50.0",
"weight": "25.0",
"id": "560",
"maxAmount": "5"
},
{
"minAmount": "10",
"weight": "50.0",
"weight": "25.0",
"id": "560",
"maxAmount": "10"
},
{
"minAmount": "3",
"weight": "25.0",
"weight": "12.5",
"id": "562",
"maxAmount": "3"
},
{
"minAmount": "37",
"weight": "25.0",
"weight": "12.5",
"id": "562",
"maxAmount": "37"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "25.0",
"id": "5281",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "25.0",
"id": "5297",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "50.0",
"weight": "25.0",
"id": "5280",
"maxAmount": "1"
},
@@ -26309,27 +26340,21 @@
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "5303",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "8.0",
"id": "5302",
"maxAmount": "1"
},
{
"minAmount": "1144",
"minAmount": "10",
"weight": "50.0",
"id": "995",
"maxAmount": "1144"
},
{
"minAmount": "132",
"weight": "50.0",
"id": "995",
"maxAmount": "132"
"maxAmount": "460"
},
{
"minAmount": "1",
@@ -26351,19 +26376,13 @@
},
{
"minAmount": "1",
"weight": "5.0",
"id": "2363",
"weight": "8.0",
"id": "12070",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"id": "2723",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "5.0",
"weight": "16.0",
"id": "31",
"maxAmount": "1"
},
@@ -26372,6 +26391,24 @@
"weight": "100.0",
"id": "0",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "8.0",
"id": "5300",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "8.0",
"id": "5304",
"maxAmount": "1"
},
{
"minAmount": "1",
"weight": "25.0",
"id": "5295",
"maxAmount": "1"
}
]
},
@@ -37532,7 +37569,7 @@
{
"minAmount": "1",
"weight": "5.0",
"id": "13467",
"id": "5680",
"maxAmount": "1"
},
{
+7 -6
View File
@@ -45809,6 +45809,7 @@
"low_alchemy": "34000",
"turn90ccw_anim": "1208",
"attack_speed": "6",
"two_handed": "true",
"turn180_anim": "1206",
"defence_anim": "420",
"equipment_slot": "3",
@@ -45945,7 +45946,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"name": "Dharok's greataxe"
},
{
@@ -47597,7 +47598,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"attack_audios": "1320,0,0,0",
"name": "Dharok's axe 100"
},
@@ -47625,7 +47626,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"attack_audios": "1320,0,0,0",
"name": "Dharok's axe 75"
},
@@ -47653,7 +47654,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"attack_audios": "1320,0,0,0",
"name": "Dharok's axe 50"
},
@@ -47681,7 +47682,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"attack_audios": "1320,0,0,0",
"name": "Dharok's axe 25"
},
@@ -47708,7 +47709,7 @@
"high_alchemy": "124800",
"weight": "13",
"weapon_interface": "2",
"render_anim": "1426",
"render_anim": "134",
"attack_audios": "1320,0,0,0",
"name": "Dharok's axe 0"
},
+92 -16
View File
@@ -12136,7 +12136,7 @@
"id": "1158",
"aggressive": "true",
"bonuses": "0,0,0,0,0,50,50,10,100,100,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -12160,7 +12160,7 @@
"id": "1160",
"aggressive": "true",
"bonuses": "0,0,0,0,0,100,100,100,10,10,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -34989,7 +34989,7 @@
"strength_level": "1",
"id": "3835",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -35006,7 +35006,7 @@
"strength_level": "1",
"id": "3836",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -57802,6 +57802,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6610",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -57811,6 +57812,7 @@
"examine": "A ghost of a knight slain during the god wars.",
"melee_animation": "7441",
"range_animation": "7522",
"poisonous": "true",
"magic_level": "80",
"poisonous": "true",
"defence_animation": "7443",
@@ -57896,6 +57898,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6615",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -57948,6 +57951,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6618",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58065,6 +58069,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6624",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58097,6 +58102,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6626",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58153,6 +58159,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6629",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58228,6 +58235,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6633",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58527,6 +58535,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6648",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58621,6 +58630,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6653",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58837,6 +58847,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6664",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58953,6 +58964,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6670",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -58986,6 +58998,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6672",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -59346,6 +59359,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6690",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -59461,6 +59475,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6696",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -59573,6 +59588,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6702",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -59787,6 +59803,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6713",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -60023,6 +60040,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6725",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -60097,6 +60115,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6729",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -86429,7 +86448,7 @@
"id": "1158",
"aggressive": "true",
"bonuses": "0,0,0,0,0,50,50,10,100,100,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -86453,7 +86472,7 @@
"id": "1160",
"aggressive": "true",
"bonuses": "0,0,0,0,0,100,100,100,10,10,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -109282,7 +109301,7 @@
"strength_level": "1",
"id": "3835",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -109299,7 +109318,7 @@
"strength_level": "1",
"id": "3836",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -132343,6 +132362,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6610",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132352,6 +132372,7 @@
"examine": "A ghost of a knight slain during the god wars.",
"melee_animation": "7441",
"range_animation": "7522",
"poisonous": "true",
"magic_level": "80",
"poisonous": "true",
"defence_animation": "7443",
@@ -132437,6 +132458,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6615",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132489,6 +132511,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6618",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132606,6 +132629,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6624",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132638,6 +132662,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6626",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132694,6 +132719,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6629",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -132769,6 +132795,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6633",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133068,6 +133095,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6648",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133162,6 +133190,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6653",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133378,6 +133407,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6664",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133494,6 +133524,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6670",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133527,6 +133558,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6672",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -133887,6 +133919,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6690",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -134002,6 +134035,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6696",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -134114,6 +134148,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6702",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -134328,6 +134363,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6713",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -134564,6 +134600,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6725",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -134638,6 +134675,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6729",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -160978,7 +161016,7 @@
"id": "1158",
"aggressive": "true",
"bonuses": "0,0,0,0,0,50,50,10,100,100,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -161002,7 +161040,7 @@
"id": "1160",
"aggressive": "true",
"bonuses": "0,0,0,0,0,100,100,100,10,10,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -183831,7 +183869,7 @@
"strength_level": "1",
"id": "3835",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -183848,7 +183886,7 @@
"strength_level": "1",
"id": "3836",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -206644,6 +206682,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6610",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -206653,6 +206692,7 @@
"examine": "A ghost of a knight slain during the god wars.",
"melee_animation": "7441",
"range_animation": "7522",
"poisonous": "true",
"magic_level": "80",
"poisonous": "true",
"defence_animation": "7443",
@@ -206738,6 +206778,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6615",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -206790,6 +206831,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6618",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -206907,6 +206949,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6624",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -206939,6 +206982,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6626",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -206995,6 +207039,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6629",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207070,6 +207115,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6633",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207369,6 +207415,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6648",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207463,6 +207510,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6653",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207679,6 +207727,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6664",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207795,6 +207844,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6670",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -207828,6 +207878,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6672",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208188,6 +208239,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6690",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208303,6 +208355,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6696",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208415,6 +208468,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6702",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208629,6 +208683,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6713",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208865,6 +208920,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6725",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -208939,6 +208995,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6729",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -235271,7 +235328,7 @@
"id": "1158",
"aggressive": "true",
"bonuses": "0,0,0,0,0,50,50,10,100,100,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -235295,7 +235352,7 @@
"id": "1160",
"aggressive": "true",
"bonuses": "0,0,0,0,0,100,100,100,10,10,0,0,0,0,0",
"range_level": "1",
"range_level": "1000",
"attack_level": "300"
},
{
@@ -258124,7 +258181,7 @@
"strength_level": "1",
"id": "3835",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -258141,7 +258198,7 @@
"strength_level": "1",
"id": "3836",
"aggressive": "true",
"range_level": "1",
"range_level": "1000",
"attack_level": "1"
},
{
@@ -281185,6 +281242,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6610",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281194,6 +281252,7 @@
"examine": "A ghost of a knight slain during the god wars.",
"melee_animation": "7441",
"range_animation": "7522",
"poisonous": "true",
"magic_level": "80",
"poisonous": "true",
"defence_animation": "7443",
@@ -281279,6 +281338,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6615",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281331,6 +281391,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6618",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281448,6 +281509,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6624",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281480,6 +281542,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6626",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281536,6 +281599,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6629",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281611,6 +281675,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6633",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -281910,6 +281975,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6648",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282004,6 +282070,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6653",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282220,6 +282287,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6664",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282336,6 +282404,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6670",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282369,6 +282438,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6672",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282729,6 +282799,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6690",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282844,6 +282915,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6696",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -282956,6 +283028,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6702",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -283170,6 +283243,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6713",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -283406,6 +283480,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6725",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
@@ -283480,6 +283555,7 @@
"lifepoints": "105",
"strength_level": "70",
"id": "6729",
"magic_level": "70",
"clue_level": "2",
"range_level": "70",
"attack_level": "70"
+1 -1
View File
@@ -6281,7 +6281,7 @@
},
{
"npc_id": "4383",
"loc_data": "{2321,5225,0,0,3}-{2321,5223,0,0,4}-{2317,5229,0,0,7}-{2322,5225,0,0,1}-{2325,5231,0,0,6}-{2321,5225,0,0,1}-{2314,5227,0,0,2}-{2312,5229,0,0,2}-{2330,5229,0,0,1}-{2324,5233,0,0,4}-{2320,5232,0,0,3}-{2324,5237,0,0,1}-{2329,5229,0,0,6}-{2315,5227,0,0,7}-{2318,5226,0,0,6}-{2322,5222,0,0,6}"
"loc_data": "{2321,5225,0,1,3}-{2321,5223,0,1,4}-{2317,5229,0,1,7}-{2322,5225,0,1,1}-{2325,5231,0,1,6}-{2321,5225,0,1,1}-{2314,5227,0,1,2}-{2312,5229,0,1,2}-{2330,5229,0,1,1}-{2324,5233,0,1,4}-{2320,5232,0,1,3}-{2324,5237,0,1,1}-{2329,5229,0,1,6}-{2315,5227,0,1,7}-{2318,5226,0,1,6}-{2322,5222,0,1,6}"
},
{
"npc_id": "4384",
+1 -1
View File
@@ -666,7 +666,7 @@
"stock": "{5376,10}-{6032,300}-{5418,10}-{6036,10}-{5354,100}-{5341,10}-{5329,10}-{5343,10}-{952,10}-{5325,10}-{1925,100}-{5331,30}-{12622,10}-{5996,0}-{6006,0}-{1965,0}-{5994,0}-{5931,0}-{6000,0}-{1957,0}-{5504,0}-{5986,0}-{1982,0}-{5982,0}-{6002,0}-{5998,0}"
},
{
"npcs": "1783",
"npcs": "2306",
"high_alch": "0",
"currency": "995",
"general_store": "false",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,7 +15,7 @@ import core.cache.misc.buffer.ByteBufferUtils;
* The server data storage.
* @author Emperor
*/
public final class ServerStore {
public final class AriosStore {
/**
* The storage.
@@ -100,10 +100,6 @@ public class BZip2Decompressor {
i1++;
j1--;
} while (true);
if (j1 == 0) {
i = 1;
break;
}
abyte0[i1] = byte4;
i1++;
j1--;
+5 -2
View File
@@ -139,8 +139,11 @@ public class Definition<T extends Node> {
public String getExamine() {
if (examine == null) {
try {
examine = handlers.get("examine").toString();
} catch (Exception e){}
if(handlers.get("examine") != null)
examine = handlers.get("examine").toString();
} catch (Exception e){
e.printStackTrace();
}
if(examine == null) {
if (name.length() > 0) {
examine = "It's a" + (StringUtils.isPlusN(name) ? "n " : " ") + name + ".";
+3 -1
View File
@@ -3,6 +3,8 @@ package core.cache.def.impl;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
@@ -71,7 +73,7 @@ public final class CS2Mapping {
*/
public static void main(String... args) throws Throwable {
GameWorld.prompt(false);
BufferedWriter bw = new BufferedWriter(new FileWriter("./cs2.txt"));
BufferedWriter bw = Files.newBufferedWriter(Paths.get("./cs2.txt"));
for (int i = 0; i < 10000; i++) {
CS2Mapping mapping = forId(i);
if (mapping == null) {
@@ -48,7 +48,7 @@ public class GraphicDefinition {
if (def != null) {
return def;
}
byte[] data = Cache.getIndexes()[21].getFileData(gfxId >>> 735411752, gfxId & 0xff);
byte[] data = Cache.getIndexes()[21].getFileData(gfxId >>> 8, gfxId & 0xff);
def = new GraphicDefinition();
def.graphicsId = gfxId;
if (data != null) {
@@ -57,10 +57,8 @@ public final class NPCDefinition extends Definition<NPC> {
*/
public boolean isVisibleOnMap;
/**
* The examine option value
*/
public String examine;
/* public String examine;*/
/**
* The drop tables.
@@ -201,7 +199,7 @@ public final class NPCDefinition extends Definition<NPC> {
NPCDefinition def = DEFINITIONS.get(id);
if (def == null) {
def = new NPCDefinition(id);
byte[] data = Cache.getIndexes()[18].getFileData(id >>> 134238215, id & 0x7f);
byte[] data = Cache.getIndexes()[18].getFileData(id >>> 7, id & 0x7f);
if (data == null) {
if (id != -1) {
// System.out.println("Failed loading NPC " + id + ".");
@@ -625,6 +623,8 @@ public final class NPCDefinition extends Definition<NPC> {
case 4:
name = NPCConfigParser.DEATH_ANIMATION;
break;
default:
break;
}
return getConfiguration(name, null);
}
@@ -64,12 +64,11 @@ public class RenderAnimationDefinition {
* @return The render animation definitions.
*/
public static RenderAnimationDefinition forId(int animId) {
RenderAnimationDefinition defs = new RenderAnimationDefinition();
if (animId == -1) {
return null;
}
byte[] data = Cache.getIndexes()[2].getFileData(32, animId);
defs = new RenderAnimationDefinition();
RenderAnimationDefinition defs = new RenderAnimationDefinition();
if (data != null) {
defs.parse(ByteBuffer.wrap(data));
} else {
@@ -1670,6 +1670,6 @@ public class SceneryDefinition extends Definition<Scenery> {
* @return The container id.
*/
public static int getContainerId(int id) {
return id >>> 1998118472;
return id >>> 8;
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ public class GZipDecompressor {
private static final Inflater inflaterInstance = new Inflater(true);
public static final void decompress(ByteBuffer buffer, byte data[]) {
public static final void decompress(ByteBuffer buffer, byte[] data) {
synchronized (inflaterInstance) {
if (~buffer.get(buffer.position()) != -32 || buffer.get(buffer.position() + 1) != -117) {
data = null;
@@ -2,6 +2,7 @@ package core.cache.misc.buffer;
import java.io.ObjectInputStream;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
/**
* Holds utility methods for reading/writing a byte buffer.
@@ -29,7 +30,7 @@ public final class ByteBufferUtils {
* @param buffer The byte buffer.
*/
public static void putString(String s, ByteBuffer buffer) {
buffer.put(s.getBytes()).put((byte) 0);
buffer.put(s.getBytes(StandardCharsets.UTF_8)).put((byte) 0);
}
/**
@@ -521,7 +521,7 @@ public class Container {
int id = buffer.getShort() & 0xFFFF;
int amount = buffer.getInt();
int charge = buffer.getInt();
if (id >= ItemDefinition.getDefinitions().size() || id < 0 || slot >= items.length || slot < 0) {
if (id >= ItemDefinition.getDefinitions().size() || slot >= items.length || slot < 0) {
continue;
}
Item item = items[slot] = new Item(id, amount, charge);
@@ -2,7 +2,7 @@ package core.game.content.activity.bountyhunter;
import java.nio.ByteBuffer;
import core.cache.ServerStore;
import core.cache.AriosStore;
import core.cache.StoreFile;
import core.cache.misc.buffer.ByteBufferUtils;
import core.game.component.Component;
@@ -53,7 +53,7 @@ public final class BHScoreBoard {
* Initializes the score boards data.
*/
public static void init() {
StoreFile file = ServerStore.get("bh_scores");
StoreFile file = AriosStore.get("bh_scores");
if (file == null) { // Indicates no cache exists yet.
return;
}
@@ -82,7 +82,7 @@ public final class BHScoreBoard {
ByteBufferUtils.putString(ROGUES.names[i], buffer);
}
buffer.flip();
ServerStore.setArchive("bh_scores", buffer);
AriosStore.setArchive("bh_scores", buffer);
}
/**
@@ -69,12 +69,4 @@ public enum DuelRule {
public int getEquipmentSlot() {
return equipmentSlot;
}
/**
* Sets the equipmentSlot.
* @param equipmentSlot the equipmentSlot to set
*/
public void setEquipmentSlot(int equipmentSlot) {
this.equipmentSlot = equipmentSlot;
}
}
@@ -1164,7 +1164,7 @@ public final class RangingGuildPlugin extends OptionHandler {
cumulativeStr += 1;
}*/
cumulativeStr *= 1.0;
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865)) * 1.0) / 10 + 1;
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865))) / 10 + 1;
hit = hit + RandomFunction.randomSign(RandomFunction.random(3));
int target = Math.max(0, 13 - hit);
@@ -6,6 +6,7 @@ import java.util.List;
import core.game.node.entity.Entity;
import core.game.node.entity.combat.BattleState;
import core.game.node.entity.combat.CombatStyle;
import org.jetbrains.annotations.NotNull;
import rs09.game.node.entity.combat.CombatSwingHandler;
import core.game.node.entity.combat.InteractionType;
import core.game.node.entity.combat.equipment.ArmourSet;
@@ -76,7 +77,7 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
}
BattleState[] targets;
state.setStyle(CombatStyle.RANGE);
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
state.setTargets(targets = list.toArray(new BattleState[0]));
for (BattleState s : targets) {
s.setStyle(CombatStyle.RANGE);
int hit = 0;
@@ -93,41 +94,46 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
switch (state.getStyle()) {
case MELEE:
entity.animate(MELEE_ATTACK);
break;
default:
entity.animate(RANGE_ATTACK);
for (BattleState s : state.getTargets()) {
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
if(state != null) {
if (state.getStyle() == CombatStyle.MELEE) {
entity.animate(MELEE_ATTACK);
} else {
entity.animate(RANGE_ATTACK);
for (BattleState s : state.getTargets()) {
Projectile.ranged(entity, s.getVictim(), 1200, 0, 0, 46, 1).send();
}
}
break;
}
}
@Override
public ArmourSet getArmourSet(Entity e) {
return getType().getSwingHandler().getArmourSet(e);
if(getType() != null)
return getType().getSwingHandler().getArmourSet(e);
else return ArmourSet.AHRIM;
}
@Override
public double getSetMultiplier(Entity e, int skillId) {
return getType().getSwingHandler().getSetMultiplier(e, skillId);
if(getType() != null)
return getType().getSwingHandler().getSetMultiplier(e, skillId);
else return 0.0;
}
@Override
public void impact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == CombatStyle.MELEE) {
if (state != null && state.getStyle() != null && state.getStyle() == CombatStyle.MELEE) {
state.getStyle().getSwingHandler().impact(entity, victim, state);
return;
}
for (BattleState s : state.getTargets()) {
if (s == null || s.getEstimatedHit() < 0) {
continue;
if(state != null && state.getTargets() != null) {
for (BattleState s : state.getTargets()) {
if (s == null || s.getEstimatedHit() < 0) {
continue;
}
int hit = s.getEstimatedHit();
s.getVictim().getImpactHandler().handleImpact(entity, hit, CombatStyle.RANGE, s);
}
int hit = s.getEstimatedHit();
s.getVictim().getImpactHandler().handleImpact(entity, hit, CombatStyle.RANGE, s);
}
}
@@ -155,17 +161,23 @@ public final class GWDGraardorSwingHandler extends CombatSwingHandler {
@Override
public int calculateAccuracy(Entity entity) {
return getType().getSwingHandler().calculateAccuracy(entity);
if(getType() != null)
return getType().getSwingHandler().calculateAccuracy(entity);
else return -1;
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return getType().getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
if(getType() != null)
return getType().getSwingHandler().calculateDefence(victim, attacker);
else return -1;
}
@Override
public int calculateHit(Entity entity, Entity victim, double modifier) {
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
if(getType() != null)
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
else return -1;
}
}
@@ -61,11 +61,11 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
@Override
public int swing(Entity entity, Entity victim, BattleState state) {
int ticks = 1;
int distance = entity.size() >> 1;
if (!entity.inCombat()) {
int distance = entity != null ? entity.size() >> 1 : 0;
if (entity != null && !entity.inCombat()) {
distance++;
}
if (victim.getLocation().withinDistance(entity.getCenterLocation(), distance) && RandomFunction.RANDOM.nextBoolean()) {
if (entity != null && victim.getLocation().withinDistance(entity.getCenterLocation(), distance) && RandomFunction.RANDOM.nextBoolean()) {
int hit = 0;
int max = CombatStyle.MELEE.getSwingHandler().calculateHit(entity, victim, 1.0);
if (CombatStyle.MELEE.getSwingHandler().isAccurateImpact(entity, victim, CombatStyle.MELEE)) {
@@ -80,7 +80,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
state.setMaximumHit(max);
state.setStyle(CombatStyle.MELEE);
} else {
ticks += (int) Math.ceil(entity.getLocation().getDistance(victim.getLocation()) * 0.3);
ticks += (int) Math.ceil(entity != null ? entity.getLocation().getDistance(victim.getLocation()) : 0.0 * 0.3);
NPC npc = (NPC) entity;
List<BattleState> list = new ArrayList<>(20);
for (Entity t : RegionManager.getLocalPlayers(npc, 28)) {
@@ -93,7 +93,7 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
}
BattleState[] targets;
state.setStyle(CombatStyle.RANGE);
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
state.setTargets(targets = list.toArray(new BattleState[0]));
for (BattleState s : targets) {
CombatStyle style = RandomFunction.randomize(10) < 3 ? CombatStyle.MAGIC : CombatStyle.RANGE;
s.setStyle(style);
@@ -114,62 +114,69 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
switch (state.getStyle()) {
case MELEE:
entity.animate(MELEE_ATTACK);
break;
default:
entity.animate(RANGE_ATTACK);
for (BattleState s : state.getTargets()) {
int gfxId = 1197;
if (s.getStyle() == CombatStyle.MAGIC) {
gfxId = 1198;
if(state != null) {
if (state.getStyle() == CombatStyle.MELEE) {
entity.animate(MELEE_ATTACK);
} else {
entity.animate(RANGE_ATTACK);
for (BattleState s : state.getTargets()) {
int gfxId = 1197;
if (s.getStyle() == CombatStyle.MAGIC) {
gfxId = 1198;
}
Projectile.ranged(entity, s.getVictim(), gfxId, 92, 36, 46, 5).send();
}
Projectile.ranged(entity, s.getVictim(), gfxId, 92, 36, 46, 5).send();
}
break;
}
}
@Override
public ArmourSet getArmourSet(Entity e) {
return getType().getSwingHandler().getArmourSet(e);
if(getType() != null)
return getType().getSwingHandler().getArmourSet(e);
else return ArmourSet.AHRIM;
}
@Override
public double getSetMultiplier(Entity e, int skillId) {
return getType().getSwingHandler().getSetMultiplier(e, skillId);
if(getType() != null)
return getType().getSwingHandler().getSetMultiplier(e, skillId);
else return 0.0;
}
@Override
public void impact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == CombatStyle.MELEE) {
if (state != null && state.getStyle() == CombatStyle.MELEE) {
state.getStyle().getSwingHandler().impact(entity, victim, state);
return;
}
for (BattleState s : state.getTargets()) {
if (s == null || s.getEstimatedHit() < 0) {
continue;
if(state != null) {
for (BattleState s : state.getTargets()) {
if (s == null || s.getEstimatedHit() < 0) {
continue;
}
int hit = s.getEstimatedHit();
s.getVictim().getImpactHandler().handleImpact(entity, hit, s.getStyle(), s);
}
int hit = s.getEstimatedHit();
s.getVictim().getImpactHandler().handleImpact(entity, hit, s.getStyle(), s);
}
}
@Override
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == CombatStyle.MELEE) {
if (state != null && state.getStyle() == CombatStyle.MELEE) {
victim.animate(victim.getProperties().getDefenceAnimation());
return;
}
for (BattleState s : state.getTargets()) {
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
if (RandomFunction.randomize(10) < 8) {
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
if (CHAMBER.insideBorder(destination)) {
s.getVictim().getProperties().setTeleportLocation(destination);
s.getVictim().graphics(END_GRAPHIC);
if(state != null) {
for (BattleState s : state.getTargets()) {
s.getVictim().animate(s.getVictim().getProperties().getDefenceAnimation());
if (RandomFunction.randomize(10) < 8) {
Direction dir = Direction.getLogicalDirection(entity.getLocation(), s.getVictim().getLocation());
Location destination = s.getVictim().getLocation().transform(dir.getStepX(), dir.getStepY(), 0);
if (CHAMBER.insideBorder(destination)) {
s.getVictim().getProperties().setTeleportLocation(destination);
s.getVictim().graphics(END_GRAPHIC);
}
}
}
}
@@ -188,17 +195,23 @@ public final class GWDKreeArraSwingHandler extends CombatSwingHandler {
@Override
public int calculateAccuracy(Entity entity) {
return getType().getSwingHandler().calculateAccuracy(entity);
if(getType() != null)
return getType().getSwingHandler().calculateAccuracy(entity);
else return -1;
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return getType().getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
if(getType() != null)
return getType().getSwingHandler().calculateDefence(victim, attacker);
else return -1;
}
@Override
public int calculateHit(Entity entity, Entity victim, double modifier) {
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
if(getType() != null)
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
else return -1;
}
}
@@ -75,7 +75,7 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
victim.getStateManager().register(EntityState.POISONED, false, 168, entity);
}
if (special) {
((Player) victim).getSkills().decrementPrayerPoints(hit / 2);
((Player) victim).getSkills().decrementPrayerPoints((double) hit / 2);
}
}
state.setEstimatedHit(hit);
@@ -85,14 +85,14 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
switch (state.getStyle()) {
case MELEE:
if(entity == null || state == null || state.getStyle() == null){
return;
}
if (state.getStyle() == CombatStyle.MELEE) {
entity.animate(MELEE_ATTACK);
break;
default:
} else {
entity.visualize(MAGIC_ATTACK, MAGIC_START);
Projectile.magic(entity, victim, 1211, 0, 0, 46, 1).send();
break;
}
}
@@ -143,8 +143,8 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return getType().getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
return getType().getSwingHandler().calculateDefence(victim, attacker);
}
@Override
@@ -64,7 +64,7 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
list.add(new BattleState(entity, t));
}
}
state.setTargets(targets = list.toArray(new BattleState[list.size()]));
state.setTargets(targets = list.toArray(new BattleState[0]));
state.setStyle(CombatStyle.MAGIC);
setType(CombatStyle.MAGIC);
}
@@ -83,31 +83,38 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
switch (getType()) {
case MELEE:
entity.animate(MELEE_ATTACK);
break;
case MAGIC:
entity.animate(MAGIC_ATTACK);
break;
default:
break;
if(getType() != null) {
switch (getType()) {
case MELEE:
entity.animate(MELEE_ATTACK);
break;
case MAGIC:
entity.animate(MAGIC_ATTACK);
break;
default:
break;
}
}
}
@Override
public ArmourSet getArmourSet(Entity e) {
return getType().getSwingHandler().getArmourSet(e);
if(getType() != null)
return getType().getSwingHandler().getArmourSet(e);
else return ArmourSet.AHRIM;
}
@Override
public double getSetMultiplier(Entity e, int skillId) {
return getType().getSwingHandler().getSetMultiplier(e, skillId);
if(getType() != null)
return getType().getSwingHandler().getSetMultiplier(e, skillId);
else return -1;
}
@Override
public void impact(Entity entity, Entity victim, BattleState state) {
state.getStyle().getSwingHandler().impact(entity, victim, state);
if(state != null)
state.getStyle().getSwingHandler().impact(entity, victim, state);
}
@Override
@@ -117,22 +124,28 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
@Override
public int calculateAccuracy(Entity entity) {
return getType().getSwingHandler().calculateAccuracy(entity);
if(getType() != null)
return getType().getSwingHandler().calculateAccuracy(entity);
else return -1;
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return getType().getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
if(getType() != null)
return getType().getSwingHandler().calculateDefence(victim, attacker);
else return -1;
}
@Override
public int calculateHit(Entity entity, Entity victim, double modifier) {
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
if(getType() != null)
return getType().getSwingHandler().calculateHit(entity, victim, modifier);
else return -1;
}
@Override
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == CombatStyle.MAGIC) {
if (state != null && state.getStyle() == CombatStyle.MAGIC) {
for (BattleState s : state.getTargets()) {
if (s.getEstimatedHit() > 0) {
s.getVictim().graphics(MAGIC_END_GRAPHIC);
@@ -140,7 +153,8 @@ public class GWDZilyanaSwingHandler extends CombatSwingHandler {
}
return;
}
state.getStyle().getSwingHandler().visualizeImpact(entity, victim, state);
if(state != null)
state.getStyle().getSwingHandler().visualizeImpact(entity, victim, state);
}
}
@@ -305,7 +305,7 @@ public class AlchemistZone extends MTAZone {
int alchIndex = indexer + index;
if (indexer != 0) {
if (indexer >= 4 && index < 4) {
if (indexer == 4 && indexer - index < 4 || indexer - index < 4) {
if (indexer == 4 && indexer - index < 4) {
return null;
}
if (indexer == 4) {
@@ -430,7 +430,7 @@ public class AlchemistZone extends MTAZone {
* Sets the cost.
* @param cost the cost to set.
*/
public void setCost(int cost) {
private void setCost(int cost) {
this.cost = cost;
}
@@ -95,7 +95,7 @@ public final class ImpDefenderNPC extends AbstractNPC {
thievingLevel += 15;
}
int currentLevel = RandomFunction.random(thievingLevel) + 1;
double ratio = currentLevel / (new Random().nextInt(level + 5) + 1);
double ratio = (double) currentLevel / (new Random().nextInt(level + 5) + 1);
return Math.round(ratio * thievingLevel) < level;
}
@@ -199,6 +199,7 @@ public class PlunderZones implements Plugin<Object> {
}
PlunderObject object = target instanceof NPC ? null : new PlunderObject(target.asScenery()); //PlunderObject(target.getId(),target.getLocation());
PlunderObjectManager manager = player.getPlunderObjectManager();
if(manager == null) return super.interact(e, target, option);
boolean alreadyOpened = manager.openedMap.getOrDefault(object.getLocation(),false);
boolean charmed = manager.charmedMap.getOrDefault(object.getLocation(),false);
boolean success = success(player, Skills.THIEVING);
@@ -56,7 +56,6 @@ public abstract class PyramidPlunderNPC extends AbstractNPC {
public PyramidPlunderNPC(int id, Location location, Player player) {
super(id, location);
this.player = player;
this.quotes = quotes;
this.endTime = (int) (GameWorld.getTicks() + (1000 / 0.6));
}
@@ -17,9 +17,9 @@ public enum PyramidPlunderRoom {
ROOM_7(7, 81, 0, 2,new Location(1927, 4424), new Location[] {Location.create(1923, 4432, 0),Location.create(1925, 4440, 0),Location.create(1929, 4440, 0),Location.create(1931, 4432, 0)}),
ROOM_8(8, 91, -2, 0,new Location(1965,4444), new Location[] {Location.create(1952, 4447, 0),Location.create(1953, 4445, 0),Location.create(1957, 4444, 0),Location.create(1962, 4448, 0)});
public int roomNum, reqLevel, spearX, spearY;
public final int roomNum, reqLevel, spearX, spearY;
Location entrance;
public List<Location> doorLocations;
public final List<Location> doorLocations;
PyramidPlunderRoom(int roomNum, int reqLevel, int spearX, int spearY, Location entrance, Location[] door_locations){
this.roomNum = roomNum;
this.reqLevel = reqLevel;
@@ -217,12 +217,15 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
}
return InteractionType.NO_INTERACT;
}
return getType().getSwingHandler().canSwing(entity, victim);
if(getType() != null)
return getType().getSwingHandler().canSwing(entity, victim);
else return InteractionType.NO_INTERACT;
}
@Override
public int swing(Entity entity, Entity victim, BattleState state) {
style = super.getType();
if(super.getType() != null)
style = super.getType();
int ticks = 1;
if (jad) {
main = CombatStyle.values()[1 + RandomFunction.RANDOM.nextInt(2)];
@@ -262,7 +265,7 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == null) {
if (state == null || state.getStyle() == null) {
return;
}
switch (state.getStyle()) {
@@ -291,19 +294,19 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
@Override
public void impact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() != null && victim.hasProtectionPrayer(state.getStyle())) {
if (state != null && state.getStyle() != null && victim.hasProtectionPrayer(state.getStyle())) {
state.setEstimatedHit(0);
}
if (state.getStyle() == null) {
if (state != null && state.getStyle() == null) {
NPC n = victim instanceof NPC ? ((NPC) victim) : (NPC) npc.activity.getPlayer().getProperties().getCombatPulse().getVictim();
if (n == null || !(n instanceof TzhaarFightCaveNPC)) {
if (!(n instanceof TzhaarFightCaveNPC)) {
n = npc;
}
((TzhaarFightCaveNPC) n).heal(state.getEstimatedHit());
n.graphics(new Graphics(444, 96));
return;
}
if (state.getEstimatedHit() > 0) {
if (state != null && state.getEstimatedHit() > 0) {
state.setEstimatedHit(formatHit(victim, state.getEstimatedHit()));
if (((NPC) entity).getId() == 2734 || ((NPC) entity).getId() == 2735) {
victim.getSkills().decrementPrayerPoints(state.getEstimatedHit());
@@ -316,11 +319,11 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
@Override
public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
if (state.getStyle() == null) {
if (state != null && state.getStyle() == null) {
return;
} else if (state.getStyle() == CombatStyle.MAGIC && !jad) {
} else if (state != null && state.getStyle() == CombatStyle.MAGIC && !jad) {
victim.graphics(Graphics.create(1624));
} else if (jad && state.getStyle() == CombatStyle.RANGE) {
} else if (state != null && jad && state.getStyle() == CombatStyle.RANGE) {
victim.graphics(Graphics.create(451));
}
style.getSwingHandler().visualizeImpact(entity, victim, state);
@@ -332,8 +335,8 @@ public final class TzhaarFightCaveNPC extends AbstractNPC {
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return style.getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
return style.getSwingHandler().calculateDefence(victim, attacker);
}
@Override
@@ -138,12 +138,12 @@ public final class TzhaarFightPitsPlugin extends ActivityPlugin {
// Become the Champion of the Fight Pits
if (lastVictor != null) {
lastVictor.getAchievementDiaryManager().finishTask(lastVictor, DiaryType.KARAMJA, 2, 0);
addTokkul(lastVictor);
lastVictor.getAppearance().setSkullIcon(SKULL_ID);
lastVictor.getUpdateMasks().register(new AppearanceFlag(lastVictor));
lastVictor.getPacketDispatch().sendString("Current Champion: " + getChampionName(), INTERFACE_ID, 0);
resetDamagePulse(lastVictor);
}
addTokkul(lastVictor);
lastVictor.getAppearance().setSkullIcon(SKULL_ID);
lastVictor.getUpdateMasks().register(new AppearanceFlag(lastVictor));
lastVictor.getPacketDispatch().sendString("Current Champion: " + getChampionName(), INTERFACE_ID, 0);
resetDamagePulse(lastVictor);
RegionManager.forId(9552).getPlanes()[0].getNpcs().get(0).setAttribute("fp_champn", getChampionName());
}
minutes = 0;
@@ -181,7 +181,9 @@ public final class AnimationRoom extends MapZone implements Plugin<Object> {
}
}
}
animateArmour(event.getPlayer(), (Scenery) event.getUsedWith(), set);
if(set != null) {
animateArmour(event.getPlayer(), (Scenery) event.getUsedWith(), set);
}
return true;
}
@@ -144,7 +144,8 @@ public final class CatapultRoom extends MapZone implements Plugin<Object> {
});
Projectile.create(Location.create(2842, 3554, 1), Location.create(2842, 3545, 1), attack.graphicId, 70, 32, 80, 220, 20, 11).send();
Scenery object = RegionManager.getObject(Location.create(2840, 3552, 1));
SceneryBuilder.replace(object, object.transform(attack.objectId), 4);
if(object != null)
SceneryBuilder.replace(object, object.transform(attack.objectId), 4);
Audio sound = new Audio(1911);
for (Player p : players) {
p.getAudioManager().send(sound);
@@ -16,7 +16,6 @@ public class SkillEffect extends ConsumableEffect {
@Override
public void activate(Player p) {
Skills skills = p.getSkills();
int level = skills.getLevel(skill_slot);
int slevel = skills.getStaticLevel(skill_slot);
skills.updateLevel(skill_slot,(int)(base + (bonus * slevel)),slevel + (int)(base + (bonus * slevel)));
}
@@ -392,7 +392,7 @@ public final class DBRCutscenePlugin extends CutscenePlugin {
getWiseOldMan().animate(CAST_ANIMATION);
getWiseOldMan().graphics(new Graphics(433));
if (target instanceof Entity) {
Projectile.create(getWiseOldMan(), target instanceof Entity ? ((Entity) target) : null, 434).send();
Projectile.create(getWiseOldMan(), (Entity) target, 434).send();
} else {
Projectile projectile = Projectile.create(getWiseOldMan(), null, 434, 30, 30, 41, 140, 0, 0);
projectile.setEndLocation((Location) target);
@@ -603,10 +603,13 @@ public final class DBRCutscenePlugin extends CutscenePlugin {
break;
case 55:
Scenery wall = RegionManager.getObject(base.transform(16, 46, 0));
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
getWiseOldMan().getWalkingQueue().reset();
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
if(wall != null)
SceneryBuilder.replace(wall, wall.transform(9151, 0, 10));
if(getWiseOldMan() != null) {
getWiseOldMan().getWalkingQueue().reset();
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 16, base.getY() + 46);
getWiseOldMan().getWalkingQueue().addPath(base.getX() + 17, base.getY() + 46);
}
break;
case 58:
camera(21, 38, -36, 43, 495, 99);
@@ -45,7 +45,7 @@ public final class ChemistDialogue extends DialoguePlugin {
public boolean open(Object... args) {
interpreter.sendOptions("Do you want to talk about lamps?", "Yes.", "No.", "No, I'm more interested in impling jars.", "Falador Achievement Diary");
stage = 0;
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
replacementReward = diary.isLevelRewarded(level)
&& diary.isComplete(level, true)
&& !player.hasItem(diary.getType().getRewards(level)[0]);
@@ -111,6 +111,7 @@ public final class DialogueInterpreter {
npc.getWalkingQueue().reset();
npc.getPulseManager().clear();
} catch(Exception e){
e.printStackTrace();
}
} else if (args.length < 1) {
args = new Object[] { dialogueKey };
@@ -163,7 +164,7 @@ public final class DialogueInterpreter {
public void startScript(int dialogueKey, ScriptContext script, Object... args) {
key = dialogueKey;
(dialogueStage = script).execute(args);
if (script != null && script.isInstant()) {
if (script.isInstant()) {
dialogueStage = script = ScriptManager.run(script, args);
}
}
@@ -39,7 +39,7 @@ public class EblisDialogue extends DialoguePlugin {
@Override
public boolean open(Object... args) {
//TODO: Add proper dialogue once DT is implemented
NPC npc = (NPC) args[0];
npc = (NPC) args[0];
if(!player.getAttribute("DT:staff-bought",false)) {
player("Hey.");
stage = 0;
@@ -59,7 +59,7 @@ public class ReadbeardFrankDialogue extends DialoguePlugin {
quest = player.getQuestRepository().getQuest("Pirate's Treasure");
npc("Arr, Matey!");
stage = 0;
AchievementDiary diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
diary = player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR);
replacementReward = diary.isLevelRewarded(level)
&& diary.isComplete(level, true)
&& !player.hasItem(diary.getType().getRewards(level)[0]);
@@ -85,6 +85,7 @@ public class SirReniteeDialogue extends DialoguePlugin {
stage = 500;
break;
}
break;
case 200:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "What is your name?");
stage = 210;
@@ -158,6 +158,7 @@ public class StankersDialogue extends DialoguePlugin {
case 90:
npc("Your headband will help you get experience when", "woodcutting maple trees, and an extra log or two when", "cutting normal trees. I've also told Geoff to increase");
stage++;
break;
case 91:
npc("your flax allowance in acknowledgement of your", "standing.");
stage = 999;
@@ -154,12 +154,11 @@ public final class TownCrierDialogue extends DialoguePlugin {
npc("Beware of players trying to lue you into the wilderness.", "Your items cannot be returned if you lose them!");
stage = 2;
break;
case 5:
default:
npc("" + GameWorld.getSettings().getName() + " will never email you asking for your log-in details.");
stage = 2;
break;
}
stage = 2;
break;
case 150:
npc("Player Moderators are normal players of the game, just", "like you. However, since they have shown themselves to be", "trustworthy and active reporters, they have been invited", "by Jagex to monitor the game and take appropriate");
@@ -166,7 +166,6 @@ public final class DoorActionHandler {
}
public static Location getEndLocation(Entity entity, Scenery object, Boolean isAutoWalk) {
Location l = object.getLocation();
Location end = DestinationFlag.OBJECT.getDestination(entity,object);
switch (object.getRotation()) {
case 0:
if (entity.getLocation().getX() >= l.getX()) {
@@ -183,7 +182,7 @@ public final class DoorActionHandler {
l = l.transform(1, 0, 0);
}
break;
case 3:
default:
if (entity.getLocation().getY() >= l.getY()) {
l = l.transform(0, -1, 0);
}
@@ -12,7 +12,7 @@ public class PresetManager {
private Player player;
private Map<String, Preset> current_presets;
private final Map<String, Preset> current_presets;
public PresetManager() {
current_presets = new HashMap<>();
@@ -26,9 +26,9 @@ public enum Canoe {
this.maxDist = ordinal() + 1;
}
public int silhouetteChild;
public int textChild;
public int maxDist;
public final int silhouetteChild;
public final int textChild;
public final int maxDist;
/**
* Represents the woodcutting level requirement to craft the canoe.
@@ -1,6 +1,6 @@
package core.game.content.holiday;
import core.cache.ServerStore;
import core.cache.AriosStore;
import core.cache.def.impl.ItemDefinition;
import java.nio.ByteBuffer;
@@ -32,10 +32,10 @@ public final class ItemLimitation {
* @return {@code True} if parsed.
*/
public boolean parse() {
if (ServerStore.get("hir_limits") == null) {
if (AriosStore.get("hir_limits") == null) {
return true;
}
ByteBuffer buffer = ServerStore.getArchive("hir_limits");
ByteBuffer buffer = AriosStore.getArchive("hir_limits");
int length = buffer.get() & 0xFF;
for (int i = 0; i < length; i++) {
int itemId = buffer.getShort() & 0xFFFF;
@@ -56,7 +56,7 @@ public final class ItemLimitation {
buffer.putShort((short) (int) ITEMS.get(itemId));
}
buffer.flip();
ServerStore.setArchive("hir_limits", buffer);
AriosStore.setArchive("hir_limits", buffer);
}
/**
@@ -1099,7 +1099,6 @@ public class ChristmasEvent extends HolidayEvent {
final Item other = args.length == 2 ? null : (Item) args[2];
if (other != null) {
identifier = "equip";
item = other;
}
switch (identifier) {
case "equip":
@@ -150,7 +150,7 @@ public final class DragonSlayerPlugin extends OptionHandler {
InteractionListeners.run(node.getId(),0,"equip",player,node);
break;
case 742:
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD) || player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
player.getPacketDispatch().sendMessage("You have already slain the dragon. Now you just need to return to Oziach for");
player.getPacketDispatch().sendMessage("your reward!");
return true;
@@ -169,7 +169,7 @@ public final class DragonSlayerPlugin extends OptionHandler {
movement.run(player, 10);
return true;
}
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD) || player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
player.getPacketDispatch().sendMessage("You have already slain the dragon. Now you just need to return to Oziach for");
player.getPacketDispatch().sendMessage("your reward!");
return true;
@@ -318,7 +318,7 @@ public final class DragonSlayerPlugin extends OptionHandler {
case 2604:
switch (option) {
case "search":
if (!player.getInventory().containsItem(DragonSlayer.MAZE_PIECE) && !player.getInventory().containsItem(DragonSlayer.MAZE_PIECE)) {
if (!player.getInventory().containsItem(DragonSlayer.MAZE_PIECE)) {
if (!player.getInventory().add(DragonSlayer.MAZE_PIECE)) {
GroundItemManager.create(DragonSlayer.MAZE_PIECE, player);
}
@@ -148,7 +148,7 @@ public final class ElvargNPC extends AbstractNPC {
return super.isAttackable(entity, style);
}
final Player player = (Player) entity;
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD) || player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
if (player.getQuestRepository().getQuest("Dragon Slayer").getStage(player) == 40 && (player.getInventory().containsItem(DragonSlayer.ELVARG_HEAD))) {
player.getPacketDispatch().sendMessage("You have already slain the dragon. Now you just need to return to Oziach for");
player.getPacketDispatch().sendMessage("your reward!");
return true;
@@ -216,8 +216,8 @@ public final class ElvargNPC extends AbstractNPC {
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return style.getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
return style.getSwingHandler().calculateDefence(victim, attacker);
}
@Override
@@ -169,8 +169,8 @@ public final class MeldarMadNPC extends AbstractNPC {
}
@Override
public int calculateDefence(Entity entity, Entity attacker) {
return style.getSwingHandler().calculateDefence(entity, attacker);
public int calculateDefence(Entity victim, Entity attacker) {
return style.getSwingHandler().calculateDefence(victim, attacker);
}
@Override
@@ -187,6 +187,7 @@ public final class LadyKeliDialogue extends DialoguePlugin {
case 56:
interpreter.sendDialogues(npc, null, "As you put it that way I am sure you can see it. You", "cannot steal the key, it is on a Runite chain.");
stage = 57;
break;
case 57:
interpreter.sendDialogue("Keli shows you a small key on a strong looking chain.");
stage = 58;
@@ -80,7 +80,7 @@ public final class RestlessGhostPlugin extends OptionHandler {
switch (option) {
case "open":
switch (id) {
case 2145:
default:
toggleCoffin(player, object);
break;
}
@@ -23,7 +23,6 @@ public class VineInteraction extends PluginInteraction {
@Override
public boolean handle(Player player, Node node) {
if(node instanceof Scenery){
Scenery obj = node.asScenery();
if(player.getQuestRepository().getStage("Fishing Contest") > 0 && player.getQuestRepository().getStage("Fishing Contest") < 100){
player.getPulseManager().run(new MovementPulse(player, node.asScenery().getLocation().transform(0, 0, 0)) {
@Override
@@ -529,7 +529,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
@Override
public void handleTickActions() {
if (player != null && !player.isActive() || !player.getLocation().withinDistance(getLocation(), 20)) {
if (player != null && !player.isActive() || player != null && !player.getLocation().withinDistance(getLocation(), 20)) {
clear();
}
super.handleTickActions();
@@ -545,10 +545,7 @@ public final class MerlinCrystalPlugin extends OptionHandler {
@Override
public boolean canAttack(Entity entity) {
if (getAttribute("thrantax_owner", entity) == entity) {
return true;
}
return false;
return getAttribute("thrantax_owner", entity) == entity;
}
@Override
@@ -591,20 +588,20 @@ public final class MerlinCrystalPlugin extends OptionHandler {
Item useditem = event.getUsedItem();
final Scenery object = (Scenery) event.getUsedWith();
if (player.getAttribute("cleared-beehives", false) && useditem.getId() == REPELLENT.getId() && object.getId() == 68) {
if (useditem != null && player.getAttribute("cleared-beehives", false) && useditem.getId() == REPELLENT.getId() && object.getId() == 68) {
player.getDialogueInterpreter().sendDialogue("You have already cleared the hive of its bees.", "You can now safely collect wax from the hive.");
}
if (useditem.getId() == REPELLENT.getId() && object.getId() == 68 && player.getAttribute("cleared-beehives", false)) {
if (useditem != null && useditem.getId() == REPELLENT.getId() && object.getId() == 68 && player.getAttribute("cleared-beehives", false)) {
player.getDialogueInterpreter().sendDialogue("You pour insect repellent on the beehive. You see the bees leaving the", "hive.");
player.setAttribute("cleared-beehives", true);
}
if (useditem.getId() == BUCKET.getId() && player.getAttribute("cleared-beehives", false)) {
if (useditem != null && useditem.getId() == BUCKET.getId() && player.getAttribute("cleared-beehives", false)) {
player.getDialogueInterpreter().sendDialogue("You get some wax from the beehive.");
player.getInventory().remove(new Item(BUCKET.getId(), 1));
player.getInventory().add(new Item(BUCKET_OF_WAX.getId(), 1));
} else if (useditem.getId() == BUCKET.getId() && !player.getAttribute("cleared-beehives", false)) {
} else if (useditem != null && useditem.getId() == BUCKET.getId() && !player.getAttribute("cleared-beehives", false)) {
player.getDialogueInterpreter().sendDialogue("It would be dangerous to stick the bucket into the hive while", "the bees are still in it. Perhaps you can clear them out", "somehow.");
}
@@ -161,6 +161,7 @@ public final class SirKayDialogue extends DialoguePlugin {
case 90:
npc("Your headband will help you get experience when", "woodcutting maple trees, and an extra log or two when", "cutting normal trees. I've also told Geoff to increase");
stage++;
break;
case 91:
npc("your flax allowance in acknowledgement of your", "standing.");
stage = 999;
@@ -28,7 +28,6 @@ public class SheepPoisonHandler extends PluginInteraction {
@Override
public boolean handle(Player player, NodeUsageEvent event) {
Node n = event.getUsedWith();
Item i = event.getUsedItem();
if(n instanceof HerderSheepNPC){
if (withinBorders(n.getLocation(),Location.create(2595, 3364, 0),Location.create(2609, 3351, 0))){
handlePoisoning(player,(HerderSheepNPC) n);
@@ -42,7 +42,6 @@ public class WitchsHousePlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
final Quest quest = player.getQuestRepository().getQuest("Witch's House");
final GroundItem ball = GroundItemManager.get(2407, new Location(2935, 3460, 0), null);
final int id = node instanceof Item ? ((Item) node).getId() : node instanceof Scenery ? ((Scenery) node).getId() : node instanceof NPC ? ((NPC) node).getId() : node.getId();
// boolean killedExperiment = player.getAttribute("witchs_house:experiment_killed",false);
// boolean experimentAlive = !player.getAttribute("witchs_house:experiment_killed", false);
@@ -967,10 +967,9 @@ public enum TutorialStage {
/**
* Represents if it is a login stage.
* @param login the login value.
* @return {@code True} if so.
*/
public boolean isLogin(boolean login) {
return this.login = login;
private void isLogin(boolean login) {
this.login = login;
}
/**
@@ -2,6 +2,7 @@ package core.game.ge;
import core.game.node.item.Item;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -75,28 +76,12 @@ public enum GEItemSet {
return itemId;
}
/**
* Sets the itemId.
* @param itemId The itemId to set.
*/
public void setItemId(int itemId) {
this.itemId = itemId;
}
/**
* Gets the components.
* @return The components.
*/
public int[] getComponents() {
return components;
}
/**
* Sets the components.
* @param components The components to set.
*/
public void setComponents(int[] components) {
this.components = components;
return Arrays.copyOf(components, components.length);
}
/**
@@ -104,6 +89,6 @@ public enum GEItemSet {
* @return The item array.
*/
public static Item[] getItemArray() {
return itemArray;
return Arrays.copyOf(itemArray, itemArray.length);
}
}
@@ -97,6 +97,7 @@ public final class GrandExchangeDatabase {
}
initialized = true;
} catch (Exception e){
e.printStackTrace();
initNewDB();
}
}
@@ -112,7 +112,7 @@ public class Interaction {
if (option.getHandler() == null || !option.getHandler().handle(player, node, option.getName().toLowerCase())) {
player.getPacketDispatch().sendMessage("Nothing interesting happens.");
}
if (option != null && option.getHandler() != null) {
if (option.getHandler() != null) {
player.debug("Using item handler " + option.getHandler().getClass().getSimpleName());
}
} catch (Exception e){
@@ -188,7 +188,7 @@ public final class LumbridgeNodePlugin extends OptionHandler {
cumulativeStr += 1;
}
cumulativeStr *= 1.0;
int hit = (int) ((14 + cumulativeStr + (bonus / 8) + ((cumulativeStr * bonus) * 0.016865)) * 1.0) / 10 + 1;
int hit = (int) ((14.0 + cumulativeStr + ((double) bonus / 8) + ((cumulativeStr * bonus) * 0.016865))) / 10 + 1;
player.getSkills().addExperience(Skills.RANGE, ((hit * 1.33) / 10));
return !player.getEquipment().contains(9706, 1) || !player.getEquipment().contains(9705, 1);
} else {
@@ -270,17 +270,13 @@ public final class TrollheimPlugin extends OptionHandler {
bandaid(player, player.getLocation(), object.getLocation().transform(0, -3, 0), CLIMB_DOWN, CLIMB_DOWN, object.getDirection());
break;
case 3790:// rock scalling.
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
direction = getOpposite(ForceMovement.direction(player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0)));
case 3791:
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_DOWN, CLIMB_DOWN, direction);
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
break;
case 3791:// rock scalling.
xOffset = player.getLocation().getX() < loc.getX() ? 2 : -2;
//bandaid(player, player.getLocation(), object.getLocation().transform(xOffset, yOffset, 0), CLIMB_UP);
player.getProperties().setTeleportLocation(object.getLocation().transform(xOffset, yOffset, 0));
break;
case 3748:
case 3748:
player.getPacketDispatch().sendMessage("You climb onto the rock...");
if (loc.equals(new Location(2821, 3635, 0))) {
bandaid(player, player.getLocation(), loc.transform(player.getLocation().getX() > loc.getX() ? -1 : 1, 0, 0), JUMP);
@@ -185,14 +185,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
return button;
}
/**
* Sets the button.
* @param button The button to set.
*/
public void setButton(int button) {
this.button = button;
}
/**
* Gets the bolt.
* @return The bolt.
@@ -201,14 +193,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
return bolt;
}
/**
* Sets the bolt.
* @param bolt The bolt to set.
*/
public void setBolt(int bolt) {
this.bolt = bolt;
}
/**
* Gets the level.
* @return The level.
@@ -217,30 +201,14 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
return level;
}
/**
* Sets the level.
* @param level The level to set.
*/
public void setLevel(int level) {
this.level = level;
}
/**
* Gets the runes.
* @return The runes.
*/
public Item[] getRunes() {
private Item[] getRunes() {
return runes;
}
/**
* Sets the runes.
* @param runes The runes to set.
*/
public void setRunes(Item[] runes) {
this.runes = runes;
}
/**
* Gets the exp.
* @return The exp.
@@ -249,14 +217,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
return exp;
}
/**
* Sets the exp.
* @param exp The exp to set.
*/
public void setExp(double exp) {
this.exp = exp;
}
/**
* Gets the enchanted.
* @return The enchanted.
@@ -265,14 +225,6 @@ public final class BoltEnchantingInterface extends ComponentPlugin {
return enchanted;
}
/**
* Sets the enchanted.
* @param enchanted The enchanted to set.
*/
public void setEnchanted(int enchanted) {
this.enchanted = enchanted;
}
/**
* Gets the bolt by the id.
* @param button the button.
@@ -1,5 +1,6 @@
package core.game.interaction.inter;
import api.ContentAPI;
import core.game.component.Component;
import core.game.component.ComponentDefinition;
import core.game.component.ComponentPlugin;
@@ -30,7 +31,7 @@ public final class GliderInterface extends ComponentPlugin {
if (glider == null) {
return true;
}
player.getPulseManager().run(new GliderPulse(1, player, glider));
ContentAPI.submitWorldPulse(new GliderPulse(1, player, glider));
return true;
}
}
@@ -14,7 +14,11 @@ import core.game.node.entity.player.link.TeleportManager.TeleportType
import core.game.world.map.Location
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
import org.json.simple.JSONObject
import org.rs09.consts.Items
import rs09.ServerStore
import rs09.ServerStore.getBoolean
import rs09.ServerStore.getInt
import rs09.game.interaction.InteractionListener
/**
@@ -30,17 +34,15 @@ class ExplorersRingPlugin : InteractionListener() {
override fun defineListeners() {
on(RINGS, ITEM, "run-replenish"){player, node ->
if (player.savedData.globalData.runReplenishDelay < System.currentTimeMillis()) {
player.savedData.globalData.runReplenishCharges = 0
player.savedData.globalData.runReplenishDelay = Util.nextMidnight(System.currentTimeMillis())
}
val charges = player.savedData.globalData.runReplenishCharges
val charges = getStoreFile().getInt(player.username.toLowerCase() + ":run")
if (charges >= getRingLevel(node.id)) {
ContentAPI.sendMessage(player,"You have used all the charges you can for one day.")
return@on true
}
player.settings.updateRunEnergy(-50.0)
player.savedData.globalData.runReplenishCharges = charges + 1
getStoreFile()[player.username.toLowerCase() + ":run"] = charges + 1
ContentAPI.sendMessage(player,"You feel refreshed as the ring revitalises you and a charge is used up.")
ContentAPI.visualize(player, 9988, 1733)
return@on true
@@ -51,16 +53,13 @@ class ExplorersRingPlugin : InteractionListener() {
ContentAPI.sendMessage(player,"You need a Magic level of 21 in order to do that.")
return@on true
}
if (player.savedData.globalData.lowAlchemyDelay < System.currentTimeMillis()) {
player.savedData.globalData.lowAlchemyCharges = 0
player.savedData.globalData.lowAlchemyDelay = Util.nextMidnight(System.currentTimeMillis())
}
if (player.savedData.globalData.lowAlchemyCharges <= 0 && player.savedData.globalData.lowAlchemyDelay > System.currentTimeMillis()) {
ContentAPI.sendMessage(player,"You have used all the charges you can for one day.")
if(getStoreFile().getBoolean(player.username.toLowerCase() + ":alchs")){
ContentAPI.sendMessage(player, "You have claimed all the charges you can for one day.")
return@on true
}
ContentAPI.sendMessage(player,"You grant yourself with 30 free low alchemy charges.") // todo this implementation is not correct, see https://www.youtube.com/watch?v=UbUIF2Kw_Dw
player.savedData.globalData.lowAlchemyCharges = 30
getStoreFile()[player.username.toLowerCase() + ":alchs"] = true
return@on true
}
@@ -93,4 +92,8 @@ class ExplorersRingPlugin : InteractionListener() {
else -> -1
}
}
fun getStoreFile(): JSONObject{
return ServerStore.getArchive("daily-explorer-ring")
}
}
@@ -101,14 +101,14 @@ public class TeleTabsOptionPlugin extends OptionHandler {
/**
* @param item the item to set
*/
public void setItem(int item) {
private void setItem(int item) {
this.item = item;
}
/**
* @param location the location to set
*/
public void setLocation(Location location) {
private void setLocation(Location location) {
this.location = location;
}
@@ -122,7 +122,7 @@ public class TeleTabsOptionPlugin extends OptionHandler {
/**
* @param exp the exp to set.
*/
public void setExp(double exp) {
private void setExp(double exp) {
this.exp = exp;
}
}
@@ -32,7 +32,7 @@ public final class TeleportCrystalPlugin extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
if (!WildernessZone.checkTeleport(player, 20)) {
if (true) {
player.getPacketDispatch().sendMessage("The crystal is unresponsive.");
return true;
}
@@ -21,7 +21,7 @@ public class BrawlingGlovesManager {
try {
registerGlove(id, Objects.requireNonNull(BrawlingGloves.forId(id)).getCharges());
} catch (Exception e){
System.out.println(e);
e.printStackTrace();
}
}
public void registerGlove(int id, int charges) {GloveCharges.putIfAbsent(id,charges);}
@@ -287,34 +287,6 @@ public class PoisonRemovePlugin extends UseWithHandler {
return third;
}
/**
* @param first the first to set.
*/
public void setFirst(int first) {
this.first = first;
}
/**
* @param item the item to set.
*/
public void setItem(int item) {
this.item = item;
}
/**
* @param second the second to set.
*/
public void setSecond(int second) {
this.second = second;
}
/**
* @param third the third to set.
*/
public void setThird(int third) {
this.third = third;
}
/**
* Method used to get the poisioned weapon for the id.
* @param i the id.
@@ -261,34 +261,6 @@ public class PoisonWeaponPlugin extends UseWithHandler {
return third;
}
/**
* @param first the first to set.
*/
public void setFirst(int first) {
this.first = first;
}
/**
* @param item the item to set.
*/
public void setItem(int item) {
this.item = item;
}
/**
* @param second the second to set.
*/
public void setSecond(int second) {
this.second = second;
}
/**
* @param third the third to set.
*/
public void setThird(int third) {
this.third = third;
}
/**
* Method used to get the poisioned weapon for the id.
* @param i the id.
@@ -320,8 +292,10 @@ public class PoisonWeaponPlugin extends UseWithHandler {
product = weapon.getThird();
player.getInventory().remove(new Item(5940, 1));
break;
default:
break;
}
int amt = weaponItem.getAmount() > 5 ? 5 : weaponItem.getAmount();
int amt = Math.min(weaponItem.getAmount(), 5);
player.getInventory().remove(new Item(weaponItem.getId(), amt));
player.getInventory().add(new Item(229, 1));
player.getInventory().add(new Item(product, amt));
@@ -44,20 +44,20 @@ public class IncubatorPlugin extends OptionHandler {
player.sendMessage("You don't have enough inventory space.");
return true;
}
if (egg != null) {
String name = egg.getProduct().getName().toLowerCase();
player.varpManager.get(1160).setVarbit(4,0).send(player);
player.sendMessage("You take your " + name + " out of the incubator.");
if(!player.getInventory().add(egg.getProduct())){
GroundItemManager.create(egg.getProduct(),player);
}
player.removeAttribute("inc");
{
String name = egg.getProduct().getName().toLowerCase();
player.varpManager.get(1160).setVarbit(4,0).send(player);
player.sendMessage("You take your " + name + " out of the incubator.");
if(!player.getInventory().add(egg.getProduct())){
GroundItemManager.create(egg.getProduct(),player);
}
player.removeAttribute("inc");
}
return true;
case "inspect":
if (player.states.get("incubator") != null || inc != -1) {
IncubatorState p = (IncubatorState) player.states.get("incubator");
if(p.getPulse() == null){
if(p != null && p.getPulse() == null){
player.varpManager.get(1160).setVarbit(4,0).send(player);
return true;
}
@@ -1,396 +0,0 @@
package core.game.interaction.npc;
import core.cache.def.impl.NPCDefinition;
import core.plugin.Initializable;
import core.game.content.dialogue.DialoguePlugin;
import core.game.content.dialogue.FacialExpression;
import core.game.interaction.OptionHandler;
import core.game.node.Node;
import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.RunScript;
import core.game.node.entity.player.link.diary.DiaryType;
import core.game.node.entity.player.link.quest.Quest;
import core.game.node.item.Item;
import core.plugin.Plugin;
/**
* Represents the plugin used for buying a battle staff from zeke.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class ZaffPlugin extends OptionHandler {
/**
* The bacon ring.
*/
public static final Item BEACON_RING = new Item(11014);
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
NPCDefinition.setOptionHandler("buy-battlestaves", this);
new ZaffDialogue().init();
new ZaffStaveDialogue().init();
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
player.getDialogueInterpreter().open(9679);
return true;
}
/**
* Represents the dialogue plugin used for the zaff npc.
* @author 'Vexia
* @version 1.0
*/
public static final class ZaffDialogue extends DialoguePlugin {
/**
* Represents the staff item.
*/
@SuppressWarnings("unused")
private static final Item STAFF = new Item(11014, 1);
/**
* The quest.
*/
private Quest quest;
/**
* Constructs a new {@code ZaffDialogue} {@code Object}.
*/
public ZaffDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code ZaffDialogue} {@code Object}.
* @param player the player.
*/
public ZaffDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new ZaffDialogue(player);
}
@Override
public boolean open(Object... args) {
npc = (NPC) args[0];
quest = player.getQuestRepository().getQuest("What Lies Below");
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Would you like to buy or sell some staves or is there", "something else you need?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
if (quest.getStage(player) == 60) {
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.", "Rat Burgiss sent me.");
stage = 1;
break;
} else if (quest.getStage(player) == 80) {
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.", "We did it! We beat Surok!");
stage = 1;
break;
} else if (quest.getStage(player) >= 70) {
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.", "Can I have another ring?");
stage = 1;
break;
}
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.");
stage = 1;
break;
case 1:
switch (buttonId) {
case 1:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Yes, please.");
stage = 10;
break;
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thank you.");
stage = 20;
break;
case 3:
if (quest.getStage(player) == 60) {
player("Rat Burgiss sent me!");
stage = 70;
break;
} else if (quest.getStage(player) == 80) {
player("We did it! We beat Surok!");
stage = 200;
break;
}
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I have another ring?");
stage = 50;
break;
}
break;
case 10:
end();
npc.openShop(player);
break;
case 20:
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Well, 'stick' your head in again if you change your mind.");
stage = 21;
break;
case 21:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Huh, terrible pun. You just can't get the 'staff' these", "days!");
stage = 22;
break;
case 22:
end();
break;
case 50:
if (player.getInventory().contains(11014, 1))
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Go and get the one that's in your inventory " + player.getUsername() + "!");
else if (player.getBank().contains(11014, 1))
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Go and get the one that's in your bank" + player.getUsername() + "!");
else if (player.getEquipment().contains(11014, 1))
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Go and get the one that's on your finger " + player.getUsername() + "!");
else {
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Of course you can! Here you go " + player.getUsername() + "!");
player.getInventory().add(BEACON_RING);
}
stage = 51;
break;
case 51:
end();
break;
case 70:
npc("Ah, yes; You must be " + player.getUsername() + "! Rat sent word that you", "would be coming. Everything is prepared. I have created", "a spell that will remove the mind control spell.");
stage++;
break;
case 71:
player("Okay, what's the plan?");
stage++;
break;
case 72:
npc("Listen carefully. For the spell to succeed, the king must", "be made very weak, if his mind is controlled, you will", "need to fight him until he is all but dead.");
stage++;
break;
case 73:
npc("Then and ONLY then, use your ring to summon me.", "I will teleport to you and cast the spell that will", "cure the king.");
stage++;
break;
case 74:
player("Why must I summon you? Can't you come with me?");
stage++;
break;
case 75:
npc("I cannot. I must look after my shop here and", "I have lots to do. Rest assured, I will come when you", "summon me.");
stage++;
break;
case 76:
player("Okay, so what do I do now?");
stage++;
break;
case 77:
npc("Take this beacon ring and some instructions.");
stage++;
break;
case 78:
npc("Once you have read the instructions. It will be time for", "you to arrest Surok.");
stage++;
break;
case 79:
player("Won't he be disinclined to acquiesce to that request?");
stage++;
break;
case 80:
npc("Won't he what?");
stage++;
break;
case 81:
player("Won't he refuse?");
stage++;
break;
case 82:
npc("I very much expect so. It may turn nasty, so be on your", "guard. I hope we can stop him before he can cast his", "spell!", "Make sure you have that ring I gave you.");
stage++;
break;
case 83:
player("Okay, thanks, Zaff!");
stage++;
break;
case 84:
player.getInventory().add(BEACON_RING);
quest.setStage(player, 70);
end();
break;
case 200:
npc("Yes. You have done well, " + player.getUsername() + ". You are to be", "commended for you actions!");
stage++;
break;
case 201:
player("It was all in the call of duty!");
stage++;
break;
case 202:
player("What will happen with Surok now?");
stage++;
break;
case 203:
npc("Well, when I disrupted Surok's spell, he will have been", "sealed in the library, but we still need to keep an", "eye on him, just in case.");
stage++;
break;
case 204:
npc("When you are ready, report back to Rat and he will", "reward you.");
stage++;
break;
case 205:
player("Okay, I will.");
stage++;
break;
case 206:
quest.setStage(player, 90);
end();
break;
}
return true;
}
@Override
public int[] getIds() {
return new int[] { 546 };
}
}
/**
* Represents the dialogue used to buy staves from zaff.
* @author 'Vexia
* @version 1.0
*/
public final class ZaffStaveDialogue extends DialoguePlugin {
/**
* The ammount of battlestaves.
*/
private int ammount;
/**
* Constructs a new {@code ZaffBuyStavesDialogue} {@code Object}.
*/
public ZaffStaveDialogue() {
/**
* empty.
*/
}
/**
* Constructs a new {@code ZaffBuyStavesDialogue} {@code Object}.
* @param player the player.
*/
public ZaffStaveDialogue(Player player) {
super(player);
}
@Override
public DialoguePlugin newInstance(Player player) {
return new ZaffStaveDialogue(player);
}
@Override
public boolean open(Object... args) {
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Do you have any battlestaves?");
stage = 0;
return true;
}
@Override
public boolean handle(int interfaceId, int buttonId) {
switch (stage) {
case 0:
ammount = player.getSavedData().getGlobalData().getZaffAmount();
if (player.getSavedData().getGlobalData().getZafTime() < System.currentTimeMillis()) {
ammount = getMaxStaffs();
}
if (player.getSavedData().getGlobalData().getZafTime() > System.currentTimeMillis() && ammount <= 0) {
interpreter.sendDialogues(546, FacialExpression.HALF_GUILTY, "I'm very sorry! I seem to be out of battlestaves at the", "moment! I expect I'll get some more in by tomorrow,", "though.");
stage = 2;
break;
}
interpreter.sendDialogues(546, FacialExpression.HALF_GUILTY, "Battlestaves cost 8,000 gold pieces each. I have " + ammount + " left.", "How many would you like to buy?");
stage = 1;
break;
case 1:
end();
/*player.setAttribute("runscript", new RunScript() {
@Override
public boolean handle() {
int amt = (int) value;
if (amt > ammount) {
amt = ammount;
}
if (amt > player.getInventory().freeSlots()) {
amt = player.getInventory().freeSlots();
}
if (amt == 0) {
return true;
}
if (7000 * amt > player.getInventory().getAmount(new Item(995))) {
player.getPacketDispatch().sendMessage("You don't have enough money to buy that many.");
return true;
} else {
Item remove = new Item(995, 7000 * amt);
if (!player.getInventory().containsItem(remove)) {
end();
return true;
}
player.getInventory().remove(remove);
if (player.getInventory().add(new Item(1391, amt))) {
player.getSavedData().getGlobalData().setZafTime(System.currentTimeMillis() + (24 * 60 * 60 * 1000));
player.getSavedData().getGlobalData().setZaffAmount(ammount - amt);
}
}
return true;
}
});
interpreter.sendInput(false, "Zaff has " + ammount + " battlestaves...");
*/ break;
//TODO: Come back and fix this later when achievement diaries can actually be completed kekkekekeke
case 2:
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Oh, okay then. I'll try again another time.");
stage = 3;
break;
case 3:
end();
break;
}
return true;
}
/**
* Gets the max staffs to buy.
* @return the max staffs to buy.
*/
public int getMaxStaffs() {
int level = player.getAchievementDiaryManager().getDiary(DiaryType.VARROCK).getLevel();
switch (level) {
case 2:
return 64;
case 1:
return 32;
case 0:
return 16;
default:
return 8;
}
}
@Override
public int[] getIds() {
return new int[] { 9679 };
}
}
}
@@ -0,0 +1,456 @@
package core.game.interaction.npc
import api.Container
import api.ContentAPI
import api.InputType
import core.cache.def.impl.NPCDefinition
import core.plugin.Initializable
import core.game.interaction.OptionHandler
import core.plugin.Plugin
import core.game.interaction.npc.ZaffPlugin.ZaffDialogue
import core.game.interaction.npc.ZaffPlugin.ZaffStaveDialogue
import core.game.content.dialogue.DialoguePlugin
import core.game.node.entity.player.link.quest.Quest
import core.game.content.dialogue.FacialExpression
import core.game.interaction.npc.ZaffPlugin
import core.game.node.Node
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.diary.DiaryType
import core.game.node.item.Item
import org.json.simple.JSONObject
import org.rs09.consts.Items
import rs09.ServerStore
import rs09.ServerStore.getInt
import rs09.game.system.SystemLogger
/**
* Represents the plugin used for buying a battle staff from zeke.
* @author 'Vexia
* @version 1.0
*/
@Initializable
class ZaffPlugin : OptionHandler() {
@Throws(Throwable::class)
override fun newInstance(arg: Any?): Plugin<Any?> {
NPCDefinition.setOptionHandler("buy-battlestaves", this)
ZaffDialogue().init()
ZaffStaveDialogue().init()
return this
}
override fun handle(player: Player, node: Node, option: String): Boolean {
player.dialogueInterpreter.open(9679)
return true
}
/**
* Represents the dialogue plugin used for the zaff npc.
* @author 'Vexia
* @version 1.0
*/
class ZaffDialogue : DialoguePlugin {
/**
* The quest.
*/
private var quest: Quest? = null
/**
* Constructs a new `ZaffDialogue` `Object`.
*/
constructor() {
/**
* empty.
*/
}
/**
* Constructs a new `ZaffDialogue` `Object`.
* @param player the player.
*/
constructor(player: Player?) : super(player) {}
override fun newInstance(player: Player?): DialoguePlugin {
return ZaffDialogue(player)
}
override fun open(vararg args: Any): Boolean {
npc = args[0] as NPC
quest = player.questRepository.getQuest("What Lies Below")
interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Would you like to buy or sell some staves or is there",
"something else you need?"
)
stage = 0
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> {
if (quest!!.getStage(player) == 60) {
interpreter.sendOptions(
"Select an Option",
"Yes, please.",
"No, thank you.",
"Rat Burgiss sent me."
)
stage = 1
} else if (quest!!.getStage(player) == 80) {
interpreter.sendOptions(
"Select an Option",
"Yes, please.",
"No, thank you.",
"We did it! We beat Surok!"
)
stage = 1
} else if (quest!!.getStage(player) >= 70) {
interpreter.sendOptions(
"Select an Option",
"Yes, please.",
"No, thank you.",
"Can I have another ring?"
)
stage = 1
}
interpreter.sendOptions("Select an Option", "Yes, please.", "No, thank you.")
stage = 1
}
1 -> when (buttonId) {
1 -> {
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Yes, please.")
stage = 10
}
2 -> {
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "No, thank you.")
stage = 20
}
3 -> {
if (quest!!.getStage(player) == 60) {
player("Rat Burgiss sent me!")
stage = 70
} else if (quest!!.getStage(player) == 80) {
player("We did it! We beat Surok!")
stage = 200
}
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Can I have another ring?")
stage = 50
}
}
10 -> {
if(player.achievementDiaryManager.getDiary(DiaryType.VARROCK).levelRewarded.contains(true)){
npcl(FacialExpression.FRIENDLY, "Would you like to hear about my battlestaves?")
stage = 1000
} else {
end()
npc.openShop(player)
}
}
20 -> {
interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Well, 'stick' your head in again if you change your mind."
)
stage = 21
}
21 -> {
interpreter.sendDialogues(
player,
FacialExpression.HALF_GUILTY,
"Huh, terrible pun. You just can't get the 'staff' these",
"days!"
)
stage = 22
}
22 -> end()
50 -> {
if (player.inventory.contains(11014, 1)) interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Go and get the one that's in your inventory " + player.username + "!"
) else if (player.bank.contains(11014, 1)) interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Go and get the one that's in your bank" + player.username + "!"
) else if (player.equipment.contains(11014, 1)) interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Go and get the one that's on your finger " + player.username + "!"
) else {
interpreter.sendDialogues(
npc,
FacialExpression.HALF_GUILTY,
"Of course you can! Here you go " + player.username + "!"
)
player.inventory.add(BEACON_RING)
}
stage = 51
}
51 -> end()
70 -> {
npc(
"Ah, yes; You must be " + player.username + "! Rat sent word that you",
"would be coming. Everything is prepared. I have created",
"a spell that will remove the mind control spell."
)
stage++
}
71 -> {
player("Okay, what's the plan?")
stage++
}
72 -> {
npc(
"Listen carefully. For the spell to succeed, the king must",
"be made very weak, if his mind is controlled, you will",
"need to fight him until he is all but dead."
)
stage++
}
73 -> {
npc(
"Then and ONLY then, use your ring to summon me.",
"I will teleport to you and cast the spell that will",
"cure the king."
)
stage++
}
74 -> {
player("Why must I summon you? Can't you come with me?")
stage++
}
75 -> {
npc(
"I cannot. I must look after my shop here and",
"I have lots to do. Rest assured, I will come when you",
"summon me."
)
stage++
}
76 -> {
player("Okay, so what do I do now?")
stage++
}
77 -> {
npc("Take this beacon ring and some instructions.")
stage++
}
78 -> {
npc("Once you have read the instructions. It will be time for", "you to arrest Surok.")
stage++
}
79 -> {
player("Won't he be disinclined to acquiesce to that request?")
stage++
}
80 -> {
npc("Won't he what?")
stage++
}
81 -> {
player("Won't he refuse?")
stage++
}
82 -> {
npc(
"I very much expect so. It may turn nasty, so be on your",
"guard. I hope we can stop him before he can cast his",
"spell!",
"Make sure you have that ring I gave you."
)
stage++
}
83 -> {
player("Okay, thanks, Zaff!")
stage++
}
84 -> {
player.inventory.add(BEACON_RING)
quest!!.setStage(player, 70)
end()
}
200 -> {
npc("Yes. You have done well, " + player.username + ". You are to be", "commended for you actions!")
stage++
}
201 -> {
player("It was all in the call of duty!")
stage++
}
202 -> {
player("What will happen with Surok now?")
stage++
}
203 -> {
npc(
"Well, when I disrupted Surok's spell, he will have been",
"sealed in the library, but we still need to keep an",
"eye on him, just in case."
)
stage++
}
204 -> {
npc("When you are ready, report back to Rat and he will", "reward you.")
stage++
}
205 -> {
player("Okay, I will.")
stage++
}
206 -> {
quest!!.setStage(player, 90)
end()
}
1000 -> options("Yes, please.", "No, thanks.").also { stage++ }
1001 -> when(buttonId){
1 -> {
end()
ContentAPI.openDialogue(player, 9679, npc)
}
2 -> {
end()
npc.openShop(player)
}
}
}
return true
}
override fun getIds(): IntArray {
return intArrayOf(546)
}
companion object {
/**
* Represents the staff item.
*/
private val STAFF = Item(11014, 1)
}
}
/**
* Represents the dialogue used to buy staves from zaff.
* @author 'Vexia
* @version 1.0
*/
inner class ZaffStaveDialogue : DialoguePlugin {
/**
* The ammount of battlestaves.
*/
private var ammount = 0
/**
* Constructs a new `ZaffBuyStavesDialogue` `Object`.
*/
constructor() {
/**
* empty.
*/
}
/**
* Constructs a new `ZaffBuyStavesDialogue` `Object`.
* @param player the player.
*/
constructor(player: Player?) : super(player) {}
override fun newInstance(player: Player?): DialoguePlugin {
return ZaffStaveDialogue(player)
}
override fun open(vararg args: Any): Boolean {
ammount = getStoreFile().getInt(player.username.toLowerCase())
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Do you have any battlestaves?")
stage = 0
return true
}
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
0 -> {
if (ammount >= maxStaffs) {
interpreter.sendDialogues(
546,
FacialExpression.HALF_GUILTY,
"I'm very sorry! I seem to be out of battlestaves at the",
"moment! I expect I'll get some more in by tomorrow,",
"though."
)
stage = 2
return true
}
interpreter.sendDialogues(
546,
FacialExpression.HALF_GUILTY,
"Battlestaves cost 8,000 gold pieces each. I have ${maxStaffs - ammount} left.",
"How many would you like to buy?"
)
stage = 1
}
1 -> end().also { ContentAPI.sendInputDialogue(player, InputType.NUMERIC, "Enter an amount:"){ value ->
ammount = getStoreFile().getInt(player.username.toLowerCase())
var amt = value as Int
if(amt > maxStaffs - ammount) amt = maxStaffs - ammount
val coinage = amt * 8000
if(!ContentAPI.inInventory(player, Items.COINS_995, coinage)){
ContentAPI.sendDialogue(player, "You can't afford that many.")
return@sendInputDialogue
}
if(amt == 0){
return@sendInputDialogue
}
if(ContentAPI.removeItem(player, Item(Items.COINS_995, coinage), Container.INVENTORY)){
ContentAPI.addItem(player, Items.BATTLESTAFF_1392, amt)
ZaffPlugin.getStoreFile()[player.username.toLowerCase()] = amt + ammount
}
} }
2 -> {
interpreter.sendDialogues(
player,
FacialExpression.HALF_GUILTY,
"Oh, okay then. I'll try again another time."
)
stage = 3
}
3 -> end()
}
return true
}
/**
* Gets the max staffs to buy.
* @return the max staffs to buy.
*/
val maxStaffs: Int
get() {
val level = player.achievementDiaryManager.getDiary(DiaryType.VARROCK).level
return when (level) {
2 -> 64
1 -> 32
0 -> 16
else -> 0
}
}
override fun getIds(): IntArray {
return intArrayOf(9679)
}
}
companion object {
/**
* The bacon ring.
*/
val BEACON_RING = Item(11014)
fun getStoreFile(): JSONObject {
return ServerStore.getArchive("daily-zaff")
}
}
}
@@ -70,7 +70,6 @@ public class ReadSignPostPlugin extends OptionHandler {
return true;
}
});
player.getPacketDispatch();
final Scenery object = (Scenery) node;
Signs sign = Signs.forId(object.getId());
if (sign == null) {
@@ -237,9 +237,8 @@ public enum BoltEffect {
*/
@SuppressWarnings("unused")
public void impact(BattleState state) {
Entity entity = state.getAttacker();
Entity victim = state.getVictim();
if (sound != null && victim != null && victim instanceof Player) {
if (sound != null && victim instanceof Player) {
sound.send(victim.asPlayer(), true);
}
if (graphics != null) {

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