- // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.kpdus.com/jad.html
- // Decompiler options: packimports(3)
- import java.applet.AppletContext;
- import java.awt.*;
- import java.io.*;
- import java.math.BigInteger;
- import java.net.*;
- import java.util.zip.CRC32;
- import sign.signlink;
- public class client extends RSApplet {
- private static String intToKOrMilLongName(int i)
- {
- String s = String.valueOf(i);
- for(int k = s.length() - 3; k > 0; k -= 3)
- s = s.substring(0, k) + "," + s.substring(k);
- if(s.length() > 8)
- s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
- else
- if(s.length() > 4)
- s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
- return " " + s;
- }
- private void stopMidi()
- {
- signlink.midifade = 0;
- signlink.midi = "stop";
- }
- private boolean menuHasAddFriend(int j)
- {
- if(j < 0)
- return false;
- int k = menuActionID[j];
- if(k >= 2000)
- k -= 2000;
- return k == 337;
- }
- public void drawChannelButtons() {
- String text[] = { "On", "Friends", "Off", "Hide" };
- int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
- switch(cButtonCPos) {
- case 0:
- //chatButtons[1].drawSprite(5, 142);
- break;
- case 1:
- //chatButtons[1].drawSprite(71, 142);
- break;
- case 2:
- //chatButtons[1].drawSprite(137, 142);
- break;
- case 3:
- //chatButtons[1].drawSprite(203, 142);
- break;
- }
- aTextDrawingArea_1271.method389(true, 422, 0xffffff, "Report Abuse", 147);
- aTextDrawingArea_1271.method389(true, 25, 0xffffff, "Public chat", 142);
- aTextDrawingArea_1271.method389(true, 150, 0xffffff, "Private chat", 142);
- aTextDrawingArea_1271.method389(true, 285, 0xffffff, "Trade/compete", 142);
- aTextDrawingArea_1271.method382(textColor[publicChatMode], 55, text[publicChatMode], 153, true);
- aTextDrawingArea_1271.method382(textColor[privateChatMode], 180, text[privateChatMode], 153, true);
- aTextDrawingArea_1271.method382(textColor[tradeMode], 325, text[tradeMode], 153, true);
- }
- private void drawChatArea() {
- aRSImageProducer_1166.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1180;
- chatArea.drawSprite(0, 0);
- backBase1.method361(0, 116);
- drawChannelButtons();
- if(messagePromptRaised) {
- chatTextDrawingArea.drawText(0, aString1121, 60, 259);
- chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
- } else if(inputDialogState == 1) {
- chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
- chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
- } else if(inputDialogState == 2) {
- chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
- chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
- } else if(aString844 != null) {
- chatTextDrawingArea.drawText(0, aString844, 60, 259);
- chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
- } else if(backDialogID != -1) {
- drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
- } else if(dialogID != -1) {
- drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
- } else {
- int j77 = -3;
- TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
- int j = 0;
- DrawingArea.setDrawingArea(96, 0, 463, 20);
- for(int k = 0; k < 100; k++)
- if(chatMessages[k] != null)
- {
- int l = chatTypes[k];
- int i1 = (90 - j * 15) + anInt1089;
- String s1 = chatNames[k];
- byte byte0 = 0;
- if(s1 != null && s1.startsWith("@cr1@"))
- {
- s1 = s1.substring(5);
- byte0 = 1;
- }
- if(s1 != null && s1.startsWith("@cr2@"))
- {
- s1 = s1.substring(5);
- byte0 = 2;
- }
- if(l == 0) {
- if(i1 > 0 && i1 < 110)
- textDrawingArea.method389(false, 19, 0, chatMessages[k], i1);//chat color enabled
- j++;
- j77++;
- }
- /*if(l == 0)
- {
- if(i1 > 0 && i1 < 110)
- textDrawingArea.method385(0, chatMessages[k], i1, 19);
- j++;
- }*/
- if((l == 1 || l == 2) && (l == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1)))
- {
- if(i1 > 0 && i1 < 110)
- {
- int j1 = 19;
- if(byte0 == 1)
- {
- modIcons[0].method361(j1, i1 - 12);
- j1 += 14;
- }
- if(byte0 == 2)
- {
- modIcons[1].method361(j1, i1 - 12);
- j1 += 14;
- }
- textDrawingArea.method385(2, s1 + ":", i1, j1);
- j1 += textDrawingArea.getTextWidth(s1) + 8;
- textDrawingArea.method385(255, chatMessages[k], i1, j1);
- }
- j++;
- }
- if((l == 3 || l == 7) && splitPrivateChat == 0 && (l == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1)))
- {
- if(i1 > 0 && i1 < 110)
- {
- int k1 = 4;
- textDrawingArea.method385(0, " From", i1, k1);
- k1 += textDrawingArea.getTextWidth(" From ");
- if(byte0 == 1)
- {
- modIcons[0].method361(k1, i1 - 12);
- k1 += 14;
- }
- if(byte0 == 2)
- {
- modIcons[1].method361(k1, i1 - 12);
- k1 += 14;
- }
- textDrawingArea.method385(0, s1 + ":", i1, k1);
- k1 += textDrawingArea.getTextWidth(s1) + 8;
- textDrawingArea.method385(0x800000, chatMessages[k], i1, k1);
- }
- j++;
- }
- if(l == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1)))
- {
- if(i1 > 0 && i1 < 110)
- textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], i1, 18);
- j++;
- }
- if(l == 5 && splitPrivateChat == 0 && privateChatMode < 2)
- {
- if(i1 > 0 && i1 < 110)
- textDrawingArea.method385(0x800000, chatMessages[k], i1, 4);
- j++;
- }
- if(l == 6 && splitPrivateChat == 0 && privateChatMode < 2)
- {
- if(i1 > 0 && i1 < 110)
- {
- textDrawingArea.method385(0, " To " + s1 + ":", i1, 4);
- textDrawingArea.method385(0x800000, chatMessages[k], i1, 12 + textDrawingArea.getTextWidth(" To " + s1));
- }
- j++;
- }
- if(l == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1)))
- {
- if(i1 > 0 && i1 < 110)
- textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], i1, 4);
- j++;
- }
- }
- DrawingArea.defaultDrawingAreaSize();
- anInt1211 = j * 14 + 7;
- if(anInt1211 < 78)
- anInt1211 = 78;
- drawScrollbar(77, anInt1211 - anInt1089 - 77, 19, 480, anInt1211);
- String s;
- if(myPlayer != null && myPlayer.name != null)
- s = myPlayer.name;
- else
- s = TextClass.fixName(myUsername);
- textDrawingArea.method385(0, s + ":", 110, 19);
- textDrawingArea.drawChatInput(255, 20 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 110, false);
- DrawingArea.method339(96, 0x000000, 479, 17);
- }
- if(menuOpen && menuScreenArea == 2) {
- drawMenu();
- }
- aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
- aRSImageProducer_1165.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1182;
- }
- public void init() {
- try {
- nodeID = 10;
- portOff = 0;
- setLowMem();
- isMembers = true;
- signlink.storeid = 32;
- signlink.startpriv(InetAddress.getLocalHost());
- initClientFrame(505,767);
- }
- catch (Exception exception) {
- return;
- }
- }
- public void startRunnable(Runnable runnable, int i)
- {
- if(i > 10)
- i = 10;
- if(signlink.mainapp != null)
- {
- signlink.startthread(runnable, i);
- } else
- {
- super.startRunnable(runnable, i);
- }
- }
- public Socket openSocket(int port)
- throws IOException
- {
- return new Socket(InetAddress.getByName(server), port);
- }
- private void processMenuClick()
- {
- if(activeInterfaceType != 0)
- return;
- int j = super.clickMode3;
- if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
- j = 0;
- if(menuOpen) {
- if(j != 1) {
- int k = super.mouseX;
- int j1 = super.mouseY;
- if(menuScreenArea == 0) {
- k -= 4;
- j1 -= 4;
- }
- if(menuScreenArea == 1) {
- k -= 519;
- j1 -= 168;
- }
- if(menuScreenArea == 2) {
- k -= 17;
- j1 -= 338;
- }
- if(menuScreenArea == 3) {
- k -= 519;
- j1 -= 0;
- }
- if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + anInt952 + 10)
- {
- menuOpen = false;
- if(menuScreenArea == 1)
- needDrawTabArea = true;
- if(menuScreenArea == 2)
- inputTaken = true;
- }
- }
- if(j == 1) {
- int l = menuOffsetX;
- int k1 = menuOffsetY;
- int i2 = menuWidth;
- int k2 = super.saveClickX;
- int l2 = super.saveClickY;
- if(menuScreenArea == 0) {
- k2 -= 4;
- l2 -= 4;
- }
- if(menuScreenArea == 1) {
- k2 -= 519;
- l2 -= 168;
- }
- if(menuScreenArea == 2) {
- k2 -= 17;
- l2 -= 338;
- }
- if(menuScreenArea == 3) {
- k2 -= 519;
- l2 -= 0;
- }
- int i3 = -1;
- for(int j3 = 0; j3 < menuActionRow; j3++)
- {
- int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
- if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
- i3 = j3;
- }
- if(i3 != -1)
- doAction(i3);
- menuOpen = false;
- if(menuScreenArea == 1)
- needDrawTabArea = true;
- if(menuScreenArea == 2)
- {
- inputTaken = true;
- }
- }
- } else
- {
- if(j == 1 && menuActionRow > 0)
- {
- int i1 = menuActionID[menuActionRow - 1];
- if(i1 == 632 || i1 == 78 || i1 == 867 || i1 == 431 || i1 == 53 || i1 == 74 || i1 == 454 || i1 == 539 || i1 == 493 || i1 == 847 || i1 == 447 || i1 == 1125)
- {
- int l1 = menuActionCmd2[menuActionRow - 1];
- int j2 = menuActionCmd3[menuActionRow - 1];
- RSInterface class9 = RSInterface.interfaceCache[j2];
- if(class9.aBoolean259 || class9.aBoolean235)
- {
- aBoolean1242 = false;
- anInt989 = 0;
- anInt1084 = j2;
- anInt1085 = l1;
- activeInterfaceType = 2;
- anInt1087 = super.saveClickX;
- anInt1088 = super.saveClickY;
- if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
- activeInterfaceType = 1;
- if(RSInterface.interfaceCache[j2].parentID == backDialogID)
- activeInterfaceType = 3;
- return;
- }
- }
- }
- if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
- j = 2;
- if(j == 1 && menuActionRow > 0)
- doAction(menuActionRow - 1);
- if(j == 2 && menuActionRow > 0)
- determineMenuSize();
- }
- }
- public static int totalRead = 0;
- public static String getFileNameWithoutExtension(String fileName) {
- File tmpFile = new File(fileName);
- tmpFile.getName();
- int whereDot = tmpFile.getName().lastIndexOf('.');
- if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
- return tmpFile.getName().substring(0, whereDot);
- }
- return "";
- }
- public void preloadModels() {
- File file = new File (signlink.findcachedir() + ("/Raw/"));
- File[] fileArray = file.listFiles();
- for(int y = 0; y < fileArray.length; y++) {
- String s = fileArray[y].getName();
- byte[] buffer = ReadFile("./Raw/"+s);
- Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
- }
- }
- public static final byte[] ReadFile(String s) {
- try {
- byte abyte0[];
- File file = new File(s);
- int i = (int)file.length();
- abyte0 = new byte[i];
- DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
- datainputstream.readFully(abyte0, 0, i);
- datainputstream.close();
- totalRead++;
- return abyte0;
- } catch(Exception e) {
- System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
- return null;
- }
- }
- public void models() {
- for(int ModelIndex = 0; ModelIndex < 50000; ModelIndex++) {
- byte[] abyte0 = getModel(ModelIndex);
- if(abyte0 != null && abyte0.length > 0) {
- decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
- pushMessage("Model added successfully!", 0, "");
- }
- }
- }
- private void saveMidi(boolean flag, byte abyte0[])
- {
- signlink.midifade = flag ? 1 : 0;
- signlink.midisave(abyte0, abyte0.length);
- }
- private void method22()
- {
- try
- {
- anInt985 = -1;
- aClass19_1056.removeAll();
- aClass19_1013.removeAll();
- Texture.method366();
- unlinkMRUNodes();
- worldController.initToNull();
- System.gc();
- for(int i = 0; i < 4; i++)
- aClass11Array1230[i].method210();
- for(int l = 0; l < 4; l++)
- {
- for(int k1 = 0; k1 < 104; k1++)
- {
- for(int j2 = 0; j2 < 104; j2++)
- byteGroundArray[l][k1][j2] = 0;
- }
- }
- ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
- int k2 = aByteArrayArray1183.length;
- stream.createFrame(0);
- if(!aBoolean1159)
- {
- for(int i3 = 0; i3 < k2; i3++)
- {
- int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
- int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
- byte abyte0[] = aByteArrayArray1183[i3];
- if(abyte0 != null)
- objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
- }
- for(int j4 = 0; j4 < k2; j4++)
- {
- int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
- int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
- byte abyte2[] = aByteArrayArray1183[j4];
- if(abyte2 == null && anInt1070 < 800)
- objectManager.method174(k7, 64, 64, l5);
- }
- anInt1097++;
- if(anInt1097 > 160)
- {
- anInt1097 = 0;
- stream.createFrame(238);
- stream.writeWordBigEndian(96);
- }
- stream.createFrame(0);
- for(int i6 = 0; i6 < k2; i6++)
- {
- byte abyte1[] = aByteArrayArray1247[i6];
- if(abyte1 != null)
- {
- int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
- int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
- objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
- }
- }
- }
- if(aBoolean1159)
- {
- for(int j3 = 0; j3 < 4; j3++)
- {
- for(int k4 = 0; k4 < 13; k4++)
- {
- for(int j6 = 0; j6 < 13; j6++)
- {
- int l7 = anIntArrayArrayArray1129[j3][k4][j6];
- if(l7 != -1)
- {
- int i9 = l7 >> 24 & 3;
- int l9 = l7 >> 1 & 3;
- int j10 = l7 >> 14 & 0x3ff;
- int l10 = l7 >> 3 & 0x7ff;
- int j11 = (j10 / 8 << 8) + l10 / 8;
- for(int l11 = 0; l11 < anIntArray1234.length; l11++)
- {
- if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
- continue;
- objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
- break;
- }
- }
- }
- }
- }
- for(int l4 = 0; l4 < 13; l4++)
- {
- for(int k6 = 0; k6 < 13; k6++)
- {
- int i8 = anIntArrayArrayArray1129[0][l4][k6];
- if(i8 == -1)
- objectManager.method174(k6 * 8, 8, 8, l4 * 8);
- }
- }
- stream.createFrame(0);
- for(int l6 = 0; l6 < 4; l6++)
- {
- for(int j8 = 0; j8 < 13; j8++)
- {
- for(int j9 = 0; j9 < 13; j9++)
- {
- int i10 = anIntArrayArrayArray1129[l6][j8][j9];
- if(i10 != -1)
- {
- int k10 = i10 >> 24 & 3;
- int i11 = i10 >> 1 & 3;
- int k11 = i10 >> 14 & 0x3ff;
- int i12 = i10 >> 3 & 0x7ff;
- int j12 = (k11 / 8 << 8) + i12 / 8;
- for(int k12 = 0; k12 < anIntArray1234.length; k12++)
- {
- if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
- continue;
- objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
- break;
- }
- }
- }
- }
- }
- }
- stream.createFrame(0);
- objectManager.method171(aClass11Array1230, worldController);
- aRSImageProducer_1165.initDrawingArea();
- stream.createFrame(0);
- int k3 = ObjectManager.anInt145;
- if(k3 > plane)
- k3 = plane;
- if(k3 < plane - 1)
- k3 = plane - 1;
- if(lowMem)
- worldController.method275(ObjectManager.anInt145);
- else
- worldController.method275(0);
- for(int i5 = 0; i5 < 104; i5++)
- {
- for(int i7 = 0; i7 < 104; i7++)
- spawnGroundItem(i5, i7);
- }
- anInt1051++;
- if(anInt1051 > 98)
- {
- anInt1051 = 0;
- stream.createFrame(150);
- }
- method63();
- }
- catch(Exception exception) { }
- ObjectDef.mruNodes1.unlinkAll();
- if(super.gameFrame != null)
- {
- stream.createFrame(210);
- stream.writeDWord(0x3f008edd);
- }
- if(lowMem && signlink.cache_dat != null)
- {
- int j = onDemandFetcher.getVersionCount(0);
- for(int i1 = 0; i1 < j; i1++)
- {
- int l1 = onDemandFetcher.getModelIndex(i1);
- if((l1 & 0x79) == 0)
- Model.method461(i1);
- }
- }
- System.gc();
- Texture.method367();
- onDemandFetcher.method566();
- int k = (anInt1069 - 6) / 8 - 1;
- int j1 = (anInt1069 + 6) / 8 + 1;
- int i2 = (anInt1070 - 6) / 8 - 1;
- int l2 = (anInt1070 + 6) / 8 + 1;
- if(aBoolean1141)
- {
- k = 49;
- j1 = 50;
- i2 = 49;
- l2 = 50;
- }
- for(int l3 = k; l3 <= j1; l3++)
- {
- for(int j5 = i2; j5 <= l2; j5++)
- if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
- {
- int j7 = onDemandFetcher.method562(0, j5, l3);
- if(j7 != -1)
- onDemandFetcher.method560(j7, 3);
- int k8 = onDemandFetcher.method562(1, j5, l3);
- if(k8 != -1)
- onDemandFetcher.method560(k8, 3);
- }
- }
- }
- private void unlinkMRUNodes()
- {
- ObjectDef.mruNodes1.unlinkAll();
- ObjectDef.mruNodes2.unlinkAll();
- EntityDef.mruNodes.unlinkAll();
- ItemDef.mruNodes2.unlinkAll();
- ItemDef.mruNodes1.unlinkAll();
- Player.mruNodes.unlinkAll();
- SpotAnim.aMRUNodes_415.unlinkAll();
- }
- private void method24(int i)
- {
- int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
- int j = ai.length;
- for(int k = 0; k < j; k++)
- ai[k] = 0;
- for(int l = 1; l < 103; l++)
- {
- int i1 = 24628 + (103 - l) * 512 * 4;
- for(int k1 = 1; k1 < 103; k1++)
- {
- if((byteGroundArray[i][k1][l] & 0x18) == 0)
- worldController.method309(ai, i1, i, k1, l);
- if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
- worldController.method309(ai, i1, i + 1, k1, l);
- i1 += 4;
- }
- }
- int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
- int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
- aClass30_Sub2_Sub1_Sub1_1263.method343();
- for(int i2 = 1; i2 < 103; i2++)
- {
- for(int j2 = 1; j2 < 103; j2++)
- {
- if((byteGroundArray[i][j2][i2] & 0x18) == 0)
- method50(i2, j1, j2, l1, i);
- if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
- method50(i2, j1, j2, l1, i + 1);
- }
- }
- aRSImageProducer_1165.initDrawingArea();
- anInt1071 = 0;
- for(int k2 = 0; k2 < 104; k2++)
- {
- for(int l2 = 0; l2 < 104; l2++)
- {
- int i3 = worldController.method303(plane, k2, l2);
- if(i3 != 0)
- {
- i3 = i3 >> 14 & 0x7fff;
- int j3 = ObjectDef.forID(i3).anInt746;
- if(j3 >= 0)
- {
- int k3 = k2;
- int l3 = l2;
- if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
- {
- byte byte0 = 104;
- byte byte1 = 104;
- int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
- for(int i4 = 0; i4 < 10; i4++)
- {
- int j4 = (int)(Math.random() * 4D);
- if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
- k3--;
- if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
- k3++;
- if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
- l3--;
- if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
- l3++;
- }
- }
- aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
- anIntArray1072[anInt1071] = k3;
- anIntArray1073[anInt1071] = l3;
- anInt1071++;
- }
- }
- }
- }
- }
- private void spawnGroundItem(int i, int j)
- {
- NodeList class19 = groundArray[plane][i][j];
- if(class19 == null)
- {
- worldController.method295(plane, i, j);
- return;
- }
- int k = 0xfa0a1f01;
- Object obj = null;
- for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
- {
- ItemDef itemDef = ItemDef.forID(item.ID);
- int l = itemDef.value;
- if(itemDef.stackable)
- l *= item.anInt1559 + 1;
- // notifyItemSpawn(item, i + baseX, j + baseY);
- if(l > k)
- {
- k = l;
- obj = item;
- }
- }
- class19.insertTail(((Node) (obj)));
- Object obj1 = null;
- Object obj2 = null;
- for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
- {
- if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
- obj1 = class30_sub2_sub4_sub2_1;
- if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
- obj2 = class30_sub2_sub4_sub2_1;
- }
- int i1 = i + (j << 7) + 0x60000000;
- worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
- }
- private void method26(boolean flag)
- {
- for(int j = 0; j < npcCount; j++)
- {
- NPC npc = npcArray[npcIndices[j]];
- int k = 0x20000000 + (npcIndices[j] << 14);
- if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
- continue;
- int l = npc.x >> 7;
- int i1 = npc.y >> 7;
- if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
- continue;
- if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
- {
- if(anIntArrayArray929[l][i1] == anInt1265)
- continue;
- anIntArrayArray929[l][i1] = anInt1265;
- }
- if(!npc.desc.aBoolean84)
- k += 0x80000000;
- worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
- }
- }
- private boolean replayWave()
- {
- return signlink.wavereplay();
- }
- private void loadError()
- {
- String s = "ondemand";//was a constant parameter
- System.out.println(s);
- try
- {
- getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
- }
- catch(Exception exception)
- {
- exception.printStackTrace();
- }
- do
- try
- {
- Thread.sleep(1000L);
- }
- catch(Exception _ex) { }
- while(true);
- }
- private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
- {
- if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
- return;
- if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
- return;
- int k1 = class9.children.length;
- for(int l1 = 0; l1 < k1; l1++)
- {
- int i2 = class9.childX[l1] + i;
- int j2 = (class9.childY[l1] + l) - j1;
- RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
- i2 += class9_1.anInt263;
- j2 += class9_1.anInt265;
- if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- if(class9_1.mOverInterToTrigger >= 0)
- anInt886 = class9_1.mOverInterToTrigger;
- else
- anInt886 = class9_1.id;
- if(class9_1.type == 0)
- {
- buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
- if(class9_1.scrollMax > class9_1.height)
- method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
- } else
- {
- if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- boolean flag = false;
- if(class9_1.contentType != 0)
- flag = buildFriendsListMenu(class9_1);
- if(!flag)
- {
- //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
- //menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id; <- BACKUP
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 315;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- String s = class9_1.selectedActionName;
- if(s.indexOf(" ") != -1)
- s = s.substring(0, s.indexOf(" "));
- menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
- menuActionID[menuActionRow] = 626;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- menuActionName[menuActionRow] = "Close";
- menuActionID[menuActionRow] = 200;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
- //menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id; <- BACKUP
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 169;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
- //menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id; <- BACKUP
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 646;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
- {
- //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
- //menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id; <- BACKUP
- menuActionName[menuActionRow] = class9_1.tooltip;
- menuActionID[menuActionRow] = 679;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.type == 2)
- {
- int k2 = 0;
- for(int l2 = 0; l2 < class9_1.height; l2++)
- {
- for(int i3 = 0; i3 < class9_1.width; i3++)
- {
- int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
- int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
- if(k2 < 20)
- {
- j3 += class9_1.spritesX[k2];
- k3 += class9_1.spritesY[k2];
- }
- if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
- {
- mouseInvInterfaceIndex = k2;
- lastActiveInvInterface = class9_1.id;
- if(class9_1.inv[k2] > 0)
- {
- ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
- if(itemSelected == 1 && class9_1.isInventoryInterface)
- {
- if(class9_1.id != anInt1284 || k2 != anInt1283)
- {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 870;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else
- if(spellSelected == 1 && class9_1.isInventoryInterface)
- {
- if((spellUsableOn & 0x10) == 16)
- {
- menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 543;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- } else
- {
- if(class9_1.isInventoryInterface)
- {
- for(int l3 = 4; l3 >= 3; l3--)
- if(itemDef.actions != null && itemDef.actions[l3] != null)
- {
- menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
- if(l3 == 3)
- menuActionID[menuActionRow] = 493;
- if(l3 == 4)
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- } else
- if(l3 == 4)
- {
- menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 847;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if(class9_1.usableItemInterface)
- {
- menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 447;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- if(class9_1.isInventoryInterface && itemDef.actions != null)
- {
- for(int i4 = 2; i4 >= 0; i4--)
- if(itemDef.actions[i4] != null)
- {
- menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
- if(i4 == 0)
- menuActionID[menuActionRow] = 74;
- if(i4 == 1)
- menuActionID[menuActionRow] = 454;
- if(i4 == 2)
- menuActionID[menuActionRow] = 539;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- if(class9_1.actions != null)
- {
- for(int j4 = 4; j4 >= 0; j4--)
- if(class9_1.actions[j4] != null)
- {
- menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
- if(j4 == 0)
- menuActionID[menuActionRow] = 632;
- if(j4 == 1)
- menuActionID[menuActionRow] = 78;
- if(j4 == 2)
- menuActionID[menuActionRow] = 867;
- if(j4 == 3)
- menuActionID[menuActionRow] = 431;
- if(j4 == 4)
- menuActionID[menuActionRow] = 53;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
- menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 1125;
- menuActionCmd1[menuActionRow] = itemDef.id;
- menuActionCmd2[menuActionRow] = k2;
- menuActionCmd3[menuActionRow] = class9_1.id;
- menuActionRow++;
- }
- }
- }
- k2++;
- }
- }
- }
- }
- }
- }
- private void drawScrollbar(int j, int k, int l, int i1, int j1)
- {
- scrollBar1.method361(i1, l);
- scrollBar2.method361(i1, (l + j) - 16);
- DrawingArea.drawPixels(j - 32, l + 16, i1, anInt1002, 16);
- int k1 = ((j - 32) * j) / j1;
- if(k1 < 8)
- k1 = 8;
- int l1 = ((j - 32 - k1) * k) / (j1 - j);
- DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
- DrawingArea.method341(l + 16 + l1, anInt902, k1, i1);
- DrawingArea.method341(l + 16 + l1, anInt902, k1, i1 + 1);
- DrawingArea.method339(l + 16 + l1, anInt902, 16, i1);
- DrawingArea.method339(l + 17 + l1, anInt902, 16, i1);
- DrawingArea.method341(l + 16 + l1, anInt927, k1, i1 + 15);
- DrawingArea.method341(l + 17 + l1, anInt927, k1 - 1, i1 + 14);
- DrawingArea.method339(l + 15 + l1 + k1, anInt927, 16, i1);
- DrawingArea.method339(l + 14 + l1 + k1, anInt927, 15, i1 + 1);
- }
- private void updateNPCs(Stream stream, int i)
- {
- anInt839 = 0;
- anInt893 = 0;
- method139(stream);
- method46(i, stream);
- method86(stream);
- for(int k = 0; k < anInt839; k++)
- {
- int l = anIntArray840[k];
- if(npcArray[l].anInt1537 != loopCycle)
- {
- npcArray[l].desc = null;
- npcArray[l] = null;
- }
- }
- if(stream.currentOffset != i)
- {
- signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
- throw new RuntimeException("eek");
- }
- for(int i1 = 0; i1 < npcCount; i1++)
- if(npcArray[npcIndices[i1]] == null)
- {
- signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
- throw new RuntimeException("eek");
- }
- }
- private int cButtonHPos;
- private int cButtonHCPos;
- private int cButtonCPos;
- private void processChatModeClick()
- {
- if(super.clickMode3 == 1)
- {
- if(super.saveClickX >= 6 && super.saveClickX <= 106 && super.saveClickY >= 467 && super.saveClickY <= 499)
- {
- publicChatMode = (publicChatMode + 1) % 4;
- aBoolean1233 = true;
- inputTaken = true;
- stream.createFrame(95);
- stream.writeWordBigEndian(publicChatMode);
- stream.writeWordBigEndian(privateChatMode);
- stream.writeWordBigEndian(tradeMode);
- }
- if(super.saveClickX >= 135 && super.saveClickX <= 235 && super.saveClickY >= 467 && super.saveClickY <= 499)
- {
- privateChatMode = (privateChatMode + 1) % 3;
- aBoolean1233 = true;
- inputTaken = true;
- stream.createFrame(95);
- stream.writeWordBigEndian(publicChatMode);
- stream.writeWordBigEndian(privateChatMode);
- stream.writeWordBigEndian(tradeMode);
- }
- if(super.saveClickX >= 273 && super.saveClickX <= 373 && super.saveClickY >= 467 && super.saveClickY <= 499)
- {
- tradeMode = (tradeMode + 1) % 3;
- aBoolean1233 = true;
- inputTaken = true;
- stream.createFrame(95);
- stream.writeWordBigEndian(publicChatMode);
- stream.writeWordBigEndian(privateChatMode);
- stream.writeWordBigEndian(tradeMode);
- }
- if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 467 && super.saveClickY <= 499) {
- if(openInterfaceID == -1) {
- clearTopInterfaces();
- reportAbuseInput = "";
- canMute = false;
- for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
- if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
- continue;
- reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
- break;
- }
- } else {
- pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
- }
- }
- }
- }
- private void method33(int i)
- {
- int j = Varp.cache[i].anInt709;
- if(j == 0)
- return;
- int k = variousSettings[i];
- if(j == 1)
- {
- if(k == 1)
- Texture.method372(0.90000000000000002D);
- if(k == 2)
- Texture.method372(0.80000000000000004D);
- if(k == 3)
- Texture.method372(0.69999999999999996D);
- if(k == 4)
- Texture.method372(0.59999999999999998D);
- ItemDef.mruNodes1.unlinkAll();
- welcomeScreenRaised = true;
- }
- if(j == 3)
- {
- boolean flag1 = musicEnabled;
- if(k == 0)
- {
- adjustVolume(musicEnabled, 0);
- musicEnabled = true;
- }
- if(k == 1)
- {
- adjustVolume(musicEnabled, -400);
- musicEnabled = true;
- }
- if(k == 2)
- {
- adjustVolume(musicEnabled, -800);
- musicEnabled = true;
- }
- if(k == 3)
- {
- adjustVolume(musicEnabled, -1200);
- musicEnabled = true;
- }
- if(k == 4)
- musicEnabled = false;
- if(musicEnabled != flag1 && !lowMem)
- {
- if(musicEnabled)
- {
- nextSong = currentSong;
- songChanging = true;
- onDemandFetcher.method558(2, nextSong);
- } else
- {
- stopMidi();
- }
- prevSong = 0;
- }
- }
- if(j == 4)
- {
- if(k == 0)
- {
- aBoolean848 = true;
- setWaveVolume(0);
- }
- if(k == 1)
- {
- aBoolean848 = true;
- setWaveVolume(-400);
- }
- if(k == 2)
- {
- aBoolean848 = true;
- setWaveVolume(-800);
- }
- if(k == 3)
- {
- aBoolean848 = true;
- setWaveVolume(-1200);
- }
- if(k == 4)
- aBoolean848 = false;
- }
- if(j == 5)
- anInt1253 = k;
- if(j == 6)
- anInt1249 = k;
- if(j == 8)
- {
- splitPrivateChat = k;
- inputTaken = true;
- }
- if(j == 9)
- anInt913 = k;
- }
- private void updateEntities() {
- try{
- int anInt974 = 0;
- for(int j = -1; j < playerCount + npcCount; j++) {
- Object obj;
- if(j == -1)
- obj = myPlayer;
- else
- if(j < playerCount)
- obj = playerArray[playerIndices[j]];
- else
- obj = npcArray[npcIndices[j - playerCount]];
- if(obj == null || !((Entity) (obj)).isVisible())
- continue;
- if(obj instanceof NPC) {
- EntityDef entityDef = ((NPC)obj).desc;
- if(entityDef.childrenIDs != null)
- entityDef = entityDef.method161();
- if(entityDef == null)
- continue;
- }
- if(j < playerCount) {
- int l = 30;
- Player player = (Player)obj;
- if(player.headIcon >= 0) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1) {
- if (player.skullIcon < 2) {
- skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- l += 25;
- }
- if (player.headIcon < 7) {
- headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- l += 18;
- }
- }
- }
- if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
- }
- } else {
- EntityDef entityDef_1 = ((NPC)obj).desc;
- if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
- }
- if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
- }
- }
- if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
- {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
- if(spriteDrawX > -1 && anInt974 < anInt975)
- {
- anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
- anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
- anIntArray976[anInt974] = spriteDrawX;
- anIntArray977[anInt974] = spriteDrawY;
- anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
- anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
- anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
- aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
- if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
- {
- anIntArray978[anInt974] += 10;
- anIntArray977[anInt974] += 5;
- }
- if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
- anIntArray979[anInt974] = 60;
- if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
- anIntArray978[anInt974] += 5;
- }
- }
- if(((Entity) (obj)).loopCycleStatus > loopCycle)
- {
- try{
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
- if(spriteDrawX > -1)
- {
- int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
- if(i1 > 30)
- i1 = 30;
- DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
- DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
- }
- }catch(Exception e){ }
- }
- for(int j1 = 0; j1 < 4; j1++)
- if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
- {
- npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
- if(spriteDrawX > -1)
- {
- if(j1 == 1)
- spriteDrawY -= 20;
- if(j1 == 2)
- {
- spriteDrawX -= 15;
- spriteDrawY -= 10;
- }
- if(j1 == 3)
- {
- spriteDrawX += 15;
- spriteDrawY -= 10;
- }
- hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
- smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
- smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
- }
- }
- }
- for(int k = 0; k < anInt974; k++) {
- int k1 = anIntArray976[k];
- int l1 = anIntArray977[k];
- int j2 = anIntArray979[k];
- int k2 = anIntArray978[k];
- boolean flag = true;
- while(flag)
- {
- flag = false;
- for(int l2 = 0; l2 < k; l2++)
- if(l1 + 2 > anIntArray977[l2] - anIntArray978[l2] && l1 - k2 < anIntArray977[l2] + 2 && k1 - j2 < anIntArray976[l2] + anIntArray979[l2] && k1 + j2 > anIntArray976[l2] - anIntArray979[l2] && anIntArray977[l2] - anIntArray978[l2] < l1)
- {
- l1 = anIntArray977[l2] - anIntArray978[l2];
- flag = true;
- }
- }
- spriteDrawX = anIntArray976[k];
- spriteDrawY = anIntArray977[k] = l1;
- String s = aStringArray983[k];
- if(anInt1249 == 0)
- {
- int i3 = 0xffff00;
- if(anIntArray980[k] < 6)
- i3 = anIntArray965[anIntArray980[k]];
- if(anIntArray980[k] == 6)
- i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
- if(anIntArray980[k] == 7)
- i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
- if(anIntArray980[k] == 8)
- i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
- if(anIntArray980[k] == 9) {
- int j3 = 150 - anIntArray982[k];
- if(j3 < 50)
- i3 = 0xff0000 + 1280 * j3;
- else
- if(j3 < 100)
- i3 = 0xffff00 - 0x50000 * (j3 - 50);
- else
- if(j3 < 150)
- i3 = 65280 + 5 * (j3 - 100);
- }
- if(anIntArray980[k] == 10) {
- int k3 = 150 - anIntArray982[k];
- if(k3 < 50)
- i3 = 0xff0000 + 5 * k3;
- else
- if(k3 < 100)
- i3 = 0xff00ff - 0x50000 * (k3 - 50);
- else
- if(k3 < 150)
- i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
- }
- if(anIntArray980[k] == 11) {
- int l3 = 150 - anIntArray982[k];
- if(l3 < 50)
- i3 = 0xffffff - 0x50005 * l3;
- else
- if(l3 < 100)
- i3 = 65280 + 0x50005 * (l3 - 50);
- else
- if(l3 < 150)
- i3 = 0xffffff - 0x50000 * (l3 - 100);
- }
- if(anIntArray981[k] == 0) {
- chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
- chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
- }
- if(anIntArray981[k] == 1) {
- chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
- chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
- }
- if(anIntArray981[k] == 2) {
- chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
- chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
- }
- if(anIntArray981[k] == 3) {
- chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
- chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
- }
- if(anIntArray981[k] == 4) {
- int i4 = chatTextDrawingArea.method384(s);
- int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
- DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
- chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
- chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
- DrawingArea.defaultDrawingAreaSize();
- }
- if(anIntArray981[k] == 5) {
- int j4 = 150 - anIntArray982[k];
- int l4 = 0;
- if(j4 < 25)
- l4 = j4 - 25;
- else
- if(j4 > 125)
- l4 = j4 - 125;
- DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
- chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
- chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
- DrawingArea.defaultDrawingAreaSize();
- }
- } else {
- chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
- chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
- }
- }
- } catch(Exception e){ }
- }
- private void delFriend(long l)
- {
- try
- {
- if(l == 0L)
- return;
- for(int i = 0; i < friendsCount; i++)
- {
- if(friendsListAsLongs[i] != l)
- continue;
- friendsCount--;
- needDrawTabArea = true;
- for(int j = i; j < friendsCount; j++)
- {
- friendsList[j] = friendsList[j + 1];
- friendsNodeIDs[j] = friendsNodeIDs[j + 1];
- friendsListAsLongs[j] = friendsListAsLongs[j + 1];
- }
- stream.createFrame(215);
- stream.writeQWord(l);
- break;
- }
- }
- catch(RuntimeException runtimeexception)
- {
- signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
- throw new RuntimeException();
- }
- }
- public void drawSideIcons(){
- /* Top sideIcons */
- if(tabInterfaceIDs[0] != -1)//attack
- sideIcons[0].drawSprite(30, 10);
- if(tabInterfaceIDs[1] != -1)//stat
- sideIcons[1].drawSprite(53, 6);
- if(tabInterfaceIDs[2] != -1)//quest
- sideIcons[2].drawSprite(83, 7);
- if(tabInterfaceIDs[3] != -1)//inventory
- sideIcons[3].drawSprite(112, 4);
- if(tabInterfaceIDs[4] != -1)//equipment
- sideIcons[4].drawSprite(153, 6);
- if(tabInterfaceIDs[5] != -1)//prayer
- sideIcons[5].drawSprite(180, 5);
- if(tabInterfaceIDs[6] != -1)//magic
- sideIcons[6].drawSprite(208, 8);
- /* Bottom sideIcons */
- // if(tabInterfaceIDs[7] != -1)//clan
- // sideIcons[7].drawSprite(53, 302);
- if(tabInterfaceIDs[8] != -1)//friends
- sideIcons[7].drawSprite(54, 303);
- if(tabInterfaceIDs[9] != -1)//ignore
- sideIcons[8].drawSprite(82, 304);
- if(tabInterfaceIDs[10] != -1)//logout
- sideIcons[9].drawSprite(116, 305);
- if(tabInterfaceIDs[11] != -1)//options
- sideIcons[10].drawSprite(153, 302);
- if(tabInterfaceIDs[12] != -1)//emotes
- sideIcons[11].drawSprite(185, 303);
- if(tabInterfaceIDs[13] != -1)//music
- sideIcons[12].drawSprite(209, 303);
- }
- public void drawRedStones() {
- if(tabInterfaceIDs[tabID] != -1) {
- switch(tabID) {
- case 0:
- redStones[0].drawSprite(19, 0);
- break;
- case 1:
- redStones[5].drawSprite(51, 1);
- break;
- case 2:
- redStones[5].drawSprite(79, 1);
- break;
- case 3:
- redStones[2].drawSprite(107, 0);
- break;
- case 4:
- redStones[7].drawSprite(150, 1);
- break;
- case 5:
- redStones[7].drawSprite(178, 1);
- break;
- case 6:
- redStones[1].drawSprite(206, 2);
- break;
- /*case 7:
- redStones[3].drawSprite(19, 297);
- break;*/
- case 8:
- redStones[8].drawSprite(51, 297);
- break;
- case 9:
- redStones[8].drawSprite(79, 297);
- break;
- case 10:
- redStones[6].drawSprite(107, 299);
- break;
- case 11:
- redStones[9].drawSprite(150, 297);
- break;
- case 12:
- redStones[9].drawSprite(178, 297);
- break;
- case 13:
- redStones[4].drawSprite(206, 297);
- break;
- }
- }
- }
- private void drawTabArea()
- {
- aRSImageProducer_1163.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1181;
- /* Draws new tab area sprite */
- tabArea.drawSprite(0, 0);
- if(invOverlayInterfaceID == -1)
- {
- drawRedStones();
- drawSideIcons();
- }
- if(invOverlayInterfaceID != -1)
- drawInterface(0, 38, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
- else
- if(tabInterfaceIDs[tabID] != -1)
- drawInterface(0, 38, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
- if(menuOpen && menuScreenArea == 1)
- drawMenu();
- aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
- aRSImageProducer_1165.initDrawingArea();
- Texture.anIntArray1472 = anIntArray1182;
- }
- private void method37(int j)
- {
- if(!lowMem)
- {
- if(Texture.anIntArray1480[17] >= j)
- {
- Background background = Texture.aBackgroundArray1474s[17];
- int k = background.anInt1452 * background.anInt1453 - 1;
- int j1 = background.anInt1452 * anInt945 * 2;
- byte abyte0[] = background.aByteArray1450;
- byte abyte3[] = aByteArray912;
- for(int i2 = 0; i2 <= k; i2++)
- abyte3[i2] = abyte0[i2 - j1 & k];
- background.aByteArray1450 = abyte3;
- aByteArray912 = abyte0;
- Texture.method370(17);
- anInt854++;
- if(anInt854 > 1235)
- {
- anInt854 = 0;
- stream.createFrame(226);
- stream.writeWordBigEndian(0);
- int l2 = stream.currentOffset;
- stream.writeWord(58722);
- stream.writeWordBigEndian(240);
- stream.writeWord((int)(Math.random() * 65536D));
- stream.writeWordBigEndian((int)(Math.random() * 256D));
- if((int)(Math.random() * 2D) == 0)
- stream.writeWord(51825);
- stream.writeWordBigEndian((int)(Math.random() * 256D));
- stream.writeWord((int)(Math.random() * 65536D));
- stream.writeWord(7130);
- stream.writeWord((int)(Math.random() * 65536D));
- stream.writeWord(61657);
- stream.writeBytes(stream.currentOffset - l2);
- }
- }
- if(Texture.anIntArray1480[24] >= j)
- {
- Background background_1 = Texture.aBackgroundArray1474s[24];
- int l = background_1.anInt1452 * background_1.anInt1453 - 1;
- int k1 = background_1.anInt1452 * anInt945 * 2;
- byte abyte1[] = background_1.aByteArray1450;
- byte abyte4[] = aByteArray912;
- for(int j2 = 0; j2 <= l; j2++)
- abyte4[j2] = abyte1[j2 - k1 & l];
- background_1.aByteArray1450 = abyte4;
- aByteArray912 = abyte1;
- Texture.method370(24);
- }
- if(Texture.anIntArray1480[34] >= j)
- {
- Background background_2 = Texture.aBackgroundArray1474s[34];
- int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
- int l1 = background_2.anInt1452 * anInt945 * 2;
- byte abyte2[] = background_2.aByteArray1450;
- byte abyte5[] = aByteArray912;
- for(int k2 = 0; k2 <= i1; k2++)
- abyte5[k2] = abyte2[k2 - l1 & i1];
- background_2.aByteArray1450 = abyte5;
- aByteArray912 = abyte2;
- Texture.method370(34);
- }
- }
- }
- private void method38()
- {
- for(int i = -1; i < playerCount; i++)
- {
- int j;
- if(i == -1)
- j = myPlayerIndex;
- else
- j = playerIndices[i];
- Player player = playerArray[j];
- if(player != null && player.textCycle > 0)
- {
- player.textCycle--;
- if(player.textCycle == 0)
- player.textSpoken = null;
- }
- }
- for(int k = 0; k < npcCount; k++)
- {
- int l = npcIndices[k];
- NPC npc = npcArray[l];
- if(npc != null && npc.textCycle > 0)
- {
- npc.textCycle--;
- if(npc.textCycle == 0)
- npc.textSpoken = null;
- }
- }
- }
- private void calcCameraPos()
- {
- int i = anInt1098 * 128 + 64;
- int j = anInt1099 * 128 + 64;
- int k = method42(plane, j, i) - anInt1100;
- if(xCameraPos < i)
- {
- xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
- if(xCameraPos > i)
- xCameraPos = i;
- }
- if(xCameraPos > i)
- {
- xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
- if(xCameraPos < i)
- xCameraPos = i;
- }
- if(zCameraPos < k)
- {
- zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
- if(zCameraPos > k)
- zCameraPos = k;
- }
- if(zCameraPos > k)
- {
- zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
- if(zCameraPos < k)
- zCameraPos = k;
- }
- if(yCameraPos < j)
- {
- yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
- if(yCameraPos > j)
- yCameraPos = j;
- }
- if(yCameraPos > j)
- {
- yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
- if(yCameraPos < j)
- yCameraPos = j;
- }
- i = anInt995 * 128 + 64;
- j = anInt996 * 128 + 64;
- k = method42(plane, j, i) - anInt997;
- int l = i - xCameraPos;
- int i1 = k - zCameraPos;
- int j1 = j - yCameraPos;
- int k1 = (int)Math.sqrt(l * l + j1 * j1);
- int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
- int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
- if(l1 < 128)
- l1 = 128;
- if(l1 > 383)
- l1 = 383;
- if(yCameraCurve < l1)
- {
- yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
- if(yCameraCurve > l1)
- yCameraCurve = l1;
- }
- if(yCameraCurve > l1)
- {
- yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
- if(yCameraCurve < l1)
- yCameraCurve = l1;
- }
- int j2 = i2 - xCameraCurve;
- if(j2 > 1024)
- j2 -= 2048;
- if(j2 < -1024)
- j2 += 2048;
- if(j2 > 0)
- {
- xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
- xCameraCurve &= 0x7ff;
- }
- if(j2 < 0)
- {
- xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
- xCameraCurve &= 0x7ff;
- }
- int k2 = i2 - xCameraCurve;
- if(k2 > 1024)
- k2 -= 2048;
- if(k2 < -1024)
- k2 += 2048;
- if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
- xCameraCurve = i2;
- }
- private void drawMenu()
- {
- int i = menuOffsetX;
- int j = menuOffsetY;
- int k = menuWidth;
- int l = anInt952;
- int i1 = 0x5d5447;
- DrawingArea.drawPixels(l, j, i, i1, k);
- DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
- DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
- chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
- int j1 = super.mouseX;
- int k1 = super.mouseY;
- if(menuScreenArea == 0) {
- j1 -= 4;
- k1 -= 4;
- }
- if(menuScreenArea == 1) {
- j1 -= 519;
- k1 -= 168;
- }
- if(menuScreenArea == 2) {
- j1 -= 17;
- k1 -= 338;
- }
- if(menuScreenArea == 3) {
- j1 -= 519;
- k1 -= 0;
- }
- for(int l1 = 0; l1 < menuActionRow; l1++)
- {
- int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
- int j2 = 0xffffff;
- if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
- j2 = 0xffff00;
- chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
- }
- }
- private void addFriend(long l)
- {
- try
- {
- if(l == 0L)
- return;
- if(friendsCount >= 100 && anInt1046 != 1)
- {
- pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
- return;
- }
- if(friendsCount >= 200)
- {
- pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
- return;
- }
- String s = TextClass.fixName(TextClass.nameForLong(l));
- for(int i = 0; i < friendsCount; i++)
- if(friendsListAsLongs[i] == l)
- {
- pushMessage(s + " is already on your friend list", 0, "");
- return;
- }
- for(int j = 0; j < ignoreCount; j++)
- if(ignoreListAsLongs[j] == l)
- {
- pushMessage("Please remove " + s + " from your ignore list first", 0, "");
- return;
- }
- if(s.equals(myPlayer.name))
- {
- return;
- } else
- {
- friendsList[friendsCount] = s;
- friendsListAsLongs[friendsCount] = l;
- friendsNodeIDs[friendsCount] = 0;
- friendsCount++;
- needDrawTabArea = true;
- stream.createFrame(188);
- stream.writeQWord(l);
- return;
- }
- }
- catch(RuntimeException runtimeexception)
- {
- signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
- }
- throw new RuntimeException();
- }
- private int method42(int i, int j, int k)
- {
- int l = k >> 7;
- int i1 = j >> 7;
- if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
- return 0;
- int j1 = i;
- if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
- j1++;
- int k1 = k & 0x7f;
- int l1 = j & 0x7f;
- int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
- int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
- return i2 * (128 - l1) + j2 * l1 >> 7;
- }
- private static String intToKOrMil(int j)
- {
- if(j < 0x186a0)
- return String.valueOf(j);
- if(j < 0x989680)
- return j / 1000 + "K";
- else
- return j / 0xf4240 + "M";
- }
- private void resetLogout()
- {
- try
- {
- if(socketStream != null)
- socketStream.close();
- }
- catch(Exception _ex) { }
- socketStream = null;
- loggedIn = false;
- loginScreenState = 0;
- myUsername = "";
- myPassword = "";
- unlinkMRUNodes();
- worldController.initToNull();
- for(int i = 0; i < 4; i++)
- aClass11Array1230[i].method210();
- System.gc();
- stopMidi();
- currentSong = -1;
- nextSong = -1;
- prevSong = 0;
- }
- private void method45()
- {
- aBoolean1031 = true;
- for(int j = 0; j < 7; j++)
- {
- anIntArray1065[j] = -1;
- for(int k = 0; k < IDK.length; k++)
- {
- if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
- continue;
- anIntArray1065[j] = k;
- break;
- }
- }
- }
- private void method46(int i, Stream stream)
- {
- while(stream.bitPosition + 21 < i * 8)
- {
- int k = stream.readBits(14);
- if(k == 16383)
- break;
- if(npcArray[k] == null)
- npcArray[k] = new NPC();
- NPC npc = npcArray[k];
- npcIndices[npcCount++] = k;
- npc.anInt1537 = loopCycle;
- int l = stream.readBits(5);
- if(l > 15)
- l -= 32;
- int i1 = stream.readBits(5);
- if(i1 > 15)
- i1 -= 32;
- int j1 = stream.readBits(1);
- npc.desc = EntityDef.forID(stream.readBits(12));
- int k1 = stream.readBits(1);
- if(k1 == 1)
- anIntArray894[anInt893++] = k;
- npc.anInt1540 = npc.desc.aByte68;
- npc.anInt1504 = npc.desc.anInt79;
- npc.anInt1554 = npc.desc.anInt67;
- npc.anInt1555 = npc.desc.anInt58;
- npc.anInt1556 = npc.desc.anInt83;
- npc.anInt1557 = npc.desc.anInt55;
- npc.anInt1511 = npc.desc.anInt77;
- npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
- }
- stream.finishBitAccess();
- }
- public void processGameLoop()
- {
- if(rsAlreadyLoaded || loadingError || genericLoadingError)
- return;
- loopCycle++;
- if(!loggedIn)
- processLoginScreenInput();
- else
- mainGameProcessor();
- processOnDemandQueue();
- }
- private void method47(boolean flag)
- {
- if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
- destX = 0;
- int j = playerCount;
- if(flag)
- j = 1;
- for(int l = 0; l < j; l++)
- {
- Player player;
- int i1;
- if(flag)
- {
- player = myPlayer;
- i1 = myPlayerIndex << 14;
- } else
- {
- player = playerArray[playerIndices[l]];
- i1 = playerIndices[l] << 14;
- }
- if(player == null || !player.isVisible())
- continue;
- player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
- int j1 = player.x >> 7;
- int k1 = player.y >> 7;
- if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
- continue;
- if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708)
- {
- player.aBoolean1699 = false;
- player.anInt1709 = method42(plane, player.y, player.x);
- worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
- continue;
- }
- if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
- {
- if(anIntArrayArray929[j1][k1] == anInt1265)
- continue;
- anIntArrayArray929[j1][k1] = anInt1265;
- }
- player.anInt1709 = method42(plane, player.y, player.x);
- worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
- }
- }
- private boolean promptUserForInput(RSInterface class9)
- {
- int j = class9.contentType;
- if(anInt900 == 2)
- {
- if(j == 201)
- {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 1;
- aString1121 = "Enter name of friend to add to list";
- }
- if(j == 202)
- {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 2;
- aString1121 = "Enter name of friend to delete from list";
- }
- }
- if(j == 205)
- {
- anInt1011 = 250;
- return true;
- }
- if(j == 501)
- {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 4;
- aString1121 = "Enter name of player to add to list";
- }
- if(j == 502)
- {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 5;
- aString1121 = "Enter name of player to delete from list";
- }
- if(j >= 300 && j <= 313)
- {
- int k = (j - 300) / 2;
- int j1 = j & 1;
- int i2 = anIntArray1065[k];
- if(i2 != -1)
- {
- do
- {
- if(j1 == 0 && --i2 < 0)
- i2 = IDK.length - 1;
- if(j1 == 1 && ++i2 >= IDK.length)
- i2 = 0;
- } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
- anIntArray1065[k] = i2;
- aBoolean1031 = true;
- }
- }
- if(j >= 314 && j <= 323)
- {
- int l = (j - 314) / 2;
- int k1 = j & 1;
- int j2 = anIntArray990[l];
- if(k1 == 0 && --j2 < 0)
- j2 = anIntArrayArray1003[l].length - 1;
- if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
- j2 = 0;
- anIntArray990[l] = j2;
- aBoolean1031 = true;
- }
- if(j == 324 && !aBoolean1047)
- {
- aBoolean1047 = true;
- method45();
- }
- if(j == 325 && aBoolean1047)
- {
- aBoolean1047 = false;
- method45();
- }
- if(j == 326)
- {
- stream.createFrame(101);
- stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
- for(int i1 = 0; i1 < 7; i1++)
- stream.writeWordBigEndian(anIntArray1065[i1]);
- for(int l1 = 0; l1 < 5; l1++)
- stream.writeWordBigEndian(anIntArray990[l1]);
- return true;
- }
- if(j == 613)
- canMute = !canMute;
- if(j >= 601 && j <= 612)
- {
- clearTopInterfaces();
- if(reportAbuseInput.length() > 0)
- {
- stream.createFrame(218);
- stream.writeQWord(TextClass.longForName(reportAbuseInput));
- stream.writeWordBigEndian(j - 601);
- stream.writeWordBigEndian(canMute ? 1 : 0);
- }
- }
- return false;
- }
- private void method49(Stream stream)
- {
- for(int j = 0; j < anInt893; j++)
- {
- int k = anIntArray894[j];
- Player player = playerArray[k];
- int l = stream.readUnsignedByte();
- if((l & 0x40) != 0)
- l += stream.readUnsignedByte() << 8;
- method107(l, k, stream, player);
- }
- }
- private void method50(int i, int k, int l, int i1, int j1)
- {
- int k1 = worldController.method300(j1, l, i);
- if(k1 != 0)
- {
- int l1 = worldController.method304(j1, l, i, k1);
- int k2 = l1 >> 6 & 3;
- int i3 = l1 & 0x1f;
- int k3 = k;
- if(k1 > 0)
- k3 = i1;
- int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
- int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
- int i5 = k1 >> 14 & 0x7fff;
- ObjectDef class46_2 = ObjectDef.forID(i5);
- if(class46_2.anInt758 != -1)
- {
- Background background_2 = mapScenes[class46_2.anInt758];
- if(background_2 != null)
- {
- int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
- int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
- background_2.method361(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
- }
- } else
- {
- if(i3 == 0 || i3 == 2)
- if(k2 == 0)
- {
- ai[k4] = k3;
- ai[k4 + 512] = k3;
- ai[k4 + 1024] = k3;
- ai[k4 + 1536] = k3;
- } else
- if(k2 == 1)
- {
- ai[k4] = k3;
- ai[k4 + 1] = k3;
- ai[k4 + 2] = k3;
- ai[k4 + 3] = k3;
- } else
- if(k2 == 2)
- {
- ai[k4 + 3] = k3;
- ai[k4 + 3 + 512] = k3;
- ai[k4 + 3 + 1024] = k3;
- ai[k4 + 3 + 1536] = k3;
- } else
- if(k2 == 3)
- {
- ai[k4 + 1536] = k3;
- ai[k4 + 1536 + 1] = k3;
- ai[k4 + 1536 + 2] = k3;
- ai[k4 + 1536 + 3] = k3;
- }
- if(i3 == 3)
- if(k2 == 0)
- ai[k4] = k3;
- else
- if(k2 == 1)
- ai[k4 + 3] = k3;
- else
- if(k2 == 2)
- ai[k4 + 3 + 1536] = k3;
- else
- if(k2 == 3)
- ai[k4 + 1536] = k3;
- if(i3 == 2)
- if(k2 == 3)
- {
- ai[k4] = k3;
- ai[k4 + 512] = k3;
- ai[k4 + 1024] = k3;
- ai[k4 + 1536] = k3;
- } else
- if(k2 == 0)
- {
- ai[k4] = k3;
- ai[k4 + 1] = k3;
- ai[k4 + 2] = k3;
- ai[k4 + 3] = k3;
- } else
- if(k2 == 1)
- {
- ai[k4 + 3] = k3;
- ai[k4 + 3 + 512] = k3;
- ai[k4 + 3 + 1024] = k3;
- ai[k4 + 3 + 1536] = k3;
- } else
- if(k2 == 2)
- {
- ai[k4 + 1536] = k3;
- ai[k4 + 1536 + 1] = k3;
- ai[k4 + 1536 + 2] = k3;
- ai[k4 + 1536 + 3] = k3;
- }
- }
- }
- k1 = worldController.method302(j1, l, i);
- if(k1 != 0)
- {
- int i2 = worldController.method304(j1, l, i, k1);
- int l2 = i2 >> 6 & 3;
- int j3 = i2 & 0x1f;
- int l3 = k1 >> 14 & 0x7fff;
- ObjectDef class46_1 = ObjectDef.forID(l3);
- if(class46_1.anInt758 != -1)
- {
- Background background_1 = mapScenes[class46_1.anInt758];
- if(background_1 != null)
- {
- int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
- int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
- background_1.method361(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
- }
- } else
- if(j3 == 9)
- {
- int l4 = 0xeeeeee;
- if(k1 > 0)
- l4 = 0xee0000;
- int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
- int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
- if(l2 == 0 || l2 == 2)
- {
- ai1[l5 + 1536] = l4;
- ai1[l5 + 1024 + 1] = l4;
- ai1[l5 + 512 + 2] = l4;
- ai1[l5 + 3] = l4;
- } else
- {
- ai1[l5] = l4;
- ai1[l5 + 512 + 1] = l4;
- ai1[l5 + 1024 + 2] = l4;
- ai1[l5 + 1536 + 3] = l4;
- }
- }
- }
- k1 = worldController.method303(j1, l, i);
- if(k1 != 0)
- {
- int j2 = k1 >> 14 & 0x7fff;
- ObjectDef class46 = ObjectDef.forID(j2);
- if(class46.anInt758 != -1)
- {
- Background background = mapScenes[class46.anInt758];
- if(background != null)
- {
- int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
- int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
- background.method361(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
- }
- }
- }
- }
- private void loadTitleScreen()
- {
- aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
- aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
- aBackgroundArray1152s = new Background[12];
- int j = 0;
- try
- {
- j = Integer.parseInt(getParameter("fl_icon"));
- }
- catch(Exception _ex) { }
- if(j == 0)
- {
- for(int k = 0; k < 12; k++)
- aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
- } else
- {
- for(int l = 0; l < 12; l++)
- aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
- }
- aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
- aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
- System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
- System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
- anIntArray851 = new int[256];
- for(int k1 = 0; k1 < 64; k1++)
- anIntArray851[k1] = k1 * 0x40000;
- for(int l1 = 0; l1 < 64; l1++)
- anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
- for(int i2 = 0; i2 < 64; i2++)
- anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
- for(int j2 = 0; j2 < 64; j2++)
- anIntArray851[j2 + 192] = 0xffffff;
- anIntArray852 = new int[256];
- for(int k2 = 0; k2 < 64; k2++)
- anIntArray852[k2] = k2 * 1024;
- for(int l2 = 0; l2 < 64; l2++)
- anIntArray852[l2 + 64] = 65280 + 4 * l2;
- for(int i3 = 0; i3 < 64; i3++)
- anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
- for(int j3 = 0; j3 < 64; j3++)
- anIntArray852[j3 + 192] = 0xffffff;
- anIntArray853 = new int[256];
- for(int k3 = 0; k3 < 64; k3++)
- anIntArray853[k3] = k3 * 4;
- for(int l3 = 0; l3 < 64; l3++)
- anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
- for(int i4 = 0; i4 < 64; i4++)
- anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
- for(int j4 = 0; j4 < 64; j4++)
- anIntArray853[j4 + 192] = 0xffffff;
- anIntArray850 = new int[256];
- anIntArray1190 = new int[32768];
- anIntArray1191 = new int[32768];
- randomizeBackground(null);
- anIntArray828 = new int[32768];
- anIntArray829 = new int[32768];
- drawLoadingText(10, "Connecting to fileserver");
- if(!aBoolean831)
- {
- drawFlames = true;
- aBoolean831 = true;
- startRunnable(this, 2);
- }
- }
- private static void setHighMem()
- {
- WorldController.lowMem = false;
- Texture.lowMem = false;
- lowMem = false;
- ObjectManager.lowMem = false;
- ObjectDef.lowMem = false;
- }
- public static void main(String args[]) {
- try {
- nodeID = 10;
- portOff = 0;
- setLowMem();
- isMembers = true;
- signlink.storeid = 32;
- signlink.startpriv(InetAddress.getLocalHost());
- client client1 = new client();
- client1.createClientFrame(505, 767);
- }
- catch(Exception exception)
- {
- }
- }
- private void loadingStages()
- {
- if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane)
- {
- aRSImageProducer_1165.initDrawingArea();
- aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
- aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
- aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
- loadingStage = 1;
- aLong824 = System.currentTimeMillis();
- }
- if(loadingStage == 1)
- {
- int j = method54();
- if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L)
- {
- signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
- aLong824 = System.currentTimeMillis();
- }
- }
- if(loadingStage == 2 && plane != anInt985)
- {
- anInt985 = plane;
- method24(plane);
- }
- }
- private int method54()
- {
- for(int i = 0; i < aByteArrayArray1183.length; i++)
- {
- if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
- return -1;
- if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
- return -2;
- }
- boolean flag = true;
- for(int j = 0; j < aByteArrayArray1183.length; j++)
- {
- byte abyte0[] = aByteArrayArray1247[j];
- if(abyte0 != null)
- {
- int k = (anIntArray1234[j] >> 8) * 64 - baseX;
- int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
- if(aBoolean1159)
- {
- k = 10;
- l = 10;
- }
- flag &= ObjectManager.method189(k, abyte0, l);
- }
- }
- if(!flag)
- return -3;
- if(aBoolean1080)
- {
- return -4;
- } else
- {
- loadingStage = 2;
- ObjectManager.anInt131 = plane;
- method22();
- stream.createFrame(121);
- return 0;
- }
- }
- private void method55()
- {
- for(Animable_Sub4 class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetFirst(); class30_sub2_sub4_sub4 != null; class30_sub2_sub4_sub4 = (Animable_Sub4)aClass19_1013.reverseGetNext())
- if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
- class30_sub2_sub4_sub4.unlink();
- else
- if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
- {
- if(class30_sub2_sub4_sub4.anInt1590 > 0)
- {
- NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
- if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
- class30_sub2_sub4_sub4.method455(loopCycle, npc.y, method42(class30_sub2_sub4_sub4.anInt1597, npc.y, npc.x) - class30_sub2_sub4_sub4.anInt1583, npc.x);
- }
- if(class30_sub2_sub4_sub4.anInt1590 < 0)
- {
- int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
- Player player;
- if(j == unknownInt10)
- player = myPlayer;
- else
- player = playerArray[j];
- if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
- class30_sub2_sub4_sub4.method455(loopCycle, player.y, method42(class30_sub2_sub4_sub4.anInt1597, player.y, player.x) - class30_sub2_sub4_sub4.anInt1583, player.x);
- }
- class30_sub2_sub4_sub4.method456(anInt945);
- worldController.method285(plane, class30_sub2_sub4_sub4.anInt1595, (int)class30_sub2_sub4_sub4.aDouble1587, -1, (int)class30_sub2_sub4_sub4.aDouble1586, 60, (int)class30_sub2_sub4_sub4.aDouble1585, class30_sub2_sub4_sub4, false);
- }
- }
- public AppletContext getAppletContext()
- {
- if(signlink.mainapp != null)
- return signlink.mainapp.getAppletContext();
- else
- return super.getAppletContext();
- }
- private void drawLogo()
- {
- byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
- Sprite sprite = new Sprite(abyte0, this);
- aRSImageProducer_1110.initDrawingArea();
- sprite.method346(0, 0);
- aRSImageProducer_1111.initDrawingArea();
- sprite.method346(-637, 0);
- aRSImageProducer_1107.initDrawingArea();
- sprite.method346(-128, 0);
- aRSImageProducer_1108.initDrawingArea();
- sprite.method346(-202, -371);
- aRSImageProducer_1109.initDrawingArea();
- sprite.method346(-202, -171);
- aRSImageProducer_1112.initDrawingArea();
- sprite.method346(0, -265);
- aRSImageProducer_1113.initDrawingArea();
- sprite.method346(-562, -265);
- aRSImageProducer_1114.initDrawingArea();
- sprite.method346(-128, -171);
- aRSImageProducer_1115.initDrawingArea();
- sprite.method346(-562, -171);
- int ai[] = new int[sprite.myWidth];
- for(int j = 0; j < sprite.myHeight; j++)
- {
- for(int k = 0; k < sprite.myWidth; k++)
- ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
- System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
- }
- /*aRSImageProducer_1110.initDrawingArea();
- sprite.method346(382, 0);
- aRSImageProducer_1111.initDrawingArea();
- sprite.method346(-255, 0);
- aRSImageProducer_1107.initDrawingArea();
- sprite.method346(254, 0);
- aRSImageProducer_1108.initDrawingArea();
- sprite.method346(180, -371);
- aRSImageProducer_1109.initDrawingArea();
- sprite.method346(180, -171);
- aRSImageProducer_1112.initDrawingArea();
- sprite.method346(382, -265);
- aRSImageProducer_1113.initDrawingArea();
- sprite.method346(-180, -265);
- aRSImageProducer_1114.initDrawingArea();
- sprite.method346(254, -171);
- aRSImageProducer_1115.initDrawingArea();
- sprite.method346(254, -171);
- aRSImageProducer_1115.initDrawingArea();
- sprite.method346(-180, -171);*/
- sprite = null;
- Object obj = null;
- Object obj1 = null;
- System.gc();
- }
- /* System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
- }
- aRSImageProducer_1110.initDrawingArea();
- sprite.method346(382, 0);
- aRSImageProducer_1111.initDrawingArea();
- sprite.method346(-255, 0);
- aRSImageProducer_1107.initDrawingArea();
- sprite.method346(254, 0);
- aRSImageProducer_1108.initDrawingArea();
- sprite.method346(180, -371);
- aRSImageProducer_1109.initDrawingArea();
- sprite.method346(180, -171);
- aRSImageProducer_1112.initDrawingArea();
- sprite.method346(382, -265);
- aRSImageProducer_1113.initDrawingArea();
- sprite.method346(-180, -265);
- aRSImageProducer_1114.initDrawingArea();
- sprite.method346(254, -171);
- aRSImageProducer_1115.initDrawingArea();
- sprite.method346(-180, -171);
- sprite = new Sprite(titleStreamLoader, "logo", 0);
- aRSImageProducer_1107.initDrawingArea();
- sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
- sprite = null;
- Object obj = null;
- Object obj1 = null;
- System.gc();
- }*/
- private void processOnDemandQueue()
- {
- do
- {
- OnDemandData onDemandData;
- do
- {
- onDemandData = onDemandFetcher.getNextNode();
- if(onDemandData == null)
- return;
- if(onDemandData.dataType == 0)
- {
- Model.method460(onDemandData.buffer, onDemandData.ID);
- if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
- {
- needDrawTabArea = true;
- if(backDialogID != -1)
- inputTaken = true;
- }
- }
- if(onDemandData.dataType == 1 && onDemandData.buffer != null)
- Class36.method529(onDemandData.buffer);
- if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
- saveMidi(songChanging, onDemandData.buffer);
- if(onDemandData.dataType == 3 && loadingStage == 1)
- {
- for(int i = 0; i < aByteArrayArray1183.length; i++)
- {
- if(anIntArray1235[i] == onDemandData.ID)
- {
- aByteArrayArray1183[i] = onDemandData.buffer;
- if(onDemandData.buffer == null)
- anIntArray1235[i] = -1;
- break;
- }
- if(anIntArray1236[i] != onDemandData.ID)
- continue;
- aByteArrayArray1247[i] = onDemandData.buffer;
- if(onDemandData.buffer == null)
- anIntArray1236[i] = -1;
- break;
- }
- }
- } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
- ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
- } while(true);
- }
- private void calcFlamesPosition()
- {
- char c = '\u0100';
- for(int j = 10; j < 117; j++)
- {
- int k = (int)(Math.random() * 100D);
- if(k < 50)
- anIntArray828[j + (c - 2 << 7)] = 255;
- }
- for(int l = 0; l < 100; l++)
- {
- int i1 = (int)(Math.random() * 124D) + 2;
- int k1 = (int)(Math.random() * 128D) + 128;
- int k2 = i1 + (k1 << 7);
- anIntArray828[k2] = 192;
- }
- for(int j1 = 1; j1 < c - 1; j1++)
- {
- for(int l1 = 1; l1 < 127; l1++)
- {
- int l2 = l1 + (j1 << 7);
- anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
- }
- }
- anInt1275 += 128;
- if(anInt1275 > anIntArray1190.length)
- {
- anInt1275 -= anIntArray1190.length;
- int i2 = (int)(Math.random() * 12D);
- randomizeBackground(aBackgroundArray1152s[i2]);
- }
- for(int j2 = 1; j2 < c - 1; j2++)
- {
- for(int i3 = 1; i3 < 127; i3++)
- {
- int k3 = i3 + (j2 << 7);
- int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
- if(i4 < 0)
- i4 = 0;
- anIntArray828[k3] = i4;
- }
- }
- System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
- anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
- if(anInt1040 > 0)
- anInt1040 -= 4;
- if(anInt1041 > 0)
- anInt1041 -= 4;
- if(anInt1040 == 0 && anInt1041 == 0)
- {
- int l3 = (int)(Math.random() * 2000D);
- if(l3 == 0)
- anInt1040 = 1024;
- if(l3 == 1)
- anInt1041 = 1024;
- }
- }
- private boolean saveWave(byte abyte0[], int i)
- {
- return abyte0 == null || signlink.wavesave(abyte0, i);
- }
- private void method60(int i)
- {
- RSInterface class9 = RSInterface.interfaceCache[i];
- for(int j = 0; j < class9.children.length; j++)
- {
- if(class9.children[j] == -1)
- break;
- RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
- if(class9_1.type == 1)
- method60(class9_1.id);
- class9_1.anInt246 = 0;
- class9_1.anInt208 = 0;
- }
- }
- private void drawHeadIcon()
- {
- if(anInt855 != 2)
- return;
- calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
- if(spriteDrawX > -1 && loopCycle % 20 < 10)
- headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
- }
- private void mainGameProcessor()
- {
- if(anInt1104 > 1)
- anInt1104--;
- if(anInt1011 > 0)
- anInt1011--;
- for(int j = 0; j < 5; j++)
- if(!parsePacket())
- break;
- if(!loggedIn)
- return;
- synchronized(mouseDetection.syncObject)
- {
- if(flagged)
- {
- if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
- {
- stream.createFrame(45);
- stream.writeWordBigEndian(0);
- int j2 = stream.currentOffset;
- int j3 = 0;
- for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
- {
- if(j2 - stream.currentOffset >= 240)
- break;
- j3++;
- int l4 = mouseDetection.coordsY[j4];
- if(l4 < 0)
- l4 = 0;
- else
- if(l4 > 502)
- l4 = 502;
- int k5 = mouseDetection.coordsX[j4];
- if(k5 < 0)
- k5 = 0;
- else
- if(k5 > 764)
- k5 = 764;
- int i6 = l4 * 765 + k5;
- if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
- {
- k5 = -1;
- l4 = -1;
- i6 = 0x7ffff;
- }
- if(k5 == anInt1237 && l4 == anInt1238)
- {
- if(anInt1022 < 2047)
- anInt1022++;
- } else
- {
- int j6 = k5 - anInt1237;
- anInt1237 = k5;
- int k6 = l4 - anInt1238;
- anInt1238 = l4;
- if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
- {
- j6 += 32;
- k6 += 32;
- stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
- anInt1022 = 0;
- } else
- if(anInt1022 < 8)
- {
- stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
- anInt1022 = 0;
- } else
- {
- stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
- anInt1022 = 0;
- }
- }
- }
- stream.writeBytes(stream.currentOffset - j2);
- if(j3 >= mouseDetection.coordsIndex)
- {
- mouseDetection.coordsIndex = 0;
- } else
- {
- mouseDetection.coordsIndex -= j3;
- for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
- {
- mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
- mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
- }
- }
- }
- } else
- {
- mouseDetection.coordsIndex = 0;
- }
- }
- if(super.clickMode3 != 0)
- {
- long l = (super.aLong29 - aLong1220) / 50L;
- if(l > 4095L)
- l = 4095L;
- aLong1220 = super.aLong29;
- int k2 = super.saveClickY;
- if(k2 < 0)
- k2 = 0;
- else
- if(k2 > 502)
- k2 = 502;
- int k3 = super.saveClickX;
- if(k3 < 0)
- k3 = 0;
- else
- if(k3 > 764)
- k3 = 764;
- int k4 = k2 * 765 + k3;
- int j5 = 0;
- if(super.clickMode3 == 2)
- j5 = 1;
- int l5 = (int)l;
- stream.createFrame(241);
- stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
- }
- if(anInt1016 > 0)
- anInt1016--;
- if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
- aBoolean1017 = true;
- if(aBoolean1017 && anInt1016 <= 0)
- {
- anInt1016 = 20;
- aBoolean1017 = false;
- stream.createFrame(86);
- stream.writeWord(anInt1184);
- stream.method432(minimapInt1);
- }
- if(super.awtFocus && !aBoolean954)
- {
- aBoolean954 = true;
- stream.createFrame(3);
- stream.writeWordBigEndian(1);
- }
- if(!super.awtFocus && aBoolean954)
- {
- aBoolean954 = false;
- stream.createFrame(3);
- stream.writeWordBigEndian(0);
- }
- loadingStages();
- method115();
- method90();
- anInt1009++;
- if(anInt1009 > 750)
- dropClient();
- method114();
- method95();
- method38();
- anInt945++;
- if(crossType != 0)
- {
- crossIndex += 20;
- if(crossIndex >= 400)
- crossType = 0;
- }
- if(atInventoryInterfaceType != 0)
- {
- atInventoryLoopCycle++;
- if(atInventoryLoopCycle >= 15)
- {
- if(atInventoryInterfaceType == 2)
- needDrawTabArea = true;
- if(atInventoryInterfaceType == 3)
- inputTaken = true;
- atInventoryInterfaceType = 0;
- }
- }
- if(activeInterfaceType != 0)
- {
- anInt989++;
- if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
- aBoolean1242 = true;
- if(super.clickMode2 == 0)
- {
- if(activeInterfaceType == 2)
- needDrawTabArea = true;
- if(activeInterfaceType == 3)
- inputTaken = true;
- activeInterfaceType = 0;
- if(aBoolean1242 && anInt989 >= 5)
- {
- lastActiveInvInterface = -1;
- processRightClick();
- if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
- {
- RSInterface class9 = RSInterface.interfaceCache[anInt1084];
- int j1 = 0;
- if(anInt913 == 1 && class9.contentType == 206)
- j1 = 1;
- if(class9.inv[mouseInvInterfaceIndex] <= 0)
- j1 = 0;
- if(class9.aBoolean235)
- {
- int l2 = anInt1085;
- int l3 = mouseInvInterfaceIndex;
- class9.inv[l3] = class9.inv[l2];
- class9.invStackSizes[l3] = class9.invStackSizes[l2];
- class9.inv[l2] = -1;
- class9.invStackSizes[l2] = 0;
- } else
- if(j1 == 1)
- {
- int i3 = anInt1085;
- for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
- if(i3 > i4)
- {
- class9.swapInventoryItems(i3, i3 - 1);
- i3--;
- } else
- if(i3 < i4)
- {
- class9.swapInventoryItems(i3, i3 + 1);
- i3++;
- }
- } else
- {
- class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
- }
- stream.createFrame(214);
- stream.method433(anInt1084);
- stream.method424(j1);
- stream.method433(anInt1085);
- stream.method431(mouseInvInterfaceIndex);
- }
- } else
- if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
- determineMenuSize();
- else
- if(menuActionRow > 0)
- doAction(menuActionRow - 1);
- atInventoryLoopCycle = 10;
- super.clickMode3 = 0;
- }
- }
- if(WorldController.anInt470 != -1)
- {
- int k = WorldController.anInt470;
- int k1 = WorldController.anInt471;
- boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
- WorldController.anInt470 = -1;
- if(flag)
- {
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 1;
- crossIndex = 0;
- }
- }
- if(super.clickMode3 == 1 && aString844 != null)
- {
- aString844 = null;
- inputTaken = true;
- super.clickMode3 = 0;
- }
- processMenuClick();
- processMainScreenClick();
- processTabClick();
- processMapAreaClick();
- processChatModeClick();
- if(super.clickMode2 == 1 || super.clickMode3 == 1)
- anInt1213++;
- if(loadingStage == 2)
- method108();
- if(loadingStage == 2 && aBoolean1160)
- calcCameraPos();
- for(int i1 = 0; i1 < 5; i1++)
- anIntArray1030[i1]++;
- method73();
- super.idleTime++;
- if(super.idleTime > 4500)
- {
- anInt1011 = 250;
- super.idleTime -= 500;
- stream.createFrame(202);
- }
- anInt988++;
- if(anInt988 > 500)
- {
- anInt988 = 0;
- int l1 = (int)(Math.random() * 8D);
- if((l1 & 1) == 1)
- anInt1278 += anInt1279;
- if((l1 & 2) == 2)
- anInt1131 += anInt1132;
- if((l1 & 4) == 4)
- anInt896 += anInt897;
- }
- if(anInt1278 < -50)
- anInt1279 = 2;
- if(anInt1278 > 50)
- anInt1279 = -2;
- if(anInt1131 < -55)
- anInt1132 = 2;
- if(anInt1131 > 55)
- anInt1132 = -2;
- if(anInt896 < -40)
- anInt897 = 1;
- if(anInt896 > 40)
- anInt897 = -1;
- anInt1254++;
- if(anInt1254 > 500)
- {
- anInt1254 = 0;
- int i2 = (int)(Math.random() * 8D);
- if((i2 & 1) == 1)
- minimapInt2 += anInt1210;
- if((i2 & 2) == 2)
- minimapInt3 += anInt1171;
- }
- if(minimapInt2 < -60)
- anInt1210 = 2;
- if(minimapInt2 > 60)
- anInt1210 = -2;
- if(minimapInt3 < -20)
- anInt1171 = 1;
- if(minimapInt3 > 10)
- anInt1171 = -1;
- anInt1010++;
- if(anInt1010 > 50)
- stream.createFrame(0);
- try
- {
- if(socketStream != null && stream.currentOffset > 0)
- {
- socketStream.queueBytes(stream.currentOffset, stream.buffer);
- stream.currentOffset = 0;
- anInt1010 = 0;
- }
- }
- catch(IOException _ex)
- {
- dropClient();
- }
- catch(Exception exception)
- {
- resetLogout();
- }
- }
- private void method63()
- {
- Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
- for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
- if(class30_sub1.anInt1294 == -1)
- {
- class30_sub1.anInt1302 = 0;
- method89(class30_sub1);
- } else
- {
- class30_sub1.unlink();
- }
- }
- private void resetImageProducers()
- {
- if(aRSImageProducer_1107 != null)
- return;
- super.fullGameScreen = null;
- aRSImageProducer_1166 = null;
- aRSImageProducer_1164 = null;
- aRSImageProducer_1163 = null;
- aRSImageProducer_1165 = null;
- aRSImageProducer_1123 = null;
- aRSImageProducer_1124 = null;
- aRSImageProducer_1125 = null;
- aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- if(titleStreamLoader != null)
- {
- drawLogo();
- loadTitleScreen();
- }
- welcomeScreenRaised = true;
- }
- void drawLoadingText(int i, String s)
- {
- anInt1079 = i;
- aString1049 = s;
- resetImageProducers();
- if(titleStreamLoader == null)
- {
- super.drawLoadingText(i, s);
- return;
- }
- aRSImageProducer_1109.initDrawingArea();
- char c = '\u0168';
- char c1 = '\310';
- byte byte1 = 20;
- chatTextDrawingArea.drawText(0xffffff, "Peractorum is loading - please wait...", c1 / 2 - 26 - byte1, c / 2);
- int j = c1 / 2 - 18 - byte1;
- DrawingArea.fillPixels(c / 2 - 152, 304, 34, 0x8c1111, j);
- DrawingArea.fillPixels(c / 2 - 151, 302, 32, 0, j + 1);
- DrawingArea.drawPixels(30, j + 2, c / 2 - 150, 0x8c1111, i * 3);
- DrawingArea.drawPixels(30, j + 2, (c / 2 - 150) + i * 3, 0, 300 - i * 3);
- chatTextDrawingArea.drawText(0xffffff, s, (c1 / 2 + 5) - byte1, c / 2);
- aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
- if(welcomeScreenRaised)
- {
- welcomeScreenRaised = false;
- if(!aBoolean831)
- {
- aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
- aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
- }
- aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
- aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
- aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
- aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
- aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
- aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
- }
- }
- private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
- int j1)
- {
- int anInt992;
- if(aBoolean972)
- anInt992 = 32;
- else
- anInt992 = 0;
- aBoolean972 = false;
- if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
- {
- class9.scrollPosition -= anInt1213 * 4;
- if(flag)
- {
- needDrawTabArea = true;
- }
- } else
- if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
- {
- class9.scrollPosition += anInt1213 * 4;
- if(flag)
- {
- needDrawTabArea = true;
- }
- } else
- if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
- {
- int l1 = ((j - 32) * j) / j1;
- if(l1 < 8)
- l1 = 8;
- int i2 = l - i1 - 16 - l1 / 2;
- int j2 = j - 32 - l1;
- class9.scrollPosition = ((j1 - j) * i2) / j2;
- if(flag)
- needDrawTabArea = true;
- aBoolean972 = true;
- }
- }
- private boolean method66(int i, int j, int k)
- {
- int i1 = i >> 14 & 0x7fff;
- int j1 = worldController.method304(plane, k, j, i);
- if(j1 == -1)
- return false;
- int k1 = j1 & 0x1f;
- int l1 = j1 >> 6 & 3;
- if(k1 == 10 || k1 == 11 || k1 == 22)
- {
- ObjectDef class46 = ObjectDef.forID(i1);
- int i2;
- int j2;
- if(l1 == 0 || l1 == 2)
- {
- i2 = class46.anInt744;
- j2 = class46.anInt761;
- } else
- {
- i2 = class46.anInt761;
- j2 = class46.anInt744;
- }
- int k2 = class46.anInt768;
- if(l1 != 0)
- k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
- doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
- } else
- {
- doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
- }
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- return true;
- }
- private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
- {
- byte abyte0[] = null;
- int l = 5;
- try
- {
- if(decompressors[0] != null)
- abyte0 = decompressors[0].decompress(i);
- }
- catch(Exception _ex) { }
- if(abyte0 != null)
- {
- // aCRC32_930.reset();
- // aCRC32_930.update(abyte0);
- // int i1 = (int)aCRC32_930.getValue();
- // if(i1 != j)
- }
- if(abyte0 != null)
- {
- StreamLoader streamLoader = new StreamLoader(abyte0);
- return streamLoader;
- }
- int j1 = 0;
- while(abyte0 == null)
- {
- String s2 = "Unknown error";
- drawLoadingText(k, "Requesting " + s);
- Object obj = null;
- try
- {
- int k1 = 0;
- DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
- byte abyte1[] = new byte[6];
- datainputstream.readFully(abyte1, 0, 6);
- Stream stream = new Stream(abyte1);
- stream.currentOffset = 3;
- int i2 = stream.read3Bytes() + 6;
- int j2 = 6;
- abyte0 = new byte[i2];
- System.arraycopy(abyte1, 0, abyte0, 0, 6);
- while(j2 < i2)
- {
- int l2 = i2 - j2;
- if(l2 > 1000)
- l2 = 1000;
- int j3 = datainputstream.read(abyte0, j2, l2);
- if(j3 < 0)
- {
- s2 = "Length error: " + j2 + "/" + i2;
- throw new IOException("EOF");
- }
- j2 += j3;
- int k3 = (j2 * 100) / i2;
- if(k3 != k1)
- drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
- k1 = k3;
- }
- datainputstream.close();
- try
- {
- if(decompressors[0] != null)
- decompressors[0].method234(abyte0.length, abyte0, i);
- }
- catch(Exception _ex)
- {
- decompressors[0] = null;
- }
- /* if(abyte0 != null)
- {
- aCRC32_930.reset();
- aCRC32_930.update(abyte0);
- int i3 = (int)aCRC32_930.getValue();
- if(i3 != j)
- {
- abyte0 = null;
- j1++;
- s2 = "Checksum error: " + i3;
- }
- }
- */
- }
- catch(IOException ioexception)
- {
- if(s2.equals("Unknown error"))
- s2 = "Connection error";
- abyte0 = null;
- }
- catch(NullPointerException _ex)
- {
- s2 = "Null error";
- abyte0 = null;
- if(!signlink.reporterror)
- return null;
- }
- catch(ArrayIndexOutOfBoundsException _ex)
- {
- s2 = "Bounds error";
- abyte0 = null;
- if(!signlink.reporterror)
- return null;
- }
- catch(Exception _ex)
- {
- s2 = "Unexpected error";
- abyte0 = null;
- if(!signlink.reporterror)
- return null;
- }
- if(abyte0 == null)
- {
- for(int l1 = l; l1 > 0; l1--)
- {
- if(j1 >= 3)
- {
- drawLoadingText(k, "Game updated - please reload page");
- l1 = 10;
- } else
- {
- drawLoadingText(k, s2 + " - Retrying in " + l1);
- }
- try
- {
- Thread.sleep(1000L);
- }
- catch(Exception _ex) { }
- }
- l *= 2;
- if(l > 60)
- l = 60;
- aBoolean872 = !aBoolean872;
- }
- }
- StreamLoader streamLoader_1 = new StreamLoader(abyte0);
- return streamLoader_1;
- }
- private void dropClient()
- {
- if(anInt1011 > 0)
- {
- resetLogout();
- return;
- }
- aRSImageProducer_1165.initDrawingArea();
- aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
- aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
- aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
- aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
- aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
- anInt1021 = 0;
- destX = 0;
- RSSocket rsSocket = socketStream;
- loggedIn = false;
- loginFailures = 0;
- login(myUsername, myPassword, true);
- if(!loggedIn)
- resetLogout();
- try
- {
- rsSocket.close();
- }
- catch(Exception _ex)
- {
- }
- }
- private void doAction(int i)
- {
- if(i < 0)
- return;
- if(inputDialogState != 0)
- {
- inputDialogState = 0;
- inputTaken = true;
- }
- int j = menuActionCmd2[i];
- int k = menuActionCmd3[i];
- int l = menuActionID[i];
- int i1 = menuActionCmd1[i];
- if(l >= 2000)
- l -= 2000;
- if(l == 582)
- {
- NPC npc = npcArray[i1];
- if(npc != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(57);
- stream.method432(anInt1285);
- stream.method432(i1);
- stream.method431(anInt1283);
- stream.method432(anInt1284);
- }
- }
- if(l == 234)
- {
- boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag1)
- flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(236);
- stream.method431(k + baseY);
- stream.writeWord(i1);
- stream.method431(j + baseX);
- }
- if(l == 62 && method66(i1, k, j))
- {
- stream.createFrame(192);
- stream.writeWord(anInt1284);
- stream.method431(i1 >> 14 & 0x7fff);
- stream.method433(k + baseY);
- stream.method431(anInt1283);
- stream.method433(j + baseX);
- stream.writeWord(anInt1285);
- }
- if(l == 511)
- {
- boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag2)
- flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(25);
- stream.method431(anInt1284);
- stream.method432(anInt1285);
- stream.writeWord(i1);
- stream.method432(k + baseY);
- stream.method433(anInt1283);
- stream.writeWord(j + baseX);
- }
- if(l == 74)
- {
- stream.createFrame(122);
- stream.method433(k);
- stream.method432(j);
- stream.method431(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 315)
- {
- RSInterface class9 = RSInterface.interfaceCache[k];
- boolean flag8 = true;
- if(class9.contentType > 0)
- flag8 = promptUserForInput(class9);
- if(flag8)
- {
- stream.createFrame(185);
- stream.writeWord(k);
- }
- }
- if(l == 561)
- {
- Player player = playerArray[i1];
- if(player != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1188 += i1;
- if(anInt1188 >= 90)
- {
- stream.createFrame(136);
- anInt1188 = 0;
- }
- stream.createFrame(128);
- stream.writeWord(i1);
- }
- }
- if(l == 20)
- {
- NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_1 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_1.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(155);
- stream.method431(i1);
- }
- }
- if(l == 779)
- {
- Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_1 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_1.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_1.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(153);
- stream.method431(i1);
- }
- }
- if(l == 516)
- if(!menuOpen)
- worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
- else
- worldController.method312(k - 4, j - 4);
- if(l == 1062)
- {
- anInt924 += baseX;
- if(anInt924 >= 113)
- {
- stream.createFrame(183);
- stream.writeDWordBigEndian(0xe63271);
- anInt924 = 0;
- }
- method66(i1, k, j);
- stream.createFrame(228);
- stream.method432(i1 >> 14 & 0x7fff);
- stream.method432(k + baseY);
- stream.writeWord(j + baseX);
- }
- if(l == 679 && !aBoolean1149)
- {
- stream.createFrame(40);
- stream.writeWord(k);
- aBoolean1149 = true;
- }
- if(l == 431)
- {
- stream.createFrame(129);
- stream.method432(j);
- stream.writeWord(k);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 337 || l == 42 || l == 792 || l == 322)
- {
- String s = menuActionName[i];
- int k1 = s.indexOf("@whi@");
- if(k1 != -1)
- {
- long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
- if(l == 337)
- addFriend(l3);
- if(l == 42)
- addIgnore(l3);
- if(l == 792)
- delFriend(l3);
- if(l == 322)
- delIgnore(l3);
- }
- }
- if(l == 53)
- {
- stream.createFrame(135);
- stream.method431(j);
- stream.method432(k);
- stream.method431(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 539)
- {
- stream.createFrame(16);
- stream.method432(i1);
- stream.method433(j);
- stream.method433(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 484 || l == 6)
- {
- String s1 = menuActionName[i];
- int l1 = s1.indexOf("@whi@");
- if(l1 != -1)
- {
- s1 = s1.substring(l1 + 5).trim();
- String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
- boolean flag9 = false;
- for(int j3 = 0; j3 < playerCount; j3++)
- {
- Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
- if(class30_sub2_sub4_sub1_sub2_7 == null || class30_sub2_sub4_sub1_sub2_7.name == null || !class30_sub2_sub4_sub1_sub2_7.name.equalsIgnoreCase(s7))
- continue;
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_7.smallX[0]);
- if(l == 484)
- {
- stream.createFrame(139);
- stream.method431(playerIndices[j3]);
- }
- if(l == 6)
- {
- anInt1188 += i1;
- if(anInt1188 >= 90)
- {
- stream.createFrame(136);
- anInt1188 = 0;
- }
- stream.createFrame(128);
- stream.writeWord(playerIndices[j3]);
- }
- flag9 = true;
- break;
- }
- if(!flag9)
- pushMessage("Unable to find " + s7, 0, "");
- }
- }
- if(l == 870)
- {
- stream.createFrame(53);
- stream.writeWord(j);
- stream.method432(anInt1283);
- stream.method433(i1);
- stream.writeWord(anInt1284);
- stream.method431(anInt1285);
- stream.writeWord(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 847)
- {
- stream.createFrame(87);
- stream.method432(i1);
- stream.writeWord(k);
- stream.method432(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 626)
- {
- RSInterface class9_1 = RSInterface.interfaceCache[k];
- spellSelected = 1;
- anInt1137 = k;
- spellUsableOn = class9_1.spellUsableOn;
- itemSelected = 0;
- needDrawTabArea = true;
- String s4 = class9_1.selectedActionName;
- if(s4.indexOf(" ") != -1)
- s4 = s4.substring(0, s4.indexOf(" "));
- String s8 = class9_1.selectedActionName;
- if(s8.indexOf(" ") != -1)
- s8 = s8.substring(s8.indexOf(" ") + 1);
- spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
- if(spellUsableOn == 16)
- {
- needDrawTabArea = true;
- tabID = 3;
- tabAreaAltered = true;
- }
- return;
- }
- if(l == 78)
- {
- stream.createFrame(117);
- stream.method433(k);
- stream.method433(i1);
- stream.method431(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 27)
- {
- Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_2 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_2.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt986 += i1;
- if(anInt986 >= 54)
- {
- stream.createFrame(189);
- stream.writeWordBigEndian(234);
- anInt986 = 0;
- }
- stream.createFrame(73);
- stream.method431(i1);
- }
- }
- if(l == 213)
- {
- boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag3)
- flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(79);
- stream.method431(k + baseY);
- stream.writeWord(i1);
- stream.method432(j + baseX);
- }
- if(l == 632)
- {
- stream.createFrame(145);
- stream.method432(k);
- stream.method432(j);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 493)
- {
- stream.createFrame(75);
- stream.method433(k);
- stream.method431(j);
- stream.method432(i1);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 652)
- {
- boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag4)
- flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(156);
- stream.method432(j + baseX);
- stream.method431(k + baseY);
- stream.method433(i1);
- }
- if(l == 94)
- {
- boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag5)
- flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(181);
- stream.method431(k + baseY);
- stream.writeWord(i1);
- stream.method431(j + baseX);
- stream.method432(anInt1137);
- }
- if(l == 646)
- {
- stream.createFrame(185);
- stream.writeWord(k);
- RSInterface class9_2 = RSInterface.interfaceCache[k];
- if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
- {
- int i2 = class9_2.valueIndexArray[0][1];
- if(variousSettings[i2] != class9_2.anIntArray212[0])
- {
- variousSettings[i2] = class9_2.anIntArray212[0];
- method33(i2);
- needDrawTabArea = true;
- }
- }
- }
- if(l == 225)
- {
- NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_2 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_2.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_2.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1226 += i1;
- if(anInt1226 >= 85)
- {
- stream.createFrame(230);
- stream.writeWordBigEndian(239);
- anInt1226 = 0;
- }
- stream.createFrame(17);
- stream.method433(i1);
- }
- }
- if(l == 965)
- {
- NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_3 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_3.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- anInt1134++;
- if(anInt1134 >= 96)
- {
- stream.createFrame(152);
- stream.writeWordBigEndian(88);
- anInt1134 = 0;
- }
- stream.createFrame(21);
- stream.writeWord(i1);
- }
- }
- if(l == 413)
- {
- NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_4 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_4.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(131);
- stream.method433(i1);
- stream.method432(anInt1137);
- }
- }
- if(l == 200)
- clearTopInterfaces();
- if(l == 1025)
- {
- NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_5 != null)
- {
- EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
- if(entityDef.childrenIDs != null)
- entityDef = entityDef.method161();
- if(entityDef != null)
- {
- String s9;
- if(entityDef.description != null)
- s9 = new String(entityDef.description);
- else
- s9 = "It's a " + entityDef.name + ".";
- pushMessage(s9, 0, "");
- }
- }
- }
- if(l == 900)
- {
- method66(i1, k, j);
- stream.createFrame(252);
- stream.method433(i1 >> 14 & 0x7fff);
- stream.method431(k + baseY);
- stream.method432(j + baseX);
- }
- if(l == 412)
- {
- NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_6 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_6.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(72);
- stream.method432(i1);
- }
- }
- if(l == 365)
- {
- Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_3 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_3.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_3.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(249);
- stream.method432(i1);
- stream.method431(anInt1137);
- }
- }
- if(l == 729)
- {
- Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_4 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_4.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_4.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(39);
- stream.method431(i1);
- }
- }
- if(l == 577)
- {
- Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_5 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_5.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_5.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(139);
- stream.method431(i1);
- }
- }
- if(l == 956 && method66(i1, k, j))
- {
- stream.createFrame(35);
- stream.method431(j + baseX);
- stream.method432(anInt1137);
- stream.method432(k + baseY);
- stream.method431(i1 >> 14 & 0x7fff);
- }
- if(l == 567)
- {
- boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag6)
- flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(23);
- stream.method431(k + baseY);
- stream.method431(i1);
- stream.method431(j + baseX);
- }
- if(l == 867)
- {
- if((i1 & 3) == 0)
- anInt1175++;
- if(anInt1175 >= 59)
- {
- stream.createFrame(200);
- stream.writeWord(25501);
- anInt1175 = 0;
- }
- stream.createFrame(43);
- stream.method431(k);
- stream.method432(i1);
- stream.method432(j);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 543)
- {
- stream.createFrame(237);
- stream.writeWord(j);
- stream.method432(i1);
- stream.writeWord(k);
- stream.method432(anInt1137);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 606)
- {
- String s2 = menuActionName[i];
- int j2 = s2.indexOf("@whi@");
- if(j2 != -1)
- if(openInterfaceID == -1)
- {
- clearTopInterfaces();
- reportAbuseInput = s2.substring(j2 + 5).trim();
- canMute = false;
- for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
- {
- if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
- continue;
- reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
- break;
- }
- } else
- {
- pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
- }
- }
- if(l == 491)
- {
- Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
- if(class30_sub2_sub4_sub1_sub2_6 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub2_6.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub2_6.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(14);
- //stream.method432(anInt1284);
- stream.writeWord(i1); //Player id
- //stream.writeWord(anInt1285);
- stream.method431(anInt1283); //Item slot
- }
- }
- if(l == 639)
- {
- String s3 = menuActionName[i];
- int k2 = s3.indexOf("@whi@");
- if(k2 != -1)
- {
- long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
- int k3 = -1;
- for(int i4 = 0; i4 < friendsCount; i4++)
- {
- if(friendsListAsLongs[i4] != l4)
- continue;
- k3 = i4;
- break;
- }
- if(k3 != -1 && friendsNodeIDs[k3] > 0)
- {
- inputTaken = true;
- inputDialogState = 0;
- messagePromptRaised = true;
- promptInput = "";
- friendsListAction = 3;
- aLong953 = friendsListAsLongs[k3];
- aString1121 = "Enter message to send to " + friendsList[k3];
- }
- }
- }
- if(l == 454)
- {
- stream.createFrame(41);
- stream.writeWord(i1);
- stream.method432(j);
- stream.method432(k);
- atInventoryLoopCycle = 0;
- atInventoryInterface = k;
- atInventoryIndex = j;
- atInventoryInterfaceType = 2;
- if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
- atInventoryInterfaceType = 1;
- if(RSInterface.interfaceCache[k].parentID == backDialogID)
- atInventoryInterfaceType = 3;
- }
- if(l == 478)
- {
- NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
- if(class30_sub2_sub4_sub1_sub1_7 != null)
- {
- doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, class30_sub2_sub4_sub1_sub1_7.smallY[0], myPlayer.smallX[0], false, class30_sub2_sub4_sub1_sub1_7.smallX[0]);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- if((i1 & 3) == 0)
- anInt1155++;
- if(anInt1155 >= 53)
- {
- stream.createFrame(85);
- stream.writeWordBigEndian(66);
- anInt1155 = 0;
- }
- stream.createFrame(18);
- stream.method431(i1);
- }
- }
- if(l == 113)
- {
- method66(i1, k, j);
- stream.createFrame(70);
- stream.method431(j + baseX);
- stream.writeWord(k + baseY);
- stream.method433(i1 >> 14 & 0x7fff);
- }
- if(l == 872)
- {
- method66(i1, k, j);
- stream.createFrame(234);
- stream.method433(j + baseX);
- stream.method432(i1 >> 14 & 0x7fff);
- stream.method433(k + baseY);
- }
- if(l == 502)
- {
- method66(i1, k, j);
- stream.createFrame(132);
- stream.method433(j + baseX);
- stream.writeWord(i1 >> 14 & 0x7fff);
- stream.method432(k + baseY);
- }
- if(l == 1125)
- {
- ItemDef itemDef = ItemDef.forID(i1);
- RSInterface class9_4 = RSInterface.interfaceCache[k];
- String s5;
- if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
- s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
- else
- if(itemDef.description != null)
- s5 = new String(itemDef.description);
- else
- s5 = "It's a " + itemDef.name + ".";
- pushMessage(s5, 0, "");
- }
- if(l == 169)
- {
- stream.createFrame(185);
- stream.writeWord(k);
- RSInterface class9_3 = RSInterface.interfaceCache[k];
- if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
- {
- int l2 = class9_3.valueIndexArray[0][1];
- variousSettings[l2] = 1 - variousSettings[l2];
- method33(l2);
- needDrawTabArea = true;
- }
- }
- if(l == 447)
- {
- itemSelected = 1;
- anInt1283 = j;
- anInt1284 = k;
- anInt1285 = i1;
- selectedItemName = ItemDef.forID(i1).name;
- spellSelected = 0;
- needDrawTabArea = true;
- return;
- }
- if(l == 1226)
- {
- int j1 = i1 >> 14 & 0x7fff;
- ObjectDef class46 = ObjectDef.forID(j1);
- String s10;
- if(class46.description != null)
- s10 = new String(class46.description);
- else
- s10 = "It's a " + class46.name + ".";
- pushMessage(s10, 0, "");
- }
- if(l == 244)
- {
- boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
- if(!flag7)
- flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
- crossX = super.saveClickX;
- crossY = super.saveClickY;
- crossType = 2;
- crossIndex = 0;
- stream.createFrame(253);
- stream.method431(j + baseX);
- stream.method433(k + baseY);
- stream.method432(i1);
- }
- if(l == 1448)
- {
- ItemDef itemDef_1 = ItemDef.forID(i1);
- String s6;
- if(itemDef_1.description != null)
- s6 = new String(itemDef_1.description);
- else
- s6 = "It's a " + itemDef_1.name + ".";
- pushMessage(s6, 0, "");
- }
- itemSelected = 0;
- spellSelected = 0;
- needDrawTabArea = true;
- }
- private void method70()
- {
- anInt1251 = 0;
- int j = (myPlayer.x >> 7) + baseX;
- int k = (myPlayer.y >> 7) + baseY;
- if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
- anInt1251 = 1;
- if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
- anInt1251 = 1;
- if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
- anInt1251 = 0;
- }
- public void run()
- {
- if(drawFlames)
- {
- drawFlames();
- } else
- {
- super.run();
- }
- }
- private void build3dScreenMenu()
- {
- if(itemSelected == 0 && spellSelected == 0)
- {
- menuActionName[menuActionRow] = "Walk here";
- menuActionID[menuActionRow] = 516;
- menuActionCmd2[menuActionRow] = super.mouseX;
- menuActionCmd3[menuActionRow] = super.mouseY;
- menuActionRow++;
- }
- int j = -1;
- for(int k = 0; k < Model.anInt1687; k++)
- {
- int l = Model.anIntArray1688[k];
- int i1 = l & 0x7f;
- int j1 = l >> 7 & 0x7f;
- int k1 = l >> 29 & 3;
- int l1 = l >> 14 & 0x7fff;
- if(l == j)
- continue;
- j = l;
- if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
- {
- ObjectDef class46 = ObjectDef.forID(l1);
- if(class46.childrenIDs != null)
- class46 = class46.method580();
- if(class46 == null)
- continue;
- if(itemSelected == 1)
- {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
- menuActionID[menuActionRow] = 62;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- } else
- if(spellSelected == 1)
- {
- if((spellUsableOn & 4) == 4)
- {
- menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
- menuActionID[menuActionRow] = 956;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- } else
- {
- if(class46.actions != null)
- {
- for(int i2 = 4; i2 >= 0; i2--)
- if(class46.actions[i2] != null)
- {
- menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
- if(i2 == 0)
- menuActionID[menuActionRow] = 502;
- if(i2 == 1)
- menuActionID[menuActionRow] = 900;
- if(i2 == 2)
- menuActionID[menuActionRow] = 113;
- if(i2 == 3)
- menuActionID[menuActionRow] = 872;
- if(i2 == 4)
- menuActionID[menuActionRow] = 1062;
- menuActionCmd1[menuActionRow] = l;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- }
- //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
- menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
- menuActionID[menuActionRow] = 1226;
- menuActionCmd1[menuActionRow] = class46.type << 14;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- }
- if(k1 == 1)
- {
- NPC npc = npcArray[l1];
- if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
- {
- for(int j2 = 0; j2 < npcCount; j2++)
- {
- NPC npc2 = npcArray[npcIndices[j2]];
- if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
- buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
- }
- for(int l2 = 0; l2 < playerCount; l2++)
- {
- Player player = playerArray[playerIndices[l2]];
- if(player != null && player.x == npc.x && player.y == npc.y)
- buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
- }
- }
- buildAtNPCMenu(npc.desc, l1, j1, i1);
- }
- if(k1 == 0)
- {
- Player player = playerArray[l1];
- if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
- {
- for(int k2 = 0; k2 < npcCount; k2++)
- {
- NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
- if(class30_sub2_sub4_sub1_sub1_2 != null && class30_sub2_sub4_sub1_sub1_2.desc.aByte68 == 1 && class30_sub2_sub4_sub1_sub1_2.x == player.x && class30_sub2_sub4_sub1_sub1_2.y == player.y)
- buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
- }
- for(int i3 = 0; i3 < playerCount; i3++)
- {
- Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
- if(class30_sub2_sub4_sub1_sub2_2 != null && class30_sub2_sub4_sub1_sub2_2 != player && class30_sub2_sub4_sub1_sub2_2.x == player.x && class30_sub2_sub4_sub1_sub2_2.y == player.y)
- buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
- }
- }
- buildAtPlayerMenu(i1, l1, player, j1);
- }
- if(k1 == 3)
- {
- NodeList class19 = groundArray[plane][i1][j1];
- if(class19 != null)
- {
- for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
- {
- ItemDef itemDef = ItemDef.forID(item.ID);
- if(itemSelected == 1)
- {
- menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 511;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- } else
- if(spellSelected == 1)
- {
- if((spellUsableOn & 1) == 1)
- {
- menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 94;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- } else
- {
- for(int j3 = 4; j3 >= 0; j3--)
- if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
- {
- menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
- if(j3 == 0)
- menuActionID[menuActionRow] = 652;
- if(j3 == 1)
- menuActionID[menuActionRow] = 567;
- if(j3 == 2)
- menuActionID[menuActionRow] = 234;
- if(j3 == 3)
- menuActionID[menuActionRow] = 244;
- if(j3 == 4)
- menuActionID[menuActionRow] = 213;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- } else
- if(j3 == 2)
- {
- menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 234;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
- menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
- menuActionID[menuActionRow] = 1448;
- menuActionCmd1[menuActionRow] = item.ID;
- menuActionCmd2[menuActionRow] = i1;
- menuActionCmd3[menuActionRow] = j1;
- menuActionRow++;
- }
- }
- }
- }
- }
- }
- public void cleanUpForQuit()
- {
- signlink.reporterror = false;
- try
- {
- if(socketStream != null)
- socketStream.close();
- }
- catch(Exception _ex) { }
- socketStream = null;
- stopMidi();
- if(mouseDetection != null)
- mouseDetection.running = false;
- mouseDetection = null;
- onDemandFetcher.disable();
- onDemandFetcher = null;
- aStream_834 = null;
- stream = null;
- aStream_847 = null;
- inStream = null;
- anIntArray1234 = null;
- aByteArrayArray1183 = null;
- aByteArrayArray1247 = null;
- anIntArray1235 = null;
- anIntArray1236 = null;
- intGroundArray = null;
- byteGroundArray = null;
- worldController = null;
- aClass11Array1230 = null;
- anIntArrayArray901 = null;
- anIntArrayArray825 = null;
- bigX = null;
- bigY = null;
- aByteArray912 = null;
- aRSImageProducer_1163 = null;
- aRSImageProducer_1164 = null;
- aRSImageProducer_1165 = null;
- aRSImageProducer_1166 = null;
- aRSImageProducer_1123 = null;
- aRSImageProducer_1124 = null;
- aRSImageProducer_1125 = null;
- /* Null pointers for custom sprites */
- chatArea = null;
- chatButtonH = null;
- chatButtonHC = null;
- chatButtonC = null;
- reportH = null;
- tabArea = null;
- mapArea = null;
- frame = null;
- /**/
- mapBack = null;
- backBase1 = null;
- sideIcons = null;
- redStones = null;
- compass = null;
- hitMarks = null;
- headIcons = null;
- headIconsHint = null;
- crosses = null;
- mapDotItem = null;
- mapDotNPC = null;
- mapDotPlayer = null;
- mapDotFriend = null;
- mapDotTeam = null;
- mapScenes = null;
- mapFunctions = null;
- anIntArrayArray929 = null;
- playerArray = null;
- playerIndices = null;
- anIntArray894 = null;
- aStreamArray895s = null;
- anIntArray840 = null;
- npcArray = null;
- npcIndices = null;
- groundArray = null;
- aClass19_1179 = null;
- aClass19_1013 = null;
- aClass19_1056 = null;
- menuActionCmd2 = null;
- menuActionCmd3 = null;
- menuActionID = null;
- menuActionCmd1 = null;
- menuActionName = null;
- variousSettings = null;
- anIntArray1072 = null;
- anIntArray1073 = null;
- aClass30_Sub2_Sub1_Sub1Array1140 = null;
- aClass30_Sub2_Sub1_Sub1_1263 = null;
- friendsList = null;
- friendsListAsLongs = null;
- friendsNodeIDs = null;
- aRSImageProducer_1110 = null;
- aRSImageProducer_1111 = null;
- aRSImageProducer_1107 = null;
- aRSImageProducer_1108 = null;
- aRSImageProducer_1109 = null;
- aRSImageProducer_1112 = null;
- aRSImageProducer_1113 = null;
- aRSImageProducer_1114 = null;
- aRSImageProducer_1115 = null;
- nullLoader();
- ObjectDef.nullLoader();
- EntityDef.nullLoader();
- ItemDef.nullLoader();
- Flo.cache = null;
- IDK.cache = null;
- RSInterface.interfaceCache = null;
- DummyClass.cache = null;
- Animation.anims = null;
- SpotAnim.cache = null;
- SpotAnim.aMRUNodes_415 = null;
- Varp.cache = null;
- super.fullGameScreen = null;
- Player.mruNodes = null;
- Texture.nullLoader();
- WorldController.nullLoader();
- Model.nullLoader();
- Class36.nullLoader();
- System.gc();
- }
- private void printDebug()
- {
- System.out.println("============");
- System.out.println("flame-cycle:" + anInt1208);
- if(onDemandFetcher != null)
- System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
- System.out.println("loop-cycle:" + loopCycle);
- System.out.println("draw-cycle:" + anInt1061);
- System.out.println("ptype:" + pktType);
- System.out.println("psize:" + pktSize);
- if(socketStream != null)
- socketStream.printDebug();
- super.shouldDebug = true;
- }
- Component getGameComponent()
- {
- if(signlink.mainapp != null)
- return signlink.mainapp;
- if(super.gameFrame != null)
- return super.gameFrame;
- else
- return this;
- }
- public byte[] getModel(int Index) {
- try {
- File Model = new File(signlink.findcachedir() + "/Models/"+Index+".gz");
- byte[] aByte = new byte[(int)Model.length()];
- FileInputStream fis = new FileInputStream(Model);
- fis.read(aByte);
- pushMessage("aByte = ["+aByte+"]!", 0, "");
- fis.close();
- return aByte;
- }
- catch(Exception e)
- {return null;}
- }
- private void method73() {
- do {
- int j = readChar(-796);
- if(j == -1)
- break;
- if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
- if(j == 8 && reportAbuseInput.length() > 0)
- reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
- if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
- reportAbuseInput += (char)j;
- } else if(messagePromptRaised) {
- if(j >= 32 && j <= 122 && promptInput.length() < 80) {
- promptInput += (char)j;
- inputTaken = true;
- }
- if(j == 8 && promptInput.length() > 0) {
- promptInput = promptInput.substring(0, promptInput.length() - 1);
- inputTaken = true;
- }
- if(j == 13 || j == 10) {
- messagePromptRaised = false;
- inputTaken = true;
- if(friendsListAction == 1)
- {
- long l = TextClass.longForName(promptInput);
- addFriend(l);
- }
- if(friendsListAction == 2 && friendsCount > 0)
- {
- long l1 = TextClass.longForName(promptInput);
- delFriend(l1);
- }
- if(friendsListAction == 3 && promptInput.length() > 0)
- {
- stream.createFrame(126);
- stream.writeWordBigEndian(0);
- int k = stream.currentOffset;
- stream.writeQWord(aLong953);
- TextInput.method526(promptInput, stream);
- stream.writeBytes(stream.currentOffset - k);
- promptInput = TextInput.processText(promptInput);
- promptInput = Censor.doCensor(promptInput);
- pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
- if(privateChatMode == 2)
- {
- privateChatMode = 1;
- aBoolean1233 = true;
- stream.createFrame(95);
- stream.writeWordBigEndian(publicChatMode);
- stream.writeWordBigEndian(privateChatMode);
- stream.writeWordBigEndian(tradeMode);
- }
- }
- if(friendsListAction == 4 && ignoreCount < 100)
- {
- long l2 = TextClass.longForName(promptInput);
- addIgnore(l2);
- }
- if(friendsListAction == 5 && ignoreCount > 0)
- {
- long l3 = TextClass.longForName(promptInput);
- delIgnore(l3);
- }
- }
- } else
- if(inputDialogState == 1)
- {
- if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10)
- {
- amountOrNameInput += (char)j;
- inputTaken = true;
- }
- if(j == 8 && amountOrNameInput.length() > 0)
- {
- amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
- inputTaken = true;
- }
- if(j == 13 || j == 10)
- {
- if(amountOrNameInput.length() > 0)
- {
- int i1 = 0;
- try
- {
- i1 = Integer.parseInt(amountOrNameInput);
- }
- catch(Exception _ex) { }
- stream.createFrame(208);
- stream.writeDWord(i1);
- }
- inputDialogState = 0;
- inputTaken = true;
- }
- } else
- if(inputDialogState == 2)
- {
- if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12)
- {
- amountOrNameInput += (char)j;
- inputTaken = true;
- }
- if(j == 8 && amountOrNameInput.length() > 0)
- {
- amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
- inputTaken = true;
- }
- if(j == 13 || j == 10)
- {
- if(amountOrNameInput.length() > 0)
- {
- stream.createFrame(60);
- stream.writeQWord(TextClass.longForName(amountOrNameInput));
- }
- inputDialogState = 0;
- inputTaken = true;
- }
- } else
- if(backDialogID == -1)
- {
- if(j >= 32 && j <= 122 && inputString.length() < 80)
- {
- inputString += (char)j;
- inputTaken = true;
- }
- if(j == 8 && inputString.length() > 0)
- {
- inputString = inputString.substring(0, inputString.length() - 1);
- inputTaken = true;
- }
- if((j == 13 || j == 10) && inputString.length() > 0)
- {
- if(myPrivilege == 2)
- {
- if(inputString.equals("::clientdrop"))
- dropClient();
- if(inputString.equals("::lag"))
- printDebug();
- if(inputString.equals("::prefetchmusic"))
- {
- for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
- onDemandFetcher.method563((byte)1, 2, j1);
- }
- if(inputString.equals("::fpson"))
- fpsOn = true;
- if(inputString.equals("::fpsoff"))
- fpsOn = false;
- if(inputString.equals("::dataon"))
- clientData = true;
- if(inputString.equals("::dataoff"))
- clientData = false;
- if(inputString.equals("::noclip"))
- {
- for(int k1 = 0; k1 < 4; k1++)
- {
- for(int i2 = 1; i2 < 103; i2++)
- {
- for(int k2 = 1; k2 < 103; k2++)
- aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
- }
- }
- }
- }
- if(inputString.startsWith("::"))
- {
- stream.createFrame(103);
- stream.writeWordBigEndian(inputString.length() - 1);
- stream.writeString(inputString.substring(2));
- } else
- {
- String s = inputString.toLowerCase();
- int j2 = 0;
- if(s.startsWith("yellow:"))
- {
- j2 = 0;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("red:"))
- {
- j2 = 1;
- inputString = inputString.substring(4);
- } else
- if(s.startsWith("green:"))
- {
- j2 = 2;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("cyan:"))
- {
- j2 = 3;
- inputString = inputString.substring(5);
- } else
- if(s.startsWith("purple:"))
- {
- j2 = 4;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("white:"))
- {
- j2 = 5;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("flash1:"))
- {
- j2 = 6;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("flash2:"))
- {
- j2 = 7;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("flash3:"))
- {
- j2 = 8;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("glow1:"))
- {
- j2 = 9;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("glow2:"))
- {
- j2 = 10;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("glow3:"))
- {
- j2 = 11;
- inputString = inputString.substring(6);
- }
- s = inputString.toLowerCase();
- int i3 = 0;
- if(s.startsWith("wave:"))
- {
- i3 = 1;
- inputString = inputString.substring(5);
- } else
- if(s.startsWith("wave2:"))
- {
- i3 = 2;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("shake:"))
- {
- i3 = 3;
- inputString = inputString.substring(6);
- } else
- if(s.startsWith("scroll:"))
- {
- i3 = 4;
- inputString = inputString.substring(7);
- } else
- if(s.startsWith("slide:"))
- {
- i3 = 5;
- inputString = inputString.substring(6);
- }
- stream.createFrame(4);
- stream.writeWordBigEndian(0);
- int j3 = stream.currentOffset;
- stream.method425(i3);
- stream.method425(j2);
- aStream_834.currentOffset = 0;
- TextInput.method526(inputString, aStream_834);
- stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
- stream.writeBytes(stream.currentOffset - j3);
- inputString = TextInput.processText(inputString);
- inputString = Censor.doCensor(inputString);
- myPlayer.textSpoken = inputString;
- myPlayer.anInt1513 = j2;
- myPlayer.anInt1531 = i3;
- myPlayer.textCycle = 150;
- if(myPrivilege == 2)
- pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
- else
- if(myPrivilege == 1)
- pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
- else
- pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
- if(publicChatMode == 2)
- {
- publicChatMode = 3;
- aBoolean1233 = true;
- stream.createFrame(95);
- stream.writeWordBigEndian(publicChatMode);
- stream.writeWordBigEndian(privateChatMode);
- stream.writeWordBigEndian(tradeMode);
- }
- }
- inputString = "";
- inputTaken = true;
- }
- }
- } while(true);
- }
- private void buildPublicChat(int j)
- {
- int l = 0;
- for(int i1 = 0; i1 < 500; i1++)
- {
- if(chatMessages[i1] == null)
- continue;
- if(chatTypeView != 1)
- continue;
- int j1 = chatTypes[i1];
- String s = chatNames[i1];
- String ct = chatMessages[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if(k1 < -23)
- break;
- if(s != null && s.startsWith("@cr1@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr2@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr3@"))
- s = s.substring(5);
- if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
- if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
- if(myPrivilege >= 1) {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void buildFriendChat(int j)
- {
- int l = 0;
- for(int i1 = 0; i1 < 500; i1++) {
- if(chatMessages[i1] == null)
- continue;
- if(chatTypeView != 2)
- continue;
- int j1 = chatTypes[i1];
- String s = chatNames[i1];
- String ct = chatMessages[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if(k1 < -23)
- break;
- if(s != null && s.startsWith("@cr1@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr2@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr3@"))
- s = s.substring(5);
- if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
- l++;
- if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
- {
- if(j > k1 - 14 && j <= k1) {
- if(myPrivilege >= 1) {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void buildDuelorTrade(int j)
- {
- int l = 0;
- for(int i1 = 0; i1 < 500; i1++)
- {
- if(chatMessages[i1] == null)
- continue;
- if(chatTypeView != 3 && chatTypeView != 4)
- continue;
- int j1 = chatTypes[i1];
- String s = chatNames[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if(k1 < -23)
- break;
- if(s != null && s.startsWith("@cr1@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr2@"))
- s = s.substring(5);
- if(s != null && s.startsWith("@cr3@"))
- s = s.substring(5);
- if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
- if(j > k1 - 14 && j <= k1) {
- menuActionName[menuActionRow] = "Accept trade @whi@" + s;
- menuActionID[menuActionRow] = 484;
- menuActionRow++;
- }
- l++;
- }
- if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
- if(j > k1 - 14 && j <= k1) {
- menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
- menuActionID[menuActionRow] = 6;
- menuActionRow++;
- }
- l++;
- }
- if(j1 == 12) {
- if(j > k1 - 14 && j <= k1) {
- menuActionName[menuActionRow] = "Go-to @blu@" + s;
- menuActionID[menuActionRow] = 915;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void buildChatAreaMenu(int j)
- {
- int l = 0;
- int test = 0;
- for(int i1 = 0; i1 < 500; i1++)
- {
- if(chatMessages[i1] == null)
- continue;
- int j1 = chatTypes[i1];
- int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
- if(k1 < -23)
- break;
- String s = chatNames[i1];
- String ct = chatMessages[i1];
- boolean flag = false;
- if(chatTypeView == 1) {
- buildPublicChat(j);
- break;
- }
- if(chatTypeView == 2) {
- buildFriendChat(j);
- break;
- }
- if(chatTypeView == 3 || chatTypeView == 4) {
- buildDuelorTrade(j);
- break;
- }
- if(chatTypeView == 5) {
- break;
- }
- if(s != null && s.startsWith("@cr1@")) {
- s = s.substring(5);
- boolean flag1 = true;
- byte byte0 = 1;
- }
- if(s != null && s.startsWith("@cr2@")) {
- s = s.substring(5);
- byte byte0 = 2;
- }
- if(s != null && s.startsWith("@cr3@")) {
- s = s.substring(5);
- byte byte0 = 3;
- }
- if(j1 == 0)
- l++;
- if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s)))
- {
- if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name))
- {
- if(myPrivilege >= 1)
- {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
- {
- if(j > k1 - 14 && j <= k1)
- {
- if(myPrivilege >= 1)
- {
- menuActionName[menuActionRow] = "Report abuse @whi@" + s;
- menuActionID[menuActionRow] = 606;
- menuActionRow++;
- }
- menuActionName[menuActionRow] = "Add ignore @whi@" + s;
- menuActionID[menuActionRow] = 42;
- menuActionRow++;
- menuActionName[menuActionRow] = "Add friend @whi@" + s;
- menuActionID[menuActionRow] = 337;
- menuActionRow++;
- }
- l++;
- }
- if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
- {
- if(j > k1 - 14 && j <= k1)
- {
- menuActionName[menuActionRow] = "Accept trade @whi@" + s;
- menuActionID[menuActionRow] = 484;
- menuActionRow++;
- }
- l++;
- }
- if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
- l++;
- if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s)))
- {
- if(j > k1 - 14 && j <= k1)
- {
- menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
- menuActionID[menuActionRow] = 6;
- menuActionRow++;
- }
- l++;
- }
- }
- }
- private void drawFriendsListOrWelcomeScreen(RSInterface class9)
- {
- int j = class9.contentType;
- if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
- {
- if(j == 1 && anInt900 == 0)
- {
- class9.message = "Loading friend list";
- class9.atActionType = 0;
- return;
- }
- if(j == 1 && anInt900 == 1)
- {
- class9.message = "Connecting to friendserver";
- class9.atActionType = 0;
- return;
- }
- if(j == 2 && anInt900 != 2)
- {
- class9.message = "Please wait...";
- class9.atActionType = 0;
- return;
- }
- int k = friendsCount;
- if(anInt900 != 2)
- k = 0;
- if(j > 700)
- j -= 601;
- else
- j--;
- if(j >= k)
- {
- class9.message = "";
- class9.atActionType = 0;
- return;
- } else
- {
- class9.message = friendsList[j];
- class9.atActionType = 1;
- return;
- }
- }
- if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
- {
- int l = friendsCount;
- if(anInt900 != 2)
- l = 0;
- if(j > 800)
- j -= 701;
- else
- j -= 101;
- if(j >= l)
- {
- class9.message = "";
- class9.atActionType = 0;
- return;
- }
- if(friendsNodeIDs[j] == 0)
- class9.message = "@red@Offline";
- else if(friendsNodeIDs[j] == nodeID)
- class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
- else
- class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
- class9.atActionType = 1;
- return;
- }
- if(j == 203)
- {
- int i1 = friendsCount;
- if(anInt900 != 2)
- i1 = 0;
- class9.scrollMax = i1 * 15 + 20;
- if(class9.scrollMax <= class9.height)
- class9.scrollMax = class9.height + 1;
- return;
- }
- if(j >= 401 && j <= 500)
- {
- if((j -= 401) == 0 && anInt900 == 0)
- {
- class9.message = "Loading ignore list";
- class9.atActionType = 0;
- return;
- }
- if(j == 1 && anInt900 == 0)
- {
- class9.message = "Please wait...";
- class9.atActionType = 0;
- return;
- }
- int j1 = ignoreCount;
- if(anInt900 == 0)
- j1 = 0;
- if(j >= j1)
- {
- class9.message = "";
- class9.atActionType = 0;
- return;
- } else
- {
- class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
- class9.atActionType = 1;
- return;
- }
- }
- if(j == 503)
- {
- class9.scrollMax = ignoreCount * 15 + 20;
- if(class9.scrollMax <= class9.height)
- class9.scrollMax = class9.height + 1;
- return;
- }
- if(j == 327)
- {
- class9.modelRotation1 = 150;
- class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
- if(aBoolean1031)
- {
- for(int k1 = 0; k1 < 7; k1++)
- {
- int l1 = anIntArray1065[k1];
- if(l1 >= 0 && !IDK.cache[l1].method537())
- return;
- }
- aBoolean1031 = false;
- Model aclass30_sub2_sub4_sub6s[] = new Model[7];
- int i2 = 0;
- for(int j2 = 0; j2 < 7; j2++)
- {
- int k2 = anIntArray1065[j2];
- if(k2 >= 0)
- aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
- }
- Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
- for(int l2 = 0; l2 < 5; l2++)
- if(anIntArray990[l2] != 0)
- {
- model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
- if(l2 == 1)
- model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
- }
- model.method469();
- model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
- model.method479(64, 850, -30, -50, -30, true);
- class9.anInt233 = 5;
- class9.mediaID = 0;
- RSInterface.method208(aBoolean994, model);
- }
- return;
- }
- if(j == 324)
- {
- if(aClass30_Sub2_Sub1_Sub1_931 == null)
- {
- aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
- aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
- }
- if(aBoolean1047)
- {
- class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
- return;
- } else
- {
- class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
- return;
- }
- }
- if(j == 325)
- {
- if(aClass30_Sub2_Sub1_Sub1_931 == null)
- {
- aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
- aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
- }
- if(aBoolean1047)
- {
- class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
- return;
- } else
- {
- class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
- return;
- }
- }
- if(j == 600)
- {
- class9.message = reportAbuseInput;
- if(loopCycle % 20 < 10)
- {
- class9.message += "|";
- return;
- } else
- {
- class9.message += " ";
- return;
- }
- }
- if(j == 613)
- if(myPrivilege >= 1)
- {
- if(canMute)
- {
- class9.textColor = 0xff0000;
- class9.message = "Moderator option: Mute player for 48 hours: <ON>";
- } else
- {
- class9.textColor = 0xffffff;
- class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
- }
- } else
- {
- class9.message = "";
- }
- if(j == 650 || j == 655)
- if(anInt1193 != 0)
- {
- String s;
- if(daysSinceLastLogin == 0)
- s = "earlier today";
- else
- if(daysSinceLastLogin == 1)
- s = "yesterday";
- else
- s = daysSinceLastLogin + " days ago";
- class9.message = "You last logged in " + s + " from: " + signlink.dns;
- } else
- {
- class9.message = "";
- }
- if(j == 651)
- {
- if(unreadMessages == 0)
- {
- class9.message = "0 unread messages";
- class9.textColor = 0xffff00;
- }
- if(unreadMessages == 1)
- {
- class9.message = "1 unread message";
- class9.textColor = 65280;
- }
- if(unreadMessages > 1)
- {
- class9.message = unreadMessages + " unread messages";
- class9.textColor = 65280;
- }
- }
- if(j == 652)
- if(daysSinceRecovChange == 201)
- {
- if(membersInt == 1)
- class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
- else
- class9.message = "";
- } else
- if(daysSinceRecovChange == 200)
- {
- class9.message = "You have not yet set any password recovery questions.";
- } else
- {
- String s1;
- if(daysSinceRecovChange == 0)
- s1 = "Earlier today";
- else
- if(daysSinceRecovChange == 1)
- s1 = "Yesterday";
- else
- s1 = daysSinceRecovChange + " days ago";
- class9.message = s1 + " you changed your recovery questions";
- }
- if(j == 653)
- if(daysSinceRecovChange == 201)
- {
- if(membersInt == 1)
- class9.message = "@whi@recommend you use a members world instead. You may use";
- else
- class9.message = "";
- } else
- if(daysSinceRecovChange == 200)
- class9.message = "We strongly recommend you do so now to secure your account.";
- else
- class9.message = "If you do not remember making this change then cancel it immediately";
- if(j == 654)
- {
- if(daysSinceRecovChange == 201)
- if(membersInt == 1)
- {
- class9.message = "@whi@this world but member benefits are unavailable whilst here.";
- return;
- } else
- {
- class9.message = "";
- return;
- }
- if(daysSinceRecovChange == 200)
- {
- class9.message = "Do this from the 'account management' area on our front webpage";
- return;
- }
- class9.message = "Do this from the 'account management' area on our front webpage";
- }
- }
- private void drawSplitPrivateChat()
- {
- if(splitPrivateChat == 0)
- return;
- TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
- int i = 0;
- if(anInt1104 != 0)
- i = 1;
- for(int j = 0; j < 100; j++)
- if(chatMessages[j] != null)
- {
- int k = chatTypes[j];
- String s = chatNames[j];
- byte byte1 = 0;
- if(s != null && s.startsWith("@cr1@"))
- {
- s = s.substring(5);
- byte1 = 1;
- }
- if(s != null && s.startsWith("@cr2@"))
- {
- s = s.substring(5);
- byte1 = 2;
- }
- if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
- {
- int l = 329 - i * 13;
- int k1 = 4;
- textDrawingArea.method385(0, "From", l, k1);
- textDrawingArea.method385(65535, "From", l - 1, k1);
- k1 += textDrawingArea.getTextWidth("From ");
- if(byte1 == 1)
- {
- modIcons[0].method361(k1, l - 12);
- k1 += 12;
- }
- if(byte1 == 2)
- {
- modIcons[1].method361(k1, l - 12);
- k1 += 12;
- }
- textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
- textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
- if(++i >= 5)
- return;
- }
- if(k == 5 && privateChatMode < 2)
- {
- int i1 = 329 - i * 13;
- textDrawingArea.method385(0, chatMessages[j], i1, 4);
- textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
- if(++i >= 5)
- return;
- }
- if(k == 6 && privateChatMode < 2)
- {
- int j1 = 329 - i * 13;
- textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
- textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
- if(++i >= 5)
- return;
- }
- }
- }
- public void pushMessage(String s, int i, String s1) {
- if(i == 0 && dialogID != -1) {
- aString844 = s;
- super.clickMode3 = 0;
- }
- if(backDialogID == -1)
- inputTaken = true;
- for(int j = 499; j > 0; j--) {
- chatTypes[j] = chatTypes[j - 1];
- chatNames[j] = chatNames[j - 1];
- chatMessages[j] = chatMessages[j - 1];
- }
- chatTypes[0] = i;
- chatNames[0] = s1;
- chatMessages[0] = s;
- }
- public void processMapAreaClick() {
- }
- private void processTabClick() {
- if(super.clickMode3 == 1) {
- if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
- {
- needDrawTabArea = true;
- tabID = 0;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
- {
- needDrawTabArea = true;
- tabID = 1;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
- {
- needDrawTabArea = true;
- tabID = 2;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
- {
- needDrawTabArea = true;
- tabID = 3;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
- {
- needDrawTabArea = true;
- tabID = 4;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
- {
- needDrawTabArea = true;
- tabID = 5;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
- {
- needDrawTabArea = true;
- tabID = 6;
- tabAreaAltered = true;
- }
- /*if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
- {
- needDrawTabArea = true;
- tabID = 7;
- tabAreaAltered = true;
- }*/
- if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
- {
- needDrawTabArea = true;
- tabID = 8;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
- {
- needDrawTabArea = true;
- tabID = 9;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
- {
- needDrawTabArea = true;
- tabID = 10;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
- {
- needDrawTabArea = true;
- tabID = 11;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
- {
- needDrawTabArea = true;
- tabID = 12;
- tabAreaAltered = true;
- }
- if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
- {
- needDrawTabArea = true;
- tabID = 13;
- tabAreaAltered = true;
- }
- }
- }
- private void resetImageProducers2()
- {
- if(aRSImageProducer_1166 != null)
- return;
- nullLoader();
- super.fullGameScreen = null;
- aRSImageProducer_1107 = null;
- aRSImageProducer_1108 = null;
- aRSImageProducer_1109 = null;
- aRSImageProducer_1110 = null;
- aRSImageProducer_1111 = null;
- aRSImageProducer_1112 = null;
- aRSImageProducer_1113 = null;
- aRSImageProducer_1114 = null;
- aRSImageProducer_1115 = null;
- /* Original chat area image producer */
- //aRSImageProducer_1166 = new RSImageProducer(479, 96, getGameComponent());
- /* New chat area image producer */
- aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
- aRSImageProducer_1164 = new RSImageProducer(246, 168, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- mapArea.drawSprite(0, 0);
- aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
- aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
- DrawingArea.setAllPixelsToZero();
- aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
- aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
- aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
- welcomeScreenRaised = true;
- }
- private String getDocumentBaseHost()
- {
- if(signlink.mainapp != null)
- return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
- if(super.gameFrame != null)
- return "";
- else
- return "";
- }
- private void method81(Sprite sprite, int j, int k)
- {
- int l = k * k + j * j;
- if(l > 4225 && l < 0x15f90)
- {
- int i1 = minimapInt1 + minimapInt2 & 0x7ff;
- int j1 = Model.modelIntArray1[i1];
- int k1 = Model.modelIntArray2[i1];
- j1 = (j1 * 256) / (minimapInt3 + 256);
- k1 = (k1 * 256) / (minimapInt3 + 256);
- int l1 = j * j1 + k * k1 >> 16;
- int i2 = j * k1 - k * j1 >> 16;
- double d = Math.atan2(l1, i2);
- int j2 = (int)(Math.sin(d) * 63D);
- int k2 = (int)(Math.cos(d) * 57D);
- mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
- } else
- {
- markMinimap(sprite, k, j);
- }
- }
- private void rightClickMapArea() {
- }
- private void processRightClick()
- {
- if(activeInterfaceType != 0)
- return;
- menuActionName[0] = "Cancel";
- menuActionID[0] = 1107;
- menuActionRow = 1;
- buildSplitPrivateChatMenu();
- anInt886 = 0;
- if(super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516 && super.mouseY < 338)
- if(openInterfaceID != -1)
- buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
- else
- build3dScreenMenu();
- if(anInt886 != anInt1026)
- anInt1026 = anInt886;
- anInt886 = 0;
- if(super.mouseX > 553 && super.mouseY > 205 && super.mouseX < 743 && super.mouseY < 466)
- if(invOverlayInterfaceID != -1)
- buildInterfaceMenu(553, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 205, super.mouseY, 0);
- else
- if(tabInterfaceIDs[tabID] != -1)
- buildInterfaceMenu(553, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 205, super.mouseY, 0);
- if(anInt886 != anInt1048)
- {
- needDrawTabArea = true;
- anInt1048 = anInt886;
- }
- anInt886 = 0;
- /* Chat area clicking */
- if(super.mouseX > 17 && super.mouseY > 357 && super.mouseX < 496 && super.mouseY < 453)
- if(backDialogID != -1)
- buildInterfaceMenu(17, RSInterface.interfaceCache[backDialogID], super.mouseX, 357, super.mouseY, 0);
- else
- if(super.mouseY < 434 && super.mouseX < 426)
- buildChatAreaMenu(super.mouseY - 357);
- if(backDialogID != -1 && anInt886 != anInt1039)
- {
- inputTaken = true;
- anInt1039 = anInt886;
- }
- /* Enable custom right click areas */
- if(super.mouseX > 519 && super.mouseY > 0 && super.mouseX < 765 && super.mouseY < 168)
- rightClickMapArea();
- /**/
- boolean flag = false;
- while(!flag)
- {
- flag = true;
- for(int j = 0; j < menuActionRow - 1; j++)
- if(menuActionID[j] < 1000 && menuActionID[j + 1] > 1000)
- {
- String s = menuActionName[j];
- menuActionName[j] = menuActionName[j + 1];
- menuActionName[j + 1] = s;
- int k = menuActionID[j];
- menuActionID[j] = menuActionID[j + 1];
- menuActionID[j + 1] = k;
- k = menuActionCmd2[j];
- menuActionCmd2[j] = menuActionCmd2[j + 1];
- menuActionCmd2[j + 1] = k;
- k = menuActionCmd3[j];
- menuActionCmd3[j] = menuActionCmd3[j + 1];
- menuActionCmd3[j + 1] = k;
- k = menuActionCmd1[j];
- menuActionCmd1[j] = menuActionCmd1[j + 1];
- menuActionCmd1[j + 1] = k;
- flag = false;
- }
- }
- }
- private int method83(int i, int j, int k)
- {
- int l = 256 - k;
- return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
- }
- private void login(String s, String s1, boolean flag)
- {
- signlink.errorname = s;
- try
- {
- if(!flag)
- {
- loginMessage1 = "";
- loginMessage2 = "Connecting to server...";
- drawLoginScreen(true);
- }
- socketStream = new RSSocket(this, openSocket(43594 + portOff));
- long l = TextClass.longForName(s);
- int i = (int)(l >> 16 & 31L);
- stream.currentOffset = 0;
- stream.writeWordBigEndian(14);
- stream.writeWordBigEndian(i);
- socketStream.queueBytes(2, stream.buffer);
- for(int j = 0; j < 8; j++)
- socketStream.read();
- int k = socketStream.read();
- int i1 = k;
- if(k == 0)
- {
- socketStream.flushInputStream(inStream.buffer, 8);
- inStream.currentOffset = 0;
- aLong1215 = inStream.readQWord();
- int ai[] = new int[4];
- ai[0] = (int)(Math.random() * 99999999D);
- ai[1] = (int)(Math.random() * 99999999D);
- ai[2] = (int)(aLong1215 >> 32);
- ai[3] = (int)aLong1215;
- stream.currentOffset = 0;
- stream.writeWordBigEndian(10);
- stream.writeDWord(ai[0]);
- stream.writeDWord(ai[1]);
- stream.writeDWord(ai[2]);
- stream.writeDWord(ai[3]);
- stream.writeDWord(signlink.uid);
- stream.writeString(s);
- stream.writeString(s1);
- stream.doKeys();
- aStream_847.currentOffset = 0;
- if(flag)
- aStream_847.writeWordBigEndian(18);
- else
- aStream_847.writeWordBigEndian(16);
- aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
- aStream_847.writeWordBigEndian(255);
- aStream_847.writeWord(317);
- aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
- for(int l1 = 0; l1 < 9; l1++)
- aStream_847.writeDWord(expectedCRCs[l1]);
- aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
- stream.encryption = new ISAACRandomGen(ai);
- for(int j2 = 0; j2 < 4; j2++)
- ai[j2] += 50;
- encryption = new ISAACRandomGen(ai);
- socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
- k = socketStream.read();
- }
- if(k == 1)
- {
- try
- {
- Thread.sleep(2000L);
- }
- catch(Exception _ex) { }
- login(s, s1, flag);
- return;
- }
- if(k == 2)
- {
- myPrivilege = socketStream.read();
- flagged = socketStream.read() == 1;
- aLong1220 = 0L;
- anInt1022 = 0;
- mouseDetection.coordsIndex = 0;
- super.awtFocus = true;
- aBoolean954 = true;
- loggedIn = true;
- stream.currentOffset = 0;
- inStream.currentOffset = 0;
- pktType = -1;
- anInt841 = -1;
- anInt842 = -1;
- anInt843 = -1;
- pktSize = 0;
- anInt1009 = 0;
- anInt1104 = 0;
- anInt1011 = 0;
- anInt855 = 0;
- menuActionRow = 0;
- menuOpen = false;
- super.idleTime = 0;
- for(int j1 = 0; j1 < 100; j1++)
- chatMessages[j1] = null;
- itemSelected = 0;
- spellSelected = 0;
- loadingStage = 0;
- anInt1062 = 0;
- anInt1278 = (int)(Math.random() * 100D) - 50;
- anInt1131 = (int)(Math.random() * 110D) - 55;
- anInt896 = (int)(Math.random() * 80D) - 40;
- minimapInt2 = (int)(Math.random() * 120D) - 60;
- minimapInt3 = (int)(Math.random() * 30D) - 20;
- minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
- anInt1021 = 0;
- anInt985 = -1;
- destX = 0;
- destY = 0;
- playerCount = 0;
- npcCount = 0;
- for(int i2 = 0; i2 < maxPlayers; i2++)
- {
- playerArray[i2] = null;
- aStreamArray895s[i2] = null;
- }
- for(int k2 = 0; k2 < 16384; k2++)
- npcArray[k2] = null;
- myPlayer = playerArray[myPlayerIndex] = new Player();
- aClass19_1013.removeAll();
- aClass19_1056.removeAll();
- for(int l2 = 0; l2 < 4; l2++)
- {
- for(int i3 = 0; i3 < 104; i3++)
- {
- for(int k3 = 0; k3 < 104; k3++)
- groundArray[l2][i3][k3] = null;
- }
- }
- aClass19_1179 = new NodeList();
- anInt900 = 0;
- friendsCount = 0;
- dialogID = -1;
- backDialogID = -1;
- openInterfaceID = -1;
- invOverlayInterfaceID = -1;
- anInt1018 = -1;
- aBoolean1149 = false;
- tabID = 3;
- inputDialogState = 0;
- menuOpen = false;
- messagePromptRaised = false;
- aString844 = null;
- anInt1055 = 0;
- anInt1054 = -1;
- aBoolean1047 = true;
- method45();
- for(int j3 = 0; j3 < 5; j3++)
- anIntArray990[j3] = 0;
- for(int l3 = 0; l3 < 5; l3++)
- {
- atPlayerActions[l3] = null;
- atPlayerArray[l3] = false;
- }
- anInt1175 = 0;
- anInt1134 = 0;
- anInt986 = 0;
- anInt1288 = 0;
- anInt924 = 0;
- anInt1188 = 0;
- anInt1155 = 0;
- anInt1226 = 0;
- int anInt941 = 0;
- int anInt1260 = 0;
- resetImageProducers2();
- return;
- }
- if(k == 3)
- {
- loginMessage1 = "";
- loginMessage2 = "Invalid username or password.";
- return;
- }
- if(k == 4)
- {
- loginMessage1 = "Your account has been disabled.";
- loginMessage2 = "Please check your message-center for details.";
- return;
- }
- if(k == 5)
- {
- loginMessage1 = "Your account is already logged in.";
- loginMessage2 = "Try again in 60 secs...";
- return;
- &nbs