interned;
+ byte[] buffer;
+ int length;
+ private boolean mutable = true;
+
+ /**
+ * @return A RSString consisting of the actual bytes in the provided string.
+ */
+ public static RSString of(String string) {
+ byte[] bytes = string.getBytes(StandardCharsets.ISO_8859_1);
+
+ RSString rs = new RSString();
+ rs.buffer = bytes;
+ rs.length = 0;
+
+ for (int i = 0; i < bytes.length; ++i) {
+ if (bytes[i] != 0) {
+ bytes[rs.length++] = bytes[i];
+ }
+ }
+
+ return rs;
+ }
+
+ /**
+ * @return A RSString that is interned and parsed.
+ */
+ public static RSString parse(String string) {
+ byte[] bytes = Objects.requireNonNull(string).replace("RuneScape", GameConfig.SERVER_NAME).getBytes();
+
+ int length = bytes.length;
+ RSString jagString = new RSString();
+ jagString.buffer = new byte[length];
+
+ int i = 0;
+ while (length > i) {
+ int ascii = bytes[i++] & 0xFF;
+ if (ascii <= 45 && ascii >= 40) {
+ if (length <= i) {
+ break;
+ }
+
+ int var7 = bytes[i++] & 0xff;
+ jagString.buffer[jagString.length++] = (byte) (-48 + var7 + 43 * (-40 + ascii));
+ } else if (ascii != 0) {
+ jagString.buffer[jagString.length++] = (byte) ascii;
+ }
+ }
+ jagString.method1576();
+ return jagString.intern();
+ }
+
+ static RSString stringCombiner(RSString[] var0) {
+ if (var0.length >= 2) {
+ return Class67.method1261(0, var0.length, var0);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ static RSString stringAnimator(int var1) {
+ try {
+ return Unsorted.method1723((byte) -117, false, var1);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "jj.C(" + var1 + ')');
+ }
+ }
+
+ public final URL toURL() throws MalformedURLException {
+ return new URL(new String(this.buffer, 0, this.length));
+ }
+
+ public final boolean equalsStringIgnoreCase(RSString other) {
+ if (other == null) {
+ return false;
+ } else if (this.length == other.length) {
+
+ for (int i = 0; i < this.length; ++i) {
+ byte var5 = this.buffer[i];
+ if (var5 >= 65 && var5 <= 90 || var5 >= -64 && var5 <= -34 && var5 != -41) {
+ var5 = (byte) (var5 + 32);
+ }
+
+ byte var6 = other.buffer[i];
+ if (65 <= var6 && var6 <= 90 || -64 <= var6 && var6 <= -34 && var6 != -41) {
+ var6 = (byte) (var6 + 32);
+ }
+
+ if (var6 != var5) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ // TODO Refactor to support regular equals method
+ public final boolean equalsString(RSString other) {
+ if (other == null) {
+ return false;
+ } else if (this == other) {
+ return true;
+ } else if (this.length == other.length) {
+
+ byte[] otherBuffer = other.buffer;
+ byte[] thisBuffer = this.buffer;
+
+ for (int i = 0; i < this.length; ++i) {
+ if (thisBuffer[i] != otherBuffer[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public final int parseInt(int radix) {
+ if (radix < 1 || radix > 36) {
+ radix = 10;
+ }
+
+ boolean negate = false;
+ boolean success = false;
+ int value = 0;
+
+ for (int i = 0; this.length > i; ++i) {
+ int currentNumber = this.buffer[i] & 0xff;
+
+ if (i == 0) {
+ if (currentNumber == '-') {
+ negate = true;
+ continue;
+ }
+
+ if (currentNumber == '+') {
+ continue;
+ }
+ }
+
+ if (currentNumber >= '0' && '9' >= currentNumber) {
+ currentNumber -= '0';
+ } else if ('A' <= currentNumber && currentNumber <= 'Z') {
+ currentNumber -= 55;
+ } else {
+ if (currentNumber < 'a' || currentNumber > 'z') {
+ throw new NumberFormatException("invalid character in number with value: " + currentNumber + " ('" + ((char) currentNumber) + "'). This string: " + toString());
+ }
+
+ currentNumber -= 87;
+ }
+
+ if (currentNumber >= radix) {
+ throw new NumberFormatException("got radix " + radix + ", but found number value " + currentNumber);
+ }
+
+ if (negate) {
+ currentNumber = -currentNumber;
+ }
+
+ int newValue = currentNumber + value * radix;
+ if (newValue / radix != value) {
+ throw new NumberFormatException("integer overflow");
+ }
+
+ value = newValue;
+ success = true;
+ }
+
+ if (success) {
+ return value;
+ } else {
+ throw new NumberFormatException("failed to parse number");
+ }
+ }
+
+ public final void drawString(Graphics g, int y, int x) {
+ String string = new String(this.buffer, 0, this.length, StandardCharsets.ISO_8859_1);
+ g.drawString(string, x, y);
+ }
+
+ final void append(RSString var1) {
+ if (this.mutable) {
+ if (var1.length + this.length > this.buffer.length) {
+ int var3;
+ for (var3 = 1; var3 < var1.length + this.length; var3 += var3) {
+ }
+
+ byte[] var4 = new byte[var3];
+ ArrayUtils.arraycopy(this.buffer, 0, var4, 0, this.length);
+ this.buffer = var4;
+ }
+
+ ArrayUtils.arraycopy(var1.buffer, 0, this.buffer, this.length, var1.length);
+ this.length += var1.length;
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ public final RSString toLowercase() {
+ RSString lower = new RSString();
+ lower.length = this.length;
+ lower.buffer = new byte[this.length];
+
+ for (int i = 0; i < this.length; ++i) {
+ byte ch = this.buffer[i];
+ if (65 <= ch && ch <= 90 || ch >= -64 && ch <= -34 && ch != -41) {
+ ch = (byte) (ch + 32);
+ }
+
+ lower.buffer[i] = ch;
+ }
+
+ return lower;
+ }
+
+ /**
+ * Returns a copy of this string with proper capitalization. Generally, this returns an all-lower string. Characters
+ * are changed to uppercase based on the following rules:
+ * - The character is the first character in the string
+ * - The character is the first non-whitespace character after a '.', '!' or '?' character
+ *
+ * Characters may be either lowercase or uppercase if the previous character is a whitespace character.
+ *
+ * @return A copy of this string with capitalization based on the rules above.
+ */
+ public final RSString properlyCapitalize() {
+ byte state = 2;
+ RSString newString = new RSString();
+ newString.length = this.length;
+ newString.buffer = new byte[this.length];
+
+ for (int i = 0; i < this.length; ++i) {
+ byte ch = this.buffer[i];
+ if ((ch < 97 || 122 < ch) && (ch < -32 || ch > -2 || ch == -9)) { // if not lowercase chars
+ if ((ch < 65 || ch > 90) && (ch < -64 || ch > -34 || ch == -41)) { // if not uppercase chars
+ if (ch != 46 && 33 != ch && ch != 63) { // if not `.`, `!` or `?`
+ if (32 == ch) { // if ' '
+ if (state != 2) {
+ state = 1;
+ }
+ } else { // if not ' '
+ state = 1;
+ }
+ } else { // if `.`, `!` or `?`
+ state = 2;
+ }
+ } else { // if uppercase char
+ if (0 == state) {
+ ch = (byte) (ch + 32);
+ }
+
+ state = 0;
+ }
+ } else {
+ if (state == 2) {
+ ch = (byte) (ch - 32);
+ }
+
+ state = 0;
+ }
+
+ newString.buffer[i] = ch;
+ }
+
+ return newString;
+ }
+
+ public final long hash() {
+ long hash = 0L;
+ for (int i = 0; i < this.length; ++i) {
+ hash = (long) (this.buffer[i] & 0xff) + (hash << 5) - hash;
+ }
+
+ return hash;
+ }
+
+ public final int length() {
+ return this.length;
+ }
+
+ public final RSString method1542(RSString var2, int var3, int var4) {
+ if (!this.mutable) {
+ throw new IllegalArgumentException();
+ } else if (0 <= var3 && var3 <= var4 && var2.length >= var4) {
+ if (this.length + (var4 - var3) > this.buffer.length) {
+ int var5;
+ for (var5 = 1; var5 < this.length + var2.length; var5 += var5) {
+ }
+
+ byte[] var6 = new byte[var5];
+ ArrayUtils.arraycopy(this.buffer, 0, var6, 0, this.length);
+ this.buffer = var6;
+ }
+
+ ArrayUtils.arraycopy(var2.buffer, var3, this.buffer, this.length, -var3 + var4);
+ this.length += var4 + -var3;
+ return this;
+ } else {
+ throw new IllegalArgumentException();
+ }
+ }
+
+ final boolean isInteger() {
+ return this.isInteger(10);
+ }
+
+ final RSString method1544(boolean var1) {
+ try {
+ RSString var2 = new RSString();
+ var2.length = this.length;
+ var2.buffer = new byte[var2.length];
+ if (var1) {
+ for (int var3 = 0; this.length > var3; ++var3) {
+ var2.buffer[this.length - var3 + -1] = this.buffer[var3];
+ }
+
+ return var2;
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.FB(" + var1 + ')');
+ }
+ }
+
+ final RSString longToRSString() {
+ try {
+ RSString var2 = new RSString();
+ var2.length = this.length;
+ var2.buffer = new byte[this.length];
+ boolean var3 = true;
+ int var4 = 0;
+
+ for (; var4 < this.length; ++var4) {
+ byte var5 = this.buffer[var4];
+ if (var5 == 95) {
+ var3 = true;
+ var2.buffer[var4] = 32;
+ } else if (97 <= var5 && var5 <= 122 && var3) {
+ var3 = false;
+ var2.buffer[var4] = (byte) (-32 + var5);
+ } else {
+ var2.buffer[var4] = var5;
+ var3 = false;
+ }
+ }
+
+ return var2;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.G(" + (byte) -50 + ')');
+ }
+ }
+
+ final int method1546(RSString var2) {
+ int var3 = 0;
+ int var4 = 0;
+ int var6 = var2.length;
+ int var5 = this.length;
+ int var7 = this.length;
+ int var8 = var2.length;
+ int var9 = 0;
+ int var10 = 0;
+
+ while (var5 != 0 && var6 != 0) {
+ if (var3 == 156 || var3 == 230) {
+ var3 = 101;
+ } else if (140 == var3 || var3 == 198) {
+ var3 = 69;
+ } else if (var3 == 223) {
+ var3 = 115;
+ } else {
+ var3 = this.buffer[var9] & 0xFF;
+ ++var9;
+ }
+
+ if (Unsorted.method2103(var3, -116)) {
+ ++var7;
+ } else {
+ --var5;
+ }
+
+ if (var4 == 156 || 230 == var4) {
+ var4 = 101;
+ } else if (var4 == 140 || var4 == 198) {
+ var4 = 69;
+ } else if (223 == var4) {
+ var4 = 115;
+ } else {
+ var4 = 255 & var2.buffer[var10];
+ ++var10;
+ }
+
+ if (Unsorted.method2103(var4, -86)) {
+ ++var8;
+ } else {
+ --var6;
+ }
+
+ if (Class158.anIntArray2004[var4] > Class158.anIntArray2004[var3]) {
+ return -1;
+ }
+
+ if (Class158.anIntArray2004[var3] > Class158.anIntArray2004[var4]) {
+ return 1;
+ }
+ }
+
+ return var8 <= var7 ? (var7 > var8 ? 1 : 0) : -1;
+ }
+
+ final URL method1547(URL var1) throws MalformedURLException {
+ try {
+
+ return new URL(var1, new String(this.buffer, 0, this.length));
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.EB(" + (var1 != null ? "{...}" : "null") + ',' + true + ')');
+ }
+ }
+
+ final RSString method1548(int var2) {
+ try {
+ if (var2 > 0 && var2 <= 255) {
+ RSString var3 = new RSString();
+ var3.buffer = new byte[1 + this.length];
+ var3.length = this.length + 1;
+ ArrayUtils.arraycopy(this.buffer, 0, var3.buffer, 0, this.length);
+ var3.buffer[this.length] = (byte) var2;
+ return var3;
+ } else {
+ throw new IllegalArgumentException("invalid char");
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.OA(" + false + ',' + var2 + ')');
+ }
+ }
+
+ final boolean endsWith(RSString var2) {
+ if (var2.length > this.length) {
+ return false;
+ } else {
+ int var3 = -var2.length + this.length;
+
+ for (int var4 = 0; var4 < var2.length; ++var4) {
+ if (this.buffer[var3 + var4] != var2.buffer[var4]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ final int indexOf(RSString var1, int var2) {
+ try {
+ return var2 <= 49 ? -20 : this.method1566(var1, 0);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.A(" + (var1 != null ? "{...}" : "null") + ',' + var2 + ')');
+ }
+ }
+
+ public final int parseInt() {
+ return this.parseInt(10);
+ }
+
+ final void method1553(int var1) {
+ try {
+ if (!this.mutable) {
+ throw new IllegalArgumentException();
+ } else if (var1 < 0) {
+ throw new IllegalArgumentException();
+ } else {
+ int var3;
+ if (this.buffer.length < var1) {
+ for (var3 = 1; var1 > var3; var3 += var3) {
+ }
+
+ byte[] var4 = new byte[var3];
+ ArrayUtils.arraycopy(this.buffer, 0, var4, 0, this.length);
+ this.buffer = var4;
+ }
+
+ for (var3 = this.length; var1 > var3; ++var3) {
+ this.buffer[var3] = 32;
+ }
+
+ this.length = var1;
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "na.RA(" + var1 + ',' + false + ')');
+ }
+ }
+
+ public final String toString() {
+ if (buffer == null) {
+ throw new RuntimeException();
+ }
+ return new String(buffer);
+ }
+
+ final void method1554(Applet var2) throws Throwable {
+ try {
+ String var3 = new String(this.buffer, 0, this.length);
+ Class42.method1057(var2, var3);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.AA(" + true + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ final int method1555(int var1, int var2) {
+ try {
+ byte var4 = (byte) var1;
+ for (int var5 = var2; this.length > var5; ++var5) {
+ if (this.buffer[var5] == var4) {
+ return var5;
+ }
+ }
+
+ return -1;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.NA(" + var1 + ',' + var2 + ',' + 1536 + ')');
+ }
+ }
+
+ final RSString substring(int start) {
+ return this.substring(start, this.length, (byte) -74 ^ -74);
+ }
+
+ // TODO Why is `dstpos` a thing? what good does it serve?
+ public final RSString substring(int start, int end, int dstpos) {
+ RSString subs = new RSString();
+ subs.length = end - start;
+ subs.buffer = new byte[end - start];
+ ArrayUtils.arraycopy(this.buffer, start, subs.buffer, dstpos, subs.length);
+ return subs;
+ }
+
+ final boolean startsWith(RSString other) {
+ if (other.length > this.length) {
+ return false;
+ }
+
+ for (int i = 0; i < other.length; ++i) {
+ if (other.buffer[i] != this.buffer[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public final boolean equals(Object var1) {
+ try {
+ if (var1 instanceof RSString) {
+ return this.equalsString((RSString) var1);
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "na.equals(" + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ final int method1559(RSString var1) {
+ try {
+
+ int var3;
+ if (var1.length < this.length) {
+ var3 = var1.length;
+ } else {
+ var3 = this.length;
+ }
+
+ for (int var4 = 0; var3 > var4; ++var4) {
+ if ((255 & this.buffer[var4]) < (var1.buffer[var4] & 0xFF)) {
+ return -1;
+ }
+
+ if ((this.buffer[var4] & 0xFF) > (var1.buffer[var4] & 0xFF)) {
+ return 1;
+ }
+ }
+
+ if (var1.length > this.length) {
+ return -1;
+ } else if (this.length <= var1.length) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "na.QA(" + (var1 != null ? "{...}" : "null") + ',' + -1 + ')');
+ }
+ }
+
+ final RSString method1560(RSString var1, RSString var3) {
+ try {
+ int var4 = this.length;
+ int var5 = var1.length - var3.length;
+ int var6 = 0;
+
+ while (true) {
+ int var7 = this.method1566(var3, var6);
+ if (0 > var7) {
+ var6 = 0;
+ RSString var10 = Unsorted.emptyString(var4);
+
+ while (true) {
+ int var8 = this.method1566(var3, var6);
+ if (0 > var8) {
+ while (this.length > var6) {
+ Objects.requireNonNull(var10).appendCharacter(255 & this.buffer[var6++]);
+ }
+
+ if (false) {
+ this.method1567(-5, (byte) -91);
+ }
+
+ return var10;
+ }
+
+ while (var6 < var8) {
+ Objects.requireNonNull(var10).appendCharacter(this.buffer[var6++] & 0xFF);
+ }
+
+ Objects.requireNonNull(var10).append(var1);
+ var6 += var3.length;
+ }
+ }
+
+ var6 = var7 - -var3.length;
+ var4 += var5;
+ }
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "na.IA(" + (var1 != null ? "{...}" : "null") + ',' + true + ',' + (var3 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public final int hashCode() {
+ try {
+ return this.method1574();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "na.hashCode()");
+ }
+ }
+
+ private boolean isInteger(int radix) {
+ if (radix < 1 || radix > 36) {
+ radix = 10;
+ }
+
+ boolean success = false;
+ boolean negate = false;
+ int value = 0;
+
+ for (int i = 0; i < this.length; ++i) {
+ int current = this.buffer[i] & 0xFF;
+ if (0 == i) {
+ if (current == 45) {
+ negate = true;
+ continue;
+ }
+
+ if (current == 43) {
+ continue;
+ }
+ }
+
+ if (current >= 48 && current <= 57) {
+ current -= 48;
+ } else if (current >= 65 && current <= 90) {
+ current -= 55;
+ } else {
+ if (97 > current || current > 122) {
+ return false;
+ }
+
+ current -= 87;
+ }
+
+ if (radix <= current) {
+ return false;
+ }
+
+ if (negate) {
+ current = -current;
+ }
+
+ int newValue = current + radix * value;
+ if (newValue / radix != value) {
+ return false;
+ }
+
+ value = newValue;
+ success = true;
+ }
+
+ return success;
+ }
+
+ final boolean method1562(byte var1, RSString var2) {
+ try {
+ if (this.length < var2.length) {
+ return false;
+ } else {
+ if (var1 != -32) {
+ this.length = 13;
+ }
+
+ for (int var3 = 0; var2.length > var3; ++var3) {
+ byte var4 = this.buffer[var3];
+ byte var5 = var2.buffer[var3];
+ if (var5 >= 65 && var5 <= 90 || -64 <= var5 && -34 >= var5 && -41 != var5) {
+ var5 = (byte) (var5 + 32);
+ }
+
+ if (65 <= var4 && var4 <= 90 || var4 >= -64 && -34 >= var4 && var4 != -41) {
+ var4 = (byte) (var4 + 32);
+ }
+
+ if (var5 != var4) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.HB(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ final RSString method1563(int var1) {
+ try {
+ if (var1 <= 86) {
+ this.trim(117);
+ }
+
+ return this;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "na.K(" + var1 + ')');
+ }
+ }
+
+ final RSString trim(int var1) {
+ try {
+ if (var1 != 1) {
+ Unsorted.method1535(null, null, 23, 68, 126, false, false);
+ }
+
+ int var2;
+ for (var2 = 0; var2 < this.length && (0 <= this.buffer[var2] && 32 >= this.buffer[var2] || (255 & this.buffer[var2]) == 160); ++var2) {
+ }
+
+ int var3;
+ for (var3 = this.length; var3 > var2 && (this.buffer[var3 - 1] >= 0 && this.buffer[var3 - 1] <= 32 || (255 & this.buffer[var3 + -1]) == 160); --var3) {
+ }
+
+ if (var2 == 0 && var3 == this.length) {
+ return this;
+ } else {
+ RSString var4 = new RSString();
+ var4.length = var3 + -var2;
+ var4.buffer = new byte[var4.length];
+
+ if (var4.length >= 0) System.arraycopy(this.buffer, var2, var4.buffer, 0, var4.length);
+
+ return var4;
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.KA(" + var1 + ')');
+ }
+ }
+
+ final RSString method1565() {
+ try {
+ byte var4 = (byte) 47;
+ RSString var6 = new RSString();
+ byte var5 = (byte) 32;
+ var6.length = this.length;
+ var6.buffer = new byte[this.length];
+
+ for (int var7 = 0; var7 < this.length; ++var7) {
+ byte var8 = this.buffer[var7];
+ if (var4 == var8) {
+ var6.buffer[var7] = var5;
+ } else {
+ var6.buffer[var7] = var8;
+ }
+ }
+
+ return var6;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "na.HA(" + 32 + ',' + 40 + ',' + 47 + ')');
+ }
+ }
+
+ final int method1566(RSString var1, int var2) {
+ try {
+ int var4 = var1.length;
+ if (var2 >= this.length) {
+ return var4 == 0 ? this.length : -1;
+ } else {
+ if (var2 < 0) {
+ var2 = 0;
+ }
+
+ if (var4 == 0) {
+ return var2;
+ } else {
+ int var7 = this.length - var4;
+ byte[] var5 = var1.buffer;
+ byte var6 = var5[0];
+ int var8 = var2;
+
+ while (var7 >= var8) {
+ if (this.buffer[var8] != var6) {
+ do {
+ ++var8;
+ if (var8 > var7) {
+ return -1;
+ }
+ } while (this.buffer[var8] != var6);
+ }
+
+ boolean var9 = true;
+ int var10 = 1 + var8;
+ int var11 = 1;
+
+ while (true) {
+ if (var11 < var4) {
+ if (this.buffer[var10] == var5[var11]) {
+ ++var10;
+ ++var11;
+ continue;
+ }
+
+ var9 = false;
+ }
+
+ if (var9) {
+ return var8;
+ }
+
+ ++var8;
+ break;
+ }
+ }
+
+ return -1;
+ }
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "na.CB(" + (var1 != null ? "{...}" : "null") + ',' + var2 + ',' + -1 + ')');
+ }
+ }
+
+ final RSString[] method1567(int var1, byte var2) {
+ try {
+ int var3 = 0;
+
+ for (int var4 = 0; var4 < this.length; ++var4) {
+ if (this.buffer[var4] == var1) {
+ ++var3;
+ }
+ }
+
+ RSString[] var11 = new RSString[1 + var3];
+ if (var3 == 0) {
+ var11[0] = this;
+ } else {
+ int var5 = 0;
+ int var6 = 0;
+
+ for (int var7 = 0; var3 > var7; ++var7) {
+ int var9;
+ for (var9 = 0; this.buffer[var9 + var6] != var1; ++var9) {
+ }
+
+ var11[var5++] = this.substring(var6, var6 - -var9, 0);
+ var6 += 1 + var9;
+ }
+
+ var11[var3] = this.substring(var6, this.length, 0);
+ }
+ return var11;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "na.GA(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final byte[] method1568() {
+ try {
+ byte[] var2 = new byte[this.length];
+ ArrayUtils.arraycopy(this.buffer, 0, var2, 0, this.length);
+ return var2;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "na.H(" + 0 + ')');
+ }
+ }
+
+ final int charAt(int var1, byte var2) {
+ try {
+ return this.buffer[var1] & 0xFF;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.SA(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public final RSString intern() {
+ final long hash = this.hash();
+ synchronized (RSString.class) {
+ LinkableRSString linkable;
+ if (interned == null) {
+ interned = new HashTable<>(4096);
+ } else {
+ for (linkable = interned.get(hash); null != linkable; linkable = interned.nextInBucket()) {
+ if (this.equalsString(linkable.value)) {
+ return linkable.value;
+ }
+ }
+ }
+
+ linkable = new LinkableRSString();
+
+ linkable.value = this;
+ mutable = false;
+ interned.put(hash, linkable);
+ }
+ return this;
+ }
+
+ final void appendCharacter(int character) {
+ if (0 < character && character <= 255) {
+ if (this.mutable) {
+ if (this.length == this.buffer.length) {
+ // TODO Is this really just making a new buffer with the size + 1? Why do we have to loop for that?
+ int newBufferSize;
+ for (newBufferSize = 1; this.length >= newBufferSize; newBufferSize += newBufferSize) {
+ }
+
+ byte[] newBuffer = new byte[newBufferSize];
+ ArrayUtils.arraycopy(this.buffer, 0, newBuffer, 0, this.length);
+ this.buffer = newBuffer;
+ }
+
+ this.buffer[this.length++] = (byte) character;
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } else {
+ throw new IllegalArgumentException("invalid char:" + character);
+ }
+ }
+
+ final RSString getParamValue(Applet applet) {
+ String string = new String(this.buffer, 0, this.length);
+ String paramValue = applet.getParameter(string);
+ return null == paramValue ? null : of(paramValue);
+ }
+
+ final int method1574() {
+ try {
+ int var2 = 0;
+
+ for (int var3 = 0; var3 < this.length; ++var3) {
+ var2 = (255 & this.buffer[var3]) + -var2 + (var2 << 5);
+ }
+
+ return var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.J(" + false + ')');
+ }
+ }
+
+ public final int method1575(FontMetrics var2) {
+ try {
+ String var3;
+ var3 = new String(this.buffer, 0, this.length, StandardCharsets.ISO_8859_1);
+
+ return var2.stringWidth(var3);
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.V(" + -21018 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ final RSString method1576() {
+ try {
+ if (this.mutable) {
+
+ if (this.buffer.length != this.length) {
+ byte[] var2 = new byte[this.length];
+ ArrayUtils.arraycopy(this.buffer, 0, var2, 0, this.length);
+ this.buffer = var2;
+ }
+
+ return this;
+ } else {
+ throw new IllegalArgumentException();
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "na.PA(" + (byte) 90 + ')');
+ }
+ }
+
+ final Object method1577(Applet var2) throws Throwable {
+ try {
+ String var3 = new String(this.buffer, 0, this.length);
+ /*Object var4 = Class42.method1055(var3, var2);
+ if (var4 instanceof String) {
+ byte[] var5 = ((String) var4).getBytes();
+ var4 = Class3_Sub13_Sub3.method178(var5, var5.length, 0);
+ }
+*/
+ return null;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "na.JA(" + -1857 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public final long toLong() {
+ long var2 = 0L;
+ for (int var4 = 0; var4 < this.length && var4 < 12; ++var4) {
+ byte var5 = this.buffer[var4];
+ var2 *= 37L;
+ if (65 <= var5 && 90 >= var5) {
+ var2 += -65 + 1 + var5;
+ } else if (var5 >= 97 && 122 >= var5) {
+ var2 += -97 + var5 + 1;
+ } else if (var5 >= 48 && var5 <= 57) {
+ var2 += -48 + var5 + 27;
+ }
+ }
+
+ while (var2 % 37L == 0 && var2 != 0L) {
+ var2 /= 37L;
+ }
+
+ return var2;
+ }
+
+ final RSString method1579() {
+ try {
+ RSString var2 = Unsorted.method1052(this.toLong());
+ return null == var2 ? TextCore.aString_1760 : var2;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "na.Q(" + -17 + ')');
+ }
+ }
+
+ public final int method1580(byte[] var2, int var3, int var5) {
+ try {
+ ArrayUtils.arraycopy(this.buffer, 0, var2, var3, var5);
+
+ return var5;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "na.LA(" + true + ',' + (var2 != null ? "{...}" : "null") + ',' + var3 + ',' + 0 + ',' + var5 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/RandomAccessFileWrapper.java b/Client/src/main/java/org/runite/client/RandomAccessFileWrapper.java
new file mode 100644
index 000000000..aada186d0
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/RandomAccessFileWrapper.java
@@ -0,0 +1,84 @@
+package org.runite.client;
+
+import java.io.EOFException;
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+public final class RandomAccessFileWrapper {
+
+ private final long limit;
+ private final File path;
+ private RandomAccessFile raf;
+ private long pos;
+
+
+ public final void seek(long pos) throws IOException {
+ this.raf.seek(pos);
+ this.pos = pos;
+ }
+
+ protected void finalize() throws Throwable {
+ if (this.raf != null) {
+ System.out.println("Warning! fileondisk " + this.path + " not closed correctly using close(). Auto-closing instead. ");
+ this.close();
+ }
+ }
+
+ public final void write(byte[] buffer, int length, int offset) throws IOException {
+ if (this.limit < this.pos + (long) length) {
+ this.raf.seek(1L + this.limit);
+ this.raf.write(1);
+ throw new EOFException();
+ } else {
+ this.raf.write(buffer, offset, length);
+ this.pos += length;
+ }
+ }
+
+ public final int read(byte[] buffer, int offset, int length, int minBytesRead) throws IOException {
+ int bytesRead = this.raf.read(buffer, offset, length);
+ if (bytesRead > minBytesRead) {
+ this.pos += bytesRead;
+ }
+
+ return bytesRead;
+ }
+
+ public final void close() throws IOException {
+ if (this.raf != null) {
+ this.raf.close();
+ this.raf = null;
+ }
+ }
+
+ public final long getLength() throws IOException {
+ return this.raf.length();
+ }
+
+ public final File getPath() {
+ return this.path;
+ }
+
+ public RandomAccessFileWrapper(File path, String mode, long limit) throws IOException {
+ if (limit == -1) {
+ limit = Long.MAX_VALUE;
+ }
+
+ if (path.length() >= limit) {
+ path.delete();
+ }
+
+ this.raf = new RandomAccessFile(path, mode);
+ this.path = path;
+ this.limit = limit;
+ this.pos = 0L;
+ int var5 = this.raf.read();
+ if (var5 != -1 && !mode.equals("r")) {
+ this.raf.seek(0L);
+ this.raf.write(var5);
+ }
+
+ this.raf.seek(0L);
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/RenderAnimationDefinition.java b/Client/src/main/java/org/runite/client/RenderAnimationDefinition.java
new file mode 100644
index 000000000..998ecb888
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/RenderAnimationDefinition.java
@@ -0,0 +1,330 @@
+package org.runite.client;
+
+import org.rs09.client.data.ReferenceCache;
+
+final class RenderAnimationDefinition {
+
+ static int[] anIntArray356 = new int[]{1, 0, -1, 0};
+ static ReferenceCache aReferenceCache_1955 = new ReferenceCache(64);
+ int yaw_max_speed = 0;
+ int[][] equipment_transforms;
+ int movement_acceleration = -1;
+ static volatile int anInt362 = 0;
+ int walk_follow_cw_turn_anim = -1;
+ int standing_ccw_turn = -1;
+ int stand_animation = -1;
+ int yaw_acceleration = 0;
+ int roll_max_speed = 0;
+ int pitch_target_angle = 0;
+ int slow_walk_follow_full_turn_anim = -1;
+ int run_follow_ccw_turn_anim = -1;
+ int run_follow_cw_turn_anim = -1;
+ static RSString aString_378 = null;
+ int slow_walk_follow_cw_turn_anim = -1;
+ int hill_height = 0;
+ int walk_animation = -1;
+ static byte[][][] aByteArrayArrayArray383;
+ static int anInt384 = 0;
+ int run_follow_full_turn_anim = -1;
+ int roll_acceleration = 0;
+ int walk_follow_full_turn_anim = -1;
+ int walk_follow_ccw_turn_anim = -1;
+ int run_anim = -1;
+ int hill_width = 0;
+ static int anInt396;
+ int slow_walk_anim = -1;
+ int pitch_max_speed = 0;
+ int roll_target_angle = 0;
+ static boolean aBoolean402 = false;
+ int pitch_acceleration = 0;
+ int slow_walk_follow_ccw_turn_anim = -1;
+ int standing_cw_turn = -1;
+
+ final void method899() {
+ try {
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ck.B(" + 96 + ')');
+ }
+ }
+
+ static void method900(Entity var0) {
+ try {
+ var0.aBoolean2810 = false;
+ SequenceDefinition var2;
+ if (-1 != var0.anInt2764) {
+ var2 = SequenceDefinition.getAnimationDefinition(var0.anInt2764);
+ if (null == var2.frames) {
+ var0.anInt2764 = -1;
+ } else {
+ ++var0.anInt2802;
+ if (var0.anInt2813 < var2.frames.length && var0.anInt2802 > var2.duration[var0.anInt2813]) {
+ var0.anInt2802 = 1;
+ ++var0.anInt2813;
+ ++var0.anInt2793;
+ Unsorted.method1470(var0.yAxis, var2, var0.xAxis, var0 == Class102.player, var0.anInt2813);
+ }
+
+ if (var2.frames.length <= var0.anInt2813) {
+ var0.anInt2813 = 0;
+ var0.anInt2802 = 0;
+ Unsorted.method1470(var0.yAxis, var2, var0.xAxis, Class102.player == var0, var0.anInt2813);
+ }
+
+ var0.anInt2793 = var0.anInt2813 - -1;
+ if (var2.frames.length <= var0.anInt2793) {
+ var0.anInt2793 = 0;
+ }
+ }
+ }
+
+ int var6;
+ if (var0.anInt2842 != -1 && var0.anInt2759 <= Class44.anInt719) {
+ var6 = GraphicDefinition.getGraphicDefinition(var0.anInt2842).anInt542;
+ if (var6 == -1) {
+ var0.anInt2842 = -1;
+ } else {
+ SequenceDefinition var3 = SequenceDefinition.getAnimationDefinition(var6);
+ if (var3.frames == null) {
+ var0.anInt2842 = -1;
+ } else {
+ if (0 > var0.anInt2805) {
+ var0.anInt2805 = 0;
+ Unsorted.method1470(var0.yAxis, var3, var0.xAxis, Class102.player == var0, 0);
+ }
+
+ ++var0.anInt2761;
+ if (var0.anInt2805 < var3.frames.length && var0.anInt2761 > var3.duration[var0.anInt2805]) {
+ ++var0.anInt2805;
+ var0.anInt2761 = 1;
+ Unsorted.method1470(var0.yAxis, var3, var0.xAxis, Class102.player == var0, var0.anInt2805);
+ }
+
+ if (var0.anInt2805 >= var3.frames.length) {
+ var0.anInt2842 = -1;
+ }
+
+ var0.anInt2826 = var0.anInt2805 - -1;
+ if (var0.anInt2826 >= var3.frames.length) {
+ var0.anInt2826 = -1;
+ }
+ }
+ }
+ }
+
+ if (var0.anInt2771 != -1 && var0.anInt2828 <= 1) {
+ var2 = SequenceDefinition.getAnimationDefinition(var0.anInt2771);
+ if (var2.resetWhenWalk == 1 && var0.anInt2811 > 0 && var0.anInt2800 <= Class44.anInt719 && Class44.anInt719 > var0.anInt2790) {
+ var0.anInt2828 = 1;
+ return;
+ }
+ }
+
+ if (var0.anInt2771 != -1 && var0.anInt2828 == 0) {
+ var2 = SequenceDefinition.getAnimationDefinition(var0.anInt2771);
+ if (var2.frames == null) {
+ var0.anInt2771 = -1;
+ } else {
+ ++var0.anInt2760;
+ if (var2.frames.length > var0.anInt2832 && var0.anInt2760 > var2.duration[var0.anInt2832]) {
+ var0.anInt2760 = 1;
+ ++var0.anInt2832;
+ Unsorted.method1470(var0.yAxis, var2, var0.xAxis, var0 == Class102.player, var0.anInt2832);
+ }
+
+ if (var2.frames.length <= var0.anInt2832) {
+ var0.anInt2832 -= var2.anInt1865;
+ ++var0.anInt2773;
+ if (var2.maxLoops > var0.anInt2773) {
+ if (var0.anInt2832 >= 0 && var0.anInt2832 < var2.frames.length) {
+ Unsorted.method1470(var0.yAxis, var2, var0.xAxis, Class102.player == var0, var0.anInt2832);
+ } else {
+ var0.anInt2771 = -1;
+ }
+ } else {
+ var0.anInt2771 = -1;
+ }
+ }
+
+ var0.anInt2776 = var0.anInt2832 + 1;
+ if (var0.anInt2776 >= var2.frames.length) {
+ var0.anInt2776 -= var2.anInt1865;
+ if (var2.maxLoops > var0.anInt2773 + 1) {
+ if (0 > var0.anInt2776 || var0.anInt2776 >= var2.frames.length) {
+ var0.anInt2776 = -1;
+ }
+ } else {
+ var0.anInt2776 = -1;
+ }
+ }
+
+ var0.aBoolean2810 = var2.aBoolean1859;
+ }
+ }
+
+ if (0 < var0.anInt2828) {
+ --var0.anInt2828;
+ }
+
+ for (var6 = 0; var0.aClass145Array2809.length > var6; ++var6) {
+ Class145 var7 = var0.aClass145Array2809[var6];
+ if (null != var7) {
+ if (var7.anInt1900 <= 0) {
+ SequenceDefinition var4 = SequenceDefinition.getAnimationDefinition(var7.animationId);
+ if (var4.frames == null) {
+ var0.aClass145Array2809[var6] = null;
+ } else {
+ ++var7.anInt1897;
+ if (var7.anInt1893 < var4.frames.length && var7.anInt1897 > var4.duration[var7.anInt1893]) {
+ ++var7.anInt1893;
+ var7.anInt1897 = 1;
+ Unsorted.method1470(var0.yAxis, var4, var0.xAxis, var0 == Class102.player, var7.anInt1893);
+ }
+
+ if (var7.anInt1893 >= var4.frames.length) {
+ ++var7.anInt1894;
+ var7.anInt1893 -= var4.anInt1865;
+ if (var4.maxLoops > var7.anInt1894) {
+ if (var7.anInt1893 >= 0 && var4.frames.length > var7.anInt1893) {
+ Unsorted.method1470(var0.yAxis, var4, var0.xAxis, Class102.player == var0, var7.anInt1893);
+ } else {
+ var0.aClass145Array2809[var6] = null;
+ }
+ } else {
+ var0.aClass145Array2809[var6] = null;
+ }
+ }
+
+ var7.anInt1891 = 1 + var7.anInt1893;
+ if (var4.frames.length <= var7.anInt1891) {
+ var7.anInt1891 -= var4.anInt1865;
+ if (1 + var7.anInt1894 < var4.maxLoops) {
+ if (var7.anInt1891 < 0 || var4.frames.length <= var7.anInt1891) {
+ var7.anInt1891 = -1;
+ }
+ } else {
+ var7.anInt1891 = -1;
+ }
+ }
+ }
+ } else {
+ --var7.anInt1900;
+ }
+ }
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ck.F(" + (var0 != null ? "{...}" : "null") + ',' + -11973 + ')');
+ }
+ }
+
+ final void parse(DataBuffer buffer) {
+ try {
+
+ while (true) {
+ int opcode = buffer.readUnsignedByte();
+ if (opcode == 0) {
+ return;
+ }
+
+ this.parseOpcode(opcode, buffer);
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ck.H(" + -1 + ',' + (buffer != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ private void parseOpcode(int opcode, DataBuffer buffer) {
+ try {
+ if (opcode == 1) {
+ this.stand_animation = buffer.readUnsignedShort();
+ this.walk_animation = buffer.readUnsignedShort();
+ if (this.walk_animation == 65535) {
+ this.walk_animation = -1;
+ }
+
+ if (65535 == this.stand_animation) {
+ this.stand_animation = -1;
+ }
+ } else if (opcode == 2) {
+ this.slow_walk_anim = buffer.readUnsignedShort();
+ } else if (opcode == 3) {
+ this.slow_walk_follow_full_turn_anim = buffer.readUnsignedShort();
+ } else if (4 == opcode) {
+ this.slow_walk_follow_ccw_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 5) {
+ this.slow_walk_follow_cw_turn_anim = buffer.readUnsignedShort();
+ } else if (6 == opcode) {
+ this.run_anim = buffer.readUnsignedShort();
+ } else if (7 == opcode) {
+ this.run_follow_full_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 8) {
+ this.run_follow_ccw_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 9) {
+ this.run_follow_cw_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 26) {
+ this.hill_width = (short) (4 * buffer.readUnsignedByte());
+ this.hill_height = (short) (4 * buffer.readUnsignedByte());
+ } else if (opcode == 27) {
+ if (this.equipment_transforms == null) {
+ this.equipment_transforms = new int[12][];
+ }
+
+ int bodyID = buffer.readUnsignedByte();
+ this.equipment_transforms[bodyID] = new int[6];
+
+ for (int type = 0; type < 6; ++type) {
+
+ /*
+ * 0 -Rotate X
+ * 1 - Rotate Y
+ * 2 - Rotate Z
+ * 3 - Translate X
+ * 4 - Translate Y
+ * 5 - Translate Z
+ */
+
+ this.equipment_transforms[bodyID][type] = buffer.readSignedShort();
+ }
+ } else if (opcode == 29) {
+ this.yaw_acceleration = buffer.readUnsignedByte();
+ } else if (opcode == 30) {
+ this.yaw_max_speed = buffer.readUnsignedShort();
+ } else if (opcode == 31) {
+ this.roll_acceleration = buffer.readUnsignedByte();
+ } else if (32 == opcode) {
+ this.roll_max_speed = buffer.readUnsignedShort();
+ } else if (33 == opcode) {
+ this.roll_target_angle = buffer.readSignedShort();
+ } else if (34 == opcode) {
+ this.pitch_acceleration = buffer.readUnsignedByte();
+ } else if (opcode == 35) {
+ this.pitch_max_speed = buffer.readUnsignedShort();
+ } else if (opcode == 36) {
+ this.pitch_target_angle = buffer.readSignedShort();
+ } else if (opcode == 37) {
+ this.movement_acceleration = buffer.readUnsignedByte();
+ } else if (opcode == 38) {
+ this.standing_ccw_turn = buffer.readUnsignedShort();
+ } else if (39 == opcode) {
+ this.standing_cw_turn = buffer.readUnsignedShort();
+ } else if (opcode == 40) {
+ this.walk_follow_full_turn_anim = buffer.readUnsignedShort();
+ } else if (41 == opcode) {
+ this.walk_follow_ccw_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 42) {
+ this.walk_follow_cw_turn_anim = buffer.readUnsignedShort();
+ } else if (opcode == 43) {
+ buffer.readUnsignedShort();
+ } else if (opcode == 44) {
+ buffer.readUnsignedShort();
+ } else if (opcode == 45) {
+ buffer.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "ck.E(" + opcode + ',' + (byte) -106 + ',' + (buffer != null ? "{...}" : "null") + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/ResourceRequest.java b/Client/src/main/java/org/runite/client/ResourceRequest.java
new file mode 100644
index 000000000..d492172d8
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/ResourceRequest.java
@@ -0,0 +1,15 @@
+package org.runite.client;
+
+import org.rs09.client.Node;
+
+abstract class ResourceRequest extends Node {
+
+ boolean priority;
+ boolean aBoolean3635;
+ volatile boolean waiting = true;
+
+ abstract int getCompletion();
+
+ abstract byte[] getData();
+
+}
diff --git a/Client/src/main/java/org/runite/client/Scenery.java b/Client/src/main/java/org/runite/client/Scenery.java
new file mode 100644
index 000000000..2e0d1b5bf
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Scenery.java
@@ -0,0 +1,965 @@
+package org.runite.client;
+
+import org.rs09.client.Linkable;
+import java.util.Objects;
+
+final class Scenery extends Linkable {
+ static LinkedList sceneryList = new LinkedList();
+ static int[] anIntArray2386 = new int[]{1, -1, -1, 1};
+
+ static int anInt2249;
+ static int anInt2251;
+ int y;
+ int plane;
+ int original_type;
+ int original_id;
+ int rotation;
+ int original_rotation;
+ int anInt2259 = -1;
+ int anInt2261 = 0;
+ int type;
+ int typemask;
+ int x;
+ int object_id;
+
+
+ static void initializeScene(int renderDistance, boolean var4) {
+ Unsorted.width1234 = 104;
+ TextureOperation17.height3179 = 104;
+ TextureOperation8.renderDistanceTiles = renderDistance;
+ Unsorted.aTileDataArrayArrayArray4070 = new TileData[4][Unsorted.width1234][TextureOperation17.height3179];
+ Class58.anIntArrayArrayArray914 = new int[4][Unsorted.width1234 + 1][TextureOperation17.height3179 + 1];
+ if (HDToolKit.highDetail) {
+ Client.aClass3_Sub11ArrayArray2199 = new Class3_Sub11[4][];
+ }
+
+ if (var4) {
+ Class166.aTileDataArrayArrayArray2065 = new TileData[1][Unsorted.width1234][TextureOperation17.height3179];
+ TextureOperation16.anIntArrayArray3115 = new int[Unsorted.width1234][TextureOperation17.height3179];
+ Unsorted.anIntArrayArrayArray3605 = new int[1][Unsorted.width1234 + 1][TextureOperation17.height3179 + 1];
+ if (HDToolKit.highDetail) {
+ TextureOperation32.aClass3_Sub11ArrayArray3346 = new Class3_Sub11[1][];
+ }
+ } else {
+ Class166.aTileDataArrayArrayArray2065 = null;
+ TextureOperation16.anIntArrayArray3115 = null;
+ Unsorted.anIntArrayArrayArray3605 = null;
+ TextureOperation32.aClass3_Sub11ArrayArray3346 = null;
+ }
+
+ Class167.method2264(false);
+ Class3_Sub28_Sub8.aClass113Array3610 = new Class113[500];
+ anInt2249 = 0;
+ Class145.aClass113Array1895 = new Class113[500];
+ Class72.anInt1672 = 0;
+ Class81.anIntArrayArrayArray1142 = new int[4][Unsorted.width1234 + 1][TextureOperation17.height3179 + 1];
+ SequenceDefinition.aClass25Array1868 = new Class25[5000];
+ Unsorted.anInt3070 = 0;
+ Unsorted.aClass25Array4060 = new Class25[100];
+ Class23.aBooleanArrayArray457 = new boolean[TextureOperation8.renderDistanceTiles + TextureOperation8.renderDistanceTiles + 1][TextureOperation8.renderDistanceTiles + TextureOperation8.renderDistanceTiles + 1];
+ Class49.aBooleanArrayArray814 = new boolean[TextureOperation8.renderDistanceTiles + TextureOperation8.renderDistanceTiles + 2][TextureOperation8.renderDistanceTiles + TextureOperation8.renderDistanceTiles + 2];
+ Unsorted.possibleHeightmap1774 = new byte[4][Unsorted.width1234][TextureOperation17.height3179];
+ }
+
+ static void method1798(int var0, Scenery var1) {
+ try {
+ long var2 = 0L;
+ int var4 = -1;
+ if (var0 <= 17) {
+ Class159.anInt1740 = -43;
+ }
+
+ int var5 = 0;
+ if (var1.typemask == 0) {
+ var2 = Scenery.lookupTypemask0(var1.plane, var1.x, var1.y);
+ }
+
+ int var6 = 0;
+ if (var1.typemask == 1) {
+ var2 = Scenery.lookupTypemask1(var1.plane, var1.x, var1.y);
+ }
+
+ if (var1.typemask == 2) {
+ var2 = Scenery.lookupTypemask2(var1.plane, var1.x, var1.y);
+ }
+
+ if (var1.typemask == 3) {
+ var2 = Scenery.lookupTypeMask3(var1.plane, var1.x, var1.y);
+ }
+
+ if (var2 != 0L) {
+ var4 = Integer.MAX_VALUE & (int) (var2 >>> 32);
+ var6 = (int) var2 >> 20 & 3;
+ var5 = ((int) var2 & 516214) >> 14;
+ }
+
+ var1.original_id = var4;
+ var1.original_type = var5;
+ var1.original_rotation = var6;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "sf.B(" + var0 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static long lookupTypemask0(int var0, int var1, int var2) {
+ TileData var3 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ return var3 != null && var3.aClass70_2234 != null ? var3.aClass70_2234.aLong1048 : 0L;
+ }
+
+ public static long lookupTypemask1(int z, int x, int y) {
+ TileData var3 = TileData.aTileDataArrayArrayArray2638[z][x][y];
+ return var3 != null && var3.aClass19_2233 != null ? var3.aClass19_2233.aLong428 : 0L;
+ }
+
+ static long lookupTypemask2(int var0, int var1, int var2) {
+ TileData var3 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ if (var3 != null) {
+ for (int var4 = 0; var4 < var3.anInt2223; ++var4) {
+ Class25 var5 = var3.aClass25Array2221[var4];
+ if ((var5.aLong498 >> 29 & 3L) == 2L && var5.anInt483 == var1 && var5.anInt478 == var2) {
+ return var5.aLong498;
+ }
+ }
+
+ }
+ return 0L;
+ }
+
+ static long lookupTypeMask3(int var0, int var1, int var2) {
+ TileData var3 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ return var3 != null && var3.aClass12_2230 != null ? var3.aClass12_2230.aLong328 : 0L;
+ }
+
+ static void cleanupOldScenery() {
+ try {
+ Scenery var1 = (Scenery) Scenery.sceneryList.startIteration();
+ for (; var1 != null; var1 = (Scenery) Scenery.sceneryList.nextIteration()) {
+ if (var1.anInt2259 > 0) {
+ var1.anInt2259 -= 1;
+ }
+ if (var1.anInt2259 != 0) {
+ if (var1.anInt2261 > 0) {
+ var1.anInt2261 -= 1;
+ }
+ if ((var1.anInt2261 == 0) && (1 <= var1.x) && (1 <= var1.y) && (102 >= var1.x) && (var1.y <= 102) && ((var1.object_id < 0) || (Unsorted.method590((byte) -34, var1.object_id, var1.type)))) {
+ Scenery.method1048(var1.object_id, var1.x, var1.plane, var1.rotation, var1.y, -65, var1.type, var1.typemask);
+ var1.anInt2261 = -1;
+ if ((var1.object_id == var1.original_id) && (var1.original_id == -1)) {
+ var1.unlink();
+ } else if ((var1.original_id == var1.object_id) && (var1.rotation == var1.original_rotation) && (var1.type == var1.original_type)) {
+ var1.unlink();
+ }
+ }
+ } else if ((var1.original_id < 0) || (Unsorted.method590((byte) -66, var1.original_id, var1.original_type))) {
+ Scenery.method1048(var1.original_id, var1.x, var1.plane, var1.original_rotation, var1.y, -71, var1.original_type, var1.typemask);
+ var1.unlink();
+ }
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ug.A(" + (byte) -82 + ')');
+ }
+ }
+
+ static void method1048(int object_id, int x, int plane, int rotation, int y, int var5, int type, int typemask) {
+ try {
+ if (var5 > -15) {
+ Unsorted.anInt688 = -64;
+ }
+
+ if (x >= 1 && y >= 1 && 102 >= x && y <= 102) {
+ int maxPlane;
+ if (!NPC.isHighDetail(41) && 0 == (2 & Unsorted.sceneryTypeMaskGrid[0][x][y])) {
+ maxPlane = plane;
+ if ((8 & Unsorted.sceneryTypeMaskGrid[plane][x][y]) != 0) {
+ maxPlane = 0;
+ }
+
+ if (maxPlane != Class140_Sub3.viewportZ) {
+ return;
+ }
+ }
+
+ maxPlane = plane;
+ if (plane < 3 && (2 & Unsorted.sceneryTypeMaskGrid[1][x][y]) == 2) {
+ maxPlane = plane + 1;
+ }
+
+ Scenery.method910(y, x, plane, typemask, maxPlane, AtmosphereParser.aClass91Array1182[plane]);
+ if (0 <= object_id) {
+ boolean var9 = KeyboardListener.aBoolean1905;
+ KeyboardListener.aBoolean1905 = true;
+ Scenery.method1683(maxPlane, false, plane, false, AtmosphereParser.aClass91Array1182[plane], object_id, type, x, y, rotation);
+ KeyboardListener.aBoolean1905 = var9;
+ }
+ }
+
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "ge.H(" + object_id + ',' + x + ',' + plane + ',' + rotation + ',' + y + ',' + var5 + ',' + type + ',' + typemask + ')');
+ }
+ }
+
+ static void method910(int y, int x, int plane, int typemask, int var5, Class91 var6) {
+ try {
+ long var7 = 0L;
+ if (typemask == 0) {
+ var7 = Scenery.lookupTypemask0(plane, x, y);
+ } else if (typemask == 1) {
+ var7 = Scenery.lookupTypemask1(plane, x, y);
+ } else if (typemask == 2) {
+ var7 = Scenery.lookupTypemask2(plane, x, y);
+ } else if (3 == typemask) {
+ var7 = Scenery.lookupTypeMask3(plane, x, y);
+ }
+
+ int var19 = (519128 & (int) var7) >> 14;
+ int var17 = (int) (var7 >>> 32) & Integer.MAX_VALUE;
+ ObjectDefinition var12 = ObjectDefinition.getObjectDefinition(var17);
+ if (var12.method1690()) {
+ Class140_Sub6.method2020(x, var12, y, plane);
+ }
+
+ int var18 = ((int) var7 & 4109484) >> 20;
+ if (var7 != 0) {
+ GameObject var13 = null;
+ GameObject var14 = null;
+ if (0 == typemask) {
+ Class70 var15 = LinkedList.method1209(plane, x, y);
+ if (null != var15) {
+ var13 = var15.aClass140_1049;
+ var14 = var15.aClass140_1052;
+ }
+
+ if (var12.ClipType != 0) {
+ var6.method1485(var18, var12.ProjectileClipped, y, var19, x);
+ }
+ } else if (typemask == 1) {
+ Class19 x1 = Class39.method1037(plane, x, y);
+ if (x1 != null) {
+ var13 = x1.aClass140_429;
+ var14 = x1.aClass140_423;
+ }
+ } else if (2 == typemask) {
+ Class25 x0 = Class163_Sub2.method2217(plane, x, y);
+ if (null != x0) {
+ var13 = x0.aClass140_479;
+ }
+
+ if (var12.ClipType != 0 && var12.SizeX + x < 104 && var12.SizeX + y < 104 && 104 > x + var12.SizeY && y + var12.SizeY < 104) {
+ var6.method1502(x, var12.SizeX, var12.ProjectileClipped, var18, var12.SizeY, y);
+ }
+ } else {
+ Class12 x2 = Class159.method2193(plane, x, y);
+ if (x2 != null) {
+ var13 = x2.object;
+ }
+
+ if (var12.ClipType == 1) {
+ var6.method1499(y, x);
+ }
+ }
+
+ if (HDToolKit.highDetail && var12.aBoolean1503) {
+ if (2 == var19) {
+ if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -76, 0, var18 + 4, 0, var19, x, y, var5);
+ }
+
+ if (var14 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var14).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -100, 0, 3 & var18 - -1, 0, var19, x, y, var5);
+ }
+ } else if (5 != var19) {
+ if (var19 == 6) {
+ if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -28, 8 * Class163_Sub3.anIntArray3007[var18], 4 - -var18, 8 * Scenery.anIntArray2386[var18], 4, x, y, var5);
+ }
+ } else if (var19 == 7) {
+ if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -120, 0, 4 - -(3 & 2 + var18), 0, 4, x, y, var5);
+ }
+ } else if (var19 == 8) {
+ if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -45, Class163_Sub3.anIntArray3007[var18] * 8, var18 + 4, 8 * Scenery.anIntArray2386[var18], 4, x, y, var5);
+ }
+
+ if (var14 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var14).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -24, Class163_Sub3.anIntArray3007[var18] * 8, 4 - -(3 & 2 + var18), Scenery.anIntArray2386[var18] * 8, 4, x, y, var5);
+ }
+ } else if (11 != var19) {
+ if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -113, 0, var18, 0, var19, x, y, var5);
+ }
+ } else if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -115, 0, 4 + var18, 0, 10, x, y, var5);
+ }
+ } else if (var13 instanceof Class140_Sub3) {
+ ((Class140_Sub3) var13).method1960();
+ } else {
+ Scenery.method840(var12, (byte) -119, Class3_Sub24_Sub3.anIntArray3491[var18] * 8, var18, RenderAnimationDefinition.anIntArray356[var18] * 8, 4, x, y, var5);
+ }
+ }
+ }
+
+ } catch (RuntimeException var16) {
+ throw ClientErrorException.clientError(var16, "dg.B(" + -96 + ',' + y + ',' + x + ',' + plane + ',' + typemask + ',' + var5 + ',' + (var6 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static void method1683(int maxPlane, boolean var1, int plane, boolean var3, Class91 var4, int objectId, int type, int objectX, int objectY, int objectRot) {
+ try {
+ plane %= 4;
+ if (var1 && !NPC.isHighDetail(103) && 0 == (2 & Unsorted.sceneryTypeMaskGrid[0][objectX][objectY])) {
+ if (0 != (16 & Unsorted.sceneryTypeMaskGrid[plane][objectX][objectY])) {
+ return;
+ }
+
+ if (Class140_Sub3.viewportZ != PacketParser.method823(objectY, objectX, (byte) 50 ^ -127, plane)) {
+ return;
+ }
+ }
+
+ if (Class85.anInt1174 > plane) {
+ Class85.anInt1174 = plane;
+ }
+
+ ObjectDefinition def = ObjectDefinition.getObjectDefinition(objectId);
+ if (!HDToolKit.highDetail || !def.aBoolean1530) {
+ int var12;
+ int var13;
+ if (objectRot == 1 || objectRot == 3) {
+ var13 = def.SizeX;
+ var12 = def.SizeY;
+ } else {
+ var12 = def.SizeX;
+ var13 = def.SizeY;
+ }
+
+ int var14;
+ int var15;
+ if (objectX + var12 <= 104) {
+ var14 = objectX + (var12 >> 1);
+ var15 = objectX - -(1 + var12 >> 1);
+ } else {
+ var15 = 1 + objectX;
+ var14 = objectX;
+ }
+
+ int var17;
+ int var16;
+ if (var13 + objectY > 104) {
+ var16 = objectY;
+ var17 = objectY - -1;
+ } else {
+ var16 = (var13 >> 1) + objectY;
+ var17 = objectY + (var13 + 1 >> 1);
+ }
+
+ int[][] var18 = Class44.anIntArrayArrayArray723[maxPlane];
+ int var20 = (var12 << 6) + (objectX << 7);
+ int var21 = (var13 << 6) + (objectY << 7);
+ int var19 = var18[var14][var17] + var18[var15][var16] + var18[var14][var16] + var18[var15][var17] >> 2;
+ int var22 = 0;
+ int[][] var23;
+ if (HDToolKit.highDetail && maxPlane != 0) {
+ var23 = Class44.anIntArrayArrayArray723[0];
+ var22 = var19 - (var23[var15][var17] + var23[var15][var16] + var23[var14][var16] + var23[var14][var17] >> 2);
+ }
+
+ var23 = null;
+ long var24 = 1073741824 | objectX | objectY << 7 | type << 14 | objectRot << 20;
+ if (var3) {
+ var23 = Class58.anIntArrayArrayArray914[0];
+ } else if (maxPlane < 3) {
+ var23 = Class44.anIntArrayArrayArray723[1 + maxPlane];
+ }
+
+ if (0 == def.SecondInt || var3) {
+ var24 |= Long.MIN_VALUE;
+ }
+
+ if (1 == def.anInt1540) {
+ var24 |= 4194304L;
+ }
+
+ if (def.aBoolean1507) {
+ var24 |= 2147483648L;
+ }
+
+ if (def.method1690()) {
+ Class70.method1286(objectY, def, objectRot, null, objectX, plane, null);
+ }
+
+ boolean var26 = def.aBoolean1503 & !var3;
+ var24 |= (long) objectId << 32;
+ Object object;
+ Class136 var28;
+ if (22 != type) {
+ if (10 == type || 11 == type) {
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ var28 = def.method1696(type == 11 ? 4 + objectRot : objectRot, var20, var18, 10, var19, var23, var1, null, (byte) -26, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 10, 11 == type ? 4 - -objectRot : objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ if (object != null) {
+ boolean var37 = method835(plane, objectX, objectY, var19, var12, var13, (GameObject) object, var24);
+ if (def.aBoolean1525 && var37 && var1) {
+ int var29 = 15;
+ if (object instanceof Model) {
+ var29 = ((Model) object).method1888() / 4;
+ if (var29 > 30) {
+ var29 = 30;
+ }
+ }
+
+ for (int var30 = 0; var30 <= var12; ++var30) {
+ for (int var31 = 0; var13 >= var31; ++var31) {
+ if (var29 > Class67.aByteArrayArrayArray1014[plane][objectX + var30][var31 + objectY]) {
+ Class67.aByteArrayArrayArray1014[plane][objectX - -var30][objectY - -var31] = (byte) var29;
+ }
+ }
+ }
+ }
+ }
+
+ if (0 != def.ClipType && null != var4) {
+ var4.method1489(objectX, def.ProjectileClipped, (byte) 96, objectY, var12, var13);
+ }
+
+ } else if (12 <= type) {
+ if (-1 == def.animationId && null == def.ChildrenIds && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, type, var19, var23, var1, null, (byte) -82, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, type, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ method835(plane, objectX, objectY, var19, 1, 1, (GameObject) object, var24);
+ if (var1 && type <= 17 && type != 13 && plane > 0) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 4);
+ }
+
+ if (def.ClipType != 0 && null != var4) {
+ var4.method1489(objectX, def.ProjectileClipped, (byte) 73, objectY, var12, var13);
+ }
+
+ } else if (0 == type) {
+ if (def.animationId == -1 && null == def.ChildrenIds && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, 0, var19, var23, var1, null, (byte) -74, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 0, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class154.method2146(plane, objectX, objectY, var19, (GameObject) object, null, Class159.anIntArray2017[objectRot], 0, var24);
+ if (var1) {
+ if (objectRot == 0) {
+ if (def.aBoolean1525) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY] = 50;
+ Class67.aByteArrayArrayArray1014[plane][objectX][1 + objectY] = 50;
+ }
+
+ if (def.aBoolean1542) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 1);
+ }
+ } else if (1 == objectRot) {
+ if (def.aBoolean1525) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY - -1] = 50;
+ Class67.aByteArrayArrayArray1014[plane][objectX - -1][objectY + 1] = 50;
+ }
+
+ if (def.aBoolean1542) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][1 + objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][1 + objectY], 2);
+ }
+ } else if (objectRot == 2) {
+ if (def.aBoolean1525) {
+ Class67.aByteArrayArrayArray1014[plane][objectX + 1][objectY] = 50;
+ Class67.aByteArrayArrayArray1014[plane][1 + objectX][1 + objectY] = 50;
+ }
+
+ if (def.aBoolean1542) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX - -1][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX - -1][objectY], 1);
+ }
+ } else if (objectRot == 3) {
+ if (def.aBoolean1525) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY] = 50;
+ Class67.aByteArrayArrayArray1014[plane][1 + objectX][objectY] = 50;
+ }
+
+ if (def.aBoolean1542) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 2);
+ }
+ }
+ }
+
+ if (0 != def.ClipType && var4 != null) {
+ var4.method1486(objectRot, type, def.ProjectileClipped, objectY, objectX);
+ }
+
+ if (def.anInt1528 != 16) {
+ PositionedGraphicObject.method1956(plane, objectX, objectY, def.anInt1528);
+ }
+
+ } else if (type == 1) {
+ if (-1 == def.animationId && def.ChildrenIds == null && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, 1, var19, var23, var1, null, (byte) -83, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 1, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class154.method2146(plane, objectX, objectY, var19, (GameObject) object, null, Class40.anIntArray675[objectRot], 0, var24);
+ if (def.aBoolean1525 && var1) {
+ if (0 == objectRot) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY + 1] = 50;
+ } else if (objectRot == 1) {
+ Class67.aByteArrayArrayArray1014[plane][objectX - -1][1 + objectY] = 50;
+ } else if (objectRot == 2) {
+ Class67.aByteArrayArrayArray1014[plane][1 + objectX][objectY] = 50;
+ } else if (3 == objectRot) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY] = 50;
+ }
+ }
+
+ if (def.ClipType != 0 && null != var4) {
+ var4.method1486(objectRot, type, def.ProjectileClipped, objectY, objectX);
+ }
+
+ } else {
+ int var43;
+ if (type == 2) {
+ var43 = 1 + objectRot & 3;
+ Object var38;
+ Object var42;
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ Class136 var45 = def.method1696(objectRot + 4, var20, var18, 2, var19, var23, var1, null, (byte) -108, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var45).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ var42 = Objects.requireNonNull(var45).aClass140_1777;
+ var45 = def.method1696(var43, var20, var18, 2, var19, var23, var1, null, (byte) -69, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var45).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ var38 = Objects.requireNonNull(var45).aClass140_1777;
+ } else {
+ var42 = new Class140_Sub3(objectId, 2, 4 + objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ var38 = new Class140_Sub3(objectId, 2, var43, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class154.method2146(plane, objectX, objectY, var19, (GameObject) var42, (GameObject) var38, Class159.anIntArray2017[objectRot], Class159.anIntArray2017[var43], var24);
+ if (def.aBoolean1542 && var1) {
+ if (objectRot == 0) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 1);
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][1 + objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][1 + objectY], 2);
+ } else if (objectRot == 1) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY - -1] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY - -1], 2);
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX - -1][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX - -1][objectY], 1);
+ } else if (objectRot == 2) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][1 + objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][1 + objectX][objectY], 1);
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 2);
+ } else if (objectRot == 3) {
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 2);
+ Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY] = TextureOperation3.bitwiseOr(Class38_Sub1.anIntArrayArrayArray2609[plane][objectX][objectY], 1);
+ }
+ }
+
+ if (def.ClipType != 0 && var4 != null) {
+ var4.method1486(objectRot, type, def.ProjectileClipped, objectY, objectX);
+ }
+
+ if (def.anInt1528 != 16) {
+ PositionedGraphicObject.method1956(plane, objectX, objectY, def.anInt1528);
+ }
+
+ } else if (type == 3) {
+ if (def.animationId == -1 && null == def.ChildrenIds && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, 3, var19, var23, var1, null, (byte) -54, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 3, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class154.method2146(plane, objectX, objectY, var19, (GameObject) object, null, Class40.anIntArray675[objectRot], 0, var24);
+ if (def.aBoolean1525 && var1) {
+ if (0 == objectRot) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY + 1] = 50;
+ } else if (objectRot == 1) {
+ Class67.aByteArrayArrayArray1014[plane][1 + objectX][objectY + 1] = 50;
+ } else if (objectRot == 2) {
+ Class67.aByteArrayArrayArray1014[plane][1 + objectX][objectY] = 50;
+ } else if (objectRot == 3) {
+ Class67.aByteArrayArrayArray1014[plane][objectX][objectY] = 50;
+ }
+ }
+
+ if (0 != def.ClipType && var4 != null) {
+ var4.method1486(objectRot, type, def.ProjectileClipped, objectY, objectX);
+ }
+
+ } else if (type == 9) {
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, type, var19, var23, var1, null, (byte) -30, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, type, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ method835(plane, objectX, objectY, var19, 1, 1, (GameObject) object, var24);
+ if (def.ClipType != 0 && var4 != null) {
+ var4.method1489(objectX, def.ProjectileClipped, (byte) 127, objectY, var12, var13);
+ }
+
+ if (def.anInt1528 != 16) {
+ PositionedGraphicObject.method1956(plane, objectX, objectY, def.anInt1528);
+ }
+
+ } else if (4 == type) {
+ if (def.animationId == -1 && null == def.ChildrenIds && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, 4, var19, var23, var1, null, (byte) -103, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 4, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class3_Sub28_Sub8.method577(plane, objectX, objectY, var19, (GameObject) object, null, Class159.anIntArray2017[objectRot], 0, 0, 0, var24);
+ } else {
+ Object var39;
+ Class136 var47;
+ long var44;
+ if (type == 5) {
+ var43 = 16;
+ var44 = Scenery.lookupTypemask0(plane, objectX, objectY);
+ if (var44 != 0) {
+ var43 = ObjectDefinition.getObjectDefinition(Integer.MAX_VALUE & (int) (var44 >>> 32)).anInt1528;
+ }
+
+ if (def.animationId == -1 && null == def.ChildrenIds && !def.aBoolean1510) {
+ var47 = def.method1696(objectRot, var20, var18, 4, var19, var23, var1, null, (byte) -125, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var47).aClass109_Sub1_1770, var20 + -(RenderAnimationDefinition.anIntArray356[objectRot] * 8), var22, -(Class3_Sub24_Sub3.anIntArray3491[objectRot] * 8) + var21);
+ }
+
+ var39 = Objects.requireNonNull(var47).aClass140_1777;
+ } else {
+ var39 = new Class140_Sub3(objectId, 4, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class3_Sub28_Sub8.method577(plane, objectX, objectY, var19, (GameObject) var39, null, Class159.anIntArray2017[objectRot], 0, var43 * RenderAnimationDefinition.anIntArray356[objectRot], Class3_Sub24_Sub3.anIntArray3491[objectRot] * var43, var24);
+ } else if (type == 6) {
+ var43 = 8;
+ var44 = Scenery.lookupTypemask0(plane, objectX, objectY);
+ if (var44 != 0) {
+ var43 = ObjectDefinition.getObjectDefinition(Integer.MAX_VALUE & (int) (var44 >>> 32)).anInt1528 / 2;
+ }
+
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ var47 = def.method1696(objectRot + 4, var20, var18, 4, var19, var23, var1, null, (byte) -65, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var47).aClass109_Sub1_1770, -(8 * anIntArray2386[objectRot]) + var20, var22, -(8 * Class163_Sub3.anIntArray3007[objectRot]) + var21);
+ }
+
+ var39 = Objects.requireNonNull(var47).aClass140_1777;
+ } else {
+ var39 = new Class140_Sub3(objectId, 4, 4 + objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class3_Sub28_Sub8.method577(plane, objectX, objectY, var19, (GameObject) var39, null, 256, objectRot, var43 * anIntArray2386[objectRot], var43 * Class163_Sub3.anIntArray3007[objectRot], var24);
+ } else if (7 == type) {
+ int var40 = 3 & objectRot - -2;
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ Class136 var41 = def.method1696(var40 - -4, var20, var18, 4, var19, var23, var1, null, (byte) -39, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var41).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var41).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 4, var40 + 4, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class3_Sub28_Sub8.method577(plane, objectX, objectY, var19, (GameObject) object, null, 256, var40, 0, 0, var24);
+ } else if (type == 8) {
+ var43 = 8;
+ var44 = Scenery.lookupTypemask0(plane, objectX, objectY);
+ if (var44 != 0) {
+ var43 = ObjectDefinition.getObjectDefinition(Integer.MAX_VALUE & (int) (var44 >>> 32)).anInt1528 / 2;
+ }
+
+ int var32 = objectRot + 2 & 3;
+ Object var46;
+ if (-1 == def.animationId && null == def.ChildrenIds && !def.aBoolean1510) {
+ int var34 = 8 * Class163_Sub3.anIntArray3007[objectRot];
+ int var33 = anIntArray2386[objectRot] * 8;
+ Class136 var35 = def.method1696(4 + objectRot, var20, var18, 4, var19, var23, var1, null, (byte) -25, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var35).aClass109_Sub1_1770, var20 + -var33, var22, -var34 + var21);
+ }
+
+ var39 = Objects.requireNonNull(var35).aClass140_1777;
+ var35 = def.method1696(var32 - -4, var20, var18, 4, var19, var23, var1, null, (byte) -101, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var35).aClass109_Sub1_1770, var20 - var33, var22, -var34 + var21);
+ }
+
+ var46 = Objects.requireNonNull(var35).aClass140_1777;
+ } else {
+ var39 = new Class140_Sub3(objectId, 4, 4 + objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ var46 = new Class140_Sub3(objectId, 4, var32 + 4, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+
+ Class3_Sub28_Sub8.method577(plane, objectX, objectY, var19, (GameObject) var39, (GameObject) var46, 256, objectRot, var43 * anIntArray2386[objectRot], Class163_Sub3.anIntArray3007[objectRot] * var43, var24);
+ }
+ }
+ }
+ } else if (KeyboardListener.aBoolean1905 || def.SecondInt != 0 || def.ClipType == 1 || def.aBoolean1483) {
+ if (def.animationId == -1 && def.ChildrenIds == null && !def.aBoolean1510) {
+ var28 = def.method1696(objectRot, var20, var18, 22, var19, var23, var1, null, (byte) -126, var26, var21);
+ if (HDToolKit.highDetail && var26) {
+ Class141.method2051(Objects.requireNonNull(var28).aClass109_Sub1_1770, var20, var22, var21);
+ }
+
+ object = Objects.requireNonNull(var28).aClass140_1777;
+ } else {
+ object = new Class140_Sub3(objectId, 22, objectRot, maxPlane, objectX, objectY, def.animationId, def.aBoolean1492, null);
+ }
+ TextureOperation39.method276(plane, objectX, objectY, var19, (GameObject) object, var24, def.aBoolean1502);
+ if (def.ClipType == 1 && null != var4) {
+ var4.method1503(objectX, objectY);
+ }
+
+ }
+ }
+ } catch (RuntimeException var36) {
+ throw ClientErrorException.clientError(var36, "p.B(" + maxPlane + ',' + var1 + ',' + plane + ',' + var3 + ',' + (var4 != null ? "{...}" : "null") + ',' + objectId + ',' + type + ',' + objectX + ',' + (byte) 50 + ',' + objectY + ',' + objectRot + ')');
+ }
+ }
+
+ static boolean method835(int var0, int var1, int var2, int var3, int var4, int var5, GameObject var6, long var8) {
+ if (var6 == null) {
+ return true;
+ } else {
+ int var10 = var1 * 128 + 64 * var4;
+ int var11 = var2 * 128 + 64 * var5;
+ return Scenery.method1189(var0, var1, var2, var4, var5, var10, var11, var3, var6, 0, false, var8);
+ }
+ }
+
+ static boolean method1189(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, GameObject var8, int var9, boolean var10, long var11) {
+ boolean var13 = Class44.anIntArrayArrayArray723 == Unsorted.anIntArrayArrayArray3605;
+ int var14 = 0;
+
+ int var16;
+ for (int var15 = var1; var15 < var1 + var3; ++var15) {
+ for (var16 = var2; var16 < var2 + var4; ++var16) {
+ if (var15 < 0 || var16 < 0 || var15 >= Unsorted.width1234 || var16 >= TextureOperation17.height3179) {
+ return false;
+ }
+
+ TileData var17 = TileData.aTileDataArrayArrayArray2638[var0][var15][var16];
+ if (var17 != null && var17.anInt2223 >= 5) {//@splinter
+ return false;
+ }
+ }
+ }
+
+ Class25 var20 = new Class25();
+ var20.aLong498 = var11;
+ var20.anInt493 = var0;
+ var20.anInt482 = var5;
+ var20.anInt484 = var6;
+ var20.anInt489 = var7;
+ var20.aClass140_479 = var8;
+ var20.anInt496 = var9;
+ var20.anInt483 = var1;
+ var20.anInt478 = var2;
+ var20.anInt495 = var1 + var3 - 1;
+ var20.anInt481 = var2 + var4 - 1;
+
+ int var21;
+ for (var16 = var1; var16 < var1 + var3; ++var16) {
+ for (var21 = var2; var21 < var2 + var4; ++var21) {
+ int var18 = 0;
+ if (var16 > var1) {
+ ++var18;
+ }
+
+ if (var16 < var1 + var3 - 1) {
+ var18 += 4;
+ }
+
+ if (var21 > var2) {
+ var18 += 8;
+ }
+
+ if (var21 < var2 + var4 - 1) {
+ var18 += 2;
+ }
+
+ for (int var19 = var0; var19 >= 0; --var19) {
+ if (TileData.aTileDataArrayArrayArray2638[var19][var16][var21] == null) {
+ TileData.aTileDataArrayArrayArray2638[var19][var16][var21] = new TileData(var19, var16, var21);
+ }
+ }
+
+ TileData var22 = TileData.aTileDataArrayArrayArray2638[var0][var16][var21];
+ var22.aClass25Array2221[var22.anInt2223] = var20;
+ var22.anIntArray2237[var22.anInt2223] = var18;
+ var22.anInt2228 |= var18;
+ ++var22.anInt2223;
+ if (var13 && TextureOperation16.anIntArrayArray3115[var16][var21] != 0) {
+ var14 = TextureOperation16.anIntArrayArray3115[var16][var21];
+ }
+ }
+ }
+
+ if (var13 && var14 != 0) {
+ for (var16 = var1; var16 < var1 + var3; ++var16) {
+ for (var21 = var2; var21 < var2 + var4; ++var21) {
+ if (TextureOperation16.anIntArrayArray3115[var16][var21] == 0) {
+ TextureOperation16.anIntArrayArray3115[var16][var21] = var14;
+ }
+ }
+ }
+ }
+
+ if (var10) {
+ SequenceDefinition.aClass25Array1868[Unsorted.anInt3070++] = var20;
+ }
+
+ return true;
+ }
+
+ static void method840(ObjectDefinition var0, byte var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) {
+ try {
+ int var9 = 3 & var3;
+ if (var1 >= -1) {
+ TextCore.aString_106 = null;
+ }
+
+ int var10;
+ int var11;
+ if (var9 == 1 || var9 == 3) {
+ var10 = var0.SizeY;
+ var11 = var0.SizeX;
+ } else {
+ var11 = var0.SizeY;
+ var10 = var0.SizeX;
+ }
+
+ int var14;
+ int var15;
+ if (var7 - -var11 > 104) {
+ var15 = 1 + var7;
+ var14 = var7;
+ } else {
+ var14 = var7 - -(var11 >> 1);
+ var15 = var7 - -(1 + var11 >> 1);
+ }
+
+ int var16 = (var6 << 7) - -(var10 << 6);
+ int var17 = (var7 << 7) + (var11 << 6);
+ int var12;
+ int var13;
+ if (104 < var6 - -var10) {
+ var12 = var6;
+ var13 = var6 + 1;
+ } else {
+ var12 = var6 + (var10 >> 1);
+ var13 = (var10 - -1 >> 1) + var6;
+ }
+
+ int[][] var18 = Class44.anIntArrayArrayArray723[var8];
+ int var20 = 0;
+ int var19 = var18[var12][var15] + var18[var12][var14] + var18[var13][var14] + var18[var13][var15] >> 2;
+ int[][] var21;
+ if (var8 != 0) {
+ var21 = Class44.anIntArrayArrayArray723[0];
+ var20 = -(var21[var12][var15] + var21[var13][var14] + (var21[var12][var14] - -var21[var13][var15]) >> 2) + var19;
+ }
+
+ var21 = null;
+ if (3 > var8) {
+ var21 = Class44.anIntArrayArrayArray723[1 + var8];
+ }
+
+ Class136 var22 = var0.method1696(var3, var16, var18, var5, var19, var21, false, null, (byte) -69, true, var17);
+ Class141.method2047(Objects.requireNonNull(var22).aClass109_Sub1_1770, -var4 + var16, var20, var17 + -var2);
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "al.K(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ')');
+ }
+ }
+
+ static int sceneryPositionHash(int plane, int var1, int tileX, int tileY) {
+ try {
+ if (null == Class44.anIntArrayArrayArray723) {
+ return 0;
+ } else {
+ int x = tileX >> 7;
+ int y = tileY >> 7;
+ if (x >= 0 && 0 <= y && x <= 103 && 103 >= y) {
+ int var7 = 127 & tileX;
+ int var8 = tileY & 127;
+ int z = plane;
+ if (3 > plane && (2 & Unsorted.sceneryTypeMaskGrid[1][x][y]) == 2) {
+ z = plane + 1;
+ }
+
+ int var10 = var7 * Class44.anIntArrayArrayArray723[z][var1 + x][1 + y] + Class44.anIntArrayArrayArray723[z][x][y + 1] * (-var7 + 128) >> 7;
+ int var9 = var7 * Class44.anIntArrayArrayArray723[z][x + 1][y] + (-var7 + 128) * Class44.anIntArrayArrayArray723[z][x][y] >> 7;
+ return var8 * var10 + (128 - var8) * var9 >> 7;
+ } else {
+ return 0;
+ }
+ }
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "ql.B(" + plane + ',' + var1 + ',' + tileX + ',' + tileY + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/Sensor.java b/Client/src/main/java/org/runite/client/Sensor.java
new file mode 100644
index 000000000..7830bb1f9
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Sensor.java
@@ -0,0 +1,49 @@
+package org.runite.client;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+class Sensor {
+
+ private final Robot robot = new Robot();
+ private Component component;
+
+ public Sensor() throws Exception {
+ }
+
+ public void setCursor(Component component, Point hotSpot, int width, int height, int[] rgb) {
+ if (rgb == null) {
+ component.setCursor(null);
+ } else {
+ BufferedImage image = new BufferedImage(width, height, 2);
+ image.setRGB(0, 0, width, height, rgb, 0, width);
+ component.setCursor(component.getToolkit().createCustomCursor(image, hotSpot, null));
+ }
+ }
+
+ public void moveMouse(int x, int y) {
+ this.robot.mouseMove(x, y);
+ }
+
+ // TODO Is unsetComponent the right name?
+ public void updateComponent(Component component, boolean unsetComponent) {
+ if (unsetComponent) {
+ component = null;
+ } else if (component == null) {
+ throw new NullPointerException();
+ }
+
+ if (component != this.component) {
+ if (this.component != null) {
+ this.component.setCursor(null);
+ this.component = null;
+ }
+
+ if (component != null) {
+ component.setCursor(component.getToolkit().createCustomCursor(new BufferedImage(1, 1, 2), new Point(0, 0), null));
+ this.component = component;
+ }
+ }
+
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/SequenceDefinition.java b/Client/src/main/java/org/runite/client/SequenceDefinition.java
new file mode 100644
index 000000000..9fd9cc51b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/SequenceDefinition.java
@@ -0,0 +1,559 @@
+package org.runite.client;
+
+
+import org.rs09.client.data.HashTable;
+
+public final class SequenceDefinition {
+
+ int delayType = 2;
+ boolean aBoolean1846 = false;
+ static volatile long aLong1847 = 0L;
+ boolean aBoolean1848 = false;
+ public int rightHandItem = -1;
+ int priority = -1;
+ public int[] frames;
+ public static CacheIndex spritesIndex_1852;
+ public int leftHandItem = -1;
+ boolean[] aBooleanArray1855;
+ public static AbstractIndexedSprite aClass109_1856;
+ int forcedPriority = 5;
+ boolean aBoolean1859 = false;
+ static CacheIndex animationReferenceIndex;
+ int maxLoops = 99;
+ static int anInt1862 = 0;
+ int animId;
+ int anInt1865 = -1;
+ int resetWhenWalk = -1;
+ int[][] sounds;
+ static Class25[] aClass25Array1868;
+ int[] duration;
+ public int[] baseIds;
+ static int[] anIntArray1871 = new int[2];
+ boolean aBoolean1872 = false;
+
+ public static SequenceDefinition getAnimationDefinition(int var0) {
+ try {
+
+ SequenceDefinition var2 = (SequenceDefinition) Texture.aReferenceCache_1146.get(var0);
+ if (var2 == null) {
+ byte[] var3 = animationReferenceIndex.getFile(Class129.method1765(var0), Class67.method1262(117, var0));
+ var2 = new SequenceDefinition();
+ var2.animId = var0;
+ if (var3 != null) {
+ var2.parseDefinitions(new DataBuffer(var3));
+ }
+
+ var2.method2058();
+ Texture.aReferenceCache_1146.put(var2, var0);
+ }
+ return var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "client.D(" + var0 + ',' + (byte) -20 + ')');
+ }
+ }
+
+
+ final void parseDefinitions(DataBuffer var1) {
+ try {
+ // System.out.print("Animation " + animId + " - parsed [");
+ while(true) {
+ int var3 = var1.readUnsignedByte();
+ if(var3 == 0) {
+ //System.out.println("].");
+ return;
+ }
+ //System.out.print(var3 + ", ");
+ this.parseOpcode(var3, var1);
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "tk.I(" + (var1 != null?"{...}":"null") + ',' + (byte) -102 + ')');
+ }
+ }
+
+ final Model method2054(int var2, int var3, Model var4, int var5, int var6) {
+ try {
+ int var7 = this.duration[var2];
+ var2 = this.frames[var2];
+ Class3_Sub28_Sub5 var8 = Class3_Sub9.method133(var2 >> 16);
+ var2 &= 65535;
+ if(var8 == null) {
+ return var4.method1890(true, true, true);
+ } else {
+ var5 &= 3;
+ Class3_Sub28_Sub5 var9 = null;
+
+ if((this.aBoolean1846 || ClientCommands.tweeningEnabled) && var3 != -1 && this.frames.length > var3) {
+ var3 = this.frames[var3];
+ var9 = Class3_Sub9.method133(var3 >> 16);
+ var3 &= 65535;
+ }
+
+ Model var10;
+ if(var9 == null) {
+ var10 = var4.method1890(!var8.method559(var2), !var8.method561(var2, (byte)121), !this.aBoolean1848);
+ } else {
+ var10 = var4.method1890(!var8.method559(var2) & !var9.method559(var3), !var8.method561(var2, (byte)125) & !var9.method561(var3, (byte)118), !this.aBoolean1848);
+ }
+
+ if(HDToolKit.highDetail && this.aBoolean1848) {
+ if(var5 == 1) {
+ ((Class140_Sub1_Sub1)var10).method1902();
+ } else if (2 == var5) {
+ ((Class140_Sub1_Sub1) var10).method1911();
+ } else if (var5 == 3) {
+ ((Class140_Sub1_Sub1) var10).method1925();
+ }
+ } else if(var5 == 1) {
+ var10.method1900();
+ } else if (2 == var5) {
+ var10.method1874();
+ } else if (3 == var5) {
+ var10.method1885();
+ }
+
+ var10.method1880(var8, var2, var9, var3, -1 + var6, var7, this.aBoolean1848);
+ if(HDToolKit.highDetail && this.aBoolean1848) {
+ if(1 == var5) {
+ ((Class140_Sub1_Sub1)var10).method1925();
+ } else if (var5 == 2) {
+ ((Class140_Sub1_Sub1) var10).method1911();
+ } else if (var5 == 3) {
+ ((Class140_Sub1_Sub1) var10).method1902();
+ }
+ } else if(var5 == 1) {
+ var10.method1885();
+ } else if (var5 == 2) {
+ var10.method1874();
+ } else if (var5 == 3) {
+ var10.method1900();
+ }
+
+ return var10;
+ }
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "tk.D(" + 19749 + ',' + var2 + ',' + var3 + ',' + (var4 != null?"{...}":"null") + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ final Model method2055(Model var1, byte var2, int var3, int var4, int var5) {
+ try {
+ int var7 = this.frames[var5];
+ int var6 = this.duration[var5];
+ Class3_Sub28_Sub5 var8 = Class3_Sub9.method133(var7 >> 16);
+ var7 &= 65535;
+ if(null == var8) {
+ return var1.method1894(true, true, true);
+ } else {
+ Class3_Sub28_Sub5 var9 = null;
+ if((this.aBoolean1846 || ClientCommands.tweeningEnabled) && var3 != -1 && this.frames.length > var3) {
+ var3 = this.frames[var3];
+ var9 = Class3_Sub9.method133(var3 >> 16);
+ var3 &= 65535;
+ }
+
+ Class3_Sub28_Sub5 var10 = null;
+ Class3_Sub28_Sub5 var11 = null;
+ int var13 = 0;
+ int var14 = 0;
+ if(null != this.baseIds) {
+ if(var5 < this.baseIds.length) {
+ var13 = this.baseIds[var5];
+ if(var13 != 65535) {
+ var10 = Class3_Sub9.method133(var13 >> 16);
+ var13 &= 65535;
+ }
+ }
+
+ if((this.aBoolean1846 || ClientCommands.tweeningEnabled) && -1 != var3 && this.baseIds.length > var3) {
+ var14 = this.baseIds[var3];
+ if(var14 != 65535) {
+ var11 = Class3_Sub9.method133(var14 >> 16);
+ var14 &= 65535;
+ }
+ }
+ }
+
+ boolean var15 = !var8.method559(var7);
+ boolean var16 = !var8.method561(var7, (byte)119);
+ if(var10 != null) {
+ var15 &= !var10.method559(var13);
+ var16 &= !var10.method561(var13, (byte)115);
+ }
+
+ if(null != var9) {
+ var15 &= !var9.method559(var3);
+ var16 &= !var9.method561(var3, (byte)123);
+ }
+
+ if(null != var11) {
+ var15 &= !var11.method559(var14);
+ var16 &= !var11.method561(var14, (byte)121);
+ }
+
+ Model var17 = var1.method1894(var15, var16, !this.aBoolean1848);
+ var17.method1880(var8, var7, var9, var3, var4 - 1, var6, this.aBoolean1848);
+ if(null != var10) {
+ var17.method1880(var10, var13, var11, var14, var4 + -1, var6, this.aBoolean1848);
+ }
+
+ return var17;
+ }
+ } catch (RuntimeException var18) {
+ throw ClientErrorException.clientError(var18, "tk.E(" + (var1 != null?"{...}":"null") + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ final Model method2056(int var1, int var2, int var3, int var4, Model var5) {
+ try {
+ int var7 = this.duration[var2];
+ var2 = this.frames[var2];
+ Class3_Sub28_Sub5 var8 = Class3_Sub9.method133(var2 >> 16);
+ var2 &= 65535;
+ if(null == var8) {
+ return var5.method1894(true, true, true);
+ } else {
+ var4 &= 3;
+ Class3_Sub28_Sub5 var9 = null;
+ if((this.aBoolean1846 || ClientCommands.tweeningEnabled) && var1 != -1 && this.frames.length > var1) {
+ var1 = this.frames[var1];
+ var9 = Class3_Sub9.method133(var1 >> 16);
+ var1 &= 65535;
+ }
+
+ Model var10;
+ if(null == var9) {
+ var10 = var5.method1894(!var8.method559(var2), !var8.method561(var2, (byte)123), !this.aBoolean1848);
+ } else {
+ var10 = var5.method1894(!var8.method559(var2) & !var9.method559(var1), !var8.method561(var2, (byte)125) & !var9.method561(var1, (byte)123), !this.aBoolean1848);
+ }
+
+ if(this.aBoolean1848 && HDToolKit.highDetail) {
+ if(1 == var4) {
+ ((Class140_Sub1_Sub1)var10).method1902();
+ } else if (var4 == 2) {
+ ((Class140_Sub1_Sub1) var10).method1911();
+ } else if (var4 == 3) {
+ ((Class140_Sub1_Sub1) var10).method1925();
+ }
+ } else if(var4 == 1) {
+ var10.method1900();
+ } else if(var4 == 2) {
+ var10.method1874();
+ } else if(var4 == 3) {
+ var10.method1885();
+ }
+
+ var10.method1880(var8, var2, var9, var1, var3 + -1, var7, this.aBoolean1848);
+ if(this.aBoolean1848 && HDToolKit.highDetail) {
+ if(var4 == 1) {
+ ((Class140_Sub1_Sub1)var10).method1925();
+ } else if(var4 == 2) {
+ ((Class140_Sub1_Sub1)var10).method1911();
+ } else if(var4 == 3) {
+ ((Class140_Sub1_Sub1)var10).method1902();
+ }
+ } else if(1 == var4) {
+ var10.method1885();
+ } else if (var4 == 2) {
+ var10.method1874();
+ } else if (3 == var4) {
+ var10.method1900();
+ }
+
+ return var10;
+ }
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "tk.B(" + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + (var5 != null?"{...}":"null") + ',' + 3 + ')');
+ }
+ }
+
+ final void method2058() {
+ try {
+ if(this.resetWhenWalk == -1) {
+ if(null == this.aBooleanArray1855) {
+ this.resetWhenWalk = 0;
+ } else {
+ this.resetWhenWalk = 2;
+ }
+ }
+
+ if(-1 == this.priority) {
+ if(null == this.aBooleanArray1855) {
+ this.priority = 0;
+ } else {
+ this.priority = 2;
+ }
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "tk.C(" + (byte) -41 + ')');
+ }
+ }
+
+ final Model method2059(int var1, int var2, int var3, Model var5) {
+ try {
+ int var6 = this.duration[var3];
+ var3 = this.frames[var3];
+ Class3_Sub28_Sub5 var7 = Class3_Sub9.method133(var3 >> 16);
+ var3 &= 65535;
+ if(var7 == null) {
+ return var5.method1882(true, true, true);
+ } else {
+ Class3_Sub28_Sub5 var9 = null;
+ if((this.aBoolean1846 || ClientCommands.tweeningEnabled) && var1 != -1 && var1 < this.frames.length) {
+ var1 = this.frames[var1];
+ var9 = Class3_Sub9.method133(var1 >> 16);
+ var1 &= 65535;
+ }
+
+ Model var10;
+ if(null == var9) {
+ var10 = var5.method1882(!var7.method559(var3), !var7.method561(var3, (byte)118), !this.aBoolean1848);
+ } else {
+ var10 = var5.method1882(!var7.method559(var3) & !var9.method559(var1), !var7.method561(var3, (byte)119) & !var9.method561(var1, (byte)118), !this.aBoolean1848);
+ }
+
+ var10.method1880(var7, var3, var9, var1, var2 + -1, var6, this.aBoolean1848);
+ return var10;
+ }
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "tk.G(" + var1 + ',' + var2 + ',' + var3 + ',' + (byte) -52 + ',' + (var5 != null?"{...}":"null") + ')');
+ }
+ }
+
+ private void parseOpcode(int opcode, DataBuffer buffer) {
+ try {
+ int count;
+ int index;
+ if(opcode == 1) {
+ count = buffer.readUnsignedShort();
+ this.duration = new int[count];
+
+ for(index = 0; count > index; ++index) {
+ this.duration[index] = buffer.readUnsignedShort();
+ }
+
+ this.frames = new int[count];
+
+ for(index = 0; count > index; ++index) {
+ this.frames[index] = buffer.readUnsignedShort();
+ }
+
+ for(index = 0; count > index; ++index) {
+ this.frames[index] += buffer.readUnsignedShort() << 16;
+ }
+ } else if(opcode == 2) {
+ this.anInt1865 = buffer.readUnsignedShort();
+ } else if(opcode == 3) {
+ this.aBooleanArray1855 = new boolean[256];
+ count = buffer.readUnsignedByte();
+
+ for(index = 0; index < count; ++index) {
+ this.aBooleanArray1855[buffer.readUnsignedByte()] = true;
+ }
+ } else if (opcode == 4) {
+ this.aBoolean1859 = true;
+ } else if (opcode == 5) {
+ this.forcedPriority = buffer.readUnsignedByte();
+ } else if (6 == opcode) {
+ this.leftHandItem = buffer.readUnsignedShort();
+ } else if (opcode == 7) {
+ this.rightHandItem = buffer.readUnsignedShort();
+ } else if (8 == opcode) {
+ this.maxLoops = buffer.readUnsignedByte();
+ } else if (9 == opcode) {
+ this.resetWhenWalk = buffer.readUnsignedByte();
+ } else if (10 == opcode) {
+ this.priority = buffer.readUnsignedByte();
+ } else if (opcode == 11) {
+ this.delayType = buffer.readUnsignedByte();
+ } else if (12 == opcode) {
+ count = buffer.readUnsignedByte();
+ this.baseIds = new int[count];
+
+ for (index = 0; index < count; ++index) {
+ this.baseIds[index] = buffer.readUnsignedShort();
+ }
+
+ for (index = 0; index < count; ++index) {
+ this.baseIds[index] += buffer.readUnsignedShort() << 16;
+ }
+ } else if (13 == opcode) {
+ count = buffer.readUnsignedShort();
+ this.sounds = new int[count][];
+
+ for (index = 0; index < count; ++index) {
+ int var6 = buffer.readUnsignedByte();
+ if (var6 > 0) {
+ this.sounds[index] = new int[var6];
+ this.sounds[index][0] = buffer.readMedium();
+
+ for (int var7 = 1; var7 < var6; ++var7) {
+ this.sounds[index][var7] = buffer.readUnsignedShort();
+ }
+ }
+ }
+ } else if (opcode == 14) {
+ this.aBoolean1848 = true;
+ } else if (15 == opcode) {
+ this.aBoolean1846 = true;
+ } else if (16 == opcode) {
+ this.aBoolean1872 = true;
+ }
+
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "tk.H(" + opcode + ',' + (byte) -73 + ',' + (buffer != null?"{...}":"null") + ')');
+ }
+ }
+
+ static void resetAll() {
+ try {
+ Class3_Sub26.anInt2556 = 0;
+ TextureOperation20.aBoolean2774 = true;
+ TextureOperation20.aLong1465 = 0L;
+ TextureOperation20.aClass67_1443.anInt1018 = 0;
+ TextureOperation26.aBoolean3078 = true;
+ TextureOperation.method153();
+ Class24.anInt469 = -1;
+ Class7.anInt2166 = -1;
+ Unsorted.incomingOpcode = -1;
+ Class159.anInt2023 = 0;
+ Class38_Sub1.anInt2617 = 0;
+ TextureOperation12.outgoingBuffer.index = 0;
+ LinkableRSString.anInt2582 = -1;
+ AbstractSprite.anInt3699 = 0;
+ BufferedDataStream.incomingBuffer.index = 0;
+
+ int var1;
+ for(var1 = 0; ClientErrorException.aClass96Array2114.length > var1; ++var1) {
+ ClientErrorException.aClass96Array2114[var1] = null;
+ }
+
+ Unsorted.menuOptionCount = 0;
+ Class38_Sub1.aBoolean2615 = false;
+ Class23.method940(119, 0);
+
+ for(var1 = 0; var1 < 100; ++var1) {
+ LinkableRSString.aStringArray2580[var1] = null;
+ }
+
+ Class164_Sub1.anInt3012 = 0;
+ TextureOperation20.anInt3216 = (int)(Math.random() * 100.0D) + -50;
+ Class45.anInt733 = 0;
+ GraphicDefinition.CAMERA_DIRECTION = 2047 & (int)(Math.random() * 20.0D) - 10;
+ Class58.anInt909 = -1;
+ Class159.localPlayerCount = 0;
+ Class161.anInt2028 = 0;
+ Unsorted.anInt42 = (int)(110.0D * Math.random()) + -55;
+ GameObject.aBoolean1837 = false;
+ Class164_Sub2.anInt3020 = -20 + (int)(30.0D * Math.random());
+ AudioHandler.currentSoundEffectCount = 0;
+ Class65.anInt987 = 0;
+ TextureOperation9.anInt3102 = -60 + (int)(Math.random() * 120.0D);
+ TextureOperation16.anInt3114 = 0;
+ LinkableRSString.anInt2589 = (int)(80.0D * Math.random()) - 40;
+ Class163.localNPCCount = 0;
+
+ for(var1 = 0; 2048 > var1; ++var1) {
+ Unsorted.players[var1] = null;
+ Class65.aClass3_Sub30Array986[var1] = null;
+ }
+
+ for(var1 = 0; var1 < 32768; ++var1) {
+ NPC.npcs[var1] = null;
+ }
+
+ Class102.player = Unsorted.players[2047] = new Player();
+ TextureOperation13.aLinkedList_3364.clear();
+ TextureOperation17.aLinkedList_3177.clear();
+ if(null != Class39.groundItems) {
+ for(var1 = 0; 4 > var1; ++var1) {
+ for(int var2 = 0; var2 < 104; ++var2) {
+ for(int var3 = 0; var3 < 104; ++var3) {
+ Class39.groundItems[var1][var2][var3] = null;
+ }
+ }
+ }
+ }
+
+ Scenery.sceneryList = new LinkedList();
+ CS2Script.anInt1357 = 0;
+ Class8.anInt104 = 0;
+ TextureOperation6.method176(-114);
+ TileData.method103();
+ Class75.anInt1105 = 0;
+ Class163_Sub2_Sub1.anInt4014 = 0;
+ Class157.anInt1996 = 0;
+ TextureOperation25.anInt3414 = 0;
+ Class146.anInt1904 = 0;
+ Unsorted.anInt30 = 0;
+ GraphicDefinition.anInt529 = 0;
+ MouseListeningClass.anInt1923 = 0;
+ Unsorted.anInt3631 = 0;
+ Class163_Sub2_Sub1.anInt4021 = 0;
+
+ for(var1 = 0; var1 < NPCDefinition.varcArray.length; ++var1) {
+ NPCDefinition.varcArray[var1] = -1;
+ }
+
+ if(ConfigInventoryDefinition.anInt3655 != -1) {
+ Class60.method1208((byte)-128, ConfigInventoryDefinition.anInt3655);
+ }
+
+ for(Class3_Sub31 var7 = TextureOperation23.aHashTable_3208.first(); var7 != null; var7 = TextureOperation23.aHashTable_3208.next()) {
+ TextureOperation19.method254(true, var7);
+ }
+
+ ConfigInventoryDefinition.anInt3655 = -1;
+ TextureOperation23.aHashTable_3208 = new HashTable(8);
+ Class3_Sub7.method122(-113);
+ TextureOperation27.aClass11_3087 = null;
+ Class38_Sub1.aBoolean2615 = false;
+ Unsorted.menuOptionCount = 0;
+ Unsorted.aClass52_1112.method1161(new int[]{0, 0, 0, 0, 0}, -1, false, null, -1);
+
+ for(var1 = 0; 8 > var1; ++var1) {
+ Class91.aStringArray1299[var1] = null;
+ Class1.aBooleanArray54[var1] = false;
+ TextureOperation35.anIntArray3328[var1] = -1;
+ }
+
+ Class3_Sub28_Sub9.method580((byte)80);
+ TextureOperation34.aBoolean3064 = true;
+
+ for(var1 = 0; var1 < 100; ++var1) {
+ Unsorted.aBooleanArray3674[var1] = true;
+ }
+
+ Unsorted.clanSize = 0;
+ PacketParser.aClass3_Sub19Array3694 = null;
+ RSInterface.aString_251 = null;
+
+ for(var1 = 0; 6 > var1; ++var1) {
+ TextureOperation29.aClass133Array3393[var1] = new Class133();
+ }
+
+ for(var1 = 0; var1 < 25; ++var1) {
+ TextureOperation17.anIntArray3185[var1] = 0;
+ Class3_Sub20.anIntArray2480[var1] = 0;
+ Class133.anIntArray1743[var1] = 0;
+ }
+
+ if(HDToolKit.highDetail) {
+ TextureOperation31.method236();
+ }
+
+ Unsorted.aBoolean4068 = true;
+ Class113.interfacePacketCounter = 0;
+ TextureOperation32.aString_3353 = TextCore.HasWalkHere;
+ Unsorted.aBoolean1084 = false;
+ TextureOperation38.aShortArray3455 = TextureOperation16.aShortArray3110 = Class136.aShortArray1779 = TextureOperation38.aShortArray3453 = new short[256];
+ InvalidateData.method165();
+ Unsorted.aBoolean1951 = false;
+ TextureOperation9.method204();
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "tk.A(" + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/ShaderInterface.java b/Client/src/main/java/org/runite/client/ShaderInterface.java
new file mode 100644
index 000000000..3e932ce74
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/ShaderInterface.java
@@ -0,0 +1,12 @@
+package org.runite.client;
+
+interface ShaderInterface {
+
+ void method21();
+
+ void method22();
+
+ void method23(int var1);
+
+ int method24();
+}
diff --git a/Client/src/main/java/org/runite/client/SignLinkAudioChannel.java b/Client/src/main/java/org/runite/client/SignLinkAudioChannel.java
new file mode 100644
index 000000000..094e1a902
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/SignLinkAudioChannel.java
@@ -0,0 +1,42 @@
+package org.runite.client;
+import java.awt.Component;
+
+final class SignLinkAudioChannel extends AudioChannel {
+
+ private final int anInt2969;
+ private static Interface1 anInterface1_2970;
+
+
+ final int method2157() {
+ return anInterface1_2970.method2((byte)118, this.anInt2969);
+ }
+
+ final void write() {
+ anInterface1_2970.method6(this.anInt2969, this.samples);
+ }
+
+ final void init(Component var1) throws Exception {
+ anInterface1_2970.method5(Class21.sampleRate, (byte)-39, var1, AudioChannel.stereo);
+ }
+
+ final void flush() {
+ anInterface1_2970.method1(this.anInt2969, 28544);
+ }
+
+ SignLinkAudioChannel(Signlink var1, int var2) {
+ anInterface1_2970 = var1.method1446((byte)99);
+ this.anInt2969 = var2;
+ }
+
+ final void open(int var1) throws Exception {
+ if(var1 > 32768) {
+ throw new IllegalArgumentException();
+ } else {
+ anInterface1_2970.method3(this.anInt2969, 25349, var1);
+ }
+ }
+
+ final void close() {
+ anInterface1_2970.method4((byte)20, this.anInt2969);
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/Signlink.java b/Client/src/main/java/org/runite/client/Signlink.java
new file mode 100644
index 000000000..78c8612c1
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Signlink.java
@@ -0,0 +1,688 @@
+package org.runite.client;
+
+import com.sun.opengl.impl.x11.DRIHack;
+import org.rs09.SystemLogger;
+
+import java.applet.Applet;
+import java.awt.*;
+import java.io.*;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class Signlink implements Runnable {
+
+ private static final Hashtable cachedFiles = new Hashtable<>(18);
+ public static String javaVersion;
+ public static String osName;
+ public static String osNameCS;
+ public static int anInt1214 = 1;
+ public static String javaVendor;
+ public static String osArchitecture;
+ public static Method setFocusCycleRoot;
+ public static Method setTraversalKeysEnabled;
+ static volatile long aLong1221 = 0L;
+ private static String homeDirectory;
+ private final Thread thread;
+ private final String gameName;
+ private final int cacheSubrevisionNum;
+ public RandomAccessFileWrapper[] cacheIndicesFiles;
+ public RandomAccessFileWrapper cacheDataFile;
+ public EventQueue systemEventQueue;
+ public RandomAccessFileWrapper cacheChecksumFile;
+ public RandomAccessFileWrapper randomDatFile;
+ public Applet gameApplet;
+ private boolean stopped;
+ private Class64 aClass64_1203 = null;
+ private Sensor sensor;
+ private Display display;
+ private Class64 aClass64_1213 = null;
+ private Interface1 anInterface1_1217;
+
+ private final int STAGE_LOAD_HDLIB = 10;
+
+
+ public Signlink(Applet applet, int var2, String gameName, int cacheIndexes) throws Exception {
+ javaVersion = "1.1";
+ this.gameName = gameName;
+ this.cacheSubrevisionNum = var2;
+ this.gameApplet = applet;
+ javaVendor = "Unknown";
+
+ try {
+ javaVendor = System.getProperty("java.vendor");
+ javaVersion = System.getProperty("java.version");
+ } catch (Exception var17) {
+ }
+
+ try {
+ osNameCS = System.getProperty("os.name");
+ } catch (Exception var16) {
+ osNameCS = "Unknown";
+ }
+
+ osName = osNameCS.toLowerCase();
+
+ try {
+ osArchitecture = System.getProperty("os.arch").toLowerCase();
+ } catch (Exception var15) {
+ osArchitecture = "";
+ }
+
+ try {
+ homeDirectory = System.getProperty("user.home");
+ if (homeDirectory != null) {
+ homeDirectory = homeDirectory + "/";
+ }
+ } catch (Exception var13) {
+ }
+
+ if (homeDirectory == null) {
+ homeDirectory = "~/";
+ }
+
+ try {
+ this.systemEventQueue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ } catch (Throwable var12) {
+ }
+
+ try {
+ if (applet == null) {
+ setTraversalKeysEnabled = Class.forName("java.awt.Component").getDeclaredMethod("setFocusTraversalKeysEnabled", Boolean.TYPE);
+ } else {
+ setTraversalKeysEnabled = applet.getClass().getMethod("setFocusTraversalKeysEnabled", Boolean.TYPE);
+ }
+ } catch (Exception var11) {
+ }
+
+ try {
+ if (applet == null) {
+ setFocusCycleRoot = Class.forName("java.awt.Container").getDeclaredMethod("setFocusCycleRoot", Boolean.TYPE);
+ } else {
+ setFocusCycleRoot = applet.getClass().getMethod("setFocusCycleRoot", Boolean.TYPE);
+ }
+ } catch (Exception var10) {
+ }
+
+ this.randomDatFile = new RandomAccessFileWrapper(getFileFromCacheFolder(null, this.cacheSubrevisionNum, "random.dat"), "rw", 25L);
+ this.cacheDataFile = new RandomAccessFileWrapper(getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, "main_file_cache.dat2"), "rw", 104857600L);
+ this.cacheChecksumFile = new RandomAccessFileWrapper(getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, "main_file_cache.idx255"), "rw", 1048576L);
+ this.cacheIndicesFiles = new RandomAccessFileWrapper[cacheIndexes];
+
+ for (int i = 0; i < cacheIndexes; ++i) {
+ this.cacheIndicesFiles[i] = new RandomAccessFileWrapper(getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, "main_file_cache.idx" + i), "rw", 1048576L);
+ }
+
+ try {
+ this.display = new Display();
+ } catch (Throwable var9) {
+ var9.printStackTrace();
+ }
+
+ try {
+ this.sensor = new Sensor();
+ } catch (Throwable var8) {
+ }
+
+ ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
+
+ for (ThreadGroup parent = threadGroup.getParent(); parent != null; parent = parent.getParent()) {
+ threadGroup = parent;
+ }
+
+ Thread[] threads = new Thread[1000];
+ threadGroup.enumerate(threads);
+
+ for (Thread value : threads) {
+ if (value != null && value.getName().startsWith("AWT")) {
+ value.setPriority(1);
+ }
+ }
+
+ this.stopped = false;
+ this.thread = new Thread(this);
+ this.thread.setPriority(10);
+ this.thread.setDaemon(true);
+ this.thread.start();
+ }
+
+ private static RandomAccessFileWrapper method1438(boolean var0, String var1) {
+ if (var0) {
+ method1438(true, null);
+ }
+
+ String[] var2 = new String[]{"c:/rscache/", "/rscache/", homeDirectory, "c:/windows/", "c:/winnt/", "c:/", "/tmp/", ""};
+
+ for (String var4 : var2) {
+ if (var4.length() <= 0 || (new File(var4)).exists()) {
+ try {
+ return new RandomAccessFileWrapper(new File(var4, "jagex_" + var1 + "_preferences.dat"), "rw", 10000L);
+ } catch (Exception var6) {
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public static File getFileFromCacheFolder(String gameName, int cacheSubRev, String filename) {
+ File cachedFile = cachedFiles.get(filename);
+ if (cachedFile == null) {
+ String[] basePaths = new String[]{homeDirectory, "c:/rscache/", "/rscache/", "c:/windows/", "c:/winnt/", "c:/", "/tmp/", ""};
+ String[] folders = new String[]{".runite_rs", ".530file_store_" + cacheSubRev};
+ for (int i = 0; i < 2; ++i) {
+ for (String folder : folders) {
+ for (String basePath : basePaths) {
+ String fullPath = basePath + folder + "/" + (gameName != null ? gameName + "/" : "") + filename;
+ RandomAccessFile raf = null;
+ try {
+ File file = new File(fullPath);
+ if (i != 0 || file.exists()) {
+ if (i != 1 || basePath.length() <= 0 || (new File(basePath)).exists()) {
+ (new File(basePath + folder)).mkdir();
+ if (gameName != null) {
+ (new File(basePath + folder + "/" + gameName)).mkdir();
+ }
+ // ClientLoader.getLibraryDownloader().updateDlls(var10.toString());
+ raf = new RandomAccessFile(file, "rw");
+ int var14 = raf.read();
+ raf.seek(0L);
+ raf.write(var14);
+ raf.seek(0L);
+ raf.close();
+ cachedFiles.put(filename, file);
+ return file;
+ }
+ }
+ } catch (Exception e) {
+ try {
+ if (raf != null) {
+ raf.close();
+ }
+ } catch (Exception e2) {
+ }
+ }
+ }
+ }
+ }
+
+ throw new RuntimeException();
+ } else {
+ return cachedFile;
+ }
+ }
+
+ public final void method1431() {
+ aLong1221 = TimeUtils.time() + 5000L;
+ }
+
+ public final boolean method1432(boolean var1) {
+ if (var1) {
+ this.cacheIndicesFiles = null;
+ }
+
+ return this.display != null;
+ }
+
+ public final Class64 method1433(String var1, int var2) {
+ if (var2 != 12) {
+ this.randomDatFile = null;
+ }
+
+ return this.method1435(12, 0, var1, 0);
+ }
+
+ public final void method1434(int[] var1, int var2, int var3, Component var4, Point var5, int var6) {
+ if (var2 == 10000) {
+ this.method1435(17, var6, new Object[]{var4, var1, var5}, var3);
+ }
+ }
+
+ private Class64 method1435(int var1, int var2, Object var3, int var4) {
+ Class64 var6 = new Class64();
+ var6.anInt980 = var2;
+ var6.anInt979 = var4;
+ var6.anInt975 = var1;
+ var6.anObject977 = var3;
+ synchronized (this) {
+ if (this.aClass64_1203 == null) {
+ this.aClass64_1203 = this.aClass64_1213 = var6;
+ } else {
+ this.aClass64_1203.aClass64_976 = var6;
+ this.aClass64_1203 = var6;
+ }
+
+ this.notify();
+ return var6;
+ }
+ }
+
+ public final Class64 method1436(Frame var1, int var2) {
+ if (var2 <= 78) {
+ this.gameApplet = null;
+ }
+
+ return this.method1435(7, 0, var1, 0);
+ }
+
+ public final Class64 method1439(boolean var1, URL var2) {
+ if (var1) {
+ this.cacheChecksumFile = null;
+ }
+
+ return this.method1435(4, 0, var2, 0);
+ }
+
+ public final Class64 method1441(byte var1, String address, int port) {
+ //System.out.println("var1: " + var1 + ", add: " + address + ":" + port);
+ return var1 != 8 ? null : this.method1435(1, 0, address, port);
+ }
+
+ public final void method1442(Class var1, int var2) {
+ if (var2 == 0) {
+ this.method1435(11, 0, var1, 0);
+ }
+ }
+
+ public final Class64 method1443(Class var1, Class[] var2, int var3, String var4) {
+ if (var3 > -7) {
+ homeDirectory = null;
+ }
+
+ return this.method1435(8, 0, new Object[]{var1, var4, var2}, 0);
+ }
+
+ public final void run() {
+// byte dat2status = Update.updateExists(1, "main_file_cache.dat2");
+
+ while (true) {
+ Class64 var1;
+ synchronized (this) {
+ while (true) {
+ if (this.stopped) {
+ return;
+ }
+
+ if (this.aClass64_1213 != null) {
+ var1 = this.aClass64_1213;
+ this.aClass64_1213 = this.aClass64_1213.aClass64_976;
+ if (this.aClass64_1213 == null) {
+ this.aClass64_1203 = null;
+ }
+ break;
+ }
+
+ try {
+ this.wait();
+ } catch (InterruptedException var11) {
+ }
+ }
+ }
+
+ try {
+ int stage = var1.anInt975;
+ if (stage == 1) {
+ if (TimeUtils.time() < aLong1221) {
+ throw new IOException();
+ }
+// System.out.println("Roar " + (String)var1.anObject977 + ", port " + var1.anInt979);
+ var1.anObject974 = new Socket(InetAddress.getByName((String) var1.anObject977), var1.anInt979);
+ } else if (2 == stage) {
+ Thread var16 = new Thread((Runnable) var1.anObject977);
+ var16.setDaemon(true);
+ var16.start();
+ var16.setPriority(var1.anInt979);
+ var1.anObject974 = var16;
+ } else if (stage == 4) {
+ if (TimeUtils.time() < aLong1221) {
+ throw new IOException();
+ }
+
+ var1.anObject974 = new DataInputStream(((URL) var1.anObject977).openStream());
+ } else {
+ Object[] var3;
+ if (stage == 8) {
+ var3 = (Object[]) var1.anObject977;
+ if (((Class) var3[0]).getClassLoader() == null) {
+ throw new SecurityException();
+ }
+
+ var1.anObject974 = ((Class) var3[0]).getDeclaredMethod((String) var3[1], (Class[]) var3[2]);
+ } else if (stage == 9) {
+ var3 = (Object[]) var1.anObject977;
+ if (((Class) var3[0]).getClassLoader() == null) {
+ throw new SecurityException();
+ }
+
+ var1.anObject974 = ((Class) var3[0]).getDeclaredField((String) var3[1]);
+ } else {
+ String var4;
+ if (stage == 3) {
+ if (aLong1221 > TimeUtils.time()) {
+ throw new IOException();
+ }
+
+ var4 = (var1.anInt979 >> 24 & 0xFF) + "." + (var1.anInt979 >> 16 & 0xFF) + "." + (var1.anInt979 >> 8 & 0xFF) + "." + (255 & var1.anInt979);
+ var1.anObject974 = InetAddress.getByName(var4).getHostName();
+ } else if (stage == 5) {
+ var1.anObject974 = this.display.method919(true);
+ } else if (stage == 6) {
+ Frame var5 = new Frame("Jagex Full Screen");
+ var1.anObject974 = var5;
+ var5.setResizable(false);
+ this.display.configureDisplayMode(-56, var1.anInt980 & 65535, var1.anInt980 >> 16, 65535 & var1.anInt979, var5, var1.anInt979 >>> 16);
+ } else if (stage == 7) {
+ this.display.updateDisplayMode();
+ } else if (stage == STAGE_LOAD_HDLIB) {
+ Class[] declaredMethodFields = new Class[]{Class.forName("java.lang.Class"), Class.forName("java.lang.String")};
+ Runtime runtime = Runtime.getRuntime();
+ Method libLoaderMethod;
+ Class clientClass = (Class) var1.anObject977;
+
+ if (!osName.startsWith("mac")) {
+ libLoaderMethod = Class.forName("java.lang.Runtime").getDeclaredMethod("loadLibrary0", declaredMethodFields);
+ libLoaderMethod.setAccessible(true);
+ libLoaderMethod.invoke(runtime, clientClass, "jawt");
+ libLoaderMethod.setAccessible(false);
+ }
+
+ boolean is64Bit = osArchitecture.contains("64");
+ boolean isSunOS = osName.startsWith("sunos");
+ //load0 is a reflection-based package-private method in Runtime. Not sure why jagex used this, but it's fucky.
+ libLoaderMethod = Class.forName("java.lang.Runtime").getDeclaredMethod("load0", declaredMethodFields);
+ libLoaderMethod.setAccessible(true);
+
+ SystemLogger.logInfo("Signlink - os Name: " + osName);
+ SystemLogger.logInfo("Signlink - os Arch: " + osArchitecture);
+
+ if (osArchitecture.equals("aarch64")) {
+ SystemLogger.logWarn("Going into HD will fail - current libs do not support ARM.");
+ throw new Exception();
+ }
+
+ if (osName.startsWith("linux") || isSunOS) {
+ String[] libs = createLibs("linux");
+ libLoaderMethod.invoke(runtime, clientClass, libs[2]);
+ DRIHack.begin();
+ libLoaderMethod.invoke(runtime, clientClass, libs[0]);
+ DRIHack.end();
+ libLoaderMethod.invoke(runtime, clientClass, libs[1]);
+ } else {
+ if(osName.startsWith("mac") && !osArchitecture.equals("ppc")) throw new Exception(); //We only have ppc libs for mac.
+ String[] libs = createLibs(osName.contains("win") ? "windows" : "macppc");
+ //Windows has to load them this way because temporary files are illegal.
+ String jogl = getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, libs[0]).toString();
+ String awt = getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, libs[1]).toString();
+ libLoaderMethod.invoke(runtime, clientClass, jogl);
+ libLoaderMethod.invoke(runtime, clientClass, awt);
+ }
+
+ libLoaderMethod.setAccessible(false);
+ } else {
+ int var18;
+ if (stage == 11) {
+ Field var20 = Class.forName("java.lang.ClassLoader").getDeclaredField("nativeLibraries");
+ var20.setAccessible(true);
+ Vector var24 = (Vector) var20.get(((Class) var1.anObject977).getClassLoader());
+
+ for (var18 = 0; var18 < var24.size(); ++var18) {
+ Object var26 = var24.elementAt(var18);
+ Method var9 = var26.getClass().getDeclaredMethod("finalize");
+ var9.setAccessible(true);
+ var9.invoke(var26);
+ var9.setAccessible(false);
+ Field var10 = var26.getClass().getDeclaredField("handle");
+ var10.setAccessible(true);
+ var10.set(var26, new Integer(0));
+ var10.setAccessible(false);
+ }
+
+ var20.setAccessible(false);
+ } else if (stage == 12) {
+ var4 = (String) var1.anObject977;
+ var1.anObject974 = method1438(false, var4);
+ } else if (stage == 14) {
+ int var22 = var1.anInt980;
+ int var23 = var1.anInt979;
+ this.sensor.moveMouse(var23, var22);
+ } else if (15 == stage) {
+ boolean var21 = var1.anInt979 != 0;
+ Component var27 = (Component) var1.anObject977;
+ this.sensor.updateComponent(var27, var21);
+ } else if (17 == stage) {
+ var3 = (Object[]) var1.anObject977;
+ this.sensor.setCursor((Component) var3[0], (Point) var3[2], var1.anInt979, var1.anInt980, (int[]) var3[1]);
+ } else {
+ if (16 != stage) {
+ throw new Exception();
+ }
+
+ try {
+ if (!osName.startsWith("win")) {
+ throw new Exception();
+ }
+
+ var4 = (String) var1.anObject977;
+ if (!var4.startsWith("http://") && !var4.startsWith("https://")) {
+ throw new Exception();
+ }
+
+ String var25 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?&=,.%+-_#:/*";
+
+ for (var18 = 0; var18 < var4.length(); ++var18) {
+ if (var25.indexOf(var4.charAt(var18)) == -1) {
+ throw new Exception();
+ }
+ }
+
+ Runtime.getRuntime().exec("cmd /c start \"j\" \"" + var4 + "\"");
+ var1.anObject974 = null;
+ } catch (Exception var12) {
+ var1.anObject974 = var12;
+ }
+ }
+ }
+ }
+ }
+
+ var1.anInt978 = 1;
+ } catch (ThreadDeath var13) {
+ throw var13;
+ } catch (Throwable var14) {
+ var1.anInt978 = 2;
+ }
+ }
+ }
+
+ /**
+ * Extracts the libs from the client resources
+ * @param os The OS in use: windows, macppc, or linux
+ * @return an array of the created filenames to load.
+ * @author Ceikry
+ */
+ public String[] createLibs(String os) throws Throwable {
+ ArrayList filenames = new ArrayList<>();
+ String jogl;
+ String awt;
+ String glueGen = "";
+ boolean isGluegenRequired = false;
+ boolean is64Bit = osArchitecture.contains("64");
+ boolean isWindowsOrMac = os.equals("macppc") || os.equals("windows");
+
+ String fileExtension = os.equals("windows") ? ".dll" : os.equals("macppc") ? ".jnilib" : ".so";
+
+ jogl = (os.equals("windows") ? "jogl" : "libjogl") +
+ (is64Bit ? "_64" : "_32") + fileExtension;
+
+ awt = (os.equals("windows") ? "jogl_awt" : "libjogl_awt") +
+ (is64Bit ? "_64" : "_32") + fileExtension;
+
+ if(!isWindowsOrMac) isGluegenRequired = true;
+ if(isGluegenRequired) glueGen = "libgluegen-rt_" + (is64Bit ? "64" : "32") + ".so";
+
+ File joglLib = isWindowsOrMac ? getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, "jogl.dll") : File.createTempFile("jogl", "." + jogl.split("\\.")[1]);
+ File awtLib = isWindowsOrMac ? getFileFromCacheFolder(this.gameName, this.cacheSubrevisionNum, "jogl_awt.dll") : File.createTempFile("jogl_awt", "." + awt.split("\\.")[1]);
+
+ try (InputStream in = getClass().getResourceAsStream("/lib/" + jogl); OutputStream out = openOutputStream(joglLib)) {
+ if (in == null) throw new FileNotFoundException("Needed library does not exist: " + jogl);
+ copyFile(in, out);
+ filenames.add(isWindowsOrMac ? joglLib.getName() : joglLib.getAbsolutePath());
+ }
+
+ try (InputStream in = getClass().getResourceAsStream("/lib/" + awt); OutputStream out = openOutputStream(awtLib)) {
+ if (in == null) throw new FileNotFoundException("Needed library does not exist: " + awt);
+ copyFile(in, out);
+ filenames.add(isWindowsOrMac ? awtLib.getName() : awtLib.getAbsolutePath());
+ }
+
+ if (isGluegenRequired) {
+ File glueLib = File.createTempFile("libgluegen", ".so");
+ try (InputStream in = getClass().getResourceAsStream("/lib/" + glueGen); OutputStream out = openOutputStream(glueLib)) {
+ if (in == null) throw new FileNotFoundException("Needed library does not exist: " + glueGen);
+ copyFile(in, out);
+ filenames.add(glueLib.getAbsolutePath());
+ }
+ }
+
+
+ return filenames.toArray(new String[]{});
+ }
+
+ public final Class64 method1444(int var1, Class var2) {
+ if (var1 > -13) {
+ this.method1435(88, -20, null, 76);
+ }
+
+ return this.method1435(10, 0, var2, 0);
+ }
+
+ public final void method1445(int var1) {
+ synchronized (this) {
+ this.stopped = true;
+ this.notifyAll();
+ }
+
+ try {
+ this.thread.join();
+ } catch (InterruptedException var8) {
+ }
+
+ if (var1 != 0) {
+ method1438(false, null);
+ }
+
+ if (this.cacheDataFile != null) {
+ try {
+ this.cacheDataFile.close();
+ } catch (IOException var7) {
+ }
+ }
+
+ if (this.cacheChecksumFile != null) {
+ try {
+ this.cacheChecksumFile.close();
+ } catch (IOException var6) {
+ }
+ }
+
+ if (this.cacheIndicesFiles != null) {
+ for (int var2 = 0; var2 < this.cacheIndicesFiles.length; ++var2) {
+ if (this.cacheIndicesFiles[var2] != null) {
+ try {
+ this.cacheIndicesFiles[var2].close();
+ } catch (IOException var5) {
+ }
+ }
+ }
+ }
+
+ if (this.randomDatFile != null) {
+ try {
+ this.randomDatFile.close();
+ } catch (IOException var4) {
+ }
+ }
+
+ }
+
+ public final Interface1 method1446(byte var1) {
+ if (var1 < 71) {
+ this.method1452(null, true);
+ }
+
+ //return this.anInterface1_1217;
+ return null;
+ }
+
+ public final Class64 method1447(int var1, String var2, Class var3) {
+ if (var1 > -39) {
+ this.method1452(null, true);
+ }
+
+ return this.method1435(9, 0, new Object[]{var3, var2}, 0);
+ }
+
+ public final Class64 method1449(int var1, int var2) {
+ if (var1 != 3) {
+ this.cacheChecksumFile = null;
+ }
+
+ return this.method1435(3, 0, null, var2);
+ }
+
+ public final Class64 method1450(int var1, int var2, int var3, int var4) {
+ return this.method1435(6, var1 + (var2 << 16), null, (var4 << 16) + var3);
+ }
+
+ public final Class64 startThread(int var2, Runnable var3) {
+ return this.method1435(2, 0, var3, var2);
+ }
+
+ public final Class64 method1452(String var1, boolean var2) {
+ if (!var2) {
+ this.method1436(null, 101);
+ }
+
+ return this.method1435(16, 0, var1, 0);
+ }
+
+ public final Class64 method1453(byte var1) {
+ if (var1 < 7) {
+ this.method1443(null, null, -91, null);
+ }
+
+ return this.method1435(5, 0, null, 0);
+ }
+
+ private static FileOutputStream openOutputStream(final File file) throws IOException {
+ if (file.exists()) {
+ if (file.isDirectory()) {
+ throw new IOException("File '" + file + "' exists but is a directory");
+ }
+ if (!file.canWrite()) {
+ throw new IOException("File '" + file + "' cannot be written to");
+ }
+ } else {
+ final File parent = file.getParentFile();
+ if (parent != null) {
+ if (!parent.mkdirs() && !parent.isDirectory()) {
+ throw new IOException("Directory '" + parent + "' could not be created");
+ }
+ }
+ }
+ return new FileOutputStream(file);
+ }
+
+ private static void copyFile(final InputStream input, final OutputStream output) throws IOException {
+ byte[] buffer = new byte[1024 * 4];
+ int n;
+ while (-1 != (n = input.read(buffer))) {
+ output.write(buffer, 0, n);
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/SoftwareSprite.java b/Client/src/main/java/org/runite/client/SoftwareSprite.java
new file mode 100644
index 000000000..182167e2b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/SoftwareSprite.java
@@ -0,0 +1,1374 @@
+package org.runite.client;
+
+import org.rs09.client.rendering.Toolkit;
+
+public class SoftwareSprite extends AbstractSprite {
+
+ int[] anIntArray4081;
+
+
+ final void method652(int var1) {
+ if(this.width != this.anInt3697 || this.height != this.anInt3706) {
+ int var2 = var1;
+ if(var1 > this.anInt3701) {
+ var2 = this.anInt3701;
+ }
+
+ int var3 = var1;
+ if(var1 + this.anInt3701 + this.width > this.anInt3697) {
+ var3 = this.anInt3697 - this.anInt3701 - this.width;
+ }
+
+ int var4 = var1;
+ if(var1 > this.anInt3698) {
+ var4 = this.anInt3698;
+ }
+
+ int var5 = var1;
+ if(var1 + this.anInt3698 + this.height > this.anInt3706) {
+ var5 = this.anInt3706 - this.anInt3698 - this.height;
+ }
+
+ int var6 = this.width + var2 + var3;
+ int var7 = this.height + var4 + var5;
+ int[] var8 = new int[var6 * var7];
+
+ for(int var9 = 0; var9 < this.height; ++var9) {
+ for(int var10 = 0; var10 < this.width; ++var10) {
+ var8[(var9 + var4) * var6 + var10 + var2] = this.anIntArray4081[var9 * this.width + var10];
+ }
+ }
+
+ this.anIntArray4081 = var8;
+ this.width = var6;
+ this.height = var7;
+ this.anInt3701 -= var2;
+ this.anInt3698 -= var4;
+ }
+ }
+
+ final void method653() {
+ int[] var1 = new int[this.width * this.height];
+ int var2 = 0;
+
+ for(int var3 = 0; var3 < this.height; ++var3) {
+ for(int var4 = this.width - 1; var4 >= 0; --var4) {
+ var1[var2++] = this.anIntArray4081[var4 + var3 * this.width];
+ }
+ }
+
+ this.anIntArray4081 = var1;
+ this.anInt3701 = this.anInt3697 - this.width - this.anInt3701;
+ }
+
+ void method635(int var1, int var2) {
+ var1 += this.anInt3701;
+ var2 += this.anInt3698;
+ int var3 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var4 = 0;
+ int var5 = this.height;
+ int var6 = this.width;
+ int var7 = Toolkit.JAVA_TOOLKIT.width - var6;
+ int var8 = 0;
+ int var9;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var5 -= var9;
+ var2 = Toolkit.JAVA_TOOLKIT.clipTop;
+ var4 += var9 * var6;
+ var3 += var9 * Toolkit.JAVA_TOOLKIT.width;
+ }
+
+ if(var2 + var5 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var5 -= var2 + var5 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var6 -= var9;
+ var1 = Toolkit.JAVA_TOOLKIT.clipLeft;
+ var4 += var9;
+ var3 += var9;
+ var8 += var9;
+ var7 += var9;
+ }
+
+ if(var1 + var6 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var9 = var1 + var6 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var6 -= var9;
+ var8 += var9;
+ var7 += var9;
+ }
+
+ if(var6 > 0 && var5 > 0) {
+ method659(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var4, var3, var6, var5, var7, var8);
+ }
+ }
+
+ private static void method654(int[] var0, int[] var1, int var3, int var4, int var5, int var6, int var7, int var8) {
+ int var9 = -(var5 >> 2);
+ var5 = -(var5 & 3);
+
+ for(int var10 = -var6; var10 < 0; ++var10) {
+ int var11;
+ int var2;
+ for(var11 = var9; var11 < 0; ++var11) {
+ var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+ }
+
+ for(var11 = var5; var11 < 0; ++var11) {
+ var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+ }
+
+ var4 += var7;
+ var3 += var8;
+ }
+
+ }
+
+ final int[] method655() {
+ int[] var4 = new int[this.anInt3697 * this.anInt3706];
+
+ for(int var5 = 0; var5 < this.height; ++var5) {
+ int var1 = var5 * this.width;
+ int var2 = this.anInt3701 + (var5 + this.anInt3698) * this.anInt3697;
+
+ for(int var6 = 0; var6 < this.width; ++var6) {
+ int var3 = this.anIntArray4081[var1++];
+ var4[var2++] = var3 != 0?-16777216 | var3:0;
+ }
+ }
+
+ return var4;
+ }
+
+ void method636(int var1, int var2, int var3, int var4, int var5, int var6) {
+ if(var6 != 0) {
+ var1 -= this.anInt3701 << 4;
+ var2 -= this.anInt3698 << 4;
+ double var7 = (double)(var5 & 65535) * 9.587379924285257E-5D;
+ int var9 = (int)Math.floor(Math.sin(var7) * (double)var6 + 0.5D);
+ int var10 = (int)Math.floor(Math.cos(var7) * (double)var6 + 0.5D);
+ int var11 = -var1 * var10 + -var2 * var9;
+ int var12 = -(-var1) * var9 + -var2 * var10;
+ int var13 = ((this.width << 4) - var1) * var10 + -var2 * var9;
+ int var14 = -((this.width << 4) - var1) * var9 + -var2 * var10;
+ int var15 = -var1 * var10 + ((this.height << 4) - var2) * var9;
+ int var16 = -(-var1) * var9 + ((this.height << 4) - var2) * var10;
+ int var17 = ((this.width << 4) - var1) * var10 + ((this.height << 4) - var2) * var9;
+ int var18 = -((this.width << 4) - var1) * var9 + ((this.height << 4) - var2) * var10;
+ int var19;
+ int var20;
+ if(var11 < var13) {
+ var19 = var11;
+ var20 = var13;
+ } else {
+ var19 = var13;
+ var20 = var11;
+ }
+
+ if(var15 < var19) {
+ var19 = var15;
+ }
+
+ if(var17 < var19) {
+ var19 = var17;
+ }
+
+ if(var15 > var20) {
+ var20 = var15;
+ }
+
+ if(var17 > var20) {
+ var20 = var17;
+ }
+
+ int var21;
+ int var22;
+ if(var12 < var14) {
+ var21 = var12;
+ var22 = var14;
+ } else {
+ var21 = var14;
+ var22 = var12;
+ }
+
+ if(var16 < var21) {
+ var21 = var16;
+ }
+
+ if(var18 < var21) {
+ var21 = var18;
+ }
+
+ if(var16 > var22) {
+ var22 = var16;
+ }
+
+ if(var18 > var22) {
+ var22 = var18;
+ }
+
+ var19 >>= 12;
+ var20 = var20 + 4095 >> 12;
+ var21 >>= 12;
+ var22 = var22 + 4095 >> 12;
+ var19 += var3;
+ var20 += var3;
+ var21 += var4;
+ var22 += var4;
+ var19 >>= 4;
+ var20 = var20 + 15 >> 4;
+ var21 >>= 4;
+ var22 = var22 + 15 >> 4;
+ if(var19 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var19 = Toolkit.JAVA_TOOLKIT.clipLeft;
+ }
+
+ if(var20 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var20 = Toolkit.JAVA_TOOLKIT.clipRight;
+ }
+
+ if(var21 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var21 = Toolkit.JAVA_TOOLKIT.clipTop;
+ }
+
+ if(var22 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var22 = Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ var20 = var19 - var20;
+ if(var20 < 0) {
+ var22 = var21 - var22;
+ if(var22 < 0) {
+ int var23 = var21 * Toolkit.JAVA_TOOLKIT.width + var19;
+ double var24 = 1.6777216E7D / (double)var6;
+ int var26 = (int)Math.floor(Math.sin(var7) * var24 + 0.5D);
+ int var27 = (int)Math.floor(Math.cos(var7) * var24 + 0.5D);
+ int var28 = (var19 << 4) + 8 - var3;
+ int var29 = (var21 << 4) + 8 - var4;
+ int var30 = (var1 << 8) - (var29 * var26 >> 4);
+ int var31 = (var2 << 8) + (var29 * var27 >> 4);
+ int var34;
+ int var35;
+ int var32;
+ int var33;
+ int var38;
+ int var36;
+ int var37;
+ if(var27 == 0) {
+ if(var26 == 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30;
+ var36 = var31;
+ var37 = var20;
+ if(var30 >= 0 && var31 >= 0 && var30 - (this.width << 12) < 0 && var31 - (this.height << 12) < 0) {
+ for(; var37 < 0; ++var37) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+ }
+ }
+
+ ++var33;
+ }
+ } else if(var26 < 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30;
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if(var30 >= 0 && var30 - (this.width << 12) < 0) {
+ if((var32 = var36 - (this.height << 12)) >= 0) {
+ var32 = (var26 - var32) / var26;
+ var37 = var20 + var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (var36 - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var36 += var26;
+ ++var37;
+ }
+ }
+
+ ++var33;
+ var30 -= var26;
+ }
+ } else {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30;
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if(var30 >= 0 && var30 - (this.width << 12) < 0) {
+ if(var36 < 0) {
+ var32 = (var26 - 1 - var36) / var26;
+ var37 = var20 + var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (1 + var36 - (this.height << 12) - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var36 += var26;
+ ++var37;
+ }
+ }
+
+ ++var33;
+ var30 -= var26;
+ }
+ }
+ } else if(var27 < 0) {
+ if(var26 == 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31;
+ var37 = var20;
+ if(var31 >= 0 && var31 - (this.height << 12) < 0) {
+ if((var32 = var35 - (this.width << 12)) >= 0) {
+ var32 = (var27 - var32) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (var35 - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ ++var37;
+ }
+ }
+
+ ++var33;
+ var31 += var27;
+ }
+ } else if(var26 < 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if((var32 = var35 - (this.width << 12)) >= 0) {
+ var32 = (var27 - var32) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (var35 - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ if((var32 = var36 - (this.height << 12)) >= 0) {
+ var32 = (var26 - var32) / var26;
+ var37 += var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 += var32;
+ }
+
+ if((var32 = (var36 - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ var36 += var26;
+ ++var37;
+ }
+
+ ++var33;
+ var30 -= var26;
+ var31 += var27;
+ }
+ } else {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if((var32 = var35 - (this.width << 12)) >= 0) {
+ var32 = (var27 - var32) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (var35 - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ if(var36 < 0) {
+ var32 = (var26 - 1 - var36) / var26;
+ var37 += var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 += var32;
+ }
+
+ if((var32 = (1 + var36 - (this.height << 12) - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ var36 += var26;
+ ++var37;
+ }
+
+ ++var33;
+ var30 -= var26;
+ var31 += var27;
+ }
+ }
+ } else if(var26 == 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31;
+ var37 = var20;
+ if(var31 >= 0 && var31 - (this.height << 12) < 0) {
+ if(var35 < 0) {
+ var32 = (var27 - 1 - var35) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (1 + var35 - (this.width << 12) - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ ++var37;
+ }
+ }
+
+ ++var33;
+ var31 += var27;
+ }
+ } else if(var26 < 0) {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if(var35 < 0) {
+ var32 = (var27 - 1 - var35) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (1 + var35 - (this.width << 12) - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ if((var32 = var36 - (this.height << 12)) >= 0) {
+ var32 = (var26 - var32) / var26;
+ var37 += var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 += var32;
+ }
+
+ if((var32 = (var36 - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ var36 += var26;
+ ++var37;
+ }
+
+ ++var33;
+ var30 -= var26;
+ var31 += var27;
+ }
+ } else {
+ for(var33 = var22; var33 < 0; var23 += Toolkit.JAVA_TOOLKIT.width) {
+ var34 = var23;
+ var35 = var30 + (var28 * var27 >> 4);
+ var36 = var31 + (var28 * var26 >> 4);
+ var37 = var20;
+ if(var35 < 0) {
+ var32 = (var27 - 1 - var35) / var27;
+ var37 = var20 + var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 = var23 + var32;
+ }
+
+ if((var32 = (1 + var35 - (this.width << 12) - var27) / var27) > var37) {
+ var37 = var32;
+ }
+
+ if(var36 < 0) {
+ var32 = (var26 - 1 - var36) / var26;
+ var37 += var32;
+ var35 += var27 * var32;
+ var36 += var26 * var32;
+ var34 += var32;
+ }
+
+ if((var32 = (1 + var36 - (this.height << 12) - var26) / var26) > var37) {
+ var37 = var32;
+ }
+
+ while(var37 < 0) {
+ var38 = this.anIntArray4081[(var36 >> 12) * this.width + (var35 >> 12)];
+ if(var38 == 0) {
+ ++var34;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var34++] = var38;
+ }
+
+ var35 += var27;
+ var36 += var26;
+ ++var37;
+ }
+
+ ++var33;
+ var30 -= var26;
+ var31 += var27;
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+ private static void method656(int[] var0, int[] var1, int var3, int var4, int var5, int var6, int var7, int var8) {
+ int var9 = -(var5 >> 2);
+ var5 = -(var5 & 3);
+
+ for(int var10 = -var6; var10 < 0; ++var10) {
+ int var11;
+ int var2;
+ for(var11 = var9; var11 < 0; ++var11) {
+ var2 = var1[var3--];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3--];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3--];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+
+ var2 = var1[var3--];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+ }
+
+ for(var11 = var5; var11 < 0; ++var11) {
+ var2 = var1[var3--];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ var0[var4++] = var2;
+ }
+ }
+
+ var4 += var7;
+ var3 += var8;
+ }
+
+ }
+
+ final void method657(int var1) {
+ int[] var2 = new int[this.width * this.height];
+ int var3 = 0;
+
+ for(int var4 = 0; var4 < this.height; ++var4) {
+ for(int var5 = 0; var5 < this.width; ++var5) {
+ int var6 = this.anIntArray4081[var3];
+ if(var6 == 0) {
+ if(var5 > 0 && this.anIntArray4081[var3 - 1] != 0) {
+ var6 = var1;
+ } else if(var4 > 0 && this.anIntArray4081[var3 - this.width] != 0) {
+ var6 = var1;
+ } else if(var5 < this.width - 1 && this.anIntArray4081[var3 + 1] != 0) {
+ var6 = var1;
+ } else if(var4 < this.height - 1 && this.anIntArray4081[var3 + this.width] != 0) {
+ var6 = var1;
+ }
+ }
+
+ var2[var3++] = var6;
+ }
+ }
+
+ this.anIntArray4081 = var2;
+ }
+
+ final void method658() {
+ Class74.setBuffer(this.anIntArray4081, this.width, this.height);
+ }
+
+ private static void method659(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ for(int var8 = -var5; var8 < 0; ++var8) {
+ int var9;
+ for(var9 = var3 + var4 - 3; var3 < var9; var0[var3++] = var1[var2++]) {
+ var0[var3++] = var1[var2++];
+ var0[var3++] = var1[var2++];
+ var0[var3++] = var1[var2++];
+ }
+
+ for(var9 += 3; var3 < var9; var0[var3++] = var1[var2++]) {
+ }
+
+ var3 += var6;
+ var2 += var7;
+ }
+
+ }
+
+ void method660(int var1, int var2, double var7) {
+ try {
+ int var10 = -20 / 2;
+ int var11 = -20 / 2;
+ int var12 = (int)(Math.sin(var7) * 65536.0D);
+ int var13 = (int)(Math.cos(var7) * 65536.0D);
+ var12 = var12 * 256 >> 8;
+ var13 = var13 * 256 >> 8;
+ int var14 = (15 << 16) + var11 * var12 + var10 * var13;
+ int var15 = (15 << 16) + (var11 * var13 - var10 * var12);
+ int var16 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+
+ for(var2 = 0; var2 < 20; ++var2) {
+ int var17 = var16;
+ int var18 = var14;
+ int var19 = var15;
+
+ for(var1 = -20; var1 < 0; ++var1) {
+ int var20 = this.anIntArray4081[(var18 >> 16) + (var19 >> 16) * this.width];
+ if(var20 == 0) {
+ ++var17;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var17++] = var20;
+ }
+
+ var18 += var13;
+ var19 -= var12;
+ }
+
+ var14 += var12;
+ var15 += var13;
+ var16 += Toolkit.JAVA_TOOLKIT.width;
+ }
+ } catch (Exception var21) {
+ }
+
+ }
+
+ void method641(int var1, int var2) {
+ var1 += this.anInt3697 - this.width - this.anInt3701;
+ var2 += this.anInt3698;
+ int var3 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var4 = this.width - 1;
+ int var5 = this.height;
+ int var6 = this.width;
+ int var7 = Toolkit.JAVA_TOOLKIT.width - var6;
+ int var8 = var6 + var6;
+ int var9;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var5 -= var9;
+ var2 = Toolkit.JAVA_TOOLKIT.clipTop;
+ var4 += var9 * var6;
+ var3 += var9 * Toolkit.JAVA_TOOLKIT.width;
+ }
+
+ if(var2 + var5 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var5 -= var2 + var5 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var6 -= var9;
+ var1 = Toolkit.JAVA_TOOLKIT.clipLeft;
+ var4 -= var9;
+ var3 += var9;
+ var8 -= var9;
+ var7 += var9;
+ }
+
+ if(var1 + var6 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var9 = var1 + var6 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var6 -= var9;
+ var8 -= var9;
+ var7 += var9;
+ }
+
+ if(var6 > 0 && var5 > 0) {
+ method656(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var4, var3, var6, var5, var7, var8);
+ }
+ }
+
+ SoftwareSprite(int var1, int var2, int var3, int var4, int var5, int var6, int[] var7) {
+ this.anInt3697 = var1;
+ this.anInt3706 = var2;
+ this.anInt3701 = var3;
+ this.anInt3698 = var4;
+ this.width = var5;
+ this.height = var6;
+ this.anIntArray4081 = var7;
+ }
+
+ void method637(int var1, int var2, int var3) {
+ var1 += this.anInt3701;
+ var2 += this.anInt3698;
+ int var4 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var5 = 0;
+ int var6 = this.height;
+ int var7 = this.width;
+ int var8 = Toolkit.JAVA_TOOLKIT.width - var7;
+ int var9 = 0;
+ int var10;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var10 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var6 -= var10;
+ var2 = Toolkit.JAVA_TOOLKIT.clipTop;
+ var5 += var10 * var7;
+ var4 += var10 * Toolkit.JAVA_TOOLKIT.width;
+ }
+
+ if(var2 + var6 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var6 -= var2 + var6 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var10 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var7 -= var10;
+ var1 = Toolkit.JAVA_TOOLKIT.clipLeft;
+ var5 += var10;
+ var4 += var10;
+ var9 += var10;
+ var8 += var10;
+ }
+
+ if(var1 + var7 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var10 = var1 + var7 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var7 -= var10;
+ var9 += var10;
+ var8 += var10;
+ }
+
+ if(var7 > 0 && var6 > 0) {
+ method662(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var5, var4, var7, var6, var8, var9, var3);
+ }
+ }
+
+ private static void method661(int[] var0, int[] var1, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12) {
+ int var13 = 256 - var12;
+ int var14 = var3;
+
+ for(int var15 = -var8; var15 < 0; ++var15) {
+ int var16 = (var4 >> 16) * var11;
+
+ for(int var17 = -var7; var17 < 0; ++var17) {
+ int var2 = var1[(var3 >> 16) + var16];
+ if(var2 == 0) {
+ ++var5;
+ } else {
+ int var18 = var0[var5];
+ var0[var5++] = ((var2 & 16711935) * var12 + (var18 & 16711935) * var13 & -16711936) + ((var2 & 65280) * var12 + (var18 & 65280) * var13 & 16711680) >> 8;
+ }
+
+ var3 += var9;
+ }
+
+ var4 += var10;
+ var3 = var14;
+ var5 += var6;
+ }
+
+ }
+
+ private static void method662(int[] var0, int[] var1, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
+ int var10 = 256 - var9;
+
+ for(int var11 = -var6; var11 < 0; ++var11) {
+ for(int var12 = -var5; var12 < 0; ++var12) {
+ int var2 = var1[var3++];
+ if(var2 == 0) {
+ ++var4;
+ } else {
+ int var13 = var0[var4];
+ var0[var4++] = ((var2 & 16711935) * var9 + (var13 & 16711935) * var10 & -16711936) + ((var2 & 65280) * var9 + (var13 & 65280) * var10 & 16711680) >> 8;
+ }
+ }
+
+ var4 += var7;
+ var3 += var8;
+ }
+
+ }
+
+ public void drawAt(int var1, int var2) {
+ var1 += this.anInt3701;
+ var2 += this.anInt3698;
+ int var3 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var4 = 0;
+ int var5 = this.height;
+ int var6 = this.width;
+ int var7 = Toolkit.JAVA_TOOLKIT.width - var6;
+ int var8 = 0;
+ int var9;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var5 -= var9;
+ var2 = Toolkit.JAVA_TOOLKIT.clipTop;
+ var4 += var9 * var6;
+ var3 += var9 * Toolkit.JAVA_TOOLKIT.width;
+ }
+
+ if(var2 + var5 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var5 -= var2 + var5 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var9 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var6 -= var9;
+ var1 = Toolkit.JAVA_TOOLKIT.clipLeft;
+ var4 += var9;
+ var3 += var9;
+ var8 += var9;
+ var7 += var9;
+ }
+
+ if(var1 + var6 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var9 = var1 + var6 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var6 -= var9;
+ var8 += var9;
+ var7 += var9;
+ }
+
+ if(var6 > 0 && var5 > 0) {
+ method654(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var4, var3, var6, var5, var7, var8);
+ }
+ }
+
+ final void method663() {
+ int[] var1 = new int[this.width * this.height];
+ int var2 = 0;
+
+ for(int var3 = this.height - 1; var3 >= 0; --var3) {
+ for(int var4 = 0; var4 < this.width; ++var4) {
+ var1[var2++] = this.anIntArray4081[var4 + var3 * this.width];
+ }
+ }
+
+ this.anIntArray4081 = var1;
+ this.anInt3698 = this.anInt3706 - this.height - this.anInt3698;
+ }
+
+ public void drawMinimapRegion(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int[] var9, int[] var10) {
+ try {
+ int var11 = -var3 / 2;
+ int var12 = -var4 / 2;
+ int var13 = (int)(Math.sin((double)var7 / 326.11D) * 65536.0D);
+ int var14 = (int)(Math.cos((double)var7 / 326.11D) * 65536.0D);
+ var13 = var13 * var8 >> 8;
+ var14 = var14 * var8 >> 8;
+ int var15 = (var5 << 16) + var12 * var13 + var11 * var14;
+ int var16 = (var6 << 16) + (var12 * var14 - var11 * var13);
+ int var17 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+
+ for(var2 = 0; var2 < var4; ++var2) {
+ int var18 = var9[var2];
+ int var19 = var17 + var18;
+ int var20 = var15 + var14 * var18;
+ int var21 = var16 - var13 * var18;
+
+ for(var1 = -var10[var2]; var1 < 0; ++var1) {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var19++] = this.anIntArray4081[(var20 >> 16) + (var21 >> 16) * this.width];
+ var20 += var14;
+ var21 -= var13;
+ }
+
+ var15 += var13;
+ var16 += var14;
+ var17 += Toolkit.JAVA_TOOLKIT.width;
+ }
+ } catch (Exception var22) {
+ }
+
+ }
+
+ final void method665() {
+ if(this.width != this.anInt3697 || this.height != this.anInt3706) {
+ int[] var1 = new int[this.anInt3697 * this.anInt3706];
+
+ for(int var2 = 0; var2 < this.height; ++var2) {
+ for(int var3 = 0; var3 < this.width; ++var3) {
+ var1[(var2 + this.anInt3698) * this.anInt3697 + var3 + this.anInt3701] = this.anIntArray4081[var2 * this.width + var3];
+ }
+ }
+
+ this.anIntArray4081 = var1;
+ this.width = this.anInt3697;
+ this.height = this.anInt3706;
+ this.anInt3701 = 0;
+ this.anInt3698 = 0;
+ }
+ }
+
+ final void drawMinimapIcons(int interfaceWidth, int interfaceHeight, int[] var3, int[] var4) {
+ if(Toolkit.JAVA_TOOLKIT.clipBottom - Toolkit.JAVA_TOOLKIT.clipTop == var3.length) {
+ interfaceWidth += this.anInt3701;
+ interfaceHeight += this.anInt3698;
+ int var5 = 0;
+ int var6 = this.height;
+ int var7 = this.width;
+ int var8 = Toolkit.JAVA_TOOLKIT.width - var7;
+ int var9 = 0;
+ int var10 = interfaceWidth + interfaceHeight * Toolkit.JAVA_TOOLKIT.width;
+ int var11;
+ if(interfaceHeight < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var11 = Toolkit.JAVA_TOOLKIT.clipTop - interfaceHeight;
+ var6 -= var11;
+ interfaceHeight = Toolkit.JAVA_TOOLKIT.clipTop;
+ var5 += var11 * var7;
+ var10 += var11 * Toolkit.JAVA_TOOLKIT.width;
+ }
+
+ if(interfaceHeight + var6 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var6 -= interfaceHeight + var6 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ if(interfaceWidth < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var11 = Toolkit.JAVA_TOOLKIT.clipLeft - interfaceWidth;
+ var7 -= var11;
+ interfaceWidth = Toolkit.JAVA_TOOLKIT.clipLeft;
+ var5 += var11;
+ var10 += var11;
+ var9 += var11;
+ var8 += var11;
+ }
+
+ if(interfaceWidth + var7 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var11 = interfaceWidth + var7 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var7 -= var11;
+ var9 += var11;
+ var8 += var11;
+ }
+
+ if(var7 > 0 && var6 > 0) {
+ var11 = interfaceWidth - Toolkit.JAVA_TOOLKIT.clipLeft;
+ int var12 = interfaceHeight - Toolkit.JAVA_TOOLKIT.clipTop;
+
+ for(int var13 = var12; var13 < var12 + var6; ++var13) {
+ int var14 = var3[var13];
+ int var15 = var4[var13];
+ int var16 = var7;
+ int var17;
+ if(var11 > var14) {
+ var17 = var11 - var14;
+ if(var17 >= var15) {
+ var5 += var7 + var9;
+ var10 += var7 + var8;
+ continue;
+ }
+
+ var15 -= var17;
+ } else {
+ var17 = var14 - var11;
+ if(var17 >= var7) {
+ var5 += var7 + var9;
+ var10 += var7 + var8;
+ continue;
+ }
+
+ var5 += var17;
+ var16 = var7 - var17;
+ var10 += var17;
+ }
+
+ var17 = 0;
+ if(var16 < var15) {
+ var15 = var16;
+ } else {
+ var17 = var16 - var15;
+ }
+
+ for(int var18 = -var15; var18 < 0; ++var18) {
+ int var19 = this.anIntArray4081[var5++];
+ if(var19 == 0) {
+ ++var10;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var10++] = var19;
+ }
+ }
+
+ var5 += var17 + var9;
+ var10 += var17 + var8;
+ }
+
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ SoftwareSprite(int var1, int var2) {
+ this.anIntArray4081 = new int[var1 * var2];
+ this.width = this.anInt3697 = var1;
+ this.height = this.anInt3706 = var2;
+ this.anInt3701 = this.anInt3698 = 0;
+ }
+
+ public void method667(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int[] var9, int[] var10) {
+ try {
+ int var11 = -var3 / 2;
+ int var12 = -var4 / 2;
+ int var13 = (int)(Math.sin((double)var7 / 326.11D) * 65536.0D);
+ int var14 = (int)(Math.cos((double)var7 / 326.11D) * 65536.0D);
+ var13 = var13 * 256 >> 8;
+ var14 = var14 * 256 >> 8;
+ int var15 = (var5 << 16) + var12 * var13 + var11 * var14;
+ int var16 = (var6 << 16) + (var12 * var14 - var11 * var13);
+ int var17 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+
+ for(var2 = 0; var2 < var4; ++var2) {
+ int var18 = var9[var2];
+ int var19 = var17 + var18;
+ int var20 = var15 + var14 * var18;
+ int var21 = var16 - var13 * var18;
+
+ for(var1 = -var10[var2]; var1 < 0; ++var1) {
+ int var22 = this.anIntArray4081[(var20 >> 16) + (var21 >> 16) * this.width];
+ if(var22 == 0) {
+ ++var19;
+ } else {
+ Toolkit.JAVA_TOOLKIT.getBuffer()[var19++] = var22;
+ }
+
+ var20 += var14;
+ var21 -= var13;
+ }
+
+ var15 += var13;
+ var16 += var14;
+ var17 += Toolkit.JAVA_TOOLKIT.width;
+ }
+ } catch (Exception var23) {
+ }
+
+ }
+
+ final void method668(int var1) {
+ for(int var2 = this.height - 1; var2 > 0; --var2) {
+ int var3 = var2 * this.width;
+
+ for(int var4 = this.width - 1; var4 > 0; --var4) {
+ if(this.anIntArray4081[var4 + var3] == 0 && this.anIntArray4081[var4 + var3 - 1 - this.width] != 0) {
+ this.anIntArray4081[var4 + var3] = var1;
+ }
+ }
+ }
+
+ }
+
+ void method642(int var1, int var2, int var3, int var4, int var5) {
+ if(var3 > 0 && var4 > 0) {
+ int var6 = this.width;
+ int var7 = this.height;
+ int var8 = 0;
+ int var9 = 0;
+ int var10 = this.anInt3697;
+ int var11 = this.anInt3706;
+ int var12 = (var10 << 16) / var3;
+ int var13 = (var11 << 16) / var4;
+ int var14;
+ if(this.anInt3701 > 0) {
+ var14 = ((this.anInt3701 << 16) + var12 - 1) / var12;
+ var1 += var14;
+ var8 += var14 * var12 - (this.anInt3701 << 16);
+ }
+
+ if(this.anInt3698 > 0) {
+ var14 = ((this.anInt3698 << 16) + var13 - 1) / var13;
+ var2 += var14;
+ var9 += var14 * var13 - (this.anInt3698 << 16);
+ }
+
+ if(var6 < var10) {
+ var3 = ((var6 << 16) - var8 + var12 - 1) / var12;
+ }
+
+ if(var7 < var11) {
+ var4 = ((var7 << 16) - var9 + var13 - 1) / var13;
+ }
+
+ var14 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var15 = Toolkit.JAVA_TOOLKIT.width - var3;
+ if(var2 + var4 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var4 -= var2 + var4 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ int var16;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var16 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var4 -= var16;
+ var14 += var16 * Toolkit.JAVA_TOOLKIT.width;
+ var9 += var13 * var16;
+ }
+
+ if(var1 + var3 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var16 = var1 + var3 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var3 -= var16;
+ var15 += var16;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var16 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var3 -= var16;
+ var14 += var16;
+ var8 += var12 * var16;
+ var15 += var16;
+ }
+
+ method661(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var8, var9, var14, var15, var3, var4, var12, var13, var6, var5);
+ }
+ }
+
+ final void method669(int var1, int var2, int var3) {
+ for(int var4 = 0; var4 < this.anIntArray4081.length; ++var4) {
+ int var5 = this.anIntArray4081[var4];
+ if(var5 != 0) {
+ int var6 = var5 >> 16 & 0xFF;
+ var6 += var1;
+ if(var6 < 1) {
+ var6 = 1;
+ } else if(var6 > 255) {
+ var6 = 255;
+ }
+
+ int var7 = var5 >> 8 & 0xFF;
+ var7 += var2;
+ if(var7 < 1) {
+ var7 = 1;
+ } else if(var7 > 255) {
+ var7 = 255;
+ }
+
+ int var8 = var5 & 0xFF;
+ var8 += var3;
+ if(var8 < 1) {
+ var8 = 1;
+ } else if(var8 > 255) {
+ var8 = 255;
+ }
+
+ this.anIntArray4081[var4] = (var6 << 16) + (var7 << 8) + var8;
+ }
+ }
+
+ }
+
+ public void method639(int var1, int var2, int var3, int var4) {
+ if(var3 > 0 && var4 > 0) {
+ int var5 = this.width;
+ int var6 = this.height;
+ int var7 = 0;
+ int var8 = 0;
+ int var9 = this.anInt3697;
+ int var10 = this.anInt3706;
+ int var11 = (var9 << 16) / var3;
+ int var12 = (var10 << 16) / var4;
+ int var13;
+ if(this.anInt3701 > 0) {
+ var13 = ((this.anInt3701 << 16) + var11 - 1) / var11;
+ var1 += var13;
+ var7 += var13 * var11 - (this.anInt3701 << 16);
+ }
+
+ if(this.anInt3698 > 0) {
+ var13 = ((this.anInt3698 << 16) + var12 - 1) / var12;
+ var2 += var13;
+ var8 += var13 * var12 - (this.anInt3698 << 16);
+ }
+
+ if(var5 < var9) {
+ var3 = ((var5 << 16) - var7 + var11 - 1) / var11;
+ }
+
+ if(var6 < var10) {
+ var4 = ((var6 << 16) - var8 + var12 - 1) / var12;
+ }
+
+ var13 = var1 + var2 * Toolkit.JAVA_TOOLKIT.width;
+ int var14 = Toolkit.JAVA_TOOLKIT.width - var3;
+ if(var2 + var4 > Toolkit.JAVA_TOOLKIT.clipBottom) {
+ var4 -= var2 + var4 - Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ int var15;
+ if(var2 < Toolkit.JAVA_TOOLKIT.clipTop) {
+ var15 = Toolkit.JAVA_TOOLKIT.clipTop - var2;
+ var4 -= var15;
+ var13 += var15 * Toolkit.JAVA_TOOLKIT.width;
+ var8 += var12 * var15;
+ }
+
+ if(var1 + var3 > Toolkit.JAVA_TOOLKIT.clipRight) {
+ var15 = var1 + var3 - Toolkit.JAVA_TOOLKIT.clipRight;
+ var3 -= var15;
+ var14 += var15;
+ }
+
+ if(var1 < Toolkit.JAVA_TOOLKIT.clipLeft) {
+ var15 = Toolkit.JAVA_TOOLKIT.clipLeft - var1;
+ var3 -= var15;
+ var13 += var15;
+ var7 += var11 * var15;
+ var14 += var15;
+ }
+
+ method670(Toolkit.JAVA_TOOLKIT.getBuffer(), this.anIntArray4081, var7, var8, var13, var14, var3, var4, var11, var12, var5);
+ }
+ }
+
+ private static void method670(int[] var0, int[] var1, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11) {
+ int var12 = var3;
+
+ for(int var13 = -var8; var13 < 0; ++var13) {
+ int var14 = (var4 >> 16) * var11;
+
+ for(int var15 = -var7; var15 < 0; ++var15) {
+ int var2 = var1[(var3 >> 16) + var14];
+ if(var2 == 0) {
+ ++var5;
+ } else {
+ var0[var5++] = var2;
+ }
+
+ var3 += var9;
+ }
+
+ var4 += var10;
+ var3 = var12;
+ var5 += var6;
+ }
+
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/Sound.java b/Client/src/main/java/org/runite/client/Sound.java
new file mode 100644
index 000000000..da65318c3
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Sound.java
@@ -0,0 +1,10 @@
+package org.runite.client;
+
+import org.rs09.client.Linkable;
+
+abstract class Sound extends Linkable {
+
+ int anInt2374;
+
+
+}
diff --git a/Client/src/main/java/org/runite/client/Sprites.java b/Client/src/main/java/org/runite/client/Sprites.java
new file mode 100644
index 000000000..8a387558e
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Sprites.java
@@ -0,0 +1,243 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+final class Sprites {
+
+ public static int compassSpriteArchive;
+ public static int hintMapEdgeSpriteArchive;
+ public static AbstractIndexedSprite[] nameIconsSpriteArray;
+ static boolean aBoolean337;
+ static int ambientVolume = 127;
+ static int p11FullSpriteArchive;
+ static int p12FullSpriteArchive;
+ static int b12FullSpriteArchive;
+ static int mapFunctionSpriteArchive;
+ static int hitmarkSpriteArchive;
+ static int hitbarDefaultSpriteArchive;
+ static int headiconsPkSpriteArchive;
+ static int headiconsPrayerSpriteArchive;
+ static int headiconsHintSpriteArchive;
+ static int hintMapMarkersSpriteArchive;
+ static int mapFlagSpriteArchive;
+ static int crossSpriteArchive;
+ static int mapDotsSpriteArchive;
+ static int scrollbarSpriteArchive;
+ static int nameIconsSpriteArchive;
+ static int floorShadowSpriteArchive;
+ static SoftwareSprite[] aSoftwareSpriteArray2140;
+
+
+ private static LDIndexedSprite[] method885(int var1, CacheIndex var2) {
+ try {
+ // System.out.println("Class 14 " + var1);
+ return !Class75_Sub4.method1351(var2, 0, var1) ? null : Unsorted.method1281();
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "cg.C(" + true + ',' + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + 0 + ')');
+ }
+ }
+
+ static void method887(CacheIndex index8) {
+ try {
+ aSoftwareSpriteArray2140 = Class157.method2176(mapFunctionSpriteArchive, index8);
+ Class75_Sub3.aAbstractSpriteArray2656 = Class140_Sub6.getSprites(hitmarkSpriteArchive, index8);
+ Unsorted.aAbstractSpriteArray996 = Class140_Sub6.getSprites(hitbarDefaultSpriteArchive, index8);
+ TextureOperation2.aAbstractSpriteArray3373 = Class140_Sub6.getSprites(headiconsPkSpriteArchive, index8);
+ NPC.aAbstractSpriteArray3977 = Class140_Sub6.getSprites(headiconsPrayerSpriteArchive, index8);
+ Class166.aAbstractSpriteArray2072 = Class140_Sub6.getSprites(headiconsHintSpriteArchive, index8);
+ Class129_Sub1.aAbstractSpriteArray2690 = Class140_Sub6.getSprites(hintMapMarkersSpriteArchive, index8);
+ Class45.aAbstractSprite_736 = Unsorted.method602(mapFlagSpriteArchive, index8);
+ Class65.aAbstractSpriteArray1825 = TextureOperation18.method286(crossSpriteArchive, index8);
+ Unsorted.minimapDotSprites = TextureOperation18.method286(mapDotsSpriteArchive, index8);
+ GameObject.aClass109Array1831 = Class85.method1424(index8, scrollbarSpriteArchive);
+ nameIconsSpriteArray = Class85.method1424(index8, nameIconsSpriteArchive);
+ FontType.smallFont.method697(nameIconsSpriteArray, null);
+ FontType.plainFont.method697(nameIconsSpriteArray, null);
+ FontType.bold.method697(nameIconsSpriteArray, null);
+ if (HDToolKit.highDetail) {
+ Class141.aClass109_Sub1Array1843 = method885(floorShadowSpriteArchive, index8);
+
+ for (int var2 = 0; var2 < Objects.requireNonNull(Class141.aClass109_Sub1Array1843).length; ++var2) {
+ Class141.aClass109_Sub1Array1843[var2].method1675();
+ }
+ }
+
+ SoftwareSprite var10 = Class40.method1043(0, index8, compassSpriteArchive);
+ Objects.requireNonNull(var10).method665();
+ if (HDToolKit.highDetail) {
+ Class57.aAbstractSprite_895 = new HDSprite(var10);
+ } else {
+ Class57.aAbstractSprite_895 = var10;
+ }
+
+ SoftwareSprite[] var3 = Class157.method2176(hintMapEdgeSpriteArchive, index8);
+
+ int var4;
+ for (var4 = 0; Objects.requireNonNull(var3).length > var4; ++var4) {
+ var3[var4].method665();
+ }
+
+ if (HDToolKit.highDetail) {
+ TextureOperation8.aAbstractSpriteArray3458 = new AbstractSprite[var3.length];
+
+ for (var4 = 0; var4 < var3.length; ++var4) {
+ TextureOperation8.aAbstractSpriteArray3458[var4] = new HDSprite(var3[var4]);
+ }
+ } else {
+ TextureOperation8.aAbstractSpriteArray3458 = var3;
+ }
+
+ int var5 = (int) ((double) 21 * Math.random()) - 10;
+ var4 = (int) (21.0D * Math.random()) - 10;
+ int var6 = -10 + (int) (21.0D * Math.random());
+ int var7 = -20 + (int) (Math.random() * 41.0D);
+
+ int var8;
+ for (var8 = 0; var8 < aSoftwareSpriteArray2140.length; ++var8) {
+ aSoftwareSpriteArray2140[var8].method669(var4 + var7, var7 + var5, var7 + var6);
+ }
+
+ if (HDToolKit.highDetail) {
+ Entity.aAbstractSpriteArray2839 = new AbstractSprite[aSoftwareSpriteArray2140.length];
+
+ for (var8 = 0; var8 < aSoftwareSpriteArray2140.length; ++var8) {
+ Entity.aAbstractSpriteArray2839[var8] = new HDSprite(aSoftwareSpriteArray2140[var8]);
+ }
+ } else {
+ Entity.aAbstractSpriteArray2839 = aSoftwareSpriteArray2140;
+ }
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "cg.A(" + 21 + ',' + (index8 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static void getSpriteFromArchive(CacheIndex index8) {
+ try {
+ p11FullSpriteArchive = index8.getArchiveForName(RSString.parse("p11_full"));
+ p12FullSpriteArchive = index8.getArchiveForName(RSString.parse("p12_full"));
+ b12FullSpriteArchive = index8.getArchiveForName(RSString.parse("b12_full"));
+ mapFunctionSpriteArchive = index8.getArchiveForName(RSString.parse("mapfunction"));
+ hitmarkSpriteArchive = index8.getArchiveForName(RSString.parse("hitmarks"));
+ hitbarDefaultSpriteArchive = index8.getArchiveForName(RSString.parse("hitbar_default"));
+ headiconsPkSpriteArchive = index8.getArchiveForName(RSString.parse("headicons_pk"));
+
+ headiconsPrayerSpriteArchive = index8.getArchiveForName(RSString.parse("headicons_prayer"));
+ headiconsHintSpriteArchive = index8.getArchiveForName(RSString.parse("hint_headicons"));
+ hintMapMarkersSpriteArchive = index8.getArchiveForName(RSString.parse("hint_mapmarkers"));
+ mapFlagSpriteArchive = index8.getArchiveForName(RSString.parse("mapflag"));
+ crossSpriteArchive = index8.getArchiveForName(RSString.parse("cross"));
+ mapDotsSpriteArchive = index8.getArchiveForName(RSString.parse("mapdots"));
+ scrollbarSpriteArchive = index8.getArchiveForName(RSString.parse("scrollbar"));
+ nameIconsSpriteArchive = index8.getArchiveForName(RSString.parse("name_icons"));
+ floorShadowSpriteArchive = index8.getArchiveForName(RSString.parse("floorshadows"));
+ compassSpriteArchive = index8.getArchiveForName(RSString.parse("compass"));
+ hintMapEdgeSpriteArchive = index8.getArchiveForName(RSString.parse("hint_mapedge"));
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "g.C(" + 208 + ',' + (index8 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static int method228(CacheIndex var0, CacheIndex var1) {
+ try {
+ int var3 = 0;
+ if (var0.retrieveSpriteFile(p11FullSpriteArchive)) {
+ ++var3;
+ }
+
+ if (var0.retrieveSpriteFile(p12FullSpriteArchive)) {
+ ++var3;
+ }
+
+ if (var0.retrieveSpriteFile(b12FullSpriteArchive)) {
+ ++var3;
+ }
+
+ if (var1.retrieveSpriteFile(p11FullSpriteArchive)) {
+ ++var3;
+ }
+
+
+ if (var1.retrieveSpriteFile(p12FullSpriteArchive)) {
+ ++var3;
+ }
+
+ if (var1.retrieveSpriteFile(b12FullSpriteArchive)) {
+ ++var3;
+ }
+
+ return var3;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "fn.B(" + (var0 != null ? "{...}" : "null") + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static int method107(CacheIndex index) {
+ try {
+ int var2 = 0;//0
+ if (index.retrieveSpriteFile(mapFunctionSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(hitmarkSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(hitbarDefaultSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(headiconsPkSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(headiconsPrayerSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(headiconsHintSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(hintMapMarkersSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(mapFlagSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(crossSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(mapDotsSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(scrollbarSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(nameIconsSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(floorShadowSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(compassSpriteArchive)) {
+ ++var2;
+ }
+
+ if (index.retrieveSpriteFile(hintMapEdgeSpriteArchive)) {
+ ++var2;
+ }
+
+ return var2;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "cd.B(" + (index != null ? "{...}" : "null") + ',' + (byte) -125 + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/SynthInstrument.java b/Client/src/main/java/org/runite/client/SynthInstrument.java
new file mode 100644
index 000000000..724898b8d
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/SynthInstrument.java
@@ -0,0 +1,304 @@
+package org.runite.client;
+
+import org.rs09.client.util.ArrayUtils;
+
+import java.util.Random;
+
+final class SynthInstrument {
+
+ private static final int[] anIntArray1591;
+ private static final int[] anIntArray1594 = new int[32768];
+ private static final int[] output;
+ private static final int[] anIntArray1599;
+ private static final int[] anIntArray1600;
+ private static final int[] anIntArray1601;
+ private static final int[] anIntArray1602;
+ private static final int[] anIntArray1603;
+ static int[][] coefficency = new int[2][8];
+ static int inverseA0;
+
+ static {
+ Random var0 = new Random(0L);
+
+ int var1;
+ for (var1 = 0; var1 < 32768; ++var1) {
+ anIntArray1594[var1] = (var0.nextInt() & 2) - 1;
+ }
+
+ anIntArray1591 = new int[32768];
+
+ for (var1 = 0; var1 < 32768; ++var1) {
+ anIntArray1591[var1] = (int) (Math.sin((double) var1 / 5215.1903D) * 16384.0D);
+ }
+
+ output = new int[220500];
+ anIntArray1599 = new int[5];
+ anIntArray1600 = new int[5];
+ anIntArray1601 = new int[5];
+ anIntArray1603 = new int[5];
+ anIntArray1602 = new int[5];
+ }
+
+ private final int[] oscillatorAmplitudes = new int[]{0, 0, 0, 0, 0};
+ private final int[] oscillatorStartMillis = new int[]{0, 0, 0, 0, 0};
+ private final int[] anIntArray1605 = new int[]{0, 0, 0, 0, 0};
+ int duration = 500;
+ int start = 0;
+ private Envelope amplitudeModulationAmplitudeEnvelope;
+ private Envelope gateClosedPhaseEnvelope;
+ private Envelope amplitudeEnvelope;
+ private Envelope gateOpenPhaseEnvelope;
+ private Envelope phaseEnvelope;
+ private int delayTime = 0;
+ private Envelope filterEnvelope;
+ private Envelope amplitudeModulationEnvelope;
+ private int delayMix = 100;
+ private Filter filter;
+ private Envelope pitch_mod_amp_env;
+ private Envelope pitch_mod_env;
+
+ private int method1716(int var1, int var2, int var3) {
+ return var3 == 1 ? ((var1 & 32767) < 16384 ? var2 : -var2) : (var3 == 2 ? anIntArray1591[var1 & 32767] * var2 >> 14 : (var3 == 3 ? ((var1 & 32767) * var2 >> 14) - var2 : (var3 == 4 ? anIntArray1594[var1 / 2607 & 32767] * var2 : 0)));
+ }
+
+ final int[] synthesize(int num_samples, int dt) {
+ ArrayUtils.zero(output, 0, num_samples);
+ if (dt >= 10) {
+ double sample_rate = (double) num_samples / ((double) dt + 0.0D);
+ this.phaseEnvelope.reset();
+ this.amplitudeEnvelope.reset();
+ int pm_phase_delta = 0;
+ int pm_phase_delta_base = 0;
+ int pm_phase = 0;
+ if (this.pitch_mod_env != null) {
+ this.pitch_mod_env.reset();
+ this.pitch_mod_amp_env.reset();
+ pm_phase_delta = (int) ((double) (this.pitch_mod_env.maxInterval - this.pitch_mod_env.minInterval) * 32.768D / sample_rate);
+ pm_phase_delta_base = (int) ((double) this.pitch_mod_env.minInterval * 32.768D / sample_rate);
+ }
+
+ int var8 = 0;
+ int var9 = 0;
+ int var10 = 0;
+ if (this.amplitudeModulationEnvelope != null) {
+ this.amplitudeModulationEnvelope.reset();
+ this.amplitudeModulationAmplitudeEnvelope.reset();
+ var8 = (int) ((double) (this.amplitudeModulationEnvelope.maxInterval - this.amplitudeModulationEnvelope.minInterval) * 32.768D / sample_rate);
+ var9 = (int) ((double) this.amplitudeModulationEnvelope.minInterval * 32.768D / sample_rate);
+ }
+
+ int var11;
+ for (var11 = 0; var11 < 5; ++var11) {
+ if (this.oscillatorAmplitudes[var11] != 0) {
+ anIntArray1601[var11] = 0;
+ anIntArray1602[var11] = (int) ((double) this.oscillatorStartMillis[var11] * sample_rate);
+ anIntArray1603[var11] = (this.oscillatorAmplitudes[var11] << 14) / 100;
+ anIntArray1599[var11] = (int) ((double) (this.phaseEnvelope.maxInterval - this.phaseEnvelope.minInterval) * 32.768D * Math.pow(1.0057929410678534D, this.anIntArray1605[var11]) / sample_rate);
+ anIntArray1600[var11] = (int) ((double) this.phaseEnvelope.minInterval * 32.768D / sample_rate);
+ }
+ }
+
+ int var12;
+ int var13;
+ int var14;
+ int delay;
+ for (var11 = 0; var11 < num_samples; ++var11) {
+ var12 = this.phaseEnvelope.nextLevel(num_samples);
+ var13 = this.amplitudeEnvelope.nextLevel(num_samples);
+ if (this.pitch_mod_env != null) {
+ var14 = this.pitch_mod_env.nextLevel(num_samples);
+ delay = this.pitch_mod_amp_env.nextLevel(num_samples);
+ var12 += this.method1716(pm_phase, delay, this.pitch_mod_env.waveTable) >> 1;
+ pm_phase += (var14 * pm_phase_delta >> 16) + pm_phase_delta_base;
+ }
+
+ if (this.amplitudeModulationEnvelope != null) {
+ var14 = this.amplitudeModulationEnvelope.nextLevel(num_samples);
+ delay = this.amplitudeModulationAmplitudeEnvelope.nextLevel(num_samples);
+ var13 = var13 * ((this.method1716(var10, delay, this.amplitudeModulationEnvelope.waveTable) >> 1) + 32768) >> 15;
+ var10 += (var14 * var8 >> 16) + var9;
+ }
+
+ for (var14 = 0; var14 < 5; ++var14) {
+ if (this.oscillatorAmplitudes[var14] != 0) {
+ delay = var11 + anIntArray1602[var14];
+ if (delay < num_samples) {
+ output[delay] += this.method1716(anIntArray1601[var14], var13 * anIntArray1603[var14] >> 15, this.phaseEnvelope.waveTable);
+ anIntArray1601[var14] += (var12 * anIntArray1599[var14] >> 16) + anIntArray1600[var14];
+ }
+ }
+ }
+ }
+
+ int var16;
+ if (this.gateClosedPhaseEnvelope != null) {
+ this.gateClosedPhaseEnvelope.reset();
+ this.gateOpenPhaseEnvelope.reset();
+ var11 = 0;
+
+ for (var14 = 0; var14 < num_samples; ++var14) {
+ delay = this.gateClosedPhaseEnvelope.nextLevel(num_samples);
+ var16 = this.gateOpenPhaseEnvelope.nextLevel(num_samples);
+ var12 = this.gateClosedPhaseEnvelope.minInterval + ((this.gateClosedPhaseEnvelope.maxInterval - this.gateClosedPhaseEnvelope.minInterval) * delay >> 8);
+ var11 += 256;
+ if (var11 >= var12) {
+ var11 = 0;
+ } else {
+ output[var14] = 0;
+ }
+ }
+ }
+
+ if (this.delayTime > 0 && this.delayMix > 0) {
+ var11 = (int) ((double) this.delayTime * sample_rate);
+
+ for (var12 = var11; var12 < num_samples; ++var12) {
+ output[var12] += output[var12 - var11] * this.delayMix / 100;
+ }
+ }
+
+ if (this.filter.pairs[0] > 0 || this.filter.pairs[1] > 0) {
+ this.filterEnvelope.reset();
+ var11 = this.filterEnvelope.nextLevel(num_samples + 1);
+ var12 = this.filter.compute(0, (float) var11 / 65536.0F);
+ var13 = this.filter.compute(1, (float) var11 / 65536.0F);
+ if (num_samples >= var12 + var13) {
+ var14 = 0;
+ delay = var13;
+ if (var13 > num_samples - var12) {
+ delay = num_samples - var12;
+ }
+
+ int var17;
+ while (var14 < delay) {
+ var16 = (int) ((long) output[var14 + var12] * (long) inverseA0 >> 16);
+
+ for (var17 = 0; var17 < var12; ++var17) {
+ var16 += (int) ((long) output[var14 + var12 - 1 - var17] * (long) coefficency[0][var17] >> 16);
+ }
+
+ for (var17 = 0; var17 < var14; ++var17) {
+ var16 -= (int) ((long) output[var14 - 1 - var17] * (long) coefficency[1][var17] >> 16);
+ }
+
+ output[var14] = var16;
+ var11 = this.filterEnvelope.nextLevel(num_samples + 1);
+ ++var14;
+ }
+
+ delay = 128;
+
+ while (true) {
+ if (delay > num_samples - var12) {
+ delay = num_samples - var12;
+ }
+
+ while (var14 < delay) {
+ var16 = (int) ((long) output[var14 + var12] * (long) inverseA0 >> 16);
+
+ for (var17 = 0; var17 < var12; ++var17) {
+ var16 += (int) ((long) output[var14 + var12 - 1 - var17] * (long) coefficency[0][var17] >> 16);
+ }
+
+ for (var17 = 0; var17 < var13; ++var17) {
+ var16 -= (int) ((long) output[var14 - 1 - var17] * (long) coefficency[1][var17] >> 16);
+ }
+
+ output[var14] = var16;
+ var11 = this.filterEnvelope.nextLevel(num_samples + 1);
+ ++var14;
+ }
+
+ if (var14 >= num_samples - var12) {
+ while (var14 < num_samples) {
+ var16 = 0;
+
+ for (var17 = var14 + var12 - num_samples; var17 < var12; ++var17) {
+ var16 += (int) ((long) output[var14 + var12 - 1 - var17] * (long) coefficency[0][var17] >> 16);
+ }
+
+ for (var17 = 0; var17 < var13; ++var17) {
+ var16 -= (int) ((long) output[var14 - 1 - var17] * (long) coefficency[1][var17] >> 16);
+ }
+
+ output[var14] = var16;
+ this.filterEnvelope.nextLevel(num_samples + 1);
+ ++var14;
+ }
+ break;
+ }
+
+ var12 = this.filter.compute(0, (float) var11 / 65536.0F);
+ var13 = this.filter.compute(1, (float) var11 / 65536.0F);
+ delay += 128;
+ }
+ }
+ }
+
+ for (var11 = 0; var11 < num_samples; ++var11) {
+ if (output[var11] < -32768) {
+ output[var11] = -32768;
+ }
+
+ if (output[var11] > 32767) {
+ output[var11] = 32767;
+ }
+ }
+
+ }
+ return output;
+ }
+
+ final void decode(DataBuffer buffer) {
+ this.phaseEnvelope = new Envelope();
+ this.phaseEnvelope.decode(buffer);
+ this.amplitudeEnvelope = new Envelope();
+ this.amplitudeEnvelope.decode(buffer);
+
+ int phaseModulationWaveTable = buffer.readUnsignedByte();
+ if (phaseModulationWaveTable != 0) {
+ --buffer.index;
+ this.pitch_mod_env = new Envelope();
+ this.pitch_mod_env.decode(buffer);
+ this.pitch_mod_amp_env = new Envelope();
+ this.pitch_mod_amp_env.decode(buffer);
+ }
+
+ int amplitudeModulationWaveTable = buffer.readUnsignedByte();
+ if (amplitudeModulationWaveTable != 0) {
+ --buffer.index;
+ this.amplitudeModulationEnvelope = new Envelope();
+ this.amplitudeModulationEnvelope.decode(buffer);
+ this.amplitudeModulationAmplitudeEnvelope = new Envelope();
+ this.amplitudeModulationAmplitudeEnvelope.decode(buffer);
+ }
+
+ int gateWaveTable = buffer.readUnsignedByte();
+ if (gateWaveTable != 0) {
+ --buffer.index;
+ this.gateClosedPhaseEnvelope = new Envelope();
+ this.gateClosedPhaseEnvelope.decode(buffer);
+ this.gateOpenPhaseEnvelope = new Envelope();
+ this.gateOpenPhaseEnvelope.decode(buffer);
+ }
+
+ for (int var3 = 0; var3 < 10; ++var3) {
+ int amplitude = buffer.getSmart();
+ if (amplitude == 0) {
+ break;
+ }
+
+ this.oscillatorAmplitudes[var3] = amplitude;
+ this.anIntArray1605[var3] = buffer.getByteOrShort();
+ this.oscillatorStartMillis[var3] = buffer.getSmart();
+ }
+
+ this.delayTime = buffer.getSmart();
+ this.delayMix = buffer.getSmart();
+ this.duration = buffer.readUnsignedShort();
+ this.start = buffer.readUnsignedShort();
+ this.filter = new Filter();
+ this.filterEnvelope = new Envelope();
+ this.filter.decode(buffer, this.filterEnvelope);
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/SynthSound.java b/Client/src/main/java/org/runite/client/SynthSound.java
new file mode 100644
index 000000000..415769368
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/SynthSound.java
@@ -0,0 +1,101 @@
+package org.runite.client;
+
+public final class SynthSound {
+
+ private final SynthInstrument[] synthInstruments = new SynthInstrument[10];
+ private int end;
+ private int start;
+
+ private SynthSound(DataBuffer buffer) {
+ for (int var2 = 0; var2 < 10; ++var2) {
+ int waveTable = buffer.readUnsignedByte();
+ if (waveTable != 0) {
+ --buffer.index;
+ this.synthInstruments[var2] = new SynthInstrument();
+ this.synthInstruments[var2].decode(buffer);
+ }
+ }
+
+ this.start = buffer.readUnsignedShort();
+ this.end = buffer.readUnsignedShort();
+ }
+
+ public static SynthSound create(CacheIndex var0, int var1, int var2) {
+ byte[] var3 = var0.getFile(var1, var2);
+ return var3 == null ? null : new SynthSound(new DataBuffer(var3));
+ }
+
+ private byte[] getSamples() {
+ int var1 = 0;
+
+ int var2;
+ for (var2 = 0; var2 < 10; ++var2) {
+ if (this.synthInstruments[var2] != null && this.synthInstruments[var2].duration + this.synthInstruments[var2].start > var1) {
+ var1 = this.synthInstruments[var2].duration + this.synthInstruments[var2].start;
+ }
+ }
+
+ if (var1 == 0) {
+ return new byte[0];
+ } else {
+ var2 = 22050 * var1 / 1000;
+ byte[] var3 = new byte[var2];
+
+ for (int var4 = 0; var4 < 10; ++var4) {
+ if (this.synthInstruments[var4] != null) {
+ int var5 = this.synthInstruments[var4].duration * 22050 / 1000;
+ int var6 = this.synthInstruments[var4].start * 22050 / 1000;
+ int[] var7 = this.synthInstruments[var4].synthesize(var5, this.synthInstruments[var4].duration);
+
+ for (int var8 = 0; var8 < var5; ++var8) {
+ int var9 = var3[var8 + var6] + (var7[var8] >> 8);
+ if ((var9 + 128 & -256) != 0) {
+ var9 = var9 >> 31 ^ 127;
+ }
+
+ var3[var8 + var6] = (byte) var9;
+ }
+ }
+ }
+
+ return var3;
+ }
+ }
+
+ public final PcmSound toPCMSound() {
+ byte[] var1 = this.getSamples();
+ return new PcmSound(var1, 22050 * this.start / 1000, 22050 * this.end / 1000);
+ }
+
+ final int getStart() {
+ int start = 9999999;
+
+ for (int var2 = 0; var2 < 10; ++var2) {
+ if (this.synthInstruments[var2] != null && this.synthInstruments[var2].start / 20 < start) {
+ start = this.synthInstruments[var2].start / 20;
+ }
+ }
+
+ if (this.start < this.end && this.start / 20 < start) {
+ start = this.start / 20;
+ }
+
+ if (start == 9999999 || start == 0) {
+ return 0;
+ } else {
+ for (int var2 = 0; var2 < 10; ++var2) {
+ if (this.synthInstruments[var2] != null) {
+ this.synthInstruments[var2].start -= start * 20;
+ }
+ }
+
+ if (this.start < this.end) {
+ this.start -= start * 20;
+ this.end -= start * 20;
+ }
+
+ return start;
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextCore.java b/Client/src/main/java/org/runite/client/TextCore.java
new file mode 100644
index 000000000..3b6011d8b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextCore.java
@@ -0,0 +1,317 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+public class TextCore {
+
+ /**
+ * Configs that are set by the client
+ */
+
+
+ /** @woah
+ * A repository filled with text that can be set to whatever the user sees fit
+ * Each will be labeled for what their original purpose is for and the files that
+ * They reside in.
+ *
+ * RSString information:
+ * The way it was programmed certain symbols require a different type of value set
+ * to determine said symbol. You may notice ex: )2 or a )3)3
+ * )2 = spacer )3 = period(.)
+ */
+
+ public static final RSString TOGGLE_ATK = RSString.parse("::toggleatk");
+ public static final RSString TOGGLE_FK = RSString.parse("::togglefk");
+ public static RSString COMMAND_BREAK_CLIENT_CONNECTION = RSString.parse("::clientdrop");
+ public static RSString aString_1622 = RSString.parse("Card:");
+ public static RSString aString_4057 = RSString.parse("Mem:");
+ public static RSString aString_4052 = RSString.parse("www");
+ public static RSString aString_3601 = RSString.parse(")3runescape)3com)4l=");
+ public static RSString aString_1932 = RSString.parse(")4a=");
+ public static RSString aString_1885 = RSString.parse("cookiehost");
+ public static RSString aString_3637 = RSString.parse(")4p=");
+ /**
+ * Holiday Event Text
+ */
+ //Halloween
+ public static RSString TrickorTreat = RSString.of("Trick-or-treat");
+ public static RSString GazeInto = RSString.of("Gaze-into");
+ public static RSString aString_132 = RSString.parse("::");
+ public static RSString aString_119 = RSString.parse("runes");
+ public static RSString aString_37 = RSString.parse("0(U");
+ public static RSString aString_38 = RSString.parse("tbrefresh");
+ public static RSString aString_1698 = RSString.parse("(R");
+ public static RSString aString_1133 = RSString.parse(")4j");
+ public static RSString aString_4066 = RSString.parse(" ");
+ public static RSString aString_2598 = RSString.parse(" ");
+ public static RSString aString_1326 = RSString.parse(")2");
+ public static RSString aString_4049 = RSString.parse("");
+ public static RSString aString_1617 = RSString.parse(")1a2)1m");
+ /**
+ * Login Screen Text
+ * Files that use these texts:
+ */
+ public static RSString RSLoadingPleaseWait = RSString.parse(GameConfig.SERVER_NAME + " is loading )2 please wait)3)3)3");
+ static RSString LoadingConfig = RSString.parse("Loading config )2 ");
+ static RSString LoadedConfig = RSString.parse("Loaded config");
+ static RSString LoadingSprites = RSString.parse("Loading sprites )2 ");
+ static RSString LoadedSprites = RSString.parse("Loaded sprites");
+ static RSString LoadingWLD = RSString.parse("Loading world list data");
+ static RSString LoadedWLD = RSString.parse("Loaded world list data");
+ static RSString LoadingPleaseWait = RSString.parse("Please wait)3)3)3");
+ static RSString LoadingPleaseWait2 = RSString.parse("Loading )2 please wait)3");
+ static RSString LoadingFonts = RSString.parse("Loading fonts )2 ");
+ static RSString LoadedFonts = RSString.parse("Loaded fonts");
+ static RSString LoadedWordPack = RSString.parse("Loaded wordpack");
+ static RSString LoadingTextures = RSString.parse("Loading textures )2 ");
+ static RSString LoadedTextures = RSString.parse("Loaded textures");
+ static RSString LoadingInterfaces = RSString.parse("Loading interfaces )2 ");
+ static RSString LoadedInterfaces = RSString.parse("Loaded interfaces");
+ static RSString LoadingTitleScreen = RSString.parse("Loading title screen )2 ");
+ static RSString LoadingGeneral = RSString.parse("Loading)3)3)3");
+ static RSString LoadingWordPack = RSString.parse("Loading wordpack )2 ");
+ static RSString LoadingConnecting = RSString.parse("Connecting.. This takes a LONG time.");
+ static RSString LoadedUpdateList = RSString.parse("Loaded update list");
+ static RSString AttemptingReestablish = RSString.parse("Please wait )2 attempting to reestablish)3");
+ static RSString CreatedWorld = RSString.parse("Created gameworld");
+ static RSString CheckingForUpdates = RSString.parse("Checking for updates )2 ");
+ static RSString LoadedInputHandler = RSString.parse("Loaded input handler");
+ static RSString OpenedTitleScreen = RSString.parse("Opened title screen");
+ static RSString LoadedTitleScreen = RSString.parse("Loaded title screen");
+ static RSString Starting3DLibrary = RSString.parse("Starting 3d Library");
+ static RSString Started3DLibrary = RSString.parse("Started 3d Library");
+ static RSString AllocatingMemory = RSString.parse("Allocating memory");
+ static RSString AllocatedMemory = RSString.parse("Allocated memory");
+ static RSString PreparedSoundEngine = RSString.parse("Prepared sound engine");
+ static RSString ConxLost = RSString.parse("Connection lost)3");
+ static RSString ConxUpdateServer = RSString.parse("Connected to update server");
+ /**
+ * User Login/ User Text
+ */
+ static RSString HasExpires = RSString.parse("; Expires=");
+ static RSString HasMaxAge = RSString.parse("; Max)2Age=");
+ static RSString HasAgeExpire = RSString.parse("; Expires=Thu)1 01)2Jan)21970 00:00:00 GMT; Max)2Age=0");
+ static RSString HasLoggedIn = RSString.parse(" has logged in)3");
+ static RSString HasLoggedOut = RSString.parse(" has logged out)3");
+ static RSString HasFriendsListFull = RSString.parse("Your friend list is full)3 Max of 100 for free users)1 and 200 for members)3");
+ static RSString HasIgnoreListFull = RSString.parse("Your ignore list is full)3 Max of 100 users)3");
+ static RSString HasOnOwnFriendsList = RSString.parse("You can(Wt add yourself to your own friend list)3");
+ static RSString HasOnOwnIgnoreList = RSString.parse("You can(Wt add yourself to your own ignore list)3");
+ static RSString HasPleaseRemove = RSString.parse("Please remove ");
+ static RSString HasIgnoreToFriends = RSString.parse(" from your ignore list first)3");
+ static RSString HasFriendsToIgnore = RSString.parse(" from your friend list first)3");
+ static RSString HasFriendsAlready = RSString.parse(" is already on your friend list)3");
+ static RSString HasIgnoreAlready = RSString.parse(" is already on your ignore list)3");
+ static RSString HasWishToTrade = RSString.parse("wishes to trade with you)3");
+ static RSString HasAttack = RSString.parse("Attack");
+ static RSString HasUse = RSString.parse("Use");
+ static RSString HasExamine = RSString.parse("Examine");
+ static RSString HasTake = RSString.parse("Take");
+ static RSString HasWalkHere = RSString.parse("Walk here");
+ static RSString HasDrop = RSString.parse("Drop");
+ static RSString HasDiscard = RSString.parse("Discard");
+ static RSString HasHidden = RSString.parse("Hidden");
+ static RSString HasNull = RSString.parse("null");
+ static RSString HasCancel = RSString.parse("Cancel");
+ static RSString HasFaceHere = RSString.parse("Face here");
+ static RSString HasContinue = RSString.parse("Continue");
+ static RSString HasClose = RSString.parse("Close");
+ static RSString HasOK = RSString.parse("Ok");
+ static RSString HasSelect = RSString.parse("Select");
+ static RSString HasChooseOptions = RSString.parse("Choose Option");
+ static RSString HasMoreOptions = RSString.parse(" more options");
+ static RSString HasUnableFind = RSString.parse("Unable to find ");
+ static RSString HasSkill = RSString.parse("skill: ");
+ static RSString HasScroll = RSString.parse("scroll:");
+ static RSString HasLevel = RSString.parse("level: ");
+ static RSString HasRating = RSString.parse("rating: ");
+ /**
+ * Money values (K (Thousand)), (M (Million))
+ */
+ static RSString ThousandK = RSString.parse("K");
+ static RSString MillionM = RSString.parse("M");
+ static RSString HasDuelFriend = RSString.parse(":duelfriend:");
+ static RSString HasDuelStake = RSString.parse(":duelstake:");
+ static RSString HasTrade = RSString.parse(":trade:");
+ static RSString HasAssist = RSString.parse(":assist:");
+ static RSString HasAssistRequest = RSString.parse(":assistreq:");
+ static RSString HasClanRequest = RSString.parse(":clanreq:");
+ static RSString HasClan = RSString.parse(":clan:");
+ static RSString HasAllyReq = RSString.parse(":allyreq:");
+ static RSString cmdChalReq = RSString.parse(":chalreq:");
+ /**
+ * Archive Info for client cache lookup
+ */
+ static RSString HasLabels = RSString.parse("_labels");
+ static RSString HasPlayerLabels = RSString.parse("_labels");
+ static RSString HasHuffman = RSString.parse("huffman");
+ /**
+ * Colored Text Commands * For Color editing use ColorCore.java
+ * *Note not used to actually change the color of text
+ * Used as color coding commands such as:
+ * red: purple: etc.
+ */
+
+ static RSString TextColorYellow = RSString.parse("yellow:");
+ static RSString TextColorRed = RSString.parse("red:");
+ static RSString TextColorGreen = RSString.parse("green:");
+ static RSString TextColorCyan = RSString.parse("cyan:");
+ static RSString TextColorPurple = RSString.parse("purple:");
+ static RSString TextColorWhite = RSString.parse("white:");
+ static RSString TextFlashOne = RSString.parse("flash1:");
+ static RSString TextFlashTwo = RSString.parse("flash2:");
+ static RSString TextFlashThree = RSString.parse("flash3:");
+ static RSString TextGlowOne = RSString.parse("glow1:");
+ static RSString TextGlowTwo = RSString.parse("glow2:");
+ static RSString TextGlowThree = RSString.parse("glow3:");
+ static RSString TextWave = RSString.parse("wave:");
+ static RSString TextWaveTwo = RSString.parse("wave2:");
+ static RSString TextShake = RSString.parse("shake:");
+ static RSString TextSlide = RSString.parse("slide:");
+ /**
+ * Months of the year
+ * This was being accessed multiple times for other methods
+ */
+ static RSString[] MonthsOfTheYear = new RSString[]{RSString.parse("Jan"),
+ RSString.parse("Feb"),
+ RSString.parse("Mar"),
+ RSString.parse("Apr"),
+ RSString.parse("May"),
+ RSString.parse("Jun"),
+ RSString.parse("Jul"),
+ RSString.parse("Aug"),
+ RSString.parse("Sep"),
+ RSString.parse("Oct"),
+ RSString.parse("Nov"),
+ RSString.parse("Dec")};
+ static RSString[] DaysOfTheWeek = new RSString[]{RSString.parse("Sun"),
+ RSString.parse("Mon"),
+ RSString.parse("Tue"),
+ RSString.parse("Wed"),
+ RSString.parse("Thu"),
+ RSString.parse("Fri"),
+ RSString.parse("Sat")};
+ /**
+ * Client Commands
+ */
+ static RSString COMMAND_HIGHRES_GRAPHICS_RESIZE = RSString.parse("::wm2");
+ static RSString COMMAND_SHIFT_DROP_CLICK = RSString.parse("::shiftclick");
+ static RSString COMMAND_GETBITS = RSString.parse("::getbits");
+ static RSString COMMAND_REPLACE_CANVAS = RSString.parse("::replacecanvas");
+ static RSString COMMAND_HIGHRES_GRAPHICS_WINDOW = RSString.parse("::wm1");
+ static RSString COMMAND_QA_OP_TEST = RSString.parse("::qa_op_test");
+ static RSString COMMAND_NOCLIP = RSString.parse("::noclip");
+ static RSString COMMAND_GARBAGE_COLLECTOR = RSString.parse("::gc");
+ static RSString COMMAND_HIGHRES_GRAPHICS_FULLSCREEN = RSString.parse("::wm3");
+ static RSString COMMAND_FPS = RSString.parse("::fps ");
+ static RSString COMMAND_TWEENING = RSString.parse("::tween");
+ static RSString COMMAND_MEMORY_MANAGEMENT = RSString.parse("::mm");
+ static RSString COMMAND_BREAK_JS5_CLIENT_CONNECTION = RSString.parse("::clientjs5drop");
+ static RSString COMMAND_BREAK_JS5_SERVER_CONNECTION = RSString.parse("::serverjs5drop");
+ static RSString COMMAND_GRAPHICS_CARD_MEMORY = RSString.parse("::cardmem");
+ static RSString COMMAND_TOGGLE_FPSOFF = RSString.parse("::fpsoff");
+ static RSString COMMAND_PC_CACHE_SIZE = RSString.parse("::pcachesize");
+ static RSString aString_853 = RSString.parse("::tele ");
+ static RSString COMMAND_LOWRES_GRAPHICS = RSString.parse("::wm0");
+ static RSString COMMAND_TOGGLE_FPSON = RSString.parse("::fpson");
+ static RSString COMMAND_REBUILD = RSString.parse("::rebuild");
+ static RSString COMMAND_BREAK_CONNECTION = RSString.parse("::breakcon");
+ static RSString COMMAND_ERROR_TEST = RSString.parse("::errortest");
+ static RSString COMMAND_SET_PARTICLES = RSString.parse("::setparticles");
+ static RSString COMMAND_RECT_DEBUG = RSString.parse("::rect_debug");
+ static RSString COMMAND_RENDER_INFO = RSString.parse("::renderinfo");
+ static RSString COMMAND_DISCORD = RSString.parse("::discord");
+ static RSString COMMAND_HIGHSCORES = RSString.parse("::highscores");
+ static RSString COMMAND_HISCORES = RSString.parse("::hiscores");
+ static RSString COMMAND_VARPDEBUG = RSString.parse("::verbose_varp");
+ /**
+ * Used as text for client commands
+ */
+ static RSString Memoryk = RSString.parse("k");
+ static RSString aString_985 = RSString.parse("Fps:");
+ static RSString aString_1630 = RSString.parse("Mem:");
+ static RSString memoryBeforeCleanup = RSString.parse("Memory before cleanup=");
+ static RSString aString_3653 = RSString.parse("Shift)2click disabled)3");
+ static RSString aString_434 = RSString.parse("Shift)2click ENABLED(Q");
+ static RSString forcedTweeningDisabled = RSString.parse("Forced tweening disabled)3");
+ static RSString forcedTweeningEnabled = RSString.parse("Forced tweening / animation smoothing ENABLED(Q");
+ /**
+ * Website
+ */
+ static RSString aString_577 = RSString.parse("http:)4)4");
+ /**
+ * Displayed if user is on a f2p world
+ */
+ static RSString MembersObject = RSString.parse("Members object");
+ /**
+ * Fonts
+ */
+ public static java.awt.Font Helvetica = new java.awt.Font("Helvetica", java.awt.Font.BOLD, 13);
+ /**
+ * Unsorted
+ */
+ static RSString Spacer = RSString.parse(" ");
+ static RSString aString_3339 = RSString.parse("null");
+ static RSString aString_3357 = RSString.parse("");
+ static RSString memoryEquals = RSString.parse("mem=");
+ static RSString aString_3399 = RSString.parse(" (X");
+ static RSString aString_3418 = RSString.parse("(U5");
+ static RSString aString_2498 = RSString.parse("(U (X");
+ static RSString aString_3574 = RSString.parse("titlebg");
+ static RSString aString_3577 = RSString.parse(": ");
+ static RSString aString_3703 = RSString.parse(" )2> ");
+ static RSString aString_3777 = RSString.parse(" x ");
+ static RSString aString_2608 = RSString.parse(")4l=");
+ static RSString aString_2168 = RSString.parse(" ");
+ static RSString aString_106 = RSString.parse("showVideoAd");
+ static RSString aString_331 = RSString.parse("(U1");
+ static RSString aString_339 = RSString.parse("1");
+ static RSString aString_341 = RSString.parse(")3");
+ static RSString aString_436 = RSString.parse("Cache:");
+ static RSString aString_442 = RSString.parse("Number of player models in cache:");
+ static RSString aString_516 = RSString.parse("unzap");
+ static RSString aString_2610 = RSString.parse(")1o");
+ static RSString aString_673 = RSString.parse(")0");
+ static RSString aString_676 = null;
+ static RSString aString_852 = RSString.parse("(U4");
+ static RSString aString_892 = RSString.parse(" )2> ");
+ static RSString aString_1051 = RSString.parse("(Udns");
+ static RSString LEFT_PARENTHESES = RSString.parse(" (X");
+ static RSString aString_1076 = RSString.parse("<)4col>");
+ static RSString aString_1151 = RSString.parse("settings=");
+ static RSString aString_1301 = RSString.parse("(U3");
+ static RSString aString_1341 = RSString.parse("logo");
+ static RSString aString_1342 = RSString.parse("details");
+ static RSString aString_2171 = RSString.parse("");
+ static RSString aString_1687 = RSString.parse("(Z");
+ static RSString aString_1694 = RSString.parse("document)3cookie=(R");
+ static RSString aString_1724 = RSString.parse(" )2>");
+ static RSString aString_1745 = RSString.parse("settings");
+ static RSString aString_1760 = RSString.parse("");
+ static RSString aString_2707 = RSString.parse(" (X100(U(Y");
+ static RSString aString_2735 = RSString.parse(")4");
+ static RSString aString_2765 = RSString.parse(" ");
+ static RSString aString_2928 = RSString.parse("null");
+ static RSString aString_1880 = RSString.parse(")1");
+ static RSString aString_2006 = RSString.parse("null");
+ static RSString aString_2018 = RSString.parse("Cabbage");
+ static RSString aString_2025 = RSString.parse(")2");
+ static RSString aString_2033 = RSString.parse("Memory after cleanup=");
+ static RSString aString_2044 = RSString.parse("cookieprefix");
+ static RSString aString_4007 = RSString.parse(":");
+ static RSString aString_4023 = RSString.parse(")3");
+ static RSString aString_3013 = RSString.parse("0");
+ static RSString aString_2074 = RSString.parse("; version=1; path=)4; domain=");
+ static RSString rectDebugEquals = RSString.parse("rect_debug=");
+ static RSString aString_2080 = RSString.parse("(U2");
+ static RSString aString_2116 = RSString.parse("Hidden)2use");
+ static RSString aString_1915 = RSString.parse("Null");
+ static RSString aString_2584 = RSString.parse("<)4col>");
+ static RSString aString_209 = RSString.parse("event_opbase");
+ static RSString aString_2304 = RSString.parse("details");
+ static RSString aString_2306 = RSString.parse("<)4col> x");
+ static RSString aString_2323 = RSString.parse(" ");
+ static RSString aString_2331 = RSString.parse("");
+ static RSString RIGHT_PARENTHESES = RSString.parse("(Y");
+
+}
diff --git a/Client/src/main/java/org/runite/client/Texture.java b/Client/src/main/java/org/runite/client/Texture.java
new file mode 100644
index 000000000..27f61f278
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Texture.java
@@ -0,0 +1,826 @@
+package org.runite.client;
+
+import org.rs09.client.data.ReferenceCache;
+
+import java.util.Objects;
+
+public final class Texture {
+
+ static int anInt2208 = -1;
+ static int[] anIntArray2213 = new int[]{16776960, 16711680, 65280, 65535, 16711935, 16777215};
+ static RSString[] aStringArray3317 = new RSString[TextureOperation35.anInt3332];
+ static int[] anIntArray3318 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3319 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3327 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3329 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3331 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3336 = new int[TextureOperation35.anInt3332];
+ static int[] anIntArray3337 = new int[TextureOperation35.anInt3332];
+ static int anInt1668 = -1;
+ static ReferenceCache aReferenceCache_1146 = new ReferenceCache(64);
+ static int anInt1150 = -1;
+ public static int y1152;
+ private final int[] anIntArray1144;
+ private final TextureOperation aClass3_Sub13_1145;
+ private final TextureOperation[] aClass3_Sub13Array1147;
+ private final TextureOperation aClass3_Sub13_1148;
+ private final int[] anIntArray1149;
+
+
+ public Texture() {
+ try {
+ this.anIntArray1149 = new int[0];
+ this.anIntArray1144 = new int[0];
+ this.aClass3_Sub13_1145 = new TextureOperation0();
+ this.aClass3_Sub13_1145.imageCacheCapacity = 1;
+ this.aClass3_Sub13_1148 = new TextureOperation0();
+ this.aClass3_Sub13Array1147 = new TextureOperation[]{this.aClass3_Sub13_1145, this.aClass3_Sub13_1148};
+ this.aClass3_Sub13_1148.imageCacheCapacity = 1;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "lc.()");
+ }
+ }
+
+ Texture(DataBuffer var1) {
+ try {
+ int var2 = var1.readUnsignedByte();
+ this.aClass3_Sub13Array1147 = new TextureOperation[var2];
+ int[][] var5 = new int[var2][];
+ int var4 = 0;
+ int var3 = 0;
+
+ int var6;
+ TextureOperation textureOperation;
+ int var8;
+ int var9;
+ for (var6 = 0; var2 > var6; ++var6) {
+ textureOperation = decodeTexture(var1);
+ if (0 <= textureOperation.method159(4)) {
+ ++var3;
+ }
+
+ if (textureOperation.getSpriteFrame() >= 0) {
+ ++var4;
+ }
+
+ var8 = textureOperation.subOperations.length;
+ var5[var6] = new int[var8];
+
+ for (var9 = 0; var9 < var8; ++var9) {
+ var5[var6][var9] = var1.readUnsignedByte();
+ }
+
+ this.aClass3_Sub13Array1147[var6] = textureOperation;
+ }
+
+ this.anIntArray1144 = new int[var3];
+ this.anIntArray1149 = new int[var4];
+ var3 = 0;
+ var4 = 0;
+
+ for (var6 = 0; var6 < var2; ++var6) {
+ textureOperation = this.aClass3_Sub13Array1147[var6];
+ var8 = textureOperation.subOperations.length;
+
+ for (var9 = 0; var8 > var9; ++var9) {
+ textureOperation.subOperations[var9] = this.aClass3_Sub13Array1147[var5[var6][var9]];
+ }
+
+ var9 = textureOperation.method159(4);
+ int var10 = textureOperation.getSpriteFrame();
+ if (var9 > 0) {
+ this.anIntArray1144[var3++] = var9;
+ }
+
+ if (var10 > 0) {
+ this.anIntArray1149[var4++] = var10;
+ }
+
+ var5[var6] = null;
+ }
+
+ this.aClass3_Sub13_1145 = this.aClass3_Sub13Array1147[var1.readUnsignedByte()];
+ this.aClass3_Sub13_1148 = this.aClass3_Sub13Array1147[var1.readUnsignedByte()];
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "lc.(" + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static void method1405(int var0, int var1, int var2, int var3, int var4, int var5, int var6) {
+ try {
+ TextureOperation8.anInt3464 = 0;
+
+ int var7;
+ int var15;
+ int var19;
+ int var21;
+ int var22;
+ int var29;
+ int var32;
+ for (var7 = -1; var7 < Class159.localPlayerCount + Class163.localNPCCount; ++var7) {
+ Entity var8;
+ if (var7 == -1) {
+ var8 = Class102.player;
+ } else if (var7 < Class159.localPlayerCount) {
+ var8 = Unsorted.players[Class56.localPlayerIndexes[var7]];
+ } else {
+ var8 = NPC.npcs[AudioThread.localNPCIndexes[-Class159.localPlayerCount + var7]];
+ }
+
+ if (null != var8 && var8.hasDefinitions()) {
+ NPCDefinition var9;
+ if (var8 instanceof NPC) {
+ var9 = ((NPC) var8).definition;
+ if (null != var9.childNPCs) {
+ var9 = var9.method1471((byte) -93);
+ }
+
+ if (var9 == null) {
+ continue;
+ }
+ }
+
+ int var12;
+ if (var7 < Class159.localPlayerCount) {
+ var19 = 30;
+ Player var10 = (Player) var8;
+ if (var10.skullIcon != -1 || -1 != var10.headIcon) {
+ Class107.method1647(var4 >> 1, var3, var8, var5, var8.method1975(var6 ^ -28716) - -15, var1 >> 1);
+ if (-1 < Class32.anInt590) {
+ if (var10.skullIcon != -1) {
+ TextureOperation2.aAbstractSpriteArray3373[var10.skullIcon].drawAt(-12 + Class32.anInt590 + var2, -var19 + var0 + anInt2208);
+ var19 += 25;
+ }
+
+ if (var10.headIcon != -1) {
+ NPC.aAbstractSpriteArray3977[var10.headIcon].drawAt(-12 + var2 + Class32.anInt590, var0 - (-anInt2208 + var19));
+ var19 += 25;
+ }
+ }
+ }
+
+ if (var7 >= 0) {
+ Class96[] var11 = ClientErrorException.aClass96Array2114;
+
+ for (var12 = 0; var12 < var11.length; ++var12) {
+ Class96 var13 = var11[var12];
+ if (null != var13 && var13.anInt1360 == 10 && Class56.localPlayerIndexes[var7] == var13.anInt1359) {
+ Class107.method1647(var4 >> 1, var3, var8, var5, var8.method1975(var6 ^ -28716) - -15, var1 >> 1);
+ if (Class32.anInt590 > -1) {
+ Class166.aAbstractSpriteArray2072[var13.anInt1351].drawAt(var2 - (-Class32.anInt590 + 12), var0 + (anInt2208 - var19));
+ }
+ }
+ }
+ }
+ } else {
+ var9 = ((NPC) var8).definition;
+ if (var9.childNPCs != null) {
+ var9 = var9.method1471((byte) 102);
+ }
+
+ if (Objects.requireNonNull(var9).anInt1269 >= 0 && NPC.aAbstractSpriteArray3977.length > var9.anInt1269) {
+ if (var9.anInt1265 == -1) {
+ var22 = 15 + var8.method1975(27855);
+ } else {
+ var22 = 15 + var9.anInt1265;
+ }
+
+ Class107.method1647(var4 >> 1, var3, var8, var5, var22, var1 >> 1);
+ if (Class32.anInt590 > -1) {
+ NPC.aAbstractSpriteArray3977[var9.anInt1269].drawAt(var2 - -Class32.anInt590 - 12, -30 + var0 - -anInt2208);
+ }
+ }
+
+ Class96[] var20 = ClientErrorException.aClass96Array2114;
+
+ for (var21 = 0; var20.length > var21; ++var21) {
+ Class96 var24 = var20[var21];
+ if (null != var24 && var24.anInt1360 == 1 && AudioThread.localNPCIndexes[-Class159.localPlayerCount + var7] == var24.anInt1359 && Class44.anInt719 % 20 < 10) {
+ if (-1 == var9.anInt1265) {
+ var29 = 15 + var8.method1975(var6 + '\u89b4');
+ } else {
+ var29 = 15 + var9.anInt1265;
+ }
+
+ Class107.method1647(var4 >> 1, var3, var8, var5, var29, var1 >> 1);
+ if (Class32.anInt590 > -1) {
+ Class166.aAbstractSpriteArray2072[var24.anInt1351].drawAt(-12 + var2 + Class32.anInt590, -28 + anInt2208 + var0);
+ }
+ }
+ }
+ }
+
+ if (var8.textSpoken != null && (var7 >= Class159.localPlayerCount || CS2Script.anInt3101 == 0 || 3 == CS2Script.anInt3101 || 1 == CS2Script.anInt3101 && ItemDefinition.method1176(((Player) var8).displayName))) {
+ Class107.method1647(var4 >> 1, var3, var8, var5, var8.method1975(27855), var1 >> 1);
+ if (-1 < Class32.anInt590 && TextureOperation8.anInt3464 < TextureOperation35.anInt3332) {
+ anIntArray3329[TextureOperation8.anInt3464] = FontType.bold.method682(var8.textSpoken) / 2;
+ anIntArray3327[TextureOperation8.anInt3464] = FontType.bold.anInt3727;
+ anIntArray3319[TextureOperation8.anInt3464] = Class32.anInt590;
+ anIntArray3337[TextureOperation8.anInt3464] = anInt2208;
+ anIntArray3331[TextureOperation8.anInt3464] = var8.textColor;
+ anIntArray3336[TextureOperation8.anInt3464] = var8.textEffect;
+ anIntArray3318[TextureOperation8.anInt3464] = var8.textCycle;
+ aStringArray3317[TextureOperation8.anInt3464] = var8.textSpoken;
+ ++TextureOperation8.anInt3464;
+ }
+ }
+
+ if (Class44.anInt719 < var8.anInt2781) {
+ AbstractSprite var23 = Unsorted.aAbstractSpriteArray996[0];
+ AbstractSprite var25 = Unsorted.aAbstractSpriteArray996[1];
+ if (var8 instanceof NPC) {
+ NPC var28 = (NPC) var8;
+ AbstractSprite[] var31 = (AbstractSprite[]) TextureOperation1.aReferenceCache_3130.get(var28.definition.anInt1279);
+ if (var31 == null) {
+ var31 = Class140_Sub6.getSprites(var28.definition.anInt1279, CacheIndex.spritesIndex);
+ if (null != var31) {
+ TextureOperation1.aReferenceCache_3130.put(var31, var28.definition.anInt1279);
+ }
+ }
+
+ if (null != var31 && var31.length == 2) {
+ var25 = var31[1];
+ var23 = var31[0];
+ }
+
+ NPCDefinition var14 = var28.definition;
+ if (-1 == var14.anInt1265) {
+ var21 = var8.method1975(27855);
+ } else {
+ var21 = var14.anInt1265;
+ }
+ } else {
+ var21 = var8.method1975(27855);
+ }
+
+ Class107.method1647(var4 >> 1, var3, var8, var5, var23.height + 10 + var21, var1 >> 1);
+ if (-1 < Class32.anInt590) {
+ var12 = -(var23.width >> 1) + Class32.anInt590 + var2;
+ var29 = anInt2208 + var0 + -3;
+ var23.drawAt(var12, var29);
+ var32 = var23.width * var8.anInt2775 / 255;
+ var15 = var23.height;
+ if (HDToolKit.highDetail) {
+ Class22.method931(var12, var29, var12 + var32, var29 + var15);
+ } else {
+ Class74.method1326(var12, var29, var12 + var32, var15 + var29);
+ }
+
+ var25.drawAt(var12, var29);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var2, var0, var1 + var2, var0 - -var4);
+ } else {
+ Class74.setClipping(var2, var0, var1 + var2, var4 + var0);
+ }
+ }
+ }
+
+ for (var19 = 0; var19 < 4; ++var19) {
+ if (Class44.anInt719 < var8.anIntArray2768[var19]) {
+ if (var8 instanceof NPC) {
+ NPC var30 = (NPC) var8;
+ NPCDefinition var26 = var30.definition;
+ if (var26.anInt1265 == -1) {
+ var22 = var8.method1975(27855) / 2;
+ } else {
+ var22 = var26.anInt1265 / 2;
+ }
+ } else {
+ var22 = var8.method1975(var6 ^ -28716) / 2;
+ }
+
+ Class107.method1647(var4 >> 1, var3, var8, var5, var22, var1 >> 1);
+ if (-1 < Class32.anInt590) {
+ if (var19 == 1) {
+ anInt2208 -= 20;
+ }
+
+ if (var19 == 2) {
+ anInt2208 -= 10;
+ Class32.anInt590 -= 15;
+ }
+
+ if (3 == var19) {
+ anInt2208 -= 10;
+ Class32.anInt590 += 15;
+ }
+
+ Class75_Sub3.aAbstractSpriteArray2656[var8.anIntArray2815[var19]].drawAt(-12 + var2 + Class32.anInt590, var0 + anInt2208 - 12);
+ FontType.smallFont.method699(RSString.stringAnimator(var8.anIntArray2836[var19]), -1 + Class32.anInt590 + var2, 3 + anInt2208 + var0, 16777215, 0);
+ }
+ }
+ }
+ }
+ }
+
+ var7 = 0;
+ if (var6 != -7397) {
+ method1409(true);
+ }
+
+ for (; TextureOperation8.anInt3464 > var7; ++var7) {
+ var19 = anIntArray3337[var7];
+ int var18 = anIntArray3319[var7];
+ var21 = anIntArray3327[var7];
+ var22 = anIntArray3329[var7];
+ boolean var27 = true;
+
+ while (var27) {
+ var27 = false;
+
+ for (var29 = 0; var7 > var29; ++var29) {
+ if (anIntArray3337[var29] - anIntArray3327[var29] < 2 + var19 && -var21 + var19 < anIntArray3337[var29] - -2 && -var22 + var18 < anIntArray3319[var29] + anIntArray3329[var29] && anIntArray3319[var29] - anIntArray3329[var29] < var22 + var18 && -anIntArray3327[var29] + anIntArray3337[var29] < var19) {
+ var19 = anIntArray3337[var29] - anIntArray3327[var29];
+ var27 = true;
+ }
+ }
+ }
+
+ Class32.anInt590 = anIntArray3319[var7];
+ anInt2208 = anIntArray3337[var7] = var19;
+ RSString var33 = aStringArray3317[var7];
+ if (Unsorted.anInt688 == 0) {
+ var32 = 16776960;
+ if (anIntArray3331[var7] < 6) {
+ var32 = anIntArray2213[anIntArray3331[var7]];
+ }
+
+ if (6 == anIntArray3331[var7]) {
+ var32 = 10 <= CSConfigCachefile.anInt1127 % 20 ? 16776960 : 16711680;
+ }
+
+ if (anIntArray3331[var7] == 7) {
+ var32 = CSConfigCachefile.anInt1127 % 20 < 10 ? 255 : 65535;
+ }
+
+ if (8 == anIntArray3331[var7]) {
+ var32 = CSConfigCachefile.anInt1127 % 20 >= 10 ? 8454016 : '\ub000';
+ }
+
+ if (9 == anIntArray3331[var7]) {
+ var15 = -anIntArray3318[var7] + 150;
+ if (var15 >= 50) {
+ if (var15 >= 100) {
+ if (150 > var15) {
+ var32 = -500 - (-(5 * var15) - 65280);
+ }
+ } else {
+ var32 = 16776960 + 16384000 + -(327680 * var15);
+ }
+ } else {
+ var32 = var15 * 1280 + 16711680;
+ }
+ }
+
+ if (10 == anIntArray3331[var7]) {
+ var15 = -anIntArray3318[var7] + 150;
+ if (50 <= var15) {
+ if (var15 < 100) {
+ var32 = -(327680 * (-50 + var15)) + 16711935;
+ } else if (150 > var15) {
+ var32 = 327680 * var15 - (32768000 - (255 + -(5 * var15) + 500));
+ }
+ } else {
+ var32 = 16711680 + var15 * 5;
+ }
+ }
+
+ if (anIntArray3331[var7] == 11) {
+ var15 = 150 + -anIntArray3318[var7];
+ if (var15 >= 50) {
+ if (var15 >= 100) {
+ if (var15 < 150) {
+ var32 = 16777215 - var15 * 327680 + 32768000;
+ }
+ } else {
+ var32 = 65280 - (-(327685 * var15) - -16384250);
+ }
+ } else {
+ var32 = 16777215 - 327685 * var15;
+ }
+ }
+
+ if (0 == anIntArray3336[var7]) {
+ FontType.bold.method699(var33, Class32.anInt590 + var2, var0 + anInt2208, var32, 0);
+ }
+
+ if (1 == anIntArray3336[var7]) {
+ FontType.bold.method696(var33, var2 - -Class32.anInt590, anInt2208 + var0, var32, CSConfigCachefile.anInt1127);
+ }
+
+ if (anIntArray3336[var7] == 2) {
+ FontType.bold.method695(var33, var2 - -Class32.anInt590, var0 - -anInt2208, var32, CSConfigCachefile.anInt1127);
+ }
+
+ if (anIntArray3336[var7] == 3) {
+ FontType.bold.method692(var33, var2 + Class32.anInt590, anInt2208 + var0, var32, CSConfigCachefile.anInt1127, 150 - anIntArray3318[var7]);
+ }
+
+ if (4 == anIntArray3336[var7]) {
+ var15 = (-anIntArray3318[var7] + 150) * (FontType.bold.method682(var33) - -100) / 150;
+ if (HDToolKit.highDetail) {
+ Class22.method931(Class32.anInt590 + var2 + -50, var0, Class32.anInt590 + var2 - -50, var4 + var0);
+ } else {
+ Class74.method1326(-50 + (var2 - -Class32.anInt590), var0, 50 + Class32.anInt590 + var2, var4 + var0);
+ }
+
+ FontType.bold.method681(var33, var2 - (-Class32.anInt590 + -50) + -var15, var0 + anInt2208, var32, 0);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var2, var0, var1 + var2, var4 + var0);
+ } else {
+ Class74.setClipping(var2, var0, var2 - -var1, var0 + var4);
+ }
+ }
+
+ if (anIntArray3336[var7] == 5) {
+ int var16 = 0;
+ var15 = -anIntArray3318[var7] + 150;
+ if (HDToolKit.highDetail) {
+ Class22.method931(var2, -1 + -FontType.bold.anInt3727 + anInt2208 + var0, var1 + var2, 5 + var0 - -anInt2208);
+ } else {
+ Class74.method1326(var2, -1 + -FontType.bold.anInt3727 + anInt2208 + var0, var2 + var1, 5 + anInt2208 + var0);
+ }
+
+ if (25 > var15) {
+ var16 = var15 + -25;
+ } else if (var15 > 125) {
+ var16 = var15 - 125;
+ }
+
+ FontType.bold.method699(var33, Class32.anInt590 + var2, var16 + var0 + anInt2208, var32, 0);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var2, var0, var2 - -var1, var0 + var4);
+ } else {
+ Class74.setClipping(var2, var0, var2 + var1, var0 + var4);
+ }
+ }
+ } else {
+ FontType.bold.method699(var33, var2 - -Class32.anInt590, var0 + anInt2208, 16776960, 0);
+ }
+ }
+
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "lc.D(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ static int method1406() {
+ try {
+ return Unsorted.anInt4045;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "lc.E(" + (byte) -43 + ')');
+ }
+ }
+
+ public static void method1409(boolean var0) {
+ try {
+ aReferenceCache_1146 = null;
+ if (var0) {
+ TextCore.aString_1151 = null;
+ }
+
+ TextCore.aString_1151 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "lc.A(" + var0 + ')');
+ }
+ }
+
+ public static TextureOperation decodeTexture(DataBuffer var1) {
+ try {
+ var1.readUnsignedByte();
+ int type = var1.readUnsignedByte();
+ TextureOperation var3 = create(type);
+ Objects.requireNonNull(var3).imageCacheCapacity = var1.readUnsignedByte();
+ int codes = var1.readUnsignedByte();
+ for (int var5 = 0; var5 < codes; ++var5) {
+ int opcode = var1.readUnsignedByte();
+ var3.decode(opcode, var1);
+ }
+
+ var3.postDecode();
+ return var3;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "qk.B(" + (byte) -67 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static TextureOperation create(int type) {
+ if (type == 0) {
+ return new TextureOperation0();
+ } else if (type == 1) {
+ return new TextureOperation1();
+ } else if (2 == type) {
+ return new TextureOperation2();
+ } else if (type == 3) {
+ return new TextureOperation3();
+ } else if (type == 4) {
+ return new TextureOperation4();
+ } else if (type == 5) {
+ return new TextureOperation5();
+ } else if (type == 6) {
+ return new TextureOperation6();
+ } else if (type == 7) {
+ return new TextureOperation7();
+ } else if (type == 8) {
+ return new TextureOperation8();
+ } else if (9 == type) {
+ return new TextureOperation9();
+ } else if (10 == type) {
+ return new TextureOperation10();
+ } else if (type == 11) {
+ return new TextureOperation11();
+ } else if (type == 12) {
+ return new TextureOperation12();
+ } else if (type == 13) {
+ return new TextureOperation13();
+ } else if (14 == type) {
+ return new TextureOperation14();
+ } else if (type == 15) {
+ return new TextureOperation15();
+ } else if (type == 16) {
+ return new TextureOperation16();
+ } else if (17 == type) {
+ return new TextureOperation17();
+ } else if (type == 18) {
+ return new TextureOperation18();
+ } else if (type == 19) {
+ return new TextureOperation19();
+ } else if (type == 20) {
+ return new TextureOperation20();
+ } else if (21 == type) {
+ return new TextureOperation21();
+ } else if (22 == type) {
+ return new TextureOperation22();
+ } else if (type == 23) {
+ return new TextureOperation23();
+ } else if (24 == type) {
+ return new TextureOperation24();
+ } else if (type == 25) {
+ return new TextureOperation25();
+ } else if (type == 26) {
+ return new TextureOperation26();
+ } else if (27 == type) {
+ return new TextureOperation27();
+ } else if (type == 28) {
+ return new TextureOperation28();
+ } else if (type == 29) {
+ return new TextureOperation29();
+ } else if (type == 30) {
+ return new TextureOperation30();
+ } else if (31 == type) {
+ return new TextureOperation31();
+ } else if (32 == type) {
+ return new TextureOperation32();
+ } else if (33 == type) {
+ return new TextureOperation33();
+ } else if (type == 34) {
+ return new TextureOperation34();
+ } else if (type == 35) {
+ return new TextureOperation35();
+ } else if (type == 36) {
+ return new TextureOperation36();
+ } else if (type == 37) {
+ return new TextureOperation37();
+ } else if (38 == type) {
+ return new TextureOperation38();
+ } else if (39 == type) {
+ return new TextureOperation39();
+ } else {
+ return null;
+ }
+ }
+
+ final int[] method1404(int var1, boolean var2, int var3, double var4, CacheIndex var7, Interface2 var8, boolean var9) {
+ try {
+ GameObject.method1859(var4);
+ Class17.anInterface2_408 = var8;
+ WaterfallShader.spritesIndex_probably_2172 = var7;
+ TextureOperation33.method180(-1, var1, var3);
+
+ int var11;
+ for (var11 = 0; var11 < this.aClass3_Sub13Array1147.length; ++var11) {
+ this.aClass3_Sub13Array1147[var11].method160(var1, var3);
+ }
+
+ int[] var10 = new int[var1 * var3];
+ int var12;
+ byte var13;
+ if (var9) {
+ var13 = -1;
+ var12 = -1;
+ var11 = var3 - 1;
+ } else {
+ var13 = 1;
+ var11 = 0;
+ var12 = var3;
+ }
+
+ int var14 = 0;
+
+ int var15;
+ for (var15 = 0; var1 > var15; ++var15) {
+ if (var2) {
+ var14 = var15;
+ }
+
+ int[] var17;
+ int[] var16;
+ int[] var18;
+ if (this.aClass3_Sub13_1145.aBoolean2375) {
+ int[] var19 = this.aClass3_Sub13_1145.method154(var15, (byte) 109);
+ var16 = var19;
+ var17 = var19;
+ var18 = var19;
+ } else {
+ int[][] var24 = this.aClass3_Sub13_1145.method166(var15);
+ var16 = var24[0];
+ var18 = var24[2];
+ var17 = var24[1];
+ }
+
+ for (int var25 = var11; var25 != var12; var25 += var13) {
+ int var20 = var16[var25] >> 4;
+ if (var20 > 255) {
+ var20 = 255;
+ }
+
+ if (var20 < 0) {
+ var20 = 0;
+ }
+
+ var20 = BufferedDataStream.anIntArray3804[var20];
+ int var22 = var18[var25] >> 4;
+ int var21 = var17[var25] >> 4;
+ if (var21 > 255) {
+ var21 = 255;
+ }
+
+ if (0 > var21) {
+ var21 = 0;
+ }
+
+ if (var22 > 255) {
+ var22 = 255;
+ }
+
+ var21 = BufferedDataStream.anIntArray3804[var21];
+ if (var22 < 0) {
+ var22 = 0;
+ }
+
+ var22 = BufferedDataStream.anIntArray3804[var22];
+ var10[var14++] = (var20 << 16) - -(var21 << 8) + var22;
+ if (var2) {
+ var14 += var3 + -1;
+ }
+ }
+ }
+
+ for (var15 = 0; var15 < this.aClass3_Sub13Array1147.length; ++var15) {
+ this.aClass3_Sub13Array1147[var15].method161((byte) -45);
+ }
+
+ return var10;
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "lc.C(" + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + 327680 + ',' + (var7 != null ? "{...}" : "null") + ',' + (var8 != null ? "{...}" : "null") + ',' + var9 + ')');
+ }
+ }
+
+ final byte[] method1407(int var1, int var2, boolean var3, Interface2 var4, CacheIndex var8) {
+ try {
+ byte[] var9 = new byte[4 * var2 * var1];
+ GameObject.method1859(0.7);
+ WaterfallShader.spritesIndex_probably_2172 = var8;
+ Class17.anInterface2_408 = var4;
+ TextureOperation33.method180(-32, var1, var2);
+
+ int var10;
+ for (var10 = 0; this.aClass3_Sub13Array1147.length > var10; ++var10) {
+ this.aClass3_Sub13Array1147[var10].method160(var1, var2);
+ }
+
+ var10 = 0;
+
+ int var11;
+ for (var11 = 0; var11 < var1; ++var11) {
+ if (var3) {
+ var10 = var11 << 2;
+ }
+
+ int[] var12;
+ int[] var13;
+ int[] var14;
+ int[] var15;
+ if (this.aClass3_Sub13_1145.aBoolean2375) {
+ var15 = this.aClass3_Sub13_1145.method154(var11, (byte) -98);
+ var12 = var15;
+ var13 = var15;
+ var14 = var15;
+ } else {
+ int[][] var22 = this.aClass3_Sub13_1145.method166(var11);
+ var12 = var22[0];
+ var13 = var22[1];
+ var14 = var22[2];
+ }
+
+ if (this.aClass3_Sub13_1148.aBoolean2375) {
+ var15 = this.aClass3_Sub13_1148.method154(var11, (byte) -103);
+ } else {
+ var15 = this.aClass3_Sub13_1148.method166(var11)[0];
+ }
+
+ for (int var16 = var2 - 1; var16 >= 0; --var16) {
+ int var17 = var12[var16] >> 4;
+ if (var17 > 255) {
+ var17 = 255;
+ }
+
+ if (var17 < 0) {
+ var17 = 0;
+ }
+
+ int var18 = var13[var16] >> 4;
+ if (var18 > 255) {
+ var18 = 255;
+ }
+
+ int var19 = var14[var16] >> 4;
+ if (var19 > 255) {
+ var19 = 255;
+ }
+
+ var17 = BufferedDataStream.anIntArray3804[var17];
+ if (var19 < 0) {
+ var19 = 0;
+ }
+
+ if (var18 < 0) {
+ var18 = 0;
+ }
+
+ var18 = BufferedDataStream.anIntArray3804[var18];
+ var19 = BufferedDataStream.anIntArray3804[var19];
+ int var20;
+ if (var17 == 0 && var18 == 0 && var19 == 0) {
+ var20 = 0;
+ } else {
+ var20 = var15[var16] >> 4;
+ if (255 < var20) {
+ var20 = 255;
+ }
+
+ if (var20 < 0) {
+ var20 = 0;
+ }
+ }
+
+ var9[var10++] = (byte) var17;
+ var9[var10++] = (byte) var18;
+ var9[var10++] = (byte) var19;
+ var9[var10++] = (byte) var20;
+ if (var3) {
+ var10 += -4 + (var2 << 2);
+ }
+ }
+ }
+
+ for (var11 = 0; this.aClass3_Sub13Array1147.length > var11; ++var11) {
+ this.aClass3_Sub13Array1147[var11].method161((byte) -45);
+ }
+
+ return var9;
+ } catch (RuntimeException var21) {
+ throw ClientErrorException.clientError(var21, "lc.F(" + var1 + ',' + var2 + ',' + var3 + ',' + (var4 != null ? "{...}" : "null") + ',' + 0.7 + ',' + 8839 + ',' + (var8 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ final boolean method1408(Interface2 var2, CacheIndex var3) {
+ try {
+ int var4;
+ if (0 < anInt1668) {
+ for (var4 = 0; this.anIntArray1144.length > var4; ++var4) {
+ if (!var3.method2129((byte) -78, this.anIntArray1144[var4], anInt1668)) {
+ return false;
+ }
+ }
+ } else {
+ for (var4 = 0; this.anIntArray1144.length > var4; ++var4) {
+ if (!var3.retrieveSpriteFile(this.anIntArray1144[var4])) {
+ return false;
+ }
+ }
+ }
+
+ for (var4 = 0; var4 < this.anIntArray1149.length; ++var4) {
+ if (!var2.method11(21, this.anIntArray1149[var4])) {
+ return false;
+ }
+ }
+
+ return true;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "lc.B(" + true + ',' + (var2 != null ? "{...}" : "null") + ',' + (var3 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation.java b/Client/src/main/java/org/runite/client/TextureOperation.java
new file mode 100644
index 000000000..870ca0b63
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation.java
@@ -0,0 +1,155 @@
+package org.runite.client;
+
+import org.rs09.client.Linkable;
+import org.runite.client.drawcalls.LoadingBox;
+
+import java.util.Random;
+
+public abstract class TextureOperation extends Linkable {
+
+ boolean aBoolean2375;
+ Class97 aClass97_2376;
+ TextureOperation[] subOperations;
+ static int anInt2378 = 0;
+ int imageCacheCapacity;
+ Class114 aClass114_2382;
+ static int anInt2383 = 0;
+
+ static int method1603(byte var0, int var1, Random var2) {
+ try {
+ if (var1 <= 0) {
+ throw new IllegalArgumentException();
+ } else if (Class140_Sub6.method2021((byte) -115, var1)) {
+ return (int) (((long) var2.nextInt() & 4294967295L) * (long) var1 >> 32);
+ } else {
+ int var3 = -((int) (4294967296L % (long) var1)) + Integer.MIN_VALUE;
+
+ int var4;
+ do {
+ var4 = var2.nextInt();
+ } while (var3 <= var4);
+
+ return TextureOperation27.method201(var4, var1);
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "ni.C(" + var0 + ',' + var1 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+
+ final int[] method152(int var1, int var2) {
+ return this.subOperations[var1].aBoolean2375 ? this.subOperations[var1].method154(var2, (byte) -118) : this.subOperations[var1].method166(var2)[0];
+ }
+
+ static void method153() {
+ Class3_Sub26.aLinkedList_2557 = new LinkedList();
+ }
+
+ int[] method154(int var1, byte var2) {
+ try {
+ throw new IllegalStateException("This operation does not have a monochrome output");
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "j.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ int getSpriteFrame() {
+ return -1;
+ }
+
+ void decode(int var1, DataBuffer var2) {
+ }
+
+ void postDecode() {
+ }
+
+ int method159(int var1) {
+ try {
+ if (var1 != 4) {
+ LoadingBox.draw(true, null);
+ }
+
+ return -1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "j.GA(" + var1 + ')');
+ }
+ }
+
+ final void method160(int var1, int var2) {
+ try {
+
+ int var4 = 255 == this.imageCacheCapacity ? var1 : this.imageCacheCapacity;
+ if (this.aBoolean2375) {
+ this.aClass114_2382 = new Class114(var4, var1, var2);
+ } else {
+ this.aClass97_2376 = new Class97(var4, var1, var2);
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "j.SA(" + var1 + ',' + var2 + ',' + 250 + ')');
+ }
+ }
+
+ void method161(byte var1) {
+ try {
+ if (var1 != -45) {
+ anInt2383 = 16;
+ }
+
+ if (this.aBoolean2375) {
+ this.aClass114_2382.method1706();
+ this.aClass114_2382 = null;
+ } else {
+ this.aClass97_2376.method1590();
+ this.aClass97_2376 = null;
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "j.BA(" + var1 + ')');
+ }
+ }
+
+ final int[][] method162(int var1, int var2, byte var3) {
+ try {
+ if (var3 > -45) {
+ return null;
+ } else if (this.subOperations[var2].aBoolean2375) {
+ int[] var4 = this.subOperations[var2].method154(var1, (byte) -105);
+ return new int[][]{var4, var4, var4};
+ } else {
+ return this.subOperations[var2].method166(var1);
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "j.UA(" + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ static Class3_Sub28_Sub17_Sub1 method163(byte[] var0) {
+ try {
+ if (var0 == null) {
+ return null;
+ } else {
+
+ Class3_Sub28_Sub17_Sub1 var2 = new Class3_Sub28_Sub17_Sub1(var0, Class164.anIntArray2048, Unsorted.anIntArray2591, GroundItem.anIntArray2931, Unsorted.anIntArray3076, Class163_Sub1.aByteArrayArray2987);
+ Class39.method1035((byte) 126);
+ return var2;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "j.WA(" + "{...}" + ',' + 25208 + ')');
+ }
+ }
+
+ TextureOperation(int var1, boolean var2) {
+ try {
+ this.subOperations = new TextureOperation[var1];
+ this.aBoolean2375 = var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "j.(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ int[][] method166(int var2) {
+ throw new IllegalStateException("This operation does not have a colour output");
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation0.java b/Client/src/main/java/org/runite/client/TextureOperation0.java
new file mode 100644
index 000000000..413fe9b83
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation0.java
@@ -0,0 +1,38 @@
+package org.runite.client;
+
+import org.rs09.client.util.ArrayUtils;
+
+public final class TextureOperation0 extends TextureOperation {
+
+ private int anInt3276;
+
+ protected TextureOperation0() {
+ super(0, true);
+ this.anInt3276 = 4096;
+
+ try {
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "mi.(" + 4096 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ if (var1 == 0) {
+ this.anInt3276 = (var2.readUnsignedByte() << 12) / 255;
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if (this.aClass114_2382.aBoolean1580) {
+ ArrayUtils.fill(var4, 0, Class113.anInt1559, this.anInt3276);
+ }
+
+ return var4;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "mi.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation1.java b/Client/src/main/java/org/runite/client/TextureOperation1.java
new file mode 100644
index 000000000..99b76fdc0
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation1.java
@@ -0,0 +1,176 @@
+package org.runite.client;
+
+import org.rs09.client.data.HashTable;
+import org.rs09.client.data.ReferenceCache;
+
+final class TextureOperation1 extends TextureOperation {
+
+ static int anInt3274;
+ private int anInt3129;
+ static ReferenceCache aReferenceCache_3130 = new ReferenceCache(4);
+ private int anInt3134;
+ private int anInt3135;
+
+
+ protected TextureOperation1() {
+ super(0, false);
+
+ try {
+ this.method218(0);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "fm.(" + 0 + ')');
+ }
+ }
+
+ private void method218(int var2) {
+ try {
+ this.anInt3134 = 4080 & var2 >> 4;
+ this.anInt3135 = var2 << 4 & 4080;
+ this.anInt3129 = (var2 & 16711680) >> 12;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "fm.Q(" + (byte) 75 + ',' + var2 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ method222(-87, 26, 75, -56, 22, -68);
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)-123, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[] var4 = var3[0];
+ int[] var5 = var3[1];
+ int[] var6 = var3[2];
+
+ for(int var7 = 0; Class113.anInt1559 > var7; ++var7) {
+ var4[var7] = this.anInt3129;
+ var5[var7] = this.anInt3134;
+ var6[var7] = this.anInt3135;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "fm.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method219(boolean var0) {
+ try {
+ if(var0) {
+ if(-1 != ConfigInventoryDefinition.anInt3655) {
+ Class60.method1208((byte)-128, ConfigInventoryDefinition.anInt3655);
+ }
+
+ for(Class3_Sub31 var2 = TextureOperation23.aHashTable_3208.first(); null != var2; var2 = TextureOperation23.aHashTable_3208.next()) {
+ TextureOperation19.method254(true, var2);
+ }
+
+ ConfigInventoryDefinition.anInt3655 = -1;
+ TextureOperation23.aHashTable_3208 = new HashTable(8);
+ Class3_Sub7.method122(3000 + -2918);
+ ConfigInventoryDefinition.anInt3655 = Client.loginScreenInterfaceID;
+ Class124.method1746(false, (byte)-36);
+ Unsorted.method1093(false);
+ TextureOperation24.method226(ConfigInventoryDefinition.anInt3655);
+ }
+
+ Class3_Sub28_Sub5.anInt3590 = -1;
+ TextureOperation20.method229(Class161.anInt2027);
+ Class102.player = new Player();
+ Class102.player.yAxis = 3000;
+ Class102.player.xAxis = 3000;
+ if(HDToolKit.highDetail) {
+ if(Class133.anInt1753 == 2) {
+ NPC.anInt3995 = Unsorted.anInt30 << 7;
+ Class77.anInt1111 = Class146.anInt1904 << 7;
+ } else {
+ InterfaceWidget.d(3000 ^ '\uf447');
+ }
+
+ TextureOperation31.method236();
+ TextureOperation26.method195();
+ Class117.method1719(28);
+ } else {
+ Class84.method1418(CacheIndex.spritesIndex);
+ Class117.method1719(10);
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "fm.E(" + var0 + ',' + 3000 + ')');
+ }
+ }
+
+ static void method220(int var1, int var2) {
+ try {
+ Class46.anInt741 = AtmosphereParser.aAtmosphereParserArrayArray1581[var2][var1].anInt1185;
+ anInt3274 = AtmosphereParser.aAtmosphereParserArrayArray1581[var2][var1].anInt1181;
+
+ AtmosphereParser.anInt1191 = AtmosphereParser.aAtmosphereParserArrayArray1581[var2][var1].anInt1178;
+ Class92.setLightPosition((float)Class46.anInt741, (float) anInt3274, (float) AtmosphereParser.anInt1191);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "fm.C(" + true + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method221(int var0, RSString var1, RSString var2, RSString var3, int var4) {
+ try {
+ MessageManager.sendGameMessage(var0, var4, var1, var3, var2);
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "fm.F(" + var0 + ',' + (var1 != null?"{...}":"null") + ',' + (var2 != null?"{...}":"null") + ',' + (var3 != null?"{...}":"null") + ',' + var4 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.method218(var2.readMedium());
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "fm.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static boolean method222(int var0, int var1, int var2, int var3, int var4, int var5) {
+ int var6;
+ int var7;
+ if(var1 == var2 && var3 == var4) {
+ if(Class8.method846(var0, var1, var3)) {
+ var6 = var1 << 7;
+ var7 = var3 << 7;
+ return TextureOperation10.method349(var6 + 1, Class44.anIntArrayArrayArray723[var0][var1][var3] + var5, var7 + 1) && TextureOperation10.method349(var6 + 128 - 1, Class44.anIntArrayArrayArray723[var0][var1 + 1][var3] + var5, var7 + 1) && TextureOperation10.method349(var6 + 128 - 1, Class44.anIntArrayArrayArray723[var0][var1 + 1][var3 + 1] + var5, var7 + 128 - 1) && TextureOperation10.method349(var6 + 1, Class44.anIntArrayArrayArray723[var0][var1][var3 + 1] + var5, var7 + 128 - 1);
+ } else {
+ return false;
+ }
+ } else {
+ for(var6 = var1; var6 <= var2; ++var6) {
+ for(var7 = var3; var7 <= var4; ++var7) {
+ if(Class81.anIntArrayArrayArray1142[var0][var6][var7] == -Class3_Sub28_Sub1.anInt3539) {
+ return false;
+ }
+ }
+ }
+
+ var6 = (var1 << 7) + 1;
+ var7 = (var3 << 7) + 2;
+ int var8 = Class44.anIntArrayArrayArray723[var0][var1][var3] + var5;
+ if(TextureOperation10.method349(var6, var8, var7)) {
+ int var9 = (var2 << 7) - 1;
+ if(TextureOperation10.method349(var9, var8, var7)) {
+ int var10 = (var4 << 7) - 1;
+ if(!TextureOperation10.method349(var6, var8, var10)) {
+ return false;
+ } else return TextureOperation10.method349(var9, var8, var10);
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation10.java b/Client/src/main/java/org/runite/client/TextureOperation10.java
new file mode 100644
index 000000000..f520df4cf
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation10.java
@@ -0,0 +1,450 @@
+package org.runite.client;
+import org.rs09.client.config.GameConfig;
+
+import java.math.BigInteger;
+
+final class TextureOperation10 extends TextureOperation {
+
+ private int[][] anIntArrayArray3438;
+ static Class3_Sub28_Sub17_Sub1 aClass3_Sub28_Sub17_Sub1_3440;
+ static BigInteger EXPONENT = GameConfig.EXPONENT;
+ private int[] anIntArray3443 = new int[257];
+
+
+ final void postDecode() {
+ try {
+
+ if(this.anIntArrayArray3438 == null) {
+ this.method345(1);
+ }
+
+ this.method346();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "um.P(" + ')');
+ }
+ }
+
+ private void method345(int var1) {
+ try {
+ if(var1 != 0) {
+ if(var1 == 1) {
+ this.anIntArrayArray3438 = new int[2][4];
+ this.anIntArrayArray3438[0][1] = 0;
+ this.anIntArrayArray3438[0][0] = 0;
+ this.anIntArrayArray3438[1][0] = 4096;
+ this.anIntArrayArray3438[0][3] = 0;
+ this.anIntArrayArray3438[1][1] = 4096;
+ this.anIntArrayArray3438[0][2] = 0;
+ this.anIntArrayArray3438[1][2] = 4096;
+ this.anIntArrayArray3438[1][3] = 4096;
+ } else if(var1 == 2) {
+ this.anIntArrayArray3438 = new int[8][4];
+ this.anIntArrayArray3438[0][0] = 0;
+ this.anIntArrayArray3438[1][0] = 2867;
+ this.anIntArrayArray3438[2][0] = 3072;
+ this.anIntArrayArray3438[0][2] = 2602;
+ this.anIntArrayArray3438[3][0] = 3276;
+ this.anIntArrayArray3438[0][3] = 2361;
+ this.anIntArrayArray3438[1][3] = 1558;
+ this.anIntArrayArray3438[4][0] = 3481;
+ this.anIntArrayArray3438[5][0] = 3686;
+ this.anIntArrayArray3438[2][3] = 1413;
+ this.anIntArrayArray3438[3][3] = 947;
+ this.anIntArrayArray3438[4][3] = 722;
+ this.anIntArrayArray3438[6][0] = 3891;
+ this.anIntArrayArray3438[1][2] = 1799;
+ this.anIntArrayArray3438[7][0] = 4096;
+ this.anIntArrayArray3438[5][3] = 1766;
+ this.anIntArrayArray3438[2][2] = 1734;
+ this.anIntArrayArray3438[3][2] = 1220;
+ this.anIntArrayArray3438[4][2] = 963;
+ this.anIntArrayArray3438[5][2] = 2152;
+ this.anIntArrayArray3438[6][3] = 915;
+ this.anIntArrayArray3438[7][3] = 1140;
+ this.anIntArrayArray3438[0][1] = 2650;
+ this.anIntArrayArray3438[6][2] = 1060;
+ this.anIntArrayArray3438[1][1] = 2313;
+ this.anIntArrayArray3438[2][1] = 2618;
+ this.anIntArrayArray3438[3][1] = 2296;
+ this.anIntArrayArray3438[4][1] = 2072;
+ this.anIntArrayArray3438[7][2] = 1413;
+ this.anIntArrayArray3438[5][1] = 2730;
+ this.anIntArrayArray3438[6][1] = 2232;
+ this.anIntArrayArray3438[7][1] = 1686;
+ } else if(3 == var1) {
+ this.anIntArrayArray3438 = new int[7][4];
+ this.anIntArrayArray3438[0][0] = 0;
+ this.anIntArrayArray3438[0][3] = 4096;
+ this.anIntArrayArray3438[1][3] = 4096;
+ this.anIntArrayArray3438[2][3] = 0;
+ this.anIntArrayArray3438[1][0] = 663;
+ this.anIntArrayArray3438[0][1] = 0;
+ this.anIntArrayArray3438[3][3] = 0;
+ this.anIntArrayArray3438[1][1] = 0;
+ this.anIntArrayArray3438[2][0] = 1363;
+ this.anIntArrayArray3438[2][1] = 0;
+ this.anIntArrayArray3438[4][3] = 0;
+ this.anIntArrayArray3438[5][3] = 4096;
+ this.anIntArrayArray3438[6][3] = 4096;
+ this.anIntArrayArray3438[3][0] = 2048;
+ this.anIntArrayArray3438[4][0] = 2727;
+ this.anIntArrayArray3438[5][0] = 3411;
+ this.anIntArrayArray3438[6][0] = 4096;
+ this.anIntArrayArray3438[3][1] = 4096;
+ this.anIntArrayArray3438[4][1] = 4096;
+ this.anIntArrayArray3438[5][1] = 4096;
+ this.anIntArrayArray3438[6][1] = 0;
+ this.anIntArrayArray3438[0][2] = 0;
+ this.anIntArrayArray3438[1][2] = 4096;
+ this.anIntArrayArray3438[2][2] = 4096;
+ this.anIntArrayArray3438[3][2] = 4096;
+ this.anIntArrayArray3438[4][2] = 0;
+ this.anIntArrayArray3438[5][2] = 0;
+ this.anIntArrayArray3438[6][2] = 0;
+ } else if(4 == var1) {
+ this.anIntArrayArray3438 = new int[6][4];
+ this.anIntArrayArray3438[0][3] = 0;
+ this.anIntArrayArray3438[0][0] = 0;
+ this.anIntArrayArray3438[0][2] = 0;
+ this.anIntArrayArray3438[1][0] = 1843;
+ this.anIntArrayArray3438[1][2] = 0;
+ this.anIntArrayArray3438[2][2] = 0;
+ this.anIntArrayArray3438[1][3] = 1493;
+ this.anIntArrayArray3438[2][3] = 2939;
+ this.anIntArrayArray3438[3][3] = 3565;
+ this.anIntArrayArray3438[3][2] = 1124;
+ this.anIntArrayArray3438[4][3] = 4031;
+ this.anIntArrayArray3438[0][1] = 0;
+ this.anIntArrayArray3438[1][1] = 0;
+ this.anIntArrayArray3438[5][3] = 4096;
+ this.anIntArrayArray3438[4][2] = 3084;
+ this.anIntArrayArray3438[2][0] = 2457;
+ this.anIntArrayArray3438[2][1] = 0;
+ this.anIntArrayArray3438[3][0] = 2781;
+ this.anIntArrayArray3438[4][0] = 3481;
+ this.anIntArrayArray3438[3][1] = 0;
+ this.anIntArrayArray3438[4][1] = 546;
+ this.anIntArrayArray3438[5][2] = 4096;
+ this.anIntArrayArray3438[5][0] = 4096;
+ this.anIntArrayArray3438[5][1] = 4096;
+ } else if(var1 == 5) {
+ this.anIntArrayArray3438 = new int[16][4];
+ this.anIntArrayArray3438[0][3] = 321;
+ this.anIntArrayArray3438[0][0] = 0;
+ this.anIntArrayArray3438[0][2] = 192;
+ this.anIntArrayArray3438[1][0] = 155;
+ this.anIntArrayArray3438[1][3] = 562;
+ this.anIntArrayArray3438[1][2] = 449;
+ this.anIntArrayArray3438[2][0] = 389;
+ this.anIntArrayArray3438[3][0] = 671;
+ this.anIntArrayArray3438[2][2] = 690;
+ this.anIntArrayArray3438[0][1] = 80;
+ this.anIntArrayArray3438[1][1] = 321;
+ this.anIntArrayArray3438[4][0] = 897;
+ this.anIntArrayArray3438[3][2] = 995;
+ this.anIntArrayArray3438[4][2] = 1397;
+ this.anIntArrayArray3438[2][1] = 578;
+ this.anIntArrayArray3438[2][3] = 803;
+ this.anIntArrayArray3438[5][0] = 1175;
+ this.anIntArrayArray3438[6][0] = 1368;
+ this.anIntArrayArray3438[5][2] = 1429;
+ this.anIntArrayArray3438[3][1] = 947;
+ this.anIntArrayArray3438[7][0] = 1507;
+ this.anIntArrayArray3438[4][1] = 1285;
+ this.anIntArrayArray3438[6][2] = 1461;
+ this.anIntArrayArray3438[8][0] = 1736;
+ this.anIntArrayArray3438[3][3] = 1140;
+ this.anIntArrayArray3438[9][0] = 2088;
+ this.anIntArrayArray3438[7][2] = 1525;
+ this.anIntArrayArray3438[4][3] = 1509;
+ this.anIntArrayArray3438[5][1] = 1525;
+ this.anIntArrayArray3438[6][1] = 1734;
+ this.anIntArrayArray3438[5][3] = 1413;
+ this.anIntArrayArray3438[8][2] = 1590;
+ this.anIntArrayArray3438[10][0] = 2355;
+ this.anIntArrayArray3438[9][2] = 2056;
+ this.anIntArrayArray3438[7][1] = 1413;
+ this.anIntArrayArray3438[11][0] = 2691;
+ this.anIntArrayArray3438[12][0] = 3031;
+ this.anIntArrayArray3438[6][3] = 1333;
+ this.anIntArrayArray3438[10][2] = 2586;
+ this.anIntArrayArray3438[11][2] = 3148;
+ this.anIntArrayArray3438[13][0] = 3522;
+ this.anIntArrayArray3438[14][0] = 3727;
+ this.anIntArrayArray3438[7][3] = 1702;
+ this.anIntArrayArray3438[8][1] = 1108;
+ this.anIntArrayArray3438[9][1] = 1766;
+ this.anIntArrayArray3438[10][1] = 2409;
+ this.anIntArrayArray3438[15][0] = 4096;
+ this.anIntArrayArray3438[12][2] = 3710;
+ this.anIntArrayArray3438[11][1] = 3116;
+ this.anIntArrayArray3438[13][2] = 3421;
+ this.anIntArrayArray3438[12][1] = 3806;
+ this.anIntArrayArray3438[13][1] = 3437;
+ this.anIntArrayArray3438[14][1] = 3116;
+ this.anIntArrayArray3438[15][1] = 2377;
+ this.anIntArrayArray3438[8][3] = 2056;
+ this.anIntArrayArray3438[9][3] = 2666;
+ this.anIntArrayArray3438[14][2] = 3148;
+ this.anIntArrayArray3438[15][2] = 2505;
+ this.anIntArrayArray3438[10][3] = 3276;
+ this.anIntArrayArray3438[11][3] = 3228;
+ this.anIntArrayArray3438[12][3] = 3196;
+ this.anIntArrayArray3438[13][3] = 3019;
+ this.anIntArrayArray3438[14][3] = 3228;
+ this.anIntArrayArray3438[15][3] = 2746;
+ } else {
+ if(var1 != 6) {
+ throw new RuntimeException("Invalid gradient preset");
+ }
+
+ this.anIntArrayArray3438 = new int[4][4];
+ this.anIntArrayArray3438[0][3] = 0;
+ this.anIntArrayArray3438[0][2] = 4096;
+ this.anIntArrayArray3438[1][3] = 0;
+ this.anIntArrayArray3438[0][1] = 0;
+ this.anIntArrayArray3438[2][3] = 0;
+ this.anIntArrayArray3438[3][3] = 0;
+ this.anIntArrayArray3438[0][0] = 2048;
+ this.anIntArrayArray3438[1][1] = 4096;
+ this.anIntArrayArray3438[1][0] = 2867;
+ this.anIntArrayArray3438[2][1] = 4096;
+ this.anIntArrayArray3438[1][2] = 4096;
+ this.anIntArrayArray3438[2][2] = 4096;
+ this.anIntArrayArray3438[3][1] = 4096;
+ this.anIntArrayArray3438[2][0] = 3276;
+ this.anIntArrayArray3438[3][2] = 0;
+ this.anIntArrayArray3438[3][0] = 4096;
+ }
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "um.B(" + var1 + ',' + false + ')');
+ }
+ }
+
+ public TextureOperation10() {
+ super(1, false);
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(true) {
+ if(var1 == 0) {
+ int var4 = var2.readUnsignedByte();
+ if(var4 == 0) {
+ this.anIntArrayArray3438 = new int[var2.readUnsignedByte()][4];
+
+ for(int var5 = 0; var5 < this.anIntArrayArray3438.length; ++var5) {
+ this.anIntArrayArray3438[var5][0] = var2.readUnsignedShort();
+ this.anIntArrayArray3438[var5][1] = var2.readUnsignedByte() << 4;
+ this.anIntArrayArray3438[var5][2] = var2.readUnsignedByte() << 4;
+ this.anIntArrayArray3438[var5][3] = var2.readUnsignedByte() << 4;
+ }
+ } else {
+ this.method345(var4);
+ }
+ }
+
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "um.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + ')');
+ }
+ }
+
+ private void method346() {
+ try {
+
+ int var5 = this.anIntArrayArray3438.length;
+ if(var5 > 0) {
+ for(int var6 = 0; var6 < 257; ++var6) {
+ int var7 = 0;
+ int var8 = var6 << 4;
+
+ for(int var9 = 0; var5 > var9 && var8 >= this.anIntArrayArray3438[var9][0]; ++var9) {
+ ++var7;
+ }
+
+ int var2;
+ int var3;
+ int var4;
+ int[] var14;
+ if(var5 > var7) {
+ var14 = this.anIntArrayArray3438[var7];
+ if(var7 > 0) {
+ int[] var10 = this.anIntArrayArray3438[-1 + var7];
+ int var11 = (var8 - var10[0] << 12) / (var14[0] + -var10[0]);
+ int var12 = 4096 + -var11;
+ var4 = var10[3] * var12 + var14[3] * var11 >> 12;
+ var2 = var12 * var10[1] + var11 * var14[1] >> 12;
+ var3 = var12 * var10[2] + var11 * var14[2] >> 12;
+ } else {
+ var2 = var14[1];
+ var4 = var14[3];
+ var3 = var14[2];
+ }
+ } else {
+ var14 = this.anIntArrayArray3438[var5 + -1];
+ var4 = var14[3];
+ var3 = var14[2];
+ var2 = var14[1];
+ }
+
+ var2 >>= 4;
+ var3 >>= 4;
+ if(var2 < 0) {
+ var2 = 0;
+ } else if(var2 > 255) {
+ var2 = 255;
+ }
+
+ if(0 > var3) {
+ var3 = 0;
+ } else if(var3 > 255) {
+ var3 = 255;
+ }
+
+ var4 >>= 4;
+ if(var4 >= 0) {
+ if(var4 > 255) {
+ var4 = 255;
+ }
+ } else {
+ var4 = 0;
+ }
+
+ this.anIntArray3443[var6] = TextureOperation3.bitwiseOr(var4, TextureOperation3.bitwiseOr(var3 << 8, var2 << 16));
+ }
+ }
+
+ } catch (RuntimeException var13) {
+ throw ClientErrorException.clientError(var13, "um.E(" + 114 + ')');
+ }
+ }
+
+ static void method347() {
+ try {
+ PacketParser.inTutorialIsland = 0;
+
+ int var1 = Class131.x1716 + (Class102.player.xAxis >> 7);
+ int var2 = (Class102.player.yAxis >> 7) - -Texture.y1152;
+ if(var1 >= 3053 && var1 <= 3156 && var2 >= 3056 && var2 <= 3136) {
+ PacketParser.inTutorialIsland = 1;
+ }
+
+ if(var1 >= 3072 && var1 <= 3118 && var2 >= 9492 && var2 <= 9535) {
+ PacketParser.inTutorialIsland = 1;
+ }
+
+ if(PacketParser.inTutorialIsland == 1 && var1 >= 3139 && 3062 >= var2) {
+ PacketParser.inTutorialIsland = 0;
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "um.O(" + true + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte)90, var2);
+
+ if(this.aClass97_2376.aBoolean1379) {
+ int[] var5 = this.method152(0, var2);
+ int[] var7 = var3[1];
+ int[] var6 = var3[0];
+ int[] var8 = var3[2];
+
+ for(int var9 = 0; Class113.anInt1559 > var9; ++var9) {
+ int var4 = var5[var9] >> 4;
+ if(var4 < 0) {
+ var4 = 0;
+ }
+
+ if(var4 > 256) {
+ var4 = 256;
+ }
+
+ var4 = this.anIntArray3443[var4];
+ var6[var9] = Unsorted.bitwiseAnd(var4, 16711680) >> 12;
+ var7[var9] = Unsorted.bitwiseAnd(4080, var4 >> 4);
+ var8[var9] = Unsorted.bitwiseAnd(255, var4) << 4;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "um.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static boolean method349(int var0, int var1, int var2) {
+ for(int var3 = 0; var3 < Class72.anInt1672; ++var3) {
+ Class113 var4 = Class145.aClass113Array1895[var3];
+ int var5;
+ int var6;
+ int var7;
+ int var8;
+ int var9;
+ if(var4.anInt1564 == 1) {
+ var5 = var4.anInt1562 - var0;
+ if(var5 > 0) {
+ var6 = var4.anInt1560 + (var4.anInt1555 * var5 >> 8);
+ var7 = var4.anInt1550 + (var4.anInt1551 * var5 >> 8);
+ var8 = var4.anInt1544 + (var4.anInt1561 * var5 >> 8);
+ var9 = var4.anInt1548 + (var4.anInt1565 * var5 >> 8);
+ if(var2 >= var6 && var2 <= var7 && var1 >= var8 && var1 <= var9) {
+ return true;
+ }
+ }
+ } else if(var4.anInt1564 == 2) {
+ var5 = var0 - var4.anInt1562;
+ if(var5 > 0) {
+ var6 = var4.anInt1560 + (var4.anInt1555 * var5 >> 8);
+ var7 = var4.anInt1550 + (var4.anInt1551 * var5 >> 8);
+ var8 = var4.anInt1544 + (var4.anInt1561 * var5 >> 8);
+ var9 = var4.anInt1548 + (var4.anInt1565 * var5 >> 8);
+ if(var2 >= var6 && var2 <= var7 && var1 >= var8 && var1 <= var9) {
+ return true;
+ }
+ }
+ } else if(var4.anInt1564 == 3) {
+ var5 = var4.anInt1560 - var2;
+ if(var5 > 0) {
+ var6 = var4.anInt1562 + (var4.anInt1549 * var5 >> 8);
+ var7 = var4.anInt1545 + (var4.anInt1557 * var5 >> 8);
+ var8 = var4.anInt1544 + (var4.anInt1561 * var5 >> 8);
+ var9 = var4.anInt1548 + (var4.anInt1565 * var5 >> 8);
+ if(var0 >= var6 && var0 <= var7 && var1 >= var8 && var1 <= var9) {
+ return true;
+ }
+ }
+ } else if(var4.anInt1564 == 4) {
+ var5 = var2 - var4.anInt1560;
+ if(var5 > 0) {
+ var6 = var4.anInt1562 + (var4.anInt1549 * var5 >> 8);
+ var7 = var4.anInt1545 + (var4.anInt1557 * var5 >> 8);
+ var8 = var4.anInt1544 + (var4.anInt1561 * var5 >> 8);
+ var9 = var4.anInt1548 + (var4.anInt1565 * var5 >> 8);
+ if(var0 >= var6 && var0 <= var7 && var1 >= var8 && var1 <= var9) {
+ return true;
+ }
+ }
+ } else if(var4.anInt1564 == 5) {
+ var5 = var1 - var4.anInt1544;
+ if(var5 > 0) {
+ var6 = var4.anInt1562 + (var4.anInt1549 * var5 >> 8);
+ var7 = var4.anInt1545 + (var4.anInt1557 * var5 >> 8);
+ var8 = var4.anInt1560 + (var4.anInt1555 * var5 >> 8);
+ var9 = var4.anInt1550 + (var4.anInt1551 * var5 >> 8);
+ if(var0 >= var6 && var0 <= var7 && var2 >= var8 && var2 <= var9) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation11.java b/Client/src/main/java/org/runite/client/TextureOperation11.java
new file mode 100644
index 000000000..d99050549
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation11.java
@@ -0,0 +1,80 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+final class TextureOperation11 extends TextureOperation {
+
+ static int anInt3244 = 0;
+ private int anInt3245 = 4096;
+ private int anInt3250 = 4096;
+ private int anInt3252 = 4096;
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3252 = var2.readUnsignedShort();
+ } else if (var1 == 1) {
+ this.anInt3245 = var2.readUnsignedShort();
+ } else if (2 == var1) {
+ this.anInt3250 = var2.readUnsignedShort();
+ }
+
+ if(!true) {
+ method266(12);
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "mg.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public static void method266(int var0) {//TODO: Misplaced Check Method
+ try {
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "mg.U(" + var0 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ anInt3244 = -40;
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)-115, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte)-74);
+ int[] var5 = Objects.requireNonNull(var4)[0];
+ int[] var6 = var4[1];
+ int[] var7 = var4[2];
+ int[] var9 = var3[1];
+ int[] var8 = var3[0];
+ int[] var10 = var3[2];
+
+ for(int var11 = 0; Class113.anInt1559 > var11; ++var11) {
+ int var12 = var5[var11];
+ int var14 = var6[var11];
+ int var13 = var7[var11];
+ if(var13 == var12 && var13 == var14) {
+ var8[var11] = this.anInt3252 * var12 >> 12;
+ var9[var11] = var13 * this.anInt3245 >> 12;
+ var10[var11] = var14 * this.anInt3250 >> 12;
+ } else {
+ var8[var11] = this.anInt3252;
+ var9[var11] = this.anInt3245;
+ var10[var11] = this.anInt3250;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "mg.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation11() {
+ super(1, false);
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation12.java b/Client/src/main/java/org/runite/client/TextureOperation12.java
new file mode 100644
index 000000000..6e7cc8e1b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation12.java
@@ -0,0 +1,168 @@
+package org.runite.client;
+
+
+import org.rs09.client.config.GameConfig;
+
+public final class TextureOperation12 extends TextureOperation {
+
+ public static BufferedDataStream outgoingBuffer = new BufferedDataStream();
+ private int anInt3036 = 0;
+ private int anInt3037 = 1;
+ private int anInt3038 = 0;
+ static RSString aClass2323;
+ static String aString2324;
+ static RSString aClass2325;
+
+
+ static void method167(int var0) {
+ try {
+ if(TextureOperation33.aClass148_3049 != null) {
+ KeyboardListener var1 = TextureOperation33.aClass148_3049;
+ synchronized(var1) {
+ TextureOperation33.aClass148_3049 = null;
+ }
+ }
+
+ if(var0 != 0) {
+ method171(119, -44, -76, -104, 29, -65, 34, 18, 104);
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ag.B(" + var0 + ')');
+ }
+ }
+
+ public TextureOperation12() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ int var4;
+ if(this.aClass114_2382.aBoolean1580) {
+ var4 = Class163_Sub3.anIntArray2999[var1];
+ int var5 = var4 - 2048 >> 1;
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var8 = Class102.anIntArray2125[var6];
+ int var9 = -2048 + var8 >> 1;
+ int var7;
+ if(this.anInt3038 == 0) {
+ var7 = (var8 + -var4) * this.anInt3037;
+ } else {
+ int var10 = var9 * var9 - -(var5 * var5) >> 12;
+ var7 = (int)(Math.sqrt((float)var10 / 4096.0F) * 4096.0D);
+ var7 = (int)(3.141592653589793D * (double)(var7 * this.anInt3037));
+ }
+
+ var7 -= var7 & -4096;
+ if(this.anInt3036 == 0) {
+ var7 = TextureOperation23.anIntArray3212[(var7 & 4085) >> 4] + 4096 >> 1;
+ } else if(this.anInt3036 == 2) {
+ var7 -= 2048;
+ if(var7 < 0) {
+ var7 = -var7;
+ }
+
+ var7 = -var7 + 2048 << 1;
+ }
+
+ var3[var6] = var7;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "ag.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method229() {
+ DataBuffer buffer = outgoingBuffer;
+ buffer.writeString(aClass2323);
+ for (char c : aString2324.toCharArray()) {
+ if (c == '-') {
+ c = ':';
+ }
+ buffer.writeByte(c);
+ }
+ buffer.writeByte(0);
+ buffer.writeString(aClass2325);
+ }
+
+ static void method169() {
+ try {
+ Class32.method995();
+
+ for(int var1 = 0; 4 > var1; ++var1) {
+ AtmosphereParser.aClass91Array1182[var1].method1496();
+ }
+
+ System.gc();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ag.O(" + 22230 + ')');
+ }
+ }
+
+ static Class> method170(String var1) throws ClassNotFoundException {
+ try {
+
+ return var1.equals("B")?Byte.TYPE:(!var1.equals("I")?(var1.equals("S")?Short.TYPE:(!var1.equals("J")?(var1.equals("Z")?Boolean.TYPE:(var1.equals("F")?Float.TYPE:(var1.equals("D")?Double.TYPE:(var1.equals("C")?Character.TYPE:Class.forName(GameConfig.PACKAGE_NAME + "." + var1))))):Long.TYPE)):Integer.TYPE);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ag.C(" + 6092 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ Class8.method844((byte)-9);
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ag.P(" + ')');
+ }
+ }
+
+ static void method171(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) {
+ try {
+ if(var0 != -101) {
+ method167(-46);
+ }
+
+ if(Unsorted.loadInterface(var1)) {
+ Unsorted.method1095(var2, var8, var4, GameObject.interfaces1834[var1], var3, -1, var7, var6, (byte)119, var5);
+ } else if (var5 == -1) {
+ for (int var9 = 0; var9 < 100; ++var9) {
+ Unsorted.aBooleanArray3674[var9] = true;
+ }
+ } else {
+ Unsorted.aBooleanArray3674[var5] = true;
+ }
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "ag.E(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+
+ if(var1 == 0) {
+ this.anInt3038 = var2.readUnsignedByte();
+ } else if (1 == var1) {
+ this.anInt3036 = var2.readUnsignedByte();
+ } else if (var1 == 3) {
+ this.anInt3037 = var2.readUnsignedByte();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ag.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+
+ static void method445() {
+ aClass2323 = RSString.parse(System.getProperty("user.name"));
+ aString2324 = Class39.method132893();
+ aClass2325 = Signlink.osName.startsWith("win") ? Class44.method3435() : Class44.method3434();
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation13.java b/Client/src/main/java/org/runite/client/TextureOperation13.java
new file mode 100644
index 000000000..ee98aad0a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation13.java
@@ -0,0 +1,249 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+final class TextureOperation13 extends TextureOperation {
+
+ static int anInt3362 = -1;
+ static int anInt3363;
+ static LinkedList aLinkedList_3364 = new LinkedList();
+ static long aLong3366;
+ static int[] anIntArray3367 = new int[64];
+
+
+ static void method312(int var0, int var1, int var2, Player playerUsername, int var4) {
+ try {
+ if(Class102.player != playerUsername) {
+ if(Unsorted.menuOptionCount < 400) {
+ RSString var5;
+ if(playerUsername.anInt3974 == 0) {
+ boolean var6 = true;
+ if(Class102.player.anInt3970 != -1 && -1 != playerUsername.anInt3970) {
+ int var7 = Math.max(playerUsername.COMBAT_LEVEL, Class102.player.COMBAT_LEVEL);
+ int var8 = Math.min(playerUsername.anInt3970, Class102.player.anInt3970);
+ int var9 = 5 - -(var7 * 10 / 100) + var8;
+ int var10 = -playerUsername.COMBAT_LEVEL + Class102.player.COMBAT_LEVEL;
+ if(0 > var10) {
+ var10 = -var10;
+ }
+
+ if(var9 < var10) {
+ var6 = false;
+ }
+ }
+
+ RSString levelEquals = Class158.paramGameTypeID != 1?TextCore.HasLevel:TextCore.HasRating;
+ if(playerUsername.COMBAT_LEVEL < playerUsername.combatLevel) {
+ var5 = RSString.stringCombiner(new RSString[]{playerUsername.getName(), var6 ? Player.combatLevelColor(playerUsername.COMBAT_LEVEL, (byte)-73, Class102.player.COMBAT_LEVEL) : ColorCore.ContextColor , TextCore.LEFT_PARENTHESES, levelEquals, RSString.stringAnimator(playerUsername.COMBAT_LEVEL), TextCore.aString_673, RSString.stringAnimator(playerUsername.combatLevel + -playerUsername.COMBAT_LEVEL), TextCore.RIGHT_PARENTHESES});
+ } else {
+ //here
+ var5 = RSString.stringCombiner(new RSString[]{playerUsername.getName(), var6 ? Player.combatLevelColor(playerUsername.COMBAT_LEVEL, (byte)-128, Class102.player.COMBAT_LEVEL) : Player.getCombatLevelDifferenceColor(playerUsername.COMBAT_LEVEL, Class102.player.COMBAT_LEVEL), TextCore.LEFT_PARENTHESES, levelEquals, RSString.stringAnimator(playerUsername.COMBAT_LEVEL), TextCore.RIGHT_PARENTHESES});
+ }
+ } else {
+ var5 = RSString.stringCombiner(new RSString[]{playerUsername.getName(), TextCore.LEFT_PARENTHESES, TextCore.HasSkill, RSString.stringAnimator(playerUsername.anInt3974), TextCore.RIGHT_PARENTHESES});
+ }
+
+ int var12;
+ if(Class164_Sub1.anInt3012 == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class99.anInt1403, var0, (byte)-80, RSString.stringCombiner(new RSString[]{RenderAnimationDefinition.aString_378, TextCore.aString_892, var5}), var4, (short)1, TextCore.HasUse, var2);
+ } else if(!GameObject.aBoolean1837) {
+ for(var12 = 7; var12 >= 0; --var12) {
+ if(null != Class91.aStringArray1299[var12]) {
+ short var14 = 0;
+ if(Class158.paramGameTypeID == 0 && Class91.aStringArray1299[var12].equalsStringIgnoreCase(TextCore.HasAttack)) {
+ //If other player level greater than my level, then right click to attack.
+ if(playerUsername.COMBAT_LEVEL > Class102.player.COMBAT_LEVEL && !GameConfig.FORCE_LEFT_CLICK_ATTACK) {
+ var14 = 2000;//Var for right click higher level players
+ }
+ if(Class102.player.teamId != 0 && playerUsername.teamId != 0) {
+ if(playerUsername.teamId == Class102.player.teamId) {
+ var14 = 2000;
+ } else {
+ var14 = 0;
+ }
+ }
+ } else if(Class1.aBooleanArray54[var12]) {
+ var14 = 2000;
+ }
+
+ short var15 = Class7.aShortArray2167[var12];
+ var15 += var14;
+ Class3_Sub24_Sub4.pushRightClickMenuAction(TextureOperation35.anIntArray3328[var12], var0, (byte)-73, RSString.stringCombiner(new RSString[]{ColorCore.ContextColor , var5}), var4, var15, Class91.aStringArray1299[var12], var2);
+ }
+ }
+ } else if((8 & Class164.anInt2051) != 0) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Unsorted.anInt1887, var0, (byte)-58, RSString.stringCombiner(new RSString[]{TextCore.aString_676, TextCore.aString_892, var5}), var4, (short)15, Class3_Sub28_Sub9.aString_3621, var2);
+ }
+
+ if(var1 <= 0) {
+ aLong3366 = -79L;
+ }
+
+ for(var12 = 0; var12 < Unsorted.menuOptionCount; ++var12) {
+ if(TextureOperation27.aShortArray3095[var12] == 60) {
+ Class163_Sub2_Sub1.aStringArray4016[var12] = RSString.stringCombiner(new RSString[]{ColorCore.ContextColor , var5});
+ break;
+ }
+ }
+
+ }
+ }
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "rj.C(" + var0 + ',' + var1 + ',' + var2 + ',' + (playerUsername != null?"{...}":"null") + ',' + var4 + ')');
+ }
+ }
+
+ static void method313(byte var0) {
+ try {
+ if(var0 <= 51) {
+ method312(77, -52, -42, null, 120);
+ }
+
+ Class166.method2257();
+ Class3_Sub8.method128();
+ Class163_Sub2_Sub1.method2220();
+ Class3_Sub10.method139(69);
+ Class3_Sub26.method512();
+ WaterfallShader.method1626((byte)-128);
+ TextureOperation33.method182();
+ Class145.method2077();
+ Class25.method959();
+ method716();
+ Class3_Sub15.method370();
+ TextureOperation3.method304();
+ Class40.method1045();
+ TextureOperation33.method183();
+ LinkableRSString.method727();
+ Class3_Sub21.method397((byte)-41);
+ if(TextureOperation20.paramModeWhat != 0) {
+ for(int var1 = 0; var1 < Class3_Sub6.softReferenceTestArray.length; ++var1) {
+ Class3_Sub6.softReferenceTestArray[var1] = null;
+ }
+
+ Class56.anInt893 = 0;
+ }
+
+ Class108.method1659();
+ Class3_Sub10.method142();
+ Unsorted.aReferenceCache_1135.clear();
+ if(!HDToolKit.highDetail) {
+ ((Class102)Class51.anInterface2_838).method1618();
+ }
+
+ Class56.aClass47_885.clear();
+ CacheIndex.skeletonsIndex.method2137();
+ CacheIndex.skinsIndex.method2137();
+ CacheIndex.interfacesIndex.method2137();
+ CacheIndex.soundFXIndex.method2137();
+ CacheIndex.landscapesIndex.method2137();
+ CacheIndex.musicIndex.method2137();
+ CacheIndex.modelsIndex.method2137();
+ CacheIndex.spritesIndex.method2137();
+ CacheIndex.huffmanEncodingIndex.method2137();
+ CacheIndex.music2Index.method2137();
+ CacheIndex.interfaceScriptsIndex.method2137();
+ TextureOperation1.aReferenceCache_3130.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "rj.E(" + var0 + ')');
+ }
+ }
+
+ static void method716() {
+ try {
+ Class136.aReferenceCache_1772.clear();
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ud.A(" + 14073 + ')');
+ }
+ }
+
+ private int method314(int var1, int var2, int var3) {
+ try {
+ if(var2 != 7001) {
+ this.method314(-83, 92, 48);
+ }
+
+ int var4 = var3 - -(57 * var1);
+ var4 ^= var4 << 1;
+ return 4096 + -((var4 * (var4 * var4 * 15731 - -789221) - -1376312589 & Integer.MAX_VALUE) / 262144);
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "rj.O(" + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ public TextureOperation13() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = Class163_Sub3.anIntArray2999[var1];
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ var3[var6] = this.method314(var5, 7001, Class102.anIntArray2125[var6]) % 4096;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "rj.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void parseObjectMapping(Class91[] var0, int var1, byte[] var2, int var3, int var4, int var5, int var6, boolean var7, int var8, int var9) {
+ try {
+ int var12 = -1;
+ DataBuffer var11 = new DataBuffer(var2);
+
+ while(true) {
+ int var13 = var11.method773();
+ if(var13 == 0) {
+ return;
+ }
+
+ var12 += var13;
+ int var14 = 0;
+
+ while(true) {
+ int var15 = var11.getSmart();
+ if(var15 == 0) {
+ break;
+ }
+
+ var14 += -1 + var15;
+ int var16 = 63 & var14;
+ int var17 = var14 >> 6 & 63;
+ int var18 = var14 >> 12;
+ int var19 = var11.readUnsignedByte();
+ int var20 = var19 >> 2;
+ int var21 = 3 & var19;
+ if(var18 == var3 && var8 <= var17 && var17 < 8 + var8 && var9 <= var16 && 8 + var9 > var16) {
+ ObjectDefinition var22 = ObjectDefinition.getObjectDefinition(var12);
+ int var23 = Class3_Sub7.method121(var16 & 7, var4, var21, var22.SizeY, var22.SizeX, 7 & var17) + var5;
+ int var24 = GameObject.method1863(var22.SizeX, var4, var22.SizeY, 7 & var17, var21, 7 & var16) + var6;
+ if(var23 > 0 && var24 > 0 && var23 < 103 && var24 < 103) {
+ Class91 var25 = null;
+ if(!var7) {
+ int var26 = var1;
+ if(2 == (Unsorted.sceneryTypeMaskGrid[1][var23][var24] & 2)) {
+ var26 = var1 - 1;
+ }
+
+ if(var26 >= 0) {
+ var25 = var0[var26];
+ }
+ }
+
+ Scenery.method1683(var1, !var7, var1, var7, var25, var12, var20, var23, var24, 3 & var21 + var4);
+ }
+ }
+ }
+ }
+ } catch (RuntimeException var27) {
+ throw ClientErrorException.clientError(var27, "rj.F(" + (var0 != null?"{...}":"null") + ',' + var1 + ',' + (var2 != null?"{...}":"null") + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ',' + var9 + ',' + (byte) -54 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation14.java b/Client/src/main/java/org/runite/client/TextureOperation14.java
new file mode 100644
index 000000000..2a575618d
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation14.java
@@ -0,0 +1,106 @@
+package org.runite.client;
+final class TextureOperation14 extends TextureOperation {
+
+ static int[] anIntArray3383 = new int[5];
+ private int anInt3385 = 585;
+ static boolean aBoolean3387 = true;
+ static volatile int anInt3389 = 0;
+
+
+ static int method319(int var0, int var1, int var2) {
+ try {
+ if(var1 >= -99) {
+ aBoolean3387 = true;
+ }
+
+ int var3 = var0 >>> 31;
+ return (var0 + var3) / var2 - var3;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "sa.E(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation14() {
+ super(0, true);
+ }
+
+ static void method320(int var0, int var1, int var2, byte var3, int var4) {
+ try {
+ if(var2 >= var4) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var1], var4, -83, var2, var0);
+ } else {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var1], var2, -48, var4, var0);
+ }
+
+ if(var3 > -55) {
+ method320(99, 100, 74, (byte)13, 92);
+ }
+
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "sa.C(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = Class163_Sub3.anIntArray2999[var1];
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var7 = Class102.anIntArray2125[var6];
+ int var8;
+ if(var7 > this.anInt3385 && 4096 - this.anInt3385 > var7 && var5 > 2048 + -this.anInt3385 && this.anInt3385 + 2048 > var5) {
+ var8 = 2048 - var7;
+ var8 = var8 < 0?-var8:var8;
+ var8 <<= 12;
+ var8 /= -this.anInt3385 + 2048;
+ var3[var6] = -var8 + 4096;
+ } else if(-this.anInt3385 + 2048 < var7 && var7 < this.anInt3385 + 2048) {
+ var8 = var5 + -2048;
+ var8 = var8 >= 0 ?var8:-var8;
+ var8 -= this.anInt3385;
+ var8 <<= 12;
+ var3[var6] = var8 / (-this.anInt3385 + 2048);
+ } else if(this.anInt3385 <= var5 && var5 <= 4096 - this.anInt3385) {
+ if(this.anInt3385 <= var7 && var7 <= 4096 - this.anInt3385) {
+ var3[var6] = 0;
+ } else {
+ var8 = -var5 + 2048;
+ var8 = var8 < 0 ?-var8:var8;
+ var8 <<= 12;
+ var8 /= 2048 - this.anInt3385;
+ var3[var6] = -var8 + 4096;
+ }
+ } else {
+ var8 = var7 + -2048;
+ var8 = 0 > var8?-var8:var8;
+ var8 -= this.anInt3385;
+ var8 <<= 12;
+ var3[var6] = var8 / (-this.anInt3385 + 2048);
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "sa.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ anInt3389 = 99;
+ }
+
+ if(var1 == 0) {
+ this.anInt3385 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "sa.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation15.java b/Client/src/main/java/org/runite/client/TextureOperation15.java
new file mode 100644
index 000000000..881f6c6e9
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation15.java
@@ -0,0 +1,192 @@
+package org.runite.client;
+import java.util.Random;
+
+final class TextureOperation15 extends TextureOperation {
+
+ private int anInt3191 = 2;
+ private int anInt3193 = 2048;
+ private int anInt3194 = 1;
+ private byte[] aByteArray3195 = new byte[512];
+ private int anInt3197 = 0;
+ static int anInt3198 = 0;
+ private short[] aShortArray3200 = new short[512];
+ private int anInt3203 = 5;
+ private int anInt3204 = 5;
+
+
+ private void method242() {
+ try {
+ Random var2 = new Random(this.anInt3197);
+ this.aShortArray3200 = new short[512];
+ if(0 < this.anInt3193) {
+ for(int var3 = 0; 512 > var3; ++var3) {
+ this.aShortArray3200[var3] = (short) TextureOperation.method1603((byte)23, this.anInt3193, var2);
+ }
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "hm.C(" + (byte) 37 + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ this.aByteArray3195 = Class49.method1123(this.anInt3197);
+ this.method242();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "hm.P(" + ')');
+ }
+ }
+
+ static int compareEnteredLanguageArgument(RSString var0) {
+ try {
+
+ for(int var2 = 0; TextureOperation4.aStringArray3238.length > var2; ++var2) {
+ if(TextureOperation4.aStringArray3238[var2].equalsStringIgnoreCase(var0)) {
+ return var2;
+ }
+ }
+
+ return -1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "hm.F(" + (var0 != null?"{...}":"null") + ',' + (byte) 13 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = this.anInt3204 * Class163_Sub3.anIntArray2999[var1] + 2048;
+ int var6 = var5 >> 12;
+ int var7 = var6 - -1;
+
+ for(int var15 = 0; var15 < Class113.anInt1559; ++var15) {
+ TextureOperation36.anInt3422 = Integer.MAX_VALUE;
+ KeyboardListener.anInt1914 = Integer.MAX_VALUE;
+ Unsorted.anInt1042 = Integer.MAX_VALUE;
+ Class3_Sub28_Sub5.anInt3589 = Integer.MAX_VALUE;
+ int var16 = this.anInt3203 * Class102.anIntArray2125[var15] + 2048;
+ int var17 = var16 >> 12;
+ int var18 = 1 + var17;
+
+ int var19;
+ for(int var9 = var6 - 1; var7 >= var9; ++var9) {
+ int var13 = 255 & this.aByteArray3195[(var9 >= this.anInt3204 ?-this.anInt3204 + var9:var9) & 0xFF];
+
+ for(int var8 = var17 + -1; var18 >= var8; ++var8) {
+ int var14 = (255 & this.aByteArray3195[(var8 >= this.anInt3203 ?-this.anInt3203 + var8:var8) + var13 & 0xFF]) * 2;
+ int var10 = -(var8 << 12) - (this.aShortArray3200[var14++] - var16);
+ int var11 = var5 - (this.aShortArray3200[var14] + (var9 << 12));
+ var19 = this.anInt3194;
+ int var12;
+ if(var19 == 1) {
+ var12 = var11 * var11 + var10 * var10 >> 12;
+ } else if (3 == var19) {
+ var10 = var10 < 0 ? -var10 : var10;
+ var11 = var11 >= 0 ? var11 : -var11;
+ var12 = var11 >= var10 ? var11 : var10;
+ } else if (4 == var19) {
+ var10 = (int) (Math.sqrt((float) (0 > var10 ? -var10 : var10) / 4096.0F) * 4096.0D);
+ var11 = (int) (Math.sqrt((float) (var11 >= 0 ? var11 : -var11) / 4096.0F) * 4096.0D);
+ var12 = var11 + var10;
+ var12 = var12 * var12 >> 12;
+ } else if (var19 == 5) {
+ var10 *= var10;
+ var11 *= var11;
+ var12 = (int) (Math.sqrt(Math.sqrt((float) (var11 + var10) / 1.6777216E7F)) * 4096.0D);
+ } else if (2 == var19) {
+ var12 = (var10 >= 0 ? var10 : -var10) - -(var11 < 0 ? -var11 : var11);
+ } else {
+ var12 = (int) (4096.0D * Math.sqrt((float) (var11 * var11 + var10 * var10) / 1.6777216E7F));
+ }
+
+ if(var12 >= Class3_Sub28_Sub5.anInt3589) {
+ if(Unsorted.anInt1042 > var12) {
+ TextureOperation36.anInt3422 = KeyboardListener.anInt1914;
+ KeyboardListener.anInt1914 = Unsorted.anInt1042;
+ Unsorted.anInt1042 = var12;
+ } else if(KeyboardListener.anInt1914 <= var12) {
+ if(var12 < TextureOperation36.anInt3422) {
+ TextureOperation36.anInt3422 = var12;
+ }
+ } else {
+ TextureOperation36.anInt3422 = KeyboardListener.anInt1914;
+ KeyboardListener.anInt1914 = var12;
+ }
+ } else {
+ TextureOperation36.anInt3422 = KeyboardListener.anInt1914;
+ KeyboardListener.anInt1914 = Unsorted.anInt1042;
+ Unsorted.anInt1042 = Class3_Sub28_Sub5.anInt3589;
+ Class3_Sub28_Sub5.anInt3589 = var12;
+ }
+ }
+ }
+
+ var19 = this.anInt3191;
+ if(var19 == 0) {
+ var3[var15] = Class3_Sub28_Sub5.anInt3589;
+ } else if(var19 == 1) {
+ var3[var15] = Unsorted.anInt1042;
+ } else if (var19 == 3) {
+ var3[var15] = KeyboardListener.anInt1914;
+ } else if (var19 == 4) {
+ var3[var15] = TextureOperation36.anInt3422;
+ } else if (var19 == 2) {
+ var3[var15] = Unsorted.anInt1042 + -Class3_Sub28_Sub5.anInt3589;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var20) {
+ throw ClientErrorException.clientError(var20, "hm.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method244(int var1, int var2, int var3, int var4) {
+ try {
+ int var5;
+ if(var3 >= var1) {
+ for(var5 = var1; var5 < var3; ++var5) {
+ Class38.anIntArrayArray663[var5][var2] = var4;
+ }
+ } else {
+ for(var5 = var3; var1 > var5; ++var5) {
+ Class38.anIntArrayArray663[var5][var2] = var4;
+ }
+ }
+
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "hm.E(" + 2 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3203 = this.anInt3204 = var2.readUnsignedByte();
+ } else if(var1 == 1) {
+ this.anInt3197 = var2.readUnsignedByte();
+ } else if(2 == var1) {
+ this.anInt3193 = var2.readUnsignedShort();
+ } else if (var1 == 3) {
+ this.anInt3191 = var2.readUnsignedByte();
+ } else if (var1 == 4) {
+ this.anInt3194 = var2.readUnsignedByte();
+ } else if (var1 == 5) {
+ this.anInt3203 = var2.readUnsignedByte();
+ } else if (var1 == 6) {
+ this.anInt3204 = var2.readUnsignedByte();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "hm.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public TextureOperation15() {
+ super(0, true);
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation16.java b/Client/src/main/java/org/runite/client/TextureOperation16.java
new file mode 100644
index 000000000..b1ccac665
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation16.java
@@ -0,0 +1,89 @@
+package org.runite.client;
+
+final class TextureOperation16 extends TextureOperation {
+
+ private int anInt3108 = 1;
+ private int anInt3109 = 204;
+ static short[] aShortArray3110 = new short[256];
+ static int anInt3111 = 0;
+ static Class36 aClass36_3112;
+ private int anInt3113 = 1;
+ static int anInt3114 = 0;
+ static int[][] anIntArrayArray3115;
+
+ public TextureOperation16() {
+ super(0, true);
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(true) {
+ if(var1 == 0) {
+ this.anInt3108 = var2.readUnsignedByte();
+ } else if (var1 == 1) {
+ this.anInt3113 = var2.readUnsignedByte();
+ } else if (var1 == 2) {
+ this.anInt3109 = var2.readUnsignedShort();
+ }
+
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "f.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ for(int var5 = 0; Class113.anInt1559 > var5; ++var5) {
+ int var6 = Class102.anIntArray2125[var5];
+ int var7 = Class163_Sub3.anIntArray2999[var1];
+ int var8 = this.anInt3108 * var6 >> 12;
+ int var9 = var7 * this.anInt3113 >> 12;
+ int var10 = this.anInt3108 * (var6 % (4096 / this.anInt3108));
+ int var11 = var7 % (4096 / this.anInt3113) * this.anInt3113;
+ if(var11 < this.anInt3109) {
+ for(var8 -= var9; var8 < 0; var8 += 4) {
+ }
+
+ while(3 < var8) {
+ var8 -= 4;
+ }
+
+ if(1 != var8) {
+ var4[var5] = 0;
+ continue;
+ }
+
+ if(var10 < this.anInt3109) {
+ var4[var5] = 0;
+ continue;
+ }
+ }
+
+ if(var10 < this.anInt3109) {
+ for(var8 -= var9; 0 > var8; var8 += 4) {
+ }
+
+ while(var8 > 3) {
+ var8 -= 4;
+ }
+
+ if(var8 > 0) {
+ var4[var5] = 0;
+ continue;
+ }
+ }
+
+ var4[var5] = 4096;
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "f.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation17.java b/Client/src/main/java/org/runite/client/TextureOperation17.java
new file mode 100644
index 000000000..a8d7cbde1
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation17.java
@@ -0,0 +1,185 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+final class TextureOperation17 extends TextureOperation {
+
+ private int anInt3174;
+ private int anInt3175 = 0;
+ private int anInt3176 = 0;
+ static LinkedList aLinkedList_3177 = new LinkedList();
+ private int anInt3178 = 0;
+ static int height3179;
+ private int anInt3180;
+ static int[] anIntArray3181;
+ private int anInt3182;
+ static boolean stereoSound = true;
+ static int[] anIntArray3185 = new int[25];
+ private int anInt3186;
+ private int anInt3188;
+ private int anInt3189;
+
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3175 = var2.readSignedShort();
+ } else if(var1 == 1) {
+ this.anInt3178 = (var2.readSignedByte() << 12) / 100;
+ } else if (var1 == 2) {
+ this.anInt3176 = (var2.readSignedByte() << 12) / 100;
+ }
+
+ if(!true) {
+ this.method240(-114, 127, 95);
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "hk.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ private void method239(int var1, int var2, int var4) {
+ try {
+ int var5 = var1 <= 2048?var1 * (4096 + var2) >> 12:-(var1 * var2 >> 12) + var1 + var2;
+ if(var5 > 0) {
+ var4 *= 6;
+ int var7 = -var5 + var1 + var1;
+ int var9 = var4 >> 12;
+ int var8 = (-var7 + var5 << 12) / var5;
+ int var10 = var4 - (var9 << 12);
+ int var11 = var5 * var8 >> 12;
+ var11 = var11 * var10 >> 12;
+ int var12 = var11 + var7;
+ int var13 = -var11 + var5;
+ if(0 == var9) {
+ this.anInt3182 = var7;
+ this.anInt3186 = var5;
+ this.anInt3174 = var12;
+ } else if(var9 == 1) {
+ this.anInt3182 = var7;
+ this.anInt3174 = var5;
+ this.anInt3186 = var13;
+ } else if (var9 == 2) {
+ this.anInt3186 = var7;
+ this.anInt3174 = var5;
+ this.anInt3182 = var12;
+ } else if (var9 == 3) {
+ this.anInt3174 = var13;
+ this.anInt3182 = var5;
+ this.anInt3186 = var7;
+ } else if (var9 == 4) {
+ this.anInt3182 = var5;
+ this.anInt3186 = var12;
+ this.anInt3174 = var7;
+ } else if (var9 == 5) {
+ this.anInt3174 = var7;
+ this.anInt3186 = var5;
+ this.anInt3182 = var13;
+ }
+ } else {
+ this.anInt3186 = this.anInt3174 = this.anInt3182 = var1;
+ }
+
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "hk.C(" + var1 + ',' + var2 + ',' + 107 + ',' + var4 + ')');
+ }
+ }
+
+ public TextureOperation17() {
+ super(1, false);
+ }
+
+ private void method240(int var2, int var3, int var4) {
+ try {
+ int var5 = var2 > var3?var2:var3;
+ var5 = var5 >= var4 ?var5:var4;
+ int var6 = var3 > var2?var2:var3;
+ var6 = var6 <= var4 ?var6:var4;
+ int var7 = -var6 + var5;
+ if(0 < var7) {
+ int var9 = (var5 - var3 << 12) / var7;
+ int var8 = (var5 + -var2 << 12) / var7;
+ int var10 = (-var4 + var5 << 12) / var7;
+ if(var2 == var5) {
+ this.anInt3180 = var3 == var6 ?var10 + 20480:4096 + -var9;
+ } else if (var3 == var5) {
+ this.anInt3180 = var4 == var6 ? var8 + 4096 : -var10 + 12288;
+ } else {
+ this.anInt3180 = var6 != var2 ? -var8 + 20480 : 12288 + var9;
+ }
+
+ this.anInt3180 /= 6;
+ } else {
+ this.anInt3180 = 0;
+ }
+
+ this.anInt3188 = (var6 - -var5) / 2;
+ if(this.anInt3188 > 0 && 4096 > this.anInt3188) {
+ this.anInt3189 = (var7 << 12) / (this.anInt3188 > 2048?8192 - 2 * this.anInt3188:this.anInt3188 * 2);
+ } else {
+ this.anInt3189 = 0;
+ }
+
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "hk.E(" + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ TextCore.COMMAND_HIGHRES_GRAPHICS_FULLSCREEN = null;
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)-118, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte)-72);
+ int[] var5 = Objects.requireNonNull(var4)[0];
+ int[] var6 = var4[1];
+ int[] var7 = var4[2];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+ int[] var8 = var3[0];
+
+ for(int var11 = 0; Class113.anInt1559 > var11; ++var11) {
+ this.method240(var5[var11], var6[var11], var7[var11]);
+ this.anInt3188 += this.anInt3176;
+ if(0 > this.anInt3188) {
+ this.anInt3188 = 0;
+ }
+
+ this.anInt3189 += this.anInt3178;
+ if(this.anInt3188 > 4096) {
+ this.anInt3188 = 4096;
+ }
+
+ if(this.anInt3189 < 0) {
+ this.anInt3189 = 0;
+ }
+
+ if(4096 < this.anInt3189) {
+ this.anInt3189 = 4096;
+ }
+
+ for(this.anInt3180 += this.anInt3175; this.anInt3180 < 0; this.anInt3180 += 4096) {
+ }
+
+ while(this.anInt3180 > 4096) {
+ this.anInt3180 -= 4096;
+ }
+
+ this.method239(this.anInt3188, this.anInt3189, this.anInt3180);
+ var8[var11] = this.anInt3186;
+ var9[var11] = this.anInt3174;
+ var10[var11] = this.anInt3182;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "hk.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation18.java b/Client/src/main/java/org/runite/client/TextureOperation18.java
new file mode 100644
index 000000000..02d132d0a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation18.java
@@ -0,0 +1,176 @@
+package org.runite.client;
+
+
+import org.rs09.client.config.GameConfig;
+
+import java.awt.*;
+
+final class TextureOperation18 extends TextureOperation39 {
+
+ static int anInt4032 = 0;
+ static int[] anIntArray4035 = new int[]{1, 1, 0, 0, 0, 8, 0, 0, 8};
+ static short aShort4038 = 32767;
+ static int anInt4039 = 0;
+ static int anInt4041 = -1;
+
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-119, var2);
+ if(this.aClass97_2376.aBoolean1379 && this.method279(-128)) {
+ int[] var4 = var3[0];
+ int var7 = var2 % this.anInt3283 * this.anInt3283;
+ int[] var5 = var3[1];
+ int[] var6 = var3[2];
+
+ for(int var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ int var9 = this.anIntArray3284[var7 + var8 % this.anInt3280];
+ var6[var8] = Unsorted.bitwiseAnd(255, var9) << 4;
+ var5[var8] = Unsorted.bitwiseAnd(var9 >> 4, 4080);
+ var4[var8] = Unsorted.bitwiseAnd(16711680, var9) >> 12;
+ }
+ }
+
+ if(-1 != -1) {
+ anInt4039 = -119;
+ }
+
+ return var3;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "kd.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method282(int[] var0, int var1, int var2, int var3, int var4) {
+ try {
+ --var1;
+ --var3;
+
+ for(int var6 = -7 + var3; var6 > var1; var0[var1] = var4) {
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ var0[var1] = var4;
+ ++var1;
+ }
+
+ while(var3 > var1) {
+ ++var1;
+ var0[var1] = var4;
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "kd.B(" + "null" + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ static void method284(float[][] var0, int[][] var1, int var2, float[][] var3, int var4, int[] var5, Class37 var6, byte var7, Class43 var8, float[][] var9, int var10) {
+ try {
+ int[] var11 = new int[var5.length / 2];
+
+ int var12;
+ for(var12 = 0; var11.length > var12; ++var12) {
+ int var13 = var5[var12 + var12];
+ int var14 = var5[var12 + var12 + 1];
+ int var15;
+ if(var10 == 1) {
+ var15 = var13;
+ var13 = var14;
+ var14 = -var15 + 128;
+ } else if (var10 == 2) {
+ var14 = -var14 + 128;
+ var13 = -var13 + 128;
+ } else if (var10 == 3) {
+ var15 = var13;
+ var13 = 128 - var14;
+ var14 = var15;
+ }
+
+ float var17;
+ float var16;
+ float var24;
+ if(var13 == 0 && var14 == 0) {
+ var16 = var3[var2][var4];
+ var24 = var9[var2][var4];
+ var17 = var0[var2][var4];
+ } else if(var13 == 128 && var14 == 0) {
+ var17 = var0[var2 - -1][var4];
+ var24 = var9[1 + var2][var4];
+ var16 = var3[var2 - -1][var4];
+ } else if(128 == var13 && var14 == 128) {
+ var16 = var3[var2 + 1][var4 + 1];
+ var24 = var9[var2 + 1][var4 + 1];
+ var17 = var0[var2 - -1][var4 + 1];
+ } else if(var13 == 0 && 128 == var14) {
+ var17 = var0[var2][1 + var4];
+ var16 = var3[var2][var4 + 1];
+ var24 = var9[var2][1 + var4];
+ } else {
+ var24 = var9[var2][var4];
+ var17 = var0[var2][var4];
+ float var18 = (float)var13 / 128.0F;
+ var16 = var3[var2][var4];
+ var16 += (-var16 + var3[1 + var2][var4]) * var18;
+ var17 += var18 * (var0[1 + var2][var4] - var17);
+ var24 += (-var24 + var9[var2 - -1][var4]) * var18;
+ float var20 = var9[var2][1 + var4];
+ var20 += (var9[var2 - -1][var4 - -1] - var20) * var18;
+ float var21 = var3[var2][1 + var4];
+ float var19 = (float)var14 / 128.0F;
+ var24 += (-var24 + var20) * var19;
+ float var22 = var0[var2][1 + var4];
+ var22 += (var0[1 + var2][var4 + 1] - var22) * var18;
+ var21 += (-var21 + var3[var2 + 1][1 + var4]) * var18;
+ var16 += (-var16 + var21) * var19;
+ var17 += (var22 - var17) * var19;
+ }
+
+ int var26 = (var2 << 7) + var13;
+ int var25 = (var4 << 7) - -var14;
+ int var27 = Class3_Sub23.method408(var13, (byte)-53, var4, var1, var2, var14);
+ var11[var12] = var6.method1018(var8, var26, var27, var25, var24, var16, var17);
+ }
+
+ var6.method1022(var11);
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "kd.Q(" + (var0 != null?"{...}":"null") + ',' + (var1 != null?"{...}":"null") + ',' + var2 + ',' + (var3 != null?"{...}":"null") + ',' + var4 + ',' + (var5 != null?"{...}":"null") + ',' + (var6 != null?"{...}":"null") + ',' + var7 + ',' + (var8 != null?"{...}":"null") + ',' + (var9 != null?"{...}":"null") + ',' + var10 + ')');
+ }
+ }
+
+ static Class158 method285(int var0, int var1, Component var3) {
+ try {
+ try {
+ Class var4 = (Class) Class.forName(GameConfig.PACKAGE_NAME + ".Class158_Sub2");
+ Class158 var8 = var4.newInstance();
+ var8.method2185(var0, var1, var3);
+ return var8;
+ } catch (Throwable var6) {
+ Class158_Sub1 var5 = new Class158_Sub1();
+ var5.method2185(var0, var1, var3);
+ return var5;
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "kd.C(" + var0 + ',' + var1 + ',' + true + ',' + (var3 != null?"{...}":"null") + ')');
+ }
+ }
+
+ static AbstractSprite[] method286(int var2, CacheIndex var3) {
+ try {
+ //System.out.println("Class3_Sub13_Sub_23_Sub1 " + var2);
+ return !Class75_Sub4.method1351(var3, 0, var2)?null: AudioThread.method891(~4);
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "kd.F(" + -1 + ',' + 0 + ',' + var2 + ',' + (var3 != null?"{...}":"null") + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation19.java b/Client/src/main/java/org/runite/client/TextureOperation19.java
new file mode 100644
index 000000000..68c46f0b7
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation19.java
@@ -0,0 +1,290 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+import java.util.Objects;
+
+final class TextureOperation19 extends TextureOperation {
+
+ static CacheIndex graphicFXIndex_3214;
+ static int[][] anIntArrayArray3215 = new int[][]{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}};
+ private int anInt3217 = 32768;
+ static int[] anIntArray3218 = new int[]{1, 4};
+
+
+ static void method254(boolean var0, Class3_Sub31 var1) {
+ try {
+ int var4 = (int)var1.linkableKey;
+
+ int var3 = var1.anInt2602;
+ var1.unlink();
+ if(var0) {
+ Class60.method1208((byte)79, var3);
+ }
+
+ Class164_Sub2.method2249(var3);
+ RSInterface var5 = Unsorted.getRSInterface(var4);
+ if(null != var5) {
+ Class20.method909(var5);
+ }
+
+ int var6 = Unsorted.menuOptionCount;
+
+ int var7;
+ for(var7 = 0; var6 > var7; ++var7) {
+ if(Unsorted.method73(TextureOperation27.aShortArray3095[var7])) {
+ Class3_Sub25.method509(var7);
+ }
+ }
+
+ if(Unsorted.menuOptionCount == 1) {
+ Class38_Sub1.aBoolean2615 = false;
+ Class21.method1340(Class21.anInt1462, Class21.anInt3552, Class21.anInt3395, Class21.anInt3537);
+ } else {
+ Class21.method1340(Class21.anInt1462, Class21.anInt3552, Class21.anInt3395, Class21.anInt3537);
+ var7 = FontType.bold.method682(RSString.parse(GameConfig.RCM_TITLE));
+
+ for(int var8 = 0; Unsorted.menuOptionCount > var8; ++var8) {
+ int var9 = FontType.bold.method682(Unsorted.method802(var8));
+ if(var7 < var9) {
+ var7 = var9;
+ }
+ }
+
+ Class21.anInt3537 = Unsorted.menuOptionCount * 15 + (Unsorted.aBoolean1951?26:22);
+ Class21.anInt3552 = var7 + 8;
+ }
+
+ if(-1 != ConfigInventoryDefinition.anInt3655) {
+ Class3_Sub8.method124(115, 1, ConfigInventoryDefinition.anInt3655);
+ }
+
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "ke.O(" + var0 + ',' + (var1 != null?"{...}":"null") + ',' + false + ')');
+ }
+ }
+
+ static void method255(int var0, int var1, int var2) {
+ try {
+ InterfaceWidget var3 = InterfaceWidget.getWidget(var2, var0);
+ var3.flagUpdate();
+ var3.anInt3598 = var1;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ke.Q(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation19() {
+ super(3, false);
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ graphicFXIndex_3214 = null;
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)4, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[] var4 = this.method152(1, var2);
+ int[] var5 = this.method152(2, var2);
+ int[] var8 = var3[2];
+ int[] var7 = var3[1];
+ int[] var6 = var3[0];
+
+ for(int var9 = 0; Class113.anInt1559 > var9; ++var9) {
+ int var10 = (var4[var9] * 255 & 1046259) >> 12;
+ int var11 = var5[var9] * this.anInt3217 >> 12;
+ int var12 = var11 * Class75_Sub2.anIntArray2639[var10] >> 12;
+ int var13 = TextureOperation23.anIntArray3212[var10] * var11 >> 12;
+ int var14 = (var12 >> 12) + var9 & RenderAnimationDefinition.anInt396;
+ int var15 = Class3_Sub20.anInt2487 & var2 - -(var13 >> 12);
+ int[][] var16 = this.method162(var15, 0, (byte)-117);
+ var6[var9] = Objects.requireNonNull(var16)[0][var14];
+ var7[var9] = var16[1][var14];
+ var8[var9] = var16[2][var14];
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "ke.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(1, var1);
+ int[] var6 = this.method152(2, var1);
+
+ for(int var7 = 0; var7 < Class113.anInt1559; ++var7) {
+ int var9 = this.anInt3217 * var6[var7] >> 12;
+ int var8 = (var5[var7] & 4087) >> 4;
+ int var10 = Class75_Sub2.anIntArray2639[var8] * var9 >> 12;
+ int var11 = TextureOperation23.anIntArray3212[var8] * var9 >> 12;
+ int var12 = RenderAnimationDefinition.anInt396 & (var10 >> 12) + var7;
+ int var13 = Class3_Sub20.anInt2487 & (var11 >> 12) + var1;
+ int[] var14 = this.method152(0, var13);
+ var4[var7] = var14[var12];
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "ke.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3217 = var2.readUnsignedShort() << 4;
+ } else if (var1 == 1) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ if(!true) {
+ TextureOperation20.anInt3216 = -7;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ke.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method257() {
+ try {
+ int var1 = 0;
+
+ for(int var2 = 0; var2 < 104; ++var2) {
+ for(int var3 = 0; var3 < 104; ++var3) {
+ if(GroundItem.method2031((byte)-106, true, var2, var3, TileData.aTileDataArrayArrayArray2638, var1)) {
+ ++var1;
+ }
+
+ if(var1 >= 512) {
+ return;
+ }
+ }
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ke.C(" + (byte) 125 + ')');
+ }
+ }
+
+ static void method259(Class126 var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, boolean var8) {
+ int var9;
+ int var10 = var9 = (var6 << 7) - Class145.anInt2697;
+ int var11;
+ int var12 = var11 = (var7 << 7) - TextureOperation13.anInt3363;
+ int var13;
+ int var14 = var13 = var10 + 128;
+ int var15;
+ int var16 = var15 = var12 + 128;
+ int var17 = Class44.anIntArrayArrayArray723[var1][var6][var7] - Unsorted.anInt3657;
+ int var18 = Class44.anIntArrayArrayArray723[var1][var6 + 1][var7] - Unsorted.anInt3657;
+ int var19 = Class44.anIntArrayArrayArray723[var1][var6 + 1][var7 + 1] - Unsorted.anInt3657;
+ int var20 = Class44.anIntArrayArrayArray723[var1][var6][var7 + 1] - Unsorted.anInt3657;
+ int var21 = var12 * var4 + var10 * var5 >> 16;
+ var12 = var12 * var5 - var10 * var4 >> 16;
+ var10 = var21;
+ var21 = var17 * var3 - var12 * var2 >> 16;
+ var12 = var17 * var2 + var12 * var3 >> 16;
+ var17 = var21;
+ if(var12 >= 50) {
+ var21 = var11 * var4 + var14 * var5 >> 16;
+ var11 = var11 * var5 - var14 * var4 >> 16;
+ var14 = var21;
+ var21 = var18 * var3 - var11 * var2 >> 16;
+ var11 = var18 * var2 + var11 * var3 >> 16;
+ var18 = var21;
+ if(var11 >= 50) {
+ var21 = var16 * var4 + var13 * var5 >> 16;
+ var16 = var16 * var5 - var13 * var4 >> 16;
+ var13 = var21;
+ var21 = var19 * var3 - var16 * var2 >> 16;
+ var16 = var19 * var2 + var16 * var3 >> 16;
+ var19 = var21;
+ if(var16 >= 50) {
+ var21 = var15 * var4 + var9 * var5 >> 16;
+ var15 = var15 * var5 - var9 * var4 >> 16;
+ var9 = var21;
+ var21 = var20 * var3 - var15 * var2 >> 16;
+ var15 = var20 * var2 + var15 * var3 >> 16;
+ if(var15 >= 50) {
+ int var22 = Class51.anInt846 + (var10 << 9) / var12;
+ int var23 = Class51.anInt835 + (var17 << 9) / var12;
+ int var24 = Class51.anInt846 + (var14 << 9) / var11;
+ int var25 = Class51.anInt835 + (var18 << 9) / var11;
+ int var26 = Class51.anInt846 + (var13 << 9) / var16;
+ int var27 = Class51.anInt835 + (var19 << 9) / var16;
+ int var28 = Class51.anInt846 + (var9 << 9) / var15;
+ int var29 = Class51.anInt835 + (var21 << 9) / var15;
+ Class51.anInt850 = 0;
+ int var30;
+ if((var26 - var28) * (var25 - var29) - (var27 - var29) * (var24 - var28) > 0) {
+ if(TextureOperation37.aBoolean3261 && TextureOperation34.method185(Class49.anInt819 + Class51.anInt846, TextureOperation18.anInt4039 + Class51.anInt835, var27, var29, var25, var26, var28, var24)) {
+ Class27.anInt515 = var6;
+ Unsorted.anInt999 = var7;
+ }
+
+ if(!HDToolKit.highDetail && !var8) {
+ Class51.aBoolean849 = var26 < 0 || var28 < 0 || var24 < 0 || var26 > Class51.anInt847 || var28 > Class51.anInt847 || var24 > Class51.anInt847;
+
+ if(var0.anInt1670 == -1) {
+ if(var0.anInt1664 != 12345678) {
+ Class51.method1154(var27, var29, var25, var26, var28, var24, var0.anInt1664, var0.anInt1663, var0.anInt1667);
+ }
+ } else if(Unsorted.aBoolean3275) {
+ if(var0.aBoolean1674) {
+ Class51.method1135(var27, var29, var25, var26, var28, var24, var0.anInt1664, var0.anInt1663, var0.anInt1667, var10, var14, var9, var17, var18, var21, var12, var11, var15, var0.anInt1670);
+ } else {
+ Class51.method1135(var27, var29, var25, var26, var28, var24, var0.anInt1664, var0.anInt1663, var0.anInt1667, var13, var9, var14, var19, var21, var18, var16, var15, var11, var0.anInt1670);
+ }
+ } else {
+ var30 = Class51.anInterface2_838.method15(var0.anInt1670, 65535);
+ Class51.method1154(var27, var29, var25, var26, var28, var24, LoginHandler.method1753(var30, var0.anInt1664), LoginHandler.method1753(var30, var0.anInt1663), LoginHandler.method1753(var30, var0.anInt1667));
+ }
+ }
+ }
+
+ if((var22 - var24) * (var29 - var25) - (var23 - var25) * (var28 - var24) > 0) {
+ if(TextureOperation37.aBoolean3261 && TextureOperation34.method185(Class49.anInt819 + Class51.anInt846, TextureOperation18.anInt4039 + Class51.anInt835, var23, var25, var29, var22, var24, var28)) {
+ Class27.anInt515 = var6;
+ Unsorted.anInt999 = var7;
+ }
+
+ if(!HDToolKit.highDetail && !var8) {
+ Class51.aBoolean849 = var22 < 0 || var24 < 0 || var28 < 0 || var22 > Class51.anInt847 || var24 > Class51.anInt847 || var28 > Class51.anInt847;
+
+ if(var0.anInt1670 == -1) {
+ if(var0.anInt1675 != 12345678) {
+ Class51.method1154(var23, var25, var29, var22, var24, var28, var0.anInt1675, var0.anInt1667, var0.anInt1663);
+ }
+ } else if(Unsorted.aBoolean3275) {
+ Class51.method1135(var23, var25, var29, var22, var24, var28, var0.anInt1675, var0.anInt1667, var0.anInt1663, var10, var14, var9, var17, var18, var21, var12, var11, var15, var0.anInt1670);
+ } else {
+ var30 = Class51.anInterface2_838.method15(var0.anInt1670, 65535);
+ Class51.method1154(var23, var25, var29, var22, var24, var28, LoginHandler.method1753(var30, var0.anInt1675), LoginHandler.method1753(var30, var0.anInt1667), LoginHandler.method1753(var30, var0.anInt1663));
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ }
+
+ final void postDecode() {
+ try {
+ Class8.method844((byte)-9);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ke.P(" + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation2.java b/Client/src/main/java/org/runite/client/TextureOperation2.java
new file mode 100644
index 000000000..18236bd0b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation2.java
@@ -0,0 +1,22 @@
+package org.runite.client;
+
+import org.rs09.client.data.ReferenceCache;
+
+final class TextureOperation2 extends TextureOperation {
+
+ static ReferenceCache aReferenceCache_3369 = new ReferenceCache(64);
+ static AbstractSprite[] aAbstractSpriteArray3373;
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ return Class102.anIntArray2125;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "rl.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation2() {
+ super(0, true);
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation20.java b/Client/src/main/java/org/runite/client/TextureOperation20.java
new file mode 100644
index 000000000..128de0980
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation20.java
@@ -0,0 +1,939 @@
+package org.runite.client;
+import org.rs09.client.filestore.resources.configs.cursors.CursorDefinition;
+
+import java.awt.Point;
+import java.io.IOException;
+import java.util.Objects;
+
+final class TextureOperation20 extends TextureOperation {
+
+ static int anInt2212 = 0;
+ static int anInt2217 = 2;
+ static int anInt3216 = 0;
+ static long aLong1465 = 0L;
+ static Class67 aClass67_1443;
+ static int anInt1682 = 1;
+ static int anInt2701 = 0;
+ static boolean aBoolean2774 = true;
+ static int anInt1977 = 0;
+ private int anInt3147 = 4;
+ static int paramModeWhat = 0;
+ private int anInt3149 = 4;
+ static CacheIndex configurationsIndex_3154;
+ static int anInt3156 = -1;
+
+
+ static void method229(int cursor) {
+ try {
+ if(!Class163_Sub3.aBoolean3004) {
+ cursor = -1;
+ }
+
+ if(cursor != Class65.anInt991) {
+ if(cursor != -1) {
+ CursorDefinition cursorDef = TextureOperation3.method311(cursor);
+ SoftwareSprite image = cursorDef.getImage();
+ if(image == null) {
+ cursor = -1;
+ } else {
+ Class38.gameSignlink.method1434(image.method655(), 10000, image.anInt3697, GameShell.canvas, new Point(cursorDef.getHotspotX(), cursorDef.getHotspotY()), image.anInt3706);
+ Class65.anInt991 = cursor;
+ }
+ }
+
+ if(cursor == -1 && Class65.anInt991 != -1) {
+ Class38.gameSignlink.method1434(null, 10000, -1, GameShell.canvas, new Point(), -1);
+ Class65.anInt991 = -1;
+ }
+
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "gg.C(" + cursor + ',' + 20827 + ')');
+ }
+ }
+
+ public TextureOperation20() {
+ super(1, false);
+ }
+
+ static void breakClientConnection() {
+ try {
+
+ if(Class159.anInt2023 > 0) {
+ Class167.method2269((byte)46);
+ } else {
+ Class163_Sub2_Sub1.aClass89_4012 = Class3_Sub15.activeConnection;
+ Class3_Sub15.activeConnection = null;
+ Class117.method1719(40);
+ }
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "nm.B(" + false + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ paramModeWhat = -117;
+ }
+
+ if(var1 == 0) {
+ this.anInt3149 = var2.readUnsignedByte();
+ } else if(1 == var1) {
+ this.anInt3147 = var2.readUnsignedByte();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "gg.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method230(int[][] var0) {
+ try {
+ Class38.anIntArrayArray663 = var0;
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "gg.Q(" + (var0 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static Class24 method231(int var0) {
+ try {
+ Class24 var2 = (Class24)Entity.aReferenceCache_2792.get(var0);
+ if(var2 == null) {
+ byte[] var3 = LoginHandler.configurationsIndex_1680.getFile(3, var0);
+ var2 = new Class24();
+ if(null != var3) {
+ var2.method952(new DataBuffer(var3));
+ }
+
+ Entity.aReferenceCache_2792.put(var2, var0);
+
+ }
+ return var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "gg.B(" + var0 + ',' + 0 + ')');
+ }
+ }
+
+ static void method232(int var0) {
+ try {
+ if(Unsorted.loadInterface(var0)) {
+ RSInterface[] var2 = GameObject.interfaces1834[var0];
+
+ for(int var3 = 0; var3 < var2.length; ++var3) {
+ RSInterface var4 = var2[var3];
+ if(null != var4) {
+ var4.anInt260 = 1;
+ var4.anInt283 = 0;
+ var4.anInt267 = 0;
+ }
+ }
+
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "gg.E(" + var0 + ',' + 16182 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var10 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = Class113.anInt1559 / this.anInt3149;
+ int var6 = Class101.anInt1427 / this.anInt3147;
+ int[] var4;
+ int var7;
+ if(var6 <= 0) {
+ var4 = this.method152(0, 0);
+ } else {
+ var7 = var1 % var6;
+ var4 = this.method152(0, Class101.anInt1427 * var7 / var6);
+ }
+
+ for(var7 = 0; var7 < Class113.anInt1559; ++var7) {
+ if(0 >= var5) {
+ var10[var7] = var4[0];
+ } else {
+ int var8 = var7 % var5;
+ var10[var7] = var4[Class113.anInt1559 * var8 / var5];
+ }
+ }
+ }
+
+ return var10;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "gg.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method233(int var0, CacheIndex var1) {
+ try {
+ if(var0 != 28280) {
+ configurationsIndex_3154 = null;
+ }
+
+ NPC.anInt4001 = var1.getArchiveForName(TextCore.aString_119);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "gg.R(" + var0 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 == -1) {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-123, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int var5 = Class113.anInt1559 / this.anInt3149;
+ int var6 = Class101.anInt1427 / this.anInt3147;
+ int[][] var4;
+ if(var6 > 0) {
+ int var7 = var2 % var6;
+ var4 = this.method162(var7 * Class101.anInt1427 / var6, 0, (byte)-109);
+ } else {
+ var4 = this.method162(0, 0, (byte)-120);
+ }
+
+ int[] var17 = Objects.requireNonNull(var4)[0];
+ int[] var9 = var4[2];
+ int[] var10 = var3[0];
+ int[] var8 = var4[1];
+ int[] var11 = var3[1];
+ int[] var12 = var3[2];
+
+ for(int var13 = 0; Class113.anInt1559 > var13; ++var13) {
+ int var14;
+ if(var5 <= 0) {
+ var14 = 0;
+ } else {
+ int var15 = var13 % var5;
+ var14 = var15 * Class113.anInt1559 / var5;
+ }
+
+ var10[var13] = var17[var14];
+ var11[var13] = var8[var14];
+ var12[var13] = var9[var14];
+ }
+ }
+
+ return var3;
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var16) {
+ throw ClientErrorException.clientError(var16, "gg.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method235() {
+ try {
+ if(Class159.anInt2023 > 0) {
+ --Class159.anInt2023;
+ }
+
+ if(Class38_Sub1.anInt2617 > 1) {
+ --Class38_Sub1.anInt2617;
+ Class140_Sub6.anInt2905 = PacketParser.anInt3213;
+ }
+
+ if(Class3_Sub28_Sub18.aBoolean3769) {
+ Class3_Sub28_Sub18.aBoolean3769 = false;
+ breakClientConnection();
+ } else {
+ int queuedVarpIndex;
+ for(queuedVarpIndex = 0; queuedVarpIndex < 100 && TextureOperation33.method181(); ++queuedVarpIndex) {
+ }
+
+ if(Class143.gameStage == 30) {
+ Class163_Sub2_Sub1.method2226(TextureOperation12.outgoingBuffer, 163, -116);
+ Object var14 = aClass67_1443.anObject1016;
+ int var2;
+ int var3;
+ int var4;
+ int var5;
+ int var6;
+ int var8;
+ int var9;
+ synchronized(var14) {
+ if(Unsorted.aBoolean29) {
+ if(Unsorted.anInt3644 != 0 || aClass67_1443.anInt1018 >= 40) {
+ TextureOperation12.outgoingBuffer.putOpcode(123);
+ var3 = 0;
+ TextureOperation12.outgoingBuffer.writeByte(0);
+ var2 = TextureOperation12.outgoingBuffer.index;
+
+ for(var4 = 0; aClass67_1443.anInt1018 > var4 && TextureOperation12.outgoingBuffer.index - var2 < 240; ++var4) {
+ ++var3;
+ var5 = aClass67_1443.anIntArray1019[var4];
+ var6 = aClass67_1443.anIntArray1020[var4];
+ if(var5 < 0) {
+ var5 = 0;
+ } else if(var5 > 65534) {
+ var5 = '\ufffe';
+ }
+
+ if(var6 >= 0) {
+ if('\ufffe' < var6) {
+ var6 = '\ufffe';
+ }
+ } else {
+ var6 = 0;
+ }
+
+ boolean var7 = false;
+ if(aClass67_1443.anIntArray1019[var4] == -1 && aClass67_1443.anIntArray1020[var4] == -1) {
+ var7 = true;
+ var5 = -1;
+ var6 = -1;
+ }
+
+ if(anInt1977 == var6 && var5 == Unsorted.anInt14) {
+ if(2047 > Class3_Sub26.anInt2556) {
+ ++Class3_Sub26.anInt2556;
+ }
+ } else {
+ var8 = -anInt1977 + var6;
+ anInt1977 = var6;
+ var9 = var5 + -Unsorted.anInt14;
+ Unsorted.anInt14 = var5;
+ if(Class3_Sub26.anInt2556 < 8 && var8 >= -32 && 31 >= var8 && -32 <= var9 && var9 <= 31) {
+ var9 += 32;
+ var8 += 32;
+ TextureOperation12.outgoingBuffer.writeShort(var9 + (Class3_Sub26.anInt2556 << 12) + (var8 << 6));
+ Class3_Sub26.anInt2556 = 0;
+ } else if(Class3_Sub26.anInt2556 < 32 && var8 >= -128 && var8 <= 127 && var9 >= -128 && var9 <= 127) {
+ TextureOperation12.outgoingBuffer.writeByte(128 - -Class3_Sub26.anInt2556);
+ var9 += 128;
+ var8 += 128;
+ TextureOperation12.outgoingBuffer.writeShort((var8 << 8) + var9);
+ Class3_Sub26.anInt2556 = 0;
+ } else if(32 > Class3_Sub26.anInt2556) {
+ TextureOperation12.outgoingBuffer.writeByte(192 - -Class3_Sub26.anInt2556);
+ if(var7) {
+ TextureOperation12.outgoingBuffer.writeInt(Integer.MIN_VALUE);
+ } else {
+ TextureOperation12.outgoingBuffer.writeInt(var6 | var5 << 16);
+ }
+
+ Class3_Sub26.anInt2556 = 0;
+ } else {
+ TextureOperation12.outgoingBuffer.writeShort(Class3_Sub26.anInt2556 + '\ue000');
+ if(var7) {
+ TextureOperation12.outgoingBuffer.writeInt(Integer.MIN_VALUE);
+ } else {
+ TextureOperation12.outgoingBuffer.writeInt(var6 | var5 << 16);
+ }
+
+ Class3_Sub26.anInt2556 = 0;
+ }
+ }
+ }
+
+ TextureOperation12.outgoingBuffer.method769(-var2 + TextureOperation12.outgoingBuffer.index);
+ if(var3 < aClass67_1443.anInt1018) {
+ aClass67_1443.anInt1018 -= var3;
+
+ for(var4 = 0; aClass67_1443.anInt1018 > var4; ++var4) {
+ aClass67_1443.anIntArray1020[var4] = aClass67_1443.anIntArray1020[var3 + var4];
+ aClass67_1443.anIntArray1019[var4] = aClass67_1443.anIntArray1019[var4 + var3];
+ }
+ } else {
+ aClass67_1443.anInt1018 = 0;
+ }
+ }
+ } else {
+ aClass67_1443.anInt1018 = 0;
+ }
+ }
+
+ if(Unsorted.anInt3644 != 0) {
+ long var15 = (-aLong1465 + Class75.aLong1102) / 50L;
+ var3 = Class38_Sub1.anInt2614;
+ if(var3 >= 0) {
+ if(var3 > 65535) {
+ var3 = 65535;
+ }
+ } else {
+ var3 = 0;
+ }
+
+ if(32767L < var15) {
+ var15 = 32767L;
+ }
+
+ var4 = Class163_Sub1.anInt2993;
+ aLong1465 = Class75.aLong1102;
+ byte var19 = 0;
+ if(var4 >= 0) {
+ if(var4 > 65535) {
+ var4 = 65535;
+ }
+ } else {
+ var4 = 0;
+ }
+
+ var6 = (int)var15;
+ if(Unsorted.anInt3644 == 2) {
+ var19 = 1;
+ }
+
+ TextureOperation12.outgoingBuffer.putOpcode(75);
+ TextureOperation12.outgoingBuffer.writeShort128LE(var19 << 15 | var6);
+ TextureOperation12.outgoingBuffer.writeIntV2(var4 | var3 << 16);
+ }
+
+ if(0 < anInt2212) {
+ --anInt2212;
+ }
+
+ if(AudioThread.aBoolean346) {
+ for(queuedVarpIndex = 0; Class3_Sub23.anInt2537 > queuedVarpIndex; ++queuedVarpIndex) {
+ var2 = Class133.inputTextCodeArray[queuedVarpIndex];
+ if(98 == var2 || var2 == 99 || var2 == 96 || var2 == 97) {
+ Unsorted.aBoolean4068 = true;
+ break;
+ }
+ }
+ } else if(ObjectDefinition.aBooleanArray1490[96] || ObjectDefinition.aBooleanArray1490[97] || ObjectDefinition.aBooleanArray1490[98] || ObjectDefinition.aBooleanArray1490[99]) {
+ Unsorted.aBoolean4068 = true;
+ }
+
+ if(Unsorted.aBoolean4068 && 0 >= anInt2212) {
+ anInt2212 = 20;
+ Unsorted.aBoolean4068 = false;
+ TextureOperation12.outgoingBuffer.putOpcode(21);
+ TextureOperation12.outgoingBuffer.putShortA(Unsorted.anInt2309);
+ TextureOperation12.outgoingBuffer.writeShortLE(GraphicDefinition.CAMERA_DIRECTION);
+ }
+
+ if(TextureOperation26.aBoolean3078 && !aBoolean2774) {
+ aBoolean2774 = true;
+ TextureOperation12.outgoingBuffer.putOpcode(22);
+ TextureOperation12.outgoingBuffer.writeByte(1);
+ }
+
+ if(!TextureOperation26.aBoolean3078 && aBoolean2774) {
+ aBoolean2774 = false;
+ TextureOperation12.outgoingBuffer.putOpcode(22);
+ TextureOperation12.outgoingBuffer.writeByte(0);
+ }
+
+ if(!CS2Script.aBoolean2705) {
+ TextureOperation12.outgoingBuffer.putOpcode(98);
+ TextureOperation12.outgoingBuffer.writeInt(Class84.method1421());
+ CS2Script.aBoolean2705 = true;
+ }
+
+ Class163_Sub1_Sub1.method2214();
+ if(Class143.gameStage == 30) {
+ Scenery.cleanupOldScenery();
+ Class115.method1713();
+ AudioHandler.method132();
+ ++AbstractSprite.anInt3699;
+ if(AbstractSprite.anInt3699 > 750) {
+ breakClientConnection();
+ } else {
+ PlayerRendering.updatePlayerAreaArray();
+ NPCRendering.updateNPCAreaArray();
+ TextureOperation34.method189();
+ if(Class3_Sub28_Sub3.aClass11_3551 != null) {
+ Unsorted.method848();
+ }
+
+ for(queuedVarpIndex = Class3_Sub5.method115(true); queuedVarpIndex != -1; queuedVarpIndex = Class3_Sub5.method115(false)) {
+ Class46.method1087(40, queuedVarpIndex);
+ Class44.anIntArray726[Unsorted.bitwiseAnd(Class36.anInt641++, 31)] = queuedVarpIndex;
+ }
+
+ int nodeModelID;
+ for(InterfaceWidget var16 = Unsorted.popNextInterfaceWidget(); var16 != null; var16 = Unsorted.popNextInterfaceWidget()) {
+ var3 = var16.e();
+ var4 = var16.f();
+ if(1 == var3) {
+ NPCDefinition.varcArray[var4] = var16.anInt3598;
+ NPC.anIntArray3986[Unsorted.bitwiseAnd(31, PacketParser.anInt87++)] = var4;
+ } else if(var3 == 2) {
+ Class132.aStringArray1739[var4] = var16.text;
+ Class163_Sub2_Sub1.anIntArray4025[Unsorted.bitwiseAnd(31, Client.anInt2317++)] = var4;
+ } else {
+ RSInterface var20;
+ if(var3 == 3) {
+ var20 = Unsorted.getRSInterface(var4);
+ if(!var16.text.equalsString(Objects.requireNonNull(var20).text)) {
+ var20.text = var16.text;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 4) {
+ var20 = Unsorted.getRSInterface(var4);
+ var6 = var16.anInt3598;
+ var8 = var16.anInt3596;
+ nodeModelID = var16.anInt3597;
+ if (Objects.requireNonNull(var20).modelType != var6 || nodeModelID != var20.itemId || var8 != var20.anInt265) {
+ var20.itemId = nodeModelID;
+ var20.anInt265 = var8;
+ var20.modelType = var6;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 5) {
+ var20 = Unsorted.getRSInterface(var4);
+ if (var16.anInt3598 != Objects.requireNonNull(var20).animationId || var16.anInt3598 == -1) {
+ var20.anInt260 = 1;
+ var20.anInt267 = 0;
+ var20.animationId = var16.anInt3598;
+ var20.anInt283 = 0;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 6) {
+ var5 = var16.anInt3598;
+ var6 = (32195 & var5) >> 10;
+ var8 = var5 & 31;
+ nodeModelID = (var5 & 1000) >> 5;
+ RSInterface var10 = Unsorted.getRSInterface(var4);
+ var9 = (var8 << 3) + (nodeModelID << 11) + (var6 << 19);
+ if (Objects.requireNonNull(var10).anInt218 != var9) {
+ var10.anInt218 = var9;
+ Class20.method909(var10);
+ }
+ } else if (var3 == 7) {
+ var20 = Unsorted.getRSInterface(var4);
+ boolean var24 = var16.anInt3598 == 1;
+ if (var20 != null && var24 == !var20.hidden) {
+ var20.hidden = var24;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 8) {
+ var20 = Unsorted.getRSInterface(var4);
+ if (var16.anInt3598 != Objects.requireNonNull(var20).anInt182 || var20.anInt308 != var16.anInt3597 || var20.anInt164 != var16.anInt3596) {
+ var20.anInt182 = var16.anInt3598;
+ var20.anInt164 = var16.anInt3596;
+ var20.anInt308 = var16.anInt3597;
+ if (-1 != var20.anInt192) {
+ if (var20.anInt184 <= 0) {
+ if (var20.defWidth > 0) {
+ var20.anInt164 = 32 * var20.anInt164 / var20.defWidth;
+ }
+ } else {
+ var20.anInt164 = var20.anInt164 * 32 / var20.anInt184;
+ }
+ }
+
+ Class20.method909(var20);
+ }
+ } else if (var3 == 9) {
+ var20 = Unsorted.getRSInterface(var4);
+ if (Objects.requireNonNull(var20).anInt192 != var16.anInt3598 || var20.anInt271 != var16.anInt3597) {
+ var20.anInt192 = var16.anInt3598;
+ var20.anInt271 = var16.anInt3597;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 10) {
+ var20 = Unsorted.getRSInterface(var4);
+ if (var16.anInt3598 != Objects.requireNonNull(var20).anInt258 || var20.anInt264 != var16.anInt3597 || var20.anInt280 != var16.anInt3596) {
+ var20.anInt264 = var16.anInt3597;
+ var20.anInt280 = var16.anInt3596;
+ var20.anInt258 = var16.anInt3598;
+ Class20.method909(var20);
+ }
+ } else if (var3 == 11) {
+ var20 = Unsorted.getRSInterface(var4);
+ Objects.requireNonNull(var20).anInt306 = var20.defX = var16.anInt3598;
+ var20.horizontalPos = 0;
+ var20.verticalPos = 0;
+ var20.anInt210 = var20.defY = var16.anInt3597;
+ Class20.method909(var20);
+ } else if (var3 == 12) {
+ var20 = Unsorted.getRSInterface(var4);
+ var6 = var16.anInt3598;
+ if (null != var20 && 0 == var20.type) {
+ if (var6 > var20.anInt252 + -var20.height) {
+ var6 = var20.anInt252 + -var20.height;
+ }
+
+ if (0 > var6) {
+ var6 = 0;
+ }
+
+ if (var6 != var20.anInt208) {
+ var20.anInt208 = var6;
+ Class20.method909(var20);
+ }
+ }
+ } else if (var3 == 13) {
+ var20 = Unsorted.getRSInterface(var4);
+ Objects.requireNonNull(var20).anInt237 = var16.anInt3598;
+ }
+ }
+ }
+
+ if(Class36.anInt638 != 0) {
+ Unsorted.anInt2958 += 20;
+ if(400 <= Unsorted.anInt2958) {
+ Class36.anInt638 = 0;
+ }
+ }
+
+ ++Class106.anInt1446;
+ if(Unsorted.aClass11_1933 != null) {
+ ++BufferedDataStream.anInt2330;
+ if(15 <= BufferedDataStream.anInt2330) {
+ Class20.method909(Unsorted.aClass11_1933);
+ Unsorted.aClass11_1933 = null;
+ }
+ }
+
+ RSInterface var17;
+ if(Class67.aClass11_1017 != null) {
+ Class20.method909(Class67.aClass11_1017);
+ if(Class126.anInt1676 > 5 + Class129_Sub1.anInt2693 || Class126.anInt1676 < -5 + Class129_Sub1.anInt2693 || Unsorted.anInt1709 > Unsorted.anInt40 + 5 || -5 + Unsorted.anInt40 > Unsorted.anInt1709) {
+ Class72.aBoolean1074 = true;
+ }
+
+ ++Class40.anInt677;
+ if(0 == TextureOperation21.anInt3069) {
+ if(Class72.aBoolean1074 && 5 <= Class40.anInt677) {
+ if(Class67.aClass11_1017 == Class99.aClass11_1402 && PacketParser.anInt86 != anInt2701) {
+ var17 = Class67.aClass11_1017;
+ byte var18 = 0;
+ if(1 == Unsorted.anInt15 && 206 == var17.anInt189) {
+ var18 = 1;
+ }
+
+ if(var17.itemAmounts[anInt2701] <= 0) {
+ var18 = 0;
+ }
+
+ if(Client.method44(var17).method93()) {
+ var5 = PacketParser.anInt86;
+ var6 = anInt2701;
+ var17.itemAmounts[var6] = var17.itemAmounts[var5];
+ var17.itemIds[var6] = var17.itemIds[var5];
+ var17.itemAmounts[var5] = -1;
+ var17.itemIds[var5] = 0;
+ } else if (var18 == 1) {
+ var6 = anInt2701;
+ var5 = PacketParser.anInt86;
+
+ while (var6 != var5) {
+ if (var5 > var6) {
+ var17.method864(-1 + var5, var5);
+ --var5;
+ } else {
+ var17.method864(1 + var5, var5);
+ ++var5;
+ }
+ }
+ } else {
+ var17.method864(anInt2701, PacketParser.anInt86);
+ }
+
+ TextureOperation12.outgoingBuffer.putOpcode(231);
+ TextureOperation12.outgoingBuffer.writeShort(PacketParser.anInt86);
+ TextureOperation12.outgoingBuffer.writeIntLE2(Class67.aClass11_1017.componentHash);
+ TextureOperation12.outgoingBuffer.putShortA(anInt2701);
+ TextureOperation12.outgoingBuffer.write128Byte(var18);
+ }
+ } else if((Unsorted.anInt998 == 1 || TextureOperation8.method353(-1 + Unsorted.menuOptionCount, 0)) && Unsorted.menuOptionCount > 2) {
+ Class132.method1801();
+ } else if(Unsorted.menuOptionCount > 0) {
+ TextureOperation9.method203(56);
+ }
+
+ Unsorted.anInt3644 = 0;
+ BufferedDataStream.anInt2330 = 10;
+ Class67.aClass11_1017 = null;
+ }
+ }
+
+ Class85.aBoolean1167 = false;
+ Class27.aClass11_526 = null;
+ Class21.aBoolean440 = false;
+ Class3_Sub23.anInt2537 = 0;
+ var17 = Class107.aClass11_1453;
+ Class107.aClass11_1453 = null;
+ RSInterface var21 = Class20.aClass11_439;
+
+ for(Class20.aClass11_439 = null; Unsorted.method591(72) && 128 > Class3_Sub23.anInt2537; ++Class3_Sub23.anInt2537) {
+ Class133.inputTextCodeArray[Class3_Sub23.anInt2537] = Class3_Sub28_Sub9.anInt3624;
+ Class120.anIntArray1638[Class3_Sub23.anInt2537] = TextureOperation7.anInt3342;
+ }
+
+ Class3_Sub28_Sub3.aClass11_3551 = null;
+ if(ConfigInventoryDefinition.anInt3655 != -1) {
+ GraphicDefinition.method967(0, 0, 0, Class23.canvasWidth, ConfigInventoryDefinition.anInt3655, 0, GroundItem.canvasHeight);
+ }
+
+ ++PacketParser.anInt3213;
+
+ while(true) {
+ CS2Script var26 = (CS2Script)PacketParser.aLinkedList_82.method1220();
+ RSInterface var23;
+ RSInterface var25;
+ if(var26 == null) {
+ while(true) {
+ var26 = (CS2Script)Class65.aLinkedList_983.method1220();
+ if(var26 == null) {
+ while(true) {
+ var26 = (CS2Script) Client.aLinkedList_1471.method1220();
+ if(var26 == null) {
+ if(Class3_Sub28_Sub3.aClass11_3551 == null) {
+ Class3_Sub19.anInt2475 = 0;
+ }
+
+ if(Class56.aClass11_886 != null) {
+ PacketParser.method829();
+ }
+
+ if(Player.rights > 0 && ObjectDefinition.aBooleanArray1490[82] && ObjectDefinition.aBooleanArray1490[81] && 0 != Class29.anInt561) {
+ var5 = WorldListCountry.localPlane - Class29.anInt561;
+ if(0 > var5) {
+ var5 = 0;
+ } else if(var5 > 3) {
+ var5 = 3;
+ }
+
+ Class30.method979(Class102.player.xOffsets2767[0] + Class131.x1716, Class102.player.yOffsets2755[0] + Texture.y1152, var5);
+ }
+
+ if(Player.rights > 0 && ObjectDefinition.aBooleanArray1490[82] && ObjectDefinition.aBooleanArray1490[81]) {
+ if(-1 != Class27.anInt515) {
+ Class30.method979(Class131.x1716 + Class27.anInt515, Texture.y1152 - -Unsorted.anInt999, WorldListCountry.localPlane);
+ }
+
+ ObjectDefinition.anInt1521 = 0;
+ CS2Script.anInt2440 = 0;
+ } else if(CS2Script.anInt2440 == 2) {
+ if(Class27.anInt515 != -1) {
+ TextureOperation12.outgoingBuffer.putOpcode(131);
+ TextureOperation12.outgoingBuffer.writeIntV2(BufferedDataStream.anInt872);
+ TextureOperation12.outgoingBuffer.putShortA(Class131.x1716 + Class27.anInt515);
+ TextureOperation12.outgoingBuffer.writeShort128LE(RSInterface.anInt278);
+ TextureOperation12.outgoingBuffer.putShortA(Unsorted.anInt999 + Texture.y1152);
+ Class36.anInt638 = 1;
+ Unsorted.anInt2958 = 0;
+ Unsorted.anInt4062 = Class38_Sub1.anInt2614;
+ Class70.anInt1053 = Class163_Sub1.anInt2993;
+ }
+
+ CS2Script.anInt2440 = 0;
+ } else if(2 == ObjectDefinition.anInt1521) {
+ if(-1 != Class27.anInt515) {
+ TextureOperation12.outgoingBuffer.putOpcode(179);
+ TextureOperation12.outgoingBuffer.writeShort(Texture.y1152 + Unsorted.anInt999);
+ TextureOperation12.outgoingBuffer.writeShort(Class27.anInt515 + Class131.x1716);
+ Unsorted.anInt2958 = 0;
+ Class36.anInt638 = 1;
+ Class70.anInt1053 = Class163_Sub1.anInt2993;
+ Unsorted.anInt4062 = Class38_Sub1.anInt2614;
+ }
+
+ ObjectDefinition.anInt1521 = 0;
+ } else if(-1 != Class27.anInt515 && 0 == CS2Script.anInt2440 && ObjectDefinition.anInt1521 == 0) {
+ boolean var27 = Class3_Sub28_Sub9.method582(Class102.player.yOffsets2755[0], 0, 0, true, 0, 2, Class27.anInt515, 0, 0, 0, Unsorted.anInt999, Class102.player.xOffsets2767[0]);
+ if(var27) {
+ Unsorted.anInt4062 = Class38_Sub1.anInt2614;
+ Unsorted.anInt2958 = 0;
+ Class70.anInt1053 = Class163_Sub1.anInt2993;
+ Class36.anInt638 = 1;
+ }
+ }
+
+ Class27.anInt515 = -1;
+ Class163_Sub1.method2211();
+ if(Class107.aClass11_1453 != var17) {
+ if(var17 != null) {
+ Class20.method909(var17);
+ }
+
+ if(null != Class107.aClass11_1453) {
+ Class20.method909(Class107.aClass11_1453);
+ }
+ }
+
+ if(var21 != Class20.aClass11_439 && Class75.anInt1109 == TextureOperation35.anInt3323) {
+ if(null != var21) {
+ Class20.method909(var21);
+ }
+
+ if(null != Class20.aClass11_439) {
+ Class20.method909(Class20.aClass11_439);
+ }
+ }
+
+ if(Class20.aClass11_439 == null) {
+ if(Class75.anInt1109 > 0) {
+ --Class75.anInt1109;
+ }
+ } else if(Class75.anInt1109 < TextureOperation35.anInt3323) {
+ ++Class75.anInt1109;
+ if(TextureOperation35.anInt3323 == Class75.anInt1109) {
+ Class20.method909(Class20.aClass11_439);
+ }
+ }
+
+ if(Class133.anInt1753 == 1) {
+ Unsorted.method2086();
+ } else if(Class133.anInt1753 == 2) {
+ CS2Script.method379();
+ } else {
+ InterfaceWidget.d(65535);
+ }
+
+ for(var5 = 0; var5 < 5; ++var5) {
+ ++Class163_Sub1_Sub1.anIntArray4009[var5];
+ }
+
+ var5 = Texture.method1406();
+ var6 = TextureOperation32.method301((byte)-119);
+ if(var5 > 15000 && var6 > 15000) {
+ Class159.anInt2023 = 250;
+ Class23.method940(112, 14500);
+ TextureOperation12.outgoingBuffer.putOpcode(245);
+ }
+
+ if(AudioThread.aClass64_351 != null && AudioThread.aClass64_351.anInt978 == 1) {
+ if(null != AudioThread.aClass64_351.anObject974) {
+ Class99.method1596(TextureOperation5.aString_3295, (byte)126, Unsorted.aBoolean2154);
+ }
+
+ TextureOperation5.aString_3295 = null;
+ AudioThread.aClass64_351 = null;
+ Unsorted.aBoolean2154 = false;
+ }
+
+ ++TextureOperation18.anInt4032;
+ ++Class43.anInt716;
+ ++ClientErrorException.anInt2120;
+ if(ClientErrorException.anInt2120 > 500) {
+ ClientErrorException.anInt2120 = 0;
+ nodeModelID = (int)(8.0D * Math.random());
+ if((nodeModelID & 4) == 4) {
+ LinkableRSString.anInt2589 += anInt1682;
+ }
+
+ if((nodeModelID & 2) == 2) {
+ Unsorted.anInt42 += anInt2217;
+ }
+
+ if((nodeModelID & 1) == 1) {
+ anInt3216 += Class146.anInt1901;
+ }
+ }
+
+ if(Class43.anInt716 > 500) {
+ Class43.anInt716 = 0;
+ nodeModelID = (int)(8.0D * Math.random());
+ if((1 & nodeModelID) == 1) {
+ TextureOperation9.anInt3102 += Unsorted.anInt48;
+ }
+
+ if((2 & nodeModelID) == 2) {
+ Class164_Sub2.anInt3020 += Unsorted.anInt25;
+ }
+ }
+
+ if(anInt3216 < -50) {
+ Class146.anInt1901 = 2;
+ }
+
+ if(TextureOperation9.anInt3102 < -60) {
+ Unsorted.anInt48 = 2;
+ }
+
+ if(Class164_Sub2.anInt3020 < -20) {
+ Unsorted.anInt25 = 1;
+ }
+
+ if(-55 > Unsorted.anInt42) {
+ anInt2217 = 2;
+ }
+
+ if(Unsorted.anInt42 > 55) {
+ anInt2217 = -2;
+ }
+
+ if(-40 > LinkableRSString.anInt2589) {
+ anInt1682 = 1;
+ }
+
+ if(anInt3216 > 50) {
+ Class146.anInt1901 = -2;
+ }
+
+ if(LinkableRSString.anInt2589 > 40) {
+ anInt1682 = -1;
+ }
+
+ if(10 < Class164_Sub2.anInt3020) {
+ Unsorted.anInt25 = -1;
+ }
+
+ if(60 < TextureOperation9.anInt3102) {
+ Unsorted.anInt48 = -2;
+ }
+
+ if(TextureOperation18.anInt4032 > 50) {
+ TextureOperation12.outgoingBuffer.putOpcode(93);
+ }
+
+ if(RenderAnimationDefinition.aBoolean402) {
+ Class38.method1029();
+ RenderAnimationDefinition.aBoolean402 = false;
+ }
+
+ try {
+ if(Class3_Sub15.activeConnection != null && TextureOperation12.outgoingBuffer.index > 0) {
+ Class3_Sub15.activeConnection.sendBytes(TextureOperation12.outgoingBuffer.buffer, TextureOperation12.outgoingBuffer.index);
+ TextureOperation18.anInt4032 = 0;
+ TextureOperation12.outgoingBuffer.index = 0;
+ }
+ } catch (IOException var11) {
+ breakClientConnection();
+ }
+
+ return;
+ }
+
+ var25 = var26.aClass11_2449;
+ if(var25.anInt191 >= 0) {
+ var23 = Unsorted.getRSInterface(var25.parentId);
+ if(null == var23 || var23.aClass11Array262 == null || var23.aClass11Array262.length <= var25.anInt191 || var25 != var23.aClass11Array262[var25.anInt191]) {
+ continue;
+ }
+ }
+
+ Class43.method1065(var26);
+ }
+ }
+
+ var25 = var26.aClass11_2449;
+ if(var25.anInt191 >= 0) {
+ var23 = Unsorted.getRSInterface(var25.parentId);
+ if(var23 == null || null == var23.aClass11Array262 || var23.aClass11Array262.length <= var25.anInt191 || var23.aClass11Array262[var25.anInt191] != var25) {
+ continue;
+ }
+ }
+
+ Class43.method1065(var26);
+ }
+ }
+
+ var25 = var26.aClass11_2449;
+ if(var25.anInt191 >= 0) {
+ var23 = Unsorted.getRSInterface(var25.parentId);
+ if(var23 == null || var23.aClass11Array262 == null || var25.anInt191 >= var23.aClass11Array262.length || var23.aClass11Array262[var25.anInt191] != var25) {
+ continue;
+ }
+ }
+
+ Class43.method1065(var26);
+ }
+ }
+ }
+ }
+ }
+ } catch (RuntimeException var13) {
+ throw ClientErrorException.clientError(var13, "gg.F(" + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation21.java b/Client/src/main/java/org/runite/client/TextureOperation21.java
new file mode 100644
index 000000000..5ee1f7e6e
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation21.java
@@ -0,0 +1,110 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+final class TextureOperation21 extends TextureOperation {
+
+ static int anInt3069 = 0;
+
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ anInt3069 = 67;
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)7, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[] var4 = this.method152(2, var2);
+ int[][] var5 = this.method162(var2, 0, (byte)-119);
+ int[][] var6 = this.method162(var2, 1, (byte)-107);
+ int[] var9 = var3[2];
+ int[] var8 = var3[1];
+ int[] var10 = Objects.requireNonNull(var5)[0];
+ int[] var11 = var5[1];
+ int[] var7 = var3[0];
+ int[] var13 = Objects.requireNonNull(var6)[0];
+ int[] var12 = var5[2];
+ int[] var15 = var6[2];
+ int[] var14 = var6[1];
+
+ for(int var16 = 0; var16 < Class113.anInt1559; ++var16) {
+ int var17 = var4[var16];
+ if(var17 == 4096) {
+ var7[var16] = var10[var16];
+ var8[var16] = var11[var16];
+ var9[var16] = var12[var16];
+ } else if (0 == var17) {
+ var7[var16] = var13[var16];
+ var8[var16] = var14[var16];
+ var9[var16] = var15[var16];
+ } else {
+ int var18 = -var17 + 4096;
+ var7[var16] = var18 * var13[var16] + var17 * var10[var16] >> 12;
+ var8[var16] = var18 * var14[var16] + var11[var16] * var17 >> 12;
+ var9[var16] = var15[var16] * var18 + var12[var16] * var17 >> 12;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var19) {
+ throw ClientErrorException.clientError(var19, "bl.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation21() {
+ super(3, false);
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bl.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method194(int var0, int var1, int var2, int var3, int var4, int var6, int var7) {
+ try {
+ if(var7 >= Class101.anInt1425 && Class3_Sub28_Sub18.anInt3765 >= var6 && var4 >= Class159.anInt2020 && var1 <= Class57.anInt902) {
+ TextureOperation4.method262(var3, var4, var1, var2, var0, var6, var7);
+ } else {
+ Class143.method2062(var6, var2, var1, var0, var3, var4, var7);
+ }
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "bl.B(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + 4096 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, var1);
+ int[] var6 = this.method152(1, var1);
+ int[] var7 = this.method152(2, var1);
+
+ for(int var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ int var9 = var7[var8];
+ if(4096 == var9) {
+ var3[var8] = var5[var8];
+ } else if(var9 == 0) {
+ var3[var8] = var6[var8];
+ } else {
+ var3[var8] = var9 * var5[var8] - -((-var9 + 4096) * var6[var8]) >> 12;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "bl.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation22.java b/Client/src/main/java/org/runite/client/TextureOperation22.java
new file mode 100644
index 000000000..355bc6e3f
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation22.java
@@ -0,0 +1,86 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+public final class TextureOperation22 extends TextureOperation {
+
+ static int anInt3419 = 0;
+ public static Class131 aClass131_3421;
+
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var4 = this.method152(0, var1);
+
+ for(int var5 = 0; var5 < Class113.anInt1559; ++var5) {
+ var3[var5] = 4096 - var4[var5];
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "tb.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation22() {
+ super(1, false);
+ }
+
+ static int method335(int var0) {
+ try {
+ if(var0 != 16859) {
+ aClass131_3421 = null;
+ }
+
+ return ClientCommands.shiftClickEnabled && ObjectDefinition.aBooleanArray1490[81] && 2 < Unsorted.menuOptionCount?Class114.anIntArray1578[-2 + Unsorted.menuOptionCount]:Class114.anIntArray1578[Unsorted.menuOptionCount - 1];
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "tb.C(" + var0 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(true) {
+ if(var1 == 0) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "tb.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 == -1) {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-128, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte)-51);
+ int[] var7 = Objects.requireNonNull(var4)[2];
+ int[] var5 = var4[0];
+ int[] var6 = var4[1];
+ int[] var8 = var3[0];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+
+ for(int var11 = 0; var11 < Class113.anInt1559; ++var11) {
+ var8[var11] = -var5[var11] + 4096;
+ var9[var11] = 4096 - var6[var11];
+ var10[var11] = 4096 - var7[var11];
+ }
+ }
+
+ return var3;
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "tb.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation23.java b/Client/src/main/java/org/runite/client/TextureOperation23.java
new file mode 100644
index 000000000..5a0e3643b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation23.java
@@ -0,0 +1,187 @@
+package org.runite.client;
+
+import org.rs09.client.data.HashTable;
+
+import java.util.Objects;
+
+final class TextureOperation23 extends TextureOperation {
+
+ static boolean aBoolean3207 = false;
+ static HashTable aHashTable_3208 = new HashTable<>(8);
+ static int[] anIntArray3212;
+ static int anInt1780;
+
+
+ public TextureOperation23() {
+ super(1, false);
+ }
+
+ static void method247(byte var0) {
+ try {
+ if(PositionedGraphicObject.aBoolean2713) {
+ SequenceDefinition.aClass109_1856 = null;
+ PositionedGraphicObject.aBoolean2713 = false;
+ Class40.aAbstractSprite_680 = null;
+ }
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "je.F(" + var0 + ')');
+ }
+ }
+
+ private void method248(int var1, byte var2, int var3) {
+ try {
+ if(var2 > 80) {
+ int var4 = Class102.anIntArray2125[var3];
+ int var5 = Class163_Sub3.anIntArray2999[var1];
+ float var6 = (float)Math.atan2(var4 - 2048, var5 - 2048);
+ if((double)var6 >= -3.141592653589793D && -2.356194490192345D >= (double)var6) {
+ Class50.anInt828 = var1;
+ Class159.anInt2024 = var3;
+ } else if((double)var6 <= -1.5707963267948966D && -2.356194490192345D <= (double)var6) {
+ Class159.anInt2024 = var1;
+ Class50.anInt828 = var3;
+ } else if((double)var6 <= -0.7853981633974483D && (double)var6 >= -1.5707963267948966D) {
+ Class159.anInt2024 = -var1 + Class113.anInt1559;
+ Class50.anInt828 = var3;
+ } else if(0.0F >= var6 && (double)var6 >= -0.7853981633974483D) {
+ Class159.anInt2024 = var3;
+ Class50.anInt828 = Class101.anInt1427 - var1;
+ } else if(var6 >= 0.0F && (double)var6 <= 0.7853981633974483D) {
+ Class159.anInt2024 = -var3 + Class113.anInt1559;
+ Class50.anInt828 = -var1 + Class101.anInt1427;
+ } else if((double)var6 >= 0.7853981633974483D && (double)var6 <= 1.5707963267948966D) {
+ Class159.anInt2024 = -var1 + Class113.anInt1559;
+ Class50.anInt828 = -var3 + Class101.anInt1427;
+ } else if((double)var6 >= 1.5707963267948966D && 2.356194490192345D >= (double)var6) {
+ Class50.anInt828 = -var3 + Class101.anInt1427;
+ Class159.anInt2024 = var1;
+ } else if(2.356194490192345D <= (double)var6 && (double)var6 <= 3.141592653589793D) {
+ Class159.anInt2024 = -var3 + Class113.anInt1559;
+ Class50.anInt828 = var1;
+ }
+
+ Class159.anInt2024 &= RenderAnimationDefinition.anInt396;
+ Class50.anInt828 &= Class3_Sub20.anInt2487;
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "je.Q(" + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ if(!true) {
+ GroundItemLink.worldmapIndex_3210 = null;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "je.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method250(CacheIndex var1) {
+ try {
+ Class8.configurationReferenceCache = var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "je.C(" + 2048 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ static int method251() {
+ try {
+ if(Class119.aClass131_1624 == null) {
+ return -1;
+ } else {
+ while(Class119.aClass131_1624.anInt1720 > anInt1780) {
+ if(Class119.aClass131_1624.method1794(anInt1780, -20138)) {
+ return anInt1780++;
+ }
+
+ ++anInt1780;
+ }
+
+ return -1;
+ }
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "je.B(" + -1 + ')');
+ }
+ }
+
+ static void method252() {
+ try {
+ Class3_Sub9 var1;
+ for(var1 = (Class3_Sub9) Unsorted.aLinkedList_78.startIteration(); null != var1; var1 = (Class3_Sub9) Unsorted.aLinkedList_78.nextIteration()) {
+ if(var1.aBoolean2329) {
+ var1.method134();
+ }
+ }
+
+ for(var1 = (Class3_Sub9) Unsorted.aLinkedList_1242.startIteration(); null != var1; var1 = (Class3_Sub9) Unsorted.aLinkedList_1242.nextIteration()) {
+ if(var1.aBoolean2329) {
+ var1.method134();
+ }
+ }
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "je.S(" + 8 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ for(int var5 = 0; var5 < Class113.anInt1559; ++var5) {
+ this.method248(var1, (byte)105, var5);
+ int[] var6 = this.method152(0, Class50.anInt828);
+ var4[var5] = var6[Class159.anInt2024];
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "je.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method253(int var1, int var2, int var3, int var4) {
+ try {
+
+ Class3_Sub28_Sub1.anInt3536 = Class23.anInt455 * var3 / var1;
+ Scenery.anInt2251 = Class108.anInt1460 * var2 / var4;
+ Texture.anInt1150 = -1;
+ TextureOperation13.anInt3362 = -1;
+ Class3_Sub5.method117();
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "je.E(" + -22611 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-125, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[] var4 = var3[0];
+ int[] var6 = var3[2];
+ int[] var5 = var3[1];
+
+ for(int var7 = 0; Class113.anInt1559 > var7; ++var7) {
+ this.method248(var2, (byte)107, var7);
+ int[][] var8 = this.method162(Class50.anInt828, 0, (byte)-49);
+ var4[var7] = Objects.requireNonNull(var8)[0][Class159.anInt2024];
+ var5[var7] = var8[1][Class159.anInt2024];
+ var6[var7] = var8[2][Class159.anInt2024];
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "je.T(" + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation24.java b/Client/src/main/java/org/runite/client/TextureOperation24.java
new file mode 100644
index 000000000..eccc5e42b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation24.java
@@ -0,0 +1,109 @@
+package org.runite.client;
+
+import org.rs09.client.rendering.Toolkit;
+
+import java.util.Objects;
+import java.util.zip.CRC32;
+
+final class TextureOperation24 extends TextureOperation {
+
+ static CRC32 CRC32 = new CRC32();
+ static int anInt3377 = 7759444;//Very light Brown 7759444 // #766654
+ static int anInt2243 = 3353893;//Dark Brown 2 3353893 // #332D25
+ static int anInt2530 = 2301979;//Dark Brown 2301979 // #34301B
+ static int anInt486 = 5063219;//Light Brown 5063219 // #4d4233
+
+
+ static void method223(int var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ try {
+ if (var7 == var4) {
+ Unsorted.method1460(var1, var3, var6, var7, var2, var5);
+ } else {
+
+ if (Class101.anInt1425 <= var2 - var7 && var7 + var2 <= Class3_Sub28_Sub18.anInt3765 && var3 - var4 >= Class159.anInt2020 && Class57.anInt902 >= var3 + var4) {
+ Class161.method2200(var6, var2, var3, var5, var7, 95, var4, var1);
+ } else {
+ TextureOperation25.method329(var7, var6, var5, var1, var3, var2, var4);
+ }
+
+ }
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "fn.C(" + true + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ public TextureOperation24() {
+ super(1, true);
+ }
+
+ static void method224(int var1, int var2, int var3, int var4, int var5) {
+ try {
+ GameObject.aClass109Array1831[0].method1667(var3, var4);
+ GameObject.aClass109Array1831[1].method1667(var3, -16 + var5 + var4);
+ int var6 = var5 * (var5 + -32) / var2;
+ if (var6 < 8) {
+ var6 = 8;
+ }
+ int var7 = var1 * (-var6 + -32 + var5) / (var2 + -var5);
+ Toolkit.getActiveToolkit().method934(var3, 16 + var4, 16, -32 + var5, anInt2530);
+ Toolkit.getActiveToolkit().method934(var3, 16 + var4 + var7, 16, var6, anInt486);
+ Toolkit.getActiveToolkit().drawVerticalLine(var3, var7 + (var4 + 16), var6, anInt3377);
+ Toolkit.getActiveToolkit().drawVerticalLine(var3 + 1, var7 + 16 + var4, var6, anInt3377);
+ Toolkit.getActiveToolkit().drawHorizontalLine(var3, var7 + 16 + var4, 16, anInt3377);
+ Toolkit.getActiveToolkit().drawHorizontalLine(var3, var7 + var4 + 17, 16, anInt3377);
+ Toolkit.getActiveToolkit().drawVerticalLine(15 + var3, var4 + (16 + var7), var6, anInt2243);
+ Toolkit.getActiveToolkit().drawVerticalLine(14 + var3, 17 + (var4 + var7), -1 + var6, anInt2243);
+ Toolkit.getActiveToolkit().drawHorizontalLine(var3, var6 + 15 + var4 + var7, 16, anInt2243);
+ Toolkit.getActiveToolkit().drawHorizontalLine(1 + var3, var6 + var4 + (14 + var7), 15, anInt2243);
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "fn.E(" + (byte) 120 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ static void method226(int var0) {
+ try {
+ if (var0 != -1) {
+ if (Unsorted.loadInterface(var0)) {
+ RSInterface[] var2 = GameObject.interfaces1834[var0];
+
+ for (int var3 = 0; var3 < var2.length; ++var3) {
+ RSInterface var4 = var2[var3];
+ if (null != var4.interfaceScript159) {
+ CS2Script var5 = new CS2Script();
+ System.out.printf("Interface (%d, %d) running script %d\n", var4.componentHash >> 16, var4.componentHash & 0xffff, var4.interfaceScript159[0]);
+ var5.arguments = var4.interfaceScript159;
+ var5.aClass11_2449 = var4;
+ DumpingTools.RunOnceAfterStartup();
+ CS2Script.runAssembledScript(2000000, var5);
+ }
+ }
+
+ }
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "fn.F(" + var0 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var10 = this.aClass114_2382.method1709(var1);
+ if (this.aClass114_2382.aBoolean1580) {
+ int[][] var4 = this.method162(var1, 0, (byte) -126);
+ int[] var5 = Objects.requireNonNull(var4)[0];
+ int[] var7 = var4[2];
+ int[] var6 = var4[1];
+
+ for (int var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var10[var8] = (var7[var8] + var5[var8] + var6[var8]) / 3;
+ }
+ }
+
+ return var10;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "fn.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation25.java b/Client/src/main/java/org/runite/client/TextureOperation25.java
new file mode 100644
index 000000000..087413f4d
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation25.java
@@ -0,0 +1,340 @@
+package org.runite.client;
+
+import org.rs09.client.data.ReferenceCache;
+
+import java.util.Objects;
+
+public final class TextureOperation25 extends TextureOperation {
+
+ private final int[] anIntArray3403 = new int[3];
+ private int anInt3404 = 409;
+ private int anInt3405 = 4096;
+ private int anInt3406 = 4096;
+ private int anInt3410 = 4096;
+ static long aLong3411 = 0L;
+ static ReferenceCache aReferenceCache_3412 = new ReferenceCache(64);
+ static int anInt3413 = 0;
+ static int anInt3414;
+ static boolean aBoolean3416 = false;
+ static int anInt3417;
+
+
+ static void method329(int var0, int var1, int var2, int var3, int var5, int var6, int var7) {
+ try {
+ int var8 = 0;
+ int var11 = -var3 + var0;
+ int var10 = 0;
+ int var9 = var7;
+ int var14 = var7 * var7;
+ int var12 = -var3 + var7;
+ int var13 = var0 * var0;
+ int var17 = var14 << 1;
+ int var16 = var12 * var12;
+ int var15 = var11 * var11;
+ int var18 = var13 << 1;
+ int var19 = var16 << 1;
+ int var20 = var15 << 1;
+ int var22 = var12 << 1;
+ int var21 = var7 << 1;
+ int var23 = var17 + var13 * (1 + -var21);
+ int var24 = var14 + -((var21 + -1) * var18);
+ int var25 = var19 + var15 * (1 + -var22);
+ int var26 = var16 - var20 * (var22 + -1);
+ int var28 = var14 << 2;
+ int var27 = var13 << 2;
+ int var30 = var16 << 2;
+ int var31 = var17 * 3;
+ int var32 = (var21 + -3) * var18;
+ int var29 = var15 << 2;
+ int var33 = var19 * 3;
+ int var35 = (-3 + var22) * var20;
+ int var37 = (-1 + var7) * var27;
+ int var38 = var30;
+ int var36 = var28;
+ int var39 = (-1 + var12) * var29;
+ int var42;
+ int var43;
+ int var41;
+ int var44;
+ if (var5 >= Class159.anInt2020 && Class57.anInt902 >= var5) {
+ int[] var40 = Class38.anIntArrayArray663[var5];
+ var41 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - var0, Class101.anInt1425);
+ var42 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - -var0, Class101.anInt1425);
+ var43 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 + -var11, Class101.anInt1425);
+ var44 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - -var11, Class101.anInt1425);
+ TextureOperation18.method282(var40, var41, 127, var43, var2);
+ TextureOperation18.method282(var40, var43, 105, var44, var1);
+ TextureOperation18.method282(var40, var44, -67, var42, var2);
+ }
+
+ while (var9 > 0) {
+ if (var23 < 0) {
+ while (var23 < 0) {
+ var23 += var31;
+ var31 += var28;
+ ++var8;
+ var24 += var36;
+ var36 += var28;
+ }
+ }
+
+ boolean var49 = (var12 >= var9);
+ if (0 > var24) {
+ var24 += var36;
+ var23 += var31;
+ ++var8;
+ var36 += var28;
+ var31 += var28;
+ }
+
+ if (var49) {
+ while (var25 < 0) {
+ ++var10;
+ var26 += var38;
+ var38 += var30;
+ var25 += var33;
+ var33 += var30;
+ }
+ if (var26 < 0) {
+ ++var10;
+ var26 += var38;
+ var25 += var33;
+ var38 += var30;
+ var33 += var30;
+ }
+
+ var25 += -var39;
+ var39 -= var29;
+ var26 += -var35;
+ var35 -= var29;
+ }
+
+ var24 += -var32;
+ var23 += -var37;
+ var37 -= var27;
+ var32 -= var27;
+ --var9;
+ var42 = var5 - -var9;
+ var41 = -var9 + var5;
+ if (Class159.anInt2020 <= var42 && Class57.anInt902 >= var41) {
+ var43 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 + var8, Class101.anInt1425);
+ var44 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var8 + var6, Class101.anInt1425);
+ if (var49) {
+ int var45 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 + var10, Class101.anInt1425);
+ int var46 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - var10, Class101.anInt1425);
+ int[] var47;
+ if (Class159.anInt2020 <= var41) {
+ var47 = Class38.anIntArrayArray663[var41];
+ TextureOperation18.method282(var47, var44, 120, var46, var2);
+ TextureOperation18.method282(var47, var46, -107, var45, var1);
+ TextureOperation18.method282(var47, var45, -102, var43, var2);
+ }
+
+ if (Class57.anInt902 >= var42) {
+ var47 = Class38.anIntArrayArray663[var42];
+ TextureOperation18.method282(var47, var44, 87, var46, var2);
+ TextureOperation18.method282(var47, var46, -92, var45, var1);
+ TextureOperation18.method282(var47, var45, 124, var43, var2);
+ }
+ } else {
+ if (var41 >= Class159.anInt2020) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var41], var44, -122, var43, var2);
+ }
+
+ if (Class57.anInt902 >= var42) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var42], var44, 89, var43, var2);
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var48) {
+ throw ClientErrorException.clientError(var48, "sk.Q(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + (byte) -54 + ',' + var5 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if (true) {
+ if (var1 == 0) {
+ this.anInt3404 = var2.readUnsignedShort();
+ } else if (1 == var1) {
+ this.anInt3405 = var2.readUnsignedShort();
+ } else if (var1 == 2) {
+ this.anInt3406 = var2.readUnsignedShort();
+ } else if (var1 == 3) {
+ this.anInt3410 = var2.readUnsignedShort();
+ } else if (4 == var1) {
+ int var4 = var2.readMedium();
+ this.anIntArray3403[2] = Unsorted.bitwiseAnd(var4, 255) >> 12;
+ this.anIntArray3403[1] = Unsorted.bitwiseAnd(var4 >> 4, 4080);
+ this.anIntArray3403[0] = Unsorted.bitwiseAnd(16711680, var4) << 4;
+ }
+
+ }
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "sk.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + ')');
+ }
+ }
+
+ static void method330(int var0, int var1, int var2, int var3, int var4, int var5) {
+ try {
+ if (var1 > -83) {
+ Unsorted.menuOptionCount = 115;
+ }
+
+ int var6 = -var3 + var5;
+ int var7 = var2 - var4;
+ if (var6 == 0) {
+ if (0 != var7) {
+ Class3_Sub8.method126(false, var2, var4, var0, var3);
+ }
+
+ } else if (var7 == 0) {
+ Class75_Sub4.method1354(var3, var0, var5, var4);
+ } else {
+ int var12 = (var7 << 12) / var6;
+ int var13 = -(var12 * var3 >> 12) + var4;
+ int var8;
+ int var10;
+ if (var3 < Class101.anInt1425) {
+ var8 = Class101.anInt1425;
+ var10 = (Class101.anInt1425 * var12 >> 12) + var13;
+ } else if (var3 > Class3_Sub28_Sub18.anInt3765) {
+ var10 = (Class3_Sub28_Sub18.anInt3765 * var12 >> 12) + var13;
+ var8 = Class3_Sub28_Sub18.anInt3765;
+ } else {
+ var8 = var3;
+ var10 = var4;
+ }
+
+ int var9;
+ int var11;
+ if (Class101.anInt1425 <= var5) {
+ if (Class3_Sub28_Sub18.anInt3765 < var5) {
+ var9 = Class3_Sub28_Sub18.anInt3765;
+ var11 = var13 - -(var12 * Class3_Sub28_Sub18.anInt3765 >> 12);
+ } else {
+ var11 = var2;
+ var9 = var5;
+ }
+ } else {
+ var9 = Class101.anInt1425;
+ var11 = var13 + (var12 * Class101.anInt1425 >> 12);
+ }
+
+ if (var11 >= Class159.anInt2020) {
+ if (Class57.anInt902 < var11) {
+ var11 = Class57.anInt902;
+ var9 = (Class57.anInt902 - var13 << 12) / var12;
+ }
+ } else {
+ var9 = (Class159.anInt2020 - var13 << 12) / var12;
+ var11 = Class159.anInt2020;
+ }
+
+ if (Class159.anInt2020 > var10) {
+ var10 = Class159.anInt2020;
+ var8 = (Class159.anInt2020 + -var13 << 12) / var12;
+ } else if (Class57.anInt902 < var10) {
+ var10 = Class57.anInt902;
+ var8 = (-var13 + Class57.anInt902 << 12) / var12;
+ }
+
+ GameObject.method1869((byte) 6, var0, var11, var10, var9, var8);
+ }
+ } catch (RuntimeException var14) {
+ throw ClientErrorException.clientError(var14, "sk.E(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ public TextureOperation25() {
+ super(1, false);
+ }
+
+ static int method332(int var0, int var1) {
+ try {
+ if (var0 != 2) {
+ anInt3414 = -40;
+ }
+
+ if ((var1 < 65 || var1 > 90) && (var1 < 192 || var1 > 222 || var1 == 215)) {
+ if (var1 != 159) return var1 != 140 ? var1 : 156;
+ return 255;
+ }
+ return 32 + var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "sk.C(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ static boolean method334(CacheIndex var0) {
+ try {
+ return var0.retrieveSpriteFile(NPC.anInt4001);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "sk.R(" + (var0 != null ? "{...}" : "null") + ',' + 0 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte) 91, var2);
+ if (this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte) -96);
+ int[] var5 = Objects.requireNonNull(var4)[0];
+ int[] var6 = var4[1];
+ int[] var7 = var4[2];
+ int[] var8 = var3[0];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+
+ for (int var11 = 0; var11 < Class113.anInt1559; ++var11) {
+ int var13 = var5[var11];
+ int var12 = -this.anIntArray3403[0] + var13;
+ if (var12 < 0) {
+ var12 = -var12;
+ }
+
+ if (this.anInt3404 < var12) {
+ var8[var11] = var13;
+ var9[var11] = var6[var11];
+ var10[var11] = var7[var11];
+ } else {
+ int var14 = var6[var11];
+ var12 = var14 + -this.anIntArray3403[1];
+ if (var12 < 0) {
+ var12 = -var12;
+ }
+
+ if (var12 > this.anInt3404) {
+ var8[var11] = var13;
+ var9[var11] = var14;
+ var10[var11] = var7[var11];
+ } else {
+ int var15 = var7[var11];
+ var12 = -this.anIntArray3403[2] + var15;
+ if (var12 < 0) {
+ var12 = -var12;
+ }
+
+ if (this.anInt3404 >= var12) {
+ var8[var11] = this.anInt3410 * var13 >> 12;
+ var9[var11] = this.anInt3406 * var14 >> 12;
+ var10[var11] = this.anInt3405 * var15 >> 12;
+ } else {
+ var8[var11] = var13;
+ var9[var11] = var14;
+ var10[var11] = var15;
+ }
+ }
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var16) {
+ throw ClientErrorException.clientError(var16, "sk.T(" + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation26.java b/Client/src/main/java/org/runite/client/TextureOperation26.java
new file mode 100644
index 000000000..f7f15115e
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation26.java
@@ -0,0 +1,195 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+final class TextureOperation26 extends TextureOperation {
+
+ private int anInt3073 = 0;
+ private int anInt3074 = 4096;
+ static boolean aBoolean3078;
+ static int anInt3081 = 0;
+
+
+ static void method195() {
+ try {
+ int regionX = (NPC.anInt3995 >> 10) - -(Class131.x1716 >> 3);
+ int regionY = (Class77.anInt1111 >> 10) - -(Texture.y1152 >> 3);
+ byte plane = 0;
+ byte sceneX = 8;
+ byte var6 = 18;
+ Class3_Sub22.aByteArrayArray2521 = new byte[var6][];
+ Class3_Sub28_Sub5.anIntArray3587 = new int[var6];
+ TextureOperation35.aByteArrayArray3335 = new byte[var6][];
+ Client.anIntArray2200 = new int[var6];
+ Class39.regionXteaKeys = new int[var6][4];
+ Class40.aByteArrayArray3669 = new byte[var6][];
+ Class3_Sub24_Sub3.regionIds = new int[var6];
+ Class164_Sub2.aByteArrayArray3027 = new byte[var6][];
+ NPC.npcSpawnCacheIndices = new int[var6];
+ TextureOperation17.anIntArray3181 = new int[var6];
+ Class101.anIntArray1426 = new int[var6];
+ byte sceneY = 8;
+ Class40.aByteArrayArray3057 = new byte[var6][];
+ int var11 = 0;
+
+ int var7;
+ for(var7 = (-6 + regionX) / 8; (6 + regionX) / 8 >= var7; ++var7) {
+ for(int var8 = (-6 + regionY) / 8; var8 <= (regionY + 6) / 8; ++var8) {
+ int var9 = (var7 << 8) - -var8;
+ Class3_Sub24_Sub3.regionIds[var11] = var9;
+
+ /**
+ * This block is used to control what is displayed on the HD login screen fly over
+ * 1. Gets the archives for the map
+ * 2. Gets the archives for the landscape
+ * 3. Gets the archives for the NPC spawns
+ * 4. Gets the archives for the map underlays (this would be like water for example
+ * 5. Gets the archives for the landscape underlays (things that (appear to be/are) -1 on the plane)
+ */
+ Client.anIntArray2200[var11] = CacheIndex.landscapesIndex.getArchiveForName(RSString.stringCombiner(new RSString[]{RSString.parse("m"), RSString.stringAnimator(var7), RSString.parse("_"), RSString.stringAnimator(var8)}));
+ if (GameConfig.HD_LOGIN_DEBUG) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting archive for map: " + Client.anIntArray2200[var11]);
+ if (GameConfig.HD_LOGIN_VERBOSE) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting specific info for map: " + "Type: " + RSString.parse("m") + " Place in cache: " + RSString.stringAnimator(var7) + RSString.parse("_") + RSString.stringAnimator(var8));
+ }
+ }
+
+
+
+ Class101.anIntArray1426[var11] = CacheIndex.landscapesIndex.getArchiveForName(RSString.stringCombiner(new RSString[]{RSString.parse("l"), RSString.stringAnimator(var7), RSString.parse("_"), RSString.stringAnimator(var8)}));
+ if (GameConfig.HD_LOGIN_DEBUG) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting archive for landscape: " + Class101.anIntArray1426[var11]);
+ if (GameConfig.HD_LOGIN_VERBOSE) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting specific info for landscape: " + "Type: " + RSString.parse("l") + " Place in cache: " + RSString.stringAnimator(var7) + RSString.parse("_") + RSString.stringAnimator(var8));
+ }
+ }
+
+
+ NPC.npcSpawnCacheIndices[var11] = CacheIndex.landscapesIndex.getArchiveForName(RSString.stringCombiner(new RSString[]{RSString.parse("n"), RSString.stringAnimator(var7), RSString.parse("_"), RSString.stringAnimator(var8)}));
+ if (GameConfig.HD_LOGIN_DEBUG) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting archive for packed NPCs: " + NPC.npcSpawnCacheIndices[var11]);
+ if (GameConfig.HD_LOGIN_VERBOSE) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting specific info for packed NPCs: " + "Type: " + RSString.parse("n") + " Place in cache: " + RSString.stringAnimator(var7) + RSString.parse("_") + RSString.stringAnimator(var8));
+ }
+ }
+
+
+ TextureOperation17.anIntArray3181[var11] = CacheIndex.landscapesIndex.getArchiveForName(RSString.stringCombiner(new RSString[]{RSString.parse("um"), RSString.stringAnimator(var7), RSString.parse("_"), RSString.stringAnimator(var8)}));
+ if (GameConfig.HD_LOGIN_DEBUG) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting archive for map underlays: " + TextureOperation17.anIntArray3181[var11]);
+ if (GameConfig.HD_LOGIN_VERBOSE) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting specific info for map underlays: " + "Type: " + RSString.parse("um") + " Place in cache: " + RSString.stringAnimator(var7) + RSString.parse("_") + RSString.stringAnimator(var8));
+ }
+ }
+
+
+ Class3_Sub28_Sub5.anIntArray3587[var11] = CacheIndex.landscapesIndex.getArchiveForName(RSString.stringCombiner(new RSString[]{RSString.parse("ul"), RSString.stringAnimator(var7), RSString.parse("_"), RSString.stringAnimator(var8)}));
+ if (GameConfig.HD_LOGIN_DEBUG) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting archive for landscape underlays: " + Class3_Sub28_Sub5.anIntArray3587[var11]);
+ if (GameConfig.HD_LOGIN_VERBOSE) {
+ System.out.println("Class3_Sub13_sub6: HD Login Screen Debug: Getting specific info for landscape underlays: " + "Type: " + RSString.parse("ul") + " Place in cache: " + RSString.stringAnimator(var7) + RSString.parse("_") + RSString.stringAnimator(var8));
+ }
+ }
+ /* End login screen index lookup */
+
+
+ if(NPC.npcSpawnCacheIndices[var11] == -1) {
+ Client.anIntArray2200[var11] = -1;
+ Class101.anIntArray1426[var11] = -1;
+ TextureOperation17.anIntArray3181[var11] = -1;
+ Class3_Sub28_Sub5.anIntArray3587[var11] = -1;
+ }
+
+ ++var11;
+ }
+ }
+
+ for(var7 = var11; NPC.npcSpawnCacheIndices.length > var7; ++var7) {
+ NPC.npcSpawnCacheIndices[var7] = -1;
+ Client.anIntArray2200[var7] = -1;
+ Class101.anIntArray1426[var7] = -1;
+ TextureOperation17.anIntArray3181[var7] = -1;
+ Class3_Sub28_Sub5.anIntArray3587[var7] = -1;
+ }
+
+ Unsorted.method1301(plane, regionY, regionX, sceneY, true, sceneX);
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "ca.F(" + 20479 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, var1);
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var7 = var5[var6];
+ var4[var6] = var7 >= this.anInt3073 && this.anInt3074 >= var7 ?4096:0;
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ca.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method196() {
+ try {
+ AudioHandler.soundEffectCoordinates = null;
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ca.B(" + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ method196();
+ }
+
+ if(var1 == 0) {
+ this.anInt3073 = var2.readUnsignedShort();
+ } else if (1 == var1) {
+ this.anInt3074 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ca.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public TextureOperation26() {
+ super(1, true);
+ }
+
+ static void method198(boolean var0) {
+ try {
+
+ int var3 = Class164_Sub2.aByteArrayArray3027.length;
+ byte[][] var2;
+ if(HDToolKit.highDetail && var0) {
+ var2 = Class40.aByteArrayArray3057;
+ } else {
+ var2 = Class3_Sub22.aByteArrayArray2521;
+ }
+
+ for(int var4 = 0; var4 < var3; ++var4) {
+ byte[] var5 = var2[var4];
+ if(var5 != null) {
+ int var6 = -Class131.x1716 + 64 * (Class3_Sub24_Sub3.regionIds[var4] >> 8);
+ int var7 = (Class3_Sub24_Sub3.regionIds[var4] & 0xFF) * 64 + -Texture.y1152;
+ Class58.method1194();
+ Class3_Sub15.method374(var6, var0, var5, var7, AtmosphereParser.aClass91Array1182);
+ }
+ }
+
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ca.E(" + var0 + ',' + -32624 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation27.java b/Client/src/main/java/org/runite/client/TextureOperation27.java
new file mode 100644
index 000000000..961392ef7
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation27.java
@@ -0,0 +1,132 @@
+package org.runite.client;
+
+import org.rs09.client.util.ArrayUtils;
+
+final class TextureOperation27 extends TextureOperation {
+
+ private int anInt3085 = 10;
+ private int anInt3086 = 0;
+ static RSInterface aClass11_3087 = null;
+ private int[] anIntArray3089;
+ private int[] anIntArray3091;
+ private int anInt3093 = 2048;
+ static short[] aShortArray3095 = new short[500];
+ static CacheIndex configurationsIndex_3098;
+
+
+ final void postDecode() {
+ try {
+ this.method202();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "d.P(" + ')');
+ }
+ }
+
+ static int method201(int var0, int var1) {
+ try {
+ int var3 = var1 + -1 & var0 >> 31;
+ return var3 + (var0 + (var0 >>> 31)) % var1;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "d.C(" + var0 + ',' + var1 + ',' + -58 + ')');
+ }
+ }
+
+ private void method202() {
+ try {
+ int var2 = 0;
+ this.anIntArray3091 = new int[this.anInt3085 + 1];
+ int var3 = 4096 / this.anInt3085;
+ this.anIntArray3089 = new int[this.anInt3085 + 1];
+ int var4 = this.anInt3093 * var3 >> 12;
+
+ for(int var5 = 0; this.anInt3085 > var5; ++var5) {
+ this.anIntArray3089[var5] = var2;
+ this.anIntArray3091[var5] = var2 + var4;
+ var2 += var3;
+ }
+
+ this.anIntArray3089[this.anInt3085] = 4096;
+ this.anIntArray3091[this.anInt3085] = this.anIntArray3091[0] + 4096;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "d.B(" + 1 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3085 = var2.readUnsignedByte();
+ } else if(var1 == 1) {
+ this.anInt3093 = var2.readUnsignedShort();
+ } else if (var1 == 2) {
+ this.anInt3086 = var2.readUnsignedByte();
+ }
+
+ if(!true) {
+ this.anIntArray3089 = null;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "d.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public TextureOperation27() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = Class163_Sub3.anIntArray2999[var1];
+ int var7;
+ if(0 == this.anInt3086) {
+ short var6 = 0;
+
+ for(var7 = 0; this.anInt3085 > var7; ++var7) {
+ if(var5 >= this.anIntArray3089[var7] && this.anIntArray3089[var7 - -1] > var5) {
+ if(var5 < this.anIntArray3091[var7]) {
+ var6 = 4096;
+ }
+ break;
+ }
+ }
+
+ ArrayUtils.fill(var3, 0, Class113.anInt1559, var6);
+ } else {
+ for(int var12 = 0; Class113.anInt1559 > var12; ++var12) {
+ int var9 = Class102.anIntArray2125[var12];
+ var7 = 0;
+ int var10 = this.anInt3086;
+ if(var10 == 1) {
+ var7 = var9;
+ } else if(var10 == 2) {
+ var7 = (var9 + var5 + -4096 >> 1) + 2048;
+ } else if (var10 == 3) {
+ var7 = (-var5 + var9 >> 1) + 2048;
+ }
+
+ short var8 = 0;
+
+ for(var10 = 0; var10 < this.anInt3085; ++var10) {
+ if(var7 >= this.anIntArray3089[var10] && this.anIntArray3089[var10 - -1] > var7) {
+ if(this.anIntArray3091[var10] > var7) {
+ var8 = 4096;
+ }
+ break;
+ }
+ }
+
+ var3[var12] = var8;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "d.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation28.java b/Client/src/main/java/org/runite/client/TextureOperation28.java
new file mode 100644
index 000000000..efeb70c95
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation28.java
@@ -0,0 +1,367 @@
+package org.runite.client;
+import org.rs09.client.util.ArrayUtils;
+
+import java.util.Objects;
+import java.util.Random;
+
+final class TextureOperation28 extends TextureOperation {
+
+ private int anInt3299 = 1024;
+ private int anInt3300 = 1024;
+ private int anInt3301 = 819;
+ private int anInt3303 = 1024;
+ private int anInt3308 = 2048;
+ private int anInt3309 = 0;
+ private int anInt3310 = 409;
+ private int anInt3312 = 0;
+ static int anInt3313 = 500;
+ private int anInt3314;
+ static int anInt3315;
+ private int anInt3316 = 1024;
+
+
+ final void postDecode() {
+ try {
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ol.P(" + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[][] var5 = this.aClass114_2382.method1710((byte)97);
+ int var9 = 0;
+ int var8 = 0;
+ int var6 = 0;
+ int var7 = 0;
+ int var10 = 0;
+ boolean var11 = true;
+ boolean var12 = true;
+ int var13 = 0;
+ int var14 = 0;
+ int var15 = Class113.anInt1559 * this.anInt3300 >> 12;
+ int var16 = Class113.anInt1559 * this.anInt3308 >> 12;
+ int var18 = this.anInt3301 * Class101.anInt1427 >> 12;
+ int var17 = Class101.anInt1427 * this.anInt3310 >> 12;
+ if(var18 <= 1) {
+ return Objects.requireNonNull(var5)[var1];
+ } else {
+ int var19 = Class113.anInt1559 / var15 + 1;
+ this.anInt3314 = Class113.anInt1559 / 8 * this.anInt3303 >> 12;
+ int[][] var21 = new int[var19][3];
+ int[][] var20 = new int[var19][3];
+ Random var22 = new Random(this.anInt3312);
+
+ while(true) {
+ while(true) {
+ int var24 = var15 - -TextureOperation.method1603((byte)-93, var16 - var15, var22);
+ int var25 = TextureOperation.method1603((byte)-96, -var17 + var18, var22) + var17;
+ int var26 = var9 + var24;
+ if(Class113.anInt1559 < var26) {
+ var26 = Class113.anInt1559;
+ var24 = Class113.anInt1559 - var9;
+ }
+
+ int var23;
+ int var29;
+ if(var12) {
+ var23 = 0;
+ } else {
+ int var27 = var10;
+ int[] var28 = var21[var10];
+ var23 = var28[2];
+ var29 = 0;
+ int var30 = var6 + var26;
+ if(0 > var30) {
+ var30 += Class113.anInt1559;
+ }
+
+ if(var30 > Class113.anInt1559) {
+ var30 -= Class113.anInt1559;
+ }
+
+ while(true) {
+ int[] var31 = var21[var27];
+ if(var31[0] <= var30 && var30 <= var31[1]) {
+ if(var10 != var27) {
+ int var42 = var6 + var9;
+ if(var42 < 0) {
+ var42 += Class113.anInt1559;
+ }
+
+ if(var42 > Class113.anInt1559) {
+ var42 -= Class113.anInt1559;
+ }
+
+ int var32;
+ int[] var33;
+ for(var32 = 1; var32 <= var29; ++var32) {
+ var33 = var21[(var10 + var32) % var13];
+ var23 = Math.max(var23, var33[2]);
+ }
+
+ for(var32 = 0; var32 <= var29; ++var32) {
+ var33 = var21[(var10 - -var32) % var13];
+ int var34 = var33[2];
+ if(var23 != var34) {
+ int var37 = var33[0];
+ int var38 = var33[1];
+ int var35;
+ int var36;
+ if(var42 < var30) {
+ var35 = Math.max(var42, var37);
+ var36 = Math.min(var30, var38);
+ } else if(var37 == 0) {
+ var36 = Math.min(var30, var38);
+ var35 = 0;
+ } else {
+ var35 = Math.max(var42, var37);
+ var36 = Class113.anInt1559;
+ }
+
+ this.method291(var34, var22, var8 + var35, -var35 + var36, -var34 + var23, var5);
+ }
+ }
+ }
+
+ var10 = var27;
+ break;
+ }
+
+ ++var29;
+ ++var27;
+ if(var13 <= var27) {
+ var27 = 0;
+ }
+ }
+ }
+
+ if(Class101.anInt1427 >= var23 - -var25) {
+ var11 = false;
+ } else {
+ var25 = Class101.anInt1427 - var23;
+ }
+
+ int[] var40;
+ if(Class113.anInt1559 == var26) {
+ this.method291(var23, var22, var7 + var9, var24, var25, var5);
+ if(var11) {
+ return var3;
+ }
+
+ var11 = true;
+ var8 = var7;
+ var12 = false;
+ var40 = var20[var14++];
+ var40[0] = var9;
+ var10 = 0;
+ var13 = var14;
+ var14 = 0;
+ var40[2] = var25 + var23;
+ var40[1] = var26;
+ var7 = TextureOperation.method1603((byte)-107, Class113.anInt1559, var22);
+ var6 = var7 + -var8;
+ int[][] var41 = var21;
+ var9 = 0;
+ var21 = var20;
+ var29 = var6;
+ if(var6 < 0) {
+ var29 = var6 + Class113.anInt1559;
+ }
+
+ var20 = var41;
+ if(var29 > Class113.anInt1559) {
+ var29 -= Class113.anInt1559;
+ }
+
+ while(true) {
+ int[] var43 = var21[var10];
+ if(var43[0] <= var29 && var29 <= var43[1]) {
+ break;
+ }
+
+ ++var10;
+ if(var13 <= var10) {
+ var10 = 0;
+ }
+ }
+ } else {
+ var40 = var20[var14++];
+ var40[1] = var26;
+ var40[2] = var25 + var23;
+ var40[0] = var9;
+ this.method291(var23, var22, var9 + var7, var24, var25, var5);
+ var9 = var26;
+ }
+ }
+ }
+ }
+ } else {
+ return var3;
+ }
+ } catch (RuntimeException var39) {
+ throw ClientErrorException.clientError(var39, "ol.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation28() {
+ super(0, true);
+ }
+
+ private void method291(int var1, Random var2, int var3, int var4, int var6, int[][] var7) {
+ try {
+ int var8 = this.anInt3316 > 0 ?4096 + -TextureOperation.method1603((byte)-128, this.anInt3316, var2):4096;
+ int var9 = this.anInt3299 * this.anInt3314 >> 12;
+ int var10 = this.anInt3314 - (0 < var9? TextureOperation.method1603((byte)39, var9, var2):0);
+ if(Class113.anInt1559 <= var3) {
+ var3 -= Class113.anInt1559;
+ }
+
+ int var11;
+ int var12;
+ if(0 < var10) {
+ if(0 >= var6 || var4 <= 0) {
+ return;
+ }
+
+ var11 = var4 / 2;
+ var12 = var6 / 2;
+ int var13 = var11 < var10?var11:var10;
+ int var14 = var10 <= var12 ?var10:var12;
+ int var16 = var4 + -(2 * var13);
+ int var15 = var13 + var3;
+
+ for(int var17 = 0; var17 < var6; ++var17) {
+ int[] var18 = var7[var1 + var17];
+ int var19;
+ int var21;
+ int var20;
+ if(var14 > var17) {
+ var19 = var17 * var8 / var14;
+ if(this.anInt3309 == 0) {
+ for(var20 = 0; var20 < var13; ++var20) {
+ var21 = var20 * var8 / var13;
+ var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, var20 + var3)] = var18[Unsorted.bitwiseAnd(-1 + var4 + var3 + -var20, RenderAnimationDefinition.anInt396)] = var21 * var19 >> 12;
+ }
+ } else {
+ for(var20 = 0; var20 < var13; ++var20) {
+ var21 = var20 * var8 / var13;
+ var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, var3 - -var20)] = var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, var4 + var3 + -var20 - 1)] = var21 >= var19 ?var19:var21;
+ }
+ }
+
+ if(Class113.anInt1559 >= var16 + var15) {
+ ArrayUtils.fill(var18, var15, var16, var19);
+ } else {
+ var20 = -var15 + Class113.anInt1559;
+ ArrayUtils.fill(var18, var15, var20, var19);
+ ArrayUtils.fill(var18, 0, -var20 + var16, var19);
+ }
+ } else {
+ var19 = var6 + -var17 - 1;
+ if(var14 <= var19) {
+ for(var20 = 0; var13 > var20; ++var20) {
+ var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, var3 + var20)] = var18[Unsorted.bitwiseAnd(-1 + -var20 + var3 - -var4, RenderAnimationDefinition.anInt396)] = var8 * var20 / var13;
+ }
+
+ if(Class113.anInt1559 < var15 - -var16) {
+ var20 = -var15 + Class113.anInt1559;
+ ArrayUtils.fill(var18, var15, var20, var8);
+ ArrayUtils.fill(var18, 0, var16 - var20, var8);
+ } else {
+ ArrayUtils.fill(var18, var15, var16, var8);
+ }
+ } else {
+ var20 = var19 * var8 / var14;
+ int var22;
+ if(this.anInt3309 == 0) {
+ for(var21 = 0; var13 > var21; ++var21) {
+ var22 = var8 * var21 / var13;
+ var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, var3 - -var21)] = var18[Unsorted.bitwiseAnd(RenderAnimationDefinition.anInt396, -1 + var3 - (-var4 + var21))] = var22 * var20 >> 12;
+ }
+ } else {
+ for(var21 = 0; var21 < var13; ++var21) {
+ var22 = var21 * var8 / var13;
+ var18[Unsorted.bitwiseAnd(var3 - -var21, RenderAnimationDefinition.anInt396)] = var18[Unsorted.bitwiseAnd(-1 + -var21 + var4 + var3, RenderAnimationDefinition.anInt396)] = var22 >= var20 ?var20:var22;
+ }
+ }
+
+ if(var16 + var15 > Class113.anInt1559) {
+ var21 = Class113.anInt1559 + -var15;
+ ArrayUtils.fill(var18, var15, var21, var20);
+ ArrayUtils.fill(var18, 0, -var21 + var16, var20);
+ } else {
+ ArrayUtils.fill(var18, var15, var16, var20);
+ }
+ }
+ }
+ }
+ } else if(var3 - -var4 <= Class113.anInt1559) {
+ for(var11 = 0; var11 < var6; ++var11) {
+ ArrayUtils.fill(var7[var1 - -var11], var3, var4, var8);
+ }
+ } else {
+ var11 = Class113.anInt1559 - var3;
+
+ for(var12 = 0; var6 > var12; ++var12) {
+ int[] var24 = var7[var12 + var1];
+ ArrayUtils.fill(var24, var3, var11, var8);
+ ArrayUtils.fill(var24, 0, -var11 + var4, var8);
+ }
+ }
+
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "ol.B(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + var3 + ',' + var4 + ',' + (byte) -69 + ',' + var6 + ',' + (var7 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ this.anInt3301 = 4;
+ }
+
+ if(var1 == 0) {
+ this.anInt3312 = var2.readUnsignedByte();
+ } else if (var1 == 1) {
+ this.anInt3300 = var2.readUnsignedShort();
+ } else if (2 == var1) {
+ this.anInt3308 = var2.readUnsignedShort();
+ } else if (var1 == 3) {
+ this.anInt3310 = var2.readUnsignedShort();
+ } else if (var1 == 4) {
+ this.anInt3301 = var2.readUnsignedShort();
+ } else if (var1 == 5) {
+ this.anInt3303 = var2.readUnsignedShort();
+ } else if (var1 == 6) {
+ this.anInt3309 = var2.readUnsignedByte();
+ } else if (var1 == 7) {
+ this.anInt3299 = var2.readUnsignedShort();
+ } else if (var1 == 8) {
+ this.anInt3316 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ol.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method292(int var0, int var1, int var2, int var3, GameObject var4, int var5, long var6, int var8, int var9, int var10, int var11) {
+ if (var4 != null) {
+ Scenery.method1189(var0, var8, var9, var10 - var8 + 1, var11 - var9 + 1, var1, var2, var3, var4, var5, true, var6);
+ }
+ }
+
+ static int method293(int var0, int var1, int var3) {
+ try {
+ var1 &= 3;
+ return (0 == var1?var3:(1 != var1?(var1 != 2 ?var0:-var3 + 1023):-var0 + 1023));
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ol.E(" + var0 + ',' + var1 + ',' + false + ',' + var3 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation29.java b/Client/src/main/java/org/runite/client/TextureOperation29.java
new file mode 100644
index 000000000..eccdbb5d1
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation29.java
@@ -0,0 +1,170 @@
+package org.runite.client;
+
+final class TextureOperation29 extends TextureOperation {
+
+ static byte[][][] aByteArrayArrayArray3390;
+ static RSString[] aStringArray3391;
+ private Class75[] aClass75Array3392;
+ static Class133[] aClass133Array3393 = new Class133[6];
+ static byte[] aByteArray3396;
+
+ static volatile int anInt3398 = 0;
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ this.method323(-60, this.aClass114_2382.method1710((byte)124));
+ }
+
+ return var3;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "si.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static int method322(byte var1) {
+ try {
+ return 255 & var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "si.C(" + true + ',' + var1 + ')');
+ }
+ }
+
+ private void method323(int var1, int[][] var2) {
+ try {
+ int var4 = Class101.anInt1427;
+ int var3 = Class113.anInt1559;
+ TextureOperation20.method230(var2);
+ Class58.method1196(Class3_Sub20.anInt2487, RenderAnimationDefinition.anInt396);
+ if(this.aClass75Array3392 != null) {
+ for(int var5 = 0; this.aClass75Array3392.length > var5; ++var5) {
+ Class75 var6 = this.aClass75Array3392[var5];
+ int var7 = var6.anInt1101;
+ int var8 = var6.anInt1104;
+ if(var7 >= 0) {
+ if(var8 < 0) {
+ var6.method1341(var3, var4);
+ } else {
+ var6.method1335(var4, var3, 4898);
+ }
+ } else if(var8 >= 0) {
+ var6.method1337(var4, true, var3);
+ }
+ }
+ }
+
+ if(var1 != -60) {
+ method326((byte)-35, null);
+ }
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "si.F(" + var1 + ',' + (var2 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.aClass75Array3392 = new Class75[var2.readUnsignedByte()];
+
+ for(int var4 = 0; var4 < this.aClass75Array3392.length; ++var4) {
+ int var5 = var2.readUnsignedByte();
+ if(var5 == 0) {
+ this.aClass75Array3392[var4] = Class8.method843(-5232, var2);
+ } else if(var5 == 1) {
+ this.aClass75Array3392[var4] = Class3_Sub28_Sub2.method536(var2);
+ } else if(var5 == 2) {
+ this.aClass75Array3392[var4] = Class3_Sub22.method404(var2);
+ } else if (3 == var5) {
+ this.aClass75Array3392[var4] = Class3_Sub19.method384(var2);
+ }
+ }
+ } else if(1 == var1) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ if(!true) {
+ this.method323(124, null);
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "si.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method324(int var0) {
+ try {
+ Class92.setLightParams(Class92.defaultScreenColorRgb, (0.7F + (float)var0 * 0.1F) * 1.1523438F, 0.69921875F, 0.69921875F);
+ Class92.setLightPosition(-50.0F, -60.0F, -50.0F);
+ Class92.setFogValues(Class92.defaultRegionAmbientRGB, 0);
+ Class92.method1504();
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "si.Q(" + var0 + ',' + false + ')');
+ }
+ }
+
+ static int method326(byte var0, RSString var1) {
+ try {
+ if(var0 <= 13) {
+ TextCore.aString_3399 = null;
+ }
+
+ return var1.length() + 1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "si.O(" + var0 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 == -1) {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-117, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int var4 = Class113.anInt1559;
+ int var5 = Class101.anInt1427;
+ int[][] var6 = new int[var5][var4];
+ int[][][] var7 = this.aClass97_2376.method1589();
+ this.method323(-60, var6);
+
+ for(int var8 = 0; var8 < Class101.anInt1427; ++var8) {
+ int[] var9 = var6[var8];
+ int[][] var10 = var7[var8];
+ int[] var11 = var10[0];
+ int[] var12 = var10[1];
+ int[] var13 = var10[2];
+
+ for(int var14 = 0; Class113.anInt1559 > var14; ++var14) {
+ int var15 = var9[var14];
+ var13[var14] = Unsorted.bitwiseAnd(255, var15) << 4;
+ var12[var14] = Unsorted.bitwiseAnd(4080, var15 >> 4);
+ var11[var14] = Unsorted.bitwiseAnd(var15 >> 12, 4080);
+ }
+ }
+ }
+
+ return var3;
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var16) {
+ throw ClientErrorException.clientError(var16, "si.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation29() {
+ super(0, true);
+ }
+
+ static void method327(int var0, int var1) {
+ try {
+ InterfaceWidget var3 = InterfaceWidget.getWidget(12, var1);
+ var3.flagUpdate();
+ var3.anInt3598 = var0;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "si.B(" + var0 + ',' + var1 + ',' + (byte) 68 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation3.java b/Client/src/main/java/org/runite/client/TextureOperation3.java
new file mode 100644
index 000000000..975bf3479
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation3.java
@@ -0,0 +1,191 @@
+package org.runite.client;
+
+import org.rs09.SystemLogger;
+import org.rs09.client.util.ArrayUtils;
+import org.rs09.client.filestore.resources.configs.cursors.CursorDefinition;
+
+import java.util.Objects;
+
+final class TextureOperation3 extends TextureOperation {
+
+ static boolean disableGEBoxes = false;
+ static int[] anIntArray3359 = new int[5];
+
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ ArrayUtils.fill(var3, 0, Class113.anInt1559, Class163_Sub3.anIntArray2999[var1]);
+ }
+
+ return var3;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "qg.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method304() {
+ try {
+
+ TextureOperation25.aReferenceCache_3412.clear();
+ TextureOperation2.aReferenceCache_3369.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "qg.F(" + 6799 + ')');
+ }
+ }
+
+ static void method305(Signlink var0, DataBuffer var1, int var2) {
+ try {
+ Class3_Sub8 var4 = new Class3_Sub8();
+ var4.anInt2296 = var1.readUnsignedByte();
+ var4.anInt2305 = var1.readInt();
+ var4.aClass64Array2298 = new Class64[var4.anInt2296];
+ var4.anIntArray2300 = new int[var4.anInt2296];
+ var4.aByteArrayArrayArray2302 = new byte[var4.anInt2296][][];
+ var4.aClass64Array2303 = new Class64[var4.anInt2296];
+ var4.anIntArray2301 = new int[var4.anInt2296];
+ var4.anIntArray2299 = new int[var4.anInt2296];
+
+ for(int var6 = 0; var4.anInt2296 > var6; ++var6) {
+ try {
+ int var7 = var1.readUnsignedByte();
+ String var8;
+ String var9;
+ int var10;
+ if (var7 == 0 || var7 == 1 || var7 == 2) {
+ var8 = new String(var1.readString().method1568());
+ var10 = 0;
+ var9 = new String(var1.readString().method1568());
+ if(var7 == 1) {
+ var10 = var1.readInt();
+ }
+
+ var4.anIntArray2301[var6] = var7;
+ var4.anIntArray2299[var6] = var10;
+ var4.aClass64Array2303[var6] = var0.method1447(-41, var9, TextureOperation12.method170(var8));
+ } else if (var7 == 3 || var7 == 4) {
+ var8 = new String(var1.readString().method1568());
+ var9 = new String(var1.readString().method1568());
+ var10 = var1.readUnsignedByte();
+ String[] var11 = new String[var10];
+
+ for (int var12 = 0; var10 > var12; ++var12) {
+ var11[var12] = new String(var1.readString().method1568());
+ }
+
+ byte[][] var21 = new byte[var10][];
+ int var14;
+ if (3 == var7) {
+ for (int var13 = 0; var13 < var10; ++var13) {
+ var14 = var1.readInt();
+ var21[var13] = new byte[var14];
+ var1.readBytes(var21[var13], var14);
+ }
+ }
+
+ var4.anIntArray2301[var6] = var7;
+ Class[] var22 = new Class[var10];
+
+ for (var14 = 0; var10 > var14; ++var14) {
+ var22[var14] = TextureOperation12.method170(var11[var14]);
+ }
+
+ var4.aClass64Array2298[var6] = var0.method1443(TextureOperation12.method170(var8), var22, -80, var9);
+ var4.aByteArrayArrayArray2302[var6] = var21;
+ }
+ } catch (ClassNotFoundException var15) {
+ var4.anIntArray2300[var6] = -1;
+ } catch (SecurityException var16) {
+ var4.anIntArray2300[var6] = -2;
+ } catch (NullPointerException var17) {
+ var4.anIntArray2300[var6] = -3;
+ } catch (Exception var18) {
+ var4.anIntArray2300[var6] = -4;
+ } catch (Throwable var19) {
+ var4.anIntArray2300[var6] = -5;
+ }
+ }
+
+ Class3_Sub26.aLinkedList_2557.pushBack(var4);
+ } catch (RuntimeException var20) {
+ throw ClientErrorException.clientError(var20, "qg.E(" + (var0 != null?"{...}":"null") + ',' + (var1 != null?"{...}":"null") + ',' + var2 + ',' + (byte) -126 + ')');
+ }
+ }
+
+ static void method306(int var0, int var2) {
+ try {
+ CSConfigCachefile var3 = CSConfigCachefile.getCSConfigFileFromVarbitID(var0);
+ int var6 = Objects.requireNonNull(var3).upperBound;
+ int var5 = var3.lowerBound;
+ int var4 = var3.parentVarpIndex;
+ int var7 = Class3_Sub6.expectedMinimumValues[var6 - var5];
+ if(var2 < 0 || var7 < var2) {
+ SystemLogger.logInfo(var7 + " < " + var2);
+ var2 = 0;
+ }
+
+ var7 <<= var5;
+ AtmosphereParser.method1428(var4, var7 & var2 << var5 | ItemDefinition.ram[var4] & ~var7);
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "qg.Q(" + var0 + ',' + false + ',' + var2 + ')');
+ }
+ }
+
+ static void method307(RSString[] var0, short[] var1, int var2) {
+ try {
+ Class3_Sub8.method127(var1, -1 + var0.length, var0, 0);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "qg.C(" + (var0 != null?"{...}":"null") + ',' + (var1 != null?"{...}":"null") + ',' + var2 + ')');
+ }
+ }
+
+ static int bitwiseOr(int var0, int var1) {
+ try {
+ return var0 | var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "qg.R(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public TextureOperation3() {
+ super(0, true);
+ }
+
+ static int method310(int var0, byte var1, int var2, int var3) {
+ try {
+ var0 &= 3;
+ if(var0 == 0) {
+ return var3;
+ } else {
+ if(var1 >= -17) {
+ TextCore.aString_3357 = null;
+ }
+
+ return var0 == 1?7 + -var2:(var0 == 2 ?-var3 + 7:var2);
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "qg.B(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ static CursorDefinition method311(int var0) {
+ try {
+ CursorDefinition var2 = (CursorDefinition) Unsorted.aReferenceCache_684.get(var0);
+ if(var2 == null) {
+ byte[] var3 = TextureOperation4.configurationsIndex_3227.getFile(33, var0);
+
+ var2 = new CursorDefinition();
+ if(var3 != null) {
+ var2.decode(new DataBuffer(var3));
+ }
+
+ Unsorted.aReferenceCache_684.put(var2, var0);
+ }
+ return var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "qg.O(" + var0 + ',' + 5 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation30.java b/Client/src/main/java/org/runite/client/TextureOperation30.java
new file mode 100644
index 000000000..58af5bcde
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation30.java
@@ -0,0 +1,273 @@
+package org.runite.client;
+import java.awt.Frame;
+import java.util.Objects;
+
+final class TextureOperation30 extends TextureOperation {
+
+ static volatile boolean fullRedraw = true;
+
+ static boolean[][] aBooleanArrayArray3118 = new boolean[][]{new boolean[0], {true, false, true}, {true, false, false, true}, {false, false, true, true}, {true, true, false}, {false, true, true}, {true, false, false, true}, {false, false, false, true, true}, {false, true, true}, {true, false, true, true, true}, {false, true, true, true, true}, {false, true, true, true, true, false}};
+ static Frame fullScreenFrame;
+ static Signlink signlink;
+ private int anInt3126 = 2048;
+ private int anInt3127 = 3072;
+ private int anInt3128 = 1024;
+
+ static int method210(int var1, int var2, int var3) {
+ try {
+ if(var3 == var2) {
+ return var2;
+ } else {
+ int var4 = -var1 + 128;
+
+ int var5 = var1 * ((-16711936 & var3) >>> 7) + var4 * ((-16711936 & var2) >>> 7) & -16711936;
+ int var6 = var4 * (16711935 & var2) - -((var3 & 16711935) * var1) & -16711936;
+ return var5 - -(var6 >> 7);
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "fh.O(" + 18348 + ',' + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3128 = var2.readUnsignedShort();
+ } else if (var1 == 1) {
+ this.anInt3127 = var2.readUnsignedShort();
+ } else if (var1 == 2) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "fh.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var7 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var4 = this.method152(0, var1);
+
+ for(int var5 = 0; var5 < Class113.anInt1559; ++var5) {
+ var7[var5] = this.anInt3128 - -(var4[var5] * this.anInt3126 >> 12);
+ }
+ }
+
+ return var7;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "fh.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method212(long var0) {
+ try {
+ if(0L != var0) {
+ for(int var3 = 0; Class3_Sub28_Sub5.anInt3591 > var3; ++var3) {
+ if(Class114.ignores[var3] == var0) {
+ --Class3_Sub28_Sub5.anInt3591;
+
+ for(int var4 = var3; var4 < Class3_Sub28_Sub5.anInt3591; ++var4) {
+ Class114.ignores[var4] = Class114.ignores[var4 + 1];
+ TextureOperation7.aStringArray3341[var4] = TextureOperation7.aStringArray3341[1 + var4];
+ }
+
+ Class110.anInt1472 = PacketParser.anInt3213;
+ TextureOperation12.outgoingBuffer.putOpcode(213);
+ TextureOperation12.outgoingBuffer.writeLong(var0);
+ break;
+ }
+ }
+
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "fh.E(" + var0 + ',' + 0 + ')');
+ }
+ }
+
+ static void method213(int var0, int var1, int var2, int var3, GameObject var4, long var5, GameObject var7, GameObject var8) {
+ Class72 var9 = new Class72();
+ var9.aClass140_1073 = var4;
+ var9.anInt1078 = var1 * 128 + 64;
+ var9.anInt1075 = var2 * 128 + 64;
+ var9.anInt1068 = var3;
+ var9.aLong1079 = var5;
+ var9.aClass140_1067 = var7;
+ var9.aClass140_1069 = var8;
+ int var10 = 0;
+ TileData var11 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ if(var11 != null) {
+ for(int var12 = 0; var12 < var11.anInt2223; ++var12) {
+ Class25 var13 = var11.aClass25Array2221[var12];
+ if((var13.aLong498 & 4194304L) == 4194304L) {
+ int var14 = var13.aClass140_479.method1871();
+ if(var14 != -32768 && var14 < var10) {
+ var10 = var14;
+ }
+ }
+ }
+ }
+
+ var9.anInt1077 = -var10;
+ if(TileData.aTileDataArrayArrayArray2638[var0][var1][var2] == null) {
+ TileData.aTileDataArrayArrayArray2638[var0][var1][var2] = new TileData(var0, var1, var2);
+ }
+
+ TileData.aTileDataArrayArrayArray2638[var0][var1][var2].aClass72_2245 = var9;
+ }
+
+ static void method214(GameObject var0, int var1, int var2, int var3, int var4, int var5) {
+ boolean var6 = true;
+ int var7 = var2;
+ int var8 = var2 + var4;
+ int var9 = var3 - 1;
+ int var10 = var3 + var5;
+
+ for(int var11 = var1; var11 <= var1 + 1; ++var11) {
+ if(var11 != Class3_Sub17.anInt2456) {
+ for(int var12 = var7; var12 <= var8; ++var12) {
+ if(var12 >= 0 && var12 < Unsorted.width1234) {
+ for(int var13 = var9; var13 <= var10; ++var13) {
+ if(var13 >= 0 && var13 < TextureOperation17.height3179 && (!var6 || var12 >= var8 || var13 >= var10 || var13 < var3 && var12 != var2)) {
+ TileData var14 = TileData.aTileDataArrayArrayArray2638[var11][var12][var13];
+ if(var14 != null) {
+ int var15 = (Class44.anIntArrayArrayArray723[var11][var12][var13] + Class44.anIntArrayArrayArray723[var11][var12 + 1][var13] + Class44.anIntArrayArrayArray723[var11][var12][var13 + 1] + Class44.anIntArrayArrayArray723[var11][var12 + 1][var13 + 1]) / 4 - (Class44.anIntArrayArrayArray723[var1][var2][var3] + Class44.anIntArrayArrayArray723[var1][var2 + 1][var3] + Class44.anIntArrayArrayArray723[var1][var2][var3 + 1] + Class44.anIntArrayArrayArray723[var1][var2 + 1][var3 + 1]) / 4;
+ Class70 var16 = var14.aClass70_2234;
+ if(var16 != null) {
+ if(var16.aClass140_1049.method1865()) {
+ var0.method1866(var16.aClass140_1049, (var12 - var2) * 128 + (1 - var4) * 64, var15, (var13 - var3) * 128 + (1 - var5) * 64, var6);
+ }
+
+ if(var16.aClass140_1052 != null && var16.aClass140_1052.method1865()) {
+ var0.method1866(var16.aClass140_1052, (var12 - var2) * 128 + (1 - var4) * 64, var15, (var13 - var3) * 128 + (1 - var5) * 64, var6);
+ }
+ }
+
+ for(int var17 = 0; var17 < var14.anInt2223; ++var17) {
+ Class25 var18 = var14.aClass25Array2221[var17];
+ if(var18 != null && var18.aClass140_479.method1865() && (var12 == var18.anInt483 || var12 == var7) && (var13 == var18.anInt478 || var13 == var9)) {
+ int var19 = var18.anInt495 - var18.anInt483 + 1;
+ int var20 = var18.anInt481 - var18.anInt478 + 1;
+ var0.method1866(var18.aClass140_479, (var18.anInt483 - var2) * 128 + (var19 - var4) * 64, var15, (var18.anInt478 - var3) * 128 + (var20 - var5) * 64, var6);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ --var7;
+ var6 = false;
+ }
+ }
+
+ }
+
+ static void method215(byte var0, LDIndexedSprite var1) {
+ try {
+ short var2 = 256;
+ int var3 = 0;
+ if(var0 >= -80) {
+ fullRedraw = true;
+ }
+
+ while(Class161.anIntArray2026.length > var3) {
+ Class161.anIntArray2026[var3] = 0;
+ ++var3;
+ }
+
+ int var4;
+ for(var3 = 0; var3 < 5000; ++var3) {
+ var4 = (int)((double)var2 * Math.random() * 128.0D);
+ Class161.anIntArray2026[var4] = (int)(Math.random() * 284.0D);
+ }
+
+ int var5;
+ int var6;
+ try {
+ for (; true; ++var3) {
+ for (var4 = 1; true; ++var4) {
+ for (var5 = 1; true; ++var5) {
+ var6 = var5 - -(var4 << 7);
+ Unsorted.anIntArray49[var6] = (Class161.anIntArray2026[128 + var6] + Class161.anIntArray2026[-1 + var6] + Class161.anIntArray2026[1 + var6] - -Class161.anIntArray2026[-128 + var6]) / 4;
+ }
+ }
+ }
+ } catch (Exception e) {
+ /*
+ System.out.println("breaking you out of the stupid endless triple for loop");
+ System.out.println("If you see this message it's a bug. this function should never run but it does sometimes for inexplicable reasons.");
+ System.out.println("Without this code here to break you out the game would crash.");
+ System.out.println("Once this client is deobbed fully this code will probably be deleted/unneeded");
+ System.out.println("- Your friendly neighborhood moth");
+ */
+ // moth is unfriendly now because u hecks keep reporting this as a bug
+ // I'm sorry you misinterpreted this message
+ // If something calls itself a bug the devs obviously know about it already.
+ }
+
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "fh.F(" + var0 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-118, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte)-50);
+ int[] var6 = Objects.requireNonNull(var4)[1];
+ int[] var7 = var4[2];
+ int[] var5 = var4[0];
+ int[] var8 = var3[0];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+
+ for(int var11 = 0; Class113.anInt1559 > var11; ++var11) {
+ var8[var11] = this.anInt3128 - -(this.anInt3126 * var5[var11] >> 12);
+ var9[var11] = (this.anInt3126 * var6[var11] >> 12) + this.anInt3128;
+ var10[var11] = this.anInt3128 + (this.anInt3126 * var7[var11] >> 12);
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "fh.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ this.anInt3126 = this.anInt3127 - this.anInt3128;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "fh.P(" + ')');
+ }
+ }
+
+ public TextureOperation30() {
+ super(1, false);
+ }
+
+ static void method216(DataBuffer var0) {
+ try {
+ for(int var2 = 0; var2 < WorldListEntry.activeWorldListSize; ++var2) {
+ int var3 = var0.getSmart();
+ int var4 = var0.readUnsignedShort();
+ if(var4 == 65535) {
+ var4 = -1;
+ }
+
+ if(null != WorldListEntry.worldList[var3]) {
+ WorldListEntry.worldList[var3].anInt722 = var4;
+ }
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "fh.Q(" + (var0 != null?"{...}":"null") + ',' + -14991 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation31.java b/Client/src/main/java/org/runite/client/TextureOperation31.java
new file mode 100644
index 000000000..8cdc77455
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation31.java
@@ -0,0 +1,75 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+import java.math.BigInteger;
+
+final class TextureOperation31 extends TextureOperation {
+
+ static CacheResourceWorker aCacheResourceWorker_3159;
+ private int anInt3160 = 0;
+ static BigInteger MODULUS = GameConfig.MODULUS;
+ private int anInt3163 = 20;
+ private int anInt3164 = 1365;
+ private int anInt3165 = 0;
+ static boolean aBoolean3166 = false;
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if (var1 == 0) {
+ this.anInt3164 = var2.readUnsignedShort();
+ } else if (var1 == 1) {
+ this.anInt3163 = var2.readUnsignedShort();
+ } else if (var1 == 2) {
+ this.anInt3160 = var2.readUnsignedShort();
+ } else if (var1 == 3) {
+ this.anInt3165 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "gm.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + true + ')');
+ }
+ }
+
+ static void method236() {
+ try {
+ TextureOperation14.aBoolean3387 = true;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "gm.C(" + (byte) 64 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if (this.aClass114_2382.aBoolean1580) {
+ for (int var5 = 0; var5 < Class113.anInt1559; ++var5) {
+ int var7 = this.anInt3165 + (Class163_Sub3.anIntArray2999[var1] << 12) / this.anInt3164;
+ int var6 = this.anInt3160 + (Class102.anIntArray2125[var5] << 12) / this.anInt3164;
+ int var10 = var6;
+ int var11 = var7;
+ int var14 = 0;
+ int var12 = var6 * var6 >> 12;
+
+ for (int var13 = var7 * var7 >> 12; var12 - -var13 < 16384 && var14 < this.anInt3163; var12 = var10 * var10 >> 12) {
+ var11 = (var10 * var11 >> 12) * 2 + var7;
+ ++var14;
+ var10 = var12 + -var13 + var6;
+ var13 = var11 * var11 >> 12;
+ }
+
+ var3[var5] = this.anInt3163 + -1 <= var14 ? 0 : (var14 << 12) / this.anInt3163;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "gm.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation31() {
+ super(0, true);
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation32.java b/Client/src/main/java/org/runite/client/TextureOperation32.java
new file mode 100644
index 000000000..402baf436
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation32.java
@@ -0,0 +1,165 @@
+package org.runite.client;
+
+final class TextureOperation32 extends TextureOperation {
+
+ static Class3_Sub11[][] aClass3_Sub11ArrayArray3346;
+ private int anInt3347 = 3216;
+ private final int[] anIntArray3348 = new int[3];
+ private int anInt3350 = 4096;
+ static RSString aString_3353;
+ private int anInt3354 = 3216;
+
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(0 == var1) {
+ this.anInt3350 = var2.readUnsignedShort();
+ } else if(1 == var1) {
+ this.anInt3347 = var2.readUnsignedShort();
+ } else if (var1 == 2) {
+ this.anInt3354 = var2.readUnsignedShort();
+ }
+
+ if(!true) {
+ method302(-47);
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "pk.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static int method301(byte var0) {
+ try {
+ //int var1 = -47 / ((45 - var0) / 57);
+ return TextureOperation29.anInt3398;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "pk.E(" + var0 + ')');
+ }
+ }
+
+ public TextureOperation32() {
+ super(1, true);
+ }
+
+ final void postDecode() {
+ try {
+ this.method303();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "pk.P(" + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var8 = Class95.anInt1343 * this.anInt3350 >> 12;
+ int[] var9 = this.method152(0, Class3_Sub20.anInt2487 & var1 + -1);
+ int[] var10 = this.method152(0, var1);
+ int[] var11 = this.method152(0, 1 + var1 & Class3_Sub20.anInt2487);
+
+ for(int var12 = 0; Class113.anInt1559 > var12; ++var12) {
+ int var14 = (var10[RenderAnimationDefinition.anInt396 & -1 + var12] - var10[1 + var12 & RenderAnimationDefinition.anInt396]) * var8 >> 12;
+ int var13 = var8 * (-var9[var12] + var11[var12]) >> 12;
+ int var15 = var14 >> 4;
+ if(0 > var15) {
+ var15 = -var15;
+ }
+
+ if(var15 > 255) {
+ var15 = 255;
+ }
+
+ int var16 = var13 >> 4;
+ if(var16 < 0) {
+ var16 = -var16;
+ }
+
+ if(255 < var16) {
+ var16 = 255;
+ }
+
+ int var17 = Class97.aByteArray1364[(var16 * (var16 - -1) >> 1) + var15] & 0xFF;
+ int var6 = var13 * var17 >> 8;
+ int var5 = var17 * var14 >> 8;
+ var6 = var6 * this.anIntArray3348[1] >> 12;
+ var5 = this.anIntArray3348[0] * var5 >> 12;
+ int var7 = 4096 * var17 >> 8;
+ var7 = var7 * this.anIntArray3348[2] >> 12;
+ var4[var12] = var7 + var6 + var5;
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var18) {
+ throw ClientErrorException.clientError(var18, "pk.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method302(int var0) {
+ try {
+ if(var0 != 2) {
+ method301((byte)56);
+ }
+
+ for(Class3_Sub28_Sub19 var1 = (Class3_Sub28_Sub19) TextureOperation13.aLinkedList_3364.startIteration(); var1 != null; var1 = (Class3_Sub28_Sub19) TextureOperation13.aLinkedList_3364.nextIteration()) {
+ Class140_Sub6 var2 = var1.aClass140_Sub6_3778;
+ if(var2.anInt2907 == WorldListCountry.localPlane && Class44.anInt719 <= var2.anInt2899) {
+ if(Class44.anInt719 >= var2.anInt2925) {
+ if(var2.entityIndex > 0) {
+ NPC var3 = NPC.npcs[-1 + var2.entityIndex];
+ if(null != var3 && var3.xAxis >= 0 && 13312 > var3.xAxis && var3.yAxis >= 0 && var3.yAxis < 13312) {
+ var2.method2024(var3.yAxis, Class44.anInt719, Scenery.sceneryPositionHash(var2.anInt2907, 1, var3.xAxis, var3.yAxis) + -var2.anInt2903, var3.xAxis);
+ }
+ }
+
+ if(var2.entityIndex < 0) {
+ int var4 = -1 + -var2.entityIndex;
+ Player var6;
+ if(Class3_Sub1.localIndex == var4) {
+ var6 = Class102.player;
+ } else {
+ var6 = Unsorted.players[var4];
+ }
+
+ if(null != var6 && var6.xAxis >= 0 && var6.xAxis < 13312 && var6.yAxis >= 0 && var6.yAxis < 13312) {
+ var2.method2024(var6.yAxis, Class44.anInt719, Scenery.sceneryPositionHash(var2.anInt2907, 1, var6.xAxis, var6.yAxis) - var2.anInt2903, var6.xAxis);
+ }
+ }
+
+ var2.method2023(Class106.anInt1446);
+ Class20.method907(WorldListCountry.localPlane, (int)var2.aDouble2920, (int)var2.aDouble2900, (int)var2.aDouble2914, 60, var2, var2.anInt2924, -1L, false);
+ }
+ } else {
+ var1.unlink();
+ }
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "pk.C(" + var0 + ')');
+ }
+ }
+
+ private void method303() {
+ try {
+ double var2 = Math.cos((float)this.anInt3354 / 4096.0F);
+ this.anIntArray3348[0] = (int)(4096.0D * var2 * Math.sin((float)this.anInt3347 / 4096.0F));
+ this.anIntArray3348[1] = (int)(Math.cos((float)this.anInt3347 / 4096.0F) * var2 * 4096.0D);
+ this.anIntArray3348[2] = (int)(4096.0D * Math.sin((float)this.anInt3354 / 4096.0F));
+ int var6 = this.anIntArray3348[2] * this.anIntArray3348[2] >> 12;
+ int var5 = this.anIntArray3348[1] * this.anIntArray3348[1] >> 12;
+ int var4 = this.anIntArray3348[0] * this.anIntArray3348[0] >> 12;
+ int var7 = (int)(4096.0D * Math.sqrt(var4 - (-var5 - var6) >> 12));
+ if(var7 != 0) {
+ this.anIntArray3348[2] = (this.anIntArray3348[2] << 12) / var7;
+ this.anIntArray3348[0] = (this.anIntArray3348[0] << 12) / var7;
+ this.anIntArray3348[1] = (this.anIntArray3348[1] << 12) / var7;
+ }
+
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "pk.B(" + (byte) 59 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation33.java b/Client/src/main/java/org/runite/client/TextureOperation33.java
new file mode 100644
index 000000000..b11cc0e04
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation33.java
@@ -0,0 +1,216 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.net.game.PacketDecoder;
+
+
+import java.io.IOException;
+
+public final class TextureOperation33 extends TextureOperation {
+
+ private int anInt3047 = 4096;
+ static KeyboardListener aClass148_3049 = new KeyboardListener();
+ private boolean aBoolean3050 = true;
+
+
+ static RSString bufferToString(byte[] bytes, int length, int offset) {
+ try {
+ RSString var4 = new RSString();
+ var4.buffer = new byte[length];
+ var4.length = 0;
+ for (int var5 = offset; var5 < length + offset; ++var5) {
+ if (bytes[var5] != 0) {
+ var4.buffer[var4.length++] = bytes[var5];
+ }
+ }
+ if (var4.toString().contains("RuneScape")) {
+ var4 = RSString.parse(var4.toString().replace("RuneScape", GameConfig.SERVER_NAME));
+ }
+ if (var4.toString().contains("Jagex")) {
+ var4 = RSString.parse(var4.toString().replace("Jagex", GameConfig.SERVER_NAME));
+ }
+ if (var4.toString().contains("Cearch")) {
+ var4 = RSString.parse(var4.toString().replace("Cearch", "search"));
+ }
+ if (var4.toString().contains(">o")) {
+ var4 = RSString.parse(var4.toString().replace(">o", "no"));
+ }
+ return var4;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "an.B(" + (bytes != null ? "{...}" : "null") + ',' + -4114 + ',' + length + ',' + offset + ')');
+ }
+ }
+
+ public TextureOperation33() {
+ super(1, false);
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if (0 == var1) {
+ this.anInt3047 = var2.readUnsignedShort();
+ } else if (var1 == 1) {
+ this.aBoolean3050 = var2.readUnsignedByte() == 1;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "an.A(" + var1 + ',' + (var2 != null ? "{...}" : "null") + ',' + true + ')');
+ }
+ }
+
+ static void method180(int var0, int var1, int var2) {
+ try {
+ int var3;
+ if (Class113.anInt1559 != var2) {
+ Class102.anIntArray2125 = new int[var2];
+
+ for (var3 = 0; var3 < var2; ++var3) {
+ Class102.anIntArray2125[var3] = (var3 << 12) / var2;
+ }
+
+ Class95.anInt1343 = 64 != var2 ? 4096 : 2048;
+ RenderAnimationDefinition.anInt396 = -1 + var2;
+ Class113.anInt1559 = var2;
+ }
+
+ if (Class101.anInt1427 != var1) {
+ if (Class113.anInt1559 == var1) {
+ Class163_Sub3.anIntArray2999 = Class102.anIntArray2125;
+ } else {
+ Class163_Sub3.anIntArray2999 = new int[var1];
+
+ for (int var4 = 0; var4 < var1; ++var4) {
+ Class163_Sub3.anIntArray2999[var4] = (var4 << 12) / var1;
+ }
+ }
+
+ Class101.anInt1427 = var1;
+ Class3_Sub20.anInt2487 = var1 + -1;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "an.S(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static boolean method181() {
+ try {
+// return PacketParser.parseIncomingPackets();
+ return PacketDecoder.INSTANCE.decodePacket();
+ } catch (IOException var4) {
+ TextureOperation20.breakClientConnection();
+ return true;
+ } catch (Exception var5) {
+ String var2 = "T2 - " + Unsorted.incomingOpcode + "," + Class7.anInt2166 + "," + Class24.anInt469 + " - " + Unsorted.incomingPacketLength + "," + (Class131.x1716 - -Class102.player.xOffsets2767[0]) + "," + (Class102.player.yOffsets2755[0] + Texture.y1152) + " - ";
+
+ for (int var3 = 0; var3 < Unsorted.incomingPacketLength && 50 > var3; ++var3) {
+ var2 = var2 + BufferedDataStream.incomingBuffer.buffer[var3] + ",";
+ }
+
+ Class49.reportError(var2, var5);
+ Class167.method2269((byte) 46);
+ return true;
+ }
+ }
+
+ static void method182() {
+ try {
+ Texture.aReferenceCache_1146.clear();
+ Class159.aReferenceCache_2016.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "an.Q(" + true + ')');
+ }
+ }
+
+ static void method183() {
+ try {
+ Unsorted.aReferenceCache_684.clear();
+ Class163_Sub1.aReferenceCache_2984.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "an.O(" + -108 + ')');
+ }
+ }
+
+ static void method184(int var0, int var1, int var2, int var3, int var5, int var6) {
+ try {
+ int var11 = Class40.method1040(Class57.anInt902, var6, Class159.anInt2020);
+ int var12 = Class40.method1040(Class57.anInt902, var0, Class159.anInt2020);
+ int var13 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var3, Class101.anInt1425);
+ int var14 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var2, Class101.anInt1425);
+
+ int var7 = Class40.method1040(Class57.anInt902, var6 + var1, Class159.anInt2020);
+ int var8 = Class40.method1040(Class57.anInt902, -var1 + var0, Class159.anInt2020);
+
+ int var15;
+ for (var15 = var11; var7 > var15; ++var15) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var15], var13, 127, var14, var5);
+ }
+
+ for (var15 = var12; var15 > var8; --var15) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var15], var13, -76, var14, var5);
+ }
+
+ int var9 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var1 + var3, Class101.anInt1425);
+ int var10 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var1 + var2, Class101.anInt1425);
+
+ for (var15 = var7; var8 >= var15; ++var15) {
+ int[] var16 = Class38.anIntArrayArray663[var15];
+ TextureOperation18.method282(var16, var13, -59, var9, var5);
+ TextureOperation18.method282(var16, var10, 1 + -97, var14, var5);
+ }
+
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "an.R(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + 1 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte) 58, var2);
+ if (this.aClass97_2376.aBoolean1379) {
+ int[] var4 = this.method152(0, Class3_Sub20.anInt2487 & var2 + -1);
+ int[] var5 = this.method152(0, var2);
+ int[] var6 = this.method152(0, 1 + var2 & Class3_Sub20.anInt2487);
+ int[] var7 = var3[0];
+ int[] var8 = var3[1];
+ int[] var9 = var3[2];
+
+ for (int var10 = 0; var10 < Class113.anInt1559; ++var10) {
+ int var14 = this.anInt3047 * (-var4[var10] + var6[var10]);
+ int var15 = this.anInt3047 * (-var5[RenderAnimationDefinition.anInt396 & -1 + var10] + var5[var10 + 1 & RenderAnimationDefinition.anInt396]);
+ int var17 = var14 >> 12;
+ int var16 = var15 >> 12;
+ int var19 = var17 * var17 >> 12;
+ int var18 = var16 * var16 >> 12;
+ int var20 = (int) (Math.sqrt((float) (var18 + var19 - -4096) / 4096.0F) * 4096.0D);
+ int var11;
+ int var12;
+ int var13;
+ if (0 == var20) {
+ var13 = 0;
+ var11 = 0;
+ var12 = 0;
+ } else {
+ var13 = 16777216 / var20;
+ var12 = var14 / var20;
+ var11 = var15 / var20;
+ }
+
+ if (this.aBoolean3050) {
+ var12 = 2048 - -(var12 >> 1);
+ var13 = (var13 >> 1) + 2048;
+ var11 = (var11 >> 1) + 2048;
+ }
+
+ var7[var10] = var11;
+ var8[var10] = var12;
+ var9[var10] = var13;
+ }
+ }
+ return var3;
+ } catch (RuntimeException var21) {
+ throw ClientErrorException.clientError(var21, "an.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation34.java b/Client/src/main/java/org/runite/client/TextureOperation34.java
new file mode 100644
index 000000000..bcaf7ac94
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation34.java
@@ -0,0 +1,405 @@
+package org.runite.client;
+import java.awt.Component;
+import java.lang.reflect.Method;
+
+final class TextureOperation34 extends TextureOperation {
+
+ int anInt3056 = 4;
+ int anInt3058 = 4;
+ private byte[] aByteArray3059 = new byte[512];
+ int anInt3060 = 4;
+ int anInt3062 = 1638;
+ private short[] aShortArray3063;
+ static boolean aBoolean3064 = true;
+ boolean aBoolean3065 = true;
+ private short[] aShortArray3066;
+ int anInt3067 = 0;
+
+
+ static boolean method185(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7) {
+ if(var1 < var2 && var1 < var3 && var1 < var4) {
+ return false;
+ } else if(var1 > var2 && var1 > var3 && var1 > var4) {
+ return false;
+ } else if(var0 < var5 && var0 < var6 && var0 < var7) {
+ return false;
+ } else if(var0 > var5 && var0 > var6 && var0 > var7) {
+ return false;
+ } else {
+ int var8 = (var1 - var2) * (var6 - var5) - (var0 - var5) * (var3 - var2);
+ int var9 = (var1 - var4) * (var5 - var7) - (var0 - var7) * (var2 - var4);
+ int var10 = (var1 - var3) * (var7 - var6) - (var0 - var6) * (var4 - var3);
+ return var8 * var10 > 0 && var10 * var9 > 0;
+ }
+ }
+
+ final void method186(int var2, int[] var3) {
+ try {
+ int var5 = this.anInt3056 * Class163_Sub3.anIntArray2999[var2];
+ int var4;
+ int var6;
+ int var8;
+ short var9;
+ int var10;
+ int var11;
+ int var12;
+ int var13;
+ int var14;
+ int var15;
+ int var17;
+ int var16;
+ int var18;
+ if(this.anInt3058 == 1) {
+ var9 = this.aShortArray3066[0];
+ var8 = this.aShortArray3063[0] << 12;
+ var11 = var5 * var8 >> 12;
+ var12 = this.anInt3060 * var8 >> 12;
+ var13 = var8 * this.anInt3056 >> 12;
+ var15 = var11 >> 12;
+ var17 = this.aByteArray3059[255 & var15] & 0xFF;
+ var11 &= 4095;
+ var14 = Class1.anIntArray52[var11];
+ var16 = var15 - -1;
+ if(var16 >= var13) {
+ var16 = 0;
+ }
+
+ var18 = 255 & this.aByteArray3059[255 & var16];
+ if(this.aBoolean3065) {
+ for(var10 = 0; Class113.anInt1559 > var10; ++var10) {
+ var4 = this.anInt3060 * Class102.anIntArray2125[var10];
+ var6 = this.method192(var8 * var4 >> 12, var18, var17, var12, var11, var14);
+ var6 = var9 * var6 >> 12;
+ var3[var10] = 2048 - -(var6 >> 1);
+ }
+ } else {
+ for(var10 = 0; var10 < Class113.anInt1559; ++var10) {
+ var4 = this.anInt3060 * Class102.anIntArray2125[var10];
+ var6 = this.method192(var8 * var4 >> 12, var18, var17, var12, var11, var14);
+ var3[var10] = var9 * var6 >> 12;
+ }
+ }
+ } else {
+ var9 = this.aShortArray3066[0];
+ if(var9 > 8 || -8 > var9) {
+ var8 = this.aShortArray3063[0] << 12;
+ var13 = var8 * this.anInt3056 >> 12;
+ var12 = this.anInt3060 * var8 >> 12;
+ var11 = var5 * var8 >> 12;
+ var15 = var11 >> 12;
+ var16 = 1 + var15;
+ var17 = this.aByteArray3059[var15 & 0xFF] & 0xFF;
+ var11 &= 4095;
+ var14 = Class1.anIntArray52[var11];
+ if(var13 <= var16) {
+ var16 = 0;
+ }
+
+ var18 = 255 & this.aByteArray3059[255 & var16];
+
+ for(var10 = 0; Class113.anInt1559 > var10; ++var10) {
+ var4 = Class102.anIntArray2125[var10] * this.anInt3060;
+ var6 = this.method192(var4 * var8 >> 12, var18, var17, var12, var11, var14);
+ var3[var10] = var6 * var9 >> 12;
+ }
+ }
+
+ for(int var7 = 1; this.anInt3058 > var7; ++var7) {
+ var9 = this.aShortArray3066[var7];
+ if(8 < var9 || var9 < -8) {
+ var8 = this.aShortArray3063[var7] << 12;
+ var11 = var8 * var5 >> 12;
+ var15 = var11 >> 12;
+ var17 = this.aByteArray3059[255 & var15] & 0xFF;
+ var12 = this.anInt3060 * var8 >> 12;
+ var16 = var15 + 1;
+ var11 &= 4095;
+ var14 = Class1.anIntArray52[var11];
+ var13 = this.anInt3056 * var8 >> 12;
+ if(var13 <= var16) {
+ var16 = 0;
+ }
+
+ var18 = 255 & this.aByteArray3059[var16 & 0xFF];
+ if(this.aBoolean3065 && this.anInt3058 + -1 == var7) {
+ for(var10 = 0; var10 < Class113.anInt1559; ++var10) {
+ var4 = Class102.anIntArray2125[var10] * this.anInt3060;
+ var6 = this.method192(var8 * var4 >> 12, var18, var17, var12, var11, var14);
+ var6 = (var9 * var6 >> 12) + var3[var10];
+ var3[var10] = (var6 >> 1) + 2048;
+ }
+ } else {
+ for(var10 = 0; Class113.anInt1559 > var10; ++var10) {
+ var4 = Class102.anIntArray2125[var10] * this.anInt3060;
+ var6 = this.method192(var4 * var8 >> 12, var18, var17, var12, var11, var14);
+ var3[var10] += var6 * var9 >> 12;
+ }
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var19) {
+ throw ClientErrorException.clientError(var19, "bi.C(" + true + ',' + var2 + ',' + (var3 != null?"{...}":"null") + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ this.aByteArray3059 = Class49.method1123(this.anInt3067);
+ this.method191();
+
+ for(int var2 = -1 + this.anInt3058; var2 >= 1; --var2) {
+ short var3 = this.aShortArray3066[var2];
+ if(8 < var3 || var3 < -8) {
+ break;
+ }
+
+ --this.anInt3058;
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "bi.P(" + ')');
+ }
+ }
+
+ static void method189() {
+ try {
+ int var2;
+
+ int var1;
+ for(var1 = -1; Class159.localPlayerCount > var1; ++var1) {
+ int var3;
+ if(var1 == -1) {
+ var3 = 2047;
+ } else {
+ var3 = Class56.localPlayerIndexes[var1];
+ }
+
+ Player var4 = Unsorted.players[var3];
+ if(var4 != null && 0 < var4.textCycle) {
+ --var4.textCycle;
+ if(var4.textCycle == 0) {
+ var4.textSpoken = null;
+ }
+ }
+ }
+
+ for(var1 = 0; var1 < Class163.localNPCCount; ++var1) {
+ var2 = AudioThread.localNPCIndexes[var1];
+ NPC var6 = NPC.npcs[var2];
+ if(null != var6 && var6.textCycle > 0) {
+ --var6.textCycle;
+ if(var6.textCycle == 0) {
+ var6.textSpoken = null;
+ }
+ }
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bi.B(" + (byte) -62 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+
+ if(var1 == 0) {
+ this.aBoolean3065 = var2.readUnsignedByte() == 1;
+ } else if(var1 == 1) {
+ this.anInt3058 = var2.readUnsignedByte();
+ } else if(var1 == 2) {
+ this.anInt3062 = var2.readSignedShort();
+ if(0 > this.anInt3062) {
+ this.aShortArray3066 = new short[this.anInt3058];
+
+ for(int var4 = 0; this.anInt3058 > var4; ++var4) {
+ this.aShortArray3066[var4] = (short)var2.readSignedShort();
+ }
+ }
+ } else if(var1 == 3) {
+ this.anInt3060 = this.anInt3056 = var2.readUnsignedByte();
+ } else if(var1 == 4) {
+ this.anInt3067 = var2.readUnsignedByte();
+ } else if(var1 == 5) {
+ this.anInt3060 = var2.readUnsignedByte();
+ } else if(var1 == 6) {
+ this.anInt3056 = var2.readUnsignedByte();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bi.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static int method190(int var0, int var1, byte var2, int var3) {
+ try {
+ int var5 = Class51.anIntArray834[Class140_Sub1_Sub2.method1940(var1, var3)];
+ if(var0 > 0) {
+ int var6 = Class51.anInterface2_838.method19(111, var0 & 65535);
+ int var7;
+ int var9;
+ if(var6 != 0) {
+ if(var3 >= 0) {
+ if(var3 > 127) {
+ var7 = 16777215;
+ } else {
+ var7 = 131586 * var3;
+ }
+ } else {
+ var7 = 0;
+ }
+
+ if(var6 == 256) {
+ var5 = var7;
+ } else {
+ var9 = -var6 + 256;
+ var5 = (16711680 & (var7 & 65280) * var6 + var9 * (var5 & 65280)) + (var6 * (var7 & 16711935) - -((16711935 & var5) * var9) & -16711936) >> 8;
+ }
+ }
+
+ var7 = Class51.anInterface2_838.method10(106, 65535 & var0);
+ if(var7 != 0) {
+ var7 += 256;
+ int var8 = ((16711680 & var5) >> 16) * var7;
+ if(65535 < var8) {
+ var8 = 65535;
+ }
+
+ var9 = ((var5 & 65280) >> 8) * var7;
+ if(var9 > 65535) {
+ var9 = 65535;
+ }
+
+ int var10 = var7 * (var5 & 0xFF);
+ if(var10 > 65535) {
+ var10 = 65535;
+ }
+
+ var5 = (var10 >> 8) + (65280 & var9) + (16711711 & var8 << 8);
+ }
+ }
+
+ return var5;
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "bi.E(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ private void method191() {
+ try {
+ int var2;
+ if(this.anInt3062 <= 0) {
+ if(this.aShortArray3066 != null && this.aShortArray3066.length == this.anInt3058) {
+ this.aShortArray3063 = new short[this.anInt3058];
+
+ for(var2 = 0; var2 < this.anInt3058; ++var2) {
+ this.aShortArray3063[var2] = (short)((int)Math.pow(2.0D, var2));
+ }
+ }
+ } else {
+ this.aShortArray3066 = new short[this.anInt3058];
+ this.aShortArray3063 = new short[this.anInt3058];
+
+ for(var2 = 0; var2 < this.anInt3058; ++var2) {
+ this.aShortArray3066[var2] = (short)((int)(Math.pow((float)this.anInt3062 / 4096.0F, var2) * 4096.0D));
+ this.aShortArray3063[var2] = (short)((int)Math.pow(2.0D, var2));
+ }
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "bi.F(" + true + ')');
+ }
+ }
+
+ private int method192(int var1, int var2, int var3, int var4, int var6, int var7) {
+ try {
+ int var10 = -4096 + var6;
+ int var13 = var1 >> 12;
+ int var12 = 1 + var13;
+ var13 &= 255;
+ if(var4 <= var12) {
+ var12 = 0;
+ }
+
+ var1 &= 4095;
+ int var14 = this.aByteArray3059[var13 - -var3] & 3;
+ int var15 = Class1.anIntArray52[var1];
+ int var8;
+ if(var14 > 1) {
+ var8 = 2 != var14?-var1 + -var6:var1 - var6;
+ } else {
+ var8 = 0 == var14?var6 + var1:-var1 + var6;
+ }
+
+ var12 &= 255;
+ int var11 = -4096 + var1;
+ var14 = this.aByteArray3059[var3 + var12] & 3;
+ int var9;
+ if(var14 <= 1) {
+ var9 = 0 == var14?var6 + var11:-var11 + var6;
+ } else {
+ var9 = 2 == var14?-var6 + var11:-var11 + -var6;
+ }
+
+ var14 = this.aByteArray3059[var13 - -var2] & 3;
+ int var16 = var8 + ((var9 + -var8) * var15 >> 12);
+ if(1 < var14) {
+ var8 = 2 != var14?-var1 - var10:var1 + -var10;
+ } else {
+ var8 = 0 != var14?var10 + -var1:var1 - -var10;
+ }
+
+ var14 = 3 & this.aByteArray3059[var2 + var12];
+ if(1 < var14) {
+ var9 = var14 != 2 ?-var10 + -var11:var11 - var10;
+ } else {
+ var9 = var14 == 0?var11 + var10:var10 + -var11;
+ }
+
+ int var17 = var8 + ((-var8 + var9) * var15 >> 12);
+ return var16 - -(var7 * (var17 + -var16) >> 12);
+ } catch (RuntimeException var18) {
+ throw ClientErrorException.clientError(var18, "bi.R(" + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ static void method193(byte var0, Component var1) {
+ try {
+ if(var0 < 49) {
+ Class53.worldListOffset = 85;
+ }
+
+ Method var2 = Signlink.setTraversalKeysEnabled;
+ if(null != var2) {
+ try {
+ var2.invoke(var1, Boolean.FALSE);
+ } catch (Throwable var4) {
+ }
+ }
+
+ var1.addKeyListener(TextureOperation33.aClass148_3049);
+ var1.addFocusListener(TextureOperation33.aClass148_3049);
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bi.Q(" + var0 + ',' + (var1 != null?"{...}":"null") + ')');
+ }
+ }
+
+ public TextureOperation34() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ this.method186(var1, var3);
+ }
+
+ return var3;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bi.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation35.java b/Client/src/main/java/org/runite/client/TextureOperation35.java
new file mode 100644
index 000000000..05f2dfe29
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation35.java
@@ -0,0 +1,77 @@
+package org.runite.client;
+
+final class TextureOperation35 extends TextureOperation {
+
+ static int anInt3332 = 50;
+ static int[] anIntArray3321 = new int[]{76, 8, 137, 4, 0, 1, 38, 2, 19};
+ private int anInt3322 = 4096;
+ static int anInt3323 = 50;
+ static int[] anIntArray3328 = new int[8];
+ static byte[][] aByteArrayArray3335;
+
+
+ public static void method294(byte var0) {
+ try {
+ Texture.anIntArray3327 = null;
+ Texture.anIntArray3337 = null;
+ Texture.aStringArray3317 = null;
+ anIntArray3328 = null;
+ Texture.anIntArray3319 = null;
+ aByteArrayArray3335 = null;
+ Texture.anIntArray3329 = null;
+ Texture.anIntArray3336 = null;
+ anIntArray3321 = null;
+ Texture.anIntArray3318 = null;
+ Texture.anIntArray3331 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "pg.B(" + var0 + ')');
+ }
+ }
+
+ public TextureOperation35() {
+ super(1, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, var1 - 1 & Class3_Sub20.anInt2487);
+ int[] var6 = this.method152(0, var1);
+ int[] var7 = this.method152(0, Class3_Sub20.anInt2487 & var1 + 1);
+
+ for(int var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ int var9 = (var7[var8] + -var5[var8]) * this.anInt3322;
+ int var10 = this.anInt3322 * (-var6[var8 - 1 & RenderAnimationDefinition.anInt396] + var6[RenderAnimationDefinition.anInt396 & var8 - -1]);
+ int var11 = var10 >> 12;
+ int var12 = var9 >> 12;
+ int var13 = var11 * var11 >> 12;
+ int var14 = var12 * var12 >> 12;
+ int var15 = (int)(Math.sqrt((float)(4096 + var14 + var13) / 4096.0F) * 4096.0D);
+ int var16 = 0 != var15?16777216 / var15:0;
+ var4[var8] = 4096 + -var16;
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "pg.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ method294((byte)-57);
+ }
+
+ if(var1 == 0) {
+ this.anInt3322 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "pg.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation36.java b/Client/src/main/java/org/runite/client/TextureOperation36.java
new file mode 100644
index 000000000..2db71146b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation36.java
@@ -0,0 +1,400 @@
+package org.runite.client;
+
+import org.rs09.client.config.GameConfig;
+
+public final class TextureOperation36 extends TextureOperation {
+
+ static int anInt3422;
+ static int anInt3423;
+ static float aFloat3424;
+ static boolean aBoolean3094 = false;
+ private int[] anIntArray3425;
+ static byte[][][] aByteArrayArrayArray3430;
+ private int anInt3431;
+ private int anInt3433;
+ private int anInt3434 = -1;
+ static float aFloat3435;
+
+ static void method1628(int var0, int var1, int var2, int var3, int var4, int var5) {
+ try {
+ int var9;
+ int var12;
+ if(Class164_Sub1.anInt3012 == 0) {
+ int var10 = AtmosphereParser.screenLowerY;
+ var9 = Class1.screenUpperY;
+ int var8 = Class145.screenUpperX;
+ int var7 = Class139.screenLowerX;
+ int var11 = (var5 - var3) * (-var7 + var8) / var1 - -var7;
+ var12 = var9 + (var10 + -var9) * (-var0 + var4) / var2;
+ if(GameObject.aBoolean1837 && (64 & Class164.anInt2051) != 0) {
+ RSInterface var13 = AbstractSprite.method638(BufferedDataStream.anInt872, RSInterface.anInt278);
+ if(var13 == null) {
+ Class25.method958((byte)-87);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Unsorted.anInt1887, 0L, (byte)-53, TextCore.aString_1724, var11, (short)11, Class3_Sub28_Sub9.aString_3621, var12);
+ }
+ } else {
+ if(Class158.paramGameTypeID == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(-1, 0L, (byte)-62, RSString.parse(""), var11, (short)36, TextCore.HasFaceHere, var12);
+ }
+
+ Class3_Sub24_Sub4.pushRightClickMenuAction(-1, 0L, (byte)-75, RSString.parse(""), var11, (short)60, TextureOperation32.aString_3353, var12);
+ }
+ }
+
+ long var25 = -1L;
+
+ for(var9 = 0; Unsorted.anInt59 > var9; ++var9) {
+ long var26 = TextureOperation38.aLongArray3448[var9];
+ var12 = (int)var26 & 127;
+ int var14 = ((int)var26 & 2009320690) >> 29;
+ int var15 = (int)(var26 >>> 32) & Integer.MAX_VALUE;
+ int var27 = 127 & (int)var26 >> 7;
+ if(var25 != var26) {
+ var25 = var26;
+ int var18;
+ if(var14 == 2 && Unsorted.method2096(WorldListCountry.localPlane, var12, var27, var26)) {
+ ObjectDefinition var16 = ObjectDefinition.getObjectDefinition(var15);
+ if(null != var16.ChildrenIds) {
+ var16 = var16.method1685(0);
+ }
+
+ if(null == var16) {
+ continue;
+ }
+
+ if(Class164_Sub1.anInt3012 == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class99.anInt1403, var26, (byte)-58, RSString.stringCombiner(new RSString[]{RenderAnimationDefinition.aString_378, ColorCore.PMColor, var16.name}), var12, (short)14, TextCore.HasUse, var27);
+ } else if(GameObject.aBoolean1837) {
+ Class3_Sub28_Sub9 var17 = -1 == Unsorted.anInt1038?null: LinkedList.method1210(Unsorted.anInt1038);
+ if(0 != (Class164.anInt2051 & 4) && (var17 == null || var17.anInt3614 != var16.method1691(var17.anInt3614, Unsorted.anInt1038, (byte) 98))) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Unsorted.anInt1887, var26, (byte)-77, RSString.stringCombiner(new RSString[]{TextCore.aString_676, ColorCore.PMColor, var16.name}), var12, (short)38, Class3_Sub28_Sub9.aString_3621, var27);
+ }
+ } else {
+ RSString[] var29 = var16.options;
+ if(Class123.aBoolean1656) {
+ var29 = Class3_Sub31.optionsArrayStringConstructor(var29);
+ }
+
+ if(var29 != null) {
+ for(var18 = 4; var18 >= 0; --var18) {
+ if(null != var29[var18]) {
+ short var19 = 0;
+ if(var18 == 0) {
+ var19 = 42;
+ }
+
+ if(var18 == 1) {
+ var19 = 50;
+ }
+
+ int var20 = -1;
+ if(2 == var18) {
+ var19 = 49;
+ }
+
+ if(var16.anInt1493 == var18) {
+ var20 = var16.anInt1517;
+ }
+
+ if(var18 == 3) {
+ var19 = 46;
+ }
+
+ if(var18 == var16.anInt1520) {
+ var20 = var16.anInt1522;
+ }
+
+ if(var18 == 4) {
+ var19 = 1001;
+ }
+
+
+ if (GameConfig.OBJECT_DEBUG_ENABLED) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(var20, var26, (byte) -91, RSString.stringCombiner(new RSString[]{ColorCore.ObjectNameColor, var16.name}), var12, var19, var29[var18], var27);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(var20, var26, (byte) -91, RSString.stringCombiner(new RSString[]{ColorCore.ObjectNameColor, var16.name}), var12, var19, var29[var18], var27);
+ }
+
+ }
+ }
+ }
+ if (GameConfig.OBJECT_DEBUG_ENABLED) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var16.objectId, (byte) -26, RSString.stringCombiner(new RSString[]{ColorCore.ObjectNameColor, var16.name}), var12, (short) 1004, RSString.parse("Examine" + " " + " ID: (X" + var16.objectId + "(Y"), var27);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var16.objectId, (byte) -26, RSString.stringCombiner(new RSString[]{ColorCore.ObjectNameColor, var16.name}), var12, (short) 1004, TextCore.HasExamine, var27);
+ }
+ }
+ }
+
+ int var21;
+ int var22;
+ int var33;
+ Player var38;
+ NPC var36;
+ int var37;
+ if(var14 == 1) {
+ NPC var31 = NPC.npcs[var15];
+ if((var31.definition.size & 1) == 0 && (127 & var31.xAxis) == 0 && (var31.yAxis & 127) == 0 || 1 == (var31.definition.size & 1) && (127 & var31.xAxis) == 64 && (var31.yAxis & 127) == 64) {
+ var33 = var31.xAxis - -64 - 64 * var31.definition.size;
+ var18 = -((-1 + var31.definition.size) * 64) + var31.yAxis;
+
+ for(var37 = 0; var37 < Class163.localNPCCount; ++var37) {
+ var36 = NPC.npcs[AudioThread.localNPCIndexes[var37]];
+ var21 = -(var36.definition.size * 64) - -64 + var36.xAxis;
+ var22 = var36.yAxis + -(var36.definition.size * 64) - -64;
+ if(var31 != var36 && var33 <= var21 && var31.definition.size - (-var33 + var21 >> 7) >= var36.definition.size && var18 <= var22 && var36.definition.size <= -(-var18 + var22 >> 7) + var31.definition.size) {
+ Unsorted.drawNpcRightClickOptions(var36.definition, var12, -126, AudioThread.localNPCIndexes[var37], var27);
+ }
+ }
+
+ for(var37 = 0; var37 < Class159.localPlayerCount; ++var37) {
+ var38 = Unsorted.players[Class56.localPlayerIndexes[var37]];
+ var21 = var38.xAxis + 64 + -(64 * var38.getSize());
+ var22 = var38.yAxis - (var38.getSize() * 64 + -64);
+ if(var21 >= var33 && var31.definition.size - (var21 - var33 >> 7) >= var38.getSize() && var18 <= var22 && var38.getSize() <= -(-var18 + var22 >> 7) + var31.definition.size) {
+ TextureOperation13.method312(Class56.localPlayerIndexes[var37], 5, var27, var38, var12);
+ }
+ }
+ }
+
+ Unsorted.drawNpcRightClickOptions(var31.definition, var12, -108, var15, var27);
+ }
+
+ if(var14 == 0) {
+ Player var30 = Unsorted.players[var15];
+ if((127 & var30.xAxis) == 64 && 64 == (127 & var30.yAxis)) {
+ var33 = var30.xAxis + -(64 * (-1 + var30.getSize()));
+ var18 = var30.yAxis + 64 + -(var30.getSize() * 64);
+
+ for(var37 = 0; var37 < Class163.localNPCCount; ++var37) {
+ var36 = NPC.npcs[AudioThread.localNPCIndexes[var37]];
+ var21 = var36.xAxis + -(var36.definition.size * 64) - -64;
+ var22 = var36.yAxis - 64 * var36.definition.size - -64;
+ if(var21 >= var33 && var36.definition.size <= -(var21 - var33 >> 7) + var30.getSize() && var18 <= var22 && -(-var18 + var22 >> 7) + var30.getSize() >= var36.definition.size) {
+ Unsorted.drawNpcRightClickOptions(var36.definition, var12, -121, AudioThread.localNPCIndexes[var37], var27);
+ }
+ }
+
+ for(var37 = 0; var37 < Class159.localPlayerCount; ++var37) {
+ var38 = Unsorted.players[Class56.localPlayerIndexes[var37]];
+ var21 = var38.xAxis - (var38.getSize() + -1) * 64;
+ var22 = var38.yAxis - (-64 + 64 * var38.getSize());
+ if(var38 != var30 && var21 >= var33 && var38.getSize() <= var30.getSize() - (var21 - var33 >> 7) && var18 <= var22 && -(var22 + -var18 >> 7) + var30.getSize() >= var38.getSize()) {
+ TextureOperation13.method312(Class56.localPlayerIndexes[var37], 9, var27, var38, var12);
+ }
+ }
+ }
+
+ TextureOperation13.method312(var15, 31, var27, var30, var12);
+ }
+
+ if(var14 == 3) {
+ LinkedList var28 = Class39.groundItems[WorldListCountry.localPlane][var12][var27];
+ if(null != var28) {
+ for(GroundItemLink var32 = (GroundItemLink)var28.method1212(); null != var32; var32 = (GroundItemLink)var28.method1219(41)) {
+ var18 = var32.aGroundItem_3676.itemId;
+ ItemDefinition var40 = ItemDefinition.getItemDefinition(var18);
+ if(Class164_Sub1.anInt3012 == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class99.anInt1403, var18, (byte)-75, RSString.stringCombiner(new RSString[]{RenderAnimationDefinition.aString_378, ColorCore.BankItemColor, var40.name}), var12, (short)33, TextCore.HasUse, var27);
+ } else if(GameObject.aBoolean1837) {
+ Class3_Sub28_Sub9 var39 = Unsorted.anInt1038 == -1?null: LinkedList.method1210(Unsorted.anInt1038);
+ if((Class164.anInt2051 & 1) != 0 && (null == var39 || var39.anInt3614 != var40.method1115(var39.anInt3614, 100, Unsorted.anInt1038))) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Unsorted.anInt1887, var18, (byte)-70, RSString.stringCombiner(new RSString[]{TextCore.aString_676, ColorCore.BankItemColor, var40.name}), var12, (short)39, Class3_Sub28_Sub9.aString_3621, var27);
+ }
+ } else {
+ RSString[] var34 = var40.groundOptions;
+ if(Class123.aBoolean1656) {
+ var34 = Class3_Sub31.optionsArrayStringConstructor(var34);
+ }
+
+ for(var21 = 4; var21 >= 0; --var21) {
+ if(var34 != null && null != var34[var21]) {
+ byte var35 = 0;
+ if(var21 == 0) {
+ var35 = 21;
+ }
+
+ if(1 == var21) {
+ var35 = 34;
+ }
+
+ int var23 = -1;
+ if(var40.anInt767 == var21) {
+ var23 = var40.anInt758;
+ }
+
+ if(var21 == 2) {
+ var35 = 18;
+ }
+
+ if(var40.anInt788 == var21) {
+ var23 = var40.anInt756;
+ }
+
+ if(var21 == 3) {
+ var35 = 20;
+ }
+
+ if(var21 == 4) {
+ var35 = 24;
+ }
+
+ Class3_Sub24_Sub4.pushRightClickMenuAction(var23, var18, (byte)-43, RSString.stringCombiner(new RSString[]{ColorCore.GroundItemColor, var40.name}), var12, var35, var34[var21], var27);
+ }
+ }
+ if (GameConfig.ITEM_DEBUG_ENABLED) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var18, (byte) -43, RSString.stringCombiner(new RSString[]{ColorCore.GroundItemColor, var40.name}), var12, (short) 1002, RSString.parse("Examine" + " " + " ID: (X" + var40.itemId + "(Y"), var27);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var18, (byte) -43, RSString.stringCombiner(new RSString[]{ColorCore.GroundItemColor, var40.name}), var12, (short) 1002, TextCore.HasExamine, var27);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var24) {
+ throw ClientErrorException.clientError(var24, "ob.K(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + (byte) 97 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ this.anInt3434 = 6;
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)-120, var2);
+ if(this.aClass97_2376.aBoolean1379 && this.method339()) {
+ int var4 = (this.anInt3433 != Class101.anInt1427?this.anInt3433 * var2 / Class101.anInt1427:var2) * this.anInt3431;
+ int[] var5 = var3[0];
+ int[] var6 = var3[1];
+ int[] var7 = var3[2];
+ int var8;
+ int var9;
+ if(this.anInt3431 == Class113.anInt1559) {
+ for(var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var9 = this.anIntArray3425[var4++];
+ var7[var8] = Unsorted.bitwiseAnd(var9 << 4, 4080);
+ var6[var8] = Unsorted.bitwiseAnd(var9, 65280) >> 4;
+ var5[var8] = Unsorted.bitwiseAnd(var9, 16711680) >> 12;
+ }
+ } else {
+ for(var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var9 = this.anInt3431 * var8 / Class113.anInt1559;
+ int var10 = this.anIntArray3425[var4 - -var9];
+ var7[var8] = Unsorted.bitwiseAnd(var10 << 4, 4080);
+ var6[var8] = Unsorted.bitwiseAnd(65280, var10) >> 4;
+ var5[var8] = Unsorted.bitwiseAnd(var10 >> 12, 4080);
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "ui.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ private boolean method339() {
+ try {
+ if(this.anIntArray3425 == null) {
+ if(this.anInt3434 < 0) {
+ return false;
+ } else {
+ int var2 = Class113.anInt1559;
+ int var3 = Class101.anInt1427;
+ int var4 = !Class17.anInterface2_408.method14((byte)-104, this.anInt3434)?128:64;
+ this.anIntArray3425 = Class17.anInterface2_408.method16(64, this.anInt3434);
+ this.anInt3433 = var4;
+ this.anInt3431 = var4;
+ TextureOperation33.method180(18, var3, var2);
+ return this.anIntArray3425 != null;
+ }
+ } else {
+ return true;
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ui.LA(" + false + ')');
+ }
+ }
+
+ static int method340(int var0) {
+ try {
+ return var0 >>> 8;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ui.NA(" + var0 + ',' + -51 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ CacheIndex.animationIndex = null;
+ }
+
+ if(0 == var1) {
+ this.anInt3434 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ui.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public TextureOperation36() {
+ super(0, false);
+ }
+
+ final void method161(byte var1) {
+ try {
+ super.method161(var1);
+ this.anIntArray3425 = null;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ui.BA(" + var1 + ')');
+ }
+ }
+
+ static AbstractIndexedSprite[] method343() {
+ try {
+ AbstractIndexedSprite[] var1 = new AbstractIndexedSprite[Class95.anInt1338];
+
+ for(int var2 = 0; var2 < Class95.anInt1338; ++var2) {
+ if(HDToolKit.highDetail) {
+ var1[var2] = new HDIndexedSprite(Class3_Sub15.anInt2426, Class133.anInt1748, Class164.anIntArray2048[var2], Unsorted.anIntArray2591[var2], GroundItem.anIntArray2931[var2], Unsorted.anIntArray3076[var2], Class163_Sub1.aByteArrayArray2987[var2], TextureOperation38.spritePalette);
+ } else {
+ var1[var2] = new LDIndexedSprite(Class3_Sub15.anInt2426, Class133.anInt1748, Class164.anIntArray2048[var2], Unsorted.anIntArray2591[var2], GroundItem.anIntArray2931[var2], Unsorted.anIntArray3076[var2], Class163_Sub1.aByteArrayArray2987[var2], TextureOperation38.spritePalette);
+ }
+ }
+ Class39.method1035((byte)113);
+ return var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ui.JA(" + 1854847236 + ')');
+ }
+ }
+
+ final int getSpriteFrame() {
+ try {
+ return this.anInt3434;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ui.HA(" + (byte) 19 + ')');
+ }
+ }
+
+ static void method344(int var0, int var1) {
+ try {
+ if(0 <= var0 && Class3_Sub24_Sub4.aBooleanArray3503.length > var0) {
+ Class3_Sub24_Sub4.aBooleanArray3503[var0] = !Class3_Sub24_Sub4.aBooleanArray3503[var0];
+ if(var1 != 4) {
+ aByteArrayArrayArray3430 = null;
+ }
+
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ui.KA(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation37.java b/Client/src/main/java/org/runite/client/TextureOperation37.java
new file mode 100644
index 000000000..7fddd685a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation37.java
@@ -0,0 +1,308 @@
+package org.runite.client;
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.net.Connection;
+
+import java.io.IOException;
+import java.net.Socket;
+import java.util.Objects;
+
+final class TextureOperation37 extends TextureOperation {
+//Class3_Sub13_Sub21
+ private int anInt3253 = 0;
+ private int anInt3254 = 4096;
+ static int anInt3256;
+ private int anInt3257 = 12288;
+ private int anInt3258 = 0;
+ static int anInt3260 = -1;
+ static boolean aBoolean3261 = false;
+ private int anInt3262 = 2048;
+ static int anInt3263 = 0;
+ static Class3_Sub28_Sub3 aClass3_Sub28_Sub3_3264;
+ private int anInt3265 = 2048;
+ private int anInt3266 = 8192;
+
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3265 = var2.readUnsignedShort();
+ } else if(var1 == 1) {
+ this.anInt3253 = var2.readUnsignedShort();
+ } else if(var1 == 2) {
+ this.anInt3258 = var2.readUnsignedShort();
+ } else if(var1 == 3) {
+ this.anInt3262 = var2.readUnsignedShort();
+ } else if (var1 == 4) {
+ this.anInt3257 = var2.readUnsignedShort();
+ } else if (var1 == 5) {
+ this.anInt3254 = var2.readUnsignedShort();
+ } else if (var1 == 6) {
+ this.anInt3266 = var2.readUnsignedShort();
+ }
+
+ if(!true) {
+ this.anInt3266 = 85;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "mh.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method267() {
+ try {
+ if(Unsorted.registryStage != 0) {
+ try {
+ if(++Class132.anInt1734 > 2000) {
+ if(null != Class3_Sub15.activeConnection) {
+ Class3_Sub15.activeConnection.close();
+ Class3_Sub15.activeConnection = null;
+ }
+
+ if(GraphicDefinition.anInt548 >= 1) {
+ Unsorted.anInt1711 = -5;
+ Unsorted.registryStage = 0;
+ return;
+ }
+
+ Unsorted.registryStage = 1;
+ Class132.anInt1734 = 0;
+ ++GraphicDefinition.anInt548;
+ if(Class140_Sub6.accRegistryPort == Class162.anInt2036) {
+ Class140_Sub6.accRegistryPort = Client.currentPort;
+ } else {
+ Class140_Sub6.accRegistryPort = Class162.anInt2036;
+ }
+ }
+
+ if(Unsorted.registryStage == 1) {
+ //Ip & Port
+ Class3_Sub9.aClass64_2318 = Class38.gameSignlink.method1441((byte)8, Class38_Sub1.accRegistryIp, Class140_Sub6.accRegistryPort);
+ Unsorted.registryStage = 2;
+ }
+
+ int response;
+ if(Unsorted.registryStage == 2) {
+ if(Objects.requireNonNull(Class3_Sub9.aClass64_2318).anInt978 == 2) {
+ throw new IOException();
+ }
+ if(1 != Class3_Sub9.aClass64_2318.anInt978) {
+ return;
+ }
+ Class3_Sub15.activeConnection = new Connection((Socket)Class3_Sub9.aClass64_2318.anObject974, Class38.gameSignlink);
+ Class3_Sub9.aClass64_2318 = null;
+ Class3_Sub15.activeConnection.sendBytes(TextureOperation12.outgoingBuffer.buffer, TextureOperation12.outgoingBuffer.index);
+ if(WorldListEntry.aAudioChannel_2627 != null) {
+ WorldListEntry.aAudioChannel_2627.method2159();
+ }
+ if(null != Class3_Sub21.aAudioChannel_2491) {
+ Class3_Sub21.aAudioChannel_2491.method2159();
+ }
+ response = Class3_Sub15.activeConnection.readByte();
+ System.out.println("Response = " + response);
+ if(WorldListEntry.aAudioChannel_2627 != null) {
+ WorldListEntry.aAudioChannel_2627.method2159();
+ }
+ if(Class3_Sub21.aAudioChannel_2491 != null) {
+ Class3_Sub21.aAudioChannel_2491.method2159();
+ }
+ if(response != 21) {
+ Unsorted.anInt1711 = response;
+ Unsorted.registryStage = 0;
+ Class3_Sub15.activeConnection.close();
+ Class3_Sub15.activeConnection = null;
+ return;
+ }
+ Unsorted.registryStage = 3;
+ }
+
+ if(3 == Unsorted.registryStage) {
+ if(Class3_Sub15.activeConnection.availableBytes() < 1) {
+ return;
+ }
+
+ TextureOperation29.aStringArray3391 = new RSString[Class3_Sub15.activeConnection.readByte()];
+ Unsorted.registryStage = 4;
+ }
+
+ if(Unsorted.registryStage == 4) {
+ if(8 * TextureOperation29.aStringArray3391.length > Class3_Sub15.activeConnection.availableBytes()) {
+ return;
+ }
+
+ BufferedDataStream.incomingBuffer.index = 0;
+ Class3_Sub15.activeConnection.readBytes(BufferedDataStream.incomingBuffer.buffer, 0, 8 * TextureOperation29.aStringArray3391.length);
+
+ for(response = 0; response < TextureOperation29.aStringArray3391.length; ++response) {
+ TextureOperation29.aStringArray3391[response] = Unsorted.method1052(BufferedDataStream.incomingBuffer.readLong());
+ }
+
+ Unsorted.anInt1711 = 21;
+ Unsorted.registryStage = 0;
+ Class3_Sub15.activeConnection.close();
+ Class3_Sub15.activeConnection = null;
+ return;
+ }
+ } catch (IOException var2) {
+ if(Class3_Sub15.activeConnection != null) {
+ Class3_Sub15.activeConnection.close();
+ Class3_Sub15.activeConnection = null;
+ }
+
+ if(GraphicDefinition.anInt548 < 1) {
+ ++GraphicDefinition.anInt548;
+ if(Class162.anInt2036 == Class140_Sub6.accRegistryPort) {
+ Class140_Sub6.accRegistryPort = Client.currentPort;
+ } else {
+ Class140_Sub6.accRegistryPort = Class162.anInt2036;
+ }
+
+ Class132.anInt1734 = 0;
+ Unsorted.registryStage = 1;
+ } else {
+ Unsorted.anInt1711 = -4;
+ Unsorted.registryStage = 0;
+ }
+ }
+
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "mh.Q(" + (byte) 36 + ')');
+ }
+ }
+
+ public TextureOperation37() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = -2048 + Class163_Sub3.anIntArray2999[var1];
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var9 = var5 + this.anInt3253;
+ int var7 = Class102.anIntArray2125[var6] + -2048;
+ int var8 = this.anInt3265 + var7;
+ var9 = var9 < -2048 ?var9 - -4096:var9;
+ var9 = 2048 < var9?-4096 + var9:var9;
+ int var10 = var7 + this.anInt3258;
+ var8 = var8 < -2048?var8 + 4096:var8;
+ var8 = var8 <= 2048 ?var8:-4096 + var8;
+ var10 = var10 >= -2048 ?var10:4096 + var10;
+ var10 = var10 > 2048 ?var10 - 4096:var10;
+ int var11 = var5 - -this.anInt3262;
+ var11 = -2048 > var11?var11 + 4096:var11;
+ var11 = var11 > 2048 ?var11 - 4096:var11;
+ var3[var6] = !this.method271(var8, var9) && !this.method270(var10, var11)?0:4096;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "mh.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ private boolean method270(int var2, int var3) {
+ try {
+ int var4 = this.anInt3257 * (var2 + var3) >> 12;
+
+ int var5 = Class75_Sub2.anIntArray2639[var4 * 255 >> 12 & 0xFF];
+ var5 = (var5 << 12) / this.anInt3257;
+ var5 = (var5 << 12) / this.anInt3266;
+ var5 = var5 * this.anInt3254 >> 12;
+ return var5 > -var2 + var3 && var3 + -var2 > -var5;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "mh.S(" + (byte) -44 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ Class8.method844((byte)-9);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "mh.P(" + ')');
+ }
+ }
+
+ private boolean method271(int var1, int var2) {
+ try {
+ int var4 = (var2 - var1) * this.anInt3257 >> 12;
+
+ int var5 = Class75_Sub2.anIntArray2639[(1047948 & var4 * 255) >> 12];
+ var5 = (var5 << 12) / this.anInt3257;
+ var5 = (var5 << 12) / this.anInt3266;
+ var5 = var5 * this.anInt3254 >> 12;
+ return var5 > var2 + var1 && -var5 < var2 + var1;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "mh.F(" + var1 + ',' + var2 + ',' + (byte) 113 + ')');
+ }
+ }
+
+ static void displayNPCOnLoginRegion() {
+ try {
+
+ int var1 = TextureOperation35.aByteArrayArray3335.length;
+
+ for(int var2 = 0; var2 < var1; ++var2) {
+ if(TextureOperation35.aByteArrayArray3335[var2] != null) {
+ int var3 = -1;
+
+ for(int var4 = 0; TextureOperation11.anInt3244 > var4; ++var4) {
+ if(TextureOperation13.anIntArray3367[var4] == Class3_Sub24_Sub3.regionIds[var2]) {
+ var3 = var4;
+ break;
+ }
+ }
+
+ if(var3 == -1) {
+ TextureOperation13.anIntArray3367[TextureOperation11.anInt3244] = Class3_Sub24_Sub3.regionIds[var2];
+ var3 = TextureOperation11.anInt3244++;
+ }
+
+ int var5 = 0;
+ DataBuffer var16 = new DataBuffer(TextureOperation35.aByteArrayArray3335[var2]);
+
+ while(TextureOperation35.aByteArrayArray3335[var2].length > var16.index && 511 > var5) {
+ int var6 = var5++ << 6 | var3;
+ int var7 = var16.readUnsignedShort();
+ int var8 = var7 >> 14;
+ int var9 = 63 & var7 >> 7;
+ int var11 = var9 + 64 * (Class3_Sub24_Sub3.regionIds[var2] >> 8) - Class131.x1716;
+ int var10 = var7 & 63;
+ int var12 = var10 + -Texture.y1152 + 64 * (255 & Class3_Sub24_Sub3.regionIds[var2]);
+ int npcID = var16.readUnsignedShort();
+
+ if (GameConfig.EASTER_EVENT_ENABLED) {
+ npcID = 1321;
+ }
+
+ NPCDefinition var13 = NPCDefinition.getNPCDefinition(npcID);
+ if(NPC.npcs[var6] == null && (var13.aByte1267 & 1) > 0 && Class140_Sub3.viewportZ == var8 && var11 >= 0 && 104 > var13.size + var11 && var12 >= 0 && 104 > var12 - -var13.size) {
+ NPC.npcs[var6] = new NPC();
+ NPC npc = NPC.npcs[var6];
+ AudioThread.localNPCIndexes[Class163.localNPCCount++] = var6;
+ npc.anInt2838 = Class44.anInt719;
+ npc.setDefinitions(var13);
+ npc.setSize(npc.definition.size, 2);
+ npc.anInt2806 = npc.anInt2785 = Class27.anIntArray510[npc.definition.aByte1268];
+ npc.anInt2779 = npc.definition.anInt1274;
+ if(npc.anInt2779 == 0) {
+ npc.anInt2785 = 0;
+ }
+
+ npc.renderAnimationId = npc.definition.renderAnimationId;
+ npc.updateAnimationPosition(npc.getSize(), var11, var12, true);
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "mh.E(" + (byte) -124 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation38.java b/Client/src/main/java/org/runite/client/TextureOperation38.java
new file mode 100644
index 000000000..b5e38cc1f
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation38.java
@@ -0,0 +1,135 @@
+package org.runite.client;
+import java.util.Objects;
+import java.util.Random;
+
+final class TextureOperation38 extends TextureOperation {
+
+ private int anInt3444 = 0;
+
+ static int[] spritePalette;
+ private int anInt3447 = 2000;
+ static long[] aLongArray3448 = new long[1000];
+ private int anInt3450 = 4096;
+ private int anInt3451 = 16;
+ static short[] aShortArray3453 = new short[256];
+ private int anInt3454 = 0;
+ static short[] aShortArray3455;
+ static int[] anIntArray3456 = new int[4096];
+
+ final void postDecode() {
+ try {
+ Class8.method844((byte)-9);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "vc.P(" + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3454 = var2.readUnsignedByte();
+ } else if(var1 == 1) {
+ this.anInt3447 = var2.readUnsignedShort();
+ } else if(var1 == 2) {
+ this.anInt3451 = var2.readUnsignedByte();
+ } else if (3 == var1) {
+ this.anInt3444 = var2.readUnsignedShort();
+ } else if (var1 == 4) {
+ this.anInt3450 = var2.readUnsignedShort();
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "vc.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ public TextureOperation38() {
+ super(0, true);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = this.anInt3450 >> 1;
+ int[][] var6 = this.aClass114_2382.method1710((byte)93);
+ Random var7 = new Random(this.anInt3454);
+
+ for(int var8 = 0; this.anInt3447 > var8; ++var8) {
+ int var9 = this.anInt3450 > 0?this.anInt3444 + -var5 + TextureOperation.method1603((byte)-99, this.anInt3450, var7):this.anInt3444;
+ int var10 = TextureOperation.method1603((byte)-96, Class113.anInt1559, var7);
+ var9 = (var9 & 4088) >> 4;
+ int var11 = TextureOperation.method1603((byte)62, Class101.anInt1427, var7);
+ int var12 = var10 - -(this.anInt3451 * Class75_Sub2.anIntArray2639[var9] >> 12);
+ int var13 = var11 + (TextureOperation23.anIntArray3212[var9] * this.anInt3451 >> 12);
+ int var15 = var12 - var10;
+ int var14 = -var11 + var13;
+ if(var15 != 0 || var14 != 0) {
+ if(var15 < 0) {
+ var15 = -var15;
+ }
+
+ if(var14 < 0) {
+ var14 = -var14;
+ }
+
+ boolean var16 = var14 > var15;
+ int var17;
+ int var18;
+ if(var16) {
+ var17 = var10;
+ var18 = var12;
+ var12 = var13;
+ var13 = var18;
+ var10 = var11;
+ var11 = var17;
+ }
+
+ if(var12 < var10) {
+ var17 = var10;
+ var18 = var11;
+ var10 = var12;
+ var11 = var13;
+ var13 = var18;
+ var12 = var17;
+ }
+
+ var18 = -var10 + var12;
+ int var19 = var13 + -var11;
+ var17 = var11;
+ if(var19 < 0) {
+ var19 = -var19;
+ }
+
+ int var20 = -var18 / 2;
+ int var22 = -(TextureOperation.method1603((byte)-18, 4096, var7) >> 2) + 1024;
+ int var23 = var11 >= var13 ?-1:1;
+ int var21 = 2048 / var18;
+
+ for(int var24 = var10; var12 > var24; ++var24) {
+ var20 += var19;
+ int var25 = var21 * (-var10 + var24) + var22 + 1024;
+ int var27 = var17 & Class3_Sub20.anInt2487;
+ if(0 < var20) {
+ var20 += -var18;
+ var17 += var23;
+ }
+
+ int var26 = RenderAnimationDefinition.anInt396 & var24;
+ if(var16) {
+ Objects.requireNonNull(var6)[var27][var26] = var25;
+ } else {
+ Objects.requireNonNull(var6)[var26][var27] = var25;
+ }
+ }
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var28) {
+ throw ClientErrorException.clientError(var28, "vc.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation39.java b/Client/src/main/java/org/runite/client/TextureOperation39.java
new file mode 100644
index 000000000..f5a54d28d
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation39.java
@@ -0,0 +1,178 @@
+package org.runite.client;
+
+import org.rs09.CustomVars;
+
+import java.util.Objects;
+
+class TextureOperation39 extends TextureOperation {
+
+ private int anInt3278 = -1;
+ int anInt3280;
+ int anInt3283;
+ int[] anIntArray3284;
+ static int itemDefinitionSize;
+
+ static int method275(int var0, int var1, int var2, int var3) {
+ try {
+ int var5 = -Class51.anIntArray851[1024 * var2 / var3] + 65536 >> 1;
+ return (var0 * (-var5 + 65536) >> 16) + (var1 * var5 >> 16);
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "nh.CA(" + var0 + ',' + var1 + ',' + var2 + ',' + ',' + var3 + ')');
+ }
+ }
+
+ static void method276(int var0, int var1, int var2, int var3, GameObject var4, long var5, boolean var7) {
+ if(var4 != null) {
+ Class12 var8 = new Class12();
+ var8.object = var4;
+ var8.anInt324 = var1 * 128 + 64;
+ var8.anInt330 = var2 * 128 + 64;
+ var8.anInt326 = var3;
+ var8.aLong328 = var5;
+ var8.aBoolean329 = var7;
+ if(TileData.aTileDataArrayArrayArray2638[var0][var1][var2] == null) {
+ TileData.aTileDataArrayArrayArray2638[var0][var1][var2] = new TileData(var0, var1, var2);
+ }
+
+ TileData.aTileDataArrayArrayArray2638[var0][var1][var2].aClass12_2230 = var8;
+ }
+ }
+
+ static boolean handleWorldListUpdate(byte[] buf) {
+ try {
+ DataBuffer buffer = new DataBuffer(buf);
+ int opcode = buffer.readUnsignedByte();
+ //System.out.println(opcode);
+ if(1 == opcode) {
+ boolean updated = buffer.readUnsignedByte() == 1;
+ if(updated) {
+ WorldListEntry.parseWorldList(buffer);
+ }
+
+ TextureOperation30.method216(buffer);
+ return true;
+ } else {
+ return false;
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "nh.AA(" + 4 + ',' + (buf != null?"{...}":"null") + ')');
+ }
+ }
+
+ final boolean method279(int var1) {
+ try {
+ if(null == this.anIntArray3284) {
+ if(this.anInt3278 < 0) {
+ return false;
+ } else {
+ SoftwareSprite var3 = Texture.anInt1668 < 0 ? Unsorted.method1537(WaterfallShader.spritesIndex_probably_2172, this.anInt3278):Class40.method1043(this.anInt3278, WaterfallShader.spritesIndex_probably_2172, Texture.anInt1668);
+ Objects.requireNonNull(var3).method665();
+ this.anInt3283 = var3.height;
+ this.anInt3280 = var3.width;
+ this.anIntArray3284 = var3.anIntArray4081;
+ return true;
+ }
+ } else {
+ return true;
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "nh.FA(" + var1 + ')');
+ }
+ }
+
+ final int method159(int var1) {
+ try {
+ return var1 != 4?40:this.anInt3278;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "nh.GA(" + var1 + ')');
+ }
+ }
+
+ public TextureOperation39() {
+ super(0, false);
+ }
+
+ static void method280(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var11, int var12) {
+ try {
+ Class3_Sub5 var13 = new Class3_Sub5();
+ var13.anInt2284 = var6;
+ var13.anInt2283 = var3;
+ var13.anInt2266 = var1;
+ var13.anInt2279 = var5;
+ var13.anInt2273 = var2;
+ var13.anInt2271 = var8;
+ var13.anInt2277 = var11;
+ var13.anInt2282 = var4;
+ var13.anInt2270 = var12;
+ var13.anInt2268 = var7;
+ var13.anInt2272 = var0;
+ var13.anInt2278 = var9;
+ Unsorted.aLinkedList_2468.pushBack(var13);
+ } catch (RuntimeException var14) {
+ throw ClientErrorException.clientError(var14, "nh.V(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ',' + var9 + ',' + -745213428 + ',' + var11 + ',' + var12 + ')');
+ }
+ }
+
+ int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ this.method159(32);
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)65, var2);
+ if(this.aClass97_2376.aBoolean1379 && this.method279(-113)) {
+ int[] var4 = var3[0];
+ int[] var5 = var3[1];
+ int[] var6 = var3[2];
+ int var7 = (Class101.anInt1427 == this.anInt3283 ?var2:this.anInt3283 * var2 / Class101.anInt1427) * this.anInt3280;
+ int var8;
+ int var9;
+ if(Class113.anInt1559 == this.anInt3280) {
+ for(var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var9 = this.anIntArray3284[var7++];
+ var6[var8] = Unsorted.bitwiseAnd(255, var9) << 4;
+ var5[var8] = Unsorted.bitwiseAnd(65280, var9) >> 4;
+ var4[var8] = Unsorted.bitwiseAnd(var9, 16711680) >> 12;
+ }
+ } else {
+ for(var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var9 = this.anInt3280 * var8 / Class113.anInt1559;
+ int var10 = this.anIntArray3284[var7 - -var9];
+ var6[var8] = Unsorted.bitwiseAnd(var10 << 4, 4080);
+ var5[var8] = Unsorted.bitwiseAnd(var10, 65280) >> 4;
+ var4[var8] = Unsorted.bitwiseAnd(var10 >> 12, 4080);
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "nh.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3278 = var2.readUnsignedShort();
+ }
+
+ if(!true) {
+ method276(115, 107, 22, 20, null, 87L, false);
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "nh.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ final void method161(byte var1) {
+ try {
+ super.method161(var1);
+ this.anIntArray3284 = null;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "nh.BA(" + var1 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation4.java b/Client/src/main/java/org/runite/client/TextureOperation4.java
new file mode 100644
index 000000000..6fa8fdcb0
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation4.java
@@ -0,0 +1,249 @@
+package org.runite.client;
+import org.rs09.client.util.ArrayUtils;
+
+import java.util.Random;
+
+final class TextureOperation4 extends TextureOperation {
+
+ private int anInt3219 = 204;
+ private int anInt3223;
+ private int anInt3224 = 81;
+ private int[][] anIntArrayArray3225;
+ static CacheIndex configurationsIndex_3227;
+ private int anInt3229 = 1024;
+ private int[] anIntArray3230;
+ private int anInt3231 = 0;
+ private static RSString aString_3232 = RSString.parse("pt");
+ private int anInt3233 = 8;
+ private int anInt3234 = 1024;
+ private int anInt3235;
+ private int anInt3236 = 409;
+ private static final RSString aString_3237 = RSString.parse("en");
+ private static RSString aString_3239 = RSString.parse("fr");
+ private int[][] anIntArrayArray3240;
+ private int anInt3242 = 4;
+ private static final RSString aString_3243 = RSString.parse("de");
+ static RSString[] aStringArray3238 = new RSString[]{aString_3237, aString_3243, aString_3239, aString_3232};
+
+
+ final void postDecode() {
+ try {
+ this.method263();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "mc.P(" + ')');
+ }
+ }
+
+ static void method260(int var1, int var2) {
+ try {
+
+ InterfaceWidget var3 = InterfaceWidget.getWidget(7, var1);
+ var3.flagUpdate();
+ var3.anInt3598 = var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "mc.O(" + -16207 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(0 == var1) {
+ this.anInt3242 = var2.readUnsignedByte();
+ } else if (var1 == 1) {
+ this.anInt3233 = var2.readUnsignedByte();
+ } else if (var1 == 2) {
+ this.anInt3236 = var2.readUnsignedShort();
+ } else if (var1 == 3) {
+ this.anInt3219 = var2.readUnsignedShort();
+ } else if (4 == var1) {
+ this.anInt3234 = var2.readUnsignedShort();
+ } else if (var1 == 5) {
+ this.anInt3231 = var2.readUnsignedShort();
+ } else if (var1 == 6) {
+ this.anInt3224 = var2.readUnsignedShort();
+ } else if (var1 == 7) {
+ this.anInt3229 = var2.readUnsignedShort();
+ }
+
+ if(!true) {
+ aString_3239 = null;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "mc.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ static void method262(int var0, int var2, int var3, int var4, int var5, int var6, int var7) {
+ try {
+ int var8 = var5 + var2;
+ int var10 = var5 + var7;
+
+ int var12;
+ for(var12 = var2; var12 < var8; ++var12) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var12], var7, 125, var6, var0);
+ }
+
+ int var9 = -var5 + var3;
+ int var11 = -var5 + var6;
+
+ for(var12 = var3; var12 > var9; --var12) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var12], var7, 103, var6, var0);
+ }
+
+ for(var12 = var8; var12 <= var9; ++var12) {
+ int[] var13 = Class38.anIntArrayArray663[var12];
+ TextureOperation18.method282(var13, var7, 117, var10, var0);
+ TextureOperation18.method282(var13, var10, 111, var11, var4);
+ TextureOperation18.method282(var13, var11, -75, var6, var0);
+ }
+
+ } catch (RuntimeException var14) {
+ throw ClientErrorException.clientError(var14, "mc.Q(" + var0 + ',' + 119 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ private void method263() {
+ try {
+ Random var2 = new Random(this.anInt3233);
+ int anInt3222 = 4096 / this.anInt3233;
+ this.anInt3223 = this.anInt3224 / 2;
+ this.anIntArrayArray3225 = new int[this.anInt3233][1 + this.anInt3242];
+ int var4 = anInt3222 / 2;
+ this.anIntArray3230 = new int[this.anInt3233 - -1];
+ this.anIntArrayArray3240 = new int[this.anInt3233][this.anInt3242];
+ this.anInt3235 = 4096 / this.anInt3242;
+ this.anIntArray3230[0] = 0;
+ int var3 = this.anInt3235 / 2;
+
+ for(int var5 = 0; this.anInt3233 > var5; ++var5) {
+ int var6;
+ int var7;
+ if(var5 > 0) {
+ var6 = anInt3222;
+ var7 = (TextureOperation.method1603((byte)59, 4096, var2) + -2048) * this.anInt3219 >> 12;
+ var6 += var7 * var4 >> 12;
+ this.anIntArray3230[var5] = this.anIntArray3230[var5 - 1] - -var6;
+ }
+
+ this.anIntArrayArray3225[var5][0] = 0;
+
+ for(var6 = 0; this.anInt3242 > var6; ++var6) {
+ if(0 < var6) {
+ var7 = this.anInt3235;
+ int var8 = (-2048 + TextureOperation.method1603((byte)-1, 4096, var2)) * this.anInt3236 >> 12;
+ var7 += var3 * var8 >> 12;
+ this.anIntArrayArray3225[var5][var6] = this.anIntArrayArray3225[var5][var6 + -1] - -var7;
+ }
+
+ this.anIntArrayArray3240[var5][var6] = this.anInt3229 <= 0 ?4096:4096 + -TextureOperation.method1603((byte)33, this.anInt3229, var2);
+ }
+
+ this.anIntArrayArray3225[var5][this.anInt3242] = 4096;
+ }
+
+ this.anIntArray3230[this.anInt3233] = 4096;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "mc.E(" + 0 + ')');
+ }
+ }
+
+ static void method264(byte var0) {
+ try {
+ TextureOperation12.outgoingBuffer.putOpcode(184);
+
+ for(Class3_Sub31 var1 = TextureOperation23.aHashTable_3208.first(); null != var1; var1 = TextureOperation23.aHashTable_3208.next()) {
+ if(var1.anInt2603 == 0) {
+ TextureOperation19.method254(true, var1);
+ }
+ }
+
+ if(var0 < 83) {
+ aString_3232 = null;
+ }
+
+ if(null != TextureOperation27.aClass11_3087) {
+ Class20.method909(TextureOperation27.aClass11_3087);
+ TextureOperation27.aClass11_3087 = null;
+ }
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "mc.C(" + var0 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ int var4;
+ if(this.aClass114_2382.aBoolean1580) {
+ int var7 = 0;
+
+ int var9;
+ for(var9 = Class163_Sub3.anIntArray2999[var1] + this.anInt3231; var9 < 0; var9 += 4096) {
+ }
+
+ while(4096 < var9) {
+ var9 -= 4096;
+ }
+
+ while(this.anInt3233 > var7 && this.anIntArray3230[var7] <= var9) {
+ ++var7;
+ }
+
+ int var11 = var7 + -1;
+ int var15 = this.anIntArray3230[var7];
+ boolean var12 = 0 == (var7 & 1);
+ int var16 = this.anIntArray3230[var7 - 1];
+ if(var16 - -this.anInt3223 < var9 && var9 < var15 - this.anInt3223) {
+ for(var4 = 0; var4 < Class113.anInt1559; ++var4) {
+ int var6 = 0;
+ int var5 = !var12?-this.anInt3234:this.anInt3234;
+
+ int var8;
+ for(var8 = Class102.anIntArray2125[var4] - -(this.anInt3235 * var5 >> 12); var8 < 0; var8 += 4096) {
+ }
+
+ while(var8 > 4096) {
+ var8 -= 4096;
+ }
+
+ while(var6 < this.anInt3242 && this.anIntArrayArray3225[var11][var6] <= var8) {
+ ++var6;
+ }
+
+ int var14 = this.anIntArrayArray3225[var11][var6];
+ int var10 = var6 - 1;
+ int var13 = this.anIntArrayArray3225[var11][var10];
+ if(var8 > var13 - -this.anInt3223 && var8 < -this.anInt3223 + var14) {
+ var3[var4] = this.anIntArrayArray3240[var11][var10];
+ } else {
+ var3[var4] = 0;
+ }
+ }
+ } else {
+ ArrayUtils.fill(var3, 0, Class113.anInt1559, 0);
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "mc.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation4() {
+ super(0, true);
+ }
+
+ static void method265(int var1) {
+ try {
+ InterfaceWidget var2 = InterfaceWidget.getWidget(8, var1);
+ var2.a();
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "mc.B(" + (byte) -42 + ',' + var1 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation5.java b/Client/src/main/java/org/runite/client/TextureOperation5.java
new file mode 100644
index 000000000..ffcfeda0a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation5.java
@@ -0,0 +1,163 @@
+package org.runite.client;
+
+import java.util.Objects;
+
+final class TextureOperation5 extends TextureOperation {
+
+ private int anInt3294 = 1;
+ static RSString aString_3295;
+ private int anInt3297 = 1;
+
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int var5 = 1 + this.anInt3297 + this.anInt3297;
+ int var6 = 65536 / var5;
+ int var7 = 1 + this.anInt3294 + this.anInt3294;
+ int var8 = 65536 / var7;
+ int[][] var9 = new int[var5][];
+
+ int var10;
+ for(var10 = -this.anInt3297 + var1; var1 - -this.anInt3297 >= var10; ++var10) {
+ int[] var11 = this.method152(0, var10 & Class3_Sub20.anInt2487);
+ int[] var12 = new int[Class113.anInt1559];
+ int var13 = 0;
+
+ int var14;
+ for(var14 = -this.anInt3294; var14 <= this.anInt3294; ++var14) {
+ var13 += var11[var14 & RenderAnimationDefinition.anInt396];
+ }
+
+ for(var14 = 0; var14 < Class113.anInt1559; var13 += var11[RenderAnimationDefinition.anInt396 & this.anInt3294 + var14]) {
+ var12[var14] = var8 * var13 >> 16;
+ var13 -= var11[RenderAnimationDefinition.anInt396 & var14 - this.anInt3294];
+ ++var14;
+ }
+
+ var9[this.anInt3297 + var10 + -var1] = var12;
+ }
+
+ for(var10 = 0; var10 < Class113.anInt1559; ++var10) {
+ int var16 = 0;
+
+ for(int var17 = 0; var5 > var17; ++var17) {
+ var16 += var9[var17][var10];
+ }
+
+ var4[var10] = var6 * var16 >> 16;
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "nm.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation5() {
+ super(1, false);
+ }
+
+ final int[][] method166(int var2) {
+ try {
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)90, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int var6 = this.anInt3294 - -this.anInt3294 - -1;
+ int var7 = 65536 / var6;
+ int var4 = this.anInt3297 + (this.anInt3297 - -1);
+ int var5 = 65536 / var4;
+ int[][][] var8 = new int[var4][][];
+
+ int var12;
+ int var13;
+ int var14;
+ for(int var9 = var2 - this.anInt3297; this.anInt3297 + var2 >= var9; ++var9) {
+ int[][] var10 = this.method162(Class3_Sub20.anInt2487 & var9, 0, (byte)-59);
+ var12 = 0;
+ var13 = 0;
+ int[][] var11 = new int[3][Class113.anInt1559];
+ var14 = 0;
+ int[] var15 = Objects.requireNonNull(var10)[0];
+ int[] var16 = var10[1];
+ int[] var17 = var10[2];
+
+ for(int var18 = -this.anInt3294; var18 <= this.anInt3294; ++var18) {
+ int var19 = var18 & RenderAnimationDefinition.anInt396;
+ var13 += var16[var19];
+ var12 += var15[var19];
+ var14 += var17[var19];
+ }
+
+ int[] var20 = var11[2];
+ int[] var31 = var11[0];
+ int[] var30 = var11[1];
+
+ int var22;
+ for(int var21 = 0; Class113.anInt1559 > var21; var12 += var15[var22]) {
+ var31[var21] = var12 * var7 >> 16;
+ var30[var21] = var13 * var7 >> 16;
+ var20[var21] = var7 * var14 >> 16;
+ var22 = RenderAnimationDefinition.anInt396 & var21 + -this.anInt3294;
+ var14 -= var17[var22];
+ ++var21;
+ var12 -= var15[var22];
+ var13 -= var16[var22];
+ var22 = this.anInt3294 + var21 & RenderAnimationDefinition.anInt396;
+ var14 += var17[var22];
+ var13 += var16[var22];
+ }
+
+ var8[-var2 + this.anInt3297 + var9] = var11;
+ }
+
+ int[] var24 = var3[0];
+ int[] var26 = var3[1];
+ int[] var25 = var3[2];
+
+ for(var12 = 0; var12 < Class113.anInt1559; ++var12) {
+ var14 = 0;
+ var13 = 0;
+ int var27 = 0;
+
+ for(int var28 = 0; var28 < var4; ++var28) {
+ int[][] var29 = var8[var28];
+ var27 += var29[2][var12];
+ var14 += var29[1][var12];
+ var13 += var29[0][var12];
+ }
+
+ var24[var12] = var5 * var13 >> 16;
+ var26[var12] = var5 * var14 >> 16;
+ var25[var12] = var27 * var5 >> 16;
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "nm.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3294 = var2.readUnsignedByte();
+ } else if(var1 == 1) {
+ this.anInt3297 = var2.readUnsignedByte();
+ } else if (2 == var1) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ if(!true) {
+ this.anInt3294 = 60;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "nm.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation6.java b/Client/src/main/java/org/runite/client/TextureOperation6.java
new file mode 100644
index 000000000..34b2ee21a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation6.java
@@ -0,0 +1,241 @@
+package org.runite.client;
+
+import org.rs09.client.data.HashTable;
+
+import java.util.Objects;
+
+final class TextureOperation6 extends TextureOperation {
+
+ //static RSString aString_3042 = RSString.createRSString(" ");
+ private int anInt3043 = 0;
+ private int anInt3046 = 4096;
+
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(0 == var1) {
+ this.anInt3043 = var2.readUnsignedShort();
+ } else if(1 == var1) {
+ this.anInt3046 = var2.readUnsignedShort();
+ } else if (2 == var1) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ //aString_3042 = (RSString)null;
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "aj.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ method175(2, -7, -114, -24, 102, -125);
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)-119, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(var2, 0, (byte)-124);
+ int[] var6 = Objects.requireNonNull(var4)[1];
+ int[] var7 = var4[2];
+ int[] var5 = var4[0];
+ int[] var8 = var3[0];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+
+ for(int var11 = 0; var11 < Class113.anInt1559; ++var11) {
+ int var13 = var6[var11];
+ int var12 = var5[var11];
+ int var14 = var7[var11];
+ if(var12 >= this.anInt3043) {
+ if(var12 > this.anInt3046) {
+ var8[var11] = this.anInt3046;
+ } else {
+ var8[var11] = var12;
+ }
+ } else {
+ var8[var11] = this.anInt3043;
+ }
+
+ if(this.anInt3043 > var13) {
+ var9[var11] = this.anInt3043;
+ } else if(var13 <= this.anInt3046) {
+ var9[var11] = var13;
+ } else {
+ var9[var11] = this.anInt3046;
+ }
+
+ if(var14 >= this.anInt3043) {
+ if(this.anInt3046 >= var14) {
+ var10[var11] = var14;
+ } else {
+ var10[var11] = this.anInt3046;
+ }
+ } else {
+ var10[var11] = this.anInt3043;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "aj.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static int method173(byte var0, int var1, RSInterface var2) {
+ try {
+ if(var0 < 4) {
+ method176(-50);
+ }
+
+ return !Client.method44(var2).method92(var1, (byte)-109) && null == var2.anObjectArray314?-1:(null != var2.anIntArray249 && var2.anIntArray249.length > var1 ?var2.anIntArray249[var1]:-1);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "aj.F(" + var0 + ',' + var1 + ',' + (var2 != null?"{...}":"null") + ')');
+ }
+ }
+
+ static void method175(int var0, int var1, int var2, int var4, int var5, int var6) {
+ try {
+ MouseListeningClass.method2091(var5);
+ int var8 = var5 - var1;
+ int var7 = 0;
+ if(var8 < 0) {
+ var8 = 0;
+ }
+
+ int var10 = -var5;
+ int var9 = var5;
+ int var11 = var8;
+ int var12 = -var8;
+ int var14 = -1;
+ int[] var15 = Class38.anIntArrayArray663[var2];
+ int var17 = var6 - -var8;
+ int var13 = -1;
+ int var16 = -var8 + var6;
+ TextureOperation18.method282(var15, -var5 + var6, -40, var16, var0);
+ TextureOperation18.method282(var15, var16, -51, var17, var4);
+ TextureOperation18.method282(var15, var17, -41, var6 - -var5, var0);
+
+ while(var9 > var7) {
+ var14 += 2;
+ var12 += var14;
+ if(var12 >= 0 && var11 >= 1) {
+ GameObject.anIntArray1838[var11] = var7;
+ --var11;
+ var12 -= var11 << 1;
+ }
+
+ ++var7;
+ var13 += 2;
+ var10 += var13;
+ int[] var19;
+ int[] var18;
+ int var21;
+ int var20;
+ int var23;
+ int var22;
+ int var24;
+ if(var10 >= 0) {
+ --var9;
+ var10 -= var9 << 1;
+ if(var9 < var8) {
+ var18 = Class38.anIntArrayArray663[var9 + var2];
+ var19 = Class38.anIntArrayArray663[-var9 + var2];
+ var22 = -var7 + var6;
+ var21 = var7 + var6;
+ var20 = GameObject.anIntArray1838[var9];
+ var24 = -var20 + var6;
+ var23 = var20 + var6;
+ TextureOperation18.method282(var18, var22, -113, var24, var0);
+ TextureOperation18.method282(var18, var24, 95, var23, var4);
+ TextureOperation18.method282(var18, var23, 117, var21, var0);
+ TextureOperation18.method282(var19, var22, 113, var24, var0);
+ TextureOperation18.method282(var19, var24, -76, var23, var4);
+ TextureOperation18.method282(var19, var23, -97, var21, var0);
+ } else {
+ var18 = Class38.anIntArrayArray663[var2 + var9];
+ var19 = Class38.anIntArrayArray663[var2 - var9];
+ var20 = var7 + var6;
+ var21 = var6 + -var7;
+ TextureOperation18.method282(var18, var21, 113, var20, var0);
+ TextureOperation18.method282(var19, var21, -100, var20, var0);
+ }
+ }
+
+ var18 = Class38.anIntArrayArray663[var2 - -var7];
+ var19 = Class38.anIntArrayArray663[var2 - var7];
+ var20 = var9 + var6;
+ var21 = -var9 + var6;
+ if(var8 <= var7) {
+ TextureOperation18.method282(var18, var21, 104, var20, var0);
+ TextureOperation18.method282(var19, var21, -127, var20, var0);
+ } else {
+ var22 = var7 <= var11?var11:GameObject.anIntArray1838[var7];
+ var23 = var22 + var6;
+ var24 = var6 + -var22;
+ TextureOperation18.method282(var18, var21, -94, var24, var0);
+ TextureOperation18.method282(var18, var24, 115, var23, var4);
+ TextureOperation18.method282(var18, var23, 110, var20, var0);
+ TextureOperation18.method282(var19, var21, -114, var24, var0);
+ TextureOperation18.method282(var19, var24, -79, var23, var4);
+ TextureOperation18.method282(var19, var23, 120, var20, var0);
+ }
+ }
+
+ } catch (RuntimeException var25) {
+ throw ClientErrorException.clientError(var25, "aj.C(" + var0 + ',' + var1 + ',' + var2 + ',' + true + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ public TextureOperation6() {
+ super(1, false);
+ }
+
+ static void method176(int var0) {
+ try {
+ int var1 = 0;
+ if(var0 >= -111) {
+ method176(40);
+ }
+
+ for(; var1 < Class95.anInt1344; ++var1) {
+ Class29 var2 = Class145.method2076(var1);
+ if(null != var2 && var2.anInt556 == 0) {
+ Class57.varpArray[var1] = 0;
+ ItemDefinition.ram[var1] = 0;
+ }
+ }
+
+ AtmosphereParser.aHashTable_3679 = new HashTable(16);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "aj.O(" + var0 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, var1);
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var7 = var5[var6];
+ if(this.anInt3043 > var7) {
+ var3[var6] = this.anInt3043;
+ } else if(this.anInt3046 >= var7) {
+ var3[var6] = var7;
+ } else {
+ var3[var6] = this.anInt3046;
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "aj.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation7.java b/Client/src/main/java/org/runite/client/TextureOperation7.java
new file mode 100644
index 000000000..1d9a64233
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation7.java
@@ -0,0 +1,605 @@
+package org.runite.client;
+
+import org.rs09.client.data.HashTable;
+
+import java.util.Objects;
+
+final class TextureOperation7 extends TextureOperation {
+
+ static RSString[] aStringArray3341 = new RSString[100];
+ static int anInt3342;
+ private int anInt3343 = 6;
+
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var3 = this.aClass114_2382.method1709(var1);
+ int var4;
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var6 = this.method152(0, var1);
+ int[] var7 = this.method152(1, var1);
+ int var8 = this.anInt3343;
+ if(var8 == 1) {
+ for(var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var3[var8] = var7[var8] + var6[var8];
+ }
+ } else if(var8 == 2) {
+ for(var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var3[var8] = -var7[var8] + var6[var8];
+ }
+ } else if (var8 == 3) {
+ for (var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var3[var8] = var7[var8] * var6[var8] >> 12;
+ }
+ } else {
+ int var5;
+ if (var8 == 4) {
+ for (var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var5 = var7[var8];
+ var3[var8] = var5 != 0 ? (var6[var8] << 12) / var5 : 4096;
+ }
+ } else if (var8 == 5) {
+ for (var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var3[var8] = 4096 - ((-var6[var8] + 4096) * (-var7[var8] + 4096) >> 12);
+ }
+ } else if (var8 == 6) {
+ for (var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var5 = var7[var8];
+ var3[var8] = var5 >= 2048 ? -((-var6[var8] + 4096) * (4096 + -var5) >> 11) + 4096 : var5 * var6[var8] >> 11;
+ }
+ } else if (var8 == 7) {
+ for (var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var4 = var6[var8];
+ var3[var8] = var4 == 4096 ? 4096 : (var7[var8] << 12) / (4096 - var4);
+ }
+ } else if (var8 == 8) {
+ for (var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var4 = var6[var8];
+ var3[var8] = var4 != 0 ? 4096 - (-var7[var8] + 4096 << 12) / var4 : 0;
+ }
+ } else if (var8 == 9) {
+ for (var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var5 = var7[var8];
+ var4 = var6[var8];
+ var3[var8] = var5 > var4 ? var4 : var5;
+ }
+ } else if (10 == var8) {
+ for (var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var5 = var7[var8];
+ var4 = var6[var8];
+ var3[var8] = var5 < var4 ? var4 : var5;
+ }
+ } else if (var8 == 11) {
+ for (var8 = 0; var8 < Class113.anInt1559; ++var8) {
+ var4 = var6[var8];
+ var5 = var7[var8];
+ var3[var8] = var4 > var5 ? var4 + -var5 : var5 - var4;
+ }
+ } else if (var8 == 12) {
+ for (var8 = 0; Class113.anInt1559 > var8; ++var8) {
+ var4 = var6[var8];
+ var5 = var7[var8];
+ var3[var8] = var5 + (var4 - (var4 * var5 >> 11));
+ }
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "pi.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ int[][] var3 = this.aClass97_2376.method1594((byte)-125, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var10 = this.method162(var2, 0, (byte)-87);
+ int[][] var11 = this.method162(var2, 1, (byte)-73);
+ int[] var12 = var3[0];
+ int[] var13 = var3[1];
+ int[] var14 = var3[2];
+ int[] var15 = Objects.requireNonNull(var10)[0];
+ int[] var16 = var10[1];
+ int[] var17 = var10[2];
+ int[] var18 = Objects.requireNonNull(var11)[0];
+ int[] var19 = var11[1];
+ int[] var20 = var11[2];
+ int var21 = this.anInt3343;
+ if(var21 == 1) {
+ for(var21 = 0; var21 < Class113.anInt1559; ++var21) {
+ var12[var21] = var18[var21] + var15[var21];
+ var13[var21] = var19[var21] + var16[var21];
+ var14[var21] = var17[var21] - -var20[var21];
+ }
+ } else if(var21 == 2) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var12[var21] = var15[var21] - var18[var21];
+ var13[var21] = -var19[var21] + var16[var21];
+ var14[var21] = -var20[var21] + var17[var21];
+ }
+ } else if(3 == var21) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var12[var21] = var18[var21] * var15[var21] >> 12;
+ var13[var21] = var16[var21] * var19[var21] >> 12;
+ var14[var21] = var20[var21] * var17[var21] >> 12;
+ }
+ } else {
+ int var7;
+ int var8;
+ int var9;
+ if(var21 == 4) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var9 = var20[var21];
+ var8 = var19[var21];
+ var7 = var18[var21];
+ var12[var21] = var7 == 0 ?4096:(var15[var21] << 12) / var7;
+ var13[var21] = var8 != 0 ?(var16[var21] << 12) / var8:4096;
+ var14[var21] = var9 != 0?(var17[var21] << 12) / var9:4096;
+ }
+ } else if(var21 == 5) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var12[var21] = 4096 + -((4096 - var18[var21]) * (4096 - var15[var21]) >> 12);
+ var13[var21] = 4096 - ((-var19[var21] + 4096) * (-var16[var21] + 4096) >> 12);
+ var14[var21] = 4096 + -((-var20[var21] + 4096) * (4096 + -var17[var21]) >> 12);
+ }
+ } else if(6 == var21) {
+ for(var21 = 0; var21 < Class113.anInt1559; ++var21) {
+ var9 = var20[var21];
+ var7 = var18[var21];
+ var8 = var19[var21];
+ var12[var21] = var7 >= 2048 ?-((-var7 + 4096) * (-var15[var21] + 4096) >> 11) + 4096:var7 * var15[var21] >> 11;
+ var13[var21] = 2048 > var8?var8 * var16[var21] >> 11:4096 - ((4096 + -var8) * (-var16[var21] + 4096) >> 11);
+ var14[var21] = 2048 <= var9?4096 + -((4096 + -var9) * (-var17[var21] + 4096) >> 11):var17[var21] * var9 >> 11;
+ }
+ } else {
+ int var4;
+ int var5;
+ int var6;
+ if(var21 == 7) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var6 = var17[var21];
+ var4 = var15[var21];
+ var5 = var16[var21];
+ var12[var21] = var4 == 4096 ?4096:(var18[var21] << 12) / (-var4 + 4096);
+ var13[var21] = var5 == 4096 ?4096:(var19[var21] << 12) / (4096 + -var5);
+ var14[var21] = var6 == 4096 ?4096:(var20[var21] << 12) / (4096 - var6);
+ }
+ } else if(var21 == 8) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var4 = var15[var21];
+ var5 = var16[var21];
+ var6 = var17[var21];
+ var12[var21] = var4 == 0?0:-((-var18[var21] + 4096 << 12) / var4) + 4096;
+ var13[var21] = var5 == 0 ?0:-((-var19[var21] + 4096 << 12) / var5) + 4096;
+ var14[var21] = 0 == var6?0:4096 - (4096 - var20[var21] << 12) / var6;
+ }
+ } else if(var21 == 9) {
+ for(var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var6 = var17[var21];
+ var9 = var20[var21];
+ var8 = var19[var21];
+ var5 = var16[var21];
+ var7 = var18[var21];
+ var4 = var15[var21];
+ var12[var21] = var7 <= var4 ?var7:var4;
+ var13[var21] = var5 >= var8?var8:var5;
+ var14[var21] = var6 < var9?var6:var9;
+ }
+ } else if (10 == var21) {
+ for (var21 = 0; var21 < Class113.anInt1559; ++var21) {
+ var9 = var20[var21];
+ var6 = var17[var21];
+ var8 = var19[var21];
+ var4 = var15[var21];
+ var5 = var16[var21];
+ var7 = var18[var21];
+ var12[var21] = var7 < var4 ? var4 : var7;
+ var13[var21] = var5 > var8 ? var5 : var8;
+ var14[var21] = var6 > var9 ? var6 : var9;
+ }
+ } else if (var21 == 11) {
+ for (var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var8 = var19[var21];
+ var7 = var18[var21];
+ var5 = var16[var21];
+ var4 = var15[var21];
+ var6 = var17[var21];
+ var9 = var20[var21];
+ var12[var21] = var7 < var4 ? var4 + -var7 : -var4 + var7;
+ var13[var21] = var5 > var8 ? -var8 + var5 : -var5 + var8;
+ var14[var21] = var9 < var6 ? var6 + -var9 : -var6 + var9;
+ }
+ } else if (var21 == 12) {
+ for (var21 = 0; Class113.anInt1559 > var21; ++var21) {
+ var4 = var15[var21];
+ var9 = var20[var21];
+ var7 = var18[var21];
+ var8 = var19[var21];
+ var6 = var17[var21];
+ var5 = var16[var21];
+ var12[var21] = -(var7 * var4 >> 11) + var7 + var4;
+ var13[var21] = var8 + var5 + -(var5 * var8 >> 11);
+ var14[var21] = var9 + (var6 - (var6 * var9 >> 11));
+ }
+ }
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var22) {
+ throw ClientErrorException.clientError(var22, "pi.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method297(long var0, int var2) {
+ try {
+ if(var0 != 0L) {
+ for(int var3 = 0; Class8.anInt104 > var3; ++var3) {
+ if(var0 == Class50.aLongArray826[var3]) {
+ --Class8.anInt104;
+
+ for(int var4 = var3; var4 < Class8.anInt104; ++var4) {
+ Class70.aStringArray1046[var4] = Class70.aStringArray1046[var4 - -1];
+ Unsorted.anIntArray882[var4] = Unsorted.anIntArray882[var4 + 1];
+ Unsorted.aStringArray2566[var4] = Unsorted.aStringArray2566[1 + var4];
+ Class50.aLongArray826[var4] = Class50.aLongArray826[1 + var4];
+ Class57.anIntArray904[var4] = Class57.anIntArray904[var4 - -1];
+ Unsorted.aBooleanArray73[var4] = Unsorted.aBooleanArray73[1 + var4];
+ }
+
+ Class110.anInt1472 = PacketParser.anInt3213;
+ TextureOperation12.outgoingBuffer.putOpcode(57);
+ TextureOperation12.outgoingBuffer.writeLong(var0);
+ break;
+ }
+ }
+
+ if(var2 != 1) {
+ aStringArray3341 = null;
+ }
+
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "pi.C(" + var0 + ',' + var2 + ')');
+ }
+ }
+
+ static Class3_Sub11[] method298(byte[][][] var0, byte[][] var1, byte[][] var2, int[][] var3, float[][] var4, int[][] var5, byte[][] var6, byte[][] var7, float[][] var8, int var9, float[][] var10, int[][] var11, int[][] var12, int[][] var13) {
+ try {
+ int[][] var15 = new int[105][105];
+
+ int var17;
+ for(int var16 = 1; var16 <= 103; ++var16) {
+ for(var17 = 1; var17 <= 103; ++var17) {
+ byte var18 = var2[var16][var17];
+ if(var18 == 0) {
+ var18 = var2[var16 + -1][var17];
+ }
+
+ if(var18 == 0) {
+ var18 = var2[var16][-1 + var17];
+ }
+
+ if(var18 == 0) {
+ var18 = var2[-1 + var16][var17 - 1];
+ }
+
+ if(0 != var18) {
+ FloorUnderlayDefinition var19 = FloorUnderlayDefinition.method629(-1 + (255 & var18));
+ var15[var16][var17] = (1 + var19.anInt1412 << 16) - -var19.anInt1414;
+ }
+ }
+ }
+
+ HashTable var52 = new HashTable(128);
+
+ int var21;
+ int var20;
+ int var22;
+ int var56;
+ for(var17 = 1; var17 <= 102; ++var17) {
+ for(var56 = 1; 102 >= var56; ++var56) {
+ if(0 != var2[var17][var56]) {
+ int[] var53;
+ if(0 == var6[var17][var56]) {
+ var53 = Class134.anIntArrayArray1763[0];
+ } else {
+ var53 = Class25.anIntArrayArray499[var1[var17][var56]];
+ if(var53.length == 0) {
+ continue;
+ }
+ }
+
+ var20 = 0;
+ var21 = var15[var17][var56];
+ var22 = var15[var17 - -1][var56];
+ if(null != var5) {
+ var20 = var5[var17][var56] & 16777215;
+ }
+
+ long var27 = (long)var20 | (long)var22 << 32;
+ int var24 = var15[var17][var56 + 1];
+ int var23 = var15[var17 + 1][var56 - -1];
+ long var31 = (long)var24 << 32 | (long)var20;
+ int var33 = var53.length / 2;
+ long var25 = (long)var20 | (long)var21 << 32;
+ Class3_Sub11 var34 = (Class3_Sub11)var52.get(var25);
+ if(null == var34) {
+ var34 = new Class3_Sub11(-1 + (var21 >> 16), (float)(65535 & var21), false, null != var13, var20);
+ var52.put(var25, var34);
+ }
+
+ ++var34.anInt2344;
+ var34.anInt2342 += var33;
+ if(var25 != var27) {
+ var34 = (Class3_Sub11)var52.get(var27);
+ if(var34 == null) {
+ var34 = new Class3_Sub11((var22 >> 16) - 1, (float)(65535 & var22), false, null != var13, var20);
+ var52.put(var27, var34);
+ }
+
+ ++var34.anInt2344;
+ var34.anInt2342 += var33;
+ }
+
+ long var29 = (long)var23 << 32 | (long)var20;
+ if(var25 != var29 && var27 != var29) {
+ var34 = (Class3_Sub11)var52.get(var29);
+ if(var34 == null) {
+ var34 = new Class3_Sub11((var23 >> 16) + -1, (float)(65535 & var23), false, null != var13, var20);
+ var52.put(var29, var34);
+ }
+
+ var34.anInt2342 += var33;
+ ++var34.anInt2344;
+ }
+
+ if(var25 != var31 && var31 != var27 && var31 != var29) {
+ var34 = (Class3_Sub11)var52.get(var31);
+ if(null == var34) {
+ var34 = new Class3_Sub11((var24 >> 16) - 1, (float)(var24 & 65535), false, null != var13, var20);
+ var52.put(var31, var34);
+ }
+
+ ++var34.anInt2344;
+ var34.anInt2342 += var33;
+ }
+ }
+ }
+ }
+
+ if(4096 != 4096) {
+ method297(-10L, 48);
+ }
+
+ Class3_Sub11 var54;
+ for(var54 = (Class3_Sub11)var52.first(); var54 != null; var54 = (Class3_Sub11)var52.next()) {
+ var54.method145();
+ }
+
+ for(var17 = 1; var17 <= 102; ++var17) {
+ for(var56 = 1; var56 <= 102; ++var56) {
+ byte var57 = var2[var17][var56];
+ if(0 != var57) {
+ if((8 & var0[var9][var17][var56]) == 0) {
+ if((2 & var0[1][var17][var56]) == 2 && 0 < var9) {
+ var20 = var9 - 1;
+ } else {
+ var20 = var9;
+ }
+ } else {
+ var20 = 0;
+ }
+
+ var21 = 0;
+ boolean[] var60 = null;
+ var22 = 128;
+ if(null != var5) {
+ var22 = var5[var17][var56] >>> 24 << 3;
+ var21 = 16777215 & var5[var17][var56];
+ }
+
+ int[] var58;
+ int var63;
+ int var62;
+ byte var61;
+ int var69;
+ int var64;
+ if(var6[var17][var56] == 0) {
+ byte var26 = 0;
+ var64 = var26 + (var2[var17 - 1][-1 + var56] != var57 ?-1:1);
+ byte var65 = 0;
+ var58 = Class134.anIntArrayArray1763[0];
+ var62 = var65 + (var57 == var2[1 + var17][var56 + -1]?1:-1);
+ if(var2[var17][var56 + -1] == var57) {
+ ++var62;
+ ++var64;
+ } else {
+ --var64;
+ --var62;
+ }
+
+ byte var28 = 0;
+ var63 = var28 + (var57 == var2[1 + var17][1 + var56]?1:-1);
+ byte var68 = 0;
+ if(var2[1 + var17][var56] == var57) {
+ ++var63;
+ ++var62;
+ } else {
+ --var62;
+ --var63;
+ }
+
+ var69 = var68 + (var2[var17 - 1][1 + var56] == var57 ?1:-1);
+ if(var2[var17][1 + var56] == var57) {
+ ++var69;
+ ++var63;
+ } else {
+ --var63;
+ --var69;
+ }
+
+ if(var2[-1 + var17][var56] == var57) {
+ ++var69;
+ ++var64;
+ } else {
+ --var69;
+ --var64;
+ }
+
+ int var30 = var64 + -var63;
+ int var66 = -var69 + var62;
+ if(var66 < 0) {
+ var66 = -var66;
+ }
+
+ if(var30 < 0) {
+ var30 = -var30;
+ }
+
+ var61 = (byte)(var30 >= var66 ?0:1);
+ var7[var17][var56] = var61;
+ } else {
+ var58 = Class25.anIntArrayArray499[var1[var17][var56]];
+ var60 = TextureOperation30.aBooleanArrayArray3118[var1[var17][var56]];
+ var61 = var7[var17][var56];
+ if(var58.length == 0) {
+ continue;
+ }
+ }
+
+ var64 = var15[var17][var56];
+ var62 = var15[var17 - -1][var56];
+ var63 = var15[var17 - -1][var56 - -1];
+ long var67 = (long)var64 << 32 | (long)var21;
+ long var32 = (long)var62 << 32 | (long)var21;
+ long var70 = (long)var63 << 32 | (long)var21;
+ int var38 = var11[var17][var56];
+ var69 = var15[var17][var56 - -1];
+ int var40 = var11[var17 - -1][var56 - -1];
+ int var39 = var11[1 + var17][var56];
+ long var36 = (long)var21 | (long)var69 << 32;
+ int var41 = var11[var17][var56 + 1];
+ int var42 = var3[var17][var56];
+ int var43 = var3[var17 + 1][var56];
+ int var44 = var3[var17 + 1][var56 - -1];
+ int var45 = var3[var17][1 + var56];
+ int var47 = -1 + (var62 >> 16);
+ int var46 = (var64 >> 16) - 1;
+ int var48 = (var63 >> 16) - 1;
+ Class3_Sub11 var50 = (Class3_Sub11)var52.get(var67);
+ Class25.method955(var13, var64 <= var64, TextureOperation34.method190(var46, var38, (byte)-92, var42), var50, var58, var56, var20, var17, var64 <= var63, var8, var69 >= var64, 2, var4, var22, TextureOperation34.method190(var46, var41, (byte)-80, var45), TextureOperation34.method190(var46, var40, (byte)-103, var44), var62 >= var64, var12, var10, var61, TextureOperation34.method190(var46, var39, (byte)-118, var43), var60);
+ int var49 = (var69 >> 16) - 1;
+ if(var32 != var67) {
+ var50 = (Class3_Sub11)var52.get(var32);
+ Class25.method955(var13, var62 <= var64, TextureOperation34.method190(var47, var38, (byte)88, var42), var50, var58, var56, var20, var17, var63 >= var62, var8, var62 <= var69, 2, var4, var22, TextureOperation34.method190(var47, var41, (byte)-82, var45), TextureOperation34.method190(var47, var40, (byte)-113, var44), var62 <= var62, var12, var10, var61, TextureOperation34.method190(var47, var39, (byte)113, var43), var60);
+ }
+
+ if(var70 != var67 && var32 != var70) {
+ var50 = (Class3_Sub11)var52.get(var70);
+ Class25.method955(var13, var63 <= var64, TextureOperation34.method190(var48, var38, (byte)59, var42), var50, var58, var56, var20, var17, var63 <= var63, var8, var63 <= var69, 4096 ^ 4098, var4, var22, TextureOperation34.method190(var48, var41, (byte)54, var45), TextureOperation34.method190(var48, var40, (byte)-87, var44), var63 <= var62, var12, var10, var61, TextureOperation34.method190(var48, var39, (byte)-77, var43), var60);
+ }
+
+ if(var67 != var36 && var32 != var36 && var36 != var70) {
+ var50 = (Class3_Sub11)var52.get(var36);
+ Class25.method955(var13, var64 >= var69, TextureOperation34.method190(var49, var38, (byte)-118, var42), var50, var58, var56, var20, var17, var69 <= var63, var8, var69 <= var69, 4096 ^ 4098, var4, var22, TextureOperation34.method190(var49, var41, (byte)-96, var45), TextureOperation34.method190(var49, var40, (byte)115, var44), var69 <= var62, var12, var10, var61, TextureOperation34.method190(var49, var39, (byte)58, var43), var60);
+ }
+ }
+ }
+ }
+
+ for(var54 = (Class3_Sub11)var52.first(); var54 != null; var54 = (Class3_Sub11)var52.next()) {
+ if(var54.anInt2343 == 0) {
+ var54.unlink();
+ } else {
+ var54.method148();
+ }
+ }
+
+ var17 = var52.size();
+ Class3_Sub11[] var59 = new Class3_Sub11[var17];
+ var52.values(var59);
+ long[] var55 = new long[var17];
+
+ for(var20 = 0; var17 > var20; ++var20) {
+ var55[var20] = var59[var20].linkableKey;
+ }
+
+ PacketParser.method824(var55, var59, -86);
+ return var59;
+ } catch (RuntimeException var51) {
+ throw ClientErrorException.clientError(var51, "pi.E(" + (var0 != null?"{...}":"null") + ',' + (var1 != null?"{...}":"null") + ',' + (var2 != null?"{...}":"null") + ',' + (var3 != null?"{...}":"null") + ',' + (var4 != null?"{...}":"null") + ',' + (var5 != null?"{...}":"null") + ',' + (var6 != null?"{...}":"null") + ',' + (var7 != null?"{...}":"null") + ',' + (var8 != null?"{...}":"null") + ',' + var9 + ',' + (var10 != null?"{...}":"null") + ',' + (var11 != null?"{...}":"null") + ',' + (var12 != null?"{...}":"null") + ',' + (var13 != null?"{...}":"null") + ',' + 4096 + ')');
+ }
+ }
+
+ public TextureOperation7() {
+ super(2, false);
+ }
+
+ static void method299(int var0, int var1, int var2) {
+ try {
+ if(var0 <= 92) {
+ method297(-6L, -85);
+ }
+
+ int var3 = var1;
+ if(var1 > 25) {
+ var3 = 25;
+ }
+
+ --var1;
+ int var4 = TextureOperation38.anIntArray3456[var1];
+ int var5 = Class45.anIntArray729[var1];
+ if(0 == var2) {
+ TextureOperation12.outgoingBuffer.putOpcode(215);
+ TextureOperation12.outgoingBuffer.writeByte(var3 - -var3 + 3);
+ }
+
+ if(var2 == 1) {
+ TextureOperation12.outgoingBuffer.putOpcode(39);
+ TextureOperation12.outgoingBuffer.writeByte(3 + var3 - (-var3 - 14));
+ }
+
+ if(var2 == 2) {
+ TextureOperation12.outgoingBuffer.putOpcode(77);
+ TextureOperation12.outgoingBuffer.writeByte(var3 + var3 - -3);
+ }
+
+ TextureOperation12.outgoingBuffer.writeByte128(ObjectDefinition.aBooleanArray1490[82]?1:0);
+ TextureOperation12.outgoingBuffer.writeShort(Class131.x1716 + var4);
+ TextureOperation12.outgoingBuffer.putShortA(Texture.y1152 + var5);
+ Class45.anInt733 = Class45.anIntArray729[0];
+ Class65.anInt987 = TextureOperation38.anIntArray3456[0];
+
+ for(int var6 = 1; var3 > var6; ++var6) {
+ --var1;
+ TextureOperation12.outgoingBuffer.writeByte128(-var4 + TextureOperation38.anIntArray3456[var1]);
+ TextureOperation12.outgoingBuffer.write128Byte(Class45.anIntArray729[var1] + -var5);
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "pi.O(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(var1 == 0) {
+ this.anInt3343 = var2.readUnsignedByte();
+ } else if(var1 == 1) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ if(!true) {
+ TextCore.aString_3339 = null;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "pi.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation8.java b/Client/src/main/java/org/runite/client/TextureOperation8.java
new file mode 100644
index 000000000..ecefb2e42
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation8.java
@@ -0,0 +1,244 @@
+package org.runite.client;
+
+final class TextureOperation8 extends TextureOperation {
+
+ private int[] anIntArray3457;
+ static AbstractSprite[] aAbstractSpriteArray3458;
+ static int anInt3460 = 0;
+ private int anInt3462 = 0;
+ static int anInt3463;
+ static int anInt3464 = 0;
+ private final short[] aShortArray3465 = new short[257];
+ static int renderDistanceTiles;
+ private int[] anIntArray3467;
+ static boolean[][] aBooleanArrayArray3468 = new boolean[][]{{true, true, true}, {false, false}, {false, true}, {true, false}, {false, true, true}, {true, false, true}, {false, true, false}, {true, false, false}};
+ private int[][] anIntArrayArray3469;
+
+
+ private void method352() {
+ try {
+ int var2 = this.anInt3462;
+ int var3;
+ int var4;
+ int[] var5;
+ int[] var6;
+ int var7;
+ int var8;
+ int var9;
+ int var10;
+ if(2 == var2) {
+ for(var2 = 0; var2 < 257; ++var2) {
+ var4 = var2 << 4;
+
+ for(var3 = 1; this.anIntArrayArray3469.length - 1 > var3 && this.anIntArrayArray3469[var3][0] <= var4; ++var3) {
+ }
+
+ var6 = this.anIntArrayArray3469[var3];
+ var5 = this.anIntArrayArray3469[var3 + -1];
+ var7 = this.method356(var3 + -2)[1];
+ var9 = var6[1];
+ var8 = var5[1];
+ int var15 = var9 - var7;
+ var10 = this.method356(var3 + 1)[1];
+ int var11 = (var4 + -var5[0] << 12) / (var6[0] + -var5[0]);
+ int var13 = var10 + -var9 + -var7 + var8;
+ int var12 = var11 * var11 >> 12;
+ int var14 = var7 + (-var8 - var13);
+ int var19 = var15 * var11 >> 12;
+ int var18 = var12 * var14 >> 12;
+ int var17 = var12 * (var11 * var13 >> 12) >> 12;
+ int var20 = var8 + var18 + var17 + var19;
+ if(var20 <= -32768) {
+ var20 = -32767;
+ }
+
+ if(var20 >= 32768) {
+ var20 = 32767;
+ }
+
+ this.aShortArray3465[var2] = (short)var20;
+ }
+ } else if (var2 == 1) {
+ for (var2 = 0; var2 < 257; ++var2) {
+ var4 = var2 << 4;
+
+ for (var3 = 1; -1 + this.anIntArrayArray3469.length > var3 && var4 >= this.anIntArrayArray3469[var3][0]; ++var3) {
+ }
+
+ var5 = this.anIntArrayArray3469[-1 + var3];
+ var6 = this.anIntArrayArray3469[var3];
+ var7 = (var4 + -var5[0] << 12) / (-var5[0] + var6[0]);
+ var8 = 4096 + -Class75_Sub2.anIntArray2639[(8189 & var7) >> 5] >> 1;
+ var9 = -var8 + 4096;
+ var10 = var8 * var6[1] + var5[1] * var9 >> 12;
+ if (var10 <= -32768) {
+ var10 = -32767;
+ }
+
+ if (32768 <= var10) {
+ var10 = 32767;
+ }
+
+ this.aShortArray3465[var2] = (short) var10;
+ }
+ } else {
+ for (var2 = 0; var2 < 257; ++var2) {
+ var4 = var2 << 4;
+
+ for (var3 = 1; -1 + this.anIntArrayArray3469.length > var3 && var4 >= this.anIntArrayArray3469[var3][0]; ++var3) {
+ }
+
+ var6 = this.anIntArrayArray3469[var3];
+ var5 = this.anIntArrayArray3469[-1 + var3];
+ var7 = (-var5[0] + var4 << 12) / (-var5[0] + var6[0]);
+ var8 = -var7 + 4096;
+ var9 = var6[1] * var7 + var8 * var5[1] >> 12;
+ if (-32768 >= var9) {
+ var9 = -32767;
+ }
+
+ if (32768 <= var9) {
+ var9 = 32767;
+ }
+
+ this.aShortArray3465[var2] = (short) var9;
+ }
+ }
+
+ } catch (RuntimeException var21) {
+ throw ClientErrorException.clientError(var21, "wi.E(" + -11 + ')');
+ }
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var8 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, var1);
+
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ int var4 = var5[var6] >> 4;
+ if(0 > var4) {
+ var4 = 0;
+ }
+
+ if(256 < var4) {
+ var4 = 256;
+ }
+
+ var8[var6] = this.aShortArray3465[var4];
+ }
+ }
+
+ return var8;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "wi.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public TextureOperation8() {
+ super(1, true);
+ }
+
+ static boolean method353(int var0, int var1) {
+ try {
+ if(var1 > var0) {
+ return false;
+ } else {
+ int var2 = TextureOperation27.aShortArray3095[var0];
+ if(var2 >= 2000) {
+ var2 -= 2000;
+ }
+
+ return var2 == 1003;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "wi.Q(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ static void method354(int var1) {
+ try {
+ TextureOperation13.anInt3362 = -1;
+
+ Scenery.anInt2251 = var1;
+ Class3_Sub5.method117();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "wi.B(" + -126 + ',' + var1 + ')');
+ }
+ }
+
+ final void postDecode() {
+ try {
+ if(null == this.anIntArrayArray3469) {
+ this.anIntArrayArray3469 = new int[][]{{0, 0}, {4096, 4096}};
+ }
+
+ if(this.anIntArrayArray3469.length < 2) {
+ throw new RuntimeException("Curve operation requires at least two markers");
+ } else {
+ if(2 == this.anInt3462) {
+ this.method355();
+ }
+
+ Class8.method844((byte)-9);
+ this.method352();
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "wi.P(" + ')');
+ }
+ }
+
+ private void method355() {
+ try {
+ int[] var2 = this.anIntArrayArray3469[0];
+
+ int[] var3 = this.anIntArrayArray3469[1];
+ int[] var4 = this.anIntArrayArray3469[this.anIntArrayArray3469.length + -2];
+ int[] var5 = this.anIntArrayArray3469[-1 + this.anIntArrayArray3469.length];
+ this.anIntArray3457 = new int[]{var2[0] - (var3[0] + -var2[0]), -var3[1] + var2[1] + var2[1]};
+ this.anIntArray3467 = new int[]{var4[0] + var4[0] + -var5[0], -var5[1] - -var4[1] + var4[1]};
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "wi.C(" + true + ')');
+ }
+ }
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(0 == var1) {
+ this.anInt3462 = var2.readUnsignedByte();
+ this.anIntArrayArray3469 = new int[var2.readUnsignedByte()][2];
+
+ for(int var4 = 0; var4 < this.anIntArrayArray3469.length; ++var4) {
+ this.anIntArrayArray3469[var4][0] = var2.readUnsignedShort();
+ this.anIntArrayArray3469[var4][1] = var2.readUnsignedShort();
+ }
+ }
+
+ if(!true) {
+ this.anInt3462 = -6;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "wi.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ private int[] method356(int var2) {
+ try {
+ if(var2 >= 0) {
+ if(this.anIntArrayArray3469.length <= var2) {
+ return this.anIntArray3467;
+ } else {
+
+ return this.anIntArrayArray3469[var2];
+ }
+ } else {
+ return this.anIntArray3457;
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "wi.F(" + (byte) -106 + ',' + var2 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TextureOperation9.java b/Client/src/main/java/org/runite/client/TextureOperation9.java
new file mode 100644
index 000000000..c4d4ec484
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TextureOperation9.java
@@ -0,0 +1,193 @@
+package org.runite.client;
+
+import org.rs09.client.util.ArrayUtils;
+
+import java.util.Objects;
+
+public final class TextureOperation9 extends TextureOperation {
+
+ private boolean aBoolean3100 = true;
+ public static int anInt3102 = 0;
+ static int anInt3103;
+ private boolean aBoolean3104 = true;
+ static float aFloat3105;
+
+
+ final void decode(int var1, DataBuffer var2) {
+ try {
+ if(!true) {
+ method207(18, false, -19, 102L);
+ }
+
+ if(var1 == 0) {
+ this.aBoolean3100 = var2.readUnsignedByte() == 1;
+ } else if(var1 == 1) {
+ this.aBoolean3104 = var2.readUnsignedByte() == 1;
+ } else if(var1 == 2) {
+ this.aBoolean2375 = var2.readUnsignedByte() == 1;
+ }
+
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ej.A(" + var1 + ',' + (var2 != null?"{...}":"null") + ',' + true + ')');
+ }
+ }
+
+ final int[][] method166(int var2) {
+ try {
+ if(-1 != -1) {
+ method207(-98, true, 95, 79L);
+ }
+
+ int[][] var3 = this.aClass97_2376.method1594((byte)54, var2);
+ if(this.aClass97_2376.aBoolean1379) {
+ int[][] var4 = this.method162(!this.aBoolean3104?var2:-var2 + Class3_Sub20.anInt2487, 0, (byte)-105);
+ int[] var5 = Objects.requireNonNull(var4)[0];
+ int[] var7 = var4[2];
+ int[] var6 = var4[1];
+ int[] var9 = var3[1];
+ int[] var10 = var3[2];
+ int[] var8 = var3[0];
+ int var11;
+ if(this.aBoolean3100) {
+ for(var11 = 0; Class113.anInt1559 > var11; ++var11) {
+ var8[var11] = var5[RenderAnimationDefinition.anInt396 + -var11];
+ var9[var11] = var6[-var11 + RenderAnimationDefinition.anInt396];
+ var10[var11] = var7[RenderAnimationDefinition.anInt396 - var11];
+ }
+ } else {
+ for(var11 = 0; var11 < Class113.anInt1559; ++var11) {
+ var8[var11] = var5[var11];
+ var9[var11] = var6[var11];
+ var10[var11] = var7[var11];
+ }
+ }
+ }
+
+ return var3;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "ej.T(" + -1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method203(int var0) {
+ try {
+ //int var1 = 15 / ((-11 - var0) / 63);
+ if(Unsorted.anInt3660 == 2) {
+ if(TextureOperation8.anInt3460 == NPCDefinition.anInt1297 && Class38_Sub1.anInt2612 == Unsorted.anInt2099) {
+ Unsorted.anInt3660 = 0;
+ if(ClientCommands.shiftClickEnabled && ObjectDefinition.aBooleanArray1490[81] && Unsorted.menuOptionCount > 2) {
+ BufferedDataStream.method806(Unsorted.menuOptionCount + -2);
+ } else {
+ BufferedDataStream.method806(Unsorted.menuOptionCount + -1);
+ }
+ }
+ } else if(NPCDefinition.anInt1297 == Class163_Sub1.anInt2993 && Class38_Sub1.anInt2614 == Class38_Sub1.anInt2612) {
+ Unsorted.anInt3660 = 0;
+ if(ClientCommands.shiftClickEnabled && ObjectDefinition.aBooleanArray1490[81] && Unsorted.menuOptionCount > 2) {
+ BufferedDataStream.method806(Unsorted.menuOptionCount - 2);
+ } else {
+ BufferedDataStream.method806(Unsorted.menuOptionCount - 1);
+ }
+ } else {
+ Unsorted.anInt2099 = Class38_Sub1.anInt2614;
+ Unsorted.anInt3660 = 2;
+ TextureOperation8.anInt3460 = Class163_Sub1.anInt2993;
+ }
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ej.B(" + var0 + ')');
+ }
+ }
+
+ static void method204() {
+ try {
+ //Client Resize.
+ TextureOperation12.outgoingBuffer.putOpcode(243);
+ TextureOperation12.outgoingBuffer.writeByte(Class83.getWindowType());
+ TextureOperation12.outgoingBuffer.writeShort(Class23.canvasWidth);
+ TextureOperation12.outgoingBuffer.writeShort(GroundItem.canvasHeight);
+ TextureOperation12.outgoingBuffer.writeByte(Unsorted.anInt3671);
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ej.C(" + -3 + ')');
+ }
+ }
+
+ public TextureOperation9() {
+ super(1, false);
+ }
+
+ final int[] method154(int var1, byte var2) {
+ try {
+ int[] var4 = this.aClass114_2382.method1709(var1);
+ if(this.aClass114_2382.aBoolean1580) {
+ int[] var5 = this.method152(0, !this.aBoolean3104?var1:Class3_Sub20.anInt2487 + -var1);
+ if(this.aBoolean3100) {
+ for(int var6 = 0; var6 < Class113.anInt1559; ++var6) {
+ var4[var6] = var5[-var6 + RenderAnimationDefinition.anInt396];
+ }
+ } else {
+ ArrayUtils.arraycopy(var5, 0, var4, 0, Class113.anInt1559);
+ }
+ }
+
+ return var4;
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "ej.D(" + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static RSString method207(int var0, boolean var1, int var2, long var3) {
+ try {
+ if(var0 >= 2 && var0 <= 36) {
+ if(var2 <= 71) {
+ aFloat3105 = 1.3008908F;
+ }
+
+ long var6 = var3 / (long)var0;
+
+ int var5;
+ for(var5 = 1; var6 != 0L; var6 /= var0) {
+ ++var5;
+ }
+
+ int var8 = var5;
+ if(0L > var3 || var1) {
+ var8 = var5 + 1;
+ }
+
+ byte[] var9 = new byte[var8];
+ if(var3 >= 0L) {
+ if(var1) {
+ var9[0] = 43;
+ }
+ } else {
+ var9[0] = 45;
+ }
+
+ for(int var10 = 0; var10 < var5; ++var10) {
+ int var11 = (int)(var3 % (long)var0);
+ var3 /= var0;
+ if(var11 < 0) {
+ var11 = -var11;
+ }
+
+ if(var11 > 9) {
+ var11 += 39;
+ }
+
+ var9[-1 + -var10 + var8] = (byte)(var11 + 48);
+ }
+
+ RSString var13 = new RSString();
+ var13.buffer = var9;
+ var13.length = var8;
+ return var13;
+ } else {
+ throw new IllegalArgumentException("Invalid radix:" + var0);
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "ej.F(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TileData.java b/Client/src/main/java/org/runite/client/TileData.java
new file mode 100644
index 000000000..100216f4d
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TileData.java
@@ -0,0 +1,53 @@
+package org.runite.client;
+
+import org.rs09.client.Linkable;
+import org.rs09.client.data.HashTable;
+
+final class TileData extends Linkable {
+ static TileData[][][] aTileDataArrayArrayArray2638;
+ static int anInt2218 = -1;
+ static HashTable aHashTable_2220 = new HashTable(32);
+ Class25[] aClass25Array2221 = new Class25[5];
+ boolean aBoolean2222;
+ int anInt2223;
+ boolean aBoolean2225;
+ Class35 aClass35_2226;
+ int anInt2227;
+ int anInt2228 = 0;
+ int anInt2229;
+ Class12 aClass12_2230;
+ int anInt2231;
+ int anInt2232;
+ Class19 aClass19_2233;
+ Class70 aClass70_2234;
+ TileData aClass3_Sub2_2235;
+ boolean aBoolean2236;
+ int[] anIntArray2237 = new int[5];
+ int anInt2238;
+ int anInt2239;
+ Class126 aClass126_2240;
+ int anInt2241;
+ int anInt2244;
+ Class72 aClass72_2245;
+
+ TileData(int var1, int var2, int var3) {
+ try {
+ this.anInt2231 = var3;
+ this.anInt2238 = this.anInt2244 = var1;
+ this.anInt2239 = var2;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "bj.(" + var1 + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ static void method103() {
+ try {
+ Client.aHashTable_2194.clear();
+ Class81.aClass13_1139.clear();
+ Class126.aClass13_1666.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "bj.B(" + (byte) 24 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/TimeUtils.java b/Client/src/main/java/org/runite/client/TimeUtils.java
new file mode 100644
index 000000000..7fa8ae674
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/TimeUtils.java
@@ -0,0 +1,35 @@
+package org.runite.client;
+
+public final class TimeUtils {
+
+ private static long correction;
+ private static long previous;
+
+ public static synchronized long time() {
+ long time = System.currentTimeMillis();
+ if (time < previous) {
+ correction += previous + -time;
+ }
+
+ previous = time;
+ return correction + time;
+ }
+
+ public static void sleep(long millis) {
+ if (0L < millis) {
+ if (0L == millis % 10L) {
+ sleepWrapped(millis + -1L);
+ sleepWrapped(1L);
+ } else {
+ sleepWrapped(millis);
+ }
+ }
+ }
+
+ private static void sleepWrapped(long millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException var4) {
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/Translation.java b/Client/src/main/java/org/runite/client/Translation.java
new file mode 100644
index 000000000..b4c54e75a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Translation.java
@@ -0,0 +1,204 @@
+package org.runite.client;
+
+public class Translation {
+
+ //English
+
+
+ //Class 9 englishToFrench
+ static void englishToFrench() {
+ try {
+ TextCore.LoadedConfig = RSString.parse("Fichiers config charg-Bs");
+ TextCore.LoadingConfig = RSString.parse("Chargement des fichiers config )2 ");
+ TextCore.TextColorPurple = RSString.parse("violet:");
+ TextCore.HasContinue = RSString.parse("Continuer");
+ TextCore.HasSkill = RSString.parse("comp-Btence ");
+ TextCore.HasExamine = RSString.parse("Examiner");
+ TextCore.LoadingWordPack = RSString.parse("Chargement du module texte )2 ");
+ TextCore.TextGlowTwo = RSString.parse("brillant2:");
+ TextCore.MillionM = RSString.parse("M");
+ TextCore.TextFlashTwo = RSString.parse("clignotant2:");
+ TextCore.TextWaveTwo = RSString.parse("ondulation2:");
+ TextCore.HasAttack = RSString.parse("Attaquer");
+ TextCore.HasFriendsListFull = RSString.parse("Votre liste d(Wamis est pleine (X100 noms maximum pour la version gratuite et 200 pour les abonn-Bs(Y)3");
+ TextCore.HasIgnoreAlready = RSString.parse(" est d-Bj-9 dans votre liste noire)3");
+ TextCore.LoadedWLD = RSString.parse("Liste des serveurs charg-Be");
+ TextCore.LoadedInputHandler = RSString.parse("Gestionnaire de saisie charg-B");
+ TextCore.TextColorRed = RSString.parse("rouge:");
+ TextCore.TextWave = RSString.parse("ondulation:");
+ TextCore.LoadingConnecting = RSString.parse("Connexion au serveur de mise -9 jour en cours");
+ TextCore.HasFriendsAlready = RSString.parse(" est d-Bj-9 dans votre liste d(Wamis)3");
+ TextCore.TextShake = RSString.parse("tremblement:");
+ TextCore.LoadingTitleScreen = RSString.parse("Chargement de l(W-Bcran)2titre )2 ");
+ TextCore.HasMoreOptions = RSString.parse(" autres options");
+ TextCore.OpenedTitleScreen = RSString.parse(",Mcran)2titre ouvert");
+ TextCore.Started3DLibrary = RSString.parse("Librairie 3D d-Bmarr-Be");
+ TextCore.LoadingPleaseWait = RSString.parse("Veuillez patienter)3)3)3");
+ TextCore.HasFaceHere = RSString.parse("Regarder dans cette direction");
+ TextCore.MillionM = RSString.parse("M");
+ TextCore.HasLoggedIn = RSString.parse(" s(West connect-B)3");
+ TextCore.TextColorCyan = RSString.parse("cyan:");
+ TextCore.LoadingFonts = RSString.parse("Chargement des polices )2 ");
+ TextCore.TextFlashThree = RSString.parse("clignotant3:");
+ TextCore.HasOK = RSString.parse("OK");
+ TextCore.HasOnOwnIgnoreList = RSString.parse("Vous ne pouvez pas ajouter votre nom -9 votre liste noire)3");
+ TextCore.LoadedTextures = RSString.parse("Textures charg-Bes");
+ TextCore.TextGlowThree = RSString.parse("brillant3:");
+ TextCore.Starting3DLibrary = RSString.parse("D-Bmarrage de la librairie 3D");
+ TextCore.CheckingForUpdates = RSString.parse("V-Brification des mises -9 jour )2 ");
+ TextCore.AttemptingReestablish = RSString.parse("Veuillez patienter )2 tentative de r-Btablissement)3");
+ TextCore.TextSlide = RSString.parse("glissement:");
+ TextCore.AllocatingMemory = RSString.parse("M-Bmoire en cours d(Wattribution");
+ TextCore.PreparedSoundEngine = RSString.parse("Moteur son pr-Bpar-B");
+ TextCore.AllocatedMemory = RSString.parse("M-Bmoire attribu-Be");
+ TextCore.HasDrop = RSString.parse("Poser");
+ TextCore.Spacer = RSString.parse(" ");
+ TextCore.HasWalkHere = RSString.parse("Atteindre");
+ TextCore.HasUnableFind = RSString.parse("Impossible de trouver ");
+ TextCore.LoadedTitleScreen = RSString.parse(",Mcran)2titre charg-B");
+ TextCore.HasFriendsToIgnore = RSString.parse(" de votre liste d(Wamis)3");
+ TextCore.LoadingSprites = RSString.parse("Chargement des sprites )2 ");
+ TextCore.MembersObject = RSString.parse("Objet d(Wabonn-Bs");
+ TextCore.LoadedUpdateList = RSString.parse("Liste des mises -9 jour charg-Be");
+ TextCore.LoadedFonts = RSString.parse("Polices charg-Bes");
+ TextCore.HasTake = RSString.parse("Prendre");
+ TextCore.HasRating = RSString.parse("classement ");
+ TextCore.HasDiscard = RSString.parse("Jeter");
+ TextCore.HasClose = RSString.parse("Fermer");
+ TextCore.HasWishToTrade = RSString.parse("voudrait faire un -Bchange avec vous)3");
+ TextCore.TextColorYellow = RSString.parse("jaune:");
+ TextCore.HasIgnoreToFriends = RSString.parse(" de votre liste noire)3");
+ TextCore.TextGlowOne = RSString.parse("brillant1:");
+ TextCore.HasChooseOptions = RSString.parse("Choisir une option");
+ TextCore.LoadingGeneral = RSString.parse("Chargement en cours)3)3)3");
+ TextCore.TextColorWhite = RSString.parse("blanc:");
+ TextCore.LoadedSprites = RSString.parse("Sprites charg-Bs");
+ TextCore.LoadingInterfaces = RSString.parse("Chargement des interfaces )2 ");
+ TextCore.HasOnOwnFriendsList = RSString.parse("Vous ne pouvez pas ajouter votre nom -9 votre liste d(Wamis)3");
+ TextCore.HasPleaseRemove = RSString.parse("Veuillez commencer par supprimer ");
+ TextCore.HasCancel = RSString.parse("Annuler");
+ TextCore.LoadedWordPack = RSString.parse("Module texte charg-B");
+ TextCore.CreatedWorld = RSString.parse("Monde de jeu cr-B-B");
+ TextCore.ThousandK = RSString.parse("K");
+ TextCore.HasLevel = RSString.parse("niveau ");
+ TextCore.ThousandK = RSString.parse("K");
+ TextCore.HasSelect = RSString.parse("S-Blectionner");
+ TextCore.ConxLost = RSString.parse("Connexion perdue)3");
+ TextCore.HasIgnoreListFull = RSString.parse("Votre liste noire est pleine (X100 noms maximum(Y)3");
+ TextCore.LoadedInterfaces = RSString.parse("Interfaces charg-Bes");
+ TextCore.RSLoadingPleaseWait = RSString.parse("Chargement de RuneScape en cours )2 veuillez patienter)3)3)3");
+ TextCore.TextFlashOne = RSString.parse("clignotant1:");
+ TextCore.HasPleaseRemove = RSString.parse("Veuillez commencer par supprimer ");
+ TextCore.TextColorGreen = RSString.parse("vert:");
+ TextCore.HasHidden = RSString.parse("Cach-B");
+ TextCore.LoadingPleaseWait2 = RSString.parse("Chargement en cours)3 Veuillez patienter)3");
+ TextCore.ConxUpdateServer = RSString.parse("Connect-B au serveur de mise -9 jour");
+ TextCore.HasLoggedOut = RSString.parse(" s(West d-Bconnect-B)3");
+ TextCore.LoadingTextures = RSString.parse("Chargement des textures )2 ");
+ TextCore.HasUse = RSString.parse("Utiliser");
+ TextCore.HasScroll = RSString.parse("d-Broulement:");
+ TextCore.LoadingWLD = RSString.parse("Chargement de la liste des serveurs");
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "bb.C(" + (byte) 121 + ')');
+ }
+ }
+
+
+ //Class3_Sub28_Sub11 English to German
+ static void englishToGerman() {
+ try {
+ TextCore.TextWave = RSString.parse("welle:");
+ TextCore.HasMoreOptions = RSString.parse(" weitere Optionen");
+ TextCore.HasPleaseRemove = RSString.parse("Bitte entfernen Sie ");
+ TextCore.LoadedConfig = RSString.parse("Konfig geladen)3");
+ TextCore.LoadedFonts = RSString.parse("Schrifts-=tze geladen)3");
+ TextCore.HasFriendsToIgnore = RSString.parse(" zuerst von Ihrer Freunde)2Liste(Q");
+ TextCore.HasWishToTrade = RSString.parse("m-Ochte mit Ihnen handeln)3");
+ TextCore.TextFlashThree = RSString.parse("blinken3:");
+ TextCore.HasFriendsListFull = RSString.parse("Ihre Freunde)2Liste ist voll(Q Maximale Eintr-=ge: Mitglieder 200)4freie Spieler 100");
+ TextCore.HasOnOwnIgnoreList = RSString.parse("Sie k-Onnen sich selbst nicht selbst auf Ihre Ignorieren)2Liste setzen(Q");
+ TextCore.CheckingForUpdates = RSString.parse("Suche nach Updates )2 ");
+ TextCore.TextColorWhite = RSString.parse("weiss:");
+ TextCore.HasDrop = RSString.parse("Fallen lassen");
+ TextCore.HasLoggedIn = RSString.parse(" loggt sich ein)3");
+ TextCore.HasRating = RSString.parse("Kampfstufe: ");
+ TextCore.ThousandK = RSString.parse("T");
+ TextCore.LoadingWLD = RSString.parse("Lade Liste der Welten");
+ TextCore.Spacer = RSString.parse(": ");
+ TextCore.TextColorGreen = RSString.parse("gr-Un:");
+ TextCore.TextGlowOne = RSString.parse("leuchten1:");
+ TextCore.LoadedInputHandler = RSString.parse("Eingabeprozedur geladen)3");
+ TextCore.TextColorRed = RSString.parse("rot:");
+ TextCore.HasOK = RSString.parse("Okay");
+ TextCore.RSLoadingPleaseWait = RSString.parse("RuneScape wird geladen )2 bitte warten)3)3)3");
+ TextCore.TextColorPurple = RSString.parse("lila:");
+ TextCore.CreatedWorld = RSString.parse("Spielwelt erstellt)3");
+ TextCore.HasPleaseRemove = RSString.parse("Bitte entfernen Sie ");
+ TextCore.LoadingFonts = RSString.parse("Lade Schrifts-=tze )2 ");
+ TextCore.HasCancel = RSString.parse("Abbrechen");
+ TextCore.TextShake = RSString.parse("sch-Utteln:");
+ TextCore.HasIgnoreListFull = RSString.parse("Ihre Ignorieren)2Liste ist voll)1 Sie k-Onnen nur 100 Spieler darauf eintragen)3");
+ TextCore.HasContinue = RSString.parse("Weiter");
+ TextCore.LoadingPleaseWait2 = RSString.parse("Ladevorgang )2 bitte warten Sie)3");
+ TextCore.HasAttack = RSString.parse("Angreifen");
+ TextCore.LoadedSprites = RSString.parse("Sprites geladen)3");
+ TextCore.LoadingTextures = RSString.parse("Lade Texturen )2 ");
+ TextCore.TextColorCyan = RSString.parse("blaugr-Un:");
+ TextCore.HasExamine = RSString.parse("Untersuchen");
+ TextCore.ConxLost = RSString.parse("Verbindung abgebrochen)3");
+ TextCore.HasSkill = RSString.parse("Fertigkeit: ");
+ TextCore.MembersObject = RSString.parse("Gegenstand f-Ur Mitglieder");
+ TextCore.LoadedWLD = RSString.parse("Liste der Welten geladen");
+ TextCore.HasIgnoreToFriends = RSString.parse(" zuerst von Ihrer Ignorieren)2Liste(Q");
+ TextCore.LoadingPleaseWait = RSString.parse("Bitte warten Sie)3)3)3");
+ TextCore.HasLoggedOut = RSString.parse(" loggt sich aus)3");
+ TextCore.Starting3DLibrary = RSString.parse("Starte 3D)2Softwarebibliothek)3");
+ TextCore.ThousandK = RSString.parse("T");
+ TextCore.HasSelect = RSString.parse("Ausw-=hlen");
+ TextCore.TextGlowTwo = RSString.parse("leuchten2:");
+ TextCore.HasTake = RSString.parse("Nehmen");
+ TextCore.HasUnableFind = RSString.parse("Spieler kann nicht gefunden werden: ");
+ TextCore.LoadingTitleScreen = RSString.parse("Lade Titelbild )2 ");
+ TextCore.LoadingConnecting = RSString.parse("Verbindung mit Update)2Server)3)3)3");
+ TextCore.HasWalkHere = RSString.parse("Hierhin gehen");
+ TextCore.HasFaceHere = RSString.parse("Hierhin drehen");
+ TextCore.LoadingSprites = RSString.parse("Lade Sprites )2 ");
+ TextCore.MillionM = RSString.parse("M");
+ TextCore.HasChooseOptions = RSString.parse("W-=hlen Sie eine Option");
+ TextCore.Started3DLibrary = RSString.parse("3D)2Softwarebibliothek gestartet)3");
+ TextCore.HasUse = RSString.parse("Benutzen");
+ TextCore.AllocatingMemory = RSString.parse("Speicher wird zugewiesen)3");
+ TextCore.AttemptingReestablish = RSString.parse("Bitte warten Sie )2 es wird versucht)1 die Verbindung wiederherzustellen)3");
+ TextCore.LoadedInterfaces = RSString.parse("Benutzeroberfl-=che geladen)3");
+ TextCore.TextSlide = RSString.parse("gleiten:");
+ TextCore.LoadedUpdateList = RSString.parse("Update)2Liste geladen)3");
+ TextCore.TextColorYellow = RSString.parse("gelb:");
+ TextCore.TextFlashTwo = RSString.parse("blinken2:");
+ TextCore.TextFlashOne = RSString.parse("blinken1:");
+ TextCore.LoadingGeneral = RSString.parse("Lade)3)3)3");
+ TextCore.MillionM = RSString.parse("M");
+ TextCore.LoadingConfig = RSString.parse("Lade Konfiguration )2 ");
+ TextCore.AllocatedMemory = RSString.parse("Zugewiesener Speicher)3");
+ TextCore.LoadedTitleScreen = RSString.parse("Titelbild geladen)3");
+ TextCore.TextGlowThree = RSString.parse("leuchten3:");
+ TextCore.HasOnOwnFriendsList = RSString.parse("Sie k-Onnen sich selbst nicht auf Ihre Freunde)2Liste setzen(Q");
+ TextCore.LoadedWordPack = RSString.parse("Wordpack geladen)3");
+ TextCore.HasIgnoreAlready = RSString.parse(" steht bereits auf Ihrer Ignorieren)2Liste(Q");
+ TextCore.ConxUpdateServer = RSString.parse("Verbindung zum Update)2Server hergestellt)3");
+ TextCore.HasDiscard = RSString.parse("Ablegen");
+ TextCore.HasHidden = RSString.parse("Versteckt");
+ TextCore.TextWaveTwo = RSString.parse("welle2:");
+ TextCore.LoadingInterfaces = RSString.parse("Lade Benutzeroberfl-=che )2 ");
+ TextCore.HasFriendsAlready = RSString.parse(" steht bereits auf Ihrer Freunde)2Liste(Q");
+ TextCore.OpenedTitleScreen = RSString.parse("Titelbild ge-Offnet)3");
+ TextCore.HasClose = RSString.parse("Schlie-8en");
+ TextCore.HasScroll = RSString.parse("scrollen:");
+ TextCore.LoadedTextures = RSString.parse("Texturen geladen)3");
+ TextCore.LoadingWordPack = RSString.parse("Lade Wordpack )2 ");
+ TextCore.PreparedSoundEngine = RSString.parse("Musik)2Engine vorbereitet)3");
+ TextCore.HasLevel = RSString.parse("Stufe: ");
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "lk.A(" + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/Unsorted.java b/Client/src/main/java/org/runite/client/Unsorted.java
new file mode 100644
index 000000000..f7a56039b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/Unsorted.java
@@ -0,0 +1,5266 @@
+package org.runite.client;
+
+import org.rs09.SlayerTracker;
+import org.rs09.XPGainDraw;
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.console.DeveloperConsole;
+import org.rs09.client.data.HashTable;
+import org.rs09.client.data.ReferenceCache;
+import org.rs09.client.net.Connection;
+import org.rs09.client.rendering.Toolkit;
+import org.rs09.client.util.ArrayUtils;
+import org.runite.client.drawcalls.*;
+
+import java.awt.*;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.Objects;
+
+public class Unsorted {
+ public static boolean aBoolean2146 = false;
+ public static int incomingOpcode = 0;
+ public static int anInt2148 = 0;
+ public static boolean aBoolean2154;
+ public static int[] anIntArray882 = new int[200];
+ public static int anInt144;
+ public static int anInt136 = 0;
+ public static byte[][][] sceneryTypeMaskGrid = new byte[4][104][104];
+ public static int[] anIntArray39;
+ public static int anInt40 = 0;
+ public static Connection js5Connection;
+ public static int anInt42 = 0;
+ public static RSString[] aStringArray45;
+ public static short aShort46 = 256;
+ public static boolean aBoolean47 = false;
+ public static int anInt48 = 2;
+ public static int[] anIntArray49;
+ public static int width1234;
+ public static Class33 aClass33_1238;
+ public static LinkedList aLinkedList_1242 = new LinkedList();
+ public static int anInt1244 = -1;
+ public static RSInterface aClass11_1933;
+ public static float[] aFloatArray1934 = new float[]{0.073F, 0.169F, 0.24F, 1.0F};
+ public static Class8 aClass8_1936;
+ public static int[] anIntArray2952 = new int[128];
+ public static int anInt2958 = 0;
+ public static LinkedList aLinkedList_78 = new LinkedList();
+ public static int anInt72 = 0;
+ public static boolean[] aBooleanArray73 = new boolean[200];
+ public static boolean[] aBooleanArray1703;
+ public static int incomingPacketLength = 0;
+ public static int anInt1705 = 0;
+ public static int anInt1709 = 0;
+ public static int anInt1711 = -2;
+ public static boolean[] aBooleanArray1712 = new boolean[100];
+ public static ReferenceCache aReferenceCache_1131 = new ReferenceCache(5);
+ public static ReferenceCache aReferenceCache_1135 = new ReferenceCache(4);
+ public static AbstractSprite[] minimapDotSprites;
+ public static int anInt1137 = 2;
+ public static int[] anIntArray1138;
+ public static int anInt3625 = 3;
+ public static int anInt3631;
+ public static Class25[] aClass25Array4060;
+ public static int anInt4062 = 0;
+ public static boolean aBoolean4063 = false;
+ public static boolean aBoolean4068 = true;
+ public static TileData[][][] aTileDataArrayArrayArray4070;
+ public static int anInt4073;
+ public static CacheIndex quickchatMenusIndex_332;
+ public static int[] anIntArray2591;
+ public static RSString[] aStringArray2596 = null;
+ public static Class3_Sub28_Sub3 aClass3_Sub28_Sub3_2600;
+ public static Class151_Sub1[] aClass151_Sub1Array2601 = new Class151_Sub1[29]; //TODO
+ public static boolean aBoolean1080 = false;
+ public static int anInt1081 = 0;
+ public static int anInt1082;
+ public static int[] anIntArray1083;
+ public static boolean aBoolean1084 = false;
+ public static int anInt1088 = 0;
+ public static int anInt1950;
+ public static boolean aBoolean1951 = false;
+ public static int anInt1953;
+ public static int anInt1881 = 0;
+ public static int anInt1887;
+ public static int anInt14 = 0;
+ public static int anInt15 = 0;
+ public static ReferenceCache aReferenceCache_21 = new ReferenceCache(64);
+ public static int registryStage = 0;
+ public static int anInt25 = 1;
+ public static int anInt3657;
+ public static int anInt3660 = 0;
+ public static boolean aBoolean3665 = true;
+ public static LinkedList aLinkedList_2468 = new LinkedList();
+ public static int[] anIntArray2469;
+ public static int[] anIntArray2470 = new int[]{0, 0, 2, 0, 0, 2, 1, 1, 0};
+ public static boolean paramJavaScriptEnabled = false;
+ public static int anInt3642 = 0;
+ public static int anInt3644 = 0;
+ public static int anInt59 = 0;
+ public static int anInt65;
+ public static boolean isMember = false;
+ public static int anInt67;
+ public static ShaderInterface[] anShaderInterfaceArray70;
+ public static boolean aBoolean742 = false;
+ public static ReferenceCache aReferenceCache_743 = new ReferenceCache(20);
+ public static CacheIndex quickChatMessages;
+ public static byte[][][] aByteArrayArrayArray1328;
+ public static int anInt3602;
+ public static int anInt3603;
+ public static boolean aBoolean3604 = true;
+ public static int[][][] anIntArrayArrayArray3605;
+ public static int viewportX;
+ public static int[] anIntArray3607 = new int[]{0, 2, 2, 2, 1, 1, 2, 2, 1, 3, 1, 1};
+ public static ReferenceCache aReferenceCache_4043 = new ReferenceCache(64);
+ public static volatile int anInt4045 = 0;
+ public static HashTable aHashTable_4046 = new HashTable(16);
+ public static MouseListeningClass aClass149_4047 = new MouseListeningClass();
+ public static CacheIndex modelsIndex_4048;
+ public static int[] anIntArray4050 = new int[1000];
+ public static ReferenceCache aReferenceCache_4051 = new ReferenceCache(30);
+ public static int gameWindowWidth = 0;
+ public static Player[] players = new Player[2048];
+ static int y942;
+ static int anInt944 = 0;
+ static int anInt952;
+ static int anInt963;
+ static int anInt1037;
+ static int anInt1038;
+ static Class30 aClass30_1039;
+ static int anInt3695;
+ static int anInt1042;
+ static CacheIndex modelsIndex_1043;
+ static AbstractSprite[] aAbstractSpriteArray996;
+ static int maskUpdateCount = 0;
+ static int anInt998 = 0;
+ static int anInt999 = -1;
+ static int wlPacketSize = 0;
+ static ReferenceCache aReferenceCache_684 = new ReferenceCache(64);
+ static int[] anIntArray686 = new int[2];
+ static int anInt688 = 0;
+ static int anInt689;
+ static RSString[] aStringArray2566 = new RSString[200];
+ static int anInt2567 = -1;
+ public static int clanSize;
+ static int[] anIntArray2574 = new int[14];
+ static int anInt2577 = 0;
+ static boolean aBoolean29 = false;
+ static int anInt30;
+ static int anInt31 = 0;
+ static int anInt3671 = 0;
+ static boolean[] aBooleanArray3674 = new boolean[100];
+ static int anInt2281 = 0;
+ static int anInt2309 = 128;
+ static boolean aBoolean2311;
+ static int frameWidth;
+ static int anInt3071 = 0;
+ static int anInt3070 = 0;
+ static int[] anIntArray3076;
+ static int x3155;
+ static WorldListEntry[] aClass44_Sub1Array3201 = new WorldListEntry[0];
+ static CacheIndex interfacesIndex_3361;
+ static Class52 aClass52_1112 = new Class52();
+ static int anInt1165 = -1;
+ static byte[][][] possibleHeightmap1774;
+ static int[][] anIntArrayArray2039 = new int[][]{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}};
+ public static int menuOptionCount = 0;
+ static boolean aBoolean11 = false;
+ public static Class158 aClass158_3009;
+ static long[] aLongArray3271 = new long[500];
+ static boolean aBoolean3275 = true;
+ static int anInt154 = 0;
+ static RSInterface aClass11_2091 = null;
+ static int anInt2099 = 0;
+
+ static void method2086() {
+ try {
+ int var1 = Class102.player.xAxis + TextureOperation20.anInt3216;
+ int var2 = Class102.player.yAxis - -anInt42;
+ if (-var1 + x3155 < -500 || -var1 + x3155 > 500 || y942 + -var2 < -500 || -var2 + y942 > 500) {
+ x3155 = var1;
+ y942 = var2;
+ }
+
+ if (var2 != y942) {
+ y942 += (-y942 + var2) / 16;
+ }
+
+ if (var1 != x3155) {
+ x3155 += (-x3155 + var1) / 16;
+ }
+
+ if (AudioThread.aBoolean346) {
+ for (int var3 = 0; var3 < Class3_Sub23.anInt2537; ++var3) {
+ int var4 = Class133.inputTextCodeArray[var3];
+ if (98 == var4) {
+ anInt2309 = -16 & anInt2309 + 47;
+ } else if (var4 == 99) {
+ anInt2309 = -16 & anInt2309 - 17;
+ } else if (var4 == 96) {
+ GraphicDefinition.CAMERA_DIRECTION = GraphicDefinition.CAMERA_DIRECTION - 65 & -128;
+ } else if (var4 == 97) {
+ GraphicDefinition.CAMERA_DIRECTION = GraphicDefinition.CAMERA_DIRECTION + 191 & -128;
+ }
+ }
+ } else {
+ if (ObjectDefinition.aBooleanArray1490[98]) {
+ Class27.anInt517 += (-Class27.anInt517 + 12) / 2;
+ } else if (!ObjectDefinition.aBooleanArray1490[99]) {
+ Class27.anInt517 /= 2;
+ } else {
+ Class27.anInt517 += (-Class27.anInt517 + -12) / 2;
+ }
+
+ if (!ObjectDefinition.aBooleanArray1490[96]) {
+ if (ObjectDefinition.aBooleanArray1490[97]) {
+ anInt2281 += (-anInt2281 + 24) / 2;
+ } else {
+ anInt2281 /= 2;
+ }
+ } else {
+ anInt2281 += (-anInt2281 + -24) / 2;
+ }
+
+ anInt2309 += Class27.anInt517 / 2;
+ GraphicDefinition.CAMERA_DIRECTION += anInt2281 / 2;
+ }
+
+ clampCameraAngle();
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "uf.B(" + (byte) 68 + ')');
+ }
+ }
+
+ static boolean method1529(int var0, int var1, int var2, int var3, int var4, int var6) {
+ try {
+ long var8 = Scenery.lookupTypemask0(var6, var1, var3 + var0);
+ int var10;
+ int var11;
+ int var12;
+ ObjectDefinition var13;
+ int var14;
+ int[] var15;
+ int var16;
+ if (var8 != 0) {
+ var10 = 3 & (int) var8 >> 20;
+ var11 = (508650 & (int) var8) >> 14;
+ var12 = Integer.MAX_VALUE & (int) (var8 >>> 32);
+ var13 = ObjectDefinition.getObjectDefinition(var12);
+ if (var13.anInt1516 == -1) {
+ var14 = var2;
+ if (var8 > 0) {
+ var14 = var4;
+ }
+
+ var15 = Toolkit.JAVA_TOOLKIT.getBuffer();
+ var16 = 4 * (-(var3 * 512) + '\uce00') + var1 * 4 + 24624;
+ if (var11 == 0 || var11 == 2) {
+ if (var10 == 0) {
+ var15[var16] = var14;
+ var15[512 + var16] = var14;
+ var15[var16 - -1024] = var14;
+ var15[1536 + var16] = var14;
+ } else if (var10 == 1) {
+ var15[var16] = var14;
+ var15[1 + var16] = var14;
+ var15[var16 - -2] = var14;
+ var15[var16 - -3] = var14;
+ } else if (var10 == 2) {
+ var15[var16 - -3] = var14;
+ var15[var16 - -3 - -512] = var14;
+ var15[var16 - -3 + 1024] = var14;
+ var15[var16 + 3 + 1536] = var14;
+ } else {
+ var15[var16 + 1536] = var14;
+ var15[1536 + var16 - -1] = var14;
+ var15[var16 + 1538] = var14;
+ var15[3 + var16 + 1536] = var14;
+ }
+ }
+
+ if (var11 == 3) {
+ if (var10 == 0) {
+ var15[var16] = var14;
+ } else if (1 == var10) {
+ var15[var16 - -3] = var14;
+ } else if (var10 == 2) {
+ var15[var16 - -3 + 1536] = var14;
+ } else {
+ var15[var16 - -1536] = var14;
+ }
+ }
+
+ if (var11 == 2) {
+ if (var10 == 3) {
+ var15[var16] = var14;
+ var15[var16 - -512] = var14;
+ var15[var16 + 1024] = var14;
+ var15[1536 + var16] = var14;
+ } else if (var10 == 0) {
+ var15[var16] = var14;
+ var15[1 + var16] = var14;
+ var15[2 + var16] = var14;
+ var15[3 + var16] = var14;
+ } else if (var10 == 1) {
+ var15[var16 - -3] = var14;
+ var15[512 + 3 + var16] = var14;
+ var15[3 + (var16 - -1024)] = var14;
+ var15[1536 + var16 + 3] = var14;
+ } else {
+ var15[1536 + var16] = var14;
+ var15[var16 - -1536 + 1] = var14;
+ var15[1536 + var16 + 2] = var14;
+ var15[var16 + 1539] = var14;
+ }
+ }
+ } else if (AudioThread.method888(var1, var13, var0, var3, var10)) {
+ return false;
+ }
+ }
+
+ var8 = Scenery.lookupTypemask2(var6, var1, var0 + var3);
+ if (var8 != 0L) {
+ var10 = (int) var8 >> 20 & 3;
+ var11 = ((int) var8 & 520964) >> 14;
+ var12 = (int) (var8 >>> 32) & Integer.MAX_VALUE;
+ var13 = ObjectDefinition.getObjectDefinition(var12);
+ if (var13.anInt1516 != -1) {
+ if (AudioThread.method888(var1, var13, var0, var3, var10)) {
+ return false;
+ }
+ } else if (var11 == 9) {
+ var14 = 15658734;
+ if (var8 > 0) {
+ var14 = 15597568;
+ }
+
+ var16 = var1 * 4 + (24624 - -(2048 * (103 - var3)));
+ var15 = Toolkit.JAVA_TOOLKIT.getBuffer();
+ if (var10 == 0 || var10 == 2) {
+ var15[1536 + var16] = var14;
+ var15[var16 - -1025] = var14;
+ var15[var16 + 512 + 2] = var14;
+ var15[var16 - -3] = var14;
+ } else {
+ var15[var16] = var14;
+ var15[var16 - -512 - -1] = var14;
+ var15[var16 - -1024 - -2] = var14;
+ var15[1536 + var16 - -3] = var14;
+ }
+ }
+ }
+
+ var8 = Scenery.lookupTypeMask3(var6, var1, var3 + var0);
+ if (var8 != 0L) {
+ var10 = (int) var8 >> 20 & 3;
+ var11 = (int) (var8 >>> 32) & Integer.MAX_VALUE;
+ ObjectDefinition var18 = ObjectDefinition.getObjectDefinition(var11);
+ return var18.anInt1516 == -1 || !AudioThread.method888(var1, var18, var0, var3, var10);
+ }
+
+ return true;
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "na.N(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + 0 + ',' + var6 + ',' + true + ')');
+ }
+ }
+
+ static int method1535(WorldListEntry var0, WorldListEntry var1, int var2, int var3, int var4, boolean var5, boolean var6) {
+ try {
+ int var7 = Class161.method2201(var1, var4, var2 + -5638, var0, var6);
+ if (var7 == 0) {
+ if (var2 != 5730) {
+ return -76;
+ } else if (var3 == -1) {
+ return 0;
+ } else {
+ int var8 = Class161.method2201(var1, var3, var2 ^ 5651, var0, var5);
+ return !var5 ? var8 : -var8;
+ }
+ } else {
+ return !var6 ? var7 : -var7;
+ }
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "na.D(" + (var0 != null ? "{...}" : "null") + ',' + (var1 != null ? "{...}" : "null") + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ static SoftwareSprite method1537(CacheIndex var0, int var1) {
+ try {
+ if (GroundItem.method2029((byte) -118, var0, var1)) {
+
+ return Class117.method1722(-93);
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "na.GB(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + false + ')');
+ }
+ }
+
+ static LDIndexedSprite method1539(int var2, CacheIndex var3) {
+ try {
+ // System.out.println("RSString " + var2);
+ return Class75_Sub4.method1351(var3, 0, var2) ? Class77.method1364() : null;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "na.MA(" + 0 + ',' + true + ',' + var2 + ',' + (var3 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static RSString method802(int var0) {
+ try {
+
+ return Class163_Sub2_Sub1.aStringArray4016[var0].length() > 0 ? RSString.stringCombiner(new RSString[]{GroundItem.aStringArray2935[var0], TextCore.Spacer, Class163_Sub2_Sub1.aStringArray4016[var0]}) : GroundItem.aStringArray2935[var0];
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "wa.RB(" + var0 + ',' + true + ')');
+ }
+ }
+
+ public static void method83(byte var0) {
+ try {
+ ItemDefinition.stringsStack = null;
+ if (var0 != 30) {
+ method84(null, 89);
+ }
+
+ aLinkedList_78 = null;
+ aBooleanArray73 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ab.H(" + var0 + ')');
+ }
+ }
+
+ static void calculateInterfacePosition(RSInterface iface, int parentWidth, int parentHeight) {
+ if (iface.verticalPos == 0) {
+ iface.anInt210 = iface.defY;
+ } else if (iface.verticalPos == 1) {
+ iface.anInt210 = (parentHeight - iface.height) / 2 + iface.defY;
+ } else if (iface.verticalPos == 2) {
+ iface.anInt210 = parentHeight - iface.height - iface.defY;
+ } else if (iface.verticalPos == 3) {
+ iface.anInt210 = iface.defY * parentHeight >> 14;
+ } else if (iface.verticalPos == 4) {
+ iface.anInt210 = (parentHeight * iface.defY >> 14) + (-iface.height + parentHeight) / 2;
+ } else {
+ iface.anInt210 = -(parentHeight * iface.defY >> 14) + -iface.height + parentHeight;
+ }
+
+ if (0 == iface.horizontalPos) {
+ iface.anInt306 = iface.defX;
+ } else if (iface.horizontalPos == 1) {
+ iface.anInt306 = iface.defX + (parentWidth - iface.width) / 2;
+ } else if (iface.horizontalPos == 2) {
+ iface.anInt306 = -iface.defX + -iface.width + parentWidth;
+ } else if (3 == iface.horizontalPos) {
+ iface.anInt306 = iface.defX * parentWidth >> 14;
+ } else if (4 == iface.horizontalPos) {
+ iface.anInt306 = (iface.defX * parentWidth >> 14) + (parentWidth - iface.width) / 2;
+ } else {
+ iface.anInt306 = -(parentWidth * iface.defX >> 14) + parentWidth + -iface.width;
+ }
+
+ if (ClientCommands.commandQaOpEnabled && (Client.method44(iface).anInt2205 != 0 || iface.type == 0)) {
+ if (iface.anInt210 < 0) {
+ iface.anInt210 = 0;
+ } else if (iface.height + iface.anInt210 > parentHeight) {
+ iface.anInt210 = parentHeight + -iface.height;
+ }
+
+ if (0 > iface.anInt306) {
+ iface.anInt306 = 0;
+ } else if (parentWidth < iface.anInt306 - -iface.width) {
+ iface.anInt306 = parentWidth + -iface.width;
+ }
+ }
+ }
+
+ static void method1225() {
+ try {
+ MouseListeningClass var1 = aClass149_4047;
+ synchronized (var1) {
+
+ TextureOperation21.anInt3069 = GraphicDefinition.anInt549;
+ Class126.anInt1676 = Class3_Sub21.anInt2493;
+ anInt1709 = MouseListeningClass.anInt1340;
+ anInt3644 = Class140_Sub3.anInt2743;
+ Class163_Sub1.anInt2993 = RenderAnimationDefinition.anInt362;
+ ++anInt4045;
+ Class38_Sub1.anInt2614 = TextureOperation14.anInt3389;
+ Class75.aLong1102 = Class140_Sub6.aLong2926;
+ Class140_Sub3.anInt2743 = 0;
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ii.D(" + 18074 + ')');
+ }
+ }
+
+ static void method848() {
+ try {
+ if (Class44.aFloat727 < NPC.aFloat3979) {
+ Class44.aFloat727 = (float) ((double) Class44.aFloat727 + (double) Class44.aFloat727 / 30.0D);
+ if (NPC.aFloat3979 < Class44.aFloat727) {
+ Class44.aFloat727 = NPC.aFloat3979;
+ }
+
+ Class3_Sub5.method117();
+ } else if (NPC.aFloat3979 < Class44.aFloat727) {
+ Class44.aFloat727 = (float) ((double) Class44.aFloat727 - (double) Class44.aFloat727 / 30.0D);
+ if (NPC.aFloat3979 > Class44.aFloat727) {
+ Class44.aFloat727 = NPC.aFloat3979;
+ }
+
+ Class3_Sub5.method117();
+ }
+
+ if (Texture.anInt1150 != -1 && -1 != TextureOperation13.anInt3362) {
+ int var1 = -Class3_Sub28_Sub1.anInt3536 + Texture.anInt1150;
+ if (2 > var1 || var1 > 2) {
+ var1 >>= 4;
+ }
+
+ int var2 = -Scenery.anInt2251 + TextureOperation13.anInt3362;
+ if (var2 < 2 || var2 > 2) {
+ var2 >>= 4;
+ }
+
+ Scenery.anInt2251 -= -var2;
+ Class3_Sub28_Sub1.anInt3536 += var1;
+ if (0 == var1 && 0 == var2) {
+ Texture.anInt1150 = -1;
+ TextureOperation13.anInt3362 = -1;
+ }
+
+ Class3_Sub5.method117();
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "bb.A(" + 4 + ')');
+ }
+ }
+
+ static int bitwiseAnd(int var0, int var1) {
+ try {
+ return var0 & var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "qc.C(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ static LDIndexedSprite[] method1281() {
+ try {
+ LDIndexedSprite[] var1 = new LDIndexedSprite[Class95.anInt1338];
+
+ for (int var2 = 0; Class95.anInt1338 > var2; ++var2) {
+ var1[var2] = new LDIndexedSprite(Class3_Sub15.anInt2426, Class133.anInt1748, Class164.anIntArray2048[var2], anIntArray2591[var2], GroundItem.anIntArray2931[var2], anIntArray3076[var2], Class163_Sub1.aByteArrayArray2987[var2], TextureOperation38.spritePalette);
+ }
+
+ Class39.method1035((byte) 116);
+ return var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "jg.A(" + 0 + ')');
+ }
+ }
+
+ public static void method1282(int var0, int var2, int var3, int var4) {
+ try {
+ for (int var5 = 0; var5 < Class3_Sub28_Sub3.anInt3557; ++var5) {
+ if (var0 < AudioChannel.anIntArray1969[var5] - -Class3_Sub28_Sub18.anIntArray3768[var5] && var0 + var4 > AudioChannel.anIntArray1969[var5] && var2 < Player.anIntArray3954[var5] - -Entity.anIntArray2794[var5] && var3 + var2 > Player.anIntArray3954[var5]) {
+ Class163_Sub1_Sub1.aBooleanArray4008[var5] = true;
+ }
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "jg.C(" + var0 + ',' + (byte) 122 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ static Class3_Sub15 method1245(CacheIndex var1, int var2) {
+ try {
+
+ byte[] var3 = var1.method2138(var2);
+ return var3 != null ? new Class3_Sub15(var3) : null;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "jb.F(" + 117 + ',' + (var1 != null ? "{...}" : "null") + ',' + var2 + ')');
+ }
+ }
+
+ static void method1250(int var0, boolean var1) {
+ try {
+ Class3_Sub10.aByteArrayArrayArray2339 = null;
+ Class44.anIntArrayArrayArray720 = null;
+ if (var0 < 14) {
+ method1250(10, true);
+ }
+
+ Class3_Sub28_Sub3.aClass11_3551 = null;
+ RenderAnimationDefinition.aByteArrayArrayArray383 = null;
+ Class83.anIntArray1161 = null;
+ CS2Script.aByteArrayArrayArray2452 = null;
+ if (var1 && null != aClass3_Sub28_Sub3_2600) {
+ Class3_Sub20.aString_3220 = aClass3_Sub28_Sub3_2600.aString_3561;
+ } else {
+ Class3_Sub20.aString_3220 = null;
+ }
+
+ Class36.aByteArrayArrayArray640 = null;
+ TextureOperation29.aByteArrayArrayArray3390 = null;
+ Class29.anIntArrayArrayArray558 = null;
+ Class146.anIntArrayArrayArray1903 = null;
+ GroundItemLink.anInt2737 = 0;
+ aClass3_Sub28_Sub3_2600 = null;
+ Class84.aLinkedList_1162.clear();
+ Class119.aClass131_1624 = null;
+ TextureOperation13.anInt3362 = -1;
+ Class75_Sub2.aClass33_2648 = null;
+ Class91.aClass33_1305 = null;
+ aClass33_1238 = null;
+ Class161.aClass33_2034 = null;
+ Class164_Sub2.aClass33_3019 = null;
+ Class99.aClass33_1399 = null;
+ Class75_Sub2.aClass33_2637 = null;
+ Class119.aClass33_1626 = null;
+ Class36.aAbstractSprite_637 = null;
+ Texture.anInt1150 = -1;
+ GroundItemLink.aSoftwareSprite_3221 = null;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "jb.E(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static int[] method62() {
+ try {
+
+ int[] var8 = new int[2048];
+ TextureOperation34 var9 = new TextureOperation34();
+ var9.anInt3060 = 8;
+ var9.anInt3058 = 4;
+ var9.anInt3067 = 35;
+ var9.anInt3056 = 8;
+ var9.anInt3062 = (int) ((float) 0.4 * 4096.0F);
+ var9.aBoolean3065 = true;
+ var9.postDecode();
+ TextureOperation33.method180(-106, 1, 2048);
+ var9.method186(0, var8);
+ return var8;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "qk.A(" + true + ',' + 14585 + ',' + 8 + ',' + 2048 + ',' + 4 + ',' + (float) 0.4 + ',' + 8 + ',' + 35 + ')');
+ }
+ }
+
+ public static int method64(int var1) {
+ try {
+ return var1 >>> 8;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "qk.D(" + true + ',' + var1 + ')');
+ }
+ }
+
+ public static short[] method65(short[] var1) {
+ try {
+ if (null == var1) {
+ return null;
+ } else {
+ short[] var2 = new short[var1.length];
+ ArrayUtils.arraycopy(var1, 0, var2, 0, var1.length);
+ return var2;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "vg.A(" + 23032 + ',' + "{...}" + ')');
+ }
+ }
+
+ public static void method66(RSString var0, int var1, int var2, byte var3, int var4) {
+ try {
+ RSInterface var5 = AbstractSprite.method638(var4, var1);
+ if (null != var5) {
+ if (var5.anObjectArray314 != null) {
+ CS2Script var6 = new CS2Script();
+ var6.arguments = var5.anObjectArray314;
+ var6.aClass11_2449 = var5;
+ var6.aString_2439 = var0;
+ var6.interfaceButtons = var2; // Set to 1 for jukebox/friends/all/game chat. set to non 1 for all other chat settings
+ Class43.method1065(var6);
+ }
+
+ boolean var8 = true;
+ if (0 < var5.anInt189) {
+ var8 = BufferedDataStream.method715(var5);
+ }
+
+ if (var8) {
+ if (Client.method44(var5).method92(var2 - 1, (byte) -108)) {
+ if (1 == var2) {
+ TextureOperation12.outgoingBuffer.putOpcode(155);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var3 < -7) {
+ if (var2 == 2) {
+ TextureOperation12.outgoingBuffer.putOpcode(196);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 3) {
+ TextureOperation12.outgoingBuffer.putOpcode(124);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 4) {
+ TextureOperation12.outgoingBuffer.putOpcode(199);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 5) {
+ TextureOperation12.outgoingBuffer.putOpcode(234);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (6 == var2) {
+ TextureOperation12.outgoingBuffer.putOpcode(168);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 7) {
+ TextureOperation12.outgoingBuffer.putOpcode(166);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 8) {
+ TextureOperation12.outgoingBuffer.putOpcode(64);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 9) {
+ TextureOperation12.outgoingBuffer.putOpcode(53);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ if (var2 == 10) {
+ TextureOperation12.outgoingBuffer.putOpcode(9);
+ TextureOperation12.outgoingBuffer.writeInt(var4);
+ TextureOperation12.outgoingBuffer.writeShort(var1);
+ }
+
+ }
+ }
+ }
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "vg.D(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ public static void method68(int var0, Entity var2) {
+ try {
+ if (var2.anInt2800 <= Class44.anInt719) {
+ if (var2.anInt2790 >= Class44.anInt719) {
+ method2270(var2);
+ } else {
+ method1180((byte) -22, var2);
+ }
+ } else {
+ PositionedGraphicObject.method1950(var2);
+ }
+
+ if (var2.xAxis < 128 || var2.yAxis < 128 || var2.xAxis >= 13184 || var2.yAxis >= 13184) {
+ var2.anInt2771 = -1;
+ var2.anInt2842 = -1;
+ var2.anInt2800 = 0;
+ var2.anInt2790 = 0;
+ var2.xAxis = 128 * var2.xOffsets2767[0] - -(64 * var2.getSize());
+ var2.yAxis = var2.yOffsets2755[0] * 128 + var2.getSize() * 64;
+ var2.method1973(2279 + -2395);
+ }
+
+ if (var2 == Class102.player && (var2.xAxis < 1536 || var2.yAxis < 1536 || var2.xAxis >= 11776 || var2.yAxis >= 11776)) {
+ var2.anInt2842 = -1;
+ var2.anInt2800 = 0;
+ var2.anInt2790 = 0;
+ var2.anInt2771 = -1;
+ var2.xAxis = var2.xOffsets2767[0] * 128 + var2.getSize() * 64;
+ var2.yAxis = 128 * var2.yOffsets2755[0] + 64 * var2.getSize();
+ var2.method1973(-98);
+ }
+
+ Class17.method904(65536, var2);
+ RenderAnimationDefinition.method900(var2);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "vg.C(" + var0 + ',' + 2279 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method1470(int var0, SequenceDefinition var1, int var3, boolean var4, int var5) {
+ try {
+ if (AudioHandler.currentSoundEffectCount < 50) {
+ if (var1.sounds != null && var1.sounds.length > var5 && null != var1.sounds[var5]) {
+ int var6 = var1.sounds[var5][0];
+ int var7 = var6 >> 8;
+ int var10;
+ if (1 < var1.sounds[var5].length) {
+ var10 = (int) ((double) var1.sounds[var5].length * Math.random());
+ if (0 < var10) {
+ var7 = var1.sounds[var5][var10];
+ }
+ }
+
+ int var8 = var6 >> 5 & 7;
+ int var9 = var6 & 31;
+ if (var9 == 0) {
+ if (var4) {
+ AudioHandler.soundEffectHandler(var8, var7, 0);
+ }
+
+ } else if (0 != Sprites.ambientVolume) {
+ AudioHandler.soundEffectIDs[AudioHandler.currentSoundEffectCount] = var7;
+ AudioHandler.soundEffectVolumeArray[AudioHandler.currentSoundEffectCount] = var8;
+ int var11 = (-64 + var0) / 128;
+ var10 = (var3 + -64) / 128;
+ AudioHandler.soundEffectDelayArray[AudioHandler.currentSoundEffectCount] = 0;
+ AudioHandler.soundEffects[AudioHandler.currentSoundEffectCount] = null;
+ AudioHandler.soundEffectCoordinates[AudioHandler.currentSoundEffectCount] = var9 + (var10 << 16) + (var11 << 8);
+
+ ++AudioHandler.currentSoundEffectCount;
+ }
+ }
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "ma.C(" + var0 + ',' + (var1 != null ? "{...}" : "null") + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ public static void method1460(int var0, int var1, int var3, int var4, int var5, int var6) {
+ try {
+ if (Class101.anInt1425 <= var5 - var4 && Class3_Sub28_Sub18.anInt3765 >= var5 - -var4 && Class159.anInt2020 <= -var4 + var1 && Class57.anInt902 >= var4 + var1) {
+ TextureOperation6.method175(var6, var0, var1, var3, var4, var5);
+ } else {
+ method2275(var3, var1, var4, var6, var0, var5);
+ }
+
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ma.A(" + var0 + ',' + var1 + ',' + (byte) -113 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ public static void method1469(int[] var0, int var1, int var2, int var3, int var4, int var5) {
+ TileData var6 = TileData.aTileDataArrayArrayArray2638[var3][var4][var5];
+ if (var6 != null) {
+ Class126 var7 = var6.aClass126_2240;
+ int var9;
+ if (var7 == null) {
+ Class35 var8 = var6.aClass35_2226;
+ if (var8 != null) {
+ var9 = var8.anInt611;
+ int var10 = var8.anInt612;
+ int var11 = var8.anInt626;
+ int var12 = var8.anInt621;
+ int[] var13 = TextureOperation19.anIntArrayArray3215[var9];
+ int[] var14 = anIntArrayArray2039[var10];
+ int var15 = 0;
+ int var16;
+ if (var11 == 0) {
+ for (var16 = 0; var16 < 4; ++var16) {
+ if (var13[var14[var15++]] != 0) {
+ var0[var1] = var12;
+ }
+
+ if (var13[var14[var15++]] != 0) {
+ var0[var1 + 1] = var12;
+ }
+
+ if (var13[var14[var15++]] != 0) {
+ var0[var1 + 2] = var12;
+ }
+
+ if (var13[var14[var15++]] != 0) {
+ var0[var1 + 3] = var12;
+ }
+
+ var1 += var2;
+ }
+ } else {
+ for (var16 = 0; var16 < 4; ++var16) {
+ var0[var1] = var13[var14[var15++]] == 0 ? var11 : var12;
+ var0[var1 + 1] = var13[var14[var15++]] == 0 ? var11 : var12;
+ var0[var1 + 2] = var13[var14[var15++]] == 0 ? var11 : var12;
+ var0[var1 + 3] = var13[var14[var15++]] == 0 ? var11 : var12;
+ var1 += var2;
+ }
+ }
+
+ }
+ } else {
+ int var17 = var7.anInt1673;
+ if (var17 != 0) {
+ for (var9 = 0; var9 < 4; ++var9) {
+ var0[var1] = var17;
+ var0[var1 + 1] = var17;
+ var0[var1 + 2] = var17;
+ var0[var1 + 3] = var17;
+ var1 += var2;
+ }
+
+ }
+ }
+ }
+ }
+
+ public static boolean method2096(int var0, int var1, int var2, long var3) {
+ TileData var5 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ if (var5 == null) {
+ return false;
+ } else if (var5.aClass70_2234 != null && var5.aClass70_2234.aLong1048 == var3) {
+ return true;
+ } else if (var5.aClass19_2233 != null && var5.aClass19_2233.aLong428 == var3) {
+ return true;
+ } else if (var5.aClass12_2230 != null && var5.aClass12_2230.aLong328 == var3) {
+ return true;
+ } else {
+ for (int var6 = 0; var6 < var5.anInt2223; ++var6) {
+ if (var5.aClass25Array2221[var6].aLong498 == var3) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ public static boolean method2103(int var0, int var1) {
+ try {
+ return var1 >= -78 || (var0 == 198 || 230 == var0 || var0 == 156 || var0 == 140 || 223 == var0);
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "bg.P(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static void method2104(RSInterface var0, boolean var1, int var2) {
+ try {
+ int var4 = var0.anInt240 != 0 ? var0.anInt240 : var0.width;
+ int var5 = var0.anInt252 != 0 ? var0.anInt252 : var0.height;
+ Class158.method2183(var0.componentHash, var1, var4, var5, GameObject.interfaces1834[var0.componentHash >> 16]);
+ if (var0.aClass11Array262 != null) {
+ Class158.method2183(var0.componentHash, var1, var4, var5, var0.aClass11Array262);
+ }
+
+ Class3_Sub31 var6 = TextureOperation23.aHashTable_3208.get(var0.componentHash);
+ if (var6 != null) {
+ Class75_Sub4.method1352(var5, var1, var6.anInt2602, var4);
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "bg.N(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public static void method84(RSString var0, int var1) {
+ try {
+ int var2 = method1602(var0);
+ if (var2 != -1) {
+ method565(Class119.aClass131_1624.xArray1727[var2], Class119.aClass131_1624.yArray1718[var2]);
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ab.N(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ')');
+ }
+ }
+
+ public static void languageSetter(int var1) {
+ try {
+ if (0 != var1) {
+ if (var1 == 1) {
+ Translation.englishToGerman();
+ } else {
+ if (2 != var1) {
+ throw new RuntimeException();
+ }
+
+ Translation.englishToFrench();
+ }
+
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ab.K(" + ',' + var1 + ')');
+ }
+ }
+
+ public static Class106[] method88() {
+ try {
+
+ if (Class56.aClass106Array890 == null) {
+ Class106[] var1 = method596(Class38.gameSignlink);
+ Class106[] var2 = new Class106[var1.length];
+ int var3 = 0;
+
+ label58:
+ for (Class106 var5 : var1) {
+ if ((0 >= var5.anInt1450 || var5.anInt1450 >= 24) && var5.anInt1447 >= 800 && 600 <= var5.anInt1449) {
+ for (int var6 = 0; var3 > var6; ++var6) {
+ Class106 var7 = var2[var6];
+ if (var5.anInt1447 == var7.anInt1447 && var5.anInt1449 == var7.anInt1449) {
+ if (var7.anInt1450 < var5.anInt1450) {
+ var2[var6] = var5;
+ }
+ continue label58;
+ }
+ }
+
+ var2[var3] = var5;
+ ++var3;
+ }
+ }
+
+ Class56.aClass106Array890 = new Class106[var3];
+ ArrayUtils.arraycopy(var2, 0, Class56.aClass106Array890, 0, var3);
+ int[] var9 = new int[Class56.aClass106Array890.length];
+
+ for (int var10 = 0; Class56.aClass106Array890.length > var10; ++var10) {
+ Class106 var11 = Class56.aClass106Array890[var10];
+ var9[var10] = var11.anInt1449 * var11.anInt1447;
+ }
+
+ Class108.method1658(var9, Class56.aClass106Array890);
+ }
+
+ return Class56.aClass106Array890;
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ab.M(" + (byte) 28 + ')');
+ }
+ }
+
+ public static void method89(CacheIndex var1, CacheIndex var2, CacheIndex var3, CacheIndex var4) {
+ try {
+ Class12.spritesIndex_323 = var2;
+ Class97.fontsIndex_1378 = var1;
+ interfacesIndex_3361 = var3;
+ Class119.modelsIndex_1628 = var4;
+
+ GameObject.interfaces1834 = new RSInterface[interfacesIndex_3361.method2121()][];
+ aBooleanArray1703 = new boolean[interfacesIndex_3361.method2121()];
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "ab.J(" + true + ',' + (var1 != null ? "{...}" : "null") + ',' + (var2 != null ? "{...}" : "null") + ',' + (var3 != null ? "{...}" : "null") + ',' + (var4 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method1772(int plane, int animId, int dummy, NPC var3) {
+ try {
+ if (var3.anInt2771 == animId && -1 != animId) {
+ SequenceDefinition var4 = SequenceDefinition.getAnimationDefinition(animId);
+ int var5 = var4.delayType;
+ if (var5 == 1) {
+ var3.anInt2776 = 1;
+ var3.anInt2832 = 0;
+ var3.anInt2760 = 0;
+ var3.anInt2773 = 0;
+ var3.anInt2828 = plane;
+ method1470(var3.yAxis, var4, var3.xAxis, false, var3.anInt2832);
+ }
+
+ if (var5 == 2) {
+ var3.anInt2773 = 0;
+ }
+ } else if (animId == -1 || -1 == var3.anInt2771 || SequenceDefinition.getAnimationDefinition(animId).forcedPriority >= SequenceDefinition.getAnimationDefinition(var3.anInt2771).forcedPriority) {
+ var3.anInt2760 = 0;
+ var3.anInt2771 = animId;
+ var3.anInt2776 = 1;
+ var3.anInt2773 = 0;
+ var3.anInt2828 = plane;
+ var3.anInt2811 = var3.anInt2816;
+ var3.anInt2832 = 0;
+ if (var3.anInt2771 != -1) {
+ method1470(var3.yAxis, SequenceDefinition.getAnimationDefinition(var3.anInt2771), var3.xAxis, false, var3.anInt2832);
+ }
+ }
+
+ if (dummy != 39) {
+ anInt1711 = 41;
+ }
+
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "sc.J(" + plane + ',' + animId + ',' + dummy + ',' + (var3 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method1775() {
+ for (int var0 = 0; var0 < anInt3070; ++var0) {
+ Class25 var1 = SequenceDefinition.aClass25Array1868[var0];
+ Class158.method2186(var1);
+ SequenceDefinition.aClass25Array1868[var0] = null;
+ }
+
+ anInt3070 = 0;
+ }
+
+ public static void method1783(Component var1) {
+ try {
+ var1.removeMouseListener(aClass149_4047);
+ var1.removeMouseMotionListener(aClass149_4047);
+ var1.removeFocusListener(aClass149_4047);
+ GraphicDefinition.anInt549 = 0;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "sc.M(" + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method1396(int var0) {
+ try {
+ int var2 = Class106.rightMargin;
+ int var1 = Class84.leftMargin;
+ int var4 = -GroundItem.canvasHeight + (Class70.frameHeight - var2);
+ int var3 = -var1 + frameWidth - Class23.canvasWidth;
+ if (~var1 < var0 || var3 > 0 || var2 > 0 || var4 > 0) {
+ try {
+ Object var5;
+ if (null != TextureOperation30.fullScreenFrame) {
+ var5 = TextureOperation30.fullScreenFrame;
+ } else if (GameShell.frame == null) {
+ var5 = Class38.gameSignlink.gameApplet;
+ } else {
+ var5 = GameShell.frame;
+ }
+
+ int var7 = 0;
+ int var6 = 0;
+ if (GameShell.frame == var5) {
+ Insets var8 = GameShell.frame.getInsets();
+ var6 = var8.left;
+ var7 = var8.top;
+ }
+
+ Graphics var11 = ((Container) var5).getGraphics();
+ var11.setColor(Color.black);
+ if (var1 > 0) {
+ var11.fillRect(var6, var7, var1, Class70.frameHeight);
+ }
+
+ if (0 < var2) {
+ var11.fillRect(var6, var7, frameWidth, var2);
+ }
+
+ if (var3 > 0) {
+ var11.fillRect(-var3 + var6 + frameWidth, var7, var3, Class70.frameHeight);
+ }
+
+ if (var4 > 0) {
+ var11.fillRect(var6, -var4 + var7 + Class70.frameHeight, frameWidth, var4);
+ }
+ } catch (Exception var9) {
+ }
+ }
+
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "l.A(" + var0 + ')');
+ }
+ }
+
+ public static void method589(int var0, int var1, int var2) {
+ TextureOperation37.aBoolean3261 = true;
+ Class91.anInt1302 = var0;
+ Class49.anInt819 = var1;
+ TextureOperation18.anInt4039 = var2;
+ Class27.anInt515 = -1;
+ anInt999 = -1;
+ }
+
+ public static boolean method590(byte var0, int var1, int var2) {
+ try {
+ if (11 == var2) {
+ var2 = 10;
+ }
+
+ if (var2 >= 5 && var2 <= 8) {
+ var2 = 4;
+ }
+
+ ObjectDefinition var4 = ObjectDefinition.getObjectDefinition(var1);
+ return var4.method1684(var2);
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "il.D(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public static boolean method591(int var0) {
+ try {
+ KeyboardListener var1 = TextureOperation33.aClass148_3049;
+ synchronized (var1) {
+ if (Class3_Sub28_Sub9.anInt3620 == Class134.anInt1762) {
+ return false;
+ } else {
+ Class3_Sub28_Sub9.anInt3624 = Class129.anIntArray1693[Class3_Sub28_Sub9.anInt3620];
+ TextureOperation7.anInt3342 = KeyboardListener.anIntArray1978[Class3_Sub28_Sub9.anInt3620];
+ Class3_Sub28_Sub9.anInt3620 = 1 + Class3_Sub28_Sub9.anInt3620 & 127;
+ if (var0 < 58) {
+ method591(68);
+ }
+
+ return true;
+ }
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "c.F(" + var0 + ')');
+ }
+ }
+
+ public static void method592(byte var0) {
+ try {
+ aClass25Array4060 = null;
+ TextCore.aString_4057 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "c.P(" + var0 + ')');
+ }
+ }
+
+ public static void method593(Frame var0, Signlink var2) {
+ try {
+
+ while (true) {
+ Class64 var3 = var2.method1436(var0, 86);
+
+ while (var3.anInt978 == 0) {
+ TimeUtils.sleep(10L);
+ }
+
+ if (1 == var3.anInt978) {
+ var0.setVisible(false);
+ var0.dispose();
+ return;
+ }
+
+ TimeUtils.sleep(100L);
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "c.R(" + (var0 != null ? "{...}" : "null") + ',' + true + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static Class106[] method596(Signlink var1) {
+ try {
+ if (var1.method1432(false)) {
+ Class64 var2 = var1.method1453((byte) 8);
+
+ while (0 == var2.anInt978) {
+ TimeUtils.sleep(10L);
+ }
+
+ if (2 == var2.anInt978) {
+ return new Class106[0];
+ } else {
+ int[] var3 = (int[]) var2.anObject974;
+ Class106[] var4 = new Class106[var3.length >> 2];
+
+ for (int var5 = 0; var5 < var4.length; ++var5) {
+ Class106 var6 = new Class106();
+ var4[var5] = var6;
+ var6.anInt1447 = var3[var5 << 2];
+ var6.anInt1449 = var3[(var5 << 2) + 1];
+ var6.anInt1450 = var3[(var5 << 2) - -2];
+ }
+
+ return var4;
+ }
+ } else {
+ return new Class106[0];
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "pm.P(" + 10 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method598(boolean var0, int var1, boolean var2, int var3, boolean var4, int var5, int var6) {
+ try {
+ if (var2) {
+ HDToolKit.method1842();
+ }
+
+ if (null != TextureOperation30.fullScreenFrame && (3 != var1 || TextureOperation.anInt2378 != var5 || anInt3071 != var6)) {
+ method593(TextureOperation30.fullScreenFrame, Class38.gameSignlink);
+ TextureOperation30.fullScreenFrame = null;
+ }
+
+ if (3 == var1 && null == TextureOperation30.fullScreenFrame) {
+ TextureOperation30.fullScreenFrame = Class99.method1597(0, var6, var5, Class38.gameSignlink);
+ if (null != TextureOperation30.fullScreenFrame) {
+ anInt3071 = var6;
+ TextureOperation.anInt2378 = var5;
+ Class119.method1730(Class38.gameSignlink);
+ }
+ }
+
+ if (var1 == 3 && TextureOperation30.fullScreenFrame == null) {
+ method598(true, anInt2577, true, var3, var4, -1, -1);
+ } else {
+ Container var7;
+ if (null == TextureOperation30.fullScreenFrame) {
+ if (null == GameShell.frame) {
+ var7 = Class38.gameSignlink.gameApplet;
+ } else {
+ var7 = GameShell.frame;
+ }
+ } else {
+ var7 = TextureOperation30.fullScreenFrame;
+ }
+
+ frameWidth = var7.getSize().width;
+ Class70.frameHeight = var7.getSize().height;
+ Insets var8;
+ if (GameShell.frame == var7) {
+ var8 = GameShell.frame.getInsets();
+ frameWidth -= var8.right + var8.left;
+ Class70.frameHeight -= var8.bottom + var8.top;
+ }
+
+ if (var1 >= 2) {
+ Class23.canvasWidth = frameWidth;
+ GroundItem.canvasHeight = Class70.frameHeight;
+ Class84.leftMargin = 0;
+ Class106.rightMargin = 0;
+ } else {
+ Class106.rightMargin = 0;
+ Class84.leftMargin = (frameWidth + -765) / 2;
+ Class23.canvasWidth = 765;
+ GroundItem.canvasHeight = 503;
+ }
+
+ if (var0) {
+ Class163_Sub1_Sub1.method2215(GameShell.canvas);
+ method1783(GameShell.canvas);
+ if (null != Class38.aClass146_668) {
+ Class38.aClass146_668.method2082(GameShell.canvas);
+ }
+
+ Client.clientInstance.addCanvas();
+ TextureOperation34.method193((byte) 97, GameShell.canvas);
+ ItemDefinition.method1119(GameShell.canvas, var4);
+ if (Class38.aClass146_668 != null) {
+ Class38.aClass146_668.method2084(GameShell.canvas, -103);
+ }
+ } else {
+ if (HDToolKit.highDetail) {
+ HDToolKit.method1854(Class23.canvasWidth, GroundItem.canvasHeight);
+ }
+
+ GameShell.canvas.setSize(Class23.canvasWidth, GroundItem.canvasHeight);
+ if (GameShell.frame == var7) {
+ var8 = GameShell.frame.getInsets();
+ GameShell.canvas.setLocation(var8.left - -Class84.leftMargin, var8.top + Class106.rightMargin);
+ } else {
+ GameShell.canvas.setLocation(Class84.leftMargin, Class106.rightMargin);
+ }
+ }
+
+ if (0 == var1 && var3 > 0) {
+ System.out.println("Trying to run method1834 for HD");
+ HDToolKit.method1834(GameShell.canvas);
+ }
+
+ if (var2 && var1 > 0) {
+ GameShell.canvas.setIgnoreRepaint(true);
+ if (!aBoolean11) {
+ Class32.method995();
+ aClass158_3009 = null;
+ aClass158_3009 = TextureOperation18.method285(GroundItem.canvasHeight, Class23.canvasWidth, GameShell.canvas);
+ Class74.method1320();
+ if (5 == Class143.gameStage) {
+ StartupLoadingBar.draw(true, FontType.bold);
+ } else {
+ LoadingBox.draw(false, TextCore.LoadingPleaseWait2);
+ }
+
+ try {
+ Graphics var11 = GameShell.canvas.getGraphics();
+ aClass158_3009.method2179(var11);
+ } catch (Exception var9) {
+ }
+
+ method1396(-1);
+ if (var3 == 0) {
+ aClass158_3009 = TextureOperation18.method285(503, 765, GameShell.canvas);
+ } else {
+ aClass158_3009 = null;
+ }
+
+ Class64 var13 = Class38.gameSignlink.method1444(-43, Client.clientInstance.getClass());
+
+ while (var13.anInt978 == 0) {
+ TimeUtils.sleep(100L);
+ }
+
+ if (1 == var13.anInt978) {
+ aBoolean11 = true;
+ }
+ }
+
+ if (aBoolean11) {
+ HDToolKit.method1853(GameShell.canvas, 2 * anInt3671);
+ }
+ }
+
+ if (!HDToolKit.highDetail && 0 < var1) {
+ method598(true, 0, true, var3, false, -1, -1);
+ } else {
+ if (var1 > 0 && var3 == 0) {
+ GameShell.aThread409.setPriority(5);
+ aClass158_3009 = null;
+ Class140_Sub1_Sub2.method1935();
+ ((Class102) Class51.anInterface2_838).method1619(200);
+ if (Class106.aBoolean1441) {
+ Class51.method1137(0.7F);
+ }
+
+ InvalidateData.method165();
+ } else if (0 == var1 && var3 > 0) {
+ GameShell.aThread409.setPriority(1);
+ aClass158_3009 = TextureOperation18.method285(503, 765, GameShell.canvas);
+ Class140_Sub1_Sub2.method1938();
+ ((Class102) Class51.anInterface2_838).method1619(20);
+ if (Class106.aBoolean1441) {
+ if (1 == anInt3625) {
+ Class51.method1137(0.9F);
+ }
+
+ if (anInt3625 == 2) {
+ Class51.method1137(0.8F);
+ }
+
+ if (3 == anInt3625) {
+ Class51.method1137(0.7F);
+ }
+
+ if (anInt3625 == 4) {
+ Class51.method1137(0.6F);
+ }
+ }
+
+ Class3_Sub11.method144();
+ InvalidateData.method165();
+ }
+
+ aBoolean742 = !NPC.isHighDetail(89);
+ if (var2) {
+ Class3_Sub20.method389();
+ }
+
+ Class3_Sub15.aBoolean2427 = var1 >= 2;
+
+ if (-1 != ConfigInventoryDefinition.anInt3655) {
+ Class124.method1746(true, (byte) -107);
+ }
+
+ if (null != Class3_Sub15.activeConnection && (Class143.gameStage == 30 || Class143.gameStage == 25)) {
+ TextureOperation9.method204();
+ }
+
+ for (int var12 = 0; var12 < 100; ++var12) {
+ aBooleanArray3674[var12] = true;
+ }
+
+ TextureOperation30.fullRedraw = true;
+ }
+ }
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "pm.F(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ static void method1047(int var0, int var1, int var2, boolean var3, int var4, boolean var5) {
+ try {
+ if (var2 > var4) {
+ int var7 = (var2 + var4) / 2;
+ int var8 = var4;
+ WorldListEntry var9 = aClass44_Sub1Array3201[var7];
+ aClass44_Sub1Array3201[var7] = aClass44_Sub1Array3201[var2];
+ aClass44_Sub1Array3201[var2] = var9;
+
+ for (int var10 = var4; var10 < var2; ++var10) {
+ if (method1535(var9, aClass44_Sub1Array3201[var10], 5730, var0, var1, var3, var5) <= 0) {
+ WorldListEntry var11 = aClass44_Sub1Array3201[var10];
+ aClass44_Sub1Array3201[var10] = aClass44_Sub1Array3201[var8];
+ aClass44_Sub1Array3201[var8++] = var11;
+ }
+ }
+
+ aClass44_Sub1Array3201[var2] = aClass44_Sub1Array3201[var8];
+ aClass44_Sub1Array3201[var8] = var9;
+ method1047(var0, var1, -1 + var8, var3, var4, var5);
+ method1047(var0, var1, var2, var3, var8 - -1, var5);
+ }
+
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "ge.A(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + false + ')');
+ }
+ }
+
+ static RSString method1052(long var1) {
+ try {
+ if (var1 > 0 && var1 < 6582952005840035281L) {
+ if (var1 % 37L == 0) {
+ return null;
+ } else {
+ int var3 = 0;
+
+ for (long var4 = var1; var4 != 0L; ++var3) {
+ var4 /= 37L;
+ }
+
+ byte[] var6 = new byte[var3];
+
+ while (0L != var1) {
+ long var7 = var1;
+ var1 /= 37L;
+ --var3;
+ var6[var3] = Class163_Sub1_Sub1.aByteArray4005[(int) (-(var1 * 37L) + var7)];
+ }
+
+ RSString var10 = new RSString();
+ var10.buffer = var6;
+ var10.length = var6.length;
+ return var10;
+ }
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "ge.B(" + -29664 + ',' + var1 + ')');
+ }
+ }
+
+ static void method1053(CacheIndex var1) {
+ try {
+ Class97.configurationsIndex_1372 = var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ge.F(" + (byte) -117 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static Font method880(byte[] var1) {
+ try {
+ if (null == var1) {
+ return null;
+ } else {
+ Object var2;
+ if (HDToolKit.highDetail) {
+ var2 = new Class3_Sub28_Sub17_Sub2(var1, Class164.anIntArray2048, anIntArray2591, GroundItem.anIntArray2931, anIntArray3076, Class163_Sub1.aByteArrayArray2987);
+ } else {
+ var2 = new Class3_Sub28_Sub17_Sub1(var1, Class164.anIntArray2048, anIntArray2591, GroundItem.anIntArray2931, anIntArray3076, Class163_Sub1.aByteArrayArray2987);
+ }
+
+ Class39.method1035((byte) 106);
+ return (Font) var2;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ce.G(" + -22376 + ',' + "{...}" + ')');
+ }
+ }
+
+ public static void constructScenery(int plane, int y, int var2, int rotation, int x, int var5, int object_id, int typemask, int type, int var9) {
+ try {
+ Scenery var10 = null;
+
+ for (Scenery var11 = (Scenery) Scenery.sceneryList.startIteration(); var11 != null; var11 = (Scenery) Scenery.sceneryList.nextIteration()) {
+ if (var11.plane == plane && var11.x == x && var11.y == y && var11.typemask == typemask) {
+ var10 = var11;
+ break;
+ }
+ }
+
+ if (null == var10) {
+ var10 = new Scenery();
+ var10.x = x;
+ var10.y = y;
+ var10.plane = plane;
+ var10.typemask = typemask;
+ Scenery.method1798(72, var10);
+ Scenery.sceneryList.pushBack(var10);
+ }
+
+ var10.type = type;
+ var10.anInt2261 = var9;
+ var10.anInt2259 = var5;
+ var10.object_id = object_id;
+ var10.rotation = rotation;
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "ce.J(" + plane + ',' + y + ',' + var2 + ',' + rotation + ',' + x + ',' + var5 + ',' + object_id + ',' + typemask + ',' + type + ',' + var9 + ')');
+ }
+ }
+
+ public static void method882() {
+ try {
+ TextureOperation36.anInt3423 = 0;
+ Class132.anInt1741 = -1;
+ anInt154 = 1;
+ GraphicDefinition.anInt546 = 2;
+ aBoolean2311 = false;
+ Class101.musicIndex_1423 = null;
+ TextureOperation8.anInt3463 = -1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ce.F(" + -1 + ',' + 2 + ')');
+ }
+ }
+
+ public static Class3_Sub28_Sub3 method884(int var0, byte var1, int var2) {
+ try {
+ Class3_Sub28_Sub3 var3 = (Class3_Sub28_Sub3) Class134.aLinkedList_1758.startIteration();
+
+ for (; var3 != null; var3 = (Class3_Sub28_Sub3) Class134.aLinkedList_1758.nextIteration()) {
+ if (var3.aBoolean3553 && var3.method537(var2, var0)) {
+ return var3;
+ }
+ }
+
+ return null;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ce.D(" + var0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method518(Player var0) {
+ try {
+ Class3_Sub9 var2 = (Class3_Sub9) aHashTable_4046.get(var0.displayName.toLong());
+
+ if (var2 == null) {
+ Class70.method1286(var0.yOffsets2755[0], null, 0, null, var0.xOffsets2767[0], WorldListCountry.localPlane, var0);
+ } else {
+ var2.method134();
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "rg.UA(" + (var0 != null ? "{...}" : "null") + ',' + -110 + ')');
+ }
+ }
+
+ static int method519(int var0, int var2, int var3) {
+ try {
+ var0 &= 3;
+
+ return 0 != var0 ? (var0 != 1 ? (var0 == 2 ? -var3 + 7 : -var2 + 7) : var2) : var3;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "rg.RA(" + var0 + ',' + true + ',' + var2 + ',' + var3 + ')');
+ }
+ }
+
+ static Class3_Sub28_Sub3 method520(byte var0) {
+ try {
+ return aClass3_Sub28_Sub3_2600;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "rg.OA(" + var0 + ')');
+ }
+ }
+
+ static void method523(int var0, int var1, int var3, int var4, int var5, int var6, int var7, int var8) {
+ try {
+ int var9 = var3 - var8;
+ int var11 = (-var5 + var0 << 16) / var9;
+ int var10 = -var4 + var6;
+ int var12 = (var7 + -var1 << 16) / var10;
+ Class83.method1410(var1, var6, var4, var3, var5, var8, var12, var11);
+ } catch (RuntimeException var13) {
+ throw ClientErrorException.clientError(var13, "rg.SA(" + var0 + ',' + var1 + ',' + 0 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ')');
+ }
+ }
+
+ public static void method744() {
+ try {
+
+ ++KeyboardListener.anInt1908;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "wa.HA(" + true + ')');
+ }
+ }
+
+ public static void method746(byte var0) {
+ try {
+ Class67.aReferenceCache_1013.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "wa.VC(" + var0 + ')');
+ }
+ }
+
+ public static void method777(Class91[] var0, boolean var1, int var2, int var3, int var5, int var6, byte[] var7) {
+ try {
+ int var10;
+ int var11;
+ if (!var1) {
+ for (int var9 = 0; 4 > var9; ++var9) {
+ for (var10 = 0; var10 < 64; ++var10) {
+ for (var11 = 0; var11 < 64; ++var11) {
+ if (var5 - -var10 > 0 && var10 + var5 < 103 && var3 + var11 > 0 && var11 + var3 < 103) {
+ var0[var9].anIntArrayArray1304[var10 + var5][var3 - -var11] = bitwiseAnd(var0[var9].anIntArrayArray1304[var10 + var5][var3 - -var11], -16777217);
+ }
+ }
+ }
+ }
+ }
+
+ DataBuffer var20 = new DataBuffer(var7);
+ byte var8;
+ if (var1) {
+ var8 = 1;
+ } else {
+ var8 = 4;
+ }
+
+ int var12;
+ for (var10 = 0; var8 > var10; ++var10) {
+ for (var11 = 0; var11 < 64; ++var11) {
+ for (var12 = 0; 64 > var12; ++var12) {
+ Class167.method2267(var2, var6, var1, var20, var12 - -var3, var5 + var11, (byte) 91, 0, var10);
+ }
+ }
+ }
+
+ int var14;
+ int var15;
+ int var17;
+ boolean var21;
+ int var24;
+ for (var21 = false; var20.index < var20.buffer.length; var21 = true) {
+ var11 = var20.readUnsignedByte();
+ if (var11 != 129) {
+ --var20.index;
+ break;
+ }
+
+ for (var12 = 0; var12 < 4; ++var12) {
+ byte var13 = var20.readSignedByte();
+ if (0 == var13) {
+ var14 = var5;
+ if (var5 >= 0) {
+ if (var5 >= 104) {
+ var14 = 104;
+ }
+ } else {
+ var14 = 0;
+ }
+
+ var24 = var3;
+ if (var3 < 0) {
+ var24 = 0;
+ } else if (var3 >= 104) {
+ var24 = 104;
+ }
+
+ var15 = 64 + var5;
+ var17 = var3 + 64;
+ if (var17 >= 0) {
+ if (var17 >= 104) {
+ var17 = 104;
+ }
+ } else {
+ var17 = 0;
+ }
+
+ if (var15 < 0) {
+ var15 = 0;
+ } else if (var15 >= 104) {
+ var15 = 104;
+ }
+
+ while (var15 > var14) {
+ while (var24 < var17) {
+ possibleHeightmap1774[var12][var14][var24] = 0;
+ ++var24;
+ }
+
+ ++var14;
+ }
+ } else if (1 == var13) {
+ for (var14 = 0; var14 < 64; var14 += 4) {
+ for (var15 = 0; var15 < 64; var15 += 4) {
+ byte var16 = var20.readSignedByte();
+
+ for (var17 = var14 + var5; 4 + var5 + var14 > var17; ++var17) {
+ for (int var18 = var3 + var15; 4 + var3 + var15 > var18; ++var18) {
+ if (var17 >= 0 && var17 < 104 && 0 <= var18 && var18 < 104) {
+ possibleHeightmap1774[var12][var17][var18] = var16;
+ }
+ }
+ }
+ }
+ }
+ } else if (var13 == 2 && var12 > 0) {
+ var15 = var5 + 64;
+ var24 = var3;
+ var17 = var3 + 64;
+ if (var15 < 0) {
+ var15 = 0;
+ } else if (104 <= var15) {
+ var15 = 104;
+ }
+
+ if (var3 >= 0) {
+ if (var3 >= 104) {
+ var24 = 104;
+ }
+ } else {
+ var24 = 0;
+ }
+
+ if (var17 >= 0) {
+ if (var17 >= 104) {
+ var17 = 104;
+ }
+ } else {
+ var17 = 0;
+ }
+
+ var14 = var5;
+ if (var5 >= 0) {
+ if (104 <= var5) {
+ var14 = 104;
+ }
+ } else {
+ var14 = 0;
+ }
+
+ while (var15 > var14) {
+ while (var17 > var24) {
+ possibleHeightmap1774[var12][var14][var24] = possibleHeightmap1774[var12 + -1][var14][var24];
+ ++var24;
+ }
+
+ ++var14;
+ }
+ }
+ }
+ }
+
+ int var23;
+ if (HDToolKit.highDetail && !var1) {
+ AtmosphereParser var22 = null;
+
+ while (var20.buffer.length > var20.index) {
+ var12 = var20.readUnsignedByte();
+ if (var12 == 0) {
+ var22 = new AtmosphereParser(var20);
+ } else {
+ if (var12 != 1) {
+// throw
+ new IllegalStateException().printStackTrace();
+ return;//
+ }
+
+ var23 = var20.readUnsignedByte();
+ if (0 < var23) {
+ for (var14 = 0; var23 > var14; ++var14) {
+ Class43 var25 = new Class43(var20);
+ if (var25.anInt705 == 31) {
+ Class57 var26 = Class81.method1401(var20.readUnsignedShort());
+ var25.method1060((byte) -67, var26.anInt896, var26.anInt908, var26.anInt899, var26.anInt907);
+ }
+
+ var25.anInt708 += var3 << 7;
+ var25.anInt703 += var5 << 7;
+ var17 = var25.anInt708 >> 7;
+ var24 = var25.anInt703 >> 7;
+ if (var24 >= 0 && 0 <= var17 && var24 < 104 && var17 < 104) {
+ var25.aBoolean696 = 0 != (sceneryTypeMaskGrid[1][var24][var17] & 2);
+ var25.anInt697 = Class44.anIntArrayArrayArray723[var25.anInt704][var24][var17] + -var25.anInt697;
+ Class68.method1264(var25);
+ }
+ }
+ }
+ }
+ }
+
+ if (var22 == null) {
+ var22 = new AtmosphereParser();
+ }
+
+ for (var12 = 0; var12 < 8; ++var12) {
+ for (var23 = 0; var23 < 8; ++var23) {
+ var14 = var12 + (var5 >> 3);
+ var15 = (var3 >> 3) + var23;
+ if (0 <= var14 && var14 < 13 && var15 >= 0 && var15 < 13) {
+ AtmosphereParser.aAtmosphereParserArrayArray1581[var14][var15] = var22;
+ }
+ }
+ }
+ }
+
+ if (!var21) {
+ for (var11 = 0; var11 < 4; ++var11) {
+ for (var12 = 0; 16 > var12; ++var12) {
+ for (var23 = 0; var23 < 16; ++var23) {
+ var14 = (var5 >> 2) - -var12;
+ var15 = var23 + (var3 >> 2);
+ if (0 <= var14 && 26 > var14 && 0 <= var15 && var15 < 26) {
+ possibleHeightmap1774[var11][var14][var15] = 0;
+ }
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var19) {
+ throw ClientErrorException.clientError(var19, "wa.OA(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + var2 + ',' + var3 + ',' + 4 + ',' + var5 + ',' + var6 + ',' + (var7 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static Class12 method784(int var0, int var1, int var2) {
+ TileData var3 = TileData.aTileDataArrayArrayArray2638[var0][var1][var2];
+ return var3 != null && var3.aClass12_2230 != null ? var3.aClass12_2230 : null;
+ }
+
+ public static void method792() {
+ try {
+ int var1 = Class137.method1817();
+ if (0 == var1) {
+ Class158.aByteArrayArrayArray2008 = null;
+ Class136.method1816(0, -7);
+ } else if (var1 == 1) {
+ Class3_Sub5.method112((byte) 0);
+ Class136.method1816(512, -7);
+ TextureOperation19.method257();
+ } else {
+ Class3_Sub5.method112((byte) (-4 + CSConfigCachefile.anInt1127 & 0xFF));
+ Class136.method1816(2, -7);
+ }
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "wa.AA(" + 9179409 + ')');
+ }
+ }
+
+ public static Font method1300(int var1, CacheIndex var3, CacheIndex var4) {
+ //System.out.println("Class 73 " + var1);
+ return !Class75_Sub4.method1351(var3, 0, var1) ? null : method880(var4.getFile(var1, 0));
+ }
+
+ public static void method1301(int plane, int regionY, int regionX, int sceneY, boolean var4, int sceneX) {
+ try {
+ if (viewportX != regionX || Class3_Sub7.viewportY != regionY || plane != Class140_Sub3.viewportZ && !NPC.isHighDetail(45)) {
+ viewportX = regionX;
+ Class3_Sub7.viewportY = regionY;
+ Class140_Sub3.viewportZ = plane;
+ if (NPC.isHighDetail(105)) {
+ Class140_Sub3.viewportZ = 0;
+ }
+
+ if (var4) {
+ Class117.method1719(28);
+ } else {
+ Class117.method1719(25);
+ }
+
+ LoadingBox.draw(true, TextCore.LoadingPleaseWait2);
+ int var8 = Texture.y1152;
+ int var7 = Class131.x1716;
+ Texture.y1152 = regionY * 8 - 48;
+ Class131.x1716 = 8 * (-6 + regionX);
+ TextureOperation37.aClass3_Sub28_Sub3_3264 = method884(8 * viewportX, (byte) 88, 8 * Class3_Sub7.viewportY);
+ int var10 = -var8 + Texture.y1152;
+ int var9 = Class131.x1716 + -var7;
+ TextureOperation22.aClass131_3421 = null;
+ int var11;
+ NPC var12;
+ int var13;
+ if (var4) {
+ Class163.localNPCCount = 0;
+
+ for (var11 = 0; var11 < 32768; ++var11) {
+ var12 = NPC.npcs[var11];
+ if (null != var12) {
+ var12.xAxis -= 128 * var9;
+ var12.yAxis -= 128 * var10;
+ if (var12.xAxis >= 0 && var12.xAxis <= 13184 && var12.yAxis >= 0 && var12.yAxis <= 13184) {
+ for (var13 = 0; 10 > var13; ++var13) {
+ var12.xOffsets2767[var13] -= var9;
+ var12.yOffsets2755[var13] -= var10;
+ }
+
+ AudioThread.localNPCIndexes[Class163.localNPCCount++] = var11;
+ } else {
+ NPC.npcs[var11].setDefinitions(null);
+ NPC.npcs[var11] = null;
+ }
+ }
+ }
+ } else {
+ for (var11 = 0; var11 < 32768; ++var11) {
+ var12 = NPC.npcs[var11];
+ if (null != var12) {
+ for (var13 = 0; var13 < 10; ++var13) {
+ var12.xOffsets2767[var13] -= var9;
+ var12.yOffsets2755[var13] -= var10;
+ }
+
+ var12.xAxis -= 128 * var9;
+ var12.yAxis -= var10 * 128;
+ }
+ }
+ }
+
+ for (var11 = 0; var11 < 2048; ++var11) {
+ Player var23 = players[var11];
+ if (null != var23) {
+ for (var13 = 0; 10 > var13; ++var13) {
+ var23.xOffsets2767[var13] -= var9;
+ var23.yOffsets2755[var13] -= var10;
+ }
+
+ var23.xAxis -= 128 * var9;
+ var23.yAxis -= 128 * var10;
+ }
+ }
+
+ WorldListCountry.localPlane = plane;
+ Class102.player.updatePlayerPosition(sceneX, false, sceneY);
+ byte var25 = 104;
+ byte var24 = 0;
+ byte var14 = 0;
+ byte var16 = 1;
+ byte var15 = 104;
+ byte var26 = 1;
+ if (var10 < 0) {
+ var16 = -1;
+ var15 = -1;
+ var14 = 103;
+ }
+
+ if (var9 < 0) {
+ var26 = -1;
+ var24 = 103;
+ var25 = -1;
+ }
+
+ for (int var17 = var24; var25 != var17; var17 += var26) {
+ for (int var18 = var14; var18 != var15; var18 += var16) {
+ int var19 = var9 + var17;
+ int var20 = var18 + var10;
+
+ for (int var21 = 0; 4 > var21; ++var21) {
+ if (var19 >= 0 && var20 >= 0 && var19 < 104 && var20 < 104) {
+ Class39.groundItems[var21][var17][var18] = Class39.groundItems[var21][var19][var20];
+ } else {
+ Class39.groundItems[var21][var17][var18] = null;
+ }
+ }
+ }
+ }
+
+ for (Scenery var27 = (Scenery) Scenery.sceneryList.startIteration(); var27 != null; var27 = (Scenery) Scenery.sceneryList.nextIteration()) {
+ var27.y -= var10;
+ var27.x -= var9;
+ if (0 > var27.x || var27.y < 0 || var27.x >= 104 || var27.y >= 104) {
+ var27.unlink();
+ }
+ }
+
+ if (var4) {
+ NPC.anInt3995 -= 128 * var9;
+ Class77.anInt1111 -= var10 * 128;
+ Class146.anInt1904 -= var10;
+ MouseListeningClass.anInt1923 -= var9;
+ Class157.anInt1996 -= var10;
+ anInt30 -= var9;
+ } else {
+ Class133.anInt1753 = 1;
+ }
+
+ AudioHandler.currentSoundEffectCount = 0;
+ if (Class65.anInt987 != 0) {
+ Class45.anInt733 -= var10;
+ Class65.anInt987 -= var9;
+ }
+
+ if (HDToolKit.highDetail && var4 && (Math.abs(var9) > 104 || 104 < Math.abs(var10))) {
+ TextureOperation31.method236();
+ }
+
+ Class58.anInt909 = -1;
+ TextureOperation17.aLinkedList_3177.clear();
+ TextureOperation13.aLinkedList_3364.clear();
+ }
+ } catch (RuntimeException var22) {
+ throw ClientErrorException.clientError(var22, "k.D(" + plane + ',' + regionY + ',' + regionX + ',' + sceneY + ',' + var4 + ',' + sceneX + ',' + true + ')');
+ }
+ }
+
+ public static InterfaceWidget popNextInterfaceWidget() {
+ try {
+ InterfaceWidget var1 = (InterfaceWidget) Class126.aClass13_1666.getFront();
+ if (var1 == null) {
+ do {
+ var1 = (InterfaceWidget) Class81.aClass13_1139.getFront();
+ if (var1 == null) {
+ return null;
+ }
+
+ if (var1.b() > TimeUtils.time()) {
+ return null;
+ }
+
+ var1.unlink();
+ var1.unlinkNode();
+ } while ((Long.MIN_VALUE & var1.nodeKey) == 0L);
+
+ return var1;
+ } else {
+ var1.unlink();
+ var1.unlinkNode();
+ return var1;
+ }
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "k.J(" + (byte) -36 + ')');
+ }
+ }
+
+ public static RSString method1303(RSInterface var0, RSString var1) {
+ try {
+ if (var1.indexOf(RSString.parse("(U"), 102) == -1) {
+ return var1;
+ } else {
+ while (true) {
+ int var3 = var1.indexOf(TextCore.aString_331, 55);
+ if (var3 == -1) {
+ while (true) {
+ var3 = var1.indexOf(TextCore.aString_2080, 106);
+ if (var3 == -1) {
+ while (true) {
+ var3 = var1.indexOf(TextCore.aString_1301, 95);
+ if (var3 == -1) {
+ while (true) {
+ var3 = var1.indexOf(TextCore.aString_852, 57);
+ if (var3 == -1) {
+ while (true) {
+ var3 = var1.indexOf(TextCore.aString_3418, 113);
+ if (var3 == -1) {
+ while (true) {
+ var3 = var1.indexOf(TextCore.aString_1051, 50);
+ if (var3 == -1) {
+ return var1;
+ }
+
+ RSString var4 = RSString.parse("");
+ if (null != Class136.aClass64_1778) {
+ var4 = Class108.method1653(Class136.aClass64_1778.anInt979);
+
+ if (null != Class136.aClass64_1778.anObject974) {
+ byte[] var5 = ((String) Class136.aClass64_1778.anObject974).getBytes(StandardCharsets.ISO_8859_1);
+ var4 = TextureOperation33.bufferToString(var5, var5.length, 0);
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), var4, var1.substring(4 + var3)});
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), Class154.method2148(Class164_Sub2.method2247((byte) -4, 4, var0)), var1.substring(var3 - -2)});
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), Class154.method2148(Class164_Sub2.method2247((byte) -109, 3, var0)), var1.substring(2 + var3)});
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), Class154.method2148(Class164_Sub2.method2247((byte) 111, 2, var0)), var1.substring(2 + var3)});
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), Class154.method2148(Class164_Sub2.method2247((byte) 23, 1, var0)), var1.substring(var3 + 2)});
+ }
+ }
+
+ var1 = RSString.stringCombiner(new RSString[]{var1.substring(0, var3, 0), Class154.method2148(Class164_Sub2.method2247((byte) 107, 0, var0)), var1.substring(2 + var3)});
+ }
+ }
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "k.K(" + (var0 != null ? "{...}" : "null") + ',' + (var1 != null ? "{...}" : "null") + ',' + 0 + ')');
+ }
+ }
+
+ public static void method2143(byte var0, int var1, int var2, int var3, int var4) {
+ try {
+ InterfaceWidget var5 = InterfaceWidget.getWidget(8, var2);
+ var5.flagUpdate();
+ var5.anInt3596 = var1;
+ if (var0 >= -120) {
+ anInt1950 = -14;
+ }
+
+ var5.anInt3598 = var4;
+ var5.anInt3597 = var3;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "ve.U(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ public static void method2065(CacheIndex var1, CacheIndex var2) {
+ try {
+ TextureOperation4.configurationsIndex_3227 = var1;
+ SequenceDefinition.spritesIndex_1852 = var2;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "u.D(" + (byte) -125 + ',' + (var1 != null ? "{...}" : "null") + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ // static final void method2068(NPCDefinition var0, int var1, int var2, int var3, int var4) {
+ // @Splinter
+ public static void drawNpcRightClickOptions(NPCDefinition var0, int var1, int var2, int var3, int var4) {
+ try {
+ if (menuOptionCount < 400) {
+ if (var0.childNPCs != null) {
+ var0 = var0.method1471((byte) 66);
+ }
+
+ if (null != var0) {
+ if (var0.aBoolean1270) {
+ RSString var5 = var0.NPCName;
+ if (0 != var0.anInt1260) {
+ RSString var6 = Class158.paramGameTypeID != 1 ? TextCore.HasLevel : TextCore.HasRating;
+ var5 = RSString.stringCombiner(new RSString[]{var5, Player.combatLevelColor(var0.anInt1260, (byte) -122, Class102.player.COMBAT_LEVEL), TextCore.LEFT_PARENTHESES, var6, RSString.stringAnimator(var0.anInt1260), TextCore.RIGHT_PARENTHESES});
+ }
+
+ if (Class164_Sub1.anInt3012 == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class99.anInt1403, var3, (byte) -125, RSString.stringCombiner(new RSString[]{RenderAnimationDefinition.aString_378, ColorCore.TextColor, var5}), var1, (short) 26, TextCore.HasUse, var4);
+ } else if (GameObject.aBoolean1837) {
+ Class3_Sub28_Sub9 var12 = -1 == anInt1038 ? null : LinkedList.method1210(anInt1038);
+ if ((2 & Class164.anInt2051) != 0 && (var12 == null || var0.method1475(anInt1038, var12.anInt3614) != var12.anInt3614)) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(anInt1887, var3, (byte) -93, RSString.stringCombiner(new RSString[]{TextCore.aString_676, ColorCore.TextColor, var5}), var1, (short) 45, Class3_Sub28_Sub9.aString_3621, var4);
+ }
+ } else {
+ RSString[] var11 = var0.options;
+ if (Class123.aBoolean1656) {
+ var11 = Class3_Sub31.optionsArrayStringConstructor(var11);
+ }
+
+ int var7;
+ if (var11 != null) {
+ for (var7 = 4; var7 >= 0; --var7) {
+ if (var11[var7] != null && (Class158.paramGameTypeID != 0 || !var11[var7].equalsStringIgnoreCase(TextCore.HasAttack))) {
+ byte var8 = 0;
+ if (var7 == 0) {
+ var8 = 17;
+ }
+
+ if (var7 == 1) {
+ var8 = 16;
+ }
+
+ int var9 = -1;
+ if (var7 == 2) {
+ var8 = 4;
+ }
+
+ if (var7 == 3) {
+ var8 = 19;
+ }
+
+ if (var0.anInt1296 == var7) {
+ var9 = var0.anInt1253;
+ }
+
+ if (var0.anInt1289 == var7) {
+ var9 = var0.anInt1278;
+ }
+
+ if (var7 == 4) {
+ var8 = 2;
+ }
+
+ Class3_Sub24_Sub4.pushRightClickMenuAction(var9, var3, (byte) -103, RSString.stringCombiner(new RSString[]{ColorCore.NPCRightClickColor, var5}), var1, var8, var11[var7], var4);
+ }
+ }
+ }
+
+ if (0 == Class158.paramGameTypeID && var11 != null) {
+ for (var7 = 4; var7 >= 0; --var7) {
+ if (null != var11[var7] && var11[var7].equalsStringIgnoreCase(TextCore.HasAttack)) {
+ short var14 = 0;
+ if (var0.anInt1260 > Class102.player.COMBAT_LEVEL && !GameConfig.FORCE_LEFT_CLICK_ATTACK) {
+ var14 = 2000;
+ //This var sets "attack" as a right click attack option for higher level npcs, let's make it a single click!
+ }
+
+ short var13 = 0;
+ if (var7 == 0) {
+ var13 = 17;
+ }
+
+ if (var7 == 1) {
+ var13 = 16;
+ }
+
+ if (2 == var7) {
+ var13 = 4;
+ }
+
+ if (3 == var7) {
+ var13 = 19;
+ }
+
+ if (var7 == 4) {
+ var13 = 2;
+ }
+
+ if (0 != var13) {
+ var13 += var14;
+ }
+
+ Class3_Sub24_Sub4.pushRightClickMenuAction(var0.anInt1298, var3, (byte) -128, RSString.stringCombiner(new RSString[]{ColorCore.NPCRightClickColor, var5}), var1, var13, var11[var7], var4);
+ }
+ }
+ }
+
+ if (GameConfig.NPC_DEBUG_ENABLED) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var3, (byte) -73, RSString.stringCombiner(new RSString[]{ColorCore.NPCRightClickColor, var5}), var1, (short) 1007, RSString.parse("Examine" + " " + " ID: (X" + var0.npcId + "(Y"), var4);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(Class131.anInt1719, var3, (byte) -73, RSString.stringCombiner(new RSString[]{ColorCore.NPCRightClickColor, var5}), var1, (short) 1007, TextCore.HasExamine, var4);
+ }
+ }
+
+ }
+ }
+ }
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "u.A(" + (var0 != null ? "{...}" : "null") + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ')');
+ }
+ }
+
+ static void method56(int var0) {
+ InterfaceWidget var2 = InterfaceWidget.getWidget(6, var0);
+ var2.a();
+ }
+
+ static boolean loadInterface(int archive) {
+ if (!aBooleanArray1703[archive]) {
+ if (interfacesIndex_3361.method2117(archive)) {
+ int fileLength = interfacesIndex_3361.getFileAmount(archive);
+ if (0 == fileLength) {
+ aBooleanArray1703[archive] = true;
+ } else {
+ if (null == GameObject.interfaces1834[archive]) {
+ GameObject.interfaces1834[archive] = new RSInterface[fileLength];
+ }
+
+ for (int fileId = 0; fileId < fileLength; ++fileId) {
+ if (null == GameObject.interfaces1834[archive][fileId]) {
+ byte[] var4 = interfacesIndex_3361.getFile(archive, fileId);
+ if (var4 != null) {
+ RSInterface iface = GameObject.interfaces1834[archive][fileId] = new RSInterface();
+ iface.componentHash = fileId + (archive << 16);
+ if (var4[0] == -1) {
+ iface.decodeScriptFormat(new DataBuffer(var4));
+ } else {
+ iface.decodeNoScripts(new DataBuffer(var4));
+ }
+ }
+ }
+ }
+
+ aBooleanArray1703[archive] = true;
+
+ }
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ }
+
+ static void method60(int var0, int var1, int var2, Class91[] var3, int var4, byte var5, byte[] var6, int var7, int var8, int var9, boolean var10) {
+ int var13;
+ if (!var10) {
+ for (int var12 = 0; var12 < 8; ++var12) {
+ for (var13 = 0; 8 > var13; ++var13) {
+ if (0 < var1 - -var12 && var12 + var1 < 103 && var13 + var4 > 0 && var4 + var13 < 103) {
+ var3[var2].anIntArrayArray1304[var12 + var1][var13 + var4] = bitwiseAnd(var3[var2].anIntArrayArray1304[var12 + var1][var13 + var4], -16777217);
+ }
+ }
+ }
+ }
+ byte var11;
+ if (var10) {
+ var11 = 1;
+ } else {
+ var11 = 4;
+ }
+
+ DataBuffer var25 = new DataBuffer(var6);
+
+ int var14;
+ int var15;
+ for (var13 = 0; var13 < var11; ++var13) {
+ for (var14 = 0; var14 < 64; ++var14) {
+ for (var15 = 0; var15 < 64; ++var15) {
+ if (var13 == var7 && var9 <= var14 && 8 + var9 > var14 && var8 <= var15 && var15 < 8 + var8) {
+ Class167.method2267(0, 0, var10, var25, TextureOperation3.method310(var0, (byte) -117, 7 & var14, 7 & var15) + var4, method519(var0, var15 & 7, var14 & 7) + var1, (byte) 63, var0, var2);
+ } else {
+ Class167.method2267(0, 0, var10, var25, -1, -1, (byte) 123, 0, 0);
+ }
+ }
+ }
+ }
+
+ int var17;
+ int var21;
+ int var20;
+ int var22;
+ int var29;
+ while (var25.index < var25.buffer.length) {
+ var14 = var25.readUnsignedByte();
+ if (var14 != 129) {
+ --var25.index;
+ break;
+ }
+
+ for (var15 = 0; var15 < 4; ++var15) {
+ byte var16 = var25.readSignedByte();
+ int var18;
+ if (var16 != 0) {
+ if (var16 == 1) {
+ for (var17 = 0; 64 > var17; var17 += 4) {
+ for (var18 = 0; var18 < 64; var18 += 4) {
+ byte var19 = var25.readSignedByte();
+ if (var7 >= var15) {
+ for (var20 = var17; var17 + 4 > var20; ++var20) {
+ for (var21 = var18; var21 < 4 + var18; ++var21) {
+ if (var9 <= var20 && 8 + var9 > var20 && var8 <= var21) {
+ var22 = var1 - -method519(var0, var21 & 7, var20 & 7);
+ int var23 = TextureOperation3.method310(var0, (byte) -97, 7 & var20, var21 & 7) + var4;
+ if (0 <= var22 && 104 > var22 && var23 >= 0 && var23 < 104) {
+ possibleHeightmap1774[var2][var22][var23] = var19;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else if (var15 <= var7) {
+ var18 = 7 + var1;
+ var17 = var1;
+ var20 = var4 - -7;
+ if (var20 < 0) {
+ var20 = 0;
+ } else if (104 <= var20) {
+ var20 = 104;
+ }
+
+ if (0 <= var18) {
+ if (var18 >= 104) {
+ var18 = 104;
+ }
+ } else {
+ var18 = 0;
+ }
+
+ var29 = var4;
+ if (var4 < 0) {
+ var29 = 0;
+ } else if (104 <= var4) {
+ var29 = 104;
+ }
+
+ if (var1 < 0) {
+ var17 = 0;
+ } else if (104 <= var1) {
+ var17 = 104;
+ }
+
+ while (var18 > var17) {
+ while (var29 < var20) {
+ possibleHeightmap1774[var2][var17][var29] = 0;
+ ++var29;
+ }
+
+ ++var17;
+ }
+ }
+ }
+ }
+
+ int var28;
+ if (HDToolKit.highDetail && !var10) {
+ AtmosphereParser var26 = null;
+
+ while (var25.buffer.length > var25.index) {
+ var15 = var25.readUnsignedByte();
+ if (var15 == 0) {
+ var26 = new AtmosphereParser(var25);
+ } else {
+ if (var15 != 1) {
+ throw new IllegalStateException();
+ }
+
+ var28 = var25.readUnsignedByte();
+ if (var28 > 0) {
+ for (var17 = 0; var28 > var17; ++var17) {
+ Class43 var30 = new Class43(var25);
+ if (var30.anInt705 == 31) {
+ Class57 var31 = Class81.method1401(var25.readUnsignedShort());
+ var30.method1060((byte) 123, var31.anInt896, var31.anInt908, var31.anInt899, var31.anInt907);
+ }
+
+ var29 = var30.anInt703 >> 7;
+ var20 = var30.anInt708 >> 7;
+ if (var30.anInt704 == var7 && var9 <= var29 && var9 - -8 > var29 && var20 >= var8 && var20 < var8 - -8) {
+ var21 = Class3_Sub26.method514(var0, var30.anInt703 & 1023, 1023 & var30.anInt708) + (var1 << 7);
+ var22 = TextureOperation28.method293(var30.anInt703 & 1023, var0, 1023 & var30.anInt708) + (var4 << 7);
+ var30.anInt703 = var21;
+ var30.anInt708 = var22;
+ var29 = var30.anInt703 >> 7;
+ var20 = var30.anInt708 >> 7;
+ if (var29 >= 0 && var20 >= 0 && 104 > var29 && var20 < 104) {
+ var30.aBoolean696 = (2 & sceneryTypeMaskGrid[1][var29][var20]) != 0;
+ var30.anInt697 = Class44.anIntArrayArrayArray723[var30.anInt704][var29][var20] - var30.anInt697;
+ Class68.method1264(var30);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (null == var26) {
+ var26 = new AtmosphereParser();
+ }
+
+ AtmosphereParser.aAtmosphereParserArrayArray1581[var1 >> 3][var4 >> 3] = var26;
+ }
+
+ var14 = 7 + var1;
+ var15 = var4 - -7;
+
+ for (var28 = var1; var14 > var28; ++var28) {
+ for (var17 = var4; var15 > var17; ++var17) {
+ possibleHeightmap1774[var2][var28][var17] = 0;
+ }
+ }
+ }
+
+ public static int method54(int var0) {
+ try {
+ return var0 & 127;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "oe.A(" + var0 + ',' + false + ')');
+ }
+ }
+
+ public static LDIndexedSprite[] method619(byte var0, int var1, CacheIndex var2) {
+ try {
+ return GroundItem.method2029((byte) -119, var2, var1) ? (var0 <= 52 ? null : method1281()) : null;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "ml.A(" + var0 + ',' + var1 + ',' + (var2 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static void method383(int var0, int var1) {
+ try {
+ if (var1 == Class23.anInt453 && var1 != 0) {
+ ShaderInterface var2 = anShaderInterfaceArray70[var1];
+ var2.method23(TextureOperation37.anInt3263);
+ }
+
+ if (var0 != -32584) {
+ method383(60, 23);
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ka.A(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static int method599(CacheIndex var1) {
+ try {
+ int var2 = 0;
+ if (var1.retrieveSpriteFile(Class154.anInt1966)) {
+ ++var2;
+ }
+
+ if (var1.retrieveSpriteFile(CSConfigCachefile.anInt1124)) {
+ ++var2;
+ }
+
+ return var2;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "lk.F(" + -20916 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static AbstractSprite method602(int var0, CacheIndex var1) {
+ try {
+ // System.out.println("Class3_sub28_Sub16 " + var1);
+ if (Class75_Sub4.method1351(var1, 0, var0)) {
+ return Class43.method1062((byte) -18 + 103);
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "lk.R(" + 0 + ',' + var0 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ /**
+ * @param notifyScripts Whether if a listening CS2 script should be invoked if this interface is resized
+ */
+ public static void calculateInterfaceSize(RSInterface iface, int parentWidth, int parentHeight, boolean notifyScripts) {
+ int oldWidth = iface.width;
+ int oldHeight = iface.height;
+
+ if (iface.horizontalResize == 0) {
+ iface.width = iface.defWidth;
+ } else if (iface.horizontalResize == 1) {
+ iface.width = parentWidth + -iface.defWidth;
+ } else if (iface.horizontalResize == 2) {
+ iface.width = iface.defWidth * parentWidth >> 14;
+ } else if (iface.horizontalResize == 3) {
+ if (iface.type == 2) {
+ iface.width = iface.defWidth * 32 - -((iface.defWidth - 1) * iface.anInt285);
+ } else if (iface.type == 7) {
+ iface.width = 115 * iface.defWidth + iface.anInt285 * (-1 + iface.defWidth);
+ }
+ }
+
+ if (iface.verticalResize == 0) {
+ iface.height = iface.defHeight;
+ } else if (iface.verticalResize == 1) {
+ iface.height = -iface.defHeight + parentHeight;
+ } else if (iface.verticalResize == 2) {
+ iface.height = parentHeight * iface.defHeight >> 14;
+ } else if (iface.verticalResize == 3) {
+ if (iface.type == 2) {
+ iface.height = (iface.defHeight + -1) * iface.anInt290 + iface.defHeight * 32;
+ } else if (iface.type == 7) {
+ iface.height = iface.defHeight * 12 + (-1 + iface.defHeight) * iface.anInt290;
+ }
+ }
+
+ if (iface.horizontalResize == 4) {
+ iface.width = iface.anInt216 * iface.height / iface.anInt160;
+ }
+
+ if (iface.verticalResize == 4) {
+ iface.height = iface.anInt160 * iface.width / iface.anInt216;
+ }
+
+ if (ClientCommands.commandQaOpEnabled && (Client.method44(iface).anInt2205 != 0 || iface.type == 0)) {
+ if (iface.height < 5 && 5 > iface.width) {
+ iface.height = 5;
+ iface.width = 5;
+ } else {
+ if (iface.width <= 0) {
+ iface.width = 5;
+ }
+
+ if (0 >= iface.height) {
+ iface.height = 5;
+ }
+ }
+ }
+
+ if (iface.anInt189 == 1337) {
+ aClass11_2091 = iface;
+ }
+
+ if (notifyScripts && null != iface.anObjectArray235 && (iface.width != oldWidth || iface.height != oldHeight)) {
+ CS2Script script = new CS2Script();
+ script.arguments = iface.anObjectArray235;
+ script.aClass11_2449 = iface;
+ Client.aLinkedList_1471.pushBack(script);
+ }
+ }
+
+ public static void method606(int var0, Class3_Sub9 var1, int var2, int var3, int var4, int var5) {
+ try {
+ if (var5 > 44) {
+ if (var1.anInt2332 != -1 || var1.anIntArray2333 != null) {
+ int var6 = 0;
+ if (var1.anInt2321 < var0) {
+ var6 += -var1.anInt2321 + var0;
+ } else if (var1.anInt2326 > var0) {
+ var6 += var1.anInt2326 - var0;
+ }
+
+ if (var1.anInt2307 >= var4) {
+ if (var4 < var1.anInt2308) {
+ var6 += -var4 + var1.anInt2308;
+ }
+ } else {
+ var6 += -var1.anInt2307 + var4;
+ }
+
+ if (0 != var1.anInt2328 && var6 - 64 <= var1.anInt2328 && 0 != Sprites.ambientVolume && var2 == var1.anInt2314) {
+ var6 -= 64;
+ if (var6 < 0) {
+ var6 = 0;
+ }
+
+ int var7 = (-var6 + var1.anInt2328) * Sprites.ambientVolume / var1.anInt2328;
+ if (var1.aClass3_Sub24_Sub1_2312 == null) {
+ if (var1.anInt2332 >= 0) {
+ SynthSound var8 = SynthSound.create(CacheIndex.soundFXIndex, var1.anInt2332, 0);
+ if (null != var8) {
+ PcmSound var9 = var8.toPCMSound().method151(Class27.resampler);
+ Class3_Sub24_Sub1 var10 = Class3_Sub24_Sub1.method437(var9, var7);
+ Objects.requireNonNull(var10).method429(-1);
+ Class3_Sub26.aClass3_Sub24_Sub2_2563.method457(var10);
+ var1.aClass3_Sub24_Sub1_2312 = var10;
+ }
+ }
+ } else {
+ var1.aClass3_Sub24_Sub1_2312.method419(var7);
+ }
+
+ if (null != var1.aClass3_Sub24_Sub1_2315) {
+ var1.aClass3_Sub24_Sub1_2315.method419(var7);
+ if (!var1.aClass3_Sub24_Sub1_2315.isLinked()) {
+ var1.aClass3_Sub24_Sub1_2315 = null;
+ }
+ } else if (var1.anIntArray2333 != null && ((var1.anInt2316 -= var3) <= 0)) {
+ int var13 = (int) ((double) var1.anIntArray2333.length * Math.random());
+ SynthSound var14 = SynthSound.create(CacheIndex.soundFXIndex, var1.anIntArray2333[var13], 0);
+ if (null != var14) {
+ PcmSound var15 = var14.toPCMSound().method151(Class27.resampler);
+ Class3_Sub24_Sub1 var11 = Class3_Sub24_Sub1.method437(var15, var7);
+ Objects.requireNonNull(var11).method429(0);
+ Class3_Sub26.aClass3_Sub24_Sub2_2563.method457(var11);
+ var1.anInt2316 = (int) ((double) (-var1.anInt2310 + var1.anInt2325) * Math.random()) + var1.anInt2310;
+ var1.aClass3_Sub24_Sub1_2315 = var11;
+ }
+ }
+
+ } else {
+ if (null != var1.aClass3_Sub24_Sub1_2312) {
+ Class3_Sub26.aClass3_Sub24_Sub2_2563.method461(var1.aClass3_Sub24_Sub1_2312);
+ var1.aClass3_Sub24_Sub1_2312 = null;
+ }
+
+ if (var1.aClass3_Sub24_Sub1_2315 != null) {
+ Class3_Sub26.aClass3_Sub24_Sub2_2563.method461(var1.aClass3_Sub24_Sub1_2315);
+ var1.aClass3_Sub24_Sub1_2315 = null;
+ }
+
+ }
+ }
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "lk.O(" + var0 + ',' + (var1 != null ? "{...}" : "null") + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ static void method1180(byte var0, Entity var1) {
+ try {
+ RenderAnimationDefinition var2 = var1.getRenderAnimationType();
+ var1.anInt2764 = var2.stand_animation;
+ if (var0 >= -5) {
+ anIntArray882 = null;
+ }
+
+ if (var1.anInt2816 == 0) {
+ var1.anInt2824 = 0;
+ } else {
+ if (var1.anInt2771 != -1 && 0 == var1.anInt2828) {
+ SequenceDefinition var3 = SequenceDefinition.getAnimationDefinition(var1.anInt2771);
+ if (var1.anInt2811 > 0 && var3.resetWhenWalk == 0) {
+ ++var1.anInt2824;
+ return;
+ }
+
+ if (var1.anInt2811 <= 0 && var3.priority == 0) {
+ ++var1.anInt2824;
+ return;
+ }
+ }
+
+ int var18 = var1.xAxis;
+ int var4 = var1.yAxis;
+ int var5 = var1.xOffsets2767[-1 + var1.anInt2816] * 128 - -(var1.getSize() * 64);
+ int var6 = 128 * var1.yOffsets2755[-1 + var1.anInt2816] - -(var1.getSize() * 64);
+ if (var5 + -var18 > 256 || -var18 + var5 < -256 || var6 - var4 > 256 || -256 > var6 - var4) {
+ var1.xAxis = var5;
+ var1.yAxis = var6;
+ return;
+ }
+
+ if (var5 <= var18) {
+ if (var18 <= var5) {
+ if (var6 <= var4) {
+ if (var6 < var4) {
+ var1.anInt2806 = 0;
+ }
+ } else {
+ var1.anInt2806 = 1024;
+ }
+ } else if (var6 > var4) {
+ var1.anInt2806 = 768;
+ } else if (var6 < var4) {
+ var1.anInt2806 = 256;
+ } else {
+ var1.anInt2806 = 512;
+ }
+ } else if (var6 > var4) {
+ var1.anInt2806 = 1280;
+ } else if (var4 > var6) {
+ var1.anInt2806 = 1792;
+ } else {
+ var1.anInt2806 = 1536;
+ }
+
+ int var7 = 2047 & -var1.anInt2785 + var1.anInt2806;
+ int var8 = var2.walk_follow_full_turn_anim;
+ if (1024 < var7) {
+ var7 -= 2048;
+ }
+
+ boolean var10 = true;
+ byte var11 = 1;
+ if (var7 >= -256 && var7 <= 256) {
+ var8 = var2.walk_animation;
+ } else if (var7 >= 256 && 768 > var7) {
+ var8 = var2.walk_follow_cw_turn_anim;
+ } else if (var7 >= -768 && -256 >= var7) {
+ var8 = var2.walk_follow_ccw_turn_anim;
+ }
+
+ int var9 = 4;
+ if (var8 == -1) {
+ var8 = var2.walk_animation;
+ }
+
+ var1.anInt2764 = var8;
+ if (var1 instanceof NPC) {
+ var10 = ((NPC) var1).definition.aBoolean1255;
+ }
+
+ if (var10) {
+ if (var1.anInt2806 != var1.anInt2785 && var1.anInt2772 == -1 && var1.anInt2779 != 0) {
+ var9 = 2;
+ }
+
+ if (2 < var1.anInt2816) {
+ var9 = 6;
+ }
+
+ if (3 < var1.anInt2816) {
+ var9 = 8;
+ }
+
+ if (var1.anInt2824 > 0 && var1.anInt2816 > 1) {
+ var9 = 8;
+ --var1.anInt2824;
+ }
+ } else {
+ if (1 < var1.anInt2816) {
+ var9 = 6;
+ }
+
+ if (var1.anInt2816 > 2) {
+ var9 = 8;
+ }
+
+ if (var1.anInt2824 > 0 && var1.anInt2816 > 1) {
+ --var1.anInt2824;
+ var9 = 8;
+ }
+ }
+
+ if (2 == var1.aByteArray2795[var1.anInt2816 - 1]) {
+ var9 <<= 1;
+ var11 = 2;
+ } else if (var1.aByteArray2795[-1 + var1.anInt2816] == 0) {
+ var11 = 0;
+ var9 >>= 1;
+ }
+
+ if (var9 >= 8 && -1 != var2.run_anim) {
+ if (var1.anInt2764 == var2.walk_follow_full_turn_anim && -1 != var2.run_follow_full_turn_anim) {
+ var1.anInt2764 = var2.run_follow_full_turn_anim;
+ } else if (var1.anInt2764 == var2.walk_follow_ccw_turn_anim && var2.run_follow_ccw_turn_anim != -1) {
+ var1.anInt2764 = var2.run_follow_ccw_turn_anim;
+ } else if (var2.walk_follow_cw_turn_anim == var1.anInt2764 && var2.run_follow_cw_turn_anim != -1) {
+ var1.anInt2764 = var2.run_follow_cw_turn_anim;
+ } else {
+ var1.anInt2764 = var2.run_anim;
+ }
+ } else if (var2.slow_walk_anim != -1 && var11 == 0) {
+ if (var1.anInt2764 == var2.walk_follow_full_turn_anim && var2.slow_walk_follow_full_turn_anim != -1) {
+ var1.anInt2764 = var2.slow_walk_follow_full_turn_anim;
+ } else if (var1.anInt2764 == var2.walk_follow_ccw_turn_anim && -1 != var2.slow_walk_follow_ccw_turn_anim) {
+ var1.anInt2764 = var2.slow_walk_follow_ccw_turn_anim;
+ } else if (var2.walk_follow_cw_turn_anim == var1.anInt2764 && -1 != var2.slow_walk_follow_cw_turn_anim) {
+ var1.anInt2764 = var2.slow_walk_follow_cw_turn_anim;
+ } else {
+ var1.anInt2764 = var2.slow_walk_anim;
+ }
+ }
+
+ if (var2.movement_acceleration != -1) {
+ var9 <<= 7;
+ if (var1.anInt2816 == 1) {
+ int var13 = (var1.xAxis <= var5 ? var5 - var1.xAxis : -var5 + var1.xAxis) << 7;
+ int var12 = var1.anInt2758 * var1.anInt2758;
+ int var14 = (var1.yAxis > var6 ? -var6 + var1.yAxis : -var1.yAxis + var6) << 7;
+ int var15 = var13 > var14 ? var13 : var14;
+ int var16 = var2.movement_acceleration * 2 * var15;
+ if (var12 <= var16) {
+ if (var12 / 2 > var15) {
+ var1.anInt2758 -= var2.movement_acceleration;
+ if (var1.anInt2758 < 0) {
+ var1.anInt2758 = 0;
+ }
+ } else if (var1.anInt2758 < var9) {
+ var1.anInt2758 += var2.movement_acceleration;
+ if (var1.anInt2758 > var9) {
+ var1.anInt2758 = var9;
+ }
+ }
+ } else {
+ var1.anInt2758 /= 2;
+ }
+ } else if (var1.anInt2758 < var9) {
+ var1.anInt2758 += var2.movement_acceleration;
+ if (var1.anInt2758 > var9) {
+ var1.anInt2758 = var9;
+ }
+ } else {
+ var1.anInt2758 -= var2.movement_acceleration;
+ if (0 > var1.anInt2758) {
+ var1.anInt2758 = 0;
+ }
+ }
+
+ var9 = var1.anInt2758 >> 7;
+ if (var9 < 1) {
+ var9 = 1;
+ }
+ }
+
+ if (var5 > var18) {
+ var1.xAxis += var9;
+ if (var1.xAxis > var5) {
+ var1.xAxis = var5;
+ }
+ } else if (var18 > var5) {
+ var1.xAxis -= var9;
+ if (var1.xAxis < var5) {
+ var1.xAxis = var5;
+ }
+ }
+
+ if (var4 >= var6) {
+ if (var6 < var4) {
+ var1.yAxis -= var9;
+ if (var6 > var1.yAxis) {
+ var1.yAxis = var6;
+ }
+ }
+ } else {
+ var1.yAxis += var9;
+ if (var6 < var1.yAxis) {
+ var1.yAxis = var6;
+ }
+ }
+
+ if (var5 == var1.xAxis && var6 == var1.yAxis) {
+ --var1.anInt2816;
+ if (0 < var1.anInt2811) {
+ --var1.anInt2811;
+ }
+ }
+ }
+
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "ia.C(" + var0 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static int method1184(int var0, byte var1) {
+ try {
+ int var3 = var0 & 63;
+ int var4 = (var0 & 217) >> 6;
+ if (var3 == 18) {
+ if (0 == var4) {
+ return 1;
+ }
+
+ if (var4 == 1) {
+ return 2;
+ }
+
+ if (var4 == 2) {
+ return 4;
+ }
+
+ return 8;
+ } else if (var3 == 19 || var3 == 21) {
+ if (var4 == 0) {
+ return 16;
+ }
+
+ if (1 == var4) {
+ return 32;
+ }
+
+ if (var4 == 2) {
+ return 64;
+ }
+
+ return 128;
+ }
+
+ return 0;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ia.A(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static boolean method73(short var0) {
+ try {
+ if (var0 != 47 && var0 != 5 && var0 != 43 && var0 != 35 && var0 != 58 && var0 != 22 && var0 != 40 && var0 != 3) {
+ if (var0 != 9 && var0 != 12 && var0 != 1006 && var0 != 1003) {
+
+ return var0 == 25 || var0 == 23 || 48 == var0 || var0 == 7 || var0 == 13 || (var0 == 8 || var0 == 32 || var0 == 28 || var0 == 59 || var0 == 51 || var0 == 41);
+ } else {
+ return true;
+ }
+ } else {
+ return true;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "aa.C(" + var0 + ',' + 121 + ')');
+ }
+ }
+
+ public static void method75(RSInterface[] var0, int var2) {
+ try {
+ for (int var3 = 0; var0.length > var3; ++var3) {
+ RSInterface var4 = var0[var3];
+ if (null != var4) {
+ if (var4.type == 0) {
+ if (null != var4.aClass11Array262) {
+ method75(var4.aClass11Array262, var2);
+ }
+
+ Class3_Sub31 var5 = TextureOperation23.aHashTable_3208.get(var4.componentHash);
+ if (null != var5) {
+ Class3_Sub8.method124(49, var2, var5.anInt2602);
+ }
+ }
+
+ CS2Script var7;
+ if (var2 == 0 && null != var4.anObjectArray206) {
+ var7 = new CS2Script();
+ var7.arguments = var4.anObjectArray206;
+ var7.aClass11_2449 = var4;
+ Class43.method1065(var7);
+ }
+
+ if (var2 == 1 && var4.anObjectArray176 != null) {
+ if (var4.anInt191 >= 0) {
+ RSInterface var8 = getRSInterface(var4.componentHash);
+ if (null == var8 || null == var8.aClass11Array262 || var8.aClass11Array262.length <= var4.anInt191 || var8.aClass11Array262[var4.anInt191] != var4) {
+ continue;
+ }
+ }
+
+ var7 = new CS2Script();
+ var7.arguments = var4.anObjectArray176;
+ var7.aClass11_2449 = var4;
+ Class43.method1065(var7);
+ }
+ }
+ }
+
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "aa.I(" + (var0 != null ? "{...}" : "null") + ',' + true + ',' + var2 + ')');
+ }
+ }
+
+ public static boolean method76(int var0, int var1, int var2, int var3, int var4, boolean var5, int var6, int var7, int var8, int var9, int var11) {
+ try {
+ int var12;
+ int var13;
+ for (var12 = 0; 104 > var12; ++var12) {
+ for (var13 = 0; var13 < 104; ++var13) {
+ Class84.anIntArrayArray1160[var12][var13] = 0;
+ Class97.anIntArrayArray1373[var12][var13] = 99999999;
+ }
+ }
+
+ Class84.anIntArrayArray1160[var11][var3] = 99;
+ Class97.anIntArrayArray1373[var11][var3] = 0;
+ var13 = var3;
+ var12 = var11;
+ byte var14 = 0;
+ TextureOperation38.anIntArray3456[var14] = var11;
+ boolean var16 = false;
+ int var15 = 0;
+ int var27 = var14 + 1;
+ Class45.anIntArray729[var14] = var3;
+ int[][] var17 = AtmosphereParser.aClass91Array1182[WorldListCountry.localPlane].anIntArrayArray1304;
+
+ int var18;
+ while (var15 != var27) {
+ var12 = TextureOperation38.anIntArray3456[var15];
+ var13 = Class45.anIntArray729[var15];
+ var15 = 4095 & var15 - -1;
+ if (var8 == var12 && var13 == var4) {
+ var16 = true;
+ break;
+ }
+
+ if (var1 != 0) {
+ if ((5 > var1 || var1 == 10) && AtmosphereParser.aClass91Array1182[WorldListCountry.localPlane].method1488(var4, var12, var13, var8, -1 + var1, 2, var7)) {
+ var16 = true;
+ break;
+ }
+
+ if (var1 < 10 && AtmosphereParser.aClass91Array1182[WorldListCountry.localPlane].method1492(var4, var1 + -1, var8, var13, 2, var7, var12, 88)) {
+ var16 = true;
+ break;
+ }
+ }
+
+ if (0 != var0 && var6 != 0 && AtmosphereParser.aClass91Array1182[WorldListCountry.localPlane].method1498(var8, var13, var12, 2, var0, var2, var4, var6)) {
+ var16 = true;
+ break;
+ }
+
+ var18 = Class97.anIntArrayArray1373[var12][var13] - -1;
+ if (var12 > 0 && Class84.anIntArrayArray1160[var12 + -1][var13] == 0 && 0 == (var17[-1 + var12][var13] & 19661070) && (var17[-1 + var12][var13 + 1] & 19661112) == 0) {
+ TextureOperation38.anIntArray3456[var27] = var12 + -1;
+ Class45.anIntArray729[var27] = var13;
+ var27 = 1 + var27 & 4095;
+ Class84.anIntArrayArray1160[var12 - 1][var13] = 2;
+ Class97.anIntArrayArray1373[-1 + var12][var13] = var18;
+ }
+
+ if (102 > var12 && Class84.anIntArrayArray1160[1 + var12][var13] == 0 && 0 == (var17[2 + var12][var13] & 19661187) && 0 == (var17[var12 + 2][1 + var13] & 19661280)) {
+ TextureOperation38.anIntArray3456[var27] = 1 + var12;
+ Class45.anIntArray729[var27] = var13;
+ var27 = 4095 & var27 + 1;
+ Class84.anIntArrayArray1160[var12 - -1][var13] = 8;
+ Class97.anIntArrayArray1373[var12 - -1][var13] = var18;
+ }
+
+ if (var13 > 0 && Class84.anIntArrayArray1160[var12][var13 + -1] == 0 && (19661070 & var17[var12][-1 + var13]) == 0 && (var17[var12 + 1][var13 - 1] & 19661187) == 0) {
+ TextureOperation38.anIntArray3456[var27] = var12;
+ Class45.anIntArray729[var27] = -1 + var13;
+ Class84.anIntArrayArray1160[var12][-1 + var13] = 1;
+ Class97.anIntArrayArray1373[var12][-1 + var13] = var18;
+ var27 = 4095 & 1 + var27;
+ }
+
+ if (var13 < 102 && Class84.anIntArrayArray1160[var12][var13 + 1] == 0 && (var17[var12][2 + var13] & 19661112) == 0 && (var17[1 + var12][var13 + 2] & 19661280) == 0) {
+ TextureOperation38.anIntArray3456[var27] = var12;
+ Class45.anIntArray729[var27] = var13 + 1;
+ Class84.anIntArrayArray1160[var12][1 + var13] = 4;
+ var27 = 1 + var27 & 4095;
+ Class97.anIntArrayArray1373[var12][var13 - -1] = var18;
+ }
+
+ if (var12 > 0 && var13 > 0 && Class84.anIntArrayArray1160[-1 + var12][-1 + var13] == 0 && (19661112 & var17[-1 + var12][var13]) == 0 && 0 == (var17[-1 + var12][-1 + var13] & 19661070) && 0 == (19661187 & var17[var12][-1 + var13])) {
+ TextureOperation38.anIntArray3456[var27] = -1 + var12;
+ Class45.anIntArray729[var27] = -1 + var13;
+ Class84.anIntArrayArray1160[-1 + var12][-1 + var13] = 3;
+ Class97.anIntArrayArray1373[-1 + var12][-1 + var13] = var18;
+ var27 = 4095 & var27 + 1;
+ }
+
+ if (var12 < 102 && 0 < var13 && Class84.anIntArrayArray1160[1 + var12][var13 + -1] == 0 && (var17[var12 - -1][var13 - 1] & 19661070) == 0 && (19661187 & var17[2 + var12][var13 + -1]) == 0 && (19661280 & var17[var12 + 2][var13]) == 0) {
+ TextureOperation38.anIntArray3456[var27] = var12 - -1;
+ Class45.anIntArray729[var27] = var13 - 1;
+ var27 = 4095 & 1 + var27;
+ Class84.anIntArrayArray1160[var12 - -1][-1 + var13] = 9;
+ Class97.anIntArrayArray1373[1 + var12][var13 + -1] = var18;
+ }
+
+ if (var12 > 0 && var13 < 102 && 0 == Class84.anIntArrayArray1160[var12 - 1][var13 + 1] && (var17[-1 + var12][var13 - -1] & 19661070) == 0 && 0 == (19661112 & var17[-1 + var12][var13 - -2]) && (19661280 & var17[var12][var13 + 2]) == 0) {
+ TextureOperation38.anIntArray3456[var27] = var12 - 1;
+ Class45.anIntArray729[var27] = 1 + var13;
+ Class84.anIntArrayArray1160[var12 - 1][1 + var13] = 6;
+ Class97.anIntArrayArray1373[-1 + var12][1 + var13] = var18;
+ var27 = 1 + var27 & 4095;
+ }
+
+ if (var12 < 102 && var13 < 102 && Class84.anIntArrayArray1160[1 + var12][1 + var13] == 0 && (19661112 & var17[var12 - -1][2 + var13]) == 0 && (19661280 & var17[var12 + 2][var13 - -2]) == 0 && (19661187 & var17[var12 - -2][var13 + 1]) == 0) {
+ TextureOperation38.anIntArray3456[var27] = 1 + var12;
+ Class45.anIntArray729[var27] = var13 + 1;
+ var27 = var27 - -1 & 4095;
+ Class84.anIntArrayArray1160[var12 - -1][var13 + 1] = 12;
+ Class97.anIntArrayArray1373[1 + var12][1 + var13] = var18;
+ }
+ }
+
+ Class129.anInt1692 = 0;
+ int var19;
+ if (!var16) {
+ if (!var5) {
+ return false;
+ }
+
+ var18 = 1000;
+ var19 = 100;
+ byte var20 = 10;
+
+ for (int var21 = -var20 + var8; var20 + var8 >= var21; ++var21) {
+ for (int var22 = var4 + -var20; var20 + var4 >= var22; ++var22) {
+ if (var21 >= 0 && var22 >= 0 && var21 < 104 && 104 > var22 && Class97.anIntArrayArray1373[var21][var22] < 100) {
+ int var23 = 0;
+ int var24 = 0;
+ if (var8 <= var21) {
+ if (-1 + var0 + var8 < var21) {
+ var23 = var21 + 1 + -var0 + -var8;
+ }
+ } else {
+ var23 = var8 - var21;
+ }
+
+ if (var22 >= var4) {
+ if (-1 + var4 + var6 < var22) {
+ var24 = -var4 + -var6 + 1 + var22;
+ }
+ } else {
+ var24 = -var22 + var4;
+ }
+
+ int var25 = var23 * var23 + var24 * var24;
+ if (var25 < var18 || var25 == var18 && Class97.anIntArrayArray1373[var21][var22] < var19) {
+ var13 = var22;
+ var19 = Class97.anIntArrayArray1373[var21][var22];
+ var18 = var25;
+ var12 = var21;
+ }
+ }
+ }
+ }
+
+ if (var18 == 1000) {
+ return false;
+ }
+
+ if (var11 == var12 && var3 == var13) {
+ return false;
+ }
+
+ Class129.anInt1692 = 1;
+ }
+
+ byte var28 = 0;
+ TextureOperation38.anIntArray3456[var28] = var12;
+ var15 = var28 + 1;
+ Class45.anIntArray729[var28] = var13;
+ var18 = var19 = Class84.anIntArrayArray1160[var12][var13];
+
+ for (; var12 != var11 || var13 != var3; var18 = Class84.anIntArrayArray1160[var12][var13]) {
+ if (var19 != var18) {
+ TextureOperation38.anIntArray3456[var15] = var12;
+ Class45.anIntArray729[var15++] = var13;
+ var19 = var18;
+ }
+
+ if ((var18 & 2) != 0) {
+ ++var12;
+ } else if ((8 & var18) != 0) {
+ --var12;
+ }
+
+ if ((var18 & 1) == 0) {
+ if ((var18 & 4) != 0) {
+ --var13;
+ }
+ } else {
+ ++var13;
+ }
+ }
+
+ if (var15 <= 0) {
+ return 1 != var9;
+ } else {
+ TextureOperation7.method299(113, var15, var9);
+ return true;
+ }
+ } catch (RuntimeException var26) {
+ throw ClientErrorException.clientError(var26, "aa.A(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ',' + var9 + ',' + 127 + ',' + var11 + ')');
+ }
+ }
+
+ public static void method78(int var0, int var2) {
+ try {
+ TextureOperation12.outgoingBuffer.putOpcode(132);
+ TextureOperation12.outgoingBuffer.writeIntV1(var2);
+ TextureOperation12.outgoingBuffer.writeShortLE(var0);
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "aa.E(" + var0 + ',' + false + ',' + var2 + ')');
+ }
+ }
+
+ public static void method81(RSInterface var1) {
+ try {
+
+ int var2 = var1.anInt189;
+ if (324 == var2) {
+ if (-1 == TextureOperation37.anInt3260) {
+ TextureOperation37.anInt3260 = var1.spriteArchiveId;
+ anInt1165 = var1.anInt296;
+ }
+
+ if (aClass52_1112.aBoolean864) {
+ var1.spriteArchiveId = TextureOperation37.anInt3260;
+ } else {
+ var1.spriteArchiveId = anInt1165;
+ }
+
+ } else if (var2 == 325) {
+ if (-1 == TextureOperation37.anInt3260) {
+ anInt1165 = var1.anInt296;
+ TextureOperation37.anInt3260 = var1.spriteArchiveId;
+ }
+
+ if (aClass52_1112.aBoolean864) {
+ var1.spriteArchiveId = anInt1165;
+ } else {
+ var1.spriteArchiveId = TextureOperation37.anInt3260;
+ }
+
+ } else if (var2 == 327) {
+ var1.anInt182 = 150;
+ var1.anInt308 = 2047 & (int) (Math.sin((double) Class44.anInt719 / 40.0D) * 256.0D);
+ var1.modelType = 5;
+ var1.itemId = -1;
+ } else if (var2 == 328) {
+ if (null == Class102.player.displayName) {
+ var1.itemId = 0;
+ } else {
+ var1.anInt182 = 150;
+ var1.anInt308 = 2047 & (int) (256.0D * Math.sin((double) Class44.anInt719 / 40.0D));
+ var1.modelType = 5;
+ var1.itemId = 2047 + ((int) Class102.player.displayName.toLong() << 11);
+ var1.anInt260 = Class102.player.anInt2793;
+ var1.anInt267 = 0;
+ var1.animationId = Class102.player.anInt2764;
+ var1.anInt283 = Class102.player.anInt2813;
+ }
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "aa.H(" + (byte) -128 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ public static boolean method1088(boolean var0) {
+ try {
+ if (paramJavaScriptEnabled) {
+ try {
+ TextCore.aString_106.method1577(Class38.gameSignlink.gameApplet);
+ return true;
+ } catch (Throwable var2) {
+ }
+ }
+
+ if (var0) {
+ aReferenceCache_743 = null;
+ }
+
+ return false;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "gn.K(" + var0 + ')');
+ }
+ }
+
+ public static Class3_Sub28_Sub5 method1089(CacheIndex cacheIndex0, CacheIndex var2, int frameId) {
+ try {
+ boolean var5 = true;
+ int[] var6 = cacheIndex0.getFileIds(frameId);
+
+ for (int var7 = 0; var7 < Objects.requireNonNull(var6).length; ++var7) {
+ byte[] var8 = cacheIndex0.method2140(var6[var7], frameId);
+ if (var8 == null) {
+ var5 = false;
+ } else {
+ int var9 = (255 & var8[0]) << 8 | var8[1] & 0xFF;
+ byte[] var10;
+ var10 = var2.method2140(0, var9);
+
+ if (null == var10) {
+ // System.out.println("Roar , " + var9);
+ var5 = false;
+ }
+ }
+ }
+ if (var5) {
+ try {
+ return new Class3_Sub28_Sub5(cacheIndex0, var2, frameId);
+ } catch (Exception var11) {
+ var11.printStackTrace();
+ return null;
+ }
+ } else {
+ return null;
+ }
+ } catch (RuntimeException var12) {
+ throw ClientErrorException.clientError(var12, "gn.J(" + (cacheIndex0 != null ? "{...}" : "null") + ',' + false + ',' + (var2 != null ? "{...}" : "null") + ',' + (byte) 118 + ',' + frameId + ')');
+ }
+ }
+
+ public static RSString emptyString(int capacit) {
+ RSString str = new RSString();
+ str.length = 0;
+ str.buffer = new byte[capacit];
+ return str;
+ }
+
+ public static void method1091(boolean var0, int var1) {
+ try {
+ byte var2;
+ byte[][] var3;
+ if (HDToolKit.highDetail && var0) {
+ var2 = 1;
+ var3 = Class40.aByteArrayArray3669;
+ } else {
+ var2 = 4;
+ var3 = Class164_Sub2.aByteArrayArray3027;
+ }
+
+ int var4 = var3.length;
+
+ int var5;
+ int var6;
+ int var7;
+ byte[] var8;
+ for (var5 = 0; var5 < var4; ++var5) {
+ var6 = -Class131.x1716 + 64 * (Class3_Sub24_Sub3.regionIds[var5] >> 8);
+ var7 = -Texture.y1152 + 64 * (255 & Class3_Sub24_Sub3.regionIds[var5]);
+ var8 = var3[var5];
+ if (null != var8) {
+ Class58.method1194();
+ method777(AtmosphereParser.aClass91Array1182, var0, -48 + 8 * viewportX, var7, var6, (Class3_Sub7.viewportY + -6) * 8, var8);
+ }
+ }
+
+ var5 = 0;
+ if (var1 > -66) {
+ method1088(true);
+ }
+
+ for (; var5 < var4; ++var5) {
+ var6 = -Class131.x1716 + 64 * (Class3_Sub24_Sub3.regionIds[var5] >> 8);
+ var7 = -Texture.y1152 + 64 * (255 & Class3_Sub24_Sub3.regionIds[var5]);
+ var8 = var3[var5];
+ if (var8 == null && Class3_Sub7.viewportY < 800) {
+ Class58.method1194();
+
+ for (int var9 = 0; var9 < var2; ++var9) {
+ Class12.method870(var9, (byte) 102, var7, var6, 64, 64);
+ }
+ }
+ }
+
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "gn.I(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static void method1093(boolean var0) {
+ try {
+ if (var0) {
+ method1093(true);
+ }
+
+ for (int var1 = 0; var1 < 100; ++var1) {
+ aBooleanArray3674[var1] = true;
+ }
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "gn.H(" + var0 + ')');
+ }
+ }
+
+ public static void method1095(int var0, int var1, int var2, RSInterface[] var3, int var4, int var5, int var6, int var7, byte var8, int var9) {
+ try {
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ Class51.method1134();
+ }
+
+ for (RSInterface var11 : var3) {
+ if (var11 != null && (var5 == var11.parentId || var5 == -1412584499 && var11 == Class56.aClass11_886)) {
+ int var12;
+ if (var9 == -1) {
+ AudioChannel.anIntArray1969[Class3_Sub28_Sub3.anInt3557] = var2 + var11.anInt306;
+ Player.anIntArray3954[Class3_Sub28_Sub3.anInt3557] = var11.anInt210 - -var1;
+ Class3_Sub28_Sub18.anIntArray3768[Class3_Sub28_Sub3.anInt3557] = var11.width;
+ Entity.anIntArray2794[Class3_Sub28_Sub3.anInt3557] = var11.height;
+ var12 = Class3_Sub28_Sub3.anInt3557++;
+ } else {
+ var12 = var9;
+ }
+
+ var11.anInt204 = Class44.anInt719;
+ var11.anInt292 = var12;
+ if (!var11.usingScripts || !Client.method51(var11)) {
+ if (0 < var11.anInt189) {
+ method81(var11);
+ }
+
+ int var14 = var1 + var11.anInt210;
+ int alpha = var11.anInt223;
+ int var13 = var11.anInt306 + var2;
+ if (ClientCommands.commandQaOpEnabled && (0 != Client.method44(var11).anInt2205 || var11.type == 0) && alpha > 127) {
+ alpha = 127;
+ }
+
+ int var17;
+ int var16;
+ if (var11 == Class56.aClass11_886) {
+ if (var5 != -1412584499 && !var11.aBoolean200) {
+ anInt3602 = var2;
+ anInt1082 = var1;
+ Class8.aClass11Array1836 = var3;
+ continue;
+ }
+
+ if (NPC.aBoolean3975 && Class85.aBoolean1167) {
+ var17 = anInt1709;
+ var16 = Class126.anInt1676;
+ var17 -= Class95.anInt1336;
+ if (var17 < Class134.anInt1761) {
+ var17 = Class134.anInt1761;
+ }
+
+ if (PacketParser.aClass11_88.height + Class134.anInt1761 < var17 + var11.height) {
+ var17 = -var11.height + PacketParser.aClass11_88.height + Class134.anInt1761;
+ }
+
+ var14 = var17;
+ var16 -= anInt1881;
+ if (TextureOperation20.anInt3156 > var16) {
+ var16 = TextureOperation20.anInt3156;
+ }
+
+ if (var11.width + var16 > PacketParser.aClass11_88.width + TextureOperation20.anInt3156) {
+ var16 = -var11.width + PacketParser.aClass11_88.width + TextureOperation20.anInt3156;
+ }
+
+ var13 = var16;
+ }
+
+ if (!var11.aBoolean200) {
+ alpha = 128;
+ }
+ }
+
+ int var19;
+ int var18;
+ int var21;
+ int var20;
+ if (2 == var11.type) {
+ var19 = var7;
+ var18 = var4;
+ var17 = var6;
+ var16 = var0;
+ } else {
+ var17 = var6 < var14 ? var14 : var6;
+ var16 = var13 > var0 ? var13 : var0;
+ var20 = var11.width + var13;
+ var21 = var14 - -var11.height;
+ if (var11.type == 9) {
+ ++var21;
+ ++var20;
+ }
+
+ var19 = var7 <= var21 ? var7 : var21;
+ var18 = var4 <= var20 ? var4 : var20;
+ }
+
+ if (!var11.usingScripts || var16 < var18 && var19 > var17) {
+ int var23;
+ int var22;
+ int var25;
+ int var24;
+ int var26;
+ int var29;
+ int var28;
+ int var47;
+ if (var11.anInt189 != 0) {
+ if (var11.anInt189 == 1337 || var11.anInt189 == 1403 && HDToolKit.highDetail) {
+ aClass11_2091 = var11;
+ anInt2567 = var14;
+ Class53.anInt865 = var13;
+ method338(var11.height, var11.anInt189 == 1403, var13, var11.width, var14);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+ continue;
+ }
+
+ if (var11.anInt189 == 1338) {
+ if (!var11.method855()) {
+ continue;
+ }
+
+ Minimap.displayMinimap(var12, (byte) 59, var14, var13, var11);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+
+ if (0 != Class161.anInt2028 && 3 != Class161.anInt2028 || Class38_Sub1.aBoolean2615 || var16 > NPCDefinition.anInt1297 || var17 > Class38_Sub1.anInt2612 || var18 <= NPCDefinition.anInt1297 || Class38_Sub1.anInt2612 >= var19) {
+ continue;
+ }
+
+ var20 = NPCDefinition.anInt1297 - var13;
+ var21 = -var14 + Class38_Sub1.anInt2612;
+ var22 = var11.anIntArray207[var21];
+ if (var22 > var20 || var22 + var11.anIntArray291[var21] < var20) {
+ continue;
+ }
+
+ var21 -= var11.height / 2;
+ var23 = 2047 & GraphicDefinition.CAMERA_DIRECTION - -TextureOperation9.anInt3102;
+ var20 -= var11.width / 2;
+ var24 = Class51.anIntArray840[var23];
+ var25 = Class51.anIntArray851[var23];
+ var24 = (Class164_Sub2.anInt3020 + 256) * var24 >> 8;
+ var25 = (Class164_Sub2.anInt3020 - -256) * var25 >> 8;
+ var47 = -(var24 * var20) + var25 * var21 >> 11;
+ var26 = var21 * var24 - -(var20 * var25) >> 11;
+ var28 = Class102.player.xAxis + var26 >> 7;
+ var29 = -var47 + Class102.player.yAxis >> 7;
+ if (GameObject.aBoolean1837 && 0 != (Class164.anInt2051 & 64)) {
+ RSInterface var53 = AbstractSprite.method638(BufferedDataStream.anInt872, RSInterface.anInt278);
+ if (null == var53) {
+ Class25.method958((byte) -91);
+ } else {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(anInt1887, 1L, (byte) -49, TextCore.aString_1724, var28, (short) 11, Class3_Sub28_Sub9.aString_3621, var29);
+ }
+ continue;
+ }
+
+ if (Class158.paramGameTypeID == 1) {
+ Class3_Sub24_Sub4.pushRightClickMenuAction(-1, 1L, (byte) -41, RSString.parse(""), var28, (short) 36, TextCore.HasFaceHere, var29);
+ }
+
+ Class3_Sub24_Sub4.pushRightClickMenuAction(-1, 1L, (byte) -125, RSString.parse(""), var28, (short) 60, TextureOperation32.aString_3353, var29);
+ continue;
+ }
+
+ if (var11.anInt189 == 1339) {
+ if (var11.method855()) {
+ Compass.drawCompass(var13, var14, var11, var12);
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+ }
+ continue;
+ }
+
+ if (var11.anInt189 == 1400) {
+ GroundItemLink.drawWorldMap(var13, var14, var11.height, var11.width);
+ aBooleanArray3674[var12] = true;
+ Class163_Sub1_Sub1.aBooleanArray4008[var12] = true;
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+ continue;
+ }
+
+ if (var11.anInt189 == 1401) {
+ Class1.worldMapMinimap(var13, var11.height, var11.width, var14);
+ aBooleanArray3674[var12] = true;
+ Class163_Sub1_Sub1.aBooleanArray4008[var12] = true;
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+ continue;
+ }
+
+ if (1402 == var11.anInt189) {
+ if (!HDToolKit.highDetail) {
+ Class129.method1768(var13, var14);
+ aBooleanArray3674[var12] = true;
+ Class163_Sub1_Sub1.aBooleanArray4008[var12] = true;
+ }
+ continue;
+ }
+
+ if (var11.anInt189 == 1405) {
+ if (DeveloperConsole.INSTANCE.getOpen()) {
+ gameWindowWidth = var11.width + var13;
+ }
+
+ if (ClientCommands.fpsOverlayEnabled) {
+ var20 = var11.width + var13;
+ var21 = 15 + var14;
+ FontType.plainFont.drawStringRightAnchor(RSString.stringCombiner(new RSString[]{RSString.parse("Fps:"), RSString.stringAnimator(SequenceDefinition.anInt1862)}), var20, var21, 16776960, -1);//Class72.stringAnimator(SequenceDefinition.anInt1862)}), var20, var21, 16776960, -1);
+ var21 += 15;
+ Runtime var57 = Runtime.getRuntime();
+ var23 = (int) ((var57.totalMemory() + -var57.freeMemory()) / 1024L);
+ var24 = 16776960;
+ if (var23 > 65536) {
+ var24 = 16711680;
+ }
+
+ FontType.plainFont.drawStringRightAnchor(RSString.stringCombiner(new RSString[]{TextCore.aString_4057, RSString.stringAnimator(var23), TextCore.Memoryk}), var20, var21, var24, -1);
+ var21 += 15;
+ if (HDToolKit.highDetail) {
+ var24 = 16776960;
+ var25 = (Class31.anInt580 + Class31.anInt585 + Class31.memory2D) / 1024;
+ if (65536 < var25) {
+ var24 = 16711680;
+ }
+
+ FontType.plainFont.drawStringRightAnchor(RSString.stringCombiner(new RSString[]{TextCore.aString_1622, RSString.stringAnimator(var25), TextCore.Memoryk}), var20, var21, var24, -1);
+ var21 += 15;
+ }
+
+ var24 = 16776960;
+ var25 = 0;
+ var47 = 0;
+ var26 = 0;
+
+ for (var28 = 0; var28 < 29; ++var28) { //TODO:
+ var25 += aClass151_Sub1Array2601[var28].method2108();
+ var26 += aClass151_Sub1Array2601[var28].method2102();
+ var47 += aClass151_Sub1Array2601[var28].method2106();
+ }
+
+ var29 = 10000 * var26 / var25;
+ var28 = var47 * 100 / var25;
+ RSString var55 = RSString.stringCombiner(new RSString[]{TextCore.aString_436, Class3_Sub23.method407(0, true, 2, var29), TextCore.aString_2498, RSString.stringAnimator(var28), RSString.parse("(U(Y")});
+ FontType.smallFont.drawStringRightAnchor(var55, var20, var21, var24, -1);
+ aBooleanArray3674[var12] = true;
+ Class163_Sub1_Sub1.aBooleanArray4008[var12] = true;
+ continue;
+ }
+ if (ClientCommands.renderInfoOverlayEnabled) {
+ if (HDToolKit.highDetail) {
+ int vendorColor;
+ String vendor = HDToolKit.gl.glGetString(7936);
+ if (vendor.contains("NVIDIA")) {
+ vendorColor = 7780608;
+ } else if (vendor.contains("AMD")) {
+ vendorColor = 15539236;
+ } else if (vendor.contains("INTEL")) {
+ vendorColor = 29125;
+ } else {
+ vendorColor = 16776960;
+ }
+ var20 = var11.width + var13;
+ var21 = 15 + var14;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse(HDToolKit.gl.glGetString(7938)), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse(vendor), var20, var21, vendorColor, 4);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse(HDToolKit.gl.glGetString(7937)), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse("Oncard Geometry: " + Class31.anInt585), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse("Oncard 2D: " + Class31.memory2D), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse("Oncard Texture: " + Class31.anInt580), var20, var21, 16776960, 7);
+ } else {
+ var20 = var11.width + var13;
+ var21 = 15 + var14;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse("Java Toolkit"), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse(System.getProperty("java.vendor")), var20, var21, 16776960, 7);
+ var21 += 15;
+ FontType.plainFont.drawStringRightAnchor(RSString.parse(System.getProperty("java.version")), var20, var21, 16776960, 7);
+ }
+ continue;
+ }
+ XPGainDraw.drawGains();
+ SlayerTracker.draw();
+ continue;
+ }
+
+ if (var11.anInt189 == 1406) {
+ ClientErrorException.anInt2115 = var14;
+ AbstractSprite.aClass11_3708 = var11;
+ TextureOperation18.anInt4041 = var13;
+ continue;
+ }
+ }
+
+ if (!Class38_Sub1.aBoolean2615) {
+ if (var11.type == 0 && var11.aBoolean219 && NPCDefinition.anInt1297 >= var16 && var17 <= Class38_Sub1.anInt2612 && NPCDefinition.anInt1297 < var18 && Class38_Sub1.anInt2612 < var19 && !ClientCommands.commandQaOpEnabled) {
+ menuOptionCount = 1;
+ Class114.anIntArray1578[0] = Class3_Sub28_Sub5.anInt3590;
+ GroundItem.aStringArray2935[0] = TextCore.HasCancel;
+ Class163_Sub2_Sub1.aStringArray4016[0] = RSString.parse("");
+ TextureOperation27.aShortArray3095[0] = 1005;
+ }
+
+ if (var16 <= NPCDefinition.anInt1297 && Class38_Sub1.anInt2612 >= var17 && var18 > NPCDefinition.anInt1297 && Class38_Sub1.anInt2612 < var19) {
+ Class3_Sub24_Sub4.method477(Class38_Sub1.anInt2612 + -var14, -var13 + NPCDefinition.anInt1297, var11);
+ }
+ }
+
+ if (var11.type == 0) {
+ if (!var11.usingScripts && Client.method51(var11) && Class107.aClass11_1453 != var11) {
+ continue;
+ }
+
+ if (!var11.usingScripts) {
+ if (var11.anInt208 > -var11.height + var11.anInt252) {
+ var11.anInt208 = -var11.height + var11.anInt252;
+ }
+
+ if (0 > var11.anInt208) {
+ var11.anInt208 = 0;
+ }
+ }
+
+ method1095(var16, -var11.anInt208 + var14, -var11.anInt247 + var13, var3, var18, var11.componentHash, var17, var19, (byte) 87, var12);
+ if (null != var11.aClass11Array262) {
+ method1095(var16, -var11.anInt208 + var14, -var11.anInt247 + var13, var11.aClass11Array262, var18, var11.componentHash, var17, var19, (byte) 52, var12);
+ }
+
+ Class3_Sub31 var36 = TextureOperation23.aHashTable_3208.get(var11.componentHash);
+ if (var36 != null) {
+ if (var36.anInt2603 == 0 && !Class38_Sub1.aBoolean2615 && NPCDefinition.anInt1297 >= var16 && Class38_Sub1.anInt2612 >= var17 && NPCDefinition.anInt1297 < var18 && Class38_Sub1.anInt2612 < var19 && !ClientCommands.commandQaOpEnabled) {
+ GroundItem.aStringArray2935[0] = TextCore.HasCancel;
+ menuOptionCount = 1;
+ Class114.anIntArray1578[0] = Class3_Sub28_Sub5.anInt3590;
+ TextureOperation27.aShortArray3095[0] = 1005;
+ Class163_Sub2_Sub1.aStringArray4016[0] = RSString.parse("");
+ }
+
+ TextureOperation12.method171(-101, var36.anInt2602, var16, var18, var13, var12, var19, var17, var14);
+ }
+
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.setClipping(var0, var6, var4, var7);
+ Class51.method1134();
+ }
+ }
+
+ if (aBooleanArray1712[var12] || Client.rectDebugInt > 1) {
+ if (var11.type == 0 && !var11.usingScripts && var11.anInt252 > var11.height) {
+ TextureOperation24.method224(var11.anInt208, var11.anInt252, var11.width + var13, var14, var11.height);
+ }
+
+ if (var11.type != 1) {
+ boolean var39;
+ boolean var46;
+ if (var11.type == 2) {
+ var20 = 0;
+
+ for (var21 = 0; var11.defHeight > var21; ++var21) {
+ for (var22 = 0; var11.defWidth > var22; ++var22) {
+ var24 = var14 + var21 * (32 - -var11.anInt290);
+ var23 = (var11.anInt285 + 32) * var22 + var13;
+ if (var20 < 20) {
+ var24 += var11.anIntArray300[var20];
+ var23 += var11.anIntArray272[var20];
+ }
+
+ if (var11.itemAmounts[var20] <= 0) {
+ if (null != var11.anIntArray197 && var20 < 20) {
+ AbstractSprite var58 = var11.method859(var20);
+ if (null == var58) {
+ if (RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ } else {
+ var58.drawAt(var23, var24);
+ }
+ }
+ } else {
+ var47 = var11.itemAmounts[var20] + -1;
+ if (var0 < 32 + var23 && var4 > var23 && var24 - -32 > var6 && var7 > var24 || var11 == Class67.aClass11_1017 && var20 == PacketParser.anInt86) {
+ AbstractSprite var54;
+ if (Class164_Sub1.anInt3012 == 1 && BufferedDataStream.anInt1473 == var20 && Class3_Sub28_Sub18.anInt3764 == var11.componentHash) {
+ var54 = Class114.method1707(2, var47, var11.aBoolean227, var11.itemIds[var20], 0);
+ } else {
+ var54 = Class114.method1707(1, var47, var11.aBoolean227, var11.itemIds[var20], 3153952);
+ }
+
+ if (Class51.aBoolean837) {
+ aBooleanArray3674[var12] = true;
+ }
+
+ if (null == var54) {
+ Class20.method909(var11);
+ } else if (Class67.aClass11_1017 == var11 && var20 == PacketParser.anInt86) {
+ var25 = Class126.anInt1676 - Class129_Sub1.anInt2693;
+ var26 = -anInt40 + anInt1709;
+ if (var26 < 5 && var26 > -5) {
+ var26 = 0;
+ }
+
+ if (var25 < 5 && var25 > -5) {
+ var25 = 0;
+ }
+
+ if (5 > Class40.anInt677) {
+ var25 = 0;
+ var26 = 0;
+ }
+
+ var54.method637(var23 + var25, var24 - -var26, 128);
+ if (var5 != -1) {
+ RSInterface var51 = var3[var5 & 65535];
+ int var31;
+ int var30;
+ if (HDToolKit.highDetail) {
+ var31 = Class22.anInt451;
+ var30 = Class22.anInt448;
+ } else {
+ var30 = Toolkit.JAVA_TOOLKIT.clipTop;
+ var31 = Toolkit.JAVA_TOOLKIT.clipBottom;
+ }
+
+ int var32;
+ if (var26 + var24 < var30 && var51.anInt208 > 0) {
+ var32 = Class106.anInt1446 * (-var26 + var30 + -var24) / 3;
+ if (Class106.anInt1446 * 10 < var32) {
+ var32 = 10 * Class106.anInt1446;
+ }
+
+ if (var32 > var51.anInt208) {
+ var32 = var51.anInt208;
+ }
+
+ var51.anInt208 -= var32;
+ anInt40 += var32;
+ Class20.method909(var51);
+ }
+
+ if (var31 < 32 + var26 + var24 && var51.anInt208 < -var51.height + var51.anInt252) {
+ var32 = (-var31 + 32 + (var24 - -var26)) * Class106.anInt1446 / 3;
+ if (var32 > Class106.anInt1446 * 10) {
+ var32 = 10 * Class106.anInt1446;
+ }
+
+ if (-var51.anInt208 + var51.anInt252 + -var51.height < var32) {
+ var32 = var51.anInt252 + -var51.height + -var51.anInt208;
+ }
+
+ var51.anInt208 += var32;
+ anInt40 -= var32;
+ Class20.method909(var51);
+ }
+ }
+ } else if (var11 == aClass11_1933 && var20 == KeyboardListener.anInt1918) {
+ var54.method637(var23, var24, 128);
+ } else {
+ var54.drawAt(var23, var24);
+ }
+ }
+ }
+
+ ++var20;
+ }
+ }
+ } else if (3 == var11.type) {
+ if (method609(var11, 26)) {
+ var20 = var11.anInt253;
+ if (Class107.aClass11_1453 == var11 && 0 != var11.anInt222) {
+ var20 = var11.anInt222;
+ }
+ } else {
+ var20 = var11.anInt218;
+ if (var11 == Class107.aClass11_1453 && 0 != var11.anInt228) {
+ var20 = var11.anInt228;
+ }
+ }
+
+ /* INTERFACE DRAWS ALPHA/NON-ALPHA BOXES/BACKGROUNDS */
+ if (alpha != 0) {
+ if (var11.aBoolean226) {
+ if (HDToolKit.highDetail) {
+ Toolkit.OPENGL_TOOLKIT.fillRect(var13, var14, var11.width, var11.height, var20, 256 + -(255 & alpha));//Magic book spell tool-tip hover background draw
+ } else {
+ Toolkit.JAVA_TOOLKIT.fillRect(var13, var14, var11.width, var11.height, var20, 256 + -(255 & alpha));
+ }
+ } else if (HDToolKit.highDetail) {
+ Class22.method928(var13, var14, var11.width, var11.height, var20, 256 + -(alpha & 0xFF));//Interface backgrounds (includes dark areas)
+ } else {
+ Class74.method1315(var13, var14, var11.width, var11.height, var20, -(alpha & 0xFF) + 256);//Interface backgrounds (includes dark areas)
+ }
+ } else if (var11.aBoolean226) {
+ if (HDToolKit.highDetail) {
+ Toolkit.OPENGL_TOOLKIT.method934(var13, var14, var11.width, var11.height, var20);//Skill tool-tip hover background draw
+ } else {
+ Toolkit.JAVA_TOOLKIT.fillRect(var13, var14, var11.width, var11.height, var20, 255);//Skill tool-tip pop up background
+ }
+ } else if (HDToolKit.highDetail) {
+ Toolkit.OPENGL_TOOLKIT.drawRect(var13, var14, var11.width, var11.height, var20, 255);//Boxed border background draw
+ } else {
+ Toolkit.JAVA_TOOLKIT.drawRect(var13, var14, var11.width, var11.height, var20, 255);//Boxed border background draw
+ }
+ // TODO DRAWRECT
+// if (Class3_Sub28_Sub12.method609(var11, 26)) {
+// var20 = var11.anInt253;
+// if (Class107.aClass11_1453 == var11 && 0 != var11.anInt222) {
+// var20 = var11.anInt222;
+// }
+// } else {
+// var20 = var11.anInt218;
+// if (var11 == Class107.aClass11_1453 && 0 != var11.anInt228) {
+// var20 = var11.anInt228;
+// }
+// }
+//
+// if (var15 != 0) {
+// if (var11.aBoolean226) {
+// Toolkit.getActiveToolkit().fillRect(var13, var14, var11.width, var11.height, var20, 256 - (var15 & 0xFF));//Background for mage book
+// } else if (HDToolKit.highDetail) {
+// Class22.method928(var13, var14, var11.width, var11.height, var20, 256 + -(var15 & 0xFF));
+// } else {
+// Class74.method1315(var13, var14, var11.width, var11.height, var20, -(var15 & 0xFF) + 256);
+// }
+// } else if (var11.aBoolean226) {
+// Toolkit.getActiveToolkit().method934(var13, var14, var11.width, var11.height, var20);//Fill Rectangle for skill hover
+// } else {
+// Toolkit.getActiveToolkit().drawRect(var13, var14, var11.width, var11.height, var20, 255);//Background border for mage book
+// }
+
+ } else {
+ Font var34;
+ if (var11.type == 4) {
+ // TODO RSInterfaceRenderText
+ var34 = var11.method868(Sprites.nameIconsSpriteArray);
+ if (var34 != null) {
+ RSString var45 = var11.text;
+ if (method609(var11, 97)) {
+ var21 = var11.anInt253;
+ if (Class107.aClass11_1453 == var11 && var11.anInt222 != 0) {
+ var21 = var11.anInt222;
+ }
+
+ if (var11.aString_172.length() > 0) {
+ var45 = var11.aString_172;
+ }
+ } else {
+ var21 = var11.anInt218;
+ if (Class107.aClass11_1453 == var11 && var11.anInt228 != 0) {
+ var21 = var11.anInt228;
+ }
+ }
+
+ if (var11.usingScripts && var11.anInt192 != -1) {
+ ItemDefinition var50 = ItemDefinition.getItemDefinition(var11.anInt192);
+ var45 = var50.name;
+ if (var45 == null) {
+ var45 = TextCore.HasNull;
+ }
+
+ if ((var50.stackingType == 1 || var11.anInt271 != 1) && var11.anInt271 != -1) {
+ var45 = RSString.stringCombiner(new RSString[]{ColorCore.ItemInterfaceColor, var45, TextCore.aString_2306, Class36.method1013((byte) -125, var11.anInt271)});
+ }
+ }
+
+ if (TextureOperation27.aClass11_3087 == var11) {
+ var21 = var11.anInt218;
+ var45 = TextCore.LoadingPleaseWait;
+ }
+
+ if (!var11.usingScripts) {
+ var45 = method1303(var11, var45);
+ }
+
+ var34.method676(var45, var13, var14, var11.width, var11.height, var21, !var11.aBoolean215 ? -1 : 0, var11.anInt194, var11.anInt225, var11.anInt205);
+ } else if (RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ } else if (5 == var11.type) {
+ AbstractSprite var37;
+ if (var11.usingScripts) {
+ if (var11.anInt192 == -1) {
+ var37 = var11.method866(false);
+ } else {
+ var37 = Class114.method1707(var11.anInt288, var11.anInt192, var11.aBoolean227, var11.anInt271, var11.anInt287);
+ }
+
+ if (var37 == null) {
+ if (RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ } else {
+ var21 = var37.anInt3697;
+ var22 = var37.anInt3706;
+ if (var11.aBoolean186) {
+ var23 = (var21 + -1 + var11.width) / var21;
+ var24 = (var11.height - 1 - -var22) / var22;
+ if (HDToolKit.highDetail) {
+ Class22.method931(var13, var14, var11.width + var13, var11.height + var14);
+ var39 = Class140_Sub6.method2021((byte) -94, var37.width);
+ var46 = Class140_Sub6.method2021((byte) -113, var37.height);
+ HDSprite var27 = (HDSprite) var37;
+ if (var39 && var46) {
+ if (alpha == 0) {
+ var27.method649(var13, var14, var23, var24);
+ } else {
+ var27.method646(var13, var14, -(255 & alpha) + 256, var23, var24);
+ }
+ } else if (var39) {
+ for (var28 = 0; var28 < var24; ++var28) {
+ if (alpha == 0) {
+ var27.method649(var13, var28 * var22 + var14, var23, 1);
+ } else {
+ var27.method646(var13, var14 + var28 * var22, 256 + -(alpha & 0xFF), var23, 1);
+ }
+ }
+ } else if (var46) {
+ for (var28 = 0; var28 < var23; ++var28) {
+ if (alpha == 0) {
+ var27.method649(var21 * var28 + var13, var14, 1, var24);
+ } else {
+ var27.method646(var21 * var28 + var13, var14, -(alpha & 0xFF) + 256, 1, var24);
+ }
+ }
+ } else {
+ for (var28 = 0; var23 > var28; ++var28) {
+ for (var29 = 0; var29 < var24; ++var29) {
+ if (alpha == 0) {
+ var37.drawAt(var13 - -(var21 * var28), var22 * var29 + var14);
+ } else {
+ var37.method637(var28 * var21 + var13, var22 * var29 + var14, -(255 & alpha) + 256);
+ }
+ }
+ }
+ }
+
+ Class22.setClipping(var0, var6, var4, var7);
+ } else {
+ Class74.method1326(var13, var14, var13 - -var11.width, var14 - -var11.height);
+
+ for (var25 = 0; var25 < var23; ++var25) {
+ for (var26 = 0; var24 > var26; ++var26) {
+ if (var11.anInt301 == 0) {
+ if (0 == alpha) {
+ var37.drawAt(var25 * var21 + var13, var22 * var26 + var14);
+ } else {
+ var37.method637(var25 * var21 + var13, var14 + var26 * var22, 256 - (255 & alpha));
+ }
+ } else {
+ var37.drawScaledOrRotated(var14 - -(var22 * var26) + var22 / 2, var11.anInt301, 4096, var25 * var21 + var13 + var21 / 2);
+ }
+ }
+ }
+
+ Class74.setClipping(var0, var6, var4, var7);
+ }
+ } else {
+ var23 = var11.width * 4096 / var21;
+ if (var11.anInt301 == 0) {
+ if (0 != alpha) {
+ var37.method642(var13, var14, var11.width, var11.height, -(255 & alpha) + 256);
+ } else if (var11.width == var21 && var11.height == var22) {
+ var37.drawAt(var13, var14);
+ } else {
+ var37.method639(var13, var14, var11.width, var11.height);
+ }
+ } else {
+ var37.drawScaledOrRotated(var14 + var11.height / 2, var11.anInt301, var23, var13 + var11.width / 2);
+ }
+ }
+ }
+ } else {
+ var37 = var11.method866(method609(var11, 69));
+ if (null != var37) {
+ var37.drawAt(var13, var14);
+ } else if (RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ }
+ } else {
+ ItemDefinition var42;
+ if (var11.type == 6) {
+ boolean var41 = method609(var11, 110);
+ Model var38 = null;
+ if (var41) {
+ var21 = var11.secondAnimationId;
+ } else {
+ var21 = var11.animationId;
+ }
+
+ var23 = 0;
+ if (var11.anInt192 != -1) {
+ var42 = ItemDefinition.getItemDefinition(var11.anInt192);
+ var42 = var42.method1106(var11.anInt271);
+ SequenceDefinition var52 = var21 == -1 ? null : SequenceDefinition.getAnimationDefinition(var21);
+ var38 = var42.method1110(var11.anInt260, var11.anInt267, var52, 1, var11.anInt283);
+ if (var38 == null) {
+ Class20.method909(var11);
+ } else {
+ var23 = -var38.method1871() / 2;
+ }
+ } else if (5 != var11.modelType) {
+ if (var21 == -1) {
+ var38 = var11.method865(-1, null, -1, 126, 0, var41, Class102.player.class52);
+ if (null == var38 && RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ } else {
+ SequenceDefinition var48 = SequenceDefinition.getAnimationDefinition(var21);
+ var38 = var11.method865(var11.anInt260, var48, var11.anInt283, 127, var11.anInt267, var41, Class102.player.class52);
+ if (null == var38 && RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ }
+ } else if (-1 == var11.itemId) {
+ var38 = aClass52_1112.method1165(null, -1, null, null, 0, -1, 100, 0, -1, -1);
+ } else {
+ var24 = 2047 & var11.itemId;
+ if (Class3_Sub1.localIndex == var24) {
+ var24 = 2047;
+ }
+
+ Player var49 = players[var24];
+ SequenceDefinition var56 = var21 == -1 ? null : SequenceDefinition.getAnimationDefinition(var21);
+ if (null != var49 && (-2048 & var11.itemId) == (int) var49.displayName.toLong() << 11) {
+ var38 = var49.class52.method1165(null, -1, null, var56, 0, -1, -126, 0, var11.anInt283, 0);
+ }
+ }
+
+ if (var38 != null) {
+ if (var11.anInt184 > 0) {
+ var24 = (var11.width << 8) / var11.anInt184;
+ } else {
+ var24 = 256;
+ }
+
+ if (var11.anInt312 <= 0) {
+ var25 = 256;
+ } else {
+ var25 = (var11.height << 8) / var11.anInt312;
+ }
+
+ var26 = var13 - -(var11.width / 2) - -(var24 * var11.anInt259 >> 8);
+ var47 = var11.height / 2 + var14 + (var25 * var11.anInt230 >> 8);
+ if (HDToolKit.highDetail) {
+ if (var11.aBoolean181) {
+ HDToolKit.method1855(var26, var47, var11.anInt164, var11.aShort293, var24, var25);
+ } else {
+ HDToolKit.method1821(var26, var47, var24, var25);
+ HDToolKit.method1825(var11.aShort169, 1.5F * (float) var11.aShort293);
+ }
+
+ HDToolKit.method1846();
+ HDToolKit.method1831(true);
+ HDToolKit.method1827(false);
+ TextureOperation29.method324(anInt3625);
+ if (aBoolean47) {
+ Class22.resetClipping();
+ HDToolKit.method1841();
+ Class22.setClipping(var0, var6, var4, var7);
+ aBoolean47 = false;
+ }
+
+ if (var11.aBoolean309) {
+ HDToolKit.depthBufferWritingDisabled();
+ }
+
+ var28 = Class51.anIntArray840[var11.anInt182] * var11.anInt164 >> 16;
+ var29 = var11.anInt164 * Class51.anIntArray851[var11.anInt182] >> 16;
+ if (var11.usingScripts) {
+ var38.method1893(var11.anInt308, var11.anInt280, var11.anInt182, var11.anInt258, var11.anInt264 + var28 + var23, var11.anInt264 + var29);
+ } else {
+ var38.method1893(var11.anInt308, 0, var11.anInt182, 0, var28, var29);
+ }
+
+ if (var11.aBoolean309) {
+ HDToolKit.method1830();
+ }
+ } else {
+ Class51.method1145(var26, var47);
+ var28 = Class51.anIntArray840[var11.anInt182] * var11.anInt164 >> 16;
+ var29 = var11.anInt164 * Class51.anIntArray851[var11.anInt182] >> 16;
+ if (!var11.usingScripts) {
+ var38.method1893(var11.anInt308, 0, var11.anInt182, 0, var28, var29);
+ } else if (var11.aBoolean181) {
+ ((Class140_Sub1_Sub2) var38).method1946(var11.anInt308, var11.anInt280, var11.anInt182, var11.anInt258, var11.anInt264 + var23 + var28, var29 + var11.anInt264, var11.anInt164);
+ } else {
+ var38.method1893(var11.anInt308, var11.anInt280, var11.anInt182, var11.anInt258, var11.anInt264 + (var28 - -var23), var29 + var11.anInt264);
+ }
+
+ Class51.method1141();
+ }
+ }
+ } else {
+ if (var11.type == 7) {
+ var34 = var11.method868(Sprites.nameIconsSpriteArray);
+ if (var34 == null) {
+ if (RSInterface.aBoolean6) {
+ Class20.method909(var11);
+ }
+ continue;
+ }
+
+ var21 = 0;
+
+ for (var22 = 0; var22 < var11.defHeight; ++var22) {
+ for (var23 = 0; var23 < var11.defWidth; ++var23) {
+ if (0 < var11.itemAmounts[var21]) {
+ var42 = ItemDefinition.getItemDefinition(var11.itemAmounts[var21] + -1);
+ RSString var40;
+ if (1 != var42.stackingType && 1 == var11.itemIds[var21]) {
+ var40 = RSString.stringCombiner(new RSString[]{
+ ColorCore.ItemInterfaceColor, var42.name, TextCore.aString_2584
+ });
+ } else {
+ var40 = RSString.stringCombiner(new RSString[]{
+ ColorCore.ItemInterfaceColor, var42.name, TextCore.aString_2306, Class36.method1013((byte) -100, var11.itemIds[var21])
+ });
+ }
+
+ var26 = var13 + var23 * (var11.anInt285 + 115);
+ var47 = (var11.anInt290 + 12) * var22 + var14;
+ if (var11.anInt194 == 0) {
+ var34.method681(var40, var26, var47, var11.anInt218, var11.aBoolean215 ? 0 : -1);
+ } else if (var11.anInt194 == 1) {
+ var34.method699(var40, 57 + var26, var47, var11.anInt218, !var11.aBoolean215 ? -1 : 0);
+ } else {
+ var34.drawStringRightAnchor(var40, -1 + var26 + 115, var47, var11.anInt218, !var11.aBoolean215 ? -1 : 0);
+ }
+ }
+
+ ++var21;
+ }
+ }
+ }
+
+ if (var11.type == 8 && Class20.aClass11_439 == var11 && TextureOperation35.anInt3323 == Class75.anInt1109) {
+ var21 = 0;
+ var20 = 0;
+ RSString var43 = var11.text;
+ Font var35 = FontType.plainFont;
+ var43 = method1303(var11, var43);
+
+ RSString var44;
+ while (var43.length() > 0) {
+ var25 = var43.indexOf(TextCore.aString_2598, 62);
+ if (var25 == -1) {
+ var44 = var43;
+ var43 = RSString.parse("");
+ } else {
+ var44 = var43.substring(0, var25, 0);
+ var43 = var43.substring(var25 + 4);
+ }
+
+ var26 = var35.method682(var44);
+ var21 += var35.anInt3727 - -1;
+ if (var26 > var20) {
+ var20 = var26;
+ }
+ }
+
+ var26 = var14 - -var11.height - -5;
+ var20 += 6;
+ var21 += 7;
+ if (var7 < var26 - -var21) {
+ var26 = -var21 + var7;
+ }
+
+ var25 = -var20 + -5 + var13 - -var11.width;
+ if (var25 < 5 + var13) {
+ var25 = 5 + var13;
+ }
+
+ if (var4 < var20 + var25) {
+ var25 = -var20 + var4;
+ }
+
+ Toolkit.getActiveToolkit().method934(var25, var26, var20, var21, 16777120);
+ Toolkit.getActiveToolkit().drawRect(var25, var26, var20, var21, 0, 255);
+
+ var43 = var11.text;
+ var47 = 2 + (var26 - -var35.anInt3727);
+
+ for (var43 = method1303(var11, var43); var43.length() > 0; var47 += var35.anInt3727 + 1) {
+ var28 = var43.indexOf(TextCore.aString_2598, 86);
+ if (var28 == -1) {
+ var44 = var43;
+ var43 = RSString.parse("");
+ } else {
+ var44 = var43.substring(0, var28, 0);
+ var43 = var43.substring(4 + var28);
+ }
+
+ var35.method681(var44, 3 + var25, var47, 0, -1);
+ }
+ }
+
+ if (var11.type == 9) {
+ if (var11.aBoolean167) {
+ var20 = var13;
+ var22 = var13 - -var11.width;
+ var21 = var14 - -var11.height;
+ var23 = var14;
+ } else {
+ var20 = var13;
+ var21 = var14;
+ var23 = var14 - -var11.height;
+ var22 = var13 + var11.width;
+ }
+
+ if (var11.anInt250 == 1) {
+ if (HDToolKit.highDetail) {
+ Class22.method933(var20, var21, var22, var23, var11.anInt218);
+ } else {
+ Class74.method1328(var20, var21, var22, var23, var11.anInt218);
+ }
+ } else if (HDToolKit.highDetail) {
+ Class22.method929(var20, var21, var22, var23, var11.anInt218, var11.anInt250);
+ } else {
+ Class74.method1322(var20, var21, var22, var23, var11.anInt218, var11.anInt250);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (var8 <= 31) {
+ quickChatMessages = null;
+ }
+
+ } catch (RuntimeException var33) {
+ throw ClientErrorException.clientError(var33, "gn.B(" + var0 + ',' + var1 + ',' + var2 + ',' + (var3 != null ? "{...}" : "null") + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ',' + var8 + ',' + var9 + ')');
+ }
+ }
+
+ public static void clampCameraAngle() {
+ try {
+ if (anInt2309 < 128) {
+ anInt2309 = 128;
+ }
+
+ if (anInt2309 > 383) {
+ anInt2309 = 383;
+ }
+
+ GraphicDefinition.CAMERA_DIRECTION &= 2047;
+
+ int var1 = x3155 >> 7;
+ int var2 = y942 >> 7;
+ int var3 = Scenery.sceneryPositionHash(WorldListCountry.localPlane, 1, x3155, y942);
+ int var4 = 0;
+ int x;
+ if (var1 > 3 && 3 < var2 && 100 > var1 && var2 < 100) {
+ for (x = -4 + var1; var1 - -4 >= x; ++x) {
+ for (int y = -4 + var2; y <= 4 + var2; ++y) {
+ int z = WorldListCountry.localPlane;
+ if (3 > z && 2 == (2 & sceneryTypeMaskGrid[1][x][y])) {
+ ++z;
+ }
+
+ int var8 = (255 & possibleHeightmap1774[z][x][y]) * 8 - Class44.anIntArrayArrayArray723[z][x][y] + var3;
+ if (var8 > var4) {
+ var4 = var8;
+ }
+ }
+ }
+ }
+
+ int var5 = 192 * var4;
+ if (var5 > 98048) {
+ var5 = 98048;
+ }
+
+ if (var5 < 32768) {
+ var5 = 32768;
+ }
+
+ if (var5 <= Class75_Sub4.anInt2670) {
+ if (Class75_Sub4.anInt2670 > var5) {
+ Class75_Sub4.anInt2670 += (var5 - Class75_Sub4.anInt2670) / 80;
+ }
+ } else {
+ Class75_Sub4.anInt2670 += (-Class75_Sub4.anInt2670 + var5) / 24;
+ }
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "gn.D()");
+ }
+ }
+
+ public static int method1100(int var0, int var2) {
+ try {
+ if (var2 == -1) {
+ return 12345678;
+ } else {
+
+ var0 = var0 * (127 & var2) >> 7;
+ if (2 <= var0) {
+ if (126 < var0) {
+ var0 = 126;
+ }
+ } else {
+ var0 = 2;
+ }
+
+ return var0 + ('\uff80' & var2);
+ }
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "gn.C(" + var0 + ',' + true + ',' + var2 + ')');
+ }
+ }
+
+ public static void method1516(int var0, int var1) {
+ try {
+ InterfaceWidget var2 = InterfaceWidget.getWidget(3, var0);
+ var2.a();
+ if (var1 < 87) {
+ TextCore.aString_1326 = null;
+ }
+
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "n.L(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ /**
+ * static final void method1517(byte var0) {
+ * try {
+ * Class139.aFontMetrics1822 = null;
+ * TextCore.Helvetica = null;
+ * if(var0 != -118) {
+ * method1516(64, 82);
+ * }
+ *
+ * Class129_Sub1.anImage2695 = null;
+ * } catch (RuntimeException var2) {
+ * throw Class44.method1067(var2, "n.J(" + var0 + ')');
+ * }
+ * }
+ **/
+
+ public static void method1517() {
+ try {
+ StartupLoadingBarInitial.aFontMetrics1822 = null;
+
+ //MillisTimer.anImage2695 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "n.J(" + (byte) -118 + ')');
+ }
+ }
+
+ public static int bitwiseXOR(int var0, int var1) {
+ try {
+ return var0 ^ var1;
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "n.E(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public static void method1525(int var1, int var2, int var3, int var4, int var5) {
+ try {
+ int var6 = Class40.method1040(Class57.anInt902, var3, Class159.anInt2020);
+ int var7 = Class40.method1040(Class57.anInt902, var5, Class159.anInt2020);
+ int var8 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var4, Class101.anInt1425);
+
+ int var9 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var2, Class101.anInt1425);
+
+ for (int var10 = var6; var10 <= var7; ++var10) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var10], var8, 3074 + -2974, var9, var1);
+ }
+
+ } catch (RuntimeException var11) {
+ throw ClientErrorException.clientError(var11, "n.I(" + 3074 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ public static SoftwareSprite loadSoftwareSprite(CacheIndex var0, int var2) {
+ try {
+ // System.out.println("Class 3_Sub28_Sub16_Sub2 " + var2);
+ return Class75_Sub4.method1351(var0, 0, var2) ? Class3_Sub28_Sub9.method578() : null;
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "gf.O(" + (var0 != null ? "{...}" : "null") + ',' + 0 + ',' + var2 + ',' + (byte) 39 + ')');
+ }
+ }
+
+ public static void parsePreferences(Signlink var0) {
+ try {
+ anInt3625 = 3;
+ Class25.method957(true);
+ aBoolean3604 = true;
+ TextureOperation17.stereoSound = true;
+ Class128.aBoolean1685 = true;
+ Class3_Sub28_Sub9.anInt3622 = 0;
+ anInt3071 = 0;
+ KeyboardListener.aBoolean1905 = true;
+ WorldListEntry.aBoolean2623 = true;
+ RSInterface.aBoolean236 = true;
+ Sprites.ambientVolume = 127;
+ Class38.aBoolean661 = true;
+ Class140_Sub6.aBoolean2910 = true;
+ TextureOperation.anInt2378 = 0;
+ anInt1137 = 2;
+ aBoolean3275 = true;
+ Class106.aBoolean1441 = true;
+ AudioHandler.musicVolume = 255;
+ Class25.aBoolean488 = true;
+ anInt3671 = 0;
+ RandomAccessFileWrapper var2 = null;
+ AudioHandler.soundEffectVolume = 127;
+ if (Class3_Sub24_Sub3.maxClientMemory >= 96) {
+ Class127_Sub1.method1758(2);
+ } else {
+ Class127_Sub1.method1758(0);
+ }
+
+ anInt2148 = 0;
+ Class3_Sub20.anInt2488 = 0;
+ AudioThread.aBoolean346 = false;
+ Class163_Sub3.aBoolean3004 = true;
+ aBoolean2146 = false;
+ aBoolean1080 = false;
+ anInt2577 = 0;
+
+ try {
+ Class64 var3 = var0.method1433("runescape", 12);
+
+ while (0 == var3.anInt978) {
+ TimeUtils.sleep(1L);
+ }
+
+ if (var3.anInt978 == 1) {
+ var2 = (RandomAccessFileWrapper) var3.anObject974;
+ byte[] var4 = new byte[(int) var2.getLength()];
+
+ int var6;
+ for (int var5 = 0; var4.length > var5; var5 += var6) {
+ var6 = var2.read(var4, var5, var4.length - var5, 0);
+ if (var6 == -1) {
+ throw new IOException("EOF");
+ }
+ }
+
+ CSConfigCachefile.method1390(new DataBuffer(var4));
+ }
+ } catch (Exception var8) {
+ }
+
+ try {
+ if (var2 != null) {
+ var2.close();
+ }
+ } catch (Exception var7) {
+ }
+
+ } catch (RuntimeException var9) {
+ throw ClientErrorException.clientError(var9, "gf.F(" + (var0 != null ? "{...}" : "null") + ',' + 0 + ')');
+ }
+ }
+
+ public static void method565(int var1, int var2) {
+ try {
+ Texture.anInt1150 = -TextureOperation37.anInt3256 + var1;
+
+ int var3 = -((int) ((float) Class3_Sub28_Sub3.aClass11_3551.width / Class44.aFloat727)) + Texture.anInt1150;
+ int var4 = Texture.anInt1150 + (int) ((float) Class3_Sub28_Sub3.aClass11_3551.width / Class44.aFloat727);
+ if (var3 < 0) {
+ Texture.anInt1150 = (int) ((float) Class3_Sub28_Sub3.aClass11_3551.width / Class44.aFloat727);
+ }
+
+ TextureOperation13.anInt3362 = Class108.anInt1460 + -1 + anInt65 + -var2;
+ int var6 = (int) ((float) Class3_Sub28_Sub3.aClass11_3551.height / Class44.aFloat727) + TextureOperation13.anInt3362;
+ int var5 = TextureOperation13.anInt3362 - (int) ((float) Class3_Sub28_Sub3.aClass11_3551.height / Class44.aFloat727);
+ if (Class23.anInt455 < var4) {
+ Texture.anInt1150 = Class23.anInt455 + -((int) ((float) Class3_Sub28_Sub3.aClass11_3551.width / Class44.aFloat727));
+ }
+
+ if (var5 < 0) {
+ TextureOperation13.anInt3362 = (int) ((float) Class3_Sub28_Sub3.aClass11_3551.height / Class44.aFloat727);
+ }
+
+ if (var6 > Class108.anInt1460) {
+ TextureOperation13.anInt3362 = -((int) ((float) Class3_Sub28_Sub3.aClass11_3551.height / Class44.aFloat727)) + Class108.anInt1460;
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "gf.E(" + (byte) 86 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ public static void method566(RSString var0, int var2) {
+ try {
+ InterfaceWidget var3 = InterfaceWidget.getWidget(3, var2);
+ var3.flagUpdate();
+ var3.text = var0;
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "gf.P(" + (var0 != null ? "{...}" : "null") + ',' + 0 + ',' + var2 + ')');
+ }
+ }
+
+ public static void method569(int var1) {
+ try {
+ InterfaceWidget var2 = InterfaceWidget.getWidget(7, var1);
+ var2.a();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "he.C(" + -82 + ',' + var1 + ')');
+ }
+ }
+
+ public static RSString method1723(byte var0, boolean var1, int var3) {
+ try {
+ int var4 = 1;
+
+ for (int var5 = var3 / 10; 0 != var5; ++var4) {
+ var5 /= 10;
+ }
+
+ int var6 = var4;
+ if (var3 < 0 || var1) {
+ var6 = var4 + 1;
+ }
+
+ byte[] var7 = new byte[var6];
+ if (var3 >= 0) {
+ if (var1) {
+ var7[0] = 43;
+ }
+ } else {
+ var7[0] = 45;
+ }
+
+ for (int var8 = 0; var4 > var8; ++var8) {
+ int var9 = var3 % 10;
+ if (var9 < 0) {
+ var9 = -var9;
+ }
+
+ var7[var6 + -var8 + -1] = (byte) (48 + var9);
+ var3 /= 10;
+ }
+
+ if (var0 >= -111) {
+ method1727((byte) 53);
+ }
+
+ RSString var11 = new RSString();
+ var11.buffer = var7;
+ var11.length = var6;
+ return var11;
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "q.A(" + var0 + ',' + var1 + ',' + 10 + ',' + var3 + ')');
+ }
+ }
+
+ public static void method1724(int var0, int var1, int var2, int var3, int var4, int var5, byte var6, int var7) {
+ try {
+ if (var5 >= 128 && var2 >= 128 && var5 <= 13056 && var2 <= 13056) {
+ int var8 = Scenery.sceneryPositionHash(WorldListCountry.localPlane, 1, var5, var2) + -var3;
+ var2 -= Class77.anInt1111;
+ var8 -= Class7.anInt2162;
+ var5 -= NPC.anInt3995;
+ int var9 = Class51.anIntArray840[Class139.anInt1823];
+ int var10 = Class51.anIntArray851[Class139.anInt1823];
+ int var11 = Class51.anIntArray840[TextureOperation28.anInt3315];
+ int var12 = Class51.anIntArray851[TextureOperation28.anInt3315];
+ int var13 = var5 * var12 + var11 * var2 >> 16;
+ var2 = var2 * var12 + -(var11 * var5) >> 16;
+ var5 = var13;
+ var13 = var10 * var8 - var2 * var9 >> 16;
+ if (var6 <= -47) {
+ var2 = var2 * var10 + var8 * var9 >> 16;
+ if (50 > var2) {
+ Texture.anInt2208 = -1;
+ Class32.anInt590 = -1;
+ } else if (HDToolKit.highDetail) {
+ int var14 = var1 * 512 >> 8;
+ Class32.anInt590 = var14 * var5 / var2 + var0;
+ int var15 = 512 * var7 >> 8;
+ Texture.anInt2208 = var15 * var13 / var2 + var4;
+ } else {
+ Class32.anInt590 = (var5 << 9) / var2 + var0;
+ Texture.anInt2208 = (var13 << 9) / var2 + var4;
+ }
+
+ }
+ } else {
+ Texture.anInt2208 = -1;
+ Class32.anInt590 = -1;
+ }
+ } catch (RuntimeException var16) {
+ throw ClientErrorException.clientError(var16, "q.C(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ',' + var7 + ')');
+ }
+ }
+
+ public static void method1726(int var0) {
+ try {
+ TextCore.aString_1622 = null;
+ TextCore.aString_1617 = null;
+
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "q.B(" + var0 + ')');
+ }
+ }
+
+ public static int method1727(byte var0) {
+ try {
+ if (var0 != 123) {
+ method1726(-123);
+ }
+
+ return KeyboardListener.aReferenceCache_1911.hardCount();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "q.D(" + var0 + ')');
+ }
+ }
+
+ static int method1602(RSString var1) {
+ try {
+ if (Class119.aClass131_1624 == null || var1.length() == 0) {
+ return -1;
+ } else {
+ for (int var2 = 0; var2 < Class119.aClass131_1624.anInt1720; ++var2) {
+ if (Class119.aClass131_1624.aStringArray1721[var2].method1560(RSString.parse(" "), TextCore.aString_4066).method1562((byte) -32, var1)) {
+ return var2;
+ }
+ }
+
+ return -1;
+ }
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ni.G(" + 0 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+
+ static void method338(int var1, boolean var2, int var3, int var4, int var5) {
+ try {
+ ++CSConfigCachefile.anInt1127;
+ Class124.method1745();
+ if(!var2) {
+ Class3_Sub5.method116(true);
+ Class102.method1611(71, true);
+ Class3_Sub5.method116(false);
+ }
+
+ Class102.method1611(100, false);
+ if(!var2) {
+ TextureOperation32.method302(2);
+ }
+
+ PositionedGraphicObject.method2067();
+ if(HDToolKit.highDetail) {
+ Class65.method1239(var4, 125, var5, var1, var3, true);
+ var3 = Class163_Sub1.anInt2989;
+ var5 = Class3_Sub28_Sub3.anInt3564;
+ var4 = Class96.anInt1358;
+ var1 = anInt31;
+ }
+
+ int var6;
+ int var7;
+ if(1 == Class133.anInt1753) {
+ var7 = 2047 & LinkableRSString.anInt2589 + GraphicDefinition.CAMERA_DIRECTION;
+ var6 = anInt2309;
+ if(Class75_Sub4.anInt2670 / 256 > var6) {
+ var6 = Class75_Sub4.anInt2670 / 256;
+ }
+
+ if(WaterfallShader.aBooleanArray2169[4] && Class166.anIntArray2073[4] + 128 > var6) {
+ var6 = 128 + Class166.anIntArray2073[4];
+ }
+
+ PositionedGraphicObject.method1952(x3155, var1, Scenery.sceneryPositionHash(WorldListCountry.localPlane, 1, Class102.player.xAxis, Class102.player.yAxis) + -50, Client.ZOOM - -(var6 * 3), var7, y942, var6);
+ }
+
+ var7 = Class7.anInt2162;
+ var6 = NPC.anInt3995;
+ int var8 = Class77.anInt1111;
+ int var9 = Class139.anInt1823;
+ int var10 = TextureOperation28.anInt3315;
+
+ int var11;
+ int var12;
+ for(var11 = 0; 5 > var11; ++var11) {
+ if(WaterfallShader.aBooleanArray2169[var11]) {
+ var12 = (int)((double)(-TextureOperation14.anIntArray3383[var11]) + (double)(TextureOperation14.anIntArray3383[var11] * 2 + 1) * Math.random() + Math.sin((double)Class163_Sub1_Sub1.anIntArray4009[var11] * ((double) TextureOperation3.anIntArray3359[var11] / 100.0D)) * (double)Class166.anIntArray2073[var11]);
+ if(var11 == 3) {
+ TextureOperation28.anInt3315 = var12 + TextureOperation28.anInt3315 & 0x7FF;
+ }
+
+ if(var11 == 4) {
+ Class139.anInt1823 += var12;
+ if(128 > Class139.anInt1823) {
+ Class139.anInt1823 = 128;
+ }
+
+ if(Class139.anInt1823 > 383) {
+ Class139.anInt1823 = 383;
+ }
+ }
+
+ if(var11 == 2) {
+ Class77.anInt1111 += var12;
+ }
+
+ if(var11 == 1) {
+ Class7.anInt2162 += var12;
+ }
+
+ if(var11 == 0) {
+ NPC.anInt3995 += var12;
+ }
+ }
+ }
+
+ Class3_Sub28_Sub20.method725();
+ if(HDToolKit.highDetail) {
+ Class22.setClipping(var3, var5, var3 + var4, var5 - -var1);
+ float var17 = (float)Class139.anInt1823 * 0.17578125F;
+ float var16 = 0.17578125F * (float) TextureOperation28.anInt3315;
+ if(Class133.anInt1753 == 3) {
+ var17 = 360.0F * InterfaceWidget.aFloat1169 / 6.2831855F;
+ var16 = Class45.aFloat730 * 360.0F / 6.2831855F;
+ }
+
+ HDToolKit.viewport(var3, var5, var4, var1, var4 / 2 + var3, var5 - -(var1 / 2), var17, var16, anInt1705, anInt1705);
+ } else {
+ Class74.setClipping(var3, var5, var4 + var3, var1 + var5);
+ Class51.method1134();
+ }
+
+ if(!Class38_Sub1.aBoolean2615 && var3 <= NPCDefinition.anInt1297 && var4 + var3 > NPCDefinition.anInt1297 && var5 <= Class38_Sub1.anInt2612 && Class38_Sub1.anInt2612 < var1 + var5) {
+ TextureOperation36.aBoolean3094 = true;
+ anInt59 = 0;
+ var12 = Class145.screenUpperX;
+ int var13 = Class1.screenUpperY;
+ var11 = Class139.screenLowerX;
+ anInt3642 = var11 + (var12 - var11) * (-var3 + NPCDefinition.anInt1297) / var4;
+ int var14 = AtmosphereParser.screenLowerY;
+ RenderAnimationDefinition.anInt384 = (-var13 + var14) * (Class38_Sub1.anInt2612 - var5) / var1 + var13;
+ } else {
+ TextureOperation36.aBoolean3094 = false;
+ anInt59 = 0;
+ }
+
+ Class58.method1194();
+ byte var19 = Class137.method1817() != 2 ?1:(byte) CSConfigCachefile.anInt1127;
+ if(HDToolKit.highDetail) {
+ HDToolKit.method1846();
+ HDToolKit.method1831(true);
+ HDToolKit.method1827(true);
+ if(Class143.gameStage == 10) {
+ var12 = BufferedDataStream.method809(Class106.anInt1446, Class77.anInt1111 >> 10, anInt3625, NPC.anInt3995 >> 10);
+ } else {
+ var12 = BufferedDataStream.method809(Class106.anInt1446, Class102.player.yOffsets2755[0] >> 3, anInt3625, Class102.player.xOffsets2767[0] >> 3);
+ }
+
+ Class68.method1269(Class44.anInt719, !WorldListEntry.aBoolean2623);
+ HDToolKit.clearScreen(var12);
+ ClientErrorException.method2285(Class139.anInt1823, Class77.anInt1111, Class7.anInt2162, NPC.anInt3995, TextureOperation28.anInt3315);
+ HDToolKit.anInt1791 = Class44.anInt719;
+ Class3_Sub22.method398(NPC.anInt3995, Class7.anInt2162, Class77.anInt1111, Class139.anInt1823, TextureOperation28.anInt3315, Class158.aByteArrayArrayArray2008, anIntArray686, Class129_Sub1.anIntArray2696, Class159.anIntArray2021, Player.anIntArray3959, SequenceDefinition.anIntArray1871, WorldListCountry.localPlane + 1, var19, Class102.player.xAxis >> 7, Class102.player.yAxis >> 7);
+ aBoolean47 = true;
+ Class68.method1265();
+ ClientErrorException.method2285(0, 0, 0, 0, 0);
+ Class58.method1194();
+ method1775();
+ Texture.method1405(var5, var4, var3, anInt1705, var1, anInt1705, -7397);
+ Class163_Sub2_Sub1.method2221(var4, var3, var1, anInt1705, anInt1705, var5);
+ } else {
+ Toolkit.JAVA_TOOLKIT.method934(var3, var5, var4, var1, 0);
+ Class3_Sub22.method398(NPC.anInt3995, Class7.anInt2162, Class77.anInt1111, Class139.anInt1823, TextureOperation28.anInt3315, Class158.aByteArrayArrayArray2008, anIntArray686, Class129_Sub1.anIntArray2696, Class159.anIntArray2021, Player.anIntArray3959, SequenceDefinition.anIntArray1871, WorldListCountry.localPlane - -1, var19, Class102.player.xAxis >> 7, Class102.player.yAxis >> 7);
+ Class58.method1194();
+ method1775();
+ Texture.method1405(var5, var4, var3, 256, var1, 256, -6403 + -994);
+ Class163_Sub2_Sub1.method2221(var4, var3, var1, 256, 256, var5);
+ }
+
+ ((Class102)Class51.anInterface2_838).method1610(Class106.anInt1446);
+ Class65.method1235(var4, var5, var1, var3);
+ Class139.anInt1823 = var9;
+ Class77.anInt1111 = var8;
+ Class7.anInt2162 = var7;
+ NPC.anInt3995 = var6;
+ TextureOperation28.anInt3315 = var10;
+ if(TextureOperation34.aBoolean3064 && Class58.aJs5Worker_917.countPriorityRequests() == 0) {
+ TextureOperation34.aBoolean3064 = false;
+ }
+
+ if(TextureOperation34.aBoolean3064) {
+ Toolkit.getActiveToolkit().method934(var3, var5, var4, var1, 0);
+ LoadingBox.draw(false, TextCore.LoadingPleaseWait2);
+ }
+
+ if(!var2 && !TextureOperation34.aBoolean3064 && !Class38_Sub1.aBoolean2615 && var3 <= NPCDefinition.anInt1297 && var4 + var3 > NPCDefinition.anInt1297 && Class38_Sub1.anInt2612 >= var5 && var1 + var5 > Class38_Sub1.anInt2612) {
+ TextureOperation36.method1628(var5, var4, var1, var3, Class38_Sub1.anInt2612, NPCDefinition.anInt1297);
+ }
+
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "ui.OA(" + -6403 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+ static boolean method609(RSInterface var0, int var1) {
+ if (null == var0.anIntArray275) {
+ return false;
+ } else {
+ int var2 = 0;
+ if (var1 <= 20) {
+ TextCore.COMMAND_MEMORY_MANAGEMENT = null;
+ }
+
+ for (; var0.anIntArray275.length > var2; ++var2) {
+ int var3 = Class164_Sub2.method2247((byte) 119, var2, var0);
+ int var4 = var0.anIntArray307[var2];
+ if (var0.anIntArray275[var2] != 2) {
+ if (var0.anIntArray275[var2] != 3) {
+ if (4 == var0.anIntArray275[var2]) {
+ if (var4 == var3) {
+ return false;
+ }
+ } else if (var3 != var4) {
+ return false;
+ }
+ } else if (var3 <= var4) {
+ return false;
+ }
+ } else if (var3 >= var4) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ }
+
+ public static RSInterface getRSInterface(int interfaceHash) {
+ try {
+ int windowId = interfaceHash >> 16;
+
+ int componentId = 65535 & interfaceHash;
+ if (GameObject.interfaces1834.length <= windowId || windowId < 0) {
+ return null;
+ }
+ if (GameObject.interfaces1834[windowId] == null || GameObject.interfaces1834[windowId].length <= componentId || null == GameObject.interfaces1834[windowId][componentId]) {
+ boolean var4 = loadInterface(windowId);
+ if (!var4) {
+ return null;
+ }
+ }
+ if (GameObject.interfaces1834[windowId].length <= componentId) {
+ return null;
+ }
+ return GameObject.interfaces1834[windowId][componentId];
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "af.F(" + interfaceHash + ')');
+ }
+ }
+
+ static void method551(int var1, int var2) {
+ try {
+ if(4 == var2 && !Class128.aBoolean1685) {
+ var2 = 2;
+ var1 = 2;
+ }
+
+ if(var2 == Class23.anInt453) {
+ if(0 != var2 && var1 != TextureOperation37.anInt3263) {
+ anShaderInterfaceArray70[var2].method23(var1);
+ TextureOperation37.anInt3263 = var1;
+ }
+ } else {
+ if(TextureOperation23.aBoolean3207) {
+ return;
+ }
+
+ if(Class23.anInt453 != 0) {
+ anShaderInterfaceArray70[Class23.anInt453].method21();
+ }
+
+ if(var2 != 0) {
+ ShaderInterface var3 = anShaderInterfaceArray70[var2];
+ var3.method22();
+ var3.method23(var1);
+ }
+
+ Class23.anInt453 = var2;
+ TextureOperation37.anInt3263 = var1;
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "cb.A(" + 0 + ',' + var1 + ',' + var2 + ')');
+ }
+ }
+
+ static void method2275(int var0, int var2, int var3, int var4, int var5, int var6) {
+ try {
+
+ int var8 = -var5 + var3;
+ MouseListeningClass.method2091(var3);
+ int var7 = 0;
+ if (var8 < 0) {
+ var8 = 0;
+ }
+
+ int var9 = var3;
+ int var10 = -var3;
+ int var12 = -var8;
+ int var11 = var8;
+ int var13 = -1;
+ int var17;
+ int var16;
+ int var19;
+ int var18;
+ if (var2 >= Class159.anInt2020 && Class57.anInt902 >= var2) {
+ int[] var15 = Class38.anIntArrayArray663[var2];
+ var16 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var3 + var6, Class101.anInt1425);
+ var17 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var3 + var6, Class101.anInt1425);
+ var18 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 + -var8, Class101.anInt1425);
+ var19 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - -var8, Class101.anInt1425);
+ TextureOperation18.method282(var15, var16, 102, var18, var4);
+ TextureOperation18.method282(var15, var18, -44, var19, var0);
+ TextureOperation18.method282(var15, var19, -61, var17, var4);
+ }
+
+ int var14 = -1;
+
+ while (var9 > var7) {
+ var13 += 2;
+ var14 += 2;
+ var12 += var14;
+ var10 += var13;
+ if (var12 >= 0 && var11 >= 1) {
+ --var11;
+ GameObject.anIntArray1838[var11] = var7;
+ var12 -= var11 << 1;
+ }
+
+ ++var7;
+ int var21;
+ int var20;
+ int[] var22;
+ int var24;
+ if (0 <= var10) {
+ --var9;
+ var10 -= var9 << 1;
+ var24 = var2 + -var9;
+ var16 = var2 + var9;
+ if (var16 >= Class159.anInt2020 && var24 <= Class57.anInt902) {
+ if (var8 <= var9) {
+ var17 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var7 + var6, Class101.anInt1425);
+ var18 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var7 + var6, Class101.anInt1425);
+ if (var16 <= Class57.anInt902) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var16], var18, -53, var17, var4);
+ }
+
+ if (var24 >= Class159.anInt2020) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var24], var18, 96, var17, var4);
+ }
+ } else {
+ var17 = GameObject.anIntArray1838[var9];
+ var18 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var7 + var6, Class101.anInt1425);
+ var19 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var7 + var6, Class101.anInt1425);
+ var20 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - -var17, Class101.anInt1425);
+ var21 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, -var17 + var6, Class101.anInt1425);
+ if (Class57.anInt902 >= var16) {
+ var22 = Class38.anIntArrayArray663[var16];
+ TextureOperation18.method282(var22, var19, 116, var21, var4);
+ TextureOperation18.method282(var22, var21, 125, var20, var0);
+ TextureOperation18.method282(var22, var20, 87, var18, var4);
+ }
+
+ if (Class159.anInt2020 <= var24) {
+ var22 = Class38.anIntArrayArray663[var24];
+ TextureOperation18.method282(var22, var19, 110, var21, var4);
+ TextureOperation18.method282(var22, var21, -114, var20, var0);
+ TextureOperation18.method282(var22, var20, -88, var18, var4);
+ }
+ }
+ }
+ }
+
+ var24 = -var7 + var2;
+ var16 = var2 - -var7;
+ if (var16 >= Class159.anInt2020 && var24 <= Class57.anInt902) {
+ var17 = var6 + var9;
+ var18 = var6 + -var9;
+ if (var17 >= Class101.anInt1425 && var18 <= Class3_Sub28_Sub18.anInt3765) {
+ var17 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var17, Class101.anInt1425);
+ var18 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var18, Class101.anInt1425);
+ if (var7 < var8) {
+ var19 = var11 >= var7 ? var11 : GameObject.anIntArray1838[var7];
+ var20 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var19 + var6, Class101.anInt1425);
+ var21 = Class40.method1040(Class3_Sub28_Sub18.anInt3765, var6 - var19, Class101.anInt1425);
+ if (Class57.anInt902 >= var16) {
+ var22 = Class38.anIntArrayArray663[var16];
+ TextureOperation18.method282(var22, var18, 126, var21, var4);
+ TextureOperation18.method282(var22, var21, 103, var20, var0);
+ TextureOperation18.method282(var22, var20, -61, var17, var4);
+ }
+
+ if (var24 >= Class159.anInt2020) {
+ var22 = Class38.anIntArrayArray663[var24];
+ TextureOperation18.method282(var22, var18, 102, var21, var4);
+ TextureOperation18.method282(var22, var21, -94, var20, var0);
+ TextureOperation18.method282(var22, var20, 99, var17, var4);
+ }
+ } else {
+ if (var16 <= Class57.anInt902) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var16], var18, 94, var17, var4);
+ }
+
+ if (var24 >= Class159.anInt2020) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var24], var18, 126, var17, var4);
+ }
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var23) {
+ throw ClientErrorException.clientError(var23, "wl.I(" + var0 + ',' + (byte) 109 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ',' + var6 + ')');
+ }
+ }
+
+ static void method2270(Entity var0) {
+ try {
+ if (Class44.anInt719 == var0.anInt2790 || var0.anInt2771 == -1 || var0.anInt2828 != 0 || SequenceDefinition.getAnimationDefinition(var0.anInt2771).duration[var0.anInt2832] < 1 + var0.anInt2760) {
+ int var2 = var0.anInt2790 + -var0.anInt2800;
+ int var3 = Class44.anInt719 + -var0.anInt2800;
+ int var4 = var0.anInt2784 * 128 + 64 * var0.getSize();
+ int var5 = var0.anInt2835 * 128 - -(var0.getSize() * 64);
+ int var6 = 128 * var0.anInt2823 + var0.getSize() * 64;
+ int var7 = 128 * var0.anInt2798 + var0.getSize() * 64;
+ var0.xAxis = (var3 * var6 + var4 * (var2 - var3)) / var2;
+ var0.yAxis = (var7 * var3 + var5 * (var2 - var3)) / var2;
+ }
+
+ var0.anInt2824 = 0;
+ if (var0.anInt2840 == 0) {
+ var0.anInt2806 = 1024;
+ }
+
+ if (1 == var0.anInt2840) {
+ var0.anInt2806 = 1536;
+ }
+
+ if (var0.anInt2840 == 2) {
+ var0.anInt2806 = 0;
+ }
+
+ if (var0.anInt2840 == 3) {
+ var0.anInt2806 = 512;
+ }
+
+ var0.anInt2785 = var0.anInt2806;
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "wl.K(" + (var0 != null ? "{...}" : "null") + ',' + (byte) -56 + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/VarpHelpers.java b/Client/src/main/java/org/runite/client/VarpHelpers.java
new file mode 100644
index 000000000..7369df795
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/VarpHelpers.java
@@ -0,0 +1,63 @@
+package org.runite.client;
+
+import org.rs09.CustomVars;
+import org.rs09.SystemLogger;
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.data.ReferenceCache;
+
+import java.util.Objects;
+
+public class VarpHelpers {
+
+ static ReferenceCache varbitLookup = new ReferenceCache(64);
+
+ static void setVarbit(byte var0, int valueToSet, int varbitID) {
+ try {
+ if (var0 >= -99) {
+ setVarbit((byte) 57, -14, 120);
+ }
+
+ CSConfigCachefile cacheFile = CSConfigCachefile.getCSConfigFileFromVarbitID(varbitID);
+ int parentVarp = Objects.requireNonNull(cacheFile).parentVarpIndex;
+ int upperBound = cacheFile.upperBound;
+ int lowerBound = cacheFile.lowerBound;
+ int varbitSize = upperBound - lowerBound;
+ SystemLogger.logInfo(parentVarp + " - bitStart: " + lowerBound + " bitEnd: " + upperBound + " bitSize = " + (varbitSize + 1));
+ int expectedMinimumValue = Class3_Sub6.expectedMinimumValues[varbitSize];
+ SystemLogger.logInfo("emv: " + expectedMinimumValue + " || vs: " + (127 + valueToSet));
+ if (valueToSet < 0|| expectedMinimumValue < valueToSet) {
+ SystemLogger.logInfo(expectedMinimumValue + " < " + valueToSet);
+ valueToSet = 0;
+ }
+
+ expectedMinimumValue <<= lowerBound;
+ int modifiedVarpValue = valueToSet << lowerBound & expectedMinimumValue | ~expectedMinimumValue & Class57.varpArray[parentVarp];
+ setVarp(modifiedVarpValue, parentVarp);
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "wd.K(" + var0 + ',' + valueToSet + ',' + varbitID + ')');
+ }
+ }
+
+ static void setVarp(int valueToSet, int varpIndex) {
+ try {
+ Class57.varpArray[varpIndex] = valueToSet;
+ if(GameConfig.VARP_DEBUG)
+ {
+ SystemLogger.logInfo("[VARP] Setting " + varpIndex + " to " + valueToSet);
+ }
+ if(CustomVars.parse(varpIndex,valueToSet)){
+ return;
+ }
+ Class3_Sub7 var3 = (Class3_Sub7) AtmosphereParser.aHashTable_3679.get(varpIndex);
+ if(null == var3) {
+ var3 = new Class3_Sub7(4611686018427387905L);
+ AtmosphereParser.aHashTable_3679.put(varpIndex, var3);
+ } else if (var3.aLong2295 != 4611686018427387905L) {
+ var3.aLong2295 = TimeUtils.time() + 500L | 4611686018427387904L;
+ }
+
+ } catch (RuntimeException var4) {
+ throw ClientErrorException.clientError(var4, "nh.W(" + (byte) 99 + ',' + valueToSet + ',' + varpIndex + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/WaterMovementShader.java b/Client/src/main/java/org/runite/client/WaterMovementShader.java
new file mode 100644
index 000000000..1a77f1c24
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WaterMovementShader.java
@@ -0,0 +1,161 @@
+package org.runite.client;
+
+
+
+
+import javax.media.opengl.GL;
+import java.nio.ByteBuffer;
+
+
+final class WaterMovementShader implements ShaderInterface {
+
+ private int anInt2177 = -1;
+ private static final float[] color = new float[]{0.1F, 0.1F, 0.15F, 0.1F};
+ private final float[] aFloatArray2179 = new float[4];
+ private int textureId = -1;
+ private int anInt2181 = -1;
+
+
+ private void method1699() {
+ byte[] var1 = new byte[]{(byte)0, (byte)-1};
+ GL var2 = HDToolKit.gl;
+ int[] var3 = new int[1];
+ var2.glGenTextures(1, var3, 0);
+ var2.glBindTexture(3552, var3[0]);
+ var2.glTexImage1D(3552, 0, 6406, 2, 0, 6406, 5121, ByteBuffer.wrap(var1));
+ var2.glTexParameteri(3552, 10241, 9729);
+ var2.glTexParameteri(3552, 10240, 9729);
+ var2.glTexParameteri(3552, 10242, '\u812f');
+ this.textureId = var3[0];
+ }
+
+ private void method1701() {
+ GL var1 = HDToolKit.gl;
+ this.anInt2177 = var1.glGenLists(2);
+ var1.glNewList(this.anInt2177, 4864);
+ var1.glTexEnvi(8960, '\u8590', 768);
+ var1.glTexEnvi(8960, '\u8581', '\u8576');
+ var1.glTexEnvf(8960, '\u8573', 2.0F);
+ var1.glTexEnvi(8960, '\u8589', '\u8576');
+ var1.glTexGeni(8192, 9472, 9217);
+ var1.glTexGeni(8193, 9472, 9217);
+ var1.glTexGenfv(8192, 9473, new float[]{9.765625E-4F, 0.0F, 0.0F, 0.0F}, 0);
+ var1.glTexGenfv(8193, 9473, new float[]{0.0F, 0.0F, 9.765625E-4F, 0.0F}, 0);
+ var1.glEnable(3168);
+ var1.glEnable(3169);
+ if(Class88.Texture3DEnabled) {
+ var1.glBindTexture('\u806f', Class88.anInt1228);
+ var1.glTexGeni(8194, 9472, 9217);
+ var1.glTexGeni(8195, 9472, 9217);
+ var1.glTexGenfv(8195, 9473, new float[]{0.0F, 0.0F, 0.0F, 1.0F}, 0);
+ var1.glEnable(3170);
+ var1.glEnable(3171);
+ var1.glEnable('\u806f');
+ }
+
+ var1.glActiveTexture('\u84c1');
+ var1.glEnable(3552);
+ var1.glBindTexture(3552, this.textureId);
+ var1.glTexEnvi(8960, '\u8571', '\u8575');
+ var1.glTexEnvi(8960, '\u8580', '\u8576');
+ var1.glTexEnvi(8960, '\u8582', 5890);
+ var1.glTexEnvi(8960, '\u8572', '\u8575');
+ var1.glTexEnvi(8960, '\u8588', '\u8576');
+ var1.glTexEnvi(8960, '\u858a', 5890);
+ var1.glEnable(3168);
+ var1.glTexGeni(8192, 9472, 9216);
+ var1.glPushMatrix();
+ var1.glLoadIdentity();
+ var1.glEndList();
+ var1.glNewList(this.anInt2177 + 1, 4864);
+ var1.glActiveTexture('\u84c1');
+ var1.glDisable(3552);
+ var1.glDisable(3168);
+ var1.glTexEnvi(8960, '\u8571', 8448);
+ var1.glTexEnvi(8960, '\u8580', 5890);
+ var1.glTexEnvi(8960, '\u8582', '\u8576');
+ var1.glTexEnvi(8960, '\u8572', 8448);
+ var1.glTexEnvi(8960, '\u8588', 5890);
+ var1.glTexEnvi(8960, '\u858a', '\u8576');
+ var1.glActiveTexture('\u84c0');
+ var1.glTexEnvi(8960, '\u8590', 768);
+ var1.glTexEnvi(8960, '\u8581', '\u8578');
+ var1.glTexEnvf(8960, '\u8573', 1.0F);
+ var1.glTexEnvi(8960, '\u8589', '\u8578');
+ var1.glDisable(3168);
+ var1.glDisable(3169);
+ if(Class88.Texture3DEnabled) {
+ var1.glDisable(3170);
+ var1.glDisable(3171);
+ var1.glDisable('\u806f');
+ }
+
+ var1.glEndList();
+ }
+
+ public final void method21() {
+ HDToolKit.gl.glCallList(this.anInt2177 + 1);
+ }
+
+ public final void method23(int var1) {
+ GL var2 = HDToolKit.gl;
+ var2.glActiveTexture('\u84c1');
+ var2.glTexEnvfv(8960, 8705, Unsorted.aFloatArray1934, 0);
+ var2.glActiveTexture('\u84c0');
+ if((var1 & 1) == 1) {
+ if(Class88.Texture3DEnabled) {
+ if(this.anInt2181 != HDToolKit.anInt1791) {
+ this.aFloatArray2179[0] = 0.0F;
+ this.aFloatArray2179[1] = 0.0F;
+ this.aFloatArray2179[2] = 0.0F;
+ this.aFloatArray2179[3] = (float)HDToolKit.anInt1791 * 0.0050F;//Water moving speed?
+ var2.glTexGenfv(8194, 9473, this.aFloatArray2179, 0);//R, OBJECT_PLANE
+ this.anInt2181 = HDToolKit.anInt1791;
+ }
+ } else {
+ HDToolKit.bindTexture2D(Class88.anIntArray1224[HDToolKit.anInt1791 * 64 / 100 % 64]);
+ }
+ } else if(Class88.Texture3DEnabled) {
+ this.aFloatArray2179[0] = 0.0F;
+ this.aFloatArray2179[1] = 0.0F;
+ this.aFloatArray2179[2] = 0.0F;
+ this.aFloatArray2179[3] = 0.0F;
+ var2.glTexGenfv(8194, 9473, this.aFloatArray2179, 0);
+ } else {
+ HDToolKit.bindTexture2D(Class88.anIntArray1224[0]);
+ }
+
+ }
+
+ public final void method22() {
+ GL var1 = HDToolKit.gl;
+ HDToolKit.method1856(2);
+ HDToolKit.method1847(2);
+ HDToolKit.method1823();
+ var1.glCallList(this.anInt2177);
+ float var2 = 2662.4001F;
+ var2 += (float)(GroundItem.anInt2938 - 128) * 0.5F;
+ if(var2 >= 3328.0F) {
+ var2 = 3327.0F;
+ }
+
+ this.aFloatArray2179[0] = 0.0F;
+ this.aFloatArray2179[1] = 0.0F;
+ this.aFloatArray2179[2] = 1.0F / (var2 - 3328.0F);
+ this.aFloatArray2179[3] = var2 / (var2 - 3328.0F);
+ var1.glTexGenfv(8192, 9474, this.aFloatArray2179, 0);//GL_ENABLE_BIT, GL_EYE_PLANE
+ var1.glPopMatrix();
+ var1.glActiveTexture('\u84c0');//GL_TEXTURE0
+ var1.glTexEnvfv(8960, 8705, color, 0);//GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR
+ }
+
+ public final int method24() {
+ return 15;
+ }
+
+ public WaterMovementShader() {
+ this.method1699();
+ this.method1701();
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/WaterShader.java b/Client/src/main/java/org/runite/client/WaterShader.java
new file mode 100644
index 000000000..6014f7c87
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WaterShader.java
@@ -0,0 +1,192 @@
+package org.runite.client;
+
+
+
+
+import javax.media.opengl.GL;
+import java.nio.ByteBuffer;
+
+
+final class WaterShader implements ShaderInterface {
+
+ static int anInt3285 = 128;
+ private final float[] aFloatArray2190 = new float[4];
+ private static boolean aBoolean2191 = false;
+ private int anInt2192 = -1;
+ private int anInt2193 = -1;
+
+
+ public WaterShader() {
+ if(HDToolKit.maxTextureUnits >= 2) {
+ int[] textures = new int[1];
+ byte[] pixels = new byte[8];
+ int pixelsPos = 0;
+ while (pixelsPos < 8) {
+ pixels[pixelsPos] = (byte) (96 + ++pixelsPos * 159 / 8);
+ }
+// for(int var3 = 0; var3 < 8; pixels[var3++] = (byte)(96 + var3 * 159 / 8)) {
+// }
+ GL var4 = HDToolKit.gl;
+ var4.glGenTextures(1, textures, 0);
+ var4.glBindTexture(3552, textures[0]);//TEXTURE_1D
+ // TEXTURE_1D, level0, ALPHA, width8, border0, ALPHA, UNSIGNED_BYTE, pixels.
+ var4.glTexImage1D(3552, 0, 6406, 8, 0, 6406, 5121, ByteBuffer.wrap(pixels));
+ var4.glTexParameteri(3552, 10241, 9729);//TEXTURE_1D, TEXTURE_MIN_FILTER, LINEAR
+ var4.glTexParameteri(3552, 10240, 9729);//TEXTURE_1D, TEXTURE_MAG_FILTER, LINEAR
+ var4.glTexParameteri(3552, 10242, '\u812f');//TEXTURE_1D, TEXTURE_WRAP_S, CLAMP_TO_EDGE
+ this.anInt2192 = textures[0];
+ aBoolean2191 = HDToolKit.maxTextureUnits > 2 && HDToolKit.allows3DTextureMapping;
+ this.method2251();
+ }
+
+ }
+
+
+ private void method2251() {
+ GL var1 = HDToolKit.gl;
+ this.anInt2193 = var1.glGenLists(2);
+ var1.glNewList(this.anInt2193, 4864);
+ var1.glActiveTexture('\u84c1');
+ if(aBoolean2191) {
+ var1.glBindTexture('\u806f', Class88.anInt1228);
+ var1.glTexEnvi(8960, '\u8571', 260);
+ var1.glTexEnvi(8960, '\u8590', 768);
+ var1.glTexEnvi(8960, '\u8572', 7681);
+ var1.glTexEnvi(8960, '\u8588', '\u8578');
+ var1.glTexGeni(8192, 9472, 9216);
+ var1.glTexGeni(8194, 9472, 9216);
+ var1.glTexGeni(8193, 9472, 9216);
+ var1.glTexGeni(8195, 9472, 9217);
+ var1.glTexGenfv(8195, 9473, new float[]{0.0F, 0.0F, 0.0F, 1.0F}, 0);
+ var1.glEnable(3168);
+ var1.glEnable(3169);
+ var1.glEnable(3170);
+ var1.glEnable(3171);
+ var1.glEnable('\u806f');
+ var1.glActiveTexture('\u84c2');
+ var1.glTexEnvi(8960, 8704, '\u8570');
+ }
+
+ var1.glBindTexture(3552, this.anInt2192);
+ var1.glTexEnvi(8960, '\u8571', '\u8575');
+ var1.glTexEnvi(8960, '\u8580', '\u8576');
+ var1.glTexEnvi(8960, '\u8582', 5890);
+ var1.glTexEnvi(8960, '\u8572', 7681);
+ var1.glTexEnvi(8960, '\u8588', '\u8578');
+ var1.glTexGeni(8192, 9472, 9216);
+ var1.glEnable(3552);
+ var1.glEnable(3168);
+ var1.glActiveTexture('\u84c0');
+ var1.glEndList();
+ var1.glNewList(this.anInt2193 + 1, 4864);
+ var1.glActiveTexture('\u84c1');
+ if(aBoolean2191) {
+ var1.glTexEnvi(8960, '\u8571', 8448);
+ var1.glTexEnvi(8960, '\u8590', 768);
+ var1.glTexEnvi(8960, '\u8572', 8448);
+ var1.glTexEnvi(8960, '\u8588', 5890);
+ var1.glDisable(3168);
+ var1.glDisable(3169);
+ var1.glDisable(3170);
+ var1.glDisable(3171);
+ var1.glDisable('\u806f');
+ var1.glActiveTexture('\u84c2');
+ var1.glTexEnvi(8960, 8704, 8448);
+ }
+
+ var1.glTexEnvfv(8960, 8705, new float[]{0.0F, 1.0F, 0.0F, 1.0F}, 0);
+ var1.glTexEnvi(8960, '\u8571', 8448);
+ var1.glTexEnvi(8960, '\u8580', 5890);
+ var1.glTexEnvi(8960, '\u8582', '\u8576');
+ var1.glTexEnvi(8960, '\u8572', 8448);
+ var1.glTexEnvi(8960, '\u8588', 5890);
+ var1.glDisable(3552);
+ var1.glDisable(3168);
+ var1.glActiveTexture('\u84c0');
+ var1.glEndList();
+ }
+
+ static int method2252() {
+ return aBoolean2191?'\u84c2':'\u84c1';
+ }
+
+ static void method2253() {
+ GL var0 = HDToolKit.gl;
+ var0.glClientActiveTexture(method2252());
+ var0.glDisableClientState('\u8078');
+ var0.glClientActiveTexture('\u84c0');
+ }
+
+ public final void method22() {
+ GL var1 = HDToolKit.gl;
+ var1.glCallList(this.anInt2193);
+ }
+
+ static void method2254() {
+ GL var0 = HDToolKit.gl;
+ var0.glClientActiveTexture(method2252());
+ var0.glEnableClientState('\u8078');
+ var0.glClientActiveTexture('\u84c0');
+ }
+
+ public final int method24() {
+ return 0;
+ }
+
+ public final void method21() {
+ GL var1 = HDToolKit.gl;
+ var1.glCallList(this.anInt2193 + 1);
+ }
+
+ public final void method23(int var1) {
+ GL var2 = HDToolKit.gl;
+ var2.glActiveTexture('\u84c1');
+ if(!aBoolean2191 && var1 < 0) {
+ var2.glDisable(3168);
+ } else {
+ var2.glPushMatrix();
+ var2.glLoadIdentity();
+ var2.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ var2.glRotatef((float)GroundItem.anInt2938 * 360.0F / 2048.0F, 1.0F, 0.0F, 0.0F);
+ var2.glRotatef((float) TextureOperation9.anInt3103 * 360.0F / 2048.0F, 0.0F, 1.0F, 0.0F);
+ var2.glTranslatef((float)(-Unsorted.anInt144), (float)(-Unsorted.anInt3695), (float)(-LinkableRSString.anInt2587));
+ if(aBoolean2191) {
+ this.aFloatArray2190[0] = 0.0010F;
+ this.aFloatArray2190[1] = 9.0E-4F;
+ this.aFloatArray2190[2] = 0.0F;
+ this.aFloatArray2190[3] = 0.0F;
+ var2.glTexGenfv(8192, 9474, this.aFloatArray2190, 0);
+ this.aFloatArray2190[0] = 0.0F;
+ this.aFloatArray2190[1] = 9.0E-4F;
+ this.aFloatArray2190[2] = 0.0010F;
+ this.aFloatArray2190[3] = 0.0F;
+ var2.glTexGenfv(8193, 9474, this.aFloatArray2190, 0);
+ this.aFloatArray2190[0] = 0.0F;
+ this.aFloatArray2190[1] = 0.0F;
+ this.aFloatArray2190[2] = 0.0F;
+ this.aFloatArray2190[3] = (float)HDToolKit.anInt1791 * 0.0050F;
+ var2.glTexGenfv(8194, 9474, this.aFloatArray2190, 0);
+ var2.glActiveTexture('\u84c2');
+ }
+
+ var2.glTexEnvfv(8960, 8705, Class72.method1297(), 0);
+ if(var1 >= 0) {
+ this.aFloatArray2190[0] = 0.0F;
+ this.aFloatArray2190[1] = 1.0F / (float) anInt3285;
+ this.aFloatArray2190[2] = 0.0F;
+ this.aFloatArray2190[3] = 1.0F * (float)var1 / (float) anInt3285;
+ var2.glTexGenfv(8192, 9474, this.aFloatArray2190, 0);
+ var2.glEnable(3168);
+ } else {
+ var2.glDisable(3168);
+ }
+
+ var2.glPopMatrix();
+ }
+
+ var2.glActiveTexture('\u84c0');
+ }
+
+
+
+}
diff --git a/Client/src/main/java/org/runite/client/WaterfallShader.java b/Client/src/main/java/org/runite/client/WaterfallShader.java
new file mode 100644
index 000000000..32591a2ca
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WaterfallShader.java
@@ -0,0 +1,234 @@
+package org.runite.client;
+
+
+import org.rs09.client.config.GameConfig;
+
+
+import javax.media.opengl.GL;
+import java.util.Objects;
+
+final class WaterfallShader implements ShaderInterface {
+
+ static boolean[] aBooleanArray2169 = new boolean[5];
+ static CacheIndex spritesIndex_probably_2172;
+ static int waterfallTextureId = -1;
+ static RSString aString_8 = RSString.parse("");
+ private int listId;
+ private final float[] aFloatArray2174 = new float[4];
+ private static RSString aString_2175 = RSString.parse(")4a=");
+
+
+ static void method1626(byte var0) {
+ try {
+ QuickChatDefinition.aReferenceCache_3572.clear();
+ Class143.aReferenceCache_1874.clear();
+ if(var0 <= -124) {
+ Class67.aReferenceCache_1013.clear();
+ }
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.F(" + var0 + ')');
+ }
+ }
+
+ static boolean method1627(int var0, byte var1) {
+ try {
+ WorldListEntry var2 = Class3_Sub8.getWorld(97, var0);
+ if(var2 == null) {
+ return false;
+ } else if (Signlink.anInt1214 != 1 && Signlink.anInt1214 != 2 && Class44.paramModeWhere != 2) {
+ RSString var9 = aString_8;
+ if (Class44.paramModeWhere != 0) {
+ var9 = RSString.stringCombiner(new RSString[]{TextCore.aString_4007, RSString.stringAnimator(var2.worldId - -7000)});
+ }
+
+ if (var1 > -2) {
+ return false;
+ } else {
+ RSString var4 = aString_8;
+ if (Class163_Sub2.paramSettings != null) {
+ var4 = RSString.stringCombiner(new RSString[]{Class97.aString_1380, Class163_Sub2.paramSettings});
+ }
+ RSString var5 = RSString.stringCombiner(new RSString[]{RSString.parse("http:)4)4"), var2.address, var9, TextCore.aString_2608, RSString.stringAnimator(Class3_Sub20.paramLanguage), aString_2175, RSString.stringAnimator(Class3_Sub26.paramAffid), var4, TextCore.aString_1133, !Unsorted.paramJavaScriptEnabled ? TextCore.aString_3013 : TextCore.aString_339, TextCore.aString_2610, !Class163_Sub2_Sub1.paramObjectTagEnabled ? TextCore.aString_3013 : TextCore.aString_339, TextCore.aString_1617, Client.paramAdvertisementSuppressed ? TextCore.aString_339 : TextCore.aString_3013});
+
+ try {
+ Objects.requireNonNull(Client.clientInstance.getAppletContext()).showDocument(var5.toURL(), "_self");
+ } catch (Exception var7) {
+ return false;
+ }
+
+ return true;
+ }
+ } else {
+ GameConfig.IP_ADDRESS = var2.address.toString();
+ System.out.println(GameConfig.IP_ADDRESS);
+// GameLaunch.SETTINGS.setIp(var2.address.toString());
+ var2.address.method1568();
+ Class38_Sub1.accRegistryIp = GameConfig.IP_MANAGEMENT;
+ CS2Script.userCurrentWorldID = var2.worldId;
+ if (Class44.paramModeWhere != 0) {
+ Class162.anInt2036 = '\u9c40' + CS2Script.userCurrentWorldID;
+ Class140_Sub6.accRegistryPort = Class162.anInt2036;
+ Client.currentPort = CS2Script.userCurrentWorldID + '\uc350';
+ }
+
+ return true;
+ }
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ob.E(" + var0 + ',' + var1 + ')');
+ }
+ }
+
+ public final int method24() {
+ try {
+ return 0;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.C()");
+ }
+ }
+
+ public final void method23(int var1) {
+ try {
+ GL var2 = HDToolKit.gl;
+ float var4 = (float)(1 + (var1 >> 3 & 3)) * 0.01F;
+ float var3 = -0.01F * (float)(1 + (var1 & 3));
+ float var5 = 0 == (var1 & 64)?4.8828125E-4F:9.765625E-4F;
+ boolean var6 = (128 & var1) != 0;
+ if(var6) {
+ this.aFloatArray2174[0] = var5;
+ this.aFloatArray2174[1] = 0.0F;
+ this.aFloatArray2174[2] = 0.0F;
+ this.aFloatArray2174[3] = 0.0F;
+ } else {
+ this.aFloatArray2174[2] = var5;
+ this.aFloatArray2174[1] = 0.0F;
+ this.aFloatArray2174[3] = 0.0F;
+ this.aFloatArray2174[0] = 0.0F;
+ }
+
+ var2.glActiveTexture('\u84c1');
+ var2.glMatrixMode(5888);
+ var2.glPushMatrix();
+ var2.glLoadIdentity();
+ var2.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
+ var2.glRotatef((float)GroundItem.anInt2938 * 360.0F / 2048.0F, 1.0F, 0.0F, 0.0F);
+ var2.glRotatef(360.0F * (float) TextureOperation9.anInt3103 / 2048.0F, 0.0F, 1.0F, 0.0F);
+ var2.glTranslatef((float)(-Unsorted.anInt144), (float)(-Unsorted.anInt3695), (float)(-LinkableRSString.anInt2587));
+ var2.glTexGenfv(8192, 9474, this.aFloatArray2174, 0);
+ this.aFloatArray2174[3] = var3 * (float)HDToolKit.anInt1791;
+ this.aFloatArray2174[0] = 0.0F;
+ this.aFloatArray2174[2] = 0.0F;
+ this.aFloatArray2174[1] = var5;
+ var2.glTexGenfv(8193, 9474, this.aFloatArray2174, 0);
+ var2.glPopMatrix();
+ if(Class88.Texture3DEnabled) {
+ this.aFloatArray2174[3] = (float)HDToolKit.anInt1791 * var4;
+ this.aFloatArray2174[1] = 0.0F;
+ this.aFloatArray2174[0] = 0.0F;
+ this.aFloatArray2174[2] = 0.0F;
+ var2.glTexGenfv(8194, 9473, this.aFloatArray2174, 0);
+ } else {
+ int var7 = (int)((float)HDToolKit.anInt1791 * var4 * 64.0F);
+ var2.glBindTexture(3553, Class88.anIntArray1223[var7 % 64]);
+ }
+
+ var2.glActiveTexture('\u84c0');
+ } catch (RuntimeException var8) {
+ throw ClientErrorException.clientError(var8, "ob.B(" + var1 + ')');
+ }
+ }
+
+ public final void method21() {
+ try {
+ GL var1 = HDToolKit.gl;
+ var1.glCallList(1 + this.listId);
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.A()");
+ }
+ }
+
+ public final void method22() {
+ try {
+ GL var1 = HDToolKit.gl;
+ var1.glCallList(this.listId);
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.D()");
+ }
+ }
+
+ public static void method1630(byte var0) {
+ try {
+ TextCore.aString_2171 = null;
+ spritesIndex_probably_2172 = null;
+ aBooleanArray2169 = null;
+ if(var0 > -112) {
+ method1632(-116, 108, 54, -120, 44, 6);
+ }
+ aString_2175 = null;
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.J(" + var0 + ')');
+ }
+ }
+
+ private void method1631() {
+ try {
+ GL var2 = HDToolKit.gl;
+ this.listId = var2.glGenLists(2);
+ var2.glNewList(this.listId, 4864);//COMPILE
+ var2.glActiveTexture('\u84c1');//TEXTURE1
+ if(Class88.Texture3DEnabled) {
+ var2.glBindTexture('\u806f', waterfallTextureId);//TEXTURE_3D
+ var2.glTexGeni(8194, 9472, 9217);//R, TEXTURE_GEN_MODE, OBJECT_LINEAR
+ var2.glEnable(3170);//TEXTURE_GEN_R
+ var2.glEnable('\u806f');//TEXTURE_3D
+ } else {
+ var2.glEnable(3553);//TEXTURE_2D
+ }
+
+ var2.glTexGeni(8192, 9472, 9216);//S, TEXTURE_GEN_MODE, EYE_LINEAR
+ var2.glTexGeni(8193, 9472, 9216);//T, TEXTURE_GEN_MODE, EYE_LINEAR
+ var2.glEnable(3168);//TEXTURE_GEN_S
+ var2.glEnable(3169);//TEXTURE_GEN_T
+ var2.glActiveTexture('\u84c0');//TEXTURE1
+ var2.glEndList();
+ var2.glNewList(this.listId + 1, 4864);//COMPILE
+ var2.glActiveTexture('\u84c1');//TEXTURE1
+ if(Class88.Texture3DEnabled) {
+ var2.glDisable('\u806f');//TEXTURE_3D
+ var2.glDisable(3170);//TEXTURE_GEN_R
+ } else {
+ var2.glDisable(3553);//TEXTURE_2D
+ }
+
+ var2.glDisable(3168);//TEXTURE_GEN_S
+ var2.glDisable(3169);//TEXTURE_GEN_T
+ var2.glActiveTexture('\u84c0');//TEXTURE0
+ var2.glEndList();
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ob.I(" + 2 + ')');
+ }
+ }
+
+ public WaterfallShader() {
+ try {
+ this.method1631();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ob.()");
+ }
+ }
+
+ static void method1632(int var0, int var1, int var2, int var3, int var4, int var5) {
+ try {
+ if(var0 <= 66) {
+ method1630((byte)-33);
+ }
+
+ for(int var6 = var3; var6 <= var1; ++var6) {
+ TextureOperation18.method282(Class38.anIntArrayArray663[var6], var4, 121, var2, var5);
+ }
+
+ } catch (RuntimeException var7) {
+ throw ClientErrorException.clientError(var7, "ob.G(" + var0 + ',' + var1 + ',' + var2 + ',' + var3 + ',' + var4 + ',' + var5 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/WorldListCountry.java b/Client/src/main/java/org/runite/client/WorldListCountry.java
new file mode 100644
index 000000000..669d31d9b
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldListCountry.java
@@ -0,0 +1,8 @@
+package org.runite.client;
+
+public final class WorldListCountry {
+
+ public static int localPlane;
+ int flagId;
+ RSString name;
+}
diff --git a/Client/src/main/java/org/runite/client/WorldListEntry.java b/Client/src/main/java/org/runite/client/WorldListEntry.java
new file mode 100644
index 000000000..8d6e445f8
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldListEntry.java
@@ -0,0 +1,226 @@
+package org.runite.client;
+
+import org.rs09.SystemLogger;
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.rendering.Toolkit;
+
+import java.util.Objects;
+
+public final class WorldListEntry extends Class44 {
+
+ public static int anInt2937;
+ public static WorldListEntry[] worldList;
+ public static int activeWorldListSize;
+ public static int updateStamp;
+ static WorldListCountry[] countries;
+ static AbstractSprite aAbstractSprite_3099;
+ static int anInt3351;
+ static AbstractSprite aAbstractSprite_1339;
+ static AbstractSprite aAbstractSprite_1457;
+ static int anInt1400;
+ static int anInt739;
+ static int anInt1126;
+ static int archiveID;
+ static int worldListArraySize;
+ public RSString activity;
+ public int worldId;
+ static boolean aBoolean2623 = true;
+ public RSString address;
+ static int anInt2626 = 20;
+ static AudioChannel aAudioChannel_2627;
+
+
+ static void method1076() {
+ try {
+ Class154.aReferenceCache_1964.clear();
+ } catch (RuntimeException var2) {
+ throw ClientErrorException.clientError(var2, "ba.C(" + 88 + ')');
+ }
+ }
+
+ static void parseWorldList(DataBuffer buffer) {
+ try {
+ int var2 = buffer.getSmart();
+ countries = new WorldListCountry[var2];
+
+ int var3;
+ for (var3 = 0; var3 < var2; ++var3) {
+ countries[var3] = new WorldListCountry();
+ countries[var3].flagId = buffer.getSmart();
+ countries[var3].name = buffer.getGJString2(105);
+ }
+
+ Class53.worldListOffset = buffer.getSmart();
+ worldListArraySize = buffer.getSmart();
+ activeWorldListSize = buffer.getSmart();
+ worldList = new WorldListEntry[-Class53.worldListOffset + worldListArraySize + 1];
+
+ for (var3 = 0; var3 < activeWorldListSize; ++var3) {
+ int worldId = buffer.getSmart();
+ WorldListEntry var5 = worldList[worldId] = new WorldListEntry();
+ var5.countryIndex = buffer.readUnsignedByte();
+ var5.settings = buffer.readInt();
+ var5.worldId = worldId - -Class53.worldListOffset;
+ var5.activity = buffer.getGJString2(98);
+ var5.address = buffer.getGJString2(79);
+ GameConfig.WORLD = worldId;
+// GameLaunch.SETTINGS.setWorld(worldId);
+ SystemLogger.logInfo("Registering to world: " + GameConfig.WORLD);
+ }
+ updateStamp = buffer.readInt();
+ Class30.loadedWorldList = true;
+ } catch (RuntimeException var6) {
+ throw ClientErrorException.clientError(var6, "hi.B(" + (buffer != null ? "{...}" : "null") + ',' + -88 + ')');
+ }
+ }
+
+ static void buildWorldListInterface() {
+ try {
+ int var1 = Class21.anInt1462;
+ int var2 = Class21.anInt3395;
+ int var4 = Class21.anInt3537;
+ int var3 = Class21.anInt3552;
+ if (aAbstractSprite_3099 == null || null == aAbstractSprite_1457) {
+ if (CacheIndex.spritesIndex.retrieveSpriteFile(archiveID) && CacheIndex.spritesIndex.retrieveSpriteFile(anInt1400)) {
+ aAbstractSprite_3099 = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, archiveID);
+ aAbstractSprite_1457 = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, anInt1400);
+ if (HDToolKit.highDetail) {
+ if (aAbstractSprite_3099 instanceof Class3_Sub28_Sub16_Sub2_Sub1) {
+ aAbstractSprite_3099 = new Class3_Sub28_Sub16_Sub1_Sub1((SoftwareSprite) aAbstractSprite_3099);
+ } else {
+ aAbstractSprite_3099 = new HDSprite((SoftwareSprite) aAbstractSprite_3099);
+ }
+
+ if (aAbstractSprite_1457 instanceof Class3_Sub28_Sub16_Sub2_Sub1) {
+ aAbstractSprite_1457 = new Class3_Sub28_Sub16_Sub1_Sub1((SoftwareSprite) aAbstractSprite_1457);
+ } else {
+ aAbstractSprite_1457 = new HDSprite((SoftwareSprite) aAbstractSprite_1457);
+ }
+ }
+ } else {
+ Toolkit.getActiveToolkit().fillRect(var1, var2, var3, 20, InterfaceWidget.anInt3600, -Unsorted.anInt963 + 256);
+ }
+ }
+
+ int var5;
+ int var6;
+ if (aAbstractSprite_3099 != null && aAbstractSprite_1457 != null) {
+ var5 = var3 / aAbstractSprite_3099.width;
+
+ for (var6 = 0; var6 < var5; ++var6) {
+ aAbstractSprite_3099.drawAt(var6 * aAbstractSprite_3099.width + var1, var2);
+ }
+
+ aAbstractSprite_1457.drawAt(var1, var2);
+ aAbstractSprite_1457.method641(-aAbstractSprite_1457.width + (var1 - -var3), var2);
+ }
+
+ FontType.bold.method681(RSString.parse(GameConfig.RCM_TITLE), var1 - -3, 14 + var2, anInt3351, -1);
+ Toolkit.getActiveToolkit().fillRect(var1, 20 + var2, var3, var4 - 20, InterfaceWidget.anInt3600, -Unsorted.anInt963 + 256);
+
+ var6 = Unsorted.anInt1709;
+ var5 = Class126.anInt1676;
+ int var7;
+ int var8;
+ for (var7 = 0; Unsorted.menuOptionCount > var7; ++var7) {
+ var8 = (-var7 + Unsorted.menuOptionCount - 1) * 15 + var2 + 35;
+ if (var1 < var5 && var5 < var1 - -var3 && -13 + var8 < var6 && var8 + 3 > var6) {
+ Toolkit.getActiveToolkit().fillRect(var1, var8 - 13, var3, 16, MouseListeningClass.anInt1926, -Class136.anInt1771 + 256);
+ }
+ }
+
+ if ((aAbstractSprite_1339 == null || Class50.aAbstractSprite_824 == null || null == Class3_Sub26.aAbstractSprite_2560) && CacheIndex.spritesIndex.retrieveSpriteFile(anInt739) && CacheIndex.spritesIndex.retrieveSpriteFile(anInt1126) && CacheIndex.spritesIndex.retrieveSpriteFile(anInt2937)) {
+ aAbstractSprite_1339 = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, anInt739);
+ Class50.aAbstractSprite_824 = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, anInt1126);
+ Class3_Sub26.aAbstractSprite_2560 = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, anInt2937);
+ if (HDToolKit.highDetail) {
+ if (aAbstractSprite_1339 instanceof Class3_Sub28_Sub16_Sub2_Sub1) {
+ aAbstractSprite_1339 = new Class3_Sub28_Sub16_Sub1_Sub1((SoftwareSprite) aAbstractSprite_1339);
+ } else {
+ aAbstractSprite_1339 = new HDSprite((SoftwareSprite) aAbstractSprite_1339);
+ }
+
+ if (Class50.aAbstractSprite_824 instanceof Class3_Sub28_Sub16_Sub2_Sub1) {
+ Class50.aAbstractSprite_824 = new Class3_Sub28_Sub16_Sub1_Sub1((SoftwareSprite) Class50.aAbstractSprite_824);
+ } else {
+ Class50.aAbstractSprite_824 = new HDSprite((SoftwareSprite) Class50.aAbstractSprite_824);
+ }
+
+ if (Class3_Sub26.aAbstractSprite_2560 instanceof Class3_Sub28_Sub16_Sub2_Sub1) {
+ Class3_Sub26.aAbstractSprite_2560 = new Class3_Sub28_Sub16_Sub1_Sub1((SoftwareSprite) Class3_Sub26.aAbstractSprite_2560);
+ } else {
+ Class3_Sub26.aAbstractSprite_2560 = new HDSprite((SoftwareSprite) Class3_Sub26.aAbstractSprite_2560);
+ }
+ }
+ }
+
+ int var9;
+ if (aAbstractSprite_1339 != null && null != Class50.aAbstractSprite_824 && null != Class3_Sub26.aAbstractSprite_2560) {
+ var7 = var3 / aAbstractSprite_1339.width;
+
+ for (var8 = 0; var7 > var8; ++var8) {
+ aAbstractSprite_1339.drawAt(var1 + aAbstractSprite_1339.width * var8, var4 + var2 + -aAbstractSprite_1339.height);
+ }
+
+ var8 = (-20 + var4) / Class50.aAbstractSprite_824.height;
+
+ for (var9 = 0; var9 < var8; ++var9) {
+ Class50.aAbstractSprite_824.drawAt(var1, var2 + 20 + var9 * Class50.aAbstractSprite_824.height);
+ Class50.aAbstractSprite_824.method641(var1 - (-var3 - -Class50.aAbstractSprite_824.width), var2 + 20 + var9 * Class50.aAbstractSprite_824.height);
+ }
+
+ Class3_Sub26.aAbstractSprite_2560.drawAt(var1, var4 + (var2 - Class3_Sub26.aAbstractSprite_2560.height));
+ Class3_Sub26.aAbstractSprite_2560.method641(var1 + var3 - Class3_Sub26.aAbstractSprite_2560.width, var2 - -var4 + -Class3_Sub26.aAbstractSprite_2560.height);
+ }
+
+ for (var7 = 0; var7 < Unsorted.menuOptionCount; ++var7) {
+ var8 = 15 * (Unsorted.menuOptionCount - 1 + -var7) + var2 + 35;
+ var9 = anInt3351;
+ if (var1 < var5 && var3 + var1 > var5 && var6 > var8 - 13 && var8 - -3 > var6) {
+ var9 = Class154.anInt1957;
+ }
+
+ FontType.bold.method681(Unsorted.method802(var7), 3 + var1, var8, var9, 0);
+ }
+
+ Unsorted.method1282(Class21.anInt1462, Class21.anInt3395, Class21.anInt3537, Class21.anInt3552);
+ } catch (RuntimeException var10) {
+ throw ClientErrorException.clientError(var10, "ij.F(" + ')');
+ }
+ }
+
+ final WorldListCountry method1078(int var1) {
+ try {
+ return countries[this.countryIndex];
+ } catch (RuntimeException var3) {
+ throw ClientErrorException.clientError(var3, "ba.B(" + var1 + ')');
+ }
+ }
+
+ static int method1079(int var0) {
+ try {
+ if (0 > var0) {
+ return 0;
+ } else {
+ Class3_Sub25 var2 = (Class3_Sub25) TileData.aHashTable_2220.get(var0);
+ if (var2 == null) {
+ return Objects.requireNonNull(ConfigInventoryDefinition.retrieveConfigurationInventoryFile(var0)).size;
+ } else {
+ int var3 = 0;
+
+ for (int var4 = 0; var4 < var2.anIntArray2547.length; ++var4) {
+ if (var2.anIntArray2547[var4] == -1) {
+ ++var3;
+ }
+ }
+
+ var3 += Objects.requireNonNull(ConfigInventoryDefinition.retrieveConfigurationInventoryFile(var0)).size + -var2.anIntArray2547.length;
+ return var3;
+ }
+ }
+ } catch (RuntimeException var5) {
+ throw ClientErrorException.clientError(var5, "ba.D(" + var0 + ',' + (byte) -80 + ')');
+ }
+ }
+
+}
diff --git a/Client/src/main/java/org/runite/client/WorldMapLOCDecoder.java b/Client/src/main/java/org/runite/client/WorldMapLOCDecoder.java
new file mode 100644
index 000000000..5fa221e66
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldMapLOCDecoder.java
@@ -0,0 +1,119 @@
+package org.runite.client;
+
+public final class WorldMapLOCDecoder {
+
+ static void decode(DataBuffer var1) {
+ try {
+ label134:
+ while (true) {
+ if (var1.index < var1.buffer.length) {
+ boolean var18 = false;
+ int var5 = 0;
+ int var6 = 0;
+ if (var1.readUnsignedByte() == 1) {
+ var5 = var1.readUnsignedByte();
+ var18 = true;
+ var6 = var1.readUnsignedByte();
+ }
+
+ int var7 = var1.readUnsignedByte();
+ int var8 = var1.readUnsignedByte();
+ int var9 = -TextureOperation37.anInt3256 + 64 * var7;
+ int var10 = -(var8 * 64) - (-Unsorted.anInt65 - -1) + Class108.anInt1460;
+ int var11;
+ int var12;
+ if (var9 >= 0 && -63 + var10 >= 0 && Class23.anInt455 > var9 + 63 && var10 < Class108.anInt1460) {
+ var11 = var9 >> 6;
+ var12 = var10 >> 6;
+ int var13 = 0;
+
+ while (true) {
+ if (var13 >= 64) {
+ continue label134;
+ }
+
+ for (int var14 = 0; var14 < 64; ++var14) {
+ if (!var18 || var13 >= 8 * var5 && 8 * var5 - -8 > var13 && 8 * var6 <= var14 && var14 < var6 * 8 - -8) {
+ int var15 = var1.readUnsignedByte();
+ if (0 != var15) {
+ int var2;
+ if (1 == (1 & var15)) {
+ var2 = var1.readUnsignedByte();
+ if (Class36.aByteArrayArrayArray640[var11][var12] == null) {
+ Class36.aByteArrayArrayArray640[var11][var12] = new byte[4096];
+ }
+
+ Class36.aByteArrayArrayArray640[var11][var12][var13 + (-var14 + 63 << 6)] = (byte) var2;
+ }
+
+ if (2 == (var15 & 2)) {
+ var2 = var1.readMedium();
+ if (null == Class29.anIntArrayArrayArray558[var11][var12]) {
+ Class29.anIntArrayArrayArray558[var11][var12] = new int[4096];
+ }
+
+ Class29.anIntArrayArrayArray558[var11][var12][(-var14 + 63 << 6) + var13] = var2;
+ }
+
+ if (4 == (var15 & 4)) {
+ var2 = var1.readMedium();
+ if (null == Class44.anIntArrayArrayArray720[var11][var12]) {
+ Class44.anIntArrayArrayArray720[var11][var12] = new int[4096];
+ }
+
+ --var2;
+ ObjectDefinition var3 = ObjectDefinition.getObjectDefinition(var2);
+ if (null != var3.ChildrenIds) {
+ var3 = var3.method1685(0);
+ if (var3 == null || var3.MapIcon == -1) {
+ continue;
+ }
+ }
+
+ Class44.anIntArrayArrayArray720[var11][var12][(-var14 + 63 << 6) + var13] = 1 + var3.objectId;
+ Class3_Sub23 var16 = new Class3_Sub23();
+ var16.anInt2532 = var3.MapIcon;
+ var16.anInt2531 = var9;
+ var16.anInt2539 = var10;
+ Class84.aLinkedList_1162.pushBack(var16);
+ }
+ }
+ }
+ }
+
+ ++var13;
+ }
+ }
+
+ var11 = 0;
+
+ while (true) {
+ if (var11 >= (var18 ? 64 : 4096)) {
+ continue label134;
+ }
+
+ var12 = var1.readUnsignedByte();
+ if (var12 != 0) {
+ if ((var12 & 1) == 1) {
+ ++var1.index;
+ }
+
+ if (2 == (var12 & 2)) {
+ var1.index += 2;
+ }
+
+ if (4 == (var12 & 4)) {
+ var1.index += 3;
+ }
+ }
+
+ ++var11;
+ }
+ }
+ return;
+ }
+ } catch (RuntimeException var17) {
+ throw ClientErrorException.clientError(var17, "nc.A(" + (byte) -83 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/WorldMapOverlay2Decoder.java b/Client/src/main/java/org/runite/client/WorldMapOverlay2Decoder.java
new file mode 100644
index 000000000..e3371ad26
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldMapOverlay2Decoder.java
@@ -0,0 +1,62 @@
+package org.runite.client;
+
+public final class WorldMapOverlay2Decoder {
+
+ static void decode(DataBuffer var1) {
+ try {
+
+ while (var1.index < var1.buffer.length) {
+ int var4 = 0;
+ boolean var3 = false;
+ int var5 = 0;
+ if (var1.readUnsignedByte() == 1) {
+ var3 = true;
+ var4 = var1.readUnsignedByte();
+ var5 = var1.readUnsignedByte();
+ }
+
+ int var6 = var1.readUnsignedByte();
+ int var7 = var1.readUnsignedByte();
+ int var8 = -TextureOperation37.anInt3256 + var6 * 64;
+ int var9 = Class108.anInt1460 + -1 - -Unsorted.anInt65 - 64 * var7;
+ byte var2;
+ int var10;
+ if (var8 >= 0 && (var9 - 63) >= 0 && Class23.anInt455 > var8 + 63 && Class108.anInt1460 > var9) {
+ var10 = var8 >> 6;
+ int var11 = var9 >> 6;
+
+ for (int var12 = 0; 64 > var12; ++var12) {
+ for (int var13 = 0; var13 < 64; ++var13) {
+ if (!var3 || var12 >= (var4 * 8) && 8 + 8 * var4 > var12 && var13 >= var5 * 8 && 8 + var5 * 8 > var13) {
+ var2 = var1.readSignedByte();
+ if (var2 != 0) {
+ if (null == TextureOperation29.aByteArrayArrayArray3390[var10][var11]) {
+ TextureOperation29.aByteArrayArrayArray3390[var10][var11] = new byte[4096];
+ }
+
+ TextureOperation29.aByteArrayArrayArray3390[var10][var11][(63 + -var13 << 6) + var12] = var2;
+ byte var14 = var1.readSignedByte();
+ if (null == CS2Script.aByteArrayArrayArray2452[var10][var11]) {
+ CS2Script.aByteArrayArrayArray2452[var10][var11] = new byte[4096];
+ }
+
+ CS2Script.aByteArrayArrayArray2452[var10][var11][var12 + (-var13 + 63 << 6)] = var14;
+ }
+ }
+ }
+ }
+ } else {
+ for (var10 = 0; (!var3 ? 4096 : 64) > var10; ++var10) {
+ var2 = var1.readSignedByte();
+ if (var2 != 0) {
+ ++var1.index;
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "sk.F(" + -21774 + ',' + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/WorldMapOverlayDecoder.java b/Client/src/main/java/org/runite/client/WorldMapOverlayDecoder.java
new file mode 100644
index 000000000..e824af9cb
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldMapOverlayDecoder.java
@@ -0,0 +1,62 @@
+package org.runite.client;
+
+public final class WorldMapOverlayDecoder {
+
+ static void decode(DataBuffer var0) {
+ try {
+
+ while(var0.buffer.length > var0.index) {
+ int var4 = 0;
+ boolean var3 = false;
+ int var5 = 0;
+ if(var0.readUnsignedByte() == 1) {
+ var3 = true;
+ var4 = var0.readUnsignedByte();
+ var5 = var0.readUnsignedByte();
+ }
+
+ int var6 = var0.readUnsignedByte();
+ int var7 = var0.readUnsignedByte();
+ int var9 = -(var7 * 64) - (-Unsorted.anInt65 - Class108.anInt1460 + 1);
+ int var8 = var6 * 64 + -TextureOperation37.anInt3256;
+ byte var2;
+ int var10;
+ if(var8 >= 0 && (var9 - 63) >= 0 && Class23.anInt455 > (var8 + 63) && var9 < Class108.anInt1460) {
+ var10 = var8 >> 6;
+ int var11 = var9 >> 6;
+
+ for(int var12 = 0; var12 < 64; ++var12) {
+ for(int var13 = 0; var13 < 64; ++var13) {
+ if(!var3 || (8 * var4) <= var12 && var12 < 8 + var4 * 8 && var13 >= var5 * 8 && (8 + var5 * 8) > var13) {
+ var2 = var0.readSignedByte();
+ if(var2 != 0) {
+ if(RenderAnimationDefinition.aByteArrayArrayArray383[var10][var11] == null) {
+ RenderAnimationDefinition.aByteArrayArrayArray383[var10][var11] = new byte[4096];
+ }
+
+ RenderAnimationDefinition.aByteArrayArrayArray383[var10][var11][var12 + (-var13 + 63 << 6)] = var2;
+ byte var14 = var0.readSignedByte();
+ if(Class3_Sub10.aByteArrayArrayArray2339[var10][var11] == null) {
+ Class3_Sub10.aByteArrayArrayArray2339[var10][var11] = new byte[4096];
+ }
+
+ Class3_Sub10.aByteArrayArrayArray2339[var10][var11][var12 + (63 - var13 << 6)] = var14;
+ }
+ }
+ }
+ }
+ } else {
+ for(var10 = 0; var10 < (var3 ? 64 : 4096); ++var10) {
+ var2 = var0.readSignedByte();
+ if(0 != var2) {
+ ++var0.index;
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var15) {
+ throw ClientErrorException.clientError(var15, "dk.C(" + (var0 != null?"{...}":"null") + ',' + false + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/WorldMapUnderlayDecoder.java b/Client/src/main/java/org/runite/client/WorldMapUnderlayDecoder.java
new file mode 100644
index 000000000..cec9a08f7
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/WorldMapUnderlayDecoder.java
@@ -0,0 +1,142 @@
+package org.runite.client;
+
+public final class WorldMapUnderlayDecoder {
+
+ static void decode(DataBuffer var1) {
+ try {
+ int var3 = Class158.anInt2010 >> 1;
+ int var2 = AudioThread.anInt4034 >> 2 << 10;
+ byte[][] var4 = new byte[Class23.anInt455][Class108.anInt1460];
+
+ int var6;
+ int var12;
+ int var14;
+ while (var1.index < var1.buffer.length) {
+ int var7 = 0;
+ var6 = 0;
+ boolean var5 = false;
+ if (var1.readUnsignedByte() == 1) {
+ var6 = var1.readUnsignedByte();
+ var7 = var1.readUnsignedByte();
+ var5 = true;
+ }
+
+ int var8 = var1.readUnsignedByte();
+ int var9 = var1.readUnsignedByte();
+ int var10 = -TextureOperation37.anInt3256 + var8 * 64;
+ int var11 = -1 + Class108.anInt1460 - var9 * 64 + Unsorted.anInt65;
+ if (var10 >= 0 && 0 <= -63 + var11 && Class23.anInt455 > var10 - -63 && var11 < Class108.anInt1460) {
+ for (var12 = 0; var12 < 64; ++var12) {
+ byte[] var13 = var4[var10 - -var12];
+
+ for (var14 = 0; 64 > var14; ++var14) {
+ if (!var5 || var12 >= 8 * var6 && 8 + 8 * var6 > var12 && var14 >= var7 * 8 && var14 < 8 + 8 * var7) {
+ var13[var11 - var14] = var1.readSignedByte();
+ }
+ }
+ }
+ } else if (var5) {
+ var1.index += 64;
+ } else {
+ var1.index += 4096;
+ }
+ }
+
+ int var27 = Class23.anInt455;
+ var6 = Class108.anInt1460;
+ int[] var29 = new int[var6];
+ int[] var28 = new int[var6];
+ int[] var30 = new int[var6];
+ int[] var32 = new int[var6];
+ int[] var31 = new int[var6];
+
+ for (var12 = -5; var27 > var12; ++var12) {
+ int var15;
+ int var35;
+ for (int var34 = 0; var6 > var34; ++var34) {
+ var14 = var12 + 5;
+ if (var27 > var14) {
+ var15 = 255 & var4[var14][var34];
+ if (var15 > 0) {
+ FloorUnderlayDefinition var16 = FloorUnderlayDefinition.method629(var15 - 1);
+ var28[var34] += var16.anInt1408;
+ var29[var34] += var16.anInt1406;
+ var30[var34] += var16.anInt1417;
+ var32[var34] += var16.anInt1418;
+ ++var31[var34];
+ }
+ }
+
+ var15 = var12 + -5;
+ if (var15 >= 0) {
+ var35 = var4[var15][var34] & 0xFF;
+ if (0 < var35) {
+ FloorUnderlayDefinition var17 = FloorUnderlayDefinition.method629(-1 + var35);
+ var28[var34] -= var17.anInt1408;
+ var29[var34] -= var17.anInt1406;
+ var30[var34] -= var17.anInt1417;
+ var32[var34] -= var17.anInt1418;
+ --var31[var34];
+ }
+ }
+ }
+
+ if (var12 >= 0) {
+ int[][] var33 = Class146.anIntArrayArrayArray1903[var12 >> 6];
+ var14 = 0;
+ var15 = 0;
+ int var36 = 0;
+ int var18 = 0;
+ var35 = 0;
+
+ for (int var19 = -5; var6 > var19; ++var19) {
+ int var20 = var19 - -5;
+ if (var6 > var20) {
+ var18 += var31[var20];
+ var15 += var29[var20];
+ var35 += var30[var20];
+ var14 += var28[var20];
+ var36 += var32[var20];
+ }
+
+ int var21 = -5 + var19;
+ if (var21 >= 0) {
+ var35 -= var30[var21];
+ var36 -= var32[var21];
+ var14 -= var28[var21];
+ var18 -= var31[var21];
+ var15 -= var29[var21];
+ }
+
+ if (var19 >= 0 && 0 < var18) {
+ int[] var22 = var33[var19 >> 6];
+ int var23 = var36 != 0 ? Class3_Sub8.method129(var35 / var18, var15 / var18, var14 * 256 / var36) : 0;
+ if (var4[var12][var19] == 0) {
+ if (var22 != null) {
+ var22[Unsorted.bitwiseAnd(4032, var19 << 6) - -Unsorted.bitwiseAnd(var12, 63)] = 0;
+ }
+ } else {
+ if (var22 == null) {
+ var22 = var33[var19 >> 6] = new int[4096];
+ }
+
+ int var24 = var3 + (var23 & 127);
+ if (var24 < 0) {
+ var24 = 0;
+ } else if (var24 > 127) {
+ var24 = 127;
+ }
+
+ int var25 = var24 + (896 & var23) + (var23 + var2 & '\ufc00');
+ var22[Unsorted.bitwiseAnd(4032, var19 << 6) + Unsorted.bitwiseAnd(63, var12)] = Class51.anIntArray834[Unsorted.method1100(96, var25)];
+ }
+ }
+ }
+ }
+ }
+
+ } catch (RuntimeException var26) {
+ throw ClientErrorException.clientError(var26, "cj.H(" + (var1 != null ? "{...}" : "null") + ')');
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/Compass.java b/Client/src/main/java/org/runite/client/drawcalls/Compass.java
new file mode 100644
index 000000000..8d2c7611f
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/Compass.java
@@ -0,0 +1,29 @@
+package org.runite.client.drawcalls;
+
+import org.runite.client.*;
+
+public final class Compass {
+
+ public static void drawCompass(int var0, int var1, RSInterface var2, int var3) {
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var0, var1, var2.width + var0, var2.height + var1);
+ }
+
+ if (Class161.anInt2028 >= 3) {
+ if (HDToolKit.highDetail) {
+ AbstractSprite var5 = var2.method866(false);
+ if (null != var5) {
+ var5.drawAt(var0, var1);
+ }
+ } else {
+ Class74.method1332(var0, var1, var2.anIntArray207, var2.anIntArray291);
+ }
+ } else if (HDToolKit.highDetail) {
+ ((HDSprite) Class57.aAbstractSprite_895).drawMinimapRegion(var0, var1, var2.width, var2.height, Class57.aAbstractSprite_895.width / 2, Class57.aAbstractSprite_895.height / 2, GraphicDefinition.CAMERA_DIRECTION, 256, (HDSprite) var2.method866(false));
+ } else {
+ ((SoftwareSprite) Class57.aAbstractSprite_895).method667(var0, var1, var2.width, var2.height, Class57.aAbstractSprite_895.width / 2, Class57.aAbstractSprite_895.height / 2, GraphicDefinition.CAMERA_DIRECTION, var2.anIntArray207, var2.anIntArray291);
+ }
+
+ Class163_Sub1_Sub1.aBooleanArray4008[var3] = true;
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/ContextMenu.java b/Client/src/main/java/org/runite/client/drawcalls/ContextMenu.java
new file mode 100644
index 000000000..64ef0deb0
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/ContextMenu.java
@@ -0,0 +1,40 @@
+package org.runite.client.drawcalls;
+
+import org.rs09.client.config.GameConfig;
+import org.rs09.client.rendering.Toolkit;
+import org.runite.client.*;
+
+public final class ContextMenu {
+
+ public static void draw() {
+ int x = Class21.anInt1462;
+ int y = Class21.anInt3395;
+ int width = Class21.anInt3552;
+ int height = Class21.anInt3537;
+ int contextMenuColor = 6116423; //Context Menu RGB || 6116423 Classic || Old var5 || ColorCore.getHexColors()
+ Toolkit.getActiveToolkit().fillRect(1 + x, y + 18, width + -2, -19 + height, GameConfig.RCM_BG_COLOR, GameConfig.getRCM_BG_OPACITY());
+ if (GameConfig.RS3_CONTEXT_STYLE) {
+ Toolkit.getActiveToolkit().fillRect(1 + x, 2 + y, width + -2, 16, GameConfig.RCM_TITLE_COLOR, GameConfig.getRCM_TITLE_OPACITY());
+ Toolkit.getActiveToolkit().drawRect(1 + x, 1 + y, width + -2, height, GameConfig.RCM_BORDER_COLOR, GameConfig.getRCM_BORDER_OPACITY());
+ } else {
+ Toolkit.getActiveToolkit().fillRect(1 + x, 2 + y, width + -2, 16, GameConfig.RCM_TITLE_COLOR, GameConfig.getRCM_TITLE_OPACITY());
+ Toolkit.getActiveToolkit().drawRect(1 + x, y + 18, width + -2, -19 + height, GameConfig.RCM_BORDER_COLOR, GameConfig.getRCM_BORDER_OPACITY());
+ }
+
+ FontType.bold.method681(RSString.parse(GameConfig.RCM_TITLE), x - -3, y + 14, contextMenuColor, -1);
+ int var7 = Unsorted.anInt1709;
+ int var6 = Class126.anInt1676;
+
+ for (int var8 = 0; var8 < Unsorted.menuOptionCount; ++var8) {
+ int var9 = (-var8 + -1 + Unsorted.menuOptionCount) * 15 + y - -31;
+ int var10 = 16777215;
+ if (var6 > x && x - -width > var6 && -13 + var9 < var7 && 3 + var9 > var7) {
+ var10 = 16776960;
+ }
+
+ FontType.bold.method681(Unsorted.method802(var8), x - -3, var9, var10, 0);
+ }
+
+ Unsorted.method1282(Class21.anInt1462, Class21.anInt3395, Class21.anInt3537, Class21.anInt3552);
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/LoadingBox.java b/Client/src/main/java/org/runite/client/drawcalls/LoadingBox.java
new file mode 100644
index 000000000..8f4afb4f4
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/LoadingBox.java
@@ -0,0 +1,38 @@
+package org.runite.client.drawcalls;
+
+import org.rs09.client.rendering.Toolkit;
+import org.runite.client.*;
+
+import java.awt.*;
+
+public final class LoadingBox {
+
+ public static void draw(boolean var1, RSString var2) {
+ byte var3 = 4;
+ int var4 = var3 + 6;
+ int var5 = var3 + 6;
+ int var6 = FontType.plainFont.method680(var2, 250);
+ int var7 = FontType.plainFont.method684(var2, 250) * 13;
+ //Used for the top left (please wait...)
+ Toolkit.getActiveToolkit().method934(var4 - var3, -var3 + var5, var3 + var6 - -var3, var3 + var3 + var7, 0);
+ Toolkit.getActiveToolkit().drawRect(-var3 + var4, -var3 + var5, var6 + var3 - -var3, var3 + var7 + var3, 16777215, 255);
+
+ FontType.plainFont.method676(var2, var4, var5, var6, var7, 16777215, -1, 1, 1, 0);
+
+ Class21.method1340(var4 + -var3, var6 + (var3 - -var3), -var3 + var5, var3 + var7 + var3);
+ if (var1) {
+ if (HDToolKit.highDetail) {
+ HDToolKit.bufferSwap();
+ } else {
+ try {
+ Graphics var8 = GameShell.canvas.getGraphics();
+ Unsorted.aClass158_3009.method2179(var8);
+ } catch (Exception var9) {
+ GameShell.canvas.repaint();
+ }
+ }
+ } else {
+ Unsorted.method1282(var4, var5, var7, var6);
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/Minimap.java b/Client/src/main/java/org/runite/client/drawcalls/Minimap.java
new file mode 100644
index 000000000..d6fea0b44
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/Minimap.java
@@ -0,0 +1,219 @@
+package org.runite.client.drawcalls;
+
+import org.rs09.client.rendering.Toolkit;
+import org.runite.client.*;
+
+import java.util.Objects;
+
+public final class Minimap {
+
+ public static void displayMinimap(int var0, byte var1, int var2, int var3, RSInterface var4) {
+ Class58.method1194();
+
+ if (HDToolKit.highDetail) {
+ Class22.setClipping(var3, var2, var3 + var4.width, var2 + var4.height);
+ } else {
+ Class74.setClipping(var3, var2, var3 - -var4.width, var2 + var4.height);
+ }
+
+ if (2 != Class161.anInt2028 && 5 != Class161.anInt2028 && Class49.aAbstractSprite_812 != null) {
+ int var19 = TextureOperation9.anInt3102 + GraphicDefinition.CAMERA_DIRECTION & 0x7FF;//Region Rotation (relative to player camera)
+ int var6 = Class102.player.xAxis / 32 + 48;//Minimap X Axis (relative to player) Used as offset
+ int var7 = -(Class102.player.yAxis / 32) + 464;//Minimap Y Axis (relative to player) Used as offset
+ if (HDToolKit.highDetail) {
+ ((HDSprite) Class49.aAbstractSprite_812).drawMinimapRegion(var3, var2, var4.width, var4.height, var6, var7, var19, Class164_Sub2.anInt3020 + 256, (HDSprite) var4.method866(false));
+ } else {
+ ((SoftwareSprite) Class49.aAbstractSprite_812).drawMinimapRegion(var3, var2, var4.width, var4.height, var6, var7, var19, 256 - -Class164_Sub2.anInt3020, var4.anIntArray207, var4.anIntArray291);
+ }
+
+ int var9;
+ int var10;
+ int var11;
+ int var12;
+ int var13;
+ int var14;
+ int var17;
+ int var16;
+ if (null != TextureOperation22.aClass131_3421) {
+ for (int var8 = 0; var8 < TextureOperation22.aClass131_3421.anInt1720; ++var8) {
+ if (TextureOperation22.aClass131_3421.method1789(var8, var1 ^ 553)) {
+ var9 = 2 + 4 * (TextureOperation22.aClass131_3421.xArray1727[var8] + -Class131.x1716) + -(Class102.player.xAxis / 32);
+ var11 = Class51.anIntArray840[var19];
+ var12 = Class51.anIntArray851[var19];
+ Font var15 = FontType.smallFont;
+ var11 = var11 * 256 / (256 + Class164_Sub2.anInt3020);
+ var10 = 2 + 4 * (-Texture.y1152 + TextureOperation22.aClass131_3421.yArray1718[var8]) - Class102.player.yAxis / 32;
+ var12 = var12 * 256 / (256 + Class164_Sub2.anInt3020);
+ var14 = -(var9 * var11) + var10 * var12 >> 16;
+ if (TextureOperation22.aClass131_3421.method1791(var8, var1 + -51) == 1) {
+ var15 = FontType.plainFont;
+ }
+
+ if (2 == TextureOperation22.aClass131_3421.method1791(var8, 8)) {
+ var15 = FontType.bold;
+ }
+
+ var13 = var11 * var10 - -(var12 * var9) >> 16;
+ var16 = var15.method680(TextureOperation22.aClass131_3421.aStringArray1721[var8], 100);
+ var13 -= var16 / 2;
+ if (-var4.width <= var13 && var13 <= var4.width && var14 >= -var4.height && var14 <= var4.height) {
+ var17 = 16777215;
+ if (TextureOperation22.aClass131_3421.anIntArray1725[var8] != -1) {
+ var17 = TextureOperation22.aClass131_3421.anIntArray1725[var8];
+ }
+
+ if (HDToolKit.highDetail) {
+ Class22.method936((HDSprite) Objects.requireNonNull(var4.method866(false)));
+ } else {
+ Class74.method1314(var4.anIntArray207, var4.anIntArray291);
+ }
+
+ var15.method693(TextureOperation22.aClass131_3421.aStringArray1721[var8], var3 + var13 + var4.width / 2, var2 + var4.height / 2 + -var14, var16, 50, var17, 0, 1, 0, 0);
+ if (HDToolKit.highDetail) {
+ Class22.method921();
+ } else {
+ Class74.method1310();
+ }
+ }
+ }
+ }
+ }
+
+ for (var9 = 0; MouseListeningClass.anInt1924 > var9; ++var9) {
+ var10 = -(Class102.player.xAxis / 32) + 2 + 4 * Class84.anIntArray1163[var9];
+ var11 = -(Class102.player.yAxis / 32) + 2 + (Unsorted.anIntArray4050[var9] * 4);
+ ObjectDefinition var20 = ObjectDefinition.getObjectDefinition(Class3_Sub19.anIntArray3693[var9]);
+ if (null != var20.ChildrenIds) {
+ var20 = var20.method1685(var1 + -59);
+ if (null == var20 || var20.MapIcon == -1) {
+ continue;
+ }
+ }
+
+ Class38_Sub1.minimapIcons(var4, Entity.aAbstractSpriteArray2839[var20.MapIcon], var11, var10, var2, var3);
+ }
+
+ for (var9 = 0; 104 > var9; ++var9) {
+ for (var10 = 0; var10 < 104; ++var10) {
+ LinkedList var25 = Class39.groundItems[WorldListCountry.localPlane][var9][var10];
+ if (null != var25) {
+ var12 = 2 + var9 * 4 + -(Class102.player.xAxis / 32);
+ var13 = -(Class102.player.yAxis / 32) + 2 + 4 * var10;
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[0], var13, var12, var2, var3);
+ }
+ }
+ }
+
+ for (var9 = 0; var9 < Class163.localNPCCount; ++var9) {
+ NPC var21 = NPC.npcs[AudioThread.localNPCIndexes[var9]];
+ if (var21 != null && var21.hasDefinitions()) {
+ NPCDefinition var22 = var21.definition;
+ if (null != var22 && null != var22.childNPCs) {
+ var22 = var22.method1471((byte) -3);
+ }
+
+ if (var22 != null && var22.aBoolean1285 && var22.aBoolean1270) {
+ var12 = var21.xAxis / 32 - Class102.player.xAxis / 32;
+ var13 = var21.yAxis / 32 + -(Class102.player.yAxis / 32);
+ if (var22.anInt1283 == -1) {
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[1], var13, var12, var2, var3);
+ } else {
+ Class38_Sub1.minimapIcons(var4, Entity.aAbstractSpriteArray2839[var22.anInt1283], var13, var12, var2, var3);
+ }
+ }
+ }
+ }
+
+ for (var9 = 0; var9 < Class159.localPlayerCount; ++var9) {
+ Player var23 = Unsorted.players[Class56.localPlayerIndexes[var9]];
+ if (null != var23 && var23.hasDefinitions()) {
+ var12 = var23.yAxis / 32 - Class102.player.yAxis / 32;
+ var11 = -(Class102.player.xAxis / 32) + var23.xAxis / 32;
+ long var29 = var23.displayName.toLong();
+ boolean var28 = false;
+
+ for (var16 = 0; var16 < Class8.anInt104; ++var16) {
+ if (Class50.aLongArray826[var16] == var29 && 0 != Unsorted.anIntArray882[var16]) {
+ var28 = true;
+ break;
+ }
+ }
+
+ boolean var31 = false;
+
+ for (var17 = 0; Unsorted.clanSize > var17; ++var17) {
+ if (var29 == PacketParser.aClass3_Sub19Array3694[var17].linkableKey) {
+ var31 = true;
+ break;
+ }
+ }
+
+ boolean var32 = false;
+ if (Class102.player.teamId != 0 && 0 != var23.teamId && var23.teamId == Class102.player.teamId) {
+ var32 = true;
+ }
+
+ if (var28) {
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[3], var12, var11, var2, var3);
+ } else if (var31) {
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[5], var12, var11, var2, var3);
+ } else if (var32) {
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[4], var12, var11, var2, var3);
+ } else {
+ Class38_Sub1.minimapIcons(var4, Unsorted.minimapDotSprites[2], var12, var11, var2, var3);
+ }
+ }
+ }
+
+ Class96[] var24 = ClientErrorException.aClass96Array2114;
+
+ for (var10 = 0; var24.length > var10; ++var10) {
+ Class96 var26 = var24[var10];
+ if (null != var26 && var26.anInt1360 != 0 && Class44.anInt719 % 20 < 10) {
+ if (var26.anInt1360 == 1 && var26.anInt1359 >= 0 && var26.anInt1359 < NPC.npcs.length) {
+ NPC var27 = NPC.npcs[var26.anInt1359];
+ if (null != var27) {
+ var13 = -(Class102.player.xAxis / 32) + var27.xAxis / 32;
+ var14 = var27.yAxis / 32 + -(Class102.player.yAxis / 32);
+ Class53.method1171(var26.anInt1351, var2, var3, var13, var14, var4);
+ }
+ }
+
+ if (var26.anInt1360 == 2) {
+ var12 = (-Class131.x1716 + var26.anInt1356) * 4 + 2 - Class102.player.xAxis / 32;
+ var13 = -(Class102.player.yAxis / 32) + 2 + (-Texture.y1152 + var26.anInt1347) * 4;
+ Class53.method1171(var26.anInt1351, var2, var3, var12, var13, var4);
+ }
+
+ if (var26.anInt1360 == 10 && var26.anInt1359 >= 0 && Unsorted.players.length > var26.anInt1359) {
+ Player var30 = Unsorted.players[var26.anInt1359];
+ if (null != var30) {
+ var14 = var30.yAxis / 32 + -(Class102.player.yAxis / 32);
+ var13 = var30.xAxis / 32 + -(Class102.player.xAxis / 32);
+ Class53.method1171(var26.anInt1351, var2, var3, var13, var14, var4);
+ }
+ }
+ }
+ }
+
+ if (Class65.anInt987 != 0) {
+ var9 = 4 * Class65.anInt987 + (2 - Class102.player.xAxis / 32);
+ var10 = 2 + 4 * Class45.anInt733 - Class102.player.yAxis / 32;
+ Class38_Sub1.minimapIcons(var4, Class45.aAbstractSprite_736, var10, var9, var2, var3);
+ }
+ Toolkit.getActiveToolkit().method934(-1 + (var3 - -(var4.width / 2)), -1 + var2 - -(var4.height / 2), 3, 3, 16777215);
+
+ } else if (HDToolKit.highDetail) {
+ AbstractSprite var5 = var4.method866(false);
+ if (null != var5) {
+ var5.drawAt(var3, var2);
+ }
+ } else {
+ Class74.method1332(var3, var2, var4.anIntArray207, var4.anIntArray291);
+ }
+
+ if (var1 == 59) {
+ Class163_Sub1_Sub1.aBooleanArray4008[var0] = true;
+ }
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBar.java b/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBar.java
new file mode 100644
index 000000000..34195101f
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBar.java
@@ -0,0 +1,26 @@
+package org.runite.client.drawcalls;
+
+import org.rs09.client.rendering.Toolkit;
+import org.runite.client.*;
+
+public final class StartupLoadingBar {
+
+ public static void draw(boolean var1, Font var2) {
+ int var3;
+ if (HDToolKit.highDetail || var1) {
+ var3 = GroundItem.canvasHeight;
+ int var4 = var3 * 956 / 503;
+ Class40.aAbstractSprite_680.method639((Class23.canvasWidth + -var4) / 2, 0, var4, var3);
+ SequenceDefinition.aClass109_1856.method1667(-(SequenceDefinition.aClass109_1856.width / 2) + Class23.canvasWidth / 2, 18);
+ }
+
+ var2.method699(TextCore.RSLoadingPleaseWait, Class23.canvasWidth / 2, GroundItem.canvasHeight / 2 - 26, 16777215, -1);
+ var3 = GroundItem.canvasHeight / 2 + -18;
+ Toolkit.getActiveToolkit().drawRect(Class23.canvasWidth / 2 - 152, var3, 304, 34, 9179409, 255);
+ Toolkit.getActiveToolkit().drawRect(-151 + Class23.canvasWidth / 2, var3 - -1, 302, 32, 0, 255);
+ Toolkit.getActiveToolkit().method934(Class23.canvasWidth / 2 - 150, var3 + 2, Client.LoadingStageNumber * 3, 30, 9179409);
+ Toolkit.getActiveToolkit().method934(Class23.canvasWidth / 2 + -150 - -(3 * Client.LoadingStageNumber), 2 + var3, 300 + -(3 * Client.LoadingStageNumber), 30, 0);
+
+ var2.method699(Client.loadingBarTextToDisplay, Class23.canvasWidth / 2, 4 + GroundItem.canvasHeight / 2, 16777215, -1);
+ }
+}
diff --git a/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBarInitial.java b/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBarInitial.java
new file mode 100644
index 000000000..11598510a
--- /dev/null
+++ b/Client/src/main/java/org/runite/client/drawcalls/StartupLoadingBarInitial.java
@@ -0,0 +1,63 @@
+package org.runite.client.drawcalls;
+
+import org.runite.client.*;
+
+import java.awt.*;
+
+public class StartupLoadingBarInitial {
+
+
+ public static FontMetrics aFontMetrics1822;
+ public static Image anImage2695;
+
+ public static void draw(Color var0, boolean var2, RSString var3, int var4) {
+
+ try {
+ Graphics var5 = GameShell.canvas.getGraphics();
+ aFontMetrics1822 = GameShell.canvas.getFontMetrics(TextCore.Helvetica);
+ if (var2) {
+ var5.setColor(Color.black);
+ var5.fillRect(0, 0, Class23.canvasWidth, GroundItem.canvasHeight);
+ }
+
+ try {
+ if (anImage2695 == null) {
+ anImage2695 = GameShell.canvas.createImage(304, 34);
+ }
+
+ Graphics var6 = anImage2695.getGraphics();
+ var6.setColor(var0);
+ var6.drawRect(0, 0, 303, 33);
+ var6.fillRect(2, 2, var4 * 3, 30);
+ var6.setColor(Color.black);
+ var6.drawRect(1, 1, 301, 31);
+ var6.fillRect(3 * var4 + 2, 2, -(3 * var4) + 300, 30);
+ var6.setFont(TextCore.Helvetica);
+ var6.setColor(Color.white);
+ var3.drawString(var6, 22, (-var3.method1575(aFontMetrics1822) + 304) / 2);
+ var5.drawImage(anImage2695, Class23.canvasWidth / 2 - 152, -18 + GroundItem.canvasHeight / 2, null);
+ } catch (Exception var9) {
+ int var7 = -152 + Class23.canvasWidth / 2;
+ int var8 = -18 + GroundItem.canvasHeight / 2;
+ var5.setColor(var0);
+ var5.drawRect(var7, var8, 303, 33);
+ var5.fillRect(var7 + 2, 2 + var8, 3 * var4, 30);
+ var5.setColor(Color.black);
+ var5.drawRect(1 + var7, var8 - -1, 301, 31);
+ var5.fillRect(3 * var4 + (var7 - -2), 2 + var8, 300 - var4 * 3, 30);
+ var5.setFont(TextCore.Helvetica);
+ var5.setColor(Color.white);
+ var3.drawString(var5, 22 + var8, var7 + (-var3.method1575(aFontMetrics1822) + 304) / 2);
+ }
+
+ if (Class167.aString_2083 != null) {
+ var5.setFont(TextCore.Helvetica);
+ var5.setColor(Color.white);
+ Class167.aString_2083.drawString(var5, GroundItem.canvasHeight / 2 - 26, Class23.canvasWidth / 2 - Class167.aString_2083.method1575(aFontMetrics1822) / 2);
+ }
+
+ } catch (Exception var10) {
+ GameShell.canvas.repaint();
+ }
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/CustomVars.kt b/Client/src/main/kotlin/org/rs09/CustomVars.kt
new file mode 100644
index 000000000..a84528bf6
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/CustomVars.kt
@@ -0,0 +1,30 @@
+package org.rs09
+
+import org.rs09.client.config.GameConfig
+
+/**
+ * Handles custom client vars because I did it the lazy way
+ * @author Ceikry
+ */
+object CustomVars {
+ @JvmStatic
+ fun parse(varID: Int, varValue: Int): Boolean{
+ return when(varID){
+ 2501 -> {
+ GameConfig.xpDropsEnabled = (varValue and 1) == 1
+ GameConfig.xpDropMode = (varValue shr 1) and 1
+ GameConfig.xpTrackMode = (varValue shr 2) and 1
+ true
+ }
+ 2502 -> {
+ GameConfig.slayerCountEnabled = true
+ GameConfig.slayerTaskID = varValue and 0x7F
+ GameConfig.setSlayerAmount((varValue shr 7) and 0xFF)
+ SlayerTracker.setSprite()
+ SystemLogger.logInfo(varValue.toString())
+ true
+ }
+ else -> false
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/Discord.kt b/Client/src/main/kotlin/org/rs09/Discord.kt
new file mode 100644
index 000000000..fb963e059
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/Discord.kt
@@ -0,0 +1,56 @@
+package org.rs09
+
+import net.arikia.dev.drpc.DiscordEventHandlers
+import net.arikia.dev.drpc.DiscordRPC
+import net.arikia.dev.drpc.DiscordRichPresence
+
+/**
+ * Handles discord rich presence integration
+ * @author Ceikry
+ * library thanks to Vatuu on Github
+ */
+object Discord {
+ const val APP_ID = "812421731238019073";
+ var presence = DiscordRichPresence()
+ var initialized = false
+
+ @JvmStatic
+ fun checkInitializable() : Boolean{
+ val OS = System.getProperty("os.name")
+ if(OS.toLowerCase().startsWith("windows") || OS.toLowerCase().contains("nux")){
+ val arch = System.getProperty("os.arch")
+ return arch != "aarch64" && !initialized
+ }
+ return false
+ }
+
+ @JvmStatic
+ fun initialize() {
+ val handlers = DiscordEventHandlers.Builder().setReadyEventHandler { user ->
+ SystemLogger.logDiscord("Discord RPC Initialized, registered to " + user.username + "#" + user.discriminator)
+ }.setErroredEventHandler { errorCode, message ->
+ SystemLogger.logDiscord("Discord error encountered: [$errorCode] $message")
+ DiscordRPC.discordShutdown()
+ }.build()
+
+ //On Linux, when the discord library initializes, it can crash any other client loading the same library.
+ //Not sure what causes this, likely a JVM bug to be honest.
+ DiscordRPC.discordInitialize(APP_ID, handlers, true)
+ initialized = true
+ }
+
+ @JvmStatic
+ fun updatePresence(stateMessage: String,details: String,imageKey : String) {
+ if(presence.state == stateMessage && presence.details == details && imageKey == presence.smallImageKey) return
+ val newPresence = DiscordRichPresence.Builder(stateMessage).setDetails(details).build()
+ newPresence.startTimestamp = System.currentTimeMillis()
+ if(newPresence.details.startsWith("Bloating")){
+ newPresence.smallImageKey = imageKey
+ }
+ newPresence.largeImageKey = "rwlogo"
+ newPresence.largeImageText = "*farts*"
+ DiscordRPC.discordUpdatePresence(newPresence)
+ presence = newPresence
+ SystemLogger.logDiscord("Updating presence ($stateMessage,$details,$imageKey)")
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/SlayerTracker.kt b/Client/src/main/kotlin/org/rs09/SlayerTracker.kt
new file mode 100644
index 000000000..b0f2154e4
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/SlayerTracker.kt
@@ -0,0 +1,151 @@
+package org.rs09
+
+import org.rs09.client.config.GameConfig
+import org.rs09.client.rendering.RenderingUtils
+import org.rs09.client.rendering.Toolkit
+import org.runite.client.*
+import java.lang.Exception
+import java.util.concurrent.TimeUnit
+
+object SlayerTracker {
+ const val posX = 5
+ const val posY = 30
+ const val textX = 7
+ const val textY = 50
+ const val spriteY = 30
+ val boxColor = GameConfig.slayerTrackerColor.toIntOrNull(16) ?: 6116423
+
+ @JvmField
+ var lastUpdate = 0L
+
+ var curSprite: AbstractSprite? = null
+
+
+ @JvmStatic
+ fun draw(){
+ val timeSinceUpdate = System.currentTimeMillis() - lastUpdate
+ if(!GameConfig.slayerCountEnabled) return
+ if(GameConfig.slayerTaskAmount <= 0) return
+ if(timeSinceUpdate >= TimeUnit.MINUTES.toMillis(5L)) return
+ val tk = Toolkit.getActiveToolkit()
+ var rectWidth = 60
+ var amountPos = textX + 40
+ if(rectWidth < 90) rectWidth = 90
+ if(amountPos < textX + 60) amountPos = textX + 60
+ tk.fillRect(posX,posY,rectWidth,30, boxColor,GameConfig.slayerTrackerOpacity)
+
+ curSprite?.drawAt(textX, spriteY)
+ RenderingUtils.drawText(GameConfig.slayerTaskAmount.toString(),amountPos, textY, -1, 2, false)
+ }
+
+ @JvmStatic
+ fun reset(){
+ GameConfig.slayerTaskAmount = 0
+ GameConfig.slayerTaskID = 0
+ GameConfig.slayerCountEnabled = false;
+ lastUpdate = 0
+ }
+
+ @JvmStatic
+ fun setSprite(){
+ try {
+ SystemLogger.logInfo("Getting slayer sprite...")
+ val itemId: Int = when (GameConfig.slayerTaskID) {
+ 0 -> 4144
+ 1 -> 4149
+ 2 -> 560
+ 3 -> 10176
+ 4 -> 4135
+ 5 -> 4139
+ 6 -> 14072
+ 7 -> 948
+ 8 -> 12189
+ 9 -> 3098
+ 10 -> 1747
+ 11 -> 4141
+ 12 -> 1751
+ 13 -> 11047
+ 14 -> 2349
+ 15 -> 9008
+ 16 -> 4521
+ 17 -> 4134
+ 18 -> 8900
+ 19 -> 4520
+ 20 -> 4137
+ 21 -> 1739
+ 22 -> 7982
+ 23 -> 10149
+ 24 -> 532
+ 25 -> 8141
+ 26 -> 6637
+ 27 -> 6695
+ 28 -> 8132
+ 29 -> 4145
+ 30 -> 7500
+ 31 -> 1422
+ 32 -> 1387
+ 33 -> 9011
+ 34 -> 4147
+ 35 -> 552
+ 36 -> 6722
+ 37 -> 10998
+ 38 -> 9016
+ 39 -> 2402
+ 40 -> 1753
+ 41 -> 7050
+ 42 -> 8137
+ 43 -> 12570
+ 44 -> 8133
+ 45 -> 4671
+ 46 -> 4671
+ 47 -> 1159
+ 48 -> 4140
+ 49 -> 2351
+ 50 -> 4142
+ 51 -> 7778
+ 52 -> 8139
+ 53 -> 4146
+ 54 -> 2402
+ 55 -> 2359
+ 56 -> 12079
+ 57 -> 12201
+ 58 -> 12570
+ 59 -> 4148
+ 60 -> 4818
+ 61 -> 6107
+ 62 -> 4138
+ 63 -> 14074
+ 64 -> 4136
+ 65 -> 6297
+ 66 -> 10634
+ 67 -> 553
+ 68 -> 8135
+ 69 -> 11732
+ 70 -> 10284
+ 71 -> 13923
+ 72 -> 2353
+ 73 -> 8136
+ 74 -> 4143
+ 75 -> 6528
+ 76 -> 10109
+ 77 -> 1403
+ 78 -> 2952
+ 79 -> 958
+ 80 -> 7594
+ 89 -> 6811
+ else -> -1
+ }
+
+ var sprite = AbstractSprite.constructItemSprite(0, HDToolKit.highDetail, itemId, false, 1, 1, false)
+ if (HDToolKit.highDetail) {
+ if (sprite is Class3_Sub28_Sub16_Sub2_Sub1) {
+ sprite = Class3_Sub28_Sub16_Sub1_Sub1(sprite as SoftwareSprite)
+ } else {
+ sprite = HDSprite(sprite as SoftwareSprite)
+ }
+ }
+
+ curSprite = sprite
+ } catch (ignored: Exception){}
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/SystemLogger.kt b/Client/src/main/kotlin/org/rs09/SystemLogger.kt
new file mode 100644
index 000000000..dcaf8296b
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/SystemLogger.kt
@@ -0,0 +1,50 @@
+package org.rs09
+
+import com.github.ajalt.mordant.terminal.Terminal
+import com.github.ajalt.mordant.rendering.TextColors.*
+import org.rs09.client.config.GameConfig
+import java.text.SimpleDateFormat
+import java.util.*
+
+/**
+ * Handles client logging
+ * @author Ceikry
+ * Thanks to Aj Alt for the awesome Mordant library!
+ */
+object SystemLogger {
+ val formatter = SimpleDateFormat("HH:mm:ss")
+ val t = Terminal()
+
+ fun getTime(): String{
+ return "[" + formatter.format(Date(System.currentTimeMillis())) +"]"
+ }
+
+ @JvmStatic
+ fun logInfo(vararg messages: String){
+ for(m in messages){
+ if(m.isNotBlank()) t.println("${getTime()}: [INFO] $m")
+ }
+ }
+
+ @JvmStatic
+ fun logErr(message: String){
+ if(message.isNotBlank()) t.println("${getTime()}: ${brightRed("[ ERR] $message")}")
+ }
+
+ @JvmStatic
+ fun logWarn(message: String){
+ if(message.isNotBlank()) t.println("${getTime()}: ${yellow("[WARN] $message")}")
+ }
+
+ @JvmStatic
+ fun logDiscord(message: String){
+ t.println("${getTime()}: ${brightBlue("[DISC] $message")}")
+ }
+
+ @JvmStatic
+ fun logVerbose(message: String){
+ if(GameConfig.VERBOSE_LOGGING){
+ logInfo(message)
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/XPGainDraw.kt b/Client/src/main/kotlin/org/rs09/XPGainDraw.kt
new file mode 100644
index 000000000..e5aa88bb9
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/XPGainDraw.kt
@@ -0,0 +1,204 @@
+package org.rs09
+
+import org.rs09.client.config.GameConfig
+import org.rs09.client.rendering.RenderingUtils
+import org.rs09.client.rendering.Toolkit
+import org.runite.client.*
+import java.util.*
+import kotlin.math.ceil
+
+/**
+ * Handles tracking and drawing of xp drops
+ * @author Ceikry
+ */
+object XPGainDraw {
+ internal class XPGain(var skillId: Int, var xpGain: Int, var currentPos: Int)
+ @JvmStatic
+ var lastXp = Array(24){0}
+
+ @JvmStatic
+ private var thisLoopGains = ArrayList()
+
+ var posX = RenderingUtils.width / 2
+ var posY = RenderingUtils.height / 4
+ var skillSprite: AbstractSprite? = null
+ var lastSkillId = 0
+
+ var gainsAddedThisLoop = 0
+ var totalXP = 0
+ var lastUpdate = 0L
+ var lastGain = 0L
+
+ const val line = 110
+ const val clearHeight = 60
+
+ @JvmStatic
+ fun addGain(xpGain: Int,skillId: Int){
+ if(GameConfig.xpDropMode == 1){
+ totalXP += xpGain
+ }
+ if(xpGain <= 0) return
+ if(gainsAddedThisLoop > 6) return
+ if(lastXp[skillId] == 0){
+ if(GameConfig.xpDropMode == 0) {
+ totalXP += xpGain
+ }
+ return
+ }
+ var drawAt = line
+ if(thisLoopGains.isNotEmpty()) {
+ if (thisLoopGains[thisLoopGains.size - 1].currentPos + 25 > line) {
+ drawAt = thisLoopGains[thisLoopGains.size - 1].currentPos + 25
+ }
+ }
+ thisLoopGains.add(XPGain(skillId,xpGain,drawAt))
+ gainsAddedThisLoop++
+ if(System.currentTimeMillis() - lastUpdate > 10000) lastUpdate = System.currentTimeMillis()
+ lastGain = System.currentTimeMillis()
+ }
+
+ @JvmStatic
+ fun drawGains() {
+ if(!GameConfig.xpDropsEnabled){
+ return
+ }
+ if(System.currentTimeMillis() - lastGain > 10000) return
+ posX = RenderingUtils.width / 2
+ posY = RenderingUtils.height / 4
+ if(posX == 382) { //Client is in fixed mode
+ posX += 60
+ }
+ drawTotal()
+ if(GameConfig.xpTrackMode == 1) {
+ skillSprite?.drawAt(posX - 65, 10)
+ RenderingUtils.drawText(addCommas(lastXp[lastSkillId].toString()), posX - 40, 28, -1, 2, false)
+ }
+ val timeDelta = getTimeDelta()
+ val removeList = ArrayList()
+ for(gain in thisLoopGains) {
+ gain.currentPos -= ceil(timeDelta / 20.0).toInt()
+ if(gain.currentPos <= clearHeight){
+ if(GameConfig.xpDropMode == 0) {
+ totalXP += gain.xpGain
+ }
+ removeList.add(gain)
+ continue;
+ }
+
+ val sprite = getSprite(getSpriteArchive(gain.skillId))
+ sprite?.drawAt((posX) - 25, gain.currentPos - 20)
+ RenderingUtils.drawText("${gain.xpGain}",posX, gain.currentPos,-1,2,false)
+ skillSprite = sprite
+ lastSkillId = gain.skillId
+ }
+ lastUpdate = System.currentTimeMillis()
+ thisLoopGains.removeAll(removeList)
+ gainsAddedThisLoop = 0
+ if(Discord.initialized) {
+ Discord.updatePresence("In-Game", "Bloating", "skill_$lastSkillId")
+ }
+ }
+
+ fun drawTotal() {
+ val tk = Toolkit.getActiveToolkit()
+ RenderingUtils.setClipping(0,0,RenderingUtils.width,500)
+ val horizontal = getSprite(822)
+ val horizontalTop = getSprite(820)
+ val tl_corner = getSprite(824)
+ val bl_corner = getSprite(826)
+ val tr_corner = getSprite(825)
+ val br_corner = getSprite(827)
+ val bg = getSprite(657)
+ bg?.drawAt(posX - 77,9)
+ tk.fillRect(posX - 75,5,140,30,0,64)
+ bl_corner?.drawAt(posX - 77,10)
+ tl_corner?.drawAt(posX - 77,5)
+ tr_corner?.drawAt(posX + 41,5)
+ br_corner?.drawAt(posX + 41,10)
+ horizontalTop?.drawAt(posX - 45,-8)
+ horizontal?.drawAt(posX - 45,22)
+ horizontalTop?.drawAt(posX - 15,-8)
+ horizontal?.drawAt(posX - 15,22)
+ horizontalTop?.drawAt(posX + 9,-8)
+ horizontal?.drawAt(posX + 9,22)
+ if(GameConfig.xpTrackMode == 0){
+ RenderingUtils.drawText("Total XP: " + addCommas(totalXP.toString()),posX - 65,28,-1,2,false)
+ }
+ }
+
+ fun getSpriteArchive(skillId: Int): Int{
+ return when(skillId) {
+ 0 -> 197
+ 1 -> 199
+ 2 -> 198
+ 3 -> 203
+ 4 -> 200
+ 5 -> 201
+ 6 -> 202
+ 7 -> 212
+ 8 -> 214
+ 9 -> 208
+ 10 -> 211
+ 11 -> 213
+ 12 -> 207
+ 13 -> 210
+ 14 -> 209
+ 15 -> 205
+ 16 -> 204
+ 17 -> 206
+ 18 -> 216
+ 19 -> 217
+ 20 -> 215
+ 21 -> 220
+ 22 -> 221
+ 23 -> 222
+ else -> 222
+ }
+ }
+
+ fun getSprite(archiveIndex: Int): AbstractSprite? {
+ var rawSprite: AbstractSprite? = null
+ if(CacheIndex.spritesIndex.retrieveSpriteFile(archiveIndex)){
+ rawSprite = Unsorted.loadSoftwareSprite(CacheIndex.spritesIndex, archiveIndex)
+ if(HDToolKit.highDetail){
+ if(rawSprite is Class3_Sub28_Sub16_Sub2_Sub1){
+ rawSprite = Class3_Sub28_Sub16_Sub1_Sub1(rawSprite as SoftwareSprite)
+ } else {
+ rawSprite = HDSprite(rawSprite as SoftwareSprite)
+ }
+ }
+ }
+ return rawSprite
+ }
+
+ fun addCommas(num: String): String{
+ var newString = ""
+ if(num.length > 9){
+ return "Lots!"
+ }
+ var counter = 1
+ num.reversed().forEach {
+ if(counter % 3 == 0 && counter != num.length){
+ newString += "$it,"
+ } else {
+ newString += it
+ }
+ counter++
+ }
+ return newString.reversed()
+ }
+
+ @JvmStatic
+ fun reset(){
+ totalXP = 0
+ lastXp = Array(24){0}
+ lastUpdate = 0
+ thisLoopGains.clear()
+ lastSkillId = 0
+ skillSprite = null
+ }
+
+ fun getTimeDelta(): Long{
+ return System.currentTimeMillis() - lastUpdate
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/DataBuffer.kt b/Client/src/main/kotlin/org/rs09/client/DataBuffer.kt
new file mode 100644
index 000000000..2071a829a
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/DataBuffer.kt
@@ -0,0 +1,107 @@
+package org.rs09.client
+
+import org.rs09.client.util.ByteArrayPool
+import org.runite.client.RSString
+
+open class DataBuffer(@JvmField val buffer: ByteArray, @JvmField var index: Int) : Linkable() {
+ constructor(buffer: ByteArray) : this(buffer, 0)
+ constructor(length: Int) : this(ByteArrayPool.getByteArray(length), 0)
+
+ fun readUnsignedByte(): Int {
+ return buffer[index++].toInt() and 0xff
+ }
+
+ fun readUnsignedShort(): Int {
+ index += 2
+ return (buffer[index - 1].toInt() and 0xff) +
+ (buffer[index - 2].toInt() and 0xff shl 8)
+ }
+
+ fun readInt(): Int {
+ index += 4
+ return (buffer[index - 4].toInt() and 0xff shl 24) +
+ (buffer[index - 3].toInt() and 0xff shl 16) +
+ (buffer[index - 2].toInt() and 0xff shl 8) +
+ (buffer[index - 1].toInt() and 0xff)
+ }
+
+ fun writeInt(value: Int) {
+ buffer[index++] = (value shr 24).toByte()
+ buffer[index++] = (value shr 16).toByte()
+ buffer[index++] = (value shr 8).toByte()
+ buffer[index++] = value.toByte()
+ }
+
+ fun writeLong(value: Long) {
+ buffer[index++] = (value shr 56).toInt().toByte()
+ buffer[index++] = (value shr 48).toInt().toByte()
+ buffer[index++] = (value shr 40).toInt().toByte()
+ buffer[index++] = (value shr 32).toInt().toByte()
+ buffer[index++] = (value shr 24).toInt().toByte()
+ buffer[index++] = (value shr 16).toInt().toByte()
+ buffer[index++] = (value shr 8).toInt().toByte()
+ buffer[index++] = value.toInt().toByte()
+ }
+
+ fun readBytes(length: Int): ByteArray {
+ val out = ByteArray(length)
+ System.arraycopy(buffer, index, out, 0, length)
+ index += length
+ return out
+ }
+
+ fun write128Byte(value: Int) {
+ buffer[index++] = (128 - value).toByte()
+ }
+
+ fun writeString(value: RSString) {
+ index += value.method1580(buffer, index, value.length())
+ buffer[index++] = 0
+ }
+
+ /*
+ * TODO Refactor / rename everything beyond this point
+ */
+
+ fun method739(var2: Int, var3: Long) {
+ var var2 = var2
+ --var2
+ if (var2 >= 0 && var2 <= 7) {
+ var var5 = var2 * 8
+ while (0 <= var5) {
+ buffer[index++] = (var3 shr var5).toInt().toByte()
+ var5 -= 8
+ }
+ } else {
+ throw IllegalArgumentException()
+ }
+ }
+
+ fun method741(): Int {
+ var var2 = buffer[index++].toInt()
+ var var3: Int
+ var3 = 0
+ while (0 > var2) {
+ var3 = 127 and var2 or var3 shl 7
+ var2 = buffer[index++].toInt()
+ }
+ return var2 or var3
+ }
+
+ fun method742(var2: Int) {
+ buffer[index + -var2 - 4] = (var2 shr 24).toByte()
+ buffer[index + -var2 - 3] = (var2 shr 16).toByte()
+ buffer[index + -var2 - 2] = (var2 shr 8).toByte()
+ buffer[index + -var2 - 1] = var2.toByte()
+ }
+
+ fun readSignedShort128(): Int {
+ index += 2
+ var value: Int = (buffer[index - 2].toInt() and 0xff shl 8) +
+ (buffer[index - 1].toInt() - 128 and 0xff)
+ if (value > 32767) {
+ value -= 65536
+ }
+ return value
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/GameLaunch.kt b/Client/src/main/kotlin/org/rs09/client/GameLaunch.kt
new file mode 100644
index 000000000..345020d43
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/GameLaunch.kt
@@ -0,0 +1,73 @@
+package org.rs09.client
+
+import org.rs09.SystemLogger
+import org.rs09.client.config.GameConfig
+import org.runite.client.GameShell
+import java.io.File
+import java.io.FileOutputStream
+
+object GameLaunch {
+
+ /**
+ * The main method.
+ * r @param args the arguments casted on runtime.
+ * r_game
+ */
+ @JvmStatic
+ fun main(args: Array) {
+ for (i in args.indices) {
+ val cmd = args[i].split("=").toTypedArray()
+ when (cmd[0]) {
+ "ip" -> GameConfig.IP_ADDRESS = cmd[1]
+ "world" -> GameConfig.WORLD_OVERRIDE = cmd[1].toInt()
+ else -> GameConfig.configLocation = cmd[0]
+ }
+ }
+ try {
+ SystemLogger.logInfo("Trying to parse config at " + GameConfig.configLocation)
+ GameConfig.parse(GameConfig.configLocation)
+ GameConfig.implementHoliday()
+ GameConfig.extendRenderDistance()
+ } catch (e: Exception){
+ GameConfig.IP_ADDRESS = "73.67.76.208"
+ GameConfig.IP_MANAGEMENT = "73.67.76.208"
+ GameConfig.JS5_SERVER_PORT = 43593
+ GameConfig.SERVER_PORT = 43594
+ GameConfig.WL_PORT = 5555
+ GameConfig.RCM_STYLE_PRESET = "classic"
+ GameConfig.RCM_TITLE = " Choose Option"
+ GameConfig.HOLIDAYS_ENABLED = true
+ GameConfig.implementHoliday()
+ GameConfig.RENDER_DISTANCE_INCREASE = true
+ GameConfig.extendRenderDistance()
+ SystemLogger.logWarn("Config file ${GameConfig.configLocation} not found, using defaults.")
+ }
+ /**
+ * Launches the client
+ */
+ if(System.getProperty("os.name").toLowerCase().contains("nux")){ //Fixes crashing due to XInitThreads not being called - JVM bug
+ val istream = javaClass.classLoader.getResourceAsStream("libfixXInitThreads.so")
+ val buff = ByteArray(1024)
+ var read = -1
+ val temp = File.createTempFile("libfixXInitThreads.so","")
+ val fos = FileOutputStream(temp)
+
+ read = istream.read(buff)
+ while(read != -1){
+ fos.write(buff, 0, read)
+ read = istream.read(buff)
+ }
+
+ fos.close()
+ istream.close()
+
+ System.load(temp.absolutePath)
+ }
+
+ //Force IPv4 because sometimes Windows insists on using IPv6 regardless of what a service actually offers
+ System.setProperty("java.net.preferIPv4Stack" , "true");
+
+ GameShell.launchDesktop()
+ }
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/Linkable.kt b/Client/src/main/kotlin/org/rs09/client/Linkable.kt
new file mode 100644
index 000000000..abda84756
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/Linkable.kt
@@ -0,0 +1,21 @@
+package org.rs09.client
+
+open class Linkable {
+ @JvmField
+ var linkableKey = 0L
+ @JvmField
+ var next: Linkable? = null
+ @JvmField
+ var previous: Linkable? = null
+
+ fun isLinked(): Boolean = previous != null
+
+ fun unlink() {
+ if (null != previous) {
+ previous!!.next = next
+ next!!.previous = previous
+ previous = null
+ next = null
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/LinkableInt.kt b/Client/src/main/kotlin/org/rs09/client/LinkableInt.kt
new file mode 100644
index 000000000..c04894d91
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/LinkableInt.kt
@@ -0,0 +1,3 @@
+package org.rs09.client
+
+data class LinkableInt(@JvmField val value: Int = 0): Linkable()
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/Node.kt b/Client/src/main/kotlin/org/rs09/client/Node.kt
new file mode 100644
index 000000000..da6a3a5a7
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/Node.kt
@@ -0,0 +1,32 @@
+package org.rs09.client
+
+open class Node : Linkable() {
+ @JvmField
+ var nodeKey: Long = 0
+ @JvmField
+ var previousNode: Node? = null
+ @JvmField
+ var nextNode: Node? = null
+
+ fun unlinkNode() {
+ if (previousNode != null) {
+ previousNode!!.nextNode = nextNode
+ nextNode!!.previousNode = previousNode
+ nextNode = null
+ previousNode = null
+ }
+ }
+
+ companion object {
+ @JvmStatic
+ fun splice(insert: Node, target: Node) {
+ if (target.previousNode != null) {
+ target.unlinkNode()
+ }
+ target.previousNode = insert
+ target.nextNode = insert.nextNode
+ target.previousNode!!.nextNode = target
+ target.nextNode!!.previousNode = target
+ }
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/config/GameConfig.backup b/Client/src/main/kotlin/org/rs09/client/config/GameConfig.backup
new file mode 100644
index 000000000..c657a8fb3
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/config/GameConfig.backup
@@ -0,0 +1,349 @@
+package org.rs09.client.config
+
+import org.json.simple.JSONObject
+import org.json.simple.parser.JSONParser
+import org.rs09.SlayerTracker
+import java.io.FileReader
+import java.math.BigInteger
+import java.util.*
+
+/**
+ * Handles the client's config loading
+ * @author Ceikry
+ */
+class GameConfig {
+ companion object {
+
+ /**
+ * Debug Booleans
+ */
+ @JvmField
+ var ITEM_DEBUG_ENABLED = false
+
+ @JvmField
+ var OBJECT_DEBUG_ENABLED = false
+
+ @JvmField
+ var NPC_DEBUG_ENABLED = false
+
+ @JvmField
+ var HD_LOGIN_DEBUG = false
+
+ @JvmField
+ var HD_LOGIN_VERBOSE = false
+
+ @JvmField
+ var CACHE_DEBUG = false
+
+ @JvmField
+ var WORLD_MAP_DEBUG = false
+
+ /**
+ * Context Menu Presets
+ */
+ @JvmField
+ var RCM_STYLE_PRESET = "classic"
+
+ /**
+ * Context Menu Customization
+ */
+ @JvmField
+ var RCM_BG_COLOR = 6116423
+
+ @JvmField
+ var RCM_BG_OPACITY = 255
+
+ @JvmField
+ var RCM_TITLE_COLOR = 0
+
+ @JvmField
+ var RCM_TITLE_OPACITY = 255
+
+ @JvmField
+ var RCM_BORDER_COLOR = 0
+
+ @JvmField
+ var RCM_BORDER_OPACITY = 255
+
+ @JvmField
+ var RCM_TITLE = " Choose Option"
+
+ @JvmField
+ var RS3_CONTEXT_STYLE = false
+
+ /**
+ * Render distance
+ */
+ @JvmField
+ var RENDER_DISTANCE_INCREASE = false
+
+ @JvmField
+ var RENDER_DISTANCE_VALUE = 3584f
+
+ @JvmField
+ var RENDER_DISTANCE_TILE_VALUE = 28
+
+ @JvmField
+ var RENDER_DISTANCE_FOG_FIX = 3328.0f
+
+ @JvmField
+ var SKYBOX_COLOR = "float"
+
+ /**
+ * Client Info
+ * Editable
+ */
+ @JvmField
+ var IP_ADDRESS = "localhost"
+
+ @JvmField
+ var IP_MANAGEMENT = "localhost"
+
+ var JS5_SERVER_PORT = 43593
+
+ @JvmField
+ var SERVER_PORT = 43594
+
+ @JvmField
+ var WL_PORT = 5555
+
+ @JvmField
+ var WORLD = 1
+
+ @JvmField
+ var WORLD_OVERRIDE = -1
+
+ @JvmField
+ var LOGIN_THEME = "redwings"
+
+ @JvmField
+ var xpDropsEnabled = true
+
+ @JvmField
+ var xpDropMode = 0
+
+ @JvmField
+ var xpTrackMode = 0
+
+ @JvmField
+ var slayerCountEnabled = true
+
+ @JvmField
+ var slayerTaskID = 0
+
+ @JvmField
+ var slayerTaskAmount = 0
+
+ @JvmField
+ var VERBOSE_LOGGING = false
+
+ @JvmStatic
+ fun setSlayerAmount(amount : Int){
+ slayerTaskAmount = amount
+ SlayerTracker.lastUpdate = System.currentTimeMillis()
+ }
+
+ /**
+ * Json config Parser
+ */
+ @JvmStatic
+ fun parse(path: String){
+ val reader = FileReader(path)
+ val parser = JSONParser()
+ val data = parser.parse(reader) as JSONObject
+
+ //Networking
+ if(data.containsKey("ip_address")) IP_ADDRESS = data["ip_address"].toString() else IP_ADDRESS = "play.2009scape.org"
+ if(data.containsKey("ip_management")) IP_MANAGEMENT = data["ip_management"].toString() else IP_MANAGEMENT = IP_ADDRESS
+ if(data.containsKey("wl_port")) WL_PORT = data["wl_port"].toString().toInt()
+ if(data.containsKey("server_port")) SERVER_PORT = data["server_port"].toString().toInt()
+ if(data.containsKey("js5_port")) JS5_SERVER_PORT = data["js5_port"].toString().toInt()
+ if(data.containsKey("world")) WORLD = data["world"].toString().toInt()
+
+ //Parse customization options
+ if(data.containsKey("customization")){
+ val custom = data["customization"] as JSONObject
+ if(custom.containsKey("login_theme")) LOGIN_THEME = custom["login_theme"].toString()
+
+ //Right-click menu customizations
+ if(custom.containsKey("right_click_menu")){
+ val rcm = custom["right_click_menu"] as JSONObject
+
+ //background
+ if(rcm.containsKey("background")){
+ val bg = rcm["background"] as JSONObject
+ if(bg.containsKey("color")) RCM_BG_COLOR = bg["color"].toString().replace("#", "").toInt(16) //convert hex -> deci
+ if(bg.containsKey("opacity")) RCM_BG_OPACITY = bg["opacity"].toString().toInt()
+ }
+
+ //title bar
+ if(rcm.containsKey("title_bar")){
+ val tb = rcm["title_bar"] as JSONObject
+ if(tb.containsKey("font_color")) RCM_TITLE = RCM_TITLE.replace("0", tb["font_color"].toString().replace("#", ""))
+ if(tb.containsKey("color")) RCM_TITLE_COLOR = tb["color"].toString().replace("#", "").toInt(16) //convert hex -> deci
+ if(tb.containsKey("opacity")) RCM_TITLE_OPACITY = tb["opacity"].toString().toInt()
+ }
+
+ //border
+ if(rcm.containsKey("border")){
+ val border = rcm["border"] as JSONObject
+ if(border.containsKey("color")) RCM_BORDER_COLOR = border["color"].toString().replace("#", "").toInt(16) //convert hex -> deci
+ if(border.containsKey("opacity")) RCM_BORDER_OPACITY = border["opacity"].toString().toInt()
+ }
+
+ //styles (changes how things are drawn)
+ if(rcm.containsKey("styles")){
+ val style = rcm["styles"] as JSONObject
+ if(style.containsKey("presets")) RCM_STYLE_PRESET = style["presets"].toString()
+ if(style.containsKey("rs3border")) RS3_CONTEXT_STYLE = style["rs3border"] as Boolean
+ }
+ }
+ if(custom.containsKey("rendering_options")) {
+ val hdoptions = custom["rendering_options"] as JSONObject
+
+ if(hdoptions.containsKey("technical")) {
+ val renderIncrease = hdoptions["technical"] as JSONObject
+ if(renderIncrease.containsKey("render_distance_increase")) RENDER_DISTANCE_INCREASE = renderIncrease["render_distance_increase"] as Boolean
+ }
+ if(hdoptions.containsKey("skybox")) {
+ val skyboxColor = hdoptions["skybox"] as JSONObject
+ if(skyboxColor.containsKey("skybox_color")) SKYBOX_COLOR
+ }
+ }
+ }
+
+ //Parse debug options
+ if(data.containsKey("debug")){
+ val debug = data["debug"] as JSONObject
+ if(debug.containsKey("item_debug")) ITEM_DEBUG_ENABLED = debug["item_debug"] as Boolean
+ if(debug.containsKey("npc_debug")) NPC_DEBUG_ENABLED = debug["npc_debug"] as Boolean
+ if(debug.containsKey("object_debug")) OBJECT_DEBUG_ENABLED = debug["object_debug"] as Boolean
+ if(debug.containsKey("hd_login_region_debug")) HD_LOGIN_DEBUG = debug["hd_login_region_debug"] as Boolean
+ if(debug.containsKey("hd_login_region_debug_verbose")) HD_LOGIN_VERBOSE = debug["hd_login_region_debug_verbose"] as Boolean
+ if(debug.containsKey("cache_debug")) CACHE_DEBUG = debug["cache_debug"] as Boolean
+ if(debug.containsKey("world_map_debug")) WORLD_MAP_DEBUG = debug["world_map_debug"] as Boolean
+ }
+
+
+ /**
+ * Style Overrides (Still working on this system. We should allow for maximum creativity
+ * The way that it will be setup is a style type 1st
+ * ie, classicbox, rs3, rounded, rounded2
+ * Then we introduce color schemes that a user could select
+ * ie, classic, rs3, alternate, alternate2, custom
+ * @author Woah
+ */
+ when (RCM_STYLE_PRESET) {
+ "classic" -> {
+ RS3_CONTEXT_STYLE = false
+ RCM_BG_COLOR = 6116423
+ RCM_BG_OPACITY = 255
+ RCM_TITLE = " Choose Option"
+ RCM_TITLE_COLOR = 0
+ RCM_TITLE_OPACITY = 255
+ RCM_BORDER_COLOR = 0
+ RCM_BORDER_OPACITY = 255
+ }
+ "rs3" -> {
+ RS3_CONTEXT_STYLE = true
+ RCM_BG_COLOR = 662822
+ RCM_BG_OPACITY = 255
+ RCM_TITLE = " Choose Option"
+ RCM_TITLE_COLOR = 1512718
+ RCM_TITLE_OPACITY = 165
+ RCM_BORDER_COLOR = 16777215
+ RCM_BORDER_OPACITY = 255
+ }
+ }
+
+
+ }
+
+ fun extendRenderDistance() {
+ if (RENDER_DISTANCE_INCREASE) {
+ /** **DO NOT CHANGE THESE NUMBERS UNLESS YOU KNOW WHAT YOU ARE DOING**
+ * Render Distance Overrides
+ *
+ * (Simple formula) Tile amount * 512
+ * Default: 7 * 512 = 3584
+ * Extended(max): 56 * 512 = 28672
+ *
+ * Files + methods effected by these values:
+ * HDToolKit METHOD viewport
+ * Class140_Sub1_Sub1 METHOD animate
+ * Class3_Sub22 METHOD method398 * value as short
+ * Class40 METHOD method1046 * using RENDER_DISTANCE_TILE_VALUE
+ */
+ RENDER_DISTANCE_VALUE = if (RENDER_DISTANCE_INCREASE) 28672F else 3584.0f
+ RENDER_DISTANCE_TILE_VALUE = if (RENDER_DISTANCE_INCREASE) 56 else 28
+ RENDER_DISTANCE_FOG_FIX = if (RENDER_DISTANCE_INCREASE) 28672F else 3328.0f
+ }
+ }
+
+ /**
+ * Client Info
+ * Not Editable
+ */
+ @JvmField
+ var CLIENT_BUILD = 530
+
+ @JvmField
+ var CLIENT_VERSION = 1
+
+ @JvmField
+ var PACKAGE_NAME = "org.runite.client"
+
+ @JvmField
+ var RSA = true
+
+ @JvmField
+ var ISAAC = false
+
+ @JvmField
+ var EXPONENT = BigInteger("65537")
+
+ @JvmField
+ var MODULUS = BigInteger("96982303379631821170939875058071478695026608406924780574168393250855797534862289546229721580153879336741968220328805101128831071152160922518190059946555203865621183480223212969502122536662721687753974815205744569357388338433981424032996046420057284324856368815997832596174397728134370577184183004453899764051")
+
+ @JvmField
+ var SERVER_NAME = "2009scape"
+
+ /**
+ * Path to config
+ */
+ @JvmField
+ var configLocation = "config.json"
+
+ /**
+ * Holiday Event Toggles
+ */
+ @JvmField
+ var HOLIDAYS_ENABLED = true
+
+ /**
+ * Halloween event NPC Definitions are handled inside of NPCDefinition.java
+ */
+ @JvmField
+ var HALLOWEEN_EVENT_ENABLED = false
+
+ @JvmField
+ var THANKSGIVING_EVENT_ENABLED = false
+
+ @JvmField
+ var CHRISTMAS_EVENT_ENABLED = false
+
+ private val calendar: Calendar = Calendar.getInstance()
+ private val month = calendar.get(Calendar.MONTH)
+
+ @JvmStatic
+ fun implementHoliday() {
+ if (HOLIDAYS_ENABLED) {
+ when (month) {
+ 9 -> HALLOWEEN_EVENT_ENABLED = true
+ 10 -> THANKSGIVING_EVENT_ENABLED = true
+ 11 -> CHRISTMAS_EVENT_ENABLED = true
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/config/GameConfig.kt b/Client/src/main/kotlin/org/rs09/client/config/GameConfig.kt
new file mode 100644
index 000000000..cc79b7313
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/config/GameConfig.kt
@@ -0,0 +1,407 @@
+package org.rs09.client.config
+
+import org.json.simple.JSONObject
+import org.json.simple.parser.JSONParser
+import org.rs09.SlayerTracker
+import java.io.FileReader
+import java.math.BigInteger
+import java.util.*
+
+/**
+ * Handles the client's config loading
+ * @author Ceikry
+ */
+object GameConfig {
+ /**
+ * Debug Booleans
+ */
+ @JvmField
+ var ITEM_DEBUG_ENABLED = false
+
+ @JvmField
+ var OBJECT_DEBUG_ENABLED = false
+
+ @JvmField
+ var NPC_DEBUG_ENABLED = false
+
+ @JvmField
+ var HD_LOGIN_DEBUG = false
+
+ @JvmField
+ var HD_LOGIN_VERBOSE = false
+
+ @JvmField
+ var CACHE_DEBUG = false
+
+ @JvmField
+ var WORLD_MAP_DEBUG = false
+
+ @JvmField
+ var DO_SNOW_DECEMBER = true
+
+ @JvmField
+ var VARP_DEBUG = false
+
+ /**
+ * Context Menu Presets
+ */
+ @JvmField
+ var RCM_STYLE_PRESET = "classic"
+
+ @JvmField
+ var FORCE_LEFT_CLICK_ATTACK = false
+
+ /**
+ * Context Menu Customization
+ */
+ @JvmField
+ var RCM_BG_COLOR = 6116423
+
+ @JvmStatic
+ var RCM_BG_OPACITY = 255
+ set(value) {
+ if(value > 255 || value < 0) field = 255
+ else field = value
+ }
+
+ @JvmField
+ var RCM_TITLE_COLOR = 0
+
+ @JvmStatic
+ var RCM_TITLE_OPACITY = 255
+ set(value) {
+ if(value > 255 || value < 0) field = 255
+ else field = value
+ }
+
+ @JvmField
+ var RCM_BORDER_COLOR = 0
+
+ @JvmStatic
+ var RCM_BORDER_OPACITY = 255
+ set(value) {
+ if(value > 255 || value < 0) field = 255
+ else field = value
+ }
+
+ @JvmField
+ var RCM_TITLE = " Choose Option"
+
+ @JvmField
+ var RS3_CONTEXT_STYLE = false
+
+ /**
+ * Render distance
+ */
+ @JvmField
+ var RENDER_DISTANCE_INCREASE = false
+
+ @JvmField
+ var RENDER_DISTANCE_VALUE = 3584f
+
+ @JvmField
+ var RENDER_DISTANCE_TILE_VALUE = 28
+
+ @JvmField
+ var RENDER_DISTANCE_FOG_FIX = 3328.0f
+
+ @JvmField
+ var SKYBOX_COLOR = "float"
+
+ /**
+ * Client Info
+ * Editable
+ */
+ @JvmField
+ var IP_ADDRESS = "localhost"
+
+ @JvmField
+ var IP_MANAGEMENT = "localhost"
+
+ @JvmField
+ var JS5_SERVER_PORT = 43593
+
+ @JvmField
+ var SERVER_PORT = 43594
+
+ @JvmField
+ var WL_PORT = 5555
+
+ @JvmField
+ var WORLD = 1
+
+ @JvmField
+ var WORLD_OVERRIDE = -1
+
+ @JvmField
+ var LOGIN_THEME = "redwings"
+
+ @JvmField
+ var xpDropsEnabled = true
+
+ @JvmField
+ var xpDropMode = 0
+
+ @JvmField
+ var xpTrackMode = 0
+
+ @JvmField
+ var slayerCountEnabled = true
+
+ @JvmField
+ var slayerTrackerColor = "#635a38"
+
+ @JvmStatic
+ var slayerTrackerOpacity = 180
+ set(value) {
+ if(value > 255 || value < 0) field = 255
+ else field = value
+ }
+
+ @JvmField
+ var slayerTaskID = 0
+
+ @JvmField
+ var slayerTaskAmount = 0
+
+ @JvmField
+ var VERBOSE_LOGGING = false
+
+ @JvmStatic
+ fun setSlayerAmount(amount : Int){
+ slayerTaskAmount = amount
+ if(slayerTaskAmount < 0) slayerTaskAmount = 0
+ SlayerTracker.lastUpdate = System.currentTimeMillis()
+ }
+
+ /**
+ * Json config Parser
+ */
+ @JvmStatic
+ fun parse(path: String){
+ val reader = FileReader(path)
+ val parser = JSONParser()
+ val data = parser.parse(reader) as JSONObject
+
+ //Networking
+ if(data.containsKey("ip_address")) IP_ADDRESS = data["ip_address"].toString() else IP_ADDRESS = "73.67.76.208"
+ if(data.containsKey("ip_management")) IP_MANAGEMENT = data["ip_management"].toString() else IP_MANAGEMENT = IP_ADDRESS
+ if(data.containsKey("wl_port")) WL_PORT = data["wl_port"].toString().toInt()
+ if(data.containsKey("server_port")) SERVER_PORT = data["server_port"].toString().toInt()
+ if(data.containsKey("js5_port")) JS5_SERVER_PORT = data["js5_port"].toString().toInt()
+ if(data.containsKey("world")) WORLD = data["world"].toString().toInt()
+
+ //Parse customization options
+ if(data.containsKey("customization")){
+ val custom = data["customization"] as JSONObject
+ if(custom.containsKey("login_theme")) LOGIN_THEME = custom["login_theme"].toString()
+ if(custom.containsKey("december_snow")) DO_SNOW_DECEMBER = custom["december_snow"] as Boolean
+
+ //Right-click menu customizations
+ if(custom.containsKey("right_click_menu")){
+ val rcm = custom["right_click_menu"] as JSONObject
+
+ if(rcm.containsKey("left_click_attack")) {
+ FORCE_LEFT_CLICK_ATTACK = rcm["left_click_attack"] as Boolean
+ }
+
+ //background
+ if(rcm.containsKey("background")){
+ val bg = rcm["background"] as JSONObject
+ if(bg.containsKey("color")) RCM_BG_COLOR = bg["color"].toString().replace("#", "").toIntOrNull(16) ?: 6116423//convert hex -> deci
+ if(bg.containsKey("opacity")) RCM_BG_OPACITY = bg["opacity"].toString().toInt()
+ }
+
+ //title bar
+ if(rcm.containsKey("title_bar")){
+ val tb = rcm["title_bar"] as JSONObject
+ if(tb.containsKey("font_color")) RCM_TITLE = RCM_TITLE.replace("0", tb["font_color"].toString().replace("#", ""))
+ if(tb.containsKey("color")) RCM_TITLE_COLOR = tb["color"].toString().replace("#", "").toIntOrNull(16) ?: 6116423//convert hex -> deci
+ if(tb.containsKey("opacity")) RCM_TITLE_OPACITY = tb["opacity"].toString().toInt()
+ }
+
+ //border
+ if(rcm.containsKey("border")){
+ val border = rcm["border"] as JSONObject
+ if(border.containsKey("color")) RCM_BORDER_COLOR = border["color"].toString().replace("#", "").toIntOrNull(16) ?: 6116423 //convert hex -> deci
+ if(border.containsKey("opacity")) RCM_BORDER_OPACITY = border["opacity"].toString().toInt()
+ }
+
+ //styles (changes how things are drawn)
+ if(rcm.containsKey("styles")){
+ val style = rcm["styles"] as JSONObject
+ if(style.containsKey("presets")) RCM_STYLE_PRESET = style["presets"].toString()
+ if(style.containsKey("rs3border")) RS3_CONTEXT_STYLE = style["rs3border"] as Boolean
+ }
+ }
+
+ if(custom.containsKey("xpdrops")){
+ val xpd = custom["xpdrops"] as JSONObject
+ if(xpd.containsKey("enabled")) xpDropsEnabled = xpd["enabled"] as Boolean
+ if(xpd.containsKey("drop_mode")) xpDropMode = xpd["drop_mode"].toString().toInt()
+ if(xpd.containsKey("track_mode")) xpTrackMode = xpd["track_mode"].toString().toInt()
+ }
+
+ if(custom.containsKey("slayer")){
+ val slayer = custom["slayer"] as JSONObject
+ if(slayer.containsKey("enabled")) slayerCountEnabled = slayer["enabled"] as Boolean
+ if(slayer.containsKey("color")) slayerTrackerColor = slayer["color"].toString().replace("#", "")
+ if(slayer.containsKey("opacity")) slayerTrackerOpacity = slayer["opacity"].toString().toInt()
+ }
+
+ if(custom.containsKey("rendering_options")) {
+ val hdoptions = custom["rendering_options"] as JSONObject
+
+ if(hdoptions.containsKey("technical")) {
+ val renderIncrease = hdoptions["technical"] as JSONObject
+ if(renderIncrease.containsKey("render_distance_increase")) RENDER_DISTANCE_INCREASE = renderIncrease["render_distance_increase"] as Boolean
+ }
+ if(hdoptions.containsKey("skybox")) {
+ val skyboxColor = hdoptions["skybox"] as JSONObject
+ if(skyboxColor.containsKey("skybox_color")) SKYBOX_COLOR
+ }
+ }
+ }
+
+ //Parse debug options
+ if(data.containsKey("debug")){
+ val debug = data["debug"] as JSONObject
+ if(debug.containsKey("item_debug")) ITEM_DEBUG_ENABLED = debug["item_debug"] as Boolean
+ if(debug.containsKey("npc_debug")) NPC_DEBUG_ENABLED = debug["npc_debug"] as Boolean
+ if(debug.containsKey("object_debug")) OBJECT_DEBUG_ENABLED = debug["object_debug"] as Boolean
+ if(debug.containsKey("hd_login_region_debug")) HD_LOGIN_DEBUG = debug["hd_login_region_debug"] as Boolean
+ if(debug.containsKey("hd_login_region_debug_verbose")) HD_LOGIN_VERBOSE = debug["hd_login_region_debug_verbose"] as Boolean
+ if(debug.containsKey("cache_debug")) CACHE_DEBUG = debug["cache_debug"] as Boolean
+ if(debug.containsKey("world_map_debug")) WORLD_MAP_DEBUG = debug["world_map_debug"] as Boolean
+ }
+
+
+ /**
+ * Style Overrides (Still working on this system. We should allow for maximum creativity
+ * The way that it will be setup is a style type 1st
+ * ie, classicbox, rs3, rounded, rounded2
+ * Then we introduce color schemes that a user could select
+ * ie, classic, rs3, alternate, alternate2, custom
+ * @author Woah
+ */
+ when (RCM_STYLE_PRESET) {
+ "classic" -> {
+ RS3_CONTEXT_STYLE = false
+ RCM_BG_COLOR = 6116423
+ RCM_BG_OPACITY = 255
+ RCM_TITLE = " Choose Option"
+ RCM_TITLE_COLOR = 0
+ RCM_TITLE_OPACITY = 255
+ RCM_BORDER_COLOR = 0
+ RCM_BORDER_OPACITY = 255
+ }
+ "rs3" -> {
+ RS3_CONTEXT_STYLE = true
+ RCM_BG_COLOR = 662822
+ RCM_BG_OPACITY = 255
+ RCM_TITLE = " Choose Option"
+ RCM_TITLE_COLOR = 1512718
+ RCM_TITLE_OPACITY = 165
+ RCM_BORDER_COLOR = 16777215
+ RCM_BORDER_OPACITY = 255
+ }
+ }
+
+
+ }
+
+ fun extendRenderDistance() {
+ if (RENDER_DISTANCE_INCREASE) {
+ /** **DO NOT CHANGE THESE NUMBERS UNLESS YOU KNOW WHAT YOU ARE DOING**
+ * Render Distance Overrides
+ *
+ * (Simple formula) Tile amount * 512
+ * Default: 7 * 512 = 3584
+ * Extended(max): 56 * 512 = 28672
+ *
+ * Files + methods effected by these values:
+ * HDToolKit METHOD viewport
+ * Class140_Sub1_Sub1 METHOD animate
+ * Class3_Sub22 METHOD method398 * value as short
+ * Class40 METHOD method1046 * using RENDER_DISTANCE_TILE_VALUE
+ */
+ RENDER_DISTANCE_VALUE = if (RENDER_DISTANCE_INCREASE) 28672F else 3584.0f
+ RENDER_DISTANCE_TILE_VALUE = if (RENDER_DISTANCE_INCREASE) 56 else 28
+ RENDER_DISTANCE_FOG_FIX = if (RENDER_DISTANCE_INCREASE) 28672F else 3328.0f
+ }
+ }
+
+ /**
+ * Client Info
+ * Not Editable
+ */
+ @JvmField
+ var CLIENT_BUILD = 530
+
+ @JvmField
+ var CLIENT_VERSION = 1
+
+ @JvmField
+ var PACKAGE_NAME = "org.runite.client"
+
+ @JvmField
+ var RSA = true
+
+ @JvmField
+ var ISAAC = false
+
+ @JvmField
+ var EXPONENT = BigInteger("65537")
+
+ @JvmField
+ var MODULUS = BigInteger("96982303379631821170939875058071478695026608406924780574168393250855797534862289546229721580153879336741968220328805101128831071152160922518190059946555203865621183480223212969502122536662721687753974815205744569357388338433981424032996046420057284324856368815997832596174397728134370577184183004453899764051")
+
+ @JvmField
+ var SERVER_NAME = "FellerScape"
+
+ /**
+ * Path to config
+ */
+ @JvmField
+ var configLocation = "config.json"
+
+ /**
+ * Holiday Event Toggles
+ */
+ @JvmField
+ var HOLIDAYS_ENABLED = true
+
+ @JvmField
+ var EASTER_EVENT_ENABLED = false
+ /**
+ * Halloween event NPC Definitions are handled inside of NPCDefinition.java
+ */
+ @JvmField
+ var HALLOWEEN_EVENT_ENABLED = false
+
+ @JvmField
+ var THANKSGIVING_EVENT_ENABLED = false
+
+ @JvmField
+ var CHRISTMAS_EVENT_ENABLED = false
+
+ private val calendar: Calendar = Calendar.getInstance()
+ private val month = calendar.get(Calendar.MONTH)
+ private val day = calendar.get(Calendar.DAY_OF_MONTH)
+
+ @JvmStatic
+ fun implementHoliday() {
+ if (HOLIDAYS_ENABLED) {
+ when (month) {
+ 3 -> {
+ if (day <= 8) {
+ EASTER_EVENT_ENABLED = true
+ }
+ }
+ 9 -> HALLOWEEN_EVENT_ENABLED = true
+ 10 -> THANKSGIVING_EVENT_ENABLED = true
+ 11 -> CHRISTMAS_EVENT_ENABLED = DO_SNOW_DECEMBER
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/console/AutocompletionHints.kt b/Client/src/main/kotlin/org/rs09/client/console/AutocompletionHints.kt
new file mode 100644
index 000000000..533b2bba2
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/console/AutocompletionHints.kt
@@ -0,0 +1,7 @@
+package org.rs09.client.console
+
+data class AutocompletionHints(
+ val base: String,
+ val completions: List,
+ val totalSize: Int
+)
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt b/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt
new file mode 100644
index 000000000..a1c99db26
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/console/DeveloperConsole.kt
@@ -0,0 +1,639 @@
+package org.rs09.client.console
+
+import org.rs09.client.LinkableInt
+import org.rs09.client.config.GameConfig
+import org.rs09.client.filestore.resources.configs.enums.EnumDefinitionProvider
+import org.rs09.client.rendering.RenderingUtils
+import org.rs09.client.rendering.Toolkit
+import org.runite.client.*
+import java.awt.event.KeyEvent
+import java.io.ByteArrayInputStream;
+import java.nio.file.FileSystems;
+import java.nio.file.Files;
+import java.text.SimpleDateFormat
+import java.util.*
+import java.util.LinkedList
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream
+import javax.sound.sampled.AudioSystem;
+import java.lang.reflect.*;
+
+fun reflectFields(o: Any?, depth: Int): StringBuilder {
+ if(o == null) {
+ return StringBuilder("null")
+ }
+ if(depth == 0) {
+ return StringBuilder("${o}")
+ }
+ val clazz = (o as Object).getClass()
+ if(clazz.isArray()) {
+ val len = java.lang.reflect.Array.getLength(o)
+ var ret = StringBuilder("[")
+ for(i in 0 until len) {
+ ret.append(reflectFields(java.lang.reflect.Array.get(o, i), depth-1))
+ if(i != len-1) {
+ ret.append(", ")
+ }
+ }
+ ret.append("]")
+ return ret
+ } else if(clazz.isPrimitive() || o is Number || o is Boolean) {
+ return StringBuilder("${o}")
+ } else {
+ var ret = StringBuilder("${clazz.getName()} {")
+ val fields = clazz.getDeclaredFields()
+ for(i in 0 until fields.size) {
+ if(!fields[i].isAccessible()) {
+ fields[i].setAccessible(true)
+ }
+ ret.append("${fields[i].name}: ${reflectFields(fields[i].get(o), depth-1)}")
+ if(i != fields.size - 1) {
+ ret.append(", ")
+ }
+ }
+ ret.append("}")
+ return ret
+ }
+}
+
+// TODO Escape characters in the string rendering - is this something we can do using RSString / the text renders?
+object DeveloperConsole {
+
+ var ENABLE_PACKETS = false
+
+ private val CONSOLE_FONT
+ get() = FontType.plainFont
+
+ private val gameWidth //Offset 5 if in-game offset 20 if on login screen
+ get() = Unsorted.gameWindowWidth
+
+ private val LOCK = Any()
+
+ private const val HEIGHT = 300
+ private const val BACKGROUND_COLOR = 0x332277
+ private const val MAX_LINES = 100
+ private const val SCROLL_SPEED = 25
+
+ private val calendar = Calendar.getInstance()
+ private var tempBuffer: IntArray? = null
+ private val lines = LinkedList()
+ private var scrollOffset = 0
+ private var str: String = ""
+
+ var firstOpen = false
+ var selectedCompletion = 0
+ var autocompletions: AutocompletionHints? = null
+ set(t) {
+ field = t
+ selectedCompletion = 0
+ }
+
+ var open = false
+
+ fun toggle() {
+ open = !open
+ }
+
+ fun draw() {
+ if (!open) return
+
+ if (!firstOpen) {
+ println("This is the developer console. To close, press ALT + `")
+ firstOpen = true
+ }
+
+ val tk = Toolkit.getActiveToolkit()
+
+ when (Class83.getWindowType()) {
+ 0, 1 -> { //use gameWidth
+ val widthOffsets = if (Class143.gameStage <= 10) RenderingUtils.width else (gameWidth + 3)
+ tk.fillRect(0, 0, widthOffsets, HEIGHT, BACKGROUND_COLOR, 128)
+ tk.drawHorizontalLine(0, HEIGHT - 14 - 2, widthOffsets, -1)
+ RenderingUtils.drawTextSmall("Build: ${GameConfig.CLIENT_BUILD}", widthOffsets - 60, HEIGHT - 17, -1, 2)
+ RenderingUtils.drawText("--> $str", 3, HEIGHT - 2, -1, 2)
+ RenderingUtils.setClipping(0, 0, widthOffsets, HEIGHT - 16)
+ }
+ 2 -> { //use RenderingUtils.width
+ tk.fillRect(0, 0, RenderingUtils.width, HEIGHT, BACKGROUND_COLOR, 128)
+ tk.drawHorizontalLine(0, HEIGHT - 14 - 2, RenderingUtils.width, -1)
+ RenderingUtils.drawTextSmall(
+ "Build: ${GameConfig.CLIENT_BUILD}",
+ RenderingUtils.width - 60,
+ HEIGHT - 17,
+ -1,
+ 2
+ )
+ RenderingUtils.drawText("--> $str", 3, HEIGHT - 2, -1, 2)
+ RenderingUtils.setClipping(0, 0, RenderingUtils.width, HEIGHT - 16)
+ }
+ }
+
+ synchronized(LOCK) {
+ lines.forEachIndexed { i, line ->
+ RenderingUtils.drawText(
+ line,
+ 7,
+ scrollOffset + HEIGHT - 20 - i * 14,
+ -1,
+ 2
+ )
+ }
+ }
+ RenderingUtils.resetClipping()
+
+ // text height = 16
+ synchronized(LOCK) {
+ autocompletions?.apply {
+ val startX = CONSOLE_FONT.method682(RSString.of("-> $str"))
+ val boxHeight = 24 + 8 + completions.size * 14
+ val boxWidth = 8 + 8 + (completions.map { CONSOLE_FONT.method682(RSString.of(it)) }.maxOrNull() ?: 0)
+
+ tk.fillRect(startX, HEIGHT - 16 - boxHeight, boxWidth, boxHeight, 0x323232, 255)
+ RenderingUtils.drawRect(
+ startX + 3,
+ HEIGHT - 16 - boxHeight + 6,
+ boxWidth - 6,
+ boxHeight - 9 - 14,
+ 0x646464,
+ 200
+ )
+ tk.drawHorizontalLine(startX + 8, HEIGHT - 16 - boxHeight + 6, 75, 0x323232)
+ RenderingUtils.drawText(
+ RSString.parse("Completions"),
+ startX + 12,
+ HEIGHT - 17 - boxHeight + 12,
+ 0xffffff
+ )
+ RenderingUtils.drawText(
+ RSString.parse(" ${completions.size}/ $totalSize sent"),
+ startX + 4,
+ HEIGHT - 20,
+ 0xffffff
+ )
+
+// tk.fillRect(startX + 4, HEIGHT - 16 - boxHeight + 14, boxWidth - 8, boxHeight - 9 - 14 - 8 - 1, 0xff0000, 255)
+// RenderingUtils.setClipping(startX + 4, HEIGHT - 16 - boxHeight + 14, boxWidth - 8, boxHeight - 9 - 14 - 8 - 1)
+ completions.forEachIndexed { i, completion ->
+ if (selectedCompletion == i) {
+ tk.fillRect(startX + 4, HEIGHT - 6 - boxHeight + 4 + i * 14, boxWidth - 8, 14, 0x2a58a8, 255)
+ }
+ RenderingUtils.drawText(
+ RSString.of(completion),
+ startX + 6,
+ HEIGHT - 6 - boxHeight + 14 + i * 14,
+ 0xffffff
+ )
+ }
+// RenderingUtils.resetClipping()
+ }
+ }
+ }
+
+ fun println(line: String) {
+ calendar.time = Date(TimeUtils.time())
+ synchronized(LOCK) {
+ lines.addFirst(RSString.of("${SimpleDateFormat("HH:mm:ss").format(Date(TimeUtils.time()))}: --> $line"))
+
+ if (lines.size >= MAX_LINES) lines.removeLast()
+
+ if (scrollOffset != 0) {
+ val room = HEIGHT - 20
+ val max = lines.size * 14
+ val diff = max - room
+ if (scrollOffset < diff) {
+ scrollOffset += 14
+ if (scrollOffset > diff) scrollOffset = diff
+ }
+ }
+ }
+ }
+
+ fun preDraw() {
+ if (RenderingUtils.hd) return
+
+ val copy = IntArray(Toolkit.JAVA_TOOLKIT.buffer.size)
+ System.arraycopy(Toolkit.JAVA_TOOLKIT.buffer, 0, copy, 0, copy.size)
+ tempBuffer = copy
+ }
+
+ fun postDraw() {
+ if (RenderingUtils.hd) return
+
+ if (tempBuffer != null) {
+ System.arraycopy(tempBuffer!!, 0, Toolkit.JAVA_TOOLKIT.buffer, 0, Toolkit.JAVA_TOOLKIT.buffer.size)
+ }
+ tempBuffer = null
+ }
+
+ fun onConsoleInput(str: String) {
+// println(" [$h:$m:$s] TODO! Handle '$str'")
+
+ if (ENABLE_PACKETS) {
+ TextureOperation12.outgoingBuffer.putOpcode(51)
+ TextureOperation12.outgoingBuffer.writeShort(0)
+ val index = TextureOperation12.outgoingBuffer.index
+ TextureOperation12.outgoingBuffer.writeString(DeveloperConsole.str)
+ TextureOperation12.outgoingBuffer.finishVarshortPacket(
+ TextureOperation12.outgoingBuffer.index - index)
+ }
+
+ println(str)
+ val clientCommand: MutableList
+ val args: Any
+ val command: String = str
+ clientCommand = command.split(' ') as MutableList
+ val argSize = clientCommand.size
+
+ when (clientCommand[0]) {
+ "enableconsolepackets" -> {
+ ENABLE_PACKETS = true
+ println(" Enabled console packets!")
+ }
+ "quests" -> {
+ println(" ~~~~~ MINIQUESTS ~~~~~")
+ System.out.println("~~~~~ MINIQUESTS ~~~~~")
+ var lookup = EnumDefinitionProvider.provide(208)
+
+ for (i in 0..17) {
+ val component = (lookup.values!![i.toLong()]!! as LinkableInt).value
+
+ val rsiface = Unsorted.getRSInterface(component)
+ if (rsiface == null) println("Error: couldnt find component for hash $component")
+
+ println("$i: ${rsiface.text}")
+ System.out.println("name ${rsiface.text}, lookup id $i")
+ }
+
+ println(" ~~~~~ QUESTS ~~~~~")
+ System.out.println("~~~~~ QUESTS ~~~~~")
+ lookup = EnumDefinitionProvider.provide(209)
+
+ for (i in 0..130) {
+ val component = (lookup.values!![i.toLong()]!! as LinkableInt).value
+
+ val rsiface = Unsorted.getRSInterface(component)
+ if (rsiface == null) println("Error: couldnt find component for hash $component")
+
+ println("$i: ${rsiface.text}")
+ System.out.println("name ${rsiface.text}, lookup id $i")
+ }
+ }
+ "errormsg" -> {
+ if (argSize == 2) {
+ args = clientCommand[1].toIntOrNull() ?: -1
+ Client.messageToDisplay = args as Int
+ } else {
+ println("Error. Displays error message on login, account creation. Use: errormsg #")
+ }
+ }
+ "reflectstatic" -> {
+ if(argSize == 3) {
+ try {
+ val className = "org.runite.client.${clientCommand[1]}"
+ val fieldName = clientCommand[2];
+ val clazz = Class.forName(className);
+ val field = clazz.getDeclaredField(fieldName)
+ if(!field.isAccessible()) {
+ field.setAccessible(true)
+ }
+ val value = field.get(null);
+ val line = "${className}.${fieldName} == ${value} / ${reflectFields(value, 1)}"
+ System.out.println(line)
+ //println(line)
+ } catch(e: Exception) {
+ e.printStackTrace()
+ }
+ } else {
+ println("Usage: reflectstatic classname fieldname")
+ }
+ }
+ "dumpscript" -> {
+ if (argSize == 2) {
+ val i = clientCommand[1].toIntOrNull()
+ if(i != null) {
+ DumpingTools.DumpOpcodesToTextFile("script_${i}.cs2", i)
+ }
+ } else {
+ println("Error. Dumps a cs2 script. Use: dumpscript #")
+ }
+ }
+ "dumpobjs" -> {
+ if (argSize == 3) {
+ var beginID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ var endID = if (clientCommand[2].toIntOrNull() == null) 0 else clientCommand[2].toInt()
+ if (beginID > endID) {
+ val tmp = endID;
+ endID = beginID;
+ beginID = tmp;
+ }
+ try {
+ for(i in beginID..endID) {
+ val obj = ObjectDefinition.getObjectDefinition(i)
+ var line = "Object ${i} - ${obj.name} - ["
+ for(j in 0 until obj.options.size) {
+ line += "${obj.options[j]}"
+ if(j != obj.options.size - 1) {
+ line += ", "
+ }
+ }
+ line += "]"
+ line += " - ${obj.ConfigFileId} - ${obj.ConfigId}"
+ if(obj.ChildrenIds != null) {
+ line += " - ["
+ for(j in 0 until obj.ChildrenIds.size) {
+ line += "${obj.ChildrenIds[j]}"
+ if(j != obj.ChildrenIds.size - 1) {
+ line += ", "
+ }
+ }
+ line += "]"
+ }
+ println(line)
+ System.out.println(line)
+ }
+ } catch(e: Throwable) {
+ e.printStackTrace()
+ }
+ } else {
+ println("Usage: dumpobjs beginID endID")
+ }
+ }
+ "dumpanimsforitem" -> {
+ if (argSize >= 2) {
+ var beginID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ var endID = if(argSize > 2) clientCommand[2].toInt() else beginID
+ for(i in 0 until 16384) {
+ val anim = SequenceDefinition.getAnimationDefinition(i)
+ if((beginID <= anim.leftHandItem && anim.leftHandItem <= endID) ||
+ (beginID <= anim.rightHandItem && anim.rightHandItem <= endID)) {
+ //System.out.println("anim ${i}, item ${anim.rightHandItem}, ${reflectFields(anim, 2)}")
+ val frameStr = if(anim.frames != null && anim.frames.size > 0) { anim.frames[0] shr 16 } else { "null" }
+ System.out.println("anim ${i}, item ${anim.rightHandItem} ${anim.leftHandItem}, ${frameStr}")
+ }
+ }
+ }
+
+ }
+ "dumpnpcs" -> {
+ if (argSize == 3) {
+ var beginID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ var endID = if (clientCommand[2].toIntOrNull() == null) 0 else clientCommand[2].toInt()
+ if (beginID > endID) {
+ val tmp = endID;
+ endID = beginID;
+ beginID = tmp;
+ }
+ try {
+ for(i in beginID..endID) {
+ val npc = NPCDefinition.getNPCDefinition(i)
+ var line = "NPC ${i} - ${npc.NPCName} - ["
+ for(j in 0 until npc.options.size) {
+ line += "${npc.options[j]}"
+ if(j != npc.options.size - 1) {
+ line += ", "
+ }
+ }
+ line += "]"
+ line += " - ${npc.configId}"
+ println(line)
+ System.out.println(line)
+ }
+ } catch(e: Throwable) {}
+ } else {
+ println("Usage: dumpnpcs beginID endID")
+ }
+ }
+ "playsound" -> {
+ if (argSize == 4) {
+ val soundID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ val soundDelay = if (clientCommand[2].toIntOrNull() == null) 0 else clientCommand[2].toInt()
+ val soundVolume = if (clientCommand[3].toIntOrNull() == null) 0 else clientCommand[3].toInt()
+ AudioHandler.soundEffectHandler(soundVolume, soundID, soundDelay)
+ println("Playing sound: $soundID with delay: $soundDelay volume: $soundVolume")
+ } else {
+ println("Error. Plays sound effect. Use: playsound soundID soundDelay soundVolume")
+ }
+ }
+ "playsoundrange" -> {
+ if (argSize == 4) {
+ var beginID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ var endID = if (clientCommand[2].toIntOrNull() == null) 0 else clientCommand[2].toInt()
+ var delay = if (clientCommand[3].toIntOrNull() == null) 0 else clientCommand[3].toInt()
+ if (beginID > endID) {
+ val tmp = endID;
+ endID = beginID;
+ beginID = tmp;
+ }
+ Thread(object : Runnable {
+ override fun run() {
+ for (i in beginID..endID) {
+ println("Playing sound effect ${i}")
+ AudioHandler.soundEffectHandler(1, i, 0)
+ Thread.sleep(delay.toLong())
+ }
+ }
+ }).start()
+ } else {
+ println("Error. Plays sound effect. Use: playsoundrange beginID endID delay")
+ }
+ }
+ "dumpsfx" -> {
+ if (argSize == 3) {
+ var beginID = if (clientCommand[1].toIntOrNull() == null) 0 else clientCommand[1].toInt()
+ var endID = if (clientCommand[2].toIntOrNull() == null) 0 else clientCommand[2].toInt()
+ Thread(object : Runnable {
+ override fun run() {
+ Files.createDirectories(FileSystems.getDefault().getPath("sfx"))
+ for (i in beginID..endID) {
+ val sfx = SynthSound.create(CacheIndex.soundFXIndex, i, 0).toPCMSound()
+ println("len of ${i}: ${sfx.samples.size}")
+ val out = Files.newOutputStream(FileSystems.getDefault().getPath("sfx", String.format("sfx_%05d.wav", i)))
+ val format = AudioFormat(AudioFormat.Encoding.PCM_SIGNED, sfx.frequency.toFloat(), 8, 1, 1, sfx.frequency.toFloat(), false)
+ AudioSystem.write(
+ AudioInputStream(ByteArrayInputStream(sfx.samples), format, sfx.samples.size.toLong()),
+ AudioFileFormat.Type.WAVE,
+ out)
+ out.close()
+ }
+ }
+ }).start()
+ } else {
+ println("Error. Dumps sound effects. Use: dumpsfx beginID endID")
+ }
+ }
+ "playsong" -> {
+ if (argSize in 2..8) {
+ if (clientCommand[1].toIntOrNull() == null) {
+ clientCommand.removeFirst()
+ AudioHandler.musicHandler(
+ CacheIndex.musicIndex.getArchiveForName(
+ RSString.of(
+ clientCommand.joinToString(
+ " "
+ )
+ )
+ ).also { println("Playing song ID: $it - ${clientCommand.joinToString("")}") }
+ )
+ } else {
+ args = clientCommand[1].toInt()
+ AudioHandler.musicHandler(args)
+ }
+ } else {
+ println("Error. Plays music. Use: playsong # OR playsong songName")
+ }
+ }
+ "playsfx" -> {
+ if (argSize == 2) {
+ args = clientCommand[1].toIntOrNull() ?: -1
+ AudioHandler.musicEffectHandler(args as Int)
+ } else {
+ println("Error. Plays a music effect. Use: playeffectfx #")
+ }
+ }
+ "cstage" -> {
+ when (argSize) {
+ 1 -> {
+ println("Client.gameStage: " + Class143.gameStage)
+ println("LoginHandler.adminLoginStage: " + Class163_Sub1_Sub1.adminLoginStage)
+ println("LoginHandler.userLoginStage: " + LoginHandler.loginStage)
+ println("AccountRegistration.registryStage: " + Unsorted.registryStage)
+ println("WorldListMethods.worldStage: " + Class43.worldListStage)
+ }
+ 2 -> {
+ args = clientCommand[1]
+ when (args) {
+ "game" -> println("GameStateManager.gameState: " + Class143.gameStage)
+ "login" -> {
+ println("LoginHandler.adminLoginStage: " + Class163_Sub1_Sub1.adminLoginStage)
+ println("LoginHandler.userLoginStage: " + LoginHandler.loginStage)
+ }
+ "register" -> println("AccountRegistration.registryStage: " + Unsorted.registryStage)
+ "wl", "worldlist" -> println("WorldListMethods.worldStage: " + Class43.worldListStage)
+ else -> println("Error. Incorrect usage. Use clientstage or clientstage game/login/register/worldlist to see a specific stage")
+ }
+ }
+ else -> println("Error. Incorrect usage. Use clientstage or clientstage game/login/register/worldlist")
+ }
+ }
+ "worldlist" -> {
+ val worldArray = WorldListEntry.worldList
+ args = clientCommand[1]
+ when (args) {
+ "active" -> {
+ println("Active: ${WorldListEntry.activeWorldListSize} Update stamp: ${WorldListEntry.updateStamp}")
+ }
+ "world" -> {
+ if (argSize == 3) {
+ val worldId = clientCommand[2].toInt()
+ if (worldArray[worldId] != null) {
+ val world = worldArray[worldId]
+ println(
+ "ID: ${world.worldId} " +
+ "WHERE: ${world.countryIndex} " +
+ "MEM: ${world.isMembers} " +
+ "PVP: ${world.isPVP} " +
+ "Loot: ${world.isLootShare} " +
+ "QC: ${world.isQuickchat} " +
+ "DESC: ${world.activity} " +
+ "NET: ${world.address}:"
+ )
+ } else {
+ println("Requested world ($worldId) is OFFLINE or NULL")
+ }
+ } else {
+ println("Error. Incorrect usage. Use worldlist world worldID")
+ }
+ }
+ "goto" -> {
+ if (argSize == 3) {
+ val worldId = clientCommand[2].toInt()
+ if (worldArray[worldId] != null) {
+ CS2Script.userCurrentWorldID = worldId
+ } else {
+ println("Requested world ($worldId) is OFFLINE or NULL")
+ }
+ } else {
+ println("Error. Incorrect usage. Use: worldlist goto worldID")
+ }
+ }
+ else -> println("World list commands: active, world ID, goto ID")
+ }
+ }
+
+ else -> {
+ System.out.println("Console command: $str")
+ sendCommand(str)
+ }
+ }
+ }
+
+ fun handleKeyDown(evt: KeyEvent) {
+ if (evt.keyCode == KeyEvent.VK_DOWN) {
+ if (autocompletions != null) {
+ if (selectedCompletion + 1 < autocompletions?.completions?.size ?: 0)
+ selectedCompletion++
+ return
+ }
+
+ if (scrollOffset > SCROLL_SPEED) scrollOffset -= SCROLL_SPEED else scrollOffset = 0
+ } else if (evt.keyCode == KeyEvent.VK_UP) {
+ if (autocompletions != null) {
+ if (selectedCompletion > 0) selectedCompletion--
+ return
+ }
+
+ val room = HEIGHT - 20
+ val max = lines.size * 14
+ val diff = max - room
+ if (scrollOffset < diff) {
+ scrollOffset += SCROLL_SPEED
+ if (scrollOffset > diff) scrollOffset = diff
+ }
+ } else if (evt.keyCode == KeyEvent.VK_ESCAPE) {
+ synchronized(LOCK) {
+ autocompletions = null
+ }
+ }
+ }
+
+ fun handleKeyPressed(evt: KeyEvent) {
+ if (evt.keyChar == '`') return
+
+ when {
+ evt.keyChar == '\t' -> {
+ if (str.isEmpty()) return
+
+ if (ENABLE_PACKETS) {
+ TextureOperation12.outgoingBuffer.putOpcode(52)
+ TextureOperation12.outgoingBuffer.writeShort(0)
+ val index = TextureOperation12.outgoingBuffer.index
+ TextureOperation12.outgoingBuffer.writeString(str)
+ TextureOperation12.outgoingBuffer.finishVarshortPacket(
+ TextureOperation12.outgoingBuffer.index - index)
+ } else if ("enableconsolepackets".startsWith(str, true)) {
+ autocompletions = AutocompletionHints(str, listOf("enableconsolepackets"), 1)
+ }
+ }
+ evt.keyChar == '\n' -> {
+ if (autocompletions != null) {
+ str += autocompletions?.completions?.get(selectedCompletion) ?: ""
+ autocompletions = null
+ return
+ }
+
+ if (str.isNotBlank()) onConsoleInput(str.trim())
+ str = ""
+ }
+ evt.keyChar == '\b' && str.isNotEmpty() -> str = str.substring(0, str.length - 1)
+ else -> str += evt.keyChar
+ }
+ }
+
+ @JvmStatic
+ fun sendCommand(command: String) {
+ TextureOperation12.outgoingBuffer.putOpcode(44)
+ TextureOperation12.outgoingBuffer.writeByte(command.length + 2)
+ TextureOperation12.outgoingBuffer.writeString(command)
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/Parameter.kt b/Client/src/main/kotlin/org/rs09/client/constants/Parameter.kt
new file mode 100644
index 000000000..d5fbab7b7
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/Parameter.kt
@@ -0,0 +1,47 @@
+package org.rs09.client.constants
+
+object Parameter {
+
+ /**
+ * Modewhat
+ * DEFAULT: LIVE_SERVER 0
+ */
+ const val LIVE_SERVER = 0
+ const val RELEASE_CANDIDATE = 1
+ const val WORK_IN_PROGRESS = 2
+
+ /**
+ * Modewhere
+ * DEFAULT: LIVE_ENVIRONMENT 0
+ */
+ const val LIVE_ENVIRONMENT = 0
+ const val OFFICE_ENVIRONMENT = 1
+ const val LOCAL_ENVIRONMENT = 2
+
+ /**
+ * Language
+ * DEFAULT: LANGUAGE_ENGLISH 0
+ */
+ const val LANGUAGE_ENGLISH = 0
+ const val LANGUAGE_GERMAN = 1
+ const val LANGUAGE_FRENCH = 2
+
+ /**
+ * Game type
+ * DEFAULT: GAME_TYPE_RUNESCAPE 0 (game0)
+ *
+ * Runescape | Game type 0 has always been Runescape (current)
+ * Mechscape | Assuming this is what the game1 was (2007 - Oct 2009)
+ * Stellar Dawn | Overhaul of 'Mechscape' (July 2010 - Stuck in corporate hell)
+ */
+ const val GAME_TYPE_RUNESCAPE = 0
+ const val GAME_TYPE_MECHSCAPE = 1
+
+ /**
+ * Affiliate ID
+ * DEFAULT: NO_AFFILIATE 0
+ */
+ const val NO_AFFILIATE = 0
+ const val SHARE_DETAILS_AFFILIATE = 99
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/gametype/MechscapeGameAppearance.kt b/Client/src/main/kotlin/org/rs09/client/constants/gametype/MechscapeGameAppearance.kt
new file mode 100644
index 000000000..8affc513e
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/gametype/MechscapeGameAppearance.kt
@@ -0,0 +1,19 @@
+package org.rs09.client.constants.gametype
+
+object MechscapeGameAppearance {
+
+ val aShortArrayArray1619 = arrayOf(shortArrayOf(10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort()), shortArrayOf(10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10347.toShort(), 10582.toShort(), 10429.toShort(), 10407.toShort(), 10359.toShort(), 8414.toShort(), 9540.toShort(), 10456.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort()), shortArrayOf(10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort()), shortArrayOf(4300.toShort(), 3294.toShort(), 3303.toShort(), 3264.toShort(), 4506.toShort(), 4382.toShort(), 4387.toShort(), 5293.toShort(), 7622.toShort(), 7384.toShort(), 8412.toShort(), 7496.toShort(), 86.toShort(), 123.toShort(), 111.toShort(), 99.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 13766.toShort(), 13745.toShort(), 13726.toShort(), 13890.toShort(), 13743.toShort(), 13852.toShort(), 17602.toShort(), 18605.toShort(), 21660.toShort(), 24000.toShort(), 24997.toShort(), 24088.toShort(), 27972.toShort(), 25903.toShort(), 26904.toShort(), 27193.toShort(), 27175.toShort(), 27156.toShort(), 30020.toShort(), 28975.toShort(), 29976.toShort(), 12482.toShort(), 13485.toShort(), 10392.toShort(), 10692.toShort(), 10669.toShort(), 10776.toShort(), 6717.toShort(), 6695.toShort(), 7830.toShort(), 6971.toShort(), 6951.toShort(), 5910.toShort(), 3389.toShort(), 3369.toShort(), 3356.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort()), shortArrayOf(10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort(), 10.toShort(), 30.toShort(), 50.toShort(), 70.toShort(), 90.toShort(), 110.toShort(), 310.toShort(), 684.toShort(), 704.toShort(), 556.toShort(), 940.toShort(), 960.toShort(), 6454.toShort(), 6952.toShort(), 6972.toShort(), 2358.toShort(), 2732.toShort(), 2752.toShort(), 10550.toShort(), 10924.toShort(), 10944.toShort(), 10310.toShort(), 10556.toShort(), 10576.toShort(), 14646.toShort(), 15020.toShort(), 15040.toShort(), 19766.toShort(), 20140.toShort(), 20160.toShort(), (-29386).toShort(), (-29012).toShort(), (-28992).toShort(), 31030.toShort(), 31276.toShort(), 31296.toShort(), (-24266).toShort(), (-23892).toShort(), (-23872).toShort(), (-19146).toShort(), (-18772).toShort(), (-18752).toShort(), (-14026).toShort(), (-13652).toShort(), (-13632).toShort(), (-6858).toShort(), (-6484).toShort(), (-6464).toShort(), 522.toShort(), 542.toShort(), 6794.toShort(), 6814.toShort(), 11018.toShort(), 11038.toShort(), 14986.toShort(), 15006.toShort(), 21130.toShort(), 21150.toShort(), (-28918).toShort(), (-28898).toShort(), (-22006).toShort(), (-21986).toShort(), (-12918).toShort(), (-12898).toShort()))
+
+ val aShortArrayArray2634 = arrayOf(shortArrayOf(0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 4.toShort(), 24.toShort(), 44.toShort(), 64.toShort(), 84.toShort(), 104.toShort(), 304.toShort(), 678.toShort(), 698.toShort(), 550.toShort(), 934.toShort(), 954.toShort(), 6448.toShort(), 6946.toShort(), 6966.toShort(), 2352.toShort(), 2726.toShort(), 2746.toShort(), 10544.toShort(), 10918.toShort(), 10938.toShort(), 10304.toShort(), 10550.toShort(), 10570.toShort(), 14640.toShort(), 15014.toShort(), 15034.toShort(), 19760.toShort(), 20134.toShort(), 20154.toShort(), (-29392).toShort(), (-29018).toShort(), (-28998).toShort(), 31024.toShort(), 31270.toShort(), 31290.toShort(), (-24272).toShort(), (-23898).toShort(), (-23878).toShort(), (-19152).toShort(), (-18778).toShort(), (-18758).toShort(), (-14032).toShort(), (-13658).toShort(), (-13638).toShort(), (-6864).toShort(), (-6490).toShort(), (-6470).toShort(), 516.toShort(), 536.toShort(), 6788.toShort(), 6808.toShort(), 11012.toShort(), 11032.toShort(), 14980.toShort(), 15000.toShort(), 21124.toShort(), 21144.toShort(), (-28924).toShort(), (-28904).toShort(), (-22012).toShort(), (-21992).toShort(), (-12924).toShort(), (-12904).toShort()), shortArrayOf(0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 10339.toShort(), 10574.toShort(), 10425.toShort(), 10398.toShort(), 10345.toShort(), 7512.toShort(), 8507.toShort(), 7378.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort()), shortArrayOf(0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 4.toShort(), 24.toShort(), 44.toShort(), 64.toShort(), 84.toShort(), 104.toShort(), 304.toShort(), 678.toShort(), 698.toShort(), 550.toShort(), 934.toShort(), 954.toShort(), 6448.toShort(), 6946.toShort(), 6966.toShort(), 2352.toShort(), 2726.toShort(), 2746.toShort(), 10544.toShort(), 10918.toShort(), 10938.toShort(), 10304.toShort(), 10550.toShort(), 10570.toShort(), 14640.toShort(), 15014.toShort(), 15034.toShort(), 19760.toShort(), 20134.toShort(), 20154.toShort(), (-29392).toShort(), (-29018).toShort(), (-28998).toShort(), 31024.toShort(), 31270.toShort(), 31290.toShort(), (-24272).toShort(), (-23898).toShort(), (-23878).toShort(), (-19152).toShort(), (-18778).toShort(), (-18758).toShort(), (-14032).toShort(), (-13658).toShort(), (-13638).toShort(), (-6864).toShort(), (-6490).toShort(), (-6470).toShort(), 516.toShort(), 536.toShort(), 6788.toShort(), 6808.toShort(), 11012.toShort(), 11032.toShort(), 14980.toShort(), 15000.toShort(), 21124.toShort(), 21144.toShort(), (-28924).toShort(), (-28904).toShort(), (-22012).toShort(), (-21992).toShort(), (-12924).toShort(), (-12904).toShort()), shortArrayOf(0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 13753.toShort(), 13737.toShort(), 13719.toShort(), 13883.toShort(), 13863.toShort(), 13974.toShort(), 19643.toShort(), 18601.toShort(), 16532.toShort(), 23993.toShort(), 25121.toShort(), 24980.toShort(), 26944.toShort(), 26921.toShort(), 24854.toShort(), 27191.toShort(), 27171.toShort(), 26130.toShort(), 26941.toShort(), 28696.toShort(), 30100.toShort(), 12477.toShort(), 10407.toShort(), 10388.toShort(), 10685.toShort(), 10665.toShort(), 10646.toShort(), 6711.toShort(), 6693.toShort(), 6674.toShort(), 6965.toShort(), 7073.toShort(), 7056.toShort(), 2361.toShort(), 4387.toShort(), 3346.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort()), shortArrayOf(0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 0.toShort(), 4.toShort(), 24.toShort(), 44.toShort(), 64.toShort(), 84.toShort(), 104.toShort(), 304.toShort(), 678.toShort(), 698.toShort(), 550.toShort(), 934.toShort(), 954.toShort(), 6448.toShort(), 6946.toShort(), 6966.toShort(), 2352.toShort(), 2726.toShort(), 2746.toShort(), 10544.toShort(), 10918.toShort(), 10938.toShort(), 10304.toShort(), 10550.toShort(), 10570.toShort(), 14640.toShort(), 15014.toShort(), 15034.toShort(), 19760.toShort(), 20134.toShort(), 20154.toShort(), (-29392).toShort(), (-29018).toShort(), (-28998).toShort(), 31024.toShort(), 31270.toShort(), 31290.toShort(), (-24272).toShort(), (-23898).toShort(), (-23878).toShort(), (-19152).toShort(), (-18778).toShort(), (-18758).toShort(), (-14032).toShort(), (-13658).toShort(), (-13638).toShort(), (-6864).toShort(), (-6490).toShort(), (-6470).toShort(), 516.toShort(), 536.toShort(), 6788.toShort(), 6808.toShort(), 11012.toShort(), 11032.toShort(), 14980.toShort(), 15000.toShort(), 21124.toShort(), 21144.toShort(), (-28924).toShort(), (-28904).toShort(), (-22012).toShort(), (-21992).toShort(), (-12924).toShort(), (-12904).toShort()))
+
+ val aShortArray63 = shortArrayOf(
+ 960.toShort(),
+ 957.toShort(), (-21568).toShort(), (-21571).toShort(), 22464.toShort()
+ )
+
+ val aShortArray2219 = shortArrayOf(
+ (-4160).toShort(),
+ (-4163).toShort(), (-8256).toShort(), (-8259).toShort(), 22461.toShort()
+ )
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/gametype/RunescapeGameAppearance.kt b/Client/src/main/kotlin/org/rs09/client/constants/gametype/RunescapeGameAppearance.kt
new file mode 100644
index 000000000..78e5ef16c
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/gametype/RunescapeGameAppearance.kt
@@ -0,0 +1,181 @@
+package org.rs09.client.constants.gametype
+
+object RunescapeGameAppearance {
+
+ /**
+ * Game type RUNESCAPE appearance values
+ */
+
+ val aShortArrayArray3654 = arrayOf(
+ shortArrayOf(
+ 6798.toShort(),
+ 107.toShort(),
+ 10283.toShort(),
+ 16.toShort(),
+ 4797.toShort(),
+ 7744.toShort(),
+ 5799.toShort(),
+ 4634.toShort(),
+ (-31839).toShort(),
+ 22433.toShort(),
+ 2983.toShort(),
+ (-11343).toShort(),
+ 8.toShort(),
+ 5281.toShort(),
+ 10438.toShort(),
+ 3650.toShort(),
+ (-27322).toShort(),
+ (-21845).toShort(),
+ 200.toShort(),
+ 571.toShort(),
+ 908.toShort(),
+ 21830.toShort(),
+ 28946.toShort(),
+ (-15701).toShort(),
+ (-14010).toShort()
+ ),
+ shortArrayOf(
+ 8741.toShort(),
+ 12.toShort(),
+ (-1506).toShort(),
+ (-22374).toShort(),
+ 7735.toShort(),
+ 8404.toShort(),
+ 1701.toShort(),
+ (-27106).toShort(),
+ 24094.toShort(),
+ 10153.toShort(),
+ (-8915).toShort(),
+ 4783.toShort(),
+ 1341.toShort(),
+ 16578.toShort(),
+ (-30533).toShort(),
+ 25239.toShort(),
+ 8.toShort(),
+ 5281.toShort(),
+ 10438.toShort(),
+ 3650.toShort(),
+ (-27322).toShort(),
+ (-21845).toShort(),
+ 200.toShort(),
+ 571.toShort(),
+ 908.toShort(),
+ 21830.toShort(),
+ 28946.toShort(),
+ (-15701).toShort(),
+ (-14010).toShort()
+ ),
+ shortArrayOf(
+ 25238.toShort(),
+ 8742.toShort(),
+ 12.toShort(),
+ (-1506).toShort(),
+ (-22374).toShort(),
+ 7735.toShort(),
+ 8404.toShort(),
+ 1701.toShort(),
+ (-27106).toShort(),
+ 24094.toShort(),
+ 10153.toShort(),
+ (-8915).toShort(),
+ 4783.toShort(),
+ 1341.toShort(),
+ 16578.toShort(),
+ (-30533).toShort(),
+ 8.toShort(),
+ 5281.toShort(),
+ 10438.toShort(),
+ 3650.toShort(),
+ (-27322).toShort(),
+ (-21845).toShort(),
+ 200.toShort(),
+ 571.toShort(),
+ 908.toShort(),
+ 21830.toShort(),
+ 28946.toShort(),
+ (-15701).toShort(),
+ (-14010).toShort()
+ ),
+ shortArrayOf(4626.toShort(), 11146.toShort(), 6439.toShort(), 12.toShort(), 4758.toShort(), 10270.toShort()),
+ shortArrayOf(
+ 4550.toShort(),
+ 4537.toShort(),
+ 5681.toShort(),
+ 5673.toShort(),
+ 5790.toShort(),
+ 6806.toShort(),
+ 8076.toShort(),
+ 4574.toShort()
+ )
+ ) //Appearance Colors
+
+ val aShortArray3349 = shortArrayOf(
+ (-10304).toShort(),
+ 9104.toShort(), (-1).toShort(), (-1).toShort(), (-1).toShort()
+ )
+
+ val aShortArrayArray435 = arrayOf(
+ shortArrayOf(
+ 6554.toShort(),
+ 115.toShort(),
+ 10304.toShort(),
+ 28.toShort(),
+ 5702.toShort(),
+ 7756.toShort(),
+ 5681.toShort(),
+ 4510.toShort(),
+ (-31835).toShort(),
+ 22437.toShort(),
+ 2859.toShort(),
+ (-11339).toShort(),
+ 16.toShort(),
+ 5157.toShort(),
+ 10446.toShort(),
+ 3658.toShort(),
+ (-27314).toShort(),
+ (-21965).toShort(),
+ 472.toShort(),
+ 580.toShort(),
+ 784.toShort(),
+ 21966.toShort(),
+ 28950.toShort(),
+ (-15697).toShort(),
+ (-14002).toShort()
+ ), shortArrayOf(
+ 9104.toShort(),
+ 10275.toShort(),
+ 7595.toShort(),
+ 3610.toShort(),
+ 7975.toShort(),
+ 8526.toShort(),
+ 918.toShort(),
+ (-26734).toShort(),
+ 24466.toShort(),
+ 10145.toShort(),
+ (-6882).toShort(),
+ 5027.toShort(),
+ 1457.toShort(),
+ 16565.toShort(),
+ (-30545).toShort(),
+ 25486.toShort(),
+ 24.toShort(),
+ 5392.toShort(),
+ 10429.toShort(),
+ 3673.toShort(),
+ (-27335).toShort(),
+ (-21957).toShort(),
+ 192.toShort(),
+ 687.toShort(),
+ 412.toShort(),
+ 21821.toShort(),
+ 28835.toShort(),
+ (-15460).toShort(),
+ (-14019).toShort()
+ ), ShortArray(0), ShortArray(0), ShortArray(0)
+ )
+
+ val aShortArray3011 = shortArrayOf(
+ 6798.toShort(),
+ 8741.toShort(), 25238.toShort(), 4626.toShort(), 4550.toShort()
+ )
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/login/LoginMessageToDisplay.kt b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginMessageToDisplay.kt
new file mode 100644
index 000000000..a33c7330a
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginMessageToDisplay.kt
@@ -0,0 +1,39 @@
+package org.rs09.client.constants.login
+
+object LoginMessageToDisplay {
+
+ const val CONNECTION_TIMED_OUT = -5
+ const val ERROR_CONNECTING_TO_SERVER = -4
+ const val PERFORMING_LOGIN = -3
+ const val ENTER_USERNAME_AND_PASSWORD = -2
+
+ const val COULD_NOT_DISPLAY_VIDEO_AD = 1
+ const val UNEXPECTED_SERVER_RESPONSE_2 = 2
+ const val INVALID_USER_OR_PASSWORD = 3
+ const val ACCOUNT_DISABLED = 4
+ const val ACCOUNT_STILL_LOGGED_IN = 5
+ const val GAME_HAS_UPDATED = 6
+ const val WORLD_IS_FULL = 7
+ const val LOGIN_SERVER_OFFLINE = 8
+ const val TOO_MANY_CONNECTIONS = 9
+ const val BAD_SESSION_ID = 10
+ const val WEAK_PASSWORD_ALERT = 11
+ const val NON_MEMBERS_ACCOUNT = 12
+ const val COULD_NOT_COMPLETE_LOGIN = 13
+ const val SERVER_BEING_UPDATED_WAIT = 14
+ const val UNEXPECTED_SERVER_RESPONSE_15 = 15
+ const val MAX_INCORRECT_LOGIN_AMOUNT = 16
+ const val FREE_ACCOUNT_IN_MEMBERS_AREA = 17
+ const val LOCKED_ACCOUNT_STOLEN = 18
+ const val FULLSCREEN_MEMBERS_ONLY = 19
+ const val MALFORMED_LOGIN_PACKET = 22
+ const val NO_LOGIN_SERVER_REPLY = 23
+ const val ERROR_LOADING_PROFILE = 24
+ const val MAC_BANNED = 26
+ const val SERVICE_UNAVAILABLE = 27
+ const val NON_MEMBER_MEMBER_LOGIN = 30
+
+ //Additive/Specialized responses displayed || LoginServerResponse REQUIREMENT_WORLD (29)
+ const val PVP_COMBAT_MINIMUM_LEVEL_20 = 0
+ const val PVP_CARRYING_LENT_ITEMS = 1
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/login/LoginOutgoingOpcode.kt b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginOutgoingOpcode.kt
new file mode 100644
index 000000000..9b0a6f63f
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginOutgoingOpcode.kt
@@ -0,0 +1,13 @@
+package org.rs09.client.constants.login
+
+object LoginOutgoingOpcode {
+
+ /**
+ * Networking
+ */
+ const val INITIAL_CONNECTION = 14
+ const val USER_RECONNECTING_LOGIN = 16
+ const val USER_ADVERTISEMENT_FINISHED = 17
+ const val USER_NORMAL_LOGIN = 18
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/login/LoginReceivedOpcode.kt b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginReceivedOpcode.kt
new file mode 100644
index 000000000..b7f885240
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginReceivedOpcode.kt
@@ -0,0 +1,15 @@
+package org.rs09.client.constants.login
+
+object LoginReceivedOpcode {
+
+ /**
+ * Received server responses
+ */
+ const val SUCCESSFUL_CONNECTION = 0
+ const val DISPLAY_ADVERTISEMENT = 1
+ const val SUCCESS = 2
+ const val PROFILE_TRANSFERRING = 21
+ const val NO_LOGIN_SERVER_REPLY = 23
+ const val REQUIREMENT_WORLD = 29
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/constants/login/LoginStage.kt b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginStage.kt
new file mode 100644
index 000000000..544948e24
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/constants/login/LoginStage.kt
@@ -0,0 +1,17 @@
+package org.rs09.client.constants.login
+
+object LoginStage {
+
+ const val ERROR_CHECK_SET_PORTS = 0
+ const val INITIALIZE_SOCKET = 1
+ const val INITIATE_USER_LOGIN = 2
+ const val SEND_ENCRYPT_USER_CREDENTIALS = 3
+ const val RECEIVE_SERVER_RESPONSE = 4
+ const val SEND_ADVERTISEMENT_TO_USER = 5
+ const val FINISH_DISPLAYING_ADVERTISEMENT = 6
+ const val DISPLAY_PROFILE_TRANSFERRING = 7
+ const val LOGIN_ACCEPTED_GET_USER_DATA = 8
+ const val FINISH_USER_LOGIN_SETUP = 9
+ const val DISPLAY_REQUIREMENT_WORLD_RESPONSE = 10
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/HashTable.kt b/Client/src/main/kotlin/org/rs09/client/data/HashTable.kt
new file mode 100644
index 000000000..591c89513
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/HashTable.kt
@@ -0,0 +1,134 @@
+package org.rs09.client.data
+
+import org.rs09.client.Linkable
+import java.util.*
+
+class HashTable(var capacity: Int) {
+ private var retrievalLinkable: Linkable? = null
+ private var iterationLinkable: Linkable? = null
+ private var retrievalKey: Long = 0
+ private var iterationIndex = 0
+
+ var buckets: Array = arrayOfNulls(capacity)
+
+ fun clear() {
+ var i = 0
+ while (i < capacity) {
+ val bucket = buckets[i]
+ while (true) {
+ val next = bucket!!.next
+ if (bucket === next) {
+ ++i
+ break
+ }
+ next!!.unlink()
+ }
+ }
+ iterationLinkable = null
+ retrievalLinkable = null
+ }
+
+ fun first(): T? {
+ iterationIndex = 0
+ return next()
+ }
+
+ operator fun next(): T? {
+ var next: Linkable?
+ if (iterationIndex > 0 && iterationLinkable !== buckets[iterationIndex - 1]) {
+ next = iterationLinkable
+ } else {
+ do {
+ if (capacity <= iterationIndex) {
+ return null
+ }
+ next = buckets[iterationIndex++]!!.next
+ } while (buckets[iterationIndex + -1] === next)
+ }
+ iterationLinkable = next!!.next
+ return next as? T
+ }
+
+ fun put(key: Long, value: T) {
+ if (value!!.previous != null) {
+ value.unlink()
+ }
+ val bucket = buckets[(key and (capacity - 1).toLong()).toInt()]
+ value.next = bucket
+ value.linkableKey = key
+ value.previous = bucket!!.previous
+ value.previous!!.next = value
+ value.next!!.previous = value
+ }
+
+ operator fun get(key: Long): T? {
+ retrievalKey = key
+ val head = Objects.requireNonNull(buckets)[(key and (capacity - 1).toLong()).toInt()]!!
+ retrievalLinkable = head.next
+ while (head !== retrievalLinkable) {
+ if (retrievalLinkable!!.linkableKey == key) {
+ val value = retrievalLinkable
+ retrievalLinkable = retrievalLinkable!!.next
+ return value as T?
+ }
+ retrievalLinkable = retrievalLinkable!!.next
+ }
+ retrievalLinkable = null
+ return null
+ }
+
+ fun size(): Int {
+ var size = 0
+ for (i in 0 until capacity) {
+ val bucket = buckets[i]
+ var next = bucket!!.next
+ while (next !== bucket) {
+ next = next!!.next
+ ++size
+ }
+ }
+ return size
+ }
+
+ fun values(values: Array) {
+ var count = 0
+ for (i in 0 until capacity) {
+ val head = buckets[i]
+ var next = head!!.next
+ while (next !== head) {
+ values[count++] = next as T?
+ next = next!!.next
+ }
+ }
+ }
+
+ fun nextInBucket(): T? {
+ if (retrievalLinkable == null) {
+ return null
+ }
+ val linkable = buckets[(retrievalKey and (-1 + capacity).toLong()).toInt()]
+ while (linkable !== retrievalLinkable) {
+ if (retrievalLinkable!!.linkableKey == retrievalKey) {
+ val value = retrievalLinkable
+ retrievalLinkable = retrievalLinkable!!.next
+ return value as T?
+ }
+ retrievalLinkable = retrievalLinkable!!.next
+ }
+ retrievalLinkable = null
+ return null
+ }
+
+ fun capacity(): Int {
+ return capacity
+ }
+
+ init {
+ for (i in 0 until capacity) {
+ val bucket = Linkable()
+ buckets[i] = bucket
+ bucket.previous = bucket
+ bucket.next = bucket
+ }
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/data/NodeCache.kt b/Client/src/main/kotlin/org/rs09/client/data/NodeCache.kt
new file mode 100644
index 000000000..2477b4fb2
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/NodeCache.kt
@@ -0,0 +1,61 @@
+package org.rs09.client.data
+
+import org.rs09.client.Node
+import java.util.*
+
+// TODO Better name
+class NodeCache(private val capacity: Int) {
+ private var empty = Node()
+ private val table: HashTable
+ private var remaining: Int
+ private val history = Queue()
+
+ operator fun get(key: Long): T? {
+ val value = table[key]
+ if (value != null) {
+ history.offer(value)
+ }
+ return value
+ }
+
+ fun first(): T? {
+ return table.first()
+ }
+
+ fun put(key: Long, value: T) {
+ if (remaining == 0) {
+ var history: Node? = history.poll()
+ Objects.requireNonNull(history)!!.unlink()
+ history!!.unlinkNode()
+ if (empty === history) {
+ history = this.history.poll()
+ Objects.requireNonNull(history)!!.unlink()
+ history!!.unlinkNode()
+ }
+ } else {
+ remaining--
+ }
+ table.put(key, value)
+ history.offer(value)
+ }
+
+ operator fun next(): T? {
+ return table.next()
+ }
+
+ fun clear() {
+ history.clear()
+ table.clear()
+ empty = Node()
+ this.remaining = capacity
+ }
+
+ init {
+ this.remaining = capacity
+ var size = 1
+ while (size - -size < remaining) {
+ size += size
+ }
+ table = HashTable(size)
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/data/Queue.kt b/Client/src/main/kotlin/org/rs09/client/data/Queue.kt
new file mode 100644
index 000000000..97f7f5dc0
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/Queue.kt
@@ -0,0 +1,73 @@
+package org.rs09.client.data
+
+import org.rs09.client.Node
+
+class Queue {
+ private val tail = Node()
+ private var current: Node? = null
+
+ fun size(): Int {
+ var size = 0
+ var var3 = tail.nextNode
+ while (var3 !== tail) {
+ var3 = var3!!.nextNode
+ ++size
+ }
+ return size
+ }
+
+ fun getFront(): T? {
+ val front = tail.nextNode
+ if (tail === front) {
+ current = null
+ return null
+ }
+ current = front!!.nextNode
+ return front as T?
+ }
+
+ fun poll(): T? {
+ val next = tail.nextNode
+ if (next === tail) {
+ return null
+ }
+ next!!.unlinkNode()
+ return next as T?
+ }
+
+ operator fun next(): T? {
+ val current = current
+ if (current === tail) {
+ this.current = null
+ return null
+ }
+ this.current = current!!.nextNode
+ return current as T?
+ }
+
+ fun offer(node: T) {
+ if (node!!.previousNode != null) {
+ node.unlinkNode()
+ }
+ node.previousNode = tail.previousNode
+ node.nextNode = tail
+ node.previousNode!!.nextNode = node
+ node.nextNode!!.previousNode = node
+ }
+
+ fun clear() {
+ while (true) {
+ val next = tail.nextNode
+ if (tail === next) {
+ current = null
+ return
+ }
+ next!!.unlinkNode()
+ }
+ }
+
+ init {
+ tail.nextNode = tail
+ tail.previousNode = tail
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/data/ReferenceCache.kt b/Client/src/main/kotlin/org/rs09/client/data/ReferenceCache.kt
new file mode 100644
index 000000000..2ab019603
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/ReferenceCache.kt
@@ -0,0 +1,125 @@
+package org.rs09.client.data
+
+import org.rs09.client.Node.Companion.splice
+import org.rs09.client.data.reference.HardObjectReference
+import org.rs09.client.data.reference.ObjectReference
+import org.rs09.client.data.reference.SoftObjectReferenceTransformer.transform
+import java.util.*
+
+class ReferenceCache(capacity: Int) {
+ private var remaining: Int
+ private val capacity: Int
+ private val history = Queue>()
+ private val table: HashTable>
+
+ fun put(value: T, key: Long) {
+ this.remove(key)
+ if (remaining == 0) {
+ val last = history.poll()!!
+ Objects.requireNonNull(last).unlink()
+ last.unlinkNode()
+ } else {
+ remaining--
+ }
+ val reference = HardObjectReference(value)
+ table.put(key, reference)
+ history.offer(reference)
+ reference.nodeKey = 0L
+ }
+
+ // TODO I added the return value here, but is that OK or will it break things
+ fun remove(key: Long): T? {
+ val previous = table[key]
+ if (previous != null) {
+ previous.unlink()
+ previous.unlinkNode()
+ remaining++
+ return previous.getValue()
+ }
+ return null
+ }
+
+ fun hardCount(): Int {
+ var count = 0
+ var reference = history.getFront()
+ while (reference != null) {
+ if (!reference.isSoftReference()) {
+ count++
+ }
+ reference = history.next()
+ }
+ return count
+ }
+
+ fun sweep(maximumAge: Int) {
+ var reference: ObjectReference? = history.getFront()
+ while (null != reference) {
+ if (!reference.isSoftReference()) {
+ if (++reference.nodeKey > maximumAge.toLong()) {
+ val soft: ObjectReference = transform(reference)
+ table.put(reference.linkableKey, soft)
+ splice(reference, soft)
+ reference.unlink()
+ reference.unlinkNode()
+ }
+ } else if (null == reference.getValue()) {
+ reference.unlink()
+ reference.unlinkNode()
+ ++remaining
+ }
+ reference = history.next()
+ }
+ }
+
+ fun clearSoftReferences() {
+ var reference = history.getFront()
+ while (reference != null) {
+ if (reference.isSoftReference()) {
+ reference.unlink()
+ reference.unlinkNode()
+ remaining++
+ }
+ reference = history.next()
+ }
+ }
+
+ fun clear() {
+ history.clear()
+ table.clear()
+ remaining = capacity
+ }
+
+ operator fun get(key: Long): T? {
+ val reference = table[key] ?: return null
+ val value = reference.getValue()
+ return if (value == null) {
+ reference.unlink()
+ reference.unlinkNode()
+ remaining++
+ null
+ } else {
+ if (reference.isSoftReference()) {
+ val hard = HardObjectReference(value)
+ table.put(reference.linkableKey, hard)
+ history.offer(hard)
+ hard.nodeKey = 0L
+ reference.unlink()
+ reference.unlinkNode()
+ } else {
+ history.offer(reference)
+ reference.nodeKey = 0L
+ }
+ value
+ }
+ }
+
+ init {
+ var size = 1
+ while (size + size < capacity) {
+ size += size
+ }
+ this.capacity = capacity
+ remaining = capacity
+ table = HashTable(size)
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/reference/HardObjectReference.kt b/Client/src/main/kotlin/org/rs09/client/data/reference/HardObjectReference.kt
new file mode 100644
index 000000000..3d10fda86
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/reference/HardObjectReference.kt
@@ -0,0 +1,6 @@
+package org.rs09.client.data.reference
+
+class HardObjectReference(private val value: T?) : ObjectReference() {
+ override fun getValue(): T? = value
+ override fun isSoftReference(): Boolean = false
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/reference/ObjectReference.kt b/Client/src/main/kotlin/org/rs09/client/data/reference/ObjectReference.kt
new file mode 100644
index 000000000..c24c40471
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/reference/ObjectReference.kt
@@ -0,0 +1,8 @@
+package org.rs09.client.data.reference
+
+import org.rs09.client.Node
+
+abstract class ObjectReference: Node() {
+ abstract fun getValue(): T?
+ abstract fun isSoftReference(): Boolean
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/reference/ReferenceTransformer.kt b/Client/src/main/kotlin/org/rs09/client/data/reference/ReferenceTransformer.kt
new file mode 100644
index 000000000..1ecb91561
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/reference/ReferenceTransformer.kt
@@ -0,0 +1,5 @@
+package org.rs09.client.data.reference
+
+abstract class ReferenceTransformer {
+ abstract fun transform(from: ObjectReference): ObjectReference
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReference.kt b/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReference.kt
new file mode 100644
index 000000000..d247115f7
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReference.kt
@@ -0,0 +1,10 @@
+package org.rs09.client.data.reference
+
+import java.lang.ref.SoftReference
+
+class SoftObjectReference(value: T?) : ObjectReference() {
+ private val value = SoftReference(value)
+
+ override fun getValue(): T? = value.get()
+ override fun isSoftReference(): Boolean = true
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReferenceTransformer.kt b/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReferenceTransformer.kt
new file mode 100644
index 000000000..2aef55c0c
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/data/reference/SoftObjectReferenceTransformer.kt
@@ -0,0 +1,8 @@
+package org.rs09.client.data.reference
+
+/**
+ * Transforms all references it receives into soft references
+ */
+object SoftObjectReferenceTransformer : ReferenceTransformer() {
+ override fun transform(from: ObjectReference): ObjectReference = SoftObjectReference(from.getValue())
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/LookupTable.kt b/Client/src/main/kotlin/org/rs09/client/filestore/LookupTable.kt
new file mode 100644
index 000000000..e90c7de80
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/LookupTable.kt
@@ -0,0 +1,40 @@
+package org.rs09.client.filestore
+
+class LookupTable(identifiers: IntArray) {
+ private val table: IntArray
+
+ operator fun get(identifier: Int): Int {
+ val mask = (table.size shr 1) + -1
+ var i = mask and identifier
+
+ while (true) {
+ val id = table[1 + i + i]
+ if (id == -1) {
+ return -1
+ }
+ if (identifier == table[i + i]) {
+ return id
+ }
+ i = i - -1 and mask
+ }
+ }
+
+ init {
+ var i = 1
+ while (i <= (identifiers.size shr 1) + identifiers.size) {
+ i = i shl 1
+ }
+
+ table = IntArray(i + i)
+ for (j in 0 until i + i) table[j] = -1
+
+ for (j in identifiers.indices) {
+ var k = identifiers[j] and i - 1
+ while (-1 != table[1 + (k + k)]) {
+ k = 1 + k and i - 1
+ }
+ table[k + k] = identifiers[j]
+ table[k + k + 1] = j
+ }
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/ReferenceTable.kt b/Client/src/main/kotlin/org/rs09/client/filestore/ReferenceTable.kt
new file mode 100644
index 000000000..d75a876c1
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/ReferenceTable.kt
@@ -0,0 +1,118 @@
+package org.rs09.client.filestore
+
+import org.rs09.client.DataBuffer
+import org.rs09.client.filestore.compression.Container
+import org.rs09.client.util.CRC
+
+class ReferenceTable(data: ByteArray, crc: Int) {
+ val crc: Int = CRC.crc32(data, data.size)
+ var revision = 0
+ var validArchiveAmount = 0
+ var archiveAmount = 0
+ lateinit var validArchiveIds: IntArray
+ lateinit var archiveRevisions: IntArray
+ lateinit var validFileIds: Array
+ lateinit var archiveCRCs: IntArray
+ lateinit var archiveLengths: IntArray
+ lateinit var archiveFileLengths: IntArray
+ lateinit var archiveNameHash: IntArray
+ var aLookupTable_949: LookupTable? = null
+ var aLookupTableArray962: Array? = null
+ var fileNameHashes: Array? = null
+
+ private fun decode(data: ByteArray) {
+ val buffer = DataBuffer(Container.decode(data))
+ val format = buffer.readUnsignedByte()
+ check(format == 5 || format == 6) { "Unexpected ReferenceTable format $format. Expected 5 or 6." }
+ revision = if (format >= 6) buffer.readInt() else 0
+
+ val fields = buffer.readUnsignedByte()
+
+ validArchiveAmount = buffer.readUnsignedShort()
+ validArchiveIds = IntArray(validArchiveAmount)
+
+ var offset = 0
+ var highest = -1
+
+ for (i in 0 until validArchiveAmount) {
+ offset += buffer.readUnsignedShort()
+ validArchiveIds[i] = offset
+ if (validArchiveIds[i] > highest)
+ highest = validArchiveIds[i]
+ }
+
+ archiveAmount = highest - -1
+ archiveRevisions = IntArray(archiveAmount)
+ validFileIds = arrayOfNulls(archiveAmount)
+ archiveCRCs = IntArray(archiveAmount)
+ archiveLengths = IntArray(archiveAmount)
+ archiveFileLengths = IntArray(archiveAmount)
+
+ if (fields != 0) {
+ archiveNameHash = IntArray(archiveAmount)
+
+ for (i in 0 until archiveAmount)
+ archiveNameHash[i] = -1
+
+ for (i in 0 until validArchiveAmount)
+ archiveNameHash[validArchiveIds[i]] = buffer.readInt()
+
+ aLookupTable_949 = LookupTable(archiveNameHash)
+ }
+
+ for (i in 0 until validArchiveAmount)
+ archiveCRCs[validArchiveIds[i]] = buffer.readInt()
+
+ for (i in 0 until validArchiveAmount)
+ archiveRevisions[validArchiveIds[i]] = buffer.readInt()
+
+ for (i in 0 until validArchiveAmount)
+ archiveFileLengths[validArchiveIds[i]] = buffer.readUnsignedShort()
+
+ for (i in 0 until validArchiveAmount) {
+ offset = 0
+ val archiveId = validArchiveIds[i]
+ val archiveFileCount = archiveFileLengths[archiveId]
+ var highestFileId = -1
+ validFileIds[archiveId] = IntArray(archiveFileCount)
+ for (file in 0 until archiveFileCount) {
+ offset += buffer.readUnsignedShort()
+ validFileIds[archiveId]!![file] = offset
+ if (offset > highestFileId) highestFileId = offset
+ }
+ archiveLengths[archiveId] = highestFileId + 1
+ if (archiveFileCount == highestFileId + 1)
+ validFileIds[archiveId] = null
+ }
+
+ if (fields != 0) {
+ val aClass69Array962 = arrayOfNulls(highest + 1)
+ val fileNameHashes = arrayOfNulls(highest + 1)
+
+ for (i in 0 until validArchiveAmount) {
+ val archiveId = validArchiveIds[i]
+ val archiveFileLength = archiveFileLengths[archiveId]
+ val archiveFileNameHashes = IntArray(archiveLengths[archiveId])
+ fileNameHashes[archiveId] = archiveFileNameHashes
+
+ for (j in 0 until archiveLengths[archiveId])
+ archiveFileNameHashes[j] = -1
+
+ for (j in 0 until archiveFileLength) {
+ val fileIndex = if (validFileIds[archiveId] == null) j else validFileIds[archiveId]!![j]
+ archiveFileNameHashes[fileIndex] = buffer.readInt()
+ }
+ aClass69Array962[archiveId] = LookupTable(archiveFileNameHashes)
+ }
+
+ this.fileNameHashes = fileNameHashes
+ this.aLookupTableArray962 = aClass69Array962
+ }
+ }
+
+ init {
+ if (this.crc != crc)
+ throw IllegalArgumentException("CRC mismatch - expected $crc, calculated ${this.crc}")
+ decode(data)
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/ResourceProvider.kt b/Client/src/main/kotlin/org/rs09/client/filestore/ResourceProvider.kt
new file mode 100644
index 000000000..fab705ef8
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/ResourceProvider.kt
@@ -0,0 +1,12 @@
+package org.rs09.client.filestore
+
+// TODO Merge with Class151
+abstract class ResourceProvider {
+ abstract fun getReferenceTable(): ReferenceTable?
+
+ abstract fun request(file: Int)
+
+ abstract fun percentComplete(file: Int): Int
+
+ abstract fun get(file: Int): ByteArray?
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/compression/Container.kt b/Client/src/main/kotlin/org/rs09/client/filestore/compression/Container.kt
new file mode 100644
index 000000000..c88ac9629
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/compression/Container.kt
@@ -0,0 +1,31 @@
+package org.rs09.client.filestore.compression
+
+import org.rs09.client.DataBuffer
+import org.runite.client.Bzip2Decompressor
+
+object Container {
+ private const val NONE = 0
+
+ fun decode(data: ByteArray): ByteArray {
+ val buffer = DataBuffer(data)
+ val compression = buffer.readUnsignedByte()
+ val size = buffer.readInt()
+
+ check(size >= 0) { "Container had data size of < 0: $size with compression $compression" }
+
+ if (compression == NONE) {
+ return buffer.readBytes(size)
+ }
+
+ val uncompressedSize = buffer.readInt()
+ check(uncompressedSize >= 0) { "Container had uncompressed data size of < 0: $size with compression $compression" }
+
+ val uncompressed = ByteArray(uncompressedSize)
+ if (compression == 1) {
+ Bzip2Decompressor.decompress(uncompressed, uncompressedSize, data)
+ } else {
+ GzipDecompressor.decompress(buffer, uncompressed)
+ }
+ return uncompressed
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/compression/GzipDecompressor.kt b/Client/src/main/kotlin/org/rs09/client/filestore/compression/GzipDecompressor.kt
new file mode 100644
index 000000000..089a429ed
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/compression/GzipDecompressor.kt
@@ -0,0 +1,22 @@
+package org.rs09.client.filestore.compression
+
+import org.rs09.client.DataBuffer
+import java.util.zip.Inflater
+
+object GzipDecompressor {
+ private var inflater = Inflater(true)
+
+ fun decompress(buffer: DataBuffer, out: ByteArray) {
+ if (buffer.buffer[buffer.index].toInt() != 31 || buffer.buffer[buffer.index + 1].toInt() != -117)
+ throw RuntimeException("Invalid GZIP header!")
+
+ try {
+ inflater.setInput(buffer.buffer, buffer.index + 10, -8 - (10 + buffer.index) + buffer.buffer.size)
+ inflater.inflate(out)
+ } catch (var5: Exception) {
+ inflater.reset()
+ throw RuntimeException("Invalid GZIP compressed data!")
+ }
+ inflater.reset()
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/cursors/CursorDefinition.kt b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/cursors/CursorDefinition.kt
new file mode 100644
index 000000000..eeff138e6
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/cursors/CursorDefinition.kt
@@ -0,0 +1,34 @@
+package org.rs09.client.filestore.resources.configs.cursors
+
+import org.runite.client.*
+
+class CursorDefinition {
+ var hotspotX = 0
+ var hotspotY = 0
+ var imageId = 0
+
+ fun getImage(): SoftwareSprite {
+ var image = Class163_Sub1.aReferenceCache_2984.get(imageId.toLong()) as? SoftwareSprite
+ if (image != null) return image
+
+ image = Unsorted.loadSoftwareSprite(SequenceDefinition.spritesIndex_1852, imageId)
+ if (image != null) Class163_Sub1.aReferenceCache_2984.put(image, imageId.toLong())
+ return image
+ }
+
+ fun decode(buffer: DataBuffer) {
+ while (true) {
+ val opcode = buffer.readUnsignedByte()
+ if (opcode == 0) break
+
+ when (opcode) {
+ 1 -> imageId = buffer.readUnsignedShort()
+ 2 -> {
+ hotspotX = buffer.readUnsignedByte()
+ hotspotY = buffer.readUnsignedByte()
+ }
+ else -> throw IllegalArgumentException("unknown CursorDefinition opcode $opcode")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinition.kt b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinition.kt
new file mode 100644
index 000000000..8afa31b87
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinition.kt
@@ -0,0 +1,130 @@
+package org.rs09.client.filestore.resources.configs.enums
+
+import org.rs09.client.Linkable
+import org.rs09.client.LinkableInt
+import org.rs09.client.Node
+import org.rs09.client.data.HashTable
+import org.runite.client.*
+
+class EnumDefinition : Node() {
+ companion object {
+ private val NULL = RSString.parse("null")
+ }
+
+ var keyType = 0
+ var valueType = 0
+
+ var values: HashTable? = null
+ var valueLookup: HashTable? = null
+
+ var defaultString = NULL
+ var defaultInt = 0
+
+ fun decode(buffer: DataBuffer) {
+ while (true) {
+ val opcode = buffer.readUnsignedByte()
+ if (opcode == 0) break
+
+ when (opcode) {
+ 1 -> keyType = buffer.readUnsignedByte()
+ 2 -> valueType = buffer.readUnsignedByte()
+ 3 -> defaultString = buffer.readString()
+ 4 -> defaultInt = buffer.readInt()
+ 5, 6 -> {
+ val size = buffer.readUnsignedShort()
+ val values = HashTable(Class95.method1585(94, size))
+
+ for (i in 0 until size) {
+ val key = buffer.readInt()
+
+ val value: Linkable = if (opcode == 5) LinkableRSString(buffer.readString())
+ else LinkableInt(buffer.readInt())
+
+ values.put(key.toLong(), value)
+ }
+
+ this.values = values
+ }
+ else -> throw IllegalArgumentException("unknown EnumDefinition opcode $opcode")
+ }
+ }
+ }
+
+ fun getString(key: Int): RSString {
+ val values = this.values ?: return defaultString
+
+ val value = values[key.toLong()] as LinkableRSString?
+ return value?.value ?: defaultString
+ }
+
+ fun getInt(key: Int): Int {
+ val values = this.values ?: return defaultInt
+
+ val value = values[key.toLong()] as LinkableInt?
+ return value?.value ?: defaultInt
+ }
+
+ private fun buildIntValueLookup() {
+ val values = requireNotNull(this.values)
+ val valueLookup = HashTable(values.capacity())
+
+ var linkable = values.first() as LinkableInt?
+ while (linkable != null) {
+ val reversed = LinkableInt(linkable.linkableKey.toInt())
+ valueLookup.put(linkable.value.toLong(), reversed)
+ linkable = values.next() as LinkableInt?
+ }
+
+ this.valueLookup = valueLookup
+ }
+
+ private fun buildStringValueLookup() {
+ val values = requireNotNull(this.values)
+ val valueLookup = HashTable(values.capacity())
+
+ var linkable = values.first() as LinkableRSString?
+ while (linkable != null) {
+ val reversed = Class3_Sub10(linkable.value, linkable.linkableKey.toInt())
+ valueLookup.put(linkable.value.hash(), reversed)
+ linkable = values.next() as LinkableRSString?
+ }
+
+ this.valueLookup = valueLookup
+ }
+
+ fun containsValue(value: Int): Boolean {
+ if (values == null) {
+ return false
+ }
+
+ if (valueLookup == null) {
+ buildIntValueLookup()
+ }
+
+ val lookup = valueLookup ?: return false
+ return lookup[value.toLong()] != null
+ }
+
+ fun containsValue(value: RSString): Boolean {
+ if (values == null) {
+ return false
+ }
+
+ if (valueLookup == null) {
+ buildStringValueLookup()
+ }
+
+ val lookup = valueLookup ?: return false
+
+ var head = lookup[value.hash()] as Class3_Sub10?
+ while (head != null) {
+ if (head.value.equalsString(value)) {
+ return true
+ }
+ head = lookup.nextInBucket() as Class3_Sub10?
+ }
+
+ return false
+ }
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinitionProvider.kt b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinitionProvider.kt
new file mode 100644
index 000000000..b234e097c
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/enums/EnumDefinitionProvider.kt
@@ -0,0 +1,29 @@
+package org.rs09.client.filestore.resources.configs.enums
+
+import org.runite.client.CacheIndex
+import org.runite.client.DataBuffer
+import org.rs09.client.data.NodeCache
+
+object EnumDefinitionProvider {
+ private val cache = NodeCache(128)
+ private lateinit var index: CacheIndex
+
+ @JvmStatic
+ fun provide(id: Int): EnumDefinition {
+ var def = cache.get(id.toLong())
+ if (def != null) return def
+
+ def = EnumDefinition()
+ val bytes = index.getFile(id ushr 8, id and 0xff)
+ if (bytes != null) def.decode(DataBuffer(bytes))
+
+ cache.put(id.toLong(), def)
+ return def
+ }
+
+ @JvmStatic
+ fun setIndex(index: CacheIndex) {
+ this.index = index
+ }
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinition.kt b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinition.kt
new file mode 100644
index 000000000..4d8590f37
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinition.kt
@@ -0,0 +1,54 @@
+package org.rs09.client.filestore.resources.configs.structs
+
+import org.rs09.client.Linkable
+import org.rs09.client.LinkableInt
+import org.rs09.client.Node
+import org.rs09.client.data.HashTable
+import org.runite.client.Class95
+import org.runite.client.DataBuffer
+import org.runite.client.LinkableRSString
+import org.runite.client.RSString
+
+class StructDefinition: Node() {
+ var values: HashTable? = null
+
+ fun decode(buffer: DataBuffer) {
+ while (true) {
+ val opcode = buffer.readUnsignedByte()
+ if (opcode == 0) break
+
+ when (opcode) {
+ 249 -> {
+ val size = buffer.readUnsignedByte()
+ val values = HashTable(Class95.method1585(105, size))
+
+ for (i in 0 until size) {
+ val isString = buffer.readUnsignedByte() == 1
+ val key = buffer.readMedium()
+
+ val value = if (isString) LinkableRSString(buffer.readString())
+ else LinkableInt(buffer.readInt())
+
+ values.put(key.toLong(), value)
+ }
+
+ this.values = values
+ }
+ else -> throw IllegalArgumentException("unknown StructDefinition opcode $opcode")
+ }
+ }
+ }
+
+ fun getInt(key: Int, orElse: Int): Int {
+ val values = this.values ?: return orElse
+ val value = values[key.toLong()] as LinkableInt?
+ return value?.value ?: orElse
+ }
+
+ fun getString(key: Int, orElse: RSString): RSString {
+ val values = this.values ?: return orElse
+
+ val value = values[key.toLong()] as LinkableRSString?
+ return value?.value ?: orElse
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinitionProvider.kt b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinitionProvider.kt
new file mode 100644
index 000000000..b14dcf822
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/filestore/resources/configs/structs/StructDefinitionProvider.kt
@@ -0,0 +1,28 @@
+package org.rs09.client.filestore.resources.configs.structs
+
+import org.runite.client.CacheIndex
+import org.runite.client.DataBuffer
+import org.rs09.client.data.NodeCache
+
+object StructDefinitionProvider {
+ private val cache = NodeCache(64)
+ private lateinit var index: CacheIndex
+
+ @JvmStatic
+ fun provide(id: Int): StructDefinition? {
+ var def = cache.get(id.toLong())
+ if (def != null) return def
+
+ def = StructDefinition()
+ val bytes = index.getFile(26, id)
+ if (bytes != null) def.decode(DataBuffer(bytes))
+
+ cache.put(id.toLong(), def)
+ return def
+ }
+
+ @JvmStatic
+ fun setIndex(index: CacheIndex) {
+ this.index = index
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/Connection.kt b/Client/src/main/kotlin/org/rs09/client/net/Connection.kt
new file mode 100644
index 000000000..15abf0b15
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/Connection.kt
@@ -0,0 +1,189 @@
+package org.rs09.client.net
+
+import org.runite.client.Class64
+import org.runite.client.Signlink
+import org.runite.client.TimeUtils
+import java.io.EOFException
+import java.io.IOException
+import java.io.InputStream
+import java.io.OutputStream
+import java.net.Socket
+import java.util.concurrent.locks.ReentrantLock
+import kotlin.concurrent.withLock
+
+class Connection(val socket: Socket, val signlink: Signlink) : Runnable {
+ private val lock = ReentrantLock()
+ private val condition = lock.newCondition()
+
+ private var inputStream: InputStream
+ private var outputStream: OutputStream
+ private var closed = false
+ private var writeFailed = false
+ private var outputBuffer: ByteArray? = null
+ private var writeIndex = 0
+ private var someOtherIndex = 0
+ private var class64: Class64? = null
+
+ init {
+ socket.soTimeout = 30_000
+ socket.tcpNoDelay = true
+ inputStream = socket.getInputStream()
+ outputStream = socket.getOutputStream()
+ }
+
+ override fun run() {
+ while (true) {
+ var bufferOffset: Int
+ var transmitLength: Int
+
+ lock.lock()
+ try {
+ if (writeIndex == someOtherIndex) {
+ if (closed) break
+ try {
+ condition.await()
+ } catch (e: InterruptedException) {
+ }
+ }
+
+ bufferOffset = someOtherIndex
+ transmitLength = if (writeIndex < someOtherIndex) 5000 - someOtherIndex
+ else writeIndex - someOtherIndex
+ } finally {
+ lock.unlock()
+ }
+
+ if (transmitLength <= 0) continue
+
+ try {
+ outputStream.write(outputBuffer!!, bufferOffset, transmitLength)
+ } catch (e: IOException) {
+ e.printStackTrace()
+ writeFailed = true
+ }
+
+ someOtherIndex = (transmitLength + someOtherIndex) % 5000
+
+ try {
+ if (someOtherIndex != writeIndex) continue
+
+ outputStream.flush()
+ } catch (e: IOException) {
+ e.printStackTrace()
+ writeFailed = true
+ }
+ }
+
+ try {
+ inputStream.close()
+ outputStream.close()
+ socket.close()
+ } catch (e: IOException) {
+ e.printStackTrace()
+ }
+
+ outputBuffer = null
+ }
+
+ @Throws(IOException::class)
+ fun readBytes(buffer: ByteArray, offset: Int, length: Int) {
+ check(offset >= 0) { "Offset <= 0 in readBytes" }
+ check(length >= 0) { "Read length <= 0 in readBytes" }
+ check(offset + length <= buffer.size) { "offset + length is greater than buffer size" }
+ check(!closed) { "Attempted to read from closed connection" }
+
+ var remaining = length
+ var bufferOffset = offset
+ while (remaining > 0) {
+ val bytesRead = inputStream.read(buffer, bufferOffset, remaining)
+ if (bytesRead <= 0)
+ throw EOFException()
+
+ bufferOffset += bytesRead
+ remaining -= bytesRead
+ }
+ }
+
+ @Throws(IOException::class)
+ fun readByte(): Int {
+ check(!closed) { "Attempted to read from closed connection" }
+ return inputStream.read()
+ }
+
+ @Throws(IOException::class)
+ fun sendBytes(buffer: ByteArray, length: Int) {
+ check(!closed) { "Attempted to write to closed connection" }
+
+ if (writeFailed) {
+ writeFailed = false
+ throw IOException("Attempted to write straight after failed write!")
+ }
+
+ val out = outputBuffer ?: ByteArray(5000).apply { outputBuffer = this }
+
+ lock.withLock {
+ for (i in 0 until length) {
+ out[writeIndex] = buffer[i]
+ writeIndex = (writeIndex + 1) % 5000
+
+ if ((4900 + someOtherIndex) % 5000 == writeIndex) {
+ throw IOException("Buffer overflow")
+ }
+ }
+
+ if (class64 == null) {
+ class64 = signlink.startThread(3, this)
+ }
+
+ condition.signalAll()
+ }
+ }
+
+ fun finalize() {
+ if (!closed) {
+ System.err.println("Finalized connection, but it wasn't closed! Did we leak?")
+ close()
+ }
+ }
+
+ fun checkErrors() {
+ if (closed || !writeFailed) return
+
+ writeFailed = false
+ throw IOException("So why are we throwing this now?")
+ }
+
+ @Throws(IOException::class)
+ fun availableBytes(): Int = if (closed) 0 else inputStream.available()
+
+ fun applyDummyStreams() {
+ if (closed) return
+
+ inputStream = DummyInputStream()
+ outputStream = DummyOutputStream()
+ }
+
+ fun close() {
+ if (closed) return
+
+ lock.withLock {
+ closed = true
+ condition.signalAll()
+ }
+
+ class64?.let { class64 ->
+ while (class64.anInt978 == 0) TimeUtils.sleep(1L)
+
+ if (class64.anInt978 == 1) {
+ try {
+ (class64.anObject974 as Thread).join()
+ } catch (e: InterruptedException) {
+ e.printStackTrace()
+ }
+ }
+ }
+
+ class64 = null
+ }
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/DummyInputStream.kt b/Client/src/main/kotlin/org/rs09/client/net/DummyInputStream.kt
new file mode 100644
index 000000000..912aaa632
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/DummyInputStream.kt
@@ -0,0 +1,11 @@
+package org.rs09.client.net
+
+import org.runite.client.TimeUtils
+import java.io.InputStream
+
+class DummyInputStream : InputStream() {
+ override fun read(): Int {
+ TimeUtils.sleep(30000L)
+ return -1
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/DummyOutputStream.kt b/Client/src/main/kotlin/org/rs09/client/net/DummyOutputStream.kt
new file mode 100644
index 000000000..8e7b8998a
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/DummyOutputStream.kt
@@ -0,0 +1,10 @@
+package org.rs09.client.net
+
+import java.io.IOException
+import java.io.OutputStream
+
+class DummyOutputStream: OutputStream() {
+ override fun write(b: Int) {
+ throw IOException("Attempted to write to DummyOutputStream")
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/game/PacketDecoder.kt b/Client/src/main/kotlin/org/rs09/client/net/game/PacketDecoder.kt
new file mode 100644
index 000000000..25f7401f4
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/game/PacketDecoder.kt
@@ -0,0 +1,78 @@
+package org.rs09.client.net.game
+
+import org.rs09.client.net.game.inbound.ConsoleAutocompletionPacketDecoder
+import org.rs09.client.net.game.inbound.ConsoleMessageDecoder
+import org.rs09.client.net.game.inbound.GamePacketDecoder
+import org.runite.client.*
+import java.io.IOException
+
+object PacketDecoder {
+ val decoders = HashMap()
+ var OPCODE_OFFSET = 241
+
+ private fun registerCustomDecoder(size: Int, decoder: GamePacketDecoder): Int {
+ val opcode = OPCODE_OFFSET++
+
+ Class75_Sub4.incomingPacketSizes[opcode] = size
+ decoders[opcode] = decoder
+ return opcode
+ }
+
+ init {
+ // VERY IMPORTANT - WHEN ADDING NEW PACKETS, ADD THEM AFTER THE OLD PACKETS
+ // OTHERWISE YOU >>WILL<< MESS UP OPCODES
+
+ registerCustomDecoder(-2, ConsoleMessageDecoder)
+ registerCustomDecoder(-2, ConsoleAutocompletionPacketDecoder)
+// println("NOTE > Registered ConsoleAutocompletionPacket as opcode $completion")
+ }
+
+ @Throws(IOException::class)
+ fun decodePacket(): Boolean {
+ val connection = Class3_Sub15.activeConnection ?: return false
+ var availableBytes = connection.availableBytes()
+ if (availableBytes <= 0) return false
+
+ if (Unsorted.incomingOpcode == -1) {
+ availableBytes--
+ Class3_Sub15.activeConnection.readBytes(BufferedDataStream.incomingBuffer.buffer, 0, 1)
+ BufferedDataStream.incomingBuffer.index = 0
+ Unsorted.incomingOpcode = BufferedDataStream.incomingBuffer.opcode
+ Unsorted.incomingPacketLength = Class75_Sub4.incomingPacketSizes[Unsorted.incomingOpcode]
+ }
+
+ if (Unsorted.incomingPacketLength == -1) {
+ if (availableBytes < 1) return false
+
+ availableBytes--
+ Class3_Sub15.activeConnection.readBytes(BufferedDataStream.incomingBuffer.buffer, 0, 1)
+ Unsorted.incomingPacketLength = BufferedDataStream.incomingBuffer.buffer[0].toInt() and 0xff
+ }
+
+ if (Unsorted.incomingPacketLength == -2) {
+ if (availableBytes < 2) return false
+
+ availableBytes -= 2
+ Class3_Sub15.activeConnection.readBytes(BufferedDataStream.incomingBuffer.buffer, 0, 2)
+ BufferedDataStream.incomingBuffer.index = 0
+ Unsorted.incomingPacketLength = BufferedDataStream.incomingBuffer.readUnsignedShort()
+ }
+
+ if (availableBytes < Unsorted.incomingPacketLength) return false
+
+ BufferedDataStream.incomingBuffer.index = 0
+ Class3_Sub15.activeConnection.readBytes(BufferedDataStream.incomingBuffer.buffer, 0, Unsorted.incomingPacketLength)
+ Class24.anInt469 = Class7.anInt2166
+ Class7.anInt2166 = LinkableRSString.anInt2582
+ LinkableRSString.anInt2582 = Unsorted.incomingOpcode
+ AbstractSprite.anInt3699 = 0
+
+ val decoder = decoders[Unsorted.incomingOpcode]
+ if (decoder == null) return PacketParser.parseIncomingPackets();
+ else decoder.decode(BufferedDataStream.incomingBuffer)
+
+ // TODO This should only happen after everything else.
+ Unsorted.incomingOpcode = -1
+ return true
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleAutocompletionPacketDecoder.kt b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleAutocompletionPacketDecoder.kt
new file mode 100644
index 000000000..81d9d11d3
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleAutocompletionPacketDecoder.kt
@@ -0,0 +1,18 @@
+package org.rs09.client.net.game.inbound
+
+import org.rs09.client.console.AutocompletionHints
+import org.rs09.client.console.DeveloperConsole
+import org.runite.client.DataBuffer
+
+object ConsoleAutocompletionPacketDecoder: GamePacketDecoder {
+ override fun decode(buffer: DataBuffer) {
+ val line = buffer.readString().toString()
+ val size = buffer.readUnsignedShort()
+ val list = ArrayList()
+ for(i in 0 until size)
+ list += buffer.readString().toString()
+ val total = buffer.readInt()
+
+ DeveloperConsole.autocompletions = AutocompletionHints(line, list, total)
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleMessageDecoder.kt b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleMessageDecoder.kt
new file mode 100644
index 000000000..d37d450ba
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/ConsoleMessageDecoder.kt
@@ -0,0 +1,12 @@
+package org.rs09.client.net.game.inbound
+
+import org.rs09.client.console.DeveloperConsole
+import org.runite.client.DataBuffer
+
+object ConsoleMessageDecoder: GamePacketDecoder {
+ override fun decode(buffer: DataBuffer) {
+ val line = buffer.readString()
+
+ DeveloperConsole.println(line.toString())
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/net/game/inbound/GamePacketDecoder.kt b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/GamePacketDecoder.kt
new file mode 100644
index 000000000..d0ce6f2bd
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/net/game/inbound/GamePacketDecoder.kt
@@ -0,0 +1,7 @@
+package org.rs09.client.net.game.inbound
+
+import org.runite.client.DataBuffer
+
+interface GamePacketDecoder {
+ fun decode(buffer: DataBuffer)
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/rendering/RenderingUtils.kt b/Client/src/main/kotlin/org/rs09/client/rendering/RenderingUtils.kt
new file mode 100644
index 000000000..9cf59d6ec
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/rendering/RenderingUtils.kt
@@ -0,0 +1,93 @@
+package org.rs09.client.rendering
+
+import org.runite.client.*
+
+/**
+ * A utility class to make rendering new things easier. This should only be used for new things. Ideally only port the
+ * necessary calls to this utility class.
+ *
+ * In the future, instead of utilizing this class, a toolkit system should be used.
+ */
+object RenderingUtils {
+ val hd: Boolean
+ get() = HDToolKit.highDetail
+
+ // TODO Is this actually the width?
+ val width: Int
+ get() = Class23.canvasWidth
+
+ // TODO Is this actually the height?
+ val height: Int
+ get() = GroundItem.canvasHeight
+
+ @JvmStatic
+ @Deprecated("Please use the Toolkit methods instead of this delegating method", ReplaceWith("Toolkit.getActiveToolkit().fillRect(x, y, w, h, rgb, alpha)"))
+ fun fillRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ Toolkit.getActiveToolkit().fillRect(x, y, w, h, rgb, alpha)
+// if (hd) Class22.fillRectangle(x, y, w, h, rgb, alpha)
+// else Class74.fillRectangle(x, y, w, h, rgb, alpha)
+ }
+
+ @JvmStatic
+ fun drawHorizontalLine(x: Int, y: Int, w: Int, rgb: Int) {
+ Toolkit.getActiveToolkit().drawHorizontalLine(x, y, w, rgb)
+// if (hd) Class22.drawHorizontalLine(x, y, w, rgb)
+// else Toolkit.JAVA_TOOLKIT.drawHorizontalLine(x, y, w, rgb)
+ }
+
+ @JvmStatic
+ fun drawVerticalLine(x: Int, y: Int, h: Int, rgb: Int) {
+ Toolkit.getActiveToolkit().drawVerticalLine(x,y,h,rgb)
+// if (hd) Class22.drawVerticalLine(x, y, h, rgb)
+// else Class74.drawVerticalLine(x, y, h, rgb)
+ }
+
+ @JvmStatic
+ fun drawRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ Toolkit.getActiveToolkit().drawRect(x, y, w, h, rgb, alpha)
+// if (hd) Class22.drawRect(x, y, w, h, rgb)
+// else Class74.drawRect(x, y, w, h, rgb)
+ }
+
+ fun drawText(str: String, x: Int, y: Int, rgb: Int, parse: Boolean = false) {
+ if (parse) FontType.plainFont.method681(RSString.parse(str), x, y, rgb, -1)
+ else FontType.plainFont.method681(RSString.of(str), x, y, rgb, -1)
+ }
+
+ fun drawText(str: String, x: Int, y: Int, rgb: Int, shadow: Int, parse: Boolean = false){
+ if (parse) FontType.plainFont.method681(RSString.parse(str), x, y, rgb, shadow)
+ else FontType.plainFont.method681(RSString.of(str), x, y, rgb, shadow)
+ }
+
+ fun drawText(str: RSString, x: Int, y: Int, rgb: Int) {
+ FontType.plainFont.method681(str, x, y, rgb, -1)
+ }
+
+ fun drawText(str: RSString, x: Int, y: Int, rgb: Int, shadow: Int) {
+ FontType.plainFont.method681(str, x, y, rgb, shadow)
+ }
+
+ fun drawTextSmall(str: String, x: Int, y: Int, rgb: Int, parse: Boolean = false) {
+ if (parse) FontType.smallFont.method681(RSString.parse(str), x, y, rgb, -1)
+ else FontType.smallFont.method681(RSString.of(str), x, y, rgb, -1)
+ }
+
+ fun drawTextSmall(str: String, x: Int, y: Int, rgb: Int, shadow: Int, parse: Boolean = false){
+ if (parse) FontType.smallFont.method681(RSString.parse(str), x, y, rgb, shadow)
+ else FontType.smallFont.method681(RSString.of(str), x, y, rgb, shadow)
+ }
+
+ fun drawTextSmall(str: RSString, x: Int, y: Int, rgb: Int) {
+ FontType.smallFont.method681(str, x, y, rgb, -1)
+ }
+
+ fun setClipping(left: Int, top: Int, right: Int, bottom: Int) {
+ if (hd) Class22.setClipping(left, top, right, bottom)
+ else Class74.setClipping(left, top, right, bottom)
+ }
+
+ fun resetClipping() {
+ if (hd) Class22.resetClipping()
+ else Class74.resetClipping()
+ }
+}
diff --git a/Client/src/main/kotlin/org/rs09/client/rendering/Toolkit.kt b/Client/src/main/kotlin/org/rs09/client/rendering/Toolkit.kt
new file mode 100644
index 000000000..abad57f8b
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/rendering/Toolkit.kt
@@ -0,0 +1,38 @@
+package org.rs09.client.rendering
+
+import org.rs09.client.rendering.java.JavaToolkit
+import org.rs09.client.rendering.opengl.OpenGlToolkit
+
+/**
+ * Represents an abstract rendering toolkit. The toolkit should support all raw rendering operations including
+ * rasterization.
+ *
+ * By abstracting rendering through toolkits, additional rendering backends can be implemented in the future.
+ */
+abstract class Toolkit {
+
+ companion object {
+ @JvmField
+ val OPENGL_TOOLKIT = OpenGlToolkit()
+ @JvmField
+ val JAVA_TOOLKIT = JavaToolkit()
+
+ @JvmStatic
+ fun getActiveToolkit(): Toolkit {
+ return if (RenderingUtils.hd) OPENGL_TOOLKIT else JAVA_TOOLKIT
+ }
+ }
+
+ abstract fun fillRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int)
+
+ abstract fun drawHorizontalLine(x: Int, y: Int, w: Int, rgb: Int)
+
+ abstract fun drawVerticalLine(x: Int, y: Int, h: Int, rgb: Int)
+
+ abstract fun drawRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int)
+
+ abstract fun method934(x: Int, y: Int, w: Int, h: Int, rgb: Int)
+
+
+
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/rendering/java/JavaToolkit.kt b/Client/src/main/kotlin/org/rs09/client/rendering/java/JavaToolkit.kt
new file mode 100644
index 000000000..676a9c179
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/rendering/java/JavaToolkit.kt
@@ -0,0 +1,150 @@
+package org.rs09.client.rendering.java
+
+import org.rs09.client.rendering.Toolkit
+
+class JavaToolkit : Toolkit() {
+ var buffer: IntArray = IntArray(0)
+
+ @JvmField
+ var clipLeft: Int = 0
+
+ @JvmField
+ var clipTop: Int = 0
+
+ @JvmField
+ var clipRight: Int = 0
+
+ @JvmField
+ var clipBottom: Int = 0
+
+ @JvmField
+ var width: Int = 0
+
+ @JvmField
+ var height: Int = 0
+
+ override fun fillRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ var x = x
+ var y = y
+ var width = w
+ var height = h
+ var rgb = rgb
+
+ if (x < this.clipLeft) {
+ width -= this.clipLeft - x
+ x = this.clipLeft
+ }
+
+ if (y < this.clipTop) {
+ height -= this.clipTop - y
+ y = this.clipTop
+ }
+
+ if (x + width > this.clipRight) {
+ width = this.clipRight - x
+ }
+
+ if (y + height > this.clipBottom) {
+ height = this.clipBottom - y
+ }
+
+ rgb = ((rgb and 0xff00ff) * alpha shr 8 and 0xff00ff) + ((rgb and 0xff00) * alpha shr 8 and 0xff00)
+ val invertedOpacity = 256 - alpha
+ val skipPerLine = this.width - width
+ var offset = x + y * this.width
+
+ for (lx in 0 until height) {
+ for (ly in -width..-1) {
+ var old = buffer[offset]
+ old = ((old and 0xff00ff) * invertedOpacity shr 8 and 0xff00ff) + ((old and 0xff00) * invertedOpacity shr 8 and 0xff00)
+ buffer[offset++] = rgb + old
+ }
+ offset += skipPerLine
+ }
+ }
+
+ override fun drawHorizontalLine(x: Int, y: Int, w: Int, rgb: Int) {
+ var x = x
+ var width = w
+
+ if (y < this.clipTop || y >= this.clipBottom)
+ return
+
+ if (x < this.clipLeft) {
+ width -= this.clipLeft - x
+ x = this.clipLeft
+ }
+ if (x + width > this.clipRight) {
+ width = this.clipRight - x
+ }
+
+ val var4 = x + y * this.width
+ for (var5 in 0 until width) {
+ buffer[var4 + var5] = rgb
+ }
+ }
+
+ override fun drawVerticalLine(x: Int, y: Int, h: Int, rgb: Int) {
+ var y = y
+ var height = h
+
+ if (x < this.clipLeft || x >= this.clipRight)
+ return
+
+ if (y < this.clipTop) {
+ height -= this.clipTop - y
+ y = this.clipTop
+ }
+ if (y + height > this.clipBottom) {
+ height = this.clipBottom - y
+ }
+
+ val var4 = x + y * this.width
+ for (var5 in 0 until height) {
+ buffer[var4 + var5 * width] = rgb
+ }
+ }
+
+ override fun drawRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ drawHorizontalLine(x, y, w, rgb)
+ drawHorizontalLine(x, y + h - 1, w, rgb)
+ drawVerticalLine(x, y, h, rgb)
+ drawVerticalLine(x + w - 1, y, h, rgb)
+ }
+
+ //Renamed from method1323 to match its openGL counterpart
+ override fun method934(x: Int, y: Int, w: Int, h: Int, rgb: Int) {
+ var x = x
+ var y = y
+ var width = w
+ var height = h
+ if (x < this.clipLeft) {
+ width -= this.clipLeft - x
+ x = this.clipLeft
+ }
+ if (y < this.clipTop) {
+ height -= this.clipTop - y
+ y = this.clipTop
+ }
+ if (x + w > this.clipRight) {
+ width = this.clipRight - x
+ }
+ if (y + h > this.clipBottom) {
+ height = this.clipBottom - y
+ }
+ val var5 = this.width - w
+ var var6 = x + y * this.width
+
+ for (var7 in -height until 0) {
+ for (var8 in -width..-1) {
+ buffer[var6++] = rgb
+ }
+ var6 += var5;
+ }
+ }
+
+
+ fun resetBuffer() {
+ buffer = IntArray(0)
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/rendering/opengl/OpenGlToolkit.kt b/Client/src/main/kotlin/org/rs09/client/rendering/opengl/OpenGlToolkit.kt
new file mode 100644
index 000000000..de63f8aa4
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/rendering/opengl/OpenGlToolkit.kt
@@ -0,0 +1,87 @@
+package org.rs09.client.rendering.opengl
+
+import org.rs09.client.rendering.Toolkit
+import org.rs09.client.rendering.opengl.enums.GLBeginMode
+import org.runite.client.HDToolKit
+
+class OpenGlToolkit: Toolkit() {
+
+ override fun fillRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ HDToolKit.method1835()
+ val var6 = x.toFloat()
+ val var7 = var6 + w.toFloat()
+ val var8 = (HDToolKit.viewHeight - y).toFloat()
+ val var9 = var8 - h.toFloat()
+ val var10 = HDToolKit.gl
+
+ var10.glBegin(GLBeginMode.TRIANGLE_FAN)
+ var10.glColor4ub((rgb shr 16).toByte(), (rgb shr 8).toByte(), rgb.toByte(), if (alpha > 255) -1 else alpha.toByte())
+ var10.glVertex2f(var6, var8)
+ var10.glVertex2f(var6, var9)
+ var10.glVertex2f(var7, var9)
+ var10.glVertex2f(var7, var8)
+ var10.glEnd()
+ }
+
+ override fun drawHorizontalLine(x: Int, y: Int, w: Int, rgb: Int) {
+ HDToolKit.method1835()
+ val startX = x.toFloat() + 0.3f
+ val endX = startX + w.toFloat()
+ val yPos = HDToolKit.viewHeight.toFloat() - (y.toFloat() + 0.3f)
+ val gl = HDToolKit.gl
+
+ gl.glBegin(GLBeginMode.LINES)
+ gl.glColor3ub((rgb shr 16).toByte(), (rgb shr 8).toByte(), rgb.toByte())
+ gl.glVertex2f(startX, yPos)
+ gl.glVertex2f(endX, yPos)
+ gl.glEnd()
+ }
+
+ override fun drawVerticalLine(x: Int, y: Int, h: Int, rgb: Int) {
+ HDToolKit.method1835()
+ val var4 = x.toFloat() + .3f
+ val var5 = HDToolKit.viewHeight.toFloat() - (y.toFloat() + 0.3f)
+ val var6 = var5 - h.toFloat()
+ val var7 = HDToolKit.gl
+
+ var7.glBegin(GLBeginMode.LINES)
+ var7.glColor3ub((rgb shr 16).toByte(), (rgb shr 8).toByte(), rgb.toByte())
+ var7.glVertex2f(var4, var5)
+ var7.glVertex2f(var4, var6)
+ var7.glEnd()
+ }
+
+ override fun drawRect(x: Int, y: Int, w: Int, h: Int, rgb: Int, alpha: Int) {
+ HDToolKit.method1835()
+ val var5 = x.toFloat() + 0.3f
+ val var6 = var5 + (w.toFloat() - 1)
+ val var7 = (HDToolKit.viewHeight.toFloat() - (y.toFloat() + 0.3f))
+ val var8 = var7 - (h.toFloat() - 1)
+ val var9 = HDToolKit.gl
+
+ var9.glBegin(GLBeginMode.LINE_LOOP)
+ var9.glColor4ub((rgb shr 16).toByte(), (rgb shr 8).toByte(), rgb.toByte(), if (alpha > 255) -1 else alpha.toByte())
+ var9.glVertex2f(var5, var7)
+ var9.glVertex2f(var5, var8)
+ var9.glVertex2f(var6, var8)
+ var9.glVertex2f(var6, var7)
+ var9.glEnd()
+ }
+
+ override fun method934(x: Int, y: Int, w: Int, h: Int, rgb: Int) {
+ HDToolKit.method1835()
+ val var5 = x.toFloat()
+ val var6 = var5 + w.toFloat()
+ val var7 = (HDToolKit.viewHeight - y).toFloat()
+ val var8 = var7 - h.toFloat()
+ val var9 = HDToolKit.gl
+
+ var9.glBegin(GLBeginMode.TRIANGLE_FAN)
+ var9.glColor3ub((rgb shr 16).toByte(), (rgb shr 8).toByte(), rgb.toByte())
+ var9.glVertex2f(var5, var7)
+ var9.glVertex2f(var5, var8)
+ var9.glVertex2f(var6, var8)
+ var9.glVertex2f(var6, var7)
+ var9.glEnd()
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/rendering/opengl/enums/GLBeginMode.kt b/Client/src/main/kotlin/org/rs09/client/rendering/opengl/enums/GLBeginMode.kt
new file mode 100644
index 000000000..b0182a15e
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/rendering/opengl/enums/GLBeginMode.kt
@@ -0,0 +1,17 @@
+package org.rs09.client.rendering.opengl.enums
+
+/**
+ * Source: https://opensource.apple.com/source/X11server/X11server-85/libGL/AppleSGLX-57/specs/enum.spec
+ */
+object GLBeginMode {
+ const val POINTS = 0x0000
+ const val LINES = 0x0001
+ const val LINE_LOOP = 0x0002
+ const val LINE_STRIP = 0x0003
+ const val TRIANGLES = 0x0004
+ const val TRIANGLE_STRIP = 0x0005
+ const val TRIANGLE_FAN = 0x0006
+ const val QUADS = 0x0007
+ const val QUAD_STRIP = 0x0008
+ const val POLYGON = 0x0009
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/util/ArrayUtils.kt b/Client/src/main/kotlin/org/rs09/client/util/ArrayUtils.kt
new file mode 100644
index 000000000..9645aa1e6
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/util/ArrayUtils.kt
@@ -0,0 +1,338 @@
+package org.rs09.client.util
+
+@Suppress("NAME_SHADOWING")
+object ArrayUtils {
+ @JvmStatic
+ fun arraycopy(source: LongArray, sourcePos: Int, dest: LongArray, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 3
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 3
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 3
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 3
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun arraycopy(source: ByteArray, sourcePos: Int, dest: ByteArray, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun arraycopy(source: IntArray, sourcePos: Int, dest: IntArray, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun arraycopy(source: FloatArray, sourcePos: Int, dest: FloatArray, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun arraycopy(source: ShortArray, sourcePos: Int, dest: ShortArray, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun arraycopy(source: Array, sourcePos: Int, dest: Array, destPos: Int, count: Int) {
+ var sourcePos = sourcePos
+ var destPos = destPos
+ var count = count
+ if (source === dest) {
+ if (sourcePos == destPos) {
+ return
+ }
+ if (destPos > sourcePos && destPos < sourcePos + count) {
+ --count
+ sourcePos += count
+ destPos += count
+ count = sourcePos - count
+ count += 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ dest[destPos--] = source[sourcePos--]
+ }
+ count -= 7
+ while (sourcePos >= count) {
+ dest[destPos--] = source[sourcePos--]
+ }
+ return
+ }
+ }
+ count += sourcePos
+ count -= 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ dest[destPos++] = source[sourcePos++]
+ }
+ count += 7
+ while (sourcePos < count) {
+ dest[destPos++] = source[sourcePos++]
+ }
+ }
+
+ @JvmStatic
+ fun fill(arr: IntArray, offset: Int, length: Int, value: Int) {
+ var offset = offset
+ var length = length
+ length = offset + length - 7
+ while (offset < length) {
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ arr[offset++] = value
+ }
+ length += 7
+ while (offset < length) {
+ arr[offset++] = value
+ }
+ }
+
+ @JvmStatic
+ fun zero(arr: IntArray, offset: Int, length: Int) {
+ var offset = offset
+ var length = length
+ length = offset + length - 7
+ while (offset < length) {
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ arr[offset++] = 0
+ }
+ length += 7
+ while (offset < length) {
+ arr[offset++] = 0
+ }
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/util/ByteArrayPool.kt b/Client/src/main/kotlin/org/rs09/client/util/ByteArrayPool.kt
new file mode 100644
index 000000000..9a3b34d39
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/util/ByteArrayPool.kt
@@ -0,0 +1,32 @@
+package org.rs09.client.util
+
+// TODO This is literally so useless because arrays are never returned to the pool...
+object ByteArrayPool {
+ private val SMALL_BUFFERS = arrayOfNulls(1000)
+ private val MEDIUM_BUFFERS = arrayOfNulls(250)
+ private val LARGE_BUFFERS = arrayOfNulls(50)
+ private var SMALL_INDEX = 0
+ private var MEDIUM_INDEX = 0
+ private var LARGE_INDEX = 0
+
+ @Synchronized
+ fun getByteArray(size: Int): ByteArray = when {
+ size == 100 && SMALL_INDEX > 0 -> {
+ val arr = SMALL_BUFFERS[--SMALL_INDEX]!!
+ SMALL_BUFFERS[SMALL_INDEX] = null
+ arr
+ }
+ size == 5000 && MEDIUM_INDEX > 0 -> {
+ val arr = MEDIUM_BUFFERS[--MEDIUM_INDEX]!!
+ MEDIUM_BUFFERS[MEDIUM_INDEX] = null
+ arr
+ }
+ size == 30000 && LARGE_INDEX > 0 -> {
+ val arr = LARGE_BUFFERS[--LARGE_INDEX]!!
+ LARGE_BUFFERS[LARGE_INDEX] = null
+ arr
+ }
+ else -> ByteArray(size)
+
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/kotlin/org/rs09/client/util/CRC.kt b/Client/src/main/kotlin/org/rs09/client/util/CRC.kt
new file mode 100644
index 000000000..bedc816d6
--- /dev/null
+++ b/Client/src/main/kotlin/org/rs09/client/util/CRC.kt
@@ -0,0 +1,35 @@
+package org.rs09.client.util
+
+object CRC {
+ private val CRC32 = IntArray(256)
+ private val CRC64 = LongArray(256)
+
+ init {
+ // Generate CRC tables
+ for (i in 0 until 256) {
+ var var0 = i
+ for (var2 in 0 until 8) {
+ var0 = if (1 == 1 and var0) {
+ var0 ushr 1 xor -306674912
+ } else {
+ var0 ushr 1
+ }
+ }
+ CRC32[i] = var0
+ }
+
+ }
+
+ fun crc32(data: ByteArray, length: Int): Int = crc32(data, 0, length)
+
+ fun crc32(data: ByteArray, offset: Int, end: Int): Int {
+ var hash = -1
+ var i = offset
+ while (end > i) {
+ hash = hash ushr 8 xor CRC32[hash xor data[i].toInt() and 0xff]
+ ++i
+ }
+ hash = hash.inv()
+ return hash
+ }
+}
\ No newline at end of file
diff --git a/Client/src/main/resources/client.conf b/Client/src/main/resources/client.conf
new file mode 100644
index 000000000..4f636b9cb
--- /dev/null
+++ b/Client/src/main/resources/client.conf
@@ -0,0 +1 @@
+target_ip_addr:127.0.0.1
diff --git a/Client/src/main/resources/fixXinitThreads.cpp b/Client/src/main/resources/fixXinitThreads.cpp
new file mode 100644
index 000000000..276e8793a
--- /dev/null
+++ b/Client/src/main/resources/fixXinitThreads.cpp
@@ -0,0 +1,3 @@
+#include
+#include
+class a{public: a() { XInitThreads(); }};a X;
diff --git a/Management-Server/src/main/java/ms/system/communication/ClanRepository.java b/Management-Server/src/main/java/ms/system/communication/ClanRepository.java
index bfe96cbd4..006034c89 100644
--- a/Management-Server/src/main/java/ms/system/communication/ClanRepository.java
+++ b/Management-Server/src/main/java/ms/system/communication/ClanRepository.java
@@ -79,7 +79,7 @@ public final class ClanRepository {
* @param player The player.
*/
public void enter(PlayerSession player) {
- if (players.size() >= MAX_MEMBERS && !owner.getUsername().equals("2009scape")) {
+ if (players.size() >= MAX_MEMBERS && !owner.getUsername().equals("Fellerscape")) {
WorldPacketRepository.sendPlayerMessage(player, "The channel you tried to join is full.:clan:");
return;
}
diff --git a/Management-Server/src/main/java/ms/system/communication/CommunicationInfo.java b/Management-Server/src/main/java/ms/system/communication/CommunicationInfo.java
index 86afae5ec..ae8bdb74d 100644
--- a/Management-Server/src/main/java/ms/system/communication/CommunicationInfo.java
+++ b/Management-Server/src/main/java/ms/system/communication/CommunicationInfo.java
@@ -45,7 +45,7 @@ public final class CommunicationInfo {
/**
* The current clan this player is in.
*/
- private String currentClan = "2009scape";
+ private String currentClan = "Fellerscape";
/**
* The rank required for joining.
diff --git a/Management-Server/src/main/java/ms/system/util/ManagementConfigParser.kt b/Management-Server/src/main/java/ms/system/util/ManagementConfigParser.kt
index 90c0ce80f..7aba7f237 100644
--- a/Management-Server/src/main/java/ms/system/util/ManagementConfigParser.kt
+++ b/Management-Server/src/main/java/ms/system/util/ManagementConfigParser.kt
@@ -7,7 +7,7 @@ import java.io.FileReader
import kotlin.system.exitProcess
/**
- * Class for parsing the server config, I.E default.conf
+ * Class for parsing the server config, I.E default.json
* @param path the path to the JSON file to parse.
* @author Ceikry
*/
@@ -68,4 +68,4 @@ class ManagementConfigParser(path: String) {
return pathProduct
}
-}
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 5586e9424..4fb01c3d2 100644
--- a/README.md
+++ b/README.md
@@ -2,268 +2,46 @@
-
-
+
+
An open source MMORPG emulation server
-
-
- Community Hosted Server
+ The Official 2009scape Server
·
- Discord Invite
- · Report Bug
+ 2009Scape Discord Invite
+ · Report Bug
-NOTE: Bug reports and support are only accepted by/offered to players of our live hosted server. We will not provide support to those running their own copies.
-
## Table of Contents
-* [Live Server Information](#live-server-information)
-* [History of this Codebase](#history-of-this-codebase)
-* [Our Core Values](#our-core-values)
-* [Contributing](#contributing)
-* [Video Setup Tutorial](#video-setup-tutorial)
-* [Setup for Content Developers](#content-developers-setting-up-the-project)
- * [Github Setup](#github-setup)
- * [Prerequisites](#prerequisites)
- * [Prereq Installation](#prereq-installation)
- * [Project Setup](#project-setup)
- * [Running the project](#running-the-project)
+* [redwings Information](#redwings-information)
+* [Contributing](#contributing-to-the-redwings-codebase)
* [License](#license)
-* [Contact](#contact)
-## Live Server Information
+## redwings Information
-Did you know that the 2009Scape Development Team hosts the main branch of this repo that you can connect to and play? Come join a growing community of people that love to grind out skills, quest, and hangout together. A download link for the launcher can be found here. Connecting to the live server is also one of the easiest ways to identify bugs/typos/missing features. Identifying these issues help developers, whether already on the project, or are even brand new to the project, fix bugs and issues in an expedited rate.
-
-## History of this Codebase
-
-The 2009Scape you see today has gone through a magnitude of changes. Originally starting its life as Arios498, this server saw a lot of people playing it daily, unfortunately, it was for profit and closed source. It was later upgraded to Arios530, targeting the build 530 of runescape with content in and around January 1st, 2009. Development came to a halt when a developer of the closed source project released the source code. The original developers of this server went on to create Kratos 530 back in 2015.
-
-This project was started out of love for the 530 revision. A small group of developers spent thousands of hours improving on the existing source that was left to the curb. Over the past year, this project has seen many developers coming and going, fixing bugs that they find either through their own server, or bugs that they find in the live game that is currently hosted. We do not accept donations of any kind. The smiles and wonderful compliments are more than enough to keep us going! Content and bugfixes are always number one on our list, and we try our best to answer any questions that you may have, provided you have read through this readme and frequently asked questions on the discord.
-
-## Our Core Values
-
-In the current climate of RSPS in general, we believe it's important to wear our core values on our sleeves and defend them with everything we have! Below are what we hold as our core, most important values:
-
-* **We do NOT believe in profiting off RSPS.** To many of us here at the 2009scape team, what we care about most is preserving the wonderful work of the Gower brothers in the most true-to-spirit manner possible. We do NOT do this to make a profit, and in fact **we outright refuse donations.** This is a labor of love and passion for everyone involved, a love for real RS2! This is perhaps the single most central value we have. If you want to "donate" to us, do so with your time and your dedication. That is what we desire most.
-
-
-* **Authenticity is central to the work**. As a remake, one of the most important things to us is being true to the Gower spirit. What the Gowers brought to us in our childhood is what we are driven to preserve for the remainder of the world.
+*"Captain! We are the Red Wings, the pride of Baron! Must we be thieves sent to plunder the weak?"*
-* **Open Source Is Crucial**. We believe open source remakes to be crucial to preserving what we loved in our childhood, and we believe for-profit and/or closed-source servers are destined to flounder out and fail.
+Welcome to redwings, powered by 2009scape. For up-to-date changes to the redwings codebase, please refer to our [CHANGELOG.md](CHANGELOG.md).
+
+Redwings was born from the 2009scape project in late December 2021. Restoring removed features, collaborating and sourcing data, and compensating for the lack of certain content. Where we go now isn't up to me, but whoever decides to partake in developing, free from constraints.
+
+The redwings logos and icons are © property of the redwings development team.
-* **Be Welcoming**. One of our most important goals is to provide a community of friendly and caring people that get along and love to enjoy the game with eachother. For this reason, we do tend to be very strict when it comes to toxicity. We care about quality a whole lot more than quantity!
+## Contributing to the redwings codebase
+To refer to setup guides and insructions in regards to working on, and contributing to the redwings codebase, please refer to our [CONTRIBUTE.md](CONTRIBUTE.md).
-## Contributing
-
-Note: All merge requests MUST be made using the defaut MR template you can select from the dropdown when creating a new merge request. Merge requests that do not use this template will not be accepted.
-More information on Kotlin can be found here.
-
-There are many ways everyone can contribute! From the most seasoned programmers to those who do not have the most remote clue how code works! Below are some things that can always use some love from the community.
-
-* **Wiki Editors**: Did you know we have a wiki? Well it's always in need of people to fill it out and stay on top of it. Editing the wiki is one of the easiest ways you can contribute to 2009scape! If you're an active player and have the will, there's so much you could be helping out with over at the wiki. Click here to go to the wiki.
-
-
-* **JSON editors**: Did you know that the vast majority of our drop tables, stats, examines, item info, npc info, etc is all stored in a very easy-to-modify format called JSON? This is something almost anyone can help with, especially with the tool made by Ceikry to make it simple and streamlined. If you want to know what can be done to help here, get in touch in the development channel in the discord! **JSON editors are always in need and always appreciated!!**.
-
-
-* **Auditors**: As a remake, authenticity is central to our core values! We could always use someone to go through the game and create large lists of simple tasks that can be done to bring us closer to the authentic 2009 game! The preferred way to do this is one-area-at-a-time. If you want to see an example of some audits we've done in the past, take a look here.
-
-
-* **Content Developers**: As a remake, we have massive amounts of content that need to be implemented or corrected. If you know how to program or are willing to learn, this is where you could be extremely helpful! We need everything from quests to dialogue to minigames to skills that still need to be corrected or implemented, and this is perhaps one of the most valuable ways someone could help out the project! If you are interested in developing content, reach out in the development channel of the Discord.
-
-## Content Developers: Setting Up the Project.
-### Gitlab Setup
-
-Note: This allows you to commit changes to the main repo (with approval)! Also, always stay up to date with the most recent updates by pulling into your copy when 2009Scape updates!
-
-1. Create a gitlab account if you haven't done so already
-
-3. Click "Fork" in the top right hand side of our gitlab page.
-
-**If at anytime you have an issue with gitlab please refer to the** Gitlab help center.
-
-### Git LFS Setup
-
-To obtain large binary files for the repo such as the cache, make sure you have git lfs installed: https://git-lfs.github.com/
-
-After setting up git lfs, you may need to run `git lfs pull` in the root of the cloned repo to download essential binaries.
-
-### Prerequisites
-
-Note: It is required for a developer submitting a PR to use Intellij IDEA as your integrated development environment.
-
-* Intellij IDEA
-* Java SE Development Kit Version 1.8/OpenJDK 1.8 (preferred)
-* Gradle (optional - Installs with Intellij on project build)
-* Xampp
-
-## Prereq Installation
-
-Windows
-
-
-
-1. Install JDK version 1.8
- * Scroll down until you see Windows x86 and Windows x64
- * If you are running a 64bit verison of Windows (standard), select Windows x64
- * Accept the terms and conditions, after reading them of course, and login to oracle
- * Download and install like any normal application
-
-2. Install Intellij IDEA
- * Click "Download" on the main page
- * Ensure "Windows" is selected at the top
- * Select "Community download"
- * Download and install like any normal application
-
-3. Install Gradle
- * Click on "Install Gradle"
- * Scroll down to "Installing manually"
- * Download "Binary-only"
- * Scroll down until you see "Microsoft Windows users"
- * Follow the instructions listed on the website
-
-4. Install Xampp
- * Click on "Xampp for Windows"
- * Download
- * Install as Administrator
-
-
-MacOS
-
-
-
-1. Install JDK version 1.8
- * Scroll down until you see macOS x64
- * select macOS x64
- * Accept the terms and conditions, after reading them of course, and login to oracle
- * Download and install like any normal mac application
-
-2. Install Intellij IDEA
- * Click "Download" on the main page
- * Select "Mac" towards the top of the main page
- * Select "Community download"
- * Download and install like any normal application
-
-3. Install Gradle
- * Click on "Install Gradle"
- * Scroll down to "Installing manually"
- * Download "Binary-only"
- * Scroll down until you see "Linux & MacOS users"
- * Follow the instructions listed on the website
-
-4. Install Xampp
- * Click on "Xampp for OS X"
- * Download
- * Install as Administrator
-
-
-Linux
-
-
-
-1. Install JDK version 1.8 through Oracle or through command line
- * Debian, Ubuntu, etc.
- ```sh
- sudo apt install openjdk-8-jdk
- ```
- * Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.
- ```sh
- su -c "yum install java-1.8.0-openjdk"
- ```
-
-2. Install Intellij IDEA through Intellij Website or through Command Line
- * Debian, Ubuntu, etc.
- ```sh
- sudo snap install intellij-idea-community --classic
- ```
-
-3. Install Gradle through the Gradle Website or through Command Line
- * Click install Gradle
- * If you're installing through Command Line follow : Installing with a package manager
- * If you're installing through Download follow : Installing manually : Linux & MacOS users
- ```sh
- sdk install gradle 6.6.1
- ```
-
-4. Install Xampp
- * Click install "XAMPP for Linux"
- * Install like any normal Linux program
-
-
-
-### Project Setup
-
-1. Open Xampp
- * On Windows make sure you run Xampp as administrator
- * On the left hand side make sure you tick the two "Service" boxes for Apache and MySQL
- * For both Apache and MySQL click "Start" under Actions
- * After doing that navigate to the PHP My Admin LOCAL SITE
- * Once opened, on the left hand side click the three "disks" that say "New"
- * In the "Database name" bar type: global
- * Press the "Create" button
- * A three disk "global" should appear on the left hand side
- * Click it and on the top bar select "Import"
- * Under **FILE TO IMPORT** click "Browse...."
- * Navigate to your 2009Scape project folder
- * Go to Server/db_exports/ and import global.sql
- * It may take a moment to import, when It is done importing Xampp is all set up!
-
-2. Open Intellij
- * Select Get from Version Control
- * Click on "Github", and you will be asked to login
- * Change your directory to wherever you want the project to load, or keep it default
- * On the right hand side you should see your Github Repository for 2009Scape
- * Select it and hit "Clone"
- * The project should instantly start building on import. Give it some time because it is going through and compiling alot of files
- * In Intellij go to File -> Project Structure -> Project and verify your Project SDK is set to JDK "1.8"
- * Setup through Intellij should now be finished!
-
-### Running the project
-
-1. Navigate to the right hand side of Intellij where it says "Gradle"
- * Gradle is very useful when it comes to running and compiling the project
- * The only tabs we are concerned about are "Management-Server" and "Server"
- * Each of these have a "Tasks" folder and an "application" folder inside of "Tasks"
-
-2. Click on the "application" folder for the Management-Server and double-click "run"
- * The management server is used for things such as player data(not saves), highscores, and world information
-
-3. Click on the "application" folder for the Server and double-click "run"
- * Please note this may take a minute or two to build, it is compiling a lot of files!
- * If you receive an error on server start, check and make sure that your worldprops/default.conf is pointing to the correct paths
- * * Server debug mode/other information can be changed in worldprops/default.conf
-
-4. Clone the legacy-client repo and follow the same Intellij setup steps
- * Click on the "application" folder for the Client and double-click "run"
- * If you receive an error on client run open your build.gradle to verify that the mainClassName is set to the correct location
- * Due to client work that is on going a lot of files get changed and new paths for the main class are created
- * **FIX** In your build.gradle change the mainClassName and Main-Class attributes to 'org.runite.jagex.Client'
- * If Gradle run still does not work, launch the Client by navigating to Client/src/main/java/org.runite/jagex/Client
- * Right click on the client and select Run 'Client.main()'
- * Client debugging options can be found inside of config.json
### License
-We use the AGPL 3.0 license, which can be found here. Please read and understand the license. Failure to follow the guidelines outlined in the license will result in legal action. If you know or hear of anyone breaking this license, please send a report, with proof, to Red Bracket#8151, ceikry#2724, or woahscam#8535 on discord or email woahscam@hotmail.com. **We WILL NOT change the license to fit your needs.**
-
-### Contact
-
-Reminder: There is no official support for setting up your own server. Do not ping/dm developers about setting up your server. Community support is available in the discord server.
-
-### Video Setup Tutorial
-Occexe made a nice video showing you how to set it up if you'd prefer that. Please note many things have changed since this was filmed and the steps are no longer strictly accurate. Check it out here:
-
-[](http://www.youtube.com/watch?v=3oQcsZdrRcE "2009Scape Setup")
-
+The redwings codebase is licensed under the AGPL 3.0 license, which can be found here.
[license-shield]: https://img.shields.io/badge/license-AGPL--3.0-informational
diff --git a/Server/data/botdata/bot_dialogue.json b/Server/data/botdata/bot_dialogue.json
index 48bee0a54..b05353e32 100644
--- a/Server/data/botdata/bot_dialogue.json
+++ b/Server/data/botdata/bot_dialogue.json
@@ -359,8 +359,8 @@
"Sounds tricky.",
"Guthiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxx!!!!!!",
"530 gang for life",
- "${real.username}, have you read the rules?",
- "${real.username}, have you checked out the Discord?",
+ "@name, have you read the rules?",
+ "@name, have you checked out the Discord?",
"why are the leprechauns moving?",
"I am beyond the point of no return!",
"Nothin' personnel, kid.",
@@ -399,7 +399,7 @@
"Firmly grasp it!",
"My legs!",
"Build more farms.",
- "B sale at Varrock ${real.username}, don't miss out!",
+ "B sale at Varrock @name, don't miss out!",
"Drop party follow me",
"Ryan where is barbass, you said two days Ryan",
"Barbass never",
@@ -412,14 +412,14 @@
"Bwuh",
"I'm literally just mothin' bro",
"Certified 2009scape classic.",
- "Make sure to like, comment and subscribe ${real.username} it really helps",
+ "Make sure to like, comment and subscribe @name it really helps",
"Real 2009scape hours!!! Murder that like if you up!!!!",
"W00t!",
"Owned!",
"Pwned!",
"Lol n00b",
- "Epic ownage ${real.username}",
- "Gielinor is a strange place, ${real.username}. Best have your wits about you.",
+ "Epic ownage @name",
+ "Gielinor is a strange place, @name. Best have your wits about you.",
"Mad bloggers bro",
"Vibe check",
"Drip check",
@@ -434,7 +434,7 @@
"yeah i got funnies",
"read muv luv",
"Why doesn't she love me bros?",
- "${real.username} is off the goop don't listen to the clown",
+ "@name is off the goop don't listen to the clown",
"do yall got laptops",
"cfunny play the alien warp sound effect",
"Ware to all whom doom hither, where cope is all yet constant.",
@@ -444,20 +444,20 @@
"based",
"where is she",
"*S N I I I I I I I I I F F F F F F F F F F F*",
- "Hey ${real.username}, who was in Paris?",
+ "Hey @name, who was in Paris?",
"Huh whuh?",
"who's lone?",
"who *is* he?",
- "Hi ${real.username}, I'm Dad!",
+ "Hi @name, I'm Dad!",
"anyone wanna play melty blood after I high alch these bows?",
"buru nyaaaa",
"Number 15, Taverley Dungeon Black Dragons.",
- "House party at Rimmington! Host: ${real.username}!",
+ "House party at Rimmington! Host: @name!",
"Spending 200m! Trade me, no junk!",
- "Surprise exam, ${real.username}!",
- "Nice outfit ${real.username}, does it come in mens?",
- "Nice outfit ${real.username}, does it come in womens?",
- "Nice outfit ${real.username}, does it come in children's size 12?",
+ "Surprise exam, @name!",
+ "Nice outfit @name, does it come in mens?",
+ "Nice outfit @name, does it come in womens?",
+ "Nice outfit @name, does it come in children's size 12?",
":)",
":D",
"die screaming",
@@ -473,27 +473,41 @@
"Help I just died to Evil Chicken and I lost my stuff!",
"Can you fight Bandos in this game?",
"one bad gloop",
- "${real.username} is not cute or funny",
+ "@name is not cute or funny",
"You have committed crimes against Gielinor and her people. What say you?",
"Barrows trauma",
"Uhuhuhuhuhu please Barrows give me the K top ahhhhhh",
"Selling rare lobby 1m",
"Rise and grind bloatscapers, let's get this bread",
"Nice",
- "Sandwiches, ${real.username}!",
+ "Sandwiches, @name!",
"What a grand and intoxicating innocence!",
"With this character's death, the thread of prophecy is severed.",
"You must gather your party before venturing forth.",
"Praise Andrew Gower",
"Please help me I can't stop playing 2009scape",
- "Are you ignoring me, ${real.username}?!",
+ "Are you ignoring me, @name?!",
+ "Uooooooooooooooooooooooooooohhhhhhhhhhhhhhhhhhhhhhhhhh",
+ "Look where I'm pointing right now, @name",
+ "God I wish that were me",
+ "where is she",
+ "im gonna brown!!!!!!",
+ "hey... babe",
+ "Run",
+ "w*men when they hit me with the training sword and i give them the lumbridge general store stare",
+ "selling deez",
+ "buying deez",
+ "Gotta bloat up",
+ "le content has arrived",
+ "schlop schlop schlop schlop schlop schlop schlop",
+ "meow meow meow oorah",
"i agree with this rfc can we put it in the game please"
],
"halloween": [
"Trick or treat!!!",
"Boo! Hahahahaha!!",
- "Have you got your costume on, ${real.username}?",
- "How much candy did you get, ${real.username}?",
+ "Have you got your costume on, @name?",
+ "How much candy did you get, @name?",
"Don't dead open inside",
"Costume party at my POH!! Follow me!",
"Trick, then!",
@@ -505,17 +519,17 @@
"Watch out for Skeleton Jack!",
"The headless-what-man? Horse? Never heard of those.",
"Bring me their souls!",
- "I'll take any sweets you don't want, ${real.username}",
+ "I'll take any sweets you don't want, @name",
"Whatever you do, don't come to Draynor Manor on this spooky night.",
- "Ahhhh! ${real.username}, you scared me! :(",
+ "Ahhhh! @name, you scared me! :(",
"I'm making soup from some leftover pumpkins, want any?",
"I'm gonna be so sick from eating all these sweets...",
"Rise from the grave, my minions! Tis' Hallowe'en!",
"This Scream Fortress 2 update hits kinda different...",
"Nice costume Woah",
- "Nice costume, ${real.username}!",
+ "Nice costume, @name!",
"Ooh, a piece of candy.",
- "Time to join the skeleton war, ${real.username}.",
+ "Time to join the skeleton war, @name.",
"Spooky scary skeletons!",
"Spooky scary skeletons!",
"Spooky scary skeletons!",
@@ -615,7 +629,8 @@
"I saw Kermit kissing santaaaa claus",
"You are a mean one, Mr. Grinch",
"Deck the hallsss",
- "ITS BEGINNING TO LOOK A LOT LIKE CHRISTAAMASSSSS"
+ "ITS BEGINNING TO LOOK A LOT LIKE CHRISTAAMASSSSS",
+ "Where were you when Phil saved Fellers Xmas?"
],
"christmas_eve": [
"I cant wait for christmas tomorrow @name!!",
@@ -639,6 +654,10 @@
"I hate when its cold outside @name",
"You need to put some warm clothes on @name",
"Wanna build a snowman @name?",
+ "Merry Christmas to all the Fellers!",
+ "Merry Christmas to all the Fellers!",
+ "Merry Christmas to all the Fellers!",
+ "Merry Christmas to all the Fellers!",
"Do you like christmas @name?"
],
"new_years_eve": [
diff --git a/Server/data/configs/drop_tables.json b/Server/data/configs/drop_tables.json
index abd2d0fac..021864beb 100644
--- a/Server/data/configs/drop_tables.json
+++ b/Server/data/configs/drop_tables.json
@@ -1639,7 +1639,7 @@
{
"minAmount": "1",
"weight": "25.0",
- "id": "2683",
+ "id": "1",
"maxAmount": "1"
}
]
@@ -2249,7 +2249,7 @@
{
"minAmount": "1",
"weight": "12.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -2308,7 +2308,7 @@
}
],
"ids": "50,2642",
- "description": "",
+ "description": "King Black Dragon (Boss)",
"main": [
{
"minAmount": "1",
@@ -2444,7 +2444,7 @@
},
{
"minAmount": "1",
- "weight": "0.154",
+ "weight": "0.1641",
"id": "11286",
"maxAmount": "1"
},
@@ -2456,8 +2456,8 @@
},
{
"minAmount": "1",
- "weight": "200.0",
- "id": "0",
+ "weight": "0.547",
+ "id": "14723",
"maxAmount": "1"
}
]
@@ -14236,34 +14236,6 @@
}
]
},
- {
- "default": [
- {
- "minAmount": "1",
- "weight": "100.0",
- "id": "526",
- "maxAmount": "1"
- }
- ],
- "charm": [],
- "ids": "281",
- "description": "",
- "main": []
- },
- {
- "default": [
- {
- "minAmount": "1",
- "weight": "100.0",
- "id": "526",
- "maxAmount": "1"
- }
- ],
- "charm": [],
- "ids": "283",
- "description": "",
- "main": []
- },
{
"default": [
{
@@ -17987,7 +17959,7 @@
{
"minAmount": "1",
"weight": "25.0",
- "id": "2837",
+ "id": "5733",
"maxAmount": "1"
},
{
@@ -39165,6 +39137,12 @@
"weight": "8.0",
"id": "5733",
"maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "4.6",
+ "id": "14723",
+ "maxAmount": "1"
}
]
},
@@ -44656,7 +44634,7 @@
{
"minAmount": "1",
"weight": "5.0",
- "id": "2683",
+ "id": "1",
"maxAmount": "1"
},
{
@@ -45096,7 +45074,7 @@
{
"minAmount": "1",
"weight": "25.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -47389,7 +47367,7 @@
{
"minAmount": "1",
"weight": "25.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -51171,7 +51149,7 @@
{
"minAmount": "1",
"weight": "5.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -51595,7 +51573,7 @@
{
"minAmount": "1",
"weight": "5.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -52205,7 +52183,7 @@
{
"minAmount": "1",
"weight": "50.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
}
]
@@ -59648,7 +59626,7 @@
{
"minAmount": "1",
"weight": "5.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -60263,7 +60241,7 @@
{
"minAmount": "1",
"weight": "25.0",
- "id": "2727",
+ "id": "12070",
"maxAmount": "1"
},
{
@@ -64115,5 +64093,151 @@
"maxAmount": "1"
}
]
+ },
+ {
+ "default": [],
+ "charm": [],
+ "ids": "8591",
+ "description": "Venenatis (Wilderness Boss)",
+ "main": [
+ {
+ "minAmount": "1",
+ "weight": "2.03",
+ "id": "14731",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "36.0",
+ "id": "1093",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "36.0",
+ "id": "1319",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "4.05",
+ "id": "14723",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "4.05",
+ "id": "7158",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "150",
+ "weight": "100.0",
+ "id": "562",
+ "maxAmount": "150"
+ },
+ {
+ "minAmount": "100",
+ "weight": "100.0",
+ "id": "560",
+ "maxAmount": "100"
+ },
+ {
+ "minAmount": "75",
+ "weight": "100.0",
+ "id": "565",
+ "maxAmount": "75"
+ },
+ {
+ "minAmount": "100",
+ "weight": "17.0",
+ "id": "445",
+ "maxAmount": "100"
+ },
+ {
+ "minAmount": "25",
+ "weight": "17.0",
+ "id": "224",
+ "maxAmount": "25"
+ },
+ {
+ "minAmount": "7",
+ "weight": "9.4",
+ "id": "9194",
+ "maxAmount": "25"
+ },
+ {
+ "minAmount": "100",
+ "weight": "9.4",
+ "id": "3052",
+ "maxAmount": "100"
+ },
+ {
+ "minAmount": "15000",
+ "weight": "220.0",
+ "id": "995",
+ "maxAmount": "19999"
+ },
+ {
+ "minAmount": "2",
+ "weight": "100.0",
+ "id": "7208",
+ "maxAmount": "2"
+ },
+ {
+ "minAmount": "8",
+ "weight": "100.0",
+ "id": "2297",
+ "maxAmount": "8"
+ },
+ {
+ "minAmount": "10",
+ "weight": "38.0",
+ "id": "5953",
+ "maxAmount": "10"
+ },
+ {
+ "minAmount": "1",
+ "weight": "17.0",
+ "id": "31",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "2",
+ "weight": "8.0",
+ "id": "5297",
+ "maxAmount": "2"
+ },
+ {
+ "minAmount": "1",
+ "weight": "8.0",
+ "id": "5315",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "8.0",
+ "id": "12070",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "2.59",
+ "id": "10976",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "0.259",
+ "id": "10977",
+ "maxAmount": "1"
+ },
+ {
+ "minAmount": "1",
+ "weight": "100.0",
+ "id": "3024",
+ "maxAmount": "1"
+ }
+ ]
}
-]
+]
\ No newline at end of file
diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json
index d29bc0c9f..2f1fe533e 100644
--- a/Server/data/configs/item_configs.json
+++ b/Server/data/configs/item_configs.json
@@ -15669,9 +15669,9 @@
"high_alchemy": "900",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Staff of air"
},
{
@@ -15708,9 +15708,9 @@
"high_alchemy": "900",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Staff of water"
},
{
@@ -15747,9 +15747,9 @@
"high_alchemy": "900",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Staff of earth"
},
{
@@ -15786,9 +15786,9 @@
"high_alchemy": "900",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "1426",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Staff of fire"
},
{
@@ -15903,9 +15903,9 @@
"high_alchemy": "9300",
"weight": "2.25",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Fire battlestaff"
},
{
@@ -15942,9 +15942,9 @@
"high_alchemy": "9300",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Water battlestaff"
},
{
@@ -15982,9 +15982,9 @@
"high_alchemy": "9300",
"weight": "2.25",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Air battlestaff"
},
{
@@ -16022,9 +16022,9 @@
"high_alchemy": "9300",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Earth battlestaff"
},
{
@@ -28833,7 +28833,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2653",
- "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,0,0,0"
+ "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -28860,7 +28860,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2655",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -28889,7 +28889,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2657",
- "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,1"
+ "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,1,0,1"
},
{
"ge_buy_limit": "2",
@@ -28916,7 +28916,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2659",
- "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0"
+ "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -28944,7 +28944,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2661",
- "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,0,0,0"
+ "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -28971,7 +28971,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2663",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -29000,7 +29000,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2665",
- "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,0,0,0"
+ "bonuses": "0,0,0,-6,-2,30,32,27,-1,30,7,0,1,0,1"
},
{
"ge_buy_limit": "2",
@@ -29027,7 +29027,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2667",
- "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0"
+ "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -29055,7 +29055,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2669",
- "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,0,0,0"
+ "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -29082,7 +29082,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2671",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -29138,7 +29138,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "2675",
- "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,0,0,0"
+ "bonuses": "0,0,0,-8,-2,44,48,46,-1,46,40,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -32518,9 +32518,9 @@
"high_alchemy": "10200",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Lava battlestaff"
},
{
@@ -32549,9 +32549,9 @@
"high_alchemy": "27000",
"weight": "2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Mystic lava staff"
},
{
@@ -32667,6 +32667,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32676,7 +32677,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3095",
- "equip_audio": "1003",
"bonuses": "3,4,-4,0,0,1,2,1,0,0,0,5,0,0,0"
},
{
@@ -32690,6 +32690,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32699,7 +32700,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3096",
- "equip_audio": "1003",
"bonuses": "4,6,-4,0,0,2,3,1,0,0,0,7,0,0,0"
},
{
@@ -32714,6 +32714,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32723,7 +32724,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3097",
- "equip_audio": "1003",
"bonuses": "8,11,-4,0,0,3,6,2,0,0,0,12,0,0,0"
},
{
@@ -32737,6 +32737,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32746,7 +32747,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3098",
- "equip_audio": "1003",
"bonuses": "10,14,-4,0,0,4,7,2,0,0,0,14,0,0,0"
},
{
@@ -32760,6 +32760,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32769,7 +32770,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3099",
- "equip_audio": "1003",
"bonuses": "11,16,-4,0,0,4,8,2,0,0,0,17,0,0,0"
},
{
@@ -32782,6 +32782,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32791,7 +32792,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3100",
- "equip_audio": "1003",
"bonuses": "18,23,-4,0,0,6,12,3,0,0,0,24,0,0,0"
},
{
@@ -32806,6 +32806,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -32816,7 +32817,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3101",
- "equip_audio": "1003",
"bonuses": "26,38,-4,0,0,10,19,5,0,0,0,39,0,0,0"
},
{
@@ -36042,7 +36042,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3478",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"requirements": "{1,40}",
@@ -36060,7 +36060,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3479",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"requirements": "{1,40}",
@@ -36078,7 +36078,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "3480",
- "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,0,0,0"
+ "bonuses": "0,0,0,-21,-7,51,49,47,-4,49,15,0,1,0,0"
},
{
"requirements": "{1,40}",
@@ -38104,6 +38104,7 @@
{
"examine": "A sword used only by Fremennik warriors.",
"durability": null,
+ "has_special": "true",
"low_alchemy": "2000",
"high_alchemy": "3000",
"weight": "1.8",
@@ -40581,10 +40582,10 @@
"high_alchemy": "72000",
"weight": "0.45",
"weapon_interface": "11",
+ "equip_audio": "2249",
"render_anim": "620",
"lendable": "true",
"attack_audios": "2720,0,0,0",
- "equip_audio": "2249",
"name": "Abyssal whip"
},
{
@@ -63492,9 +63493,9 @@
"high_alchemy": "10200",
"weight": "2.2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Mud battlestaff"
},
{
@@ -63782,6 +63783,7 @@
"attack_speed": "4",
"two_handed": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"defence_anim": "397",
"equipment_slot": "3",
@@ -63791,7 +63793,6 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "6587",
- "equip_audio": "1003",
"bonuses": "10,14,-4,0,0,4,7,2,0,0,0,14,1,0,0"
},
{
@@ -93656,7 +93657,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10368",
- "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,0,0,0"
+ "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93683,7 +93684,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10370",
- "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,0,0,0"
+ "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93709,7 +93710,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10372",
- "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,0,0,0"
+ "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93735,7 +93736,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10374",
- "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,0,0,0"
+ "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93760,7 +93761,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10376",
- "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,0,0,0"
+ "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93788,7 +93789,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10378",
- "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,0,0,0"
+ "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93814,7 +93815,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10380",
- "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,0,0,0"
+ "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93841,7 +93842,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10382",
- "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,0,0,0"
+ "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93866,7 +93867,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10384",
- "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,0,0,0"
+ "bonuses": "0,0,0,-10,11,6,5,7,8,0,6,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93895,7 +93896,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10386",
- "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,0,0,0"
+ "bonuses": "0,0,0,-15,30,55,47,60,50,55,55,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93920,7 +93921,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10388",
- "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,0,0,0"
+ "bonuses": "0,0,0,-10,17,31,25,33,28,31,30,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -93946,7 +93947,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10390",
- "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,0,0,0"
+ "bonuses": "0,0,0,-1,7,4,7,10,4,8,8,0,1,0,0"
},
{
"ge_buy_limit": "2",
@@ -95042,6 +95043,7 @@
"turn90ccw_anim": "822",
"weapon_interface": "12",
"turn180_anim": "5438",
+ "equip_audio": "3277",
"render_anim": "1171",
"equipment_slot": "3",
"stand_anim": "5363",
@@ -95050,7 +95052,6 @@
"archery_ticket_price": "0",
"id": "10487",
"stand_turn_anim": "823",
- "equip_audio": "3277",
"bonuses": "-100,-100,-50,0,0,0,0,0,0,0,0,-10,0,0,0"
},
{
@@ -95161,29 +95162,29 @@
"high_alchemy": "461",
"destroy": "true",
"weight": "4.5",
+ "equip_audio": "3284",
"equipment_slot": "1",
"destroy_message": "I can buy a replacement from Ava in Draynor Manor; she will charge me 999 coins for this service.",
"name": "Ava's attractor",
"tradeable": "false",
"archery_ticket_price": "0",
"id": "10498",
- "equip_audio": "3284",
"bonuses": "0,0,0,0,2,0,0,0,2,0,0,0,0,0,0"
},
{
- "destroy_message": "I can obtain a replacement for this from Ava in Draynor Manor. She will need 999 coins to buy the lower",
"shop_price": "999",
"examine": "A superior bagged chicken ready to serve you, magnet in claw.",
"durability": null,
- "name": "Ava's accumulator",
- "tradeable": "false",
"destroy": "true",
"weight": "4.5",
+ "equip_audio": "3284",
+ "equipment_slot": "1",
+ "destroy_message": "I can obtain a replacement for this from Ava in Draynor Manor. She will need 999 coins to buy the lower",
+ "name": "Ava's accumulator",
+ "tradeable": "false",
"archery_ticket_price": "0",
"id": "10499",
- "bonuses": "0,0,0,0,4,0,1,0,4,0,0,0,0,0,0",
- "equip_audio": "3284",
- "equipment_slot": "1"
+ "bonuses": "0,0,0,0,4,0,1,0,4,0,0,0,0,0,0"
},
{
"destroy_message": "I can obtain a replacement for this from the crone who lives west of the Port Phasmatys farm.",
@@ -98248,7 +98249,7 @@
"tradeable": "true",
"archery_ticket_price": "0",
"id": "10780",
- "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,0,0,0,0,0"
+ "bonuses": "0,0,0,-30,-10,82,80,72,-6,80,0,0,0,0,1"
},
{
"examine": "Rune platebody with complete gold trim & plating.",
@@ -102227,10 +102228,10 @@
"high_alchemy": "72001",
"weight": "1.9",
"weapon_interface": "16",
+ "equip_audio": "3738",
"render_anim": "1",
"lendable": "true",
"attack_audios": "3731,0,0,0",
- "equip_audio": "3738",
"name": "Dark bow"
},
{
@@ -106231,9 +106232,9 @@
"high_alchemy": "10200",
"weight": "2",
"weapon_interface": "1",
+ "equip_audio": "2230",
"render_anim": "28",
"attack_audios": "2555,0,0,0",
- "equip_audio": "2230",
"name": "Steam battlestaff"
},
{
@@ -122887,15 +122888,15 @@
"two_handed": "true",
"weapon_interface": "16",
"absorb": "0,0,0",
+ "equip_audio": "3738",
"render_anim": "303",
"lendable": "true",
"destroy_message": "Drop",
"grand_exchange_price": "86850",
+ "attack_audios": "3731,0,0,0",
"name": "Dark bow",
"archery_ticket_price": "0",
"id": "13405",
- "attack_audios": "3731,0,0,0",
- "equip_audio": "3738",
"bonuses": "0,0,0,0,95,0,0,0,0,0,0,0,0,0,0"
},
{
@@ -128239,13 +128240,13 @@
"two_handed": "true",
"weapon_interface": "9",
"absorb": "0,0,0",
+ "equip_audio": "1003",
"lendable": "true",
"destroy_message": "Drop",
"grand_exchange_price": "6535",
"name": "Rune claws",
"archery_ticket_price": "0",
"id": "13764",
- "equip_audio": "1003",
"bonuses": "26,38,-4,0,0,10,19,5,0,0,0,39,0,0,0"
},
{
@@ -130641,7 +130642,7 @@
"shop_price": "300000",
"durability": null,
"high_alchemy": "180000",
- "destroy": "false",
+ "destroy": "true",
"weight": "4.2",
"weapon_interface": "14",
"render_anim": "28",
@@ -130654,7 +130655,7 @@
"durability": null,
"low_alchemy": "120000",
"high_alchemy": "180000",
- "destroy": "false",
+ "destroy": "true",
"attack_speed": "4",
"two_handed": "true",
"destroy_message": "Drop",
@@ -137782,9 +137783,9 @@
"high_alchemy": "40500",
"destroy": "true",
"weapon_interface": "9",
+ "equip_audio": "1003",
"render_anim": "2583",
"lendable": "true",
- "equip_audio": "1003",
"name": "Dragon claws"
},
{
@@ -137815,13 +137816,13 @@
"two_handed": "true",
"weapon_interface": "9",
"absorb": "0,0,0",
+ "equip_audio": "1003",
"lendable": "true",
"destroy_message": "Drop",
"grand_exchange_price": "1472441",
"name": "Dragon claws",
"archery_ticket_price": "0",
"id": "14486",
- "equip_audio": "1003",
"bonuses": "41,57,-4,0,0,13,26,7,0,0,0,56,0,0,0"
},
{
@@ -139667,5 +139668,1055 @@
"examine": "Item container for C. Ele Minor Drop Table. You should not be able to obtain this item.",
"name": "C. Ele Minor Drop Table",
"id": "799"
+ },
+ {
+ "shop_price": "160",
+ "ge_buy_limit": "500",
+ "examine": "Provides excellent protection.",
+ "durability": null,
+ "low_alchemy": "64",
+ "high_alchemy": "96",
+ "weight": "9.5",
+ "equipment_slot": "4",
+ "remove_sleeves": "true",
+ "grand_exchange_price": "36",
+ "name": "Bronze platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14658",
+ "bonuses": "0,0,0,-30,-10,15,14,9,-6,14,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "500",
+ "grand_exchange_price": "36",
+ "durability": null,
+ "name": "Bronze platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14659"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "These look pretty heavy.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "9",
+ "equipment_slot": "7",
+ "grand_exchange_price": "34",
+ "name": "Bronze platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14660",
+ "bonuses": "0,0,0,-21,-7,8,7,6,-4,7,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "34",
+ "durability": null,
+ "name": "Bronze platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14661"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "Designer leg protection.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "8.1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "113",
+ "name": "Bronze plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14662",
+ "bonuses": "0,0,0,-21,-7,8,7,6,-4,7,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "113",
+ "durability": null,
+ "name": "Bronze plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14663"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "44",
+ "ge_buy_limit": "100",
+ "examine": "A full face helmet.",
+ "durability": null,
+ "low_alchemy": "17",
+ "high_alchemy": "26",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "67",
+ "name": "Bronze full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14664",
+ "bonuses": "0,0,0,-6,-2,4,5,3,-1,4,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "67",
+ "durability": null,
+ "name": "Bronze full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14665"
+ },
+ {
+ "shop_price": "86",
+ "ge_buy_limit": "100",
+ "examine": "A large metal shield.",
+ "durability": null,
+ "low_alchemy": "27",
+ "high_alchemy": "40",
+ "weight": "5.4",
+ "equipment_slot": "5",
+ "grand_exchange_price": "18",
+ "name": "Bronze kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14666",
+ "bonuses": "0,0,0,-8,-2,5,7,6,-1,6,1,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "18",
+ "durability": null,
+ "name": "Bronze kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14667"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "24",
+ "ge_buy_limit": "100",
+ "examine": "A medium sized helmet.",
+ "durability": null,
+ "low_alchemy": "9",
+ "high_alchemy": "14",
+ "weight": "1.8",
+ "equipment_slot": "0",
+ "grand_exchange_price": "39",
+ "name": "Bronze med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14668",
+ "bonuses": "0,0,0,-3,-1,3,4,2,-1,3,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "39",
+ "durability": null,
+ "name": "Bronze med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14669"
+ },
+ {
+ "shop_price": "48",
+ "ge_buy_limit": "100",
+ "examine": "A medium square shield.",
+ "durability": null,
+ "low_alchemy": "19",
+ "high_alchemy": "28",
+ "weight": "3",
+ "equipment_slot": "5",
+ "grand_exchange_price": "12",
+ "name": "Bronze sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14670",
+ "bonuses": "0,0,0,-6,-2,5,6,4,0,5,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "12",
+ "durability": null,
+ "name": "Bronze sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14671"
+ },
+ {
+ "shop_price": "160",
+ "ge_buy_limit": "500",
+ "examine": "Provides excellent protection.",
+ "durability": null,
+ "low_alchemy": "64",
+ "high_alchemy": "96",
+ "weight": "9.5",
+ "equipment_slot": "4",
+ "remove_sleeves": "true",
+ "grand_exchange_price": "36",
+ "name": "Iron platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14672",
+ "bonuses": "0,0,0,-30,-10,15,14,9,-6,14,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "500",
+ "grand_exchange_price": "36",
+ "durability": null,
+ "name": "Iron platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14673"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "These look pretty heavy.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "9",
+ "equipment_slot": "7",
+ "grand_exchange_price": "34",
+ "name": "Iron platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14674",
+ "bonuses": "0,0,0,-21,-7,8,7,6,-4,7,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "34",
+ "durability": null,
+ "name": "Iron platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14675"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "Designer leg protection.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "8.1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "113",
+ "name": "Iron plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14676",
+ "bonuses": "0,0,0,-21,-7,8,7,6,-4,7,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "113",
+ "durability": null,
+ "name": "Iron plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14677"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "44",
+ "ge_buy_limit": "100",
+ "examine": "A full face helmet.",
+ "durability": null,
+ "low_alchemy": "17",
+ "high_alchemy": "26",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "67",
+ "name": "Iron full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14678",
+ "bonuses": "0,0,0,-6,-2,4,5,3,-1,4,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "67",
+ "durability": null,
+ "name": "Iron full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14679"
+ },
+ {
+ "shop_price": "86",
+ "ge_buy_limit": "100",
+ "examine": "A large metal shield.",
+ "durability": null,
+ "low_alchemy": "27",
+ "high_alchemy": "40",
+ "weight": "5.4",
+ "equipment_slot": "5",
+ "grand_exchange_price": "18",
+ "name": "Iron kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14680",
+ "bonuses": "0,0,0,-8,-2,5,7,6,-1,6,1,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "18",
+ "durability": null,
+ "name": "Iron kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14681"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "24",
+ "ge_buy_limit": "100",
+ "examine": "A medium sized helmet.",
+ "durability": null,
+ "low_alchemy": "9",
+ "high_alchemy": "14",
+ "weight": "1.8",
+ "equipment_slot": "0",
+ "grand_exchange_price": "39",
+ "name": "Iron med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14682",
+ "bonuses": "0,0,0,-3,-1,3,4,2,-1,3,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "39",
+ "durability": null,
+ "name": "Iron med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14683"
+ },
+ {
+ "shop_price": "48",
+ "ge_buy_limit": "100",
+ "examine": "A medium square shield.",
+ "durability": null,
+ "low_alchemy": "19",
+ "high_alchemy": "28",
+ "weight": "3",
+ "equipment_slot": "5",
+ "grand_exchange_price": "12",
+ "name": "Iron sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14684",
+ "bonuses": "0,0,0,-6,-2,5,6,4,0,5,0,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "12",
+ "durability": null,
+ "name": "Iron sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14685"
+ },
+ {
+ "shop_price": "160",
+ "ge_buy_limit": "500",
+ "examine": "Provides excellent protection.",
+ "durability": null,
+ "low_alchemy": "64",
+ "high_alchemy": "96",
+ "weight": "9.5",
+ "equipment_slot": "4",
+ "remove_sleeves": "true",
+ "grand_exchange_price": "36",
+ "name": "Mithril platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14700",
+ "bonuses": "0,0,0,-30,-10,46,44,38,-6,44,20,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "500",
+ "grand_exchange_price": "36",
+ "durability": null,
+ "name": "Mithril platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14701"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "These look pretty heavy.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "9",
+ "equipment_slot": "7",
+ "grand_exchange_price": "34",
+ "name": "Mithril platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14702",
+ "bonuses": "0,0,0,-21,-7,24,22,20,-4,22,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "34",
+ "durability": null,
+ "name": "Mithril platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14703"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "Designer leg protection.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "8.1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "113",
+ "name": "Mithril plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14704",
+ "bonuses": "0,0,0,-21,-7,24,22,20,-4,22,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "113",
+ "durability": null,
+ "name": "Mithril plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14705"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "44",
+ "ge_buy_limit": "100",
+ "examine": "A full face helmet.",
+ "durability": null,
+ "low_alchemy": "17",
+ "high_alchemy": "26",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "67",
+ "name": "Mithril full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14706",
+ "bonuses": "0,0,0,-6,-2,13,14,11,-1,13,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "67",
+ "durability": null,
+ "name": "Mithril full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14707"
+ },
+ {
+ "shop_price": "86",
+ "ge_buy_limit": "100",
+ "examine": "A large metal shield.",
+ "durability": null,
+ "low_alchemy": "27",
+ "high_alchemy": "40",
+ "weight": "5.4",
+ "equipment_slot": "5",
+ "grand_exchange_price": "18",
+ "name": "Mithril kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14708",
+ "bonuses": "0,0,0,-8,-2,18,22,20,-1,20,20,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "18",
+ "durability": null,
+ "name": "Mithril kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14709"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "24",
+ "ge_buy_limit": "100",
+ "examine": "A medium sized helmet.",
+ "durability": null,
+ "low_alchemy": "9",
+ "high_alchemy": "14",
+ "weight": "1.8",
+ "equipment_slot": "0",
+ "grand_exchange_price": "39",
+ "name": "Mithril med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14710",
+ "bonuses": "0,0,0,-3,-1,10,11,9,-1,10,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "39",
+ "durability": null,
+ "name": "Mithril med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14711"
+ },
+ {
+ "shop_price": "48",
+ "ge_buy_limit": "100",
+ "examine": "A medium square shield.",
+ "durability": null,
+ "low_alchemy": "19",
+ "high_alchemy": "28",
+ "weight": "3",
+ "equipment_slot": "5",
+ "grand_exchange_price": "12",
+ "name": "Mithril sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14712",
+ "bonuses": "0,0,0,-6,-2,17,19,15,0,17,18,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "12",
+ "durability": null,
+ "name": "Mithril sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14713"
+ },
+ {
+ "shop_price": "160",
+ "ge_buy_limit": "500",
+ "examine": "Provides excellent protection.",
+ "durability": null,
+ "low_alchemy": "64",
+ "high_alchemy": "96",
+ "weight": "9.5",
+ "equipment_slot": "4",
+ "remove_sleeves": "true",
+ "grand_exchange_price": "36",
+ "name": "Steel platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14686",
+ "bonuses": "0,0,0,-30,-10,32,31,24,-6,31,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "500",
+ "grand_exchange_price": "36",
+ "durability": null,
+ "name": "Steel platebody (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14687"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "These look pretty heavy.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "9",
+ "equipment_slot": "7",
+ "grand_exchange_price": "34",
+ "name": "Steel platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14688",
+ "bonuses": "0,0,0,-21,-7,17,16,15,-4,16,2,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "34",
+ "durability": null,
+ "name": "Steel platelegs (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14689"
+ },
+ {
+ "shop_price": "80",
+ "ge_buy_limit": "100",
+ "examine": "Designer leg protection.",
+ "durability": null,
+ "low_alchemy": "32",
+ "high_alchemy": "48",
+ "weight": "8.1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "113",
+ "name": "Steel plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14690",
+ "bonuses": "0,0,0,-21,-7,17,16,15,-4,16,2,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "113",
+ "durability": null,
+ "name": "Steel plateskirt (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14691"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "44",
+ "ge_buy_limit": "100",
+ "examine": "A full face helmet.",
+ "durability": null,
+ "low_alchemy": "17",
+ "high_alchemy": "26",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "67",
+ "name": "Steel full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14692",
+ "bonuses": "0,0,0,-6,-2,9,10,7,-1,9,3,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "67",
+ "durability": null,
+ "name": "Steel full helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14693"
+ },
+ {
+ "shop_price": "86",
+ "ge_buy_limit": "100",
+ "examine": "A large metal shield.",
+ "durability": null,
+ "low_alchemy": "27",
+ "high_alchemy": "40",
+ "weight": "5.4",
+ "equipment_slot": "5",
+ "grand_exchange_price": "18",
+ "name": "Steel kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14694",
+ "bonuses": "0,0,0,-8,-2,13,15,14,-1,14,5,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "18",
+ "durability": null,
+ "name": "Steel kiteshield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14695"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "24",
+ "ge_buy_limit": "100",
+ "examine": "A medium sized helmet.",
+ "durability": null,
+ "low_alchemy": "9",
+ "high_alchemy": "14",
+ "weight": "1.8",
+ "equipment_slot": "0",
+ "grand_exchange_price": "39",
+ "name": "Steel med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14696",
+ "bonuses": "0,0,0,-3,-1,7,8,6,-1,7,3,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "39",
+ "durability": null,
+ "name": "Steel med helm (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14697"
+ },
+ {
+ "shop_price": "48",
+ "ge_buy_limit": "100",
+ "examine": "A medium square shield.",
+ "durability": null,
+ "low_alchemy": "19",
+ "high_alchemy": "28",
+ "weight": "3",
+ "equipment_slot": "5",
+ "grand_exchange_price": "12",
+ "name": "Steel sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14698",
+ "bonuses": "0,0,0,-6,-2,12,13,11,0,12,4,0,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "12",
+ "durability": null,
+ "name": "Steel sq shield (g)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14699"
+ },
+ {
+ "shop_price": "5",
+ "ge_buy_limit": "500",
+ "examine": "The platebody of a forgotten warrior, corrupted by the dark altar.",
+ "durability": null,
+ "low_alchemy": "224",
+ "high_alchemy": "336",
+ "weight": "9.95",
+ "equipment_slot": "4",
+ "remove_sleeves": "true",
+ "grand_exchange_price": "434",
+ "name": "Corrupted platebody",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14714",
+ "bonuses": "0,0,0,-30,-10,21,20,12,-6,20,5,0,0,0,0"
+ },
+ {
+ "shop_price": "280",
+ "ge_buy_limit": "100",
+ "examine": "The platelegs of a forgotten warrior, corrupted by the dark altar.",
+ "durability": null,
+ "low_alchemy": "112",
+ "high_alchemy": "168",
+ "weight": "9",
+ "absorb": "1,0,1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "55",
+ "name": "Corrupted platelegs",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14715",
+ "bonuses": "0,0,0,-21,-7,11,10,10,-4,10,0,0,0,0,0"
+ },
+ {
+ "shop_price": "280",
+ "ge_buy_limit": "100",
+ "examine": "The plateskirt of a forgotten warrior, corrupted by the dark altar.",
+ "durability": null,
+ "low_alchemy": "112",
+ "high_alchemy": "168",
+ "weight": "8.1",
+ "equipment_slot": "7",
+ "grand_exchange_price": "86",
+ "name": "Corrupted plateskirt",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14716",
+ "bonuses": "0,0,0,-21,-7,11,10,10,-4,10,0,0,0,0,0"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "61",
+ "ge_buy_limit": "100",
+ "examine": "The helmet of a forgotton warrior, corrupted by the dark altar.",
+ "durability": null,
+ "low_alchemy": "61",
+ "high_alchemy": "92",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "56",
+ "name": "Corrupted full helm",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14717",
+ "bonuses": "0,0,0,-6,-2,6,7,5,-1,6,0,0,0,0,0"
+ },
+ {
+ "shop_price": "233",
+ "ge_buy_limit": "100",
+ "examine": "The kiteshield of a forgotton warrior, corrupted by the dark altar.",
+ "durability": null,
+ "low_alchemy": "95",
+ "high_alchemy": "142",
+ "weight": "5.4",
+ "equipment_slot": "5",
+ "grand_exchange_price": "57",
+ "name": "Corrupted kiteshield",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14718",
+ "bonuses": "0,0,0,-8,-2,8,10,9,-1,9,2,0,0,0,0"
+ },
+ {
+ "examine": "They seem to be not quite of this world...",
+ "durability": null,
+ "name": "Corrupted boots",
+ "low_alchemy": "120",
+ "high_alchemy": "180",
+ "archery_ticket_price": "0",
+ "id": "14719",
+ "bonuses": "0,0,0,2,0,0,0,0,2,0,0,0,0,0,0",
+ "equipment_slot": "10"
+ },
+ {
+ "remove_head": "true",
+ "examine": "A ghostly hood, fit for a ghostly head.",
+ "durability": null,
+ "name": "Corrupted hood",
+ "low_alchemy": "120",
+ "high_alchemy": "180",
+ "archery_ticket_price": "0",
+ "id": "14720",
+ "bonuses": "0,0,0,3,0,0,0,0,3,0,0,0,0,0,0",
+ "equipment_slot": "0"
+ },
+ {
+ "examine": "They seem to fade in and out of existence...",
+ "durability": null,
+ "name": "Corrupted gloves",
+ "low_alchemy": "120",
+ "high_alchemy": "180",
+ "archery_ticket_price": "0",
+ "id": "14721",
+ "bonuses": "0,0,0,2,0,0,0,0,2,0,0,0,0,0,0",
+ "equipment_slot": "9"
+ },
+ {
+ "examine": "Made of a strange, ghostly material...",
+ "durability": null,
+ "name": "Corrupted cloak",
+ "low_alchemy": "100",
+ "high_alchemy": "150",
+ "archery_ticket_price": "0",
+ "id": "14722",
+ "bonuses": "0,0,0,5,0,0,0,0,5,0,0,0,0,0,0",
+ "equipment_slot": "1"
+ },
+ {
+ "requirements": "{0,60}-{14,61}",
+ "shop_price": "1320000",
+ "ge_buy_limit": "40",
+ "examine": "If rocks could feel fear, they'd fear this.",
+ "durability": null,
+ "has_special": "true",
+ "rare_item": "true",
+ "low_alchemy": "55000",
+ "high_alchemy": "75000",
+ "weight": "2.4",
+ "attack_speed": "5",
+ "weapon_interface": "4",
+ "defence_anim": "403",
+ "equipment_slot": "3",
+ "attack_anims": "401,401,400,401",
+ "lendable": "true",
+ "grand_exchange_price": "19500",
+ "attack_audios": "2508,2508,2508,2508",
+ "name": "Dragon pickaxe",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14723",
+ "bonuses": "38,-2,32,0,0,0,1,0,0,0,0,42,0,0,0"
+ },
+ {
+ "ge_buy_limit": "100",
+ "grand_exchange_price": "19500",
+ "durability": null,
+ "name": "Dragon pickaxe",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14724"
+ },
+ {
+ "requirements": "{0,60}-{1,60}",
+ "examine": "A defensive weapon.",
+ "durability": null,
+ "name": "Dragon defender",
+ "weight": "0.4",
+ "archery_ticket_price": "0",
+ "id": "14725",
+ "bonuses": "25,24,23,-3,-2,25,24,23,-3,-2,8,6,0,0,0",
+ "defence_anim": "4177",
+ "equipment_slot": "5"
+ },
+ {
+ "ge_buy_limit": "8",
+ "turn90cw_anim": "821",
+ "examine": "A magical elven sword.",
+ "walk_anim": "1146",
+ "has_special": "false",
+ "low_alchemy": "40000",
+ "turn90ccw_anim": "822",
+ "attack_speed": "4",
+ "turn180_anim": "820",
+ "defence_anim": "397",
+ "equipment_slot": "3",
+ "attack_anims": "390,390,381,390",
+ "grand_exchange_price": "155280944",
+ "stand_anim": "809",
+ "tradeable": "true",
+ "run_anim": "1210",
+ "archery_ticket_price": "0",
+ "id": "14726",
+ "stand_turn_anim": "823",
+ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
+ "requirements": "{0,75}",
+ "shop_price": "100000",
+ "durability": null,
+ "high_alchemy": "60000",
+ "weight": "1.8",
+ "weapon_interface": "6",
+ "render_anim": "28",
+ "lendable": "false",
+ "attack_audios": "2500,2500,2517,2500",
+ "name": "Blade of saeldor (inactive)"
+ },
+ {
+ "ge_buy_limit": "10",
+ "grand_exchange_price": "60200",
+ "durability": null,
+ "name": "Blade of saeldor (inactive)",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14727"
+ },
+ {
+ "turn90cw_anim": "821",
+ "examine": "A magical elven sword.",
+ "walk_anim": "1146",
+ "has_special": "true",
+ "low_alchemy": "40000",
+ "turn90ccw_anim": "822",
+ "attack_speed": "4",
+ "turn180_anim": "820",
+ "defence_anim": "397",
+ "equipment_slot": "3",
+ "attack_anims": "390,390,381,390",
+ "stand_anim": "809",
+ "tradeable": "false",
+ "run_anim": "1210",
+ "archery_ticket_price": "0",
+ "id": "14728",
+ "stand_turn_anim": "823",
+ "bonuses": "55,94,0,0,0,0,0,0,0,0,0,89,0,0,0",
+ "requirements": "{0,75}",
+ "shop_price": "100000",
+ "durability": null,
+ "high_alchemy": "60000",
+ "weight": "1.8",
+ "weapon_interface": "6",
+ "render_anim": "28",
+ "lendable": "false",
+ "attack_audios": "2500,2500,2517,2500",
+ "name": "Blade of saeldor"
+ },
+ {
+ "shop_price": "50000",
+ "examine": "An ancient ring said to bring you closer to the Gods.",
+ "durability": null,
+ "low_alchemy": "20000",
+ "high_alchemy": "30000",
+ "destroy": "false",
+ "absorb": "0,0,0",
+ "equipment_slot": "12",
+ "destroy_message": "",
+ "name": "Ring of the gods",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14729",
+ "bonuses": "0,0,0,0,0,1,1,1,1,1,1,0,4,0,0"
+ },
+ {
+ "durability": null,
+ "name": "Ring of the gods",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14730"
+ },
+ {
+ "shop_price": "50000",
+ "examine": "A razor sharp ring.",
+ "durability": null,
+ "rare_item": "true",
+ "low_alchemy": "20000",
+ "high_alchemy": "30000",
+ "destroy": "false",
+ "absorb": "0,0,0",
+ "equipment_slot": "12",
+ "destroy_message": "",
+ "name": "Treasonous ring",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14731",
+ "bonuses": "4,0,0,0,0,4,0,0,0,0,0,0,0,0,0"
+ },
+ {
+ "durability": null,
+ "name": "Treasonous ring",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14732"
+ },
+ {
+ "shop_price": "50000",
+ "examine": "An incredibly heavy ring.",
+ "durability": null,
+ "low_alchemy": "20000",
+ "high_alchemy": "30000",
+ "destroy": "false",
+ "absorb": "0,0,0",
+ "equipment_slot": "12",
+ "destroy_message": "",
+ "name": "Tyrannical ring",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14733",
+ "bonuses": "0,0,4,0,0,0,0,4,0,0,0,0,0,0,0"
+ },
+ {
+ "durability": null,
+ "name": "Tyrannical ring",
+ "tradeable": "true",
+ "archery_ticket_price": "0",
+ "id": "14734"
+ },
+ {
+ "remove_head": "true",
+ "shop_price": "61",
+ "ge_buy_limit": "100",
+ "examine": "A gift from Neitiznot's Burgher enhanced with the jaw of a Basilisk.",
+ "durability": null,
+ "low_alchemy": "61",
+ "high_alchemy": "92",
+ "weight": "2.7",
+ "remove_beard": "true",
+ "equipment_slot": "0",
+ "grand_exchange_price": "56",
+ "name": "Neitiznot faceguard",
+ "tradeable": "false",
+ "archery_ticket_price": "0",
+ "id": "14735",
+ "bonuses": "0,0,0,0,0,36,34,38,3,34,0,6,3,0,0"
}
]
\ No newline at end of file
diff --git a/Server/data/configs/npc_configs.json b/Server/data/configs/npc_configs.json
index a7682ca76..d52a3bab9 100644
--- a/Server/data/configs/npc_configs.json
+++ b/Server/data/configs/npc_configs.json
@@ -1762,7 +1762,7 @@
"name": "Wolf",
"defence_level": "52",
"safespot": null,
- "lifepoints": "15",
+ "lifepoints": "69",
"strength_level": "55",
"id": "95",
"range_level": "1",
@@ -13171,6 +13171,7 @@
"lifepoints": "51",
"strength_level": "1",
"id": "1265",
+ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"clue_level": "0",
"range_level": "1",
"attack_level": "1"
@@ -13209,6 +13210,7 @@
"strength_level": "1",
"id": "1267",
"aggressive": "true",
+ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
"clue_level": "0",
"range_level": "1",
"attack_level": "1"
@@ -37018,7 +37020,7 @@
"attack_level": "1"
},
{
- "examine": "Not man's best friend.",
+ "examine": "They say inside you there are two wolves...",
"melee_animation": "6559",
"range_animation": "6559",
"combat_audio": "481,491,490",
@@ -37031,7 +37033,7 @@
"name": "Wolf",
"defence_level": "9",
"safespot": null,
- "lifepoints": "15",
+ "lifepoints": "69",
"strength_level": "1",
"id": "4413",
"bonuses": "7,7,7,7,7,7,7,7,7,7,7,7,7,7,7",
@@ -37039,7 +37041,7 @@
"attack_level": "1"
},
{
- "examine": "Not man's best friend.",
+ "examine": "They say inside you there are two wolves...",
"melee_animation": "6559",
"range_animation": "6559",
"combat_audio": "481,491,490",
@@ -233414,5 +233416,28 @@
"examine": "Moley, moley, moley!",
"name": "Baby Mole",
"id": "3343"
+ },
+ {
+ "examine": "That'll get your arachnophobia going...",
+ "melee_animation": "5319",
+ "attack_speed": "5",
+ "poisonous": "true",
+ "magic_level": "150",
+ "respawn_delay": "50",
+ "defence_animation": "5320",
+ "slayer_exp": "388",
+ "poison_amount": "8",
+ "magic_animation": "5319",
+ "death_animation": "5321",
+ "name": "Venenatis",
+ "defence_level": "490",
+ "poison_immune": "true",
+ "lifepoints": "255",
+ "strength_level": "490",
+ "id": "8591",
+ "aggressive": "true",
+ "bonuses": "0,0,0,0,0,260,260,260,850,100,50,0,0,0,0",
+ "range_level": "1",
+ "attack_level": "470"
}
]
\ No newline at end of file
diff --git a/Server/data/configs/npc_spawns.json b/Server/data/configs/npc_spawns.json
index 9c0315f89..2b80df23c 100644
--- a/Server/data/configs/npc_spawns.json
+++ b/Server/data/configs/npc_spawns.json
@@ -10967,6 +10967,10 @@
"npc_id": "800",
"loc_data": "{2884,9765,0,1,0}-{2890,9766,0,1,0}-{2894,9764,0,1,0}"
},
+ {
+ "npc_id": "8591",
+ "loc_data": "{3178,3893,0,1,0}"
+ },
{
"npc_id": "3322",
"loc_data": "{2384,4439,0,1,0}"
diff --git a/Server/data/configs/shops.json b/Server/data/configs/shops.json
index f8bef5fb2..4fcf8b0f7 100644
--- a/Server/data/configs/shops.json
+++ b/Server/data/configs/shops.json
@@ -2151,11 +2151,20 @@
"stock": "{2028,10}-{2030,10}-{2032,10}-{2034,10}-{2036,10}-{2038,10}-{2040,10}"
},
{
- "npcs": "2565",
+ "npcs": "4568",
"high_alch": "0",
"currency": "995",
"general_store": "false",
"id": "244",
+ "title": "Forgotten Relix",
+ "stock": "{7409,5}-{4081,5}-{10588,5}-{1409,5}-{11061,5}-{10887,5}-{9625,5}-{6714,5}-{10886,5}-{11200,5}-{4502,5}-{5763,20}"
+ },
+ {
+ "npcs": "2565",
+ "high_alch": "0",
+ "currency": "995",
+ "general_store": "false",
+ "id": "245",
"title": "The Armour Store",
"stock": "{1147,0}-{1163,0}-{1127,0}-{1093,0}-{1185,0}-{1201,0}-{1113,0}-{1079,0}-{1145,0}-{1161,0}-{1123,0}-{1091,0}-{1183,0}-{1199,0}-{1111,0}-{1073,0}-{1143,0}-{1159,0}-{1121,0}-{1085,0}-{1181,0}-{1197,0}-{1109,0}-{1071,0}"
},
@@ -2164,7 +2173,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "245",
+ "id": "246",
"title": "Gift Shop",
"stock": "{590,10}-{2866,100}-{2878,10}-{314,1000}-{1351,10}-{954,10}-{1931,30}-{1925,30}-{2347,10}-{946,10}-{12561,10}-{12563,10}-{12565,0}-{12567,0}-{12568,0}-{12559,0}-{12570,0}"
},
@@ -2173,7 +2182,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "246",
+ "id": "247",
"title": "Miscellanian Food Shop",
"stock": "{2309,5}-{1985,5}-{1965,5}-{1942,5}-{1957,5}-{1933,5}-{1973,5}-{1927,5}"
},
@@ -2182,7 +2191,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "247",
+ "id": "248",
"title": "The Esoterican Arms",
"stock": "{1917,10}-{5763,10}-{1993,5}-{1798,5}"
},
@@ -2191,7 +2200,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "248",
+ "id": "249",
"title": "Miscellanian Clothes Shop",
"stock": "{3767,5}-{3769,5}-{3771,5}-{3773,5}-{3775,5}-{3795,5}-{5050,3}-{5052,3}-{5038,3}-{5040,3}-{5044,3}-{5046,3}-{5026,3}-{5028,3}-{5032,3}-{5034,3}"
},
@@ -2200,7 +2209,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "249",
+ "id": "250",
"title": "Island Fishmonger",
"stock": "{303,5}-{307,5}-{309,5}-{311,2}-{301,2}-{313,1500}-{314,1000}-{305,5}-{317,0}-{325,200}-{345,0}-{353,0}-{341,0}-{321,0}-{335,0}-{349,0}-{331,0}-{359,0}-{377,0}-{363,0}-{371,0}-{383,0}"
},
@@ -2209,7 +2218,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "250",
+ "id": "251",
"title": "Greengrocer of Miscellania",
"stock": "{1965,10}-{1942,10}-{1957,10}-{1982,10}-{1550,2}"
},
@@ -2218,7 +2227,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "251",
+ "id": "252",
"title": "Legends Guild General Store",
"stock": "{373,20}-{2323,5}-{121,3}-{886,500}"
},
@@ -2227,7 +2236,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "252",
+ "id": "253",
"title": "Two Feet Charley's Fish Shop",
"stock": "{317,10}-{327,10}-{345,10}-{353,10}-{341,10}-{321,10}-{359,0}-{377,0}-{363,0}-{377,0}"
},
@@ -2236,7 +2245,7 @@
"high_alch": "0",
"currency": "995",
"general_store": "false",
- "id": "253",
+ "id": "254",
"title": "Fremennik Fur Trader",
"stock": "{948,10}-{958,10}-{10117,0}-{10121,0}-{10119,0}-{10123,0}-{10093,0}-{10095,0}-{10097,0}-{10099,0}-{10101,0}-{10103,0}"
}
diff --git a/Server/data/eco/grandexchange.db b/Server/data/eco/grandexchange.db
new file mode 100644
index 000000000..f3254e0c8
Binary files /dev/null and b/Server/data/eco/grandexchange.db differ
diff --git a/Server/data/eco/offer_dispatch.json b/Server/data/eco/offer_dispatch.json
new file mode 100644
index 000000000..cf2789833
--- /dev/null
+++ b/Server/data/eco/offer_dispatch.json
@@ -0,0 +1,239 @@
+{
+ "offers": [
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694252244",
+ "uid": "1",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694257643",
+ "uid": "2",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694264843",
+ "uid": "3",
+ "itemId": "385",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "1682",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694269041",
+ "uid": "4",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694274445",
+ "uid": "5",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646694291847",
+ "uid": "6",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695358127",
+ "uid": "7",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695376133",
+ "uid": "8",
+ "itemId": "373",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "501",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695379130",
+ "uid": "9",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695380930",
+ "uid": "10",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695382733",
+ "uid": "11",
+ "itemId": "385",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "1682",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646695394136",
+ "uid": "12",
+ "itemId": "373",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "501",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890783469",
+ "uid": "13",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890790017",
+ "uid": "14",
+ "itemId": "379",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "334",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890797218",
+ "uid": "15",
+ "itemId": "373",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "501",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890808026",
+ "uid": "16",
+ "itemId": "373",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "501",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890815224",
+ "uid": "17",
+ "itemId": "385",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "1682",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ },
+ {
+ "completedAmount": "0",
+ "timeStamp": "1646890824831",
+ "uid": "18",
+ "itemId": "385",
+ "sale": false,
+ "amount": "100",
+ "withdrawItems": [],
+ "offeredValue": "1682",
+ "playerUID": "524363194",
+ "offerState": "1",
+ "totalCoinExchange": "0"
+ }
+ ],
+ "offsetUID": "19"
+}
\ No newline at end of file
diff --git a/Server/data/global_kill_stats.json b/Server/data/global_kill_stats.json
new file mode 100644
index 000000000..9afc43307
--- /dev/null
+++ b/Server/data/global_kill_stats.json
@@ -0,0 +1 @@
+{"kills":{"Arrowmind9":{"397":1},"April7":{"1767":1},"Superjoden7":{"81":1},"Jellyfishes9":{"397":1}},"rare_drops":{}}
\ No newline at end of file
diff --git a/Server/data/kratoscache/cache/main_file_cache.idx27 b/Server/data/kratoscache/cache/main_file_cache.idx27
new file mode 100644
index 000000000..ce542efaa
--- /dev/null
+++ b/Server/data/kratoscache/cache/main_file_cache.idx27
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Server/data/serverstore/daily-deaths-global.json b/Server/data/serverstore/daily-deaths-global.json
new file mode 100644
index 000000000..1560b481a
--- /dev/null
+++ b/Server/data/serverstore/daily-deaths-global.json
@@ -0,0 +1,3 @@
+{
+ "lumbridge-cows": 4
+}
\ No newline at end of file
diff --git a/Server/data/serverstore/shooting-star.json b/Server/data/serverstore/shooting-star.json
new file mode 100644
index 000000000..af73bd5a4
--- /dev/null
+++ b/Server/data/serverstore/shooting-star.json
@@ -0,0 +1,5 @@
+{
+ "level": 3,
+ "isDiscovered": false,
+ "location": "South-west Varrock mine"
+}
\ No newline at end of file
diff --git a/Server/data/serverstore/weekly-penguinhns.json b/Server/data/serverstore/weekly-penguinhns.json
new file mode 100644
index 000000000..0479321ea
--- /dev/null
+++ b/Server/data/serverstore/weekly-penguinhns.json
@@ -0,0 +1,14 @@
+{
+ "spawned-penguins": [
+ 17,
+ 8,
+ 1,
+ 14,
+ 2,
+ 7,
+ 20,
+ 23,
+ 16,
+ 12
+ ]
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/anna_isaakson.asc b/Server/scripts/dialogue/anna_isaakson.asc
new file mode 100644
index 000000000..392b58148
--- /dev/null
+++ b/Server/scripts/dialogue/anna_isaakson.asc
@@ -0,0 +1,5 @@
+@dialogue npc:5512
+ npc("Hello visitor, how are you?")
+ player("Better than expected. Its a lot...nicer...here than I was", "expecting. Everyone seems pretty happy.")
+ npc("Of course, the Burgher is strong and wise, and looks", "after us well")
+ player("I think some of those Jatizso citizens have got", "the wrong idea about this place.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/ardougne_baker.asc b/Server/scripts/dialogue/ardougne_baker.asc
new file mode 100644
index 000000000..8ac900b31
--- /dev/null
+++ b/Server/scripts/dialogue/ardougne_baker.asc
@@ -0,0 +1,10 @@
+@dialogue npc:571
+
+npc("Good day, monsieur. Would you like ze nice", "freshly-baked bread? Or perhaps a nice piece of cake?")
+option("Let's see what you have.", "No, thank you.")
+@option1 {
+ openshop(571)
+}
+@option2 {
+ player("No, thank you.")
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/bandit.asc b/Server/scripts/dialogue/bandit.asc
new file mode 100644
index 000000000..bcf67804b
--- /dev/null
+++ b/Server/scripts/dialogue/bandit.asc
@@ -0,0 +1,2 @@
+@dialogue npc:1926, 1925, 1927, 1928, 1929, 1930, 1931
+npc("Get out of this village.", "You are not welcome here.");
\ No newline at end of file
diff --git a/Server/scripts/dialogue/bandit_shopkeeper.asc b/Server/scripts/dialogue/bandit_shopkeeper.asc
new file mode 100644
index 000000000..14a3f7795
--- /dev/null
+++ b/Server/scripts/dialogue/bandit_shopkeeper.asc
@@ -0,0 +1,15 @@
+@dialogue npc:1917
+player("Hello.")
+npc("Stuff for sale.", "You buying?")
+>options
+
+options: {
+ option("Yes", "No")
+ @option1{
+ openshop(1917)
+ }
+ @option2{
+ npc("No?", "'Bye then.")
+ }
+
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/centaur.asc b/Server/scripts/dialogue/centaur.asc
new file mode 100644
index 000000000..08374f6e5
--- /dev/null
+++ b/Server/scripts/dialogue/centaur.asc
@@ -0,0 +1,2 @@
+@dialogue npc:4439,4438
+npc("Welcome to the land of extreme donators.");
\ No newline at end of file
diff --git a/Server/scripts/dialogue/fridleif_shieldson.asc b/Server/scripts/dialogue/fridleif_shieldson.asc
new file mode 100644
index 000000000..561f3f4ae
--- /dev/null
+++ b/Server/scripts/dialogue/fridleif_shieldson.asc
@@ -0,0 +1,4 @@
+@dialogue npc:5505
+
+
+ npc("Congratulations, Champion Larlim Far-strider. Thank you", "for defeating the Troll King.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/ghost_guard.asc b/Server/scripts/dialogue/ghost_guard.asc
new file mode 100644
index 000000000..f4cc09d09
--- /dev/null
+++ b/Server/scripts/dialogue/ghost_guard.asc
@@ -0,0 +1,15 @@
+@dialogue npc:1706
+npc("All visitors to Port Phasmatys must pay a toll charge of", "2 Ectotokens.")
+>options
+
+options: {
+ option("I don't have that many Ectotokens.", "Where can I get Ecototokens?")
+ @option 1 {
+ player("I don't have that many Ectotokens.")
+ npc("In that case, you need to go to the Temple and earn", "some. Talk to the disciples - they will tell you how.")
+ }
+ @option 2 {
+ player("Where can I get my Ectotokens?")
+ npc("You need to go to the Temple and earn some.", "Talk to the disciples - they will tell you how.")
+ }
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/ghosty_dialogue.asc b/Server/scripts/dialogue/ghosty_dialogue.asc
new file mode 100644
index 000000000..2d621ea48
--- /dev/null
+++ b/Server/scripts/dialogue/ghosty_dialogue.asc
@@ -0,0 +1,3 @@
+@dialogue type:"ghosty dialogue":
+npc("Woooo wooo wooooo woooo")
+plainmessage("You cannot understand the ghost.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/gnometraveller.asc b/Server/scripts/dialogue/gnometraveller.asc
new file mode 100644
index 000000000..dd931f897
--- /dev/null
+++ b/Server/scripts/dialogue/gnometraveller.asc
@@ -0,0 +1,6 @@
+@dialogue npc:2138
+npc(FacialExpression.OLD_NORMAL, "Hello I am a gnome traveller visiting Keldagrim in search", "of low-level skilling supplies.", "I'll offer you an increased buying price,", "higher than any other merchants here can match.");
+npc(FacialExpression.OLD_NORMAL, "If you happen to have any, use them on me and I will", "give you a reasonable amount of gold coins.");
+player("What items, specifically, do you buy?");
+npc(FacialExpression.OLD_NORMAL, "Logs, Oak logs, Willow logs, Clay, Copper ore, Tin ore,", "Iron ore, Shrimps, Sardines, Anchovies, Trout,", "Guam leaves, Tarromin leaves, Harralander leaves", "Bronze bars, Iron bars, and Arrow shafts...");
+npc(FacialExpression.OLD_NORMAL, "... are some of the items I am looking for.", "When it comes to fish, I will pay more if it's cooked.", "I also accept clean or grimy herbs.", "I am also accepting items in regular or bank note form.");
diff --git a/Server/scripts/dialogue/gunnar_holdstrom.asc b/Server/scripts/dialogue/gunnar_holdstrom.asc
new file mode 100644
index 000000000..15ce77c01
--- /dev/null
+++ b/Server/scripts/dialogue/gunnar_holdstrom.asc
@@ -0,0 +1,7 @@
+@dialogue npc:5511
+
+
+ npc("Ah, isn't it a lovely day?")
+ player("It's not bad. What puts you in such a good mood?")
+ npc("Oh, I just love my job. The smell of the sea breeze, the", "smell of the arctic pine sap, the smell of the yaks. I find it", All so bracing.")
+ player("Bracing? Hmmm. I think I might have chosen a different word.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/gunnjorn.asc b/Server/scripts/dialogue/gunnjorn.asc
new file mode 100644
index 000000000..3029b91e8
--- /dev/null
+++ b/Server/scripts/dialogue/gunnjorn.asc
@@ -0,0 +1,3 @@
+@dialogue npc:607
+npc("Haha welcome to my obstacle course. Have fun, but", "remember this isn't a child's playground. People have", "died here.");
+npc("The best way to train, is to go round the course in a", "clockwise direction.")
diff --git a/Server/scripts/dialogue/irksol.asc b/Server/scripts/dialogue/irksol.asc
new file mode 100644
index 000000000..7083a6350
--- /dev/null
+++ b/Server/scripts/dialogue/irksol.asc
@@ -0,0 +1,17 @@
+@dialogue npc:566
+npc("Selling ruby rings! The best deals on rings in over", "twenty four hundred planes of existence!")
+>options
+
+options: {
+ option("I'm interested in these deals.", "No thanks, just browsing.")
+ @option 1 {
+ player("I'm interested in these deals.")
+ npc("Aha! A connoisseur! Check out these beauties!")
+ openshop(566)
+ }
+ @option 2 {
+ player("No thanks, just browsing.")
+ npc("Fair enough.")
+
+ }
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/jimmy_wg.asc b/Server/scripts/dialogue/jimmy_wg.asc
new file mode 100644
index 000000000..3a18ffb4a
--- /dev/null
+++ b/Server/scripts/dialogue/jimmy_wg.asc
@@ -0,0 +1,41 @@
+@dialogue npc:4298
+npc("'Ello there.");
+>options
+
+options: {
+ option("Tell me about this room.", "Tell me how to balance kegs.", "May I claim my tokens please?", "Bye!");
+ @option1 {
+ player("Tell me about this room?");
+ npc("Well... s'like thish...");
+ npc("Thish here'sh a shtore room right?");
+ player("A store room you mean?");
+ npc("That'sh what I said! *HIC* A shtore room..... Now", "technic'ly shpeaking, I should be outshide guarding it...");
+ player("But you just nipped in to have a quick drink?");
+ npc("Yep... and to practish.");
+ player("Practish? I mean.. practise what?");
+ npc("Keg balancin. I'm the besht.");
+ >options
+ }
+ @option2 {
+ player("Tell me how to balance kegs?");
+ npc("Yer very very shtrange. But.... you pick the keg up,", "and balance it on yer head, then you pick another keg", "up and put that on top. S'really very eashy.");
+ player("Eashy?");
+ npc("Yesh. Eashy.");
+ pause(2)
+ npc("But you couldn't ever balansh ash many ash meee!");
+ player("That sounds like a challenge, I'll show you!");
+ >options
+ }
+ @option3 {
+ player("May I claim my tokens please?");
+ npc("Well... err.. ish not offishal or anyfin... but I got the", "ledger of tokensh 'ere. I'll jus' err.. write it in!");
+ player("Won't they know?");
+ npc("Nah... hic.... I'm a wizsh at copyin' signaturesh. Jus'", "ashk an offishal mem'er of shtaff like Shloane fer yer", "tokensh.");
+ plainmessage("The rather drunk Jimmy scribbles the tokens you've earned from", "Keg Balancing in the Ledger so that you can claim them from an", "official member of training staff.");
+ }
+ @option4 {
+ player("Bye!");
+ npc("Shure you wouldn't like an ickle drinkie fore yer go?");
+ player("No thanks, got things to do, people to see, tokens to", "earn...");
+ }
+}
diff --git a/Server/scripts/dialogue/jofridr_moedstatter.asc b/Server/scripts/dialogue/jofridr_moedstatter.asc
new file mode 100644
index 000000000..81f3e069d
--- /dev/null
+++ b/Server/scripts/dialogue/jofridr_moedstatter.asc
@@ -0,0 +1,28 @@
+@dialogue npc:5509
+
+npc("Hello there. Would you like to see the good I have", "for sale?")
+>options
+options: {
+option("Yes please, Jofridr", "No thank you, Jofridr", "Why do you have so much wool in your store?)
+@option1 {
+player("Yes please, Jofridr.")
+openshop(5509)
+}
+
+@option2 {
+ player("No thank you, Jofridr")
+ npc("Fair thee well.")
+}
+@option3 {
+ player("Why do you have so much wool in", "your store?")
+ npc("Ah, I have contacts on the mainland. I have a", "sailor friend who brings me crates of", "wool on a regular basis.")
+ player("What do you trade for it?")
+ npc("Rope of course! What else can we sell? Fish", "would go off before it got so far south.")
+ player("Where does all this rope go?")
+ npc("Err, I don't remember the name of the place", "very well. Dreinna? Drennor? Something like that.")
+ player("That's very interesting. Thanks Jofridr.")
+ }
+ }
+
+
+
\ No newline at end of file
diff --git a/Server/scripts/dialogue/jukat.asc b/Server/scripts/dialogue/jukat.asc
new file mode 100644
index 000000000..938ddb6f7
--- /dev/null
+++ b/Server/scripts/dialogue/jukat.asc
@@ -0,0 +1,15 @@
+@dialogue npc:564
+npc("Dragon swords! Here, Dragon swords! Straight from", "Frenaskrae!")
+>options
+
+options: {
+ option("Yes please.", "No thanks, I'm just browsing.")
+ @option 1 {
+ player("Yes please!")
+ openshop(564)
+ }
+ @option 2 {
+ player("No thanks, I'm just browsing.")
+ }
+}
+
diff --git a/Server/scripts/dialogue/kjedelig_uppsen.asc b/Server/scripts/dialogue/kjedelig_uppsen.asc
new file mode 100644
index 000000000..2b5b1dad5
--- /dev/null
+++ b/Server/scripts/dialogue/kjedelig_uppsen.asc
@@ -0,0 +1,7 @@
+@dialogue npc:5518
+
+
+npc("Ho, Larlim Far-strider! The brave warrior returns!")
+ player("It was a hard-fought battle, but we Fremennik prevailed!")
+ npc("I expect we'll be hearing songs about the 'slayer of the", "Troll king' for many years to come")
+ player("It would be an honour to be remembered in such a way!", "Thanks.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/lisse_isaakson.asc b/Server/scripts/dialogue/lisse_isaakson.asc
new file mode 100644
index 000000000..6c6b04746
--- /dev/null
+++ b/Server/scripts/dialogue/lisse_isaakson.asc
@@ -0,0 +1,10 @@
+@dialogue npc:5513
+
+ npc("Hello, visitor!")
+ player("Hello. What are you up to?")
+ npc("Ah, I was about to collect some yak's milk to make", "yak cheese.")
+ player("Eughr! Though I am curious. Can I try some?")
+ npc("Sorry, no. The last outlander who ate my cheese", "was ill for a month")
+ player("So why don't you get ill as well?")
+ npc("Well, we eat yak milk products every day, from", "when we're born. So I suppose we're used to it. Anyways I", "should stop yakking - Haha - and get on with my work")
+ player("I'm glad to see that puns are common", "everywhere in Keldagrim; even here")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/melina.asc b/Server/scripts/dialogue/melina.asc
new file mode 100644
index 000000000..45f5389b7
--- /dev/null
+++ b/Server/scripts/dialogue/melina.asc
@@ -0,0 +1,2 @@
+@dialogue npc:2935
+npc("Leave me be.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/molly.asc b/Server/scripts/dialogue/molly.asc
new file mode 100644
index 000000000..ad71aba80
--- /dev/null
+++ b/Server/scripts/dialogue/molly.asc
@@ -0,0 +1,41 @@
+@dialogue npc:3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911
+
+npc("Thanks for coming!")
+player("It's not like I had a lot of choice you know!")
+npc("I'm sorry for abducting you like that, but I really need", "your help >playername<.")
+player("What's the problem then?")
+>event_info
+
+event_info:{
+ npc("It's my evil twin sister! She's been galavanting around", "Keldagrim commiting crimes and now I'm getting the", "blame!")
+ player("Well what's all this got to do with me then?")
+ npc("I'm glad you asked!")
+ npc("Through that door is a room with a cage and a control", "panel that operates a giant mechanical claw.")
+ npc("I lured my sister into the room so I could imprison her", "in the cage by using the claw. The problem is my sister", "managed to herd some innocent civilians in there with", "her.")
+ player("So what do you need me to do?")
+ npc("I need you to go next door and use the claw to catch", "my sister.")
+ npc("Once she's in prison, she won't be causing me anymore", "bother!")
+ player("Sounds easy enough to me.")
+ npc("Fabulous! Now take a good long look at me because the", "door will be locked behind you. My twin looks exactly", "like me, even her clothes!")
+ npc("One more thing to make your life difficult; the magic", "powering the claw is running low so you'll only have", "two attempts to catch her.")
+ player("I'll do my best then!")
+ npc("By the way, would you like me to run through the", "controls for you, or do you think you'll manage?")
+ setattribute("/save:ame:evil_twin_info", true);
+ option("Yes please.", "No thanks.")
+ @option1{
+ player("Yes please. I mean, it's always best to be prepared,", "right?")
+ npc("Ok, when you turn the machine on you'll see the", "glowing mark on the floor where the claw is currently", "aiming, and you'll see a lever and button on the right", "hand side of your screen.")
+ npc("To move the claw's current location, click on the", "direction you want it to move in, as indicated on the", "right hand panel.")
+ npc("You'll know which way the claw will go as the lever will", "point that way to show you.")
+ npc("When you see someone on top of the glowing mark,", "then hit the button on the right hand panel, as this will", "send the claw down to pick them up.")
+ npc("Do be careful and make sure that there is someone on", "the mark, and not just walking past it.")
+ npc("Oh, and make sure the person is my sister, so you", "don't end up catching a random civilian.")
+ npc("Does that help?")
+ player("Yes, that covers everything. Thanks!")
+ npc("Good luck!")
+ }
+ @option2{
+ player("No thanks, I should be able to work it out.")
+ npc("Good luck!")
+ }
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/morten_holdstrom.asc b/Server/scripts/dialogue/morten_holdstrom.asc
new file mode 100644
index 000000000..8b0f0eb01
--- /dev/null
+++ b/Server/scripts/dialogue/morten_holdstrom.asc
@@ -0,0 +1,11 @@
+@dialogue npc:5510
+
+
+ npc("Good day to you.")
+ player("Hello. What are you up to?")
+ npc("Ah, Today is surstromming day! The herring I buried", "six months ago is ready to be dug up.")
+ player("Eughr! What are you going to do with it?")
+ npc("Eat it, of course! It will be fermented just-right by now.")
+ player("Fermented? You eat rotten fish?")
+ npc("Hmmm, tasty. I'm guessing you don't want to", "come round and try it?")
+ player("You guess correctly.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/peer_the_seer.asc b/Server/scripts/dialogue/peer_the_seer.asc
new file mode 100644
index 000000000..53da493d0
--- /dev/null
+++ b/Server/scripts/dialogue/peer_the_seer.asc
@@ -0,0 +1,4 @@
+@dialogue npc:1288
+npc("Hey! Outerlander! That is my house! Who do you", "think you are to just barge into my home without", "asking?")
+player("Um... My name is @name.")
+npc("It was a rhetorical question, outerlander. Now get lost.", "I do not appreciate intruders in my home.")
diff --git a/Server/scripts/dialogue/private_paldon.asc b/Server/scripts/dialogue/private_paldon.asc
new file mode 100644
index 000000000..9b44ca0ba
--- /dev/null
+++ b/Server/scripts/dialogue/private_paldon.asc
@@ -0,0 +1,6 @@
+@dialogue npc:5031
+player("Hi")
+npc("Shhh. Don't talk to me.")
+player("What? Why?")
+npc("If I'm seen slacking off by talking to you, I'll be in", "deep trouble!")
+player("Oh... Sorry.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/private_pendron.asc b/Server/scripts/dialogue/private_pendron.asc
new file mode 100644
index 000000000..d35e10b01
--- /dev/null
+++ b/Server/scripts/dialogue/private_pendron.asc
@@ -0,0 +1,5 @@
+@dialogue npc:5032
+player("Hi there.")
+npc("Don't suppose you've seen a battleaxe around here?")
+player("A battleaxe? Nope, afraid not.")
+npc("The captain is going to kill me if he finds out I've lost", "my weapon.")
diff --git a/Server/scripts/dialogue/private_pierreb.asc b/Server/scripts/dialogue/private_pierreb.asc
new file mode 100644
index 000000000..4c76ea8e0
--- /dev/null
+++ b/Server/scripts/dialogue/private_pierreb.asc
@@ -0,0 +1,4 @@
+@dialogue npc:5033
+player("Hello. So you're just a private?")
+npc("Show some respect! It's more than you'll achieve.")
+player("I beg to differ. I'm in perfect shape!")
diff --git a/Server/scripts/dialogue/robin.asc b/Server/scripts/dialogue/robin.asc
new file mode 100644
index 000000000..3a3995208
--- /dev/null
+++ b/Server/scripts/dialogue/robin.asc
@@ -0,0 +1,11 @@
+@dialogue npc:1694
+player("It's nice to see another human face around here.")
+npc("Leave me be, peasant - I am relaxing.")
+player("Well, that's nice!")
+npc("Do you know who I am?")
+player("I'm sorry, I haven't had the privilege.")
+npc("I, peasant, am Robin, Master Bowman. I am very", "famous you know.")
+player("Oh, Robin, Master Bowman, I see.")
+npc("So have you heard of me?")
+player("No.")
+
diff --git a/Server/scripts/dialogue/simon_templeton.asc b/Server/scripts/dialogue/simon_templeton.asc
new file mode 100644
index 000000000..9d5dc9b79
--- /dev/null
+++ b/Server/scripts/dialogue/simon_templeton.asc
@@ -0,0 +1,38 @@
+@dialogue npc:3123
+player("Hello, Simon.")
+npc("G'day, @name.")
+player("How's it going?")
+$hasitem(6970, 1) {
+ npc("Not bad, mate, not bad at all. Got any artefacts for", "me?")
+ >sellOptions
+}
+npc("I've been contracted to retrieve artefacts from the top", "of this magnificent pyramid.")
+player("So, why are you down here and not up there then?")
+npc("Well, it's me back - an old injury I picked up in", "Sophanem has come back to haunt me. I was working", "for the Museum of Varrock, and the gold I had been", "given wasn't enough to pay for the carpet rides, let")
+npc("alone any decent equipment. But that was a long time", "ago... I can't even lift a chisel right now. There's no", "way I can climb all the way up there.")
+player("How on earth did you get down the cliff face, then?")
+npc("That's what set off the injury. I was fine before I", "scrabbed down the pesky slope. I think it will be a while", "before I can climb back up again; I must be getting", "old.")
+npc("Hang on a second... You look like you're pretty agile", "and up for a challenge. How about you retrieve it for", "me?")
+npc("I'll tell you what, I'll give you 1000 coins for every", "artefact you get for me.")
+player("I'll see what I can do.")
+npc("Good on ya, mate!")
+
+sellOptions: {
+ option("Sell it.", "Keep it.")
+ @option1{
+ player("I have one here I'll sell you.")
+ $removeitem(6970, 1) {
+ additem(995, 1000)
+ itemmessage(6970, "You hand over the artefact(s) and Simon hands you 1000 coins.")
+ npc("Ripper! Thanks a bundle mate! Thanks to you I can", "fulfill me contract. You're a true blue! The boss will be", "pleased.")
+ player("Glad I was able to help... but who is your boss? I", "thought you worked for the museum?")
+ npc("Mind your own bizzo, mate. But if you get any more,", "you know where I am!")
+ }
+ }
+ @option2{
+ player("I have one, but I want to keep it for now.")
+ npc("Careful, mate, people come looking for a thing like", "that!")
+ player("Thanks for the advice, but I'll hang onto it for now.")
+ npc("Bye, cobber.")
+ }
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/slug_hemligssen.asc b/Server/scripts/dialogue/slug_hemligssen.asc
new file mode 100644
index 000000000..3742d17e0
--- /dev/null
+++ b/Server/scripts/dialogue/slug_hemligssen.asc
@@ -0,0 +1,5 @@
+@dialogue npc:5520
+
+
+ npc("Shh. Go away. I'm not allowed to talk to you.")
+ player("Fine, Whatever...")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/spirit_spider.asc b/Server/scripts/dialogue/spirit_spider.asc
new file mode 100644
index 000000000..d864fc823
--- /dev/null
+++ b/Server/scripts/dialogue/spirit_spider.asc
@@ -0,0 +1,7 @@
+@dialogue npc:6841, 6842
+npc("Where are we going?")
+player("I've not decided yet.")
+npc("Fine, don't tell me...")
+player("Oh, okay, well we are going...")
+npc("Don't want to know now.")
+player("Siiiigh...spiders.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/test.asc b/Server/scripts/dialogue/test.asc
new file mode 100644
index 000000000..88a630011
--- /dev/null
+++ b/Server/scripts/dialogue/test.asc
@@ -0,0 +1 @@
+message("Roar")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/thakkrad_sigmundson.asc b/Server/scripts/dialogue/thakkrad_sigmundson.asc
new file mode 100644
index 000000000..228288cbb
--- /dev/null
+++ b/Server/scripts/dialogue/thakkrad_sigmundson.asc
@@ -0,0 +1,6 @@
+@dialogue npc:5506
+
+npc("Thank you for leading the Burgher's militia against the", "Troll King.")
+ npc("Now that the trolls are leaderless I have repaired the", "bridge to the central isle for you as best I can.")
+ player("Thanks Thakkrad. Does that mean I have access to the", "runite ores on that island?")
+ npc("Yes, You should be able to mine runite there if you wish.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/trogen_konungarde.asc b/Server/scripts/dialogue/trogen_konungarde.asc
new file mode 100644
index 000000000..367a6428a
--- /dev/null
+++ b/Server/scripts/dialogue/trogen_konungarde.asc
@@ -0,0 +1,7 @@
+@dialogue npc:5519
+
+
+npc("Ho, Larlim Far-strider! The brave warrior returns!")
+ player("It was a hard-fought battle, but we Fremennik prevailed!")
+ npc("I expect we'll be hearing songs about the 'slayer of the", "Troll king' for many years to come")
+ player("It would be an honour to be remembered in such a way!", "Thanks.")
\ No newline at end of file
diff --git a/Server/scripts/dialogue/yanille_bartender.asc b/Server/scripts/dialogue/yanille_bartender.asc
new file mode 100644
index 000000000..a9da9908b
--- /dev/null
+++ b/Server/scripts/dialogue/yanille_bartender.asc
@@ -0,0 +1,25 @@
+@dialogue npc:739
+npc("What can I get you?")
+player("What's on the menu?")
+npc("Dragon Bitter and Greenman's Ale, oh and some cheap", "beer.")
+>options
+
+options: {
+ option("I'll give it a miss I think", "I'll try the Dragon Bitter.", "Can I have some Greenman's Ale?", "One cheap beer please!")
+ @option1 {
+
+ }
+ @option2 {
+
+ }
+ @option3 {
+
+ }
+ @option4 {
+
+ }
+}
+
+buy:(id, cost) {
+
+}
\ No newline at end of file
diff --git a/Server/scripts/dialogue/zanaris_gatekeeper.asc b/Server/scripts/dialogue/zanaris_gatekeeper.asc
new file mode 100644
index 000000000..c79e44646
--- /dev/null
+++ b/Server/scripts/dialogue/zanaris_gatekeeper.asc
@@ -0,0 +1,6 @@
+@dialogue npc:3321, 3307
+player("What happened to the old man who used to be the", "doorman?")
+npc("You mean my father? He went into retirement, I've", "taken over the family business instead.")
+player("Your father! But you don't look anything like him!")
+npc("No, fortunately for me I inherited my good looks from", "my mother.")
+
diff --git a/Server/src/main/java/core/cache/def/impl/ItemDefinition.java b/Server/src/main/java/core/cache/def/impl/ItemDefinition.java
index 80c4c15b7..bf222cbff 100644
--- a/Server/src/main/java/core/cache/def/impl/ItemDefinition.java
+++ b/Server/src/main/java/core/cache/def/impl/ItemDefinition.java
@@ -18,11 +18,14 @@ import core.plugin.Plugin;
import core.tools.StringUtils;
import rs09.game.system.SystemLogger;
import rs09.game.system.config.ItemConfigParser;
+import org.rs09.consts.Items;
import java.nio.ByteBuffer;
import java.text.DecimalFormat;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Arrays;
/**
* Represents an item's definitions.
@@ -678,39 +681,72 @@ public class ItemDefinition extends Definition- {
}
/**
- * The allowed names.
+ * The allowed ids.
*/
- private static final String[] allowedNames = new String[] { "cape", "robe", "hat", "potion" };
+ private static final HashSet
allowedItems = new HashSet(Arrays.asList(
+ Items.PENANCE_GLOVES_10553,
+ Items.ICE_GLOVES_1580,
+ Items.BOOTS_OF_LIGHTNESS_88,
+ Items.CLIMBING_BOOTS_3105,
+ Items.SPOTTED_CAPE_10069,
+ Items.SPOTTIER_CAPE_10071,
+ Items.SARADOMIN_CAPE_2412,
+ Items.ZAMORAK_CAPE_2414,
+ Items.GUTHIX_CAPE_2413,
+ Items.SARADOMIN_CLOAK_10446,
+ Items.ZAMORAK_CLOAK_10450,
+ Items.GUTHIX_CLOAK_10448,
+ Items.HOLY_BOOK_3840,
+ Items.DAMAGED_BOOK_3839,
+ Items.UNHOLY_BOOK_3842,
+ Items.DAMAGED_BOOK_3841,
+ Items.BOOK_OF_BALANCE_3844,
+ Items.DAMAGED_BOOK_3843,
+ Items.WIZARD_BOOTS_2579,
+ Items.COMBAT_BRACELET1_11124,
+ Items.COMBAT_BRACELET2_11122,
+ Items.COMBAT_BRACELET3_11120,
+ Items.COMBAT_BRACELET4_11118,
+ Items.REGEN_BRACELET_11133,
+ Items.WARLOCK_CLOAK_14081,
+ Items.WARLOCK_LEGS_14077,
+ Items.WARLOCK_TOP_14076
+ ));
+ private static final HashSet bannedItems = new HashSet(Arrays.asList(
+ /**Items.BUTTERFLY_NET_10010, easing the restriction until barehanded implementation**/
+ Items.DWARF_CANNON_SET_11967,
+ Items.CANNON_BARRELS_10,
+ Items.CANNON_BASE_6,
+ Items.CANNON_STAND_8,
+ Items.CANNON_FURNACE_12,
+ Items.COOKING_GAUNTLETS_775,
+ Items.CHAOS_GAUNTLETS_777,
+ Items.GOLDSMITH_GAUNTLETS_776,
+ Items.KARAMJA_GLOVES_1_11136,
+ Items.KARAMJA_GLOVES_2_11138,
+ Items.KARAMJA_GLOVES_3_11140,
+ Items.VYREWATCH_TOP_9634,
+ Items.VYREWATCH_LEGS_9636,
+ Items.VYREWATCH_SHOES_9638
+ ));
+
/**
* Checks if the item is allowed on entrana.
* @return {@code True} if so.
*/
public boolean isAllowedOnEntrana() {
- if (getId() == 946) {
+ if(allowedItems.contains(getId())) {
return true;
}
- if (getName().equals("Boots")) {
- return true;
+ if(bannedItems.contains(getId())) {
+ return false;
}
if (getName().toLowerCase().startsWith("ring") || getName().toLowerCase().startsWith("amulet")) {
return true;
}
- if (getName().toLowerCase().contains("spotted") || getName().toLowerCase().equals("spottier")) {
- return true;
- }
- if (getName().equals("Boots of lightness")) {
- return true;
- }
- if(getName().toLowerCase().contains("arrow") || getName().toLowerCase().contains("bolt")){
- return false;
- }
- for (String name : allowedNames) {
- if (getName().toLowerCase().contains(name)) {
- return true;
- }
- }
- return getConfiguration(ItemConfigParser.BONUS) == null;
+ int[] bonuses = getConfiguration(ItemConfigParser.BONUS);
+ return bonuses == null || Arrays.stream(bonuses).allMatch(x -> x == 0);
}
/**
@@ -1661,4 +1697,4 @@ public class ItemDefinition extends Definition- {
public void setMaleWornModelId4(int maleWornModelId4) {
this.maleWornModelId4 = maleWornModelId4;
}
-}
\ No newline at end of file
+}
diff --git a/Server/src/main/java/core/game/content/activity/guild/CraftingGuildPlugin.java b/Server/src/main/java/core/game/content/activity/guild/CraftingGuildPlugin.java
deleted file mode 100644
index dd3aedb80..000000000
--- a/Server/src/main/java/core/game/content/activity/guild/CraftingGuildPlugin.java
+++ /dev/null
@@ -1,293 +0,0 @@
-package core.game.content.activity.guild;
-
-import core.cache.def.impl.NPCDefinition;
-import core.cache.def.impl.SceneryDefinition;
-import core.game.content.dialogue.DialoguePlugin;
-import core.game.content.global.Skillcape;
-import core.game.content.global.action.DoorActionHandler;
-import core.game.node.entity.skill.Skills;
-import core.game.node.entity.skill.crafting.TanningProduct;
-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.item.Item;
-import core.game.node.scenery.Scenery;
-import core.game.world.map.Location;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin used for the crafting guild.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class CraftingGuildPlugin extends OptionHandler {
-
- /**
- * Represents the brown apron item.
- */
- private static final Item BROWN_APRON = new Item(1757);
-
- @Override
- public Plugin
newInstance(Object arg) throws Throwable {
- SceneryDefinition.forId(2647).getHandlers().put("option:open", this);
- NPCDefinition.forId(804).getHandlers().put("option:trade", this);
- new MasterCrafterDialogue().init();
- new TannerDialogue().init();
- return this;
- }
-
- @Override
- public boolean handle(Player player, Node node, String option) {
- final int id = node instanceof Scenery ? ((Scenery) node).getId() : ((NPC) node).getId();
- switch (option) {
- case "open":
- switch (id) {
- case 2647:
- if (player.getLocation().getY() >= 3289) {
- if (player.getSkills().getStaticLevel(Skills.CRAFTING) < 40) {
- player.getDialogueInterpreter().sendDialogues(805, null, "Sorry, only experienced crafters are allowed in here.", "You must be level 40 or above to enter.");
- return true;
- }
- if (!player.getEquipment().containsItem(BROWN_APRON)) {
- player.getDialogueInterpreter().open(805, true, true);
- return true;
- }
- player.getDialogueInterpreter().sendDialogues(805, null, "Welcome to the Guild of Master Craftsmen.");
- DoorActionHandler.handleAutowalkDoor(player, (Scenery) node);
- } else {
- DoorActionHandler.handleAutowalkDoor(player, (Scenery) node);
- return true;
- }
- break;
- }
- return true;
- case "trade":
- switch (id) {
- case 804:
- TanningProduct.open(player, 804);
- break;
- }
- return true;
- }
- return true;
- }
-
- @Override
- public Location getDestination(Node node, Node n) {
- if (n instanceof Scenery) {
- return DoorActionHandler.getDestination((Player) node, (Scenery) n);
- }
- return null;
- }
-
- /**
- * Represents the dialogue plugin used for the crafting master.
- * @author 'Vexia
- * @version 1.0
- */
- public final class MasterCrafterDialogue extends DialoguePlugin {
-
- /**
- * Constructs a new {@code MasterCrafterDialogue} {@code Object}.
- */
- public MasterCrafterDialogue() {
- /**
- * empty.
- */
- }
-
- /**
- * Constructs a new {@code MasterCrafterDialogue} {@code Object}.
- * @param player the player.
- */
- public MasterCrafterDialogue(final Player player) {
- super(player);
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new MasterCrafterDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- if (args.length == 2) {
- npc("Where's your brown apron? You can't come in here", "unless you're wearing one.");
- stage = 100;
- return true;
- }
- npc = (NPC) args[0];
- npc("Hello, and welcome to the Crafting Guild. Accomplished", "crafters from all over the land come here to use our", "top notch workshops.");
- stage = 0;
- return true;
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- switch (stage) {
- case 0:
- if (npc.getId() == 805) {
- if (Skillcape.isMaster(player, Skills.CRAFTING)) {
- player("Hey, could I buy a Skillcape of Crafting?");
- stage = 3;
- } else {
- player("Hey, what is that cape you're wearing?", "I don't recognise it.");
- stage = 1;
- }
- } else {
- end();
- }
- break;
- case 1:
- npc("This? This is a Skillcape of Crafting. It is a symbol of", "my ability and standing here in the Crafting Guild. If", "you should ever achieve level 99 Crafting come and talk", "to me and we'll see if we can sort you out with one.");
- stage = 2;
- break;
- case 2:
- end();
- break;
- case 3:
- npc("Certainly! Right after you pay me 99000 coins.");
- stage = 4;
- break;
- case 4:
- options("Okay, here you go.", "No, thanks.");
- stage = 5;
- break;
- case 5:
- switch (buttonId) {
- case 1:
- player("Okay, here you go.");
- stage = 6;
- break;
- case 2:
- end();
- break;
- }
- break;
- case 6:
- if (Skillcape.purchase(player, Skills.CRAFTING)) {
- npc("There you go! Enjoy.");
- }
- stage = 7;
- break;
- case 7:
- end();
- break;
- case 100:
- npc("Where's your borwn apron? You can't come in here", "unless you're wearing one.");
- stage = 101;
- break;
- case 101:
- player("Err... I haven't got one.");
- stage = 102;
- break;
- case 102:
- end();
- break;
- }
- return true;
- }
-
- @Override
- public int[] getIds() {
- return new int[] { 805, 2732, 2733 };
- }
-
- }
-
- /**
- * Represents the dialogue used for the tanner npc.
- * @author 'Vexia
- * @version 1.0
- */
- public final class TannerDialogue extends DialoguePlugin {
-
- /**
- * Constructs a new {@code TannerDialogue} {@code Object}.
- */
- public TannerDialogue() {
- /**
- * empty.
- */
- }
-
- /**
- * Constructs a new {@code TannerDialogue} {@code Object}.
- * @param player the player.
- */
- public TannerDialogue(final Player player) {
- super(player);
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new TannerDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- npc("Greetings friend. I am a manufacturer of leather.");
- stage = 0;
- return true;
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- switch (stage) {
- case 0:
- options("Can I buy some leather then?", "Leather is rather weak stuff.");
- stage = 1;
- break;
- case 1:
- switch (buttonId) {
- case 1:
- player("Can I buy some leather then?");
- stage = 10;
- break;
- case 2:
- player("Leather is rather weak stuff.");
- stage = 20;
- break;
- }
- break;
- case 10:
- npc("Certainly!");
- stage = 11;
- break;
- case 11:
- end();
- TanningProduct.open(player, 804);
- break;
- case 20:
- npc("Normal leather may be quite weak, but it's very cheap -", "I make it from cowhides for only 1 gp per hide - and", "it's so easy to craft that anyone can work with it.");
- stage = 21;
- break;
- case 21:
- npc("Alternatively you could try hard leather. It's not so", "easy to craft, but I only charge 3gp per cowhide to", "prepare it, and it makes much studier armour.");
- stage = 22;
- break;
- case 22:
- npc("I can also tan snake hides and dragonhides, suitable for", "crafting into the highest quality armour for rangers.");
- stage = 23;
- break;
- case 23:
- player("Thanks, I'll bear it in mind.");
- stage = 24;
- break;
- case 24:
- end();
- break;
- }
- return true;
- }
-
- @Override
- public int[] getIds() {
- return new int[] { 804 };
- }
-
- }
-}
diff --git a/Server/src/main/java/core/game/content/activity/guild/FishingGuild.java b/Server/src/main/java/core/game/content/activity/guild/FishingGuild.java
index 93802cf69..8b5d07ee1 100644
--- a/Server/src/main/java/core/game/content/activity/guild/FishingGuild.java
+++ b/Server/src/main/java/core/game/content/activity/guild/FishingGuild.java
@@ -30,9 +30,10 @@ public final class FishingGuild extends OptionHandler {
@Override
public boolean handle(Player player, Node node, String option) {
+ final int id = ((Scenery) node).getId();
switch (option) {
case "open":
- switch (node.getId()) {
+ switch (id) {
case 2025:
if (player.getSkills().getDynamicLevels()[Skills.FISHING] < 68 && player.getLocation().withinDistance(new Location(2611, 3394, 0))) {
player.getDialogueInterpreter().sendDialogues(308, null, "Hello, I'm afraid only the top fishers are allowed to use", "our premier fishing facilities.");
diff --git a/Server/src/main/java/core/game/content/activity/pyramidplunder/PlunderZones.java b/Server/src/main/java/core/game/content/activity/pyramidplunder/PlunderZones.java
index 2f3fbcf9c..6a2e2de5b 100644
--- a/Server/src/main/java/core/game/content/activity/pyramidplunder/PlunderZones.java
+++ b/Server/src/main/java/core/game/content/activity/pyramidplunder/PlunderZones.java
@@ -9,7 +9,6 @@ import core.game.node.entity.npc.NPC;
import core.game.node.entity.player.Player;
import core.game.node.entity.skill.Skills;
import core.game.node.item.Item;
-import core.game.node.scenery.Scenery;
import core.game.node.scenery.SceneryBuilder;
import core.game.system.task.LocationLogoutTask;
import core.game.system.task.LogoutTask;
@@ -198,9 +197,9 @@ public class PlunderZones implements Plugin {
}
return true;
}
- PlunderObject object = target instanceof Scenery ? new PlunderObject(target.asScenery()) : null;
+ PlunderObject object = target instanceof NPC ? null : new PlunderObject(target.asScenery()); //PlunderObject(target.getId(),target.getLocation());
PlunderObjectManager manager = player.getPlunderObjectManager();
- if(object == null || manager == null) return super.interact(e, target, option);
+ 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);
@@ -212,7 +211,7 @@ public class PlunderZones implements Plugin {
case 16517: //Spear trap
if(!checkRequirements(player,room)){
player.getPacketDispatch().sendMessage("You need to be at least level " + room.reqLevel + " thieving.");
- return true;
+ break;
}
player.getLocks().lockInteractions(2);
player.animate(animations[success ? 1 : 0]);
@@ -226,18 +225,18 @@ public class PlunderZones implements Plugin {
} else {
player.getPacketDispatch().sendMessage("You fail to pass the spears.");
}
- return true;
+ break;
case 16503:
case 16502:
case 16501: // Urns
if (optionName.equals("search")) {
if (!checkRequirements(player,room)){
player.getPacketDispatch().sendMessage("You need to be at least level " + room.reqLevel + " thieving.");
- return true;
+ break;
}
if (alreadyOpened){
player.getPacketDispatch().sendMessage("You've already looted this.");
- return true;
+ break;
}
player.animate(animations[success ? 1 : 0]);
@@ -260,7 +259,7 @@ public class PlunderZones implements Plugin {
SceneryBuilder.replace(target.asScenery(), target.asScenery().transform(object.snakeId), 5);
}
}
- return true;
+ break;
case 16509:
case 16510:
case 16511: // Snake urns
@@ -272,17 +271,17 @@ public class PlunderZones implements Plugin {
player.getImpactHandler().manualHit(player, RandomFunction.random(2, 8), ImpactHandler.HitsplatType.NORMAL);
player.getPacketDispatch().sendMessage("The snake bites you.");
}
- return true;
+ break;
case 16473: // Chest
if(optionName.equals("search")) {
boolean willSpawnSwarm = (RandomFunction.random(1,20) == 10);
if(!checkRequirements(player,room)){
player.getPacketDispatch().sendMessage("You need at least level " + room.reqLevel + " thieving to loot this.");
- return true;
+ break;
}
if (alreadyOpened){
player.getPacketDispatch().sendMessage("You've already looted this.");
- return true;
+ break;
}
player.getPacketDispatch().sendMessage("You search the chest...");
player.animate(animations[1]);
@@ -301,16 +300,16 @@ public class PlunderZones implements Plugin {
manager.registerOpened(object);
//ObjectBuilder.replace(target.asObject(), target.asObject().transform(object.openId), 5);
}
- return true;
+ break;
case 16495: //Sarcophagus
if(optionName.equals("open")) {
if (!checkRequirements(player,room)){
player.getPacketDispatch().sendMessage("You need to be at least level " + room.reqLevel + " thieving.");
- return true;
+ break;
}
if (alreadyOpened){
player.getPacketDispatch().sendMessage("You've already looted this.");
- return true;
+ break;
}
boolean willSpawnMummy = (RandomFunction.random(1,5) == 3);
player.animate(animations[1]);
@@ -329,12 +328,12 @@ public class PlunderZones implements Plugin {
manager.registerOpened(object);
//ObjectBuilder.replace(target.asObject(), target.asObject().transform(object.openId), 5);
}
- return true;
+ break;
case 16475: //doors
if(optionName.equals("pick-lock") && roomnum < 8) {
if (!checkRequirements(player,room)){
player.getPacketDispatch().sendMessage("You need to be at least level " + room.reqLevel + " thieving.");
- return true;
+ break;
}
player.animate(animations[1]);
player.getLocks().lockInteractions(2);
@@ -355,13 +354,14 @@ public class PlunderZones implements Plugin {
} else if(roomnum == 8) {
ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, Location.create(3288, 2801, 0));
}
- return true;
+ break;
case 16476:
player.getDialogueInterpreter().sendDialogue("This door doesn't seem to lead","anywhere.");
- return true;
+ break;
default:
return super.interact(e, target, option);
}
+ return true;
}
}
}
diff --git a/Server/src/main/java/core/game/content/activity/wguild/cyclopes/CyclopesRoom.java b/Server/src/main/java/core/game/content/activity/wguild/cyclopes/CyclopesRoom.java
index 4ef808d96..27d279fbb 100644
--- a/Server/src/main/java/core/game/content/activity/wguild/cyclopes/CyclopesRoom.java
+++ b/Server/src/main/java/core/game/content/activity/wguild/cyclopes/CyclopesRoom.java
@@ -41,7 +41,7 @@ public final class CyclopesRoom extends MapZone implements Plugin {
/**
* The defenders.
*/
- private static final int[] DEFENDERS = { 8844, 8845, 8846, 8847, 8848, 8849, 8850};
+ private static final int[] DEFENDERS = { 8844, 8845, 8846, 8847, 8848, 8849, 8850, 14725};
/**
* The players in the room.
@@ -262,7 +262,7 @@ public final class CyclopesRoom extends MapZone implements Plugin {
case 0:
player.setAttribute("sent_dialogue", true);
if (defenderId == DEFENDERS.length - 1) {
- npc(4289, "I'll release some cyclopes which might drop the same", "rune defender for you as there isn't any higher! Have", "fun in there.");
+ npc(4289, "I'll release some cyclopes which might drop the same", "dragon defender for you as there isn't any higher! Have", "fun in there.");
} else if (defenderId == -1) {
npc(4289, "I'll release some cyclopes which might drop bronze", "defenders for you to start off with, unless you show me", "another. Have fun in there.");
} else {
diff --git a/Server/src/main/java/core/game/content/dialogue/BananaCrateDialogue.java b/Server/src/main/java/core/game/content/dialogue/BananaCrateDialogue.java
deleted file mode 100644
index e6b7dbb3c..000000000
--- a/Server/src/main/java/core/game/content/dialogue/BananaCrateDialogue.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package core.game.content.dialogue;
-
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.game.world.update.flag.context.Animation;
-
-/**
- * Represents the banana crate dialogue.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class BananaCrateDialogue extends DialoguePlugin {
-
- /**
- * Represents the dialogue id.
- */
- public static final int ID = 9682749;
-
- /**
- * Represents the animation to use.
- */
- private static final Animation ANIMATION = new Animation(832);
-
- /**
- * Represents the banana item.
- */
- private static final Item BANANA = new Item(1963);
-
- /**
- * Constructs a new {@code BananaCrateDialogue} {@code Object}.
- */
- public BananaCrateDialogue() {
- /**
- * empty.
- */
- }
-
- /**
- * Constructs a new {@code BananaCrateDialogue} {@code Object}.
- * @param player the player.
- */
- public BananaCrateDialogue(Player player) {
- super(player);
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new BananaCrateDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- interpreter.sendOptions("Do you want to take a banana?", "Yes.", "No.");
- stage = 0;
- return true;
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- switch (stage) {
- case 0:
- switch (buttonId) {
- case 1:
- if (player.getInventory().add(BANANA)) {
- player.animate(ANIMATION);
- player.getPacketDispatch().sendMessage("You take a banana.");
- }
- end();
- break;
- case 2:
- end();
- break;
- }
- break;
- }
- return true;
- }
-
- @Override
- public int[] getIds() {
- return new int[] { ID };
- }
-}
diff --git a/Server/src/main/java/core/game/content/dialogue/BillTeachDialogue.java b/Server/src/main/java/core/game/content/dialogue/BillTeachDialogue.java
new file mode 100644
index 000000000..4d7840258
--- /dev/null
+++ b/Server/src/main/java/core/game/content/dialogue/BillTeachDialogue.java
@@ -0,0 +1,219 @@
+package core.game.content.dialogue;
+
+import core.plugin.Initializable;
+import core.game.node.entity.npc.NPC;
+import core.game.node.entity.player.Player;
+import core.game.world.map.Location;
+
+/**
+ * Represents the dialogue plugin used for Bill Teach
+ * @author Charlie
+ * @version 1.0
+ */
+@Initializable
+public final class BillTeachDialogue extends DialoguePlugin {
+
+ /**
+ * Constructs a new {@code BarfyBill} {@code Object}.
+ */
+ public BillTeachDialogue() {
+ /**
+ * empty.
+ */
+ }
+
+ /**
+ * Constructs a new {@code BarfyBill} {@code Object}.
+ * @param player the player.
+ */
+ public BillTeachDialogue(Player player) {
+ super(player);
+ }
+
+ @Override
+ public DialoguePlugin newInstance(Player player) {
+ return new BillTeachDialogue(player);
+ }
+
+ @Override
+ public boolean open(Object... args) {
+ npc = new NPC(3155);
+ player("Hello there.");
+ stage = 0;
+ return true;
+ }
+
+ @Override
+ public boolean handle(int interfaceId, int buttonId) {
+ switch (stage) {
+ case 0:
+ npc("Arr'! Avast ye' scallywag!", "You be lookin' to get somewhere " + (player.isMale() ? "lad?" : "lass?"));
+ stage = 1;
+ break;
+ case 1:
+ interpreter.sendOptions("Select an Option", "Yes", "No, thank you");
+ stage = 2;
+ break;
+ case 2:
+ switch (buttonId) {
+ case 1:
+ player("Yes, where can you take me?");
+ stage = 1000;
+ break;
+ case 2:
+ npc("Arr'! You be wastin' my time again..");
+ stage = 7;
+ break;
+ }
+ break;
+ case 1000:
+ npc("Aye, take a browse through me options.");
+ stage++;
+ break;
+ case 1001:
+ interpreter.sendOptions("Select an Option", "Slayer Tower", "Zanaris Fairy Ring", "Gnome Stronghold", "Rellekka", "More");
+ stage = 2000;
+ break;
+ case 2000:
+ switch (buttonId) {
+ case 1:
+ if(!player.getQuestRepository().isComplete("Priest in Peril")) {
+ npc("Aye, sorry there " + pirateGender() + ", but you'll be needing to ", "help King Roald with something first.");
+ stage = 7;
+ } else {
+ end();
+ player.teleport(new Location(3429, 3526, 0));
+ }
+ break;
+ case 2:
+ if(!player.getQuestRepository().isComplete("Lost City")) {
+ npc("Aye, sorry there " + pirateGender() + ", but you'll be needing to ", "discover Zanaris first.");
+ stage = 7;
+ } else {
+ end();
+ player.teleport(new Location(2412, 4433, 0));
+ }
+ break;
+ case 3:
+ end();
+ player.teleport(new Location(2461, 3444, 0));
+ break;
+ case 4:
+ end();
+ player.teleport(new Location(2669, 3631, 0));
+ break;
+ case 5:
+ interpreter.sendOptions("Select an Option", "Kalphite Lair", "Asgarnian Ice Dungeon", "Fremmenik Dungeon", "Taverley Dungeon", "More");
+ stage = 3000;
+ break;
+ }
+ break;
+ case 3000:
+ switch (buttonId) {
+ case 1:
+ end();
+ player.teleport(new Location(3227, 3107, 0));
+ break;
+ case 2:
+ end();
+ player.teleport(new Location(3007, 9550, 0));
+ break;
+ case 3:
+ end();
+ player.teleport(new Location(2808, 10002, 0));
+ break;
+ case 4:
+ end();
+ player.teleport(new Location(2884, 9798, 0));
+ break;
+ case 5:
+ interpreter.sendOptions("Select an Option", "Waterfall Dungeon", "Brimhaven Dungeon", "Ape Atoll Dungeon", "God Wars Dungeon", "More");
+ stage = 4000;
+ break;
+ }
+ break;
+ case 4000:
+ switch (buttonId) {
+ case 1:
+ end();
+ player.teleport(new Location(2575, 9861, 0));
+ break;
+ case 2:
+ end();
+ player.teleport(new Location(2713, 9564, 0));
+ break;
+ case 3:
+ end();
+ player.teleport(new Location(2715, 9184, 0));
+ break;
+ case 4:
+ end();
+ player.teleport(new Location(2898, 3710, 0));
+ break;
+ case 5:
+ interpreter.sendOptions("Select an Option", "Shilo Village", "Yanille", "Zul-Andra", "Piscatoris Fishing Colony", "More");
+ stage = 5000;
+ break;
+ }
+ break;
+ case 5000:
+ switch (buttonId) {
+ case 1:
+ end();
+ player.teleport(new Location(2867, 2952, 0));
+ break;
+ case 2:
+ end();
+ player.teleport(new Location(2544, 3096, 0));
+ break;
+ case 3:
+ end();
+ player.teleport(new Location(2193, 3055, 0));
+ break;
+ case 4:
+ end();
+ player.teleport(new Location(2343, 3663, 0));
+ break;
+ case 5:
+ interpreter.sendOptions("Select an Option", "Bandit Camp", "Miscellenia", "Mort'ton", "Feldip Hills", "Back");
+ stage = 6000;
+ break;
+ }
+ break;
+ case 6000:
+ switch (buttonId) {
+ case 1:
+ end();
+ player.teleport(new Location(3176, 2987, 0));
+ break;
+ case 2:
+ end();
+ player.teleport(new Location(2581, 3845, 0));
+ break;
+ case 3:
+ end();
+ player.teleport(new Location(3488, 3296, 0));
+ break;
+ case 4:
+ end();
+ player.teleport(new Location(2525, 2915, 0));
+ break;
+ case 5:
+ interpreter.sendOptions("Select an Option", "Slayer Tower", "Zanaris Fairy Ring", "Gnome Stronghold", "Rellekka", "More");
+ stage = 2000;
+ break;
+ }
+ break;
+ case 7:
+ end();
+ break;
+ }
+ return true;
+ }
+
+ @Override
+ public int[] getIds() {
+ return new int[] { 3155 };
+ }
+
+}
diff --git a/Server/src/main/java/core/game/content/dialogue/DenulthDialogue.java b/Server/src/main/java/core/game/content/dialogue/DenulthDialogue.java
deleted file mode 100644
index 453b01d3f..000000000
--- a/Server/src/main/java/core/game/content/dialogue/DenulthDialogue.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package core.game.content.dialogue;
-
-import core.game.node.entity.npc.NPC;
-import core.plugin.Initializable;
-import core.game.node.entity.player.Player;
-
-/**
- * Represents the denulth dialogue plugin.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class DenulthDialogue extends DialoguePlugin {
-
- /**
- * Constructs a new {@code DenulthDialogue} {@code Object}.
- */
- public DenulthDialogue() {
- /**
- * empty.
- */
- }
-
- /**
- * Constructs a new {@code DenulthDialogue} {@code Object}.
- * @param player the player.
- */
- public DenulthDialogue(Player player) {
- super(player);
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new DenulthDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- npc = (NPC) args[0];
- interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Hello!");
- stage = 0;
- return true;
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- switch (stage) {
- case 0:
- interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Welcome back friend!");
- stage = 1;
- break;
- case 1:
- interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "How goes your fight with trolls?");
- stage = 2;
- break;
- case 2:
- interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "Very good! We are winning.");
- stage = 3;
- break;
- case 3:
- interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Good luck!");
- stage = 4;
- break;
- case 4:
- end();
- break;
- }
- return true;
- }
-
- @Override
- public int[] getIds() {
- return new int[] { 1060 };
- }
-
-}
diff --git a/Server/src/main/java/core/game/content/dialogue/FacialExpression.java b/Server/src/main/java/core/game/content/dialogue/FacialExpression.java
index 8ecf1ed26..a4d32afdf 100644
--- a/Server/src/main/java/core/game/content/dialogue/FacialExpression.java
+++ b/Server/src/main/java/core/game/content/dialogue/FacialExpression.java
@@ -50,6 +50,7 @@ public enum FacialExpression {
//Chatheads from 2009?
NOD_YES(9741),
+ DISAGREE(9742),
WORRIED(9743),
HALF_WORRIED(9745), //Not on the wiki, first half of worried
AMAZED(9746),
diff --git a/Server/src/main/java/core/game/content/dialogue/HansDialoguePlugin.java b/Server/src/main/java/core/game/content/dialogue/HansDialoguePlugin.java
index 9e052bd37..25384d331 100644
--- a/Server/src/main/java/core/game/content/dialogue/HansDialoguePlugin.java
+++ b/Server/src/main/java/core/game/content/dialogue/HansDialoguePlugin.java
@@ -134,9 +134,9 @@ public final class HansDialoguePlugin extends DialoguePlugin {
switch(buttonId){
case 1:
if(player.getAttributes().containsKey("permadeath")){
- options("1.0x", "2.5x", "Stay 5.0x", "(HCIM Only) 10x");
+ options("1.0x", "2.5x", "Stay 5.0x", "(HCIM Only) 10x", "20x");
} else {
- options("1.0x", "2.5x", "Stay 5.0x");
+ options("1.0x", "2.5x", "Stay 5.0x", "10x", "20x");
}
stage++;
break;
@@ -176,7 +176,14 @@ public final class HansDialoguePlugin extends DialoguePlugin {
} else {
stage = 15;
}
- break;
+ break;
+ case 5:
+ if (player.newPlayer) {
+ player.getSkills().experienceMutiplier = 20.0;
+ stage = 14;
+ } else {
+ stage = 15;
+ }
}
npc("One moment, please...");
break;
diff --git a/Server/src/main/java/core/game/content/dialogue/SkullSceptreDialogue.java b/Server/src/main/java/core/game/content/dialogue/SkullSceptreDialogue.java
deleted file mode 100644
index 9661657ee..000000000
--- a/Server/src/main/java/core/game/content/dialogue/SkullSceptreDialogue.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package core.game.content.dialogue;
-
-import core.plugin.Initializable;
-import core.game.node.entity.player.Player;
-
-/**
- * @author 'Vexia
- */
-@Initializable
-public class SkullSceptreDialogue extends DialoguePlugin {
-
- public SkullSceptreDialogue() {
-
- }
-
- public SkullSceptreDialogue(Player player) {
- super(player);
- }
-
- @Override
- public int[] getIds() {
- return new int[] { 78489 };
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- end();
- return true;
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new SkullSceptreDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- interpreter.sendItemMessage(9009, "The two halves of the skull fit perfectly.");
- if (args.length == 1) {
- interpreter.sendItemMessage(9012, "The two halves of the sceptre fit perfectly.");// The
- // Sceptre", "appears
- // to
- // be
- // designed
- // to
- // have
- // something
- // on
- // top.");
- return true;
- }
- if (args.length == 2) {
- interpreter.sendItemMessage(9013, "The skull fits perfectly atop the Sceptre.");// The
- // Sceptre", "appears
- // to
- // be
- // designed
- // to
- // have
- // something
- // on
- // top.");
- return true;
- }
- stage = 0;
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/content/global/BossKillCounter.java b/Server/src/main/java/core/game/content/global/BossKillCounter.java
index 319b0dcdb..dc8f12368 100644
--- a/Server/src/main/java/core/game/content/global/BossKillCounter.java
+++ b/Server/src/main/java/core/game/content/global/BossKillCounter.java
@@ -32,7 +32,7 @@ public enum BossKillCounter {
}, "Tormented demon", -1),
CALLISTO(new int[] { 8610 }, "Callisto", 14658),
SCORPIA(new int[] { 8611 }, "Scorpia", 14661),
- VENENATIS(new int[] { 8612 }, "Venenatis", 14657),
+ VENENATIS(new int[] { 8591 }, "Venenatis", 14657),
VETION(new int[] { 8613 }, "Vet'ion", 14659),
KRAKEN(new int[] { 8614 }, "Cave Kraken", 14651),
diff --git a/Server/src/main/java/core/game/content/global/EnchantedJewellery.java b/Server/src/main/java/core/game/content/global/EnchantedJewellery.java
index 0d6b92af9..f1af710e1 100644
--- a/Server/src/main/java/core/game/content/global/EnchantedJewellery.java
+++ b/Server/src/main/java/core/game/content/global/EnchantedJewellery.java
@@ -23,7 +23,7 @@ public enum EnchantedJewellery {
DIGSITE_PENDANT(new String[] {}, new Location[] { Location.create(3342, 3445, 0) }, true, 11194, 11193, 11192, 11191, 11190),
COMBAT_BRACELET(new String[] { "Champions' Guild", "Monastery", "Ranging Guild", "Warriors' Guild", "Nowhere." }, new Location[] { Location.create(3191, 3365, 0), Location.create(3052, 3472, 0), Location.create(2657, 3439, 0), Location.create(2878, 3546, 0) }, 11118, 11120, 11122, 11124, 11126),
SKILLS_NECKLACE(new String[] { "Fishing Guild", "Mining Guild", "Crafting Guild", "Cooking Guild", "Nowhere." }, new Location[] { Location.create(2611, 3392, 0), Location.create(3016, 3338, 0), Location.create(2933, 3290, 0), Location.create(3143, 3442, 0) }, 11105, 11107, 11109, 11111, 11113),
- RING_OF_WEALTH(new String[] {"Grand Exchange","Nowhere."}, new Location[] {Location.create(3163, 3464, 0)},14646,14644,14642,14640,14638);
+ RING_OF_WEALTH(new String[] {"Miscellania", "Grand Exchange", "Falador Park", "Dondakan's Rock", "Nowhere."}, new Location[] {Location.create(2533, 3864, 0), Location.create(3163, 3464, 0), Location.create(2995, 3375, 0), Location.create(2829, 10166, 0)},14646,14644,14642,14640,14638);
/**
* Represents the teleport animation.
diff --git a/Server/src/main/java/core/game/content/quest/members/thetouristrap/MercenaryCaptainDialogue.java b/Server/src/main/java/core/game/content/quest/members/thetouristrap/MercenaryCaptainDialogue.java
index 43f74baf4..02b7a751f 100644
--- a/Server/src/main/java/core/game/content/quest/members/thetouristrap/MercenaryCaptainDialogue.java
+++ b/Server/src/main/java/core/game/content/quest/members/thetouristrap/MercenaryCaptainDialogue.java
@@ -194,7 +194,9 @@ public final class MercenaryCaptainDialogue extends DialoguePlugin {
player.getInventory().add(TouristTrap.METAL_KEY, player);
player.getDialogueInterpreter().sendItemMessage(TouristTrap.METAL_KEY, "The mercenary captain drops a metal key on the floor.", "You quickly grab the key and add it to your inventory.");
}
- quest.setStage(player, 20);
+ if(quest.getStage(player) < 20) {
+ quest.setStage(player, 20);
+ }
break;
}
}
diff --git a/Server/src/main/java/core/game/content/ttrail/ClueLevel.java b/Server/src/main/java/core/game/content/ttrail/ClueLevel.java
index 85a8a76b9..9ea5e4775 100644
--- a/Server/src/main/java/core/game/content/ttrail/ClueLevel.java
+++ b/Server/src/main/java/core/game/content/ttrail/ClueLevel.java
@@ -26,6 +26,31 @@ import java.util.List;
public enum ClueLevel {
EASY(new Item(2714), 1 << 16 | 5,
+ // bronze (g)
+ new ChanceItem(14664, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14658, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14660, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14662, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14666, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14668, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14670, 1, 1, DropFrequency.UNCOMMON),
+ // iron (g)
+ new ChanceItem(14678, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14672, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14674, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14676, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14680, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14682, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14684, 1, 1, DropFrequency.UNCOMMON),
+ // steel (g)
+ new ChanceItem(14692, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14686, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14688, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14690, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14694, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14696, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14698, 1, 1, DropFrequency.UNCOMMON),
+ // berets
new ChanceItem(Items.BLUE_BERET_2633, 1, 1, DropFrequency.UNCOMMON),
new ChanceItem(Items.BLACK_BERET_2635, 1, 1, DropFrequency.UNCOMMON),
new ChanceItem(Items.WHITE_BERET_2637, 1, 1, DropFrequency.UNCOMMON),
@@ -170,6 +195,14 @@ public enum ClueLevel {
new ChanceItem(Items.STUDDED_BODY_1133, 1, 1, DropFrequency.COMMON)),
MEDIUM(new Item(2717), 1 << 16 | 6,
+ // mithril (g)
+ new ChanceItem(14706, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14700, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14702, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14704, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14708, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14710, 1, 1, DropFrequency.UNCOMMON),
+ new ChanceItem(14712, 1, 1, DropFrequency.UNCOMMON),
// Trimmed
// addy
// shit
diff --git a/Server/src/main/java/core/game/content/zone/fremmenik/FremmenikPlugin.java b/Server/src/main/java/core/game/content/zone/fremmenik/FremmenikPlugin.java
deleted file mode 100644
index ff42e1fdb..000000000
--- a/Server/src/main/java/core/game/content/zone/fremmenik/FremmenikPlugin.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package core.game.content.zone.fremmenik;
-
-import core.cache.def.impl.NPCDefinition;
-import core.game.interaction.OptionHandler;
-import core.game.node.Node;
-import core.game.node.entity.player.Player;
-import core.plugin.Plugin;
-
-/**
- * Handles the fremmenik plugin.
- * @author Vexia
- */
-public class FremmenikPlugin extends OptionHandler {
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- NPCDefinition.forId(5508).getHandlers().put("option:ferry-neitiznot", this);
- return this;
- }
-
- @Override
- public boolean handle(Player player, Node node, String option) {
- switch (option) {
- case "ferry-neitiznot":
- return true;
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/content/zone/rellekka/RellekkaZone.java b/Server/src/main/java/core/game/content/zone/rellekka/RellekkaZone.java
index 9aca35a5c..370b54464 100644
--- a/Server/src/main/java/core/game/content/zone/rellekka/RellekkaZone.java
+++ b/Server/src/main/java/core/game/content/zone/rellekka/RellekkaZone.java
@@ -76,9 +76,6 @@ public final class RellekkaZone extends MapZone implements Plugin {
* (option.equals("Trade") ? "buy clothes here" :
* "change their shoes here") + "."); return true;
*/
- //case 4148:
- // player.getDialogueInterpreter().sendDialogues(1278, null, "Hey, outerlander. You can't go through there. Talent", "only, backstage.");
- // return true;
case 100:
player.getDialogueInterpreter().sendDialogue("You try to open the trapdoor but it won't budge! It looks like the", "trapdoor can only be opened from the other side.");
return true;
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/CapeDyeingPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/CapeDyeingPlugin.java
deleted file mode 100644
index 861a1e27b..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/CapeDyeingPlugin.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-package core.game.interaction.item.withitem;
-
-import org.rs09.consts.Items;
-import core.game.content.global.Dyes;
-import core.game.content.global.action.SpecialLadders;
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.diary.DiaryType;
-import core.game.node.item.Item;
-import core.game.world.map.Location;
-import core.plugin.InitializablePlugin;
-import core.plugin.Plugin;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.stream.Stream;
-
-*/
-/**
- * Handles the dyeing of a cape.
- * @author afaroutdude
- *//*
-
-@InitializablePlugin
-public final class CapeDyeingPlugin extends UseWithHandler {
-
- */
-/**
- * Constructs a new {@code CapeDyeingPlugin} {@code Object}.
- *//*
-
- public CapeDyeingPlugin() {
- super(Cape.getIds());
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- for (Cape c : Cape.values()) {
- addHandler(c.getDye().getItem().getId(), ITEM_TYPE, this);
- }
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- final boolean testCape = Cape.isCape(event.getBaseItem());
- final Item cape = Cape.isCape(event.getBaseItem()) ? event.getBaseItem() : event.getUsedItem();
- final Item dye = Cape.isCape(event.getBaseItem()) ? event.getUsedItem() : event.getBaseItem();
- final Item dyedCape = MAP_DYE_TO_CAPE.get(dye);
- if (dyedCape == null) {
- return false;
- }
- if (!cape.equals(dyedCape) && player.getInventory().containsItems(dye, cape) && player.getInventory().remove(dye, cape)) {
- player.getInventory().add(dyedCape);
- if (dye.equals(Dyes.BLACK.getItem())) {
- player.getInventory().add(new Item(Items.VIAL_229));
- }
- if (dye.equals(Dyes.PINK.getItem()) && !player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).isComplete(2,5)) {
- player.getAchievementDiaryManager().getDiary(DiaryType.FALADOR).updateTask(player,2,5,true);
- }
- }
- return true;
- }
-
- */
-/**
- * A cape to dye.
- * @author Vexia
- *//*
-
- public enum Cape {
- BLACK(Dyes.BLACK, new Item(1019)),
- RED(Dyes.RED, new Item(1007)),
- BLUE(Dyes.BLUE, new Item(1021)),
- YELLOW(Dyes.YELLOW, new Item(1023)),
- GREEN(Dyes.GREEN, new Item(1027)),
- PURPLE(Dyes.PURPLE, new Item(1029)),
- ORANGE(Dyes.ORANGE, new Item(1031)),
- PINK(Dyes.PINK, new Item(6959));
-
- */
-/**
- * The dye for the cape.
- *//*
-
- private final Dyes dye;
-
- */
-/**
- * The cape item.
- *//*
-
- private final Item cape;
-
- */
-/**
- * Constructs a new {@code Cape} {@code Object}.
- * @param dye the dye.
- * @param cape the cape.
- *//*
-
- Cape(Dyes dye, Item cape) {
- this.dye = dye;
- this.cape = cape;
- }
-
- */
-/**
- * Gets the dye.
- * @return The dye.
- *//*
-
- public Dyes getDye() {
- return dye;
- }
-
- */
-/**
- * Gets the cape.
- * @return The cape.
- *//*
-
- public Item getCape() {
- return cape;
- }
-
- */
-/**
- * @return an int array of all cape IDs
- *//*
-
- static public int[] getIds() {
- return Stream.of(Cape.values())
- .map(Cape::getCape)
- .map(Item::getId)
- .mapToInt(Integer::intValue).toArray();
- }
-
- */
-/**
- * @param potentiallyCape
- * @return true if passed item is a cape that we can handle
- *//*
-
- static public boolean isCape(Item potentiallyCape){
- for (Cape c : Cape.values()) {
- if (c.getCape().getId() == potentiallyCape.getId()) {
- return true;
- }
- }
- return false;
- }
- }
-
- public static HashMap- MAP_DYE_TO_CAPE = new HashMap<>();
- static {
- for (Cape c : Cape.values()) {
- MAP_DYE_TO_CAPE.putIfAbsent(c.getDye().getItem(), c.getCape());
- }
- }
-}
-*/
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/ChestKeyPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/ChestKeyPlugin.java
deleted file mode 100644
index c3bb454f3..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/ChestKeyPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.game.node.scenery.Scenery;
-import core.game.node.scenery.SceneryBuilder;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin used to handle the usage of a chest key on the chest.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class ChestKeyPlugin extends UseWithHandler {
-
- /**
- * Represents the chest key item.
- */
- private static final Item CHEST_KEY = new Item(432);
-
- /**
- * Represents the pirate message item.
- */
- private static final Item PIRATE_MESSAGE = new Item(433);
-
- /**
- * Constructs a new {@code ChestKeyPlugin} {@code Object}.
- */
- public ChestKeyPlugin() {
- super(432);
- }
-
- @Override
- public Plugin
newInstance(Object arg) throws Throwable {
- addHandler(2079, OBJECT_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- if (player.getInventory().remove(CHEST_KEY)) {
- SceneryBuilder.replace((Scenery) event.getUsedWith(), ((Scenery) event.getUsedWith()).transform(2080), 3);
- player.getInventory().add(PIRATE_MESSAGE);
- player.getPacketDispatch().sendMessage("You unlock the chest.");
- player.getPacketDispatch().sendMessage("All that's in the chest is a message...");
- player.getPacketDispatch().sendMessage("You take the message from the chest.");
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/CrystalKeyCreatePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/CrystalKeyCreatePlugin.java
deleted file mode 100644
index 63e8275c0..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/CrystalKeyCreatePlugin.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin used to handle the creation of a crystal key.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class CrystalKeyCreatePlugin extends UseWithHandler {
-
- /**
- * Represents the crystal key item.
- */
- private static final Item KEY = new Item(989, 1);
-
- /**
- * Constructs a new {@code CrystalKeyCreatePlugin} {@code Object}.
- */
- public CrystalKeyCreatePlugin() {
- super(985);
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- if (player.getInventory().remove(event.getBaseItem(), event.getUsedItem())) {
- player.getInventory().add(KEY);
- player.getPacketDispatch().sendMessage("You join the loop half of a key and the tooth half of a key to make a crystal key.");
- }
- return true;
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(987, ITEM_TYPE, this);
- return this;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/DarkBowDyePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/DarkBowDyePlugin.java
deleted file mode 100644
index 881f75e7c..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/DarkBowDyePlugin.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package core.game.interaction.item.withitem;
-import core.game.content.dialogue.DialogueAction;
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Plugin;
-import core.plugin.Initializable;
-import rs09.plugin.PluginManager;
-
-/**
- * The plugin used to dye a dark bow into a more one.
- * @author Splinter
- * @version 1.0
- */
-@Initializable
-public final class DarkBowDyePlugin extends UseWithHandler {
-
-
- /**
- * Constructs a new {@code DarkBowDyePlugin} {@code Object}.
- */
- public DarkBowDyePlugin() {
- super(11235);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(14795, ITEM_TYPE, this);
- addHandler(14797, ITEM_TYPE, this);
- addHandler(14799, ITEM_TYPE, this);
- addHandler(14801, ITEM_TYPE, this);
- PluginManager.definePlugin(new DarkBowCleanPlugin());
- return this;
- }
-
- @Override
- public boolean handle(final NodeUsageEvent event) {
- final Player player = event.getPlayer();
- player.getDialogueInterpreter().sendOptions("Apply "+event.getUsedItem().getName().replace("dark bow paint", "paint?").toLowerCase(), "Yes", "No");
- player.getDialogueInterpreter().addAction(new DialogueAction() {
-
- @Override
- public void handle(Player player, int buttonId) {
- switch (buttonId) {
- case 2:
- if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
- player.getInventory().add(getResult(event.getUsedItem().getId()));
- player.sendMessage("You dye the bow into a more fashionable version.");
- }
- break;
- }
- }
-
- });
- return true;
- }
-
- /**
- * Gets the resulting colored dark bow.
- * @return the item
- */
- private Item getResult(int dyeId){
- switch(dyeId){
- case 14797:
- return new Item(14803, 1);
- case 14795:
- return new Item(14804, 1);
- case 14799:
- return new Item(14805, 1);
- case 14801:
- return new Item(14806, 1);
- }
- return null;
- }
-
- /**
- * Cleans the dark bow and removes the paint.
- * @author Andrew
- */
- public final class DarkBowCleanPlugin extends UseWithHandler {
-
- /**
- * Constructs a new {@code DarkBowCleanPlugin} {@code Object}.
- */
- public DarkBowCleanPlugin() {
- super(3188);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(14803, ITEM_TYPE, this);
- addHandler(14804, ITEM_TYPE, this);
- addHandler(14805, ITEM_TYPE, this);
- addHandler(14806, ITEM_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(final NodeUsageEvent event) {
- final Player player = event.getPlayer();
- player.getDialogueInterpreter().sendOptions("Wipe the paint off?", "Yes", "No");
- player.getDialogueInterpreter().addAction(new DialogueAction() {
-
- @Override
- public void handle(Player player, int buttonId) {
- switch (buttonId) {
- case 2:
- if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
- player.getInventory().add(new Item(11235, 1));
- player.sendMessage("You wipe the paint off with the cleaning cloth, then toss it away.");
- }
- break;
- }
- }
-
- });
- return true;
- }
- }
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingDialogue.java b/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingDialogue.java
new file mode 100644
index 000000000..9ca809b57
--- /dev/null
+++ b/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingDialogue.java
@@ -0,0 +1,150 @@
+package core.game.interaction.item.withitem;
+
+import static api.ContentAPIKt.*;
+import core.game.component.Component;
+import core.plugin.Initializable;
+import kotlin.Unit;
+import org.rs09.consts.Items;
+import core.game.content.dialogue.DialoguePlugin;
+import core.game.interaction.NodeUsageEvent;
+import core.game.interaction.UseWithHandler;
+import core.game.node.entity.player.Player;
+import core.game.node.entity.player.link.RunScript;
+import core.game.node.item.Item;
+import core.game.world.update.flag.context.Animation;
+import core.plugin.Plugin;
+import rs09.game.interaction.item.withitem.FruitSlicing;
+
+/**
+ * Represents the fruit cutting plugin.
+ * @author 'Vexia
+ * @version 1.0
+ */
+@Initializable
+public final class FruitCuttingDialogue extends DialoguePlugin {
+
+ /**
+ * Represents the component interface.
+ */
+ private static final Component COMPONENT = new Component(140);
+
+ /**
+ * Represents the fruit.
+ */
+ private FruitSlicing.Fruit fruit;
+
+ /**
+ * Represents the fruit to cut.
+ */
+ private Item item;
+
+ /**
+ * Represents if its a sliced cut.
+ */
+ private boolean slice;
+
+ /**
+ * Constructs a new {@code FruitCuttingDialogue} {@code Object}.
+ */
+ public FruitCuttingDialogue() {
+ /**
+ * empty.
+ */
+ }
+
+ /**
+ * Constructs a new {@code FruitCuttingDialogue} {@code Object}.
+ * @param player the player.
+ */
+ public FruitCuttingDialogue(Player player) {
+ super(player);
+ }
+
+ @Override
+ public DialoguePlugin newInstance(Player player) {
+ return new FruitCuttingDialogue(player);
+ }
+
+ @Override
+ public boolean open(Object... args) {
+ fruit = ((FruitSlicing.Fruit) args[0]);
+ player.getPacketDispatch().sendString("Would you like to...", 140, 4);
+ player.getPacketDispatch().sendItemOnInterface(fruit.getSliced().getId(), 1, 140, 5);
+ player.getPacketDispatch().sendItemOnInterface(fruit.getDiced().getId(), 1, 140, 6);
+ player.getPacketDispatch().sendString("Slice the " + fruit.getBase().getName().toLowerCase() + ".", 140, 2);
+ player.getPacketDispatch().sendString("Dice the " + fruit.getBase().getName().toLowerCase() + ".", 140, 3);
+ player.getInterfaceManager().openChatbox(COMPONENT);
+ stage = 0;
+ return true;
+ }
+
+ @Override
+ public boolean handle(int interfaceId, int buttonId) {
+ switch (stage) {
+ case 0:
+ player.getInterfaceManager().openChatbox(309);
+ player.getPacketDispatch().sendItemZoomOnInterface(1, 160, 309, 2);
+ slice = buttonId == 2 ? false : true;
+ item = buttonId == 2 ? fruit.getDiced() : fruit.getSliced();
+ player.getPacketDispatch().sendString(" " + item.getName(), 309, 6);
+ player.getPacketDispatch().sendItemZoomOnInterface(item.getId(), 175, 309, 2);
+ stage = 1;
+ break;
+ case 1:
+ int amount = 0;
+ switch (buttonId) {
+ case 6:
+ amount = 1;
+ break;
+ case 5:
+ amount = 5;
+ break;
+ case 4:
+ sendInputDialogue(player, false, "Enter the amount:", (value) -> {
+ String s = value.toString();
+ s = s.replace("k","000");
+ s = s.replace("K","000");
+ int val = Integer.parseInt(s);
+ cut(player, val, slice);
+ return Unit.INSTANCE;
+ });
+ return true;
+ case 3:
+ amount = player.getInventory().getAmount(fruit.getBase());
+ break;
+ }
+ cut(player, amount, slice);
+ break;
+ }
+ return true;
+ }
+
+ @Override
+ public int[] getIds() {
+ return new int[] { 31237434 };
+ }
+
+ /**
+ * Method used to cut a fruit.
+ * @param player the player.
+ * @param amount the amount.
+ * @param slice if its sliced.
+ */
+ private final void cut(final Player player, int amount, boolean slice) {
+ if (amount > player.getInventory().getAmount(fruit.getBase())) {
+ amount = player.getInventory().getAmount(fruit.getBase());
+ }
+ end();
+ final Item remove = new Item(fruit.getBase().getId(), amount);
+ if (!player.getInventory().containsItem(remove)) {
+ return;
+ }
+ if (player.getInventory().remove(remove)) {
+ player.getPacketDispatch().sendMessage("You cut the " + fruit.name().toLowerCase() + " into " + (slice ? fruit == FruitSlicing.Fruit.PINEAPPLE ? "rings" : "slices" : "chunks") + ".");
+ for (int i = 0; i < amount; i++) {
+ player.getInventory().add(slice ? fruit.getSliced() : fruit.getDiced());
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingPlugin.java
deleted file mode 100644
index 6b0fc2829..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/FruitCuttingPlugin.java
+++ /dev/null
@@ -1,273 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import static api.ContentAPIKt.*;
-import core.game.component.Component;
-import core.plugin.Initializable;
-import kotlin.Unit;
-import org.rs09.consts.Items;
-import core.game.content.dialogue.DialoguePlugin;
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.RunScript;
-import core.game.node.item.Item;
-import core.game.world.update.flag.context.Animation;
-import core.plugin.Plugin;
-
-/**
- * Represents the fruit cutting plugin.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class FruitCuttingPlugin extends UseWithHandler {
-
- /**
- * Represents the cutting banana animation.
- */
- private static final Animation ANIMATION = new Animation(1192);
-
- /**
- * Constructs a new {@code FruitCuttingPlugin} {@code Object}.
- */
- public FruitCuttingPlugin() {
- super(946);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- for (Fruit fruit : Fruit.values()) {
- addHandler(fruit.getBase().getId(), ITEM_TYPE, this);
- }
- new FruitCuttingDialogue().init();
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- final Fruit fruit = Fruit.forBase(event.getUsedItem());
- if (fruit == Fruit.BANANA || fruit == Fruit.LEMON) {
- if (player.getInventory().remove(fruit.getBase())) {
- player.lock(2);
- player.animate(ANIMATION);
- player.getInventory().add(fruit.getSliced());
- player.getPacketDispatch().sendMessage("You deftly chop the "+ fruit.name().toLowerCase() + " into slices.");
- }
- return true;
- }
- player.getDialogueInterpreter().open(31237434, fruit);
- return true;
- }
-
- /**
- * Represents the a fruit to cut.
- * @author 'Vexia
- * @date 30/11/2013
- */
- public enum Fruit {
- PINEAPPLE(new Item(2114), new Item(2116), new Item(2118, 4)),
- BANANA(new Item(1963), null, new Item(3162)),
- LEMON(new Item(2102), new Item(Items.LEMON_CHUNKS_2104), new Item(2106)),
- LIME(new Item(Items.LIME_2120),new Item(Items.LIME_CHUNKS_2122), new Item(Items.LIME_SLICES_2124)),
- ORANGE(new Item(2108), new Item(2110), new Item(2112));
-
- /**
- * Constructs a new {@code FruitCuttingPlugin.java} {@code Object}.
- * @param base the base item.
- * @param diced the diced item.
- * @param sliced the sliced item.
- */
- Fruit(Item base, Item diced, Item sliced) {
- this.base = base;
- this.diced = diced;
- this.sliced = sliced;
- }
-
- /**
- * Represents the base item.
- */
- private final Item base;
-
- /**
- * Represents the diced item.
- */
- private final Item diced;
-
- /**
- * Represents the sliced item.
- */
- private final Item sliced;
-
- /**
- * Gets the base.
- * @return The base.
- */
- public Item getBase() {
- return base;
- }
-
- /**
- * Gets the diced.
- * @return The diced.
- */
- public Item getDiced() {
- return diced;
- }
-
- /**
- * Gets the sliced.
- * @return The sliced.
- */
- public Item getSliced() {
- return sliced;
- }
-
- /**
- * Method used to get the fruit for the base item.
- * @param item the item.
- * @return the fruit.
- */
- public static Fruit forBase(final Item item) {
- for (Fruit fruit : values()) {
- if (fruit.getBase().getId() == item.getId()) {
- return fruit;
- }
- }
- return null;
- }
- }
-
- /**
- * Represents the dialogue plugin used to cut fruit.
- * @author 'Vexia
- * @version 1.0
- */
- public static final class FruitCuttingDialogue extends DialoguePlugin {
-
- /**
- * Represents the component interface.
- */
- private static final Component COMPONENT = new Component(140);
-
- /**
- * Represents the fruit.
- */
- private Fruit fruit;
-
- /**
- * Represents the fruit to cut.
- */
- private Item item;
-
- /**
- * Represents if its a sliced cut.
- */
- private boolean slice;
-
- /**
- * Constructs a new {@code FruitCuttingDialogue} {@code Object}.
- */
- public FruitCuttingDialogue() {
- /**
- * empty.
- */
- }
-
- /**
- * Constructs a new {@code FruitCuttingDialogue} {@code Object}.
- * @param player the player.
- */
- public FruitCuttingDialogue(Player player) {
- super(player);
- }
-
- @Override
- public DialoguePlugin newInstance(Player player) {
- return new FruitCuttingDialogue(player);
- }
-
- @Override
- public boolean open(Object... args) {
- fruit = ((Fruit) args[0]);
- player.getPacketDispatch().sendString("Would you like to...", 140, 4);
- player.getPacketDispatch().sendItemOnInterface(fruit.getSliced().getId(), 1, 140, 5);
- player.getPacketDispatch().sendItemOnInterface(fruit.getDiced().getId(), 1, 140, 6);
- player.getPacketDispatch().sendString("Slice the " + fruit.getBase().getName().toLowerCase() + ".", 140, 2);
- player.getPacketDispatch().sendString("Dice the " + fruit.getBase().getName().toLowerCase() + ".", 140, 3);
- player.getInterfaceManager().openChatbox(COMPONENT);
- stage = 0;
- return true;
- }
-
- @Override
- public boolean handle(int interfaceId, int buttonId) {
- switch (stage) {
- case 0:
- player.getInterfaceManager().openChatbox(309);
- player.getPacketDispatch().sendItemZoomOnInterface(1, 160, 309, 2);
- slice = buttonId == 2 ? false : true;
- item = buttonId == 2 ? fruit.getDiced() : fruit.getSliced();
- player.getPacketDispatch().sendString(" " + item.getName(), 309, 6);
- player.getPacketDispatch().sendItemZoomOnInterface(item.getId(), 175, 309, 2);
- stage = 1;
- break;
- case 1:
- int amount = 0;
- switch (buttonId) {
- case 6:
- amount = 1;
- break;
- case 5:
- amount = 5;
- break;
- case 4:
- sendInputDialogue(player, false, "Enter the amount:", (value) -> {
- String s = value.toString();
- s = s.replace("k","000");
- s = s.replace("K","000");
- int val = Integer.parseInt(s);
- cut(player, val, slice);
- return Unit.INSTANCE;
- });
- return true;
- case 3:
- amount = player.getInventory().getAmount(fruit.getBase());
- break;
- }
- cut(player, amount, slice);
- break;
- }
- return true;
- }
-
- @Override
- public int[] getIds() {
- return new int[] { 31237434 };
- }
-
- /**
- * Method used to cut a fruit.
- * @param player the player.
- * @param amount the amount.
- * @param slice if its sliced.
- */
- private final void cut(final Player player, int amount, boolean slice) {
- if (amount > player.getInventory().getAmount(fruit.getBase())) {
- amount = player.getInventory().getAmount(fruit.getBase());
- }
- end();
- final Item remove = new Item(fruit.getBase().getId(), amount);
- if (!player.getInventory().containsItem(remove)) {
- return;
- }
- if (player.getInventory().remove(remove)) {
- player.getPacketDispatch().sendMessage("You cut the " + fruit.name().toLowerCase() + " into " + (slice ? fruit == Fruit.PINEAPPLE ? "rings" : "slices" : "chunks") + ".");
- for (int i = 0; i < amount; i++) {
- player.getInventory().add(slice ? fruit.getSliced() : fruit.getDiced());
- }
- }
- }
-
- }
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/GodswordHiltAttachPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/GodswordHiltAttachPlugin.java
deleted file mode 100644
index 67804f9a1..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/GodswordHiltAttachPlugin.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Plugin;
-import core.plugin.Initializable;
-import core.tools.StringUtils;
-
-/**
- * Handles the attaching of a hilt on the godsword blade.
- * @author Emperor
- * @version 1.0
- */
-@Initializable
-public final class GodswordHiltAttachPlugin extends UseWithHandler {
-
- /**
- * Constructs a new {@code GodswordHiltAttachPlugin} {@code Object}.
- */
- public GodswordHiltAttachPlugin() {
- super(11702, 11704, 11706, 11708);
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- Item item = event.getUsedItem();
- if (item == null)
- return false;
- Item baseItem = event.getBaseItem();
- Player player = event.getPlayer();
- if (!player.getInventory().containsItem(item) || !player.getInventory().containsItem(baseItem)) {
- return false;
- }
- if (player.getInventory().replace(null, item.getSlot(), false) != item || player.getInventory().replace(null, baseItem.getSlot(), false) != baseItem) {
- player.getInventory().update();
- return false;
- }
- item = new Item(item.getId() - 8);
- player.getInventory().add(item);
- String name = item.getDefinition().getName();
- player.getPacketDispatch().sendMessage("You attach the hilt to the blade and make a" + (StringUtils.isPlusN(name) ? "n " : " ") + name + ".");
- return true;
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- // In case of item-on-item: register the lowest item id - in this case
- // godsword blade)
- // (eg. if one item is 1521 and the other is 842 -> 842 should be
- // registered)
- addHandler(11690, ITEM_TYPE, this);
- return this;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/GraniteMaulPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/GraniteMaulPlugin.java
deleted file mode 100644
index b2cddcb7a..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/GraniteMaulPlugin.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.cache.def.impl.ItemDefinition;
-import core.plugin.Initializable;
-import core.game.content.dialogue.DialogueAction;
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.OptionHandler;
-import core.game.interaction.UseWithHandler;
-import core.game.node.Node;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Plugin;
-import rs09.plugin.PluginManager;
-
-/**
- * The plugin used to make the granite maul into the ornamental version.
- * @author Splinter
- * @version 1.0
- */
-@Initializable
-public final class GraniteMaulPlugin extends UseWithHandler {
-
-
- /**
- * Constructs a new {@code GraniteMaulPlugin} {@code Object}.
- */
- public GraniteMaulPlugin() {
- super(4153);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- PluginManager.definePlugin(new GraniteMaulRevertHandler());
- addHandler(14793, ITEM_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(final NodeUsageEvent event) {
- final Player player = event.getPlayer();
- player.getDialogueInterpreter().sendOptions("Attach the clamp?", "Yes", "No");
- player.getDialogueInterpreter().addAction(new DialogueAction() {
-
- @Override
- public void handle(Player player, int buttonId) {
- switch (buttonId) {
- case 2:
- if (player.getInventory().remove(event.getBaseItem()) && player.getInventory().remove(event.getUsedItem())) {
- player.getInventory().add(new Item(14792, 1));
- player.sendMessage("You attach the clamp to the granite maul, making it slightly more fashionable.");
- }
- break;
- }
- }
-
- });
- return true;
- }
-
- /**
- * Handles the removal of the ornamental kit.
- * @author Splinter
- */
- public final class GraniteMaulRevertHandler extends OptionHandler {
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- ItemDefinition.forId(14792).getHandlers().put("option:revert", this);
- return null;
- }
-
- @Override
- public boolean handle(Player player, Node node, String option) {
- final Item item = (Item) node;
- player.getDialogueInterpreter().sendOptions("Remove the clamp?", "Yes", "No");
- player.getDialogueInterpreter().addAction(new DialogueAction() {
-
- @Override
- public void handle(Player player, int buttonId) {
- switch (buttonId) {
- case 2:
- if(player.getInventory().remove(item)){
- player.getInventory().add(new Item(4153, 1));
- player.sendMessage("You remove the clamp from your maul, and in the process, it is destroyed.");
- }
- break;
- }
- }
-
- });
- return true;
- }
-
- @Override
- public boolean isWalk() {
- return false;
- }
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/GraniteSplittingPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/GraniteSplittingPlugin.java
deleted file mode 100644
index 46bccd928..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/GraniteSplittingPlugin.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Used to handle the reward of splitting granite with a chisel in to smaller
- * pieces.
- * @author Splinter
- */
-@Initializable
-public class GraniteSplittingPlugin extends UseWithHandler {
-
- public GraniteSplittingPlugin() {
- super(1755);
- }
-
- /**
- * Represents the 5kg granite
- */
- private static final Item FIVE_KG = new Item(6983, 1);
-
- /**
- * Represents the 2kg granite
- */
- private static final Item TWO_KG = new Item(6981, 1);
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- if (event.getUsedItem().getId() == 6981) {
- if (event.getPlayer().getInventory().freeSlots() < 4) {
- event.getPlayer().getPacketDispatch().sendMessage("You need four inventory slots to split this.");
- } else {
- if (event.getPlayer().getInventory().remove(TWO_KG)) {
- event.getPlayer().getInventory().add(new Item(6979, 4));
- event.getPlayer().getPacketDispatch().sendMessage("You chisel the 2kg granite into four smaller pieces.");
- }
- }
- }
- if (event.getUsedItem().getId() == 6983) {
- if (event.getPlayer().getInventory().freeSlots() < 4) {
- event.getPlayer().getPacketDispatch().sendMessage("You need four inventory slots to split this.");
- } else {
- if (event.getPlayer().getInventory().remove(FIVE_KG)) {
- event.getPlayer().getInventory().add(new Item(6981, 2));
- event.getPlayer().getInventory().add(new Item(6979, 2));
- event.getPlayer().getPacketDispatch().sendMessage("You chisel the 5kg granite into four smaller pieces.");
- }
- }
- }
- return true;
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(6981, ITEM_TYPE, this);
- addHandler(6983, ITEM_TYPE, this);
- return this;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/ImpJarCreatePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/ImpJarCreatePlugin.java
deleted file mode 100644
index 30b90a001..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/ImpJarCreatePlugin.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.game.node.scenery.Scenery;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Handles the creating of an imp jar.
- * @author Vexia
- */
-@Initializable
-public final class ImpJarCreatePlugin extends UseWithHandler {
-
- /**
- * The flower ids.
- */
- private static final int[] FLOWERS = new int[] { 2460, 2461, 2462, 2463, 2464, 2465, 2466, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477 };
-
- /**
- * Constructs a new {@code ImpJarCreatePlugin} {@code Object}.
- */
- public ImpJarCreatePlugin() {
- super(6097, 11264, 1939, 4525, 4535, 4546, 4700, 11262, 10012);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(11266, ITEM_TYPE, this);
- for (int i : FLOWERS) {
- addHandler(i, ITEM_TYPE, this);
- }
- for (int i : getValidChildren(5908)) {
- addHandler(i, OBJECT_TYPE, this);
- }
- addHandler(5909, OBJECT_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- Player player = event.getPlayer();
- if (event.getUsedWith() instanceof Scenery) {
- if ((event.getUsedItem().getId() >= 4525 && event.getUsedItem().getId() <= 4700) || event.getUsedItem().getId() == 1939 || event.getUsedItem().getId() == 11262 || event.getUsedItem().getId() == 10012) {
- fillOilStill(player, event.getUsedItem());
- }
- return true;
- }
- if (((Item) event.getUsedWith()).getId() == 6097) {
- makeOil(player);
- } else if (event.getUsedItem().getId() == 11264) {
- makeRepellent(player, event.getUsedItem(), (Item) event.getUsedWith());
- }
- return true;
- }
-
- /**
- * Fills the oil still.
- * @param player the player.
- */
- private void fillOilStill(Player player, Item used) {
- int configValue = player.getConfigManager().get(425);
- if (used.getId() == 11262 || used.getId() == 10012) {
- if (configValue == 0 && used.getId() == 11262) {
- player.getInventory().replace(new Item(229), used.getSlot());
- player.sendMessage("You refine some imp repellent.");
- player.getConfigManager().set(425, 64, true);
- return;
- } else if (configValue == 32) {
- player.sendMessage("There is already lamp oil in the still.");
- return;
- } else if (configValue == 64) {
- if (used.getId() == 11262) {
- player.sendMessage("There is already imp repellent in the still.");
- } else {
- player.getInventory().replace(new Item(11260), used.getSlot());
- player.getConfigManager().set(425, 0, true);
- player.sendMessage("You turn the butterfly jar into an impling jar.");
- }
- return;
- }
- player.sendMessage("There is no refined imp repellent in the still.");
- return;
- }
- if (configValue == 64) {
- player.sendMessage("There is already imp repellent in the still.");
- return;
- }
- if (configValue == 32 && used.getId() == 1939) {
- player.sendMessage("There is already lamp oil in the still.");
- return;
- }
- if (used.getId() == 1939) {
- if (player.getInventory().remove(new Item(1939))) {
- player.getConfigManager().set(425, 32, true);
- player.sendMessage("You refine some swamp tar into lamp oil.");
- }
- } else {
- if (configValue == 0) {
- player.sendMessage("There is no oil in the still.");
- } else {
- if (player.getInventory().contains(4525, 1) || player.getInventory().contains(4535, 1) || player.getInventory().contains(4546, 1) || player.getInventory().contains(4700, 1)) {
- Item replace = new Item(used.getId() == 4525 ? 4522 : used.getId() == 4535 ? 4537 : used.getId() == 4546 ? 4548 : 4701);
- player.getInventory().replace(replace, used.getSlot());
- player.getConfigManager().set(425, 0, true);
- player.sendMessage("You fill the item with oil.");
- }
- }
- }
- }
-
- /**
- * Makes imp repellent.
- * @param player the player.
- * @param usedWith the used item.
- */
- private void makeRepellent(Player player, Item oil, Item usedWith) {
- if (isFlower(usedWith.getId())) {
- if (player.getInventory().remove(usedWith)) {
- player.getInventory().replace(new Item(11262), oil.getSlot());
- player.sendMessage("You mix the flower petals with the anchovy oil to make a very strange-smelling concoction.");
- ;
- }
- }
- }
-
- /**
- * Makes anchovy oil.
- * @param player the player.
- */
- private void makeOil(Player player) {
- if (!player.getInventory().contains(229, 1)) {
- player.sendMessage("You need an empty vial to put your anchovy oil into.");
- return;
- }
- if (!player.getInventory().contains(11266, 8)) {
- player.sendMessage("You need 8 anchovy paste's in order to make anchovy oil.");
- return;
- }
- if (player.getInventory().remove(new Item(11266, 8), new Item(229))) {
- player.getInventory().add(new Item(11264));
- }
- }
-
- /**
- * Checks if the id is a flower.
- * @param id the id.
- * @return {@code True} if so.
- */
- private boolean isFlower(int id) {
- for (int i : FLOWERS) {
- if (i == id) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/KaramjanSilkPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/KaramjanSilkPlugin.java
deleted file mode 100644
index f0441e4c3..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/KaramjanSilkPlugin.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the karamjan silk plugin.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class KaramjanSilkPlugin extends UseWithHandler {
-
- /**
- * Represents the cloth item.
- */
- private static final Item CLOTH = new Item(3188);
-
- /**
- * Represents the silk item.
- */
- private static final Item SILK = new Item(950);
-
- /**
- * Constructs a new {@code KaramjanSilkPlugin} {@code Object}.
- */
- public KaramjanSilkPlugin() {
- super(950);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(431, ITEM_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- if (player.getInventory().remove(SILK)) {
- player.getInventory().add(CLOTH);
- player.getPacketDispatch().sendMessage("You pour some of the Karamjan rum over the silk.");
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/LavaScalePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/LavaScalePlugin.java
deleted file mode 100644
index e445ef51c..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/LavaScalePlugin.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.node.entity.skill.Skills;
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.game.world.update.flag.context.Animation;
-import core.plugin.Plugin;
-import rs09.plugin.PluginManager;
-import core.plugin.Initializable;
-import core.tools.RandomFunction;
-
-/**
- * Handles the grinding of Lava Scales.
- * @author Splinter
- * @version 1.0
- */
-@Initializable
-public final class LavaScalePlugin extends UseWithHandler {
-
- /**
- * Constructs a new {@code LavaScalePlugin} {@code Object}.
- */
- public LavaScalePlugin() {
- super(14695);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(233, ITEM_TYPE, this);
- PluginManager.definePlugin(new AntifireMakePlugin());
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- Player player = event.getPlayer();
- if(player.getInventory().remove(new Item(14695))){
- player.getInventory().add(new Item(14768, RandomFunction.random(3, 6)));
- player.animate(new Animation(364));
- player.sendMessage("You grind the scales into fine shards.");
- }
- return true;
- }
-
- /**
- * Handles the making of the Extended antifire potion.
- * It's apparently not made like regular potions.
- * @author Splinter
- * @version 1.0
- */
- public final class AntifireMakePlugin extends UseWithHandler {
-
- /**
- * Constructs a new {@code LavaScalePlugin} {@code Object}.
- */
- public AntifireMakePlugin() {
- super(2454, 2456, 2458, 2452);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(14768, ITEM_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- Player player = event.getPlayer();
- int count = player.getInventory().getAmount(event.getUsedWith().asItem());
- int total = count * getReq(event.getUsedWith().asItem().getId());
- if(player.getInventory().contains(14768, total)){
- player.getInventory().remove(new Item(14768, total), new Item(event.getUsedWith().getId(), count));
- player.getInventory().add(new Item(event.getUsedWith().getId() + 12301, count));
- player.animate(new Animation(363));
- player.getSkills().addExperience(Skills.HERBLORE, 27.5 * total);
- player.sendMessages("You drop a total of "+(total)+" lava scales in the potions and upgrade all of the", "potions of the same dose into extended antifire potions.");
- } else {
- player.sendMessage("You don't have enough shards to upgrade all your potions of that dose.");
- }
- return true;
- }
-
- }
-
- /**
- * Get the required amount of shards.
- * @return
- */
- public int getReq(int id){
- switch(id){
- case 2452:
- return 4;
- case 2454:
- return 3;
- case 2456:
- return 2;
- case 2458:
- return 1;
- }
- return 4;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/SeasonedSardinePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/SeasonedSardinePlugin.java
deleted file mode 100644
index d27da8c40..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/SeasonedSardinePlugin.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin to make seasoned sardines.
- * @author 'Vexia
- * @date Oct 6, 2013
- */
-@Initializable
-public class SeasonedSardinePlugin extends UseWithHandler {
-
- /**
- * Represents the seasoned sardine.
- */
- private final Item SEASONED_SARDINE = new Item(1552);
-
- /**
- * Constructs a new {@code SeasonedSardinePlugina} {@code Object}.
- */
- public SeasonedSardinePlugin() {
- super(327);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(1573, ITEM_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- if (player.getInventory().remove(event.getUsedItem()) && player.getInventory().remove(event.getBaseItem())) {
- player.getDialogueInterpreter().sendDialogue("You rub the doogle leaves over the sardine.");
- player.getInventory().add(SEASONED_SARDINE);
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/SkullSceptrePlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/SkullSceptrePlugin.java
deleted file mode 100644
index 450933140..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/SkullSceptrePlugin.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * @author 'Vexia
- */
-@Initializable
-public class SkullSceptrePlugin extends UseWithHandler {
-
- public SkullSceptrePlugin() {
- super(9008, 9009, 9011);
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- if (event.getUsedItem().getId() == 9008 && ((Item) event.getUsedWith()).getId() == 9007) {
- event.getPlayer().getInventory().remove(new Item(9008, 1));
- event.getPlayer().getInventory().remove(new Item(9007, 1));
- event.getPlayer().getInventory().add(new Item(9009, 1));
- event.getPlayer().getDialogueInterpreter().open(78489);
- return true;
- }
- if (event.getUsedItem().getId() == 9011 && ((Item) event.getUsedWith()).getId() == 9010) {
- event.getPlayer().getInventory().remove(new Item(9010, 1));
- event.getPlayer().getInventory().remove(new Item(9011, 1));
- event.getPlayer().getInventory().add(new Item(9012, 1));
- event.getPlayer().getDialogueInterpreter().open(78489, true);
- return true;
- }
- if (event.getUsedItem().getId() == 9012 && ((Item) event.getUsedWith()).getId() == 9009) {
- event.getPlayer().getInventory().remove(new Item(9009, 1));
- event.getPlayer().getInventory().remove(new Item(9012, 1));
- event.getPlayer().getInventory().add(new Item(9013, 1));
- event.getPlayer().getDialogueInterpreter().open(78489, true, true);
- return true;
- }
- return true;
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(9007, ITEM_TYPE, this);
- addHandler(9010, ITEM_TYPE, this);
- addHandler(9012, ITEM_TYPE, this);
- return this;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withitem/WaterSkinPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/WaterSkinPlugin.java
deleted file mode 100644
index eabcda331..000000000
--- a/Server/src/main/java/core/game/interaction/item/withitem/WaterSkinPlugin.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package core.game.interaction.item.withitem;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.item.Item;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the water skin refilling plugin.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class WaterSkinPlugin extends UseWithHandler {
-
- /**
- * Represents the full skill item.
- */
- private final Item FULL_SKIN = new Item(1823);
-
- /**
- * Represents data of water skin filling vessils.
- */
- private final int[][] data = new int[][] { { 1937, 1935 }, { 1929, 1925 }, { 1921, 1923 }, { 227, 229 } };
-
- /**
- * Constructs a new {@code WaterSkinPlugin} {@code Object}.
- */
- public WaterSkinPlugin() {
- super(1825, 1827, 1829, 1831);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- for (int i = 0; i < data.length; i++) {
- addHandler(data[i][0], ITEM_TYPE, this);
- }
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Item waterSkin = event.getUsedItem().getName().contains("skin") ? event.getUsedItem() : event.getBaseItem();
- final Item vessil = !event.getUsedItem().getName().contains("skin") ? event.getUsedItem() : event.getBaseItem();
- if (event.getPlayer().getInventory().remove(waterSkin)) {
- event.getPlayer().getInventory().add(vessil.getId() == 227 ? new Item(waterSkin.getId() - 2) : FULL_SKIN);
- for (int i = 0; i < data.length; i++) {
- if (data[i][0] == vessil.getId() && event.getPlayer().getInventory().remove(vessil)) {
- event.getPlayer().getInventory().add(new Item(data[i][1]));
- }
- }
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withnpc/GertrudeCatUsePlugin.java b/Server/src/main/java/core/game/interaction/item/withnpc/GertrudeCatUsePlugin.java
deleted file mode 100644
index 1275872c5..000000000
--- a/Server/src/main/java/core/game/interaction/item/withnpc/GertrudeCatUsePlugin.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package core.game.interaction.item.withnpc;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.npc.NPC;
-import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.quest.Quest;
-import core.game.node.item.Item;
-import core.game.system.task.Pulse;
-import rs09.game.world.GameWorld;
-import core.game.world.map.Location;
-import core.game.world.map.path.Path;
-import core.game.world.map.path.Pathfinder;
-import core.game.world.update.flag.context.Animation;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin used to handle the use with interactions.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class GertrudeCatUsePlugin extends UseWithHandler {
-
- /**
- * Represents the animation of bending down.
- */
- private static final Animation BEND_DOWN = Animation.create(827);
-
- /**
- * Represents the empty bucket.
- */
- private static final Item EMPTY_BUCKET = new Item(1925);
-
- /**
- * Constructs a new {@code GertrudeCatUsePlugin} {@code Object}.
- */
- public GertrudeCatUsePlugin() {
- super(1927, 1552, 327, 13236);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(2997, NPC_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- final NPC npc = ((NPC) event.getUsedWith());
- final Quest quest = player.getQuestRepository().getQuest("Gertrude's Cat");
- if (event.getUsedItem().getId() == 1927 && quest.getStage(player) == 20) {
- if (player.getInventory().remove(event.getUsedItem())) {
- player.getInventory().add(EMPTY_BUCKET);
- player.animate(BEND_DOWN);
- npc.sendChat("Mew!");
- quest.setStage(player, 30);
- }
- } else if (event.getUsedItem().getId() == 1552 && quest.getStage(player) == 30) {
- if (player.getInventory().remove(event.getUsedItem())) {
- player.animate(BEND_DOWN);
- npc.sendChat("Mew!");
- quest.setStage(player, 40);
- }
- } else if (event.getUsedItem().getId() == 327 && quest.getStage(player) == 50) {
- player.getDialogueInterpreter().sendDialogue("The cat doesn't seem interested in that.");
- } else if (event.getUsedItem().getId() == 13236) {
- if (player.getInventory().remove(event.getUsedItem())) {
- quest.setStage(player, 60);
- player.lock(5);
- GameWorld.getPulser().submit(new Pulse(1) {
- int count = 0;
- final NPC kitten = NPC.create(761, player.getLocation());
-
- @Override
- public boolean pulse() {
- switch (count) {
- case 0:
- kitten.init();
- kitten.face(npc);
- npc.face(kitten);
- npc.sendChat("Pur...");
- kitten.sendChat("Pur...");
- final Path path = Pathfinder.find(npc, new Location(3310, 3510, 1));
- path.walk(npc);
- final Path pathh = Pathfinder.find(kitten, new Location(3310, 3510, 1));
- pathh.walk(kitten);
- break;
- case 5:
- kitten.clear();
- player.setAttribute("hidefluff", System.currentTimeMillis() + 60000);
- break;
- }
- count++;
- return count == 6;
- }
-
- });
- }
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/item/withnpc/LadyKeliRopePlugin.java b/Server/src/main/java/core/game/interaction/item/withnpc/LadyKeliRopePlugin.java
deleted file mode 100644
index ec0b56dec..000000000
--- a/Server/src/main/java/core/game/interaction/item/withnpc/LadyKeliRopePlugin.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package core.game.interaction.item.withnpc;
-
-import core.game.interaction.NodeUsageEvent;
-import core.game.interaction.UseWithHandler;
-import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.quest.Quest;
-import core.game.node.item.Item;
-import rs09.game.world.GameWorld;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-
-/**
- * Represents the plugin used to tie up lady keli.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class LadyKeliRopePlugin extends UseWithHandler {
-
- /**
- * Represents the rope item.
- */
- private static final Item ROPE = new Item(954);
-
- /**
- * Constructs a new {@code LadyKeliRopePlugin} {@code Object}.
- */
- public LadyKeliRopePlugin() {
- super(954);
- }
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- addHandler(919, NPC_TYPE, this);
- return this;
- }
-
- @Override
- public boolean handle(NodeUsageEvent event) {
- final Player player = event.getPlayer();
- final Quest quest = player.getQuestRepository().getQuest("Prince Ali Rescue");
- if (quest.getStage(player) >= 40 && player.getAttribute("guard-drunk", false) && quest.getStage(player) != 100) {
- if (player.getInventory().remove(ROPE)) {
- player.getDialogueInterpreter().sendDialogue("You overpower Keli, tie her up, and put her in a cupboard.");
- quest.setStage(player, 50);
- player.setAttribute("keli-gone", GameWorld.getTicks() + 350);
- }
- } else {
- if (quest.getStage(player) == 40) {
- player.getPacketDispatch().sendMessage("You need to do something about the guard first.");
- }
- return true;
- }
- return true;
- }
-
-}
diff --git a/Server/src/main/java/core/game/interaction/object/WildernessObeliskPlugin.java b/Server/src/main/java/core/game/interaction/object/WildernessObeliskPlugin.java
deleted file mode 100644
index 75ea82f6e..000000000
--- a/Server/src/main/java/core/game/interaction/object/WildernessObeliskPlugin.java
+++ /dev/null
@@ -1,151 +0,0 @@
-package core.game.interaction.object;
-
-import core.cache.def.impl.SceneryDefinition;
-import core.game.interaction.OptionHandler;
-import core.game.node.Node;
-import core.game.node.entity.player.Player;
-import core.game.node.entity.player.link.TeleportManager.TeleportType;
-import core.game.node.scenery.Scenery;
-import core.game.node.scenery.SceneryBuilder;
-import core.game.system.task.Pulse;
-import rs09.game.world.GameWorld;
-import core.game.world.map.Location;
-import core.game.world.map.RegionManager;
-import core.game.world.update.flag.chunk.GraphicUpdateFlag;
-import core.game.world.update.flag.context.Graphics;
-import core.plugin.Initializable;
-import core.plugin.Plugin;
-import core.tools.RandomFunction;
-
-/**
- * Represents the wilderness obelisk plugin.
- * @author 'Vexia
- * @version 1.0
- */
-@Initializable
-public final class WildernessObeliskPlugin extends OptionHandler {
-
- @Override
- public Plugin newInstance(Object arg) throws Throwable {
- SceneryDefinition.forId(14829).getHandlers().put("option:activate", this);
- SceneryDefinition.forId(14826).getHandlers().put("option:activate", this);
- SceneryDefinition.forId(14827).getHandlers().put("option:activate", this);
- SceneryDefinition.forId(14828).getHandlers().put("option:activate", this);
- SceneryDefinition.forId(14830).getHandlers().put("option:activate", this);
- SceneryDefinition.forId(14831).getHandlers().put("option:activate", this);
- return this;
- }
-
- @Override
- public boolean handle(final Player player, final Node node, String option) {
- final Scenery nodeObject = (Scenery) node;
- final Obelisk stationObelisk = Obelisk.forLocation(player.getLocation());
- if (stationObelisk == null) {
- return false;
- }
- for (int i = 0; i < 4; i++) {
- int x = stationObelisk.getLocation().getX();
- int y = stationObelisk.getLocation().getY();
- int z = stationObelisk.getLocation().getZ();
- switch (i) {
- case 0:
- x = x + 2;
- y = y + 2;
- SceneryBuilder.replace(new Scenery(nodeObject.getId(), Location.create(x, y, z)), new Scenery(14825, Location.create(x, y, 0)), 6);
- break;
- case 1:
- x = x - 2;
- y = y + 2;
- SceneryBuilder.replace(new Scenery(nodeObject.getId(), Location.create(x, y, z)), new Scenery(14825, Location.create(x, y, 0)), 6);
- break;
- case 2:
- x = x - 2;
- y = y - 2;
- SceneryBuilder.replace(new Scenery(nodeObject.getId(), Location.create(x, y, z)), new Scenery(14825, Location.create(x, y, 0)), 6);
- break;
- case 3:
- x = x + 2;
- y = y - 2;
- SceneryBuilder.replace(new Scenery(nodeObject.getId(), Location.create(x, y, z)), new Scenery(14825, Location.create(x, y, 0)), 6);
- break;
- }
- }
- player.getAudioManager().send(204);
- GameWorld.getPulser().submit(new Pulse(6, player) {
- @Override
- public boolean pulse() {
- final Location center = stationObelisk.getLocation();
- if (getDelay() == 1) {
- for (int x = center.getX() - 1; x <= center.getX() + 1; x++) {
- for (int y = center.getY() - 1; y <= center.getY() + 1; y++) {
- Location l = Location.create(x, y, 0);
- RegionManager.getRegionChunk(l).flag(new GraphicUpdateFlag(Graphics.create(342), l));
- }
- }
- return true;
- }
- int index = RandomFunction.random(Obelisk.values().length);
- Obelisk newObelisk = Obelisk.values()[index];
- if (newObelisk == stationObelisk) {
- newObelisk = Obelisk.values()[index++ % Obelisk.values().length];
- }
- for (Player player : RegionManager.getLocalPlayers(center, 1)) {
- player.getPacketDispatch().sendMessage("Ancient magic teleports you somewhere in the wilderness.");
- int xDif = stationObelisk.getLocation().getX() - player.getLocation().getX();
- int yDif = stationObelisk.getLocation().getY() - player.getLocation().getY();
- if (xDif > 0 || yDif > 0) {
- player.getTeleporter().send(Location.create(newObelisk.getLocation().getX() - xDif, newObelisk.getLocation().getY() - yDif, 0), TeleportType.OBELISK, 2);
- } else {
- player.getTeleporter().send(Location.create(newObelisk.getLocation().getX() + xDif, newObelisk.getLocation().getY() + yDif, 0), TeleportType.OBELISK, 2);
- }
- }
- super.setDelay(1);
- return false;
- }
-
- });
- return true;
- }
-
- /**
- * Represents an obelisk type.
- * @author 'Vexia
- * @version 1.0
- */
- public enum Obelisk {
- LEVEL_13(new Location(3156, 3620, 0)), LEVEL_19(new Location(3219, 3656, 0)), LEVEL_27(new Location(3035, 3732, 0)), LEVEL_35(new Location(3106, 3794, 0)), LEVEL_44(new Location(2980, 3866, 0)), LEVEL_50(new Location(3307, 3916, 0));
-
- /**
- * Represents the location to teleport to.
- */
- private Location location;
-
- /**
- * Constructs a new {@code Obelisk} {@code Object}.
- * @param location the location.
- */
- Obelisk(Location location) {
- this.location = location;
- }
-
- /**
- * Gets the location.
- * @return the location
- */
- public Location getLocation() {
- return location;
- }
-
- /**
- * Gets the obelisk by location.
- * @param location the location.
- * @return the obelisk.
- */
- public static Obelisk forLocation(Location location) {
- for (Obelisk obelisk : Obelisk.values())
- if (obelisk.getLocation().getDistance(location) <= 20)
- return obelisk;
- return null;
- }
- }
-}
diff --git a/Server/src/main/java/core/game/interaction/object/dmc/DMCHandler.java b/Server/src/main/java/core/game/interaction/object/dmc/DMCHandler.java
index 90242a3ad..34f6eb528 100644
--- a/Server/src/main/java/core/game/interaction/object/dmc/DMCHandler.java
+++ b/Server/src/main/java/core/game/interaction/object/dmc/DMCHandler.java
@@ -110,13 +110,13 @@ public final class DMCHandler {
}
player.getPacketDispatch().sendSceneryAnimation(cannon, Animation.create(direction.getAnimationId()));
Location l = cannon.getLocation().transform(1, 1, 0);
- player.getAudioManager().send(new Audio(2877), true, l);
+ player.getAudioManager().send(new Audio(2877), true);
direction = DMCRevolution.values()[(direction.ordinal() + 1) % DMCRevolution.values().length];
for (NPC npc : RegionManager.getLocalNpcs(l, 10)) {
if (direction.isInSight(npc.getLocation().getX() - l.getX(), npc.getLocation().getY() - l.getY()) && npc.isAttackable(player, CombatStyle.RANGE, false) && CombatSwingHandler.isProjectileClipped(npc, l, false)) {
int speed = (int) (25 + (l.getDistance(npc.getLocation()) * 10));
Projectile.create(l, npc.getLocation(), 53, 40, 36, 20, speed, 0, 128).send();
- player.getAudioManager().send(new Audio(1667), true, l);
+ player.getAudioManager().send(new Audio(1667), true);
cannonballs--;
int hit = 0;
if (player.getSwingHandler(false).isAccurateImpact(player, npc, CombatStyle.RANGE, 1.2, 1.0)) {
@@ -236,7 +236,7 @@ public final class DMCHandler {
case 0:
object = SceneryBuilder.add(new Scenery(7, spawn));
player.getPacketDispatch().sendMessage("You place the cannon base on the ground.");
- break;
+ return count++ == 666;
case 1:
player.getPacketDispatch().sendMessage("You add the stand.");
break;
@@ -249,11 +249,11 @@ public final class DMCHandler {
handler.configure(SceneryBuilder.add(object = object.transform(6)));
return true;
}
- player.getAudioManager().send(new Audio(2876), true);
- if(count != 0) {
- SceneryBuilder.remove(object);
- SceneryBuilder.add(object = object.transform(object.getId() + 1));
- }
+ player.getAudioManager().send(new Audio(2876), true);
+ if(count != 0) {
+ SceneryBuilder.remove(object);
+ SceneryBuilder.add(object = object.transform(object.getId() + 1));
+ }
return ++count == 4;
}
});
diff --git a/Server/src/main/java/core/game/node/entity/combat/special/ArmadylCrossbowSpecialHandler.java b/Server/src/main/java/core/game/node/entity/combat/special/ArmadylCrossbowSpecialHandler.java
new file mode 100644
index 000000000..3b22367e6
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/combat/special/ArmadylCrossbowSpecialHandler.java
@@ -0,0 +1,70 @@
+package core.game.node.entity.combat.special;
+
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.handlers.RangeSwingHandler;
+import core.game.node.entity.impl.Projectile;
+import core.game.node.entity.impl.Animator.Priority;
+import core.game.node.entity.player.Player;
+import core.game.world.update.flag.context.Animation;
+import core.plugin.Plugin;
+import core.plugin.Initializable;
+import core.tools.RandomFunction;
+
+/**
+ * Represents the new Armadyl C'bow special attack.
+ * @author Splinter
+ * @version 1.0
+ */
+@Initializable
+public final class ArmadylCrossbowSpecialHandler extends RangeSwingHandler implements Plugin {
+
+ /**
+ * The special energy required.
+ */
+ private static final int SPECIAL_ENERGY = 50;
+
+ /**
+ * The attack animation.
+ */
+ private static final Animation ANIMATION = new Animation(4230, Priority.HIGH);
+
+ @Override
+ public Object fireEvent(String identifier, Object... args) {
+ return null;
+ }
+
+ @Override
+ public Plugin newInstance(Object arg) throws Throwable {
+ CombatStyle.RANGE.getSwingHandler().register(9185, this);
+ return this;
+ }
+
+ @Override
+ public int swing(Entity entity, Entity victim, BattleState state) {
+ Player p = (Player) entity;
+ configureRangeData(p, state);
+ if (state.getWeapon() == null || !Companion.hasAmmo(entity, state)) {
+ entity.getProperties().getCombatPulse().stop();
+ p.getSettings().toggleSpecialBar();
+ return -1;
+ }
+ if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
+ return -1;
+ }
+ int hit = 0;
+ if (isAccurateImpact(entity, victim, CombatStyle.RANGE, 2.0, 1.0)) {//2x the accuracy
+ hit = RandomFunction.random(calculateHit(entity, victim, 1.0));
+ }
+ Companion.useAmmo(entity, state, victim.getLocation());
+ state.setEstimatedHit(hit);
+ return 1;
+ }
+
+ @Override
+ public void visualize(Entity entity, Entity victim, BattleState state) {
+ entity.animate(ANIMATION);
+ Projectile.create(entity, victim, 698, 36, 25, 35, 50).send();
+ }
+}
diff --git a/Server/src/main/java/core/game/node/entity/combat/special/DragonPickaxeSpecialHandler.java b/Server/src/main/java/core/game/node/entity/combat/special/DragonPickaxeSpecialHandler.java
new file mode 100644
index 000000000..5e5d12eb5
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/combat/special/DragonPickaxeSpecialHandler.java
@@ -0,0 +1,61 @@
+package core.game.node.entity.combat.special;
+
+import core.game.node.entity.skill.Skills;
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.handlers.MeleeSwingHandler;
+import core.game.node.entity.player.Player;
+import core.plugin.Initializable;
+import core.plugin.Plugin;
+
+/**
+ * Handles the Dragon pickaxe's special attack.
+ * @author Crash
+ */
+@Initializable
+public final class DragonPickaxeSpecialHandler extends MeleeSwingHandler implements Plugin {
+
+ /**
+ * The special energy required.
+ */
+ private static final int SPECIAL_ENERGY = 100;
+
+ /**
+ * The attack animation.
+ */
+ //private static final Animation ANIMATION = new Animation(1057, Priority.HIGH);
+
+ /**
+ * The graphic.
+ */
+ //private static final Graphics GRAPHIC = new Graphics(247);
+
+ @Override
+ public Object fireEvent(String identifier, Object... args) {
+ switch (identifier) {
+ case "instant_spec":
+ case "ncspec":
+ return true;
+ }
+ return null;
+ }
+
+ @Override
+ public Plugin newInstance(Object arg) throws Throwable {
+ CombatStyle.MELEE.getSwingHandler().register(14723, this);
+ return this;
+ }
+
+ @Override
+ public int swing(Entity entity, Entity victim, BattleState state) {
+ Player p = (Player) entity;
+ if (!p.getSettings().drainSpecial(SPECIAL_ENERGY))
+ return -1;
+ p.sendChat("Smashing!");
+ //p.visualize(ANIMATION, GRAPHIC);
+ p.getSkills().updateLevel(Skills.MINING, 3, p.getSkills().getStaticLevel(Skills.MINING) + 3);
+ return -1;
+ }
+
+}
diff --git a/Server/src/main/java/core/game/node/entity/combat/special/OGClobberSpecialHandler.java b/Server/src/main/java/core/game/node/entity/combat/special/OGClobberSpecialHandler.java
new file mode 100644
index 000000000..b560e1c6c
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/combat/special/OGClobberSpecialHandler.java
@@ -0,0 +1,75 @@
+package core.game.node.entity.combat.special;
+
+import core.game.node.entity.skill.Skills;
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.handlers.MeleeSwingHandler;
+import core.game.node.entity.impl.Animator.Priority;
+import core.game.node.entity.player.Player;
+import core.game.world.update.flag.context.Animation;
+import core.game.world.update.flag.context.Graphics;
+import core.plugin.Initializable;
+import core.plugin.Plugin;
+import core.tools.RandomFunction;
+
+/**
+ * Represents the original dragon axe's special attack, Clobber.
+ * @author Emperor
+ * @version 1.0
+ */
+@Initializable
+public final class OGClobberSpecialHandler extends MeleeSwingHandler implements Plugin {
+
+ /**
+ * The special energy required.
+ */
+ private static final int SPECIAL_ENERGY = 100;
+
+ /**
+ * The attack animation.
+ */
+ private static final Animation ANIMATION = new Animation(2876, Priority.HIGH);
+
+ /**
+ * The graphic.
+ */
+ private static final Graphics GRAPHIC = new Graphics(479, 96);
+
+ @Override
+ public Object fireEvent(String identifier, Object... args) {
+ return null;
+ }
+
+ @Override
+ public Plugin newInstance(Object arg) throws Throwable {
+ CombatStyle.MELEE.getSwingHandler().register(3757, this);
+ return this;
+ }
+
+ @Override
+ public int swing(Entity entity, Entity victim, BattleState state) {
+ if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
+ return -1;
+ }
+ int hit = 0;
+ //if (entity instanceof Player) {
+ // entity.asPlayer().sendChat("Chop chop!");
+ //}
+ if (isAccurateImpact(entity, victim, CombatStyle.MELEE, 1.05, 1.0)) {
+ hit = RandomFunction.random(calculateHit(entity, victim, 1.0));
+ if (hit > 9) {
+ int amount = hit / 10;
+ victim.getSkills().updateLevel(Skills.DEFENCE, -amount, 0);
+ victim.getSkills().updateLevel(Skills.MAGIC, -amount, 0);
+ }
+ }
+ state.setEstimatedHit(hit);
+ return 1;
+ }
+
+ @Override
+ public void visualize(Entity entity, Entity victim, BattleState state) {
+ entity.visualize(ANIMATION, GRAPHIC);
+ }
+}
diff --git a/Server/src/main/java/core/game/node/entity/combat/special/SaeldorsStrikeSpecialHandler.java b/Server/src/main/java/core/game/node/entity/combat/special/SaeldorsStrikeSpecialHandler.java
new file mode 100644
index 000000000..fb9d291fd
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/combat/special/SaeldorsStrikeSpecialHandler.java
@@ -0,0 +1,118 @@
+package core.game.node.entity.combat.special;
+
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.handlers.MeleeSwingHandler;
+import core.game.node.entity.impl.Animator.Priority;
+import core.game.node.entity.player.Player;
+import core.game.node.entity.state.EntityState;
+import core.game.world.map.Direction;
+import core.game.world.map.Location;
+import core.game.world.map.Point;
+import core.game.world.map.path.Pathfinder;
+import core.game.world.update.flag.context.Animation;
+import core.game.world.update.flag.context.Graphics;
+import core.plugin.Initializable;
+import core.plugin.Plugin;
+
+/**
+ * Handles the Blade of Saeldor's special attack.
+ * @author Crash
+ */
+@Initializable
+public final class SaeldorsStrikeSpecialHandler extends MeleeSwingHandler implements Plugin {
+
+ /**
+ * The special energy required.
+ */
+ private static final int SPECIAL_ENERGY = 100;
+
+ /**
+ * The attack animation.
+ */
+ private static final Animation ANIMATION = new Animation(1872, Priority.HIGH);
+
+ /**
+ * The graphic.
+ */
+ private static final Graphics GRAPHIC = new Graphics(347, 96);
+
+ /**
+ * The stun animation.
+ */
+ private static Animation STUN_ANIM = new Animation(424);
+
+ @Override
+ public Object fireEvent(String identifier, Object... args) {
+ return null;
+ }
+
+ @Override
+ public Plugin newInstance(Object arg) throws Throwable {
+ CombatStyle.MELEE.getSwingHandler().register(14728, this);
+ return this;
+ }
+
+ @Override
+ public int swing(Entity entity, final Entity victim, BattleState state) {
+ if (victim.size() > 1) {
+ ((Player) entity).getPacketDispatch().sendMessage("That creature is too large to knock back!");
+ ((Player) entity).getSettings().toggleSpecialBar();
+ return -1;
+ }
+ if (!((Player) entity).getSettings().drainSpecial(SPECIAL_ENERGY)) {
+ return -1;
+ }
+ state.setEstimatedHit(-1);
+ Direction dir = null;
+ int vx = victim.getLocation().getX();
+ int vy = victim.getLocation().getY();
+ int sx = entity.getLocation().getX();
+ int sy = entity.getLocation().getY();
+ if (vx == sx && vy > sy) {
+ dir = Direction.NORTH;
+ } else if (vx == sx && vy < sy) {
+ dir = Direction.SOUTH;
+ } else if (vx > sx && vy == sy) {
+ dir = Direction.EAST;
+ } else if (vx < sx && vy == sy) {
+ dir = Direction.WEST;
+ } else if (vx > sx && vy > sy) {
+ dir = Direction.NORTH_EAST;
+ } else if (vx < sx && vy > sy) {
+ dir = Direction.NORTH_WEST;
+ } else if (vx > sx && vy < sy) {
+ dir = Direction.SOUTH_EAST;
+ } else if (vx < sx && vy < sy) {
+ dir = Direction.SOUTH_WEST;
+ }
+ victim.getWalkingQueue().reset();
+ victim.getPulseManager().clear();
+ victim.animate(STUN_ANIM);
+ victim.getStateManager().set(EntityState.STUNNED, 5);
+ if (dir != null) {
+ Point p = Direction.getWalkPoint(dir);
+ Location dest = victim.getLocation().transform(p.getX(), p.getY(), 0);
+ if (Pathfinder.find(victim, dest, false, Pathfinder.DUMB).isSuccessful()) {
+ victim.getWalkingQueue().addPath(dest.getX(), dest.getY());
+ }
+ }
+ entity.asPlayer().getAudioManager().send(2533);
+ return 1;
+ }
+
+ @Override
+ public void visualize(Entity entity, Entity victim, BattleState state) {
+ entity.visualize(ANIMATION, GRAPHIC);
+ }
+
+ @Override
+ public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
+ }
+
+ @Override
+ public void impact(Entity entity, Entity victim, BattleState state) {
+ }
+
+}
diff --git a/Server/src/main/java/core/game/node/entity/combat/special/ShoveSpecialHandler.java b/Server/src/main/java/core/game/node/entity/combat/special/ShoveSpecialHandler.java
index ae67f2a0c..90dc747be 100644
--- a/Server/src/main/java/core/game/node/entity/combat/special/ShoveSpecialHandler.java
+++ b/Server/src/main/java/core/game/node/entity/combat/special/ShoveSpecialHandler.java
@@ -17,7 +17,7 @@ import core.plugin.Initializable;
import core.plugin.Plugin;
/**
- * Handles the dragon spear special attack.
+ * Handles the dragon spear and zamorakian spear special attack, Shove.
* @author Emperor
*/
@Initializable
diff --git a/Server/src/main/java/core/game/node/entity/npc/NPC.java b/Server/src/main/java/core/game/node/entity/npc/NPC.java
index a7368a983..594dca73c 100644
--- a/Server/src/main/java/core/game/node/entity/npc/NPC.java
+++ b/Server/src/main/java/core/game/node/entity/npc/NPC.java
@@ -470,14 +470,14 @@ public class NPC extends Entity {
}
}
}
- if (shop != null) {
- if (shop.getLastRestock() < GameWorld.getTicks()) {
- if (shop.isRestock()) {
- shop.restock();
- shop.setLastRestock(GameWorld.getTicks() + 100);
- }
- }
- }
+ // if (shop != null) {
+ // if (shop.getLastRestock() < GameWorld.getTicks()) {
+ // if (shop.isRestock()) {
+ // shop.restock();
+ // shop.setLastRestock(GameWorld.getTicks() + 100);
+ // }
+ // }
+ // }
if (forceTalk != null && getAttribute("lastForceTalk", 0) < GameWorld.getTicks()) {
sendChat(forceTalk);
setAttribute("lastForceTalk", GameWorld.getTicks() + RandomFunction.random(15, 30));
diff --git a/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/CrazyArchaeologistNPC.java b/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/CrazyArchaeologistNPC.java
new file mode 100644
index 000000000..29779e4ce
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/CrazyArchaeologistNPC.java
@@ -0,0 +1,207 @@
+package core.game.node.entity.npc.bosses.wilderness;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import core.game.content.global.BossKillCounter;
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.CombatSwingHandler;
+import core.game.node.entity.combat.ImpactHandler.HitsplatType;
+import core.game.node.entity.combat.equipment.SwitchAttack;
+import rs09.game.node.entity.combat.handlers.MultiSwingHandler;
+import core.game.node.entity.impl.Projectile;
+import core.game.node.entity.npc.AbstractNPC;
+import core.game.node.entity.player.Player;
+import core.game.world.map.Location;
+import core.game.world.map.RegionManager;
+import core.game.world.update.flag.context.Animation;
+import core.plugin.Initializable;
+import core.tools.RandomFunction;
+
+/**
+ * Handles the Crazy Archaeologist NPC.
+ * @author Vexia
+ *
+ */
+@Initializable
+public class CrazyArchaeologistNPC extends AbstractNPC {
+
+ /**
+ * The quotes for the crazy archaeologist.
+ */
+ private static final String[] QUOTES = new String[] {"I'm Bellock - respect me!", "Get off my site!", "No-one messes with Bellock's dig!", "These ruins are mine!", "Taste my knowledge!", "You belong in a museum!"};
+
+ /**
+ * The multi swing handler.
+ */
+ private static final MultiSwingHandler COMBAT_HANDLER = new ArchaeologistHandler();
+
+ /**
+ * Constructs a new @{Code CrazyArchaeologistNPC} object.
+ * @param id The id.
+ * @param location The location.
+ */
+ public CrazyArchaeologistNPC(int id, Location location) {
+ super(id, location);
+ }
+
+ /**
+ * Constructs a new @{Code CrazyArchaeologistNPC} object.
+ */
+ public CrazyArchaeologistNPC() {
+ super(-1, null);
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ configureBossData();
+ }
+
+ @Override
+ public void sendImpact(BattleState state) {
+ if (state.getEstimatedHit() > 24) {
+ state.setEstimatedHit(24);
+ }
+ super.sendImpact(state);
+ }
+
+ @Override
+ public void commenceDeath(Entity killer) {
+ sendChat("Ow!");
+ super.commenceDeath(killer);
+ }
+
+ @Override
+ public void finalizeDeath(Entity killer) {
+ super.finalizeDeath(killer);
+ BossKillCounter.addtoKillcount((Player) killer, this.getId());
+ }
+
+ @Override
+ public CombatSwingHandler getSwingHandler(boolean swing) {
+ return COMBAT_HANDLER;
+ }
+
+ @Override
+ public AbstractNPC construct(int id, Location location, Object... objects) {
+ return new CrazyArchaeologistNPC(id, location);
+ }
+
+ @Override
+ public int[] getIds() {
+ return new int[] {997};
+ }
+
+ /**
+ * Handles the Crazy Archaeologist combat handler.
+ * @author Vexia
+ */
+ public static class ArchaeologistHandler extends MultiSwingHandler {
+
+ /**
+ * The switch attacks.
+ */
+ private static final SwitchAttack[] ATTACKS = new SwitchAttack[] {new SwitchAttack(CombatStyle.MELEE), new SwitchAttack(CombatStyle.RANGE.getSwingHandler(), new Animation(1162))};
+
+ /**
+ * The exposion locations.
+ */
+ private final List locs = new ArrayList<>();
+
+ /**
+ * If the special attack is used.
+ */
+ private boolean special;
+
+ /**
+ * Constructs a new @{Code ChaosCombatHandler} object.
+ */
+ public ArchaeologistHandler() {
+ super(ATTACKS);
+ }
+
+ @Override
+ public int swing(Entity entity, Entity victim, BattleState state) {
+ if (state.getStyle() == CombatStyle.RANGE && RandomFunction.random(10) == 1) {
+ special = true;
+ }
+ return super.swing(entity, victim, state);
+ }
+
+ @Override
+ public void impact(Entity entity, Entity victim, BattleState state) {
+ if (special) {
+ special = false;
+ for (Location l : locs) {
+ if (l == null) {
+ continue;
+ }
+ for (Player p : RegionManager.getLocalPlayers(l, 3)) {
+ p.getImpactHandler().manualHit(entity, RandomFunction.random(1, 24), HitsplatType.NORMAL);
+ }
+ }
+ locs.clear();
+ return;
+ }
+ super.impact(entity, victim, state);
+ }
+
+ @Override
+ public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
+ if (state.getStyle() == CombatStyle.RANGE && special) {
+ entity.sendChat("Rain of knowledge!");
+ Location loc = null;
+ for (int i = 0; i < 3; i++) {
+ loc = getRandomLoc(entity);
+ if (!RegionManager.isTeleportPermitted(loc)) {
+ loc = getRandomLoc(entity);
+ }
+ if (locs.contains(loc)) {
+ loc = getRandomLoc(entity);
+ }
+ if (!RegionManager.isTeleportPermitted(loc)) {
+ loc = getRandomLoc(entity);
+ }
+ if (!locs.contains(loc)) {
+ locs.add(loc);
+ }
+ }
+ for (Location l : locs) {
+ if (l == null || entity == null) {
+ continue;
+ }
+ Projectile p = Projectile.create(entity, null, 156, 40, 10, 30, 90);
+ p.setEndLocation(l);
+ p.send();
+ }
+ entity.animate(new Animation(1167));
+ } else {
+ if (state.getStyle() == CombatStyle.RANGE) {
+ Projectile p = Projectile.ranged(entity, victim, 156, 40, 30, 0, 15);
+ p.setSpeed(40);
+ p.send();
+ }
+ entity.sendChat(RandomFunction.getRandomElement(QUOTES));
+ }
+ if (state.getStyle() == CombatStyle.MELEE) {
+ super.visualizeImpact(entity, victim, state);
+ }
+ }
+
+ /**
+ * Gets the random loc.
+ * @param entity the entity.
+ * @return the loc.
+ */
+ public Location getRandomLoc(Entity entity) {
+ Location l = entity.getLocation();
+ boolean negative = RandomFunction.random(2) == 1;
+ return l.getLocation().transform((negative ? RandomFunction.random(-3, 3) : RandomFunction.random(0, 3)), (negative ? RandomFunction.random(-3, 3) : RandomFunction.random(3, 3)), 0);
+ }
+
+ }
+
+}
diff --git a/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/VenenatisNPC.java b/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/VenenatisNPC.java
new file mode 100644
index 000000000..f43cba29a
--- /dev/null
+++ b/Server/src/main/java/core/game/node/entity/npc/bosses/wilderness/VenenatisNPC.java
@@ -0,0 +1,208 @@
+package core.game.node.entity.npc.bosses.wilderness;
+
+import core.game.content.global.BossKillCounter;
+import core.game.node.entity.Entity;
+import core.game.node.entity.combat.BattleState;
+import core.game.node.entity.combat.CombatStyle;
+import rs09.game.node.entity.combat.CombatSwingHandler;
+import core.game.node.entity.combat.InteractionType;
+import core.game.node.entity.combat.ImpactHandler.HitsplatType;
+import core.game.node.entity.impl.Projectile;
+import core.game.node.entity.npc.AbstractNPC;
+import core.game.node.entity.player.Player;
+import core.game.node.entity.state.EntityState;
+import core.game.world.map.Location;
+import core.game.world.update.flag.context.Graphics;
+import core.plugin.Initializable;
+import core.tools.RandomFunction;
+
+/**
+ * Handles the Venenatis NPC.
+ * @author Vexia
+ *
+ */
+@Initializable
+public class VenenatisNPC extends AbstractNPC {
+
+ /**
+ * The venenatis combat swing handler.
+ */
+ private final VenenatisCombatSwingHandler handler = new VenenatisCombatSwingHandler();
+
+ /**
+ * Constructs a new @{Code VenenatisNPC} object.
+ */
+ public VenenatisNPC() {
+ super(-1, null);
+ }
+
+ /**
+ * Constructs a new @{Code VenenatisNPC} object.
+ * @param id The id.
+ * @param location The location.
+ */
+ public VenenatisNPC(int id, Location location) {
+ super(id, location);
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ super.setAggressive(true);
+ super.setDefaultBehavior();
+ configureBossData();
+ }
+
+ @Override
+ public AbstractNPC construct(int id, Location location, Object... objects) {
+ return new VenenatisNPC(id, location);
+ }
+
+ @Override
+ public void finalizeDeath(Entity killer) {
+ super.finalizeDeath(killer);
+ if (killer instanceof Player) {
+ BossKillCounter.addtoKillcount((Player) killer, this.getId());
+ }
+ }
+
+ @Override
+ public void sendImpact(BattleState state) {
+ if (state.getEstimatedHit() > 50) {
+ state.setEstimatedHit(RandomFunction.random(40, 50));
+ } else if (state.getSecondaryHit() > 50) {
+ state.setEstimatedHit(RandomFunction.random(40, 50));
+ }
+ super.sendImpact(state);
+ }
+
+ @Override
+ public void checkImpact(BattleState state) {
+ super.checkImpact(state);
+ }
+
+ @Override
+ public CombatSwingHandler getSwingHandler(boolean swing) {
+ return handler;
+ }
+
+ @Override
+ public int[] getIds() {
+ return new int[] {8591};
+ }
+
+ /**
+ * Handles the combat for the npc Venenatis.
+ * @author Vexia
+ *
+ */
+ public class VenenatisCombatSwingHandler extends CombatSwingHandler {
+
+ /**
+ * The current combat style.
+ */
+ private CombatStyle style = CombatStyle.MAGIC;
+
+ /**
+ * If the special attack is launched.
+ */
+ private boolean special;
+
+ /**
+ * If the player drain attack is launched.
+ */
+ private boolean prayerDrain;
+
+ /**
+ * Constructs a new @{Code VenenatisCombatSwingHandler} object.
+ */
+ public VenenatisCombatSwingHandler() {
+ super(CombatStyle.MAGIC);
+ }
+
+ @Override
+ public InteractionType canSwing(Entity entity, Entity victim) {
+ return style.getSwingHandler().canSwing(entity, victim);
+ }
+
+ @Override
+ public int swing(Entity entity, Entity victim, BattleState state) {
+ if (style == CombatStyle.MAGIC) {
+ return 2 + (int) Math.floor(entity.getLocation().getDistance(victim.getLocation()) * 0.5);
+ }
+ return style.getSwingHandler().swing(entity, victim, state);
+ }
+
+ @Override
+ public void impact(Entity entity, Entity victim, BattleState state) {
+ if (victim instanceof Player) {
+ Player p = (Player) victim;
+ if (special) {
+ int hit = style.getSwingHandler().calculateHit(entity, victim, 1.0);
+ if (hit < 10) {
+ hit = RandomFunction.random(10, 30);
+ }
+ if (hit > 50) {
+ hit = 50;
+ }
+ p.getStateManager().register(EntityState.STUNNED, true, 5, "Venenatis hurls her web at you, sticking you to the ground.");
+ p.getImpactHandler().manualHit(entity, hit, HitsplatType.NORMAL);
+ special = false;
+ } else if (prayerDrain) {
+ Projectile.create(entity, victim, 109).send(); // Curse projectile?
+ p.getSkills().decrementPrayerPoints(p.getSkills().getPrayerPoints() * 0.30);
+ p.sendMessage("Your prayer has been drained!");
+ prayerDrain = false;
+ }
+ }
+ style.getSwingHandler().impact(entity, victim, state);
+ if (RandomFunction.random(2) == 1) {
+ style = CombatStyle.MAGIC;
+ } else {
+ style = CombatStyle.MELEE;
+ }
+ this.setType(style);
+ }
+
+ @Override
+ public void visualizeImpact(Entity entity, Entity victim, BattleState state) {
+ if ((style == CombatStyle.MAGIC || style == CombatStyle.MELEE) && RandomFunction.random(20) == 1) {
+ special = true;
+ }
+ switch (style) {
+ case MAGIC:
+ Projectile.create(entity, victim, 165).send();
+ break;
+ case MELEE:
+ if (!special && victim.getSkills().getPrayerPoints() > 0 && RandomFunction.random(20) == 1) {
+ prayerDrain = true;
+ }
+ return;
+ default:
+ break;
+ }
+ style.getSwingHandler().visualizeImpact(entity, victim, state);
+ }
+
+ @Override
+ public int calculateAccuracy(Entity entity) {
+ return style.getSwingHandler().calculateAccuracy(entity);
+ }
+
+ @Override
+ public int calculateHit(Entity entity, Entity victim, double modifier) {
+ return style.getSwingHandler().calculateHit(entity, victim, modifier);
+ }
+
+ @Override
+ public int calculateDefence(Entity entity, Entity attacker) {
+ return style.getSwingHandler().calculateDefence(entity, attacker);
+ }
+
+ @Override
+ public double getSetMultiplier(Entity e, int skillId) {
+ return style.getSwingHandler().getSetMultiplier(e, skillId);
+ }
+
+ }
+}
diff --git a/Server/src/main/java/core/game/node/entity/player/Player.java b/Server/src/main/java/core/game/node/entity/player/Player.java
index d8d27a98b..cc94d24e3 100644
--- a/Server/src/main/java/core/game/node/entity/player/Player.java
+++ b/Server/src/main/java/core/game/node/entity/player/Player.java
@@ -402,6 +402,7 @@ public class Player extends Entity {
getProperties().setSpawnLocation(ServerConstants.HOME_LOCATION);
getDetails().getSession().setObject(this);
getDetails().getSession().setLastPing(System.currentTimeMillis() + 10_000L);
+ this.varpManager.get(678).setVarbit(0,3).send(this);
}
super.init();
LoginConfiguration.configureLobby(this);
@@ -633,6 +634,10 @@ public class Player extends Entity {
setAttribute("dead", true);
}
if (this.isArtificial() && killer instanceof NPC) {
+ /* Re-enable for bots to be "killed" by npcs
+ * this is causing NPE's and should be left disabled until bots are fixed.
+ setAttribute("dead", true);
+ */
return;
}
getPacketDispatch().sendMessage("Oh dear, you are dead!");
diff --git a/Server/src/main/java/core/game/node/entity/player/link/spawn/SpawnData.java b/Server/src/main/java/core/game/node/entity/player/link/spawn/SpawnData.java
index e15ee014e..ff127b19a 100644
--- a/Server/src/main/java/core/game/node/entity/player/link/spawn/SpawnData.java
+++ b/Server/src/main/java/core/game/node/entity/player/link/spawn/SpawnData.java
@@ -419,10 +419,6 @@ public class SpawnData {
if (GameWorld.isEconomyWorld()) {
return;
}
- if (killer.isArtificial() || killed.isArtificial() || killer.getDetails().getInfo().getIp().equals(killed.getDetails().getInfo().getIp()) || killed.getDetails().getInfo().getMac().equals(killer.getDetails().getInfo().getMac())) {
- killer.sendMessage("You can't kill someone from your own computer address.");
- return;
- }
SpawnData killedInfo = killed.getSavedData().getSpawnData();
int increment = getStreakPoints(killer);
if (killedInfo.getKillStreak() > 4) {
diff --git a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt
index e9018f88e..5bdc73c21 100644
--- a/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt
+++ b/Server/src/main/java/core/game/node/entity/skill/cooking/CookingRewrite.kt
@@ -1,10 +1,11 @@
package core.game.node.entity.skill.cooking
-import core.game.node.scenery.Scenery
import core.game.node.entity.player.Player
import core.game.node.item.Item
+import core.game.node.scenery.Scenery
import org.rs09.consts.Items
import org.rs09.consts.Items.BREAD_DOUGH_2307
+import org.rs09.consts.Items.RAW_BEAR_MEAT_2136
import org.rs09.consts.Items.RAW_BEEF_2132
import org.rs09.consts.Items.SEAWEED_401
import org.rs09.consts.Items.UNCOOKED_CAKE_1889
@@ -31,8 +32,8 @@ class CookingRewrite : InteractionListener() {
val obj = with.asScenery()
val range = obj.name.toLowerCase().contains("range")
when (item.id) {
- RAW_BEEF_2132 -> if (range) {
- player.dialogueInterpreter.open(CookingDialogue(item.id,9436,true,obj))
+ RAW_BEEF_2132, RAW_BEAR_MEAT_2136 -> if (range) {
+ player.dialogueInterpreter.open(CookingDialogue(item.id,Items.SINEW_9436,obj))
return@onUseWith true
}
BREAD_DOUGH_2307, UNCOOKED_CAKE_1889 -> if (!range) {
@@ -49,7 +50,7 @@ class CookingRewrite : InteractionListener() {
}
companion object {
- val COOKING_OBJs = intArrayOf(24313,21302, 13528, 13529, 13533, 13531, 13536, 13539, 13542, 2728, 2729, 2730, 2731, 2732, 2859, 3038, 3039, 3769, 3775, 4265, 4266, 5249, 5499, 5631, 5632, 5981, 9682, 10433, 11404, 11405, 11406, 12102, 12796, 13337, 13881, 14169, 14919, 15156, 20000, 20001, 21620, 21792, 22713, 22714, 23046, 24283, 24284, 25155, 25156, 25465, 25730, 27297, 29139, 30017, 32099, 33500, 34495, 34546, 36973, 37597, 37629, 37726, 114, 4172, 5275, 8750, 16893, 22154, 34410, 34565, 114, 9085, 9086, 9087, 12269, 15398, 25440, 25441, 2724, 2725, 2726, 4618, 4650, 5165, 6093, 6094, 6095, 6096, 8712, 9374, 9439, 9440, 9441, 10824, 17640, 17641, 17642, 17643, 18039, 21795, 24285, 24329, 27251, 33498, 35449, 36815, 36816, 37426, 40110)
+ val COOKING_OBJs = intArrayOf(24313,21302, 13528, 13529, 13533, 13531, 13536, 13539, 13542, 2728, 2729, 2730, 2731, 2732, 2859, 3038, 3039, 3769, 3775, 4265, 4266, 5249, 5499, 5631, 5632, 5981, 9682, 10433, 11404, 11405, 11406, 12102, 12796, 13337, 13881, 14169, 14919, 15156, 20000, 20001, 21620, 21792, 22713, 22714, 23046, 24283, 24284, 25155, 25156, 25465, 25730, 27297, 29139, 30017, 32099, 33500, 34495, 34546, 36973, 37597, 37629, 37726, 114, 4172, 5275, 8750, 16893, 22154, 34410, 34565, 114, 9085, 9086, 9087, 12269, 15398, 25440, 25441, 2724, 2725, 2726, 4618, 4650, 5165, 6093, 6094, 6095, 6096, 8712, 9374, 9439, 9440, 9441, 10824, 17640, 17641, 17642, 17643, 18039, 21795, 24285, 24329, 27251, 33498, 35449, 36815, 36816, 37426, 40110, 10377)
@JvmStatic
fun cook(player: Player, `object`: Scenery?, initial: Int, product: Int, amount: Int) {
@@ -60,6 +61,8 @@ class CookingRewrite : InteractionListener() {
player.pulseManager.run(PieCookingPulse(player, `object`, initial, product, amount))
} else if (CookableItems.intentionalBurn(initial)) {
player.pulseManager.run(IntentionalBurnPulse(player, `object`, initial, product, amount))
+ } else if (product == Items.SINEW_9436) { // This pulse overrides the StandardCookingPulse
+ player.pulseManager.run(SinewCookingPulse(player, `object`, initial, product, amount))
} else {
player.pulseManager.run(StandardCookingPulse(player, `object`, initial, product, amount))
}
diff --git a/Server/src/main/java/core/game/node/entity/skill/fletching/Fletching.java b/Server/src/main/java/core/game/node/entity/skill/fletching/Fletching.java
index 55c26e67d..bf28158e3 100644
--- a/Server/src/main/java/core/game/node/entity/skill/fletching/Fletching.java
+++ b/Server/src/main/java/core/game/node/entity/skill/fletching/Fletching.java
@@ -266,11 +266,11 @@ public class Fletching {
}
private enum Items{
STANDARD(1511,FletchingItems.ARROW_SHAFT, FletchingItems.SHORT_BOW, FletchingItems.LONG_BOW, FletchingItems.WOODEN_STOCK),
- OAK(1521, FletchingItems.OAK_SHORTBOW, FletchingItems.OAK_LONGBOW, FletchingItems.OAK_STOCK),
- WILLOW(1519, FletchingItems.WILLOW_SHORTBOW, FletchingItems.WILLOW_LONGBOW, FletchingItems.WILLOW_STOCK),
- MAPLE(1517, FletchingItems.MAPLE_SHORTOW, FletchingItems.MAPLE_LONGBOW, FletchingItems.MAPLE_STOCK),
- YEW(1515, FletchingItems.YEW_SHORTBOW, FletchingItems.YEW_LONGBOW, FletchingItems.YEW_STOCK),
- MAGIC(1513, FletchingItems.MAGIC_SHORTBOW, FletchingItems.MAGIC_LONGBOW),
+ OAK(1521, FletchingItems.O_ARROW_SHAFT, FletchingItems.OAK_SHORTBOW, FletchingItems.OAK_LONGBOW, FletchingItems.OAK_STOCK),
+ WILLOW(1519, FletchingItems.W_ARROW_SHAFT, FletchingItems.WILLOW_SHORTBOW, FletchingItems.WILLOW_LONGBOW, FletchingItems.WILLOW_STOCK),
+ MAPLE(1517, FletchingItems.M_ARROW_SHAFT, FletchingItems.MAPLE_SHORTOW, FletchingItems.MAPLE_LONGBOW, FletchingItems.MAPLE_STOCK),
+ YEW(1515, FletchingItems.Y_ARROW_SHAFT, FletchingItems.YEW_SHORTBOW, FletchingItems.YEW_LONGBOW, FletchingItems.YEW_STOCK),
+ MAGIC(1513, FletchingItems.MAG_ARROW_SHAFT, FletchingItems.MAGIC_SHORTBOW, FletchingItems.MAGIC_LONGBOW),
TEAK(6333, FletchingItems.TEAK_STOCK),
MAHOGANY(6332, FletchingItems.MAHOGANY_STOCK);
@@ -302,26 +302,31 @@ public class Fletching {
WOODEN_STOCK(9440, 6, 9, 1),
//Oak logs
+ O_ARROW_SHAFT(52, 7.5, 15, 25),
OAK_SHORTBOW(54, 16.5, 20, 1),
OAK_LONGBOW(56,25,25,1),
OAK_STOCK(9442, 16, 24, 1),
//Willow logs
+ W_ARROW_SHAFT(52, 12.5, 30, 35),
WILLOW_SHORTBOW(60, 33.3, 35, 1),
WILLOW_LONGBOW(58, 41.5, 40, 1),
WILLOW_STOCK(9444, 22, 39, 1),
//Maple logs
+ M_ARROW_SHAFT(52, 25, 45, 50),
MAPLE_SHORTOW(64, 50, 50, 1),
MAPLE_LONGBOW(62, 58.3, 55, 1),
MAPLE_STOCK(9448, 32, 54, 1),
//Yew logs
+ Y_ARROW_SHAFT(52, 43, 60, 65),
YEW_SHORTBOW(68, 67.5, 65, 1),
YEW_LONGBOW(66, 75, 70, 1),
YEW_STOCK(9452, 50, 69, 1),
//Magic logs
+ MAG_ARROW_SHAFT(52, 61, 75, 80),
MAGIC_SHORTBOW(72, 83.3, 80,1),
MAGIC_LONGBOW(70, 91.5, 85, 1),
diff --git a/Server/src/main/java/core/game/node/entity/skill/gather/SkillingTool.java b/Server/src/main/java/core/game/node/entity/skill/gather/SkillingTool.java
index a77366987..c1083041d 100644
--- a/Server/src/main/java/core/game/node/entity/skill/gather/SkillingTool.java
+++ b/Server/src/main/java/core/game/node/entity/skill/gather/SkillingTool.java
@@ -79,6 +79,11 @@ public enum SkillingTool {
* Represents a rune pickaxe (mining).
*/
RUNE_PICKAXE(1275, 41, 0.65D, new Animation(624)),
+
+ /**
+ * Represents the Dragon Pickaxe (mining).
+ */
+ DRAGON_PICKAXE(14723, 61, 1.0D, new Animation(11155)),
/**
* Represents the Inferno Adze (woodcutting)
@@ -88,7 +93,7 @@ public enum SkillingTool {
/**
* Represents the Inferno Adze (mining)
*/
- INFERNO_ADZE2(13661, 61, 1.0D, new Animation(10222)),
+ INFERNO_ADZE2(13661, 61, 0.65D, new Animation(10222)),
HATCHET_CLASS1(Items.HATCHET_CLASS_1_14132, 1, 0.1, new Animation(10603)),
HATCHET_CLASS2(Items.HATCHET_CLASS_2_14134, 20, 0.3, new Animation(10604)),
@@ -206,6 +211,7 @@ public enum SkillingTool {
SkillingTool[] pickaxePriority = new SkillingTool[] {
SkillingTool.PICKAXE_CLASS5,
SkillingTool.PICKAXE_CLASS4,
+ SkillingTool.DRAGON_PICKAXE,
SkillingTool.RUNE_PICKAXE,
SkillingTool.PICKAXE_CLASS3,
SkillingTool.ADAMANT_PICKAXE,
diff --git a/Server/src/main/java/core/game/node/entity/skill/slayer/Master.java b/Server/src/main/java/core/game/node/entity/skill/slayer/Master.java
index 83ee6be4d..c45680435 100644
--- a/Server/src/main/java/core/game/node/entity/skill/slayer/Master.java
+++ b/Server/src/main/java/core/game/node/entity/skill/slayer/Master.java
@@ -177,6 +177,15 @@ public enum Master {
new Task(Tasks.BANSHEE, 5),
new Task(Tasks.CAVE_CRAWLERS, 5)),
DURADEL(8275, 100, 50, new int[]{50, 199}, new int[]{15, 75, 225},
+ //new Task(Tasks.JAD, 1), - to remain disabled until boss tasks have lower kill amounts
+ new Task(Tasks.COMMANDER_ZILYANA,1),
+ new Task(Tasks.CHAOS_ELEMENTAL, 1),
+ new Task(Tasks.GENERAL_GRARDOOR,1),
+ new Task(Tasks.GIANT_MOLE,1),
+ new Task(Tasks.KING_BLACK_DRAGON,1),
+ new Task(Tasks.KRIL_TSUTSAROTH,1),
+ new Task(Tasks.KREE_ARRA,1),
+ new Task(Tasks.VENENATIS,1),
new Task(Tasks.ABYSSAL_DEMONS,12),
new Task(Tasks.DARK_BEASTS,11),
new Task(Tasks.TZHAAR, 10),
diff --git a/Server/src/main/java/core/game/node/entity/skill/slayer/Tasks.java b/Server/src/main/java/core/game/node/entity/skill/slayer/Tasks.java
index b3307bada..4f7c565ad 100644
--- a/Server/src/main/java/core/game/node/entity/skill/slayer/Tasks.java
+++ b/Server/src/main/java/core/game/node/entity/skill/slayer/Tasks.java
@@ -93,13 +93,14 @@ public enum Tasks {
WOLVES(20, new int[] { 95, 96, 97, 141, 142, 143, 839, 1198, 1330, 1558, 1559, 1951, 1952, 1953, 1954, 1955, 1956, 4413, 4414, 6046, 6047, 6048, 6049, 6050, 6051, 6052, 6829, 6830, 7005 }, new String[] { "Wolves are more agressive then dog's." }, 1, false),
ZOMBIES(10, new int[] { 73, 74, 75, 76, 2058, 2714, 2863, 2866, 2869, 2878, 3622, 4392, 4393, 4394, 5293, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306, 5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326, 5327, 5328, 5329, 5330, 5331, 5375, 5376, 5377, 5378, 5379, 5380, 5393, 5394, 5395, 5396, 5397, 5398, 5399, 5400, 5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 6099, 6100, 6131, }, new String[] { "Zombies are creatures with no brain, they do hit farley", "high though." }, 1, true),
JAD(90, new int[] { }, new String[] { "TzTok-Jad is the king of the Fight Caves." }, 1, false, 1 | 1 << 16),
- CHAOS_ELEMENTAL(90, new int[] { 3200 }, new String[] { "The Chaos Elemental is located in the deep Wilderness." }, 1, false, 5 | 25 << 16),
+ CHAOS_ELEMENTAL(75, new int[] { 3200 }, new String[] { "The Chaos Elemental is located in the deep Wilderness." }, 1, false, 5 | 25 << 16),
GIANT_MOLE(75, new int[] { 3340 }, new String[] { "Fighting the Giant Mole will require a light source." }, 1, false, 5 | 25 << 16),
KING_BLACK_DRAGON(75, new int[] { 50 }, new String[] { "The King Black Dragon is located in the deep wilderness." }, 1, false, 5 | 25 << 16),
COMMANDER_ZILYANA(90, new int[] { 6247 }, new String[] { "Commander Zilyana is one of the four Godwars bosses." }, 1, false, 5 | 25 << 16),
GENERAL_GRARDOOR(90, new int[] { 6260 }, new String[] { "General Grardoor is one of the four Godwars bosses." }, 1, false, 5 | 25 << 16),
KRIL_TSUTSAROTH(90, new int[] { 6203 }, new String[] { "Kril Tsutsaroth is one of the four Godwars bosses." }, 1, false, 5 | 25 << 16),
KREE_ARRA(90, new int[] { 6222 }, new String[] { "Kree'arra is one of the four Godwars bosses." }, 1, false, 5 | 25 << 16),
+ VENENATIS(75, new int[] { 8591 }, new String[] { "Venenatis is located in the deep Wilderness." }, 1, false, 5 | 25 << 16),
SKELETAL_WYVERN(70, new int[] { 3068, 3069, 3070, 3071 }, new String[] { "A skeletal wyvern requires an elemental, mirror", "or dragonfire shield." }, 72, false, 24 | 39 << 16);
static final HashMap taskMap = new HashMap<>();
diff --git a/Server/src/main/java/core/game/system/SystemManager.java b/Server/src/main/java/core/game/system/SystemManager.java
index 48685fdb3..67c942e5d 100644
--- a/Server/src/main/java/core/game/system/SystemManager.java
+++ b/Server/src/main/java/core/game/system/SystemManager.java
@@ -1,6 +1,7 @@
package core.game.system;
import core.game.system.security.EncryptionManager;
+import gui.ServerMonitor;
import rs09.game.world.GameWorld;
/**
diff --git a/Server/src/main/java/core/game/world/map/zone/impl/WildernessZone.java b/Server/src/main/java/core/game/world/map/zone/impl/WildernessZone.java
index 104b85204..bab217784 100644
--- a/Server/src/main/java/core/game/world/map/zone/impl/WildernessZone.java
+++ b/Server/src/main/java/core/game/world/map/zone/impl/WildernessZone.java
@@ -254,7 +254,7 @@ public final class WildernessZone extends MapZone {
} else if (e instanceof NPC) {
NPC n = (NPC) e;
if (n.getDefinition().hasAttackOption() && n.isAggressive()) {
- //n.setAggressive(true);
+ n.setAggressive(true);
n.setAggressiveHandler(new AggressiveHandler(n, AggressiveBehavior.WILDERNESS));
}
}
diff --git a/Server/src/main/java/core/net/packet/in/IdlePacketHandler.java b/Server/src/main/java/core/net/packet/in/IdlePacketHandler.java
index 0acb48c24..ec542a2a2 100644
--- a/Server/src/main/java/core/net/packet/in/IdlePacketHandler.java
+++ b/Server/src/main/java/core/net/packet/in/IdlePacketHandler.java
@@ -14,13 +14,14 @@ public final class IdlePacketHandler implements IncomingPacket {
@Override
public void decode(Player player, int opcode, IoBuffer buffer) {
- if (player.getDetails().getRights() != Rights.ADMINISTRATOR) {
+ /**if (player.getDetails().getRights() != Rights.ADMINISTRATOR) {
GeneralBotCreator.BotScriptPulse pulse = player.getAttribute("botting:script",null);
if(pulse != null && pulse.isRunning()){
return;
}
player.getPacketDispatch().sendLogout();
- }
+ return;
+ }*/
}
}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/api/God.kt b/Server/src/main/kotlin/api/God.kt
index 6bbeaa0d0..106ba9ad2 100644
--- a/Server/src/main/kotlin/api/God.kt
+++ b/Server/src/main/kotlin/api/God.kt
@@ -1,3 +1,4 @@
+
package api
enum class God(vararg val validItems: Int) {
diff --git a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/GreenDragonKiller.kt b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/GreenDragonKiller.kt
index 7142f2d1d..25b46b670 100644
--- a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/GreenDragonKiller.kt
+++ b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/GreenDragonKiller.kt
@@ -22,6 +22,7 @@ import rs09.game.node.entity.combat.CombatSwingHandler
import rs09.game.node.entity.combat.handlers.MagicSwingHandler
import rs09.game.node.entity.combat.handlers.MeleeSwingHandler
import rs09.game.node.entity.combat.handlers.RangeSwingHandler
+import rs09.game.world.GameWorld
import kotlin.random.Random
/**
@@ -36,13 +37,8 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
var lootDelay = 0
var offerMade = false
- var food = if (Random.nextBoolean()){
- Items.LOBSTER_379
- } else if(Random.nextBoolean()){
- Items.SWORDFISH_373
- } else {
- Items.SHARK_385
- }
+ var food = Items.SWORDFISH_373
+
var myBorders: ZoneBorders? = null
val type = when(style){
@@ -97,7 +93,7 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
State.LOOTING -> {
lootDelay = 0
- val items = AIRepository.groundItems.get(bot)
+ val items = AIRepository.groundItems[bot]
if(items.isNullOrEmpty()) {state = State.KILLING; return}
if(bot.inventory.isFull) {
if(bot.inventory.containsItem(Item(food))){
@@ -107,7 +103,7 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
}
return
}
- items.forEach {it: Item -> scriptAPI.takeNearestGroundItem(it.id)}
+ items.toTypedArray().forEach {it: Item -> scriptAPI.takeNearestGroundItem(it.id)}
}
State.TO_BANK -> {
@@ -145,7 +141,7 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
bot.inventory.clear()
state = if(bot.bank.getAmount(food) < 10)
State.TO_GE
- else
+ else
State.TO_DRAGONS
for(item in inventory)
bot.inventory.add(item)
@@ -156,28 +152,6 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
})
}
- State.BUYING_FOOD -> {
- if(!offerMade)
- {
- scriptAPI.buyFromGE(bot, food, 100)
- offerMade = true
- } else
- {
- val offer = AIRepository.getOffer(bot)
- if (offer == null) {
- offerMade = false
- } else {
- if (offer.completedAmount == offer.amount) {
- state = State.TO_DRAGONS
- offer.offerState = OfferState.REMOVED
- bot.bank.add(Item(offer.itemID, offer.completedAmount))
- bot.bank.refresh()
- scriptAPI.withdraw(food, 10)
- }
- }
- }
- }
-
State.TO_DRAGONS -> {
offerMade = false
if(bot.location.x >= 3143){
@@ -225,14 +199,19 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
State.SELL_GE -> {
scriptAPI.sellAllOnGe()
- state = State.BUYING_FOOD
+ GameWorld.Pulser.submit(object : Pulse() {
+ override fun pulse(): Boolean {
+ bot.bank.add(Item(Items.SWORDFISH_373, 100))
+ return true
+ }
+ })
+ state = State.BANKING
}
State.REFRESHING -> {
running = false
return
}
-
}
}
@@ -257,7 +236,6 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
TO_GE,
SELL_GE,
REFRESHING,
- BUYING_FOOD
}
@@ -295,4 +273,4 @@ class GreenDragonKiller(val style: CombatStyle, area: ZoneBorders? = null) : Scr
return super.canSwing(entity, victim)
}
}
-}
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceListeners.kt b/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceListeners.kt
index 870fa7e33..059cad2dd 100644
--- a/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceListeners.kt
+++ b/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceListeners.kt
@@ -321,60 +321,40 @@ class BlastFurnaceListeners : InteractionListener() {
/**The sequel to Limp Bizkits hit single, "Fix shit"*/
- on(brokenPotPipe,SCENERY,"repair"){ player, _ ->
- if(player.getSkills().getLevel(Skills.CRAFTING) >= 30){
- if(inInventory(player,Items.HAMMER_2347,1)) {
- rewardXP(player, Skills.CRAFTING, 50.0)
- BlastFurnace.potPipeBroken = false
- }
- else {
- sendMessage(player, "I need a hammer to do this!")
- }
+ on(brokenPotPipe,SCENERY,"repair"){ player, node ->
+ if(inInventory(player,Items.HAMMER_2347,1) && player.getSkills().getLevel(Skills.CRAFTING) >= 30){
+ rewardXP(player,Skills.CRAFTING, 50.0)
+ BlastFurnace.potPipeBroken = false
}else{
sendDialogue(player,"I need 30 Craft in order to do this")
}
return@on true
}
- on(brokenPumpPipe,SCENERY, "repair"){ player, _ ->
- if(player.getSkills().getLevel(Skills.CRAFTING) >= 30){
- if(inInventory(player,Items.HAMMER_2347,1)) {
- rewardXP(player, Skills.CRAFTING, 50.0)
- BlastFurnace.pumpPipeBroken = false
- }
- else {
- sendMessage(player, "I need a hammer to do this!")
- }
+ on(brokenPumpPipe,SCENERY, "repair"){ player, node ->
+ if(inInventory(player,Items.HAMMER_2347,1) && player.getSkills().getLevel(Skills.CRAFTING) >= 30){
+ rewardXP(player,Skills.CRAFTING, 50.0)
+ BlastFurnace.pumpPipeBroken = false
}else{
sendDialogue(player,"I need 30 Craft in order to do this")
}
return@on true
}
- on(brokenBelt,SCENERY,"repair"){ player, _ ->
- if(player.getSkills().getLevel(Skills.CRAFTING) >= 30){
- if(inInventory(player,Items.HAMMER_2347,1)) {
- rewardXP(player, Skills.CRAFTING, 50.0)
- BlastFurnace.beltBroken = false
- }
- else {
- sendMessage(player, "I need a hammer to do this!")
- }
+ on(brokenBelt,SCENERY,"repair"){ player, node ->
+ if(inInventory(player,Items.HAMMER_2347,1) && player.getSkills().getLevel(Skills.CRAFTING) >= 30){
+ rewardXP(player,Skills.CRAFTING, 50.0)
+ BlastFurnace.beltBroken = false
}else{
sendDialogue(player,"I need 30 Craft in order to do this")
}
return@on true
}
- on(brokenCog,SCENERY,"repair"){ player, _ ->
- if(player.getSkills().getLevel(Skills.CRAFTING) >= 30){
- if(inInventory(player,Items.HAMMER_2347,1)) {
- rewardXP(player, Skills.CRAFTING, 50.0)
- BlastFurnace.cogBroken = false
- }
- else {
- sendMessage(player, "I need a hammer to do this!")
- }
+ on(brokenCog,SCENERY,"repair"){ player, node ->
+ if(inInventory(player,Items.HAMMER_2347,1) && player.getSkills().getLevel(Skills.CRAFTING) >= 30){
+ rewardXP(player,Skills.CRAFTING, 50.0)
+ BlastFurnace.cogBroken = false
}else{
sendDialogue(player,"I need 30 Craft in order to do this")
}
diff --git a/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceZone.kt b/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceZone.kt
index 291c33ee0..7c51956f9 100644
--- a/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceZone.kt
+++ b/Server/src/main/kotlin/rs09/game/content/activity/blastfurnace/BlastFurnaceZone.kt
@@ -14,9 +14,7 @@ import core.plugin.Plugin
* operate and run its logic if there are actual players in this zone
* @author phil lips*/
-
-//Remove this once the funny dupe gets fixed
-//@Initializable
+@Initializable
class BlastFurnaceZone : MapZone("Blast Furnace Zone",true), Plugin {
var pulseStarted = false
diff --git a/Server/src/main/kotlin/rs09/game/content/activity/guild/crafting/CraftingGuildListeners.kt b/Server/src/main/kotlin/rs09/game/content/activity/guild/crafting/CraftingGuildListeners.kt
new file mode 100644
index 000000000..2e404533e
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/activity/guild/crafting/CraftingGuildListeners.kt
@@ -0,0 +1,43 @@
+package rs09.game.content.activity.guild.crafting
+
+import api.*
+import core.game.content.dialogue.FacialExpression
+import core.game.content.global.action.DoorActionHandler
+import core.game.node.entity.skill.Skills
+import org.rs09.consts.NPCs
+import rs09.game.content.dialogue.region.craftingguild.MasterCrafterDialogue
+import rs09.game.content.dialogue.region.craftingguild.TheDoorDialogues
+import rs09.game.interaction.InteractionListener
+
+/**
+ * @author bushtail
+ */
+
+class CraftingGuildListeners : InteractionListener() {
+ private val GUILD_DOOR = 2647
+ private val APRON = 1757
+ private val CAPE = 9780
+ val master = NPCs.MASTER_CRAFTER_805
+
+ override fun defineListeners() {
+ on(GUILD_DOOR, SCENERY, "open" ) { player, door ->
+ if(hasLevelStat(player, Skills.CRAFTING, 40)) {
+ if(inEquipment(player, APRON)) {
+ openDialogue(player, TheDoorDialogues(2))
+ DoorActionHandler.handleAutowalkDoor(player, door.asScenery())
+ return@on true
+ } else if(inEquipment(player, CAPE)) {
+ openDialogue(player, TheDoorDialogues(2))
+ DoorActionHandler.handleAutowalkDoor(player, door.asScenery())
+ return@on true
+ } else {
+ openDialogue(player, TheDoorDialogues(1))
+ return@on false
+ }
+ } else {
+ openDialogue(player, TheDoorDialogues(0))
+ return@on false
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/DenulthDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/DenulthDialogue.kt
new file mode 100644
index 000000000..77d49106b
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/DenulthDialogue.kt
@@ -0,0 +1,35 @@
+package rs09.game.content.dialogue.region.burthorpe
+
+import api.openDialogue
+import core.game.content.dialogue.DialoguePlugin
+import core.game.node.entity.npc.NPC
+import core.game.node.entity.player.Player
+import core.plugin.Initializable
+import org.rs09.consts.NPCs
+import rs09.game.content.quest.members.deathplateau.DenulthDialogueFile
+
+/**
+ * @author qmqz
+ */
+
+@Initializable
+class DenulthDialogue(player: Player? = null) : DialoguePlugin(player){
+
+ override fun open(vararg args: Any?): Boolean {
+ npc = args[0] as NPC
+ openDialogue(player, DenulthDialogueFile())
+ return true
+ }
+
+ override fun handle(interfaceId: Int, buttonId: Int): Boolean {
+ return true
+ }
+
+ override fun newInstance(player: Player?): DialoguePlugin {
+ return DenulthDialogue(player)
+ }
+
+ override fun getIds(): IntArray {
+ return intArrayOf(NPCs.DENULTH_1060)
+ }
+}
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/EohricDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/EohricDialogue.kt
new file mode 100644
index 000000000..5e1abad6d
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/burthorpe/EohricDialogue.kt
@@ -0,0 +1,35 @@
+package rs09.game.content.dialogue.region.burthorpe
+
+import api.openDialogue
+import core.game.content.dialogue.DialoguePlugin
+import core.game.node.entity.npc.NPC
+import core.game.node.entity.player.Player
+import core.plugin.Initializable
+import org.rs09.consts.NPCs
+import rs09.game.content.quest.members.deathplateau.EohricDialogueFile
+
+/**
+ * @author qmqz
+ */
+
+@Initializable
+class EohricDialogue(player: Player? = null) : DialoguePlugin(player){
+
+ override fun open(vararg args: Any?): Boolean {
+ npc = args[0] as NPC
+ openDialogue(player, EohricDialogueFile())
+ return true
+ }
+
+ override fun handle(interfaceId: Int, buttonId: Int): Boolean {
+ return true
+ }
+
+ override fun newInstance(player: Player?): DialoguePlugin {
+ return EohricDialogue(player)
+ }
+
+ override fun getIds(): IntArray {
+ return intArrayOf(NPCs.EOHRIC_1080)
+ }
+}
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/MasterCrafterDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/MasterCrafterDialogue.kt
new file mode 100644
index 000000000..7dc380090
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/MasterCrafterDialogue.kt
@@ -0,0 +1,62 @@
+package rs09.game.content.dialogue.region.craftingguild
+
+import api.*
+import core.game.content.dialogue.DialoguePlugin
+import core.game.content.dialogue.FacialExpression
+import core.game.content.global.Skillcape
+import core.game.node.entity.npc.NPC
+import core.game.node.entity.player.Player
+import core.game.node.entity.skill.Skills
+import core.game.node.item.Item
+import core.plugin.Initializable
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author bushtail
+ */
+
+@Initializable
+class MasterCrafterDialogue(player: Player? = null) : DialoguePlugin(player) {
+
+ override fun newInstance(player: Player) : DialoguePlugin {
+ return MasterCrafterDialogue(player)
+ }
+
+ override fun open(vararg args: Any?) : Boolean {
+ npc = args[0] as NPC
+ stage = 0
+ return true
+ }
+
+ override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
+ when(stage) {
+ 0 -> if(hasLevelStat(player, Skills.CRAFTING, 99)) {
+ player(FacialExpression.ASKING, "Hey, could I buy a Skillcape of Crafting?").also{ stage = 10 }
+ } else {
+ player(FacialExpression.ASKING,"Hey, what is that cape you're wearing? I don't recognize it.").also { stage++ }
+ }
+ 1 -> npcl(FacialExpression.FRIENDLY, "This? This is a Skillcape of Crafting. It is a symbol of my ability and standing here in the Crafting Guild. If you should ever achieve level 99 Crafting come and talk to me and we'll see if we can sort you out with one.").also{ stage = END_DIALOGUE }
+ 10 -> npcl(FacialExpression.HAPPY, "Certainly! Right after you pay me 99000 coins.").also{ stage++ }
+ 11 -> options("Okay, here you go.", "No thanks.").also{ stage++ }
+ 12 -> when(buttonId) {
+ 1 -> player(FacialExpression.FRIENDLY, "Okay, here you go.").also{ stage++ }
+ 2 -> player(FacialExpression.HALF_THINKING, "No, thanks.").also{ stage = END_DIALOGUE }
+ }
+ 13 -> if(inInventory(player, 617, 99000)) {
+ removeItem(player, Item(617, 99000), Container.INVENTORY)
+ addItem(player, 9780, 1)
+ npcl(FacialExpression.HAPPY, "There you go! Enjoy.").also{ stage = END_DIALOGUE }
+ } else {
+ npcl(FacialExpression.DISAGREE, "You don't have enough coins for a cape.").also{ stage = END_DIALOGUE }
+ }
+ 20 -> npcl(FacialExpression.DISAGREE, "Where's your brown apron? You can't come in here unless you're wearing one.").also{ stage++ }
+ 21 -> player(FacialExpression.HALF_GUILTY, "Err... I haven't got one.").also{ stage = END_DIALOGUE }
+ }
+ return true
+ }
+
+ override fun getIds() : IntArray {
+ return intArrayOf(805)
+ }
+
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TannerDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TannerDialogue.kt
new file mode 100644
index 000000000..c462f50ce
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TannerDialogue.kt
@@ -0,0 +1,49 @@
+package rs09.game.content.dialogue.region.craftingguild
+
+import core.game.content.dialogue.DialoguePlugin
+import core.game.content.dialogue.FacialExpression
+import core.game.node.entity.npc.NPC
+import core.game.node.entity.player.Player
+import core.plugin.Initializable
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author bushtail
+ */
+
+@Initializable
+class TannerDialogue(player: Player? = null) : DialoguePlugin(player) {
+
+ override fun newInstance(player: Player) : DialoguePlugin {
+ return TannerDialogue(player)
+ }
+
+ override fun open(vararg args: Any?) : Boolean {
+ npc = args[0] as NPC
+ npcl(FacialExpression.NEUTRAL, "Greetings friend. I am a manufacturer of leather.")
+ stage = 0
+ return true
+ }
+
+ override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
+ when(stage) {
+ 0 -> options("Can I buy some leather then?", "Leather is rather weak stuff.").also{ stage++ }
+ 1 -> when(buttonId) {
+ 1 -> player(FacialExpression.ASKING,"Can I buy some leather then?").also{ stage = 10 }
+ 2 -> player(FacialExpression.SUSPICIOUS, "Leather is rather weak stuff.").also { stage = 20 }
+ }
+
+ 10 -> npcl(FacialExpression.FRIENDLY, "Certainly!").also { stage = END_DIALOGUE; npc.openShop(player) }
+
+ 20 -> npcl(FacialExpression.NOD_YES, "Normal leather may be quite weak, but it's very cheap - I make it from cowhides for only 1 gp per hide - and it's so easy to craft that anyone can work with it.").also{ stage++ }
+ 21 -> npcl(FacialExpression.HALF_THINKING, "Alternatively you could try hard leather. It's not so easy to craft, but I only charge 3 gp per cowhide to prepare it, and it makes much sturdier armour.").also{ stage++ }
+ 22 -> npcl(FacialExpression.FRIENDLY, "I can also tan snake hides and dragonhides, suitable for craftinginto the highest quality armour for rangers.").also{ stage++ }
+ 23 -> player(FacialExpression.NEUTRAL, "Thanks, I'll bear it in mind.").also{ stage = END_DIALOGUE }
+ }
+ return true
+ }
+ override fun getIds() : IntArray {
+ return intArrayOf(804)
+ }
+
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TheDoorDialogues.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TheDoorDialogues.kt
new file mode 100644
index 000000000..fe369eb48
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/craftingguild/TheDoorDialogues.kt
@@ -0,0 +1,37 @@
+package rs09.game.content.dialogue.region.craftingguild
+
+import core.game.content.dialogue.FacialExpression
+import core.game.node.entity.npc.NPC
+import core.game.world.map.Location
+import rs09.game.content.activity.guild.crafting.CraftingGuildListeners
+import rs09.game.content.dialogue.DialogueFile
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author bushtail
+ */
+
+class TheDoorDialogues(val it: Int) : DialogueFile() {
+ var i = CraftingGuildListeners()
+ var n = NPC(i.master)
+ var l = Location.create(2933,3289,0)
+
+ override fun handle(interfaceId: Int, buttonId: Int) {
+ npc = n
+ when(it) {
+ 0 -> when(stage) {
+ 0 -> npcl(FacialExpression.DISAGREE, "Sorry, only experienced crafters are allowed in here. You must be level 40 or above to enter.").also{ stage = END_DIALOGUE}
+ }
+
+ 1 -> when(stage) {
+ 0 -> npcl(FacialExpression.DISAGREE, "Where's your brown apron? You can't come in here unless you're wearing one.").also{ stage = END_DIALOGUE }
+ }
+
+ 2 -> when(stage) {
+ 0 -> if(player!!.location == l) {
+ npcl(FacialExpression.FRIENDLY, "Welcome to the Guild of Master Craftsmen.").also{ stage = END_DIALOGUE }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/ZandarHorfyreDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/darkwizardstower/ZandarHorfyreDialogue.kt
similarity index 89%
rename from Server/src/main/kotlin/rs09/game/content/dialogue/ZandarHorfyreDialogue.kt
rename to Server/src/main/kotlin/rs09/game/content/dialogue/region/darkwizardstower/ZandarHorfyreDialogue.kt
index ef87e4042..f34dd4fac 100644
--- a/Server/src/main/kotlin/rs09/game/content/dialogue/ZandarHorfyreDialogue.kt
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/darkwizardstower/ZandarHorfyreDialogue.kt
@@ -1,4 +1,4 @@
-package rs09.game.content.dialogue
+package rs09.game.content.dialogue.region.darkwizardstower
import api.teleport
import core.game.content.dialogue.DialoguePlugin
@@ -10,10 +10,13 @@ import core.game.world.map.Location
import core.plugin.Initializable
import rs09.tools.END_DIALOGUE
+/**
+ * @author bushtail
+ */
@Initializable
class ZandarHorfyreDialogue(player: Player? = null) : DialoguePlugin(player) {
- override fun newInstance(player: Player): DialoguePlugin {
+ override fun newInstance(player: Player) : DialoguePlugin {
return ZandarHorfyreDialogue(player)
}
@@ -33,8 +36,7 @@ class ZandarHorfyreDialogue(player: Player? = null) : DialoguePlugin(player) {
2 -> player("No, I think I'll stay for a bit.").also{ stage = 20 }
}
- 10 -> npcl(FacialExpression.NEUTRAL,"Good! And don't forget to close the door behind you!").also{ stage++ }
- 11 -> stage = END_DIALOGUE
+ 10 -> npcl(FacialExpression.NEUTRAL,"Good! And don't forget to close the door behind you!").also{ stage = END_DIALOGUE }
20 -> npcl(FacialExpression.ANNOYED,"Actually, that wasn't an invitation. I've tried being polite, now we'll do it the hard way!").also{ teleport(player, Location.create(3217, 3177, 0), TeleportManager.TeleportType.INSTANT) }.also{ stage++ }
21 -> player(FacialExpression.ANGRY, "Zamorak curse that mage!").also{ stage++ }
diff --git a/Server/src/main/kotlin/rs09/game/content/dialogue/region/falador/ApprenticeWorkmanDialogue.kt b/Server/src/main/kotlin/rs09/game/content/dialogue/region/falador/ApprenticeWorkmanDialogue.kt
index 197313549..d53acd0fa 100644
--- a/Server/src/main/kotlin/rs09/game/content/dialogue/region/falador/ApprenticeWorkmanDialogue.kt
+++ b/Server/src/main/kotlin/rs09/game/content/dialogue/region/falador/ApprenticeWorkmanDialogue.kt
@@ -24,7 +24,7 @@ class ApprenticeWorkmanDialogue(player: Player? = null) : DialoguePlugin(player)
when(stage){
0 -> {
npc(FacialExpression.FRIENDLY, "Sorry, I haven't got time to chat.",
- "We've only just finished a collossal order of furniture",
+ "We've only just finished a colossal order of furniture",
"for the Varrock area, and already there's more work",
"coming in.").also { stage++ }
}
diff --git a/Server/src/main/kotlin/rs09/game/content/global/action/PickupHandler.kt b/Server/src/main/kotlin/rs09/game/content/global/action/PickupHandler.kt
index c480faab5..f07ac7b4b 100644
--- a/Server/src/main/kotlin/rs09/game/content/global/action/PickupHandler.kt
+++ b/Server/src/main/kotlin/rs09/game/content/global/action/PickupHandler.kt
@@ -74,9 +74,14 @@ object PickupHandler {
player.achievementDiaryManager.updateTask(player, DiaryType.KARAMJA, 2, 7, palms >= 5)
}
GroundItemManager.destroy(item)
+ /* Re-enable for bots to drop items, however
+ * this is causing NPE's and should be left disabled until bots are fixed.
+
if (item.dropper?.isArtificial == true) {
getItems(item.dropper)?.remove(item)
}
+ */
+
player.audioManager.send(Audio(2582, 10, 1))
}
return true
diff --git a/Server/src/main/kotlin/rs09/game/content/global/worldevents/holiday/christmas/GiftRollPlugin.kt b/Server/src/main/kotlin/rs09/game/content/global/worldevents/holiday/christmas/GiftRollPlugin.kt
index 3d61e59a6..4cdbd584d 100644
--- a/Server/src/main/kotlin/rs09/game/content/global/worldevents/holiday/christmas/GiftRollPlugin.kt
+++ b/Server/src/main/kotlin/rs09/game/content/global/worldevents/holiday/christmas/GiftRollPlugin.kt
@@ -18,6 +18,7 @@ import rs09.tools.stringtools.colorize
import java.time.Month
import java.util.*
+//@Initializable - uncomment this to re enable cope boxes
class GiftRollPlugin : XPGainPlugin() {
override fun run(player: Player, skill: Int, amount: Double) {
val numDaily = getDailyGifts(player)
@@ -26,7 +27,7 @@ class GiftRollPlugin : XPGainPlugin() {
if(System.currentTimeMillis() < cooldown) return
player.setAttribute("/save:christmas-cooldown", System.currentTimeMillis() + 5000L)
- if(System.currentTimeMillis() > cooldown && numDaily < 10 && RandomFunction.roll(15).also { player.debug("Rolling gift: $it") } && amount > 20) {
+ if(System.currentTimeMillis() > cooldown && numDaily < 28 && RandomFunction.roll(15).also { player.debug("Rolling gift: $it") } && amount > 20) {
incrementDailyGifts(player)
addItemOrDrop(player, Items.MYSTERY_BOX_6199)
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/BrotherKojo.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/BrotherKojo.kt
new file mode 100644
index 000000000..7dcb6ed62
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/BrotherKojo.kt
@@ -0,0 +1,108 @@
+package rs09.game.content.quest.members.clocktower
+
+import api.getAttribute
+import api.questStage
+import api.setAttribute
+import api.setQuestStage
+import core.game.content.dialogue.DialoguePlugin
+import core.game.content.dialogue.FacialExpression
+import core.game.node.entity.npc.NPC
+import core.game.node.entity.player.Player
+import core.game.node.entity.player.link.quest.QuestRepository
+import core.plugin.Initializable
+import org.rs09.consts.Items
+import org.rs09.consts.NPCs
+import rs09.game.content.quest.members.monksfriend.setQuest
+import rs09.game.content.quest.members.thefremenniktrials.cleanupAttributes
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author qmqz
+ */
+
+@Initializable
+class BrotherKojo(player: Player? = null) : DialoguePlugin(player){
+
+ override fun open(vararg args: Any?): Boolean {
+ npc = args[0] as NPC
+
+ when(questStage(player, "Clock Tower")) {
+ 0 -> player(FacialExpression.FRIENDLY,"Hello, monk.").also { stage = 0 }
+ 1, 2 -> {
+ when (getAttribute(player, "quest:clocktower-cogsplaced", 0)) {
+ 0 -> player(FacialExpression.FRIENDLY, "Hello again.").also { stage = 50 }
+ 1 -> player(FacialExpression.FRIENDLY, "I've placed a cog!").also { stage = 60 }
+ 2 -> player(FacialExpression.FRIENDLY, "Two down!").also { stage = 65 }
+ 3 -> npc(FacialExpression.FRIENDLY, "One left.").also { stage = END_DIALOGUE }
+ 4 -> player(FacialExpression.FRIENDLY, "I have replaced all the cogs!").also { stage = 100 }
+ }
+ }
+ 100 -> player(FacialExpression.FRIENDLY, "Hello again Brother Kojo.").also { stage = 400 }
+ }
+
+ return true
+ }
+
+ override fun handle(interfaceId: Int, buttonId: Int): Boolean {
+ when(stage) {
+
+ 0 -> npcl(FacialExpression.FRIENDLY, "Hello adventurer. My name is Brother Kojo. Do you happen to know the time?").also { stage++ }
+ 1 -> player(FacialExpression.SAD, "No, sorry, I don't.").also { stage++ }
+ 2 -> npcl(FacialExpression.NEUTRAL, "Exactly! This clock tower has recently broken down, and without it nobody can tell the correct time. I must fix it before the town people become too angry!").also { stage++ }
+ 3 -> npcl(FacialExpression.ASKING, "I don't suppose you could assist me in the repairs? I'll pay you for your help.").also { stage++ }
+ 4 -> options("OK old monk, what can I do?", "How much reward are we talking?", "Not now old monk.").also { stage++ }
+ 5 -> when(buttonId) {
+ 1 -> player(FacialExpression.FRIENDLY, "Ok old monk, what can I do?").also { stage = 20 }
+ 2 -> player(FacialExpression.ASKING, "So... how much reward are we talking then?").also { stage = 200 }
+ 3 -> player(FacialExpression.FRIENDLY, "Not now old monk.").also { stage = 300 }
+ }
+
+ 20 -> npc(FacialExpression.HAPPY, "Oh, thank you kind ${if (player.isMale) "sir" else "madam"}!",
+ "In the cellar below, you'll find four cogs.",
+ "They're too heavy for me, but you should be able to",
+ "carry them one at a time.").also { stage++ }
+ 21 -> npcl(FacialExpression.THINKING, "I know one goes on each floor... but I can't exactly remember which goes where specifically. Oh well, I'm sure you can figure it out fairly easily.").also { stage++}
+ 22 -> player(FacialExpression.FRIENDLY, "Well, I'll do my best.").also { stage++ }
+ 23 -> npcl(FacialExpression.HAPPY, "Thank you again! And remember to be careful, the cellar is full of strange beasts!").also {
+ stage = END_DIALOGUE
+ setQuestStage(player, "Clock Tower", 1)
+ setAttribute(player, "/save:quest:clocktower-cogsplaced", 0)
+ }
+
+ 50 -> npcl(FacialExpression.ASKING, "Oh hello, are you having trouble? The cogs are in four rooms below us. Place one cog on a pole on each of the four tower levels.").also { stage++ }
+ 51 -> player(FacialExpression.FRIENDLY, "Right, gotcha. I'll do that then.").also { stage = END_DIALOGUE }
+
+ 60 -> npcl(FacialExpression.FRIENDLY, "That's great. Come see me when you've done the other three.").also { stage = END_DIALOGUE }
+ 65 -> npc(FacialExpression.FRIENDLY, "Two to go.").also { stage = END_DIALOGUE }
+
+ 100 -> npcl(FacialExpression.FRIENDLY, "Really..? Wait, listen! Well done, well done! Yes yes yes, you've done it! You ARE clever!").also { stage++ }
+ 101 -> npcl(FacialExpression.FRIENDLY, "The townsfolk will all be able to know the correct time now! Thank you so much for all of your help! And as promised, here is your reward!").also { stage++ }
+ 102 -> {
+ end()
+ player.questRepository.getQuest("Clock Tower").finish(player)
+ player.removeAttribute("quest:clocktower-cogsplaced")
+ player.removeAttribute("quest:clocktower-blackcogplaced")
+ player.removeAttribute("quest:clocktower-redcogplaced")
+ player.removeAttribute("quest:clocktower-bluecogplaced")
+ player.removeAttribute("quest:clocktower-whitecogplaced")
+ player.removeAttribute("quest:clocktower-poisonplaced")
+ }
+
+ 200 -> npcl(FacialExpression.STRUGGLE, "Well, I'm only a monk so I'm not exactly rich, but I assure you I will give you a fair reward for the time spent assisting me in repairing the clock.").also { stage = 4 }
+
+ 300 -> npcl(FacialExpression.FRIENDLY, "OK then. Come back and let me know if you change your mind.").also { stage = END_DIALOGUE }
+
+ 400 -> npcl(FacialExpression.FRIENDLY, "Oh hello there traveller. You've done a grand job with the clock. It's just like new.").also { stage = END_DIALOGUE }
+
+ }
+ return true
+ }
+
+ override fun newInstance(player: Player?): DialoguePlugin {
+ return BrotherKojo(player)
+ }
+
+ override fun getIds(): IntArray {
+ return intArrayOf(NPCs.BROTHER_KOJO_223)
+ }
+}
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTower.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTower.kt
new file mode 100644
index 000000000..ffa566304
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTower.kt
@@ -0,0 +1,80 @@
+package rs09.game.content.quest.members.clocktower
+
+import api.addItemOrDrop
+import api.getAttribute
+import core.game.node.entity.player.Player
+import core.game.node.entity.player.link.quest.Quest
+import core.plugin.Initializable
+import org.rs09.consts.Items
+
+/**
+ * @author qmqz
+ */
+
+@Initializable
+class ClockTower : Quest("Clock Tower",36, 37, 1, 10, 0, 1, 8) {
+
+ /**
+ *todo:
+ * be able to walk through gate Id: 39 after poisoning rattos and they die
+ * figure out levers
+ * stop people from just walking through the gate left of levers
+ **/
+
+ override fun drawJournal(player: Player?, stage: Int) {
+ super.drawJournal(player, stage)
+
+ var line = 12
+ var stage = getStage(player)
+
+ when (stage) {
+ 0 -> {
+ line(player, "I can start this quest by speaking to !!Brother Kojo?? at the", line++)
+ line(player, "!!Clock Tower?? which is located !!South?? of !!Ardougne??", line++)
+ }
+
+ 1, 2 -> {
+ line(player, "I spoke to Brother Kojo at the Clock Tower South of", line++, true)
+ line(player, "Ardougne and agreed to help him repair the clock.", line++, true)
+ line(player,"To repair the clock I need to find the four coloured cogs", line++, getAttribute(player!!, "quest:clocktower-cogsplaced", 0) >= 4)
+ line(player,"and place them on the four correctly coloured spindles.", line++, getAttribute(player!!, "quest:clocktower-cogsplaced", 0) >= 4)
+ line(player, if (getAttribute(player!!, "quest:clocktower-bluecogplaced", false)) "I placed the !!Blue Cog?? on it's !!spindle??." else "I haven't placed the !!Blue Cog?? on it's !!spindle?? yet.", line++, getAttribute(player!!, "quest:clocktower-bluecogplaced", false))
+ line(player, if (getAttribute(player!!, "quest:clocktower-blackcogplaced", false)) "I placed the !!Black Cog?? on it's !!spindle??." else "I haven't placed the !!Black Cog?? on it's !!spindle?? yet.", line++, getAttribute(player!!, "quest:clocktower-blackcogplaced", false))
+ line(player, if (getAttribute(player!!, "quest:clocktower-blackwhiteplaced", false)) "I placed the !!White Cog?? on it's !!spindle??." else "I haven't placed the !!White Cog?? on it's !!spindle?? yet.", line++, getAttribute(player!!, "quest:clocktower-whitecogplaced", false))
+ line(player, if (getAttribute(player!!, "quest:clocktower-blackredplaced", false)) "I placed the !!Red Cog?? on it's !!spindle??." else "I haven't placed the !!Red Cog?? on it's !!spindle?? yet.", line++, getAttribute(player!!, "quest:clocktower-redcogplaced", false))
+ }
+
+ 100 -> {
+ line(player, "I spoke to Brother Kojo at the Clock Tower South of", line++, true)
+ line(player, "Ardougne and agreed to help him repair the clock.", line++, true)
+ line(player,"To repair the clock I need to find the four coloured cogs", line++, true)
+ line(player,"and place them on the four correctly coloured spindles.", line++, true)
+ line(player,"I placed the !!Blue Cog?? on it's !!spindle??.", line++, true)
+ line(player,"I placed the !!Black Cog?? on it's !!spindle??.", line++, true)
+ line(player,"I placed the !!White Cog?? on it's !!spindle??.", line++, true)
+ line(player,"I placed the !!Red Cog?? on it's !!spindle??.", line++, true)
+ line(player, " QUEST COMPLETE!", line++ +1)
+ }
+
+ //line(player,"", line++)
+
+ }
+ }
+
+ override fun finish(player: Player) {
+ var ln = 10
+ super.finish(player)
+ player.packetDispatch.sendString("You have completed the Clock Tower Quest!", 277, 4)
+ player.packetDispatch.sendItemZoomOnInterface(1891, 240, 277, 5)
+
+ drawReward(player,"1 Quest Point", ln++)
+ drawReward(player,"500 coins", ln++)
+
+ addItemOrDrop(player, Items.COINS_995, 500)
+
+ }
+
+ override fun newInstance(`object`: Any?): Quest {
+ return this
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTowerObjInterationDialogueFile.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTowerObjInterationDialogueFile.kt
new file mode 100644
index 000000000..28ee4e6c1
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/clocktower/ClockTowerObjInterationDialogueFile.kt
@@ -0,0 +1,30 @@
+package rs09.game.content.quest.members.clocktower
+
+import api.*
+import core.game.node.entity.player.link.TeleportManager
+import core.game.node.item.GroundItem
+import core.game.node.item.GroundItemManager
+import core.game.node.item.Item
+import org.rs09.consts.Items
+import rs09.game.content.dialogue.DialogueFile
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author qmqz
+ */
+
+class ClockTowerObjInterationDialogueFile(val it: Int) : DialogueFile() {
+
+ override fun handle(interfaceId: Int, buttonId: Int) {
+ when (it) {
+ 0 -> when (stage) {
+ 0 -> sendDialogue(player!!, "The death throes of the rats seem to have shaken the door loose of its hinges. You pick it up and go through.").also { stage++ }
+ 1 -> {
+ end()
+ //forceWalk(player!!, location(2578, 9656, 0), "clip")
+ //teleport(player!!, location(2578, 9656, 0), TeleportManager.TeleportType.INSTANT)
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DeathPlateau.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DeathPlateau.kt
new file mode 100644
index 000000000..6e09ad2fe
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DeathPlateau.kt
@@ -0,0 +1,54 @@
+package rs09.game.content.quest.members.deathplateau
+
+import api.addItemOrDrop
+import api.setAttribute
+import core.game.node.entity.player.Player
+import core.game.node.entity.player.link.quest.Quest
+import core.game.node.entity.skill.Skills
+import core.plugin.Initializable
+import org.rs09.consts.Items
+
+/**
+ * @author qmqz
+ */
+
+@Initializable
+class DeathPlateau : Quest("Death Plateau",314, 43, 1, 314, 0, 1, 80) {
+
+ override fun drawJournal(player: Player?, stage: Int) {
+ super.drawJournal(player, stage)
+
+ var line = 12
+ var stage = getStage(player)
+
+ when (stage) {
+ 0 -> {
+ line(player, "I can start this quest by speaking to !!Denulth?? who is in his", line++)
+ line(player, "tent at the !!Imperial Guard camp?? in !!Burthorpe", line++)
+ }
+
+ //line(player,"", line++)
+
+ }
+ }
+
+ override fun finish(player: Player) {
+ var ln = 10
+ super.finish(player)
+ player.packetDispatch.sendString("You have completed the Death Plateau Quest!", 277, 4)
+ player.packetDispatch.sendItemZoomOnInterface(1891, 240, 277, 5)
+
+ drawReward(player,"1 Quest Point", ln++)
+ drawReward(player,"3,000 Attack XP", ln++)
+ drawReward(player,"Some Steel Claws", ln++)
+ drawReward(player,"Ability to make Claws", ln++)
+
+ addItemOrDrop(player, Items.STEEL_CLAWS_3097, 1)
+ player.skills.addExperience(Skills.ATTACK, 3000.0)
+
+ }
+
+ override fun newInstance(`object`: Any?): Quest {
+ return this
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Dialogue_File.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Dialogue_File.kt
new file mode 100644
index 000000000..6e7774123
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Dialogue_File.kt
@@ -0,0 +1,29 @@
+package rs09.game.content.quest.members.deathplateau
+
+import api.getScenery
+import api.sendDialogue
+import core.game.content.dialogue.FacialExpression
+import core.game.content.global.action.DoorActionHandler
+import core.game.node.entity.npc.NPC
+import org.rs09.consts.NPCs
+import rs09.game.content.dialogue.DialogueFile
+
+/**
+ * @author qmqz
+ */
+
+class Death_Plateau_Door_Dialogue_File() : DialogueFile() {
+ override fun handle(interfaceId: Int, buttonId: Int) {
+ npc = NPC(NPCs.HAROLD_1078)
+ when (stage) {
+ 0 -> sendDialogue(player!!,"You knock on the door.").also { stage++ }
+ 1 -> npc(FacialExpression.FRIENDLY, "Come on in!").also { stage++ }
+ 2 -> {
+ end()
+ DoorActionHandler.handleAutowalkDoor(player, getScenery(2906, 3543, 1))
+ }
+ }
+
+ }
+}
+
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Interaction_Listener.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Interaction_Listener.kt
new file mode 100644
index 000000000..14a603eb0
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/Death_Plateau_Door_Interaction_Listener.kt
@@ -0,0 +1,27 @@
+package rs09.game.content.quest.members.deathplateau
+
+import api.getScenery
+import api.location
+import api.openDialogue
+import core.game.content.global.action.DoorActionHandler
+import org.rs09.consts.Scenery
+import rs09.game.interaction.InteractionListener
+
+/**
+ * @author qmqz
+ */
+
+class Death_Plateau_Door_Interaction_Listener : InteractionListener() {
+
+ override fun defineListeners() {
+ on(Scenery.DOOR_3747, SCENERY, "open") { player, _ ->
+ if (player.location == location(2906, 3543, 1)) {
+ openDialogue(player, Death_Plateau_Door_Dialogue_File())
+ } else {
+ DoorActionHandler.handleAutowalkDoor(player, getScenery(2906, 3543, 1))
+ }
+
+ return@on true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DenulthDialogueFile.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DenulthDialogueFile.kt
new file mode 100644
index 000000000..439633b96
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/DenulthDialogueFile.kt
@@ -0,0 +1,72 @@
+package rs09.game.content.quest.members.deathplateau
+
+import api.questStage
+import api.setQuestStage
+import core.game.content.dialogue.FacialExpression
+import core.game.node.entity.npc.NPC
+import org.rs09.consts.NPCs
+import rs09.game.content.dialogue.DialogueFile
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author qmqz
+ */
+
+class DenulthDialogueFile() : DialogueFile() {
+
+ override fun handle(interfaceId: Int, buttonId: Int) {
+ npc = NPC(NPCs.DENULTH_1060)
+
+ when(questStage(player!!, "Death Plateau")) {
+ 0 -> when (stage) {
+ 0 -> player(FacialExpression.FRIENDLY, "Hello!").also { stage++ }
+ 1 -> npc(FacialExpression.FRIENDLY, "Hello citizen, how can I help you?").also { stage++ }
+ 2 -> options("Do you have any quests for me?", "What is this place?", "You can't, thanks.").also { stage++ }
+ 3 -> when (buttonId) {
+ 1 -> player(FacialExpression.FRIENDLY, "Do you have any quests for me?").also { stage = 10 }
+ 3 -> player(FacialExpression.FRIENDLY, "You can't, thanks.").also { stage = END_DIALOGUE }
+ }
+
+ 10 -> npc(FacialExpression.FRIENDLY, "I don't know if you can help us!").also { stage++ }
+ 11 -> npcl(FacialExpression.FRIENDLY, "The trolls have taken up camp on the Death Plateau! " +
+ "They are using it to launch raids at night on the village." +
+ "We have tried to attack the camp, but the main path is heavily guarded!").also { stage++ }
+ 12 -> player(FacialExpression.ASKING, "Perhaps there is a way you can sneak up at night?").also { stage++ }
+ 13 -> npc(FacialExpression.FRIENDLY, "If there is another way, I do not know of it.").also { stage++ }
+ 14 -> npc(FacialExpression.FRIENDLY, "Do you know of such a path?").also { stage++ }
+ 15 -> options("No, but perhaps I could try and find one?", "No, sorry.").also { stage++ }
+ 16 -> when (buttonId) {
+ 1 -> player(FacialExpression.FRIENDLY, "No, but perhaps I could try and find one?").also { stage = 20 }
+ }
+
+ 20 -> npc(FacialExpression.FRIENDLY, "Citizen you would be well rewarded!").also { stage++ }
+ 21 -> npcl(FacialExpression.FRIENDLY, "If you go up to Death Plateau, be very careful as the trolls will attack you on sight!").also { stage++ }
+ 22 -> player(FacialExpression.FRIENDLY, "I'll be careful.").also { stage++ }
+ 23 -> npc(FacialExpression.FRIENDLY, "One other thing.").also { stage++ }
+ 24 -> player(FacialExpression.FRIENDLY, "What's that?").also { stage++ }
+ 25 -> npc(FacialExpression.FRIENDLY, "All of our equipment is kept in the castle on the hill.").also { stage++ }
+ 26 -> npcl(FacialExpression.FRIENDLY, "The stupid guard that was on duty last night lost the combination to the lock!" +
+ "I told the Prince that the Imperial Guard should've been in charge of security!").also { stage++ }
+ 27 -> player(FacialExpression.ASKING, "No problem, what does the combination look like?").also { stage++ }
+ 28 -> npcl(FacialExpression.FRIENDLY, "The equipment room is unlocked when the stone balls are placed in the correct order on the stone mechanism outside it." +
+ "The right order is written on a piece of paper the guard had.").also { stage++ }
+ 29 -> player(FacialExpression.FRIENDLY, "A stone what...?!").also { stage++ }
+ 30 -> npcl(FacialExpression.FRIENDLY, "Well citizen, the Prince is fond of puzzles. Why we couldn't just have a key is beyond me!").also { stage++ }
+ 31 -> player(FacialExpression.SUSPICIOUS, "I'll get on it right away!").also { stage++ }
+ 32 -> {
+ setQuestStage(player!!, "Clock Tower", 1)
+ END_DIALOGUE
+ }
+
+
+ }
+ /*
+ npc(FacialExpression.FRIENDLY, "").also { stage++ }
+ player(FacialExpression.FRIENDLY, "").also { stage++ }
+
+ npcl(FacialExpression.FRIENDLY, "").also { stage++ }
+ playerl(FacialExpression.FRIENDLY, "").also { stage++ }
+ */
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/EohricDialogueFile.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/EohricDialogueFile.kt
new file mode 100644
index 000000000..551ca75f2
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deathplateau/EohricDialogueFile.kt
@@ -0,0 +1,63 @@
+package rs09.game.content.quest.members.deathplateau
+
+import api.questStage
+import core.game.content.dialogue.FacialExpression
+import core.game.node.entity.npc.NPC
+import org.rs09.consts.NPCs
+import rs09.game.content.dialogue.DialogueFile
+import rs09.tools.END_DIALOGUE
+
+/**
+ * @author qmqz
+ */
+
+class EohricDialogueFile() : DialogueFile() {
+
+ override fun handle(interfaceId: Int, buttonId: Int) {
+ npc = NPC(NPCs.EOHRIC_1080)
+
+ when(questStage(player!!, "Death Plateau")) {
+ 0 -> when (stage) {
+ 0 -> npc(FacialExpression.ASKING, "Hello. Can I help?").also { stage++ }
+ 1 -> options("What is this place?", "That's quite an outfit.", "Goodbye.").also { stage++ }
+ 2 -> when (buttonId) {
+ 1 -> npcl(FacialExpression.FRIENDLY, "This is Burthorpe Castle, home to His Royal Highness Prince Anlaf, heir to the throne of Asgarnia.").also { stage = 10 }
+ 2 -> npcl(FacialExpression.HAPPY, "Why, thank you. I designed it myself. I've always found purple such a cheerful colour!").also { stage = 1 }
+ 3 -> player(FacialExpression.FRIENDLY, "Goodbye.").also { stage = END_DIALOGUE }
+ }
+ 10 -> npc(FacialExpression.FRIENDLY, "No doubt you're impressed.").also { stage++ }
+ 11 -> options("Where is the prince?", "Goodbye.").also { stage++ }
+ 12 -> when (buttonId) {
+ 1 -> npcl(FacialExpression.SUSPICIOUS, "I cannot disclose the prince's exact whereabouts for fear of compromising his personal safety.").also { stage = 20 }
+ 2 -> player(FacialExpression.FRIENDLY, "Goodbye.").also { stage = END_DIALOGUE }
+ }
+ 20 -> npcl(FacialExpression.FRIENDLY, "But rest assured that he is working tirelessly to maintain the safety and wellbeing of Burthorpe's people.").also { stage = 1 }
+ }
+
+ 1 -> when (stage) {
+ 0 -> player(FacialExpression.FRIENDLY, "Hi!").also { stage++ }
+ 1 -> npc(FacialExpression.FRIENDLY, "Hi, can I help?").also { stage++ }
+ 2 -> options("I'm looking for the guard that was on the last night.",
+ "Do you know of another way up Death Plateau?",
+ "No, I'm just looking around.").also { stage++ }
+ 3 -> when (buttonId) {
+ 1 -> player(FacialExpression.THINKING, "I'm looking for the guard that was on the last night.").also { stage = 10 }
+ 3 -> player(FacialExpression.FRIENDLY, "No, I'm just looking around.").also { stage = END_DIALOGUE }
+
+ 10 -> npcl(FacialExpression.FRIENDLY, "There was only one guard on last night. Harold. He's a nice lad, if a little dim.").also { stage++ }
+ 11 -> player(FacialExpression.FRIENDLY, "Do you know where he is staying?").also { stage++ }
+ 12 -> npc(FacialExpression.FRIENDLY, "Harold is staying at the Toad and Chicken.").also { stage++ }
+ 13 -> player(FacialExpression.FRIENDLY, "Thanks!").also { stage = END_DIALOGUE }
+ }
+
+ }
+ /*
+ npc(FacialExpression.FRIENDLY, "").also { stage++ }
+ player(FacialExpression.FRIENDLY, "").also { stage++ }
+
+ npcl(FacialExpression.FRIENDLY, "").also { stage++ }
+ playerl(FacialExpression.FRIENDLY, "").also { stage++ }
+ */
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/deserttreasure/DesertTreasure.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/deserttreasure/DesertTreasure.kt
index f42498ac6..e245290dc 100644
--- a/Server/src/main/kotlin/rs09/game/content/quest/members/deserttreasure/DesertTreasure.kt
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/deserttreasure/DesertTreasure.kt
@@ -1,103 +1,103 @@
-//package rs09.game.content.quest.members.deserttreasure
+package rs09.game.content.quest.members.deserttreasure
-//import core.game.node.entity.player.Player
-//import core.game.node.entity.player.link.quest.Quest
-//import core.game.node.entity.skill.Skills
-//import core.plugin.Initializable
+import core.game.node.entity.player.Player
+import core.game.node.entity.player.link.quest.Quest
+import core.game.node.entity.skill.Skills
+import core.plugin.Initializable
/**
* @author qmqz
*/
-//@Initializable
-//class DesertTreasure : Quest("Desert Treasure",15, 44, 3, 440, 0, 1, 15){
+@Initializable
+class DesertTreasure : Quest("Desert Treasure",43, 44, 3, 440, 0, 1, 15){
- //override fun drawJournal(player: Player?, stage: Int) {
- // super.drawJournal(player, stage)
- // var line = 12
+ override fun drawJournal(player: Player?, stage: Int) {
+ super.drawJournal(player, stage)
+ var line = 12
- //val stage = player?.questRepository?.getStage("Desert Treasure")!!
+ val stage = player?.questRepository?.getStage("Desert Treasure")!!
- //when (stage) {
- // 0 -> {
- // line(player,"I can start this quest by speaking to !!The Archaeologist??", line++)
- // line(player,"who is exploring the !!Bedabin Camp?? South West of the", line++)
- // line(player,"!!Shantay Pass.??", line++)
- // line(player,"To complete this quest I will need:", line++)
- // if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
- // line(player,"Level 10 Slayer", line++)
- // } else {
- // line(player,"---Level 10 Slayer/--", line++)
- // }
- // if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
- // line(player,"Level 50 Firemaking", line++)
- // }
- // if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
- // line(player,"Level 50 Magic", line++)
- // }
- // if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
- // line(player,"Level 53 Thieving", line++)
- // }
- // line(player,"I must have completed the following quests:", line++)
+ when (stage) {
+ 0 -> {
+ line(player,"I can start this quest by speaking to !!The Archaeologist??", line++)
+ line(player,"who is exploring the !!Bedabin Camp?? South West of the", line++)
+ line(player,"!!Shantay Pass.??", line++)
+ line(player,"To complete this quest I will need:", line++)
+ if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
+ line(player,"Level 10 Slayer", line++)
+ } else {
+ line(player,"---Level 10 Slayer/--", line++)
+ }
+ if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
+ line(player,"Level 50 Firemaking", line++)
+ }
+ if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
+ line(player,"Level 50 Magic", line++)
+ }
+ if (player.skills.getStaticLevel(Skills.SLAYER) < 10) {
+ line(player,"Level 53 Thieving", line++)
+ }
+ line(player,"I must have completed the following quests:", line++)
- // if (player.questRepository.isComplete("The Digsite Quest")) {
- // line(player,"---!!The digsite Quest??/--", line++)
- // } else {
- // line(player,"!!The digsite Quest??", line++)
- // }
+ if (player.questRepository.isComplete("The Digsite Quest")) {
+ line(player,"---!!The digsite Quest??/--", line++)
+ } else {
+ line(player,"!!The digsite Quest??", line++)
+ }
- // if (player.questRepository.isComplete("The Tourist Trap")) {
- // line(player,"---!!The Tourist Trap??/--", line++)
- // } else {
- // line(player,"!!The Tourist Trap??", line++)
- // }
+ if (player.questRepository.isComplete("The Tourist Trap")) {
+ line(player,"---!!The Tourist Trap??/--", line++)
+ } else {
+ line(player,"!!The Tourist Trap??", line++)
+ }
- // if (player.questRepository.isComplete("The Temple of Ikov")) {
- // line(player,"---!!The Temple of Ikov??/--", line++)
- // } else {
- // line(player,"!!The Temple of Ikov??", line++)
- // }
+ if (player.questRepository.isComplete("The Temple of Ikov")) {
+ line(player,"---!!The Temple of Ikov??/--", line++)
+ } else {
+ line(player,"!!The Temple of Ikov??", line++)
+ }
- // if (player.questRepository.isComplete("Priest In Peril")) {
- // line(player,"---!!Priest In Peril??/--", line++)
- // } else {
- // line(player,"!!Priest In Peril??", line++)
- // }
+ if (player.questRepository.isComplete("Priest In Peril")) {
+ line(player,"---!!Priest In Peril??/--", line++)
+ } else {
+ line(player,"!!Priest In Peril??", line++)
+ }
- // if (player.questRepository.isComplete("Waterfall Quest")) {
- // line(player,"---!!Waterfall Quest??/--", line++)
- // } else {
- // line(player,"!!Waterfall Quest??", line++)
- // }
+ if (player.questRepository.isComplete("Waterfall Quest")) {
+ line(player,"---!!Waterfall Quest??/--", line++)
+ } else {
+ line(player,"!!Waterfall Quest??", line++)
+ }
- // if (player.questRepository.isComplete("Troll Stronghold")) {
- // line(player,"---!!Troll Stronghold??/--", line++)
- // } else {
- // line(player,"!!Troll Stronghold??", line++)
- // }
+ if (player.questRepository.isComplete("Troll Stronghold")) {
+ line(player,"---!!Troll Stronghold??/--", line++)
+ } else {
+ line(player,"!!Troll Stronghold??", line++)
+ }
- // line(player,"", line++)
- //}
- // }
- //}
+ line(player,"", line++)
+ }
+ }
+ }
- // override fun finish(player: Player) {
- // var ln = 10
- // super.finish(player)
- // player.packetDispatch.sendString("You have completed Desert Treasure!", 277, 4)
- // player.packetDispatch.sendItemZoomOnInterface(1891, 240, 277, 5)
-//
- // drawReward(player,"3 Quest Points", ln++)
- // drawReward(player,"20,000 Magic XP", ln++)
- // drawReward(player,"Ability to use", ln++)
- // drawReward(player,"Ancient Magicks", ln)
+ override fun finish(player: Player) {
+ var ln = 10
+ super.finish(player)
+ player.packetDispatch.sendString("You have completed Desert Treasure!", 277, 4)
+ player.packetDispatch.sendItemZoomOnInterface(1891, 240, 277, 5)
- // player.skills.addExperience(Skills.MAGIC, 20000.0)
+ drawReward(player,"3 Quest Points", ln++)
+ drawReward(player,"20,000 Magic XP", ln++)
+ drawReward(player,"Ability to use", ln++)
+ drawReward(player,"Ancient Magicks", ln)
- // }
+ player.skills.addExperience(Skills.MAGIC, 20000.0)
- // override fun newInstance(`object`: Any?): Quest {
- // return this
- // }
-//}
\ No newline at end of file
+ }
+
+ override fun newInstance(`object`: Any?): Quest {
+ return this
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/monksfriend/MonkBalloonSpawner.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/monksfriend/MonkBalloonSpawner.kt
new file mode 100644
index 000000000..695751b3f
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/monksfriend/MonkBalloonSpawner.kt
@@ -0,0 +1,209 @@
+package rs09.game.content.quest.members.monksfriend
+
+import core.cache.def.impl.SceneryDefinition
+import core.game.content.activity.partyroom.PartyRoomPlugin
+import core.game.interaction.OptionHandler
+import core.game.node.Node
+import core.game.node.entity.player.Player
+import core.game.node.item.GroundItem
+import core.game.node.item.Item
+import core.game.node.scenery.Scenery
+import core.game.node.scenery.SceneryBuilder
+import core.game.system.task.Pulse
+import core.game.world.map.Location
+import core.game.world.map.RegionManager.getObject
+import core.game.world.map.RegionManager.isTeleportPermitted
+import core.plugin.Plugin
+import core.tools.RandomFunction
+import rs09.game.world.GameWorld.Pulser
+
+/**
+ * Manages the dropped party balloons.
+ * @author Kya
+ */
+class MonkBalloonSpawner : OptionHandler() {
+/**
+ * Constructs a new {@Code BalloonManager} {@Code Object}
+ */
+
+
+ @Throws(Throwable::class)
+ override fun newInstance(arg: Any): Plugin {
+ for (balloon in PartyBalloon.values()) {
+ SceneryDefinition.forId(balloon.balloonId).handlers["option:burst"] = this
+ }
+ return this
+ }
+
+ override fun handle(player: Player, node: Node, option: String): Boolean {
+ when (option) {
+ "burst" -> {
+ PartyBalloon.forId(node.id)!!.burst(player, node)
+ return true
+ }
+ }
+ return true
+ }
+
+ override fun getDestination(node: Node, n: Node): Location {
+ return n.location
+ }
+
+ /**
+ * Drops the balloons.
+ */
+ fun drop() {
+ balloons.clear()
+ Pulser.submit(object : Pulse(1) {
+ var waves = 0
+ override fun pulse(): Boolean {
+ if (waves == 0 || waves == 3 || waves == 5 || waves == 8 || waves == 10 || waves == 12 || waves == 15 || waves == 18 || waves == 20) {
+ for (i in 0..10) {
+ val balloon = balloon
+ if (balloon != null) {
+ balloons.add(balloon)
+ SceneryBuilder.add(balloon, RandomFunction.random(20, 30))
+ }
+ }
+ }
+ return ++waves > 20
+ }
+ })
+ }
+
+ /**
+ * Gets the balloon drop.
+ * @return the balloon.
+ */
+ private val balloon: Scenery?
+ get() {
+ val location = Location(2602 + RandomFunction.randomSign(RandomFunction.getRandom(8)), 3208 + RandomFunction.randomSign(RandomFunction.getRandom(6)), 0)
+ return if (!isTeleportPermitted(location) || getObject(location) != null) {
+ null
+ } else Scenery(PartyBalloon.values()[RandomFunction.random(PartyBalloon.values().size)].balloonId, location)
+ }
+ /**
+ * A party balloon.
+ * @author Vexia
+ */
+ internal enum class PartyBalloon(
+ /**
+ * The balloon id.
+ */
+ val balloonId: Int,
+ /**
+ * The popping id.
+ */
+ private val popId: Int) {
+ YELLOW(115, 123), RED(116, 124), BLUE(117, 125), GREEN(118, 126), PURPLE(119, 127), WHITE(120, 128), GREEN_BLUE(121, 129), TRI(122, 130);
+ /**
+ * Gets the balloonId.
+ * @return the balloonId
+ */
+ /**
+ * Gets the popId.
+ * @return the popId
+ */
+
+ /**
+ * Constructs a new {@Code PartyBalloon} {@Code Object}
+ * @param balloonId the balloon id.
+ * @param popId the pop id.
+ */
+
+ /**
+ * Bursts a party balloon.
+ * @param player the player.
+ * @param object the object.
+ */
+ fun burst(player: Player, balloon: Node) {
+ player.sendChat("woopsie!")
+/*
+
+ val popped = `object`.transform(popId)
+ if (!balloons.contains(`object`)) {
+ player.lock(2)
+ SceneryBuilder.remove(`object`)
+ SceneryBuilder.remove(popped)
+ player.animate(Animation.create(10017))
+ player.sendMessage("Error! Balloon not registered.")
+ return
+ }
+ player.lock(2)
+ SceneryBuilder.remove(`object`)
+ SceneryBuilder.add(popped)
+ balloons.remove(`object`)
+ player.animate(Animation.create(10017))
+
+ // Pop a party balloon
+ Pulser.submit(object : Pulse(1) {
+ var counter = 0
+ override fun pulse(): Boolean {
+ when (++counter) {
+ 1 -> {
+ SceneryBuilder.remove(popped)
+ return true
+ }
+ }
+ return false
+ }
+ })
+
+ */
+ }
+
+ /**
+ * Gets the ground item.
+ * @param location the location.
+ * @param player the player.
+ * @return the ground item.
+ */
+ private fun getGround(location: Location, player: Player): GroundItem? {
+ val item = PartyRoomPlugin.getPartyChest().toArray()[RandomFunction.random(PartyRoomPlugin.getPartyChest().itemCount())]
+ ?: return null
+ if (PartyRoomPlugin.getPartyChest().remove(item)) {
+ val dropItem: Item
+ val newamt: Int
+ if (item.amount > 1) {
+ newamt = RandomFunction.random(1, item.amount)
+ if (item.amount - newamt > 0) {
+ val newItem = Item(item.id, item.amount - newamt)
+ PartyRoomPlugin.getPartyChest().add(newItem)
+ }
+ dropItem = Item(item.id, newamt)
+ } else {
+ dropItem = item
+ }
+ return GroundItem(dropItem, location, player)
+ }
+ return null
+ }
+
+ companion object {
+ /**
+ * Gets a party balloon.
+ * @param id the id.
+ * @return the balloon.
+ */
+ fun forId(id: Int): PartyBalloon? {
+ for (balloon in values()) {
+ if (balloon.balloonId == id) {
+ return balloon
+ }
+ }
+ return null
+ }
+ }
+ }
+
+ companion object {
+ /**
+ * Gets the balloons.
+ * @return the balloons
+ */
+ /**
+ * The list of dropped balloons.
+ */
+ val balloons: MutableList = ArrayList(20)
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterListeners.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterListeners.kt
new file mode 100644
index 000000000..955974892
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterListeners.kt
@@ -0,0 +1,77 @@
+package rs09.game.content.quest.members.mountaindaughter
+
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class MountainDaughterListeners : InteractionListener(){
+
+ val rockSlide = 5847
+ val boulder = 5842
+ val tallTree = 5848
+ val rockCluster = 5849
+ val flatStoneOne = 5850
+ val flatStoneTwo = 5851
+ val shiningPool = 5897
+
+
+ val plank = Items.PLANK_960
+ val pole = Items.POLE_4494
+ val rope = Items.ROPE_954
+ val mud = Items.MUD_4490
+
+
+ override fun defineListeners() {
+
+ on(rockSlide, SCENERY,"Climb-over"){player, node ->
+
+ return@on true
+ }
+
+ on(tallTree, SCENERY,"Climb"){player, node ->
+
+ return@on true
+ }
+
+ on(shiningPool, SCENERY,"Listen-to"){ player, node ->
+
+ return@on true
+ }
+
+ on(flatStoneOne, SCENERY,"Jump-across"){ player, node ->
+
+ return@on true
+ }
+
+ on(flatStoneTwo, SCENERY,"Jump-across"){ player, node ->
+
+ return@on true
+ }
+
+ onUseWith(SCENERY,boulder,rope){player, used, with ->
+
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY,tallTree,mud){player, used, with ->
+
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY,flatStoneOne,plank){player, used, with ->
+
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY,flatStoneTwo,plank){player, used, with ->
+
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY,rockCluster,pole){player, used, with ->
+
+ return@onUseWith true
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterQuest.kt b/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterQuest.kt
new file mode 100644
index 000000000..e53e80e9f
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/content/quest/members/mountaindaughter/MountainDaughterQuest.kt
@@ -0,0 +1,44 @@
+package rs09.game.content.quest.members.mountaindaughter
+
+import core.game.content.quest.fremtrials.FremennikTrials
+import core.game.node.entity.player.Player
+import core.game.node.entity.player.link.quest.Quest
+import core.game.node.entity.skill.Skills
+import org.rs09.consts.Items
+
+class MountainDaughterQuest : Quest("Mountain Daughter",74,89,2,423,0,1,70){
+
+ class SkillRequirement(val skill: Int?, val level: Int?)
+
+ val requirements = arrayListOf()
+
+ override fun drawJournal(player: Player?, stage: Int) {
+ super.drawJournal(player, stage)
+ var line = 11
+ val started = player?.questRepository?.getStage("Mountain Daughter")!! > 0
+
+ if(!started){
+ line(player,"Requirements to complete quest:",line++)
+ line += 1
+ line(player,"Level 20 Agility",line++, player.skills.getStaticLevel(Skills.WOODCUTTING) >= 40)
+ line(player,"The ability to defeat a !!level 70 monster??",line++)
+ }
+ }
+ override fun finish(player: Player?) {
+ super.finish(player)
+ player ?: return
+ var ln = 10
+ player.packetDispatch.sendItemZoomOnInterface(Items.BEARHEAD_4502, 235, 277, 5)
+ drawReward(player, "2 Quest Points", ln++)
+ drawReward(player, "2,000 Prayer XP",ln++)
+ drawReward(player, "1,000 Attack XP", ln++)
+ drawReward(player, "A Bearhead", ln++)
+ player.skills.addExperience(Skills.PRAYER, 2000.0)
+ player.skills.addExperience(Skills.ATTACK, 1000.0)
+ player.questRepository.syncronizeTab(player)
+ }
+ override fun newInstance(`object`: Any?): Quest {
+ requirements.add(MountainDaughterQuest.SkillRequirement(Skills.AGILITY, 20))
+ return this
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/content/zone/keldagrim/KeldagrimPlugin.kt b/Server/src/main/kotlin/rs09/game/content/zone/keldagrim/KeldagrimPlugin.kt
index 770a316ae..38998fb2a 100644
--- a/Server/src/main/kotlin/rs09/game/content/zone/keldagrim/KeldagrimPlugin.kt
+++ b/Server/src/main/kotlin/rs09/game/content/zone/keldagrim/KeldagrimPlugin.kt
@@ -117,14 +117,12 @@ class BlastFurnaceDoorDialogue : DialogueFile(){
var init = true
override fun handle(componentID: Int, buttonID: Int) {
if (init) {
- //stage = if (player!!.getSkills().getLevel(Skills.SMITHING) >= 60) {
- // 100
- //}else{
- // 5
- //}
- //init = false
- //uncomment the above out when BF gets fixed.
- stage = 69
+ stage = if (player!!.getSkills().getLevel(Skills.SMITHING) >= 60) {
+ 100
+ }else{
+ 5
+ }
+ init = false
}
when(stage){
5 -> sendDialogue(player!!,"You must be Smithing Level 60 or higher in order to enter the Blast Furnace").also { stage = 10 }
@@ -146,7 +144,6 @@ class BlastFurnaceDoorDialogue : DialogueFile(){
20 -> sendDialogue(player!!,"Then get out of here!").also { stage = 40 }
}
40 -> end()
- 69 -> sendDialogue(player!!,"The Blast Furnace is temporarily closed down for maintenance.").also { end() } //Remove this line when BF gets fixed
100 -> player?.properties?.teleportLocation = Location.create(1940, 4958, 0).also { stage = 40 }
}
}
diff --git a/Server/src/main/kotlin/rs09/game/interaction/inter/FairyRingInterface.kt b/Server/src/main/kotlin/rs09/game/interaction/inter/FairyRingInterface.kt
index 800217ab5..738565883 100644
--- a/Server/src/main/kotlin/rs09/game/interaction/inter/FairyRingInterface.kt
+++ b/Server/src/main/kotlin/rs09/game/interaction/inter/FairyRingInterface.kt
@@ -110,8 +110,8 @@ class FairyRingInterface : InterfaceListener(){
val code = "${RING_1[ring1index]}${RING_2[ring2index]}${RING_3[ring3index]}"
val ring: FairyRing? = FairyRing.valueOf(code.toUpperCase())
var tile = ring?.tile
- if(ring == FairyRing.CIP){
- sendDialogue(player, "The ring seems to reject you.")
+ if(ring == FairyRing.CIP && !player.getQuestRepository().isComplete("The Fremennik Trials")){
+ sendDialogue(player, "You need to have completed The Fremennik Trials to access this fairy ring.")
}
if (ring == null || tile == null) {
val center = Location(2412, 4434, 0)
@@ -157,7 +157,7 @@ class FairyRingInterface : InterfaceListener(){
enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int = -1) {
AIQ(Location.create(2996, 3114, 0), "Asgarnia: Mudskipper Point", 15),
AIR(Location.create(2700, 3247, 0), "Islands: South of Witchaven", 16),
- AJQ(Location.create(2735, 5221, 0), "Dungeons: Dark cave south of Dorgesh-Kaann", 19),
+ AJQ(Location.create(2735, 5221, 0), "Dungeons: Dark cave south of Dorgesh-Kaan", 19), //Requires completion of "Death to the Dorgeshuun"
ALR(Location.create(3059, 4875, 0), "Other realms: Abyssal Area", 28),
AJR(Location.create(2780, 3613, 0), "Kandarin: Slayer cave south-east of Rellekka", 20),
AJS(Location.create(2500, 3896, 0), "Islands: Penguins near Miscellania", 21),
@@ -168,14 +168,14 @@ enum class FairyRing(val tile: Location?, val tip: String = "", val childId: Int
BIP(Location.create(3410, 3324, 0), "Islands: River Salve", 30),
BIQ(Location.create(3251, 3095, 0), "Kharidian Desert: Near Kalphite hive", 31),
BIS(Location.create(2635, 3266, 0), "Kandarin: Ardougne Zoo unicorns", 33),
- BJR(null, "Other Realms: Realm of the Fisher King", 36),
+ BJR(null, "Other Realms: Realm of the Fisher King", 36), //Requires completion of "Holy Grail"
BKP(Location.create(2385, 3035, 0), "Feldip Hills: South of Castle Wars", 38),
BKQ(Location.create(3041, 4532, 0), "Other realms: Enchanted Valley", 39),
BKR(Location.create(3469, 3431, 0), "Morytania: Mort Myre, south of Canifis", 40),
BLP(Location.create(2437, 5126, 0), "Dungeons: TzHaar area", 42),
- BLQ(null, "Yu'biusk", 43),//Location.create(2229, 4244, 1)
+ BLQ(null, "Yu'biusk", 43),//Location.create(2229, 4244, 1) Requires completion of "Land of the Goblins"
BLR(Location.create(2740, 3351, 0), "Kandarin: Legends' Guild", 44),
- CIP(null, "Islands: Miscellania", 46), //Location.create(2513, 3884, 0)
+ CIP(Location.create(2513, 3884, 0), "Islands: Miscellania", 46), //Requires completion of "The Fremennik Trials"
CIQ(Location.create(2528, 3127, 0), "Kandarin: North-west of Yanille", 47),
CJR(Location.create(2705, 3576, 0), "Kandarin: Sinclair Mansion", 52),
CKP(Location.create(2075, 4848, 0), "Other realms: Cosmic Entity's plane", 54),
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/CulChestItems.kt b/Server/src/main/kotlin/rs09/game/interaction/item/CulChestItems.kt
deleted file mode 100644
index 042674d99..000000000
--- a/Server/src/main/kotlin/rs09/game/interaction/item/CulChestItems.kt
+++ /dev/null
@@ -1,56 +0,0 @@
-package rs09.game.interaction.item
-
-import api.*
-import core.game.node.Node
-import core.game.node.entity.player.Player
-import core.game.node.item.GroundItemManager
-import core.game.node.item.Item
-import org.rs09.consts.Items
-import rs09.game.interaction.InteractionListener
-
-class CulChestItems: InteractionListener() {
-
- override fun defineListeners() {
-
- onEquip(Items.CLEAVER_7451){player, node ->
- alchemize(player,node)
- }
-
- onEquip(Items.MEAT_TENDERISER_7449){player, node ->
- alchemize(player,node)
- }
-
- onEquip(Items.GLOVES_7458){player, node ->
- alchemize(player,node)
- }
-
- onEquip(Items.GLOVES_7459){player, node ->
- alchemize(player,node)
- }
-
- onEquip(Items.GLOVES_7460){player, node ->
- alchemize(player,node)
- }
-
- onEquip(Items.GLOVES_7461){player,node ->
- alchemize(player,node)
- }
-
- onEquip(Items.GLOVES_7462){player, node ->
- alchemize(player,node)
- }
-
- }
-
- fun alchemize(player: Player, node: Node): Boolean{
- val amount = amountInInventory(player, node.id) + amountInEquipment(player, node.id)
- val coins = amount * itemDefinition(node.id).value
-
- removeAll(player, node.id, api.Container.INVENTORY)
- removeItem(player, node.id, api.Container.EQUIPMENT)
- addItemOrDrop(player, 995, coins)
-
- sendDialogue(player, "The item instantly alchemized itself!")
- return false //tell equip handler not to equip the gloves at all if they still even exist lel
- }
-}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/ChiselOnGranite.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/ChiselOnGranite.kt
new file mode 100644
index 000000000..999891f37
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/ChiselOnGranite.kt
@@ -0,0 +1,33 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class ChiselOnGranite : InteractionListener() {
+ override fun defineListeners() {
+ val granite = intArrayOf(Items.GRANITE_5KG_6983, Items.GRANITE_2KG_6981)
+
+ onUseWith(ITEM, granite, Items.CHISEL_1755) {player, used, _ ->
+ if (freeSlots(player) < 3) {
+ sendMessage(player, "You need four inventory slots to do this.")
+ } else {
+ if(removeItem(player, used, Container.INVENTORY)) {
+ when (used.id) {
+ Items.GRANITE_5KG_6983 -> {
+ sendMessage(player, "You chisel the 5kg granite into four smaller pieces.")
+ addItemOrDrop(player, Items.GRANITE_2KG_6981, 2)
+ addItemOrDrop(player, Items.GRANITE_500G_6979, 2)
+ }
+
+ Items.GRANITE_2KG_6981 -> {
+ sendMessage(player, "You chisel the 2kg granite into four smaller pieces.")
+ addItemOrDrop(player, Items.GRANITE_500G_6979, 4)
+ }
+ }
+ }
+ }
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/CombineCrystalKey.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/CombineCrystalKey.kt
new file mode 100644
index 000000000..184d694bd
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/CombineCrystalKey.kt
@@ -0,0 +1,17 @@
+package rs09.game.interaction.item.withitem
+
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+import api.*
+
+class CombineCrystalKey : InteractionListener() {
+ override fun defineListeners() {
+ onUseWith(ITEM, Items.LOOP_HALF_OF_A_KEY_987, Items.TOOTH_HALF_OF_A_KEY_985){player, used, with ->
+ if(removeItem(player, used, Container.INVENTORY) && removeItem(player,with,Container.INVENTORY)) {
+ addItem(player, Items.CRYSTAL_KEY_989)
+ sendMessage(player, "You join the loop half of a key and the tooth half of a key to make a crystal key.")
+ }
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/FruitSlicing.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/FruitSlicing.kt
new file mode 100644
index 000000000..854d0d409
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/FruitSlicing.kt
@@ -0,0 +1,55 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import core.game.node.item.Item
+import org.rs09.consts.Items
+import org.rs09.consts.Items.LEMON_CHUNKS_2104
+import org.rs09.consts.Items.LIME_2120
+import org.rs09.consts.Items.LIME_CHUNKS_2122
+import org.rs09.consts.Items.LIME_SLICES_2124
+import rs09.game.content.dialogue.DialogueFile
+import rs09.game.interaction.InteractionListener
+
+class FruitSlicing : InteractionListener() {
+
+ override fun defineListeners() {
+ val fruits = Fruit.values().map { it.base.id } .toIntArray()
+
+ onUseWith(ITEM, fruits, Items.KNIFE_946) {player, used, with ->
+ val fruit = Fruit.forBase(used.id) ?: return@onUseWith false
+
+ if ((fruit == Fruit.BANANA || fruit == Fruit.LEMON)) {
+ if (removeItem(player, used.asItem(), Container.INVENTORY)) {
+ lock(player, 2)
+ animate(player, 1192)
+ addItem(player, fruit.sliced.id, fruit.sliced.amount)
+ sendMessage(player, "You deftly chop the " + fruit.name.toLowerCase() + " into slices.")
+ }
+ } else {
+ //TODO: Below Dialogue is still located in FruitCuttingDialogue.java. Convert to DialogueFile and make this not so garbage.
+ openDialogue(player,31237434, fruit)
+ }
+ return@onUseWith true
+ }
+ }
+
+ enum class Fruit(val base: Item, val diced: Item?, val sliced: Item) {
+ PINEAPPLE(Item(2114), Item(2116), Item(2118, 4)),
+ BANANA(Item(1963), null, Item(3162)),
+ LEMON(Item(2102), Item(LEMON_CHUNKS_2104), Item(2106)),
+ LIME(Item(LIME_2120), Item(LIME_CHUNKS_2122), Item(LIME_SLICES_2124)),
+ ORANGE(Item(2108), Item(2110), Item(2112));
+
+ companion object {
+ val fruitMap = values().map { it.base.id to it }.toMap()
+ /**
+ * Method used to get the fruit for the base item.
+ * @param item the item.
+ * @return the fruit.
+ */
+ fun forBase(item: Int): Fruit? {
+ return fruitMap[item]
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/GroundCogs.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/GroundCogs.kt
new file mode 100644
index 000000000..af62a8010
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/GroundCogs.kt
@@ -0,0 +1,136 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import core.game.node.entity.npc.NPC
+import core.game.node.item.GroundItem
+import core.game.node.item.Item
+import core.game.world.map.Location
+import core.game.world.map.path.Pathfinder
+import org.rs09.consts.Items
+import org.rs09.consts.NPCs
+import org.rs09.consts.Scenery
+import rs09.game.content.quest.members.clocktower.ClockTowerObjInterationDialogueFile
+import rs09.game.interaction.InteractionListener
+
+class GroundCogs : InteractionListener() {
+
+ override fun defineListeners() {
+ on(Items.BLACK_COG_21, GROUNDITEM, "take") { player, groundItem ->
+ if (!inInventory(player, Items.BUCKET_OF_WATER_1929, 1) && !inEquipment(player, Items.ICE_GLOVES_1580)){
+ sendDialogue(player, "The cog is red hot from the flames. You cannot pick it up.")
+ } else if(hasSpaceFor(player, Item(Items.BLACK_COG_21)) && getAttribute(player, "quest:clocktower-blackcogcooled", false)) {
+ addItem(player, Items.BLACK_COG_21)
+ removeGroundItem(groundItem as GroundItem)
+ setAttribute(player, "/save:quest:clocktower-blackcogcooled", false)
+ setQuestStage(player, "Clock Tower", 2)
+ } else if(hasSpaceFor(player, Item(Items.BLACK_COG_21)) && (inInventory(player, Items.BUCKET_OF_WATER_1929, 1) || inEquipment(player, Items.ICE_GLOVES_1580)) && !getAttribute(player, "quest:clocktower-blackcogcooled", false)) {
+ if(!inEquipment(player, Items.ICE_GLOVES_1580) && removeItem(player, Items.BUCKET_OF_WATER_1929)) {
+ sendDialogue(player!!, "You pour water over the cog. It quickly cools down enough to take.")
+ addItem(player!!, Items.BUCKET_1925)
+ addItem(player!!, Items.BLACK_COG_21)
+ setQuestStage(player!!, "Clock Tower", 2)
+ setAttribute(player, "/save:quest:clocktower-blackcogcooled", true)
+ removeGroundItem(groundItem as GroundItem)
+ } else if(inEquipment(player, Items.ICE_GLOVES_1580) && !inInventory(player, Items.BUCKET_OF_WATER_1929)) {
+ sendDialogue(player, "You grab the cog with your ice gloves. It quickly cools down enough to take.")
+ setAttribute(player, "/save:quest:clocktower-blackcogcooled", true)
+ removeGroundItem(groundItem as GroundItem)
+ addItem(player, Items.BLACK_COG_21)
+ setQuestStage(player, "Clock Tower", 2)
+ }
+ }
+ return@on true
+ }
+
+ onUseWith(SCENERY, Items.BLACK_COG_21, Scenery.CLOCK_SPINDLE_30) { player, _, _ ->
+ sendMessage(player, "The cog fits perfectly.")
+ removeItem(player, Items.BLACK_COG_21)
+ setAttribute(player,"/save:quest:clocktower-blackcogplaced", true)
+ player.incrementAttribute("/save:quest:clocktower-cogsplaced")
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.BLUE_COG_22, Scenery.CLOCK_SPINDLE_32) { player, _, _ ->
+ sendMessage(player, "The cog fits perfectly.")
+ removeItem(player, Items.BLUE_COG_22)
+ setAttribute(player,"/save:quest:clocktower-bluecogplaced", true)
+ player.incrementAttribute("/save:quest:clocktower-cogsplaced")
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.WHITE_COG_20, Scenery.CLOCK_SPINDLE_31) { player, _, _ ->
+ sendMessage(player, "The cog fits perfectly.")
+ removeItem(player, Items.WHITE_COG_20)
+ setAttribute(player,"/save:quest:clocktower-whitecogplaced", true)
+ player.incrementAttribute("/save:quest:clocktower-cogsplaced")
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.RED_COG_23, Scenery.CLOCK_SPINDLE_29) { player, _, _ ->
+ sendMessage(player, "The cog fits perfectly.")
+ removeItem(player, Items.RED_COG_23)
+ setAttribute(player,"/save:quest:clocktower-redcogplaced", true)
+ player.incrementAttribute("/save:quest:clocktower-cogsplaced")
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.RAT_POISON_24, Scenery.FOOD_TROUGH_40) { player, _, _ ->
+ val loc = location(2579, 9656, 0)
+
+ sendMessage(player, "The rats swarm towards the poisoned food...")
+ sendMessage(player, "... and devour it hungrily.")
+ sendMessage(player, "You see them smashing against the gates in a panic.")
+ sendMessage(player, "They seem to be dying.")
+ removeItem(player, Items.RAT_POISON_24)
+ setAttribute(player,"/save:quest:clocktower-poisonplaced", true)
+ runTask(player, 1) {
+ val rattos = findLocalNPCs(player, intArrayOf(NPCs.DUNGEON_RAT_224))
+ rattos.forEach{rat ->
+ if(rat.location.withinDistance(loc,20)) {
+ var a = 0
+ var b = 0
+ var c = false
+
+ for(rat in rattos) {
+ Pathfinder.find(rat.location, location(loc.x + a, loc.y + b, loc.z), true, Pathfinder.SMART).walk(rat)
+ a++
+ if (a == 4) {
+ c = true
+ a = 0
+ }
+ if (c) {
+ b = 1
+ }
+ }
+ runTask(rat, 15) {
+ rat.startDeath(player)
+ }
+ }
+ }
+ }
+ return@onUseWith true
+ }
+
+ val levers = intArrayOf(Scenery.LEVER_33, Scenery.LEVER_34)
+ on(levers, SCENERY, "pull") { player, node ->
+ if (node.asScenery().location.equals(2591, 9661, 0)) {
+ setAttribute(player, "clocktower:raiseLowerLever", true)
+ //also opens door id 37, location: 2595, 9657, 0
+ }
+
+ if (node.asScenery().location.equals(2593, 9661, 0)) {
+ setAttribute(player, "clocktower:lowerUpperLever", true)
+ }
+ return@on true
+ }
+
+ on(Scenery.GATE_39, SCENERY, "go-through") { player, node ->
+ if (node.asScenery().location.equals(2579, 9656, 0) && player.location.equals(2579, 9656, 0)) {
+ openDialogue(player, ClockTowerObjInterationDialogueFile(0))
+ }
+ return@on true
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HiltOnBlade.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HiltOnBlade.kt
new file mode 100644
index 000000000..d85d52422
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HiltOnBlade.kt
@@ -0,0 +1,22 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import core.tools.StringUtils
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class HiltOnBlade : InteractionListener() {
+ override fun defineListeners() {
+ val HILTS = intArrayOf(Items.ARMADYL_HILT_11702, Items.ZAMORAK_HILT_11708, Items.BANDOS_HILT_11704, Items.SARADOMIN_HILT_11706)
+
+ onUseWith(ITEM, HILTS, Items.GODSWORD_BLADE_11690) {player, used, with ->
+ if (removeItem(player, used.asItem(), Container.INVENTORY) && removeItem(player, with.asItem(), Container.INVENTORY)) {
+ val godsword = if(used.id > 11690) used.id - 8 else with.id - 8
+ addItem(player, godsword)
+ sendMessage(player, "You attach the hilt to the blade and make a ${if(StringUtils.isPlusN(getItemName(godsword))) "an" else "a"} ${getItemName(godsword)}.")
+ }
+
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/KeyOnPirateChest.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/KeyOnPirateChest.kt
new file mode 100644
index 000000000..feb26428f
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/KeyOnPirateChest.kt
@@ -0,0 +1,22 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import org.rs09.consts.Items
+import org.rs09.consts.Scenery
+import rs09.game.interaction.InteractionListener
+
+class KeyOnPirateChest : InteractionListener() {
+ override fun defineListeners() {
+ onUseWith(SCENERY, Items.CHEST_KEY_432, Scenery.CHEST_2079){player, used, with ->
+ val scenery = with as core.game.node.scenery.Scenery
+ if(removeItem(player, used, Container.INVENTORY)){
+ replaceScenery(scenery, 2080, 3)
+ addItemOrDrop(player, Items.PIRATE_MESSAGE_433)
+ sendMessage(player, "You unlock the chest.")
+ sendMessage(player, "All that's in the chest is a message...")
+ sendMessage(player, "You take the message from the chest.")
+ }
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/OilStillListeners.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/OilStillListeners.kt
new file mode 100644
index 000000000..f4eaaaa2c
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/OilStillListeners.kt
@@ -0,0 +1,98 @@
+package rs09.game.interaction.item.withitem
+
+import api.*
+import core.game.node.entity.player.Player
+import org.rs09.consts.Items
+import org.rs09.consts.Scenery
+import rs09.game.interaction.InteractionListener
+
+class OilStillListeners : InteractionListener() {
+ override fun defineListeners() {
+ val flowers = (Items.FLOWERS_2460..Items.FLOWERS_2477).toIntArray()
+ val stills = intArrayOf(*getChildren(5908), 5909)
+ val fillableItems = mapOf(
+ Items.OIL_LAMP_4525 to Items.OIL_LAMP_4522,
+ Items.OIL_LANTERN_4535 to Items.OIL_LANTERN_4537,
+ Items.BULLSEYE_LANTERN_4546 to Items.BULLSEYE_LANTERN_4548,
+ Items.SAPPHIRE_LANTERN_4700 to Items.SAPPHIRE_LANTERN_4701
+ )
+
+ onUseWith(ITEM, flowers, Items.ANCHOVY_OIL_11264) { player, used, with ->
+ if (removeItem(player, used, Container.INVENTORY)) {
+ replaceSlot(player, with.asItem().slot, Items.IMP_REPELLENT_11262.asItem())
+ sendMessage(player, "You mix the flower petals with the anchovy oil to make a very strange-smelling concoction.")
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.SWAMP_TAR_1939, *stills) {player, used, _ ->
+ if(checkStillEmpty(player)){
+ removeItem(player, used)
+ setVarbit(player, 425, 4, 2, save = true)
+ sendMessage(player, "You refine some swamp tar into lamp oil.")
+ } else {
+ sendStillFull(player)
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, fillableItems.keys.toIntArray(), *stills){player, used, _ ->
+ when {
+ checkStillEmpty(player) -> sendMessage(player, "There is no oil in the sill.")
+ getStillState(player) == 2 -> {
+ val replacement = fillableItems[used.id]?.asItem() ?: return@onUseWith false
+ replaceSlot(player, used.asItem().slot, replacement)
+ setVarbit(player, 425, 4, 0)
+ sendMessage(player, "You fill the ${replacement.name.toLowerCase()} with oil.")
+ }
+ else -> sendMessage(player, "There is refined imp repellent in this still, not lamp oil.")
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.IMP_REPELLENT_11262, *stills){player, used, _ ->
+ when {
+ checkStillEmpty(player) -> {
+ replaceSlot(player, used.asItem().slot, Items.VIAL_229.asItem())
+ sendMessage(player, "You refine some imp repellent.")
+ setVarbit(player, 425, 4, 4)
+ }
+ else -> sendStillFull(player)
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(SCENERY, Items.BUTTERFLY_JAR_10012, *stills){player, used, _ ->
+ when {
+ checkStillEmpty(player) -> sendMessage(player, "There is no refined imp repellent in the still.")
+ getStillState(player) == 2 -> {
+ replaceSlot(player, used.asItem().slot, Items.IMPLING_JAR_11260.asItem())
+ setVarbit(player, 425, 4, 0)
+ sendMessage(player, "You turn the butterfly jar into an impling jar.")
+ }
+ else -> sendMessage(player, "There is lamp oil in this still, not refined imp repellent.")
+ }
+ return@onUseWith true
+ }
+ }
+
+ private fun checkStillEmpty(player: Player) : Boolean {
+ val stillState = getStillState(player)
+ return stillState == 0
+ }
+
+ private fun sendStillFull(player: Player) {
+ val stillState = getStillState(player)
+
+ if(stillState != 0) {
+ when(stillState) {
+ 2 -> sendMessage(player, "There is already lamp oil in the still.")
+ 4 -> sendMessage(player, "There is already imp repellent in the still.")
+ }
+ }
+ }
+
+ private fun getStillState(player: Player): Int {
+ return getVarbitValue(player, 425, 4)
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SardineSeasoner.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SardineSeasoner.kt
new file mode 100644
index 000000000..cef852817
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SardineSeasoner.kt
@@ -0,0 +1,19 @@
+package rs09.game.interaction.item.withitem
+
+import api.addItem
+import api.removeItem
+import api.sendDialogue
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class SardineSeasoner : InteractionListener() {
+ override fun defineListeners() {
+ onUseWith(ITEM, Items.DOOGLE_LEAVES_1573, Items.RAW_SARDINE_327) {player, used, with ->
+ if(removeItem(player, used.asItem()) && removeItem(player, with.asItem())){
+ addItem(player, Items.DOOGLE_SARDINE_1552)
+ sendDialogue(player, "You rub the doogle leaves over the sardine.")
+ }
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SilkRumListener.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SilkRumListener.kt
new file mode 100644
index 000000000..457e41748
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SilkRumListener.kt
@@ -0,0 +1,17 @@
+package rs09.game.interaction.item.withitem
+
+import api.asItem
+import api.replaceSlot
+import api.sendMessage
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class SilkRumListener : InteractionListener() {
+ override fun defineListeners() {
+ onUseWith(ITEM, Items.KARAMJAN_RUM_431, Items.SILK_950){player, _, with ->
+ replaceSlot(player, with.asItem().slot, Items.CLEANING_CLOTH_3188.asItem())
+ sendMessage(player, "You pour some of the Karamjan rum over the silk.")
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SkullSceptreCombiner.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SkullSceptreCombiner.kt
new file mode 100644
index 000000000..08db102bf
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/SkullSceptreCombiner.kt
@@ -0,0 +1,35 @@
+package rs09.game.interaction.item.withitem
+
+import api.addItem
+import api.removeItem
+import api.sendDialogue
+import org.rs09.consts.Items
+import rs09.game.interaction.InteractionListener
+
+class SkullSceptreCombiner : InteractionListener() {
+ override fun defineListeners() {
+ onUseWith(ITEM, Items.LEFT_SKULL_HALF_9008, Items.RIGHT_SKULL_HALF_9007) {player, used, with ->
+ if(removeItem(player, used.asItem()) && removeItem(player, with.asItem())){
+ addItem(player, Items.STRANGE_SKULL_9009)
+ sendDialogue(player, "The two halves of the skull fit perfectly.")
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(ITEM, Items.BOTTOM_OF_SCEPTRE_9011, Items.TOP_OF_SCEPTRE_9010) {player, used, with ->
+ if(removeItem(player, used.asItem()) && removeItem(player, with.asItem())){
+ addItem(player, Items.RUNED_SCEPTRE_9012)
+ sendDialogue(player, "The two halves of the sceptre fit perfectly.")
+ }
+ return@onUseWith true
+ }
+
+ onUseWith(ITEM, Items.RUNED_SCEPTRE_9012, Items.STRANGE_SKULL_9009) {player, used, with ->
+ if(removeItem(player, used.asItem()) && removeItem(player, with.asItem())){
+ addItem(player, Items.SKULL_SCEPTRE_9013)
+ sendDialogue(player,"The skull fits perfectly on top of the sceptre.")
+ }
+ return@onUseWith true
+ }
+ }
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withobject/WaterSourceListener.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/WaterSourceListener.kt
index 03834186d..6c0be65fc 100644
--- a/Server/src/main/kotlin/rs09/game/interaction/item/withobject/WaterSourceListener.kt
+++ b/Server/src/main/kotlin/rs09/game/interaction/item/withobject/WaterSourceListener.kt
@@ -2,6 +2,7 @@ package rs09.game.interaction.item.withobject
import api.*
import core.game.node.entity.player.link.diary.DiaryType
+import core.game.system.task.Pulse
import core.game.world.update.flag.context.Animation
import org.rs09.consts.Items
import rs09.game.interaction.InteractionListener
@@ -35,14 +36,17 @@ class WaterSourceListener : InteractionListener() {
player.achievementDiaryManager.getDiary(DiaryType.FALADOR).updateTask(player, 0, 7, true)
}
- runTask(player, 1){
- if(removeItem(player, used))
- {
- animate(player, animation)
- sendMessage(player, formatMsgText(used.name, vessel.fillMsg))
- addItemOrDrop(player, vessel.output)
+ player.pulseManager.run(object : Pulse(1){
+ override fun pulse(): Boolean {
+ if(removeItem(player, used.id))
+ {
+ animate(player, animation)
+ sendMessage(player, formatMsgText(used.name, vessel.fillMsg))
+ addItemOrDrop(player, vessel.output)
+ }
+ return !vessel.autofill || amountInInventory(player, used.id) == 0
}
- }
+ })
return@onUseWith true
}
@@ -69,7 +73,7 @@ class WaterSourceListener : InteractionListener() {
return sb.toString()
}
- internal enum class WaterVessel(val inputs: IntArray, val output: Int, val wellable: Boolean = false, val fillMsg: String = "You fill the @.")
+ internal enum class WaterVessel(val inputs: IntArray, val output: Int, val wellable: Boolean = false, val autofill: Boolean = true, val fillMsg: String = "You fill the @.")
{
BUCKET(
inputs = intArrayOf(Items.BUCKET_1925),
@@ -78,7 +82,7 @@ class WaterSourceListener : InteractionListener() {
),
VIAL(
inputs = intArrayOf(Items.VIAL_229),
- output = Items.VIAL_OF_WATER_227
+ output = Items.VIAL_OF_WATER_227,
),
JUG(
inputs = intArrayOf(Items.JUG_1935),
@@ -88,14 +92,8 @@ class WaterSourceListener : InteractionListener() {
inputs = intArrayOf(Items.BOWL_1923),
output = Items.BOWL_OF_WATER_1921
),
- CLAY(
- inputs = intArrayOf(Items.CLAY_434),
- output = Items.SOFT_CLAY_1761,
- wellable = false,
- fillMsg = "You mix the clay and water. You now have some soft, workable clay."
- ),
WATERING_CAN(
- inputs = intArrayOf(Items.WATERING_CAN1_5333, Items.WATERING_CAN2_5334, Items.WATERING_CAN3_5335, Items.WATERING_CAN4_5336, Items.WATERING_CAN5_5337, Items.WATERING_CAN6_5338, Items.WATERING_CAN7_5339),
+ inputs = intArrayOf(Items.WATERING_CAN_5331,Items.WATERING_CAN1_5333, Items.WATERING_CAN2_5334, Items.WATERING_CAN3_5335, Items.WATERING_CAN4_5336, Items.WATERING_CAN5_5337, Items.WATERING_CAN6_5338, Items.WATERING_CAN7_5339),
output = Items.WATERING_CAN8_5340
),
WATER_SKIN(
diff --git a/Server/src/main/kotlin/rs09/game/interaction/object/WildernessObeliskListener.kt b/Server/src/main/kotlin/rs09/game/interaction/object/WildernessObeliskListener.kt
new file mode 100644
index 000000000..d857f4ea3
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/interaction/object/WildernessObeliskListener.kt
@@ -0,0 +1,97 @@
+package rs09.game.interaction.`object`
+
+import core.game.node.Node
+import core.game.node.entity.player.link.TeleportManager
+import core.game.node.scenery.Scenery
+import core.game.node.scenery.SceneryBuilder
+import core.game.system.task.Pulse
+import core.game.world.map.Location
+import core.game.world.map.RegionManager.getLocalPlayersMaxNorm
+import core.game.world.map.RegionManager.getRegionChunk
+import core.game.world.update.flag.chunk.GraphicUpdateFlag
+import core.game.world.update.flag.context.Graphics
+import org.rs09.consts.Scenery.OBELISK_14825
+import org.rs09.consts.Scenery.OBELISK_14826
+import org.rs09.consts.Scenery.OBELISK_14827
+import org.rs09.consts.Scenery.OBELISK_14828
+import org.rs09.consts.Scenery.OBELISK_14829
+import org.rs09.consts.Scenery.OBELISK_14830
+import org.rs09.consts.Scenery.OBELISK_14831
+import rs09.game.interaction.InteractionListener
+import rs09.game.system.SystemLogger
+import rs09.game.world.GameWorld
+import java.util.*
+
+/**
+ * Interaction listener for the Wilderness Obelisks
+ * @author Woah
+ */
+private val OBELISKS: HashMap = hashMapOf(
+ Pair(OBELISK_14829, Location(3156, 3620, 0)), // Level 13
+ Pair(OBELISK_14830, Location(3219, 3656, 0)), // Level 19
+ Pair(OBELISK_14827, Location(3035, 3732, 0)), // Level 27
+ Pair(OBELISK_14828, Location(3106, 3794, 0)), // Level 35
+ Pair(OBELISK_14826, Location(2980, 3866, 0)), // Level 44
+ Pair(OBELISK_14831, Location(3307, 3916, 0)) // Level 50
+)
+private val REPLACEMENT_OBELISK = OBELISK_14825
+private val OBELISK_TELEPORT_AUDIO = 204
+private val OBELISK_TELEPORT_GFX = 342
+private val random = Random()
+
+class WildernessObeliskListener : InteractionListener() {
+
+ override fun defineListeners() {
+
+ on(OBELISKS.keys.toIntArray(), SCENERY, "activate") { player, node ->
+ val selectedObelisk = OBELISKS[node.id]
+ if (selectedObelisk != null) {
+ val obelisks = getSurroundingObeliskScenery(node, selectedObelisk)
+ obelisks.forEach { obj -> // Replace the scenery with the animated obelisk object
+ SceneryBuilder.replace(obj, obj.transform(REPLACEMENT_OBELISK), 6)
+ }
+ player.audioManager.send(OBELISK_TELEPORT_AUDIO)
+ GameWorld.Pulser.submit(object : Pulse(6, player) {
+ override fun pulse(): Boolean {
+ if (delay == 1) {
+ // Send the graphic in a 3x3 square
+ selectedObelisk.get3x3Tiles().forEach {
+ getRegionChunk(it).flag(GraphicUpdateFlag(Graphics.create(OBELISK_TELEPORT_GFX), it))
+ }
+ return true
+ }
+ // Choose new location to teleport players to
+ val newObeliskLoc = OBELISKS.random()
+
+ // Get all the players in a 3x3 square
+ for (player in getLocalPlayersMaxNorm(selectedObelisk, 1)) {
+ val surroundingLoc = newObeliskLoc.value.get3x3Tiles()
+ player.packetDispatch.sendMessage("Ancient magic teleports you somewhere in the wilderness.")
+ player.teleporter.send(surroundingLoc.random(), TeleportManager.TeleportType.OBELISK, 2)
+ }
+ super.setDelay(1)
+ return false
+ }
+
+ })
+ return@on true
+ } else {
+ SystemLogger.logErr("Selected Obelisk is null!")
+ return@on true
+ }
+ }
+ }
+
+ // Retrieves the scenery at the four corners of the Obelisk square
+ private fun getSurroundingObeliskScenery(node: Node, selectedObelisk: Location): Array {
+ return arrayOf(
+ Scenery(node.id, Location(selectedObelisk.x - 5 / 2, selectedObelisk.y - 5 / 2, 0)),
+ Scenery(node.id, Location(selectedObelisk.x + 5 / 2, selectedObelisk.y - 5 / 2, 0)),
+ Scenery(node.id, Location(selectedObelisk.x - 5 / 2, selectedObelisk.y + 5 / 2, 0)),
+ Scenery(node.id, Location(selectedObelisk.x + 5 / 2, selectedObelisk.y + 5 / 2, 0))
+ )
+ }
+
+ // Helper random method
+ private fun Map.random(): Map.Entry = entries.elementAt(random.nextInt(size))
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/node/entity/player/info/login/PlayerSaveParser.kt b/Server/src/main/kotlin/rs09/game/node/entity/player/info/login/PlayerSaveParser.kt
index c972d77e0..ca9733392 100644
--- a/Server/src/main/kotlin/rs09/game/node/entity/player/info/login/PlayerSaveParser.kt
+++ b/Server/src/main/kotlin/rs09/game/node/entity/player/info/login/PlayerSaveParser.kt
@@ -16,6 +16,7 @@ import org.json.simple.parser.JSONParser
import rs09.ServerConstants
import rs09.game.node.entity.skill.farming.CompostBins
import rs09.game.node.entity.skill.farming.FarmingPatch
+import rs09.game.world.GameWorld
import rs09.game.system.SystemLogger
import java.io.FileReader
import java.util.*
@@ -387,14 +388,6 @@ class PlayerSaveParser(val player: Player) {
player.skills.parse(skillData)
player.skills.experienceGained = saveFile!!["totalEXP"].toString().toDouble()
player.skills.experienceMutiplier = saveFile!!["exp_multiplier"].toString().toDouble()
- if (GameWorld.settings?.default_xp_rate != 5.0) {
- player.skills.experienceMutiplier = GameWorld.settings?.default_xp_rate!!
- }
- val divisor: Double
- if(player.skills.experienceMutiplier >= 10 && !player.attributes.containsKey("permadeath")){ //exclude permadeath HCIMs from XP squish
- divisor = player.skills.experienceMutiplier / 5.0
- player.skills.correct(divisor)
- }
if (saveFile!!.containsKey("milestone")) {
val milestone: JSONObject = saveFile!!["milestone"] as JSONObject
player.skills.combatMilestone = (milestone.get("combatMilestone")).toString().toInt()
diff --git a/Server/src/main/kotlin/rs09/game/node/entity/player/info/stats/StatsCommandSet.kt b/Server/src/main/kotlin/rs09/game/node/entity/player/info/stats/StatsCommandSet.kt
index 69d9a7e8b..0d76e6625 100644
--- a/Server/src/main/kotlin/rs09/game/node/entity/player/info/stats/StatsCommandSet.kt
+++ b/Server/src/main/kotlin/rs09/game/node/entity/player/info/stats/StatsCommandSet.kt
@@ -27,7 +27,7 @@ val MITHRIL_DRAGON_IDS = intArrayOf(NPCs.MITHRIL_DRAGON_5363, NPCs.MITHRIL_DRAGO
val SKELETAL_WYVERN_IDS = intArrayOf(NPCs.SKELETAL_WYVERN_3068, NPCs.SKELETAL_WYVERN_3069, NPCs.SKELETAL_WYVERN_3070, NPCs.SKELETAL_WYVERN_3071)
val SPACER = " ";
-val NUM_PAGES = 3
+val NUM_PAGES = 4
fun sendStats(player: Player, other: Player, page: Int){
prepareInterface(player, other, page)
@@ -41,7 +41,7 @@ fun sendStats(player: Player, other: Player, page: Int){
68 -> sendLine(player,"Medium Clues: ${other.treasureTrailManager.completedClues[1]}",i)
69 -> sendLine(player,"Hard Clues: ${other.treasureTrailManager.completedClues[2]}",i)
70 -> sendLine(player,SPACER,i)
- 71 -> sendLine(player,"Slayer Tasks: ${other.slayer.totalTasks}",i)
+ 71 -> sendLine(player,"Slayer Tasks: ${other.slayer.flags.completedTasks}",i)
72 -> sendLine(player,"Quest Points: ${other.questRepository.points}",i)
73 -> sendLine(player,"Ironman Mode: ${other.ironmanManager.mode.name.toLowerCase()}",i)
74 -> sendLine(player,"Deaths: ${other.getAttribute("$STATS_BASE:$STATS_DEATHS",0)}",i)
@@ -138,6 +138,40 @@ fun sendStats(player: Player, other: Player, page: Int){
else -> sendLine(player,"",i)
}
}
+ 3 -> {
+ when(i) {
+ 97 -> sendLine(player, "Venenatis KC: ${globalData.bossCounters.get(BossKillCounter.VENENATIS.ordinal)}",i)
+ 68 -> sendLine(player,SPACER,i)
+ 69 -> sendLine(player,SPACER,i)
+ 70 -> sendLine(player, "Dragon pickaxe: ${GlobalKillCounter.getRareDrops(other, 14723)}", i)
+ 71 -> sendLine(player, "Treasonous ring: ${GlobalKillCounter.getRareDrops(other, 14731)}", i)
+ 72 -> sendLine(player,SPACER,i)
+ 73 -> sendLine(player,SPACER,i)
+ 74 -> sendLine(player,SPACER,i)
+ 75 -> sendLine(player,SPACER,i)
+ 76 -> sendLine(player,SPACER,i)
+ 77 -> sendLine(player,SPACER,i)
+ 78 -> sendLine(player,SPACER,i)
+ 79 -> sendLine(player,SPACER,i)
+ 80 -> sendLine(player,SPACER,i)
+
+ 82 -> sendLine(player,SPACER,i)
+ 83 -> sendLine(player,SPACER,i)
+ 84 -> sendLine(player,SPACER,i)
+ 85 -> sendLine(player,SPACER,i)
+ 86 -> sendLine(player,SPACER,i)
+ 87 -> sendLine(player,SPACER,i)
+ 88 -> sendLine(player,SPACER,i)
+ 89 -> sendLine(player,SPACER,i)
+ 90 -> sendLine(player,SPACER,i)
+ 91 -> sendLine(player,SPACER,i)
+ 92 -> sendLine(player,SPACER,i)
+ 93 -> sendLine(player,SPACER,i)
+ 94 -> sendLine(player,SPACER,i)
+ 95 -> sendLine(player,SPACER,i)
+ else -> sendLine(player,"",i)
+ }
+ }
}
}
player.interfaceManager.open(Component(26))
diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/cooking/CookingDialogue.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/cooking/CookingDialogue.kt
index 52720e2a8..9422d099b 100644
--- a/Server/src/main/kotlin/rs09/game/node/entity/skill/cooking/CookingDialogue.kt
+++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/cooking/CookingDialogue.kt
@@ -1,14 +1,14 @@
package rs09.game.node.entity.skill.cooking
-import api.*
+import api.sendInputDialogue
import core.cache.def.impl.ItemDefinition
-import core.game.node.scenery.Scenery
-import core.game.node.entity.player.link.RunScript
import core.game.node.entity.skill.cooking.CookableItems
import core.game.node.entity.skill.cooking.CookingRewrite.Companion.cook
+import core.game.node.scenery.Scenery
import core.net.packet.PacketRepository
import core.net.packet.context.ChildPositionContext
import core.net.packet.out.RepositionChild
+import org.rs09.consts.Items
import rs09.game.content.dialogue.DialogueFile
import rs09.tools.START_DIALOGUE
@@ -16,7 +16,6 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
var initial = 0
var product = 0
var `object`: Scenery? = null
- var sinew = false
override fun handle(componentID: Int, buttonID: Int) {
when(stage){
START_DIALOGUE -> {
@@ -30,12 +29,11 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
}
`object` = args.get(1) as Scenery
}
- 4 -> {
- initial = args.get(0) as Int
- product = args.get(1) as Int
- sinew = args.get(2) as Boolean
- `object` = args.get(3) as Scenery
- if (sinew) {
+ 3 -> {
+ initial = args[0] as Int
+ product = args[1] as Int
+ `object` = args[2] as Scenery
+ if (product == Items.SINEW_9436) {
player!!.dialogueInterpreter.sendOptions(
"Select one",
"Dry the meat into sinew",
@@ -67,7 +65,7 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
100 -> {
when (buttonID) {
- 1 -> cook(player!!, `object`, initial, product, 1)
+ 1 -> display()
2 -> {
product = CookableItems.forId(initial).cooked
display()
@@ -91,8 +89,8 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
player!!.interfaceManager.openChatbox(307)
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 3, 60, 90))
PacketRepository.send(RepositionChild::class.java, ChildPositionContext(player, 307, 2, 208, 20))
- player!!.packetDispatch.sendItemZoomOnInterface(product, 160, 307, 2)
- player!!.packetDispatch.sendString(ItemDefinition.forId(product).name, 307, 3)
+ player!!.packetDispatch.sendItemZoomOnInterface(initial, 160, 307, 2)
+ player!!.packetDispatch.sendString(ItemDefinition.forId(initial).name, 307, 3)
stage = 1
}
diff --git a/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt b/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt
index af4dcfc35..1d3f19615 100644
--- a/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt
+++ b/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt
@@ -3,6 +3,7 @@ package rs09.game.system
import com.github.ajalt.mordant.rendering.TextColors
import com.github.ajalt.mordant.terminal.Terminal
import gui.GuiEvent
+import gui.ServerMonitor
import rs09.ServerConstants
import java.io.*
import java.text.SimpleDateFormat
@@ -46,6 +47,7 @@ object SystemLogger {
val msg = "${getTime()}: [INFO] $m"
if(m.isNotBlank()) {
t.println(msg)
+ ServerMonitor.eventQueue.add(GuiEvent.AddDefaultMessage(msg))
}
}
}
@@ -55,6 +57,7 @@ object SystemLogger {
val msg = "${getTime()}: [ ERR] $message"
if(message.isNotBlank()) {
t.println(msg)
+ ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
}
}
@@ -63,6 +66,7 @@ object SystemLogger {
val msg = "${getTime()}: [WARN] $message"
if(message.isNotBlank()) {
t.println(msg)
+ ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
}
}
@@ -71,6 +75,7 @@ object SystemLogger {
val msg = "${getTime()}: [ALRT] $message"
if(message.isNotBlank()) {
t.println(msg)
+ ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg))
}
}
@@ -79,6 +84,7 @@ object SystemLogger {
val msg = "${getTime()}: [AIPL] $message"
if(message.isNotBlank()) {
t.println(msg)
+ ServerMonitor.eventQueue.add(GuiEvent.AddAIPMessage(msg))
}
}
diff --git a/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt b/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt
index 777ec29fa..cf30b98c1 100644
--- a/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt
+++ b/Server/src/main/kotlin/rs09/game/system/command/rottenpotato/RottenPotatoOptionHandler.kt
@@ -1,15 +1,12 @@
package rs09.game.system.command.rottenpotato
-import api.removeItem
import core.cache.def.impl.ItemDefinition
import core.game.interaction.OptionHandler
import core.game.node.Node
import core.game.node.entity.player.Player
-import core.game.node.entity.player.info.Rights
import core.plugin.Initializable
import core.plugin.Plugin
import org.rs09.consts.Items
-import rs09.game.system.SystemLogger
import rs09.game.system.command.CommandSystem
import rs09.tools.stringtools.colorize
@@ -32,14 +29,6 @@ class RottenPotatoOptionHandler : OptionHandler() {
node ?: return false
option ?: return false
- // re-add the fucking check because some fucking moron removed it at some point
- if(player.rights != Rights.ADMINISTRATOR)
- {
- removeItem(player, Items.ROTTEN_POTATO_5733)
- SystemLogger.logAlert("Player ${player.username} had a rotten potato. It has been removed.")
- return false
- }
-
when(option){
"rs hd" -> player.dialogueInterpreter.open(RottenPotatoRSHDDialogue().ID)
"heal" -> player.fullRestore().also { player.sendMessage(colorize("%RAll healed!")) }
diff --git a/Server/src/main/kotlin/rs09/game/system/command/sets/MusicCommandSet.kt b/Server/src/main/kotlin/rs09/game/system/command/sets/MusicCommandSet.kt
index a1b27b7c1..3c341980e 100644
--- a/Server/src/main/kotlin/rs09/game/system/command/sets/MusicCommandSet.kt
+++ b/Server/src/main/kotlin/rs09/game/system/command/sets/MusicCommandSet.kt
@@ -6,6 +6,7 @@ import core.net.packet.context.MusicContext
import core.net.packet.out.MusicPacket
import core.plugin.Initializable
import rs09.game.system.command.Command
+import rs09.game.world.zone.fellercellar.FellerCellar
@Initializable
class MusicCommandSet : CommandSet(Command.Privilege.STANDARD){
@@ -48,5 +49,9 @@ class MusicCommandSet : CommandSet(Command.Privilege.STANDARD){
player.musicPlayer.unlock(me.id)
}
}
+
+ define("forceshuffle") { player, _ ->
+ FellerCellar.songTime = 0
+ }
}
}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt
index 451479703..040e7709b 100644
--- a/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt
+++ b/Server/src/main/kotlin/rs09/game/system/config/ServerConfigParser.kt
@@ -98,7 +98,7 @@ object ServerConfigParser {
ServerConstants.HOME_LOCATION = parseLocation(data.getString("world.home_location"))
ServerConstants.START_LOCATION = parseLocation(data.getString("world.new_player_location"))
ServerConstants.DAILY_RESTART = data.getBoolean("world.daily_restart")
- ServerConstants.GRAND_EXCHANGE_DATA_PATH = data.getPath("paths.eco_data")
+ ServerConstants.GRAND_EXCHANGE_DATA_PATH = data.getPath("paths.grand_exchange_data_path")
ServerConstants.CELEDT_DATA_PATH = data.getPath("paths.cele_drop_table_path")
}
diff --git a/Server/src/main/kotlin/rs09/game/system/config/ShopParser.kt b/Server/src/main/kotlin/rs09/game/system/config/ShopParser.kt
index 3a0768eeb..8fcd110be 100644
--- a/Server/src/main/kotlin/rs09/game/system/config/ShopParser.kt
+++ b/Server/src/main/kotlin/rs09/game/system/config/ShopParser.kt
@@ -1,13 +1,16 @@
package rs09.game.system.config
+import api.submitWorldPulse
import core.game.content.global.shop.Shop
import core.game.node.entity.player.Player
import core.game.node.item.Item
+import core.game.system.task.Pulse
import org.json.simple.JSONArray
import org.json.simple.JSONObject
import org.json.simple.parser.JSONParser
import rs09.ServerConstants
import rs09.game.system.SystemLogger
+import rs09.game.world.repository.Repository
import java.io.FileReader
class ShopParser{
@@ -50,6 +53,15 @@ class ShopParser{
}
count++
}
+
+ submitWorldPulse(object : Pulse(100)
+ {
+ override fun pulse(): Boolean {
+ Repository.npcs.asSequence().filter { it.shop != null }.forEach { it.shop.restock() }
+ return false
+ }
+ })
+
SystemLogger.logInfo("Parsed $count shops.")
}
diff --git a/Server/src/main/kotlin/rs09/game/system/config/XteaParser.kt b/Server/src/main/kotlin/rs09/game/system/config/XteaParser.kt
index 5ff740263..256af6e20 100644
--- a/Server/src/main/kotlin/rs09/game/system/config/XteaParser.kt
+++ b/Server/src/main/kotlin/rs09/game/system/config/XteaParser.kt
@@ -13,14 +13,10 @@ class XteaParser {
companion object{
val REGION_XTEA = HashMap()
val DEFAULT_REGION_KEYS = intArrayOf(14881828, -6662814, 58238456, 146761213)
- fun getRegionXTEA(regionId: Int): IntArray? { //Uses the xtea's from the sql to unlock regions
- // System.out.println("USING SQL REGION KEYS");//Confirms we have unlocked those regions
- return REGION_XTEA[regionId]
- ?: // System.out.println("USING DEFAULT REGION KEYS FOR REGION " + regionId);//Used to check for missing regions
- return DEFAULT_REGION_KEYS //This one grabs the keys from the SQL
- // return DEFAULT_REGION_KEYS;//This one only uses the default keys at the top,{ 14881828, -6662814, 58238456, 146761213 }. Unsure why they chose these numbers.
+ fun getRegionXTEA(regionId: Int): IntArray? {
+ return intArrayOf(0, 0, 0, 0)
}
- }
+ }
val parser = JSONParser()
var reader: FileReader? = null
diff --git a/Server/src/main/kotlin/rs09/game/world/ImmerseWorld.kt b/Server/src/main/kotlin/rs09/game/world/ImmerseWorld.kt
index 6423a3cbf..7336dfecb 100644
--- a/Server/src/main/kotlin/rs09/game/world/ImmerseWorld.kt
+++ b/Server/src/main/kotlin/rs09/game/world/ImmerseWorld.kt
@@ -21,10 +21,10 @@ object ImmerseWorld {
immerseSeersAndCatherby()
immerseLumbridgeDraynor()
immerseVarrock()
- // immerseWilderness() temp disabled due to unbalanced exchange rates
+ immerseWilderness()
immerseFishingGuild()
immerseAdventurer()
- // immerseSlayer()
+ immerseSlayer()
}
}
diff --git a/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellar.kt b/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellar.kt
new file mode 100644
index 000000000..4f81abf1f
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellar.kt
@@ -0,0 +1,62 @@
+package rs09.game.world.zone.fellercellar
+
+import core.game.node.entity.player.Player
+import core.game.system.task.Pulse
+import core.net.packet.PacketRepository
+import core.net.packet.context.MusicContext
+import core.net.packet.out.MusicPacket
+import core.tools.RandomFunction
+import rs09.tools.stringtools.colorize
+
+object FellerCellar {
+ val SONG_LENGTHS = intArrayOf(222,222,100,225,430,400,147,575,141,275,146,635)
+ val SONG_NAMES = arrayOf("Red Wings","Clocktower","Pizza Time","Clash On The Big Bridge","Pokke Village","Corridors of Time","Cirno's Theme",
+ "Golden Sneer","Crash 3 Warp Room","Slider Theme","Fun Naming","Fight On!")
+ var FellerCellarPlayerList = ArrayList()
+ var random = RandomFunction.getRandom(11)
+ var lastRoll = random
+ var songTime = SONG_LENGTHS[random]
+
+ var fellerPulse = object : Pulse() {
+ override fun pulse(): Boolean {
+ if(songTime <= 0){
+ random = RandomFunction.getRandom(11)
+ while(random == lastRoll){
+ random = RandomFunction.getRandom(11)
+ }
+ lastRoll = random
+ songTime = SONG_LENGTHS[random]
+ FellerCellarPlayerList.forEach { player ->
+ shuffleTracks(player, random)
+ }
+ for (player in FellerCellarPlayerList) {
+ if(random == 7){
+ player.sendMessage(colorize("%RNow playing: ${SONG_NAMES[random]}"))
+ }
+ else player.sendMessage(colorize("%GNow playing: ${SONG_NAMES[random]}"))
+ }
+ }
+ songTime--
+ return false
+ }
+ }
+
+ fun shuffleTracks(player: Player, random: Int) {
+ when(random){
+ 0 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,668))
+ 1 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,669))
+ 2 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,670))
+ 3 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,671))
+ 4 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,672))
+ 5 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,673))
+ 6 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,674))
+ 7 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,675))
+ 8 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,676))
+ 9 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,677))
+ 10 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,678))
+ 11 -> PacketRepository.send(MusicPacket::class.java, MusicContext(player,679))
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellarZone.kt b/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellarZone.kt
new file mode 100644
index 000000000..963178ac3
--- /dev/null
+++ b/Server/src/main/kotlin/rs09/game/world/zone/fellercellar/FellerCellarZone.kt
@@ -0,0 +1,54 @@
+package rs09.game.world.zone.fellercellar
+
+import api.sendMessage
+import api.submitWorldPulse
+import core.game.node.entity.Entity
+import core.game.world.map.zone.MapZone
+import core.game.world.map.zone.ZoneBorders
+import core.game.world.map.zone.ZoneBuilder
+import core.plugin.Initializable
+import core.plugin.Plugin
+import core.tools.RandomFunction
+import rs09.tools.stringtools.colorize
+
+@Initializable
+class FellerCellarZone : MapZone("Feller Cellar Zone",true), Plugin {
+
+ var pulseStarted = false
+
+ override fun newInstance(arg: Any?): Plugin {
+ ZoneBuilder.configure(this)
+ return this
+ }
+
+ override fun fireEvent(identifier: String?, vararg args: Any?): Any {
+ return Unit
+ }
+
+ override fun configure() {
+ super.register(ZoneBorders(3207,9614,3220,9626))
+ }
+ override fun enter(e: Entity?): Boolean {
+ if(!pulseStarted){
+ submitWorldPulse(FellerCellar.fellerPulse)
+ pulseStarted = true
+ }
+ if (e != null && e.isPlayer) {
+ FellerCellar.shuffleTracks(e.asPlayer(), FellerCellar.random)
+ FellerCellar.FellerCellarPlayerList.add(e.asPlayer())
+ if(FellerCellar.random == 7){
+ e.asPlayer().sendMessage(colorize("%RNow playing: ${FellerCellar.SONG_NAMES[FellerCellar.random]}"))
+ }
+ else sendMessage(e.asPlayer(), colorize("%GNow Playing: ${FellerCellar.SONG_NAMES[FellerCellar.random]}"))
+ }
+ return super.enter(e)
+ }
+
+ override fun leave(e: Entity?, logout: Boolean): Boolean {
+ if (e != null && e.isPlayer) {
+ FellerCellar.FellerCellarPlayerList.remove(e.asPlayer())
+ }
+ return super.leave(e, logout)
+ }
+
+}
\ No newline at end of file
diff --git a/Server/src/main/kotlin/rs09/net/event/LoginReadEvent.kt b/Server/src/main/kotlin/rs09/net/event/LoginReadEvent.kt
index c4addd162..d1911e0e8 100644
--- a/Server/src/main/kotlin/rs09/net/event/LoginReadEvent.kt
+++ b/Server/src/main/kotlin/rs09/net/event/LoginReadEvent.kt
@@ -66,6 +66,7 @@ class LoginReadEvent
* @param buffer The buffer to read from.
*/
private fun decodeWorld(opcode: Int, session: IoSession, buffer: ByteBuffer) {
+ SystemLogger.logInfo("decodeWorld")
var buffer = buffer
val d = buffer.get() // Memory?
val e = buffer.get() // no advertisement = 1
@@ -105,28 +106,26 @@ class LoginReadEvent
session.isaacPair = ISAACPair(inCipher, outCipher)
session.clientInfo = ClientInfo(displayMode, windowMode, screenWidth, screenHeight)
val b = buffer
- SystemLogger.logInfo("spawning thread to handle login")
TaskExecutor.executeSQL {
- SystemLogger.logInfo("login thread start")
+ SystemLogger.logInfo("spawning thread to handle login")
Thread.currentThread().name = "Login Password Response"
- SystemLogger.logInfo("login thread named")
try {
+ SystemLogger.logInfo("about to grab the username")
val username = StringUtils.longToString(b.long)
- SystemLogger.logInfo("got username")
+ SystemLogger.logInfo(username)
val password = ByteBufferUtils.getString(b)
- SystemLogger.logInfo("got password")
+ SystemLogger.logInfo("im not logging the fucking password")
val response = PlayerSQLManager.getCredentialResponse(username, password)
- SystemLogger.logInfo("got sql response")
+ SystemLogger.logInfo(response.toString())
if (response != Response.SUCCESSFUL) {
- SystemLogger.logInfo("not success :(")
+ SystemLogger.logInfo("why isnt it fucking successful")
session.write(response, true)
return@executeSQL
}
- SystemLogger.logInfo("great success, attempting login")
+ SystemLogger.logInfo("YOU SHOULD BE LOGGING IN NOW")
login(PlayerDetails(username, password), session, b, opcode)
- SystemLogger.logInfo("done")
+ SystemLogger.logInfo("YOU SHOULD NOW BE LOGGED IN")
} catch (e: Exception) {
- SystemLogger.logInfo("big whoops")
e.printStackTrace()
session.write(Response.COULD_NOT_LOGIN)
}
@@ -136,7 +135,8 @@ class LoginReadEvent
/**
* Handles the login procedure after we check an acc is registered & certified.
- * @param details the player's details.
+ * @param username the username.
+ * @param password the password.
* @param session the session.
* @param buffer the byte buffer.
* @param opcode the opcode.
@@ -163,6 +163,7 @@ class LoginReadEvent
*/
@JvmStatic
fun getISAACSeed(buffer: ByteBuffer): IntArray {
+ SystemLogger.logInfo("getISAACSeed")
val seed = IntArray(4)
for (i in 0..3) {
seed[i] = buffer.int
diff --git a/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt b/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt
index e97f1e956..445ad9f9f 100644
--- a/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt
+++ b/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt
@@ -3,6 +3,7 @@ package rs09.net.packet
import core.net.packet.OutgoingPacket
import core.net.packet.out.*
import gui.GuiEvent
+import gui.ServerMonitor
import rs09.game.system.SystemLogger
import java.util.*
@@ -29,6 +30,7 @@ object PacketWriteQueue {
@JvmStatic
fun flush(){
+ ServerMonitor.eventQueue.add(GuiEvent.UpdateQueuedPackets(PacketsToWrite.size))
while(!PacketsToWrite.isEmpty()){
val p = PacketsToWrite.poll() ?: continue
write(p.out,p.context)
diff --git a/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt b/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt
index b42a41011..cfa5c1de5 100644
--- a/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt
+++ b/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt
@@ -119,8 +119,8 @@ class MajorUpdateWorker {
}
val end = System.currentTimeMillis()
- ServerMonitor.eventQueue.add(GuiEvent.UpdateTickTime(end - start))
- ServerMonitor.eventQueue.add(GuiEvent.UpdatePulseCount(GameWorld.Pulser.TASKS.size))
+ //ServerMonitor.eventQueue.add(GuiEvent.UpdateTickTime(end - start))
+ //ServerMonitor.eventQueue.add(GuiEvent.UpdatePulseCount(GameWorld.Pulser.TASKS.size))
Thread.sleep(max(600 - (end - start), 0))
}
}
@@ -130,7 +130,7 @@ class MajorUpdateWorker {
worker.start()
}
- //if (ServerConstants.ALLOW_GUI)
- // ServerMonitor.open()
+ if (ServerConstants.ALLOW_GUI)
+ ServerMonitor.open()
}
}
\ No newline at end of file
diff --git a/Server/worldprops/default.conf b/Server/worldprops/default.conf
index 932c45714..b7ef36905 100644
--- a/Server/worldprops/default.conf
+++ b/Server/worldprops/default.conf
@@ -14,7 +14,7 @@ database_port = "3306"
[world]
-name = "2009scape"
+name = "FellerScape"
debug = true
dev = true
start_gui = false
@@ -24,10 +24,10 @@ world_id = "1"
country_id = "0"
members = true
#activity as displayed on the world list
-activity = "2009scape classic."
+activity = "Fellers?"
pvp = false
default_xp_rate = 5.0
-allow_slayer_reroll = false
+allow_slayer_reroll = true
#enables a default clan for players to join automatically. Should be an account with the same name as @name, with a clan set up already.
enable_default_clan = true
enable_bots = true
@@ -43,9 +43,9 @@ autostock_ge = false
allow_token_purchase = true
skillcape_perks = true
increased_door_time = false
-enable_botting = false
+enable_botting = true
max_adv_bots = 100
-wild_pvp_enabled = false
+wild_pvp_enabled = true
[paths]
#path to the data folder, which contains the cache subfolder and such
@@ -65,5 +65,4 @@ cele_drop_table_path = "@data/CELEDT.xml"
object_parser_path = "@data/ObjectParser.xml"
#path logs are written to
logs_path = "@data/logs"
-bot_data = "@data/botdata"
-eco_data = "@data/eco"
\ No newline at end of file
+bot_data = "@data/botdata"
\ No newline at end of file
diff --git a/build.sh b/build.sh
new file mode 100644
index 000000000..dcdabc084
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,2 @@
+cd Server
+gradle jar
diff --git a/dumps/530/animations b/dumps/530/animations.txt
similarity index 100%
rename from dumps/530/animations
rename to dumps/530/animations.txt
diff --git a/make-release.py b/make-release.py
deleted file mode 100755
index b9855d3c7..000000000
--- a/make-release.py
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/env python3
-
-import subprocess
-import datetime
-import os
-
-
-WEB_REPO = '../2009scape.github.io'
-NEWS_DIR = 'services/m=news/archives'
-LOG_DELIMITER = ';;;;;'
-DEBUG = False
-
-
-class Tag:
- def __init__(self, tag_name, last_tag):
- self.tag_name = tag_name
- self.last_tag = last_tag
-
-
-def make_tag() -> Tag:
- tag_name = datetime.datetime.now().strftime('%b-%d-%Y')
- print('new release tag:', tag_name)
- last_tag = subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).decode('utf8').strip()
- print('last release tag:', last_tag)
- if not DEBUG:
- subprocess.run(['git', 'tag', tag_name])
- return Tag(tag_name, last_tag)
-
-
-def get_changelog_html(tag: Tag) -> str:
- if DEBUG:
- log_period = f'{tag.last_tag}..HEAD'
- else:
- log_period = f'{tag.last_tag}..{tag.tag_name}'
- changelog = subprocess.check_output(['git', 'log', log_period, f'--format=%B{LOG_DELIMITER}']).decode('utf8').split(LOG_DELIMITER)
- changelog_html = ''.join(['' + change.strip().replace('\n', ' \n') + ' \n' for change in changelog if change.strip()])
- changelog_html = f''
- print('generated changelog:', changelog_html, sep='\n')
- return changelog_html
-
-
-def make_news_post(tag: Tag) -> None:
- changelog_html = get_changelog_html(tag)
- os.chdir(os.path.join(WEB_REPO, NEWS_DIR))
- current_date = datetime.datetime.now().strftime('%Y-%m-%d')
- news_filename = current_date + '.html'
- print('news filename:', news_filename)
- news_post = news_template(current_date, changelog_html)
- if DEBUG:
- print('generated news post:', news_post)
- else:
- if news_filename in os.listdir():
- raise FileExistsError(news_filename)
- with open(news_filename, 'wt') as news_handle:
- news_handle.write(news_post)
-
-
-def news_template(current_date: str, changelog: str) -> str:
- return '''---
-title: More Changes in Gielinor
-tags: news
-layout: newspost
-collection: Game Updates
-date: '''+ current_date + ''' 00:00:00 +0000
-authors: ryannathans
-excerpt: "There have been some more changes in Gielinor..."
----
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ page.authors }}
-
-
- ???
-
-
-
-
-
-
-
- {{ page.date | date: '%d-%B-%Y' }}
-
-
-
-
Greetings Explorers
-
There have been some more changes in Gielinor:
''' + changelog + '''
-
-
-
-
-
-
-
-
-
-
-
'''
-
-
-def main() -> None:
- tag = make_tag()
- make_news_post(tag)
-
-
-if __name__ == '__main__':
- main()
diff --git a/run.sh b/run.sh
new file mode 100644
index 000000000..6d3861c11
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+echo "Make sure you have built the server before running this command."
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 [--build] type"
+ echo "Example: $0 ms"
+ echo "Example: $0 server Server/worldprops/default.json"
+ echo "Example: $0 client"
+ echo "Example: $0 --build server Server/worldprops/default.json"
+ exit
+fi
+readIndex=1
+propsFile="$1"
+doBuild=false
+function run_server {
+ Server/bin/Server "$1"
+}
+run_ms(){
+ exec "Management-Server/bin/Management-Server"
+}
+run_client(){
+ exec "Client/bin/Client"
+}
+if [ "$1" = "--build" ]; then
+ readIndex="$((readIndex + 1))"
+ doBuild=true
+ if [ $# -lt 2 ]; then
+ echo "You must supply a type."
+ echo "If you just want to build without running, use build.sh"
+ exit
+ fi
+fi
+
+type="${!readIndex}"
+if [ $doBuild = true ]; then
+ ./build.sh "$type"
+fi
+if [ "$type" = "server" ]; then
+ readIndex="$((readIndex + 1))"
+ propsFile="${!readIndex}"
+ echo $propsFile
+ run_server "$propsFile"
+elif [ "$type" = "ms" ]; then
+ run_ms
+elif [ "$type" = "client" ]; then
+ run_client
+fi
diff --git a/telecoordinates b/telecoordinates
new file mode 100644
index 000000000..1c21db96c
--- /dev/null
+++ b/telecoordinates
@@ -0,0 +1,1326 @@
+Big water fall ::tele 2534,3511
+Very back of wild ::tele 3100,3957
+Varrock east bank ::tele 3250,3423
+Varrock ::tele 3210,3424
+Falador ::tele 2964,3378
+Lumbridge ::tele 3222,3218
+Camelot ::tele 2757,3477
+East Ardougne ::tele 2662,3305
+West Ardougne ::tele 2529,3307
+King Lathas Training Grounds ::tele 2516,3369
+Tree Gnome Stronghold ::tele 2461,3443
+Al Kharid ::tele 3293,3174
+Shantays Pass ::tele 3304,3116
+Kalphite Lair ::tele 3226,3107
+Pyramid ::tele 3233,2902
+Pollnivneach ::tele 3359,2910
+Menaphos/Sophanem ::tele 3274,2784
+Yanille ::tele 2606,3093
+Gul'Tanoth ::tele 2516,3044
+Tutorial Island ::tele 3094,3107
+Barbarian Village ::tele 3082,3420
+Entrana ::tele 2834,3335
+Heroes Guild ::tele 2902,3510
+Rangers Guild ::tele 2658,3439
+Coal Trucks ::tele 2582,3481
+Goblin Village ::tele 2956,3506
+Druids Circle ::tele 2926,3482
+Burthorpe ::tele 2926,3559
+White wolf mountain ::tele 2848,3498
+Catherby ::tele 2813,3447
+Seers village ::tele 2708,3492
+Fishing guild ::tele 2603,3414
+Barbarian Agility Course ::tele 2541,3546
+Prifddinas ::tele 2242,3278
+Elf camp (Tirannwn) ::tele 2197,3252
+Isafdar (Tirannwn) ::tele 2241,3238
+Duel arena ::tele 3360,3213
+Desert mining camp ::tele 3286,3023
+Bedabin camp ::tele 3171,3026
+Bandit camp ::tele 3176,2987
+Sophanem ::tele 3305,2755
+Ruins of Uzer ::tele 3490,3090
+Mort'ton ::tele 3489,3288
+Canifis ::tele 3506,3496
+Port Phasmatys ::tele 3687,3502
+Fenkenstrain's castle ::tele 3550,3548
+Dig site ::tele 3354,3402
+Exam centre ::tele 3354,3344
+Edgeville ::tele 3093,3493
+Crafting guild ::tele 2933,3285
+Port Sarim ::tele 3023,3208
+Rimmington ::tele 2957,3214
+Draynor village ::tele 3093,3244
+Fight arena ::tele 2585,3150
+Tree gnome village ::tele 2525,3167
+Port Khazard ::tele 2665,3161
+Monastery ::tele 3051,3490
+Karamja ::tele 2948,3147
+Crandor ::tele 2851,3238
+King Black Dragon Lair ::tele 2717,9816
+KQ Lair ::tele 3487,9493
+Underground pass level 2 ::tele 2337,9798
+Weird water place ::tele 2676,3008
+Members Karajama ::tele 2815,3182
+Grave island ::tele 3504,3575
+HAM camp ::tele 3165,9629
+Pyramid under Sophanem ::tele 3277,9171
+Juna the snake (Press Burst of Strength a few times to get to it) ::tele 3251,9517
+Smoky tunnels/dark room (This place needs more tests) 3206,9379
+Underground pass level 1 ::tele 2495,9715
+Mage Arena ::tele 3107,3937
+Ape Atoll ::tele 2755,2784
+Jungle demon area bottom level ::tele 2714,9183
+Jungle demon area top level (use Burst of Strength) ::tele 2703,9178
+Wilderness Agility Course ::tele 3003,3934
+Keldagram ::tele 2937,9999 (and run north for a little while)
+(Alternate) Keldagram, if you tele to 2937,3763 then Press Clarity of Thought then you will be able to walk around in Keldagrim!
+Agility arena on Karamja ::tele 2761,9557
+Metal dragon dungeon (back) ::tele 2713,9459
+Metal dragon dungeon (front) ::tele 2713,9564
+Inside the desert treasure pyramid ::tele 3233,9315
+Tree gnome hanger ::tele 2390,9886
+Fishing platform ::tele 2782,3273
+Boat crash island place ::tele 2795,3321
+Legends quest jungle dungeon ::tele 2772,9341
+TzHaar ::tele 2480,5175
+Essence mine ::tele 2911,4832
+Morings end part 1 mine ::tele 2044,4649
+Dwarf cut scene meeting area ::tele 2035,4529
+New KBD lair ::tele 2273,4695
+Elven forest cut scene area ::tele 2309,4597
+Gold mine rock ::tele 2358,4959
+White knight tasks area ::tele 2443,4956
+Rouge maze (Press Burst of Strength) ::tele 3050,5071
+The shadow guys dungeon ::tele 2738,5081
+Barrows top ::tele 3564,3288
+Barrows tunnel ::tele 3568,9695 (Press Burst of Strength a few times to get to the barrows bros coffins)
+Barrows chest ::tele 3551,9694
+CW bank= 2441,3090
+CW center= 2400,3103
+Blue dragons= 2910,9801
+Black demons= 2860 9775
+Hell Hounds= 2867,9844
+Black dragons= 2829,9826
+Chaos rune crafting alter ::tele 2269,4843
+Legends dungeon prt2 ::tele 2375,4705
+Mage arena dungeon ::tele 2519,4719
+Evil Bobs island "scaperune" ::tele 2525,4776
+Distant kingdom (alive) 2576,4655
+Distant kingdom (dead) 2803,4723
+Forester random event ::tele 2602,4775
+Alt area ::tele 2527,4547
+Fremmy maze ::tele 2652,9999
+Death rune altar ::tele 2207,4836
+Cosmic alter ::tele 2162,4833
+Middle of under ground pass (Press Burst of Strength) ::tele 2168 4726
+Quiz random event ::tele 1952,4768
+Trawler boat ::tele 2013,4820
+Sunk trawler mini game boat ::tele 1951,4825
+Trawler boat empty of water ::tele 1886,4830
+Mime stage ::tele 2008,4762
+"Draynor" ::tele 2130,4913
+Game room ::tele 2196,4961
+Mind alter ::tele 2796,4818
+Air Alter ::tele 2845,4832
+Water Alter ::tele 2713,4836
+Earth Alter ::tele 2660,4839
+Fire Alter ::tele 2584,4836
+Body Alter ::tele 2527,4833
+Law Alter ::tele 2464,4834
+Nature Alter ::tele 2398,4841
+Gas hole ::tele 2464,4782
+Edge of maze ::tele 2885,4550
+Center of maze ::tele 2912,4576
+Falador mine ::tele 3038,9800
+2867 9955 - Ice Queen Lair
+3429 3538 - Slayer Tower
+2710 9466 - Brimhaven Dungeon
+2856 3812 - Ice Path
+2480 3437 - Gnome Agility Training
+3281 2765 - Pyramid Plunder room
+3345 3251 - Duel Arena
+2717 9808 - King Black Dragon Cave
+3044 4973 - Rouges Den
+2979 3611 - Green Dragons
+Big water fall ::tele 2534,3511
+Very back of wild ::tele 3100,3957
+Varrock east bank ::tele 3250,3423
+Varrock ::tele 3210,3424
+Falador ::tele 2964,3378
+Lumbridge ::tele 3222,3218
+Camelot ::tele 2757,3477
+East Ardougne ::tele 2662,3305
+West Ardougne ::tele 2529,3307
+King Lathas Training Grounds ::tele 2516,3369
+Tree Gnome Stronghold ::tele 2461,3443
+Al Kharid ::tele 3293,3174
+Shantays Pass ::tele 3304,3116
+Kalphite Lair ::tele 3226,3107
+Pyramid ::tele 3233,2902
+Pollnivneach ::tele 3359,2910
+Menaphos/Sophanem ::tele 3274,2784
+Yanille ::tele 2606,3093
+Gul'Tanoth ::tele 2516,3044
+Tutorial Island ::tele 3094,3107
+Barbarian Village ::tele 3082,3420
+Entrana ::tele 2834,3335
+Heroes Guild ::tele 2902,3510
+Rangers Guild ::tele 2658,3439
+Coal Trucks ::tele 2582,3481
+Goblin Village ::tele 2956,3506
+Druids Circle ::tele 2926,3482
+Burthorpe ::tele 2926,3559
+White wolf mountain ::tele 2848,3498
+Catherby ::tele 2813,3447
+Seers village ::tele 2708,3492
+Fishing guild ::tele 2603,3414
+Barbarian Agility Course ::tele 2541,3546
+Prifddinas ::tele 2242,3278
+Elf camp (Tirannwn) ::tele 2197,3252
+Isafdar (Tirannwn) ::tele 2241,3238
+Duel arena ::tele 3360,3213
+Desert mining camp ::tele 3286,3023
+Bedabin camp ::tele 3171,3026
+Bandit camp ::tele 3176,2987
+Sophanem ::tele 3305,2755
+Ruins of Uzer ::tele 3490,3090
+Mort'ton ::tele 3489,3288
+Canifis ::tele 3506,3496
+Port Phasmatys ::tele 3687,3502
+Fenkenstrain's castle ::tele 3550,3548
+Dig site ::tele 3354,3402
+Exam centre ::tele 3354,3344
+Edgeville ::tele 3093,3493
+Crafting guild ::tele 2933,3285
+Port Sarim ::tele 3023,3208
+Rimmington ::tele 2957,3214
+Draynor village ::tele 3093,3244
+Fight arena ::tele 2585,3150
+Tree gnome village ::tele 2525,3167
+Port Khazard ::tele 2665,3161
+Monastery ::tele 3051,3490
+Karamja ::tele 2948,3147
+Crandor ::tele 2851,3238
+King Black Dragon Lair ::tele 2717,9816
+KQ Lair ::tele 3487,9493
+Underground pass level 2 ::tele 2337,9798
+Weird water place ::tele 2676,3008
+Members Karajama ::tele 2815,3182
+Grave island ::tele 3504,3575
+HAM camp ::tele 3165,9629
+Pyramid under Sophanem ::tele 3277,9171
+Juna the snake ::tele 3251,9517
+Smoky tunnels/dark room (This place needs more tests) 3206,9379
+Underground pass level 1 ::tele 2495,9715
+Mage Arena ::tele 3107,3937
+Ape Atoll ::tele 2755,2784
+Jungle demon area bottom level ::tele 2714,9183
+Jungle demon area top level (use Burst of Strength) ::tele 2703,9178
+Wilderness Agility Course ::tele 3003,3934
+Keldagram ::tele 2937,9999
+Agility arena on Karamja ::tele 2761,9557
+Metal dragon dungeon (back) ::tele 2713,9459
+Metal dragon dungeon (front) ::tele 2713,9564
+Inside the desert treasure pyramid ::tele 3233,9315
+Tree gnome hanger ::tele 2390,9886
+Fishing platform ::tele 2782,3273
+Boat crash island place ::tele 2795,3321
+Legends quest jungle dungeon ::tele 2772,9341
+TzHaar ::tele 2480,5175
+Essence mine ::tele 2911,4832
+Morings end part 1 mine ::tele 2044,4649
+Dwarf cut scene meeting area ::tele 2035,4529
+New KBD lair ::tele 2273,4695
+Elven forest cut scene area ::tele 2309,4597
+Gold mine rock ::tele 2358,4959
+White knight tasks area ::tele 2443,4956
+Rouge maze (Press Burst of Strength) ::tele 3050,5071
+The shadow guys dungeon ::tele 2738,5081
+Barrows top ::tele 3564,3288
+Barrows tunnel ::tele 3568,9695
+Barrows chest ::tele 3551,9694
+CW bank= 2441,3090
+CW center= 2400,3103
+Blue dragons= 2910,9801
+Black demons= 2860 9775
+Hell Hounds= 2867,9844
+Black dragons= 2829,9826
+Chaos rune crafting alter ::tele 2269,4843
+Legends dungeon prt2 ::tele 2375,4705
+Mage arena dungeon ::tele 2519,4719
+Evil Bobs island "scaperune" ::tele 2525,4776
+Distant kingdom (alive) 2576,4655
+Distant kingdom (dead) 2803,4723
+Forester random event ::tele 2602,4775
+Alt area ::tele 2527,4547
+Fremmy maze ::tele 2652,9999
+Death rune altar ::tele 2207,4836
+Cosmic alter ::tele 2162,4833
+Middle of under ground pass ::tele 2168 4726
+Quiz random event ::tele 1952,4768
+Trawler boat ::tele 2013,4820
+Sunk trawler mini game boat ::tele 1951,4825
+Trawler boat empty of water ::tele 1886,4830
+Mime stage ::tele 2008,4762
+"Draynor" ::tele 2130,4913
+Game room ::tele 2196,4961
+Mind alter ::tele 2796,4818
+Air Alter ::tele 2845,4832
+Water Alter ::tele 2713,4836
+Earth Alter ::tele 2660,4839
+Fire Alter ::tele 2584,4836
+Body Alter ::tele 2527,4833
+Law Alter ::tele 2464,4834
+Nature Alter ::tele 2398,4841
+Gas hole ::tele 2464,4782
+Edge of maze ::tele 2885,4550
+Center of maze ::tele 2912,4576
+Falador mine ::tele 3038,9800
+::tele 3157 4822 = drill deamon camp
+
+::tele 2477 4768 = frog cave
+
+::tele 2596 4780 = freaky forester
+
+::tele 2095 4428 = prison pete
+
+::tele 1952 4764 = quiz show
+
+::tele 2338 4747 = Lost and found
+
+::tele 1960 4824 = Twarler Mini-Game
+
+::tele 2015 4826 = twarler mini-game inside
+
+::tele 1971 5001 = WIERD CHRUCH! NOT ON RUNESCAPE!
+
+::tele 1928 5002 = Grave digger
+
+::tele 2584 4838 = fire alter
+
+::tele 2966 9633 = somekind of rat-hole never seen this
+
+::tele 2929 9649 = dragon slayer mace
+
+::tele 2907 9705 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2981 9914 = recipes goblin cook place
+
+::tele 2916 9912 = heroes guild cave
+
+::tele 2932 9848 = chaos druids
+
+::tele 2898 9766 = baby bluedragons
+
+::tele 3048 9582 = ice-warriors & giants
+
+::tele 2977 9515 = recipes crabs
+
+::tele 2973 9505 = recipe water "mini-quest"
+
+::tele 2783 9574 = agility arena
+
+::tele 2835 9562 = karamja lessers
+
+::tele 1891 4947 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2007 4431 = x-mas workshop event wooot!
+
+::tele 2400 4850 = nature altar!
+
+::tele 3421 9622 = quest place (dont remember (or newer seen) what quest)
+
+::tele 1865 5330 = recipe the lum kitchen when started recipe near the secret sky must check if it is possible to see in rs.
+
+::tele 1860 5345 = same as above but no barrier & no chairs expet one why?
+
+::tele 2393 4713 = i don't know prob: quest place (dont remember (or newer seen) what quest)
+
+::tele 2385 4685 = have a relation to the place above what is that?
+
+::tele 2525 4776 = evil bob's island
+
+::tele 2633 4700 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2650 4565 = monkey sadness fight the jungle demon?
+
+::tele 2650 4508 = monkey sadness the gnome glider puzzle!
+
+::tele 3300 9825 = A Soul's Bane quest
+
+::tele 3345 9715 = mage training arena (telegrab) ftw
+
+::tele 3350 9680 = mage training arena (telegrab) ftw another one
+
+::tele 3345 9712 = mage training arena (telegrab) ftw another one NOTE: if you see the same arenas try changin height level!
+
+::tele 2152 5095 = Secret island
+
+::tele 2721 4828 = water alter
+
+::tele 2784 4840 = mind alter
+
+::tele 2842 4835 = air alter
+
+::tele 2898 4819 = rune essent mining
+
+::tele 3029 4834 = abyss
+
+::tele 2528 4833 = wierd alter
+
+::tele 2471 4838 = law alter
+
+::tele 1823 4835 = two ships
+
+::tele 3105 3930 = mage arena
+
+::tele 1894 5333 = secret sky
+
+::tele 1865 5341 = recipie for desaster feast
+
+::tele 3424 9891 = under passage way to canfis
+
+::tele 3681 9889 = ecto plasm floor
+
+::tele 2470 9899 = under gnomes grand tree
+
+::tele 2319 9804 = i'bans trap drop
+
+::tele 2856 3809 = slippery ice path
+
+::tele 3551 9693 = barrows chest
+
+::tele 3177 9753 = under draynore mannor
+
+::tele 3040 9741 = faladore mining guild
+
+::tele 3079 9505 = toturial mining
+
+::tele 3110 9512 = toturial combat train
+
+::tele 3232 2896 = top of piramid for desert tresure
+
+::tele 3291 2764 = desert city
+
+::tele 3298 9179 = under desert city
+
+::tele 2861 3165 = volcano
+
+::tele 2863 9570 = under volcano
+
+::tele 2835 3268 = candor
+
+::tele 2766 3277 = fishing docks
+
+::tele 2446 10147 = daganoth cave ( go to "::tele 2446 9999" then keep walking the right direction then ul get there )
+
+::tele 2438 5172 = volcano lava
+
+::tele 2395 5154 = fight pits
+
+::tele 3234 9896 = wierd place
+
+::tele 3132 9909 = under edgevill
+
+::tele 3233 9313 = under piramid at acent alter
+
+::tele 3363 9639 = mage train up ( shapes )
+
+::tele 3363 9637 = mage train up ( bones )
+
+::tele 3365 9637 = mage train up ( alching )
+
+::tele 3363 2984 = a desert city
+
+::tele 2396 5093 = fight caves
+
+::tele 3559 9895 = football traning corse
+
+::tele 3541 9891 = jumping corse
+
+::tele 3528 9871 = zip line
+
+::tele 3539 9872 = jumping steps
+
+::tele 3555 9947 = cave
+
+::tele 2972 9507 = Under water
+
+::tele 2545 4715 = mage arena room
+
+::tele 2505 4707 = mage arena statues
+
+::tele 3551 9712 = barrows coffins
+
+::tele 2716 9816 = black king dragon
+
+::tele 3487 9493 = kaphite queen place
+
+::tele 2744 3444 = camalot flax
+
+::tele 2273 4695 = king black drags
+
+::tele 2516 4646 = daganoth quest place mother
+
+::tele 2121 4918 = Draynor private from map
+
+::tele 2142 4834 = cosmic alter
+
+::tele 2134 4717 = slave cages ( look up to see them,,cannot be walked on )
+
+::tele 2091 3210 = wierd grass land??
+
+
+/*Guilds*/
+rangeguild = 2657 3439
+rangingguild = 2657 3439
+
+fishguild = 2611 3393
+fishingguild = 2611 3393
+
+mineguild = 3016 3339
+miningguild = 3016 3339
+
+craftguild = 2933 3289
+craftingguild = 2933 3289
+
+heroguild = 2902 3510
+herosguild = 2902 3510
+heroesguild = 2902 3510
+
+/*End Guilds*/
+
+crystalchest = 2914 3450
+
+/*Altars*/
+deathaltar = 2207 4836
+cosmicaltar = 2162 4833
+chaosaltar = 2269 4843
+mindaltar = 2796 4818
+airaltar = 2845 4832
+wateraltar = 2713 4836
+earthaltar = 2660 4839
+firealtar = 2584 4836
+bodyaltar = 2527 4833
+lawaltar = 2464 4834
+naturealtar = 2398 4841
+
+/*End Altars*/
+
+falador = 2965 3380
+goblinvillage = 2956 3506
+druidscircle = 2926 3482
+burthrope = 2926 3561
+
+whitewolf = 2848 3498
+catherby = 2815 3447
+camelotcastle = 2758 3495
+seersvillage = 2708 3492
+
+
+barbagil = 2541 3546
+grandtree1 = 2480 3488
+grandtree2 = 2466 3490
+treegnome = 2441 3429
+westardy = 2535 3305
+eastardy = 2659 3308
+prifddinas = 2242 3278
+elfcamp = 2197 3252
+isafdar = 2241 3238
+duelarena = 3360 3213
+alkharid = 3288 3189
+desertmine = 3286 3023
+bedabincamp = 3171 3026
+banditcamp = 3176 2987
+pollnivneach = 3365 2970
+pyramid = 3233 2901
+sophanem = 3305 2755
+uzer = 3490 3090
+mortton = 3489 3288
+canifis = 3506 3496
+phasmatys = 3687 3502
+fenkencastle = 3550 3548
+digsite = 3354 3402
+examcentre = 3354 3344
+varrock = 3214 3424
+barbvillage = 3081 3424
+edgeville = 3093 3493
+
+sarim = 3023 3208
+rimmington = 2957 3214
+draynor = 3093 3244
+lumbridge = 3223 3218
+fightarena = 2585 3150
+gnomevillage1 = 2521 3177
+gnomevillage2 = 2525 3167
+khazard = 2665 3161
+yanille = 2569 3098
+monestary = 3051 3490
+karamja = 2814 3182
+crandor = 2851 3238
+tutisland = 3123 3100
+tzhaar = 2480 5175
+mineess = 2911 4832
+bobsiland = 2526 4777
+
+membersdungeon = 2884 9798
+dramentree = 2861 9736
+karamjadungeon = 2843 9636
+steeldragons = 2719 9433
+bluedragons = 2591 9439
+theogre = 2584 9737
+shadowwarrior = 2705 9758
+subwhitewolf = 2822 9882
+gloryfountain = 2918 9895
+spampdungeon = 3168 9572
+barrowscenter = 3551 9693
+canifis = 3477 9845
+werewol***il = 3549 9865
+eledungeon = 2715 9889
+blurite = 3007 9550
+miniagil = 2759 9557
+runerocks = 3061 3886
+kalphites = 3485 9509
+smokedungeon = 3207 9377
+pyramid4 = 3233 9313
+crashisland = 2893 2724
+apeatoll = 2801 2704
+marimpray = 2807 9201
+marimcreate = 2764 9164
+apeatolldungeon = 2805 9142
+kharazi = 2822 2911
+jungledemon = 2657 4568
+hangar = 2584 4516
+gnomedungeon = 2596 4435
+purplecrystal = 2792 4427
+submage = 2538 4717
+godpray = 2507 4718
+lighttower = 2519 4642
+bigdwarfs = 2776 10162
+bigdwarfs2 = 2838 10126
+bigdwarfs3 = 2923 10191
+waterfall = 2534 3511
+endwild = 3100 3957
+eastbank = 3250 3423
+varrock = 3210 3424
+falador2 = 2964 3378
+lumbridge = 3222 3218
+camelot = 2757 3477
+eardy2 = 2662 3305
+wardy2 = 2529 3307
+lathas = 2516 3369
+gnomestrong = 2461 3443
+kharid = 3293 3174
+shantay = 3304 3116
+kalphlair = 3226 3107
+pyramid2 = 3233 2902
+pollnivneach = 3359 2910
+menaphos = 3274 2784
+yanille = 2606 3093
+gultanoth = 2516 3044
+tutisland2 = 3094 3107
+barbarins = 3082 3420
+entrana = 2834 3335
+
+coaltrucks = 2582 3481
+gvillage = 2956 3506
+stonehenge2 = 2926 3482
+burth = 2926 3559
+wwolf = 2848 3498
+catherb = 2813 3447
+seers = 2708 3492
+barbyagil = 2541 3546
+prifdinas = 2242 3278
+elfcamp2 = 2197 3252
+isafdar2 = 2241 3238
+darena = 3360 3213
+dminecamp = 3286 3023
+bedcamp = 3171 3026
+bandcamp = 3176 2987
+soph = 3305 2755
+uzerruins = 3490 3090
+morton = 3489 3288
+canif = 3506 3496
+portp = 3687 3502
+fenken = 3550 3548
+dsite = 3354 3402
+ecentre = 3354 3344
+edgeville = 3093 3493
+
+psarim = 3023 3208
+rimm = 2957 3214
+farena = 2585 3150
+tgvill = 2525 3167
+pkhazard = 2665 3161
+monkies = 3051 3490
+karamj = 2948 3147
+crandor2 = 2851 3238
+thekbd = 2717 9816
+thebigkq = 3487 9493
+thepass2 = 2337 9798
+wiredwater = 2676 3008
+karamja4memb = 2815 3182
+meetjuna = 3251 9517
+darkroom = 3206 9379
+thepass1 = 2495 9715
+magicarena = 3107 3937
+aatoll = 2755 2784
+jungledemonb = 2714 9183
+jungledemont = 2703 9178
+wagility = 3003 3934
+keldagrim = 2937 9999
+karamjaagil = 2761 9557
+metaldragback = 2713 9459
+metaldragfront = 2713 9564
+desertpyramid = 3233 9315
+thehangar = 2390 9886
+fishplatform = 2782 3273
+boatcrash = 2795 3321
+legendsjungle = 2772 9341
+tzhaar2 = 2480 5175
+mineess2 = 2911 4832
+morningsend = 2044 4649
+dwarfs = 2035 4529
+kbdlair = 2273 4695
+elvenforest = 2309 4597
+goldmine = 2358 4959
+initiate = 2443 4956
+shadowguys = 2738 5081
+barrowstop = 3564 3288
+barrowstunnel = 3568 9695
+barrowschest = 3551 9694
+cwbank = 2441 3090
+castlewars = 2400 3103
+bluedrags = 2910 9801
+blackdemons = 2860 9775
+hellhounds = 2867 9844
+blackdrags = 2829 9826
+
+legends2 = 2377 4705
+magearena = 2519 4719
+scaperune = 2525 4776
+forester = 2602 4775
+theisland = 2527 4547
+fremmymaze = 2652 9999
+
+quizgame = 1952 4768
+trawler = 2013 4820
+sunktrawler = 1951 4825
+emptytrawler = 1886 4830
+mimestage = 2008 4762
+draynor = 2130 4913
+gameroom = 2196 4961
+gashole = 2464 4782
+shilo = 2827 2995
+karamja1 = 2973 2890
+karamja2 = 2973 2910
+greater = 3288 3886
+wildpalace = 3288 3886
+slayertower = 3428 3535
+misc = 2512 3860
+shilo = 2852 2955
+
+party = 2739 3472
+rellaka = 2659 3661
+trollheim = 2910 3612
+tears of guthix = 3257 9517
+
+Pest Control Game: X 2667 Y 2594
+Pest Control Bank: X 2658 Y 2649
+
+2867 9955 - Ice Queen Lair
+3429 3538 - Slayer Tower
+2710 9466 - Brimhaven Dungeon
+2856 3812 - Ice Path
+2480 3437 - Gnome Agility Training
+3281 2765 - Pyramid Plunder room
+3345 3251 - Duel Arena
+2717 9808 - King Black Dragon Cave
+3044 4973 - Rouges Den
+2979 3611 - Green Dragons
+Big water fall ::tele 2534,3511
+Very back of wild ::tele 3100,3957
+Varrock east bank ::tele 3250,3423
+Varrock ::tele 3210,3424
+Falador ::tele 2964,3378
+Lumbridge ::tele 3222,3218
+Camelot ::tele 2757,3477
+East Ardougne ::tele 2662,3305
+West Ardougne ::tele 2529,3307
+King Lathas Training Grounds ::tele 2516,3369
+Tree Gnome Stronghold ::tele 2461,3443
+Al Kharid ::tele 3293,3174
+Shantays Pass ::tele 3304,3116
+Kalphite Lair ::tele 3226,3107
+Pyramid ::tele 3233,2902
+Pollnivneach ::tele 3359,2910
+Menaphos/Sophanem ::tele 3274,2784
+Yanille ::tele 2606,3093
+Gul'Tanoth ::tele 2516,3044
+Tutorial Island ::tele 3094,3107
+Barbarian Village ::tele 3082,3420
+Entrana ::tele 2834,3335
+Heroes Guild ::tele 2902,3510
+Rangers Guild ::tele 2658,3439
+Coal Trucks ::tele 2582,3481
+Goblin Village ::tele 2956,3506
+Druids Circle ::tele 2926,3482
+Burthorpe ::tele 2926,3559
+White wolf mountain ::tele 2848,3498
+Catherby ::tele 2813,3447
+Seers village ::tele 2708,3492
+Fishing guild ::tele 2603,3414
+Barbarian Agility Course ::tele 2541,3546
+Prifddinas ::tele 2242,3278
+Elf camp (Tirannwn) ::tele 2197,3252
+Isafdar (Tirannwn) ::tele 2241,3238
+Duel arena ::tele 3360,3213
+Desert mining camp ::tele 3286,3023
+Bedabin camp ::tele 3171,3026
+Bandit camp ::tele 3176,2987
+Sophanem ::tele 3305,2755
+Ruins of Uzer ::tele 3490,3090
+Mort'ton ::tele 3489,3288
+Canifis ::tele 3506,3496
+Port Phasmatys ::tele 3687,3502
+Fenkenstrain's castle ::tele 3550,3548
+Dig site ::tele 3354,3402
+Exam centre ::tele 3354,3344
+Edgeville ::tele 3093,3493
+Crafting guild ::tele 2933,3285
+Port Sarim ::tele 3023,3208
+Rimmington ::tele 2957,3214
+Draynor village ::tele 3093,3244
+Fight arena ::tele 2585,3150
+Tree gnome village ::tele 2525,3167
+Port Khazard ::tele 2665,3161
+Monastery ::tele 3051,3490
+Karamja ::tele 2948,3147
+Crandor ::tele 2851,3238
+King Black Dragon Lair ::tele 2717,9816
+KQ Lair ::tele 3487,9493
+Underground pass level 2 ::tele 2337,9798
+Weird water place ::tele 2676,3008
+Members Karajama ::tele 2815,3182
+Grave island ::tele 3504,3575
+HAM camp ::tele 3165,9629
+Pyramid under Sophanem ::tele 3277,9171
+Juna the snake ::tele 3251,9517
+Smoky tunnels/dark room (This place needs more tests) 3206,9379
+Underground pass level 1 ::tele 2495,9715
+Mage Arena ::tele 3107,3937
+Ape Atoll ::tele 2755,2784
+Jungle demon area bottom level ::tele 2714,9183
+Jungle demon area top level (use Burst of Strength) ::tele 2703,9178
+Wilderness Agility Course ::tele 3003,3934
+Keldagram ::tele 2937,9999
+Agility arena on Karamja ::tele 2761,9557
+Metal dragon dungeon (back) ::tele 2713,9459
+Metal dragon dungeon (front) ::tele 2713,9564
+Inside the desert treasure pyramid ::tele 3233,9315
+Tree gnome hanger ::tele 2390,9886
+Fishing platform ::tele 2782,3273
+Boat crash island place ::tele 2795,3321
+Legends quest jungle dungeon ::tele 2772,9341
+TzHaar ::tele 2480,5175
+Essence mine ::tele 2911,4832
+Morings end part 1 mine ::tele 2044,4649
+Dwarf cut scene meeting area ::tele 2035,4529
+New KBD lair ::tele 2273,4695
+Elven forest cut scene area ::tele 2309,4597
+Gold mine rock ::tele 2358,4959
+White knight tasks area ::tele 2443,4956
+Rouge maze (Press Burst of Strength) ::tele 3050,5071
+The shadow guys dungeon ::tele 2738,5081
+Barrows top ::tele 3564,3288
+Barrows tunnel ::tele 3568,9695
+Barrows chest ::tele 3551,9694
+CW bank= 2441,3090
+CW center= 2400,3103
+Blue dragons= 2910,9801
+Black demons= 2860 9775
+Hell Hounds= 2867,9844
+Black dragons= 2829,9826
+Chaos rune crafting alter ::tele 2269,4843
+Legends dungeon prt2 ::tele 2375,4705
+Mage arena dungeon ::tele 2519,4719
+Evil Bobs island "scaperune" ::tele 2525,4776
+Distant kingdom (alive) 2576,4655
+Distant kingdom (dead) 2803,4723
+Forester random event ::tele 2602,4775
+Alt area ::tele 2527,4547
+Fremmy maze ::tele 2652,9999
+Death rune altar ::tele 2207,4836
+Cosmic alter ::tele 2162,4833
+Middle of under ground pass ::tele 2168 4726
+Quiz random event ::tele 1952,4768
+Trawler boat ::tele 2013,4820
+Sunk trawler mini game boat ::tele 1951,4825
+Trawler boat empty of water ::tele 1886,4830
+Mime stage ::tele 2008,4762
+"Draynor" ::tele 2130,4913
+Game room ::tele 2196,4961
+Mind alter ::tele 2796,4818
+Air Alter ::tele 2845,4832
+Water Alter ::tele 2713,4836
+Earth Alter ::tele 2660,4839
+Fire Alter ::tele 2584,4836
+Body Alter ::tele 2527,4833
+Law Alter ::tele 2464,4834
+Nature Alter ::tele 2398,4841
+Gas hole ::tele 2464,4782
+Edge of maze ::tele 2885,4550
+Center of maze ::tele 2912,4576
+Falador mine ::tele 3038,9800
+::tele 3157 4822 = drill deamon camp
+
+::tele 2477 4768 = frog cave
+
+::tele 2596 4780 = freaky forester
+
+::tele 2095 4428 = prison pete
+
+::tele 1952 4764 = quiz show
+
+::tele 2338 4747 = Lost and found
+
+::tele 1960 4824 = Twarler Mini-Game
+
+::tele 2015 4826 = twarler mini-game inside
+
+::tele 1971 5001 = WIERD CHRUCH! NOT ON RUNESCAPE!
+
+::tele 1928 5002 = Grave digger
+
+::tele 2584 4838 = fire alter
+
+::tele 2966 9633 = somekind of rat-hole never seen this
+
+::tele 2929 9649 = dragon slayer mace
+
+::tele 2907 9705 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2981 9914 = recipes goblin cook place
+
+::tele 2916 9912 = heroes guild cave
+
+::tele 2932 9848 = chaos druids
+
+::tele 2898 9766 = baby bluedragons
+
+::tele 3048 9582 = ice-warriors & giants
+
+::tele 2977 9515 = recipes crabs
+
+::tele 2973 9505 = recipe water "mini-quest"
+
+::tele 2783 9574 = agility arena
+
+::tele 2835 9562 = karamja lessers
+
+::tele 1891 4947 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2007 4431 = x-mas workshop event wooot!
+
+::tele 2400 4850 = nature altar!
+
+::tele 3421 9622 = quest place (dont remember (or newer seen) what quest)
+
+::tele 1865 5330 = recipe the lum kitchen when started recipe near the secret sky must check if it is possible to see in rs.
+
+::tele 1860 5345 = same as above but no barrier & no chairs expet one why?
+
+::tele 2393 4713 = i don't know prob: quest place (dont remember (or newer seen) what quest)
+
+::tele 2385 4685 = have a relation to the place above what is that?
+
+::tele 2525 4776 = evil bob's island
+
+::tele 2633 4700 = quest place (dont remember (or newer seen) what quest)
+
+::tele 2650 4565 = monkey sadness fight the jungle demon?
+
+::tele 2650 4508 = monkey sadness the gnome glider puzzle!
+
+::tele 3300 9825 = A Soul's Bane quest
+
+::tele 3345 9715 = mage training arena (telegrab) ftw
+
+::tele 3350 9680 = mage training arena (telegrab) ftw another one
+
+::tele 3345 9712 = mage training arena (telegrab) ftw another one NOTE: if you see the same arenas try changin height level!
+
+::tele 2152 5095 = Secret island
+
+::tele 2721 4828 = water alter
+
+::tele 2784 4840 = mind alter
+
+::tele 2842 4835 = air alter
+
+::tele 2898 4819 = rune essent mining
+
+::tele 3029 4834 = abyss
+
+::tele 2528 4833 = wierd alter
+
+::tele 2471 4838 = law alter
+
+::tele 1823 4835 = two ships
+
+::tele 3105 3930 = mage arena
+
+::tele 1894 5333 = secret sky
+
+::tele 1865 5341 = recipie for desaster feast
+
+::tele 3424 9891 = under passage way to canfis
+
+::tele 3681 9889 = ecto plasm floor
+
+::tele 2470 9899 = under gnomes grand tree
+
+::tele 2319 9804 = i'bans trap drop
+
+::tele 2856 3809 = slippery ice path
+
+::tele 3551 9693 = barrows chest
+
+::tele 3177 9753 = under draynore mannor
+
+::tele 3040 9741 = faladore mining guild
+
+::tele 3079 9505 = toturial mining
+
+::tele 3110 9512 = toturial combat train
+
+::tele 3232 2896 = top of piramid for desert tresure
+
+::tele 3291 2764 = desert city
+
+::tele 3298 9179 = under desert city
+
+::tele 2861 3165 = volcano
+
+::tele 2863 9570 = under volcano
+
+::tele 2835 3268 = candor
+
+::tele 2766 3277 = fishing docks
+
+::tele 2446 10147 = daganoth cave ( go to "::tele 2446 9999" then keep walking the right direction then ul get there )
+
+::tele 2438 5172 = volcano lava
+
+::tele 2395 5154 = fight pits
+
+::tele 3234 9896 = wierd place
+
+::tele 3132 9909 = under edgevill
+
+::tele 3233 9313 = under piramid at acent alter
+
+::tele 3363 9639 = mage train up ( shapes )
+
+::tele 3363 9637 = mage train up ( bones )
+
+::tele 3365 9637 = mage train up ( alching )
+
+::tele 3363 2984 = a desert city
+
+::tele 2396 5093 = fight caves
+
+::tele 3559 9895 = football traning corse
+
+::tele 3541 9891 = jumping corse
+
+::tele 3528 9871 = zip line
+
+::tele 3539 9872 = jumping steps
+
+::tele 3555 9947 = cave
+
+::tele 2972 9507 = Under water
+
+::tele 2545 4715 = mage arena room
+
+::tele 2505 4707 = mage arena statues
+
+::tele 3551 9712 = barrows coffins
+
+::tele 2716 9816 = black king dragon
+
+::tele 3487 9493 = kaphite queen place
+
+::tele 2744 3444 = camalot flax
+
+::tele 2273 4695 = king black drags
+
+::tele 2516 4646 = daganoth quest place mother
+
+::tele 2121 4918 = Draynor private from map
+
+::tele 2142 4834 = cosmic alter
+
+::tele 2134 4717 = slave cages ( look up to see them,,cannot be walked on )
+
+::tele 2091 3210 = wierd grass land??
+
+
+/*Guilds*/
+rangeguild = 2657 3439
+rangingguild = 2657 3439
+
+fishguild = 2611 3393
+fishingguild = 2611 3393
+
+mineguild = 3016 3339
+miningguild = 3016 3339
+
+craftguild = 2933 3289
+craftingguild = 2933 3289
+
+heroguild = 2902 3510
+herosguild = 2902 3510
+heroesguild = 2902 3510
+
+/*End Guilds*/
+
+crystalchest = 2914 3450
+
+/*Altars*/
+deathaltar = 2207 4836
+cosmicaltar = 2162 4833
+chaosaltar = 2269 4843
+mindaltar = 2796 4818
+airaltar = 2845 4832
+wateraltar = 2713 4836
+earthaltar = 2660 4839
+firealtar = 2584 4836
+bodyaltar = 2527 4833
+lawaltar = 2464 4834
+naturealtar = 2398 4841
+
+/*End Altars*/
+
+falador = 2965 3380
+goblinvillage = 2956 3506
+druidscircle = 2926 3482
+burthrope = 2926 3561
+
+whitewolf = 2848 3498
+catherby = 2815 3447
+camelotcastle = 2758 3495
+seersvillage = 2708 3492
+
+
+barbagil = 2541 3546
+grandtree1 = 2480 3488
+grandtree2 = 2466 3490
+treegnome = 2441 3429
+westardy = 2535 3305
+eastardy = 2659 3308
+prifddinas = 2242 3278
+elfcamp = 2197 3252
+isafdar = 2241 3238
+duelarena = 3360 3213
+alkharid = 3288 3189
+desertmine = 3286 3023
+bedabincamp = 3171 3026
+banditcamp = 3176 2987
+pollnivneach = 3365 2970
+pyramid = 3233 2901
+sophanem = 3305 2755
+uzer = 3490 3090
+mortton = 3489 3288
+canifis = 3506 3496
+phasmatys = 3687 3502
+fenkencastle = 3550 3548
+digsite = 3354 3402
+examcentre = 3354 3344
+varrock = 3214 3424
+barbvillage = 3081 3424
+edgeville = 3093 3493
+
+sarim = 3023 3208
+rimmington = 2957 3214
+draynor = 3093 3244
+lumbridge = 3223 3218
+fightarena = 2585 3150
+gnomevillage1 = 2521 3177
+gnomevillage2 = 2525 3167
+khazard = 2665 3161
+yanille = 2569 3098
+monestary = 3051 3490
+karamja = 2814 3182
+crandor = 2851 3238
+tutisland = 3123 3100
+tzhaar = 2480 5175
+mineess = 2911 4832
+bobsiland = 2526 4777
+
+membersdungeon = 2884 9798
+dramentree = 2861 9736
+karamjadungeon = 2843 9636
+steeldragons = 2719 9433
+bluedragons = 2591 9439
+theogre = 2584 9737
+shadowwarrior = 2705 9758
+subwhitewolf = 2822 9882
+gloryfountain = 2918 9895
+spampdungeon = 3168 9572
+barrowscenter = 3551 9693
+canifis = 3477 9845
+werewol***il = 3549 9865
+eledungeon = 2715 9889
+blurite = 3007 9550
+miniagil = 2759 9557
+runerocks = 3061 3886
+kalphites = 3485 9509
+smokedungeon = 3207 9377
+pyramid4 = 3233 9313
+crashisland = 2893 2724
+apeatoll = 2801 2704
+marimpray = 2807 9201
+marimcreate = 2764 9164
+apeatolldungeon = 2805 9142
+kharazi = 2822 2911
+jungledemon = 2657 4568
+hangar = 2584 4516
+gnomedungeon = 2596 4435
+purplecrystal = 2792 4427
+submage = 2538 4717
+godpray = 2507 4718
+lighttower = 2519 4642
+bigdwarfs = 2776 10162
+bigdwarfs2 = 2838 10126
+bigdwarfs3 = 2923 10191
+waterfall = 2534 3511
+endwild = 3100 3957
+eastbank = 3250 3423
+varrock = 3210 3424
+falador2 = 2964 3378
+lumbridge = 3222 3218
+camelot = 2757 3477
+eardy2 = 2662 3305
+wardy2 = 2529 3307
+lathas = 2516 3369
+gnomestrong = 2461 3443
+kharid = 3293 3174
+shantay = 3304 3116
+kalphlair = 3226 3107
+pyramid2 = 3233 2902
+pollnivneach = 3359 2910
+menaphos = 3274 2784
+yanille = 2606 3093
+gultanoth = 2516 3044
+tutisland2 = 3094 3107
+barbarins = 3082 3420
+entrana = 2834 3335
+
+coaltrucks = 2582 3481
+gvillage = 2956 3506
+stonehenge2 = 2926 3482
+burth = 2926 3559
+wwolf = 2848 3498
+catherb = 2813 3447
+seers = 2708 3492
+barbyagil = 2541 3546
+prifdinas = 2242 3278
+elfcamp2 = 2197 3252
+isafdar2 = 2241 3238
+darena = 3360 3213
+dminecamp = 3286 3023
+bedcamp = 3171 3026
+bandcamp = 3176 2987
+soph = 3305 2755
+uzerruins = 3490 3090
+morton = 3489 3288
+canif = 3506 3496
+portp = 3687 3502
+fenken = 3550 3548
+dsite = 3354 3402
+ecentre = 3354 3344
+edgeville = 3093 3493
+
+psarim = 3023 3208
+rimm = 2957 3214
+farena = 2585 3150
+tgvill = 2525 3167
+pkhazard = 2665 3161
+monkies = 3051 3490
+karamj = 2948 3147
+crandor2 = 2851 3238
+thekbd = 2717 9816
+thebigkq = 3487 9493
+thepass2 = 2337 9798
+wiredwater = 2676 3008
+karamja4memb = 2815 3182
+meetjuna = 3251 9517
+darkroom = 3206 9379
+thepass1 = 2495 9715
+magicarena = 3107 3937
+aatoll = 2755 2784
+jungledemonb = 2714 9183
+jungledemont = 2703 9178
+wagility = 3003 3934
+keldagrim = 2937 9999
+karamjaagil = 2761 9557
+metaldragback = 2713 9459
+metaldragfront = 2713 9564
+desertpyramid = 3233 9315
+thehangar = 2390 9886
+fishplatform = 2782 3273
+boatcrash = 2795 3321
+legendsjungle = 2772 9341
+tzhaar2 = 2480 5175
+mineess2 = 2911 4832
+morningsend = 2044 4649
+dwarfs = 2035 4529
+kbdlair = 2273 4695
+elvenforest = 2309 4597
+goldmine = 2358 4959
+initiate = 2443 4956
+shadowguys = 2738 5081
+barrowstop = 3564 3288
+barrowstunnel = 3568 9695
+barrowschest = 3551 9694
+cwbank = 2441 3090
+castlewars = 2400 3103
+bluedrags = 2910 9801
+blackdemons = 2860 9775
+hellhounds = 2867 9844
+blackdrags = 2829 9826
+
+legends2 = 2377 4705
+magearena = 2519 4719
+scaperune = 2525 4776
+forester = 2602 4775
+theisland = 2527 4547
+fremmymaze = 2652 9999
+
+quizgame = 1952 4768
+trawler = 2013 4820
+sunktrawler = 1951 4825
+emptytrawler = 1886 4830
+mimestage = 2008 4762
+draynor = 2130 4913
+gameroom = 2196 4961
+gashole = 2464 4782
+shilo = 2827 2995
+karamja1 = 2973 2890
+karamja2 = 2973 2910
+greater = 3288 3886
+wildpalace = 3288 3886
+slayertower = 3428 3535
+misc = 2512 3860
+shilo = 2852 2955
+
+party = 2739 3472
+rellaka = 2659 3661
+trollheim = 2910 3612
+tears of guthix = 3257 9517
+
+Pest Control Game: X 2667 Y 2594
+Pest Control Bank: X 2658 Y 2649
diff --git a/test b/test
new file mode 100644
index 000000000..9b79d200a
--- /dev/null
+++ b/test
@@ -0,0 +1,217 @@
+package core
+
+import core.game.system.SystemShutdownHook
+import core.game.system.mysql.SQLManager
+import core.game.world.map.Location
+import core.tools.mysql.Database
+import core.tools.secondsToTicks
+import org.json.simple.JSONObject
+import java.io.File
+import java.math.BigInteger
+
+/**
+ * A class holding various variables for the server.
+ * @author Ceikry
+ */
+class ServerConstants {
+ companion object {
+ @JvmField
+ var SHUTDOWN_HOOK: Thread = Thread(SystemShutdownHook())
+
+ @JvmField
+ var DATA_PATH: String? = null
+
+ //path to the cache
+ @JvmField
+ var CACHE_PATH: String? = null
+
+ //path for the server store (obsolete, but kept for the sake of system sanity.)
+ @JvmField
+ var STORE_PATH: String? = null
+
+ //path for player saves
+ @JvmField
+ var PLAYER_SAVE_PATH: String? = null
+
+ @JvmField
+ var PLAYER_ATTRIBUTE_PATH = "ish";
+
+ //path to the various config files, such as npc_spawns.json
+ var CONFIG_PATH: String? = null
+
+ @JvmField
+ var GRAND_EXCHANGE_DATA_PATH: String? = null
+
+ @JvmField
+ var RDT_DATA_PATH: String? = null
+
+ @JvmField
+ var OBJECT_PARSER_PATH: String? = null
+
+ @JvmField
+ var SCRIPTS_PATH: String? = null
+
+ @JvmField
+ var DIALOGUE_SCRIPTS_PATH: String? = null
+
+ @JvmField
+ var LOGS_PATH: String? = null
+
+ @JvmField
+ var BOT_DATA_PATH: String? = null
+
+ //the max number of players.
+ @JvmField
+ var MAX_PLAYERS = 0
+
+ //the max number of NPCs
+ @JvmField
+ var MAX_NPCS = 0
+
+ //the location where new players are placed on login.
+ @JvmField
+ var START_LOCATION: Location? = null
+
+ //Location for all home teleports/respawn location
+ @JvmField
+ var HOME_LOCATION: Location? = null
+
+ //the name for the database
+ @JvmField
+ var DATABASE_NAME: String? = null
+
+ //username for the database
+ @JvmField
+ var DATABASE_USER: String? = null
+
+ //password for the database
+ @JvmField
+ var DATABASE_PASS: String? = null
+
+ //address for the database
+ @JvmField
+ var DATABASE_ADDRESS: String? = null
+
+ @JvmField
+ var DATABASE_PORT: String? = null
+
+ @JvmField
+ var WRITE_LOGS: Boolean = false
+
+ @JvmField
+ var BANK_SIZE: Int = 496
+
+ @JvmField
+ var GE_AUTOSAVE_FREQUENCY = secondsToTicks(3600) //1 hour
+
+ @JvmField
+ var GE_AUTOSTOCK_ENABLED = false
+
+ //location names for the ::to command.
+ val TELEPORT_DESTINATIONS = arrayOf(
+ arrayOf(Location.create(2974, 4383, 2), "corp", "corporal", "corporeal"),
+ arrayOf(Location.create(2659, 2649, 0), "pc", "pest control", "pest"),
+ arrayOf(Location.create(3293, 3184, 0), "al kharid", "alkharid", "kharid"),
+ arrayOf(Location.create(3222, 3217, 0), "lumbridge", "lumby"),
+ arrayOf(Location.create(3110, 3168, 0), "wizard tower", "wizards tower", "tower", "wizards"),
+ arrayOf(Location.create(3083, 3249, 0), "draynor", "draynor village"),
+ arrayOf(Location.create(3019, 3244, 0), "port sarim", "sarim"),
+ arrayOf(Location.create(2956, 3209, 0), "rimmington"),
+ arrayOf(Location.create(2965, 3380, 0), "fally", "falador"),
+ arrayOf(Location.create(2895, 3436, 0), "taverley"),
+ arrayOf(Location.create(3080, 3423, 0), "barbarian village", "barb"),
+ arrayOf(Location.create(3213, 3428, 0), "varrock"),
+ arrayOf(Location.create(3164, 3485, 0), "grand exchange", "ge"),
+ arrayOf(Location.create(2917, 3175, 0), "karamja"),
+ arrayOf(Location.create(2450, 5165, 0), "tzhaar"),
+ arrayOf(Location.create(2795, 3177, 0), "brimhaven"),
+ arrayOf(Location.create(2849, 2961, 0), "shilo village", "shilo"),
+ arrayOf(Location.create(2605, 3093, 0), "yanille"),
+ arrayOf(Location.create(2663, 3305, 0), "ardougne", "ardy"),
+ arrayOf(Location.create(2450, 3422, 0), "gnome stronghold", "gnome"),
+ arrayOf(Location.create(2730, 3485, 0), "camelot", "cammy", "seers"),
+ arrayOf(Location.create(2805, 3435, 0), "catherby"),
+ arrayOf(Location.create(2659, 3657, 0), "rellekka"),
+ arrayOf(Location.create(2890, 3676, 0), "trollheim"),
+ arrayOf(Location.create(2914, 3746, 0), "godwars", "gwd", "god wars"),
+ arrayOf(Location.create(3180, 3684, 0), "bounty hunter", "bh"),
+ arrayOf(Location.create(3272, 3687, 0), "clan wars", "clw"),
+ arrayOf(Location.create(3090, 3957, 0), "mage arena", "mage", "magearena", "arena"),
+ arrayOf(Location.create(3069, 10257, 0), "king black dragon", "kbd"),
+ arrayOf(Location.create(3359, 3416, 0), "digsite"),
+ arrayOf(Location.create(3488, 3489, 0), "canifis"),
+ arrayOf(Location.create(3428, 3526, 0), "slayer tower", "slayer"),
+ arrayOf(Location.create(3502, 9483, 2), "kalphite queen", "kq", "kalphite hive", "kalphite"),
+ arrayOf(Location.create(3233, 2913, 0), "pyramid"),
+ arrayOf(Location.create(3419, 2917, 0), "nardah"),
+ arrayOf(Location.create(3482, 3090, 0), "uzer"),
+ arrayOf(Location.create(3358, 2970, 0), "pollnivneach", "poln"),
+ arrayOf(Location.create(3305, 2788, 0), "sophanem"),
+ arrayOf(Location.create(2898, 3544, 0), "burthorpe", "burthorp"),
+ arrayOf(Location.create(3088, 3491, 0), "edge", "edgeville"),
+ arrayOf(Location.create(3169, 3034, 0), "bedabin"),
+ arrayOf(Location.create(3565, 3289, 0), "barrows"),
+ arrayOf(Location.create(3016, 3513, 0), "bkf", "black knights fortress"),
+ arrayOf(Location.create(3052, 3481, 0), "monastery")
+ )
+
+ @JvmField
+ var DATABASE: Database? = null
+
+ //if SQL is enabled
+ @JvmField
+ var MYSQL = true
+
+ //the server name
+ @JvmField
+ var SERVER_NAME: String = ""
+
+ //The RSA_KEY for the server.
+ @JvmField
+ var EXPONENT = BigInteger("109343860332353211924482133180092752644123222251570035818592399718899543340247882615012834369709881454157761178411602406231525266135486523035643931381979724348736863559735931163013508521663192459153115214061347330689961869574877386212674606945486858607548180282077056338048348202722564364196572081666257569141")
+
+ //The MODULUS for the server.
+ @JvmField
+ var MODULUS = BigInteger("96982303379631821170939875058071478695026608406924780574168393250855797534862289546229721580153879336741968220328805101128831071152160922518190059946555203865621183480223212969502122536662721687753974815205744569357388338433981424032996046420057284324856368815997832596174397728134370577184183004453899764051")
+
+ /**
+ * Parses a JSONObject and retrieves the values for all settings in this file.
+ * @author Ceikry
+ * @param data : The JSONObject to parse.
+ */
+ fun parse(data: JSONObject) {
+ MAX_PLAYERS = data["max_players"].toString().toInt()
+ MAX_NPCS = data["max_npcs"].toString().toInt()
+
+ START_LOCATION = JSONUtils.parseLocation(data["new_player_location"].toString())
+ HOME_LOCATION = JSONUtils.parseLocation(data["home_location"].toString())
+
+ DATA_PATH = JSONUtils.parsePath(data["data_path"].toString())
+ CACHE_PATH = JSONUtils.parsePath(data["cache_path"].toString())
+ STORE_PATH = JSONUtils.parsePath(data["store_path"].toString())
+ PLAYER_SAVE_PATH = JSONUtils.parsePath(data["save_path"].toString())
+ CONFIG_PATH = JSONUtils.parsePath(data["configs_path"].toString())
+ PLAYER_ATTRIBUTE_PATH = PLAYER_SAVE_PATH + "attributes" + File.separator
+ GRAND_EXCHANGE_DATA_PATH = JSONUtils.parsePath(data["grand_exchange_data_path"].toString())
+ BOT_DATA_PATH = JSONUtils.parsePath(data["bot_data_path"].toString())
+ RDT_DATA_PATH = JSONUtils.parsePath(data["rare_drop_table_path"].toString())
+ OBJECT_PARSER_PATH = JSONUtils.parsePath(data["object_parser_path"].toString())
+ SCRIPTS_PATH = JSONUtils.parsePath(data["scripts_path"].toString())
+ DIALOGUE_SCRIPTS_PATH = JSONUtils.parsePath(data["dialogue_scripts_path"].toString())
+ if(data.containsKey("logs_path")){
+ LOGS_PATH = data["logs_path"].toString()
+ }
+ if(data.containsKey("writeLogs")){
+ WRITE_LOGS = data["writeLogs"] as Boolean
+ }
+
+ DATABASE_NAME = data["database_name"].toString()
+ DATABASE_USER = data["database_username"].toString()
+ DATABASE_PASS = data["database_password"].toString()
+ DATABASE_ADDRESS = data["database_address"].toString()
+ DATABASE_PORT = data["database_port"].toString()
+
+ DATABASE = Database(DATABASE_ADDRESS, DATABASE_NAME, DATABASE_USER, DATABASE_PASS)
+ }
+ }
+}
\ No newline at end of file