Guest User

Client.java

a guest
Jul 21st, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 372.57 KB | None | 0 0
  1. // Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.kpdus.com/jad.html
  3. // Decompiler options: packimports(3)
  4.  
  5. import java.applet.AppletContext;
  6. import java.awt.*;
  7. import java.io.*;
  8. import java.math.BigInteger;
  9. import java.net.*;
  10. import java.util.zip.CRC32;
  11. import java.lang.reflect.Method;
  12. import sign.signlink;
  13. import javax.swing.*;
  14.  
  15. public class client extends RSApplet {
  16.    
  17.  
  18.     public int MapX, MapY;
  19.     public static int spellID = 0;
  20.     public static boolean newDamage = false;
  21.    
  22.     private static String intToKOrMilLongName(int i) {
  23.         String s = String.valueOf(i);
  24.         for(int k = s.length() - 3; k > 0; k -= 3)
  25.             s = s.substring(0, k) + "," + s.substring(k);
  26.  
  27.         //if(j != 0)
  28.            // aBoolean1224 = !aBoolean1224;
  29.         if(s.length() > 8)
  30.             s = "@gre@" + s.substring(0, s.length() - 8) + " million @whi@(" + s + ")";
  31.         else
  32.         if(s.length() > 4)
  33.             s = "@cya@" + s.substring(0, s.length() - 4) + "K @whi@(" + s + ")";
  34.         return " " + s;
  35.     }
  36.      public final String methodR(/*int i,*/ int j)
  37.     {
  38.         //if(i <= 0)
  39.            // pktType = inStream.readUnsignedByte();
  40.         if(j >= 0 && j < 10000)
  41.             return String.valueOf(j);
  42.         if(j >= 10000 && j < 10000000)
  43.             return j / 1000 + "K";
  44.         if(j >= 10000000 && j  < 999999999)
  45.             return j / 1000000 + "M";
  46.         if(j >= 999999999)
  47.             return "*";
  48.         else
  49.         return "?";
  50.     }
  51.    
  52.     public static final byte[] ReadFile(String s) {
  53.         try {
  54.             byte abyte0[];
  55.             File file = new File(s);
  56.             int i = (int)file.length();
  57.             abyte0 = new byte[i];
  58.             DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(s)));
  59.             datainputstream.readFully(abyte0, 0, i);
  60.             datainputstream.close();
  61.             return abyte0;
  62.         } catch(Exception e) {
  63.             System.out.println((new StringBuilder()).append("Read Error: ").append(s).toString());
  64.             return null;
  65.         }
  66.     }
  67.  
  68.     public void models() {
  69.         for(int ModelIndex = 0; ModelIndex < 29191; ModelIndex++) {
  70.             byte[] abyte0 = getModel(ModelIndex);
  71.             if(abyte0 != null && abyte0.length > 0) {
  72.                 decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  73.                 pushMessage("Model added successfully!", 0, "");
  74.             }
  75.         }
  76.     }
  77.     public byte[] getModel(int Index) {
  78.         try {
  79.             File Model = new File("./model/"+Index+".gz");
  80.             byte[] aByte = new byte[(int)Model.length()];
  81.             FileInputStream fis = new FileInputStream(Model);
  82.             fis.read(aByte);
  83.             pushMessage("aByte = ["+aByte+"]!", 0, "");
  84.             fis.close();
  85.             return aByte;
  86.         }
  87.         catch(Exception e)
  88.         {return null;}
  89.     }
  90.    
  91.     private void stopMidi() {
  92.         signlink.midifade = 0;
  93.         signlink.midi = "stop";
  94.     }
  95.    
  96.     private boolean menuHasAddFriend(int j) {
  97.         if(j < 0)
  98.             return false;
  99.         int k = menuActionID[j];
  100.         if(k >= 2000)
  101.             k -= 2000;
  102.         return k == 337;
  103.     }
  104.    
  105.     public void drawChannelButtons() {
  106.         String text[] = { "On", "Friends", "Off", "Hide" };
  107.         int textColor[] = { 65280, 0xffff00, 0xff0000, 65535 };
  108.         switch(cButtonCPos) {
  109.             case 0:
  110.                 chatButtons[1].drawSprite(5, 142);
  111.                 break;
  112.             case 1:
  113.                 chatButtons[1].drawSprite(71, 142);
  114.                 break;
  115.             case 2:
  116.                 chatButtons[1].drawSprite(137, 142);
  117.                 break;
  118.             case 3:
  119.                 chatButtons[1].drawSprite(203, 142);
  120.                 break;
  121.             case 4:
  122.                 chatButtons[1].drawSprite(269, 142);
  123.                 break;
  124.             case 5:
  125.                 chatButtons[1].drawSprite(335, 142);
  126.                 break;
  127.         }
  128.         if(cButtonHPos == cButtonCPos) {
  129.             switch(cButtonHPos) {
  130.                 case 0:
  131.                     chatButtons[2].drawSprite(5, 142);
  132.                     break;
  133.                 case 1:
  134.                     chatButtons[2].drawSprite(71, 142);
  135.                     break;
  136.                 case 2:
  137.                     chatButtons[2].drawSprite(137, 142);
  138.                     break;
  139.                 case 3:
  140.                     chatButtons[2].drawSprite(203, 142);
  141.                     break;
  142.                 case 4:
  143.                     chatButtons[2].drawSprite(269, 142);
  144.                     break;
  145.                 case 5:
  146.                     chatButtons[2].drawSprite(335, 142);
  147.                     break;
  148.                 case 6:
  149.                     chatButtons[3].drawSprite(404, 142);
  150.                     break;
  151.             }
  152.         } else {
  153.             switch(cButtonHPos) {
  154.                 case 0:
  155.                     chatButtons[0].drawSprite(5, 142);
  156.                     break;
  157.                 case 1:
  158.                     chatButtons[0].drawSprite(71, 142);
  159.                     break;
  160.                 case 2:
  161.                     chatButtons[0].drawSprite(137, 142);
  162.                     break;
  163.                 case 3:
  164.                     chatButtons[0].drawSprite(203, 142);
  165.                     break;
  166.                 case 4:
  167.                     chatButtons[0].drawSprite(269, 142);
  168.                     break;
  169.                 case 5:
  170.                     chatButtons[0].drawSprite(335, 142);
  171.                     break;
  172.                 case 6:
  173.                     chatButtons[3].drawSprite(404, 142);
  174.                     break;
  175.             }
  176.         }
  177.         smallText.method389(true, 425, 0xffffff, "Report Abuse", 157);
  178.         smallText.method389(true, 26, 0xffffff, "All", 157);
  179.         smallText.method389(true, 86, 0xffffff, "Game", 157);
  180.         smallText.method389(true, 150, 0xffffff, "Public", 152);
  181.         smallText.method389(true, 212, 0xffffff, "Private", 152);
  182.         smallText.method389(true, 286, 0xffffff, "Clan", 152);
  183.         smallText.method389(true, 349, 0xffffff, "Trade", 152);
  184.         smallText.method382(textColor[publicChatMode], 164, text[publicChatMode], 163, true);
  185.         smallText.method382(textColor[privateChatMode], 230, text[privateChatMode], 163, true);
  186.         smallText.method382(textColor[clanChatMode], 296, text[clanChatMode], 163, true);
  187.         smallText.method382(textColor[tradeMode], 362, text[tradeMode], 163, true);
  188.     }
  189.  
  190.     private void drawChatArea() {
  191.         aRSImageProducer_1166.initDrawingArea();
  192.         Texture.anIntArray1472 = anIntArray1180;
  193.         chatArea.drawSprite(0, 0);
  194.         drawChannelButtons();
  195.         TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  196.         if(messagePromptRaised) {
  197.             chatTextDrawingArea.drawText(0, aString1121, 60, 259);
  198.             chatTextDrawingArea.drawText(128, promptInput + "*", 80, 259);
  199.         } else if(inputDialogState == 1) {
  200.             chatTextDrawingArea.drawText(0, "Enter amount:", 60, 259);
  201.             chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  202.         } else if(inputDialogState == 2) {
  203.             chatTextDrawingArea.drawText(0, "Enter name:", 60, 259);
  204.             chatTextDrawingArea.drawText(128, amountOrNameInput + "*", 80, 259);
  205.         } else if(aString844 != null) {
  206.             chatTextDrawingArea.drawText(0, aString844, 60, 259);
  207.             chatTextDrawingArea.drawText(128, "Click to continue", 80, 259);
  208.         } else if(backDialogID != -1) {
  209.             drawInterface(0, 20, RSInterface.interfaceCache[backDialogID], 20);
  210.         } else if(dialogID != -1) {
  211.             drawInterface(0, 20, RSInterface.interfaceCache[dialogID], 20);
  212.         } else {
  213.             int j77 = -3;
  214.             int j = 0;
  215.             DrawingArea.setDrawingArea(122, 8, 497, 7);
  216.             for(int k = 0; k < 500; k++)
  217.             if(chatMessages[k] != null) {
  218.                 int chatType = chatTypes[k];
  219.                 int yPos = (70 - j77 * 14) + anInt1089 + 5;
  220.                 String s1 = chatNames[k];
  221.                 byte byte0 = 0;
  222.                 if(s1 != null && s1.startsWith("@cr1@")) {
  223.                     s1 = s1.substring(5);
  224.                     byte0 = 1;
  225.                 } else if(s1 != null && s1.startsWith("@cr2@")) {
  226.                     s1 = s1.substring(5);
  227.                     byte0 = 2;
  228.                 } else if(s1 != null && s1.startsWith("@cr3@")) {
  229.                     s1 = s1.substring(5);
  230.                     byte0 = 3;
  231.                 }
  232.                 if(chatType == 0) {
  233.                     if (chatTypeView == 5 || chatTypeView == 0) {
  234.                     if(yPos > 0 && yPos < 210)
  235.                         textDrawingArea.method389(false, 11, 0, chatMessages[k], yPos);//chat color enabled
  236.                     j++;
  237.                     j77++;
  238.                     }
  239.                 }
  240.                 if((chatType == 1 || chatType == 2) && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
  241.                     if (chatTypeView == 1 || chatTypeView == 0) {
  242.                         if(yPos > 0 && yPos < 210) {
  243.                             int xPos = 11;
  244.                             if(byte0 == 1) {
  245.                                 modIcons[0].drawBackground(xPos + 1, yPos - 12);
  246.                                 xPos += 14;
  247.                             } else if(byte0 == 2) {
  248.                                 modIcons[1].drawBackground(xPos + 1, yPos - 12);
  249.                                 xPos += 14;
  250.                             } else if(byte0 == 3) {
  251.                                 modIcons[2].drawBackground(xPos + 1, yPos - 12);
  252.                                 xPos += 14;
  253.                             }
  254.                             textDrawingArea.method385(0, s1 + ":", yPos, xPos);
  255.                             xPos += textDrawingArea.getTextWidth(s1) + 8;
  256.                             textDrawingArea.method389(false, xPos, 255, chatMessages[k], yPos);
  257.                         }
  258.                         j++;
  259.                         j77++;
  260.                     }
  261.                 }
  262.                 if((chatType == 3 || chatType == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (chatType == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s1))) {
  263.                     if (chatTypeView == 2 || chatTypeView == 0) {
  264.                         if(yPos > 0 && yPos < 210) {
  265.                             int k1 = 11;
  266.                             textDrawingArea.method385(0, "From", yPos, k1);
  267.                             k1 += textDrawingArea.getTextWidth("From ");
  268.                             if(byte0 == 1) {
  269.                                 modIcons[0].drawBackground(k1, yPos - 12);
  270.                                 k1 += 12;
  271.                             } else if(byte0 == 2) {
  272.                                 modIcons[1].drawBackground(k1, yPos - 12);
  273.                                 k1 += 12;
  274.                             } else if(byte0 == 3) {
  275.                                 modIcons[2].drawBackground(k1, yPos - 12);
  276.                                 k1 += 12;
  277.                             }
  278.                             textDrawingArea.method385(0, s1 + ":", yPos, k1);
  279.                             k1 += textDrawingArea.getTextWidth(s1) + 8;
  280.                             textDrawingArea.method385(0x800000, chatMessages[k], yPos, k1);
  281.                         }
  282.                         j++;
  283.                         j77++;
  284.                     }
  285.                 }
  286.                 if(chatType == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  287.                     if (chatTypeView == 3 || chatTypeView == 0) {
  288.                         if(yPos > 0 && yPos < 210)
  289.                             textDrawingArea.method385(0x800080, s1 + " " + chatMessages[k], yPos, 11);
  290.                         j++;
  291.                         j77++;
  292.                     }
  293.                 }
  294.                 if(chatType == 5 && splitPrivateChat == 0 && privateChatMode < 2) {
  295.                     if (chatTypeView == 2 || chatTypeView == 0) {
  296.                         if(yPos > 0 && yPos < 210)
  297.                             textDrawingArea.method385(0x800000, chatMessages[k], yPos, 11);
  298.                         j++;
  299.                         j77++;
  300.                     }
  301.                 }
  302.                 if(chatType == 6 && (splitPrivateChat == 0 || chatTypeView == 2) && privateChatMode < 2) {
  303.                     if (chatTypeView == 2 || chatTypeView == 0) {
  304.                         if(yPos > 0 && yPos < 210) {
  305.                             textDrawingArea.method385(0, "To " + s1 + ":", yPos, 11);
  306.                             textDrawingArea.method385(0x800000, chatMessages[k], yPos, 15 + textDrawingArea.getTextWidth("To :" + s1));
  307.                         }
  308.                     j++;
  309.                     j77++;
  310.                     }
  311.                 }
  312.                 if(chatType == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s1))) {
  313.                     if (chatTypeView == 3 || chatTypeView == 0) {
  314.                         if(yPos > 0 && yPos < 210)
  315.                             textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  316.                         j++;
  317.                         j77++;
  318.                     }
  319.                     if(chatType == 11 && (clanChatMode == 0)) {
  320.                         if (chatTypeView == 11) {
  321.                         if(yPos > 0 && yPos < 210)
  322.                             textDrawingArea.method385(0x7e3200, s1 + " " + chatMessages[k], yPos, 11);
  323.                         j++;
  324.                         j77++;
  325.                     }
  326.                     if(chatType == 12) {
  327.                         if(yPos > 0 && yPos < 110)
  328.                             textDrawingArea.method385(0x7e3200, chatMessages[k] + " @blu@" + s1, yPos, 11);
  329.                             j++;
  330.                         }
  331.                     }
  332.                 }
  333.                 if(chatType == 16) {
  334.                     int j2 = 40;
  335.                     int clanNameWidth = textDrawingArea.getTextWidth(clanname);
  336.                     if(chatTypeView == 11 || chatTypeView == 0) {
  337.                         if(yPos > 3 && yPos < 130)
  338.                             switch(chatRights[k]) {
  339.                                 case 1:
  340.                                     j2 += clanNameWidth;
  341.                                     modIcons[0].drawBackground(j2 - 18, yPos - 12);
  342.                                     j2 += 14;
  343.                                     break;
  344.                                    
  345.                                 case 2:
  346.                                     j2 += clanNameWidth;
  347.                                     modIcons[1].drawBackground(j2 - 18, yPos - 12);
  348.                                     j2 += 14;
  349.                                     break;
  350.                                    
  351.                                 case 3:
  352.                                     j2 += clanNameWidth;
  353.                                     modIcons[1].drawBackground(j2 - 18, yPos - 12);
  354.                                     j2 += 14;
  355.                                     break;
  356.                
  357.                                 default:
  358.                                     j2 += clanNameWidth;
  359.                                     break;
  360.                             }
  361.                             textDrawingArea.method385(0, "[", yPos, 8);
  362.                             textDrawingArea.method385(255, ""+clanname+"", yPos, 14);
  363.                             textDrawingArea.method385(0, "]", yPos, clanNameWidth + 14);
  364.                            
  365.                             textDrawingArea.method385(0, chatNames[k]+":", yPos, j2 - 17); //j2
  366.                             j2 += textDrawingArea.getTextWidth(chatNames[k]) + 7;
  367.                             textDrawingArea.method385(0x800000, chatMessages[k], yPos, j2 - 16);//j2
  368.                             j++;
  369.                             j77++;
  370.                         }
  371.                     }
  372.             }
  373.             DrawingArea.defaultDrawingAreaSize();
  374.             anInt1211 = j * 14 + 7 + 5;
  375.             if(anInt1211 < 111)
  376.                 anInt1211 = 111;
  377.             drawScrollbar(114, anInt1211 - anInt1089 - 113, 7, 496, anInt1211);
  378.             String s;
  379.             if(myPlayer != null && myPlayer.name != null)
  380.                 s = myPlayer.name;
  381.             else
  382.                 s = TextClass.fixName(myUsername);
  383.             textDrawingArea.method385(0, s + ":", 133, 11);
  384.             textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidth(s + ": "), inputString + "*", 133, false);
  385.             DrawingArea.method339(121, 0x807660, 506, 7);
  386.         }
  387.         if(menuOpen && menuScreenArea == 2) {
  388.             drawMenu();
  389.         }
  390.         aRSImageProducer_1166.drawGraphics(338, super.graphics, 0);
  391.         aRSImageProducer_1165.initDrawingArea();
  392.         Texture.anIntArray1472 = anIntArray1182;
  393.     }
  394.  
  395.     public void init() {
  396.         nodeID = 10;
  397.         portOff = 0;
  398.         setHighMem();
  399.         isMembers = true;
  400.         initClientFrame(503, 765);
  401.     }
  402.  
  403.     public void startRunnable(Runnable runnable, int i) {
  404.         if(i > 10)
  405.             i = 10;
  406.         if(signlink.mainapp != null) {
  407.             signlink.startthread(runnable, i);
  408.         } else {
  409.             super.startRunnable(runnable, i);
  410.         }
  411.     }
  412.  
  413.     public Socket openSocket(int port) throws IOException {
  414.             return new Socket(InetAddress.getByName(server), port);
  415.     }
  416.  
  417.     private void processMenuClick() {
  418.         if(activeInterfaceType != 0)
  419.             return;
  420.         int j = super.clickMode3;
  421.         if(spellSelected == 1 && super.saveClickX >= 516 && super.saveClickY >= 160 && super.saveClickX <= 765 && super.saveClickY <= 205)
  422.             j = 0;
  423.         if(menuOpen) {
  424.             if(j != 1) {
  425.                 int k = super.mouseX;
  426.                 int j1 = super.mouseY;
  427.                 if(menuScreenArea == 0) {
  428.                     k -= 4;
  429.                     j1 -= 4;
  430.                 }
  431.                 if(menuScreenArea == 1) {
  432.                     k -= 519;
  433.                     j1 -= 168;
  434.                 }
  435.                 if(menuScreenArea == 2) {
  436.                     k -= 17;
  437.                     j1 -= 338;
  438.                 }
  439.                 if(menuScreenArea == 3) {
  440.                     k -= 519;
  441.                     j1 -= 0;
  442.                 }
  443.                 if(k < menuOffsetX - 10 || k > menuOffsetX + menuWidth + 10 || j1 < menuOffsetY - 10 || j1 > menuOffsetY + menuHeight + 10) {
  444.                     menuOpen = false;
  445.                     if(menuScreenArea == 1)
  446.                         needDrawTabArea = true;
  447.                     if(menuScreenArea == 2)
  448.                         inputTaken = true;
  449.                 }
  450.             }
  451.             if(j == 1) {
  452.                 int l = menuOffsetX;
  453.                 int k1 = menuOffsetY;
  454.                 int i2 = menuWidth;
  455.                 int k2 = super.saveClickX;
  456.                 int l2 = super.saveClickY;
  457.                 if(menuScreenArea == 0) {
  458.                     k2 -= 4;
  459.                     l2 -= 4;
  460.                 }
  461.                 if(menuScreenArea == 1) {
  462.                     k2 -= 519;
  463.                     l2 -= 168;
  464.                 }
  465.                 if(menuScreenArea == 2) {
  466.                     k2 -= 17;
  467.                     l2 -= 338;
  468.                 }
  469.                 if(menuScreenArea == 3) {
  470.                     k2 -= 519;
  471.                     l2 -= 0;
  472.                 }
  473.                 int i3 = -1;
  474.                 for(int j3 = 0; j3 < menuActionRow; j3++) {
  475.                     int k3 = k1 + 31 + (menuActionRow - 1 - j3) * 15;
  476.                     if(k2 > l && k2 < l + i2 && l2 > k3 - 13 && l2 < k3 + 3)
  477.                         i3 = j3;
  478.                 }
  479.                 System.out.println(i3);
  480.                 if(i3 != -1)
  481.                     doAction(i3);
  482.                 menuOpen = false;
  483.                 if(menuScreenArea == 1)
  484.                     needDrawTabArea = true;
  485.                 if(menuScreenArea == 2) {
  486.                     inputTaken = true;
  487.                 }
  488.             }
  489.         } else {
  490.             if(j == 1 && menuActionRow > 0) {
  491.                 int i1 = menuActionID[menuActionRow - 1];
  492.                 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) {
  493.                     int l1 = menuActionCmd2[menuActionRow - 1];
  494.                     int j2 = menuActionCmd3[menuActionRow - 1];
  495.                     RSInterface class9 = RSInterface.interfaceCache[j2];
  496.                     if(class9.aBoolean259 || class9.aBoolean235) {
  497.                         aBoolean1242 = false;
  498.                         anInt989 = 0;
  499.                         anInt1084 = j2;
  500.                         anInt1085 = l1;
  501.                         activeInterfaceType = 2;
  502.                         anInt1087 = super.saveClickX;
  503.                         anInt1088 = super.saveClickY;
  504.                         if(RSInterface.interfaceCache[j2].parentID == openInterfaceID)
  505.                             activeInterfaceType = 1;
  506.                         if(RSInterface.interfaceCache[j2].parentID == backDialogID)
  507.                             activeInterfaceType = 3;
  508.                         return;
  509.                     }
  510.                 }
  511.             }
  512.             if(j == 1 && (anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  513.                 j = 2;
  514.             if(j == 1 && menuActionRow > 0)
  515.                 doAction(menuActionRow - 1);
  516.             if(j == 2 && menuActionRow > 0)
  517.                 determineMenuSize();
  518.         }
  519.     }
  520.  
  521.  
  522.     public static int totalRead = 0;
  523.  
  524.     public static String getFileNameWithoutExtension(String fileName) {
  525.         File tmpFile = new File(fileName);
  526.         tmpFile.getName();
  527.         int whereDot = tmpFile.getName().lastIndexOf('.');
  528.         if (0 < whereDot && whereDot <= tmpFile.getName().length() - 2 ) {
  529.             return tmpFile.getName().substring(0, whereDot);
  530.         }
  531.         return "";
  532.     }
  533.  
  534.     public void preloadModels() {
  535.         File file = new File("./Raw/");
  536.         File[] fileArray = file.listFiles();
  537.         for(int y = 0; y < fileArray.length; y++) {
  538.             String s = fileArray[y].getName();
  539.             byte[] buffer = ReadFile("./Raw/"+s);
  540.             Model.method460(buffer,Integer.parseInt(getFileNameWithoutExtension(s)));
  541.         }
  542.     }
  543.  
  544.  
  545.  
  546.     private void saveMidi(boolean flag, byte abyte0[])
  547.     {
  548.         signlink.midifade = flag ? 1 : 0;
  549.         signlink.midisave(abyte0, abyte0.length);
  550.     }
  551.  
  552.     private void method22()
  553.     {
  554.         try
  555.         {
  556.             anInt985 = -1;
  557.             aClass19_1056.removeAll();
  558.             aClass19_1013.removeAll();
  559.             Texture.method366();
  560.             unlinkMRUNodes();
  561.             worldController.initToNull();
  562.             System.gc();
  563.             for(int i = 0; i < 4; i++)
  564.                 aClass11Array1230[i].method210();
  565.  
  566.             for(int l = 0; l < 4; l++)
  567.             {
  568.                 for(int k1 = 0; k1 < 104; k1++)
  569.                 {
  570.                     for(int j2 = 0; j2 < 104; j2++)
  571.                         byteGroundArray[l][k1][j2] = 0;
  572.  
  573.                 }
  574.  
  575.             }
  576.  
  577.             ObjectManager objectManager = new ObjectManager(byteGroundArray, intGroundArray);
  578.             int k2 = aByteArrayArray1183.length;
  579.             stream.createFrame(0);
  580.             if(!aBoolean1159)
  581.             {
  582.                 for(int i3 = 0; i3 < k2; i3++)
  583.                 {
  584.                     int i4 = (anIntArray1234[i3] >> 8) * 64 - baseX;
  585.                     int k5 = (anIntArray1234[i3] & 0xff) * 64 - baseY;
  586.                     byte abyte0[] = aByteArrayArray1183[i3];
  587.                     if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat"))
  588.                         abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[i3]+".dat");
  589.                     if(abyte0 != null)
  590.                         objectManager.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aClass11Array1230);
  591.                 }
  592.  
  593.                 for(int j4 = 0; j4 < k2; j4++)
  594.                 {
  595.                     int l5 = (anIntArray1234[j4] >> 8) * 64 - baseX;
  596.                     int k7 = (anIntArray1234[j4] & 0xff) * 64 - baseY;
  597.                     byte abyte2[] = aByteArrayArray1183[j4];
  598.                     if(abyte2 == null && anInt1070 < 800)
  599.                         objectManager.method174(k7, 64, 64, l5);
  600.                 }
  601.  
  602.                 anInt1097++;
  603.                 if(anInt1097 > 160)
  604.                 {
  605.                     anInt1097 = 0;
  606.                     stream.createFrame(238);
  607.                     stream.writeWordBigEndian(96);
  608.                 }
  609.                 stream.createFrame(0);
  610.                 for(int i6 = 0; i6 < k2; i6++)
  611.                 {
  612.                     byte abyte1[] = aByteArrayArray1247[i6];
  613.                     if(abyte1 != null)
  614.                     {
  615.                         int l8 = (anIntArray1234[i6] >> 8) * 64 - baseX;
  616.                         int k9 = (anIntArray1234[i6] & 0xff) * 64 - baseY;
  617.                         objectManager.method190(l8, aClass11Array1230, k9, worldController, abyte1);
  618.                     }
  619.                 }
  620.  
  621.             }
  622.             if(aBoolean1159)
  623.             {
  624.                 for(int j3 = 0; j3 < 4; j3++)
  625.                 {
  626.                     for(int k4 = 0; k4 < 13; k4++)
  627.                     {
  628.                         for(int j6 = 0; j6 < 13; j6++)
  629.                         {
  630.                             int l7 = anIntArrayArrayArray1129[j3][k4][j6];
  631.                             if(l7 != -1)
  632.                             {
  633.                                 int i9 = l7 >> 24 & 3;
  634.                                 int l9 = l7 >> 1 & 3;
  635.                                 int j10 = l7 >> 14 & 0x3ff;
  636.                                 int l10 = l7 >> 3 & 0x7ff;
  637.                                 int j11 = (j10 / 8 << 8) + l10 / 8;
  638.                                 for(int l11 = 0; l11 < anIntArray1234.length; l11++)
  639.                                 {
  640.                                     if(anIntArray1234[l11] != j11 || aByteArrayArray1183[l11] == null)
  641.                                         continue;
  642.                                     objectManager.method179(i9, l9, aClass11Array1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
  643.                                     break;
  644.                                 }
  645.  
  646.                             }
  647.                         }
  648.  
  649.                     }
  650.  
  651.                 }
  652.  
  653.                 for(int l4 = 0; l4 < 13; l4++)
  654.                 {
  655.                     for(int k6 = 0; k6 < 13; k6++)
  656.                     {
  657.                         int i8 = anIntArrayArrayArray1129[0][l4][k6];
  658.                         if(i8 == -1)
  659.                             objectManager.method174(k6 * 8, 8, 8, l4 * 8);
  660.                     }
  661.  
  662.                 }
  663.  
  664.                 stream.createFrame(0);
  665.                 for(int l6 = 0; l6 < 4; l6++)
  666.                 {
  667.                     for(int j8 = 0; j8 < 13; j8++)
  668.                     {
  669.                         for(int j9 = 0; j9 < 13; j9++)
  670.                         {
  671.                             int i10 = anIntArrayArrayArray1129[l6][j8][j9];
  672.                             if(i10 != -1)
  673.                             {
  674.                                 int k10 = i10 >> 24 & 3;
  675.                                 int i11 = i10 >> 1 & 3;
  676.                                 int k11 = i10 >> 14 & 0x3ff;
  677.                                 int i12 = i10 >> 3 & 0x7ff;
  678.                                 int j12 = (k11 / 8 << 8) + i12 / 8;
  679.                                 for(int k12 = 0; k12 < anIntArray1234.length; k12++)
  680.                                 {
  681.                                     if(anIntArray1234[k12] != j12 || aByteArrayArray1247[k12] == null)
  682.                                         continue;
  683.                                     //objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  684.                                     byte abyte0[] = aByteArrayArray1247[k12];
  685.                                     if (FileOperations.FileExists(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat"))
  686.                                         abyte0 = FileOperations.ReadFile(signlink.findcachedir()+"maps/"+anIntArray1235[k12]+".dat");
  687.                                     objectManager.method183(aClass11Array1230, worldController, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
  688.                                     break;
  689.                                 }
  690.  
  691.                             }
  692.                         }
  693.  
  694.                     }
  695.  
  696.                 }
  697.  
  698.             }
  699.             stream.createFrame(0);
  700.             objectManager.method171(aClass11Array1230, worldController);
  701.             aRSImageProducer_1165.initDrawingArea();
  702.             stream.createFrame(0);
  703.             int k3 = ObjectManager.anInt145;
  704.             if(k3 > plane)
  705.                 k3 = plane;
  706.             if(k3 < plane - 1)
  707.                 k3 = plane - 1;
  708.             if(lowMem)
  709.                 worldController.method275(ObjectManager.anInt145);
  710.             else
  711.                 worldController.method275(0);
  712.             for(int i5 = 0; i5 < 104; i5++)
  713.             {
  714.                 for(int i7 = 0; i7 < 104; i7++)
  715.                     spawnGroundItem(i5, i7);
  716.  
  717.             }
  718.  
  719.             anInt1051++;
  720.             if(anInt1051 > 98)
  721.             {
  722.                 anInt1051 = 0;
  723.                 stream.createFrame(150);
  724.             }
  725.             method63();
  726.         }
  727.         catch(Exception exception) { }
  728.         ObjectDef.mruNodes1.unlinkAll();
  729.         if(super.gameFrame != null)
  730.         {
  731.             stream.createFrame(210);
  732.             stream.writeDWord(0x3f008edd);
  733.         }
  734.         if(lowMem && signlink.cache_dat != null)
  735.         {
  736.             int j = onDemandFetcher.getVersionCount(0);
  737.             for(int i1 = 0; i1 < j; i1++)
  738.             {
  739.                 int l1 = onDemandFetcher.getModelIndex(i1);
  740.                 if((l1 & 0x79) == 0)
  741.                     Model.method461(i1);
  742.             }
  743.  
  744.         }
  745.         System.gc();
  746.         Texture.method367();
  747.         onDemandFetcher.method566();
  748.         int k = (anInt1069 - 6) / 8 - 1;
  749.         int j1 = (anInt1069 + 6) / 8 + 1;
  750.         int i2 = (anInt1070 - 6) / 8 - 1;
  751.         int l2 = (anInt1070 + 6) / 8 + 1;
  752.         if(aBoolean1141)
  753.         {
  754.             k = 49;
  755.             j1 = 50;
  756.             i2 = 49;
  757.             l2 = 50;
  758.         }
  759.         for(int l3 = k; l3 <= j1; l3++)
  760.         {
  761.             for(int j5 = i2; j5 <= l2; j5++)
  762.                 if(l3 == k || l3 == j1 || j5 == i2 || j5 == l2)
  763.                 {
  764.                     int j7 = onDemandFetcher.method562(0, j5, l3);
  765.                     if(j7 != -1)
  766.                         onDemandFetcher.method560(j7, 3);
  767.                     int k8 = onDemandFetcher.method562(1, j5, l3);
  768.                     if(k8 != -1)
  769.                         onDemandFetcher.method560(k8, 3);
  770.                 }
  771.  
  772.         }
  773.  
  774.     }
  775.  
  776.     private void unlinkMRUNodes()
  777.     {
  778.         ObjectDef.mruNodes1.unlinkAll();
  779.         ObjectDef.mruNodes2.unlinkAll();
  780.         EntityDef.mruNodes.unlinkAll();
  781.         ItemDef.mruNodes2.unlinkAll();
  782.         ItemDef.mruNodes1.unlinkAll();
  783.         Player.mruNodes.unlinkAll();
  784.         SpotAnim.aMRUNodes_415.unlinkAll();
  785.     }
  786.  
  787.     private void method24(int i)
  788.     {
  789.         int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  790.         int j = ai.length;
  791.         for(int k = 0; k < j; k++)
  792.             ai[k] = 0;
  793.  
  794.         for(int l = 1; l < 103; l++)
  795.         {
  796.             int i1 = 24628 + (103 - l) * 512 * 4;
  797.             for(int k1 = 1; k1 < 103; k1++)
  798.             {
  799.                 if((byteGroundArray[i][k1][l] & 0x18) == 0)
  800.                     worldController.method309(ai, i1, i, k1, l);
  801.                 if(i < 3 && (byteGroundArray[i + 1][k1][l] & 8) != 0)
  802.                     worldController.method309(ai, i1, i + 1, k1, l);
  803.                 i1 += 4;
  804.             }
  805.  
  806.         }
  807.  
  808.         int j1 = ((238 + (int)(Math.random() * 20D)) - 10 << 16) + ((238 + (int)(Math.random() * 20D)) - 10 << 8) + ((238 + (int)(Math.random() * 20D)) - 10);
  809.         int l1 = (238 + (int)(Math.random() * 20D)) - 10 << 16;
  810.         aClass30_Sub2_Sub1_Sub1_1263.method343();
  811.         for(int i2 = 1; i2 < 103; i2++)
  812.         {
  813.             for(int j2 = 1; j2 < 103; j2++)
  814.             {
  815.                 if((byteGroundArray[i][j2][i2] & 0x18) == 0)
  816.                     method50(i2, j1, j2, l1, i);
  817.                 if(i < 3 && (byteGroundArray[i + 1][j2][i2] & 8) != 0)
  818.                     method50(i2, j1, j2, l1, i + 1);
  819.             }
  820.  
  821.         }
  822.  
  823.         aRSImageProducer_1165.initDrawingArea();
  824.         anInt1071 = 0;
  825.         for(int k2 = 0; k2 < 104; k2++)
  826.         {
  827.             for(int l2 = 0; l2 < 104; l2++)
  828.             {
  829.                 int i3 = worldController.method303(plane, k2, l2);
  830.                 if(i3 != 0)
  831.                 {
  832.                     i3 = i3 >> 14 & 0x7fff;
  833.                     int j3 = ObjectDef.forID(i3).anInt746;
  834.                     if(j3 >= 0)
  835.                     {
  836.                         int k3 = k2;
  837.                         int l3 = l2;
  838.                         if(j3 != 22 && j3 != 29 && j3 != 34 && j3 != 36 && j3 != 46 && j3 != 47 && j3 != 48)
  839.                         {
  840.                             byte byte0 = 104;
  841.                             byte byte1 = 104;
  842.                             int ai1[][] = aClass11Array1230[plane].anIntArrayArray294;
  843.                             for(int i4 = 0; i4 < 10; i4++)
  844.                             {
  845.                                 int j4 = (int)(Math.random() * 4D);
  846.                                 if(j4 == 0 && k3 > 0 && k3 > k2 - 3 && (ai1[k3 - 1][l3] & 0x1280108) == 0)
  847.                                     k3--;
  848.                                 if(j4 == 1 && k3 < byte0 - 1 && k3 < k2 + 3 && (ai1[k3 + 1][l3] & 0x1280180) == 0)
  849.                                     k3++;
  850.                                 if(j4 == 2 && l3 > 0 && l3 > l2 - 3 && (ai1[k3][l3 - 1] & 0x1280102) == 0)
  851.                                     l3--;
  852.                                 if(j4 == 3 && l3 < byte1 - 1 && l3 < l2 + 3 && (ai1[k3][l3 + 1] & 0x1280120) == 0)
  853.                                     l3++;
  854.                             }
  855.  
  856.                         }
  857.                         aClass30_Sub2_Sub1_Sub1Array1140[anInt1071] = mapFunctions[j3];
  858.                         anIntArray1072[anInt1071] = k3;
  859.                         anIntArray1073[anInt1071] = l3;
  860.                         anInt1071++;
  861.                     }
  862.                 }
  863.             }
  864.  
  865.         }
  866.  
  867.     }
  868.  
  869.     private void spawnGroundItem(int i, int j)
  870.     {
  871.         NodeList class19 = groundArray[plane][i][j];
  872.         if(class19 == null)
  873.         {
  874.             worldController.method295(plane, i, j);
  875.             return;
  876.         }
  877.         int k = 0xfa0a1f01;
  878.         Object obj = null;
  879.         for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  880.         {
  881.             ItemDef itemDef = ItemDef.forID(item.ID);
  882.             int l = itemDef.value;
  883.             if(itemDef.stackable)
  884.                 l *= item.anInt1559 + 1;
  885. //  notifyItemSpawn(item, i + baseX, j + baseY);
  886.    
  887.             if(l > k)
  888.             {
  889.                 k = l;
  890.                 obj = item;
  891.             }
  892.         }
  893.  
  894.         class19.insertTail(((Node) (obj)));
  895.         Object obj1 = null;
  896.         Object obj2 = null;
  897.         for(Item class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetFirst(); class30_sub2_sub4_sub2_1 != null; class30_sub2_sub4_sub2_1 = (Item)class19.reverseGetNext())
  898.         {
  899.             if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && obj1 == null)
  900.                 obj1 = class30_sub2_sub4_sub2_1;
  901.             if(class30_sub2_sub4_sub2_1.ID != ((Item) (obj)).ID && class30_sub2_sub4_sub2_1.ID != ((Item) (obj1)).ID && obj2 == null)
  902.                 obj2 = class30_sub2_sub4_sub2_1;
  903.         }
  904.  
  905.         int i1 = i + (j << 7) + 0x60000000;
  906.         worldController.method281(i, i1, ((Animable) (obj1)), method42(plane, j * 128 + 64, i * 128 + 64), ((Animable) (obj2)), ((Animable) (obj)), plane, j);
  907.     }
  908.  
  909.     private void method26(boolean flag)
  910.     {
  911.         for(int j = 0; j < npcCount; j++)
  912.         {
  913.             NPC npc = npcArray[npcIndices[j]];
  914.             int k = 0x20000000 + (npcIndices[j] << 14);
  915.             if(npc == null || !npc.isVisible() || npc.desc.aBoolean93 != flag)
  916.                 continue;
  917.             int l = npc.x >> 7;
  918.             int i1 = npc.y >> 7;
  919.             if(l < 0 || l >= 104 || i1 < 0 || i1 >= 104)
  920.                 continue;
  921.             if(npc.anInt1540 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  922.             {
  923.                 if(anIntArrayArray929[l][i1] == anInt1265)
  924.                     continue;
  925.                 anIntArrayArray929[l][i1] = anInt1265;
  926.             }
  927.             if(!npc.desc.aBoolean84)
  928.                 k += 0x80000000;
  929.             worldController.method285(plane, npc.anInt1552, method42(plane, npc.y, npc.x), k, npc.y, (npc.anInt1540 - 1) * 64 + 60, npc.x, npc, npc.aBoolean1541);
  930.         }
  931.     }
  932.  
  933.     private boolean replayWave()
  934.     {
  935.             return signlink.wavereplay();
  936.     }
  937.  
  938.     private void loadError()
  939.     {
  940.         String s = "ondemand";//was a constant parameter
  941.         System.out.println(s);
  942.         try
  943.         {
  944.             getAppletContext().showDocument(new URL(getCodeBase(), "loaderror_" + s + ".html"));
  945.         }
  946.         catch(Exception exception)
  947.         {
  948.             exception.printStackTrace();
  949.         }
  950.         do
  951.             try
  952.             {
  953.                 Thread.sleep(1000L);
  954.             }
  955.             catch(Exception _ex) { }
  956.         while(true);
  957.     }
  958.    
  959.     public void drawHoverBox(int xPos, int yPos, String text) {
  960.         String[] results = text.split("\n");
  961.         int height = (results.length * 16) + 6;
  962.         int width;
  963.         width = chatTextDrawingArea.getTextWidth(results[0]) + 6;
  964.         for(int i = 1; i < results.length; i++)
  965.             if(width <= chatTextDrawingArea.getTextWidth(results[i]) + 6)
  966.                 width = chatTextDrawingArea.getTextWidth(results[i]) + 6;
  967.         DrawingArea.drawPixels(height, yPos, xPos, 0xFFFFA0, width);
  968.         DrawingArea.fillPixels(xPos, width, height, 0, yPos);
  969.         yPos += 14;
  970.         for(int i = 0; i < results.length; i++) {
  971.             chatTextDrawingArea.method389(false, xPos + 3, 0, results[i], yPos);
  972.             yPos += 16;
  973.         }
  974.     }
  975.    
  976.     private void buildInterfaceMenu(int i, RSInterface class9, int k, int l, int i1, int j1)
  977.     {
  978.         if(class9.type != 0 || class9.children == null || class9.isMouseoverTriggered)
  979.             return;
  980.         if(k < i || i1 < l || k > i + class9.width || i1 > l + class9.height)
  981.             return;
  982.         int k1 = class9.children.length;
  983.         for(int l1 = 0; l1 < k1; l1++)
  984.         {
  985.             int i2 = class9.childX[l1] + i;
  986.             int j2 = (class9.childY[l1] + l) - j1;
  987.             RSInterface class9_1 = RSInterface.interfaceCache[class9.children[l1]];
  988.             i2 += class9_1.anInt263;
  989.             j2 += class9_1.anInt265;
  990.             if((class9_1.mOverInterToTrigger >= 0 || class9_1.anInt216 != 0) && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  991.                 if(class9_1.mOverInterToTrigger >= 0)
  992.                     anInt886 = class9_1.mOverInterToTrigger;
  993.                 else
  994.                     anInt886 = class9_1.id;
  995.             if (class9_1.type == 8 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height) {
  996.                 anInt1315 = class9_1.id;
  997.             }
  998.             if(class9_1.type == 0)
  999.             {
  1000.                 buildInterfaceMenu(i2, class9_1, k, j2, i1, class9_1.scrollPosition);
  1001.                 if(class9_1.scrollMax > class9_1.height)
  1002.                     method65(i2 + class9_1.width, class9_1.height, k, i1, class9_1, j2, true, class9_1.scrollMax);
  1003.             } else
  1004.             {
  1005.                 if(class9_1.atActionType == 1 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1006.                 {
  1007.                     boolean flag = false;
  1008.                     if(class9_1.contentType != 0)
  1009.                         flag = buildFriendsListMenu(class9_1);
  1010.                     if(!flag)
  1011.                     {
  1012.                         //System.out.println("1"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1013.                         menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1014.                         menuActionID[menuActionRow] = 315;
  1015.                         menuActionCmd3[menuActionRow] = class9_1.id;
  1016.                         menuActionRow++;
  1017.                     }
  1018.                 }
  1019.                 if(class9_1.atActionType == 2 && spellSelected == 0 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1020.                 {
  1021.                     String s = class9_1.selectedActionName;
  1022.                     if(s.indexOf(" ") != -1)
  1023.                         s = s.substring(0, s.indexOf(" "));
  1024.                     menuActionName[menuActionRow] = s + " @gre@" + class9_1.spellName;
  1025.                     menuActionID[menuActionRow] = 626;
  1026.                     menuActionCmd3[menuActionRow] = class9_1.id;
  1027.                     menuActionRow++;
  1028.                 }
  1029.                 if(class9_1.atActionType == 3 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1030.                 {
  1031.                     menuActionName[menuActionRow] = "Close";
  1032.                     menuActionID[menuActionRow] = 200;
  1033.                     menuActionCmd3[menuActionRow] = class9_1.id;
  1034.                     menuActionRow++;
  1035.                 }
  1036.                 if(class9_1.atActionType == 4 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1037.                 {
  1038.                     //System.out.println("2"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1039.                     menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1040.                     menuActionID[menuActionRow] = 169;
  1041.                     menuActionCmd3[menuActionRow] = class9_1.id;
  1042.                     menuActionRow++;
  1043.                     if (class9_1.hoverText != null) {
  1044.                         //drawHoverBox(k, l, class9_1.hoverText);
  1045.                         //System.out.println("DRAWING INTERFACE: " + class9_1.hoverText);
  1046.                     }
  1047.                 }
  1048.                 if(class9_1.atActionType == 5 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1049.                 {
  1050.                     //System.out.println("3"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1051.                     menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1052.                     menuActionID[menuActionRow] = 646;
  1053.                     menuActionCmd3[menuActionRow] = class9_1.id;
  1054.                     menuActionRow++;
  1055.                 }
  1056.                 if(class9_1.atActionType == 6 && !aBoolean1149 && k >= i2 && i1 >= j2 && k < i2 + class9_1.width && i1 < j2 + class9_1.height)
  1057.                 {
  1058.                     //System.out.println("4"+class9_1.tooltip + ", " + class9_1.interfaceID);
  1059.                     menuActionName[menuActionRow] = class9_1.tooltip + ", " + class9_1.id;
  1060.                     menuActionID[menuActionRow] = 679;
  1061.                     menuActionCmd3[menuActionRow] = class9_1.id;
  1062.                     menuActionRow++;
  1063.                 }
  1064.                 if(class9_1.type == 2)
  1065.                 {
  1066.                     int k2 = 0;
  1067.                     for(int l2 = 0; l2 < class9_1.height; l2++)
  1068.                     {
  1069.                         for(int i3 = 0; i3 < class9_1.width; i3++)
  1070.                         {
  1071.                             int j3 = i2 + i3 * (32 + class9_1.invSpritePadX);
  1072.                             int k3 = j2 + l2 * (32 + class9_1.invSpritePadY);
  1073.                             if(k2 < 20)
  1074.                             {
  1075.                                 j3 += class9_1.spritesX[k2];
  1076.                                 k3 += class9_1.spritesY[k2];
  1077.                             }
  1078.                             if(k >= j3 && i1 >= k3 && k < j3 + 32 && i1 < k3 + 32)
  1079.                             {
  1080.                                 mouseInvInterfaceIndex = k2;
  1081.                                 lastActiveInvInterface = class9_1.id;
  1082.                                 if(class9_1.inv[k2] > 0)
  1083.                                 {
  1084.                                     ItemDef itemDef = ItemDef.forID(class9_1.inv[k2] - 1);
  1085.                                     if(itemSelected == 1 && class9_1.isInventoryInterface)
  1086.                                     {
  1087.                                         if(class9_1.id != anInt1284 || k2 != anInt1283)
  1088.                                         {
  1089.                                             menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  1090.                                             menuActionID[menuActionRow] = 870;
  1091.                                             menuActionCmd1[menuActionRow] = itemDef.id;
  1092.                                             menuActionCmd2[menuActionRow] = k2;
  1093.                                             menuActionCmd3[menuActionRow] = class9_1.id;
  1094.                                             menuActionRow++;
  1095.                                         }
  1096.                                     } else
  1097.                                     if(spellSelected == 1 && class9_1.isInventoryInterface)
  1098.                                     {
  1099.                                         if((spellUsableOn & 0x10) == 16)
  1100.                                         {
  1101.                                             menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  1102.                                             menuActionID[menuActionRow] = 543;
  1103.                                             menuActionCmd1[menuActionRow] = itemDef.id;
  1104.                                             menuActionCmd2[menuActionRow] = k2;
  1105.                                             menuActionCmd3[menuActionRow] = class9_1.id;
  1106.                                             menuActionRow++;
  1107.                                         }
  1108.                                     } else
  1109.                                     {
  1110.                                         if(class9_1.isInventoryInterface)
  1111.                                         {
  1112.                                             for(int l3 = 4; l3 >= 3; l3--)
  1113.                                                 if(itemDef.actions != null && itemDef.actions[l3] != null)
  1114.                                                 {
  1115.                                                     menuActionName[menuActionRow] = itemDef.actions[l3] + " @lre@" + itemDef.name;
  1116.                                                     if(l3 == 3)
  1117.                                                         menuActionID[menuActionRow] = 493;
  1118.                                                     if(l3 == 4)
  1119.                                                         menuActionID[menuActionRow] = 847;
  1120.                                                     menuActionCmd1[menuActionRow] = itemDef.id;
  1121.                                                     menuActionCmd2[menuActionRow] = k2;
  1122.                                                     menuActionCmd3[menuActionRow] = class9_1.id;
  1123.                                                     menuActionRow++;
  1124.                                                 } else
  1125.                                                 if(l3 == 4)
  1126.                                                 {
  1127.                                                     menuActionName[menuActionRow] = "Drop @lre@" + itemDef.name;
  1128.                                                     menuActionID[menuActionRow] = 847;
  1129.                                                     menuActionCmd1[menuActionRow] = itemDef.id;
  1130.                                                     menuActionCmd2[menuActionRow] = k2;
  1131.                                                     menuActionCmd3[menuActionRow] = class9_1.id;
  1132.                                                     menuActionRow++;
  1133.                                                 }
  1134.  
  1135.                                         }
  1136.                                         if(class9_1.usableItemInterface)
  1137.                                         {
  1138.                                             menuActionName[menuActionRow] = "Use @lre@" + itemDef.name;
  1139.                                             menuActionID[menuActionRow] = 447;
  1140.                                             menuActionCmd1[menuActionRow] = itemDef.id;
  1141.                                             //k2 = inventory spot
  1142.                                             //System.out.println(k2);
  1143.                                             menuActionCmd2[menuActionRow] = k2;
  1144.                                             menuActionCmd3[menuActionRow] = class9_1.id;
  1145.                                             menuActionRow++;
  1146.                                         }
  1147.                                         if(class9_1.isInventoryInterface && itemDef.actions != null)
  1148.                                         {
  1149.                                             for(int i4 = 2; i4 >= 0; i4--)
  1150.                                                 if(itemDef.actions[i4] != null)
  1151.                                                 {
  1152.                                                     menuActionName[menuActionRow] = itemDef.actions[i4] + " @lre@" + itemDef.name;
  1153.                                                     if(i4 == 0)
  1154.                                                         menuActionID[menuActionRow] = 74;
  1155.                                                     if(i4 == 1)
  1156.                                                         menuActionID[menuActionRow] = 454;
  1157.                                                     if(i4 == 2)
  1158.                                                         menuActionID[menuActionRow] = 539;
  1159.                                                     menuActionCmd1[menuActionRow] = itemDef.id;
  1160.                                                     menuActionCmd2[menuActionRow] = k2;
  1161.                                                     menuActionCmd3[menuActionRow] = class9_1.id;
  1162.                                                     menuActionRow++;
  1163.                                                 }
  1164.  
  1165.                                         }
  1166.                                         if(class9_1.actions != null)
  1167.                                         {
  1168.                                             for(int j4 = 4; j4 >= 0; j4--)
  1169.                                                 if(class9_1.actions[j4] != null)
  1170.                                                 {
  1171.                                                     menuActionName[menuActionRow] = class9_1.actions[j4] + " @lre@" + itemDef.name;
  1172.                                                     if(j4 == 0)
  1173.                                                         menuActionID[menuActionRow] = 632;
  1174.                                                     if(j4 == 1)
  1175.                                                         menuActionID[menuActionRow] = 78;
  1176.                                                     if(j4 == 2)
  1177.                                                         menuActionID[menuActionRow] = 867;
  1178.                                                     if(j4 == 3)
  1179.                                                         menuActionID[menuActionRow] = 431;
  1180.                                                     if(j4 == 4)
  1181.                                                         menuActionID[menuActionRow] = 53;
  1182.                                                     menuActionCmd1[menuActionRow] = itemDef.id;
  1183.                                                     menuActionCmd2[menuActionRow] = k2;
  1184.                                                     menuActionCmd3[menuActionRow] = class9_1.id;
  1185.                                                     menuActionRow++;
  1186.                                                 }
  1187.  
  1188.                                         }
  1189.                                         //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + (class9_1.inv[k2] - 1) + "@gre@)";
  1190.                                         menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  1191.                                         menuActionID[menuActionRow] = 1125;
  1192.                                         menuActionCmd1[menuActionRow] = itemDef.id;
  1193.                                         menuActionCmd2[menuActionRow] = k2;
  1194.                                         menuActionCmd3[menuActionRow] = class9_1.id;
  1195.                                         menuActionRow++;
  1196.                                     }
  1197.                                 }
  1198.                             }
  1199.                             k2++;
  1200.                         }
  1201.  
  1202.                     }
  1203.  
  1204.                 }
  1205.             }
  1206.         }
  1207.  
  1208.     }
  1209.  
  1210.     public void drawScrollbar(int j, int k, int l, int i1, int j1) {
  1211.         scrollBar1.drawSprite(i1, l);
  1212.         scrollBar2.drawSprite(i1, (l + j) - 16);
  1213.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 16);
  1214.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x3d3426, 15);
  1215.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x342d21, 13);
  1216.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x2e281d, 11);
  1217.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x29241b, 10);
  1218.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x252019, 9);
  1219.         DrawingArea.drawPixels(j - 32, l + 16, i1, 0x000001, 1);
  1220.         int k1 = ((j - 32) * j) / j1;
  1221.         if(k1 < 8)
  1222.             k1 = 8;
  1223.         int l1 = ((j - 32 - k1) * k) / (j1 - j);
  1224.         DrawingArea.drawPixels(k1, l + 16 + l1, i1, barFillColor, 16);
  1225.         DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1);
  1226.         DrawingArea.method341(l + 16 + l1, 0x817051, k1, i1 + 1);
  1227.         DrawingArea.method341(l + 16 + l1, 0x73654a, k1, i1 + 2);
  1228.         DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 3);
  1229.         DrawingArea.method341(l + 16 + l1, 0x6a5c43, k1, i1 + 4);
  1230.         DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 5);
  1231.         DrawingArea.method341(l + 16 + l1, 0x655841, k1, i1 + 6);
  1232.         DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 7);
  1233.         DrawingArea.method341(l + 16 + l1, 0x61553e, k1, i1 + 8);
  1234.         DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 9);
  1235.         DrawingArea.method341(l + 16 + l1, 0x5d513c, k1, i1 + 10);
  1236.         DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 11);
  1237.         DrawingArea.method341(l + 16 + l1, 0x594e3a, k1, i1 + 12);
  1238.         DrawingArea.method341(l + 16 + l1, 0x514635, k1, i1 + 13);
  1239.         DrawingArea.method341(l + 16 + l1, 0x4b4131, k1, i1 + 14);
  1240.         DrawingArea.method339(l + 16 + l1, 0x000001, 15, i1);
  1241.         DrawingArea.method339(l + 17 + l1, 0x000001, 15, i1);
  1242.         DrawingArea.method339(l + 17 + l1, 0x655841, 14, i1);
  1243.         DrawingArea.method339(l + 17 + l1, 0x6a5c43, 13, i1);
  1244.         DrawingArea.method339(l + 17 + l1, 0x6d5f48, 11, i1);
  1245.         DrawingArea.method339(l + 17 + l1, 0x73654a, 10, i1);
  1246.         DrawingArea.method339(l + 17 + l1, 0x76684b, 7, i1);
  1247.         DrawingArea.method339(l + 17 + l1, 0x7b6a4d, 5, i1);
  1248.         DrawingArea.method339(l + 17 + l1, 0x7e6e50, 4, i1);
  1249.         DrawingArea.method339(l + 17 + l1, 0x817051, 3, i1);
  1250.         DrawingArea.method339(l + 17 + l1, 0x000001, 2, i1);
  1251.         DrawingArea.method339(l + 18 + l1, 0x000001, 16, i1);
  1252.         DrawingArea.method339(l + 18 + l1, 0x564b38, 15, i1);
  1253.         DrawingArea.method339(l + 18 + l1, 0x5d513c, 14, i1);
  1254.         DrawingArea.method339(l + 18 + l1, 0x625640, 11, i1);
  1255.         DrawingArea.method339(l + 18 + l1, 0x655841, 10, i1);
  1256.         DrawingArea.method339(l + 18 + l1, 0x6a5c43, 7, i1);
  1257.         DrawingArea.method339(l + 18 + l1, 0x6e6046, 5, i1);
  1258.         DrawingArea.method339(l + 18 + l1, 0x716247, 4, i1);
  1259.         DrawingArea.method339(l + 18 + l1, 0x7b6a4d, 3, i1);
  1260.         DrawingArea.method339(l + 18 + l1, 0x817051, 2, i1);
  1261.         DrawingArea.method339(l + 18 + l1, 0x000001, 1, i1);
  1262.         DrawingArea.method339(l + 19 + l1, 0x000001, 16, i1);
  1263.         DrawingArea.method339(l + 19 + l1, 0x514635, 15, i1);
  1264.         DrawingArea.method339(l + 19 + l1, 0x564b38, 14, i1);
  1265.         DrawingArea.method339(l + 19 + l1, 0x5d513c, 11, i1);
  1266.         DrawingArea.method339(l + 19 + l1, 0x61553e, 9, i1);
  1267.         DrawingArea.method339(l + 19 + l1, 0x655841, 7, i1);
  1268.         DrawingArea.method339(l + 19 + l1, 0x6a5c43, 5, i1);
  1269.         DrawingArea.method339(l + 19 + l1, 0x6e6046, 4, i1);
  1270.         DrawingArea.method339(l + 19 + l1, 0x73654a, 3, i1);
  1271.         DrawingArea.method339(l + 19 + l1, 0x817051, 2, i1);
  1272.         DrawingArea.method339(l + 19 + l1, 0x000001, 1, i1);
  1273.         DrawingArea.method339(l + 20 + l1, 0x000001, 16, i1);
  1274.         DrawingArea.method339(l + 20 + l1, 0x4b4131, 15, i1);
  1275.         DrawingArea.method339(l + 20 + l1, 0x544936, 14, i1);
  1276.         DrawingArea.method339(l + 20 + l1, 0x594e3a, 13, i1);
  1277.         DrawingArea.method339(l + 20 + l1, 0x5d513c, 10, i1);
  1278.         DrawingArea.method339(l + 20 + l1, 0x61553e, 8, i1);
  1279.         DrawingArea.method339(l + 20 + l1, 0x655841, 6, i1);
  1280.         DrawingArea.method339(l + 20 + l1, 0x6a5c43, 4, i1);
  1281.         DrawingArea.method339(l + 20 + l1, 0x73654a, 3, i1);
  1282.         DrawingArea.method339(l + 20 + l1, 0x817051, 2, i1);
  1283.         DrawingArea.method339(l + 20 + l1, 0x000001, 1, i1);
  1284.         DrawingArea.method341(l + 16 + l1, 0x000001, k1, i1 + 15);
  1285.         DrawingArea.method339(l + 15 + l1 + k1, 0x000001, 16, i1);
  1286.         DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 15, i1);
  1287.         DrawingArea.method339(l + 14 + l1 + k1, 0x3f372a, 14, i1);
  1288.         DrawingArea.method339(l + 14 + l1 + k1, 0x443c2d, 10, i1);
  1289.         DrawingArea.method339(l + 14 + l1 + k1, 0x483e2f, 9, i1);
  1290.         DrawingArea.method339(l + 14 + l1 + k1, 0x4a402f, 7, i1);
  1291.         DrawingArea.method339(l + 14 + l1 + k1, 0x4b4131, 4, i1);
  1292.         DrawingArea.method339(l + 14 + l1 + k1, 0x564b38, 3, i1);
  1293.         DrawingArea.method339(l + 14 + l1 + k1, 0x000001, 2, i1);
  1294.         DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 16, i1);
  1295.         DrawingArea.method339(l + 13 + l1 + k1, 0x443c2d, 15, i1);
  1296.         DrawingArea.method339(l + 13 + l1 + k1, 0x4b4131, 11, i1);
  1297.         DrawingArea.method339(l + 13 + l1 + k1, 0x514635, 9, i1);
  1298.         DrawingArea.method339(l + 13 + l1 + k1, 0x544936, 7, i1);
  1299.         DrawingArea.method339(l + 13 + l1 + k1, 0x564b38, 6, i1);
  1300.         DrawingArea.method339(l + 13 + l1 + k1, 0x594e3a, 4, i1);
  1301.         DrawingArea.method339(l + 13 + l1 + k1, 0x625640, 3, i1);
  1302.         DrawingArea.method339(l + 13 + l1 + k1, 0x6a5c43, 2, i1);
  1303.         DrawingArea.method339(l + 13 + l1 + k1, 0x000001, 1, i1);
  1304.         DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 16, i1);
  1305.         DrawingArea.method339(l + 12 + l1 + k1, 0x443c2d, 15, i1);
  1306.         DrawingArea.method339(l + 12 + l1 + k1, 0x4b4131, 14, i1);
  1307.         DrawingArea.method339(l + 12 + l1 + k1, 0x544936, 12, i1);
  1308.         DrawingArea.method339(l + 12 + l1 + k1, 0x564b38, 11, i1);
  1309.         DrawingArea.method339(l + 12 + l1 + k1, 0x594e3a, 10, i1);
  1310.         DrawingArea.method339(l + 12 + l1 + k1, 0x5d513c, 7, i1);
  1311.         DrawingArea.method339(l + 12 + l1 + k1, 0x61553e, 4, i1);
  1312.         DrawingArea.method339(l + 12 + l1 + k1, 0x6e6046, 3, i1);
  1313.         DrawingArea.method339(l + 12 + l1 + k1, 0x7b6a4d, 2, i1);
  1314.         DrawingArea.method339(l + 12 + l1 + k1, 0x000001, 1, i1);
  1315.         DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 16, i1);
  1316.         DrawingArea.method339(l + 11 + l1 + k1, 0x4b4131, 15, i1);
  1317.         DrawingArea.method339(l + 11 + l1 + k1, 0x514635, 14, i1);
  1318.         DrawingArea.method339(l + 11 + l1 + k1, 0x564b38, 13, i1);
  1319.         DrawingArea.method339(l + 11 + l1 + k1, 0x594e3a, 11, i1);
  1320.         DrawingArea.method339(l + 11 + l1 + k1, 0x5d513c, 9, i1);
  1321.         DrawingArea.method339(l + 11 + l1 + k1, 0x61553e, 7, i1);
  1322.         DrawingArea.method339(l + 11 + l1 + k1, 0x655841, 5, i1);
  1323.         DrawingArea.method339(l + 11 + l1 + k1, 0x6a5c43, 4, i1);
  1324.         DrawingArea.method339(l + 11 + l1 + k1, 0x73654a, 3, i1);
  1325.         DrawingArea.method339(l + 11 + l1 + k1, 0x7b6a4d, 2, i1);
  1326.         DrawingArea.method339(l + 11 + l1 + k1, 0x000001, 1, i1);
  1327.     }
  1328.  
  1329.     private void updateNPCs(Stream stream, int i)
  1330.     {
  1331.         anInt839 = 0;
  1332.         anInt893 = 0;
  1333.         method139(stream);
  1334.         method46(i, stream);
  1335.         method86(stream);
  1336.         for(int k = 0; k < anInt839; k++)
  1337.         {
  1338.             int l = anIntArray840[k];
  1339.             if(npcArray[l].anInt1537 != loopCycle)
  1340.             {
  1341.                 npcArray[l].desc = null;
  1342.                 npcArray[l] = null;
  1343.             }
  1344.         }
  1345.  
  1346.         if(stream.currentOffset != i)
  1347.         {
  1348.             signlink.reporterror(myUsername + " size mismatch in getnpcpos - pos:" + stream.currentOffset + " psize:" + i);
  1349.             throw new RuntimeException("eek");
  1350.         }
  1351.         for(int i1 = 0; i1 < npcCount; i1++)
  1352.             if(npcArray[npcIndices[i1]] == null)
  1353.             {
  1354.                 signlink.reporterror(myUsername + " null entry in npc list - pos:" + i1 + " size:" + npcCount);
  1355.                 throw new RuntimeException("eek");
  1356.             }
  1357.  
  1358.     }
  1359.  
  1360.     private int cButtonHPos;
  1361.     private int cButtonHCPos;
  1362.     private int cButtonCPos;
  1363.  
  1364.     private void processChatModeClick() {
  1365.         if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  1366.             cButtonHPos = 0;
  1367.             aBoolean1233 = true;
  1368.             inputTaken = true;
  1369.         } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  1370.             cButtonHPos = 1;
  1371.             aBoolean1233 = true;
  1372.             inputTaken = true;
  1373.         } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  1374.             cButtonHPos = 2;
  1375.             aBoolean1233 = true;
  1376.             inputTaken = true;
  1377.         } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  1378.             cButtonHPos = 3;
  1379.             aBoolean1233 = true;
  1380.             inputTaken = true;
  1381.         } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  1382.             cButtonHPos = 4;
  1383.             aBoolean1233 = true;
  1384.             inputTaken = true;
  1385.         } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  1386.             cButtonHPos = 5;
  1387.             aBoolean1233 = true;
  1388.             inputTaken = true;
  1389.         } else if(super.mouseX >= 404 && super.mouseX <= 515 && super.mouseY >= 482 && super.mouseY <= 503) {
  1390.             cButtonHPos = 6;
  1391.             aBoolean1233 = true;
  1392.             inputTaken = true;
  1393.         } else {
  1394.             cButtonHPos = -1;
  1395.             aBoolean1233 = true;
  1396.             inputTaken = true;
  1397.         }
  1398.         if(super.clickMode3 == 1) {
  1399.             if(super.saveClickX >= 5 && super.saveClickX <= 61 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1400.                 cButtonCPos = 0;
  1401.                 chatTypeView = 0;
  1402.                 aBoolean1233 = true;
  1403.                 inputTaken = true;
  1404.             } else if(super.saveClickX >= 71 && super.saveClickX <= 127 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1405.                 cButtonCPos = 1;
  1406.                 chatTypeView = 5;
  1407.                 aBoolean1233 = true;
  1408.                 inputTaken = true;
  1409.             } else if(super.saveClickX >= 137 && super.saveClickX <= 193 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1410.                 cButtonCPos = 2;
  1411.                 chatTypeView = 1;
  1412.                 aBoolean1233 = true;
  1413.                 inputTaken = true;
  1414.             } else if(super.saveClickX >= 203 && super.saveClickX <= 259 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1415.                 cButtonCPos = 3;
  1416.                 chatTypeView = 2;
  1417.                 aBoolean1233 = true;
  1418.                 inputTaken = true;
  1419.             } else if(super.saveClickX >= 269 && super.saveClickX <= 325 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1420.                 cButtonCPos = 4;
  1421.                 chatTypeView = 11;
  1422.                 aBoolean1233 = true;
  1423.                 inputTaken = true;
  1424.             } else if(super.saveClickX >= 335 && super.saveClickX <= 391 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1425.                 cButtonCPos = 5;
  1426.                 chatTypeView = 3;
  1427.                 aBoolean1233 = true;
  1428.                 inputTaken = true;
  1429.             } else if(super.saveClickX >= 404 && super.saveClickX <= 515 && super.saveClickY >= 482 && super.saveClickY <= 505) {
  1430.                 if(openInterfaceID == -1) {
  1431.                     clearTopInterfaces();
  1432.                     reportAbuseInput = "";
  1433.                     canMute = false;
  1434.                     for(int i = 0; i < RSInterface.interfaceCache.length; i++) {
  1435.                         if(RSInterface.interfaceCache[i] == null || RSInterface.interfaceCache[i].contentType != 600)
  1436.                             continue;
  1437.                         reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i].parentID;
  1438.                         break;
  1439.                     }
  1440.                 } else {
  1441.                     pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  1442.                 }
  1443.             }
  1444.         }
  1445.     }
  1446.  
  1447.     private void method33(int i)
  1448.     {
  1449.         int j = Varp.cache[i].anInt709;
  1450.         if(j == 0)
  1451.             return;
  1452.         int k = variousSettings[i];
  1453.         if(j == 1)
  1454.         {
  1455.             if(k == 1)
  1456.                 Texture.method372(0.90000000000000002D);
  1457.             if(k == 2)
  1458.                 Texture.method372(0.80000000000000004D);
  1459.             if(k == 3)
  1460.                 Texture.method372(0.69999999999999996D);
  1461.             if(k == 4)
  1462.                 Texture.method372(0.59999999999999998D);
  1463.             ItemDef.mruNodes1.unlinkAll();
  1464.             welcomeScreenRaised = true;
  1465.         }
  1466.         if(j == 3)
  1467.         {
  1468.             boolean flag1 = musicEnabled;
  1469.             if(k == 0)
  1470.             {
  1471.                 adjustVolume(musicEnabled, 0);
  1472.                 musicEnabled = true;
  1473.             }
  1474.             if(k == 1)
  1475.             {
  1476.                 adjustVolume(musicEnabled, -400);
  1477.                 musicEnabled = true;
  1478.             }
  1479.             if(k == 2)
  1480.             {
  1481.                 adjustVolume(musicEnabled, -800);
  1482.                 musicEnabled = true;
  1483.             }
  1484.             if(k == 3)
  1485.             {
  1486.                 adjustVolume(musicEnabled, -1200);
  1487.                 musicEnabled = true;
  1488.             }
  1489.             if(k == 4)
  1490.                 musicEnabled = false;
  1491.             if(musicEnabled != flag1 && !lowMem)
  1492.             {
  1493.                 if(musicEnabled)
  1494.                 {
  1495.                     nextSong = currentSong;
  1496.                     songChanging = true;
  1497.                     onDemandFetcher.method558(2, nextSong);
  1498.                 } else
  1499.                 {
  1500.                     stopMidi();
  1501.                 }
  1502.                 prevSong = 0;
  1503.             }
  1504.         }
  1505.         if(j == 4)
  1506.         {
  1507.             if(k == 0)
  1508.             {
  1509.                 aBoolean848 = true;
  1510.                 setWaveVolume(0);
  1511.             }
  1512.             if(k == 1)
  1513.             {
  1514.                 aBoolean848 = true;
  1515.                 setWaveVolume(-400);
  1516.             }
  1517.             if(k == 2)
  1518.             {
  1519.                 aBoolean848 = true;
  1520.                 setWaveVolume(-800);
  1521.             }
  1522.             if(k == 3)
  1523.             {
  1524.                 aBoolean848 = true;
  1525.                 setWaveVolume(-1200);
  1526.             }
  1527.             if(k == 4)
  1528.                 aBoolean848 = false;
  1529.         }
  1530.         if(j == 5)
  1531.             anInt1253 = k;
  1532.         if(j == 6)
  1533.             anInt1249 = k;
  1534.         if(j == 8)
  1535.         {
  1536.             splitPrivateChat = k;
  1537.             inputTaken = true;
  1538.         }
  1539.         if(j == 9)
  1540.             anInt913 = k;
  1541.     }
  1542.  
  1543.     private void updateEntities() {
  1544.         try{
  1545.             int anInt974 = 0;
  1546.             for(int j = -1; j < playerCount + npcCount; j++) {
  1547.             Object obj;
  1548.             if(j == -1)
  1549.                 obj = myPlayer;
  1550.             else
  1551.             if(j < playerCount)
  1552.                 obj = playerArray[playerIndices[j]];
  1553.             else
  1554.                 obj = npcArray[npcIndices[j - playerCount]];
  1555.             if(obj == null || !((Entity) (obj)).isVisible())
  1556.                 continue;
  1557.             if(obj instanceof NPC) {
  1558.                 EntityDef entityDef = ((NPC)obj).desc;
  1559.                 if(entityDef.childrenIDs != null)
  1560.                     entityDef = entityDef.method161();
  1561.                 if(entityDef == null)
  1562.                     continue;
  1563.             }
  1564.             if(j < playerCount) {
  1565.                 int l = 30;
  1566.                 Player player = (Player)obj;
  1567.                 if(player.headIcon >= 0) {
  1568.                     npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1569.                     if(spriteDrawX > -1) {
  1570.                         if (player.skullIcon < 2) {
  1571.                             skullIcons[player.skullIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1572.                             l += 25;
  1573.                         }
  1574.                         if (player.headIcon < 7) {
  1575.                             headIcons[player.headIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1576.                             l += 18;
  1577.                         }
  1578.                     }
  1579.                 }
  1580.                 if(j >= 0 && anInt855 == 10 && anInt933 == playerIndices[j]) {
  1581.                     npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1582.                     if(spriteDrawX > -1)
  1583.                         headIconsHint[player.hintIcon].drawSprite(spriteDrawX - 12, spriteDrawY - l);
  1584.                 }
  1585.             } else {
  1586.                 EntityDef entityDef_1 = ((NPC)obj).desc;
  1587.                 if(entityDef_1.anInt75 >= 0 && entityDef_1.anInt75 < headIcons.length) {
  1588.                     npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1589.                     if(spriteDrawX > -1)
  1590.                         headIcons[entityDef_1.anInt75].drawSprite(spriteDrawX - 12, spriteDrawY - 30);
  1591.                 }
  1592.                 if(anInt855 == 1 && anInt1222 == npcIndices[j - playerCount] && loopCycle % 20 < 10) {
  1593.                     npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1594.                     if(spriteDrawX > -1)
  1595.                         headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  1596.                 }
  1597.             }
  1598.             if(((Entity) (obj)).textSpoken != null && (j >= playerCount || publicChatMode == 0 || publicChatMode == 3 || publicChatMode == 1 && isFriendOrSelf(((Player)obj).name)))
  1599.             {
  1600.                 npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height);
  1601.                 if(spriteDrawX > -1 && anInt974 < anInt975)
  1602.                 {
  1603.                     anIntArray979[anInt974] = chatTextDrawingArea.method384(((Entity) (obj)).textSpoken) / 2;
  1604.                     anIntArray978[anInt974] = chatTextDrawingArea.anInt1497;
  1605.                     anIntArray976[anInt974] = spriteDrawX;
  1606.                     anIntArray977[anInt974] = spriteDrawY;
  1607.                     anIntArray980[anInt974] = ((Entity) (obj)).anInt1513;
  1608.                     anIntArray981[anInt974] = ((Entity) (obj)).anInt1531;
  1609.                     anIntArray982[anInt974] = ((Entity) (obj)).textCycle;
  1610.                     aStringArray983[anInt974++] = ((Entity) (obj)).textSpoken;
  1611.                     if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 >= 1 && ((Entity) (obj)).anInt1531 <= 3)
  1612.                     {
  1613.                         anIntArray978[anInt974] += 10;
  1614.                         anIntArray977[anInt974] += 5;
  1615.                     }
  1616.                     if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 4)
  1617.                         anIntArray979[anInt974] = 60;
  1618.                     if(anInt1249 == 0 && ((Entity) (obj)).anInt1531 == 5)
  1619.                         anIntArray978[anInt974] += 5;
  1620.                 }
  1621.             }
  1622.             if(((Entity) (obj)).loopCycleStatus > loopCycle)
  1623.             {
  1624.                 try{
  1625.                     npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15);
  1626.                     if(spriteDrawX > -1)
  1627.                     {
  1628.                         int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth;
  1629.                         if(i1 > 30)
  1630.                             i1 = 30;
  1631.                         DrawingArea.drawPixels(5, spriteDrawY - 3, spriteDrawX - 15, 65280, i1);
  1632.                         DrawingArea.drawPixels(5, spriteDrawY - 3, (spriteDrawX - 15) + i1, 0xff0000, 30 - i1);
  1633.                     }
  1634.                 }catch(Exception e){ }
  1635.                 }
  1636.                 for(int j1 = 0; j1 < 4; j1++)
  1637.                     if(((Entity) (obj)).hitsLoopCycle[j1] > loopCycle)
  1638.                     {
  1639.                         npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height / 2);
  1640.                         if(spriteDrawX > -1)
  1641.                         {
  1642.                             if(j1 == 1)
  1643.                                 spriteDrawY -= 20;
  1644.                             if(j1 == 2)
  1645.                             {
  1646.                                 spriteDrawX -= 15;
  1647.                                 spriteDrawY -= 10;
  1648.                             }
  1649.                             if(j1 == 3)
  1650.                             {
  1651.                                 spriteDrawX += 15;
  1652.                                 spriteDrawY -= 10;
  1653.                             }
  1654.                             hitMarks[((Entity) (obj)).hitMarkTypes[j1]].drawSprite(spriteDrawX - 12, spriteDrawY - 12);
  1655.                             smallText.drawText(0, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 4, spriteDrawX);
  1656.                             smallText.drawText(0xffffff, String.valueOf(((Entity) (obj)).hitArray[j1]), spriteDrawY + 3, spriteDrawX - 1);
  1657.                         }
  1658.                     }
  1659.             }
  1660.             for(int k = 0; k < anInt974; k++) {
  1661.                 int k1 = anIntArray976[k];
  1662.                 int l1 = anIntArray977[k];
  1663.                 int j2 = anIntArray979[k];
  1664.                 int k2 = anIntArray978[k];
  1665.                 boolean flag = true;
  1666.                 while(flag)
  1667.                 {
  1668.                     flag = false;
  1669.                     for(int l2 = 0; l2 < k; l2++)
  1670.                         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)
  1671.                         {
  1672.                             l1 = anIntArray977[l2] - anIntArray978[l2];
  1673.                             flag = true;
  1674.                         }
  1675.  
  1676.                 }
  1677.                 spriteDrawX = anIntArray976[k];
  1678.                 spriteDrawY = anIntArray977[k] = l1;
  1679.                 String s = aStringArray983[k];
  1680.                 if(anInt1249 == 0)
  1681.                 {
  1682.                     int i3 = 0xffff00;
  1683.                     if(anIntArray980[k] < 6)
  1684.                         i3 = anIntArray965[anIntArray980[k]];
  1685.                     if(anIntArray980[k] == 6)
  1686.                         i3 = anInt1265 % 20 >= 10 ? 0xffff00 : 0xff0000;
  1687.                     if(anIntArray980[k] == 7)
  1688.                         i3 = anInt1265 % 20 >= 10 ? 65535 : 255;
  1689.                     if(anIntArray980[k] == 8)
  1690.                         i3 = anInt1265 % 20 >= 10 ? 0x80ff80 : 45056;
  1691.                     if(anIntArray980[k] == 9) {
  1692.                         int j3 = 150 - anIntArray982[k];
  1693.                         if(j3 < 50)
  1694.                             i3 = 0xff0000 + 1280 * j3;
  1695.                         else
  1696.                         if(j3 < 100)
  1697.                             i3 = 0xffff00 - 0x50000 * (j3 - 50);
  1698.                         else
  1699.                         if(j3 < 150)
  1700.                             i3 = 65280 + 5 * (j3 - 100);
  1701.                     }
  1702.                     if(anIntArray980[k] == 10) {
  1703.                         int k3 = 150 - anIntArray982[k];
  1704.                         if(k3 < 50)
  1705.                             i3 = 0xff0000 + 5 * k3;
  1706.                         else
  1707.                         if(k3 < 100)
  1708.                             i3 = 0xff00ff - 0x50000 * (k3 - 50);
  1709.                         else
  1710.                         if(k3 < 150)
  1711.                             i3 = (255 + 0x50000 * (k3 - 100)) - 5 * (k3 - 100);
  1712.                     }
  1713.                     if(anIntArray980[k] == 11) {
  1714.                         int l3 = 150 - anIntArray982[k];
  1715.                         if(l3 < 50)
  1716.                             i3 = 0xffffff - 0x50005 * l3;
  1717.                         else
  1718.                         if(l3 < 100)
  1719.                             i3 = 65280 + 0x50005 * (l3 - 50);
  1720.                         else
  1721.                         if(l3 < 150)
  1722.                             i3 = 0xffffff - 0x50000 * (l3 - 100);
  1723.                     }
  1724.                     if(anIntArray981[k] == 0) {
  1725.                         chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1726.                         chatTextDrawingArea.drawText(i3, s, spriteDrawY, spriteDrawX);
  1727.                     }
  1728.                     if(anIntArray981[k] == 1) {
  1729.                         chatTextDrawingArea.method386(0, s, spriteDrawX, anInt1265, spriteDrawY + 1);
  1730.                         chatTextDrawingArea.method386(i3, s, spriteDrawX, anInt1265, spriteDrawY);
  1731.                     }
  1732.                     if(anIntArray981[k] == 2) {
  1733.                         chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY + 1, 0);
  1734.                         chatTextDrawingArea.method387(spriteDrawX, s, anInt1265, spriteDrawY, i3);
  1735.                     }
  1736.                     if(anIntArray981[k] == 3) {
  1737.                         chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY + 1, spriteDrawX, 0);
  1738.                         chatTextDrawingArea.method388(150 - anIntArray982[k], s, anInt1265, spriteDrawY, spriteDrawX, i3);
  1739.                     }
  1740.                     if(anIntArray981[k] == 4) {
  1741.                         int i4 = chatTextDrawingArea.method384(s);
  1742.                         int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
  1743.                         DrawingArea.setDrawingArea(334, spriteDrawX - 50, spriteDrawX + 50, 0);
  1744.                         chatTextDrawingArea.method385(0, s, spriteDrawY + 1, (spriteDrawX + 50) - k4);
  1745.                         chatTextDrawingArea.method385(i3, s, spriteDrawY, (spriteDrawX + 50) - k4);
  1746.                         DrawingArea.defaultDrawingAreaSize();
  1747.                     }
  1748.                     if(anIntArray981[k] == 5) {
  1749.                         int j4 = 150 - anIntArray982[k];
  1750.                         int l4 = 0;
  1751.                         if(j4 < 25)
  1752.                             l4 = j4 - 25;
  1753.                         else
  1754.                         if(j4 > 125)
  1755.                             l4 = j4 - 125;
  1756.                         DrawingArea.setDrawingArea(spriteDrawY + 5, 0, 512, spriteDrawY - chatTextDrawingArea.anInt1497 - 1);
  1757.                         chatTextDrawingArea.drawText(0, s, spriteDrawY + 1 + l4, spriteDrawX);
  1758.                         chatTextDrawingArea.drawText(i3, s, spriteDrawY + l4, spriteDrawX);
  1759.                         DrawingArea.defaultDrawingAreaSize();
  1760.                     }
  1761.                 } else {
  1762.                     chatTextDrawingArea.drawText(0, s, spriteDrawY + 1, spriteDrawX);
  1763.                     chatTextDrawingArea.drawText(0xffff00, s, spriteDrawY, spriteDrawX);
  1764.                 }
  1765.             }
  1766.         } catch(Exception e){ }
  1767.     }
  1768.  
  1769.     private void delFriend(long l)
  1770.     {
  1771.         try
  1772.         {
  1773.             if(l == 0L)
  1774.                 return;
  1775.             for(int i = 0; i < friendsCount; i++)
  1776.             {
  1777.                 if(friendsListAsLongs[i] != l)
  1778.                     continue;
  1779.                 friendsCount--;
  1780.                 needDrawTabArea = true;
  1781.                 for(int j = i; j < friendsCount; j++)
  1782.                 {
  1783.                     friendsList[j] = friendsList[j + 1];
  1784.                     friendsNodeIDs[j] = friendsNodeIDs[j + 1];
  1785.                     friendsListAsLongs[j] = friendsListAsLongs[j + 1];
  1786.                 }
  1787.  
  1788.                 stream.createFrame(215);
  1789.                 stream.writeQWord(l);
  1790.                 break;
  1791.             }
  1792.         }
  1793.         catch(RuntimeException runtimeexception)
  1794.         {
  1795.             signlink.reporterror("18622, " + false + ", " + l + ", " + runtimeexception.toString());
  1796.             throw new RuntimeException();
  1797.         }
  1798.     }
  1799.  
  1800.     public void drawSideIcons(){
  1801.         /* Top sideIcons */
  1802.         if(tabInterfaceIDs[0] != -1)//attack
  1803.             sideIcons[0].drawSprite(10, 4);
  1804.         if(tabInterfaceIDs[1] != -1)//stat
  1805.             sideIcons[1].drawSprite(43, 4);
  1806.         if(tabInterfaceIDs[2] != -1)//quest
  1807.             sideIcons[2].drawSprite(76, 3);
  1808.         if(tabInterfaceIDs[3] != -1)//inventory
  1809.             sideIcons[3].drawSprite(111, 5);
  1810.         if(tabInterfaceIDs[4] != -1)//equipment
  1811.             sideIcons[4].drawSprite(140, 1);
  1812.         if(tabInterfaceIDs[5] != -1)//prayer
  1813.             sideIcons[5].drawSprite(174, 1);
  1814.         if(tabInterfaceIDs[6] != -1)//magic
  1815.             sideIcons[6].drawSprite(208, 4);
  1816.         /* Bottom sideIcons */
  1817.         if(tabInterfaceIDs[7] != -1)//clan
  1818.             sideIcons[7].drawSprite(11, 303);
  1819.         if(tabInterfaceIDs[8] != -1)//friends
  1820.             sideIcons[8].drawSprite(46, 306);
  1821.         if(tabInterfaceIDs[9] != -1)//ignore
  1822.             sideIcons[9].drawSprite(79, 306);
  1823.         if(tabInterfaceIDs[10] != -1)//options
  1824.             sideIcons[10].drawSprite(113, 302);
  1825.         if(tabInterfaceIDs[11] != -1)//options
  1826.             sideIcons[11].drawSprite(145, 304);
  1827.         if(tabInterfaceIDs[12] != -1)//emotes
  1828.             sideIcons[12].drawSprite(181, 302);
  1829.         if(tabInterfaceIDs[13] != -1)//music
  1830.             sideIcons[13].drawSprite(213, 303);
  1831.     }
  1832.  
  1833.     public void drawRedStones() {
  1834.         if(tabInterfaceIDs[tabID] != -1) {
  1835.             switch(tabID) {
  1836.                 case 0:
  1837.                     redStones[0].drawSprite(3, 0);
  1838.                     break;
  1839.                 case 1:
  1840.                     redStones[4].drawSprite(41, 0);
  1841.                     break;
  1842.                 case 2:
  1843.                     redStones[4].drawSprite(74, 0);
  1844.                     break;
  1845.                 case 3:
  1846.                     redStones[4].drawSprite(107, 0);
  1847.                     break;
  1848.                 case 4:
  1849.                     redStones[4].drawSprite(140, 0);
  1850.                     break;
  1851.                 case 5:
  1852.                     redStones[4].drawSprite(173, 0);
  1853.                     break;
  1854.                 case 6:
  1855.                     redStones[1].drawSprite(206, 0);
  1856.                     break;
  1857.                 case 7:
  1858.                     redStones[2].drawSprite(3, 298);
  1859.                     break;
  1860.                 case 8:
  1861.                     redStones[4].drawSprite(41, 298);
  1862.                     break;
  1863.                 case 9:
  1864.                     redStones[4].drawSprite(74, 298);
  1865.                     break;
  1866.                 case 10:
  1867.                     redStones[4].drawSprite(107, 298);
  1868.                     break;
  1869.                 case 11:
  1870.                     redStones[4].drawSprite(140, 298);
  1871.                     break;
  1872.                 case 12:
  1873.                     redStones[4].drawSprite(173, 298);
  1874.                     break;
  1875.                 case 13:
  1876.                     redStones[3].drawSprite(206, 298);
  1877.                     break;
  1878.             }
  1879.         }
  1880.     }
  1881.  
  1882.     private void drawTabArea() {
  1883.         aRSImageProducer_1163.initDrawingArea();
  1884.         Texture.anIntArray1472 = anIntArray1181;
  1885.         tabArea.drawSprite(0, 0);
  1886.         if(invOverlayInterfaceID == -1) {
  1887.             drawRedStones();
  1888.             drawSideIcons();
  1889.         }
  1890.         if(invOverlayInterfaceID != -1)
  1891.             drawInterface(0, 28, RSInterface.interfaceCache[invOverlayInterfaceID], 37);
  1892.         else if(tabInterfaceIDs[tabID] != -1)
  1893.             drawInterface(0, 28, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], 37);
  1894.         if(menuOpen && menuScreenArea == 1)
  1895.             drawMenu();
  1896.         aRSImageProducer_1163.drawGraphics(168, super.graphics, 519);
  1897.         aRSImageProducer_1165.initDrawingArea();
  1898.         Texture.anIntArray1472 = anIntArray1182;
  1899.     }
  1900.  
  1901.     private void method37(int j) {
  1902.         if(!lowMem) {
  1903.             if(Texture.anIntArray1480[17] >= j) {
  1904.                 Background background = Texture.aBackgroundArray1474s[17];
  1905.                 int k = background.anInt1452 * background.anInt1453 - 1;
  1906.                 //fire cape apparently?
  1907.                 int j1 = background.anInt1452 * anInt945 * 2;
  1908.                 byte abyte0[] = background.aByteArray1450;
  1909.                 byte abyte3[] = aByteArray912;
  1910.                 for(int i2 = 0; i2 <= k; i2++)
  1911.                     abyte3[i2] = abyte0[i2 - j1 & k];
  1912.  
  1913.                 background.aByteArray1450 = abyte3;
  1914.                 aByteArray912 = abyte0;
  1915.                 Texture.method370(17);
  1916.                 anInt854++;
  1917.                 if(anInt854 > 1235) {
  1918.                     anInt854 = 0;
  1919.                     stream.createFrame(226);
  1920.                     stream.writeWordBigEndian(0);
  1921.                     int l2 = stream.currentOffset;
  1922.                     stream.writeWord(58722);
  1923.                     stream.writeWordBigEndian(240);
  1924.                     stream.writeWord((int)(Math.random() * 65536D));
  1925.                     stream.writeWordBigEndian((int)(Math.random() * 256D));
  1926.                     if((int)(Math.random() * 2D) == 0)
  1927.                         stream.writeWord(51825);
  1928.                     stream.writeWordBigEndian((int)(Math.random() * 256D));
  1929.                     stream.writeWord((int)(Math.random() * 65536D));
  1930.                     stream.writeWord(7130);
  1931.                     stream.writeWord((int)(Math.random() * 65536D));
  1932.                     stream.writeWord(61657);
  1933.                     stream.writeBytes(stream.currentOffset - l2);
  1934.                 }
  1935.             }
  1936.             if(Texture.anIntArray1480[24] >= j) {
  1937.                 Background background_1 = Texture.aBackgroundArray1474s[24];
  1938.                 int l = background_1.anInt1452 * background_1.anInt1453 - 1;
  1939.                 int k1 = background_1.anInt1452 * anInt945 * 2;
  1940.                 byte abyte1[] = background_1.aByteArray1450;
  1941.                 byte abyte4[] = aByteArray912;
  1942.                 for(int j2 = 0; j2 <= l; j2++)
  1943.                     abyte4[j2] = abyte1[j2 - k1 & l];
  1944.  
  1945.                 background_1.aByteArray1450 = abyte4;
  1946.                 aByteArray912 = abyte1;
  1947.                 Texture.method370(24);
  1948.             }
  1949.             if(Texture.anIntArray1480[34] >= j) {
  1950.                 Background background_2 = Texture.aBackgroundArray1474s[34];
  1951.                 int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1952.                 int l1 = background_2.anInt1452 * anInt945 * 2;
  1953.                 byte abyte2[] = background_2.aByteArray1450;
  1954.                 byte abyte5[] = aByteArray912;
  1955.                 for(int k2 = 0; k2 <= i1; k2++)
  1956.                     abyte5[k2] = abyte2[k2 - l1 & i1];
  1957.  
  1958.                 background_2.aByteArray1450 = abyte5;
  1959.                 aByteArray912 = abyte2;
  1960.                 Texture.method370(34);
  1961.             }
  1962.             if(Texture.anIntArray1480[40] >= j)
  1963.             {
  1964.                 Background background_2 = Texture.aBackgroundArray1474s[40];
  1965.                 int i1 = background_2.anInt1452 * background_2.anInt1453 - 1;
  1966.                 int l1 = background_2.anInt1452 * anInt945 * 2;
  1967.                 byte abyte2[] = background_2.aByteArray1450;
  1968.                 byte abyte5[] = aByteArray912;
  1969.                 for(int k2 = 0; k2 <= i1; k2++)
  1970.                     abyte5[k2] = abyte2[k2 - l1 & i1];
  1971.  
  1972.                 background_2.aByteArray1450 = abyte5;
  1973.                 aByteArray912 = abyte2;
  1974.                 Texture.method370(40);
  1975.             }
  1976.         }
  1977.     }
  1978.  
  1979.     private void method38() {
  1980.         for(int i = -1; i < playerCount; i++) {
  1981.             int j;
  1982.             if(i == -1)
  1983.                 j = myPlayerIndex;
  1984.             else
  1985.                 j = playerIndices[i];
  1986.             Player player = playerArray[j];
  1987.             if(player != null && player.textCycle > 0) {
  1988.                 player.textCycle--;
  1989.                 if(player.textCycle == 0)
  1990.                     player.textSpoken = null;
  1991.             }
  1992.         }
  1993.         for(int k = 0; k < npcCount; k++) {
  1994.             int l = npcIndices[k];
  1995.             NPC npc = npcArray[l];
  1996.             if(npc != null && npc.textCycle > 0) {
  1997.                 npc.textCycle--;
  1998.                 if(npc.textCycle == 0)
  1999.                     npc.textSpoken = null;
  2000.             }
  2001.         }
  2002.     }
  2003.  
  2004.     private void calcCameraPos() {
  2005.         int i = anInt1098 * 128 + 64;
  2006.         int j = anInt1099 * 128 + 64;
  2007.         int k = method42(plane, j, i) - anInt1100;
  2008.         if(xCameraPos < i) {
  2009.             xCameraPos += anInt1101 + ((i - xCameraPos) * anInt1102) / 1000;
  2010.             if(xCameraPos > i)
  2011.                 xCameraPos = i;
  2012.         }
  2013.         if(xCameraPos > i) {
  2014.             xCameraPos -= anInt1101 + ((xCameraPos - i) * anInt1102) / 1000;
  2015.             if(xCameraPos < i)
  2016.                 xCameraPos = i;
  2017.         }
  2018.         if(zCameraPos < k) {
  2019.             zCameraPos += anInt1101 + ((k - zCameraPos) * anInt1102) / 1000;
  2020.             if(zCameraPos > k)
  2021.                 zCameraPos = k;
  2022.         }
  2023.         if(zCameraPos > k) {
  2024.             zCameraPos -= anInt1101 + ((zCameraPos - k) * anInt1102) / 1000;
  2025.             if(zCameraPos < k)
  2026.                 zCameraPos = k;
  2027.         }
  2028.         if(yCameraPos < j) {
  2029.             yCameraPos += anInt1101 + ((j - yCameraPos) * anInt1102) / 1000;
  2030.             if(yCameraPos > j)
  2031.                 yCameraPos = j;
  2032.         }
  2033.         if(yCameraPos > j) {
  2034.             yCameraPos -= anInt1101 + ((yCameraPos - j) * anInt1102) / 1000;
  2035.             if(yCameraPos < j)
  2036.                 yCameraPos = j;
  2037.         }
  2038.         i = anInt995 * 128 + 64;
  2039.         j = anInt996 * 128 + 64;
  2040.         k = method42(plane, j, i) - anInt997;
  2041.         int l = i - xCameraPos;
  2042.         int i1 = k - zCameraPos;
  2043.         int j1 = j - yCameraPos;
  2044.         int k1 = (int)Math.sqrt(l * l + j1 * j1);
  2045.         int l1 = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  2046.         int i2 = (int)(Math.atan2(l, j1) * -325.94900000000001D) & 0x7ff;
  2047.         if(l1 < 128)
  2048.             l1 = 128;
  2049.         if(l1 > 383)
  2050.             l1 = 383;
  2051.         if(yCameraCurve < l1) {
  2052.             yCameraCurve += anInt998 + ((l1 - yCameraCurve) * anInt999) / 1000;
  2053.             if(yCameraCurve > l1)
  2054.                 yCameraCurve = l1;
  2055.         }
  2056.         if(yCameraCurve > l1) {
  2057.             yCameraCurve -= anInt998 + ((yCameraCurve - l1) * anInt999) / 1000;
  2058.             if(yCameraCurve < l1)
  2059.                 yCameraCurve = l1;
  2060.         }
  2061.         int j2 = i2 - xCameraCurve;
  2062.         if(j2 > 1024)
  2063.             j2 -= 2048;
  2064.         if(j2 < -1024)
  2065.             j2 += 2048;
  2066.         if(j2 > 0) {
  2067.             xCameraCurve += anInt998 + (j2 * anInt999) / 1000;
  2068.             xCameraCurve &= 0x7ff;
  2069.         }
  2070.         if(j2 < 0) {
  2071.             xCameraCurve -= anInt998 + (-j2 * anInt999) / 1000;
  2072.             xCameraCurve &= 0x7ff;
  2073.         }
  2074.         int k2 = i2 - xCameraCurve;
  2075.         if(k2 > 1024)
  2076.             k2 -= 2048;
  2077.         if(k2 < -1024)
  2078.             k2 += 2048;
  2079.         if(k2 < 0 && j2 > 0 || k2 > 0 && j2 < 0)
  2080.             xCameraCurve = i2;
  2081.     }
  2082.  
  2083.     private void drawMenu() {
  2084.         int i = menuOffsetX;
  2085.         int j = menuOffsetY;
  2086.         int k = menuWidth;
  2087.         int l = menuHeight + 1;
  2088.         int i1 = 0x5d5447;
  2089.         //DrawingArea.drawPixels(height, yPos, xPos, color, width);
  2090.         //DrawingArea.fillPixels(xPos, width, height, color, yPos);
  2091.         DrawingArea.drawPixels(l, j, i, i1, k);
  2092.         DrawingArea.drawPixels(16, j + 1, i + 1, 0, k - 2);
  2093.         DrawingArea.fillPixels(i + 1, k - 2, l - 19, 0, j + 18);
  2094.         chatTextDrawingArea.method385(i1, "Choose Option", j + 14, i + 3);
  2095.         int j1 = super.mouseX;
  2096.         int k1 = super.mouseY;
  2097.         if(menuScreenArea == 0) {
  2098.             j1 -= 4;
  2099.             k1 -= 4;
  2100.         }
  2101.         if(menuScreenArea == 1) {
  2102.             j1 -= 519;
  2103.             k1 -= 168;
  2104.         }
  2105.         if(menuScreenArea == 2) {
  2106.             j1 -= 17;
  2107.             k1 -= 338;
  2108.         }
  2109.         if(menuScreenArea == 3) {
  2110.             j1 -= 519;
  2111.             k1 -= 0;
  2112.         }
  2113.         for(int l1 = 0; l1 < menuActionRow; l1++) {
  2114.             int i2 = j + 31 + (menuActionRow - 1 - l1) * 15;
  2115.             int j2 = 0xffffff;
  2116.             if(j1 > i && j1 < i + k && k1 > i2 - 13 && k1 < i2 + 3)
  2117.                 j2 = 0xffff00;
  2118.             chatTextDrawingArea.method389(true, i + 3, j2, menuActionName[l1], i2);
  2119.         }
  2120.     }
  2121.  
  2122.     private void addFriend(long l) {
  2123.         try {
  2124.             if(l == 0L)
  2125.                 return;
  2126.             if(friendsCount >= 100 && anInt1046 != 1) {
  2127.                 pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2128.                 return;
  2129.             }
  2130.             if(friendsCount >= 200) {
  2131.                 pushMessage("Your friendlist is full. Max of 100 for free users, and 200 for members", 0, "");
  2132.                 return;
  2133.             }
  2134.             String s = TextClass.fixName(TextClass.nameForLong(l));
  2135.             for(int i = 0; i < friendsCount; i++)
  2136.                 if(friendsListAsLongs[i] == l) {
  2137.                     pushMessage(s + " is already on your friend list", 0, "");
  2138.                     return;
  2139.                 }
  2140.             for(int j = 0; j < ignoreCount; j++)
  2141.                 if(ignoreListAsLongs[j] == l) {
  2142.                     pushMessage("Please remove " + s + " from your ignore list first", 0, "");
  2143.                     return;
  2144.                 }
  2145.  
  2146.             if(s.equals(myPlayer.name)) {
  2147.                 return;
  2148.             } else {
  2149.                 friendsList[friendsCount] = s;
  2150.                 friendsListAsLongs[friendsCount] = l;
  2151.                 friendsNodeIDs[friendsCount] = 0;
  2152.                 friendsCount++;
  2153.                 needDrawTabArea = true;
  2154.                 stream.createFrame(188);
  2155.                 stream.writeQWord(l);
  2156.                 return;
  2157.             }
  2158.         } catch(RuntimeException runtimeexception) {
  2159.             signlink.reporterror("15283, " + (byte)68 + ", " + l + ", " + runtimeexception.toString());
  2160.         }
  2161.         throw new RuntimeException();
  2162.     }
  2163.  
  2164.     private int method42(int i, int j, int k) {
  2165.         int l = k >> 7;
  2166.         int i1 = j >> 7;
  2167.         if(l < 0 || i1 < 0 || l > 103 || i1 > 103)
  2168.             return 0;
  2169.         int j1 = i;
  2170.         if(j1 < 3 && (byteGroundArray[1][l][i1] & 2) == 2)
  2171.             j1++;
  2172.         int k1 = k & 0x7f;
  2173.         int l1 = j & 0x7f;
  2174.         int i2 = intGroundArray[j1][l][i1] * (128 - k1) + intGroundArray[j1][l + 1][i1] * k1 >> 7;
  2175.         int j2 = intGroundArray[j1][l][i1 + 1] * (128 - k1) + intGroundArray[j1][l + 1][i1 + 1] * k1 >> 7;
  2176.         return i2 * (128 - l1) + j2 * l1 >> 7;
  2177.     }
  2178.  
  2179.     private static String intToKOrMil(int j) {
  2180.         if(j < 0x186a0)
  2181.             return String.valueOf(j);
  2182.         if(j < 0x989680)
  2183.             return j / 1000 + "K";
  2184.         else
  2185.             return j / 0xf4240 + "M";
  2186.     }
  2187.  
  2188.     private void resetLogout() {
  2189.         try {
  2190.             if(socketStream != null)
  2191.                 socketStream.close();
  2192.         }
  2193.         catch(Exception _ex) { }
  2194.         socketStream = null;
  2195.         loggedIn = false;
  2196.         loginScreenState = 0;
  2197.  //    myUsername = "";
  2198.  //    myPassword = "";
  2199.         unlinkMRUNodes();
  2200.         worldController.initToNull();
  2201.         for(int i = 0; i < 4; i++)
  2202.             aClass11Array1230[i].method210();
  2203.         System.gc();
  2204.         stopMidi();
  2205.         currentSong = -1;
  2206.         nextSong = -1;
  2207.         prevSong = 0;
  2208.     }
  2209.  
  2210.     private void method45() {
  2211.         aBoolean1031 = true;
  2212.         for(int j = 0; j < 7; j++) {
  2213.             anIntArray1065[j] = -1;
  2214.             for(int k = 0; k < IDK.length; k++) {
  2215.                 if(IDK.cache[k].aBoolean662 || IDK.cache[k].anInt657 != j + (aBoolean1047 ? 0 : 7))
  2216.                     continue;
  2217.                 anIntArray1065[j] = k;
  2218.                 break;
  2219.             }
  2220.         }
  2221.     }
  2222.  
  2223.     private void method46(int i, Stream stream) {
  2224.         while(stream.bitPosition + 21 < i * 8) {
  2225.             int k = stream.readBits(14);
  2226.             if(k == 16383)
  2227.                 break;
  2228.             if(npcArray[k] == null)
  2229.                 npcArray[k] = new NPC();
  2230.             NPC npc = npcArray[k];
  2231.             npcIndices[npcCount++] = k;
  2232.             npc.anInt1537 = loopCycle;
  2233.             int l = stream.readBits(5);
  2234.             if(l > 15)
  2235.                 l -= 32;
  2236.             int i1 = stream.readBits(5);
  2237.             if(i1 > 15)
  2238.                 i1 -= 32;
  2239.             int j1 = stream.readBits(1);
  2240.             npc.desc = EntityDef.forID(stream.readBits(12));
  2241.             int k1 = stream.readBits(1);
  2242.             if(k1 == 1)
  2243.                 anIntArray894[anInt893++] = k;
  2244.             npc.anInt1540 = npc.desc.aByte68;
  2245.             npc.anInt1504 = npc.desc.anInt79;
  2246.             npc.anInt1554 = npc.desc.walkAnim;
  2247.             npc.anInt1555 = npc.desc.anInt58;
  2248.             npc.anInt1556 = npc.desc.anInt83;
  2249.             npc.anInt1557 = npc.desc.anInt55;
  2250.             npc.anInt1511 = npc.desc.standAnim;
  2251.             npc.setPos(myPlayer.smallX[0] + i1, myPlayer.smallY[0] + l, j1 == 1);
  2252.         }
  2253.         stream.finishBitAccess();
  2254.     }
  2255.  
  2256.     public void processGameLoop() {
  2257.         if(rsAlreadyLoaded || loadingError || genericLoadingError)
  2258.             return;
  2259.         loopCycle++;
  2260.         if(!loggedIn)
  2261.             processLoginScreenInput();
  2262.         else
  2263.             mainGameProcessor();
  2264.         processOnDemandQueue();
  2265.     }
  2266.  
  2267.     private void method47(boolean flag) {
  2268.         if(myPlayer.x >> 7 == destX && myPlayer.y >> 7 == destY)
  2269.             destX = 0;
  2270.         int j = playerCount;
  2271.         if(flag)
  2272.             j = 1;
  2273.         for(int l = 0; l < j; l++) {
  2274.             Player player;
  2275.             int i1;
  2276.             if(flag) {
  2277.                 player = myPlayer;
  2278.                 i1 = myPlayerIndex << 14;
  2279.             } else {
  2280.                 player = playerArray[playerIndices[l]];
  2281.                 i1 = playerIndices[l] << 14;
  2282.             }
  2283.             if(player == null || !player.isVisible())
  2284.                 continue;
  2285.             player.aBoolean1699 = (lowMem && playerCount > 50 || playerCount > 200) && !flag && player.anInt1517 == player.anInt1511;
  2286.             int j1 = player.x >> 7;
  2287.             int k1 = player.y >> 7;
  2288.             if(j1 < 0 || j1 >= 104 || k1 < 0 || k1 >= 104)
  2289.                 continue;
  2290.             if(player.aModel_1714 != null && loopCycle >= player.anInt1707 && loopCycle < player.anInt1708) {
  2291.                 player.aBoolean1699 = false;
  2292.                 player.anInt1709 = method42(plane, player.y, player.x);
  2293.                 worldController.method286(plane, player.y, player, player.anInt1552, player.anInt1722, player.x, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
  2294.                 continue;
  2295.             }
  2296.             if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64) {
  2297.                 if(anIntArrayArray929[j1][k1] == anInt1265)
  2298.                     continue;
  2299.                 anIntArrayArray929[j1][k1] = anInt1265;
  2300.             }
  2301.             player.anInt1709 = method42(plane, player.y, player.x);
  2302.             worldController.method285(plane, player.anInt1552, player.anInt1709, i1, player.y, 60, player.x, player, player.aBoolean1541);
  2303.         }
  2304.     }
  2305.  
  2306.     private boolean promptUserForInput(RSInterface class9) {
  2307.         int j = class9.contentType;
  2308.         if(anInt900 == 2) {
  2309.             if(j == 201) {
  2310.                 inputTaken = true;
  2311.                 inputDialogState = 0;
  2312.                 messagePromptRaised = true;
  2313.                 promptInput = "";
  2314.                 friendsListAction = 1;
  2315.                 aString1121 = "Enter name of friend to add to list";
  2316.             }
  2317.             if(j == 202) {
  2318.                 inputTaken = true;
  2319.                 inputDialogState = 0;
  2320.                 messagePromptRaised = true;
  2321.                 promptInput = "";
  2322.                 friendsListAction = 2;
  2323.                 aString1121 = "Enter name of friend to delete from list";
  2324.             }
  2325.         }
  2326.         if(j == 205) {
  2327.             anInt1011 = 250;
  2328.             return true;
  2329.         }
  2330.         if(j == 501) {
  2331.             inputTaken = true;
  2332.             inputDialogState = 0;
  2333.             messagePromptRaised = true;
  2334.             promptInput = "";
  2335.             friendsListAction = 4;
  2336.             aString1121 = "Enter name of player to add to list";
  2337.         }
  2338.         if(j == 502) {
  2339.             inputTaken = true;
  2340.             inputDialogState = 0;
  2341.             messagePromptRaised = true;
  2342.             promptInput = "";
  2343.             friendsListAction = 5;
  2344.             aString1121 = "Enter name of player to delete from list";
  2345.         }
  2346.         if(j == 550) {
  2347.             inputTaken = true;
  2348.             inputDialogState = 0;
  2349.             messagePromptRaised = true;
  2350.             promptInput = "";
  2351.             friendsListAction = 6;
  2352.             aString1121 = "Enter the name of the chat you wish to join";
  2353.         }
  2354.         if(j >= 300 && j <= 313) {
  2355.             int k = (j - 300) / 2;
  2356.             int j1 = j & 1;
  2357.             int i2 = anIntArray1065[k];
  2358.             if(i2 != -1) {
  2359.                 do {
  2360.                     if(j1 == 0 && --i2 < 0)
  2361.                         i2 = IDK.length - 1;
  2362.                     if(j1 == 1 && ++i2 >= IDK.length)
  2363.                         i2 = 0;
  2364.                 } while(IDK.cache[i2].aBoolean662 || IDK.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
  2365.                 anIntArray1065[k] = i2;
  2366.                 aBoolean1031 = true;
  2367.             }
  2368.         }
  2369.         if(j >= 314 && j <= 323) {
  2370.             int l = (j - 314) / 2;
  2371.             int k1 = j & 1;
  2372.             int j2 = anIntArray990[l];
  2373.             if(k1 == 0 && --j2 < 0)
  2374.                 j2 = anIntArrayArray1003[l].length - 1;
  2375.             if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
  2376.                 j2 = 0;
  2377.             anIntArray990[l] = j2;
  2378.             aBoolean1031 = true;
  2379.         }
  2380.         if(j == 324 && !aBoolean1047) {
  2381.             aBoolean1047 = true;
  2382.             method45();
  2383.         }
  2384.         if(j == 325 && aBoolean1047) {
  2385.             aBoolean1047 = false;
  2386.             method45();
  2387.         }
  2388.         if(j == 326) {
  2389.             stream.createFrame(101);
  2390.             stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
  2391.             for(int i1 = 0; i1 < 7; i1++)
  2392.                 stream.writeWordBigEndian(anIntArray1065[i1]);
  2393.  
  2394.             for(int l1 = 0; l1 < 5; l1++)
  2395.                 stream.writeWordBigEndian(anIntArray990[l1]);
  2396.  
  2397.             return true;
  2398.         }
  2399.         if(j == 613)
  2400.             canMute = !canMute;
  2401.         if(j >= 601 && j <= 612) {
  2402.             clearTopInterfaces();
  2403.             if(reportAbuseInput.length() > 0) {
  2404.                 stream.createFrame(218);
  2405.                 stream.writeQWord(TextClass.longForName(reportAbuseInput));
  2406.                 stream.writeWordBigEndian(j - 601);
  2407.                 stream.writeWordBigEndian(canMute ? 1 : 0);
  2408.             }
  2409.         }
  2410.         return false;
  2411.     }
  2412.  
  2413.     private void method49(Stream stream) {
  2414.         for(int j = 0; j < anInt893; j++) {
  2415.             int k = anIntArray894[j];
  2416.             Player player = playerArray[k];
  2417.             int l = stream.readUnsignedByte();
  2418.             if((l & 0x40) != 0)
  2419.                 l += stream.readUnsignedByte() << 8;
  2420.             method107(l, k, stream, player);
  2421.         }
  2422.     }
  2423.  
  2424.     private void method50(int i, int k, int l, int i1, int j1) {
  2425.         int k1 = worldController.method300(j1, l, i);
  2426.         if(k1 != 0) {
  2427.             int l1 = worldController.method304(j1, l, i, k1);
  2428.             int k2 = l1 >> 6 & 3;
  2429.             int i3 = l1 & 0x1f;
  2430.             int k3 = k;
  2431.             if(k1 > 0)
  2432.                 k3 = i1;
  2433.             int ai[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2434.             int k4 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2435.             int i5 = k1 >> 14 & 0x7fff;
  2436.             ObjectDef class46_2 = ObjectDef.forID(i5);
  2437.             if(class46_2.anInt758 != -1) {
  2438.                 Background background_2 = mapScenes[class46_2.anInt758];
  2439.                 if(background_2 != null) {
  2440.                     int i6 = (class46_2.anInt744 * 4 - background_2.anInt1452) / 2;
  2441.                     int j6 = (class46_2.anInt761 * 4 - background_2.anInt1453) / 2;
  2442.                     background_2.drawBackground(48 + l * 4 + i6, 48 + (104 - i - class46_2.anInt761) * 4 + j6);
  2443.                 }
  2444.             } else {
  2445.                 if(i3 == 0 || i3 == 2)
  2446.                     if(k2 == 0) {
  2447.                         ai[k4] = k3;
  2448.                         ai[k4 + 512] = k3;
  2449.                         ai[k4 + 1024] = k3;
  2450.                         ai[k4 + 1536] = k3;
  2451.                     } else if(k2 == 1) {
  2452.                         ai[k4] = k3;
  2453.                         ai[k4 + 1] = k3;
  2454.                         ai[k4 + 2] = k3;
  2455.                         ai[k4 + 3] = k3;
  2456.                     } else if(k2 == 2) {
  2457.                         ai[k4 + 3] = k3;
  2458.                         ai[k4 + 3 + 512] = k3;
  2459.                         ai[k4 + 3 + 1024] = k3;
  2460.                         ai[k4 + 3 + 1536] = k3;
  2461.                     } else if(k2 == 3) {
  2462.                         ai[k4 + 1536] = k3;
  2463.                         ai[k4 + 1536 + 1] = k3;
  2464.                         ai[k4 + 1536 + 2] = k3;
  2465.                         ai[k4 + 1536 + 3] = k3;
  2466.                     }
  2467.                 if(i3 == 3)
  2468.                     if(k2 == 0)
  2469.                         ai[k4] = k3;
  2470.                     else if(k2 == 1)
  2471.                         ai[k4 + 3] = k3;
  2472.                     else if(k2 == 2)
  2473.                         ai[k4 + 3 + 1536] = k3;
  2474.                     else if(k2 == 3)
  2475.                         ai[k4 + 1536] = k3;
  2476.                 if(i3 == 2)
  2477.                     if(k2 == 3) {
  2478.                         ai[k4] = k3;
  2479.                         ai[k4 + 512] = k3;
  2480.                         ai[k4 + 1024] = k3;
  2481.                         ai[k4 + 1536] = k3;
  2482.                     } else if(k2 == 0) {
  2483.                         ai[k4] = k3;
  2484.                         ai[k4 + 1] = k3;
  2485.                         ai[k4 + 2] = k3;
  2486.                         ai[k4 + 3] = k3;
  2487.                     } else if(k2 == 1) {
  2488.                         ai[k4 + 3] = k3;
  2489.                         ai[k4 + 3 + 512] = k3;
  2490.                         ai[k4 + 3 + 1024] = k3;
  2491.                         ai[k4 + 3 + 1536] = k3;
  2492.                     } else if(k2 == 2) {
  2493.                         ai[k4 + 1536] = k3;
  2494.                         ai[k4 + 1536 + 1] = k3;
  2495.                         ai[k4 + 1536 + 2] = k3;
  2496.                         ai[k4 + 1536 + 3] = k3;
  2497.                     }
  2498.             }
  2499.         }
  2500.         k1 = worldController.method302(j1, l, i);
  2501.         if(k1 != 0) {
  2502.             int i2 = worldController.method304(j1, l, i, k1);
  2503.             int l2 = i2 >> 6 & 3;
  2504.             int j3 = i2 & 0x1f;
  2505.             int l3 = k1 >> 14 & 0x7fff;
  2506.             ObjectDef class46_1 = ObjectDef.forID(l3);
  2507.             if(class46_1.anInt758 != -1) {
  2508.                 Background background_1 = mapScenes[class46_1.anInt758];
  2509.                 if(background_1 != null) {
  2510.                     int j5 = (class46_1.anInt744 * 4 - background_1.anInt1452) / 2;
  2511.                     int k5 = (class46_1.anInt761 * 4 - background_1.anInt1453) / 2;
  2512.                     background_1.drawBackground(48 + l * 4 + j5, 48 + (104 - i - class46_1.anInt761) * 4 + k5);
  2513.                 }
  2514.             } else if(j3 == 9) {
  2515.                 int l4 = 0xeeeeee;
  2516.                 if(k1 > 0)
  2517.                     l4 = 0xee0000;
  2518.                 int ai1[] = aClass30_Sub2_Sub1_Sub1_1263.myPixels;
  2519.                 int l5 = 24624 + l * 4 + (103 - i) * 512 * 4;
  2520.                 if(l2 == 0 || l2 == 2) {
  2521.                     ai1[l5 + 1536] = l4;
  2522.                     ai1[l5 + 1024 + 1] = l4;
  2523.                     ai1[l5 + 512 + 2] = l4;
  2524.                     ai1[l5 + 3] = l4;
  2525.                 } else {
  2526.                     ai1[l5] = l4;
  2527.                     ai1[l5 + 512 + 1] = l4;
  2528.                     ai1[l5 + 1024 + 2] = l4;
  2529.                     ai1[l5 + 1536 + 3] = l4;
  2530.                 }
  2531.             }
  2532.         }
  2533.         k1 = worldController.method303(j1, l, i);
  2534.         if(k1 != 0) {
  2535.             int j2 = k1 >> 14 & 0x7fff;
  2536.             ObjectDef class46 = ObjectDef.forID(j2);
  2537.             if(class46.anInt758 != -1) {
  2538.                 Background background = mapScenes[class46.anInt758];
  2539.                 if(background != null) {
  2540.                     int i4 = (class46.anInt744 * 4 - background.anInt1452) / 2;
  2541.                     int j4 = (class46.anInt761 * 4 - background.anInt1453) / 2;
  2542.                     background.drawBackground(48 + l * 4 + i4, 48 + (104 - i - class46.anInt761) * 4 + j4);
  2543.                 }
  2544.             }
  2545.         }
  2546.     }
  2547.  
  2548.     private void loadTitleScreen() {
  2549.         aBackground_966 = new Background(titleStreamLoader, "titlebox", 0);
  2550.         aBackground_967 = new Background(titleStreamLoader, "titlebutton", 0);
  2551.         aBackgroundArray1152s = new Background[12];
  2552.         int j = 0;
  2553.         try {
  2554.             j = Integer.parseInt(getParameter("fl_icon"));
  2555.         } catch(Exception _ex) {
  2556.         }
  2557.         if(j == 0) {
  2558.             for(int k = 0; k < 12; k++)
  2559.                 aBackgroundArray1152s[k] = new Background(titleStreamLoader, "runes", k);
  2560.  
  2561.         } else {
  2562.             for(int l = 0; l < 12; l++)
  2563.                 aBackgroundArray1152s[l] = new Background(titleStreamLoader, "runes", 12 + (l & 3));
  2564.  
  2565.         }
  2566.         aClass30_Sub2_Sub1_Sub1_1201 = new Sprite(128, 265);
  2567.         aClass30_Sub2_Sub1_Sub1_1202 = new Sprite(128, 265);
  2568.         System.arraycopy(aRSImageProducer_1110.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, 33920);
  2569.  
  2570.         System.arraycopy(aRSImageProducer_1111.anIntArray315, 0, aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, 33920);
  2571.  
  2572.         anIntArray851 = new int[256];
  2573.         for(int k1 = 0; k1 < 64; k1++)
  2574.             anIntArray851[k1] = k1 * 0x40000;
  2575.  
  2576.         for(int l1 = 0; l1 < 64; l1++)
  2577.             anIntArray851[l1 + 64] = 0xff0000 + 1024 * l1;
  2578.  
  2579.         for(int i2 = 0; i2 < 64; i2++)
  2580.             anIntArray851[i2 + 128] = 0xffff00 + 4 * i2;
  2581.  
  2582.         for(int j2 = 0; j2 < 64; j2++)
  2583.             anIntArray851[j2 + 192] = 0xffffff;
  2584.  
  2585.         anIntArray852 = new int[256];
  2586.         for(int k2 = 0; k2 < 64; k2++)
  2587.             anIntArray852[k2] = k2 * 1024;
  2588.  
  2589.         for(int l2 = 0; l2 < 64; l2++)
  2590.             anIntArray852[l2 + 64] = 65280 + 4 * l2;
  2591.  
  2592.         for(int i3 = 0; i3 < 64; i3++)
  2593.             anIntArray852[i3 + 128] = 65535 + 0x40000 * i3;
  2594.  
  2595.         for(int j3 = 0; j3 < 64; j3++)
  2596.             anIntArray852[j3 + 192] = 0xffffff;
  2597.  
  2598.         anIntArray853 = new int[256];
  2599.         for(int k3 = 0; k3 < 64; k3++)
  2600.             anIntArray853[k3] = k3 * 4;
  2601.  
  2602.         for(int l3 = 0; l3 < 64; l3++)
  2603.             anIntArray853[l3 + 64] = 255 + 0x40000 * l3;
  2604.  
  2605.         for(int i4 = 0; i4 < 64; i4++)
  2606.             anIntArray853[i4 + 128] = 0xff00ff + 1024 * i4;
  2607.  
  2608.         for(int j4 = 0; j4 < 64; j4++)
  2609.             anIntArray853[j4 + 192] = 0xffffff;
  2610.  
  2611.         anIntArray850 = new int[256];
  2612.         anIntArray1190 = new int[32768];
  2613.         anIntArray1191 = new int[32768];
  2614.         randomizeBackground(null);
  2615.         anIntArray828 = new int[32768];
  2616.         anIntArray829 = new int[32768];
  2617.         drawLoadingText(16, "Connecting to fileserver");
  2618.         if(!aBoolean831) {
  2619.             drawFlames = true;
  2620.             aBoolean831 = true;
  2621.             startRunnable(this, 2);
  2622.         }
  2623.     }
  2624.  
  2625.     private static void setHighMem() {
  2626.         WorldController.lowMem = false;
  2627.         Texture.lowMem = false;
  2628.         lowMem = false;
  2629.         ObjectManager.lowMem = false;
  2630.         ObjectDef.lowMem = false;
  2631.     }
  2632.  
  2633.     public static void main(String args[]) {
  2634.         try {
  2635.             System.out.println("RS2 user client - release #" + 317);
  2636.             if(args.length != 5) {
  2637.                 System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2638.                 return;
  2639.             }
  2640.             nodeID = Integer.parseInt(args[0]);
  2641.             //portOff = Integer.parseInt(args[1]);
  2642.             portOff = 0;
  2643.             if(args[2].equals("lowmem"))
  2644.                 setLowMem();
  2645.             else if(args[2].equals("highmem")) {
  2646.                 setHighMem();
  2647.             } else {
  2648.                 System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2649.                 return;
  2650.             }
  2651.             if(args[3].equals("free"))
  2652.                 isMembers = false;
  2653.             else if(args[3].equals("members")) {
  2654.                 isMembers = true;
  2655.             } else {
  2656.                 System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
  2657.                 return;
  2658.             }
  2659.             signlink.storeid = Integer.parseInt(args[4]);
  2660.             signlink.startpriv(InetAddress.getLocalHost());
  2661.             new Jframe(args);
  2662.             //client client1 = new client();
  2663.             //client1.createClientFrame(503, 765);
  2664.         } catch(Exception exception) {
  2665.         }
  2666.     }
  2667.  
  2668.     private void loadingStages() {
  2669.         if(lowMem && loadingStage == 2 && ObjectManager.anInt131 != plane) {
  2670.             aRSImageProducer_1165.initDrawingArea();
  2671.             aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  2672.             aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  2673.             aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  2674.             loadingStage = 1;
  2675.             aLong824 = System.currentTimeMillis();
  2676.         }
  2677.         if(loadingStage == 1) {
  2678.             int j = method54();
  2679.             if(j != 0 && System.currentTimeMillis() - aLong824 > 0x57e40L) {
  2680.                 signlink.reporterror(myUsername + " glcfb " + aLong1215 + "," + j + "," + lowMem + "," + decompressors[0] + "," + onDemandFetcher.getNodeCount() + "," + plane + "," + anInt1069 + "," + anInt1070);
  2681.                 aLong824 = System.currentTimeMillis();
  2682.             }
  2683.         }
  2684.         if(loadingStage == 2 && plane != anInt985) {
  2685.             anInt985 = plane;
  2686.             method24(plane);
  2687.         }
  2688.     }
  2689.  
  2690.     private int method54() {
  2691.         for(int i = 0; i < aByteArrayArray1183.length; i++) {
  2692.             if(aByteArrayArray1183[i] == null && anIntArray1235[i] != -1)
  2693.                 return -1;
  2694.             if(aByteArrayArray1247[i] == null && anIntArray1236[i] != -1)
  2695.                 return -2;
  2696.         }
  2697.         boolean flag = true;
  2698.         for(int j = 0; j < aByteArrayArray1183.length; j++) {
  2699.             byte abyte0[] = aByteArrayArray1247[j];
  2700.             if(abyte0 != null) {
  2701.                 int k = (anIntArray1234[j] >> 8) * 64 - baseX;
  2702.                 int l = (anIntArray1234[j] & 0xff) * 64 - baseY;
  2703.                 if(aBoolean1159) {
  2704.                     k = 10;
  2705.                     l = 10;
  2706.                 }
  2707.                 flag &= ObjectManager.method189(k, abyte0, l);
  2708.             }
  2709.         }
  2710.         if(!flag)
  2711.             return -3;
  2712.         if(aBoolean1080) {
  2713.             return -4;
  2714.         } else {
  2715.             loadingStage = 2;
  2716.             ObjectManager.anInt131 = plane;
  2717.             method22();
  2718.             stream.createFrame(121);
  2719.             return 0;
  2720.         }
  2721.     }
  2722.  
  2723.     private void method55()
  2724.     {
  2725.         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())
  2726.             if(class30_sub2_sub4_sub4.anInt1597 != plane || loopCycle > class30_sub2_sub4_sub4.anInt1572)
  2727.                 class30_sub2_sub4_sub4.unlink();
  2728.             else
  2729.             if(loopCycle >= class30_sub2_sub4_sub4.anInt1571)
  2730.             {
  2731.                 if(class30_sub2_sub4_sub4.anInt1590 > 0)
  2732.                 {
  2733.                     NPC npc = npcArray[class30_sub2_sub4_sub4.anInt1590 - 1];
  2734.                     if(npc != null && npc.x >= 0 && npc.x < 13312 && npc.y >= 0 && npc.y < 13312)
  2735.                         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);
  2736.                 }
  2737.                 if(class30_sub2_sub4_sub4.anInt1590 < 0)
  2738.                 {
  2739.                     int j = -class30_sub2_sub4_sub4.anInt1590 - 1;
  2740.                     Player player;
  2741.                     if(j == unknownInt10)
  2742.                         player = myPlayer;
  2743.                     else
  2744.                         player = playerArray[j];
  2745.                     if(player != null && player.x >= 0 && player.x < 13312 && player.y >= 0 && player.y < 13312)
  2746.                         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);
  2747.                 }
  2748.                 class30_sub2_sub4_sub4.method456(anInt945);
  2749.                 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);
  2750.             }
  2751.  
  2752.     }
  2753.  
  2754.     public AppletContext getAppletContext()
  2755.     {
  2756.         if(signlink.mainapp != null)
  2757.             return signlink.mainapp.getAppletContext();
  2758.         else
  2759.             return super.getAppletContext();
  2760.     }
  2761.  
  2762.     private void drawLogo() {
  2763.         byte abyte0[] = titleStreamLoader.getDataForName("title.dat");
  2764.         Sprite sprite = new Sprite(abyte0, this);
  2765.         aRSImageProducer_1110.initDrawingArea();
  2766.         sprite.method346(0, 0);
  2767.         aRSImageProducer_1111.initDrawingArea();
  2768.         sprite.method346(-637, 0);
  2769.         aRSImageProducer_1107.initDrawingArea();
  2770.         sprite.method346(-128, 0);
  2771.         aRSImageProducer_1108.initDrawingArea();
  2772.         sprite.method346(-202, -371);
  2773.         aRSImageProducer_1109.initDrawingArea();
  2774.         sprite.method346(-202, -171);
  2775.         aRSImageProducer_1112.initDrawingArea();
  2776.         sprite.method346(0, -265);
  2777.         aRSImageProducer_1113.initDrawingArea();
  2778.         sprite.method346(-562, -265);
  2779.         aRSImageProducer_1114.initDrawingArea();
  2780.         sprite.method346(-128, -171);
  2781.         aRSImageProducer_1115.initDrawingArea();
  2782.         sprite.method346(-562, -171);
  2783.         int ai[] = new int[sprite.myWidth];
  2784.         for(int j = 0; j < sprite.myHeight; j++) {
  2785.             for(int k = 0; k < sprite.myWidth; k++)
  2786.                 ai[k] = sprite.myPixels[(sprite.myWidth - k - 1) + sprite.myWidth * j];
  2787.  
  2788.             System.arraycopy(ai, 0, sprite.myPixels, sprite.myWidth * j, sprite.myWidth);
  2789.         }
  2790.         aRSImageProducer_1110.initDrawingArea();
  2791.         sprite.method346(382, 0);
  2792.         aRSImageProducer_1111.initDrawingArea();
  2793.         sprite.method346(-255, 0);
  2794.         aRSImageProducer_1107.initDrawingArea();
  2795.         sprite.method346(254, 0);
  2796.         aRSImageProducer_1108.initDrawingArea();
  2797.         sprite.method346(180, -371);
  2798.         aRSImageProducer_1109.initDrawingArea();
  2799.         sprite.method346(180, -171);
  2800.         aRSImageProducer_1112.initDrawingArea();
  2801.         sprite.method346(382, -265);
  2802.         aRSImageProducer_1113.initDrawingArea();
  2803.         sprite.method346(-180, -265);
  2804.         aRSImageProducer_1114.initDrawingArea();
  2805.         sprite.method346(254, -171);
  2806.         aRSImageProducer_1115.initDrawingArea();
  2807.         sprite.method346(-180, -171);
  2808.         sprite = new Sprite(titleStreamLoader, "logo", 0);
  2809.         aRSImageProducer_1107.initDrawingArea();
  2810.         //sprite.drawSprite(382 - sprite.myWidth / 2 - 128, 18);
  2811.         sprite = null;
  2812.         Object obj = null;
  2813.         Object obj1 = null;
  2814.         System.gc();
  2815.     }
  2816.  
  2817.     private void processOnDemandQueue()
  2818.     {
  2819.         do
  2820.         {
  2821.             OnDemandData onDemandData;
  2822.             do
  2823.             {
  2824.                 onDemandData = onDemandFetcher.getNextNode();
  2825.                 if(onDemandData == null)
  2826.                     return;
  2827.                 if(onDemandData.dataType == 0)
  2828.                 {
  2829.                     Model.method460(onDemandData.buffer, onDemandData.ID);
  2830.                     if((onDemandFetcher.getModelIndex(onDemandData.ID) & 0x62) != 0)
  2831.                     {
  2832.                         needDrawTabArea = true;
  2833.                         if(backDialogID != -1)
  2834.                             inputTaken = true;
  2835.                     }
  2836.                 }
  2837.                 if(onDemandData.dataType == 1 && onDemandData.buffer != null)
  2838.                     Class36.method529(onDemandData.buffer);
  2839.                 if(onDemandData.dataType == 2 && onDemandData.ID == nextSong && onDemandData.buffer != null)
  2840.                     saveMidi(songChanging, onDemandData.buffer);
  2841.                 if(onDemandData.dataType == 3 && loadingStage == 1)
  2842.                 {
  2843.                     for(int i = 0; i < aByteArrayArray1183.length; i++)
  2844.                     {
  2845.                         if(anIntArray1235[i] == onDemandData.ID)
  2846.                         {
  2847.                             aByteArrayArray1183[i] = onDemandData.buffer;
  2848.                             if(onDemandData.buffer == null)
  2849.                                 anIntArray1235[i] = -1;
  2850.                             break;
  2851.                         }
  2852.                         if(anIntArray1236[i] != onDemandData.ID)
  2853.                             continue;
  2854.                         aByteArrayArray1247[i] = onDemandData.buffer;
  2855.                         if(onDemandData.buffer == null)
  2856.                             anIntArray1236[i] = -1;
  2857.                         break;
  2858.                     }
  2859.  
  2860.                 }
  2861.             } while(onDemandData.dataType != 93 || !onDemandFetcher.method564(onDemandData.ID));
  2862.             ObjectManager.method173(new Stream(onDemandData.buffer), onDemandFetcher);
  2863.         } while(true);
  2864.     }
  2865.  
  2866.     private void calcFlamesPosition()
  2867.     {
  2868.         char c = '\u0100';
  2869.         for(int j = 10; j < 117; j++)
  2870.         {
  2871.             int k = (int)(Math.random() * 100D);
  2872.             if(k < 50)
  2873.                 anIntArray828[j + (c - 2 << 7)] = 255;
  2874.         }
  2875.         for(int l = 0; l < 100; l++)
  2876.         {
  2877.             int i1 = (int)(Math.random() * 124D) + 2;
  2878.             int k1 = (int)(Math.random() * 128D) + 128;
  2879.             int k2 = i1 + (k1 << 7);
  2880.             anIntArray828[k2] = 192;
  2881.         }
  2882.  
  2883.         for(int j1 = 1; j1 < c - 1; j1++)
  2884.         {
  2885.             for(int l1 = 1; l1 < 127; l1++)
  2886.             {
  2887.                 int l2 = l1 + (j1 << 7);
  2888.                 anIntArray829[l2] = (anIntArray828[l2 - 1] + anIntArray828[l2 + 1] + anIntArray828[l2 - 128] + anIntArray828[l2 + 128]) / 4;
  2889.             }
  2890.  
  2891.         }
  2892.  
  2893.         anInt1275 += 128;
  2894.         if(anInt1275 > anIntArray1190.length)
  2895.         {
  2896.             anInt1275 -= anIntArray1190.length;
  2897.             int i2 = (int)(Math.random() * 12D);
  2898.             randomizeBackground(aBackgroundArray1152s[i2]);
  2899.         }
  2900.         for(int j2 = 1; j2 < c - 1; j2++)
  2901.         {
  2902.             for(int i3 = 1; i3 < 127; i3++)
  2903.             {
  2904.                 int k3 = i3 + (j2 << 7);
  2905.                 int i4 = anIntArray829[k3 + 128] - anIntArray1190[k3 + anInt1275 & anIntArray1190.length - 1] / 5;
  2906.                 if(i4 < 0)
  2907.                     i4 = 0;
  2908.                 anIntArray828[k3] = i4;
  2909.             }
  2910.  
  2911.         }
  2912.  
  2913.         System.arraycopy(anIntArray969, 1, anIntArray969, 0, c - 1);
  2914.  
  2915.         anIntArray969[c - 1] = (int)(Math.sin((double)loopCycle / 14D) * 16D + Math.sin((double)loopCycle / 15D) * 14D + Math.sin((double)loopCycle / 16D) * 12D);
  2916.         if(anInt1040 > 0)
  2917.             anInt1040 -= 4;
  2918.         if(anInt1041 > 0)
  2919.             anInt1041 -= 4;
  2920.         if(anInt1040 == 0 && anInt1041 == 0)
  2921.         {
  2922.             int l3 = (int)(Math.random() * 2000D);
  2923.             if(l3 == 0)
  2924.                 anInt1040 = 1024;
  2925.             if(l3 == 1)
  2926.                 anInt1041 = 1024;
  2927.         }
  2928.     }
  2929.  
  2930.     private boolean saveWave(byte abyte0[], int i)
  2931.     {
  2932.         return abyte0 == null || signlink.wavesave(abyte0, i);
  2933.     }
  2934.  
  2935.     private void method60(int i)
  2936.     {
  2937.         RSInterface class9 = RSInterface.interfaceCache[i];
  2938.         for(int j = 0; j < class9.children.length; j++)
  2939.         {
  2940.             if(class9.children[j] == -1)
  2941.                 break;
  2942.             RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j]];
  2943.             if(class9_1.type == 1)
  2944.                 method60(class9_1.id);
  2945.             class9_1.anInt246 = 0;
  2946.             class9_1.anInt208 = 0;
  2947.         }
  2948.     }
  2949.  
  2950.     private void drawHeadIcon()
  2951.     {
  2952.         if(anInt855 != 2)
  2953.             return;
  2954.         calcEntityScreenPos((anInt934 - baseX << 7) + anInt937, anInt936 * 2, (anInt935 - baseY << 7) + anInt938);
  2955.         if(spriteDrawX > -1 && loopCycle % 20 < 10)
  2956.             headIconsHint[0].drawSprite(spriteDrawX - 12, spriteDrawY - 28);
  2957.     }
  2958.  
  2959.     private void mainGameProcessor()
  2960.     {
  2961.         if(anInt1104 > 1)
  2962.             anInt1104--;
  2963.         if(anInt1011 > 0)
  2964.             anInt1011--;
  2965.         for(int j = 0; j < 5; j++)
  2966.             if(!parsePacket())
  2967.                 break;
  2968.  
  2969.         if(!loggedIn)
  2970.             return;
  2971.         synchronized(mouseDetection.syncObject)
  2972.         {
  2973.             if(flagged)
  2974.             {
  2975.                 if(super.clickMode3 != 0 || mouseDetection.coordsIndex >= 40)
  2976.                 {
  2977.                     stream.createFrame(45);
  2978.                     stream.writeWordBigEndian(0);
  2979.                     int j2 = stream.currentOffset;
  2980.                     int j3 = 0;
  2981.                     for(int j4 = 0; j4 < mouseDetection.coordsIndex; j4++)
  2982.                     {
  2983.                         if(j2 - stream.currentOffset >= 240)
  2984.                             break;
  2985.                         j3++;
  2986.                         int l4 = mouseDetection.coordsY[j4];
  2987.                         if(l4 < 0)
  2988.                             l4 = 0;
  2989.                         else
  2990.                         if(l4 > 502)
  2991.                             l4 = 502;
  2992.                         int k5 = mouseDetection.coordsX[j4];
  2993.                         if(k5 < 0)
  2994.                             k5 = 0;
  2995.                         else
  2996.                         if(k5 > 764)
  2997.                             k5 = 764;
  2998.                         int i6 = l4 * 765 + k5;
  2999.                         if(mouseDetection.coordsY[j4] == -1 && mouseDetection.coordsX[j4] == -1)
  3000.                         {
  3001.                             k5 = -1;
  3002.                             l4 = -1;
  3003.                             i6 = 0x7ffff;
  3004.                         }
  3005.                         if(k5 == anInt1237 && l4 == anInt1238)
  3006.                         {
  3007.                             if(anInt1022 < 2047)
  3008.                                 anInt1022++;
  3009.                         } else
  3010.                         {
  3011.                             int j6 = k5 - anInt1237;
  3012.                             anInt1237 = k5;
  3013.                             int k6 = l4 - anInt1238;
  3014.                             anInt1238 = l4;
  3015.                             if(anInt1022 < 8 && j6 >= -32 && j6 <= 31 && k6 >= -32 && k6 <= 31)
  3016.                             {
  3017.                                 j6 += 32;
  3018.                                 k6 += 32;
  3019.                                 stream.writeWord((anInt1022 << 12) + (j6 << 6) + k6);
  3020.                                 anInt1022 = 0;
  3021.                             } else
  3022.                             if(anInt1022 < 8)
  3023.                             {
  3024.                                 stream.writeDWordBigEndian(0x800000 + (anInt1022 << 19) + i6);
  3025.                                 anInt1022 = 0;
  3026.                             } else
  3027.                             {
  3028.                                 stream.writeDWord(0xc0000000 + (anInt1022 << 19) + i6);
  3029.                                 anInt1022 = 0;
  3030.                             }
  3031.                         }
  3032.                     }
  3033.  
  3034.                     stream.writeBytes(stream.currentOffset - j2);
  3035.                     if(j3 >= mouseDetection.coordsIndex)
  3036.                     {
  3037.                         mouseDetection.coordsIndex = 0;
  3038.                     } else
  3039.                     {
  3040.                         mouseDetection.coordsIndex -= j3;
  3041.                         for(int i5 = 0; i5 < mouseDetection.coordsIndex; i5++)
  3042.                         {
  3043.                             mouseDetection.coordsX[i5] = mouseDetection.coordsX[i5 + j3];
  3044.                             mouseDetection.coordsY[i5] = mouseDetection.coordsY[i5 + j3];
  3045.                         }
  3046.  
  3047.                     }
  3048.                 }
  3049.             } else
  3050.             {
  3051.                 mouseDetection.coordsIndex = 0;
  3052.             }
  3053.         }
  3054.         if(super.clickMode3 != 0)
  3055.         {
  3056.             long l = (super.aLong29 - aLong1220) / 50L;
  3057.             if(l > 4095L)
  3058.                 l = 4095L;
  3059.             aLong1220 = super.aLong29;
  3060.             int k2 = super.saveClickY;
  3061.             if(k2 < 0)
  3062.                 k2 = 0;
  3063.             else
  3064.             if(k2 > 502)
  3065.                 k2 = 502;
  3066.             int k3 = super.saveClickX;
  3067.             if(k3 < 0)
  3068.                 k3 = 0;
  3069.             else
  3070.             if(k3 > 764)
  3071.                 k3 = 764;
  3072.             int k4 = k2 * 765 + k3;
  3073.             int j5 = 0;
  3074.             if(super.clickMode3 == 2)
  3075.                 j5 = 1;
  3076.             int l5 = (int)l;
  3077.             stream.createFrame(241);
  3078.             stream.writeDWord((l5 << 20) + (j5 << 19) + k4);
  3079.         }
  3080.         if(anInt1016 > 0)
  3081.             anInt1016--;
  3082.         if(super.keyArray[1] == 1 || super.keyArray[2] == 1 || super.keyArray[3] == 1 || super.keyArray[4] == 1)
  3083.             aBoolean1017 = true;
  3084.         if(aBoolean1017 && anInt1016 <= 0)
  3085.         {
  3086.             anInt1016 = 20;
  3087.             aBoolean1017 = false;
  3088.             stream.createFrame(86);
  3089.             stream.writeWord(anInt1184);
  3090.             stream.method432(minimapInt1);
  3091.         }
  3092.         if(super.awtFocus && !aBoolean954)
  3093.         {
  3094.             aBoolean954 = true;
  3095.             stream.createFrame(3);
  3096.             stream.writeWordBigEndian(1);
  3097.         }
  3098.         if(!super.awtFocus && aBoolean954)
  3099.         {
  3100.             aBoolean954 = false;
  3101.             stream.createFrame(3);
  3102.             stream.writeWordBigEndian(0);
  3103.         }
  3104.         loadingStages();
  3105.         method115();
  3106.         method90();
  3107.         anInt1009++;
  3108.         if(anInt1009 > 750)
  3109.             dropClient();
  3110.         method114();
  3111.         method95();
  3112.         method38();
  3113.         anInt945++;
  3114.         if(crossType != 0)
  3115.         {
  3116.             crossIndex += 20;
  3117.             if(crossIndex >= 400)
  3118.                 crossType = 0;
  3119.         }
  3120.         if(atInventoryInterfaceType != 0)
  3121.         {
  3122.             atInventoryLoopCycle++;
  3123.             if(atInventoryLoopCycle >= 15)
  3124.             {
  3125.                 if(atInventoryInterfaceType == 2)
  3126.                     needDrawTabArea = true;
  3127.                 if(atInventoryInterfaceType == 3)
  3128.                     inputTaken = true;
  3129.                 atInventoryInterfaceType = 0;
  3130.             }
  3131.         }
  3132.         if(activeInterfaceType != 0)
  3133.         {
  3134.             anInt989++;
  3135.             if(super.mouseX > anInt1087 + 5 || super.mouseX < anInt1087 - 5 || super.mouseY > anInt1088 + 5 || super.mouseY < anInt1088 - 5)
  3136.                 aBoolean1242 = true;
  3137.             if(super.clickMode2 == 0)
  3138.             {
  3139.                 if(activeInterfaceType == 2)
  3140.                     needDrawTabArea = true;
  3141.                 if(activeInterfaceType == 3)
  3142.                     inputTaken = true;
  3143.                 activeInterfaceType = 0;
  3144.                 if(aBoolean1242 && anInt989 >= 5)
  3145.                 {
  3146.                     lastActiveInvInterface = -1;
  3147.                     processRightClick();
  3148.                     if(lastActiveInvInterface == anInt1084 && mouseInvInterfaceIndex != anInt1085)
  3149.                     {
  3150.                         RSInterface class9 = RSInterface.interfaceCache[anInt1084];
  3151.                         int j1 = 0;
  3152.                         if(anInt913 == 1 && class9.contentType == 206)
  3153.                             j1 = 1;
  3154.                         if(class9.inv[mouseInvInterfaceIndex] <= 0)
  3155.                             j1 = 0;
  3156.                         if(class9.aBoolean235)
  3157.                         {
  3158.                             int l2 = anInt1085;
  3159.                             int l3 = mouseInvInterfaceIndex;
  3160.                             class9.inv[l3] = class9.inv[l2];
  3161.                             class9.invStackSizes[l3] = class9.invStackSizes[l2];
  3162.                             class9.inv[l2] = -1;
  3163.                             class9.invStackSizes[l2] = 0;
  3164.                         } else
  3165.                         if(j1 == 1)
  3166.                         {
  3167.                             int i3 = anInt1085;
  3168.                             for(int i4 = mouseInvInterfaceIndex; i3 != i4;)
  3169.                                 if(i3 > i4)
  3170.                                 {
  3171.                                     class9.swapInventoryItems(i3, i3 - 1);
  3172.                                     i3--;
  3173.                                 } else
  3174.                                 if(i3 < i4)
  3175.                                 {
  3176.                                     class9.swapInventoryItems(i3, i3 + 1);
  3177.                                     i3++;
  3178.                                 }
  3179.  
  3180.                         } else
  3181.                         {
  3182.                             class9.swapInventoryItems(anInt1085, mouseInvInterfaceIndex);
  3183.                         }
  3184.                         stream.createFrame(214);
  3185.                         stream.method433(anInt1084);
  3186.                         stream.method424(j1);
  3187.                         stream.method433(anInt1085);
  3188.                         stream.method431(mouseInvInterfaceIndex);
  3189.                     }
  3190.                 } else
  3191.                 if((anInt1253 == 1 || menuHasAddFriend(menuActionRow - 1)) && menuActionRow > 2)
  3192.                     determineMenuSize();
  3193.                 else
  3194.                 if(menuActionRow > 0)
  3195.                     doAction(menuActionRow - 1);
  3196.                 atInventoryLoopCycle = 10;
  3197.                 super.clickMode3 = 0;
  3198.             }
  3199.         }
  3200.         if(WorldController.anInt470 != -1)
  3201.         {
  3202.             int k = WorldController.anInt470;
  3203.             int k1 = WorldController.anInt471;
  3204.             boolean flag = doWalkTo(0, 0, 0, 0, myPlayer.smallY[0], 0, 0, k1, myPlayer.smallX[0], true, k);
  3205.             WorldController.anInt470 = -1;
  3206.             if(flag)
  3207.             {
  3208.                 crossX = super.saveClickX;
  3209.                 crossY = super.saveClickY;
  3210.                 crossType = 1;
  3211.                 crossIndex = 0;
  3212.             }
  3213.         }
  3214.         if(super.clickMode3 == 1 && aString844 != null)
  3215.         {
  3216.             aString844 = null;
  3217.             inputTaken = true;
  3218.             super.clickMode3 = 0;
  3219.         }
  3220.         processMenuClick();
  3221.         processMainScreenClick();
  3222.         processTabClick();
  3223.         processChatModeClick();
  3224.         if(super.clickMode2 == 1 || super.clickMode3 == 1)
  3225.             anInt1213++;
  3226.         if (anInt1500 != 0 || anInt1044 != 0 || anInt1129 != 0) {
  3227.             if (anInt1501 < 100) {
  3228.                 anInt1501++;
  3229.                 if (anInt1501 == 100) {
  3230.                     if (anInt1500 != 0) {
  3231.                         inputTaken = true;
  3232.                     }
  3233.                     if (anInt1044 != 0) {
  3234.                         needDrawTabArea = true;
  3235.                     }
  3236.                 }
  3237.             }
  3238.         } else if (anInt1501 > 0) {
  3239.             anInt1501--;
  3240.         }
  3241.         if(loadingStage == 2)
  3242.             method108();
  3243.         if(loadingStage == 2 && aBoolean1160)
  3244.             calcCameraPos();
  3245.         for(int i1 = 0; i1 < 5; i1++)
  3246.             anIntArray1030[i1]++;
  3247.  
  3248.         method73();
  3249.         super.idleTime++;
  3250.         if(super.idleTime > 4500)
  3251.         {
  3252.             anInt1011 = 250;
  3253.             super.idleTime -= 500;
  3254.             stream.createFrame(202);
  3255.         }
  3256.         anInt988++;
  3257.         if(anInt988 > 500)
  3258.         {
  3259.             anInt988 = 0;
  3260.             int l1 = (int)(Math.random() * 8D);
  3261.             if((l1 & 1) == 1)
  3262.                 anInt1278 += anInt1279;
  3263.             if((l1 & 2) == 2)
  3264.                 anInt1131 += anInt1132;
  3265.             if((l1 & 4) == 4)
  3266.                 anInt896 += anInt897;
  3267.         }
  3268.         if(anInt1278 < -50)
  3269.             anInt1279 = 2;
  3270.         if(anInt1278 > 50)
  3271.             anInt1279 = -2;
  3272.         if(anInt1131 < -55)
  3273.             anInt1132 = 2;
  3274.         if(anInt1131 > 55)
  3275.             anInt1132 = -2;
  3276.         if(anInt896 < -40)
  3277.             anInt897 = 1;
  3278.         if(anInt896 > 40)
  3279.             anInt897 = -1;
  3280.         anInt1254++;
  3281.         if(anInt1254 > 500)
  3282.         {
  3283.             anInt1254 = 0;
  3284.             int i2 = (int)(Math.random() * 8D);
  3285.             if((i2 & 1) == 1)
  3286.                 minimapInt2 += anInt1210;
  3287.             if((i2 & 2) == 2)
  3288.                 minimapInt3 += anInt1171;
  3289.         }
  3290.         if(minimapInt2 < -60)
  3291.             anInt1210 = 2;
  3292.         if(minimapInt2 > 60)
  3293.             anInt1210 = -2;
  3294.         if(minimapInt3 < -20)
  3295.             anInt1171 = 1;
  3296.         if(minimapInt3 > 10)
  3297.             anInt1171 = -1;
  3298.         anInt1010++;
  3299.         if(anInt1010 > 50)
  3300.             stream.createFrame(0);
  3301.         try
  3302.         {
  3303.             if(socketStream != null && stream.currentOffset > 0)
  3304.             {
  3305.                 socketStream.queueBytes(stream.currentOffset, stream.buffer);
  3306.                 stream.currentOffset = 0;
  3307.                 anInt1010 = 0;
  3308.             }
  3309.         }
  3310.         catch(IOException _ex)
  3311.         {
  3312.             dropClient();
  3313.         }
  3314.         catch(Exception exception)
  3315.         {
  3316.             resetLogout();
  3317.         }
  3318.     }
  3319.  
  3320.     private void method63()
  3321.     {
  3322.         Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst();
  3323.         for(; class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  3324.             if(class30_sub1.anInt1294 == -1)
  3325.             {
  3326.                 class30_sub1.anInt1302 = 0;
  3327.                 method89(class30_sub1);
  3328.             } else
  3329.             {
  3330.                 class30_sub1.unlink();
  3331.             }
  3332.  
  3333.     }
  3334.  
  3335.     private void resetImageProducers()
  3336.     {
  3337.         if(aRSImageProducer_1107 != null)
  3338.             return;
  3339.         super.fullGameScreen = null;
  3340.         aRSImageProducer_1166 = null;
  3341.         aRSImageProducer_1164 = null;
  3342.         aRSImageProducer_1163 = null;
  3343.         aRSImageProducer_1165 = null;
  3344.         aRSImageProducer_1123 = null;
  3345.         aRSImageProducer_1124 = null;
  3346.         aRSImageProducer_1125 = null;
  3347.         aRSImageProducer_1110 = new RSImageProducer(128, 265, getGameComponent());
  3348.         DrawingArea.setAllPixelsToZero();
  3349.         aRSImageProducer_1111 = new RSImageProducer(128, 265, getGameComponent());
  3350.         DrawingArea.setAllPixelsToZero();
  3351.         aRSImageProducer_1107 = new RSImageProducer(509, 171, getGameComponent());
  3352.         DrawingArea.setAllPixelsToZero();
  3353.         aRSImageProducer_1108 = new RSImageProducer(360, 132, getGameComponent());
  3354.         DrawingArea.setAllPixelsToZero();
  3355.         aRSImageProducer_1109 = new RSImageProducer(360, 200, getGameComponent());
  3356.         DrawingArea.setAllPixelsToZero();
  3357.         aRSImageProducer_1112 = new RSImageProducer(202, 238, getGameComponent());
  3358.         DrawingArea.setAllPixelsToZero();
  3359.         aRSImageProducer_1113 = new RSImageProducer(203, 238, getGameComponent());
  3360.         DrawingArea.setAllPixelsToZero();
  3361.         aRSImageProducer_1114 = new RSImageProducer(74, 94, getGameComponent());
  3362.         DrawingArea.setAllPixelsToZero();
  3363.         aRSImageProducer_1115 = new RSImageProducer(75, 94, getGameComponent());
  3364.         DrawingArea.setAllPixelsToZero();
  3365.         if(titleStreamLoader != null)
  3366.         {
  3367.             drawLogo();
  3368.             loadTitleScreen();
  3369.         }
  3370.         welcomeScreenRaised = true;
  3371.     }
  3372.  
  3373.     void drawLoadingText(int i, String s)
  3374.     {
  3375.         anInt1079 = i;
  3376.         aString1049 = s;
  3377.         resetImageProducers();
  3378.         if(titleStreamLoader == null) {
  3379.             super.drawLoadingText(i, s);
  3380.             return;
  3381.         }
  3382.         aRSImageProducer_1109.initDrawingArea();
  3383.         loadingBarEmpty = new Sprite("empty");
  3384.         loadingBarFull = new Sprite("full");
  3385.         char c = '\u0168';
  3386.         char c1 = '\310';
  3387.         byte byte1 = 20;
  3388.         int j = c1 / 2 - 18 - byte1;
  3389.         loadingBarEmpty.drawSprite(20, 60);
  3390.         loadingBarFull.drawSprite(86, 84);
  3391.         DrawingArea.drawPixels(13, 84, (86 + i), 0x302e2c, (194 - i));
  3392.         if (i == 194) {
  3393.             smallText.drawText(0xffffff, s + " - 100%", 76, 180);
  3394.         } else {
  3395.             smallText.drawText(0xffffff, s + " - " + (i/2) + "%", 76, 180);
  3396.         }
  3397.         aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  3398.         if(welcomeScreenRaised) {
  3399.             welcomeScreenRaised = false;
  3400.             if(!aBoolean831) {
  3401.                 aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  3402.                 aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  3403.             }
  3404.             aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  3405.             aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  3406.             aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  3407.             aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  3408.             aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  3409.             aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  3410.         }
  3411.     }
  3412.  
  3413.     private void method65(int i, int j, int k, int l, RSInterface class9, int i1, boolean flag,
  3414.                           int j1)
  3415.     {
  3416.         int anInt992;
  3417.         if(aBoolean972)
  3418.             anInt992 = 32;
  3419.         else
  3420.             anInt992 = 0;
  3421.         aBoolean972 = false;
  3422.         if(k >= i && k < i + 16 && l >= i1 && l < i1 + 16)
  3423.         {
  3424.             class9.scrollPosition -= anInt1213 * 4;
  3425.             if(flag)
  3426.             {
  3427.                 needDrawTabArea = true;
  3428.             }
  3429.         } else
  3430.         if(k >= i && k < i + 16 && l >= (i1 + j) - 16 && l < i1 + j)
  3431.         {
  3432.             class9.scrollPosition += anInt1213 * 4;
  3433.             if(flag)
  3434.             {
  3435.                 needDrawTabArea = true;
  3436.             }
  3437.         } else
  3438.         if(k >= i - anInt992 && k < i + 16 + anInt992 && l >= i1 + 16 && l < (i1 + j) - 16 && anInt1213 > 0)
  3439.         {
  3440.             int l1 = ((j - 32) * j) / j1;
  3441.             if(l1 < 8)
  3442.                 l1 = 8;
  3443.             int i2 = l - i1 - 16 - l1 / 2;
  3444.             int j2 = j - 32 - l1;
  3445.             class9.scrollPosition = ((j1 - j) * i2) / j2;
  3446.             if(flag)
  3447.                 needDrawTabArea = true;
  3448.             aBoolean972 = true;
  3449.         }
  3450.     }
  3451.  
  3452.     private boolean method66(int i, int j, int k)
  3453.     {
  3454.         int i1 = i >> 14 & 0x7fff;
  3455.         int j1 = worldController.method304(plane, k, j, i);
  3456.         if(j1 == -1)
  3457.             return false;
  3458.         int k1 = j1 & 0x1f;
  3459.         int l1 = j1 >> 6 & 3;
  3460.         if(k1 == 10 || k1 == 11 || k1 == 22)
  3461.         {
  3462.             ObjectDef class46 = ObjectDef.forID(i1);
  3463.             int i2;
  3464.             int j2;
  3465.             if(l1 == 0 || l1 == 2)
  3466.             {
  3467.                 i2 = class46.anInt744;
  3468.                 j2 = class46.anInt761;
  3469.             } else
  3470.             {
  3471.                 i2 = class46.anInt761;
  3472.                 j2 = class46.anInt744;
  3473.             }
  3474.             int k2 = class46.anInt768;
  3475.             if(l1 != 0)
  3476.                 k2 = (k2 << l1 & 0xf) + (k2 >> 4 - l1);
  3477.             doWalkTo(2, 0, j2, 0, myPlayer.smallY[0], i2, k2, j, myPlayer.smallX[0], false, k);
  3478.         } else
  3479.         {
  3480.             doWalkTo(2, l1, 0, k1 + 1, myPlayer.smallY[0], 0, 0, j, myPlayer.smallX[0], false, k);
  3481.         }
  3482.         crossX = super.saveClickX;
  3483.         crossY = super.saveClickY;
  3484.         crossType = 2;
  3485.         crossIndex = 0;
  3486.         return true;
  3487.     }
  3488.  
  3489.     private StreamLoader streamLoaderForName(int i, String s, String s1, int j, int k)
  3490.     {
  3491.         byte abyte0[] = null;
  3492.         int l = 5;
  3493.         try
  3494.         {
  3495.             if(decompressors[0] != null)
  3496.                 abyte0 = decompressors[0].decompress(i);
  3497.         }
  3498.         catch(Exception _ex) { }
  3499.         if(abyte0 != null)
  3500.         {
  3501.     //      aCRC32_930.reset();
  3502.     //      aCRC32_930.update(abyte0);
  3503.     //      int i1 = (int)aCRC32_930.getValue();
  3504.     //      if(i1 != j)
  3505.         }
  3506.         if(abyte0 != null)
  3507.         {
  3508.             StreamLoader streamLoader = new StreamLoader(abyte0);
  3509.             return streamLoader;
  3510.         }
  3511.         int j1 = 0;
  3512.         while(abyte0 == null)
  3513.         {
  3514.             String s2 = "Unknown error";
  3515.             drawLoadingText(k, "Requesting " + s);
  3516.             Object obj = null;
  3517.             try
  3518.             {
  3519.                 int k1 = 0;
  3520.                 DataInputStream datainputstream = openJagGrabInputStream(s1 + j);
  3521.                 byte abyte1[] = new byte[6];
  3522.                 datainputstream.readFully(abyte1, 0, 6);
  3523.                 Stream stream = new Stream(abyte1);
  3524.                 stream.currentOffset = 3;
  3525.                 int i2 = stream.read3Bytes() + 6;
  3526.                 int j2 = 6;
  3527.                 abyte0 = new byte[i2];
  3528.                 System.arraycopy(abyte1, 0, abyte0, 0, 6);
  3529.  
  3530.                 while(j2 < i2)
  3531.                 {
  3532.                     int l2 = i2 - j2;
  3533.                     if(l2 > 1000)
  3534.                         l2 = 1000;
  3535.                     int j3 = datainputstream.read(abyte0, j2, l2);
  3536.                     if(j3 < 0)
  3537.                     {
  3538.                         s2 = "Length error: " + j2 + "/" + i2;
  3539.                         throw new IOException("EOF");
  3540.                     }
  3541.                     j2 += j3;
  3542.                     int k3 = (j2 * 100) / i2;
  3543.                     if(k3 != k1)
  3544.                         drawLoadingText(k, "Loading " + s + " - " + k3 + "%");
  3545.                     k1 = k3;
  3546.                 }
  3547.                 datainputstream.close();
  3548.                 try
  3549.                 {
  3550.                     if(decompressors[0] != null)
  3551.                         decompressors[0].method234(abyte0.length, abyte0, i);
  3552.                 }
  3553.                 catch(Exception _ex)
  3554.                 {
  3555.                     decompressors[0] = null;
  3556.                 }
  3557.    /*            if(abyte0 != null)
  3558.                 {
  3559.                     aCRC32_930.reset();
  3560.                     aCRC32_930.update(abyte0);
  3561.                     int i3 = (int)aCRC32_930.getValue();
  3562.                     if(i3 != j)
  3563.                     {
  3564.                         abyte0 = null;
  3565.                         j1++;
  3566.                         s2 = "Checksum error: " + i3;
  3567.                     }
  3568.                 }
  3569.   */
  3570.             }
  3571.             catch(IOException ioexception)
  3572.             {
  3573.                 if(s2.equals("Unknown error"))
  3574.                     s2 = "Connection error";
  3575.                 abyte0 = null;
  3576.             }
  3577.             catch(NullPointerException _ex)
  3578.             {
  3579.                 s2 = "Null error";
  3580.                 abyte0 = null;
  3581.                 if(!signlink.reporterror)
  3582.                     return null;
  3583.             }
  3584.             catch(ArrayIndexOutOfBoundsException _ex)
  3585.             {
  3586.                 s2 = "Bounds error";
  3587.                 abyte0 = null;
  3588.                 if(!signlink.reporterror)
  3589.                     return null;
  3590.             }
  3591.             catch(Exception _ex)
  3592.             {
  3593.                 s2 = "Unexpected error";
  3594.                 abyte0 = null;
  3595.                 if(!signlink.reporterror)
  3596.                     return null;
  3597.             }
  3598.             if(abyte0 == null)
  3599.             {
  3600.                 for(int l1 = l; l1 > 0; l1--)
  3601.                 {
  3602.                     if(j1 >= 3)
  3603.                     {
  3604.                         drawLoadingText(k, "Game updated - please reload page");
  3605.                         l1 = 10;
  3606.                     } else
  3607.                     {
  3608.                         drawLoadingText(k, s2 + " - Retrying in " + l1);
  3609.                     }
  3610.                     try
  3611.                     {
  3612.                         Thread.sleep(1000L);
  3613.                     }
  3614.                     catch(Exception _ex) { }
  3615.                 }
  3616.  
  3617.                 l *= 2;
  3618.                 if(l > 60)
  3619.                     l = 60;
  3620.                 aBoolean872 = !aBoolean872;
  3621.             }
  3622.  
  3623.         }
  3624.  
  3625.         StreamLoader streamLoader_1 = new StreamLoader(abyte0);
  3626.             return streamLoader_1;
  3627.     }
  3628.  
  3629.     private void dropClient()
  3630.     {
  3631.         if(anInt1011 > 0)
  3632.         {
  3633.             resetLogout();
  3634.             return;
  3635.         }
  3636.         aRSImageProducer_1165.initDrawingArea();
  3637.         aTextDrawingArea_1271.drawText(0, "Connection lost", 144, 257);
  3638.         aTextDrawingArea_1271.drawText(0xffffff, "Connection lost", 143, 256);
  3639.         aTextDrawingArea_1271.drawText(0, "Please wait - attempting to reestablish", 159, 257);
  3640.         aTextDrawingArea_1271.drawText(0xffffff, "Please wait - attempting to reestablish", 158, 256);
  3641.         aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  3642.         anInt1021 = 0;
  3643.         destX = 0;
  3644.         RSSocket rsSocket = socketStream;
  3645.         loggedIn = false;
  3646.         loginFailures = 0;
  3647.         login(myUsername, myPassword, true);
  3648.         if(!loggedIn)
  3649.             resetLogout();
  3650.         try
  3651.         {
  3652.             rsSocket.close();
  3653.         }
  3654.         catch(Exception _ex)
  3655.         {
  3656.         }
  3657.     }
  3658.  
  3659.     private void doAction(int i)
  3660.     {
  3661.         if(i < 0)
  3662.             return;
  3663.         if(inputDialogState != 0)
  3664.         {
  3665.             inputDialogState = 0;
  3666.             inputTaken = true;
  3667.         }
  3668.         int j = menuActionCmd2[i];
  3669.         int k = menuActionCmd3[i];
  3670.         int l = menuActionID[i];
  3671.         int i1 = menuActionCmd1[i];
  3672.         if(l >= 2000)
  3673.             l -= 2000;
  3674.         if(l == 582)
  3675.         {
  3676.             NPC npc = npcArray[i1];
  3677.             if(npc != null)
  3678.             {
  3679.                 doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, npc.smallY[0], myPlayer.smallX[0], false, npc.smallX[0]);
  3680.                 crossX = super.saveClickX;
  3681.                 crossY = super.saveClickY;
  3682.                 crossType = 2;
  3683.                 crossIndex = 0;
  3684.                 stream.createFrame(57);
  3685.                 stream.method432(anInt1285);
  3686.                 stream.method432(i1);
  3687.                 stream.method431(anInt1283);
  3688.                 stream.method432(anInt1284);
  3689.             }
  3690.         }
  3691.         if(l == 234)
  3692.         {
  3693.             boolean flag1 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3694.             if(!flag1)
  3695.                 flag1 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3696.             crossX = super.saveClickX;
  3697.             crossY = super.saveClickY;
  3698.             crossType = 2;
  3699.             crossIndex = 0;
  3700.             stream.createFrame(236);
  3701.             stream.method431(k + baseY);
  3702.             stream.writeWord(i1);
  3703.             stream.method431(j + baseX);
  3704.         }
  3705.         if(l == 62 && method66(i1, k, j))
  3706.         {
  3707.             stream.createFrame(192);
  3708.             stream.writeWord(anInt1284);
  3709.             stream.method431(i1 >> 14 & 0x7fff);
  3710.             stream.method433(k + baseY);
  3711.             stream.method431(anInt1283);
  3712.             stream.method433(j + baseX);
  3713.             stream.writeWord(anInt1285);
  3714.         }
  3715.         if(l == 511)
  3716.         {
  3717.             boolean flag2 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  3718.             if(!flag2)
  3719.                 flag2 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  3720.             crossX = super.saveClickX;
  3721.             crossY = super.saveClickY;
  3722.             crossType = 2;
  3723.             crossIndex = 0;
  3724.             stream.createFrame(25);
  3725.             stream.method431(anInt1284);
  3726.             stream.method432(anInt1285);
  3727.             stream.writeWord(i1);
  3728.             stream.method432(k + baseY);
  3729.             stream.method433(anInt1283);
  3730.             stream.writeWord(j + baseX);
  3731.         }
  3732.         if(l == 74)
  3733.         {
  3734.             stream.createFrame(122);
  3735.             stream.method433(k);
  3736.             stream.method432(j);
  3737.             stream.method431(i1);
  3738.             atInventoryLoopCycle = 0;
  3739.             atInventoryInterface = k;
  3740.             atInventoryIndex = j;
  3741.             atInventoryInterfaceType = 2;
  3742.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3743.                 atInventoryInterfaceType = 1;
  3744.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3745.                 atInventoryInterfaceType = 3;
  3746.         }
  3747.         if (l == 315) {
  3748.             RSInterface class9 = RSInterface.interfaceCache[k];
  3749.             boolean flag8 = true;
  3750.             if (class9.contentType > 0)
  3751.                 flag8 = promptUserForInput(class9);
  3752.             if (flag8) {
  3753.                
  3754.                 switch(k){
  3755.                     case 19144:
  3756.                         sendFrame248(15106,3213);
  3757.                         method60(15106);
  3758.                         inputTaken = true;
  3759.                         break;
  3760.                     default:
  3761.                         stream.createFrame(185);
  3762.                         stream.writeWord(k);
  3763.                         break;
  3764.                    
  3765.                 }
  3766.             }
  3767.         }
  3768.         if(l == 561)
  3769.         {
  3770.             Player player = playerArray[i1];
  3771.             if(player != null)
  3772.             {
  3773.                 doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, player.smallY[0], myPlayer.smallX[0], false, player.smallX[0]);
  3774.                 crossX = super.saveClickX;
  3775.                 crossY = super.saveClickY;
  3776.                 crossType = 2;
  3777.                 crossIndex = 0;
  3778.                 anInt1188 += i1;
  3779.                 if(anInt1188 >= 90)
  3780.                 {
  3781.                     stream.createFrame(136);
  3782.                     anInt1188 = 0;
  3783.                 }
  3784.                 stream.createFrame(128);
  3785.                 stream.writeWord(i1);
  3786.             }
  3787.         }
  3788.         if(l == 20)
  3789.         {
  3790.             NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[i1];
  3791.             if(class30_sub2_sub4_sub1_sub1_1 != null)
  3792.             {
  3793.                 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]);
  3794.                 crossX = super.saveClickX;
  3795.                 crossY = super.saveClickY;
  3796.                 crossType = 2;
  3797.                 crossIndex = 0;
  3798.                 stream.createFrame(155);
  3799.                 stream.method431(i1);
  3800.             }
  3801.         }
  3802.         if(l == 779)
  3803.         {
  3804.             Player class30_sub2_sub4_sub1_sub2_1 = playerArray[i1];
  3805.             if(class30_sub2_sub4_sub1_sub2_1 != null)
  3806.             {
  3807.                 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]);
  3808.                 crossX = super.saveClickX;
  3809.                 crossY = super.saveClickY;
  3810.                 crossType = 2;
  3811.                 crossIndex = 0;
  3812.                 stream.createFrame(153);
  3813.                 stream.method431(i1);
  3814.             }
  3815.         }
  3816.         if(l == 516)
  3817.             if(!menuOpen)
  3818.                 worldController.method312(super.saveClickY - 4, super.saveClickX - 4);
  3819.             else
  3820.                 worldController.method312(k - 4, j - 4);
  3821.         if(l == 1062)
  3822.         {
  3823.             anInt924 += baseX;
  3824.             if(anInt924 >= 113)
  3825.             {
  3826.                 stream.createFrame(183);
  3827.                 stream.writeDWordBigEndian(0xe63271);
  3828.                 anInt924 = 0;
  3829.             }
  3830.             method66(i1, k, j);
  3831.             stream.createFrame(228);
  3832.             stream.method432(i1 >> 14 & 0x7fff);
  3833.             stream.method432(k + baseY);
  3834.             stream.writeWord(j + baseX);
  3835.         }
  3836.         if(l == 679 && !aBoolean1149)
  3837.         {
  3838.             stream.createFrame(40);
  3839.             stream.writeWord(k);
  3840.             aBoolean1149 = true;
  3841.         }
  3842.         if(l == 431)
  3843.         {
  3844.             stream.createFrame(129);
  3845.             stream.method432(j);
  3846.             stream.writeWord(k);
  3847.             stream.method432(i1);
  3848.             atInventoryLoopCycle = 0;
  3849.             atInventoryInterface = k;
  3850.             atInventoryIndex = j;
  3851.             atInventoryInterfaceType = 2;
  3852.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3853.                 atInventoryInterfaceType = 1;
  3854.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3855.                 atInventoryInterfaceType = 3;
  3856.         }
  3857.         if(l == 337 || l == 42 || l == 792 || l == 322)
  3858.         {
  3859.             String s = menuActionName[i];
  3860.             int k1 = s.indexOf("@whi@");
  3861.             if(k1 != -1)
  3862.             {
  3863.                 long l3 = TextClass.longForName(s.substring(k1 + 5).trim());
  3864.                 if(l == 337)
  3865.                     addFriend(l3);
  3866.                 if(l == 42)
  3867.                     addIgnore(l3);
  3868.                 if(l == 792)
  3869.                     delFriend(l3);
  3870.                 if(l == 322)
  3871.                     delIgnore(l3);
  3872.             }
  3873.         }
  3874.         if(l == 53)
  3875.         {
  3876.             stream.createFrame(135);
  3877.             stream.method431(j);
  3878.             stream.method432(k);
  3879.             stream.method431(i1);
  3880.             atInventoryLoopCycle = 0;
  3881.             atInventoryInterface = k;
  3882.             atInventoryIndex = j;
  3883.             atInventoryInterfaceType = 2;
  3884.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3885.                 atInventoryInterfaceType = 1;
  3886.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3887.                 atInventoryInterfaceType = 3;
  3888.         }
  3889.         if(l == 539)
  3890.         {
  3891.             stream.createFrame(16);
  3892.             stream.method432(i1);
  3893.             stream.method433(j);
  3894.             stream.method433(k);
  3895.             atInventoryLoopCycle = 0;
  3896.             atInventoryInterface = k;
  3897.             atInventoryIndex = j;
  3898.             atInventoryInterfaceType = 2;
  3899.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3900.                 atInventoryInterfaceType = 1;
  3901.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3902.                 atInventoryInterfaceType = 3;
  3903.         }
  3904.         if(l == 484 || l == 6)
  3905.         {
  3906.             String s1 = menuActionName[i];
  3907.             int l1 = s1.indexOf("@whi@");
  3908.             if(l1 != -1)
  3909.             {
  3910.                 s1 = s1.substring(l1 + 5).trim();
  3911.                 String s7 = TextClass.fixName(TextClass.nameForLong(TextClass.longForName(s1)));
  3912.                 boolean flag9 = false;
  3913.                 for(int j3 = 0; j3 < playerCount; j3++)
  3914.                 {
  3915.                     Player class30_sub2_sub4_sub1_sub2_7 = playerArray[playerIndices[j3]];
  3916.                     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))
  3917.                         continue;
  3918.                     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]);
  3919.                     if(l == 484)
  3920.                     {
  3921.                         stream.createFrame(139);
  3922.                         stream.method431(playerIndices[j3]);
  3923.                     }
  3924.                     if(l == 6)
  3925.                     {
  3926.                         anInt1188 += i1;
  3927.                         if(anInt1188 >= 90)
  3928.                         {
  3929.                             stream.createFrame(136);
  3930.                             anInt1188 = 0;
  3931.                         }
  3932.                         stream.createFrame(128);
  3933.                         stream.writeWord(playerIndices[j3]);
  3934.                     }
  3935.                     flag9 = true;
  3936.                     break;
  3937.                 }
  3938.  
  3939.                 if(!flag9)
  3940.                     pushMessage("Unable to find " + s7, 0, "");
  3941.             }
  3942.         }
  3943.         if(l == 870)
  3944.         {
  3945.             stream.createFrame(53);
  3946.             stream.writeWord(j);
  3947.             stream.method432(anInt1283);
  3948.             stream.method433(i1);
  3949.             stream.writeWord(anInt1284);
  3950.             stream.method431(anInt1285);
  3951.             stream.writeWord(k);
  3952.             atInventoryLoopCycle = 0;
  3953.             atInventoryInterface = k;
  3954.             atInventoryIndex = j;
  3955.             atInventoryInterfaceType = 2;
  3956.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3957.                 atInventoryInterfaceType = 1;
  3958.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3959.                 atInventoryInterfaceType = 3;
  3960.         }
  3961.         if(l == 847)
  3962.         {
  3963.             stream.createFrame(87);
  3964.             stream.method432(i1);
  3965.             stream.writeWord(k);
  3966.             stream.method432(j);
  3967.             atInventoryLoopCycle = 0;
  3968.             atInventoryInterface = k;
  3969.             atInventoryIndex = j;
  3970.             atInventoryInterfaceType = 2;
  3971.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  3972.                 atInventoryInterfaceType = 1;
  3973.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  3974.                 atInventoryInterfaceType = 3;
  3975.         }
  3976.         if(l == 626)
  3977.         {
  3978.             RSInterface class9_1 = RSInterface.interfaceCache[k];
  3979.             spellSelected = 1;
  3980.             spellID = class9_1.id;
  3981.             anInt1137 = k;
  3982.             spellUsableOn = class9_1.spellUsableOn;
  3983.             itemSelected = 0;
  3984.             needDrawTabArea = true;
  3985.             spellID = class9_1.id;
  3986.             String s4 = class9_1.selectedActionName;
  3987.             if(s4.indexOf(" ") != -1)
  3988.                 s4 = s4.substring(0, s4.indexOf(" "));
  3989.             String s8 = class9_1.selectedActionName;
  3990.             if(s8.indexOf(" ") != -1)
  3991.                 s8 = s8.substring(s8.indexOf(" ") + 1);
  3992.             spellTooltip = s4 + " " + class9_1.spellName + " " + s8;
  3993.             //class9_1.sprite1.drawSprite(class9_1.anInt263, class9_1.anInt265, 0xffffff);
  3994.             //class9_1.sprite1.drawSprite(200,200);
  3995.             //System.out.println("Sprite: " + class9_1.sprite1.toString());
  3996.             if(spellUsableOn == 16)
  3997.             {
  3998.                 needDrawTabArea = true;
  3999.                 tabID = 3;
  4000.                 tabAreaAltered = true;
  4001.             }
  4002.             return;
  4003.         }
  4004.         if(l == 78)
  4005.         {
  4006.             stream.createFrame(117);
  4007.             stream.method433(k);
  4008.             stream.method433(i1);
  4009.             stream.method431(j);
  4010.             atInventoryLoopCycle = 0;
  4011.             atInventoryInterface = k;
  4012.             atInventoryIndex = j;
  4013.             atInventoryInterfaceType = 2;
  4014.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4015.                 atInventoryInterfaceType = 1;
  4016.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4017.                 atInventoryInterfaceType = 3;
  4018.         }
  4019.         if(l == 27)
  4020.         {
  4021.             Player class30_sub2_sub4_sub1_sub2_2 = playerArray[i1];
  4022.             if(class30_sub2_sub4_sub1_sub2_2 != null)
  4023.             {
  4024.                 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]);
  4025.                 crossX = super.saveClickX;
  4026.                 crossY = super.saveClickY;
  4027.                 crossType = 2;
  4028.                 crossIndex = 0;
  4029.                 anInt986 += i1;
  4030.                 if(anInt986 >= 54)
  4031.                 {
  4032.                     stream.createFrame(189);
  4033.                     stream.writeWordBigEndian(234);
  4034.                     anInt986 = 0;
  4035.                 }
  4036.                 stream.createFrame(73);
  4037.                 stream.method431(i1);
  4038.             }
  4039.         }
  4040.         if(l == 213)
  4041.         {
  4042.             boolean flag3 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4043.             if(!flag3)
  4044.                 flag3 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4045.             crossX = super.saveClickX;
  4046.             crossY = super.saveClickY;
  4047.             crossType = 2;
  4048.             crossIndex = 0;
  4049.             stream.createFrame(79);
  4050.             stream.method431(k + baseY);
  4051.             stream.writeWord(i1);
  4052.             stream.method432(j + baseX);
  4053.         }
  4054.         if(l == 632)
  4055.         {
  4056.             stream.createFrame(145);
  4057.             stream.method432(k);
  4058.             stream.method432(j);
  4059.             stream.method432(i1);
  4060.             atInventoryLoopCycle = 0;
  4061.             atInventoryInterface = k;
  4062.             atInventoryIndex = j;
  4063.             atInventoryInterfaceType = 2;
  4064.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4065.                 atInventoryInterfaceType = 1;
  4066.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4067.                 atInventoryInterfaceType = 3;
  4068.         }
  4069.         if(l == 1004) {
  4070.             if(tabInterfaceIDs[10] != -1) {
  4071.                 needDrawTabArea = true;
  4072.                 tabID = 10;
  4073.                 tabAreaAltered = true;
  4074.             }
  4075.         }
  4076.         if(l == 1003) {
  4077.             clanChatMode = 2;
  4078.             aBoolean1233 = true;
  4079.             inputTaken = true;
  4080.         }
  4081.         if(l == 1002) {
  4082.             clanChatMode = 1;
  4083.             aBoolean1233 = true;
  4084.             inputTaken = true;
  4085.         }
  4086.         if(l == 1001) {
  4087.             clanChatMode = 0;
  4088.             aBoolean1233 = true;
  4089.             inputTaken = true;
  4090.         }
  4091.         if(l == 1000) {
  4092.             cButtonCPos = 4;
  4093.             chatTypeView = 11;
  4094.             aBoolean1233 = true;
  4095.             inputTaken = true;
  4096.         }
  4097.         if(l == 999) {
  4098.             cButtonCPos = 0;
  4099.             chatTypeView = 0;
  4100.             aBoolean1233 = true;
  4101.             inputTaken = true;
  4102.         }
  4103.         if(l == 998) {
  4104.             cButtonCPos = 1;
  4105.             chatTypeView = 5;
  4106.             aBoolean1233 = true;
  4107.             inputTaken = true;
  4108.         }
  4109.         if(l == 997) {
  4110.             publicChatMode = 3;
  4111.             aBoolean1233 = true;
  4112.             inputTaken = true;
  4113.         }
  4114.         if(l == 996) {
  4115.             publicChatMode = 2;
  4116.             aBoolean1233 = true;
  4117.             inputTaken = true;
  4118.         }
  4119.         if(l == 995) {
  4120.             publicChatMode = 1;
  4121.             aBoolean1233 = true;
  4122.             inputTaken = true;
  4123.         }
  4124.         if(l == 994) {
  4125.             publicChatMode = 0;
  4126.             aBoolean1233 = true;
  4127.             inputTaken = true;
  4128.         }
  4129.         if(l == 993) {
  4130.             cButtonCPos = 2;
  4131.             chatTypeView = 1;
  4132.             aBoolean1233 = true;
  4133.             inputTaken = true;
  4134.         }
  4135.         if(l == 992) {
  4136.             privateChatMode = 2;
  4137.             aBoolean1233 = true;
  4138.             inputTaken = true;
  4139.         }
  4140.         if(l == 991) {
  4141.             privateChatMode = 1;
  4142.             aBoolean1233 = true;
  4143.             inputTaken = true;
  4144.         }
  4145.         if(l == 990) {
  4146.             privateChatMode = 0;
  4147.             aBoolean1233 = true;
  4148.             inputTaken = true;
  4149.         }
  4150.         if(l == 989) {
  4151.             cButtonCPos = 3;
  4152.             chatTypeView = 2;
  4153.             aBoolean1233 = true;
  4154.             inputTaken = true;
  4155.         }
  4156.         if(l == 987) {
  4157.             tradeMode = 2;
  4158.             aBoolean1233 = true;
  4159.             inputTaken = true;
  4160.         }
  4161.         if(l == 986) {
  4162.             tradeMode = 1;
  4163.             aBoolean1233 = true;
  4164.             inputTaken = true;
  4165.         }
  4166.         if(l == 985) {
  4167.             tradeMode = 0;
  4168.             aBoolean1233 = true;
  4169.             inputTaken = true;
  4170.         }
  4171.         if(l == 984) {
  4172.             cButtonCPos = 5;
  4173.             chatTypeView = 3;
  4174.             aBoolean1233 = true;
  4175.             inputTaken = true;
  4176.         }
  4177.         if(l == 983) {
  4178.             duelMode = 2;
  4179.             aBoolean1233 = true;
  4180.             inputTaken = true;
  4181.         }
  4182.         if(l == 982) {
  4183.             duelMode = 1;
  4184.             aBoolean1233 = true;
  4185.             inputTaken = true;
  4186.         }
  4187.         if(l == 981) {
  4188.             duelMode = 0;
  4189.             aBoolean1233 = true;
  4190.             inputTaken = true;
  4191.         }
  4192.         if(l == 980) {
  4193.             cButtonCPos = 6;
  4194.             chatTypeView = 4;
  4195.             aBoolean1233 = true;
  4196.             inputTaken = true;
  4197.         }
  4198.         if(l == 493)
  4199.         {
  4200.             stream.createFrame(75);
  4201.             stream.method433(k);
  4202.             stream.method431(j);
  4203.             stream.method432(i1);
  4204.             atInventoryLoopCycle = 0;
  4205.             atInventoryInterface = k;
  4206.             atInventoryIndex = j;
  4207.             atInventoryInterfaceType = 2;
  4208.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4209.                 atInventoryInterfaceType = 1;
  4210.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4211.                 atInventoryInterfaceType = 3;
  4212.         }
  4213.         if(l == 652)
  4214.         {
  4215.             boolean flag4 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4216.             if(!flag4)
  4217.                 flag4 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4218.             crossX = super.saveClickX;
  4219.             crossY = super.saveClickY;
  4220.             crossType = 2;
  4221.             crossIndex = 0;
  4222.             stream.createFrame(156);
  4223.             stream.method432(j + baseX);
  4224.             stream.method431(k + baseY);
  4225.             stream.method433(i1);
  4226.         }
  4227.         if(l == 94)
  4228.         {
  4229.             boolean flag5 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4230.             if(!flag5)
  4231.                 flag5 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4232.             crossX = super.saveClickX;
  4233.             crossY = super.saveClickY;
  4234.             crossType = 2;
  4235.             crossIndex = 0;
  4236.             stream.createFrame(181);
  4237.             stream.method431(k + baseY);
  4238.             stream.writeWord(i1);
  4239.             stream.method431(j + baseX);
  4240.             stream.method432(anInt1137);
  4241.         }
  4242.         if(l == 646)
  4243.         {
  4244.             stream.createFrame(185);
  4245.             stream.writeWord(k);
  4246.             RSInterface class9_2 = RSInterface.interfaceCache[k];
  4247.             if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5)
  4248.             {
  4249.                 int i2 = class9_2.valueIndexArray[0][1];
  4250.                 if(variousSettings[i2] != class9_2.anIntArray212[0])
  4251.                 {
  4252.                     variousSettings[i2] = class9_2.anIntArray212[0];
  4253.                     method33(i2);
  4254.                     needDrawTabArea = true;
  4255.                 }
  4256.             }
  4257.         }
  4258.         if(l == 225)
  4259.         {
  4260.             NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[i1];
  4261.             if(class30_sub2_sub4_sub1_sub1_2 != null)
  4262.             {
  4263.                 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]);
  4264.                 crossX = super.saveClickX;
  4265.                 crossY = super.saveClickY;
  4266.                 crossType = 2;
  4267.                 crossIndex = 0;
  4268.                 anInt1226 += i1;
  4269.                 if(anInt1226 >= 85)
  4270.                 {
  4271.                     stream.createFrame(230);
  4272.                     stream.writeWordBigEndian(239);
  4273.                     anInt1226 = 0;
  4274.                 }
  4275.                 stream.createFrame(17);
  4276.                 stream.method433(i1);
  4277.             }
  4278.         }
  4279.         if(l == 965)
  4280.         {
  4281.             NPC class30_sub2_sub4_sub1_sub1_3 = npcArray[i1];
  4282.             if(class30_sub2_sub4_sub1_sub1_3 != null)
  4283.             {
  4284.                 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]);
  4285.                 crossX = super.saveClickX;
  4286.                 crossY = super.saveClickY;
  4287.                 crossType = 2;
  4288.                 crossIndex = 0;
  4289.                 anInt1134++;
  4290.                 if(anInt1134 >= 96)
  4291.                 {
  4292.                     stream.createFrame(152);
  4293.                     stream.writeWordBigEndian(88);
  4294.                     anInt1134 = 0;
  4295.                 }
  4296.                 stream.createFrame(21);
  4297.                 stream.writeWord(i1);
  4298.             }
  4299.         }
  4300.         if(l == 413)
  4301.         {
  4302.             NPC class30_sub2_sub4_sub1_sub1_4 = npcArray[i1];
  4303.             if(class30_sub2_sub4_sub1_sub1_4 != null)
  4304.             {
  4305.                 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]);
  4306.                 crossX = super.saveClickX;
  4307.                 crossY = super.saveClickY;
  4308.                 crossType = 2;
  4309.                 crossIndex = 0;
  4310.                 stream.createFrame(131);
  4311.                 stream.method433(i1);
  4312.                 stream.method432(anInt1137);
  4313.             }
  4314.         }
  4315.         if(l == 200)
  4316.             clearTopInterfaces();
  4317.         if(l == 1025)
  4318.         {
  4319.             NPC class30_sub2_sub4_sub1_sub1_5 = npcArray[i1];
  4320.             if(class30_sub2_sub4_sub1_sub1_5 != null)
  4321.             {
  4322.                 EntityDef entityDef = class30_sub2_sub4_sub1_sub1_5.desc;
  4323.                 if(entityDef.childrenIDs != null)
  4324.                     entityDef = entityDef.method161();
  4325.                 if(entityDef != null)
  4326.                 {
  4327.                     String s9;
  4328.                     if(entityDef.description != null)
  4329.                         s9 = new String(entityDef.description);
  4330.                     else
  4331.                         s9 = "It's a " + entityDef.name + ".";
  4332.                     pushMessage(s9, 0, "");
  4333.                 }
  4334.             }
  4335.         }
  4336.         if(l == 900)
  4337.         {
  4338.             method66(i1, k, j);
  4339.             stream.createFrame(252);
  4340.             stream.method433(i1 >> 14 & 0x7fff);
  4341.             stream.method431(k + baseY);
  4342.             stream.method432(j + baseX);
  4343.         }
  4344.         if(l == 412)
  4345.         {
  4346.             NPC class30_sub2_sub4_sub1_sub1_6 = npcArray[i1];
  4347.             if(class30_sub2_sub4_sub1_sub1_6 != null)
  4348.             {
  4349.                 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]);
  4350.                 crossX = super.saveClickX;
  4351.                 crossY = super.saveClickY;
  4352.                 crossType = 2;
  4353.                 crossIndex = 0;
  4354.                 stream.createFrame(72);
  4355.                 stream.method432(i1);
  4356.             }
  4357.         }
  4358.         if(l == 365)
  4359.         {
  4360.             Player class30_sub2_sub4_sub1_sub2_3 = playerArray[i1];
  4361.             if(class30_sub2_sub4_sub1_sub2_3 != null)
  4362.             {
  4363.                 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]);
  4364.                 crossX = super.saveClickX;
  4365.                 crossY = super.saveClickY;
  4366.                 crossType = 2;
  4367.                 crossIndex = 0;
  4368.                 stream.createFrame(249);
  4369.                 stream.method432(i1);
  4370.                 stream.method431(anInt1137);
  4371.             }
  4372.         }
  4373.         if(l == 729)
  4374.         {
  4375.             Player class30_sub2_sub4_sub1_sub2_4 = playerArray[i1];
  4376.             if(class30_sub2_sub4_sub1_sub2_4 != null)
  4377.             {
  4378.                 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]);
  4379.                 crossX = super.saveClickX;
  4380.                 crossY = super.saveClickY;
  4381.                 crossType = 2;
  4382.                 crossIndex = 0;
  4383.                 stream.createFrame(39);
  4384.                 stream.method431(i1);
  4385.             }
  4386.         }
  4387.         if(l == 577)
  4388.         {
  4389.             Player class30_sub2_sub4_sub1_sub2_5 = playerArray[i1];
  4390.             if(class30_sub2_sub4_sub1_sub2_5 != null)
  4391.             {
  4392.                 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]);
  4393.                 crossX = super.saveClickX;
  4394.                 crossY = super.saveClickY;
  4395.                 crossType = 2;
  4396.                 crossIndex = 0;
  4397.                 stream.createFrame(139);
  4398.                 stream.method431(i1);
  4399.             }
  4400.         }
  4401.         if(l == 956 && method66(i1, k, j))
  4402.         {
  4403.             stream.createFrame(35);
  4404.             stream.method431(j + baseX);
  4405.             stream.method432(anInt1137);
  4406.             stream.method432(k + baseY);
  4407.             stream.method431(i1 >> 14 & 0x7fff);
  4408.         }
  4409.         if(l == 567)
  4410.         {
  4411.             boolean flag6 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4412.             if(!flag6)
  4413.                 flag6 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4414.             crossX = super.saveClickX;
  4415.             crossY = super.saveClickY;
  4416.             crossType = 2;
  4417.             crossIndex = 0;
  4418.             stream.createFrame(23);
  4419.             stream.method431(k + baseY);
  4420.             stream.method431(i1);
  4421.             stream.method431(j + baseX);
  4422.         }
  4423.         if(l == 867)
  4424.         {
  4425.             if((i1 & 3) == 0)
  4426.                 anInt1175++;
  4427.             if(anInt1175 >= 59)
  4428.             {
  4429.                 stream.createFrame(200);
  4430.                 stream.writeWord(25501);
  4431.                 anInt1175 = 0;
  4432.             }
  4433.             stream.createFrame(43);
  4434.             stream.method431(k);
  4435.             stream.method432(i1);
  4436.             stream.method432(j);
  4437.             atInventoryLoopCycle = 0;
  4438.             atInventoryInterface = k;
  4439.             atInventoryIndex = j;
  4440.             atInventoryInterfaceType = 2;
  4441.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4442.                 atInventoryInterfaceType = 1;
  4443.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4444.                 atInventoryInterfaceType = 3;
  4445.         }
  4446.         if(l == 543)
  4447.         {
  4448.             stream.createFrame(237);
  4449.             stream.writeWord(j);
  4450.             stream.method432(i1);
  4451.             stream.writeWord(k);
  4452.             stream.method432(anInt1137);
  4453.             atInventoryLoopCycle = 0;
  4454.             atInventoryInterface = k;
  4455.             atInventoryIndex = j;
  4456.             atInventoryInterfaceType = 2;
  4457.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4458.                 atInventoryInterfaceType = 1;
  4459.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4460.                 atInventoryInterfaceType = 3;
  4461.         }
  4462.         if(l == 606)
  4463.         {
  4464.             String s2 = menuActionName[i];
  4465.             int j2 = s2.indexOf("@whi@");
  4466.             if(j2 != -1)
  4467.                 if(openInterfaceID == -1)
  4468.                 {
  4469.                     clearTopInterfaces();
  4470.                     reportAbuseInput = s2.substring(j2 + 5).trim();
  4471.                     canMute = false;
  4472.                     for(int i3 = 0; i3 < RSInterface.interfaceCache.length; i3++)
  4473.                     {
  4474.                         if(RSInterface.interfaceCache[i3] == null || RSInterface.interfaceCache[i3].contentType != 600)
  4475.                             continue;
  4476.                         reportAbuseInterfaceID = openInterfaceID = RSInterface.interfaceCache[i3].parentID;
  4477.                         break;
  4478.                     }
  4479.  
  4480.                 } else
  4481.                 {
  4482.                     pushMessage("Please close the interface you have open before using 'report abuse'", 0, "");
  4483.                 }
  4484.         }
  4485.         if(l == 491)
  4486.         {
  4487.             Player class30_sub2_sub4_sub1_sub2_6 = playerArray[i1];
  4488.             if(class30_sub2_sub4_sub1_sub2_6 != null)
  4489.             {
  4490.                 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]);
  4491.                 crossX = super.saveClickX;
  4492.                 crossY = super.saveClickY;
  4493.                 crossType = 2;
  4494.                 crossIndex = 0;
  4495.                 stream.createFrame(14);
  4496.                 stream.method432(anInt1284);
  4497.                 stream.writeWord(i1);
  4498.                 stream.writeWord(anInt1285);
  4499.                 stream.method431(anInt1283);
  4500.             }
  4501.         }
  4502.         if(l == 639)
  4503.         {
  4504.             String s3 = menuActionName[i];
  4505.             int k2 = s3.indexOf("@whi@");
  4506.             if(k2 != -1)
  4507.             {
  4508.                 long l4 = TextClass.longForName(s3.substring(k2 + 5).trim());
  4509.                 int k3 = -1;
  4510.                 for(int i4 = 0; i4 < friendsCount; i4++)
  4511.                 {
  4512.                     if(friendsListAsLongs[i4] != l4)
  4513.                         continue;
  4514.                     k3 = i4;
  4515.                     break;
  4516.                 }
  4517.  
  4518.                 if(k3 != -1 && friendsNodeIDs[k3] > 0)
  4519.                 {
  4520.                     inputTaken = true;
  4521.                     inputDialogState = 0;
  4522.                     messagePromptRaised = true;
  4523.                     promptInput = "";
  4524.                     friendsListAction = 3;
  4525.                     aLong953 = friendsListAsLongs[k3];
  4526.                     aString1121 = "Enter message to send to " + friendsList[k3];
  4527.                 }
  4528.             }
  4529.         }
  4530.         if(l == 454)
  4531.         {
  4532.             stream.createFrame(41);
  4533.             stream.writeWord(i1);
  4534.             stream.method432(j);
  4535.             stream.method432(k);
  4536.             atInventoryLoopCycle = 0;
  4537.             atInventoryInterface = k;
  4538.             atInventoryIndex = j;
  4539.             atInventoryInterfaceType = 2;
  4540.             if(RSInterface.interfaceCache[k].parentID == openInterfaceID)
  4541.                 atInventoryInterfaceType = 1;
  4542.             if(RSInterface.interfaceCache[k].parentID == backDialogID)
  4543.                 atInventoryInterfaceType = 3;
  4544.         }
  4545.         if(l == 478)
  4546.         {
  4547.             NPC class30_sub2_sub4_sub1_sub1_7 = npcArray[i1];
  4548.             if(class30_sub2_sub4_sub1_sub1_7 != null)
  4549.             {
  4550.                 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]);
  4551.                 crossX = super.saveClickX;
  4552.                 crossY = super.saveClickY;
  4553.                 crossType = 2;
  4554.                 crossIndex = 0;
  4555.                 if((i1 & 3) == 0)
  4556.                     anInt1155++;
  4557.                 if(anInt1155 >= 53)
  4558.                 {
  4559.                     stream.createFrame(85);
  4560.                     stream.writeWordBigEndian(66);
  4561.                     anInt1155 = 0;
  4562.                 }
  4563.                 stream.createFrame(18);
  4564.                 stream.method431(i1);
  4565.             }
  4566.         }
  4567.         if(l == 113)
  4568.         {
  4569.             method66(i1, k, j);
  4570.             stream.createFrame(70);
  4571.             stream.method431(j + baseX);
  4572.             stream.writeWord(k + baseY);
  4573.             stream.method433(i1 >> 14 & 0x7fff);
  4574.         }
  4575.         if(l == 872)
  4576.         {
  4577.             method66(i1, k, j);
  4578.             stream.createFrame(234);
  4579.             stream.method433(j + baseX);
  4580.             stream.method432(i1 >> 14 & 0x7fff);
  4581.             stream.method433(k + baseY);
  4582.         }
  4583.         if(l == 502)
  4584.         {
  4585.             method66(i1, k, j);
  4586.             stream.createFrame(132);
  4587.             stream.method433(j + baseX);
  4588.             stream.writeWord(i1 >> 14 & 0x7fff);
  4589.             stream.method432(k + baseY);
  4590.         }
  4591.         if(l == 1125)
  4592.         {
  4593.             ItemDef itemDef = ItemDef.forID(i1);
  4594.             RSInterface class9_4 = RSInterface.interfaceCache[k];
  4595.             String s5;
  4596.             if(class9_4 != null && class9_4.invStackSizes[j] >= 0x186a0)
  4597.                 s5 = class9_4.invStackSizes[j] + " x " + itemDef.name;
  4598.             else
  4599.             if(itemDef.description != null)
  4600.                 s5 = new String(itemDef.description);
  4601.             else
  4602.                 s5 = "It's a " + itemDef.name + ".";
  4603.             pushMessage(s5, 0, "");
  4604.         }
  4605.         if(l == 169)
  4606.         {
  4607.             stream.createFrame(185);
  4608.             stream.writeWord(k);
  4609.             RSInterface class9_3 = RSInterface.interfaceCache[k];
  4610.             if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5)
  4611.             {
  4612.                 int l2 = class9_3.valueIndexArray[0][1];
  4613.                 variousSettings[l2] = 1 - variousSettings[l2];
  4614.                 method33(l2);
  4615.                 needDrawTabArea = true;
  4616.             }
  4617.         }
  4618.         if(l == 447)
  4619.         {
  4620.             itemSelected = 1;
  4621.             anInt1283 = j;
  4622.             anInt1284 = k;
  4623.             anInt1285 = i1;
  4624.             selectedItemName = ItemDef.forID(i1).name;
  4625.             spellSelected = 0;
  4626.             needDrawTabArea = true;
  4627.             return;
  4628.         }
  4629.         if(l == 1226)
  4630.         {
  4631.             int j1 = i1 >> 14 & 0x7fff;
  4632.             ObjectDef class46 = ObjectDef.forID(j1);
  4633.             String s10;
  4634.             if(class46.description != null)
  4635.                 s10 = new String(class46.description);
  4636.             else
  4637.                 s10 = "It's a " + class46.name + ".";
  4638.             pushMessage(s10, 0, "");
  4639.         }
  4640.         if(l == 244)
  4641.         {
  4642.             boolean flag7 = doWalkTo(2, 0, 0, 0, myPlayer.smallY[0], 0, 0, k, myPlayer.smallX[0], false, j);
  4643.             if(!flag7)
  4644.                 flag7 = doWalkTo(2, 0, 1, 0, myPlayer.smallY[0], 1, 0, k, myPlayer.smallX[0], false, j);
  4645.             crossX = super.saveClickX;
  4646.             crossY = super.saveClickY;
  4647.             crossType = 2;
  4648.             crossIndex = 0;
  4649.             stream.createFrame(253);
  4650.             stream.method431(j + baseX);
  4651.             stream.method433(k + baseY);
  4652.             stream.method432(i1);
  4653.         }
  4654.         if(l == 1448)
  4655.         {
  4656.             ItemDef itemDef_1 = ItemDef.forID(i1);
  4657.             String s6;
  4658.             if(itemDef_1.description != null)
  4659.                 s6 = new String(itemDef_1.description);
  4660.             else
  4661.                 s6 = "It's a " + itemDef_1.name + ".";
  4662.             pushMessage(s6, 0, "");
  4663.         }
  4664.         itemSelected = 0;
  4665.             spellSelected = 0;
  4666.             needDrawTabArea = true;
  4667.  
  4668.     }
  4669.  
  4670.     private void method70()
  4671.     {
  4672.         anInt1251 = 0;
  4673.         int j = (myPlayer.x >> 7) + baseX;
  4674.         int k = (myPlayer.y >> 7) + baseY;
  4675.         if(j >= 3053 && j <= 3156 && k >= 3056 && k <= 3136)
  4676.             anInt1251 = 1;
  4677.         if(j >= 3072 && j <= 3118 && k >= 9492 && k <= 9535)
  4678.             anInt1251 = 1;
  4679.         if(anInt1251 == 1 && j >= 3139 && j <= 3199 && k >= 3008 && k <= 3062)
  4680.             anInt1251 = 0;
  4681.     }
  4682.  
  4683.     public void run() {
  4684.         if(drawFlames) {
  4685.             drawFlames();
  4686.         } else {
  4687.             super.run();
  4688.         }
  4689.     }
  4690.  
  4691.     private void build3dScreenMenu()
  4692.     {
  4693.         if(itemSelected == 0 && spellSelected == 0)
  4694.         {
  4695.             menuActionName[menuActionRow] = "Walk here";
  4696.             menuActionID[menuActionRow] = 516;
  4697.             menuActionCmd2[menuActionRow] = super.mouseX;
  4698.             menuActionCmd3[menuActionRow] = super.mouseY;
  4699.             menuActionRow++;
  4700.         }
  4701.         int j = -1;
  4702.         for(int k = 0; k < Model.anInt1687; k++)
  4703.         {
  4704.             int l = Model.anIntArray1688[k];
  4705.             int i1 = l & 0x7f;
  4706.             int j1 = l >> 7 & 0x7f;
  4707.             int k1 = l >> 29 & 3;
  4708.             int l1 = l >> 14 & 0x7fff;
  4709.             if(l == j)
  4710.                 continue;
  4711.             j = l;
  4712.             if(k1 == 2 && worldController.method304(plane, i1, j1, l) >= 0)
  4713.             {
  4714.                 ObjectDef class46 = ObjectDef.forID(l1);
  4715.                 if(class46.childrenIDs != null)
  4716.                     class46 = class46.method580();
  4717.                 if(class46 == null)
  4718.                     continue;
  4719.                 if(itemSelected == 1)
  4720.                 {
  4721.                     menuActionName[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class46.name;
  4722.                     menuActionID[menuActionRow] = 62;
  4723.                     menuActionCmd1[menuActionRow] = l;
  4724.                     menuActionCmd2[menuActionRow] = i1;
  4725.                     menuActionCmd3[menuActionRow] = j1;
  4726.                     menuActionRow++;
  4727.                 } else
  4728.                 if(spellSelected == 1)
  4729.                 {
  4730.                     if((spellUsableOn & 4) == 4)
  4731.                     {
  4732.                         menuActionName[menuActionRow] = spellTooltip + " @cya@" + class46.name;
  4733.                         menuActionID[menuActionRow] = 956;
  4734.                         menuActionCmd1[menuActionRow] = l;
  4735.                         menuActionCmd2[menuActionRow] = i1;
  4736.                         menuActionCmd3[menuActionRow] = j1;
  4737.                         menuActionRow++;
  4738.                     }
  4739.                 } else
  4740.                 {
  4741.                     if(class46.actions != null)
  4742.                     {
  4743.                         for(int i2 = 4; i2 >= 0; i2--)
  4744.                             if(class46.actions[i2] != null)
  4745.                             {
  4746.                                 menuActionName[menuActionRow] = class46.actions[i2] + " @cya@" + class46.name;
  4747.                                 if(i2 == 0)
  4748.                                     menuActionID[menuActionRow] = 502;
  4749.                                 if(i2 == 1)
  4750.                                     menuActionID[menuActionRow] = 900;
  4751.                                 if(i2 == 2)
  4752.                                     menuActionID[menuActionRow] = 113;
  4753.                                 if(i2 == 3)
  4754.                                     menuActionID[menuActionRow] = 872;
  4755.                                 if(i2 == 4)
  4756.                                     menuActionID[menuActionRow] = 1062;
  4757.                                 menuActionCmd1[menuActionRow] = l;
  4758.                                 menuActionCmd2[menuActionRow] = i1;
  4759.                                 menuActionCmd3[menuActionRow] = j1;
  4760.                                 menuActionRow++;
  4761.                             }
  4762.  
  4763.                     }
  4764.                     //menuActionName[menuActionRow] = "Examine @cya@" + class46.name + " @gre@(@whi@" + l1 + "@gre@) (@whi@" + (i1 + baseX) + "," + (j1 + baseY) + "@gre@)";
  4765.                     menuActionName[menuActionRow] = "Examine @cya@" + class46.name;
  4766.                     menuActionID[menuActionRow] = 1226;
  4767.                     menuActionCmd1[menuActionRow] = class46.type << 14;
  4768.                     menuActionCmd2[menuActionRow] = i1;
  4769.                     menuActionCmd3[menuActionRow] = j1;
  4770.                     menuActionRow++;
  4771.                 }
  4772.             }
  4773.             if(k1 == 1)
  4774.             {
  4775.                 NPC npc = npcArray[l1];
  4776.                 if(npc.desc.aByte68 == 1 && (npc.x & 0x7f) == 64 && (npc.y & 0x7f) == 64)
  4777.                 {
  4778.                     for(int j2 = 0; j2 < npcCount; j2++)
  4779.                     {
  4780.                         NPC npc2 = npcArray[npcIndices[j2]];
  4781.                         if(npc2 != null && npc2 != npc && npc2.desc.aByte68 == 1 && npc2.x == npc.x && npc2.y == npc.y)
  4782.                             buildAtNPCMenu(npc2.desc, npcIndices[j2], j1, i1);
  4783.                     }
  4784.  
  4785.                     for(int l2 = 0; l2 < playerCount; l2++)
  4786.                     {
  4787.                         Player player = playerArray[playerIndices[l2]];
  4788.                         if(player != null && player.x == npc.x && player.y == npc.y)
  4789.                             buildAtPlayerMenu(i1, playerIndices[l2], player, j1);
  4790.                     }
  4791.  
  4792.                 }
  4793.                 buildAtNPCMenu(npc.desc, l1, j1, i1);
  4794.             }
  4795.             if(k1 == 0)
  4796.             {
  4797.                 Player player = playerArray[l1];
  4798.                 if((player.x & 0x7f) == 64 && (player.y & 0x7f) == 64)
  4799.                 {
  4800.                     for(int k2 = 0; k2 < npcCount; k2++)
  4801.                     {
  4802.                         NPC class30_sub2_sub4_sub1_sub1_2 = npcArray[npcIndices[k2]];
  4803.                         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)
  4804.                             buildAtNPCMenu(class30_sub2_sub4_sub1_sub1_2.desc, npcIndices[k2], j1, i1);
  4805.                     }
  4806.  
  4807.                     for(int i3 = 0; i3 < playerCount; i3++)
  4808.                     {
  4809.                         Player class30_sub2_sub4_sub1_sub2_2 = playerArray[playerIndices[i3]];
  4810.                         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)
  4811.                             buildAtPlayerMenu(i1, playerIndices[i3], class30_sub2_sub4_sub1_sub2_2, j1);
  4812.                     }
  4813.  
  4814.                 }
  4815.                 buildAtPlayerMenu(i1, l1, player, j1);
  4816.             }
  4817.             if(k1 == 3)
  4818.             {
  4819.                 NodeList class19 = groundArray[plane][i1][j1];
  4820.                 if(class19 != null)
  4821.                 {
  4822.                     for(Item item = (Item)class19.getFirst(); item != null; item = (Item)class19.getNext())
  4823.                     {
  4824.                         ItemDef itemDef = ItemDef.forID(item.ID);
  4825.                         if(itemSelected == 1)
  4826.                         {
  4827.                             menuActionName[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDef.name;
  4828.                             menuActionID[menuActionRow] = 511;
  4829.                             menuActionCmd1[menuActionRow] = item.ID;
  4830.                             menuActionCmd2[menuActionRow] = i1;
  4831.                             menuActionCmd3[menuActionRow] = j1;
  4832.                             menuActionRow++;
  4833.                         } else
  4834.                         if(spellSelected == 1)
  4835.                         {
  4836.                             if((spellUsableOn & 1) == 1)
  4837.                             {
  4838.                                 menuActionName[menuActionRow] = spellTooltip + " @lre@" + itemDef.name;
  4839.                                 menuActionID[menuActionRow] = 94;
  4840.                                 menuActionCmd1[menuActionRow] = item.ID;
  4841.                                 menuActionCmd2[menuActionRow] = i1;
  4842.                                 menuActionCmd3[menuActionRow] = j1;
  4843.                                 menuActionRow++;
  4844.                             }
  4845.                         } else
  4846.                         {
  4847.                             for(int j3 = 4; j3 >= 0; j3--)
  4848.                                 if(itemDef.groundActions != null && itemDef.groundActions[j3] != null)
  4849.                                 {
  4850.                                     menuActionName[menuActionRow] = itemDef.groundActions[j3] + " @lre@" + itemDef.name;
  4851.                                     if(j3 == 0)
  4852.                                         menuActionID[menuActionRow] = 652;
  4853.                                     if(j3 == 1)
  4854.                                         menuActionID[menuActionRow] = 567;
  4855.                                     if(j3 == 2)
  4856.                                         menuActionID[menuActionRow] = 234;
  4857.                                     if(j3 == 3)
  4858.                                         menuActionID[menuActionRow] = 244;
  4859.                                     if(j3 == 4)
  4860.                                         menuActionID[menuActionRow] = 213;
  4861.                                     menuActionCmd1[menuActionRow] = item.ID;
  4862.                                     menuActionCmd2[menuActionRow] = i1;
  4863.                                     menuActionCmd3[menuActionRow] = j1;
  4864.                                     menuActionRow++;
  4865.                                 } else
  4866.                                 if(j3 == 2)
  4867.                                 {
  4868.                                     menuActionName[menuActionRow] = "Take @lre@" + itemDef.name;
  4869.                                     menuActionID[menuActionRow] = 234;
  4870.                                     menuActionCmd1[menuActionRow] = item.ID;
  4871.                                     menuActionCmd2[menuActionRow] = i1;
  4872.                                     menuActionCmd3[menuActionRow] = j1;
  4873.                                     menuActionRow++;
  4874.                                 }
  4875.  
  4876.                             //menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name + " @gre@(@whi@" + item.ID + "@gre@)";
  4877.                             menuActionName[menuActionRow] = "Examine @lre@" + itemDef.name;
  4878.                             menuActionID[menuActionRow] = 1448;
  4879.                             menuActionCmd1[menuActionRow] = item.ID;
  4880.                             menuActionCmd2[menuActionRow] = i1;
  4881.                             menuActionCmd3[menuActionRow] = j1;
  4882.                             menuActionRow++;
  4883.                         }
  4884.                     }
  4885.  
  4886.                 }
  4887.             }
  4888.         }
  4889.     }
  4890.  
  4891.     public void cleanUpForQuit()
  4892.     {
  4893.         signlink.reporterror = false;
  4894.         try
  4895.         {
  4896.             if(socketStream != null)
  4897.                 socketStream.close();
  4898.         }
  4899.         catch(Exception _ex) { }
  4900.         socketStream = null;
  4901.         stopMidi();
  4902.         if(mouseDetection != null)
  4903.             mouseDetection.running = false;
  4904.         mouseDetection = null;
  4905.         onDemandFetcher.disable();
  4906.         onDemandFetcher = null;
  4907.         aStream_834 = null;
  4908.         stream = null;
  4909.         aStream_847 = null;
  4910.         inStream = null;
  4911.         anIntArray1234 = null;
  4912.         aByteArrayArray1183 = null;
  4913.         aByteArrayArray1247 = null;
  4914.         anIntArray1235 = null;
  4915.         anIntArray1236 = null;
  4916.         intGroundArray = null;
  4917.         byteGroundArray = null;
  4918.         worldController = null;
  4919.         aClass11Array1230 = null;
  4920.         anIntArrayArray901 = null;
  4921.         anIntArrayArray825 = null;
  4922.         bigX = null;
  4923.         bigY = null;
  4924.         aByteArray912 = null;
  4925.         aRSImageProducer_1163 = null;
  4926.         mapEdgeIP = null;
  4927.         leftFrame = null;
  4928.         topFrame = null;
  4929.         rightFrame = null;
  4930.         aRSImageProducer_1164 = null;
  4931.         aRSImageProducer_1165 = null;
  4932.         aRSImageProducer_1166 = null;
  4933.         aRSImageProducer_1123 = null;
  4934.         aRSImageProducer_1124 = null;
  4935.         aRSImageProducer_1125 = null;
  4936.         /* Null pointers for custom sprites */
  4937.         chatArea = null;
  4938.         loadingBarFull = null;
  4939.         loadingBarEmpty = null;
  4940.         chatButtons = null;
  4941.         tabArea = null;
  4942.         mapArea = null;
  4943.         /**/
  4944.         mapBack = null;
  4945.         sideIcons = null;
  4946.         redStones = null;
  4947.         compass = null;
  4948.         hitMarks = null;
  4949.         headIcons = null;
  4950.         skullIcons = null;
  4951.         headIconsHint = null;
  4952.         crosses = null;
  4953.         mapDotItem = null;
  4954.         mapDotNPC = null;
  4955.         mapDotPlayer = null;
  4956.         mapDotFriend = null;
  4957.         mapDotTeam = null;
  4958.         mapScenes = null;
  4959.         mapFunctions = null;
  4960.         anIntArrayArray929 = null;
  4961.         playerArray = null;
  4962.         playerIndices = null;
  4963.         anIntArray894 = null;
  4964.         aStreamArray895s = null;
  4965.         anIntArray840 = null;
  4966.         npcArray = null;
  4967.         npcIndices = null;
  4968.         groundArray = null;
  4969.         aClass19_1179 = null;
  4970.         aClass19_1013 = null;
  4971.         aClass19_1056 = null;
  4972.         menuActionCmd2 = null;
  4973.         menuActionCmd3 = null;
  4974.         menuActionID = null;
  4975.         menuActionCmd1 = null;
  4976.         menuActionName = null;
  4977.         variousSettings = null;
  4978.         anIntArray1072 = null;
  4979.         anIntArray1073 = null;
  4980.         aClass30_Sub2_Sub1_Sub1Array1140 = null;
  4981.         aClass30_Sub2_Sub1_Sub1_1263 = null;
  4982.         friendsList = null;
  4983.         friendsListAsLongs = null;
  4984.         friendsNodeIDs = null;
  4985.         aRSImageProducer_1110 = null;
  4986.         aRSImageProducer_1111 = null;
  4987.         aRSImageProducer_1107 = null;
  4988.         aRSImageProducer_1108 = null;
  4989.         aRSImageProducer_1109 = null;
  4990.         aRSImageProducer_1112 = null;
  4991.         aRSImageProducer_1113 = null;
  4992.         aRSImageProducer_1114 = null;
  4993.         aRSImageProducer_1115 = null;
  4994.         multiOverlay = null;
  4995.         nullLoader();
  4996.         ObjectDef.nullLoader();
  4997.         EntityDef.nullLoader();
  4998.         ItemDef.nullLoader();
  4999.         Flo.cache = null;
  5000.         IDK.cache = null;
  5001.         RSInterface.interfaceCache = null;
  5002.         DummyClass.cache = null;
  5003.         Animation.anims = null;
  5004.         SpotAnim.cache = null;
  5005.         SpotAnim.aMRUNodes_415 = null;
  5006.         Varp.cache = null;
  5007.         super.fullGameScreen = null;
  5008.         Player.mruNodes = null;
  5009.         Texture.nullLoader();
  5010.         WorldController.nullLoader();
  5011.         Model.nullLoader();
  5012.         Class36.nullLoader();
  5013.         System.gc();
  5014.     }
  5015.  
  5016.     private void printDebug()
  5017.     {
  5018.         System.out.println("============");
  5019.         System.out.println("flame-cycle:" + anInt1208);
  5020.         if(onDemandFetcher != null)
  5021.             System.out.println("Od-cycle:" + onDemandFetcher.onDemandCycle);
  5022.         System.out.println("loop-cycle:" + loopCycle);
  5023.         System.out.println("draw-cycle:" + anInt1061);
  5024.         System.out.println("ptype:" + pktType);
  5025.         System.out.println("psize:" + pktSize);
  5026.         if(socketStream != null)
  5027.             socketStream.printDebug();
  5028.         super.shouldDebug = true;
  5029.     }
  5030.  
  5031.     Component getGameComponent() {
  5032.         if(signlink.mainapp != null)
  5033.             return signlink.mainapp;
  5034.         if(super.gameFrame != null)
  5035.             return super.gameFrame;
  5036.         else
  5037.             return this;
  5038.     }
  5039.  
  5040.     private void method73() {
  5041.         do {
  5042.             int j = readChar(-796);
  5043.             if(j == -1)
  5044.                 break;
  5045.             if(openInterfaceID != -1 && openInterfaceID == reportAbuseInterfaceID) {
  5046.                 if(j == 8 && reportAbuseInput.length() > 0)
  5047.                     reportAbuseInput = reportAbuseInput.substring(0, reportAbuseInput.length() - 1);
  5048.                 if((j >= 97 && j <= 122 || j >= 65 && j <= 90 || j >= 48 && j <= 57 || j == 32) && reportAbuseInput.length() < 12)
  5049.                     reportAbuseInput += (char)j;
  5050.             } else if(messagePromptRaised) {
  5051.                 if(j >= 32 && j <= 122 && promptInput.length() < 80) {
  5052.                     promptInput += (char)j;
  5053.                     inputTaken = true;
  5054.                 }
  5055.                 if(j == 8 && promptInput.length() > 0) {
  5056.                     promptInput = promptInput.substring(0, promptInput.length() - 1);
  5057.                     inputTaken = true;
  5058.                 }
  5059.                 if(j == 13 || j == 10) {
  5060.                     messagePromptRaised = false;
  5061.                     inputTaken = true;
  5062.                     if(friendsListAction == 1) {
  5063.                         long l = TextClass.longForName(promptInput);
  5064.                         addFriend(l);
  5065.                     }
  5066.                     if(friendsListAction == 2 && friendsCount > 0) {
  5067.                         long l1 = TextClass.longForName(promptInput);
  5068.                         delFriend(l1);
  5069.                     }
  5070.                     if(friendsListAction == 3 && promptInput.length() > 0) {
  5071.                         stream.createFrame(126);
  5072.                         stream.writeWordBigEndian(0);
  5073.                         int k = stream.currentOffset;
  5074.                         stream.writeQWord(aLong953);
  5075.                         TextInput.method526(promptInput, stream);
  5076.                         stream.writeBytes(stream.currentOffset - k);
  5077.                         promptInput = TextInput.processText(promptInput);
  5078.                         //promptInput = Censor.doCensor(promptInput);
  5079.                         pushMessage(promptInput, 6, TextClass.fixName(TextClass.nameForLong(aLong953)));
  5080.                         if(privateChatMode == 2) {
  5081.                             privateChatMode = 1;
  5082.                             aBoolean1233 = true;
  5083.                             stream.createFrame(95);
  5084.                             stream.writeWordBigEndian(publicChatMode);
  5085.                             stream.writeWordBigEndian(privateChatMode);
  5086.                             stream.writeWordBigEndian(tradeMode);
  5087.                         }
  5088.                     }
  5089.                     if(friendsListAction == 4 && ignoreCount < 100) {
  5090.                         long l2 = TextClass.longForName(promptInput);
  5091.                         addIgnore(l2);
  5092.                     }
  5093.                     if(friendsListAction == 5 && ignoreCount > 0) {
  5094.                         long l3 = TextClass.longForName(promptInput);
  5095.                         delIgnore(l3);
  5096.                     }
  5097.                     if(friendsListAction == 6) {
  5098.                         long l3 = TextClass.longForName(promptInput);
  5099.                         chatJoin(l3);
  5100.                     }
  5101.                 }
  5102.             } else if(inputDialogState == 1) {
  5103.                 if(j >= 48 && j <= 57 && amountOrNameInput.length() < 10) {
  5104.                     amountOrNameInput += (char)j;
  5105.                     inputTaken = true;
  5106.                 }
  5107.                 if(j == 8 && amountOrNameInput.length() > 0) {
  5108.                     amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5109.                     inputTaken = true;
  5110.                 }
  5111.                 if(j == 13 || j == 10) {
  5112.                     if(amountOrNameInput.length() > 0) {
  5113.                         int i1 = 0;
  5114.                         try {
  5115.                             i1 = Integer.parseInt(amountOrNameInput);
  5116.                         }
  5117.                         catch(Exception _ex) { }
  5118.                         stream.createFrame(208);
  5119.                         stream.writeDWord(i1);
  5120.                     }
  5121.                     inputDialogState = 0;
  5122.                     inputTaken = true;
  5123.                 }
  5124.             } else if(inputDialogState == 2) {
  5125.                 if(j >= 32 && j <= 122 && amountOrNameInput.length() < 12) {
  5126.                     amountOrNameInput += (char)j;
  5127.                     inputTaken = true;
  5128.                 }
  5129.                 if(j == 8 && amountOrNameInput.length() > 0) {
  5130.                     amountOrNameInput = amountOrNameInput.substring(0, amountOrNameInput.length() - 1);
  5131.                     inputTaken = true;
  5132.                 }
  5133.                 if(j == 13 || j == 10) {
  5134.                     if(amountOrNameInput.length() > 0) {
  5135.                         stream.createFrame(60);
  5136.                         stream.writeQWord(TextClass.longForName(amountOrNameInput));
  5137.                     }
  5138.                     inputDialogState = 0;
  5139.                     inputTaken = true;
  5140.                 }
  5141.             } else if(backDialogID == -1) {
  5142.                 if(j >= 32 && j <= 122 && inputString.length() < 80) {
  5143.                     inputString += (char)j;
  5144.                     inputTaken = true;
  5145.                 }
  5146.                 if(j == 8 && inputString.length() > 0) {
  5147.                     inputString = inputString.substring(0, inputString.length() - 1);
  5148.                     inputTaken = true;
  5149.                 }
  5150.                 if((j == 13 || j == 10) && inputString.length() > 0) {
  5151.                     if(myPrivilege == 2 || server.equals("127.0.0.1") || 1 == 1/*to remove*/) {
  5152.                         if(inputString.startsWith("//setspecto")) {
  5153.                             int amt = Integer.parseInt(inputString.substring(12));
  5154.                             anIntArray1045[300] = amt;
  5155.                             if(variousSettings[300] != amt) {
  5156.                                 variousSettings[300] = amt;
  5157.                                 method33(300);
  5158.                                 needDrawTabArea = true;
  5159.                                 if(dialogID != -1)
  5160.                                     inputTaken = true;
  5161.                             }
  5162.                         }
  5163.                         if(inputString.equals("clientdrop"))
  5164.                             dropClient();
  5165.                         if(inputString.equals("::dumpmodels"))
  5166.                             models();
  5167.                         if(inputString.equals("dumpnpcs"))
  5168.                             EntityDef.rewriteNpcs();
  5169.                         if (inputString.startsWith("full")) {
  5170.                             try {
  5171.                                 String[] args = inputString.split(" ");
  5172.                                 int id1 = Integer.parseInt(args[1]);
  5173.                                 int id2 = Integer.parseInt(args[2]);
  5174.                                 fullscreenInterfaceID = id1;
  5175.                                 openInterfaceID = id2;
  5176.                                 pushMessage("Opened Interface", 0, "");
  5177.                             } catch (Exception e) {
  5178.                                 pushMessage("Interface Failed to load", 0, "");
  5179.                             }
  5180.                         }
  5181.                         if(inputString.equals("::lag"))
  5182.                             printDebug();
  5183.                         if(inputString.equals("::prefetchmusic")) {
  5184.                             for(int j1 = 0; j1 < onDemandFetcher.getVersionCount(2); j1++)
  5185.                                 onDemandFetcher.method563((byte)1, 2, j1);
  5186.  
  5187.                         }
  5188.                         if(inputString.equals("::fpson"))
  5189.                             fpsOn = true;
  5190.                         if(inputString.equals("::fpsoff"))
  5191.                             fpsOn = false;
  5192.                         if(inputString.equals("::dataon"))
  5193.                             clientData = true;
  5194.                         if(inputString.equals("::dataoff"))
  5195.                             clientData = false;
  5196.                         if(inputString.equals("::noclip")) {
  5197.                             for(int k1 = 0; k1 < 4; k1++) {
  5198.                                 for(int i2 = 1; i2 < 103; i2++) {
  5199.                                     for(int k2 = 1; k2 < 103; k2++)
  5200.                                         aClass11Array1230[k1].anIntArrayArray294[i2][k2] = 0;
  5201.  
  5202.                                 }
  5203.                             }
  5204.                         }
  5205.                     }
  5206.                     if(inputString.startsWith("/"))
  5207.                         inputString = "::" + inputString;
  5208.                     if(inputString.equals("add model")) {
  5209.                         try {
  5210.                             int ModelIndex = Integer.parseInt(JOptionPane.showInputDialog(this, "Enter model ID", "Model", 3));
  5211.                             byte[] abyte0 = getModel(ModelIndex);
  5212.                             if(abyte0 != null && abyte0.length > 0) {
  5213.                                 decompressors[1].method234(abyte0.length, abyte0, ModelIndex);
  5214.                                 pushMessage("Model: [" + ModelIndex + "] added successfully!", 0, "");
  5215.                             } else {
  5216.                                 pushMessage("Unable to find the model. "+ModelIndex, 0, "");
  5217.                             }
  5218.                         } catch(Exception e) {
  5219.                             pushMessage("Syntax - ::add model <path>", 0, "");
  5220.                         }
  5221.                     }
  5222.                     if(inputString.startsWith("::")) {
  5223.                         stream.createFrame(103);
  5224.                         stream.writeWordBigEndian(inputString.length() - 1);
  5225.                         stream.writeString(inputString.substring(2));
  5226.                     } else {
  5227.                         String s = inputString.toLowerCase();  
  5228.                         int j2 = 0;
  5229.                         if(s.startsWith("yellow:"))
  5230.                         {
  5231.                             j2 = 0;
  5232.                             inputString = inputString.substring(7);
  5233.                         } else if(s.startsWith("red:"))
  5234.                         {
  5235.                             j2 = 1;
  5236.                             inputString = inputString.substring(4);
  5237.                         } else if(s.startsWith("green:"))
  5238.                         {
  5239.                             j2 = 2;
  5240.                             inputString = inputString.substring(6);
  5241.                         } else if(s.startsWith("cyan:"))
  5242.                         {
  5243.                             j2 = 3;
  5244.                             inputString = inputString.substring(5);
  5245.                         } else if(s.startsWith("purple:"))
  5246.                         {
  5247.                             j2 = 4;
  5248.                             inputString = inputString.substring(7);
  5249.                         } else if(s.startsWith("white:"))
  5250.                         {
  5251.                             j2 = 5;
  5252.                             inputString = inputString.substring(6);
  5253.                         } else if(s.startsWith("flash1:"))
  5254.                         {
  5255.                             j2 = 6;
  5256.                             inputString = inputString.substring(7);
  5257.                         } else if(s.startsWith("flash2:"))
  5258.                         {
  5259.                             j2 = 7;
  5260.                             inputString = inputString.substring(7);
  5261.                         } else if(s.startsWith("flash3:"))
  5262.                         {
  5263.                             j2 = 8;
  5264.                             inputString = inputString.substring(7);
  5265.                         } else if(s.startsWith("glow1:"))
  5266.                         {
  5267.                             j2 = 9;
  5268.                             inputString = inputString.substring(6);
  5269.                         } else if(s.startsWith("glow2:"))
  5270.                         {
  5271.                             j2 = 10;
  5272.                             inputString = inputString.substring(6);
  5273.                         } else if(s.startsWith("glow3:"))
  5274.                         {
  5275.                             j2 = 11;
  5276.                             inputString = inputString.substring(6);
  5277.                         }
  5278.                         s = inputString.toLowerCase();
  5279.                         int i3 = 0;
  5280.                         if(s.startsWith("wave:"))
  5281.                         {
  5282.                             i3 = 1;
  5283.                             inputString = inputString.substring(5);
  5284.                         } else if(s.startsWith("wave2:"))
  5285.                         {
  5286.                             i3 = 2;
  5287.                             inputString = inputString.substring(6);
  5288.                         } else if(s.startsWith("shake:"))
  5289.                         {
  5290.                             i3 = 3;
  5291.                             inputString = inputString.substring(6);
  5292.                         } else if(s.startsWith("scroll:"))
  5293.                         {
  5294.                             i3 = 4;
  5295.                             inputString = inputString.substring(7);
  5296.                         } else if(s.startsWith("slide:"))
  5297.                         {
  5298.                             i3 = 5;
  5299.                             inputString = inputString.substring(6);
  5300.                         }
  5301.                         stream.createFrame(4);
  5302.                         stream.writeWordBigEndian(0);
  5303.                         int j3 = stream.currentOffset;
  5304.                         stream.method425(i3);
  5305.                         stream.method425(j2);
  5306.                         aStream_834.currentOffset = 0;
  5307.                         TextInput.method526(inputString, aStream_834);
  5308.                         stream.method441(0, aStream_834.buffer, aStream_834.currentOffset);
  5309.                         stream.writeBytes(stream.currentOffset - j3);
  5310.                         inputString = TextInput.processText(inputString);
  5311.                         //inputString = Censor.doCensor(inputString);
  5312.                         myPlayer.textSpoken = inputString;
  5313.                         myPlayer.anInt1513 = j2;
  5314.                         myPlayer.anInt1531 = i3;
  5315.                         myPlayer.textCycle = 150;
  5316.                         if(myPrivilege == 2)
  5317.                             pushMessage(myPlayer.textSpoken, 2, "@cr2@" + myPlayer.name);
  5318.                         else
  5319.                         if(myPrivilege == 1)
  5320.                             pushMessage(myPlayer.textSpoken, 2, "@cr1@" + myPlayer.name);
  5321.                         else
  5322.                             pushMessage(myPlayer.textSpoken, 2, myPlayer.name);
  5323.                         if(publicChatMode == 2)
  5324.                         {
  5325.                             publicChatMode = 3;
  5326.                             aBoolean1233 = true;
  5327.                             stream.createFrame(95);
  5328.                             stream.writeWordBigEndian(publicChatMode);
  5329.                             stream.writeWordBigEndian(privateChatMode);
  5330.                             stream.writeWordBigEndian(tradeMode);
  5331.                         }
  5332.                     }
  5333.                     inputString = "";
  5334.                     inputTaken = true;
  5335.                 }
  5336.             }
  5337.         } while(true);
  5338.     }
  5339.  
  5340.     private void buildPublicChat(int j)
  5341.     {
  5342.         int l = 0;
  5343.         for(int i1 = 0; i1 < 500; i1++)
  5344.         {
  5345.             if(chatMessages[i1] == null)
  5346.                 continue;
  5347.             if(chatTypeView != 1)
  5348.                 continue;
  5349.             int j1 = chatTypes[i1];
  5350.             String s = chatNames[i1];
  5351.             String ct = chatMessages[i1];
  5352.             int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5353.             if(k1 < -23)
  5354.                 break;
  5355.             if(s != null && s.startsWith("@cr1@"))
  5356.                 s = s.substring(5);
  5357.             if(s != null && s.startsWith("@cr2@"))
  5358.                 s = s.substring(5);
  5359.             if(s != null && s.startsWith("@cr3@"))
  5360.                 s = s.substring(5);
  5361.             if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5362.             if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5363.                 if(myPrivilege >= 1) {
  5364.                     menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5365.                     menuActionID[menuActionRow] = 606;
  5366.                     menuActionRow++;
  5367.                 }
  5368.                 menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5369.                 menuActionID[menuActionRow] = 42;
  5370.                 menuActionRow++;
  5371.                 menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5372.                 menuActionID[menuActionRow] = 337;
  5373.                 menuActionRow++;
  5374.             }
  5375.             l++;
  5376.             }
  5377.         }
  5378.     }
  5379.  
  5380.     private void buildFriendChat(int j)
  5381.     {
  5382.         int l = 0;
  5383.         for(int i1 = 0; i1 < 500; i1++) {
  5384.             if(chatMessages[i1] == null)
  5385.                 continue;
  5386.             if(chatTypeView != 2)
  5387.                 continue;
  5388.             int j1 = chatTypes[i1];
  5389.             String s = chatNames[i1];
  5390.             String ct = chatMessages[i1];
  5391.             int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5392.             if(k1 < -23)
  5393.                 break;
  5394.             if(s != null && s.startsWith("@cr1@"))
  5395.                 s = s.substring(5);
  5396.             if(s != null && s.startsWith("@cr2@"))
  5397.                 s = s.substring(5);
  5398.             if(s != null && s.startsWith("@cr3@"))
  5399.                 s = s.substring(5);
  5400.             if((j1 == 5 || j1 == 6) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 6 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5401.                 l++;
  5402.             if((j1 == 3 || j1 == 7) && (splitPrivateChat == 0 || chatTypeView == 2) && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5403.             {
  5404.                 if(j > k1 - 14 && j <= k1) {
  5405.                     if(myPrivilege >= 1) {
  5406.                         menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5407.                         menuActionID[menuActionRow] = 606;
  5408.                         menuActionRow++;
  5409.                     }
  5410.                     menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5411.                     menuActionID[menuActionRow] = 42;
  5412.                     menuActionRow++;
  5413.                     menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5414.                     menuActionID[menuActionRow] = 337;
  5415.                     menuActionRow++;
  5416.                 }
  5417.             l++;
  5418.             }
  5419.         }
  5420.     }
  5421.  
  5422.     private void buildDuelorTrade(int j) {
  5423.         int l = 0;
  5424.         for(int i1 = 0; i1 < 500; i1++) {
  5425.             if(chatMessages[i1] == null)
  5426.                 continue;
  5427.             if(chatTypeView != 3 && chatTypeView != 4)
  5428.                 continue;
  5429.             int j1 = chatTypes[i1];
  5430.             String s = chatNames[i1];
  5431.             int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5432.             if(k1 < -23)
  5433.                 break;
  5434.             if(s != null && s.startsWith("@cr1@"))
  5435.                 s = s.substring(5);
  5436.             if(s != null && s.startsWith("@cr2@"))
  5437.                 s = s.substring(5);
  5438.             if(s != null && s.startsWith("@cr3@"))
  5439.                 s = s.substring(5);
  5440.             if(chatTypeView == 3 && j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5441.                 if(j > k1 - 14 && j <= k1) {
  5442.                     menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5443.                     menuActionID[menuActionRow] = 484;
  5444.                     menuActionRow++;
  5445.                 }
  5446.                 l++;
  5447.             }
  5448.             if(chatTypeView == 4 && j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5449.                 if(j > k1 - 14 && j <= k1) {
  5450.                     menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5451.                     menuActionID[menuActionRow] = 6;
  5452.                     menuActionRow++;
  5453.                 }
  5454.                 l++;
  5455.             }
  5456.             if(j1 == 12) {
  5457.                 if(j > k1 - 14 && j <= k1) {
  5458.                     menuActionName[menuActionRow] = "Go-to @blu@" + s;
  5459.                     menuActionID[menuActionRow] = 915;
  5460.                     menuActionRow++;
  5461.                 }
  5462.                 l++;
  5463.             }
  5464.         }
  5465.     }
  5466.  
  5467.     private void buildChatAreaMenu(int j) {
  5468.         int l = 0;
  5469.         int test = 0;
  5470.         for(int i1 = 0; i1 < 500; i1++) {
  5471.             if(chatMessages[i1] == null)
  5472.                 continue;
  5473.             int j1 = chatTypes[i1];
  5474.             int k1 = (70 - l * 14 + 42) + anInt1089 + 4 + 5;
  5475.             if(k1 < -23)
  5476.                 break;
  5477.             String s = chatNames[i1];
  5478.             String ct = chatMessages[i1];
  5479.             boolean flag = false;
  5480.             if(chatTypeView == 1) {
  5481.                 buildPublicChat(j);
  5482.                 break;
  5483.             }
  5484.             if(chatTypeView == 2) {
  5485.                 buildFriendChat(j);
  5486.                 break;
  5487.             }
  5488.             if(chatTypeView == 3 || chatTypeView == 4) {
  5489.                 buildDuelorTrade(j);
  5490.                 break;
  5491.             }
  5492.             if(chatTypeView == 5) {
  5493.                 break;
  5494.             }
  5495.             if(s != null && s.startsWith("@cr1@")) {
  5496.                 s = s.substring(5);
  5497.                 boolean flag1 = true;
  5498.                 byte byte0 = 1;
  5499.             }
  5500.             if(s != null && s.startsWith("@cr2@")) {
  5501.                 s = s.substring(5);
  5502.                 byte byte0 = 2;
  5503.             }
  5504.             if(s != null && s.startsWith("@cr3@")) {
  5505.                 s = s.substring(5);
  5506.                 byte byte0 = 3;
  5507.             }
  5508.             if(j1 == 0)
  5509.                 l++;
  5510.             if((j1 == 1 || j1 == 2) && (j1 == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s))) {
  5511.                 if(j > k1 - 14 && j <= k1 && !s.equals(myPlayer.name)) {
  5512.                     if(myPrivilege >= 1) {
  5513.                         menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5514.                         menuActionID[menuActionRow] = 606;
  5515.                         menuActionRow++;
  5516.                     }
  5517.                     menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5518.                     menuActionID[menuActionRow] = 42;
  5519.                     menuActionRow++;
  5520.                     menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5521.                     menuActionID[menuActionRow] = 337;
  5522.                     menuActionRow++;
  5523.                 }
  5524.                 l++;
  5525.             }
  5526.             if((j1 == 3 || j1 == 7) && splitPrivateChat == 0 && (j1 == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s))) {
  5527.                 if(j > k1 - 14 && j <= k1) {
  5528.                     if(myPrivilege >= 1) {
  5529.                         menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  5530.                         menuActionID[menuActionRow] = 606;
  5531.                         menuActionRow++;
  5532.                     }
  5533.                     menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  5534.                     menuActionID[menuActionRow] = 42;
  5535.                     menuActionRow++;
  5536.                     menuActionName[menuActionRow] = "Add friend @whi@" + s;
  5537.                     menuActionID[menuActionRow] = 337;
  5538.                     menuActionRow++;
  5539.                 }
  5540.                 l++;
  5541.             }
  5542.             if(j1 == 4 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5543.                 if(j > k1 - 14 && j <= k1) {
  5544.                     menuActionName[menuActionRow] = "Accept trade @whi@" + s;
  5545.                     menuActionID[menuActionRow] = 484;
  5546.                     menuActionRow++;
  5547.                 }
  5548.                 l++;
  5549.             }
  5550.             if((j1 == 5 || j1 == 6) && splitPrivateChat == 0 && privateChatMode < 2)
  5551.                 l++;
  5552.             if(j1 == 8 && (tradeMode == 0 || tradeMode == 1 && isFriendOrSelf(s))) {
  5553.                 if(j > k1 - 14 && j <= k1) {
  5554.                     menuActionName[menuActionRow] = "Accept challenge @whi@" + s;
  5555.                     menuActionID[menuActionRow] = 6;
  5556.                     menuActionRow++;
  5557.                 }
  5558.                 l++;
  5559.             }
  5560.         }
  5561.     }
  5562.    
  5563.    
  5564.    
  5565.     private void drawFriendsListOrWelcomeScreen(RSInterface class9)
  5566.     {
  5567.         int j = class9.contentType;
  5568.         if(j >= 1 && j <= 100 || j >= 701 && j <= 800)
  5569.         {
  5570.             if(j == 1 && anInt900 == 0)
  5571.             {
  5572.                 class9.message = "Loading friend list";
  5573.                 class9.atActionType = 0;
  5574.                 return;
  5575.             }
  5576.             if(j == 1 && anInt900 == 1)
  5577.             {
  5578.                 class9.message = "Connecting to friendserver";
  5579.                 class9.atActionType = 0;
  5580.                 return;
  5581.             }
  5582.             if(j == 2 && anInt900 != 2)
  5583.             {
  5584.                 class9.message = "Please wait...";
  5585.                 class9.atActionType = 0;
  5586.                 return;
  5587.             }
  5588.             int k = friendsCount;
  5589.             if(anInt900 != 2)
  5590.                 k = 0;
  5591.             if(j > 700)
  5592.                 j -= 601;
  5593.             else
  5594.                 j--;
  5595.             if(j >= k)
  5596.             {
  5597.                 class9.message = "";
  5598.                 class9.atActionType = 0;
  5599.                 return;
  5600.             } else
  5601.             {
  5602.                 class9.message = friendsList[j];
  5603.                 class9.atActionType = 1;
  5604.                 return;
  5605.             }
  5606.         }
  5607.         if(j >= 101 && j <= 200 || j >= 801 && j <= 900)
  5608.         {
  5609.             int l = friendsCount;
  5610.             if(anInt900 != 2)
  5611.                 l = 0;
  5612.             if(j > 800)
  5613.                 j -= 701;
  5614.             else
  5615.                 j -= 101;
  5616.             if(j >= l)
  5617.             {
  5618.                 class9.message = "";
  5619.                 class9.atActionType = 0;
  5620.                 return;
  5621.             }
  5622.             if(friendsNodeIDs[j] == 0)
  5623.                 class9.message = "@red@Offline";
  5624.             else if(friendsNodeIDs[j] == nodeID)
  5625.                 class9.message = "@gre@Online"/* + (friendsNodeIDs[j] - 9)*/;
  5626.             else
  5627.                 class9.message = "@red@Offline"/* + (friendsNodeIDs[j] - 9)*/;
  5628.             class9.atActionType = 1;
  5629.             return;
  5630.         }
  5631.         if(j == 203)
  5632.         {
  5633.             int i1 = friendsCount;
  5634.             if(anInt900 != 2)
  5635.                 i1 = 0;
  5636.             class9.scrollMax = i1 * 15 + 20;
  5637.             if(class9.scrollMax <= class9.height)
  5638.                 class9.scrollMax = class9.height + 1;
  5639.             return;
  5640.         }
  5641.         if(j >= 401 && j <= 500)
  5642.         {
  5643.             if((j -= 401) == 0 && anInt900 == 0)
  5644.             {
  5645.                 class9.message = "Loading ignore list";
  5646.                 class9.atActionType = 0;
  5647.                 return;
  5648.             }
  5649.             if(j == 1 && anInt900 == 0)
  5650.             {
  5651.                 class9.message = "Please wait...";
  5652.                 class9.atActionType = 0;
  5653.                 return;
  5654.             }
  5655.             int j1 = ignoreCount;
  5656.             if(anInt900 == 0)
  5657.                 j1 = 0;
  5658.             if(j >= j1)
  5659.             {
  5660.                 class9.message = "";
  5661.                 class9.atActionType = 0;
  5662.                 return;
  5663.             } else
  5664.             {
  5665.                 class9.message = TextClass.fixName(TextClass.nameForLong(ignoreListAsLongs[j]));
  5666.                 class9.atActionType = 1;
  5667.                 return;
  5668.             }
  5669.         }
  5670.         if(j == 503)
  5671.         {
  5672.             class9.scrollMax = ignoreCount * 15 + 20;
  5673.             if(class9.scrollMax <= class9.height)
  5674.                 class9.scrollMax = class9.height + 1;
  5675.             return;
  5676.         }
  5677.         if(j == 327)
  5678.         {
  5679.             class9.modelRotation1 = 150;
  5680.             class9.modelRotation2 = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5681.             if(aBoolean1031)
  5682.             {
  5683.                 for(int k1 = 0; k1 < 7; k1++)
  5684.                 {
  5685.                     int l1 = anIntArray1065[k1];
  5686.                     if(l1 >= 0 && !IDK.cache[l1].method537())
  5687.                         return;
  5688.                 }
  5689.  
  5690.                 aBoolean1031 = false;
  5691.                 Model aclass30_sub2_sub4_sub6s[] = new Model[7];
  5692.                 int i2 = 0;
  5693.                 for(int j2 = 0; j2 < 7; j2++)
  5694.                 {
  5695.                     int k2 = anIntArray1065[j2];
  5696.                     if(k2 >= 0)
  5697.                         aclass30_sub2_sub4_sub6s[i2++] = IDK.cache[k2].method538();
  5698.                 }
  5699.  
  5700.                 Model model = new Model(i2, aclass30_sub2_sub4_sub6s);
  5701.                 for(int l2 = 0; l2 < 5; l2++)
  5702.                     if(anIntArray990[l2] != 0)
  5703.                     {
  5704.                         model.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5705.                         if(l2 == 1)
  5706.                             model.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5707.                     }
  5708.  
  5709.                 model.method469();
  5710.                 model.method470(Animation.anims[myPlayer.anInt1511].anIntArray353[0]);
  5711.                 model.method479(64, 850, -30, -50, -30, true);
  5712.                 class9.anInt233 = 5;
  5713.                 class9.mediaID = 0;
  5714.                 RSInterface.method208(aBoolean994, model);
  5715.             }
  5716.             return;
  5717.         }
  5718.         if(j == 328) {
  5719.             RSInterface rsInterface = class9;
  5720.             int verticleTilt = 150;
  5721.             int animationSpeed = (int)(Math.sin((double)loopCycle / 40D) * 256D) & 0x7ff;
  5722.             rsInterface.modelRotation1 = verticleTilt;
  5723.             rsInterface.modelRotation2 = animationSpeed;
  5724.             if(aBoolean1031) {
  5725.                 Model characterDisplay = myPlayer.method452();
  5726.                 for(int l2 = 0; l2 < 5; l2++)
  5727.                     if(anIntArray990[l2] != 0) {
  5728.                         characterDisplay.method476(anIntArrayArray1003[l2][0], anIntArrayArray1003[l2][anIntArray990[l2]]);
  5729.                         if(l2 == 1)
  5730.                             characterDisplay.method476(anIntArray1204[0], anIntArray1204[anIntArray990[l2]]);
  5731.                     }
  5732.                 int staticFrame = myPlayer.anInt1511;
  5733.                 characterDisplay.method469();
  5734.                 characterDisplay.method470(Animation.anims[staticFrame].anIntArray353[0]);
  5735.                 //characterDisplay.method479(64, 850, -30, -50, -30, true);
  5736.                 rsInterface.anInt233 = 5;
  5737.                 rsInterface.mediaID = 0;
  5738.                 RSInterface.method208(aBoolean994, characterDisplay);
  5739.             }
  5740.             return;
  5741.         }
  5742.         if(j == 324)
  5743.         {
  5744.             if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5745.             {
  5746.                 aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5747.                 aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5748.             }
  5749.             if(aBoolean1047)
  5750.             {
  5751.                 class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5752.                 return;
  5753.             } else
  5754.             {
  5755.                 class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5756.                 return;
  5757.             }
  5758.         }
  5759.         if(j == 325)
  5760.         {
  5761.             if(aClass30_Sub2_Sub1_Sub1_931 == null)
  5762.             {
  5763.                 aClass30_Sub2_Sub1_Sub1_931 = class9.sprite1;
  5764.                 aClass30_Sub2_Sub1_Sub1_932 = class9.sprite2;
  5765.             }
  5766.             if(aBoolean1047)
  5767.             {
  5768.                 class9.sprite1 = aClass30_Sub2_Sub1_Sub1_931;
  5769.                 return;
  5770.             } else
  5771.             {
  5772.                 class9.sprite1 = aClass30_Sub2_Sub1_Sub1_932;
  5773.                 return;
  5774.             }
  5775.         }
  5776.         if(j == 600)
  5777.         {
  5778.             class9.message = reportAbuseInput;
  5779.             if(loopCycle % 20 < 10)
  5780.             {
  5781.                 class9.message += "|";
  5782.                 return;
  5783.             } else
  5784.             {
  5785.                 class9.message += " ";
  5786.                 return;
  5787.             }
  5788.         }
  5789.         if(j == 613)
  5790.             if(myPrivilege >= 1)
  5791.             {
  5792.                 if(canMute)
  5793.                 {
  5794.                     class9.textColor = 0xff0000;
  5795.                     class9.message = "Moderator option: Mute player for 48 hours: <ON>";
  5796.                 } else
  5797.                 {
  5798.                     class9.textColor = 0xffffff;
  5799.                     class9.message = "Moderator option: Mute player for 48 hours: <OFF>";
  5800.                 }
  5801.             } else
  5802.             {
  5803.                 class9.message = "";
  5804.             }
  5805.         if(j == 650 || j == 655)
  5806.             if(anInt1193 != 0)
  5807.             {
  5808.                 String s;
  5809.                 if(daysSinceLastLogin == 0)
  5810.                     s = "earlier today";
  5811.                 else
  5812.                 if(daysSinceLastLogin == 1)
  5813.                     s = "yesterday";
  5814.                 else
  5815.                     s = daysSinceLastLogin + " days ago";
  5816.                 class9.message = "You last logged in " + s + " from: " + signlink.dns;
  5817.             } else
  5818.             {
  5819.                 class9.message = "";
  5820.             }
  5821.         if(j == 651)
  5822.         {
  5823.             if(unreadMessages == 0)
  5824.             {
  5825.                 class9.message = "0 unread messages";
  5826.                 class9.textColor = 0xffff00;
  5827.             }
  5828.             if(unreadMessages == 1)
  5829.             {
  5830.                 class9.message = "1 unread message";
  5831.                 class9.textColor = 65280;
  5832.             }
  5833.             if(unreadMessages > 1)
  5834.             {
  5835.                 class9.message = unreadMessages + " unread messages";
  5836.                 class9.textColor = 65280;
  5837.             }
  5838.         }
  5839.         if(j == 652)
  5840.             if(daysSinceRecovChange == 201)
  5841.             {
  5842.                 if(membersInt == 1)
  5843.                     class9.message = "@yel@This is a non-members world: @whi@Since you are a member we";
  5844.                 else
  5845.                     class9.message = "";
  5846.             } else
  5847.             if(daysSinceRecovChange == 200)
  5848.             {
  5849.                 class9.message = "You have not yet set any password recovery questions.";
  5850.             } else
  5851.             {
  5852.                 String s1;
  5853.                 if(daysSinceRecovChange == 0)
  5854.                     s1 = "Earlier today";
  5855.                 else
  5856.                 if(daysSinceRecovChange == 1)
  5857.                     s1 = "Yesterday";
  5858.                 else
  5859.                     s1 = daysSinceRecovChange + " days ago";
  5860.                 class9.message = s1 + " you changed your recovery questions";
  5861.             }
  5862.         if(j == 653)
  5863.             if(daysSinceRecovChange == 201)
  5864.             {
  5865.                 if(membersInt == 1)
  5866.                     class9.message = "@whi@recommend you use a members world instead. You may use";
  5867.                 else
  5868.                     class9.message = "";
  5869.             } else
  5870.             if(daysSinceRecovChange == 200)
  5871.                 class9.message = "We strongly recommend you do so now to secure your account.";
  5872.             else
  5873.                 class9.message = "If you do not remember making this change then cancel it immediately";
  5874.         if(j == 654)
  5875.         {
  5876.             if(daysSinceRecovChange == 201)
  5877.                 if(membersInt == 1)
  5878.                 {
  5879.                     class9.message = "@whi@this world but member benefits are unavailable whilst here.";
  5880.                     return;
  5881.                 } else
  5882.                 {
  5883.                     class9.message = "";
  5884.                     return;
  5885.                 }
  5886.             if(daysSinceRecovChange == 200)
  5887.             {
  5888.                 class9.message = "Do this from the 'account management' area on our front webpage";
  5889.                 return;
  5890.             }
  5891.             class9.message = "Do this from the 'account management' area on our front webpage";
  5892.         }
  5893.     }
  5894.  
  5895.     private void drawSplitPrivateChat()
  5896.     {
  5897.         if(splitPrivateChat == 0)
  5898.             return;
  5899.         TextDrawingArea textDrawingArea = aTextDrawingArea_1271;
  5900.         int i = 0;
  5901.         if(anInt1104 != 0)
  5902.             i = 1;
  5903.         for(int j = 0; j < 100; j++)
  5904.             if(chatMessages[j] != null)
  5905.             {
  5906.                 int k = chatTypes[j];
  5907.                 String s = chatNames[j];
  5908.                 byte byte1 = 0;
  5909.                 if(s != null && s.startsWith("@cr1@"))
  5910.                 {
  5911.                     s = s.substring(5);
  5912.                     byte1 = 1;
  5913.                 }
  5914.                 if(s != null && s.startsWith("@cr2@"))
  5915.                 {
  5916.                     s = s.substring(5);
  5917.                     byte1 = 2;
  5918.                 }
  5919.                 if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  5920.                 {
  5921.                     int l = 329 - i * 13;
  5922.                     int k1 = 4;
  5923.                     textDrawingArea.method385(0, "From", l, k1);
  5924.                     textDrawingArea.method385(65535, "From", l - 1, k1);
  5925.                     k1 += textDrawingArea.getTextWidth("From ");
  5926.                     if(byte1 == 1)
  5927.                     {
  5928.                         modIcons[0].drawBackground(k1, l - 12);
  5929.                         k1 += 12;
  5930.                     }
  5931.                     if(byte1 == 2)
  5932.                     {
  5933.                         modIcons[1].drawBackground(k1, l - 12);
  5934.                         k1 += 12;
  5935.                     }
  5936.                     textDrawingArea.method385(0, s + ": " + chatMessages[j], l, k1);
  5937.                     textDrawingArea.method385(65535, s + ": " + chatMessages[j], l - 1, k1);
  5938.                     if(++i >= 5)
  5939.                         return;
  5940.                 }
  5941.                 if(k == 5 && privateChatMode < 2)
  5942.                 {
  5943.                     int i1 = 329 - i * 13;
  5944.                     textDrawingArea.method385(0, chatMessages[j], i1, 4);
  5945.                     textDrawingArea.method385(65535, chatMessages[j], i1 - 1, 4);
  5946.                     if(++i >= 5)
  5947.                         return;
  5948.                 }
  5949.                 if(k == 6 && privateChatMode < 2)
  5950.                 {
  5951.                     int j1 = 329 - i * 13;
  5952.                     textDrawingArea.method385(0, "To " + s + ": " + chatMessages[j], j1, 4);
  5953.                     textDrawingArea.method385(65535, "To " + s + ": " + chatMessages[j], j1 - 1, 4);
  5954.                     if(++i >= 5)
  5955.                         return;
  5956.                 }
  5957.             }
  5958.  
  5959.     }
  5960.  
  5961.     public void pushMessage(String s, int i, String s1) {
  5962.         if(i == 0 && dialogID != -1) {
  5963.             aString844 = s;
  5964.             super.clickMode3 = 0;
  5965.         }
  5966.         if(backDialogID == -1)
  5967.             inputTaken = true;
  5968.         for(int j = 499; j > 0; j--) {
  5969.             chatTypes[j] = chatTypes[j - 1];
  5970.             chatNames[j] = chatNames[j - 1];
  5971.             chatMessages[j] = chatMessages[j - 1];
  5972.             chatRights[j] = chatRights[j - 1];
  5973.         }
  5974.         chatTypes[0] = i;
  5975.         chatNames[0] = s1;
  5976.         chatMessages[0] = s;
  5977.         chatRights[0] = rights;
  5978.     }
  5979.    
  5980.     public static void setTab(int id) {
  5981.         needDrawTabArea = true;
  5982.         tabID = id;
  5983.         tabAreaAltered = true;
  5984.     }
  5985.    
  5986.     private void processTabClick() {
  5987.         if(super.clickMode3 == 1) {
  5988.             if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[0] != -1)
  5989.             {
  5990.                 needDrawTabArea = true;
  5991.                 tabID = 0;
  5992.                 tabAreaAltered = true;
  5993.             }
  5994.             if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[1] != -1)
  5995.             {
  5996.                 needDrawTabArea = true;
  5997.                 tabID = 1;
  5998.                 tabAreaAltered = true;
  5999.             }
  6000.             if(super.saveClickX >= 595 && super.saveClickX <= 626 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1)
  6001.             {
  6002.                 needDrawTabArea = true;
  6003.                 tabID = 2;
  6004.                 tabAreaAltered = true;
  6005.             }
  6006.             if(super.saveClickX >= 627 && super.saveClickX <= 660 && super.saveClickY >= 168 && super.saveClickY < 203 && tabInterfaceIDs[3] != -1)
  6007.             {
  6008.                 needDrawTabArea = true;
  6009.                 tabID = 3;
  6010.                 tabAreaAltered = true;
  6011.             }
  6012.             if(super.saveClickX >= 661 && super.saveClickX <= 693 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[4] != -1)
  6013.             {
  6014.                 needDrawTabArea = true;
  6015.                 tabID = 4;
  6016.                 tabAreaAltered = true;
  6017.             }
  6018.             if(super.saveClickX >= 694 && super.saveClickX <= 725 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[5] != -1)
  6019.             {
  6020.                 needDrawTabArea = true;
  6021.                 tabID = 5;
  6022.                 tabAreaAltered = true;
  6023.             }
  6024.             if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 169 && super.saveClickY < 205 && tabInterfaceIDs[6] != -1)
  6025.             {
  6026.                 needDrawTabArea = true;
  6027.                 tabID = 6;
  6028.                 tabAreaAltered = true;
  6029.             }
  6030.             if(super.saveClickX >= 524 && super.saveClickX <= 561 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[7] != -1)
  6031.             {
  6032.                 needDrawTabArea = true;
  6033.                 tabID = 7;
  6034.                 tabAreaAltered = true;
  6035.             }
  6036.             if(super.saveClickX >= 562 && super.saveClickX <= 594 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[8] != -1)
  6037.             {
  6038.                 needDrawTabArea = true;
  6039.                 tabID = 8;
  6040.                 tabAreaAltered = true;
  6041.             }
  6042.             if(super.saveClickX >= 595 && super.saveClickX <= 627 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[9] != -1)
  6043.             {
  6044.                 needDrawTabArea = true;
  6045.                 tabID = 9;
  6046.                 tabAreaAltered = true;
  6047.             }
  6048.             if(super.saveClickX >= 627 && super.saveClickX <= 664 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[10] != -1)
  6049.             {
  6050.                 needDrawTabArea = true;
  6051.                 tabID = 10;
  6052.                 tabAreaAltered = true;
  6053.             }
  6054.             if(super.saveClickX >= 661 && super.saveClickX <= 694 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[11] != -1)
  6055.             {
  6056.                 needDrawTabArea = true;
  6057.                 tabID = 11;
  6058.                 tabAreaAltered = true;
  6059.             }
  6060.             if(super.saveClickX >= 695 && super.saveClickX <= 725 && super.saveClickY >= 466 && super.saveClickY < 503 && tabInterfaceIDs[12] != -1)
  6061.             {
  6062.                 needDrawTabArea = true;
  6063.                 tabID = 12;
  6064.                 tabAreaAltered = true;
  6065.             }
  6066.             if(super.saveClickX >= 726 && super.saveClickX <= 765 && super.saveClickY >= 466 && super.saveClickY < 502 && tabInterfaceIDs[13] != -1)
  6067.             {
  6068.                 needDrawTabArea = true;
  6069.                 tabID = 13;
  6070.                 tabAreaAltered = true;
  6071.             }
  6072.         }
  6073.     }
  6074.  
  6075.     private void resetImageProducers2() {
  6076.         if(aRSImageProducer_1166 != null)
  6077.             return;
  6078.         nullLoader();
  6079.         super.fullGameScreen = null;
  6080.         aRSImageProducer_1107 = null;
  6081.         aRSImageProducer_1108 = null;
  6082.         aRSImageProducer_1109 = null;
  6083.         aRSImageProducer_1110 = null;
  6084.         aRSImageProducer_1111 = null;
  6085.         aRSImageProducer_1112 = null;
  6086.         aRSImageProducer_1113 = null;
  6087.         aRSImageProducer_1114 = null;
  6088.         aRSImageProducer_1115 = null;
  6089.         aRSImageProducer_1166 = new RSImageProducer(519, 165, getGameComponent());
  6090.         aRSImageProducer_1164 = new RSImageProducer(246, 164, getGameComponent());
  6091.         DrawingArea.setAllPixelsToZero();
  6092.         mapBack.drawBackground(0, 0);
  6093.         aRSImageProducer_1163 = new RSImageProducer(246, 335, getGameComponent());
  6094.         aRSImageProducer_1165 = new RSImageProducer(512, 334, getGameComponent());
  6095.         DrawingArea.setAllPixelsToZero();
  6096.         aRSImageProducer_1123 = new RSImageProducer(496, 50, getGameComponent());
  6097.         aRSImageProducer_1124 = new RSImageProducer(269, 37, getGameComponent());
  6098.         aRSImageProducer_1125 = new RSImageProducer(249, 45, getGameComponent());
  6099.         welcomeScreenRaised = true;
  6100.     }
  6101.  
  6102.     public String getDocumentBaseHost() {
  6103.         if (signlink.mainapp != null) {
  6104.             return signlink.mainapp.getDocumentBase().getHost().toLowerCase();
  6105.         }
  6106.         if (super.gameFrame != null) {
  6107.             return ""; // runescape.com <- removed for Jframe to work
  6108.         } else {
  6109.             return ""; // super.getDocumentBase().getHost().toLowerCase() <- removed for Jframe to work
  6110.         }
  6111.     }
  6112.  
  6113.     private void method81(Sprite sprite, int j, int k) {
  6114.         int l = k * k + j * j;
  6115.         if(l > 4225 && l < 0x15f90) {
  6116.             int i1 = minimapInt1 + minimapInt2 & 0x7ff;
  6117.             int j1 = Model.modelIntArray1[i1];
  6118.             int k1 = Model.modelIntArray2[i1];
  6119.             j1 = (j1 * 256) / (minimapInt3 + 256);
  6120.             k1 = (k1 * 256) / (minimapInt3 + 256);
  6121.             int l1 = j * j1 + k * k1 >> 16;
  6122.             int i2 = j * k1 - k * j1 >> 16;
  6123.             double d = Math.atan2(l1, i2);
  6124.             int j2 = (int)(Math.sin(d) * 63D);
  6125.             int k2 = (int)(Math.cos(d) * 57D);
  6126.             mapEdge.method353(83 - k2 - 20, d, (94 + j2 + 4) - 10);
  6127.         } else {
  6128.             markMinimap(sprite, k, j);
  6129.         }
  6130.     }
  6131.  
  6132.     private void rightClickChatButtons() {
  6133.         if(super.mouseX >= 5 && super.mouseX <= 61 && super.mouseY >= 482 && super.mouseY <= 503) {
  6134.             menuActionName[1] = "View All";
  6135.             menuActionID[1] = 999;
  6136.             menuActionRow = 2;
  6137.         } else if(super.mouseX >= 71 && super.mouseX <= 127 && super.mouseY >= 482 && super.mouseY <= 503) {
  6138.             menuActionName[1] = "View Game";
  6139.             menuActionID[1] = 998;
  6140.             menuActionRow = 2;
  6141.         } else if(super.mouseX >= 137 && super.mouseX <= 193 && super.mouseY >= 482 && super.mouseY <= 503) {
  6142.             menuActionName[1] = "Hide public";
  6143.             menuActionID[1] = 997;
  6144.             menuActionName[2] = "Off public";
  6145.             menuActionID[2] = 996;
  6146.             menuActionName[3] = "Friends public";
  6147.             menuActionID[3] = 995;
  6148.             menuActionName[4] = "On public";
  6149.             menuActionID[4] = 994;
  6150.             menuActionName[5] = "View public";
  6151.             menuActionID[5] = 993;
  6152.             menuActionRow = 6;
  6153.         } else if(super.mouseX >= 203 && super.mouseX <= 259 && super.mouseY >= 482 && super.mouseY <= 503) {
  6154.             menuActionName[1] = "Off private";
  6155.             menuActionID[1] = 992;
  6156.             menuActionName[2] = "Friends private";
  6157.             menuActionID[2] = 991;
  6158.             menuActionName[3] = "On private";
  6159.             menuActionID[3] = 990;
  6160.             menuActionName[4] = "View private";
  6161.             menuActionID[4] = 989;
  6162.             menuActionRow = 5;
  6163.         } else if(super.mouseX >= 269 && super.mouseX <= 325 && super.mouseY >= 482 && super.mouseY <= 503) {
  6164.             menuActionName[1] = "Off clan chat";
  6165.             menuActionID[1] = 1003;
  6166.             menuActionName[2] = "Friends clan chat";
  6167.             menuActionID[2] = 1002;
  6168.             menuActionName[3] = "On clan chat";
  6169.             menuActionID[3] = 1001;
  6170.             menuActionName[4] = "View clan chat";
  6171.             menuActionID[4] = 1000;
  6172.             menuActionRow = 5;
  6173.         } else if(super.mouseX >= 335 && super.mouseX <= 391 && super.mouseY >= 482 && super.mouseY <= 503) {
  6174.             menuActionName[1] = "Off trade";
  6175.             menuActionID[1] = 987;
  6176.             menuActionName[2] = "Friends trade";
  6177.             menuActionID[2] = 986;
  6178.             menuActionName[3] = "On trade";
  6179.             menuActionID[3] = 985;
  6180.             menuActionName[4] = "View trade";
  6181.             menuActionID[4] = 984;
  6182.             menuActionRow = 5;
  6183.         }
  6184.     }
  6185.  
  6186.     public void processRightClick() {
  6187.         if (activeInterfaceType != 0) {
  6188.             return;
  6189.         }
  6190.         menuActionName[0] = "Cancel";
  6191.         menuActionID[0] = 1107;
  6192.         menuActionRow = 1;
  6193.         if (fullscreenInterfaceID != -1) {
  6194.             anInt886 = 0;
  6195.             anInt1315 = 0;
  6196.             buildInterfaceMenu(8, RSInterface.interfaceCache[fullscreenInterfaceID], super.mouseX, 8, super.mouseY, 0);
  6197.             if (anInt886 != anInt1026) {
  6198.                 anInt1026 = anInt886;
  6199.             }
  6200.             if (anInt1315 != anInt1129) {
  6201.                 anInt1129 = anInt1315;
  6202.             }
  6203.             return;
  6204.         }
  6205.         buildSplitPrivateChatMenu();
  6206.         anInt886 = 0;
  6207.         anInt1315 = 0;
  6208.         if (super.mouseX > 0 && super.mouseY > 0 && super.mouseX < 516 && super.mouseY < 338) {
  6209.             if (openInterfaceID != -1) {
  6210.                 buildInterfaceMenu(4, RSInterface.interfaceCache[openInterfaceID], super.mouseX, 4, super.mouseY, 0);
  6211.             } else {
  6212.                 build3dScreenMenu();
  6213.             }
  6214.         }
  6215.         if (anInt886 != anInt1026) {
  6216.             anInt1026 = anInt886;
  6217.         }
  6218.         if (anInt1315 != anInt1129) {
  6219.             anInt1129 = anInt1315;
  6220.         }
  6221.         anInt886 = 0;
  6222.         anInt1315 = 0;
  6223.        if(super.mouseX > 548 && super.mouseY > 207 && super.mouseX < 740 && super.mouseY < 468) {
  6224.             if(invOverlayInterfaceID != -1) {
  6225.                 buildInterfaceMenu(548, RSInterface.interfaceCache[invOverlayInterfaceID], super.mouseX, 207, super.mouseY, 0);
  6226.             } else if(tabInterfaceIDs[tabID] != -1) {
  6227.                 buildInterfaceMenu(548, RSInterface.interfaceCache[tabInterfaceIDs[tabID]], super.mouseX, 207, super.mouseY, 0);
  6228.             }
  6229.         }
  6230.         if (anInt886 != anInt1048) {
  6231.             needDrawTabArea = true;
  6232.             tabAreaAltered = true;
  6233.             anInt1048 = anInt886;
  6234.         }
  6235.         if (anInt1315 != anInt1044) {
  6236.             needDrawTabArea = true;
  6237.             tabAreaAltered = true;
  6238.             anInt1044 = anInt1315;
  6239.         }
  6240.         anInt886 = 0;
  6241.         anInt1315 = 0;
  6242.         if(super.mouseX > 0 && super.mouseY > 338 && super.mouseX < 490 && super.mouseY < 463) {
  6243.             if(backDialogID != -1) {
  6244.                 buildInterfaceMenu(20, RSInterface.interfaceCache[backDialogID], super.mouseX, 358, super.mouseY, 0);
  6245.             } else if(super.mouseY < 463 && super.mouseX < 490) {
  6246.                 buildChatAreaMenu(super.mouseY - 338);
  6247.             }
  6248.         }
  6249.         if (backDialogID != -1 && anInt886 != anInt1039) {
  6250.             inputTaken = true;
  6251.             anInt1039 = anInt886;
  6252.         }
  6253.         if (backDialogID != -1 && anInt1315 != anInt1500) {
  6254.             inputTaken = true;
  6255.             anInt1500 = anInt1315;
  6256.         }
  6257.         /* Enable custom right click areas */
  6258.         if(super.mouseX > 4 && super.mouseY > 480 && super.mouseX < 516 && super.mouseY < 503)
  6259.             rightClickChatButtons();
  6260.         /**/
  6261.         boolean flag = false;
  6262.         while (!flag) {
  6263.             flag = true;
  6264.             for (int j = 0; j < menuActionRow - 1; j++) {
  6265.                 if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
  6266.                     String s = menuActionName[j];
  6267.                     menuActionName[j] = menuActionName[j + 1];
  6268.                     menuActionName[j + 1] = s;
  6269.                     int k = menuActionID[j];
  6270.                     menuActionID[j] = menuActionID[j + 1];
  6271.                     menuActionID[j + 1] = k;
  6272.                     k = menuActionCmd2[j];
  6273.                     menuActionCmd2[j] = menuActionCmd2[j + 1];
  6274.                     menuActionCmd2[j + 1] = k;
  6275.                     k = menuActionCmd3[j];
  6276.                     menuActionCmd3[j] = menuActionCmd3[j + 1];
  6277.                     menuActionCmd3[j + 1] = k;
  6278.                     k = menuActionCmd1[j];
  6279.                     menuActionCmd1[j] = menuActionCmd1[j + 1];
  6280.                     menuActionCmd1[j + 1] = k;
  6281.                     flag = false;
  6282.                 }
  6283.             }
  6284.         }
  6285.     }
  6286.  
  6287.     private int method83(int i, int j, int k)
  6288.     {
  6289.         int l = 256 - k;
  6290.         return ((i & 0xff00ff) * l + (j & 0xff00ff) * k & 0xff00ff00) + ((i & 0xff00) * l + (j & 0xff00) * k & 0xff0000) >> 8;
  6291.     }
  6292.  
  6293.     private void login(String s, String s1, boolean flag)
  6294.     {
  6295.         signlink.errorname = s;
  6296.         try
  6297.         {
  6298.             if(!flag)
  6299.             {
  6300.                 loginMessage1 = "";
  6301.                 loginMessage2 = "Connecting to server...";
  6302.                 drawLoginScreen(true);
  6303.             }
  6304.             socketStream = new RSSocket(this, openSocket(43594 + portOff));
  6305.             long l = TextClass.longForName(s);
  6306.             int i = (int)(l >> 16 & 31L);
  6307.             stream.currentOffset = 0;
  6308.             stream.writeWordBigEndian(14);
  6309.             stream.writeWordBigEndian(i);
  6310.             socketStream.queueBytes(2, stream.buffer);
  6311.             for(int j = 0; j < 8; j++)
  6312.                 socketStream.read();
  6313.  
  6314.             int k = socketStream.read();
  6315.             int i1 = k;
  6316.             if(k == 0)
  6317.             {
  6318.                 socketStream.flushInputStream(inStream.buffer, 8);
  6319.                 inStream.currentOffset = 0;
  6320.                 aLong1215 = inStream.readQWord();
  6321.                 int ai[] = new int[4];
  6322.                 ai[0] = (int)(Math.random() * 99999999D);
  6323.                 ai[1] = (int)(Math.random() * 99999999D);
  6324.                 ai[2] = (int)(aLong1215 >> 32);
  6325.                 ai[3] = (int)aLong1215;
  6326.                 stream.currentOffset = 0;
  6327.                 stream.writeWordBigEndian(10);
  6328.                 stream.writeDWord(ai[0]);
  6329.                 stream.writeDWord(ai[1]);
  6330.                 stream.writeDWord(ai[2]);
  6331.                 stream.writeDWord(ai[3]);
  6332.                 stream.writeDWord(/*signlink.uid*/999999);
  6333.                 stream.writeString(s);
  6334.                 stream.writeString(s1);
  6335.                 stream.doKeys();
  6336.                 aStream_847.currentOffset = 0;
  6337.                 if(flag)
  6338.                     aStream_847.writeWordBigEndian(18);
  6339.                 else
  6340.                     aStream_847.writeWordBigEndian(16);
  6341.                 aStream_847.writeWordBigEndian(stream.currentOffset + 36 + 1 + 1 + 2);
  6342.                 aStream_847.writeWordBigEndian(255);
  6343.                 aStream_847.writeWord(317);
  6344.                 aStream_847.writeWordBigEndian(lowMem ? 1 : 0);
  6345.                 for(int l1 = 0; l1 < 9; l1++)
  6346.                     aStream_847.writeDWord(expectedCRCs[l1]);
  6347.  
  6348.                 aStream_847.writeBytes(stream.buffer, stream.currentOffset, 0);
  6349.                 stream.encryption = new ISAACRandomGen(ai);
  6350.                 for(int j2 = 0; j2 < 4; j2++)
  6351.                     ai[j2] += 50;
  6352.  
  6353.                 encryption = new ISAACRandomGen(ai);
  6354.                 socketStream.queueBytes(aStream_847.currentOffset, aStream_847.buffer);
  6355.                 k = socketStream.read();
  6356.             }
  6357.             if(k == 1)
  6358.             {
  6359.                 try
  6360.                 {
  6361.                     Thread.sleep(2000L);
  6362.                 }
  6363.                 catch(Exception _ex) { }
  6364.                 login(s, s1, flag);
  6365.                 return;
  6366.             }
  6367.             if(k == 2)
  6368.             {
  6369.                 myPrivilege = socketStream.read();
  6370.                 flagged = socketStream.read() == 1;
  6371.                 aLong1220 = 0L;
  6372.                 anInt1022 = 0;
  6373.                 mouseDetection.coordsIndex = 0;
  6374.                 super.awtFocus = true;
  6375.                 aBoolean954 = true;
  6376.                 loggedIn = true;
  6377.                 stream.currentOffset = 0;
  6378.                 inStream.currentOffset = 0;
  6379.                 pktType = -1;
  6380.                 anInt841 = -1;
  6381.                 anInt842 = -1;
  6382.                 anInt843 = -1;
  6383.                 pktSize = 0;
  6384.                 anInt1009 = 0;
  6385.                 anInt1104 = 0;
  6386.                 anInt1011 = 0;
  6387.                 anInt855 = 0;
  6388.                 menuActionRow = 0;
  6389.                 menuOpen = false;
  6390.                 super.idleTime = 0;
  6391.                 for(int j1 = 0; j1 < 100; j1++)
  6392.                     chatMessages[j1] = null;
  6393.  
  6394.                 itemSelected = 0;
  6395.                 spellSelected = 0;
  6396.                 loadingStage = 0;
  6397.                 anInt1062 = 0;
  6398.                 anInt1278 = (int)(Math.random() * 100D) - 50;
  6399.                 anInt1131 = (int)(Math.random() * 110D) - 55;
  6400.                 anInt896 = (int)(Math.random() * 80D) - 40;
  6401.                 minimapInt2 = (int)(Math.random() * 120D) - 60;
  6402.                 minimapInt3 = (int)(Math.random() * 30D) - 20;
  6403.                 minimapInt1 = (int)(Math.random() * 20D) - 10 & 0x7ff;
  6404.                 anInt1021 = 0;
  6405.                 anInt985 = -1;
  6406.                 destX = 0;
  6407.                 destY = 0;
  6408.                 playerCount = 0;
  6409.                 npcCount = 0;
  6410.                 for(int i2 = 0; i2 < maxPlayers; i2++)
  6411.                 {
  6412.                     playerArray[i2] = null;
  6413.                     aStreamArray895s[i2] = null;
  6414.                 }
  6415.  
  6416.                 for(int k2 = 0; k2 < 16384; k2++)
  6417.                     npcArray[k2] = null;
  6418.  
  6419.                 myPlayer = playerArray[myPlayerIndex] = new Player();
  6420.                 aClass19_1013.removeAll();
  6421.                 aClass19_1056.removeAll();
  6422.                 for(int l2 = 0; l2 < 4; l2++)
  6423.                 {
  6424.                     for(int i3 = 0; i3 < 104; i3++)
  6425.                     {
  6426.                         for(int k3 = 0; k3 < 104; k3++)
  6427.                             groundArray[l2][i3][k3] = null;
  6428.  
  6429.                     }
  6430.  
  6431.                 }
  6432.  
  6433.                 aClass19_1179 = new NodeList();
  6434.                 fullscreenInterfaceID = -1;
  6435.                 anInt900 = 0;
  6436.                 friendsCount = 0;
  6437.                 dialogID = -1;
  6438.                 backDialogID = -1;
  6439.                 openInterfaceID = -1;
  6440.                 invOverlayInterfaceID = -1;
  6441.                 anInt1018 = -1;
  6442.                 aBoolean1149 = false;
  6443.                 tabID = 3;
  6444.                 inputDialogState = 0;
  6445.                 menuOpen = false;
  6446.                 messagePromptRaised = false;
  6447.                 aString844 = null;
  6448.                 anInt1055 = 0;
  6449.                 anInt1054 = -1;
  6450.                 aBoolean1047 = true;
  6451.                 method45();
  6452.                 for(int j3 = 0; j3 < 5; j3++)
  6453.                     anIntArray990[j3] = 0;
  6454.  
  6455.                 for(int l3 = 0; l3 < 5; l3++)
  6456.                 {
  6457.                     atPlayerActions[l3] = null;
  6458.                     atPlayerArray[l3] = false;
  6459.                 }
  6460.  
  6461.                 anInt1175 = 0;
  6462.                 anInt1134 = 0;
  6463.                 anInt986 = 0;
  6464.                 anInt1288 = 0;
  6465.                 anInt924 = 0;
  6466.                 anInt1188 = 0;
  6467.                 anInt1155 = 0;
  6468.                 anInt1226 = 0;
  6469.                 int anInt941 = 0;
  6470.                 int anInt1260 = 0;
  6471.                 resetImageProducers2();
  6472.                 return;
  6473.             }
  6474.             if(k == 3)
  6475.             {
  6476.                 loginMessage1 = "";
  6477.                 loginMessage2 = "Invalid username or password.";
  6478.                 return;
  6479.             }
  6480.             if(k == 4)
  6481.             {
  6482.                 loginMessage1 = "Your account has been disabled.";
  6483.                 loginMessage2 = "Please check your message-center for details.";
  6484.                 return;
  6485.             }
  6486.             if(k == 5)
  6487.             {
  6488.                 loginMessage1 = "Your account is already logged in.";
  6489.                 loginMessage2 = "Try again in 60 secs...";
  6490.                 return;
  6491.             }
  6492.             if(k == 6)
  6493.             {
  6494.                 loginMessage1 = "RuneScape has been updated!";
  6495.                 loginMessage2 = "Please reload this page.";
  6496.                 return;
  6497.             }
  6498.             if(k == 7)
  6499.             {
  6500.                 loginMessage1 = "This world is full.";
  6501.                 loginMessage2 = "Please use a different world.";
  6502.                 return;
  6503.             }
  6504.             if(k == 8)
  6505.             {
  6506.                 loginMessage1 = "Unable to connect.";
  6507.                 loginMessage2 = "Login server offline.";
  6508.                 return;
  6509.             }
  6510.             if(k == 9)
  6511.             {
  6512.                 loginMessage1 = "Login limit exceeded.";
  6513.                 loginMessage2 = "Too many connections from your address.";
  6514.                 return;
  6515.             }
  6516.             if(k == 10)
  6517.             {
  6518.                 loginMessage1 = "Unable to connect.";
  6519.                 loginMessage2 = "Bad session id.";
  6520.                 return;
  6521.             }
  6522.             if(k == 11)
  6523.             {
  6524.                 loginMessage2 = "Login server rejected session.";
  6525.                 loginMessage2 = "Please try again.";
  6526.                 return;
  6527.             }
  6528.             if(k == 12)
  6529.             {
  6530.                 loginMessage1 = "You need a members account to login to this world.";
  6531.                 loginMessage2 = "Please subscribe, or use a different world.";
  6532.                 return;
  6533.             }
  6534.             if(k == 13)
  6535.             {
  6536.                 loginMessage1 = "Could not complete login.";
  6537.                 loginMessage2 = "Please try using a different world.";
  6538.                 return;
  6539.             }
  6540.             if(k == 14)
  6541.             {
  6542.                 loginMessage1 = "The server is being updated.";
  6543.                 loginMessage2 = "Please wait 1 minute and try again.";
  6544.                 return;
  6545.             }
  6546.             if(k == 15)
  6547.             {
  6548.                 loggedIn = true;
  6549.                 stream.currentOffset = 0;
  6550.                 inStream.currentOffset = 0;
  6551.                 pktType = -1;
  6552.                 anInt841 = -1;
  6553.                 anInt842 = -1;
  6554.                 anInt843 = -1;
  6555.                 pktSize = 0;
  6556.                 anInt1009 = 0;
  6557.                 anInt1104 = 0;
  6558.                 menuActionRow = 0;
  6559.                 menuOpen = false;
  6560.                 aLong824 = System.currentTimeMillis();
  6561.                 return;
  6562.             }
  6563.             if(k == 16)
  6564.             {
  6565.                 loginMessage1 = "Login attempts exceeded.";
  6566.                 loginMessage2 = "Please wait 1 minute and try again.";
  6567.                 return;
  6568.             }
  6569.             if(k == 17)
  6570.             {
  6571.                 loginMessage1 = "You are standing in a members-only area.";
  6572.                 loginMessage2 = "To play on this world move to a free area first";
  6573.                 return;
  6574.             }
  6575.             if(k == 20)
  6576.             {
  6577.                 loginMessage1 = "Invalid loginserver requested";
  6578.                 loginMessage2 = "Please try using a different world.";
  6579.                 return;
  6580.             }
  6581.             if(k == 21)
  6582.             {
  6583.                 for(int k1 = socketStream.read(); k1 >= 0; k1--)
  6584.                 {
  6585.                     loginMessage1 = "You have only just left another world";
  6586.                     loginMessage2 = "Your profile will be transferred in: " + k1 + " seconds";
  6587.                     drawLoginScreen(true);
  6588.                     try
  6589.                     {
  6590.                         Thread.sleep(1000L);
  6591.                     }
  6592.                     catch(Exception _ex) { }
  6593.                 }
  6594.  
  6595.                 login(s, s1, flag);
  6596.                 return;
  6597.             }
  6598.             if(k == -1)
  6599.             {
  6600.                 if(i1 == 0)
  6601.                 {
  6602.                     if(loginFailures < 2)
  6603.                     {
  6604.                         try
  6605.                         {
  6606.                             Thread.sleep(2000L);
  6607.                         }
  6608.                         catch(Exception _ex) { }
  6609.                         loginFailures++;
  6610.                         login(s, s1, flag);
  6611.                         return;
  6612.                     } else
  6613.                     {
  6614.                         loginMessage1 = "No response from loginserver";
  6615.                         loginMessage2 = "Please wait 1 minute and try again.";
  6616.                         return;
  6617.                     }
  6618.                 } else
  6619.                 {
  6620.                     loginMessage1 = "No response from server";
  6621.                     loginMessage2 = "Please try using a different world.";
  6622.                     return;
  6623.                 }
  6624.             } else
  6625.             {
  6626.                 System.out.println("response:" + k);
  6627.                 loginMessage1 = "Unexpected server response";
  6628.                 loginMessage2 = "Please try using a different world.";
  6629.                 return;
  6630.             }
  6631.         }
  6632.         catch(IOException _ex)
  6633.         {
  6634.             loginMessage1 = "";
  6635.         }
  6636.         loginMessage2 = "Error connecting to server.";
  6637.     }
  6638.  
  6639.     private boolean doWalkTo(int i, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
  6640.         byte byte0 = 104;
  6641.         byte byte1 = 104;
  6642.         for(int l2 = 0; l2 < byte0; l2++) {
  6643.             for(int i3 = 0; i3 < byte1; i3++) {
  6644.                 anIntArrayArray901[l2][i3] = 0;
  6645.                 anIntArrayArray825[l2][i3] = 0x5f5e0ff;
  6646.             }
  6647.         }
  6648.         int j3 = j2;
  6649.         int k3 = j1;
  6650.         anIntArrayArray901[j2][j1] = 99;
  6651.         anIntArrayArray825[j2][j1] = 0;
  6652.         int l3 = 0;
  6653.         int i4 = 0;
  6654.         bigX[l3] = j2;
  6655.         bigY[l3++] = j1;
  6656.         boolean flag1 = false;
  6657.         int j4 = bigX.length;
  6658.         int ai[][] = aClass11Array1230[plane].anIntArrayArray294;
  6659.         while(i4 != l3)
  6660.         {
  6661.             j3 = bigX[i4];
  6662.             k3 = bigY[i4];
  6663.             i4 = (i4 + 1) % j4;
  6664.             if(j3 == k2 && k3 == i2)
  6665.             {
  6666.                 flag1 = true;
  6667.                 break;
  6668.             }
  6669.             if(i1 != 0)
  6670.             {
  6671.                 if((i1 < 5 || i1 == 10) && aClass11Array1230[plane].method219(k2, j3, k3, j, i1 - 1, i2))
  6672.                 {
  6673.                     flag1 = true;
  6674.                     break;
  6675.                 }
  6676.                 if(i1 < 10 && aClass11Array1230[plane].method220(k2, i2, k3, i1 - 1, j, j3))
  6677.                 {
  6678.                     flag1 = true;
  6679.                     break;
  6680.                 }
  6681.             }
  6682.             if(k1 != 0 && k != 0 && aClass11Array1230[plane].method221(i2, k2, j3, k, l1, k1, k3))
  6683.             {
  6684.                 flag1 = true;
  6685.                 break;
  6686.             }
  6687.             int l4 = anIntArrayArray825[j3][k3] + 1;
  6688.             if(j3 > 0 && anIntArrayArray901[j3 - 1][k3] == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0)
  6689.             {
  6690.                 bigX[l3] = j3 - 1;
  6691.                 bigY[l3] = k3;
  6692.                 l3 = (l3 + 1) % j4;
  6693.                 anIntArrayArray901[j3 - 1][k3] = 2;
  6694.                 anIntArrayArray825[j3 - 1][k3] = l4;
  6695.             }
  6696.             if(j3 < byte0 - 1 && anIntArrayArray901[j3 + 1][k3] == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0)
  6697.             {
  6698.                 bigX[l3] = j3 + 1;
  6699.                 bigY[l3] = k3;
  6700.                 l3 = (l3 + 1) % j4;
  6701.                 anIntArrayArray901[j3 + 1][k3] = 8;
  6702.                 anIntArrayArray825[j3 + 1][k3] = l4;
  6703.             }
  6704.             if(k3 > 0 && anIntArrayArray901[j3][k3 - 1] == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6705.             {
  6706.                 bigX[l3] = j3;
  6707.                 bigY[l3] = k3 - 1;
  6708.                 l3 = (l3 + 1) % j4;
  6709.                 anIntArrayArray901[j3][k3 - 1] = 1;
  6710.                 anIntArrayArray825[j3][k3 - 1] = l4;
  6711.             }
  6712.             if(k3 < byte1 - 1 && anIntArrayArray901[j3][k3 + 1] == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6713.             {
  6714.                 bigX[l3] = j3;
  6715.                 bigY[l3] = k3 + 1;
  6716.                 l3 = (l3 + 1) % j4;
  6717.                 anIntArrayArray901[j3][k3 + 1] = 4;
  6718.                 anIntArrayArray825[j3][k3 + 1] = l4;
  6719.             }
  6720.             if(j3 > 0 && k3 > 0 && anIntArrayArray901[j3 - 1][k3 - 1] == 0 && (ai[j3 - 1][k3 - 1] & 0x128010e) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6721.             {
  6722.                 bigX[l3] = j3 - 1;
  6723.                 bigY[l3] = k3 - 1;
  6724.                 l3 = (l3 + 1) % j4;
  6725.                 anIntArrayArray901[j3 - 1][k3 - 1] = 3;
  6726.                 anIntArrayArray825[j3 - 1][k3 - 1] = l4;
  6727.             }
  6728.             if(j3 < byte0 - 1 && k3 > 0 && anIntArrayArray901[j3 + 1][k3 - 1] == 0 && (ai[j3 + 1][k3 - 1] & 0x1280183) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 - 1] & 0x1280102) == 0)
  6729.             {
  6730.                 bigX[l3] = j3 + 1;
  6731.                 bigY[l3] = k3 - 1;
  6732.                 l3 = (l3 + 1) % j4;
  6733.                 anIntArrayArray901[j3 + 1][k3 - 1] = 9;
  6734.                 anIntArrayArray825[j3 + 1][k3 - 1] = l4;
  6735.             }
  6736.             if(j3 > 0 && k3 < byte1 - 1 && anIntArrayArray901[j3 - 1][k3 + 1] == 0 && (ai[j3 - 1][k3 + 1] & 0x1280138) == 0 && (ai[j3 - 1][k3] & 0x1280108) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6737.             {
  6738.                 bigX[l3] = j3 - 1;
  6739.                 bigY[l3] = k3 + 1;
  6740.                 l3 = (l3 + 1) % j4;
  6741.                 anIntArrayArray901[j3 - 1][k3 + 1] = 6;
  6742.                 anIntArrayArray825[j3 - 1][k3 + 1] = l4;
  6743.             }
  6744.             if(j3 < byte0 - 1 && k3 < byte1 - 1 && anIntArrayArray901[j3 + 1][k3 + 1] == 0 && (ai[j3 + 1][k3 + 1] & 0x12801e0) == 0 && (ai[j3 + 1][k3] & 0x1280180) == 0 && (ai[j3][k3 + 1] & 0x1280120) == 0)
  6745.             {
  6746.                 bigX[l3] = j3 + 1;
  6747.                 bigY[l3] = k3 + 1;
  6748.                 l3 = (l3 + 1) % j4;
  6749.                 anIntArrayArray901[j3 + 1][k3 + 1] = 12;
  6750.                 anIntArrayArray825[j3 + 1][k3 + 1] = l4;
  6751.             }
  6752.         }
  6753.         anInt1264 = 0;
  6754.         if(!flag1)
  6755.         {
  6756.             if(flag)
  6757.             {
  6758.                 int i5 = 100;
  6759.                 for(int k5 = 1; k5 < 2; k5++)
  6760.                 {
  6761.                     for(int i6 = k2 - k5; i6 <= k2 + k5; i6++)
  6762.                     {
  6763.                         for(int l6 = i2 - k5; l6 <= i2 + k5; l6++)
  6764.                             if(i6 >= 0 && l6 >= 0 && i6 < 104 && l6 < 104 && anIntArrayArray825[i6][l6] < i5)
  6765.                             {
  6766.                                 i5 = anIntArrayArray825[i6][l6];
  6767.                                 j3 = i6;
  6768.                                 k3 = l6;
  6769.                                 anInt1264 = 1;
  6770.                                 flag1 = true;
  6771.                             }
  6772.  
  6773.                     }
  6774.  
  6775.                     if(flag1)
  6776.                         break;
  6777.                 }
  6778.  
  6779.             }
  6780.             if(!flag1)
  6781.                 return false;
  6782.         }
  6783.         i4 = 0;
  6784.         bigX[i4] = j3;
  6785.         bigY[i4++] = k3;
  6786.         int l5;
  6787.         for(int j5 = l5 = anIntArrayArray901[j3][k3]; j3 != j2 || k3 != j1; j5 = anIntArrayArray901[j3][k3])
  6788.         {
  6789.             if(j5 != l5)
  6790.             {
  6791.                 l5 = j5;
  6792.                 bigX[i4] = j3;
  6793.                 bigY[i4++] = k3;
  6794.             }
  6795.             if((j5 & 2) != 0)
  6796.                 j3++;
  6797.             else
  6798.             if((j5 & 8) != 0)
  6799.                 j3--;
  6800.             if((j5 & 1) != 0)
  6801.                 k3++;
  6802.             else
  6803.             if((j5 & 4) != 0)
  6804.                 k3--;
  6805.         }
  6806. //  if(cancelWalk) { return i4 > 0; }
  6807.    
  6808.  
  6809.         if(i4 > 0)
  6810.         {
  6811.             int k4 = i4;
  6812.             if(k4 > 25)
  6813.                 k4 = 25;
  6814.             i4--;
  6815.             int k6 = bigX[i4];
  6816.             int i7 = bigY[i4];
  6817.             anInt1288 += k4;
  6818.             if(anInt1288 >= 92)
  6819.             {
  6820.                 stream.createFrame(36);
  6821.                 stream.writeDWord(0);
  6822.                 anInt1288 = 0;
  6823.             }
  6824.             if(i == 0)
  6825.             {
  6826.                 stream.createFrame(164);
  6827.                 stream.writeWordBigEndian(k4 + k4 + 3);
  6828.             }
  6829.             if(i == 1)
  6830.             {
  6831.                 stream.createFrame(248);
  6832.                 stream.writeWordBigEndian(k4 + k4 + 3 + 14);
  6833.             }
  6834.             if(i == 2)
  6835.             {
  6836.                 stream.createFrame(98);
  6837.                 stream.writeWordBigEndian(k4 + k4 + 3);
  6838.             }
  6839.             stream.method433(k6 + baseX);
  6840.             destX = bigX[0];
  6841.             destY = bigY[0];
  6842.             for(int j7 = 1; j7 < k4; j7++)
  6843.             {
  6844.                 i4--;
  6845.                 stream.writeWordBigEndian(bigX[i4] - k6);
  6846.                 stream.writeWordBigEndian(bigY[i4] - i7);
  6847.             }
  6848.  
  6849.             stream.method431(i7 + baseY);
  6850.             stream.method424(super.keyArray[5] != 1 ? 0 : 1);
  6851.             return true;
  6852.         }
  6853.         return i != 1;
  6854.     }
  6855.  
  6856.     private void method86(Stream stream)
  6857.     {
  6858.         for(int j = 0; j < anInt893; j++)
  6859.         {
  6860.             int k = anIntArray894[j];
  6861.             NPC npc = npcArray[k];
  6862.             int l = stream.readUnsignedByte();
  6863.             if((l & 0x10) != 0)
  6864.             {
  6865.                 int i1 = stream.method434();
  6866.                 if(i1 == 65535)
  6867.                     i1 = -1;
  6868.                 int i2 = stream.readUnsignedByte();
  6869.                 if(i1 == npc.anim && i1 != -1)
  6870.                 {
  6871.                     int l2 = Animation.anims[i1].anInt365;
  6872.                     if(l2 == 1)
  6873.                     {
  6874.                         npc.anInt1527 = 0;
  6875.                         npc.anInt1528 = 0;
  6876.                         npc.anInt1529 = i2;
  6877.                         npc.anInt1530 = 0;
  6878.                     }
  6879.                     if(l2 == 2)
  6880.                         npc.anInt1530 = 0;
  6881.                 } else
  6882.                 if(i1 == -1 || npc.anim == -1 || Animation.anims[i1].anInt359 >= Animation.anims[npc.anim].anInt359)
  6883.                 {
  6884.                     npc.anim = i1;
  6885.                     npc.anInt1527 = 0;
  6886.                     npc.anInt1528 = 0;
  6887.                     npc.anInt1529 = i2;
  6888.                     npc.anInt1530 = 0;
  6889.                     npc.anInt1542 = npc.smallXYIndex;
  6890.                 }
  6891.             }
  6892.             if((l & 8) != 0)
  6893.             {
  6894.                 int j1 = stream.method426();
  6895.                 int j2 = stream.method427();
  6896.                 npc.updateHitData(j2, j1, loopCycle);
  6897.                 npc.loopCycleStatus = loopCycle + 300;
  6898.                 npc.currentHealth = stream.method426();
  6899.                 npc.maxHealth = stream.readUnsignedByte();
  6900.             }
  6901.             if((l & 0x80) != 0)
  6902.             {
  6903.                 npc.anInt1520 = stream.readUnsignedWord();
  6904.                 int k1 = stream.readDWord();
  6905.                 npc.anInt1524 = k1 >> 16;
  6906.                 npc.anInt1523 = loopCycle + (k1 & 0xffff);
  6907.                 npc.anInt1521 = 0;
  6908.                 npc.anInt1522 = 0;
  6909.                 if(npc.anInt1523 > loopCycle)
  6910.                     npc.anInt1521 = -1;
  6911.                 if(npc.anInt1520 == 65535)
  6912.                     npc.anInt1520 = -1;
  6913.             }
  6914.             if((l & 0x20) != 0)
  6915.             {
  6916.                 npc.interactingEntity = stream.readUnsignedWord();
  6917.                 if(npc.interactingEntity == 65535)
  6918.                     npc.interactingEntity = -1;
  6919.             }
  6920.             if((l & 1) != 0)
  6921.             {
  6922.                 npc.textSpoken = stream.readString();
  6923.                 npc.textCycle = 100;
  6924. //  entityMessage(npc);
  6925.    
  6926.             }
  6927.             if((l & 0x40) != 0)
  6928.             {
  6929.                 int l1 = stream.method427();
  6930.                 int k2 = stream.method428();
  6931.                 npc.updateHitData(k2, l1, loopCycle);
  6932.                 npc.loopCycleStatus = loopCycle + 300;
  6933.                 npc.currentHealth = stream.method428();
  6934.                 npc.maxHealth = stream.method427();
  6935.             }
  6936.             if((l & 2) != 0)
  6937.             {
  6938.                 npc.desc = EntityDef.forID(stream.method436());
  6939.                 npc.anInt1540 = npc.desc.aByte68;
  6940.                 npc.anInt1504 = npc.desc.anInt79;
  6941.                 npc.anInt1554 = npc.desc.walkAnim;
  6942.                 npc.anInt1555 = npc.desc.anInt58;
  6943.                 npc.anInt1556 = npc.desc.anInt83;
  6944.                 npc.anInt1557 = npc.desc.anInt55;
  6945.                 npc.anInt1511 = npc.desc.standAnim;
  6946.             }
  6947.             if((l & 4) != 0)
  6948.             {
  6949.                 npc.anInt1538 = stream.method434();
  6950.                 npc.anInt1539 = stream.method434();
  6951.             }
  6952.         }
  6953.     }
  6954.  
  6955.     private void buildAtNPCMenu(EntityDef entityDef, int i, int j, int k)
  6956.     {
  6957.         if(menuActionRow >= 400)
  6958.             return;
  6959.         if(entityDef.childrenIDs != null)
  6960.             entityDef = entityDef.method161();
  6961.         if(entityDef == null)
  6962.             return;
  6963.         if(!entityDef.aBoolean84)
  6964.             return;
  6965.         String s = entityDef.name;
  6966.         if(entityDef.combatLevel != 0)
  6967.             s = s + combatDiffColor(myPlayer.combatLevel, entityDef.combatLevel) + " (level-" + entityDef.combatLevel + ")";
  6968.         if(itemSelected == 1)
  6969.         {
  6970.             menuActionName[menuActionRow] = "Use " + selectedItemName + " with @yel@" + s;
  6971.             menuActionID[menuActionRow] = 582;
  6972.             menuActionCmd1[menuActionRow] = i;
  6973.             menuActionCmd2[menuActionRow] = k;
  6974.             menuActionCmd3[menuActionRow] = j;
  6975.             menuActionRow++;
  6976.             return;
  6977.         }
  6978.         if(spellSelected == 1)
  6979.         {
  6980.             if((spellUsableOn & 2) == 2)
  6981.             {
  6982.                 menuActionName[menuActionRow] = spellTooltip + " @yel@" + s;
  6983.                 menuActionID[menuActionRow] = 413;
  6984.                 menuActionCmd1[menuActionRow] = i;
  6985.                 menuActionCmd2[menuActionRow] = k;
  6986.                 menuActionCmd3[menuActionRow] = j;
  6987.                 menuActionRow++;
  6988.             }
  6989.         } else
  6990.         {
  6991.             if(entityDef.actions != null)
  6992.             {
  6993.                 for(int l = 4; l >= 0; l--)
  6994.                     if(entityDef.actions[l] != null && !entityDef.actions[l].equalsIgnoreCase("attack"))
  6995.                     {
  6996.                         menuActionName[menuActionRow] = entityDef.actions[l] + " @yel@" + s;
  6997.                         if(l == 0)
  6998.                             menuActionID[menuActionRow] = 20;
  6999.                         if(l == 1)
  7000.                             menuActionID[menuActionRow] = 412;
  7001.                         if(l == 2)
  7002.                             menuActionID[menuActionRow] = 225;
  7003.                         if(l == 3)
  7004.                             menuActionID[menuActionRow] = 965;
  7005.                         if(l == 4)
  7006.                             menuActionID[menuActionRow] = 478;
  7007.                         menuActionCmd1[menuActionRow] = i;
  7008.                         menuActionCmd2[menuActionRow] = k;
  7009.                         menuActionCmd3[menuActionRow] = j;
  7010.                         menuActionRow++;
  7011.                     }
  7012.  
  7013.             }
  7014.             if(entityDef.actions != null)
  7015.             {
  7016.                 for(int i1 = 4; i1 >= 0; i1--)
  7017.                     if(entityDef.actions[i1] != null && entityDef.actions[i1].equalsIgnoreCase("attack"))
  7018.                     {
  7019.                         char c = '\0';
  7020.                         if(entityDef.combatLevel > myPlayer.combatLevel)
  7021.                             c = '\u07D0';
  7022.                         menuActionName[menuActionRow] = entityDef.actions[i1] + " @yel@" + s;
  7023.                         if(i1 == 0)
  7024.                             menuActionID[menuActionRow] = 20 + c;
  7025.                         if(i1 == 1)
  7026.                             menuActionID[menuActionRow] = 412 + c;
  7027.                         if(i1 == 2)
  7028.                             menuActionID[menuActionRow] = 225 + c;
  7029.                         if(i1 == 3)
  7030.                             menuActionID[menuActionRow] = 965 + c;
  7031.                         if(i1 == 4)
  7032.                             menuActionID[menuActionRow] = 478 + c;
  7033.                         menuActionCmd1[menuActionRow] = i;
  7034.                         menuActionCmd2[menuActionRow] = k;
  7035.                         menuActionCmd3[menuActionRow] = j;
  7036.                         menuActionRow++;
  7037.                     }
  7038.  
  7039.             }
  7040.             //menuActionName[menuActionRow] = "Examine @yel@" + s + " @gre@(@whi@" + entityDef.type + "@gre@)";
  7041.             menuActionName[menuActionRow] = "Examine @yel@" + s;
  7042.             menuActionID[menuActionRow] = 1025;
  7043.             menuActionCmd1[menuActionRow] = i;
  7044.             menuActionCmd2[menuActionRow] = k;
  7045.             menuActionCmd3[menuActionRow] = j;
  7046.             menuActionRow++;
  7047.         }
  7048.     }
  7049.  
  7050.     private void buildAtPlayerMenu(int i, int j, Player player, int k)
  7051.     {
  7052.         if(player == myPlayer)
  7053.             return;
  7054.         if(menuActionRow >= 400)
  7055.             return;
  7056.         String s;
  7057.         if(player.skill == 0)
  7058.             s = player.name + combatDiffColor(myPlayer.combatLevel, player.combatLevel) + " (level-" + player.combatLevel + ")";
  7059.         else
  7060.             s = player.name + " (skill-" + player.skill + ")";
  7061.         if(itemSelected == 1)
  7062.         {
  7063.             menuActionName[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s;
  7064.             menuActionID[menuActionRow] = 491;
  7065.             menuActionCmd1[menuActionRow] = j;
  7066.             menuActionCmd2[menuActionRow] = i;
  7067.             menuActionCmd3[menuActionRow] = k;
  7068.             menuActionRow++;
  7069.         } else
  7070.         if(spellSelected == 1)
  7071.         {
  7072.             if((spellUsableOn & 8) == 8)
  7073.             {
  7074.                 menuActionName[menuActionRow] = spellTooltip + " @whi@" + s;
  7075.                 menuActionID[menuActionRow] = 365;
  7076.                 menuActionCmd1[menuActionRow] = j;
  7077.                 menuActionCmd2[menuActionRow] = i;
  7078.                 menuActionCmd3[menuActionRow] = k;
  7079.                 menuActionRow++;
  7080.             }
  7081.         } else
  7082.         {
  7083.             for(int l = 4; l >= 0; l--)
  7084.                 if(atPlayerActions[l] != null)
  7085.                 {
  7086.                     menuActionName[menuActionRow] = atPlayerActions[l] + " @whi@" + s;
  7087.                     char c = '\0';
  7088.                     if(atPlayerActions[l].equalsIgnoreCase("attack"))
  7089.                     {
  7090.                         if(player.combatLevel > myPlayer.combatLevel)
  7091.                             c = '\u07D0';
  7092.                         if(myPlayer.team != 0 && player.team != 0)
  7093.                             if(myPlayer.team == player.team)
  7094.                                 c = '\u07D0';
  7095.                             else
  7096.                                 c = '\0';
  7097.                     } else
  7098.                     if(atPlayerArray[l])
  7099.                         c = '\u07D0';
  7100.                     if(l == 0)
  7101.                         menuActionID[menuActionRow] = 561 + c;
  7102.                     if(l == 1)
  7103.                         menuActionID[menuActionRow] = 779 + c;
  7104.                     if(l == 2)
  7105.                         menuActionID[menuActionRow] = 27 + c;
  7106.                     if(l == 3)
  7107.                         menuActionID[menuActionRow] = 577 + c;
  7108.                     if(l == 4)
  7109.                         menuActionID[menuActionRow] = 729 + c;
  7110.                     menuActionCmd1[menuActionRow] = j;
  7111.                     menuActionCmd2[menuActionRow] = i;
  7112.                     menuActionCmd3[menuActionRow] = k;
  7113.                     menuActionRow++;
  7114.                 }
  7115.  
  7116.         }
  7117.         for(int i1 = 0; i1 < menuActionRow; i1++)
  7118.             if(menuActionID[i1] == 516)
  7119.             {
  7120.                 menuActionName[i1] = "Walk here @whi@" + s;
  7121.                 return;
  7122.             }
  7123.  
  7124.     }
  7125.  
  7126.     private void method89(Class30_Sub1 class30_sub1)
  7127.     {
  7128.         int i = 0;
  7129.         int j = -1;
  7130.         int k = 0;
  7131.         int l = 0;
  7132.         if(class30_sub1.anInt1296 == 0)
  7133.             i = worldController.method300(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7134.         if(class30_sub1.anInt1296 == 1)
  7135.             i = worldController.method301(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7136.         if(class30_sub1.anInt1296 == 2)
  7137.             i = worldController.method302(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7138.         if(class30_sub1.anInt1296 == 3)
  7139.             i = worldController.method303(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298);
  7140.         if(i != 0)
  7141.         {
  7142.             int i1 = worldController.method304(class30_sub1.anInt1295, class30_sub1.anInt1297, class30_sub1.anInt1298, i);
  7143.             j = i >> 14 & 0x7fff;
  7144.             k = i1 & 0x1f;
  7145.             l = i1 >> 6;
  7146.         }
  7147.         class30_sub1.anInt1299 = j;
  7148.         class30_sub1.anInt1301 = k;
  7149.         class30_sub1.anInt1300 = l;
  7150.     }
  7151.  
  7152.     private void method90()
  7153.     {
  7154.         for(int i = 0; i < anInt1062; i++)
  7155.             if(anIntArray1250[i] <= 0)
  7156.             {
  7157.                 boolean flag1 = false;
  7158.                 try
  7159.                 {
  7160.                     if(anIntArray1207[i] == anInt874 && anIntArray1241[i] == anInt1289)
  7161.                     {
  7162.                         if(!replayWave())
  7163.                             flag1 = true;
  7164.                     } else
  7165.                     {
  7166.                         Stream stream = Sounds.method241(anIntArray1241[i], anIntArray1207[i]);
  7167.                         if(System.currentTimeMillis() + (long)(stream.currentOffset / 22) > aLong1172 + (long)(anInt1257 / 22))
  7168.                         {
  7169.                             anInt1257 = stream.currentOffset;
  7170.                             aLong1172 = System.currentTimeMillis();
  7171.                             if(saveWave(stream.buffer, stream.currentOffset))
  7172.                             {
  7173.                                 anInt874 = anIntArray1207[i];
  7174.                                 anInt1289 = anIntArray1241[i];
  7175.                             } else
  7176.                             {
  7177.                                 flag1 = true;
  7178.                             }
  7179.                         }
  7180.                     }
  7181.                 }
  7182.                 catch(Exception exception) { }
  7183.                 if(!flag1 || anIntArray1250[i] == -5)
  7184.                 {
  7185.                     anInt1062--;
  7186.                     for(int j = i; j < anInt1062; j++)
  7187.                     {
  7188.                         anIntArray1207[j] = anIntArray1207[j + 1];
  7189.                         anIntArray1241[j] = anIntArray1241[j + 1];
  7190.                         anIntArray1250[j] = anIntArray1250[j + 1];
  7191.                     }
  7192.  
  7193.                     i--;
  7194.                 } else
  7195.                 {
  7196.                     anIntArray1250[i] = -5;
  7197.                 }
  7198.             } else
  7199.             {
  7200.                 anIntArray1250[i]--;
  7201.             }
  7202.  
  7203.         if(prevSong > 0)
  7204.         {
  7205.             prevSong -= 20;
  7206.             if(prevSong < 0)
  7207.                 prevSong = 0;
  7208.             if(prevSong == 0 && musicEnabled && !lowMem)
  7209.             {
  7210.                 nextSong = currentSong;
  7211.                 songChanging = true;
  7212.                 onDemandFetcher.method558(2, nextSong);
  7213.             }
  7214.         }
  7215.     }
  7216.  
  7217.     void startUp()
  7218.     {
  7219.         drawLoadingText(32, "Starting up");
  7220.         if(signlink.sunjava)
  7221.             super.minDelay = 5;
  7222.         if(aBoolean993)
  7223.         {
  7224.  //        rsAlreadyLoaded = true;
  7225.  //        return;
  7226.         }
  7227.         aBoolean993 = true;
  7228.         boolean flag = true;
  7229.         String s = getDocumentBaseHost();
  7230.         if(signlink.cache_dat != null)
  7231.         {
  7232.             for(int i = 0; i < 5; i++)
  7233.                 decompressors[i] = new Decompressor(signlink.cache_dat, signlink.cache_idx[i], i + 1);
  7234.         } try {
  7235.             titleStreamLoader = streamLoaderForName(1, "title screen", "title", expectedCRCs[1], 25);
  7236.             smallText = new TextDrawingArea(false, "p11_full", titleStreamLoader);
  7237.             aTextDrawingArea_1271 = new TextDrawingArea(false, "p12_full", titleStreamLoader);
  7238.             chatTextDrawingArea = new TextDrawingArea(false, "b12_full", titleStreamLoader);
  7239.             TextDrawingArea aTextDrawingArea_1273 = new TextDrawingArea(true, "q8_full", titleStreamLoader);
  7240.             drawLogo();
  7241.             loadTitleScreen();
  7242.             StreamLoader streamLoader = streamLoaderForName(2, "config", "config", expectedCRCs[2], 30);
  7243.             StreamLoader streamLoader_1 = streamLoaderForName(3, "interface", "interface", expectedCRCs[3], 35);
  7244.             StreamLoader streamLoader_2 = streamLoaderForName(4, "2d graphics", "media", expectedCRCs[4], 40);
  7245.             StreamLoader streamLoader_3 = streamLoaderForName(6, "textures", "textures", expectedCRCs[6], 45);
  7246.             StreamLoader streamLoader_4 = streamLoaderForName(7, "chat system", "wordenc", expectedCRCs[7], 50);
  7247.             StreamLoader streamLoader_5 = streamLoaderForName(8, "sound effects", "sounds", expectedCRCs[8], 55);
  7248.             byteGroundArray = new byte[4][104][104];
  7249.             intGroundArray = new int[4][105][105];
  7250.             worldController = new WorldController(intGroundArray);
  7251.             for(int j = 0; j < 4; j++)
  7252.                 aClass11Array1230[j] = new Class11();
  7253.  
  7254.             aClass30_Sub2_Sub1_Sub1_1263 = new Sprite(512, 512);
  7255.             StreamLoader streamLoader_6 = streamLoaderForName(5, "update list", "versionlist", expectedCRCs[5], 60);
  7256.             drawLoadingText(48, "Connecting to update server");
  7257.             onDemandFetcher = new OnDemandFetcher();
  7258.             onDemandFetcher.start(streamLoader_6, this);
  7259.             Class36.method528(onDemandFetcher.getAnimCount());
  7260.             Model.method459(onDemandFetcher.getVersionCount(0), onDemandFetcher);
  7261.             ModelDecompressor.loadModels();
  7262.             //preloadModels();
  7263.             if(!lowMem)
  7264.             {
  7265.                 nextSong = 0;
  7266.                 try
  7267.                 {
  7268.                     nextSong = Integer.parseInt(getParameter("music"));
  7269.                 }
  7270.                 catch(Exception _ex) { }
  7271.                 songChanging = true;
  7272.                 onDemandFetcher.method558(2, nextSong);
  7273.                 while(onDemandFetcher.getNodeCount() > 0)
  7274.                 {
  7275.                     processOnDemandQueue();
  7276.                     try
  7277.                     {
  7278.                         Thread.sleep(100L);
  7279.                     }
  7280.                     catch(Exception _ex) { }
  7281.                     if(onDemandFetcher.anInt1349 > 3)
  7282.                     {
  7283.                         loadError();
  7284.                         return;
  7285.                     }
  7286.                 }
  7287.             }
  7288.             drawLoadingText(64, "Requesting animations");
  7289.             int k = onDemandFetcher.getVersionCount(1);
  7290.             for(int i1 = 0; i1 < k; i1++)
  7291.                 onDemandFetcher.method558(1, i1);
  7292.  
  7293.             while(onDemandFetcher.getNodeCount() > 0)
  7294.             {
  7295.                 int j1 = k - onDemandFetcher.getNodeCount();
  7296.                 if(j1 > 0)
  7297.                     drawLoadingText(64, "Loading animations - " + (j1 * 100) / k + "%");
  7298.                 processOnDemandQueue();
  7299.                 try
  7300.                 {
  7301.                     Thread.sleep(100L);
  7302.                 }
  7303.                 catch(Exception _ex) { }
  7304.                 if(onDemandFetcher.anInt1349 > 3)
  7305.                 {
  7306.                     loadError();
  7307.                     return;
  7308.                 }
  7309.             }
  7310.             drawLoadingText(80, "Requesting models");
  7311.             k = onDemandFetcher.getVersionCount(0);
  7312.             for(int k1 = 0; k1 < k; k1++)
  7313.             {
  7314.                 int l1 = onDemandFetcher.getModelIndex(k1);
  7315.                 if((l1 & 1) != 0)
  7316.                     onDemandFetcher.method558(0, k1);
  7317.             }
  7318.  
  7319.             k = onDemandFetcher.getNodeCount();
  7320.             while(onDemandFetcher.getNodeCount() > 0)
  7321.             {
  7322.                 int i2 = k - onDemandFetcher.getNodeCount();
  7323.                 if(i2 > 0)
  7324.                     drawLoadingText(80, "Loading models - " + (i2 * 100) / k + "%");
  7325.                 processOnDemandQueue();
  7326.                 try
  7327.                 {
  7328.                     Thread.sleep(100L);
  7329.                 }
  7330.                 catch(Exception _ex) { }
  7331.             }
  7332.             if(decompressors[0] != null)
  7333.             {
  7334.                 drawLoadingText(96, "Requesting maps");
  7335.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 47));
  7336.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 47));
  7337.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 48));
  7338.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 48));
  7339.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 48, 49));
  7340.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 48, 49));
  7341.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 47));
  7342.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 47));
  7343.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 47, 48));
  7344.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 47, 48));
  7345.                 onDemandFetcher.method558(3, onDemandFetcher.method562(0, 148, 48));
  7346.                 onDemandFetcher.method558(3, onDemandFetcher.method562(1, 148, 48));
  7347.                 k = onDemandFetcher.getNodeCount();
  7348.                 while(onDemandFetcher.getNodeCount() > 0)
  7349.                 {
  7350.                     int j2 = k - onDemandFetcher.getNodeCount();
  7351.                     if(j2 > 0)
  7352.                         drawLoadingText(96, "Loading maps - " + (j2 * 100) / k + "%");
  7353.                     processOnDemandQueue();
  7354.                     try
  7355.                     {
  7356.                         Thread.sleep(100L);
  7357.                     }
  7358.                     catch(Exception _ex) { }
  7359.                 }
  7360.             }
  7361.             k = onDemandFetcher.getVersionCount(0);
  7362.             for(int k2 = 0; k2 < k; k2++)
  7363.             {
  7364.                 int l2 = onDemandFetcher.getModelIndex(k2);
  7365.                 byte byte0 = 0;
  7366.                 if((l2 & 8) != 0)
  7367.                     byte0 = 10;
  7368.                 else
  7369.                 if((l2 & 0x20) != 0)
  7370.                     byte0 = 9;
  7371.                 else
  7372.                 if((l2 & 0x10) != 0)
  7373.                     byte0 = 8;
  7374.                 else
  7375.                 if((l2 & 0x40) != 0)
  7376.                     byte0 = 7;
  7377.                 else
  7378.                 if((l2 & 0x80) != 0)
  7379.                     byte0 = 6;
  7380.                 else
  7381.                 if((l2 & 2) != 0)
  7382.                     byte0 = 5;
  7383.                 else
  7384.                 if((l2 & 4) != 0)
  7385.                     byte0 = 4;
  7386.                 if((l2 & 1) != 0)
  7387.                     byte0 = 3;
  7388.                 if(byte0 != 0)
  7389.                     onDemandFetcher.method563(byte0, 0, k2);
  7390.             }
  7391.  
  7392.             onDemandFetcher.method554(isMembers);
  7393.             if(!lowMem)
  7394.             {
  7395.                 int l = onDemandFetcher.getVersionCount(2);
  7396.                 for(int i3 = 1; i3 < l; i3++)
  7397.                     if(onDemandFetcher.method569(i3))
  7398.                         onDemandFetcher.method563((byte)1, 2, i3);
  7399.  
  7400.             }
  7401.             drawLoadingText(112, "Unpacking media");
  7402.             /* Custom sprite unpacking */
  7403.             chatArea = new Sprite("chatarea");
  7404.             tabArea = new Sprite("tabarea");
  7405.             mapArea = new Sprite("maparea");
  7406.             multiOverlay = new Sprite(streamLoader_2, "overlay_multiway", 0);
  7407.             /**/
  7408.             mapBack = new Background(streamLoader_2, "mapback", 0);
  7409.             for(int c1 = 0; c1 <= 3; c1++)
  7410.                 chatButtons[c1] = new Sprite(streamLoader_2, "chatbuttons", c1);
  7411.             for(int j3 = 0; j3 <= 14; j3++)
  7412.                 sideIcons[j3] = new Sprite(streamLoader_2, "sideicons", j3);
  7413.             for(int r1 = 0; r1 < 5; r1++)
  7414.                 redStones[r1] = new Sprite("redstones " + r1);
  7415.             compass = new Sprite(streamLoader_2, "compass", 0);
  7416.             mapEdge = new Sprite(streamLoader_2, "mapedge", 0);
  7417.             mapEdge.method345();
  7418.             try
  7419.             {
  7420.                 for(int k3 = 0; k3 < 100; k3++)
  7421.                     mapScenes[k3] = new Background(streamLoader_2, "mapscene", k3);
  7422.             }
  7423.             catch(Exception _ex) { }
  7424.             try
  7425.             {
  7426.                 for(int l3 = 0; l3 < 100; l3++)
  7427.                     mapFunctions[l3] = new Sprite(streamLoader_2, "mapfunction", l3);
  7428.             }
  7429.             catch(Exception _ex) { }
  7430.             try
  7431.             {
  7432.                 for(int i4 = 0; i4 < 20; i4++)
  7433.                     hitMarks[i4] = new Sprite(streamLoader_2, "hitmarks", i4);
  7434.             }
  7435.             catch(Exception _ex) { }
  7436.             try
  7437.             {
  7438.                 for(int h1 = 0; h1 < 6; h1++)
  7439.                     headIconsHint[h1] = new Sprite(streamLoader_2, "headicons_hint", h1);
  7440.             } catch(Exception _ex) { }
  7441.             try {
  7442.                 for(int j4 = 0; j4 < 8; j4++)
  7443.                     headIcons[j4] = new Sprite(streamLoader_2, "headicons_prayer", j4);
  7444.                 for(int j45 = 0; j45 < 3; j45++)
  7445.                     skullIcons[j45] = new Sprite(streamLoader_2, "headicons_pk", j45 );
  7446.             }
  7447.             catch(Exception _ex) { }
  7448.             mapFlag = new Sprite(streamLoader_2, "mapmarker", 0);
  7449.             mapMarker = new Sprite(streamLoader_2, "mapmarker", 1);
  7450.             for(int k4 = 0; k4 < 8; k4++)
  7451.                 crosses[k4] = new Sprite(streamLoader_2, "cross", k4);
  7452.  
  7453.             mapDotItem = new Sprite(streamLoader_2, "mapdots", 0);
  7454.             mapDotNPC = new Sprite(streamLoader_2, "mapdots", 1);
  7455.             mapDotPlayer = new Sprite(streamLoader_2, "mapdots", 2);
  7456.             mapDotFriend = new Sprite(streamLoader_2, "mapdots", 3);
  7457.             mapDotTeam = new Sprite(streamLoader_2, "mapdots", 4);
  7458.             mapDotClan = new Sprite(streamLoader_2, "mapdots", 5);
  7459.             scrollBar1 = new Sprite(streamLoader_2, "scrollbar", 0);
  7460.             scrollBar2 = new Sprite(streamLoader_2, "scrollbar", 1);
  7461.  
  7462.             for(int l4 = 0; l4 < 2; l4++)
  7463.                 modIcons[l4] = new Background(streamLoader_2, "mod_icons", l4);
  7464.  
  7465.             Sprite sprite = new Sprite(streamLoader_2, "screenframe", 0);
  7466.             leftFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7467.             sprite.method346(0, 0);
  7468.             sprite = new Sprite(streamLoader_2, "screenframe", 1);
  7469.             topFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7470.             sprite.method346(0, 0);
  7471.             sprite = new Sprite(streamLoader_2, "screenframe", 2);
  7472.             rightFrame = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7473.             sprite.method346(0, 0);
  7474.             sprite = new Sprite(streamLoader_2, "mapedge", 0);
  7475.             mapEdgeIP = new RSImageProducer(sprite.myWidth, sprite.myHeight, getGameComponent());
  7476.             sprite.method346(0, 0);
  7477.  
  7478.             int i5 = (int)(Math.random() * 21D) - 10;
  7479.             int j5 = (int)(Math.random() * 21D) - 10;
  7480.             int k5 = (int)(Math.random() * 21D) - 10;
  7481.             int l5 = (int)(Math.random() * 41D) - 20;
  7482.             for(int i6 = 0; i6 < 100; i6++)
  7483.             {
  7484.                 if(mapFunctions[i6] != null)
  7485.                     mapFunctions[i6].method344(i5 + l5, j5 + l5, k5 + l5);
  7486.                 if(mapScenes[i6] != null)
  7487.                     mapScenes[i6].method360(i5 + l5, j5 + l5, k5 + l5);
  7488.             }
  7489.  
  7490.             drawLoadingText(128, "Unpacking textures");
  7491.             Texture.method368(streamLoader_3);
  7492.             Texture.method372(0.80000000000000004D);
  7493.             Texture.method367();
  7494.             drawLoadingText(144, "Unpacking config");
  7495.             Animation.unpackConfig(streamLoader);
  7496.             ObjectDef.unpackConfig(streamLoader);
  7497.             Flo.unpackConfig(streamLoader);
  7498.             ItemDef.unpackConfig(streamLoader);
  7499.             EntityDef.unpackConfig(streamLoader);
  7500.             IDK.unpackConfig(streamLoader);
  7501.             SpotAnim.unpackConfig(streamLoader);
  7502.             Varp.unpackConfig(streamLoader);
  7503.             VarBit.unpackConfig(streamLoader);
  7504.             ItemDef.isMembers = isMembers;
  7505.             if(!lowMem)
  7506.             {
  7507.                 drawLoadingText(160, "Unpacking sounds");
  7508.                 byte abyte0[] = streamLoader_5.getDataForName("sounds.dat");
  7509.                 Stream stream = new Stream(abyte0);
  7510.                 Sounds.unpack(stream);
  7511.             }
  7512.             drawLoadingText(176, "Unpacking interfaces");
  7513.             TextDrawingArea aclass30_sub2_sub1_sub4s[] = {
  7514.                     smallText, aTextDrawingArea_1271, chatTextDrawingArea, aTextDrawingArea_1273
  7515.             };
  7516.             RSInterface.unpack(streamLoader_1, aclass30_sub2_sub1_sub4s, streamLoader_2);
  7517.             drawLoadingText(194, "Preparing game engine");
  7518.             for(int j6 = 0; j6 < 33; j6++)
  7519.             {
  7520.                 int k6 = 999;
  7521.                 int i7 = 0;
  7522.                 for(int k7 = 0; k7 < 34; k7++)
  7523.                 {
  7524.                     if(mapBack.aByteArray1450[k7 + j6 * mapBack.anInt1452] == 0)
  7525.                     {
  7526.                         if(k6 == 999)
  7527.                             k6 = k7;
  7528.                         continue;
  7529.                     }
  7530.                     if(k6 == 999)
  7531.                         continue;
  7532.                     i7 = k7;
  7533.                     break;
  7534.                 }
  7535.  
  7536.                 anIntArray968[j6] = k6;
  7537.                 anIntArray1057[j6] = i7 - k6;
  7538.             }
  7539.  
  7540.             for(int l6 = 5; l6 < 156; l6++)
  7541.             {
  7542.                 int j7 = 999;
  7543.                 int l7 = 0;
  7544.                 for(int j8 = 25; j8 < 172; j8++)
  7545.                 {
  7546.                     if(mapBack.aByteArray1450[j8 + l6 * mapBack.anInt1452] == 0 && (j8 > 34 || l6 > 34))
  7547.                     {
  7548.                         if(j7 == 999)
  7549.                             j7 = j8;
  7550.                         continue;
  7551.                     }
  7552.                     if(j7 == 999)
  7553.                         continue;
  7554.                     l7 = j8;
  7555.                     break;
  7556.                 }
  7557.  
  7558.                 anIntArray1052[l6 - 5] = j7 - 25;
  7559.                 anIntArray1229[l6 - 5] = l7 - j7;
  7560.             }
  7561.  
  7562.             Texture.method365(765, 503);
  7563.             fullScreenTextureArray = Texture.anIntArray1472;
  7564.             Texture.method365(519, 165);
  7565.             anIntArray1180 = Texture.anIntArray1472;
  7566.             Texture.method365(246, 335);
  7567.             anIntArray1181 = Texture.anIntArray1472;
  7568.             Texture.method365(512, 334);
  7569.             anIntArray1182 = Texture.anIntArray1472;
  7570.             int ai[] = new int[9];
  7571.             for(int i8 = 0; i8 < 9; i8++)
  7572.             {
  7573.                 int k8 = 128 + i8 * 32 + 15;
  7574.                 int l8 = 600 + k8 * 3;
  7575.                 int i9 = Texture.anIntArray1470[k8];
  7576.                 ai[i8] = l8 * i9 >> 16;
  7577.             }
  7578.  
  7579.             WorldController.method310(500, 800, 512, 334, ai);
  7580.             Censor.loadConfig(streamLoader_4);
  7581.             mouseDetection = new MouseDetection(this);
  7582.             startRunnable(mouseDetection, 10);
  7583.             Animable_Sub5.clientInstance = this;
  7584.             ObjectDef.clientInstance = this;
  7585.             EntityDef.clientInstance = this;
  7586.             return;
  7587.         }
  7588.         catch(Exception exception)
  7589.         {
  7590.             signlink.reporterror("loaderror " + aString1049 + " " + anInt1079);
  7591.         }
  7592.         loadingError = true;
  7593.     }
  7594.  
  7595.     private void method91(Stream stream, int i)
  7596.     {
  7597.         while(stream.bitPosition + 10 < i * 8)
  7598.         {
  7599.             int j = stream.readBits(11);
  7600.             if(j == 2047)
  7601.                 break;
  7602.             if(playerArray[j] == null)
  7603.             {
  7604.                 playerArray[j] = new Player();
  7605.                 if(aStreamArray895s[j] != null)
  7606.                     playerArray[j].updatePlayer(aStreamArray895s[j]);
  7607.             }
  7608.             playerIndices[playerCount++] = j;
  7609.             Player player = playerArray[j];
  7610.             player.anInt1537 = loopCycle;
  7611.             int k = stream.readBits(1);
  7612.             if(k == 1)
  7613.                 anIntArray894[anInt893++] = j;
  7614.             int l = stream.readBits(1);
  7615.             int i1 = stream.readBits(5);
  7616.             if(i1 > 15)
  7617.                 i1 -= 32;
  7618.             int j1 = stream.readBits(5);
  7619.             if(j1 > 15)
  7620.                 j1 -= 32;
  7621.             player.setPos(myPlayer.smallX[0] + j1, myPlayer.smallY[0] + i1, l == 1);
  7622.         }
  7623.         stream.finishBitAccess();
  7624.     }
  7625.  
  7626.     private void processMainScreenClick() {
  7627.         if(anInt1021 != 0)
  7628.             return;
  7629.         if(super.clickMode3 == 1) {
  7630.             int i = super.saveClickX - 25 - 545;
  7631.             int j = super.saveClickY - 5 - 4;
  7632.             if(i >= 0 && j >= 0 && i < 146 && j < 151) {
  7633.                 i -= 73;
  7634.                 j -= 75;
  7635.                 int k = minimapInt1 + minimapInt2 & 0x7ff;
  7636.                 int i1 = Texture.anIntArray1470[k];
  7637.                 int j1 = Texture.anIntArray1471[k];
  7638.                 i1 = i1 * (minimapInt3 + 256) >> 8;
  7639.                 j1 = j1 * (minimapInt3 + 256) >> 8;
  7640.                 int k1 = j * i1 + i * j1 >> 11;
  7641.                 int l1 = j * j1 - i * i1 >> 11;
  7642.                 int i2 = myPlayer.x + k1 >> 7;
  7643.                 int j2 = myPlayer.y - l1 >> 7;
  7644.                 boolean flag1 = doWalkTo(1, 0, 0, 0, myPlayer.smallY[0], 0, 0, j2, myPlayer.smallX[0], true, i2);
  7645.                 if(flag1) {
  7646.                     stream.writeWordBigEndian(i);
  7647.                     stream.writeWordBigEndian(j);
  7648.                     stream.writeWord(minimapInt1);
  7649.                     stream.writeWordBigEndian(57);
  7650.                     stream.writeWordBigEndian(minimapInt2);
  7651.                     stream.writeWordBigEndian(minimapInt3);
  7652.                     stream.writeWordBigEndian(89);
  7653.                     stream.writeWord(myPlayer.x);
  7654.                     stream.writeWord(myPlayer.y);
  7655.                     stream.writeWordBigEndian(anInt1264);
  7656.                     stream.writeWordBigEndian(63);
  7657.                 }
  7658.             }
  7659.             anInt1117++;
  7660.             if(anInt1117 > 1151) {
  7661.                 anInt1117 = 0;
  7662.                 stream.createFrame(246);
  7663.                 stream.writeWordBigEndian(0);
  7664.                 int l = stream.currentOffset;
  7665.                 if((int)(Math.random() * 2D) == 0)
  7666.                     stream.writeWordBigEndian(101);
  7667.                 stream.writeWordBigEndian(197);
  7668.                 stream.writeWord((int)(Math.random() * 65536D));
  7669.                 stream.writeWordBigEndian((int)(Math.random() * 256D));
  7670.                 stream.writeWordBigEndian(67);
  7671.                 stream.writeWord(14214);
  7672.                 if((int)(Math.random() * 2D) == 0)
  7673.                     stream.writeWord(29487);
  7674.                 stream.writeWord((int)(Math.random() * 65536D));
  7675.                 if((int)(Math.random() * 2D) == 0)
  7676.                     stream.writeWordBigEndian(220);
  7677.                 stream.writeWordBigEndian(180);
  7678.                 stream.writeBytes(stream.currentOffset - l);
  7679.             }
  7680.         }
  7681.     }
  7682.  
  7683.     private String interfaceIntToString(int j) {
  7684.         if(j < 0x3b9ac9ff)
  7685.             return String.valueOf(j);
  7686.         else
  7687.             return "*";
  7688.     }
  7689.  
  7690.     private void showErrorScreen()
  7691.     {
  7692.         Graphics g = getGameComponent().getGraphics();
  7693.         g.setColor(Color.black);
  7694.         g.fillRect(0, 0, 765, 503);
  7695.         method4(1);
  7696.         if(loadingError)
  7697.         {
  7698.             aBoolean831 = false;
  7699.             g.setFont(new Font("Helvetica", 1, 16));
  7700.             g.setColor(Color.yellow);
  7701.             int k = 35;
  7702.             g.drawString("Sorry, an error has occured whilst loading RuneScape", 30, k);
  7703.             k += 50;
  7704.             g.setColor(Color.white);
  7705.             g.drawString("To fix this try the following (in order):", 30, k);
  7706.             k += 50;
  7707.             g.setColor(Color.white);
  7708.             g.setFont(new Font("Helvetica", 1, 12));
  7709.             g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, k);
  7710.             k += 30;
  7711.             g.drawString("2: Try clearing your web-browsers cache from tools->internet options", 30, k);
  7712.             k += 30;
  7713.             g.drawString("3: Try using a different game-world", 30, k);
  7714.             k += 30;
  7715.             g.drawString("4: Try rebooting your computer", 30, k);
  7716.             k += 30;
  7717.             g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
  7718.         }
  7719.         if(genericLoadingError)
  7720.         {
  7721.             aBoolean831 = false;
  7722.             g.setFont(new Font("Helvetica", 1, 20));
  7723.             g.setColor(Color.white);
  7724.             g.drawString("Error - unable to load game!", 50, 50);
  7725.             g.drawString("To play RuneScape make sure you play from", 50, 100);
  7726.             g.drawString("http://www.runescape.com", 50, 150);
  7727.         }
  7728.         if(rsAlreadyLoaded)
  7729.         {
  7730.             aBoolean831 = false;
  7731.             g.setColor(Color.yellow);
  7732.             int l = 35;
  7733.             g.drawString("Error a copy of RuneScape already appears to be loaded", 30, l);
  7734.             l += 50;
  7735.             g.setColor(Color.white);
  7736.             g.drawString("To fix this try the following (in order):", 30, l);
  7737.             l += 50;
  7738.             g.setColor(Color.white);
  7739.             g.setFont(new Font("Helvetica", 1, 12));
  7740.             g.drawString("1: Try closing ALL open web-browser windows, and reloading", 30, l);
  7741.             l += 30;
  7742.             g.drawString("2: Try rebooting your computer, and reloading", 30, l);
  7743.             l += 30;
  7744.         }
  7745.     }
  7746.  
  7747.     public URL getCodeBase() {     
  7748.         try {
  7749.             return new URL(server +":" + (80 + portOff));
  7750.         } catch(Exception _ex) {
  7751.         }
  7752.         return null;
  7753.     }
  7754.  
  7755.     private void method95() {
  7756.         for(int j = 0; j < npcCount; j++) {
  7757.             int k = npcIndices[j];
  7758.             NPC npc = npcArray[k];
  7759.             if(npc != null)
  7760.                 method96(npc);
  7761.         }
  7762.     }
  7763.  
  7764.     private void method96(Entity entity)
  7765.     {
  7766.         if(entity.x < 128 || entity.y < 128 || entity.x >= 13184 || entity.y >= 13184)
  7767.         {
  7768.             entity.anim = -1;
  7769.             entity.anInt1520 = -1;
  7770.             entity.anInt1547 = 0;
  7771.             entity.anInt1548 = 0;
  7772.             entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7773.             entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7774.             entity.method446();
  7775.         }
  7776.         if(entity == myPlayer && (entity.x < 1536 || entity.y < 1536 || entity.x >= 11776 || entity.y >= 11776))
  7777.         {
  7778.             entity.anim = -1;
  7779.             entity.anInt1520 = -1;
  7780.             entity.anInt1547 = 0;
  7781.             entity.anInt1548 = 0;
  7782.             entity.x = entity.smallX[0] * 128 + entity.anInt1540 * 64;
  7783.             entity.y = entity.smallY[0] * 128 + entity.anInt1540 * 64;
  7784.             entity.method446();
  7785.         }
  7786.         if(entity.anInt1547 > loopCycle)
  7787.             method97(entity);
  7788.         else
  7789.         if(entity.anInt1548 >= loopCycle)
  7790.             method98(entity);
  7791.         else
  7792.             method99(entity);
  7793.         method100(entity);
  7794.         method101(entity);
  7795.     }
  7796.  
  7797.     private void method97(Entity entity)
  7798.     {
  7799.         int i = entity.anInt1547 - loopCycle;
  7800.         int j = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7801.         int k = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7802.         entity.x += (j - entity.x) / i;
  7803.         entity.y += (k - entity.y) / i;
  7804.         entity.anInt1503 = 0;
  7805.         if(entity.anInt1549 == 0)
  7806.             entity.turnDirection = 1024;
  7807.         if(entity.anInt1549 == 1)
  7808.             entity.turnDirection = 1536;
  7809.         if(entity.anInt1549 == 2)
  7810.             entity.turnDirection = 0;
  7811.         if(entity.anInt1549 == 3)
  7812.             entity.turnDirection = 512;
  7813.     }
  7814.  
  7815.     private void method98(Entity entity)
  7816.     {
  7817.         if(entity.anInt1548 == loopCycle || entity.anim == -1 || entity.anInt1529 != 0 || entity.anInt1528 + 1 > Animation.anims[entity.anim].method258(entity.anInt1527))
  7818.         {
  7819.             int i = entity.anInt1548 - entity.anInt1547;
  7820.             int j = loopCycle - entity.anInt1547;
  7821.             int k = entity.anInt1543 * 128 + entity.anInt1540 * 64;
  7822.             int l = entity.anInt1545 * 128 + entity.anInt1540 * 64;
  7823.             int i1 = entity.anInt1544 * 128 + entity.anInt1540 * 64;
  7824.             int j1 = entity.anInt1546 * 128 + entity.anInt1540 * 64;
  7825.             entity.x = (k * (i - j) + i1 * j) / i;
  7826.             entity.y = (l * (i - j) + j1 * j) / i;
  7827.         }
  7828.         entity.anInt1503 = 0;
  7829.         if(entity.anInt1549 == 0)
  7830.             entity.turnDirection = 1024;
  7831.         if(entity.anInt1549 == 1)
  7832.             entity.turnDirection = 1536;
  7833.         if(entity.anInt1549 == 2)
  7834.             entity.turnDirection = 0;
  7835.         if(entity.anInt1549 == 3)
  7836.             entity.turnDirection = 512;
  7837.         entity.anInt1552 = entity.turnDirection;
  7838.     }
  7839.  
  7840.     private void method99(Entity entity)
  7841.     {
  7842.         entity.anInt1517 = entity.anInt1511;
  7843.         if(entity.smallXYIndex == 0)
  7844.         {
  7845.             entity.anInt1503 = 0;
  7846.             return;
  7847.         }
  7848.         if(entity.anim != -1 && entity.anInt1529 == 0)
  7849.         {
  7850.             Animation animation = Animation.anims[entity.anim];
  7851.             if(entity.anInt1542 > 0 && animation.anInt363 == 0)
  7852.             {
  7853.                 entity.anInt1503++;
  7854.                 return;
  7855.             }
  7856.             if(entity.anInt1542 <= 0 && animation.anInt364 == 0)
  7857.             {
  7858.                 entity.anInt1503++;
  7859.                 return;
  7860.             }
  7861.         }
  7862.         int i = entity.x;
  7863.         int j = entity.y;
  7864.         int k = entity.smallX[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7865.         int l = entity.smallY[entity.smallXYIndex - 1] * 128 + entity.anInt1540 * 64;
  7866.         if(k - i > 256 || k - i < -256 || l - j > 256 || l - j < -256)
  7867.         {
  7868.             entity.x = k;
  7869.             entity.y = l;
  7870.             return;
  7871.         }
  7872.         if(i < k)
  7873.         {
  7874.             if(j < l)
  7875.                 entity.turnDirection = 1280;
  7876.             else
  7877.             if(j > l)
  7878.                 entity.turnDirection = 1792;
  7879.             else
  7880.                 entity.turnDirection = 1536;
  7881.         } else
  7882.         if(i > k)
  7883.         {
  7884.             if(j < l)
  7885.                 entity.turnDirection = 768;
  7886.             else
  7887.             if(j > l)
  7888.                 entity.turnDirection = 256;
  7889.             else
  7890.                 entity.turnDirection = 512;
  7891.         } else
  7892.         if(j < l)
  7893.             entity.turnDirection = 1024;
  7894.         else
  7895.             entity.turnDirection = 0;
  7896.         int i1 = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7897.         if(i1 > 1024)
  7898.             i1 -= 2048;
  7899.         int j1 = entity.anInt1555;
  7900.         if(i1 >= -256 && i1 <= 256)
  7901.             j1 = entity.anInt1554;
  7902.         else
  7903.         if(i1 >= 256 && i1 < 768)
  7904.             j1 = entity.anInt1557;
  7905.         else
  7906.         if(i1 >= -768 && i1 <= -256)
  7907.             j1 = entity.anInt1556;
  7908.         if(j1 == -1)
  7909.             j1 = entity.anInt1554;
  7910.         entity.anInt1517 = j1;
  7911.         int k1 = 4;
  7912.         if(entity.anInt1552 != entity.turnDirection && entity.interactingEntity == -1 && entity.anInt1504 != 0)
  7913.             k1 = 2;
  7914.         if(entity.smallXYIndex > 2)
  7915.             k1 = 6;
  7916.         if(entity.smallXYIndex > 3)
  7917.             k1 = 8;
  7918.         if(entity.anInt1503 > 0 && entity.smallXYIndex > 1)
  7919.         {
  7920.             k1 = 8;
  7921.             entity.anInt1503--;
  7922.         }
  7923.         if(entity.aBooleanArray1553[entity.smallXYIndex - 1])
  7924.             k1 <<= 1;
  7925.         if(k1 >= 8 && entity.anInt1517 == entity.anInt1554 && entity.anInt1505 != -1)
  7926.             entity.anInt1517 = entity.anInt1505;
  7927.         if(i < k)
  7928.         {
  7929.             entity.x += k1;
  7930.             if(entity.x > k)
  7931.                 entity.x = k;
  7932.         } else
  7933.         if(i > k)
  7934.         {
  7935.             entity.x -= k1;
  7936.             if(entity.x < k)
  7937.                 entity.x = k;
  7938.         }
  7939.         if(j < l)
  7940.         {
  7941.             entity.y += k1;
  7942.             if(entity.y > l)
  7943.                 entity.y = l;
  7944.         } else
  7945.         if(j > l)
  7946.         {
  7947.             entity.y -= k1;
  7948.             if(entity.y < l)
  7949.                 entity.y = l;
  7950.         }
  7951.         if(entity.x == k && entity.y == l)
  7952.         {
  7953.             entity.smallXYIndex--;
  7954.             if(entity.anInt1542 > 0)
  7955.                 entity.anInt1542--;
  7956.         }
  7957.     }
  7958.  
  7959.     private void method100(Entity entity)
  7960.     {
  7961.         if(entity.anInt1504 == 0)
  7962.             return;
  7963.         if(entity.interactingEntity != -1 && entity.interactingEntity < 32768)
  7964.         {
  7965.             NPC npc = npcArray[entity.interactingEntity];
  7966.             if(npc != null)
  7967.             {
  7968.                 int i1 = entity.x - npc.x;
  7969.                 int k1 = entity.y - npc.y;
  7970.                 if(i1 != 0 || k1 != 0)
  7971.                     entity.turnDirection = (int)(Math.atan2(i1, k1) * 325.94900000000001D) & 0x7ff;
  7972.             }
  7973.         }
  7974.         if(entity.interactingEntity >= 32768)
  7975.         {
  7976.             int j = entity.interactingEntity - 32768;
  7977.             if(j == unknownInt10)
  7978.                 j = myPlayerIndex;
  7979.             Player player = playerArray[j];
  7980.             if(player != null)
  7981.             {
  7982.                 int l1 = entity.x - player.x;
  7983.                 int i2 = entity.y - player.y;
  7984.                 if(l1 != 0 || i2 != 0)
  7985.                     entity.turnDirection = (int)(Math.atan2(l1, i2) * 325.94900000000001D) & 0x7ff;
  7986.             }
  7987.         }
  7988.         if((entity.anInt1538 != 0 || entity.anInt1539 != 0) && (entity.smallXYIndex == 0 || entity.anInt1503 > 0))
  7989.         {
  7990.             int k = entity.x - (entity.anInt1538 - baseX - baseX) * 64;
  7991.             int j1 = entity.y - (entity.anInt1539 - baseY - baseY) * 64;
  7992.             if(k != 0 || j1 != 0)
  7993.                 entity.turnDirection = (int)(Math.atan2(k, j1) * 325.94900000000001D) & 0x7ff;
  7994.             entity.anInt1538 = 0;
  7995.             entity.anInt1539 = 0;
  7996.         }
  7997.         int l = entity.turnDirection - entity.anInt1552 & 0x7ff;
  7998.         if(l != 0)
  7999.         {
  8000.             if(l < entity.anInt1504 || l > 2048 - entity.anInt1504)
  8001.                 entity.anInt1552 = entity.turnDirection;
  8002.             else
  8003.             if(l > 1024)
  8004.                 entity.anInt1552 -= entity.anInt1504;
  8005.             else
  8006.                 entity.anInt1552 += entity.anInt1504;
  8007.             entity.anInt1552 &= 0x7ff;
  8008.             if(entity.anInt1517 == entity.anInt1511 && entity.anInt1552 != entity.turnDirection)
  8009.             {
  8010.                 if(entity.anInt1512 != -1)
  8011.                 {
  8012.                     entity.anInt1517 = entity.anInt1512;
  8013.                     return;
  8014.                 }
  8015.                 entity.anInt1517 = entity.anInt1554;
  8016.             }
  8017.         }
  8018.     }
  8019.  
  8020.     private void method101(Entity entity)
  8021.     {
  8022.         entity.aBoolean1541 = false;
  8023.         if(entity.anInt1517 != -1)
  8024.         {
  8025.             Animation animation = Animation.anims[entity.anInt1517];
  8026.             entity.anInt1519++;
  8027.             if(entity.anInt1518 < animation.anInt352 && entity.anInt1519 > animation.method258(entity.anInt1518))
  8028.             {
  8029.                 entity.anInt1519 = 0;
  8030.                 entity.anInt1518++;
  8031.             }
  8032.             if(entity.anInt1518 >= animation.anInt352)
  8033.             {
  8034.                 entity.anInt1519 = 0;
  8035.                 entity.anInt1518 = 0;
  8036.             }
  8037.         }
  8038.         if(entity.anInt1520 != -1 && loopCycle >= entity.anInt1523)
  8039.         {
  8040.             if(entity.anInt1521 < 0)
  8041.                 entity.anInt1521 = 0;
  8042.             Animation animation_1 = SpotAnim.cache[entity.anInt1520].aAnimation_407;
  8043.             for(entity.anInt1522++; entity.anInt1521 < animation_1.anInt352 && entity.anInt1522 > animation_1.method258(entity.anInt1521); entity.anInt1521++)
  8044.                 entity.anInt1522 -= animation_1.method258(entity.anInt1521);
  8045.  
  8046.             if(entity.anInt1521 >= animation_1.anInt352 && (entity.anInt1521 < 0 || entity.anInt1521 >= animation_1.anInt352))
  8047.                 entity.anInt1520 = -1;
  8048.         }
  8049.         if(entity.anim != -1 && entity.anInt1529 <= 1)
  8050.         {
  8051.             Animation animation_2 = Animation.anims[entity.anim];
  8052.             if(animation_2.anInt363 == 1 && entity.anInt1542 > 0 && entity.anInt1547 <= loopCycle && entity.anInt1548 < loopCycle)
  8053.             {
  8054.                 entity.anInt1529 = 1;
  8055.                 return;
  8056.             }
  8057.         }
  8058.         if(entity.anim != -1 && entity.anInt1529 == 0)
  8059.         {
  8060.             Animation animation_3 = Animation.anims[entity.anim];
  8061.             for(entity.anInt1528++; entity.anInt1527 < animation_3.anInt352 && entity.anInt1528 > animation_3.method258(entity.anInt1527); entity.anInt1527++)
  8062.                 entity.anInt1528 -= animation_3.method258(entity.anInt1527);
  8063.  
  8064.             if(entity.anInt1527 >= animation_3.anInt352)
  8065.             {
  8066.                 entity.anInt1527 -= animation_3.anInt356;
  8067.                 entity.anInt1530++;
  8068.                 if(entity.anInt1530 >= animation_3.anInt362)
  8069.                     entity.anim = -1;
  8070.                 if(entity.anInt1527 < 0 || entity.anInt1527 >= animation_3.anInt352)
  8071.                     entity.anim = -1;
  8072.             }
  8073.             entity.aBoolean1541 = animation_3.aBoolean358;
  8074.         }
  8075.         if(entity.anInt1529 > 0)
  8076.             entity.anInt1529--;
  8077.     }
  8078.  
  8079.     private void drawGameScreen()
  8080.     {
  8081.         if (fullscreenInterfaceID != -1 && (loadingStage == 2 || super.fullGameScreen != null)) {
  8082.             if (loadingStage == 2) {
  8083.                 method119(anInt945, fullscreenInterfaceID);
  8084.                 if (openInterfaceID != -1) {
  8085.                     method119(anInt945, openInterfaceID);
  8086.                 }
  8087.                 anInt945 = 0;
  8088.                 resetAllImageProducers();
  8089.                 super.fullGameScreen.initDrawingArea();
  8090.                 Texture.anIntArray1472 = fullScreenTextureArray;
  8091.                 DrawingArea.setAllPixelsToZero();
  8092.                 welcomeScreenRaised = true;
  8093.                 if (openInterfaceID != -1) {
  8094.                     RSInterface rsInterface_1 = RSInterface.interfaceCache[openInterfaceID];
  8095.                     if (rsInterface_1.width == 512 && rsInterface_1.height == 334 && rsInterface_1.type == 0) {
  8096.                         rsInterface_1.width = 765;
  8097.                         rsInterface_1.height = 503;
  8098.                     }
  8099.                     drawInterface(0, 0, rsInterface_1, 8);
  8100.                 }
  8101.                 RSInterface rsInterface = RSInterface.interfaceCache[fullscreenInterfaceID];
  8102.                 if (rsInterface.width == 512 && rsInterface.height == 334 && rsInterface.type == 0) {
  8103.                     rsInterface.width = 765;
  8104.                     rsInterface.height = 503;
  8105.                 }
  8106.                 drawInterface(0, 0, rsInterface, 8);
  8107.  
  8108.                 if (!menuOpen) {
  8109.                     processRightClick();
  8110.                     drawTooltip();
  8111.                 } else {
  8112.                     drawMenu();
  8113.                 }
  8114.             }
  8115.             drawCount++;
  8116.             super.fullGameScreen.drawGraphics(0, super.graphics, 0);
  8117.             return;
  8118.         } else {
  8119.             if (drawCount != 0) {
  8120.                 resetImageProducers2();
  8121.             }
  8122.         }
  8123.         if(welcomeScreenRaised) {
  8124.             welcomeScreenRaised = false;
  8125.             topFrame.drawGraphics(0, super.graphics, 0);
  8126.             leftFrame.drawGraphics(4, super.graphics, 0);
  8127.             rightFrame.drawGraphics(4, super.graphics, 516);
  8128.             mapEdgeIP.drawGraphics(4, super.graphics, 519);
  8129.             needDrawTabArea = true;
  8130.             inputTaken = true;
  8131.             tabAreaAltered = true;
  8132.             aBoolean1233 = true;
  8133.             if(loadingStage != 2) {
  8134.                 aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  8135.                 aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8136.             }
  8137.         }
  8138.         if(menuOpen && menuScreenArea == 1)
  8139.             needDrawTabArea = true;
  8140.         if(invOverlayInterfaceID != -1)
  8141.         {
  8142.             boolean flag1 = method119(anInt945, invOverlayInterfaceID);
  8143.             if(flag1)
  8144.                 needDrawTabArea = true;
  8145.         }
  8146.         if(atInventoryInterfaceType == 2)
  8147.             needDrawTabArea = true;
  8148.         if(activeInterfaceType == 2)
  8149.             needDrawTabArea = true;
  8150.         /*if(needDrawTabArea)
  8151.         {*/
  8152.             drawTabArea();
  8153.             /*needDrawTabArea = false;
  8154.         }*/
  8155.         if(backDialogID == -1)
  8156.         {
  8157.             aClass9_1059.scrollPosition = anInt1211 - anInt1089 - 110;
  8158.             if(super.mouseX > 478 && super.mouseX < 580 && super.mouseY > 342)
  8159.                 method65(494, 110, super.mouseX - 0, super.mouseY - 348, aClass9_1059, 0, false, anInt1211);
  8160.             int i = anInt1211 - 110 - aClass9_1059.scrollPosition;
  8161.             if(i < 0)
  8162.                 i = 0;
  8163.             if(i > anInt1211 - 110)
  8164.                 i = anInt1211 - 110;
  8165.             if(anInt1089 != i)
  8166.             {
  8167.                 anInt1089 = i;
  8168.                 inputTaken = true;
  8169.             }
  8170.         }
  8171.         if(backDialogID != -1) {
  8172.             boolean flag2 = method119(anInt945, backDialogID);
  8173.             if(flag2)
  8174.                 inputTaken = true;
  8175.         }
  8176.         if(atInventoryInterfaceType == 3)
  8177.             inputTaken = true;
  8178.         if(activeInterfaceType == 3)
  8179.             inputTaken = true;
  8180.         if(aString844 != null)
  8181.             inputTaken = true;
  8182.         if(menuOpen && menuScreenArea == 2)
  8183.             inputTaken = true;
  8184.         if(inputTaken) {
  8185.             drawChatArea();
  8186.             inputTaken = false;
  8187.         }
  8188.         if(loadingStage == 2)
  8189.             method146();
  8190.         if(loadingStage == 2) {
  8191.             drawMinimap();
  8192.             aRSImageProducer_1164.drawGraphics(4, super.graphics, 545);
  8193.         }
  8194.         if(anInt1054 != -1)
  8195.             tabAreaAltered = true;
  8196.         if(tabAreaAltered)
  8197.         {
  8198.             if(anInt1054 != -1 && anInt1054 == tabID)
  8199.             {
  8200.                 anInt1054 = -1;
  8201.                 stream.createFrame(120);
  8202.                 stream.writeWordBigEndian(tabID);
  8203.             }
  8204.             tabAreaAltered = false;
  8205.             aRSImageProducer_1125.initDrawingArea();
  8206.             aRSImageProducer_1165.initDrawingArea();
  8207.         }
  8208.         anInt945 = 0;
  8209.     }
  8210.  
  8211.     private boolean buildFriendsListMenu(RSInterface class9)
  8212.     {
  8213.         int i = class9.contentType;
  8214.         if(i >= 1 && i <= 200 || i >= 701 && i <= 900)
  8215.         {
  8216.             if(i >= 801)
  8217.                 i -= 701;
  8218.             else
  8219.             if(i >= 701)
  8220.                 i -= 601;
  8221.             else
  8222.             if(i >= 101)
  8223.                 i -= 101;
  8224.             else
  8225.                 i--;
  8226.             menuActionName[menuActionRow] = "Remove @whi@" + friendsList[i];
  8227.             menuActionID[menuActionRow] = 792;
  8228.             menuActionRow++;
  8229.             menuActionName[menuActionRow] = "Message @whi@" + friendsList[i];
  8230.             menuActionID[menuActionRow] = 639;
  8231.             menuActionRow++;
  8232.             return true;
  8233.         }
  8234.         if(i >= 401 && i <= 500)
  8235.         {
  8236.             menuActionName[menuActionRow] = "Remove @whi@" + class9.message;
  8237.             menuActionID[menuActionRow] = 322;
  8238.             menuActionRow++;
  8239.             return true;
  8240.         } else
  8241.         {
  8242.             return false;
  8243.         }
  8244.     }
  8245.  
  8246.     private void method104()
  8247.     {
  8248.         Animable_Sub3 class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetFirst();
  8249.         for(; class30_sub2_sub4_sub3 != null; class30_sub2_sub4_sub3 = (Animable_Sub3)aClass19_1056.reverseGetNext())
  8250.             if(class30_sub2_sub4_sub3.anInt1560 != plane || class30_sub2_sub4_sub3.aBoolean1567)
  8251.                 class30_sub2_sub4_sub3.unlink();
  8252.             else
  8253.             if(loopCycle >= class30_sub2_sub4_sub3.anInt1564)
  8254.             {
  8255.                 class30_sub2_sub4_sub3.method454(anInt945);
  8256.                 if(class30_sub2_sub4_sub3.aBoolean1567)
  8257.                     class30_sub2_sub4_sub3.unlink();
  8258.                 else
  8259.                     worldController.method285(class30_sub2_sub4_sub3.anInt1560, 0, class30_sub2_sub4_sub3.anInt1563, -1, class30_sub2_sub4_sub3.anInt1562, 60, class30_sub2_sub4_sub3.anInt1561, class30_sub2_sub4_sub3, false);
  8260.             }
  8261.  
  8262.     }
  8263.    
  8264.     public void drawBlackBox(int xPos, int yPos) {
  8265.         DrawingArea.drawPixels(71, yPos - 1, xPos - 2, 0x726451, 1);
  8266.         DrawingArea.drawPixels(69, yPos, xPos + 174, 0x726451, 1);
  8267.         DrawingArea.drawPixels(1, yPos - 2, xPos - 2, 0x726451, 178);
  8268.         DrawingArea.drawPixels(1, yPos + 68, xPos, 0x726451, 174);
  8269.         DrawingArea.drawPixels(71, yPos - 1, xPos - 1, 0x2E2B23, 1);
  8270.         DrawingArea.drawPixels(71, yPos - 1, xPos + 175, 0x2E2B23, 1);
  8271.         DrawingArea.drawPixels(1, yPos - 1, xPos, 0x2E2B23, 175);
  8272.         DrawingArea.drawPixels(1, yPos + 69, xPos, 0x2E2B23, 175);
  8273.         DrawingArea.method335(0, yPos, 174, 68, 220, xPos);
  8274.     }
  8275.    
  8276.     private void drawInterface(int j, int k, RSInterface class9, int l) {
  8277.         if(class9.type != 0 || class9.children == null)
  8278.             return;
  8279.         if(class9.isMouseoverTriggered && anInt1026 != class9.id && anInt1048 != class9.id && anInt1039 != class9.id)
  8280.             return;
  8281.         int i1 = DrawingArea.topX;
  8282.         int j1 = DrawingArea.topY;
  8283.         int k1 = DrawingArea.bottomX;
  8284.         int l1 = DrawingArea.bottomY;
  8285.         DrawingArea.setDrawingArea(l + class9.height, k, k + class9.width, l);
  8286.         int i2 = class9.children.length;
  8287.         for(int j2 = 0; j2 < i2; j2++)  {
  8288.             int k2 = class9.childX[j2] + k;
  8289.             int l2 = (class9.childY[j2] + l) - j;
  8290.             RSInterface class9_1 = RSInterface.interfaceCache[class9.children[j2]];
  8291.             k2 += class9_1.anInt263;
  8292.             l2 += class9_1.anInt265;
  8293.             if(class9_1.contentType > 0)
  8294.                 drawFriendsListOrWelcomeScreen(class9_1);
  8295.             //here
  8296.             int[] IDs = {
  8297.                 1196, 1199, 1206, 1215, 1224, 1231, 1240, 1249, 1258, 1267, 1274, 1283, 1573,
  8298.                 1290, 1299, 1308, 1315, 1324, 1333, 1340, 1349, 1358, 1367, 1374, 1381, 1388,
  8299.                 1397, 1404, 1583, 12038, 1414, 1421, 1430, 1437, 1446, 1453, 1460, 1469, 15878,
  8300.                 1602, 1613, 1624, 7456, 1478, 1485, 1494, 1503, 1512, 1521, 1530, 1544, 1553,
  8301.                 1563, 1593, 1635, 12426, 12436, 12446, 12456, 6004, 18471,
  8302.                 /* Ancients */
  8303.                 12940, 12988, 13036, 12902, 12862, 13046, 12964, 13012, 13054, 12920, 12882, 13062,
  8304.                 12952, 13000, 13070, 12912, 12872, 13080, 12976, 13024, 13088, 12930, 12892, 13096
  8305.             };
  8306.             for(int m5 = 0; m5 < IDs.length; m5++) {
  8307.                 if(class9_1.id == IDs[m5] + 1) {
  8308.                     if(m5 > 61)
  8309.                         drawBlackBox(k2 + 1, l2);
  8310.                     else
  8311.                         drawBlackBox(k2, l2 + 1);
  8312.                 }
  8313.             }
  8314.             int[] runeChildren = {
  8315.                 1202, 1203, 1209, 1210, 1211, 1218, 1219, 1220, 1227, 1228, 1234, 1235, 1236, 1243, 1244, 1245,
  8316.                 1252, 1253, 1254, 1261, 1262, 1263, 1270, 1271, 1277, 1278, 1279, 1286, 1287, 1293, 1294, 1295,
  8317.                 1302, 1303, 1304, 1311, 1312, 1318, 1319, 1320, 1327, 1328, 1329, 1336, 1337, 1343, 1344, 1345,
  8318.                 1352, 1353, 1354, 1361, 1362, 1363, 1370, 1371, 1377, 1378, 1384, 1385, 1391, 1392, 1393, 1400,
  8319.                 1401, 1407, 1408, 1410, 1417, 1418, 1424, 1425, 1426, 1433, 1434, 1440, 1441, 1442, 1449, 1450,
  8320.                 1456, 1457, 1463, 1464, 1465, 1472, 1473, 1474, 1481, 1482, 1488, 1489, 1490, 1497, 1498, 1499,
  8321.                 1506, 1507, 1508, 1515, 1516, 1517, 1524, 1525, 1526, 1533, 1534, 1535, 1547, 1548, 1549, 1556,
  8322.                 1557, 1558, 1566, 1567, 1568, 1576, 1577, 1578, 1586, 1587, 1588, 1596, 1597, 1598, 1605, 1606,
  8323.                 1607, 1616, 1617, 1618, 1627, 1628, 1629, 1638, 1639, 1640, 6007, 6008, 6011, 8673, 8674, 12041,
  8324.                 12042, 12429, 12430, 12431, 12439, 12440, 12441, 12449, 12450, 12451, 12459, 12460, 15881, 15882,
  8325.                 15885, 18474, 18475, 18478
  8326.             };
  8327.             for(int r = 0; r < runeChildren.length; r++)
  8328.                 if(class9_1.id == runeChildren[r])
  8329.                     class9_1.modelZoom = 775;
  8330.             if(class9_1.type == 0) {
  8331.                 if(class9_1.scrollPosition > class9_1.scrollMax - class9_1.height)
  8332.                     class9_1.scrollPosition = class9_1.scrollMax - class9_1.height;
  8333.                 if(class9_1.scrollPosition < 0)
  8334.                     class9_1.scrollPosition = 0;
  8335.                 drawInterface(class9_1.scrollPosition, k2, class9_1, l2);
  8336.                 if(class9_1.scrollMax > class9_1.height)
  8337.                     drawScrollbar(class9_1.height, class9_1.scrollPosition, l2, k2 + class9_1.width, class9_1.scrollMax);
  8338.             } else if(class9_1.type != 1)
  8339.                 if(class9_1.type == 2) {
  8340.                     int i3 = 0;
  8341.                     for(int l3 = 0; l3 < class9_1.height; l3++) {
  8342.                         for(int l4 = 0; l4 < class9_1.width; l4++) {
  8343.                             int k5 = k2 + l4 * (32 + class9_1.invSpritePadX);
  8344.                             int j6 = l2 + l3 * (32 + class9_1.invSpritePadY);
  8345.                             if(i3 < 20) {
  8346.                                 k5 += class9_1.spritesX[i3];
  8347.                                 j6 += class9_1.spritesY[i3];
  8348.                             }
  8349.                             if(class9_1.inv[i3] > 0) {
  8350.                                 int k6 = 0;
  8351.                                 int j7 = 0;
  8352.                                 int j9 = class9_1.inv[i3] - 1;
  8353.                                 if(k5 > DrawingArea.topX - 32 && k5 < DrawingArea.bottomX && j6 > DrawingArea.topY - 32 && j6 < DrawingArea.bottomY || activeInterfaceType != 0 && anInt1085 == i3) {
  8354.                                     int l9 = 0;
  8355.                                     if(itemSelected == 1 && anInt1283 == i3 && anInt1284 == class9_1.id)
  8356.                                         l9 = 0xffffff;
  8357.                                     Sprite class30_sub2_sub1_sub1_2 = ItemDef.getSprite(j9, class9_1.invStackSizes[i3], l9);
  8358.                                     if(class30_sub2_sub1_sub1_2 != null) {
  8359.                                         if(activeInterfaceType != 0 && anInt1085 == i3 && anInt1084 == class9_1.id) {
  8360.                                             k6 = super.mouseX - anInt1087;
  8361.                                             j7 = super.mouseY - anInt1088;
  8362.                                             if(k6 < 5 && k6 > -5)
  8363.                                                 k6 = 0;
  8364.                                             if(j7 < 5 && j7 > -5)
  8365.                                                 j7 = 0;
  8366.                                             if(anInt989 < 5) {
  8367.                                                 k6 = 0;
  8368.                                                 j7 = 0;
  8369.                                             }
  8370.                                             class30_sub2_sub1_sub1_2.drawSprite1(k5 + k6, j6 + j7);
  8371.                                             if(j6 + j7 < DrawingArea.topY && class9.scrollPosition > 0) {
  8372.                                                 int i10 = (anInt945 * (DrawingArea.topY - j6 - j7)) / 3;
  8373.                                                 if(i10 > anInt945 * 10)
  8374.                                                     i10 = anInt945 * 10;
  8375.                                                 if(i10 > class9.scrollPosition)
  8376.                                                     i10 = class9.scrollPosition;
  8377.                                                 class9.scrollPosition -= i10;
  8378.                                                 anInt1088 += i10;
  8379.                                             }
  8380.                                             if(j6 + j7 + 32 > DrawingArea.bottomY && class9.scrollPosition < class9.scrollMax - class9.height) {
  8381.                                                 int j10 = (anInt945 * ((j6 + j7 + 32) - DrawingArea.bottomY)) / 3;
  8382.                                                 if(j10 > anInt945 * 10)
  8383.                                                     j10 = anInt945 * 10;
  8384.                                                 if(j10 > class9.scrollMax - class9.height - class9.scrollPosition)
  8385.                                                     j10 = class9.scrollMax - class9.height - class9.scrollPosition;
  8386.                                                 class9.scrollPosition += j10;
  8387.                                                 anInt1088 -= j10;
  8388.                                             }
  8389.                                         } else if(atInventoryInterfaceType != 0 && atInventoryIndex == i3 && atInventoryInterface == class9_1.id)
  8390.                                             class30_sub2_sub1_sub1_2.drawSprite1(k5, j6);
  8391.                                         else
  8392.                                             class30_sub2_sub1_sub1_2.drawSprite(k5, j6);
  8393.                                         if(class30_sub2_sub1_sub1_2.anInt1444 == 33 || class9_1.invStackSizes[i3] != 1)
  8394.                                         {
  8395.                                             int k10 = class9_1.invStackSizes[i3];
  8396.                                             if(k10 >= 1)
  8397.                                                 smallText.method385(0xFFFF00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8398.                                             if(k10 >= 100000)
  8399.                                                 smallText.method385(0xFFFFFF, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8400.                                             if(k10 >= 10000000)
  8401.                                                 smallText.method385(0x49E20E, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);
  8402.  
  8403.                                             /*smallText.method385(0, intToKOrMil(k10), j6 + 10 + j7, k5 + 1 + k6);
  8404.                                             smallText.method385(0xffff00, intToKOrMil(k10), j6 + 9 + j7, k5 + k6);*/
  8405.                                         }
  8406.                                     }
  8407.                                 }
  8408.                             } else if(class9_1.sprites != null && i3 < 20) {
  8409.                                 Sprite class30_sub2_sub1_sub1_1 = class9_1.sprites[i3];
  8410.                                 if(class30_sub2_sub1_sub1_1 != null)
  8411.                                     class30_sub2_sub1_sub1_1.drawSprite(k5, j6);
  8412.                             }
  8413.                             i3++;
  8414.                         }
  8415.                     }
  8416.                 } else if(class9_1.type == 3) {
  8417.                     boolean flag = false;
  8418.                     if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8419.                         flag = true;
  8420.                     int j3;
  8421.                     if(interfaceIsSelected(class9_1)) {
  8422.                         j3 = class9_1.anInt219;
  8423.                         if(flag && class9_1.anInt239 != 0)
  8424.                             j3 = class9_1.anInt239;
  8425.                     } else {
  8426.                         j3 = class9_1.textColor;
  8427.                         if(flag && class9_1.anInt216 != 0)
  8428.                             j3 = class9_1.anInt216;
  8429.                     }
  8430.                     if(class9_1.aByte254 == 0) {
  8431.                         if(class9_1.aBoolean227)
  8432.                             DrawingArea.drawPixels(class9_1.height, l2, k2, j3, class9_1.width);
  8433.                         else
  8434.                             DrawingArea.fillPixels(k2, class9_1.width, class9_1.height, j3, l2);
  8435.                     } else if(class9_1.aBoolean227)
  8436.                         DrawingArea.method335(j3, l2, class9_1.width, class9_1.height, 256 - (class9_1.aByte254 & 0xff), k2);
  8437.                     else
  8438.                         DrawingArea.method338(l2, class9_1.height, 256 - (class9_1.aByte254 & 0xff), j3, class9_1.width, k2);
  8439.                 } else if(class9_1.type == 4) {
  8440.                     TextDrawingArea textDrawingArea = class9_1.textDrawingAreas;
  8441.                     String s = class9_1.message;
  8442.                     boolean flag1 = false;
  8443.                     if(anInt1039 == class9_1.id || anInt1048 == class9_1.id || anInt1026 == class9_1.id)
  8444.                         flag1 = true;
  8445.                     int i4;
  8446.                     if(interfaceIsSelected(class9_1)) {
  8447.                         i4 = class9_1.anInt219;
  8448.                         if(flag1 && class9_1.anInt239 != 0)
  8449.                             i4 = class9_1.anInt239;
  8450.                         if(class9_1.aString228.length() > 0)
  8451.                             s = class9_1.aString228;
  8452.                     } else {
  8453.                         i4 = class9_1.textColor;
  8454.                         if(flag1 && class9_1.anInt216 != 0)
  8455.                             i4 = class9_1.anInt216;
  8456.                     }
  8457.                     if(class9_1.atActionType == 6 && aBoolean1149) {
  8458.                         s = "Please wait...";
  8459.                         i4 = class9_1.textColor;
  8460.                     }
  8461.                     if(DrawingArea.width == 519) {
  8462.                         if(i4 == 0xffff00)
  8463.                             i4 = 255;
  8464.                         if(i4 == 49152)
  8465.                             i4 = 0xffffff;
  8466.                     }
  8467.                     if((class9_1.parentID == 1151) || (class9_1.parentID == 12855)) {
  8468.                         switch (i4) {
  8469.                             case 16773120: i4 = 0xFE981F; break;
  8470.                             case 7040819: i4 = 0xAF6A1A; break;
  8471.                         }
  8472.                     }
  8473.                     for(int l6 = l2 + textDrawingArea.anInt1497; s.length() > 0; l6 += textDrawingArea.anInt1497)
  8474.                     {
  8475.                         if(s.indexOf("%") != -1)
  8476.                         {
  8477.                             do
  8478.                             {
  8479.                                 int k7 = s.indexOf("%1");
  8480.                                 if(k7 == -1)
  8481.                                     break;
  8482.                                 if(class9_1.id < 4000 || class9_1.id > 5000 && class9_1.id !=13921 && class9_1.id !=13922 && class9_1.id !=12171 && class9_1.id !=12172)
  8483.                                     s = s.substring(0, k7) + methodR(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8484.                                 else
  8485.                                     s = s.substring(0, k7) + interfaceIntToString(extractInterfaceValues(class9_1, 0)) + s.substring(k7 + 2);
  8486.                             } while(true);
  8487.                             do
  8488.                             {
  8489.                                 int l7 = s.indexOf("%2");
  8490.                                 if(l7 == -1)
  8491.                                     break;
  8492.                                 s = s.substring(0, l7) + interfaceIntToString(extractInterfaceValues(class9_1, 1)) + s.substring(l7 + 2);
  8493.                             } while(true);
  8494.                             do
  8495.                             {
  8496.                                 int i8 = s.indexOf("%3");
  8497.                                 if(i8 == -1)
  8498.                                     break;
  8499.                                 s = s.substring(0, i8) + interfaceIntToString(extractInterfaceValues(class9_1, 2)) + s.substring(i8 + 2);
  8500.                             } while(true);
  8501.                             do
  8502.                             {
  8503.                                 int j8 = s.indexOf("%4");
  8504.                                 if(j8 == -1)
  8505.                                     break;
  8506.                                 s = s.substring(0, j8) + interfaceIntToString(extractInterfaceValues(class9_1, 3)) + s.substring(j8 + 2);
  8507.                             } while(true);
  8508.                             do
  8509.                             {
  8510.                                 int k8 = s.indexOf("%5");
  8511.                                 if(k8 == -1)
  8512.                                     break;
  8513.                                 s = s.substring(0, k8) + interfaceIntToString(extractInterfaceValues(class9_1, 4)) + s.substring(k8 + 2);
  8514.                             } while(true);
  8515.                         }
  8516.                         int l8 = s.indexOf("\\n");
  8517.                         String s1;
  8518.                         if(l8 != -1)
  8519.                         {
  8520.                             s1 = s.substring(0, l8);
  8521.                             s = s.substring(l8 + 2);
  8522.                         } else
  8523.                         {
  8524.                             s1 = s;
  8525.                             s = "";
  8526.                         }
  8527.                         if(class9_1.centerText)
  8528.                             textDrawingArea.method382(i4, k2 + class9_1.width / 2, s1, l6, class9_1.textShadow);
  8529.                         else
  8530.                             textDrawingArea.method389(class9_1.textShadow, k2, i4, s1, l6);
  8531.                     }
  8532.                 } else if(class9_1.type == 5) {
  8533.                     //whats this?
  8534.                     Sprite sprite;
  8535.                     if(interfaceIsSelected(class9_1))
  8536.                         sprite = class9_1.sprite2;
  8537.                     else
  8538.                         sprite = class9_1.sprite1;
  8539.                     if(spellSelected == 1 && class9_1.id == spellID && spellID != 0 && sprite != null) {
  8540.                         sprite.drawSprite(k2, l2, 0xffffff);
  8541.                     } else {
  8542.                         if (sprite != null)
  8543.                             sprite.drawSprite(k2, l2);
  8544.                     }
  8545.                     if(sprite != null)
  8546.                         sprite.drawSprite(k2, l2);
  8547.                 } else if(class9_1.type == 6) {
  8548.                     int k3 = Texture.textureInt1;
  8549.                     int j4 = Texture.textureInt2;
  8550.                     Texture.textureInt1 = k2 + class9_1.width / 2;
  8551.                     Texture.textureInt2 = l2 + class9_1.height / 2;
  8552.                     int i5 = Texture.anIntArray1470[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8553.                     int l5 = Texture.anIntArray1471[class9_1.modelRotation1] * class9_1.modelZoom >> 16;
  8554.                     boolean flag2 = interfaceIsSelected(class9_1);
  8555.                     int i7;
  8556.                     if(flag2)
  8557.                         i7 = class9_1.anInt258;
  8558.                     else
  8559.                         i7 = class9_1.anInt257;
  8560.                     Model model;
  8561.                     if(i7 == -1) {
  8562.                         model = class9_1.method209(-1, -1, flag2);
  8563.                     } else {
  8564.                         Animation animation = Animation.anims[i7];
  8565.                         model = class9_1.method209(animation.anIntArray354[class9_1.anInt246], animation.anIntArray353[class9_1.anInt246], flag2);
  8566.                     }
  8567.                     if(model != null)
  8568.                         model.method482(class9_1.modelRotation2, 0, class9_1.modelRotation1, 0, i5, l5);
  8569.                     Texture.textureInt1 = k3;
  8570.                     Texture.textureInt2 = j4;
  8571.                 } else if(class9_1.type == 7) {
  8572.                     TextDrawingArea textDrawingArea_1 = class9_1.textDrawingAreas;
  8573.                     int k4 = 0;
  8574.                     for(int j5 = 0; j5 < class9_1.height; j5++) {
  8575.                         for(int i6 = 0; i6 < class9_1.width; i6++) {
  8576.                             if(class9_1.inv[k4] > 0) {
  8577.                                 ItemDef itemDef = ItemDef.forID(class9_1.inv[k4] - 1);
  8578.                                 String s2 = itemDef.name;
  8579.                                 if(itemDef.stackable || class9_1.invStackSizes[k4] != 1)
  8580.                                     s2 = s2 + " x" + intToKOrMilLongName(class9_1.invStackSizes[k4]);
  8581.                                 int i9 = k2 + i6 * (115 + class9_1.invSpritePadX);
  8582.                                 int k9 = l2 + j5 * (12 + class9_1.invSpritePadY);
  8583.                                 if(class9_1.centerText)
  8584.                                     textDrawingArea_1.method382(class9_1.textColor, i9 + class9_1.width / 2, s2, k9, class9_1.textShadow);
  8585.                                 else
  8586.                                     textDrawingArea_1.method389(class9_1.textShadow, i9, class9_1.textColor, s2, k9);
  8587.                             }
  8588.                             k4++;
  8589.                         }
  8590.                     }
  8591.                 } else if (class9_1.type == 8) {
  8592.                     drawHoverBox(k2, l2, class9_1.popupString);
  8593.                 }
  8594.         }
  8595.         DrawingArea.setDrawingArea(l1, i1, k1, j1);
  8596.     }
  8597.  
  8598.     private void randomizeBackground(Background background) {
  8599.         int j = 256;
  8600.         for(int k = 0; k < anIntArray1190.length; k++)
  8601.             anIntArray1190[k] = 0;
  8602.  
  8603.         for(int l = 0; l < 5000; l++) {
  8604.             int i1 = (int)(Math.random() * 128D * (double)j);
  8605.             anIntArray1190[i1] = (int)(Math.random() * 256D);
  8606.         }
  8607.         for(int j1 = 0; j1 < 20; j1++) {
  8608.             for(int k1 = 1; k1 < j - 1; k1++) {
  8609.                 for(int i2 = 1; i2 < 127; i2++) {
  8610.                     int k2 = i2 + (k1 << 7);
  8611.                     anIntArray1191[k2] = (anIntArray1190[k2 - 1] + anIntArray1190[k2 + 1] + anIntArray1190[k2 - 128] + anIntArray1190[k2 + 128]) / 4;
  8612.                 }
  8613.  
  8614.             }
  8615.             int ai[] = anIntArray1190;
  8616.             anIntArray1190 = anIntArray1191;
  8617.             anIntArray1191 = ai;
  8618.         }
  8619.         if(background != null) {
  8620.             int l1 = 0;
  8621.             for(int j2 = 0; j2 < background.anInt1453; j2++) {
  8622.                 for(int l2 = 0; l2 < background.anInt1452; l2++)
  8623.                     if(background.aByteArray1450[l1++] != 0) {
  8624.                         int i3 = l2 + 16 + background.anInt1454;
  8625.                         int j3 = j2 + 16 + background.anInt1455;
  8626.                         int k3 = i3 + (j3 << 7);
  8627.                         anIntArray1190[k3] = 0;
  8628.                     }
  8629.             }
  8630.         }
  8631.     }
  8632.  
  8633.     private void method107(int i, int j, Stream stream, Player player)
  8634.     {
  8635.         if((i & 0x400) != 0)
  8636.         {
  8637.             player.anInt1543 = stream.method428();
  8638.             player.anInt1545 = stream.method428();
  8639.             player.anInt1544 = stream.method428();
  8640.             player.anInt1546 = stream.method428();
  8641.             player.anInt1547 = stream.method436() + loopCycle;
  8642.             player.anInt1548 = stream.method435() + loopCycle;
  8643.             player.anInt1549 = stream.method428();
  8644.             player.method446();
  8645.         }
  8646.         if((i & 0x100) != 0)
  8647.         {
  8648.             player.anInt1520 = stream.method434();
  8649.             int k = stream.readDWord();
  8650.             player.anInt1524 = k >> 16;
  8651.             player.anInt1523 = loopCycle + (k & 0xffff);
  8652.             player.anInt1521 = 0;
  8653.             player.anInt1522 = 0;
  8654.             if(player.anInt1523 > loopCycle)
  8655.                 player.anInt1521 = -1;
  8656.             if(player.anInt1520 == 65535)
  8657.                 player.anInt1520 = -1;
  8658.         }
  8659.         if((i & 8) != 0)
  8660.         {
  8661.             int l = stream.method434();
  8662.             if(l == 65535)
  8663.                 l = -1;
  8664.             int i2 = stream.method427();
  8665.             if(l == player.anim && l != -1)
  8666.             {
  8667.                 int i3 = Animation.anims[l].anInt365;
  8668.                 if(i3 == 1)
  8669.                 {
  8670.                     player.anInt1527 = 0;
  8671.                     player.anInt1528 = 0;
  8672.                     player.anInt1529 = i2;
  8673.                     player.anInt1530 = 0;
  8674.                 }
  8675.                 if(i3 == 2)
  8676.                     player.anInt1530 = 0;
  8677.             } else
  8678.             if(l == -1 || player.anim == -1 || Animation.anims[l].anInt359 >= Animation.anims[player.anim].anInt359)
  8679.             {
  8680.                 player.anim = l;
  8681.                 player.anInt1527 = 0;
  8682.                 player.anInt1528 = 0;
  8683.                 player.anInt1529 = i2;
  8684.                 player.anInt1530 = 0;
  8685.                 player.anInt1542 = player.smallXYIndex;
  8686.             }
  8687.         }
  8688.         if((i & 4) != 0)
  8689.         {
  8690.             player.textSpoken = stream.readString();
  8691.             if(player.textSpoken.charAt(0) == '~')
  8692.             {
  8693.                 player.textSpoken = player.textSpoken.substring(1);
  8694.                 pushMessage(player.textSpoken, 2, player.name);
  8695.             } else
  8696.             if(player == myPlayer)
  8697.                 pushMessage(player.textSpoken, 2, player.name);
  8698.             player.anInt1513 = 0;
  8699.             player.anInt1531 = 0;
  8700.             player.textCycle = 150;
  8701.         }
  8702.         if((i & 0x80) != 0)
  8703.         {
  8704.             //right fucking here
  8705.             int i1 = stream.method434();
  8706.             int j2 = stream.readUnsignedByte();
  8707.             int j3 = stream.method427();
  8708.             int k3 = stream.currentOffset;
  8709.             if(player.name != null && player.visible)
  8710.             {
  8711.                 long l3 = TextClass.longForName(player.name);
  8712.                 boolean flag = false;
  8713.                 if(j2 <= 1)
  8714.                 {
  8715.                     for(int i4 = 0; i4 < ignoreCount; i4++)
  8716.                     {
  8717.                         if(ignoreListAsLongs[i4] != l3)
  8718.                             continue;
  8719.                         flag = true;
  8720.                         break;
  8721.                     }
  8722.  
  8723.                 }
  8724.                 if(!flag && anInt1251 == 0)
  8725.                     try
  8726.                     {
  8727.                         aStream_834.currentOffset = 0;
  8728.                         stream.method442(j3, 0, aStream_834.buffer);
  8729.                         aStream_834.currentOffset = 0;
  8730.                         String s = TextInput.method525(j3, aStream_834);
  8731.                         //s = Censor.doCensor(s);
  8732.                         player.textSpoken = s;
  8733.                         player.anInt1513 = i1 >> 8;
  8734.                         player.privelage = j2;
  8735.                         player.anInt1531 = i1 & 0xff;
  8736.                         player.textCycle = 150;
  8737.                         if(j2 == 2 || j2 == 3)
  8738.                             pushMessage(s, 1, "@cr2@" + player.name);
  8739.                         else if(j2 == 1)
  8740.                             pushMessage(s, 1, "@cr1@" + player.name);
  8741.                         else
  8742.                             pushMessage(s, 2, player.name);
  8743.                     }
  8744.                     catch(Exception exception)
  8745.                     {
  8746.                         signlink.reporterror("cde2");
  8747.                     }
  8748.             }
  8749.             stream.currentOffset = k3 + j3;
  8750.         }
  8751.         if((i & 1) != 0)
  8752.         {
  8753.             player.interactingEntity = stream.method434();
  8754.             if(player.interactingEntity == 65535)
  8755.                 player.interactingEntity = -1;
  8756.         }
  8757.         if((i & 0x10) != 0)
  8758.         {
  8759.             int j1 = stream.method427();
  8760.             byte abyte0[] = new byte[j1];
  8761.             Stream stream_1 = new Stream(abyte0);
  8762.             stream.readBytes(j1, 0, abyte0);
  8763.             aStreamArray895s[j] = stream_1;
  8764.             player.updatePlayer(stream_1);
  8765.         }
  8766.         if((i & 2) != 0)
  8767.         {
  8768.             player.anInt1538 = stream.method436();
  8769.             player.anInt1539 = stream.method434();
  8770.         }
  8771.         if((i & 0x20) != 0)
  8772.         {
  8773.             int k1 = stream.readUnsignedByte();
  8774.             int k2 = stream.method426();
  8775.             player.updateHitData(k2, k1, loopCycle);
  8776.             player.loopCycleStatus = loopCycle + 300;
  8777.             player.currentHealth = stream.method427();
  8778.             player.maxHealth = stream.readUnsignedByte();
  8779.         }
  8780.         if((i & 0x200) != 0)
  8781.         {
  8782.             int l1 = stream.readUnsignedByte();
  8783.             int l2 = stream.method428();
  8784.             player.updateHitData(l2, l1, loopCycle);
  8785.             player.loopCycleStatus = loopCycle + 300;
  8786.             player.currentHealth = stream.readUnsignedByte();
  8787.             player.maxHealth = stream.method427();
  8788.         }
  8789.     }
  8790.  
  8791.     private void method108()
  8792.     {
  8793.         try
  8794.         {
  8795.             int j = myPlayer.x + anInt1278;
  8796.             int k = myPlayer.y + anInt1131;
  8797.             if(anInt1014 - j < -500 || anInt1014 - j > 500 || anInt1015 - k < -500 || anInt1015 - k > 500)
  8798.             {
  8799.                 anInt1014 = j;
  8800.                 anInt1015 = k;
  8801.             }
  8802.             if(anInt1014 != j)
  8803.                 anInt1014 += (j - anInt1014) / 16;
  8804.             if(anInt1015 != k)
  8805.                 anInt1015 += (k - anInt1015) / 16;
  8806.             if(super.keyArray[1] == 1)
  8807.                 anInt1186 += (-24 - anInt1186) / 2;
  8808.             else
  8809.             if(super.keyArray[2] == 1)
  8810.                 anInt1186 += (24 - anInt1186) / 2;
  8811.             else
  8812.                 anInt1186 /= 2;
  8813.             if(super.keyArray[3] == 1)
  8814.                 anInt1187 += (12 - anInt1187) / 2;
  8815.             else
  8816.             if(super.keyArray[4] == 1)
  8817.                 anInt1187 += (-12 - anInt1187) / 2;
  8818.             else
  8819.                 anInt1187 /= 2;
  8820.               minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff;
  8821.               anInt1184 += anInt1187 / 2;
  8822.             if(anInt1184 < 128)
  8823.                 anInt1184 = 128;
  8824.             if(anInt1184 > 383)
  8825.                 anInt1184 = 383;
  8826.             int l = anInt1014 >> 7;
  8827.             int i1 = anInt1015 >> 7;
  8828.             int j1 = method42(plane, anInt1015, anInt1014);
  8829.             int k1 = 0;
  8830.             if(l > 3 && i1 > 3 && l < 100 && i1 < 100)
  8831.             {
  8832.                 for(int l1 = l - 4; l1 <= l + 4; l1++)
  8833.                 {
  8834.                     for(int k2 = i1 - 4; k2 <= i1 + 4; k2++)
  8835.                     {
  8836.                         int l2 = plane;
  8837.                         if(l2 < 3 && (byteGroundArray[1][l1][k2] & 2) == 2)
  8838.                             l2++;
  8839.                         int i3 = j1 - intGroundArray[l2][l1][k2];
  8840.                         if(i3 > k1)
  8841.                             k1 = i3;
  8842.                     }
  8843.  
  8844.                 }
  8845.  
  8846.             }
  8847.             anInt1005++;
  8848.             if(anInt1005 > 1512)
  8849.             {
  8850.                 anInt1005 = 0;
  8851.                 stream.createFrame(77);
  8852.                 stream.writeWordBigEndian(0);
  8853.                 int i2 = stream.currentOffset;
  8854.                 stream.writeWordBigEndian((int)(Math.random() * 256D));
  8855.                 stream.writeWordBigEndian(101);
  8856.                 stream.writeWordBigEndian(233);
  8857.                 stream.writeWord(45092);
  8858.                 if((int)(Math.random() * 2D) == 0)
  8859.                     stream.writeWord(35784);
  8860.                 stream.writeWordBigEndian((int)(Math.random() * 256D));
  8861.                 stream.writeWordBigEndian(64);
  8862.                 stream.writeWordBigEndian(38);
  8863.                 stream.writeWord((int)(Math.random() * 65536D));
  8864.                 stream.writeWord((int)(Math.random() * 65536D));
  8865.                 stream.writeBytes(stream.currentOffset - i2);
  8866.             }
  8867.             int j2 = k1 * 192;
  8868.             if(j2 > 0x17f00)
  8869.                 j2 = 0x17f00;
  8870.             if(j2 < 32768)
  8871.                 j2 = 32768;
  8872.             if(j2 > anInt984)
  8873.             {
  8874.                 anInt984 += (j2 - anInt984) / 24;
  8875.                 return;
  8876.             }
  8877.             if(j2 < anInt984)
  8878.             {
  8879.                 anInt984 += (j2 - anInt984) / 80;
  8880.             }
  8881.         }
  8882.         catch(Exception _ex)
  8883.         {
  8884.             signlink.reporterror("glfc_ex " + myPlayer.x + "," + myPlayer.y + "," + anInt1014 + "," + anInt1015 + "," + anInt1069 + "," + anInt1070 + "," + baseX + "," + baseY);
  8885.             throw new RuntimeException("eek");
  8886.         }
  8887.     }
  8888.  
  8889.     public void processDrawing()
  8890.     {
  8891.         if(rsAlreadyLoaded || loadingError || genericLoadingError)
  8892.         {
  8893.             showErrorScreen();
  8894.             return;
  8895.         }
  8896.         anInt1061++;
  8897.         if(!loggedIn)
  8898.             drawLoginScreen(false);
  8899.         else
  8900.             drawGameScreen();
  8901.         anInt1213 = 0;
  8902.     }
  8903.  
  8904.     private boolean isFriendOrSelf(String s)
  8905.     {
  8906.         if(s == null)
  8907.             return false;
  8908.         for(int i = 0; i < friendsCount; i++)
  8909.             if(s.equalsIgnoreCase(friendsList[i]))
  8910.                 return true;
  8911.         return s.equalsIgnoreCase(myPlayer.name);
  8912.     }
  8913.  
  8914.     private static String combatDiffColor(int i, int j)
  8915.     {
  8916.         int k = i - j;
  8917.         if(k < -9)
  8918.             return "@red@";
  8919.         if(k < -6)
  8920.             return "@or3@";
  8921.         if(k < -3)
  8922.             return "@or2@";
  8923.         if(k < 0)
  8924.             return "@or1@";
  8925.         if(k > 9)
  8926.             return "@gre@";
  8927.         if(k > 6)
  8928.             return "@gr3@";
  8929.         if(k > 3)
  8930.             return "@gr2@";
  8931.         if(k > 0)
  8932.             return "@gr1@";
  8933.         else
  8934.             return "@yel@";
  8935.     }
  8936.  
  8937.     private void setWaveVolume(int i)
  8938.     {
  8939.         signlink.wavevol = i;
  8940.     }
  8941.  
  8942.     private void draw3dScreen()
  8943.     {
  8944.         drawSplitPrivateChat();
  8945.         if(crossType == 1)
  8946.         {
  8947.             crosses[crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8948.             anInt1142++;
  8949.             if(anInt1142 > 67)
  8950.             {
  8951.                 anInt1142 = 0;
  8952.                 stream.createFrame(78);
  8953.             }
  8954.         }
  8955.         if(crossType == 2)
  8956.             crosses[4 + crossIndex / 100].drawSprite(crossX - 8 - 4, crossY - 8 - 4);
  8957.         if(anInt1018 != -1)
  8958.         {
  8959.             method119(anInt945, anInt1018);
  8960.             drawInterface(0, 0, RSInterface.interfaceCache[anInt1018], 0);
  8961.         }
  8962.         if(openInterfaceID != -1)
  8963.         {
  8964.             method119(anInt945, openInterfaceID);
  8965.             drawInterface(0, 0, RSInterface.interfaceCache[openInterfaceID], 0);
  8966.         }
  8967.         method70();
  8968.         if(!menuOpen)
  8969.         {
  8970.             processRightClick();
  8971.             drawTooltip();
  8972.         } else
  8973.         if(menuScreenArea == 0)
  8974.             drawMenu();
  8975.         if(anInt1055 == 1)
  8976.             multiOverlay.drawSprite(472, 296);
  8977.         if(fpsOn)
  8978.         {
  8979.             char c = '\u01FB';
  8980.             int k = 20;
  8981.             int i1 = 0xffff00;
  8982.             if(super.fps < 15)
  8983.                 i1 = 0xff0000;
  8984.             aTextDrawingArea_1271.method380("Fps:" + super.fps, c, i1, k);
  8985.             k += 15;
  8986.             Runtime runtime = Runtime.getRuntime();
  8987.             int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  8988.             i1 = 0xffff00;
  8989.             if(j1 > 0x2000000 && lowMem)
  8990.                 i1 = 0xff0000;
  8991.             aTextDrawingArea_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
  8992.             k += 15;
  8993.         }
  8994.         int i1 = 0xffff00;
  8995.         int x = baseX + (myPlayer.x - 6 >> 7);
  8996.         int y = baseY + (myPlayer.y - 6 >> 7);
  8997.         if (clientData)
  8998.         {
  8999.             char c = '\u01FB';
  9000.             int k = 20;
  9001.             if(super.fps < 15)
  9002.             i1 = 0xff0000;
  9003.             aTextDrawingArea_1271.method385(0xffff00, "Fps: " + super.fps, 285, 5);
  9004.             Runtime runtime = Runtime.getRuntime();
  9005.             int j1 = (int)((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
  9006.             i1 = 0xffff00;
  9007.             if(j1 > 0x2000000 && lowMem)
  9008.             i1 = 0xff0000;
  9009.             k += 15;
  9010.             aTextDrawingArea_1271.method385(0xffff00, "Mem: " + j1 + "k", 299, 5);
  9011.             aTextDrawingArea_1271.method385(0xffff00, "Mouse X: " + super.mouseX + " , Mouse Y: " + super.mouseY, 314, 5);
  9012.             aTextDrawingArea_1271.method385(0xffff00, "Coords: " + x + ", " + y, 329, 5);
  9013.         }
  9014.         if(anInt1104 != 0)
  9015.         {
  9016.             int j = anInt1104 / 50;
  9017.             int l = j / 60;
  9018.             j %= 60;
  9019.             if(j < 10)
  9020.                 aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
  9021.             else
  9022.                 aTextDrawingArea_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
  9023.             anInt849++;
  9024.             if(anInt849 > 75)
  9025.             {
  9026.                 anInt849 = 0;
  9027.                 stream.createFrame(148);
  9028.             }
  9029.         }
  9030.     }
  9031.  
  9032.     private void addIgnore(long l)
  9033.     {
  9034.         try
  9035.         {
  9036.             if(l == 0L)
  9037.                 return;
  9038.             if(ignoreCount >= 100)
  9039.             {
  9040.                 pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
  9041.                 return;
  9042.             }
  9043.             String s = TextClass.fixName(TextClass.nameForLong(l));
  9044.             for(int j = 0; j < ignoreCount; j++)
  9045.                 if(ignoreListAsLongs[j] == l)
  9046.                 {
  9047.                     pushMessage(s + " is already on your ignore list", 0, "");
  9048.                     return;
  9049.                 }
  9050.             for(int k = 0; k < friendsCount; k++)
  9051.                 if(friendsListAsLongs[k] == l)
  9052.                 {
  9053.                     pushMessage("Please remove " + s + " from your friend list first", 0, "");
  9054.                     return;
  9055.                 }
  9056.  
  9057.             ignoreListAsLongs[ignoreCount++] = l;
  9058.             needDrawTabArea = true;
  9059.             stream.createFrame(133);
  9060.             stream.writeQWord(l);
  9061.             return;
  9062.         }
  9063.         catch(RuntimeException runtimeexception)
  9064.         {
  9065.             signlink.reporterror("45688, " + l + ", " + 4 + ", " + runtimeexception.toString());
  9066.         }
  9067.         throw new RuntimeException();
  9068.     }
  9069.  
  9070.     private void method114()
  9071.     {
  9072.         for(int i = -1; i < playerCount; i++)
  9073.         {
  9074.             int j;
  9075.             if(i == -1)
  9076.                 j = myPlayerIndex;
  9077.             else
  9078.                 j = playerIndices[i];
  9079.             Player player = playerArray[j];
  9080.             if(player != null)
  9081.                 method96(player);
  9082.         }
  9083.  
  9084.     }
  9085.  
  9086.     private void method115()
  9087.     {
  9088.         if(loadingStage == 2)
  9089.         {
  9090.             for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9091.             {
  9092.                 if(class30_sub1.anInt1294 > 0)
  9093.                     class30_sub1.anInt1294--;
  9094.                 if(class30_sub1.anInt1294 == 0)
  9095.                 {
  9096.                     if(class30_sub1.anInt1299 < 0 || ObjectManager.method178(class30_sub1.anInt1299, class30_sub1.anInt1301))
  9097.                     {
  9098.                         method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1300, class30_sub1.anInt1301, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1299);
  9099.                         class30_sub1.unlink();
  9100.                     }
  9101.                 } else
  9102.                 {
  9103.                     if(class30_sub1.anInt1302 > 0)
  9104.                         class30_sub1.anInt1302--;
  9105.                     if(class30_sub1.anInt1302 == 0 && class30_sub1.anInt1297 >= 1 && class30_sub1.anInt1298 >= 1 && class30_sub1.anInt1297 <= 102 && class30_sub1.anInt1298 <= 102 && (class30_sub1.anInt1291 < 0 || ObjectManager.method178(class30_sub1.anInt1291, class30_sub1.anInt1293)))
  9106.                     {
  9107.                         method142(class30_sub1.anInt1298, class30_sub1.anInt1295, class30_sub1.anInt1292, class30_sub1.anInt1293, class30_sub1.anInt1297, class30_sub1.anInt1296, class30_sub1.anInt1291);
  9108.                         class30_sub1.anInt1302 = -1;
  9109.                         if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1299 == -1)
  9110.                             class30_sub1.unlink();
  9111.                         else
  9112.                         if(class30_sub1.anInt1291 == class30_sub1.anInt1299 && class30_sub1.anInt1292 == class30_sub1.anInt1300 && class30_sub1.anInt1293 == class30_sub1.anInt1301)
  9113.                             class30_sub1.unlink();
  9114.                     }
  9115.                 }
  9116.             }
  9117.  
  9118.         }
  9119.     }
  9120.    
  9121.    
  9122.     //stops the click from going over sprite
  9123.     private void determineMenuSize()
  9124.     {
  9125.         int i = chatTextDrawingArea.getTextWidth("Choose Option");
  9126.         for(int j = 0; j < menuActionRow; j++)
  9127.         {
  9128.             int k = chatTextDrawingArea.getTextWidth(menuActionName[j]);
  9129.             if(k > i)
  9130.                 i = k;
  9131.         }
  9132.  
  9133.         i += 8;
  9134.         int l = 15 * menuActionRow + 21;
  9135.         if(super.saveClickX > 4 && super.saveClickY > 4 && super.saveClickX < 516 && super.saveClickY < 338)
  9136.         {
  9137.             int i1 = super.saveClickX - 4 - i / 2;
  9138.             if(i1 + i > 512)
  9139.                 i1 = 512 - i;
  9140.             if(i1 < 0)
  9141.                 i1 = 0;
  9142.             int l1 = super.saveClickY - 4;
  9143.             if(l1 + l > 334)
  9144.                 l1 = 334 - l;
  9145.             if(l1 < 0)
  9146.                 l1 = 0;
  9147.             menuOpen = true;
  9148.             menuScreenArea = 0;
  9149.             menuOffsetX = i1;
  9150.             menuOffsetY = l1;
  9151.             menuWidth = i;
  9152.             menuHeight = 15 * menuActionRow + 22;
  9153.         }
  9154.         if(super.saveClickX > 519 && super.saveClickY > 168 && super.saveClickX < 765 && super.saveClickY < 503)
  9155.         {
  9156.             int j1 = super.saveClickX - 519 - i / 2;
  9157.             if(j1 < 0)
  9158.                 j1 = 0;
  9159.             else
  9160.             if(j1 + i > 245)
  9161.                 j1 = 245 - i;
  9162.             int i2 = super.saveClickY - 168;
  9163.             if(i2 < 0)
  9164.                 i2 = 0;
  9165.             else
  9166.             if(i2 + l > 333)
  9167.                 i2 = 333 - l;
  9168.             menuOpen = true;
  9169.             menuScreenArea = 1;
  9170.             menuOffsetX = j1;
  9171.             menuOffsetY = i2;
  9172.             menuWidth = i;
  9173.             menuHeight = 15 * menuActionRow + 22;
  9174.         }
  9175.         if(super.saveClickX > 0 && super.saveClickY > 338 && super.saveClickX < 516 && super.saveClickY < 503)
  9176.         {
  9177.             int k1 = super.saveClickX - 0 - i / 2;
  9178.             if(k1 < 0)
  9179.                 k1 = 0;
  9180.             else
  9181.             if(k1 + i > 516)
  9182.                 k1 = 516 - i;
  9183.             int j2 = super.saveClickY - 338;
  9184.             if(j2 < 0)
  9185.                 j2 = 0;
  9186.             else
  9187.             if(j2 + l > 165)
  9188.                 j2 = 165 - l;
  9189.             menuOpen = true;
  9190.             menuScreenArea = 2;
  9191.             menuOffsetX = k1;
  9192.             menuOffsetY = j2;
  9193.             menuWidth = i;
  9194.             menuHeight = 15 * menuActionRow + 22;
  9195.         }
  9196.     }
  9197.  
  9198.     private void method117(Stream stream)
  9199.     {
  9200.         stream.initBitAccess();
  9201.         int j = stream.readBits(1);
  9202.         if(j == 0)
  9203.             return;
  9204.         int k = stream.readBits(2);
  9205.         if(k == 0)
  9206.         {
  9207.             anIntArray894[anInt893++] = myPlayerIndex;
  9208.             return;
  9209.         }
  9210.         if(k == 1)
  9211.         {
  9212.             int l = stream.readBits(3);
  9213.             myPlayer.moveInDir(false, l);
  9214.             int k1 = stream.readBits(1);
  9215.             if(k1 == 1)
  9216.                 anIntArray894[anInt893++] = myPlayerIndex;
  9217.             return;
  9218.         }
  9219.         if(k == 2)
  9220.         {
  9221.             int i1 = stream.readBits(3);
  9222.             myPlayer.moveInDir(true, i1);
  9223.             int l1 = stream.readBits(3);
  9224.             myPlayer.moveInDir(true, l1);
  9225.             int j2 = stream.readBits(1);
  9226.             if(j2 == 1)
  9227.                 anIntArray894[anInt893++] = myPlayerIndex;
  9228.             return;
  9229.         }
  9230.         if(k == 3)
  9231.         {
  9232.             plane = stream.readBits(2);
  9233.             int j1 = stream.readBits(1);
  9234.             int i2 = stream.readBits(1);
  9235.             if(i2 == 1)
  9236.                 anIntArray894[anInt893++] = myPlayerIndex;
  9237.             int k2 = stream.readBits(7);
  9238.             int l2 = stream.readBits(7);
  9239.             myPlayer.setPos(l2, k2, j1 == 1);
  9240.         }
  9241.     }
  9242.  
  9243.     private void nullLoader()
  9244.     {
  9245.         aBoolean831 = false;
  9246.         while(drawingFlames)
  9247.         {
  9248.             aBoolean831 = false;
  9249.             try
  9250.             {
  9251.                 Thread.sleep(50L);
  9252.             }
  9253.             catch(Exception _ex) { }
  9254.         }
  9255.         aBackground_966 = null;
  9256.         aBackground_967 = null;
  9257.         aBackgroundArray1152s = null;
  9258.         anIntArray850 = null;
  9259.         anIntArray851 = null;
  9260.         anIntArray852 = null;
  9261.         anIntArray853 = null;
  9262.         anIntArray1190 = null;
  9263.         anIntArray1191 = null;
  9264.         anIntArray828 = null;
  9265.         anIntArray829 = null;
  9266.         aClass30_Sub2_Sub1_Sub1_1201 = null;
  9267.         aClass30_Sub2_Sub1_Sub1_1202 = null;
  9268.     }
  9269.  
  9270.     private boolean method119(int i, int j)
  9271.     {
  9272.         boolean flag1 = false;
  9273.         RSInterface class9 = RSInterface.interfaceCache[j];
  9274.         for(int k = 0; k < class9.children.length; k++)
  9275.         {
  9276.             if(class9.children[k] == -1)
  9277.                 break;
  9278.             RSInterface class9_1 = RSInterface.interfaceCache[class9.children[k]];
  9279.             if(class9_1.type == 1)
  9280.                 flag1 |= method119(i, class9_1.id);
  9281.             if(class9_1.type == 6 && (class9_1.anInt257 != -1 || class9_1.anInt258 != -1))
  9282.             {
  9283.                 boolean flag2 = interfaceIsSelected(class9_1);
  9284.                 int l;
  9285.                 if(flag2)
  9286.                     l = class9_1.anInt258;
  9287.                 else
  9288.                     l = class9_1.anInt257;
  9289.                 if(l != -1)
  9290.                 {
  9291.                     Animation animation = Animation.anims[l];
  9292.                     for(class9_1.anInt208 += i; class9_1.anInt208 > animation.method258(class9_1.anInt246);)
  9293.                     {
  9294.                         class9_1.anInt208 -= animation.method258(class9_1.anInt246) + 1;
  9295.                         class9_1.anInt246++;
  9296.                         if(class9_1.anInt246 >= animation.anInt352)
  9297.                         {
  9298.                             class9_1.anInt246 -= animation.anInt356;
  9299.                             if(class9_1.anInt246 < 0 || class9_1.anInt246 >= animation.anInt352)
  9300.                                 class9_1.anInt246 = 0;
  9301.                         }
  9302.                         flag1 = true;
  9303.                     }
  9304.  
  9305.                 }
  9306.             }
  9307.         }
  9308.  
  9309.         return flag1;
  9310.     }
  9311.  
  9312.     private int method120()
  9313.     {
  9314.         int j = 3;
  9315.         if(yCameraCurve < 310)
  9316.         {
  9317.             int k = xCameraPos >> 7;
  9318.             int l = yCameraPos >> 7;
  9319.             int i1 = myPlayer.x >> 7;
  9320.             int j1 = myPlayer.y >> 7;
  9321.             if((byteGroundArray[plane][k][l] & 4) != 0)
  9322.                 j = plane;
  9323.             int k1;
  9324.             if(i1 > k)
  9325.                 k1 = i1 - k;
  9326.             else
  9327.                 k1 = k - i1;
  9328.             int l1;
  9329.             if(j1 > l)
  9330.                 l1 = j1 - l;
  9331.             else
  9332.                 l1 = l - j1;
  9333.             if(k1 > l1)
  9334.             {
  9335.                 int i2 = (l1 * 0x10000) / k1;
  9336.                 int k2 = 32768;
  9337.                 while(k != i1)
  9338.                 {
  9339.                     if(k < i1)
  9340.                         k++;
  9341.                     else
  9342.                     if(k > i1)
  9343.                         k--;
  9344.                     if((byteGroundArray[plane][k][l] & 4) != 0)
  9345.                         j = plane;
  9346.                     k2 += i2;
  9347.                     if(k2 >= 0x10000)
  9348.                     {
  9349.                         k2 -= 0x10000;
  9350.                         if(l < j1)
  9351.                             l++;
  9352.                         else
  9353.                         if(l > j1)
  9354.                             l--;
  9355.                         if((byteGroundArray[plane][k][l] & 4) != 0)
  9356.                             j = plane;
  9357.                     }
  9358.                 }
  9359.             } else
  9360.             {
  9361.                 int j2 = (k1 * 0x10000) / l1;
  9362.                 int l2 = 32768;
  9363.                 while(l != j1)
  9364.                 {
  9365.                     if(l < j1)
  9366.                         l++;
  9367.                     else
  9368.                     if(l > j1)
  9369.                         l--;
  9370.                     if((byteGroundArray[plane][k][l] & 4) != 0)
  9371.                         j = plane;
  9372.                     l2 += j2;
  9373.                     if(l2 >= 0x10000)
  9374.                     {
  9375.                         l2 -= 0x10000;
  9376.                         if(k < i1)
  9377.                             k++;
  9378.                         else
  9379.                         if(k > i1)
  9380.                             k--;
  9381.                         if((byteGroundArray[plane][k][l] & 4) != 0)
  9382.                             j = plane;
  9383.                     }
  9384.                 }
  9385.             }
  9386.         }
  9387.         if((byteGroundArray[plane][myPlayer.x >> 7][myPlayer.y >> 7] & 4) != 0)
  9388.             j = plane;
  9389.         return j;
  9390.     }
  9391.  
  9392.     private int method121()
  9393.     {
  9394.         int j = method42(plane, yCameraPos, xCameraPos);
  9395.         if(j - zCameraPos < 800 && (byteGroundArray[plane][xCameraPos >> 7][yCameraPos >> 7] & 4) != 0)
  9396.             return plane;
  9397.         else
  9398.             return 3;
  9399.     }
  9400.  
  9401.     private void delIgnore(long l)
  9402.     {
  9403.         try
  9404.         {
  9405.             if(l == 0L)
  9406.                 return;
  9407.             for(int j = 0; j < ignoreCount; j++)
  9408.                 if(ignoreListAsLongs[j] == l)
  9409.                 {
  9410.                     ignoreCount--;
  9411.                     needDrawTabArea = true;
  9412.                     System.arraycopy(ignoreListAsLongs, j + 1, ignoreListAsLongs, j, ignoreCount - j);
  9413.  
  9414.                     stream.createFrame(74);
  9415.                     stream.writeQWord(l);
  9416.                     return;
  9417.                 }
  9418.  
  9419.             return;
  9420.         }
  9421.         catch(RuntimeException runtimeexception)
  9422.         {
  9423.             signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9424.         }
  9425.         throw new RuntimeException();
  9426.     }
  9427.    
  9428.    
  9429.     private void chatJoin(long l) {
  9430.         try {
  9431.             if(l == 0L)
  9432.                 return;
  9433.             stream.createFrame(60);
  9434.             stream.writeQWord(l);
  9435.             return;
  9436.         }
  9437.         catch(RuntimeException runtimeexception)
  9438.         {
  9439.             signlink.reporterror("47229, " + 3 + ", " + l + ", " + runtimeexception.toString());
  9440.         }
  9441.         throw new RuntimeException();
  9442.    
  9443.     }
  9444.    
  9445.     public String getParameter(String s)
  9446.     {
  9447.         if(signlink.mainapp != null)
  9448.             return signlink.mainapp.getParameter(s);
  9449.         else
  9450.             return super.getParameter(s);
  9451.     }
  9452.  
  9453.     private void adjustVolume(boolean flag, int i)
  9454.     {
  9455.         signlink.midivol = i;
  9456.         if(flag)
  9457.             signlink.midi = "voladjust";
  9458.     }
  9459.  
  9460.     private int extractInterfaceValues(RSInterface class9, int j)
  9461.     {
  9462.         if(class9.valueIndexArray == null || j >= class9.valueIndexArray.length)
  9463.             return -2;
  9464.         try
  9465.         {
  9466.             int ai[] = class9.valueIndexArray[j];
  9467.             int k = 0;
  9468.             int l = 0;
  9469.             int i1 = 0;
  9470.             do
  9471.             {
  9472.                 int j1 = ai[l++];
  9473.                 int k1 = 0;
  9474.                 byte byte0 = 0;
  9475.                 if(j1 == 0)
  9476.                     return k;
  9477.                 if(j1 == 1)
  9478.                     k1 = currentStats[ai[l++]];
  9479.                 if(j1 == 2)
  9480.                     k1 = maxStats[ai[l++]];
  9481.                 if(j1 == 3)
  9482.                     k1 = currentExp[ai[l++]];
  9483.                 if(j1 == 4)
  9484.                 {
  9485.                     RSInterface class9_1 = RSInterface.interfaceCache[ai[l++]];
  9486.                     int k2 = ai[l++];
  9487.                     if(k2 >= 0 && k2 < ItemDef.totalItems && (!ItemDef.forID(k2).membersObject || isMembers))
  9488.                     {
  9489.                         for(int j3 = 0; j3 < class9_1.inv.length; j3++)
  9490.                             if(class9_1.inv[j3] == k2 + 1)
  9491.                                 k1 += class9_1.invStackSizes[j3];
  9492.  
  9493.                     }
  9494.                 }
  9495.                 if(j1 == 5)
  9496.                     k1 = variousSettings[ai[l++]];
  9497.                 if(j1 == 6)
  9498.                     k1 = anIntArray1019[maxStats[ai[l++]] - 1];
  9499.                 if(j1 == 7)
  9500.                     k1 = (variousSettings[ai[l++]] * 100) / 46875;
  9501.                 if(j1 == 8)
  9502.                     k1 = myPlayer.combatLevel;
  9503.                 if(j1 == 9)
  9504.                 {
  9505.                     for(int l1 = 0; l1 < Skills.skillsCount; l1++)
  9506.                         if(Skills.skillEnabled[l1])
  9507.                             k1 += maxStats[l1];
  9508.  
  9509.                 }
  9510.                 if(j1 == 10)
  9511.                 {
  9512.                     RSInterface class9_2 = RSInterface.interfaceCache[ai[l++]];
  9513.                     int l2 = ai[l++] + 1;
  9514.                     if(l2 >= 0 && l2 < ItemDef.totalItems && (!ItemDef.forID(l2).membersObject || isMembers))
  9515.                     {
  9516.                         for(int k3 = 0; k3 < class9_2.inv.length; k3++)
  9517.                         {
  9518.                             if(class9_2.inv[k3] != l2)
  9519.                                 continue;
  9520.                             k1 = 0x3b9ac9ff;
  9521.                             break;
  9522.                         }
  9523.  
  9524.                     }
  9525.                 }
  9526.                 if(j1 == 11)
  9527.                     k1 = energy;
  9528.                 if(j1 == 12)
  9529.                     k1 = weight;
  9530.                 if(j1 == 13)
  9531.                 {
  9532.                     int i2 = variousSettings[ai[l++]];
  9533.                     int i3 = ai[l++];
  9534.                     k1 = (i2 & 1 << i3) == 0 ? 0 : 1;
  9535.                 }
  9536.                 if(j1 == 14)
  9537.                 {
  9538.                     int j2 = ai[l++];
  9539.                     VarBit varBit = VarBit.cache[j2];
  9540.                     int l3 = varBit.anInt648;
  9541.                     int i4 = varBit.anInt649;
  9542.                     int j4 = varBit.anInt650;
  9543.                     int k4 = anIntArray1232[j4 - i4];
  9544.                     k1 = variousSettings[l3] >> i4 & k4;
  9545.                 }
  9546.                 if(j1 == 15)
  9547.                     byte0 = 1;
  9548.                 if(j1 == 16)
  9549.                     byte0 = 2;
  9550.                 if(j1 == 17)
  9551.                     byte0 = 3;
  9552.                 if(j1 == 18)
  9553.                     k1 = (myPlayer.x >> 7) + baseX;
  9554.                 if(j1 == 19)
  9555.                     k1 = (myPlayer.y >> 7) + baseY;
  9556.                 if(j1 == 20)
  9557.                     k1 = ai[l++];
  9558.                 if(byte0 == 0)
  9559.                 {
  9560.                     if(i1 == 0)
  9561.                         k += k1;
  9562.                     if(i1 == 1)
  9563.                         k -= k1;
  9564.                     if(i1 == 2 && k1 != 0)
  9565.                         k /= k1;
  9566.                     if(i1 == 3)
  9567.                         k *= k1;
  9568.                     i1 = 0;
  9569.                 } else
  9570.                 {
  9571.                     i1 = byte0;
  9572.                 }
  9573.             } while(true);
  9574.         }
  9575.         catch(Exception _ex)
  9576.         {
  9577.             return -1;
  9578.         }
  9579.     }
  9580.  
  9581.     private void drawTooltip() {
  9582.         if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
  9583.             return;
  9584.         String s;
  9585.         if(itemSelected == 1 && menuActionRow < 2)
  9586.             s = "Use " + selectedItemName + " with...";
  9587.         else if(spellSelected == 1 && menuActionRow < 2)
  9588.             s = spellTooltip + "...";
  9589.         else
  9590.             s = menuActionName[menuActionRow - 1];
  9591.         if(menuActionRow > 2)
  9592.             s = s + "@whi@ / " + (menuActionRow - 2) + " more options";
  9593.         chatTextDrawingArea.method390(4, 0xffffff, s, loopCycle / 1000, 15);
  9594.     }
  9595.  
  9596.     private void drawMinimap() {
  9597.         aRSImageProducer_1164.initDrawingArea();
  9598.         if(anInt1021 == 2) {
  9599.             byte abyte0[] = mapBack.aByteArray1450;
  9600.             int ai[] = DrawingArea.pixels;
  9601.             int k2 = abyte0.length;
  9602.             for(int i5 = 0; i5 < k2; i5++)
  9603.                 if(abyte0[i5] == 0)
  9604.                     ai[i5] = 0;
  9605.             compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9606.             aRSImageProducer_1165.initDrawingArea();
  9607.             return;
  9608.         }
  9609.         int i = minimapInt1 + minimapInt2 & 0x7ff;
  9610.         int j = 48 + myPlayer.x / 32;
  9611.         int l2 = 464 - myPlayer.y / 32;
  9612.         aClass30_Sub2_Sub1_Sub1_1263.method352(151, i, anIntArray1229, 256 + minimapInt3, anIntArray1052, l2, 5, 25, 146, j);
  9613.         compass.method352(33, minimapInt1, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
  9614.         for(int j5 = 0; j5 < anInt1071; j5++) {
  9615.             int k = (anIntArray1072[j5] * 4 + 2) - myPlayer.x / 32;
  9616.             int i3 = (anIntArray1073[j5] * 4 + 2) - myPlayer.y / 32;
  9617.             markMinimap(aClass30_Sub2_Sub1_Sub1Array1140[j5], k, i3);
  9618.         }
  9619.         for(int k5 = 0; k5 < 104; k5++) {
  9620.             for(int l5 = 0; l5 < 104; l5++) {
  9621.                 NodeList class19 = groundArray[plane][k5][l5];
  9622.                 if(class19 != null) {
  9623.                     int l = (k5 * 4 + 2) - myPlayer.x / 32;
  9624.                     int j3 = (l5 * 4 + 2) - myPlayer.y / 32;
  9625.                     markMinimap(mapDotItem, l, j3);
  9626.                 }
  9627.             }
  9628.         }
  9629.         for(int i6 = 0; i6 < npcCount; i6++) {
  9630.             NPC npc = npcArray[npcIndices[i6]];
  9631.             if(npc != null && npc.isVisible()) {
  9632.                 EntityDef entityDef = npc.desc;
  9633.                 if(entityDef.childrenIDs != null)
  9634.                     entityDef = entityDef.method161();
  9635.                 if(entityDef != null && entityDef.aBoolean87 && entityDef.aBoolean84) {
  9636.                     int i1 = npc.x / 32 - myPlayer.x / 32;
  9637.                     int k3 = npc.y / 32 - myPlayer.y / 32;
  9638.                     markMinimap(mapDotNPC, i1, k3);
  9639.                 }
  9640.             }
  9641.         }
  9642.         for(int j6 = 0; j6 < playerCount; j6++) {
  9643.             Player player = playerArray[playerIndices[j6]];
  9644.             if(player != null && player.isVisible()) {
  9645.                 int j1 = player.x / 32 - myPlayer.x / 32;
  9646.                 int l3 = player.y / 32 - myPlayer.y / 32;
  9647.                 boolean flag1 = false;
  9648.                 boolean flag3 = false;
  9649.                 for (int j3 = 0; j3 < clanList.length; j3++) {
  9650.                     if (clanList[j3] == null)
  9651.                         continue;
  9652.                     if (!clanList[j3].equalsIgnoreCase(player.name))
  9653.                         continue;
  9654.                     flag3 = true;
  9655.                     break;
  9656.                 }
  9657.                 long l6 = TextClass.longForName(player.name);
  9658.                 for(int k6 = 0; k6 < friendsCount; k6++) {
  9659.                     if(l6 != friendsListAsLongs[k6] || friendsNodeIDs[k6] == 0)
  9660.                         continue;
  9661.                     flag1 = true;
  9662.                     break;
  9663.                 }
  9664.                 boolean flag2 = false;
  9665.                 if(myPlayer.team != 0 && player.team != 0 && myPlayer.team == player.team)
  9666.                     flag2 = true;
  9667.                 if(flag1)
  9668.                     markMinimap(mapDotFriend, j1, l3);
  9669.                 else if(flag3)
  9670.                     markMinimap(mapDotClan, j1, l3);
  9671.                 else if(flag2)
  9672.                     markMinimap(mapDotTeam, j1, l3);
  9673.                 else
  9674.                     markMinimap(mapDotPlayer, j1, l3);
  9675.             }
  9676.         }
  9677.         if(anInt855 != 0 && loopCycle % 20 < 10) {
  9678.             if(anInt855 == 1 && anInt1222 >= 0 && anInt1222 < npcArray.length) {
  9679.                 NPC class30_sub2_sub4_sub1_sub1_1 = npcArray[anInt1222];
  9680.                 if(class30_sub2_sub4_sub1_sub1_1 != null) {
  9681.                     int k1 = class30_sub2_sub4_sub1_sub1_1.x / 32 - myPlayer.x / 32;
  9682.                     int i4 = class30_sub2_sub4_sub1_sub1_1.y / 32 - myPlayer.y / 32;
  9683.                     method81(mapMarker, i4, k1);
  9684.                 }
  9685.             }
  9686.             if(anInt855 == 2) {
  9687.                 int l1 = ((anInt934 - baseX) * 4 + 2) - myPlayer.x / 32;
  9688.                 int j4 = ((anInt935 - baseY) * 4 + 2) - myPlayer.y / 32;
  9689.                 method81(mapMarker, j4, l1);
  9690.             }
  9691.             if(anInt855 == 10 && anInt933 >= 0 && anInt933 < playerArray.length) {
  9692.                 Player class30_sub2_sub4_sub1_sub2_1 = playerArray[anInt933];
  9693.                 if(class30_sub2_sub4_sub1_sub2_1 != null) {
  9694.                     int i2 = class30_sub2_sub4_sub1_sub2_1.x / 32 - myPlayer.x / 32;
  9695.                     int k4 = class30_sub2_sub4_sub1_sub2_1.y / 32 - myPlayer.y / 32;
  9696.                     method81(mapMarker, k4, i2);
  9697.                 }
  9698.             }
  9699.         }
  9700.         if(destX != 0) {
  9701.             int j2 = (destX * 4 + 2) - myPlayer.x / 32;
  9702.             int l4 = (destY * 4 + 2) - myPlayer.y / 32;
  9703.             markMinimap(mapFlag, j2, l4);
  9704.         }
  9705.         DrawingArea.drawPixels(3, 78, 97, 0xffffff, 3);
  9706.         mapBack.drawBackground(0, 0);
  9707.         aRSImageProducer_1165.initDrawingArea();
  9708.     }
  9709.  
  9710.     private void npcScreenPos(Entity entity, int i) {
  9711.         calcEntityScreenPos(entity.x, i, entity.y);
  9712.     }
  9713.  
  9714.     private void calcEntityScreenPos(int i, int j, int l) {
  9715.         if(i < 128 || l < 128 || i > 13056 || l > 13056) {
  9716.             spriteDrawX = -1;
  9717.             spriteDrawY = -1;
  9718.             return;
  9719.         }
  9720.         int i1 = method42(plane, l, i) - j;
  9721.         i -= xCameraPos;
  9722.         i1 -= zCameraPos;
  9723.         l -= yCameraPos;
  9724.         int j1 = Model.modelIntArray1[yCameraCurve];
  9725.         int k1 = Model.modelIntArray2[yCameraCurve];
  9726.         int l1 = Model.modelIntArray1[xCameraCurve];
  9727.         int i2 = Model.modelIntArray2[xCameraCurve];
  9728.         int j2 = l * l1 + i * i2 >> 16;
  9729.         l = l * i2 - i * l1 >> 16;
  9730.         i = j2;
  9731.         j2 = i1 * k1 - l * j1 >> 16;
  9732.         l = i1 * j1 + l * k1 >> 16;
  9733.         i1 = j2;
  9734.         if(l >= 50) {
  9735.             spriteDrawX = Texture.textureInt1 + (i << 9) / l;
  9736.             spriteDrawY = Texture.textureInt2 + (i1 << 9) / l;
  9737.         } else {
  9738.             spriteDrawX = -1;
  9739.             spriteDrawY = -1;
  9740.         }
  9741.     }
  9742.  
  9743.     private void buildSplitPrivateChatMenu()
  9744.     {
  9745.         if(splitPrivateChat == 0)
  9746.             return;
  9747.         int i = 0;
  9748.         if(anInt1104 != 0)
  9749.             i = 1;
  9750.         for(int j = 0; j < 100; j++)
  9751.             if(chatMessages[j] != null)
  9752.             {
  9753.                 int k = chatTypes[j];
  9754.                 String s = chatNames[j];
  9755.                 boolean flag1 = false;
  9756.                 if(s != null && s.startsWith("@cr1@"))
  9757.                 {
  9758.                     s = s.substring(5);
  9759.                     boolean flag2 = true;
  9760.                 }
  9761.                 if(s != null && s.startsWith("@cr2@"))
  9762.                 {
  9763.                     s = s.substring(5);
  9764.                     byte byte0 = 2;
  9765.                 }
  9766.                 if((k == 3 || k == 7) && (k == 7 || privateChatMode == 0 || privateChatMode == 1 && isFriendOrSelf(s)))
  9767.                 {
  9768.                     int l = 329 - i * 13;
  9769.                     if(super.mouseX > 4 && super.mouseY - 4 > l - 10 && super.mouseY - 4 <= l + 3)
  9770.                     {
  9771.                         int i1 = aTextDrawingArea_1271.getTextWidth("From:  " + s + chatMessages[j]) + 25;
  9772.                         if(i1 > 450)
  9773.                             i1 = 450;
  9774.                         if(super.mouseX < 4 + i1)
  9775.                         {
  9776.                             if(myPrivilege >= 1)
  9777.                             {
  9778.                                 menuActionName[menuActionRow] = "Report abuse @whi@" + s;
  9779.                                 menuActionID[menuActionRow] = 2606;
  9780.                                 menuActionRow++;
  9781.                             }
  9782.                             menuActionName[menuActionRow] = "Add ignore @whi@" + s;
  9783.                             menuActionID[menuActionRow] = 2042;
  9784.                             menuActionRow++;
  9785.                             menuActionName[menuActionRow] = "Add friend @whi@" + s;
  9786.                             menuActionID[menuActionRow] = 2337;
  9787.                             menuActionRow++;
  9788.                         }
  9789.                     }
  9790.                     if(++i >= 5)
  9791.                         return;
  9792.                 }
  9793.                 if((k == 5 || k == 6) && privateChatMode < 2 && ++i >= 5)
  9794.                     return;
  9795.             }
  9796.  
  9797.     }
  9798.  
  9799.     private void method130(int j, int k, int l, int i1, int j1, int k1,
  9800.                            int l1, int i2, int j2)
  9801.     {
  9802.         Class30_Sub1 class30_sub1 = null;
  9803.         for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  9804.         {
  9805.             if(class30_sub1_1.anInt1295 != l1 || class30_sub1_1.anInt1297 != i2 || class30_sub1_1.anInt1298 != j1 || class30_sub1_1.anInt1296 != i1)
  9806.                 continue;
  9807.             class30_sub1 = class30_sub1_1;
  9808.             break;
  9809.         }
  9810.  
  9811.         if(class30_sub1 == null)
  9812.         {
  9813.             class30_sub1 = new Class30_Sub1();
  9814.             class30_sub1.anInt1295 = l1;
  9815.             class30_sub1.anInt1296 = i1;
  9816.             class30_sub1.anInt1297 = i2;
  9817.             class30_sub1.anInt1298 = j1;
  9818.             method89(class30_sub1);
  9819.             aClass19_1179.insertHead(class30_sub1);
  9820.         }
  9821.         class30_sub1.anInt1291 = k;
  9822.         class30_sub1.anInt1293 = k1;
  9823.         class30_sub1.anInt1292 = l;
  9824.         class30_sub1.anInt1302 = j2;
  9825.         class30_sub1.anInt1294 = j;
  9826.     }
  9827.  
  9828.     private boolean interfaceIsSelected(RSInterface class9)
  9829.     {
  9830.         if(class9.anIntArray245 == null)
  9831.             return false;
  9832.         for(int i = 0; i < class9.anIntArray245.length; i++)
  9833.         {
  9834.             int j = extractInterfaceValues(class9, i);
  9835.             int k = class9.anIntArray212[i];
  9836.             if(class9.anIntArray245[i] == 2)
  9837.             {
  9838.                 if(j >= k)
  9839.                     return false;
  9840.             } else
  9841.             if(class9.anIntArray245[i] == 3)
  9842.             {
  9843.                 if(j <= k)
  9844.                     return false;
  9845.             } else
  9846.             if(class9.anIntArray245[i] == 4)
  9847.             {
  9848.                 if(j == k)
  9849.                     return false;
  9850.             } else
  9851.             if(j != k)
  9852.                 return false;
  9853.         }
  9854.  
  9855.         return true;
  9856.     }
  9857.  
  9858.     private DataInputStream openJagGrabInputStream(String s)
  9859.         throws IOException
  9860.     {
  9861.  //    if(!aBoolean872)
  9862.  //        if(signlink.mainapp != null)
  9863.  //            return signlink.openurl(s);
  9864.  //        else
  9865.  //            return new DataInputStream((new URL(getCodeBase(), s)).openStream());
  9866.         if(aSocket832 != null)
  9867.         {
  9868.             try
  9869.             {
  9870.                 aSocket832.close();
  9871.             }
  9872.             catch(Exception _ex) { }
  9873.             aSocket832 = null;
  9874.         }
  9875.         aSocket832 = openSocket(43595);
  9876.         aSocket832.setSoTimeout(10000);
  9877.         java.io.InputStream inputstream = aSocket832.getInputStream();
  9878.         OutputStream outputstream = aSocket832.getOutputStream();
  9879.         outputstream.write(("JAGGRAB /" + s + "\n\n").getBytes());
  9880.         return new DataInputStream(inputstream);
  9881.     }
  9882.  
  9883.     private void doFlamesDrawing()
  9884.     {
  9885.         char c = '\u0100';
  9886.         if(anInt1040 > 0)
  9887.         {
  9888.             for(int i = 0; i < 256; i++)
  9889.                 if(anInt1040 > 768)
  9890.                     anIntArray850[i] = method83(anIntArray851[i], anIntArray852[i], 1024 - anInt1040);
  9891.                 else
  9892.                 if(anInt1040 > 256)
  9893.                     anIntArray850[i] = anIntArray852[i];
  9894.                 else
  9895.                     anIntArray850[i] = method83(anIntArray852[i], anIntArray851[i], 256 - anInt1040);
  9896.  
  9897.         } else
  9898.         if(anInt1041 > 0)
  9899.         {
  9900.             for(int j = 0; j < 256; j++)
  9901.                 if(anInt1041 > 768)
  9902.                     anIntArray850[j] = method83(anIntArray851[j], anIntArray853[j], 1024 - anInt1041);
  9903.                 else
  9904.                 if(anInt1041 > 256)
  9905.                     anIntArray850[j] = anIntArray853[j];
  9906.                 else
  9907.                     anIntArray850[j] = method83(anIntArray853[j], anIntArray851[j], 256 - anInt1041);
  9908.  
  9909.         } else
  9910.         {
  9911.             System.arraycopy(anIntArray851, 0, anIntArray850, 0, 256);
  9912.  
  9913.         }
  9914.         System.arraycopy(aClass30_Sub2_Sub1_Sub1_1201.myPixels, 0, aRSImageProducer_1110.anIntArray315, 0, 33920);
  9915.  
  9916.         int i1 = 0;
  9917.         int j1 = 1152;
  9918.         for(int k1 = 1; k1 < c - 1; k1++)
  9919.         {
  9920.             int l1 = (anIntArray969[k1] * (c - k1)) / c;
  9921.             int j2 = 22 + l1;
  9922.             if(j2 < 0)
  9923.                 j2 = 0;
  9924.             i1 += j2;
  9925.             for(int l2 = j2; l2 < 128; l2++)
  9926.             {
  9927.                 int j3 = anIntArray828[i1++];
  9928.                 if(j3 != 0)
  9929.                 {
  9930.                     int l3 = j3;
  9931.                     int j4 = 256 - j3;
  9932.                     j3 = anIntArray850[j3];
  9933.                     int l4 = aRSImageProducer_1110.anIntArray315[j1];
  9934.                     aRSImageProducer_1110.anIntArray315[j1++] = ((j3 & 0xff00ff) * l3 + (l4 & 0xff00ff) * j4 & 0xff00ff00) + ((j3 & 0xff00) * l3 + (l4 & 0xff00) * j4 & 0xff0000) >> 8;
  9935.                 } else
  9936.                 {
  9937.                     j1++;
  9938.                 }
  9939.             }
  9940.  
  9941.             j1 += j2;
  9942.         }
  9943.  
  9944.         aRSImageProducer_1110.drawGraphics(0, super.graphics, 0);
  9945.         System.arraycopy(aClass30_Sub2_Sub1_Sub1_1202.myPixels, 0, aRSImageProducer_1111.anIntArray315, 0, 33920);
  9946.  
  9947.         i1 = 0;
  9948.         j1 = 1176;
  9949.         for(int k2 = 1; k2 < c - 1; k2++)
  9950.         {
  9951.             int i3 = (anIntArray969[k2] * (c - k2)) / c;
  9952.             int k3 = 103 - i3;
  9953.             j1 += i3;
  9954.             for(int i4 = 0; i4 < k3; i4++)
  9955.             {
  9956.                 int k4 = anIntArray828[i1++];
  9957.                 if(k4 != 0)
  9958.                 {
  9959.                     int i5 = k4;
  9960.                     int j5 = 256 - k4;
  9961.                     k4 = anIntArray850[k4];
  9962.                     int k5 = aRSImageProducer_1111.anIntArray315[j1];
  9963.                     aRSImageProducer_1111.anIntArray315[j1++] = ((k4 & 0xff00ff) * i5 + (k5 & 0xff00ff) * j5 & 0xff00ff00) + ((k4 & 0xff00) * i5 + (k5 & 0xff00) * j5 & 0xff0000) >> 8;
  9964.                 } else
  9965.                 {
  9966.                     j1++;
  9967.                 }
  9968.             }
  9969.  
  9970.             i1 += 128 - k3;
  9971.             j1 += 128 - k3 - i3;
  9972.         }
  9973.  
  9974.         aRSImageProducer_1111.drawGraphics(0, super.graphics, 637);
  9975.     }
  9976.  
  9977.     private void method134(Stream stream)
  9978.     {
  9979.         int j = stream.readBits(8);
  9980.         if(j < playerCount)
  9981.         {
  9982.             for(int k = j; k < playerCount; k++)
  9983.                 anIntArray840[anInt839++] = playerIndices[k];
  9984.  
  9985.         }
  9986.         if(j > playerCount)
  9987.         {
  9988.             signlink.reporterror(myUsername + " Too many players");
  9989.             throw new RuntimeException("eek");
  9990.         }
  9991.         playerCount = 0;
  9992.         for(int l = 0; l < j; l++)
  9993.         {
  9994.             int i1 = playerIndices[l];
  9995.             Player player = playerArray[i1];
  9996.             int j1 = stream.readBits(1);
  9997.             if(j1 == 0)
  9998.             {
  9999.                 playerIndices[playerCount++] = i1;
  10000.                 player.anInt1537 = loopCycle;
  10001.             } else
  10002.             {
  10003.                 int k1 = stream.readBits(2);
  10004.                 if(k1 == 0)
  10005.                 {
  10006.                     playerIndices[playerCount++] = i1;
  10007.                     player.anInt1537 = loopCycle;
  10008.                     anIntArray894[anInt893++] = i1;
  10009.                 } else
  10010.                 if(k1 == 1)
  10011.                 {
  10012.                     playerIndices[playerCount++] = i1;
  10013.                     player.anInt1537 = loopCycle;
  10014.                     int l1 = stream.readBits(3);
  10015.                     player.moveInDir(false, l1);
  10016.                     int j2 = stream.readBits(1);
  10017.                     if(j2 == 1)
  10018.                         anIntArray894[anInt893++] = i1;
  10019.                 } else
  10020.                 if(k1 == 2)
  10021.                 {
  10022.                     playerIndices[playerCount++] = i1;
  10023.                     player.anInt1537 = loopCycle;
  10024.                     int i2 = stream.readBits(3);
  10025.                     player.moveInDir(true, i2);
  10026.                     int k2 = stream.readBits(3);
  10027.                     player.moveInDir(true, k2);
  10028.                     int l2 = stream.readBits(1);
  10029.                     if(l2 == 1)
  10030.                         anIntArray894[anInt893++] = i1;
  10031.                 } else
  10032.                 if(k1 == 3)
  10033.                     anIntArray840[anInt839++] = i1;
  10034.             }
  10035.         }
  10036.     }
  10037.  
  10038.     private void drawLoginScreen(boolean flag)
  10039.     {
  10040.         resetImageProducers();
  10041.         aRSImageProducer_1109.initDrawingArea();
  10042.         aBackground_966.drawBackground(0, 0);
  10043.         char c = '\u0168';
  10044.         char c1 = '\310';
  10045.         if(loginScreenState == 0)
  10046.         {
  10047.             int i = c1 / 2 + 80;
  10048.             smallText.method382(0x75a9a9, c / 2, onDemandFetcher.statusString, i, true);
  10049.             i = c1 / 2 - 20;
  10050.             chatTextDrawingArea.method382(0xffff00, c / 2, "Welcome to PwnXile", i, true);
  10051.             i += 30;
  10052.             int l = c / 2 - 80;
  10053.             int k1 = c1 / 2 + 20;
  10054.             aBackground_967.drawBackground(l - 73, k1 - 20);
  10055.             chatTextDrawingArea.method382(0xffffff, l, "Help", k1 + 5, true);
  10056.             l = c / 2 + 80;
  10057.             aBackground_967.drawBackground(l - 73, k1 - 20);
  10058.             chatTextDrawingArea.method382(0xffffff, l, "Play Now", k1 + 5, true);
  10059.         }
  10060.         if(loginScreenState == 2)
  10061.         {
  10062.             int j = c1 / 2 - 40;
  10063.             if(loginMessage1.length() > 0)
  10064.             {
  10065.                 chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage1, j - 15, true);
  10066.                 chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j, true);
  10067.                 j += 30;
  10068.             } else
  10069.             {
  10070.                 chatTextDrawingArea.method382(0xffff00, c / 2, loginMessage2, j - 7, true);
  10071.                 j += 30;
  10072.             }
  10073.             chatTextDrawingArea.method389(true, c / 2 - 90, 0xffffff, "Username: " + myUsername + ((loginScreenCursorPos == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10074.             j += 15;
  10075.             chatTextDrawingArea.method389(true, c / 2 - 88, 0xffffff, "Password: " + TextClass.passwordAsterisks(myPassword) + ((loginScreenCursorPos == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
  10076.             j += 15;
  10077.             if(!flag)
  10078.             {
  10079.                 int i1 = c / 2 - 80;
  10080.                 int l1 = c1 / 2 + 50;
  10081.                 aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10082.                 chatTextDrawingArea.method382(0xffffff, i1, "Login", l1 + 5, true);
  10083.                 i1 = c / 2 + 80;
  10084.                 aBackground_967.drawBackground(i1 - 73, l1 - 20);
  10085.                 chatTextDrawingArea.method382(0xffffff, i1, "Cancel", l1 + 5, true);
  10086.             }
  10087.         }
  10088.         if(loginScreenState == 3)
  10089.         {
  10090.                         chatTextDrawingArea.method382(0xffff00, c / 2, "Create a free account", c1 / 2 - 60, true);
  10091.             int k = c1 / 2 - 35;
  10092.             chatTextDrawingArea.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
  10093.             k += 15;
  10094.             chatTextDrawingArea.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
  10095.             k += 15;
  10096.             chatTextDrawingArea.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
  10097.             k += 15;
  10098.             chatTextDrawingArea.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
  10099.             k += 15;
  10100.             int j1 = c / 2;
  10101.             int i2 = c1 / 2 + 50;
  10102.             aBackground_967.drawBackground(j1 - 73, i2 - 20);
  10103.             chatTextDrawingArea.method382(0xffffff, j1, "Cancel", i2 + 5, true);
  10104.         }
  10105.         aRSImageProducer_1109.drawGraphics(171, super.graphics, 202);
  10106.         if(welcomeScreenRaised)
  10107.         {
  10108.             welcomeScreenRaised = false;
  10109.             aRSImageProducer_1107.drawGraphics(0, super.graphics, 128);
  10110.             aRSImageProducer_1108.drawGraphics(371, super.graphics, 202);
  10111.             aRSImageProducer_1112.drawGraphics(265, super.graphics, 0);
  10112.             aRSImageProducer_1113.drawGraphics(265, super.graphics, 562);
  10113.             aRSImageProducer_1114.drawGraphics(171, super.graphics, 128);
  10114.             aRSImageProducer_1115.drawGraphics(171, super.graphics, 562);
  10115.         }
  10116.     }
  10117.  
  10118.     private void drawFlames()
  10119.     {
  10120.         drawingFlames = true;
  10121.         try
  10122.         {
  10123.             long l = System.currentTimeMillis();
  10124.             int i = 0;
  10125.             int j = 20;
  10126.             while(aBoolean831)
  10127.             {
  10128.                 anInt1208++;
  10129.                 //calcFlamesPosition();
  10130.                 //calcFlamesPosition();
  10131.                 doFlamesDrawing();
  10132.                 if(++i > 10)
  10133.                 {
  10134.                     long l1 = System.currentTimeMillis();
  10135.                     int k = (int)(l1 - l) / 10 - j;
  10136.                     j = 40 - k;
  10137.                     if(j < 5)
  10138.                         j = 5;
  10139.                     i = 0;
  10140.                     l = l1;
  10141.                 }
  10142.                 try
  10143.                 {
  10144.                     Thread.sleep(j);
  10145.                 }
  10146.                 catch(Exception _ex) { }
  10147.             }
  10148.         }
  10149.         catch(Exception _ex) { }
  10150.         drawingFlames = false;
  10151.     }
  10152.  
  10153.     public void raiseWelcomeScreen()
  10154.     {
  10155.         welcomeScreenRaised = true;
  10156.     }
  10157.  
  10158.     private void method137(Stream stream, int j)
  10159.     {
  10160.         if(j == 84)
  10161.         {
  10162.             int k = stream.readUnsignedByte();
  10163.             int j3 = anInt1268 + (k >> 4 & 7);
  10164.             int i6 = anInt1269 + (k & 7);
  10165.             int l8 = stream.readUnsignedWord();
  10166.             int k11 = stream.readUnsignedWord();
  10167.             int l13 = stream.readUnsignedWord();
  10168.             if(j3 >= 0 && i6 >= 0 && j3 < 104 && i6 < 104)
  10169.             {
  10170.                 NodeList class19_1 = groundArray[plane][j3][i6];
  10171.                 if(class19_1 != null)
  10172.                 {
  10173.                     for(Item class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetFirst(); class30_sub2_sub4_sub2_3 != null; class30_sub2_sub4_sub2_3 = (Item)class19_1.reverseGetNext())
  10174.                     {
  10175.                         if(class30_sub2_sub4_sub2_3.ID != (l8 & 0x7fff) || class30_sub2_sub4_sub2_3.anInt1559 != k11)
  10176.                             continue;
  10177.                         class30_sub2_sub4_sub2_3.anInt1559 = l13;
  10178.                         break;
  10179.                     }
  10180.  
  10181.                     spawnGroundItem(j3, i6);
  10182.                 }
  10183.             }
  10184.             return;
  10185.         }
  10186.         if(j == 105)
  10187.         {
  10188.             int l = stream.readUnsignedByte();
  10189.             int k3 = anInt1268 + (l >> 4 & 7);
  10190.             int j6 = anInt1269 + (l & 7);
  10191.             int i9 = stream.readUnsignedWord();
  10192.             int l11 = stream.readUnsignedByte();
  10193.             int i14 = l11 >> 4 & 0xf;
  10194.             int i16 = l11 & 7;
  10195.             if(myPlayer.smallX[0] >= k3 - i14 && myPlayer.smallX[0] <= k3 + i14 && myPlayer.smallY[0] >= j6 - i14 && myPlayer.smallY[0] <= j6 + i14 && aBoolean848 && !lowMem && anInt1062 < 50)
  10196.             {
  10197.                 anIntArray1207[anInt1062] = i9;
  10198.                 anIntArray1241[anInt1062] = i16;
  10199.                 anIntArray1250[anInt1062] = Sounds.anIntArray326[i9];
  10200.                 anInt1062++;
  10201.             }
  10202.         }
  10203.         if(j == 215)
  10204.         {
  10205.             int i1 = stream.method435();
  10206.             int l3 = stream.method428();
  10207.             int k6 = anInt1268 + (l3 >> 4 & 7);
  10208.             int j9 = anInt1269 + (l3 & 7);
  10209.             int i12 = stream.method435();
  10210.             int j14 = stream.readUnsignedWord();
  10211.             if(k6 >= 0 && j9 >= 0 && k6 < 104 && j9 < 104 && i12 != unknownInt10)
  10212.             {
  10213.                 Item class30_sub2_sub4_sub2_2 = new Item();
  10214.                 class30_sub2_sub4_sub2_2.ID = i1;
  10215.                 class30_sub2_sub4_sub2_2.anInt1559 = j14;
  10216.                 if(groundArray[plane][k6][j9] == null)
  10217.                     groundArray[plane][k6][j9] = new NodeList();
  10218.                 groundArray[plane][k6][j9].insertHead(class30_sub2_sub4_sub2_2);
  10219.                 spawnGroundItem(k6, j9);
  10220.             }
  10221.             return;
  10222.         }
  10223.         if(j == 156)
  10224.         {
  10225.             int j1 = stream.method426();
  10226.             int i4 = anInt1268 + (j1 >> 4 & 7);
  10227.             int l6 = anInt1269 + (j1 & 7);
  10228.             int k9 = stream.readUnsignedWord();
  10229.             if(i4 >= 0 && l6 >= 0 && i4 < 104 && l6 < 104)
  10230.             {
  10231.                 NodeList class19 = groundArray[plane][i4][l6];
  10232.                 if(class19 != null)
  10233.                 {
  10234.                     for(Item item = (Item)class19.reverseGetFirst(); item != null; item = (Item)class19.reverseGetNext())
  10235.                     {
  10236.                         if(item.ID != (k9 & 0x7fff))
  10237.                             continue;
  10238.                         item.unlink();
  10239.                         break;
  10240.                     }
  10241.  
  10242.                     if(class19.reverseGetFirst() == null)
  10243.                         groundArray[plane][i4][l6] = null;
  10244.                     spawnGroundItem(i4, l6);
  10245.                 }
  10246.             }
  10247.             return;
  10248.         }
  10249.         if(j == 160)
  10250.         {
  10251.             int k1 = stream.method428();
  10252.             int j4 = anInt1268 + (k1 >> 4 & 7);
  10253.             int i7 = anInt1269 + (k1 & 7);
  10254.             int l9 = stream.method428();
  10255.             int j12 = l9 >> 2;
  10256.             int k14 = l9 & 3;
  10257.             int j16 = anIntArray1177[j12];
  10258.             int j17 = stream.method435();
  10259.             if(j4 >= 0 && i7 >= 0 && j4 < 103 && i7 < 103)
  10260.             {
  10261.                 int j18 = intGroundArray[plane][j4][i7];
  10262.                 int i19 = intGroundArray[plane][j4 + 1][i7];
  10263.                 int l19 = intGroundArray[plane][j4 + 1][i7 + 1];
  10264.                 int k20 = intGroundArray[plane][j4][i7 + 1];
  10265.                 if(j16 == 0)
  10266.                 {
  10267.                     Object1 class10 = worldController.method296(plane, j4, i7);
  10268.                     if(class10 != null)
  10269.                     {
  10270.                         int k21 = class10.uid >> 14 & 0x7fff;
  10271.                         if(j12 == 2)
  10272.                         {
  10273.                             class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, 4 + k14, 2, i19, l19, j18, k20, j17, false);
  10274.                             class10.aClass30_Sub2_Sub4_279 = new Animable_Sub5(k21, k14 + 1 & 3, 2, i19, l19, j18, k20, j17, false);
  10275.                         } else
  10276.                         {
  10277.                             class10.aClass30_Sub2_Sub4_278 = new Animable_Sub5(k21, k14, j12, i19, l19, j18, k20, j17, false);
  10278.                         }
  10279.                     }
  10280.                 }
  10281.                 if(j16 == 1)
  10282.                 {
  10283.                     Object2 class26 = worldController.method297(j4, i7, plane);
  10284.                     if(class26 != null)
  10285.                         class26.aClass30_Sub2_Sub4_504 = new Animable_Sub5(class26.uid >> 14 & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
  10286.                 }
  10287.                 if(j16 == 2)
  10288.                 {
  10289.                     Object5 class28 = worldController.method298(j4, i7, plane);
  10290.                     if(j12 == 11)
  10291.                         j12 = 10;
  10292.                     if(class28 != null)
  10293.                         class28.aClass30_Sub2_Sub4_521 = new Animable_Sub5(class28.uid >> 14 & 0x7fff, k14, j12, i19, l19, j18, k20, j17, false);
  10294.                 }
  10295.                 if(j16 == 3)
  10296.                 {
  10297.                     Object3 class49 = worldController.method299(i7, j4, plane);
  10298.                     if(class49 != null)
  10299.                         class49.aClass30_Sub2_Sub4_814 = new Animable_Sub5(class49.uid >> 14 & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
  10300.                 }
  10301.             }
  10302.             return;
  10303.         }
  10304.         if(j == 147)
  10305.         {
  10306.             int l1 = stream.method428();
  10307.             int k4 = anInt1268 + (l1 >> 4 & 7);
  10308.             int j7 = anInt1269 + (l1 & 7);
  10309.             int i10 = stream.readUnsignedWord();
  10310.             byte byte0 = stream.method430();
  10311.             int l14 = stream.method434();
  10312.             byte byte1 = stream.method429();
  10313.             int k17 = stream.readUnsignedWord();
  10314.             int k18 = stream.method428();
  10315.             int j19 = k18 >> 2;
  10316.             int i20 = k18 & 3;
  10317.             int l20 = anIntArray1177[j19];
  10318.             byte byte2 = stream.readSignedByte();
  10319.             int l21 = stream.readUnsignedWord();
  10320.             byte byte3 = stream.method429();
  10321.             Player player;
  10322.             if(i10 == unknownInt10)
  10323.                 player = myPlayer;
  10324.             else
  10325.                 player = playerArray[i10];
  10326.             if(player != null)
  10327.             {
  10328.                 ObjectDef class46 = ObjectDef.forID(l21);
  10329.                 int i22 = intGroundArray[plane][k4][j7];
  10330.                 int j22 = intGroundArray[plane][k4 + 1][j7];
  10331.                 int k22 = intGroundArray[plane][k4 + 1][j7 + 1];
  10332.                 int l22 = intGroundArray[plane][k4][j7 + 1];
  10333.                 Model model = class46.method578(j19, i20, i22, j22, k22, l22, -1);
  10334.                 if(model != null)
  10335.                 {
  10336.                     method130(k17 + 1, -1, 0, l20, j7, 0, plane, k4, l14 + 1);
  10337.                     player.anInt1707 = l14 + loopCycle;
  10338.                     player.anInt1708 = k17 + loopCycle;
  10339.                     player.aModel_1714 = model;
  10340.                     int i23 = class46.anInt744;
  10341.                     int j23 = class46.anInt761;
  10342.                     if(i20 == 1 || i20 == 3)
  10343.                     {
  10344.                         i23 = class46.anInt761;
  10345.                         j23 = class46.anInt744;
  10346.                     }
  10347.                     player.anInt1711 = k4 * 128 + i23 * 64;
  10348.                     player.anInt1713 = j7 * 128 + j23 * 64;
  10349.                     player.anInt1712 = method42(plane, player.anInt1713, player.anInt1711);
  10350.                     if(byte2 > byte0)
  10351.                     {
  10352.                         byte byte4 = byte2;
  10353.                         byte2 = byte0;
  10354.                         byte0 = byte4;
  10355.                     }
  10356.                     if(byte3 > byte1)
  10357.                     {
  10358.                         byte byte5 = byte3;
  10359.                         byte3 = byte1;
  10360.                         byte1 = byte5;
  10361.                     }
  10362.                     player.anInt1719 = k4 + byte2;
  10363.                     player.anInt1721 = k4 + byte0;
  10364.                     player.anInt1720 = j7 + byte3;
  10365.                     player.anInt1722 = j7 + byte1;
  10366.                 }
  10367.             }
  10368.         }
  10369.         if(j == 151)
  10370.         {
  10371.             int i2 = stream.method426();
  10372.             int l4 = anInt1268 + (i2 >> 4 & 7);
  10373.             int k7 = anInt1269 + (i2 & 7);
  10374.             int j10 = stream.method434();
  10375.             int k12 = stream.method428();
  10376.             int i15 = k12 >> 2;
  10377.             int k16 = k12 & 3;
  10378.             int l17 = anIntArray1177[i15];
  10379.             if(l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
  10380.                 method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
  10381.             return;
  10382.         }
  10383.         if(j == 4)
  10384.         {
  10385.             int j2 = stream.readUnsignedByte();
  10386.             int i5 = anInt1268 + (j2 >> 4 & 7);
  10387.             int l7 = anInt1269 + (j2 & 7);
  10388.             int k10 = stream.readUnsignedWord();
  10389.             int l12 = stream.readUnsignedByte();
  10390.             int j15 = stream.readUnsignedWord();
  10391.             if(i5 >= 0 && l7 >= 0 && i5 < 104 && l7 < 104)
  10392.             {
  10393.                 i5 = i5 * 128 + 64;
  10394.                 l7 = l7 * 128 + 64;
  10395.                 Animable_Sub3 class30_sub2_sub4_sub3 = new Animable_Sub3(plane, loopCycle, j15, k10, method42(plane, l7, i5) - l12, l7, i5);
  10396.                 aClass19_1056.insertHead(class30_sub2_sub4_sub3);
  10397.             }
  10398.             return;
  10399.         }
  10400.         if(j == 44)
  10401.         {
  10402.             int k2 = stream.method436();
  10403.             int j5 = stream.readUnsignedWord();
  10404.             int i8 = stream.readUnsignedByte();
  10405.             int l10 = anInt1268 + (i8 >> 4 & 7);
  10406.             int i13 = anInt1269 + (i8 & 7);
  10407.             if(l10 >= 0 && i13 >= 0 && l10 < 104 && i13 < 104)
  10408.             {
  10409.                 Item class30_sub2_sub4_sub2_1 = new Item();
  10410.                 class30_sub2_sub4_sub2_1.ID = k2;
  10411.                 class30_sub2_sub4_sub2_1.anInt1559 = j5;
  10412.                 if(groundArray[plane][l10][i13] == null)
  10413.                     groundArray[plane][l10][i13] = new NodeList();
  10414.                 groundArray[plane][l10][i13].insertHead(class30_sub2_sub4_sub2_1);
  10415.                 spawnGroundItem(l10, i13);
  10416.             }
  10417.             return;
  10418.         }
  10419.         if(j == 101)
  10420.         {
  10421.             int l2 = stream.method427();
  10422.             int k5 = l2 >> 2;
  10423.             int j8 = l2 & 3;
  10424.             int i11 = anIntArray1177[k5];
  10425.             int j13 = stream.readUnsignedByte();
  10426.             int k15 = anInt1268 + (j13 >> 4 & 7);
  10427.             int l16 = anInt1269 + (j13 & 7);
  10428.             if(k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
  10429.                 method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
  10430.             return;
  10431.         }
  10432.         if(j == 117)
  10433.         {
  10434.             int i3 = stream.readUnsignedByte();
  10435.             int l5 = anInt1268 + (i3 >> 4 & 7);
  10436.             int k8 = anInt1269 + (i3 & 7);
  10437.             int j11 = l5 + stream.readSignedByte();
  10438.             int k13 = k8 + stream.readSignedByte();
  10439.             int l15 = stream.readSignedWord();
  10440.             int i17 = stream.readUnsignedWord();
  10441.             int i18 = stream.readUnsignedByte() * 4;
  10442.             int l18 = stream.readUnsignedByte() * 4;
  10443.             int k19 = stream.readUnsignedWord();
  10444.             int j20 = stream.readUnsignedWord();
  10445.             int i21 = stream.readUnsignedByte();
  10446.             int j21 = stream.readUnsignedByte();
  10447.             if(l5 >= 0 && k8 >= 0 && l5 < 104 && k8 < 104 && j11 >= 0 && k13 >= 0 && j11 < 104 && k13 < 104 && i17 != 65535)
  10448.             {
  10449.                 l5 = l5 * 128 + 64;
  10450.                 k8 = k8 * 128 + 64;
  10451.                 j11 = j11 * 128 + 64;
  10452.                 k13 = k13 * 128 + 64;
  10453.                 Animable_Sub4 class30_sub2_sub4_sub4 = new Animable_Sub4(i21, l18, k19 + loopCycle, j20 + loopCycle, j21, plane, method42(plane, k8, l5) - i18, k8, l5, l15, i17);
  10454.                 class30_sub2_sub4_sub4.method455(k19 + loopCycle, k13, method42(plane, k13, j11) - l18, j11);
  10455.                 aClass19_1013.insertHead(class30_sub2_sub4_sub4);
  10456.             }
  10457.         }
  10458.     }
  10459.  
  10460.     private static void setLowMem()
  10461.     {
  10462.         WorldController.lowMem = true;
  10463.         Texture.lowMem = true;
  10464.         lowMem = true;
  10465.         ObjectManager.lowMem = true;
  10466.         ObjectDef.lowMem = true;
  10467.     }
  10468.  
  10469.     private void method139(Stream stream)
  10470.     {
  10471.         stream.initBitAccess();
  10472.         int k = stream.readBits(8);
  10473.         if(k < npcCount)
  10474.         {
  10475.             for(int l = k; l < npcCount; l++)
  10476.                 anIntArray840[anInt839++] = npcIndices[l];
  10477.  
  10478.         }
  10479.         if(k > npcCount)
  10480.         {
  10481.             signlink.reporterror(myUsername + " Too many npcs");
  10482.             throw new RuntimeException("eek");
  10483.         }
  10484.         npcCount = 0;
  10485.         for(int i1 = 0; i1 < k; i1++)
  10486.         {
  10487.             int j1 = npcIndices[i1];
  10488.             NPC npc = npcArray[j1];
  10489.             int k1 = stream.readBits(1);
  10490.             if(k1 == 0)
  10491.             {
  10492.                 npcIndices[npcCount++] = j1;
  10493.                 npc.anInt1537 = loopCycle;
  10494.             } else
  10495.             {
  10496.                 int l1 = stream.readBits(2);
  10497.                 if(l1 == 0)
  10498.                 {
  10499.                     npcIndices[npcCount++] = j1;
  10500.                     npc.anInt1537 = loopCycle;
  10501.                     anIntArray894[anInt893++] = j1;
  10502.                 } else
  10503.                 if(l1 == 1)
  10504.                 {
  10505.                     npcIndices[npcCount++] = j1;
  10506.                     npc.anInt1537 = loopCycle;
  10507.                     int i2 = stream.readBits(3);
  10508.                     npc.moveInDir(false, i2);
  10509.                     int k2 = stream.readBits(1);
  10510.                     if(k2 == 1)
  10511.                         anIntArray894[anInt893++] = j1;
  10512.                 } else
  10513.                 if(l1 == 2)
  10514.                 {
  10515.                     npcIndices[npcCount++] = j1;
  10516.                     npc.anInt1537 = loopCycle;
  10517.                     int j2 = stream.readBits(3);
  10518.                     npc.moveInDir(true, j2);
  10519.                     int l2 = stream.readBits(3);
  10520.                     npc.moveInDir(true, l2);
  10521.                     int i3 = stream.readBits(1);
  10522.                     if(i3 == 1)
  10523.                         anIntArray894[anInt893++] = j1;
  10524.                 } else
  10525.                 if(l1 == 3)
  10526.                     anIntArray840[anInt839++] = j1;
  10527.             }
  10528.         }
  10529.  
  10530.     }
  10531.  
  10532.     private void processLoginScreenInput()
  10533.     {
  10534.         if(loginScreenState == 0)
  10535.         {
  10536.             int i = super.myWidth / 2 - 80;
  10537.             int l = super.myHeight / 2 + 20;
  10538.             l += 20;
  10539.             if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10540.             {
  10541.                 loginScreenState = 3;
  10542.                 loginScreenCursorPos = 0;
  10543.             }
  10544.             i = super.myWidth / 2 + 80;
  10545.             if(super.clickMode3 == 1 && super.saveClickX >= i - 75 && super.saveClickX <= i + 75 && super.saveClickY >= l - 20 && super.saveClickY <= l + 20)
  10546.             {
  10547.                 loginMessage1 = "";
  10548.                 loginMessage2 = "Enter your username & password.";
  10549.                 loginScreenState = 2;
  10550.                 loginScreenCursorPos = 0;
  10551.             }
  10552.         } else
  10553.         {
  10554.             if(loginScreenState == 2)
  10555.             {
  10556.                 int j = super.myHeight / 2 - 40;
  10557.                 j += 30;
  10558.                 j += 25;
  10559.                 if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10560.                     loginScreenCursorPos = 0;
  10561.                 j += 15;
  10562.                 if(super.clickMode3 == 1 && super.saveClickY >= j - 15 && super.saveClickY < j)
  10563.                     loginScreenCursorPos = 1;
  10564.                 j += 15;
  10565.                 int i1 = super.myWidth / 2 - 80;
  10566.                 int k1 = super.myHeight / 2 + 50;
  10567.                 k1 += 20;
  10568.                 if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10569.                 {
  10570.                     loginFailures = 0;
  10571.                     login(myUsername, myPassword, false);
  10572.                     if(loggedIn)
  10573.                         return;
  10574.                 }
  10575.                 i1 = super.myWidth / 2 + 80;
  10576.                 if(super.clickMode3 == 1 && super.saveClickX >= i1 - 75 && super.saveClickX <= i1 + 75 && super.saveClickY >= k1 - 20 && super.saveClickY <= k1 + 20)
  10577.                 {
  10578.                     loginScreenState = 0;
  10579.  //                myUsername = "";
  10580.  //                myPassword = "";
  10581.                 }
  10582.                 do
  10583.                 {
  10584.                     int l1 = readChar(-796);
  10585.                     if(l1 == -1)
  10586.                         break;
  10587.                     boolean flag1 = false;
  10588.                     for(int i2 = 0; i2 < validUserPassChars.length(); i2++)
  10589.                     {
  10590.                         if(l1 != validUserPassChars.charAt(i2))
  10591.                             continue;
  10592.                         flag1 = true;
  10593.                         break;
  10594.                     }
  10595.  
  10596.                     if(loginScreenCursorPos == 0)
  10597.                     {
  10598.                         if(l1 == 8 && myUsername.length() > 0)
  10599.                             myUsername = myUsername.substring(0, myUsername.length() - 1);
  10600.                         if(l1 == 9 || l1 == 10 || l1 == 13)
  10601.                             loginScreenCursorPos = 1;
  10602.                         if(flag1)
  10603.                             myUsername += (char)l1;
  10604.                         if(myUsername.length() > 12)
  10605.                             myUsername = myUsername.substring(0, 12);
  10606.                     } else
  10607.                     if(loginScreenCursorPos == 1)
  10608.                     {
  10609.                         if(l1 == 8 && myPassword.length() > 0)
  10610.                             myPassword = myPassword.substring(0, myPassword.length() - 1);
  10611.                         if (l1 == 9 || l1 == 10 || l1 == 13)
  10612.                             if (myUsername == "")
  10613.                             loginScreenCursorPos = 0;
  10614.                             else if (myPassword == "") {
  10615.                             } else
  10616.                             login(myUsername, myPassword, false);
  10617.  
  10618.                         if(flag1)
  10619.                             myPassword += (char)l1;
  10620.                         if(myPassword.length() > 20)
  10621.                             myPassword = myPassword.substring(0, 20);
  10622.                     }
  10623.                 } while(true);
  10624.                 return;
  10625.             }
  10626.             if(loginScreenState == 3)
  10627.             {
  10628.                 int k = super.myWidth / 2;
  10629.                 int j1 = super.myHeight / 2 + 50;
  10630.                 j1 += 20;
  10631.                 if(super.clickMode3 == 1 && super.saveClickX >= k - 75 && super.saveClickX <= k + 75 && super.saveClickY >= j1 - 20 && super.saveClickY <= j1 + 20)
  10632.                     loginScreenState = 0;
  10633.             }
  10634.         }
  10635.     }
  10636.  
  10637.     private void markMinimap(Sprite sprite, int i, int j) {
  10638.         int k = minimapInt1 + minimapInt2 & 0x7ff;
  10639.         int l = i * i + j * j;
  10640.         if(l > 6400)
  10641.             return;
  10642.         int i1 = Model.modelIntArray1[k];
  10643.         int j1 = Model.modelIntArray2[k];
  10644.         i1 = (i1 * 256) / (minimapInt3 + 256);
  10645.         j1 = (j1 * 256) / (minimapInt3 + 256);
  10646.         int k1 = j * i1 + i * j1 >> 16;
  10647.         int l1 = j * j1 - i * i1 >> 16;
  10648.         if(l > 2500) {
  10649.             sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4 , 83 - l1 - sprite.anInt1445 / 2 - 4);
  10650.         } else {
  10651.             sprite.drawSprite(((94 + k1) - sprite.anInt1444 / 2) + 4, 83 - l1 - sprite.anInt1445 / 2 - 4);
  10652.         }
  10653.     }
  10654.  
  10655.     private void method142(int i, int j, int k, int l, int i1, int j1, int k1
  10656.     )
  10657.     {
  10658.         if(i1 >= 1 && i >= 1 && i1 <= 102 && i <= 102)
  10659.         {
  10660.             if(lowMem && j != plane)
  10661.                 return;
  10662.             int i2 = 0;
  10663.             if(j1 == 0)
  10664.                 i2 = worldController.method300(j, i1, i);
  10665.             if(j1 == 1)
  10666.                 i2 = worldController.method301(j, i1, i);
  10667.             if(j1 == 2)
  10668.                 i2 = worldController.method302(j, i1, i);
  10669.             if(j1 == 3)
  10670.                 i2 = worldController.method303(j, i1, i);
  10671.             if(i2 != 0)
  10672.             {
  10673.                 int i3 = worldController.method304(j, i1, i, i2);
  10674.                 int j2 = i2 >> 14 & 0x7fff;
  10675.                 int k2 = i3 & 0x1f;
  10676.                 int l2 = i3 >> 6;
  10677.                 if(j1 == 0)
  10678.                 {
  10679.                     worldController.method291(i1, j, i, (byte)-119);
  10680.                     ObjectDef class46 = ObjectDef.forID(j2);
  10681.                     if(class46.aBoolean767)
  10682.                         aClass11Array1230[j].method215(l2, k2, class46.aBoolean757, i1, i);
  10683.                 }
  10684.                 if(j1 == 1)
  10685.                     worldController.method292(i, j, i1);
  10686.                 if(j1 == 2)
  10687.                 {
  10688.                     worldController.method293(j, i1, i);
  10689.                     ObjectDef class46_1 = ObjectDef.forID(j2);
  10690.                     if(i1 + class46_1.anInt744 > 103 || i + class46_1.anInt744 > 103 || i1 + class46_1.anInt761 > 103 || i + class46_1.anInt761 > 103)
  10691.                         return;
  10692.                     if(class46_1.aBoolean767)
  10693.                         aClass11Array1230[j].method216(l2, class46_1.anInt744, i1, i, class46_1.anInt761, class46_1.aBoolean757);
  10694.                 }
  10695.                 if(j1 == 3)
  10696.                 {
  10697.                     worldController.method294(j, i, i1);
  10698.                     ObjectDef class46_2 = ObjectDef.forID(j2);
  10699.                     if(class46_2.aBoolean767 && class46_2.hasActions)
  10700.                         aClass11Array1230[j].method218(i, i1);
  10701.                 }
  10702.             }
  10703.             if(k1 >= 0)
  10704.             {
  10705.                 int j3 = j;
  10706.                 if(j3 < 3 && (byteGroundArray[1][i1][i] & 2) == 2)
  10707.                     j3++;
  10708.                 ObjectManager.method188(worldController, k, i, l, j3, aClass11Array1230[j], intGroundArray, i1, k1, j);
  10709.             }
  10710.         }
  10711.     }
  10712.  
  10713.     private void updatePlayers(int i, Stream stream)
  10714.     {
  10715.         anInt839 = 0;
  10716.         anInt893 = 0;
  10717.         method117(stream);
  10718.         method134(stream);
  10719.         method91(stream, i);
  10720.         method49(stream);
  10721.         for(int k = 0; k < anInt839; k++)
  10722.         {
  10723.             int l = anIntArray840[k];
  10724.             if(playerArray[l].anInt1537 != loopCycle)
  10725.                 playerArray[l] = null;
  10726.         }
  10727.  
  10728.         if(stream.currentOffset != i)
  10729.         {
  10730.             signlink.reporterror("Error packet size mismatch in getplayer pos:" + stream.currentOffset + " psize:" + i);
  10731.             throw new RuntimeException("eek");
  10732.         }
  10733.         for(int i1 = 0; i1 < playerCount; i1++)
  10734.             if(playerArray[playerIndices[i1]] == null)
  10735.             {
  10736.                 signlink.reporterror(myUsername + " null entry in pl list - pos:" + i1 + " size:" + playerCount);
  10737.                 throw new RuntimeException("eek");
  10738.             }
  10739.  
  10740.     }
  10741.  
  10742.     private void setCameraPos(int j, int k, int l, int i1, int j1, int k1)
  10743.     {
  10744.         int l1 = 2048 - k & 0x7ff;
  10745.         int i2 = 2048 - j1 & 0x7ff;
  10746.         int j2 = 0;
  10747.         int k2 = 0;
  10748.         int l2 = j;
  10749.         if(l1 != 0)
  10750.         {
  10751.             int i3 = Model.modelIntArray1[l1];
  10752.             int k3 = Model.modelIntArray2[l1];
  10753.             int i4 = k2 * k3 - l2 * i3 >> 16;
  10754.             l2 = k2 * i3 + l2 * k3 >> 16;
  10755.             k2 = i4;
  10756.         }
  10757.         if(i2 != 0)
  10758.         {
  10759. /* xxx          if(cameratoggle){
  10760.                 if(zoom == 0)
  10761.                 zoom = k2;
  10762.               if(lftrit == 0)
  10763.                 lftrit = j2;
  10764.               if(fwdbwd == 0)
  10765.                 fwdbwd = l2;
  10766.               k2 = zoom;
  10767.               j2 = lftrit;
  10768.               l2 = fwdbwd;
  10769.             }
  10770. */
  10771.             int j3 = Model.modelIntArray1[i2];
  10772.             int l3 = Model.modelIntArray2[i2];
  10773.             int j4 = l2 * j3 + j2 * l3 >> 16;
  10774.             l2 = l2 * l3 - j2 * j3 >> 16;
  10775.             j2 = j4;
  10776.         }
  10777.         xCameraPos = l - j2;
  10778.         zCameraPos = i1 - k2;
  10779.         yCameraPos = k1 - l2;
  10780.         yCameraCurve = k;
  10781.         xCameraCurve = j1;
  10782.     }
  10783.  
  10784.     public void updateStrings(String str, int i) {
  10785.         switch(i) {
  10786.             case 1675: sendFrame126(str, 17508); break;//Stab
  10787.             case 1676: sendFrame126(str, 17509); break;//Slash
  10788.             case 1677: sendFrame126(str, 17510); break;//Cursh
  10789.             case 1678: sendFrame126(str, 17511); break;//Magic
  10790.             case 1679: sendFrame126(str, 17512); break;//Range
  10791.             case 1680: sendFrame126(str, 17513); break;//Stab
  10792.             case 1681: sendFrame126(str, 17514); break;//Slash
  10793.             case 1682: sendFrame126(str, 17515); break;//Crush
  10794.             case 1683: sendFrame126(str, 17516); break;//Magic
  10795.             case 1684: sendFrame126(str, 17517); break;//Range
  10796.             case 1686: sendFrame126(str, 17518); break;//Strength
  10797.             case 1687: sendFrame126(str, 17519); break;//Prayer
  10798.         }
  10799.     }
  10800.  
  10801.     public void sendFrame126(String str,int i) {
  10802.         RSInterface.interfaceCache[i].message = str;
  10803.         if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
  10804.             needDrawTabArea = true;
  10805.     }
  10806.  
  10807.     public void sendPacket185(int button,int toggle,int type) {
  10808.         switch(type) {
  10809.             case 135:
  10810.                 RSInterface class9 = RSInterface.interfaceCache[button];
  10811.                 boolean flag8 = true;
  10812.                 if(class9.contentType > 0)
  10813.                     flag8 = promptUserForInput(class9);
  10814.                 if(flag8) {
  10815.                     stream.createFrame(185);
  10816.                     stream.writeWord(button);
  10817.                 }
  10818.                 break;
  10819.             case 646:
  10820.                 stream.createFrame(185);
  10821.                 stream.writeWord(button);
  10822.                 RSInterface class9_2 = RSInterface.interfaceCache[button];
  10823.                 if(class9_2.valueIndexArray != null && class9_2.valueIndexArray[0][0] == 5) {
  10824.                     if(variousSettings[toggle] != class9_2.anIntArray212[0]) {
  10825.                         variousSettings[toggle] = class9_2.anIntArray212[0];
  10826.                         method33(toggle);
  10827.                         needDrawTabArea = true;
  10828.                     }
  10829.                 }
  10830.                 break;
  10831.             case 169:
  10832.                 stream.createFrame(185);
  10833.                 stream.writeWord(button);
  10834.                 RSInterface class9_3 = RSInterface.interfaceCache[button];
  10835.                 if(class9_3.valueIndexArray != null && class9_3.valueIndexArray[0][0] == 5) {
  10836.                     variousSettings[toggle] = 1 - variousSettings[toggle];
  10837.                     method33(toggle);
  10838.                     needDrawTabArea = true;
  10839.                 }
  10840.                 switch(button) {
  10841.                     case 19136:
  10842.                         System.out.println("toggle = "+toggle);
  10843.                         if(toggle == 0)
  10844.                             sendFrame36(173,toggle);
  10845.                         if(toggle == 1)
  10846.                             sendPacket185(153,173,646);
  10847.                         break;
  10848.                 }
  10849.                 break;
  10850.         }
  10851.     }
  10852.  
  10853.     public void sendFrame36(int id,int state) {
  10854.         anIntArray1045[id] = state;
  10855.         if(variousSettings[id] != state) {
  10856.             variousSettings[id] = state;
  10857.             method33(id);
  10858.             needDrawTabArea = true;
  10859.             if(dialogID != -1)
  10860.                 inputTaken = true;
  10861.         }
  10862.     }
  10863.  
  10864.     public void sendFrame219() {
  10865.         if(invOverlayInterfaceID != -1) {
  10866.             invOverlayInterfaceID = -1;
  10867.             needDrawTabArea = true;
  10868.             tabAreaAltered = true;
  10869.         }
  10870.         if(backDialogID != -1) {
  10871.             backDialogID = -1;
  10872.             inputTaken = true;
  10873.         }
  10874.         if(inputDialogState != 0) {
  10875.             inputDialogState = 0;
  10876.             inputTaken = true;
  10877.         }
  10878.         openInterfaceID = -1;
  10879.         aBoolean1149 = false;
  10880.     }
  10881.  
  10882.     public void sendFrame248(int interfaceID,int sideInterfaceID)   {
  10883.         if(backDialogID != -1) {
  10884.             backDialogID = -1;
  10885.             inputTaken = true;
  10886.         }
  10887.         if(inputDialogState != 0) {
  10888.             inputDialogState = 0;
  10889.             inputTaken = true;
  10890.         }
  10891.         openInterfaceID = interfaceID;
  10892.         invOverlayInterfaceID = sideInterfaceID;
  10893.         needDrawTabArea = true;
  10894.         tabAreaAltered = true;
  10895.         aBoolean1149 = false;
  10896.     }
  10897.  
  10898.     private boolean parsePacket() {
  10899.         if(socketStream == null)
  10900.             return false;
  10901.         try {
  10902.             int i = socketStream.available();
  10903.             if(i == 0)
  10904.                 return false;
  10905.             if(pktType == -1) {
  10906.                 socketStream.flushInputStream(inStream.buffer, 1);
  10907.                 pktType = inStream.buffer[0] & 0xff;
  10908.                 if(encryption != null)
  10909.                     pktType = pktType - encryption.getNextKey() & 0xff;
  10910.                 pktSize = SizeConstants.packetSizes[pktType];
  10911.                 i--;
  10912.             }
  10913.             if(pktSize == -1)
  10914.                 if(i > 0) {
  10915.                     socketStream.flushInputStream(inStream.buffer, 1);
  10916.                     pktSize = inStream.buffer[0] & 0xff;
  10917.                     i--;
  10918.                 } else {
  10919.                     return false;
  10920.                 }
  10921.             if(pktSize == -2)
  10922.                 if(i > 1) {
  10923.                     socketStream.flushInputStream(inStream.buffer, 2);
  10924.                     inStream.currentOffset = 0;
  10925.                     pktSize = inStream.readUnsignedWord();
  10926.                     i -= 2;
  10927.                 } else {
  10928.                     return false;
  10929.                 }
  10930.             if(i < pktSize)
  10931.                 return false;
  10932.             inStream.currentOffset = 0;
  10933.             socketStream.flushInputStream(inStream.buffer, pktSize);
  10934.             anInt1009 = 0;
  10935.             anInt843 = anInt842;
  10936.             anInt842 = anInt841;
  10937.             anInt841 = pktType;
  10938.             switch(pktType) {
  10939.                 case 81:
  10940.                     updatePlayers(pktSize, inStream);
  10941.                     aBoolean1080 = false;
  10942.                     pktType = -1;
  10943.                     return true;
  10944.                    
  10945.                 case 176:
  10946.                     daysSinceRecovChange = inStream.method427();
  10947.                     unreadMessages = inStream.method435();
  10948.                     membersInt = inStream.readUnsignedByte();
  10949.                     anInt1193 = inStream.method440();
  10950.                     daysSinceLastLogin = inStream.readUnsignedWord();
  10951.                     if(anInt1193 != 0 && openInterfaceID == -1) {
  10952.                         signlink.dnslookup(TextClass.method586(anInt1193));
  10953.                         clearTopInterfaces();
  10954.                         char c = '\u028A';
  10955.                         if(daysSinceRecovChange != 201 || membersInt == 1)
  10956.                             c = '\u028F';
  10957.                         reportAbuseInput = "";
  10958.                         canMute = false;
  10959.                         for(int k9 = 0; k9 < RSInterface.interfaceCache.length; k9++) {
  10960.                             if(RSInterface.interfaceCache[k9] == null || RSInterface.interfaceCache[k9].contentType != c)
  10961.                                 continue;
  10962.                             openInterfaceID = RSInterface.interfaceCache[k9].parentID;
  10963.                            
  10964.                         }
  10965.                     }
  10966.                     pktType = -1;
  10967.                     return true;
  10968.                    
  10969.                 case 64:
  10970.                     anInt1268 = inStream.method427();
  10971.                     anInt1269 = inStream.method428();
  10972.                     for(int j = anInt1268; j < anInt1268 + 8; j++) {
  10973.                         for(int l9 = anInt1269; l9 < anInt1269 + 8; l9++)
  10974.                             if(groundArray[plane][j][l9] != null) {
  10975.                                 groundArray[plane][j][l9] = null;
  10976.                                 spawnGroundItem(j, l9);
  10977.                             }
  10978.                     }
  10979.                     for(Class30_Sub1 class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1 != null; class30_sub1 = (Class30_Sub1)aClass19_1179.reverseGetNext())
  10980.                         if(class30_sub1.anInt1297 >= anInt1268 && class30_sub1.anInt1297 < anInt1268 + 8 && class30_sub1.anInt1298 >= anInt1269 && class30_sub1.anInt1298 < anInt1269 + 8 && class30_sub1.anInt1295 == plane)
  10981.                             class30_sub1.anInt1294 = 0;
  10982.                     pktType = -1;
  10983.                     return true;
  10984.                    
  10985.                 case 185:
  10986.                     int k = inStream.method436();
  10987.                     RSInterface.interfaceCache[k].anInt233 = 3;
  10988.                     if(myPlayer.desc == null)
  10989.                         RSInterface.interfaceCache[k].mediaID = (myPlayer.anIntArray1700[0] << 25) + (myPlayer.anIntArray1700[4] << 20) + (myPlayer.equipment[0] << 15) + (myPlayer.equipment[8] << 10) + (myPlayer.equipment[11] << 5) + myPlayer.equipment[1];
  10990.                     else
  10991.                         RSInterface.interfaceCache[k].mediaID = (int)(0x12345678L + myPlayer.desc.type);
  10992.                     pktType = -1;
  10993.                     return true;
  10994.                    
  10995.                 /* Clan chat packet */
  10996.                 case 217:
  10997.                     try {
  10998.                         name = inStream.readString();
  10999.                         message = inStream.readString();
  11000.                         clanname = inStream.readString();
  11001.                         rights = inStream.readUnsignedWord();
  11002.                         //message = TextInput.processText(message);
  11003.                         //message = Censor.doCensor(message);
  11004.                         System.out.println(clanname);
  11005.                         pushMessage(message, 16, name);
  11006.                     } catch(Exception e) {
  11007.                         e.printStackTrace();
  11008.                     }
  11009.                     pktType = -1;
  11010.                     return true;
  11011.                    
  11012.                 case 107:
  11013.                     aBoolean1160 = false;
  11014.                     for(int l = 0; l < 5; l++)
  11015.                         aBooleanArray876[l] = false;
  11016.                     pktType = -1;
  11017.                     return true;
  11018.                    
  11019.                 case 72:
  11020.                     int i1 = inStream.method434();
  11021.                     RSInterface class9 = RSInterface.interfaceCache[i1];
  11022.                     for(int k15 = 0; k15 < class9.inv.length; k15++) {
  11023.                         class9.inv[k15] = -1;
  11024.                         class9.inv[k15] = 0;
  11025.                     }
  11026.                     pktType = -1;
  11027.                     return true;
  11028.                    
  11029.                 case 214:
  11030.                     ignoreCount = pktSize / 8;
  11031.                     for(int j1 = 0; j1 < ignoreCount; j1++)
  11032.                         ignoreListAsLongs[j1] = inStream.readQWord();
  11033.                     pktType = -1;
  11034.                     return true;
  11035.                    
  11036.                 case 166:
  11037.                     aBoolean1160 = true;
  11038.                     anInt1098 = inStream.readUnsignedByte();
  11039.                     anInt1099 = inStream.readUnsignedByte();
  11040.                     anInt1100 = inStream.readUnsignedWord();
  11041.                     anInt1101 = inStream.readUnsignedByte();
  11042.                     anInt1102 = inStream.readUnsignedByte();
  11043.                     if(anInt1102 >= 100) {
  11044.                         xCameraPos = anInt1098 * 128 + 64;
  11045.                         yCameraPos = anInt1099 * 128 + 64;
  11046.                         zCameraPos = method42(plane, yCameraPos, xCameraPos) - anInt1100;
  11047.                     }
  11048.                     pktType = -1;
  11049.                     return true;
  11050.                    
  11051.                 case 134:
  11052.                     needDrawTabArea = true;
  11053.                     int k1 = inStream.readUnsignedByte();
  11054.                     int i10 = inStream.method439();
  11055.                     int l15 = inStream.readUnsignedByte();
  11056.                     currentExp[k1] = i10;
  11057.                     currentStats[k1] = l15;
  11058.                     maxStats[k1] = 1;
  11059.                     for(int k20 = 0; k20 < 98; k20++)
  11060.                         if(i10 >= anIntArray1019[k20])
  11061.                             maxStats[k1] = k20 + 2;
  11062.                     pktType = -1;
  11063.                     return true;
  11064.                    
  11065.                 case 71:
  11066.                     int l1 = inStream.readUnsignedWord();
  11067.                     int j10 = inStream.method426();
  11068.                     if(l1 == 65535)
  11069.                         l1 = -1;
  11070.                     tabInterfaceIDs[j10] = l1;
  11071.                     needDrawTabArea = true;
  11072.                     tabAreaAltered = true;
  11073.                     pktType = -1;
  11074.                     return true;
  11075.                    
  11076.                 case 74:
  11077.                     int i2 = inStream.method434();
  11078.                     if(i2 == 65535)
  11079.                         i2 = -1;
  11080.                     if(i2 != currentSong && musicEnabled && !lowMem && prevSong == 0) {
  11081.                         nextSong = i2;
  11082.                         songChanging = true;
  11083.                         onDemandFetcher.method558(2, nextSong);
  11084.                     }
  11085.                     currentSong = i2;
  11086.                     pktType = -1;
  11087.                     return true;
  11088.                    
  11089.                 case 121:
  11090.                     int j2 = inStream.method436();
  11091.                     int k10 = inStream.method435();
  11092.                     if(musicEnabled && !lowMem) {
  11093.                         nextSong = j2;
  11094.                         songChanging = false;
  11095.                         onDemandFetcher.method558(2, nextSong);
  11096.                         prevSong = k10;
  11097.                     }
  11098.                     pktType = -1;
  11099.                     return true;
  11100.                    
  11101.                 case 109:
  11102.                     resetLogout();
  11103.                     pktType = -1;
  11104.                     return false;
  11105.                    
  11106.                 case 70:
  11107.                     int k2 = inStream.readSignedWord();
  11108.                     int l10 = inStream.method437();
  11109.                     int i16 = inStream.method434();
  11110.                     RSInterface class9_5 = RSInterface.interfaceCache[i16];
  11111.                     class9_5.anInt263 = k2;
  11112.                     class9_5.anInt265 = l10;
  11113.                     pktType = -1;
  11114.                     return true;
  11115.                    
  11116.                 case 73:
  11117.                 case 241:
  11118.                     int l2 = anInt1069;
  11119.                     int i11 = anInt1070;
  11120.                     if(pktType == 73) {
  11121.                         l2 = inStream.method435();
  11122.                         i11 = inStream.readUnsignedWord();
  11123.                         aBoolean1159 = false;
  11124.                     }
  11125.                     if(pktType == 241) {
  11126.                         i11 = inStream.method435();
  11127.                         inStream.initBitAccess();
  11128.                         for(int j16 = 0; j16 < 4; j16++) {
  11129.                             for(int l20 = 0; l20 < 13; l20++) {
  11130.                                 for(int j23 = 0; j23 < 13; j23++) {
  11131.                                     int i26 = inStream.readBits(1);
  11132.                                     if(i26 == 1)
  11133.                                         anIntArrayArrayArray1129[j16][l20][j23] = inStream.readBits(26);
  11134.                                     else
  11135.                                         anIntArrayArrayArray1129[j16][l20][j23] = -1;
  11136.                                 }
  11137.                             }
  11138.                         }
  11139.                         inStream.finishBitAccess();
  11140.                         l2 = inStream.readUnsignedWord();
  11141.                         aBoolean1159 = true;
  11142.                     }
  11143.                     if(anInt1069 == l2 && anInt1070 == i11 && loadingStage == 2) {
  11144.                         pktType = -1;
  11145.                         return true;
  11146.                     }
  11147.                     anInt1069 = l2;
  11148.                     anInt1070 = i11;
  11149.                     baseX = (anInt1069 - 6) * 8;
  11150.                     baseY = (anInt1070 - 6) * 8;
  11151.                     aBoolean1141 = (anInt1069 / 8 == 48 || anInt1069 / 8 == 49) && anInt1070 / 8 == 48;
  11152.                     if(anInt1069 / 8 == 48 && anInt1070 / 8 == 148)
  11153.                         aBoolean1141 = true;
  11154.                     loadingStage = 1;
  11155.                     aLong824 = System.currentTimeMillis();
  11156.                     aRSImageProducer_1165.initDrawingArea();
  11157.                     aTextDrawingArea_1271.drawText(0, "Loading - please wait.", 151, 257);
  11158.                     aTextDrawingArea_1271.drawText(0xffffff, "Loading - please wait.", 150, 256);
  11159.                     aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  11160.                     if(pktType == 73) {
  11161.                         int k16 = 0;
  11162.                         for(int i21 = (anInt1069 - 6) / 8; i21 <= (anInt1069 + 6) / 8; i21++) {
  11163.                             for(int k23 = (anInt1070 - 6) / 8; k23 <= (anInt1070 + 6) / 8; k23++)
  11164.                                 k16++;
  11165.                         }
  11166.                         aByteArrayArray1183 = new byte[k16][];
  11167.                         aByteArrayArray1247 = new byte[k16][];
  11168.                         anIntArray1234 = new int[k16];
  11169.                         anIntArray1235 = new int[k16];
  11170.                         anIntArray1236 = new int[k16];
  11171.                         k16 = 0;
  11172.                         for(int l23 = (anInt1069 - 6) / 8; l23 <= (anInt1069 + 6) / 8; l23++) {
  11173.                             for(int j26 = (anInt1070 - 6) / 8; j26 <= (anInt1070 + 6) / 8; j26++) {
  11174.                                 anIntArray1234[k16] = (l23 << 8) + j26;
  11175.                                 if(aBoolean1141 && (j26 == 49 || j26 == 149 || j26 == 147 || l23 == 50 || l23 == 49 && j26 == 47)) {
  11176.                                     anIntArray1235[k16] = -1;
  11177.                                     anIntArray1236[k16] = -1;
  11178.                                     k16++;
  11179.                                 } else {
  11180.                                     int k28 = anIntArray1235[k16] = onDemandFetcher.method562(0, j26, l23);
  11181.                                     if(k28 != -1)
  11182.                                         onDemandFetcher.method558(3, k28);
  11183.                                     int j30 = anIntArray1236[k16] = onDemandFetcher.method562(1, j26, l23);
  11184.                                     if(j30 != -1)
  11185.                                         onDemandFetcher.method558(3, j30);
  11186.                                     k16++;
  11187.                                 }
  11188.                             }
  11189.                         }
  11190.                     }
  11191.                     if(pktType == 241) {
  11192.                         int l16 = 0;
  11193.                         int ai[] = new int[676];
  11194.                         for(int i24 = 0; i24 < 4; i24++) {
  11195.                             for(int k26 = 0; k26 < 13; k26++) {
  11196.                                 for(int l28 = 0; l28 < 13; l28++) {
  11197.                                     int k30 = anIntArrayArrayArray1129[i24][k26][l28];
  11198.                                     if(k30 != -1) {
  11199.                                         int k31 = k30 >> 14 & 0x3ff;
  11200.                                         int i32 = k30 >> 3 & 0x7ff;
  11201.                                         int k32 = (k31 / 8 << 8) + i32 / 8;
  11202.                                         for(int j33 = 0; j33 < l16; j33++) {
  11203.                                             if(ai[j33] != k32)
  11204.                                                 continue;
  11205.                                             k32 = -1;
  11206.                                            
  11207.                                         }
  11208.                                         if(k32 != -1)
  11209.                                             ai[l16++] = k32;
  11210.                                     }
  11211.                                 }
  11212.                             }
  11213.                         }
  11214.                         aByteArrayArray1183 = new byte[l16][];
  11215.                         aByteArrayArray1247 = new byte[l16][];
  11216.                         anIntArray1234 = new int[l16];
  11217.                         anIntArray1235 = new int[l16];
  11218.                         anIntArray1236 = new int[l16];
  11219.                         for(int l26 = 0; l26 < l16; l26++) {
  11220.                             int i29 = anIntArray1234[l26] = ai[l26];
  11221.                             int l30 = i29 >> 8 & 0xff;
  11222.                             int l31 = i29 & 0xff;
  11223.                             int j32 = anIntArray1235[l26] = onDemandFetcher.method562(0, l31, l30);
  11224.                             if(j32 != -1)
  11225.                                 onDemandFetcher.method558(3, j32);
  11226.                             int i33 = anIntArray1236[l26] = onDemandFetcher.method562(1, l31, l30);
  11227.                             if(i33 != -1)
  11228.                                 onDemandFetcher.method558(3, i33);
  11229.                         }
  11230.                     }
  11231.                     int i17 = baseX - anInt1036;
  11232.                     int j21 = baseY - anInt1037;
  11233.                     anInt1036 = baseX;
  11234.                     anInt1037 = baseY;
  11235.                     for(int j24 = 0; j24 < 16384; j24++) {
  11236.                         NPC npc = npcArray[j24];
  11237.                         if(npc != null) {
  11238.                             for(int j29 = 0; j29 < 10; j29++) {
  11239.                                 npc.smallX[j29] -= i17;
  11240.                                 npc.smallY[j29] -= j21;
  11241.                             }
  11242.                             npc.x -= i17 * 128;
  11243.                             npc.y -= j21 * 128;
  11244.                         }
  11245.                     }
  11246.                     for(int i27 = 0; i27 < maxPlayers; i27++) {
  11247.                         Player player = playerArray[i27];
  11248.                         if(player != null) {
  11249.                             for(int i31 = 0; i31 < 10; i31++) {
  11250.                                 player.smallX[i31] -= i17;
  11251.                                 player.smallY[i31] -= j21;
  11252.                             }
  11253.                             player.x -= i17 * 128;
  11254.                             player.y -= j21 * 128;
  11255.                         }
  11256.                     }
  11257.                     aBoolean1080 = true;
  11258.                     byte byte1 = 0;
  11259.                     byte byte2 = 104;
  11260.                     byte byte3 = 1;
  11261.                     if(i17 < 0) {
  11262.                         byte1 = 103;
  11263.                         byte2 = -1;
  11264.                         byte3 = -1;
  11265.                     }
  11266.                     byte byte4 = 0;
  11267.                     byte byte5 = 104;
  11268.                     byte byte6 = 1;
  11269.                     if(j21 < 0) {
  11270.                         byte4 = 103;
  11271.                         byte5 = -1;
  11272.                         byte6 = -1;
  11273.                     }
  11274.                     for(int k33 = byte1; k33 != byte2; k33 += byte3) {
  11275.                         for(int l33 = byte4; l33 != byte5; l33 += byte6) {
  11276.                             int i34 = k33 + i17;
  11277.                             int j34 = l33 + j21;
  11278.                             for(int k34 = 0; k34 < 4; k34++)
  11279.                                 if(i34 >= 0 && j34 >= 0 && i34 < 104 && j34 < 104)
  11280.                                     groundArray[k34][k33][l33] = groundArray[k34][i34][j34];
  11281.                                 else
  11282.                                     groundArray[k34][k33][l33] = null;
  11283.                         }
  11284.                     }
  11285.                     for(Class30_Sub1 class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetFirst(); class30_sub1_1 != null; class30_sub1_1 = (Class30_Sub1)aClass19_1179.reverseGetNext()) {
  11286.                         class30_sub1_1.anInt1297 -= i17;
  11287.                         class30_sub1_1.anInt1298 -= j21;
  11288.                         if(class30_sub1_1.anInt1297 < 0 || class30_sub1_1.anInt1298 < 0 || class30_sub1_1.anInt1297 >= 104 || class30_sub1_1.anInt1298 >= 104)
  11289.                             class30_sub1_1.unlink();
  11290.                     }
  11291.                     if(destX != 0) {
  11292.                         destX -= i17;
  11293.                         destY -= j21;
  11294.                     }
  11295.                     aBoolean1160 = false;
  11296.                     pktType = -1;
  11297.                     return true;
  11298.                    
  11299.                 case 208:
  11300.                     int i3 = inStream.method437();
  11301.                     if(i3 >= 0)
  11302.                         method60(i3);
  11303.                     anInt1018 = i3;
  11304.                     pktType = -1;
  11305.                     return true;
  11306.                    
  11307.                 case 99:
  11308.                     anInt1021 = inStream.readUnsignedByte();
  11309.                     pktType = -1;
  11310.                     return true;
  11311.                    
  11312.                 case 75:
  11313.                     int j3 = inStream.method436();
  11314.                     int j11 = inStream.method436();
  11315.                     RSInterface.interfaceCache[j11].anInt233 = 2;
  11316.                     RSInterface.interfaceCache[j11].mediaID = j3;
  11317.                     pktType = -1;
  11318.                     return true;
  11319.                    
  11320.                 case 114:
  11321.                     anInt1104 = inStream.method434() * 30;
  11322.                     pktType = -1;
  11323.                     return true;
  11324.                    
  11325.                 case 60:
  11326.                     anInt1269 = inStream.readUnsignedByte();
  11327.                     anInt1268 = inStream.method427();
  11328.                     while(inStream.currentOffset < pktSize) {
  11329.                         int k3 = inStream.readUnsignedByte();
  11330.                         method137(inStream, k3);
  11331.                     }
  11332.                     pktType = -1;
  11333.                     return true;
  11334.                    
  11335.                 case 35:
  11336.                     int l3 = inStream.readUnsignedByte();
  11337.                     int k11 = inStream.readUnsignedByte();
  11338.                     int j17 = inStream.readUnsignedByte();
  11339.                     int k21 = inStream.readUnsignedByte();
  11340.                     aBooleanArray876[l3] = true;
  11341.                     anIntArray873[l3] = k11;
  11342.                     anIntArray1203[l3] = j17;
  11343.                     anIntArray928[l3] = k21;
  11344.                     anIntArray1030[l3] = 0;
  11345.                     pktType = -1;
  11346.                     return true;
  11347.                    
  11348.                 case 174:
  11349.                     int i4 = inStream.readUnsignedWord();
  11350.                     int l11 = inStream.readUnsignedByte();
  11351.                     int k17 = inStream.readUnsignedWord();
  11352.                     if(aBoolean848 && !lowMem && anInt1062 < 50) {
  11353.                         anIntArray1207[anInt1062] = i4;
  11354.                         anIntArray1241[anInt1062] = l11;
  11355.                         anIntArray1250[anInt1062] = k17 + Sounds.anIntArray326[i4];
  11356.                         anInt1062++;
  11357.                     }
  11358.                     pktType = -1;
  11359.                     return true;
  11360.                    
  11361.                 case 104:
  11362.                     int j4 = inStream.method427();
  11363.                     int i12 = inStream.method426();
  11364.                     String s6 = inStream.readString();
  11365.                     if(j4 >= 1 && j4 <= 5) {
  11366.                         if(s6.equalsIgnoreCase("null"))
  11367.                             s6 = null;
  11368.                         atPlayerActions[j4 - 1] = s6;
  11369.                         atPlayerArray[j4 - 1] = i12 == 0;
  11370.                     }
  11371.                     pktType = -1;
  11372.                     return true;
  11373.                    
  11374.                 case 78:
  11375.                     destX = 0;
  11376.                     pktType = -1;
  11377.                     return true;
  11378.                    
  11379.                 case 253:
  11380.                     String s = inStream.readString();
  11381.                     if(s.endsWith(":tradereq:")) {
  11382.                         String s3 = s.substring(0, s.indexOf(":"));
  11383.                         long l17 = TextClass.longForName(s3);
  11384.                         boolean flag2 = false;
  11385.                         for(int j27 = 0; j27 < ignoreCount; j27++) {
  11386.                             if(ignoreListAsLongs[j27] != l17)
  11387.                                 continue;
  11388.                             flag2 = true;
  11389.                            
  11390.                         }
  11391.                         if(!flag2 && anInt1251 == 0)
  11392.                             pushMessage("wishes to trade with you.", 4, s3);
  11393.                     } else if (s.endsWith(":clan:")) {
  11394.                         String s4 = s.substring(0, s.indexOf(":"));
  11395.                         long l18 = TextClass.longForName(s4);
  11396.                         pushMessage("Clan: ", 8, s4);  
  11397.                     } else if(s.endsWith("#url#")) {
  11398.                         String link = s.substring(0, s.indexOf("#"));
  11399.                         pushMessage("Join us at: ", 9, link);
  11400.                     } else if(s.endsWith(":duelreq:")) {
  11401.                         String s4 = s.substring(0, s.indexOf(":"));
  11402.                         long l18 = TextClass.longForName(s4);
  11403.                         boolean flag3 = false;
  11404.                         for(int k27 = 0; k27 < ignoreCount; k27++) {
  11405.                             if(ignoreListAsLongs[k27] != l18)
  11406.                                 continue;
  11407.                             flag3 = true;
  11408.                            
  11409.                         }
  11410.                         if(!flag3 && anInt1251 == 0)
  11411.                             pushMessage("wishes to duel with you.", 8, s4);
  11412.                     } else if(s.endsWith(":chalreq:")) {
  11413.                         String s5 = s.substring(0, s.indexOf(":"));
  11414.                         long l19 = TextClass.longForName(s5);
  11415.                         boolean flag4 = false;
  11416.                         for(int l27 = 0; l27 < ignoreCount; l27++) {
  11417.                             if(ignoreListAsLongs[l27] != l19)
  11418.                                 continue;
  11419.                             flag4 = true;
  11420.                            
  11421.                         }
  11422.                         if(!flag4 && anInt1251 == 0) {
  11423.                             String s8 = s.substring(s.indexOf(":") + 1, s.length() - 9);
  11424.                             pushMessage(s8, 8, s5);
  11425.                         }
  11426.                     } else {
  11427.                         pushMessage(s, 0, "");
  11428.                     }
  11429.                     pktType = -1;
  11430.                     return true;
  11431.                    
  11432.                 case 1:
  11433.                     for(int k4 = 0; k4 < playerArray.length; k4++)
  11434.                         if(playerArray[k4] != null)
  11435.                             playerArray[k4].anim = -1;
  11436.                     for(int j12 = 0; j12 < npcArray.length; j12++)
  11437.                         if(npcArray[j12] != null)
  11438.                             npcArray[j12].anim = -1;
  11439.                     pktType = -1;
  11440.                     return true;
  11441.                    
  11442.                 case 50:
  11443.                     long l4 = inStream.readQWord();
  11444.                     int i18 = inStream.readUnsignedByte();
  11445.                     String s7 = TextClass.fixName(TextClass.nameForLong(l4));
  11446.                     for(int k24 = 0; k24 < friendsCount; k24++) {
  11447.                         if(l4 != friendsListAsLongs[k24])
  11448.                             continue;
  11449.                         if(friendsNodeIDs[k24] != i18) {
  11450.                             friendsNodeIDs[k24] = i18;
  11451.                             needDrawTabArea = true;
  11452.                             if(i18 >= 2) {
  11453.                                 pushMessage(s7 + " has logged in.", 5, "");
  11454.                             }
  11455.                             if(i18 <= 1) {
  11456.                                 pushMessage(s7 + " has logged out.", 5, "");
  11457.                             }
  11458.                         }
  11459.                         s7 = null;
  11460.                        
  11461.                     }
  11462.                     if(s7 != null && friendsCount < 200) {
  11463.                         friendsListAsLongs[friendsCount] = l4;
  11464.                         friendsList[friendsCount] = s7;
  11465.                         friendsNodeIDs[friendsCount] = i18;
  11466.                         friendsCount++;
  11467.                         needDrawTabArea = true;
  11468.                     }
  11469.                     for(boolean flag6 = false; !flag6;) {
  11470.                         flag6 = true;
  11471.                         for(int k29 = 0; k29 < friendsCount - 1; k29++)
  11472.                             if(friendsNodeIDs[k29] != nodeID && friendsNodeIDs[k29 + 1] == nodeID || friendsNodeIDs[k29] == 0 && friendsNodeIDs[k29 + 1] != 0) {
  11473.                                 int j31 = friendsNodeIDs[k29];
  11474.                                 friendsNodeIDs[k29] = friendsNodeIDs[k29 + 1];
  11475.                                 friendsNodeIDs[k29 + 1] = j31;
  11476.                                 String s10 = friendsList[k29];
  11477.                                 friendsList[k29] = friendsList[k29 + 1];
  11478.                                 friendsList[k29 + 1] = s10;
  11479.                                 long l32 = friendsListAsLongs[k29];
  11480.                                 friendsListAsLongs[k29] = friendsListAsLongs[k29 + 1];
  11481.                                 friendsListAsLongs[k29 + 1] = l32;
  11482.                                 needDrawTabArea = true;
  11483.                                 flag6 = false;
  11484.                             }
  11485.                     }
  11486.                     pktType = -1;
  11487.                     return true;
  11488.                    
  11489.                 case 110:
  11490.                     if(tabID == 12)
  11491.                         needDrawTabArea = true;
  11492.                     energy = inStream.readUnsignedByte();
  11493.                     pktType = -1;
  11494.                     return true;
  11495.                    
  11496.                 case 254:
  11497.                     anInt855 = inStream.readUnsignedByte();
  11498.                     if(anInt855 == 1)
  11499.                         anInt1222 = inStream.readUnsignedWord();
  11500.                     if(anInt855 >= 2 && anInt855 <= 6) {
  11501.                         if(anInt855 == 2) {
  11502.                             anInt937 = 64;
  11503.                             anInt938 = 64;
  11504.                         }
  11505.                         if(anInt855 == 3) {
  11506.                             anInt937 = 0;
  11507.                             anInt938 = 64;
  11508.                         }
  11509.                         if(anInt855 == 4) {
  11510.                             anInt937 = 128;
  11511.                             anInt938 = 64;
  11512.                         }
  11513.                         if(anInt855 == 5) {
  11514.                             anInt937 = 64;
  11515.                             anInt938 = 0;
  11516.                         }
  11517.                         if(anInt855 == 6) {
  11518.                             anInt937 = 64;
  11519.                             anInt938 = 128;
  11520.                         }
  11521.                         anInt855 = 2;
  11522.                         anInt934 = inStream.readUnsignedWord();
  11523.                         anInt935 = inStream.readUnsignedWord();
  11524.                         anInt936 = inStream.readUnsignedByte();
  11525.                     }
  11526.                     if(anInt855 == 10)
  11527.                         anInt933 = inStream.readUnsignedWord();
  11528.                     pktType = -1;
  11529.                     return true;
  11530.                    
  11531.                 case 248:
  11532.                     int i5 = inStream.method435();
  11533.                     int k12 = inStream.readUnsignedWord();
  11534.                     if(backDialogID != -1) {
  11535.                         backDialogID = -1;
  11536.                         inputTaken = true;
  11537.                     }
  11538.                     if(inputDialogState != 0) {
  11539.                         inputDialogState = 0;
  11540.                         inputTaken = true;
  11541.                     }
  11542.                     openInterfaceID = i5;
  11543.                     invOverlayInterfaceID = k12;
  11544.                     needDrawTabArea = true;
  11545.                     tabAreaAltered = true;
  11546.                     aBoolean1149 = false;
  11547.                     pktType = -1;
  11548.                     return true;
  11549.                    
  11550.                 case 79:
  11551.                     int j5 = inStream.method434();
  11552.                     int l12 = inStream.method435();
  11553.                     RSInterface class9_3 = RSInterface.interfaceCache[j5];
  11554.                     if(class9_3 != null && class9_3.type == 0) {
  11555.                         if(l12 < 0)
  11556.                             l12 = 0;
  11557.                         if(l12 > class9_3.scrollMax - class9_3.height)
  11558.                             l12 = class9_3.scrollMax - class9_3.height;
  11559.                         class9_3.scrollPosition = l12;
  11560.                     }
  11561.                     pktType = -1;
  11562.                     return true;
  11563.                    
  11564.                 case 68:
  11565.                     for(int k5 = 0; k5 < variousSettings.length; k5++)
  11566.                         if(variousSettings[k5] != anIntArray1045[k5]) {
  11567.                             variousSettings[k5] = anIntArray1045[k5];
  11568.                             method33(k5);
  11569.                             needDrawTabArea = true;
  11570.                         }
  11571.                     pktType = -1;
  11572.                     return true;
  11573.                    
  11574.                 case 196:
  11575.                     long l5 = inStream.readQWord();
  11576.                     int j18 = inStream.readDWord();
  11577.                     int l21 = inStream.readUnsignedByte();
  11578.                     boolean flag5 = false;
  11579.                     for(int i28 = 0; i28 < 100; i28++) {
  11580.                         if(anIntArray1240[i28] != j18)
  11581.                             continue;
  11582.                         flag5 = true;
  11583.                        
  11584.                     }
  11585.                     if(l21 <= 1) {
  11586.                         for(int l29 = 0; l29 < ignoreCount; l29++) {
  11587.                             if(ignoreListAsLongs[l29] != l5)
  11588.                                 continue;
  11589.                             flag5 = true;
  11590.                            
  11591.                         }
  11592.                     }
  11593.                     if(!flag5 && anInt1251 == 0)
  11594.                         try {
  11595.                             anIntArray1240[anInt1169] = j18;
  11596.                             anInt1169 = (anInt1169 + 1) % 100;
  11597.                             String s9 = TextInput.method525(pktSize - 13, inStream);
  11598.                             //if(l21 != 3)
  11599.                                 //s9 = Censor.doCensor(s9);
  11600.                             if(l21 == 2 || l21 == 3)
  11601.                                 pushMessage(s9, 7, "@cr2@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11602.                             else
  11603.                             if(l21 == 1)
  11604.                                 pushMessage(s9, 7, "@cr1@" + TextClass.fixName(TextClass.nameForLong(l5)));
  11605.                             else
  11606.                                 pushMessage(s9, 3, TextClass.fixName(TextClass.nameForLong(l5)));
  11607.                         } catch(Exception exception1) {
  11608.                             signlink.reporterror("cde1");
  11609.                         }
  11610.                     pktType = -1;
  11611.                     return true;
  11612.                    
  11613.                 case 85:
  11614.                     anInt1269 = inStream.method427();
  11615.                     anInt1268 = inStream.method427();
  11616.                     pktType = -1;
  11617.                     return true;
  11618.                    
  11619.                 case 24:
  11620.                     anInt1054 = inStream.method428();
  11621.                     if(anInt1054 == tabID) {
  11622.                         if(anInt1054 == 3)
  11623.                             tabID = 1;
  11624.                         else
  11625.                             tabID = 3;
  11626.                         needDrawTabArea = true;
  11627.                     }
  11628.                     pktType = -1;
  11629.                     return true;
  11630.                    
  11631.                 case 246:
  11632.                     int i6 = inStream.method434();
  11633.                     int i13 = inStream.readUnsignedWord();
  11634.                     int k18 = inStream.readUnsignedWord();
  11635.                     if(k18 == 65535) {
  11636.                         RSInterface.interfaceCache[i6].anInt233 = 0;
  11637.                         pktType = -1;
  11638.                         return true;
  11639.                     } else {
  11640.                         ItemDef itemDef = ItemDef.forID(k18);
  11641.                         RSInterface.interfaceCache[i6].anInt233 = 4;
  11642.                         RSInterface.interfaceCache[i6].mediaID = k18;
  11643.                         RSInterface.interfaceCache[i6].modelRotation1 = itemDef.modelRotation1;
  11644.                         RSInterface.interfaceCache[i6].modelRotation2 = itemDef.modelRotation2;
  11645.                         RSInterface.interfaceCache[i6].modelZoom = (itemDef.modelZoom * 100) / i13;
  11646.                         pktType = -1;
  11647.                         return true;
  11648.                     }
  11649.                    
  11650.                 case 171:
  11651.                     boolean flag1 = inStream.readUnsignedByte() == 1;
  11652.                     int j13 = inStream.readUnsignedWord();
  11653.                     RSInterface.interfaceCache[j13].isMouseoverTriggered = flag1;
  11654.                     pktType = -1;
  11655.                     return true;
  11656.                    
  11657.                 case 142:
  11658.                     int j6 = inStream.method434();
  11659.                     method60(j6);
  11660.                     if(backDialogID != -1) {
  11661.                         backDialogID = -1;
  11662.                         inputTaken = true;
  11663.                     }
  11664.                     if(inputDialogState != 0) {
  11665.                         inputDialogState = 0;
  11666.                         inputTaken = true;
  11667.                     }
  11668.                     invOverlayInterfaceID = j6;
  11669.                     needDrawTabArea = true;
  11670.                     tabAreaAltered = true;
  11671.                     openInterfaceID = -1;
  11672.                     aBoolean1149 = false;
  11673.                     pktType = -1;
  11674.                     return true;
  11675.                    
  11676.                 case 126:
  11677.                     String text = inStream.readString();
  11678.                     int frame = inStream.method435();
  11679.                     if (text.startsWith("www.")) {
  11680.                         launchURL(text);
  11681.                         pktType = -1;
  11682.                         return true;
  11683.                     }
  11684.                     updateStrings(text, frame);
  11685.                     sendFrame126(text, frame);
  11686.                     if (frame >= 18144 && frame <= 18244) {
  11687.                         clanList[frame - 18144] = text;
  11688.                     }
  11689.                     pktType = -1;
  11690.                     return true;
  11691.                    
  11692.                 case 206:
  11693.                     publicChatMode = inStream.readUnsignedByte();
  11694.                     privateChatMode = inStream.readUnsignedByte();
  11695.                     tradeMode = inStream.readUnsignedByte();
  11696.                     aBoolean1233 = true;
  11697.                     inputTaken = true;
  11698.                     pktType = -1;
  11699.                     return true;
  11700.                    
  11701.                 case 240:
  11702.                     if(tabID == 12)
  11703.                         needDrawTabArea = true;
  11704.                     weight = inStream.readSignedWord();
  11705.                     pktType = -1;
  11706.                     return true;
  11707.                    
  11708.                 case 8:
  11709.                     int k6 = inStream.method436();
  11710.                     int l13 = inStream.readUnsignedWord();
  11711.                     RSInterface.interfaceCache[k6].anInt233 = 1;
  11712.                     RSInterface.interfaceCache[k6].mediaID = l13;
  11713.                     pktType = -1;
  11714.                     return true;
  11715.                    
  11716.                 case 122:
  11717.                     int l6 = inStream.method436();
  11718.                     int i14 = inStream.method436();
  11719.                     int i19 = i14 >> 10 & 0x1f;
  11720.                     int i22 = i14 >> 5 & 0x1f;
  11721.                     int l24 = i14 & 0x1f;
  11722.                     RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
  11723.                     pktType = -1;
  11724.                     return true;
  11725.                    
  11726.                 case 53:
  11727.                     needDrawTabArea = true;
  11728.                     int i7 = inStream.readUnsignedWord();
  11729.                     RSInterface class9_1 = RSInterface.interfaceCache[i7];
  11730.                     int j19 = inStream.readUnsignedWord();
  11731.                     for(int j22 = 0; j22 < j19; j22++) {
  11732.                         int i25 = inStream.readUnsignedByte();
  11733.                         if(i25 == 255)
  11734.                             i25 = inStream.method440();
  11735.                         class9_1.inv[j22] = inStream.method436();
  11736.                         class9_1.invStackSizes[j22] = i25;
  11737.                     }
  11738.                     for(int j25 = j19; j25 < class9_1.inv.length; j25++) {
  11739.                         class9_1.inv[j25] = 0;
  11740.                         class9_1.invStackSizes[j25] = 0;
  11741.                     }
  11742.                     pktType = -1;
  11743.                     return true;
  11744.                    
  11745.                 case 230:
  11746.                     int j7 = inStream.method435();
  11747.                     int j14 = inStream.readUnsignedWord();
  11748.                     int k19 = inStream.readUnsignedWord();
  11749.                     int k22 = inStream.method436();
  11750.                     RSInterface.interfaceCache[j14].modelRotation1 = k19;
  11751.                     RSInterface.interfaceCache[j14].modelRotation2 = k22;
  11752.                     RSInterface.interfaceCache[j14].modelZoom = j7;
  11753.                     pktType = -1;
  11754.                     return true;
  11755.                    
  11756.                 case 221:
  11757.                     anInt900 = inStream.readUnsignedByte();
  11758.                     needDrawTabArea = true;
  11759.                     pktType = -1;
  11760.                     return true;
  11761.                    
  11762.                 case 177:
  11763.                     aBoolean1160 = true;
  11764.                     anInt995 = inStream.readUnsignedByte();
  11765.                     anInt996 = inStream.readUnsignedByte();
  11766.                     anInt997 = inStream.readUnsignedWord();
  11767.                     anInt998 = inStream.readUnsignedByte();
  11768.                     anInt999 = inStream.readUnsignedByte();
  11769.                     if(anInt999 >= 100) {
  11770.                         int k7 = anInt995 * 128 + 64;
  11771.                         int k14 = anInt996 * 128 + 64;
  11772.                         int i20 = method42(plane, k14, k7) - anInt997;
  11773.                         int l22 = k7 - xCameraPos;
  11774.                         int k25 = i20 - zCameraPos;
  11775.                         int j28 = k14 - yCameraPos;
  11776.                         int i30 = (int)Math.sqrt(l22 * l22 + j28 * j28);
  11777.                         yCameraCurve = (int)(Math.atan2(k25, i30) * 325.94900000000001D) & 0x7ff;
  11778.                         xCameraCurve = (int)(Math.atan2(l22, j28) * -325.94900000000001D) & 0x7ff;
  11779.                         if(yCameraCurve < 128)
  11780.                             yCameraCurve = 128;
  11781.                         if(yCameraCurve > 383)
  11782.                             yCameraCurve = 383;
  11783.                     }
  11784.                     pktType = -1;
  11785.                     return true;
  11786.                    
  11787.                 case 249:
  11788.                     anInt1046 = inStream.method426();
  11789.                     unknownInt10 = inStream.method436();
  11790.                     pktType = -1;
  11791.                     return true;
  11792.                    
  11793.                 case 65:
  11794.                     updateNPCs(inStream, pktSize);
  11795.                     pktType = -1;
  11796.                     return true;
  11797.                    
  11798.                 case 27:
  11799.                     messagePromptRaised = false;
  11800.                     inputDialogState = 1;
  11801.                     amountOrNameInput = "";
  11802.                     inputTaken = true;
  11803.                     pktType = -1;
  11804.                     return true;
  11805.                    
  11806.                 case 187:
  11807.                     messagePromptRaised = false;
  11808.                     inputDialogState = 2;
  11809.                     amountOrNameInput = "";
  11810.                     inputTaken = true;
  11811.                     pktType = -1;
  11812.                     return true;
  11813.                    
  11814.                 case 97:
  11815.                     int l7 = inStream.readUnsignedWord();
  11816.                     method60(l7);
  11817.                     if(invOverlayInterfaceID != -1) {
  11818.                         invOverlayInterfaceID = -1;
  11819.                         needDrawTabArea = true;
  11820.                         tabAreaAltered = true;
  11821.                     }
  11822.                     if(backDialogID != -1) {
  11823.                         backDialogID = -1;
  11824.                         inputTaken = true;
  11825.                     }
  11826.                     if(inputDialogState != 0) {
  11827.                         inputDialogState = 0;
  11828.                         inputTaken = true;
  11829.                     }
  11830.                     openInterfaceID = l7;
  11831.                     aBoolean1149 = false;
  11832.                     pktType = -1;
  11833.                     return true;
  11834.                    
  11835.                 case 218:
  11836.                     int i8 = inStream.method438();
  11837.                     dialogID = i8;
  11838.                     inputTaken = true;
  11839.                     pktType = -1;
  11840.                     return true;
  11841.                    
  11842.                 case 87:
  11843.                     int j8 = inStream.method434();
  11844.                     int l14 = inStream.method439();
  11845.                     anIntArray1045[j8] = l14;
  11846.                     if(variousSettings[j8] != l14) {
  11847.                         variousSettings[j8] = l14;
  11848.                         method33(j8);
  11849.                         needDrawTabArea = true;
  11850.                         if(dialogID != -1)
  11851.                             inputTaken = true;
  11852.                     }
  11853.                     pktType = -1;
  11854.                     return true;
  11855.                    
  11856.                 case 36:
  11857.                     int k8 = inStream.method434();
  11858.                     byte byte0 = inStream.readSignedByte();
  11859.                     anIntArray1045[k8] = byte0;
  11860.                     if(variousSettings[k8] != byte0) {
  11861.                         variousSettings[k8] = byte0;
  11862.                         method33(k8);
  11863.                         needDrawTabArea = true;
  11864.                         if(dialogID != -1)
  11865.                             inputTaken = true;
  11866.                     }
  11867.                     pktType = -1;
  11868.                     return true;
  11869.                    
  11870.                 case 61:
  11871.                     anInt1055 = inStream.readUnsignedByte();
  11872.                     pktType = -1;
  11873.                     return true;
  11874.                    
  11875.                 case 200:
  11876.                     int l8 = inStream.readUnsignedWord();
  11877.                     int i15 = inStream.readSignedWord();
  11878.                     RSInterface class9_4 = RSInterface.interfaceCache[l8];
  11879.                     class9_4.anInt257 = i15;
  11880.                     if(i15 == -1) {
  11881.                         class9_4.anInt246 = 0;
  11882.                         class9_4.anInt208 = 0;
  11883.                     }
  11884.                     pktType = -1;
  11885.                     return true;
  11886.                    
  11887.                 case 219:
  11888.                     if(invOverlayInterfaceID != -1) {
  11889.                         invOverlayInterfaceID = -1;
  11890.                         needDrawTabArea = true;
  11891.                         tabAreaAltered = true;
  11892.                     }
  11893.                     if(backDialogID != -1) {
  11894.                         backDialogID = -1;
  11895.                         inputTaken = true;
  11896.                     }
  11897.                     if(inputDialogState != 0) {
  11898.                         inputDialogState = 0;
  11899.                         inputTaken = true;
  11900.                     }
  11901.                     openInterfaceID = -1;
  11902.                     aBoolean1149 = false;
  11903.                     pktType = -1;
  11904.                     return true;
  11905.                    
  11906.                 case 34:
  11907.                     needDrawTabArea = true;
  11908.                     int i9 = inStream.readUnsignedWord();
  11909.                     RSInterface class9_2 = RSInterface.interfaceCache[i9];
  11910.                     while(inStream.currentOffset < pktSize) {
  11911.                         int j20 = inStream.method422();
  11912.                         int i23 = inStream.readUnsignedWord();
  11913.                         int l25 = inStream.readUnsignedByte();
  11914.                         if(l25 == 255)
  11915.                             l25 = inStream.readDWord();
  11916.                         if(j20 >= 0 && j20 < class9_2.inv.length) {
  11917.                             class9_2.inv[j20] = i23;
  11918.                             class9_2.invStackSizes[j20] = l25;
  11919.                         }
  11920.                     }
  11921.                     pktType = -1;
  11922.                     return true;
  11923.                    
  11924.                 case 4:
  11925.                 case 44:
  11926.                 case 84:
  11927.                 case 101:
  11928.                 case 105:
  11929.                 case 117:
  11930.                 case 147:
  11931.                 case 151:
  11932.                 case 156:
  11933.                 case 160:
  11934.                 case 215:
  11935.                     method137(inStream, pktType);
  11936.                     pktType = -1;
  11937.                     return true;
  11938.                    
  11939.                 case 106:
  11940.                     tabID = inStream.method427();
  11941.                     needDrawTabArea = true;
  11942.                     tabAreaAltered = true;
  11943.                     pktType = -1;
  11944.                     return true;
  11945.                    
  11946.                 case 164:
  11947.                     int j9 = inStream.method434();
  11948.                     method60(j9);
  11949.                     if(invOverlayInterfaceID != -1) {
  11950.                         invOverlayInterfaceID = -1;
  11951.                         needDrawTabArea = true;
  11952.                         tabAreaAltered = true;
  11953.                     }
  11954.                     backDialogID = j9;
  11955.                     inputTaken = true;
  11956.                     openInterfaceID = -1;
  11957.                     aBoolean1149 = false;
  11958.                     pktType = -1;
  11959.                     return true;
  11960.                    
  11961.             }
  11962.             signlink.reporterror("T1 - " + pktType + "," + pktSize + " - " + anInt842 + "," + anInt843);
  11963.             //resetLogout();
  11964.         } catch(IOException _ex) {
  11965.             dropClient();
  11966.         } catch(Exception exception) {
  11967.             String s2 = "T2 - " + pktType + "," + anInt842 + "," + anInt843 + " - " + pktSize + "," + (baseX + myPlayer.smallX[0]) + "," + (baseY + myPlayer.smallY[0]) + " - ";
  11968.             for(int j15 = 0; j15 < pktSize && j15 < 50; j15++)
  11969.                 s2 = s2 + inStream.buffer[j15] + ",";
  11970.             signlink.reporterror(s2);
  11971.             //resetLogout();
  11972.         }
  11973.         pktType = -1;
  11974.         return true;
  11975.     }
  11976.  
  11977.     private void method146() {
  11978.         anInt1265++;
  11979.         method47(true);
  11980.         method26(true);
  11981.         method47(false);
  11982.         method26(false);
  11983.         method55();
  11984.         method104();
  11985.         if(!aBoolean1160) {
  11986.             int i = anInt1184;
  11987.             if(anInt984 / 256 > i)
  11988.                 i = anInt984 / 256;
  11989.             if(aBooleanArray876[4] && anIntArray1203[4] + 128 > i)
  11990.                 i = anIntArray1203[4] + 128;
  11991.             int k = minimapInt1 + anInt896 & 0x7ff;
  11992.             setCameraPos(600 + i * 3, i, anInt1014, method42(plane, myPlayer.y, myPlayer.x) - 50, k, anInt1015);
  11993.         }
  11994.         int j;
  11995.         if(!aBoolean1160)
  11996.             j = method120();
  11997.         else
  11998.             j = method121();
  11999.         int l = xCameraPos;
  12000.         int i1 = zCameraPos;
  12001.         int j1 = yCameraPos;
  12002.         int k1 = yCameraCurve;
  12003.         int l1 = xCameraCurve;
  12004.         for(int i2 = 0; i2 < 5; i2++)
  12005.             if(aBooleanArray876[i2]) {
  12006.                 int j2 = (int)((Math.random() * (double)(anIntArray873[i2] * 2 + 1) - (double)anIntArray873[i2]) + Math.sin((double)anIntArray1030[i2] * ((double)anIntArray928[i2] / 100D)) * (double)anIntArray1203[i2]);
  12007.                 if(i2 == 0)
  12008.                     xCameraPos += j2;
  12009.                 if(i2 == 1)
  12010.                     zCameraPos += j2;
  12011.                 if(i2 == 2)
  12012.                     yCameraPos += j2;
  12013.                 if(i2 == 3)
  12014.                     xCameraCurve = xCameraCurve + j2 & 0x7ff;
  12015.                 if(i2 == 4) {
  12016.                     yCameraCurve += j2;
  12017.                     if(yCameraCurve < 128)
  12018.                         yCameraCurve = 128;
  12019.                     if(yCameraCurve > 383)
  12020.                         yCameraCurve = 383;
  12021.                 }
  12022.             }
  12023.         int k2 = Texture.anInt1481;
  12024.         Model.aBoolean1684 = true;
  12025.         Model.anInt1687 = 0;
  12026.         Model.anInt1685 = super.mouseX - 4;
  12027.         Model.anInt1686 = super.mouseY - 4;
  12028.         DrawingArea.setAllPixelsToZero();
  12029.         worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
  12030.         worldController.clearObj5Cache();
  12031.         updateEntities();
  12032.         drawHeadIcon();
  12033.         method37(k2);
  12034.         draw3dScreen();
  12035.         aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
  12036.         xCameraPos = l;
  12037.         zCameraPos = i1;
  12038.         yCameraPos = j1;
  12039.         yCameraCurve = k1;
  12040.         xCameraCurve = l1;
  12041.     }
  12042.  
  12043.     public void clearTopInterfaces() {
  12044.         stream.createFrame(130);
  12045.         if (invOverlayInterfaceID != -1) {
  12046.             invOverlayInterfaceID = -1;
  12047.             needDrawTabArea = true;
  12048.             aBoolean1149 = false;
  12049.             tabAreaAltered = true;
  12050.         }
  12051.         if (backDialogID != -1) {
  12052.             backDialogID = -1;
  12053.             inputTaken = true;
  12054.             aBoolean1149 = false;
  12055.         }
  12056.         openInterfaceID = -1;
  12057.         fullscreenInterfaceID = -1;
  12058.     }
  12059.  
  12060.     public client() {
  12061.         fullscreenInterfaceID = -1;
  12062.         chatRights = new int[500];
  12063.         chatTypeView = 0;
  12064.         clanChatMode = 0;
  12065.         cButtonHPos = -1;
  12066.         cButtonHCPos = -1;
  12067.         cButtonCPos = 0;
  12068.         server = "127.0.0.1";
  12069.         anIntArrayArray825 = new int[104][104];
  12070.         friendsNodeIDs = new int[200];
  12071.         groundArray = new NodeList[4][104][104];
  12072.         aBoolean831 = false;
  12073.         aStream_834 = new Stream(new byte[5000]);
  12074.         npcArray = new NPC[16384];
  12075.         npcIndices = new int[16384];
  12076.         anIntArray840 = new int[1000];
  12077.         aStream_847 = Stream.create();
  12078.         aBoolean848 = true;
  12079.         openInterfaceID = -1;
  12080.         currentExp = new int[Skills.skillsCount];
  12081.         aBoolean872 = false;
  12082.         anIntArray873 = new int[5];
  12083.         anInt874 = -1;
  12084.         aBooleanArray876 = new boolean[5];
  12085.         drawFlames = false;
  12086.         reportAbuseInput = "";
  12087.         unknownInt10 = -1;
  12088.         menuOpen = false;
  12089.         inputString = "";
  12090.         maxPlayers = 2048;
  12091.         myPlayerIndex = 2047;
  12092.         playerArray = new Player[maxPlayers];
  12093.         playerIndices = new int[maxPlayers];
  12094.         anIntArray894 = new int[maxPlayers];
  12095.         aStreamArray895s = new Stream[maxPlayers];
  12096.         anInt897 = 1;
  12097.         anIntArrayArray901 = new int[104][104];
  12098.         anInt902 = 0x766654;
  12099.         aByteArray912 = new byte[16384];
  12100.         currentStats = new int[Skills.skillsCount];
  12101.         ignoreListAsLongs = new long[100];
  12102.         loadingError = false;
  12103.         anInt927 = 0x332d25;
  12104.         anIntArray928 = new int[5];
  12105.         anIntArrayArray929 = new int[104][104];
  12106.         chatTypes = new int[500];
  12107.         chatNames = new String[500];
  12108.         chatMessages = new String[500];
  12109.         chatButtons = new Sprite[4];
  12110.         sideIcons = new Sprite[15];
  12111.         redStones = new Sprite[5];
  12112.         aBoolean954 = true;
  12113.         friendsListAsLongs = new long[200];
  12114.         currentSong = -1;
  12115.         drawingFlames = false;
  12116.         spriteDrawX = -1;
  12117.         spriteDrawY = -1;
  12118.         anIntArray968 = new int[33];
  12119.         anIntArray969 = new int[256];
  12120.         decompressors = new Decompressor[5];
  12121.         variousSettings = new int[2000];
  12122.         aBoolean972 = false;
  12123.         anInt975 = 50;
  12124.         anIntArray976 = new int[anInt975];
  12125.         anIntArray977 = new int[anInt975];
  12126.         anIntArray978 = new int[anInt975];
  12127.         anIntArray979 = new int[anInt975];
  12128.         anIntArray980 = new int[anInt975];
  12129.         anIntArray981 = new int[anInt975];
  12130.         anIntArray982 = new int[anInt975];
  12131.         aStringArray983 = new String[anInt975];
  12132.         anInt985 = -1;
  12133.         hitMarks = new Sprite[20];
  12134.         anIntArray990 = new int[5];
  12135.         aBoolean994 = false;
  12136.         anInt1002 = 0x23201b;
  12137.         amountOrNameInput = "";
  12138.         aClass19_1013 = new NodeList();
  12139.         aBoolean1017 = false;
  12140.         anInt1018 = -1;
  12141.         anIntArray1030 = new int[5];
  12142.         aBoolean1031 = false;
  12143.         mapFunctions = new Sprite[100];
  12144.         dialogID = -1;
  12145.         maxStats = new int[Skills.skillsCount];
  12146.         anIntArray1045 = new int[2000];
  12147.         aBoolean1047 = true;
  12148.         anIntArray1052 = new int[151];
  12149.         anInt1054 = -1;
  12150.         aClass19_1056 = new NodeList();
  12151.         anIntArray1057 = new int[33];
  12152.         aClass9_1059 = new RSInterface();
  12153.         mapScenes = new Background[100];
  12154.         barFillColor = 0x4d4233;
  12155.         anIntArray1065 = new int[7];
  12156.         anIntArray1072 = new int[1000];
  12157.         anIntArray1073 = new int[1000];
  12158.         aBoolean1080 = false;
  12159.         friendsList = new String[200];
  12160.         inStream = Stream.create();
  12161.         expectedCRCs = new int[9];
  12162.         menuActionCmd2 = new int[500];
  12163.         menuActionCmd3 = new int[500];
  12164.         menuActionID = new int[500];
  12165.         menuActionCmd1 = new int[500];
  12166.         headIcons = new Sprite[20];
  12167.         skullIcons = new Sprite[20];
  12168.         headIconsHint = new Sprite[20];
  12169.         tabAreaAltered = false;
  12170.         aString1121 = "";
  12171.         atPlayerActions = new String[5];
  12172.         atPlayerArray = new boolean[5];
  12173.         anIntArrayArrayArray1129 = new int[4][13][13];
  12174.         anInt1132 = 2;
  12175.         aClass30_Sub2_Sub1_Sub1Array1140 = new Sprite[1000];
  12176.         aBoolean1141 = false;
  12177.         aBoolean1149 = false;
  12178.         crosses = new Sprite[8];
  12179.         musicEnabled = true;
  12180.         needDrawTabArea = false;
  12181.         loggedIn = false;
  12182.         canMute = false;
  12183.         aBoolean1159 = false;
  12184.         aBoolean1160 = false;
  12185.         anInt1171 = 1;
  12186.         myUsername = "";
  12187.         myPassword = "";
  12188.         genericLoadingError = false;
  12189.         reportAbuseInterfaceID = -1;
  12190.         aClass19_1179 = new NodeList();
  12191.         anInt1184 = 128;
  12192.         invOverlayInterfaceID = -1;
  12193.         stream = Stream.create();
  12194.         menuActionName = new String[500];
  12195.         anIntArray1203 = new int[5];
  12196.         anIntArray1207 = new int[50];
  12197.         anInt1210 = 2;
  12198.         anInt1211 = 78;
  12199.         promptInput = "";
  12200.         modIcons = new Background[2];
  12201.         tabID = 3;
  12202.         inputTaken = false;
  12203.         songChanging = true;
  12204.         anIntArray1229 = new int[151];
  12205.         aClass11Array1230 = new Class11[4];
  12206.         aBoolean1233 = false;
  12207.         anIntArray1240 = new int[100];
  12208.         anIntArray1241 = new int[50];
  12209.         aBoolean1242 = false;
  12210.         anIntArray1250 = new int[50];
  12211.         rsAlreadyLoaded = false;
  12212.         welcomeScreenRaised = false;
  12213.         messagePromptRaised = false;
  12214.         loginMessage1 = "";
  12215.         loginMessage2 = "";
  12216.         backDialogID = -1;
  12217.         anInt1279 = 2;
  12218.         bigX = new int[4000];
  12219.         bigY = new int[4000];
  12220.         anInt1289 = -1;
  12221.     }
  12222.  
  12223.     public int rights;
  12224.     public String name;
  12225.     public String message;
  12226.     public String clanname;
  12227.     private final int[] chatRights;
  12228.     public int chatTypeView;
  12229.     public int clanChatMode;
  12230.     public int duelMode;
  12231.     /* Declare custom sprites */
  12232.     private Sprite chatArea;
  12233.     private Sprite loadingBarFull;
  12234.     private Sprite loadingBarEmpty;
  12235.     private Sprite[] chatButtons;
  12236.     private Sprite tabArea;
  12237.     private Sprite mapArea;
  12238.     /**/
  12239.     private RSImageProducer leftFrame;
  12240.     private RSImageProducer topFrame;
  12241.     private RSImageProducer rightFrame;
  12242.     private int ignoreCount;
  12243.     private long aLong824;
  12244.     private int[][] anIntArrayArray825;
  12245.     private int[] friendsNodeIDs;
  12246.     private NodeList[][][] groundArray;
  12247.     private int[] anIntArray828;
  12248.     private int[] anIntArray829;
  12249.     private volatile boolean aBoolean831;
  12250.     private Socket aSocket832;
  12251.     private int loginScreenState;
  12252.     private Stream aStream_834;
  12253.     private NPC[] npcArray;
  12254.     private int npcCount;
  12255.     private int[] npcIndices;
  12256.     private int anInt839;
  12257.     private int[] anIntArray840;
  12258.     private int anInt841;
  12259.     private int anInt842;
  12260.     private int anInt843;
  12261.     private String aString844;
  12262.     private int privateChatMode;
  12263.     private Stream aStream_847;
  12264.     private boolean aBoolean848;
  12265.     private static int anInt849;
  12266.     private int[] anIntArray850;
  12267.     private int[] anIntArray851;
  12268.     private int[] anIntArray852;
  12269.     private int[] anIntArray853;
  12270.     private static int anInt854;
  12271.     private int anInt855;
  12272.     private int openInterfaceID;
  12273.     private int xCameraPos;
  12274.     private int zCameraPos;
  12275.     private int yCameraPos;
  12276.     private int yCameraCurve;
  12277.     private int xCameraCurve;
  12278.     private int myPrivilege;
  12279.     private final int[] currentExp;
  12280.     private Sprite[] redStones;
  12281.     private Sprite mapFlag;
  12282.     private Sprite mapMarker;
  12283.     private boolean aBoolean872;
  12284.     private final int[] anIntArray873;
  12285.     private int anInt874;
  12286.     private final boolean[] aBooleanArray876;
  12287.     private int weight;
  12288.     private MouseDetection mouseDetection;
  12289.     private volatile boolean drawFlames;
  12290.     private String reportAbuseInput;
  12291.     private int unknownInt10;
  12292.     private boolean menuOpen;
  12293.     private int anInt886;
  12294.     private String inputString;
  12295.     private final int maxPlayers;
  12296.     private final int myPlayerIndex;
  12297.     private Player[] playerArray;
  12298.     private int playerCount;
  12299.     private int[] playerIndices;
  12300.     private int anInt893;
  12301.     private int[] anIntArray894;
  12302.     private Stream[] aStreamArray895s;
  12303.     private int anInt896;
  12304.     private int anInt897;
  12305.     private int friendsCount;
  12306.     private int anInt900;
  12307.     private int[][] anIntArrayArray901;
  12308.     private final int anInt902;
  12309.     private byte[] aByteArray912;
  12310.     private int anInt913;
  12311.     private int crossX;
  12312.     private int crossY;
  12313.     private int crossIndex;
  12314.     private int crossType;
  12315.     private int plane;
  12316.     private final int[] currentStats;
  12317.     private static int anInt924;
  12318.     private final long[] ignoreListAsLongs;
  12319.     private boolean loadingError;
  12320.     private final int anInt927;
  12321.     private final int[] anIntArray928;
  12322.     private int[][] anIntArrayArray929;
  12323.     private Sprite aClass30_Sub2_Sub1_Sub1_931;
  12324.     private Sprite aClass30_Sub2_Sub1_Sub1_932;
  12325.     private int anInt933;
  12326.     private int anInt934;
  12327.     private int anInt935;
  12328.     private int anInt936;
  12329.     private int anInt937;
  12330.     private int anInt938;
  12331.     private static int anInt940;
  12332.     private final int[] chatTypes;
  12333.     private final String[] chatNames;
  12334.     private final String[] chatMessages;
  12335.     private int anInt945;
  12336.     private WorldController worldController;
  12337.     private Sprite[] sideIcons;
  12338.     private int menuScreenArea;
  12339.     private int menuOffsetX;
  12340.     private int menuOffsetY;
  12341.     private int menuWidth;
  12342.     private int menuHeight;
  12343.     private long aLong953;
  12344.     private boolean aBoolean954;
  12345.     private long[] friendsListAsLongs;
  12346.     private String[] clanList = new String[100];
  12347.     private int currentSong;
  12348.     private static int nodeID = 10;
  12349.     static int portOff;
  12350.     static boolean clientData;
  12351.     private static boolean isMembers = true;
  12352.     private static boolean lowMem;
  12353.     private volatile boolean drawingFlames;
  12354.     private int spriteDrawX;
  12355.     private int spriteDrawY;
  12356.     private final int[] anIntArray965 = {
  12357.         0xffff00, 0xff0000, 65280, 65535, 0xff00ff, 0xffffff
  12358.     };
  12359.     private Background aBackground_966;
  12360.     private Background aBackground_967;
  12361.     private final int[] anIntArray968;
  12362.     private final int[] anIntArray969;
  12363.     final Decompressor[] decompressors;
  12364.     public int variousSettings[];
  12365.     private boolean aBoolean972;
  12366.     private final int anInt975;
  12367.     private final int[] anIntArray976;
  12368.     private final int[] anIntArray977;
  12369.     private final int[] anIntArray978;
  12370.     private final int[] anIntArray979;
  12371.     private final int[] anIntArray980;
  12372.     private final int[] anIntArray981;
  12373.     private final int[] anIntArray982;
  12374.     private final String[] aStringArray983;
  12375.     private int anInt984;
  12376.     private int anInt985;
  12377.     private static int anInt986;
  12378.     private Sprite[] hitMarks;
  12379.     private int anInt988;
  12380.     private int anInt989;
  12381.     private final int[] anIntArray990;
  12382.     private static boolean aBoolean993;
  12383.     private final boolean aBoolean994;
  12384.     private int anInt995;
  12385.     private int anInt996;
  12386.     private int anInt997;
  12387.     private int anInt998;
  12388.     private int anInt999;
  12389.     private ISAACRandomGen encryption;
  12390.     private Sprite mapEdge;
  12391.     private Sprite multiOverlay;
  12392.     private final int anInt1002;
  12393.     static final int[][] anIntArrayArray1003 = {
  12394.         {
  12395.             6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433,
  12396.             2983, 54193
  12397.         }, {
  12398.             8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153,
  12399.             56621, 4783, 1341, 16578, 35003, 25239
  12400.         }, {
  12401.             25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094,
  12402.             10153, 56621, 4783, 1341, 16578, 35003
  12403.         }, {
  12404.             4626, 11146, 6439, 12, 4758, 10270
  12405.         }, {
  12406.             4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574
  12407.         }
  12408.     };
  12409.     private String amountOrNameInput;
  12410.     private static int anInt1005;
  12411.     private int daysSinceLastLogin;
  12412.     private int pktSize;
  12413.     private int pktType;
  12414.     private int anInt1009;
  12415.     private int anInt1010;
  12416.     private int anInt1011;
  12417.     private NodeList aClass19_1013;
  12418.     private int anInt1014;
  12419.     private int anInt1015;
  12420.     private int anInt1016;
  12421.     private boolean aBoolean1017;
  12422.     private int anInt1018;
  12423.     private static final int[] anIntArray1019;
  12424.     private int anInt1021;
  12425.     private int anInt1022;
  12426.     private int loadingStage;
  12427.     private Sprite scrollBar1;
  12428.     private Sprite scrollBar2;
  12429.     private int anInt1026;
  12430.     private Background backBase1;
  12431.     private Background backBase2;
  12432.     private Background backHmid1;
  12433.     private final int[] anIntArray1030;
  12434.     private boolean aBoolean1031;
  12435.     private Sprite[] mapFunctions;
  12436.     private int baseX;
  12437.     private int baseY;
  12438.     private int anInt1036;
  12439.     private int anInt1037;
  12440.     private int loginFailures;
  12441.     private int anInt1039;
  12442.     private int anInt1040;
  12443.     private int anInt1041;
  12444.     private int dialogID;
  12445.     private final int[] maxStats;
  12446.     private final int[] anIntArray1045;
  12447.     private int anInt1046;
  12448.     private boolean aBoolean1047;
  12449.     private int anInt1048;
  12450.     private String aString1049;
  12451.     private static int anInt1051;
  12452.     private final int[] anIntArray1052;
  12453.     private StreamLoader titleStreamLoader;
  12454.     private int anInt1054;
  12455.     private int anInt1055;
  12456.     private NodeList aClass19_1056;
  12457.     private final int[] anIntArray1057;
  12458.     public final RSInterface aClass9_1059;
  12459.     private Background[] mapScenes;
  12460.     private static int anInt1061;
  12461.     private int anInt1062;
  12462.     private final int barFillColor;
  12463.     private int friendsListAction;
  12464.     private final int[] anIntArray1065;
  12465.     private int mouseInvInterfaceIndex;
  12466.     private int lastActiveInvInterface;
  12467.     private OnDemandFetcher onDemandFetcher;
  12468.     private int anInt1069;
  12469.     private int anInt1070;
  12470.     private int anInt1071;
  12471.     private int[] anIntArray1072;
  12472.     private int[] anIntArray1073;
  12473.     private Sprite mapDotItem;
  12474.     private Sprite mapDotNPC;
  12475.     private Sprite mapDotPlayer;
  12476.     private Sprite mapDotFriend;
  12477.     private Sprite mapDotTeam;
  12478.     private Sprite mapDotClan;
  12479.     private int anInt1079;
  12480.     private boolean aBoolean1080;
  12481.     private String[] friendsList;
  12482.     private Stream inStream;
  12483.     private int anInt1084;
  12484.     private int anInt1085;
  12485.     private int activeInterfaceType;
  12486.     private int anInt1087;
  12487.     private int anInt1088;
  12488.     public static int anInt1089;
  12489.     private final int[] expectedCRCs;
  12490.     private int[] menuActionCmd2;
  12491.     private int[] menuActionCmd3;
  12492.     private int[] menuActionID;
  12493.     private int[] menuActionCmd1;
  12494.     private Sprite[] headIcons;
  12495.     private Sprite[] skullIcons;
  12496.     private Sprite[] headIconsHint;
  12497.     private static int anInt1097;
  12498.     private int anInt1098;
  12499.     private int anInt1099;
  12500.     private int anInt1100;
  12501.     private int anInt1101;
  12502.     private int anInt1102;
  12503.     private static boolean tabAreaAltered;
  12504.     private int anInt1104;
  12505.     private RSImageProducer aRSImageProducer_1107;
  12506.     private RSImageProducer aRSImageProducer_1108;
  12507.     private RSImageProducer aRSImageProducer_1109;
  12508.     private RSImageProducer aRSImageProducer_1110;
  12509.     private RSImageProducer aRSImageProducer_1111;
  12510.     private RSImageProducer aRSImageProducer_1112;
  12511.     private RSImageProducer aRSImageProducer_1113;
  12512.     private RSImageProducer aRSImageProducer_1114;
  12513.     private RSImageProducer aRSImageProducer_1115;
  12514.     private static int anInt1117;
  12515.     private int membersInt;
  12516.     private String aString1121;
  12517.     private Sprite compass;
  12518.     private RSImageProducer aRSImageProducer_1123;
  12519.     private RSImageProducer aRSImageProducer_1124;
  12520.     private RSImageProducer aRSImageProducer_1125;
  12521.     public static Player myPlayer;
  12522.     private final String[] atPlayerActions;
  12523.     private final boolean[] atPlayerArray;
  12524.     private final int[][][] anIntArrayArrayArray1129;
  12525.     private final int[] tabInterfaceIDs = {
  12526.         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  12527.         -1, -1, -1, -1, -1
  12528.     };
  12529.     private int anInt1131;
  12530.     private int anInt1132;
  12531.     private int menuActionRow;
  12532.     private static int anInt1134;
  12533.     private int spellSelected;
  12534.     private int anInt1137;
  12535.     private int spellUsableOn;
  12536.     private String spellTooltip;
  12537.     private Sprite[] aClass30_Sub2_Sub1_Sub1Array1140;
  12538.     private boolean aBoolean1141;
  12539.     private static int anInt1142;
  12540.     private int energy;
  12541.     private boolean aBoolean1149;
  12542.     private Sprite[] crosses;
  12543.     private boolean musicEnabled;
  12544.     private Background[] aBackgroundArray1152s;
  12545.     private static boolean needDrawTabArea;
  12546.     private int unreadMessages;
  12547.     private static int anInt1155;
  12548.     private static boolean fpsOn;
  12549.     public boolean loggedIn;
  12550.     private boolean canMute;
  12551.     private boolean aBoolean1159;
  12552.     private boolean aBoolean1160;
  12553.     static int loopCycle;
  12554.     private static final String validUserPassChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!\"\243$%^&*()-_=+[{]};:'@#~,<.>/?\\| ";
  12555.     private RSImageProducer aRSImageProducer_1163;
  12556.     private RSImageProducer mapEdgeIP;
  12557.     private RSImageProducer aRSImageProducer_1164;
  12558.     private RSImageProducer aRSImageProducer_1165;
  12559.     private RSImageProducer aRSImageProducer_1166;
  12560.     private int daysSinceRecovChange;
  12561.     private RSSocket socketStream;
  12562.     private int anInt1169;
  12563.     private int minimapInt3;
  12564.     private int anInt1171;
  12565.     private long aLong1172;
  12566.     private String myUsername;
  12567.     private String myPassword;
  12568.     private static int anInt1175;
  12569.     private boolean genericLoadingError;
  12570.     private final int[] anIntArray1177 = {
  12571.         0, 0, 0, 0, 1, 1, 1, 1, 1, 2,
  12572.         2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  12573.         2, 2, 3
  12574.     };
  12575.     private int reportAbuseInterfaceID;
  12576.     private NodeList aClass19_1179;
  12577.     private int[] anIntArray1180;
  12578.     private int[] anIntArray1181;
  12579.     private int[] anIntArray1182;
  12580.     private byte[][] aByteArrayArray1183;
  12581.     private int anInt1184;
  12582.     private int minimapInt1;
  12583.     private int anInt1186;
  12584.     private int anInt1187;
  12585.     private static int anInt1188;
  12586.     private int invOverlayInterfaceID;
  12587.     private int[] anIntArray1190;
  12588.     private int[] anIntArray1191;
  12589.     private Stream stream;
  12590.     private int anInt1193;
  12591.     private int splitPrivateChat;
  12592.     private Background mapBack;
  12593.     private String[] menuActionName;
  12594.     private Sprite aClass30_Sub2_Sub1_Sub1_1201;
  12595.     private Sprite aClass30_Sub2_Sub1_Sub1_1202;
  12596.     private final int[] anIntArray1203;
  12597.     static final int[] anIntArray1204 = {
  12598.         9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145,
  12599.         58654, 5027, 1457, 16565, 34991, 25486
  12600.     };
  12601.     private static boolean flagged;
  12602.     private final int[] anIntArray1207;
  12603.     private int anInt1208;
  12604.     private int minimapInt2;
  12605.     private int anInt1210;
  12606.     private int anInt1211;
  12607.     private String promptInput;
  12608.     private int anInt1213;
  12609.     private int[][][] intGroundArray;
  12610.     private long aLong1215;
  12611.     private int loginScreenCursorPos;
  12612.     private final Background[] modIcons;
  12613.     private long aLong1220;
  12614.     private static int tabID;
  12615.     private int anInt1222;
  12616.     public static boolean inputTaken;
  12617.     private int inputDialogState;
  12618.     private static int anInt1226;
  12619.     private int nextSong;
  12620.     private boolean songChanging;
  12621.     private final int[] anIntArray1229;
  12622.     private Class11[] aClass11Array1230;
  12623.     public static int anIntArray1232[];
  12624.     private boolean aBoolean1233;
  12625.     private int[] anIntArray1234;
  12626.     private int[] anIntArray1235;
  12627.     private int[] anIntArray1236;
  12628.     private int anInt1237;
  12629.     private int anInt1238;
  12630.     public final int anInt1239 = 100;
  12631.     private final int[] anIntArray1240;
  12632.     private final int[] anIntArray1241;
  12633.     private boolean aBoolean1242;
  12634.     private int atInventoryLoopCycle;
  12635.     private int atInventoryInterface;
  12636.     private int atInventoryIndex;
  12637.     private int atInventoryInterfaceType;
  12638.     private byte[][] aByteArrayArray1247;
  12639.     private int tradeMode;
  12640.     private int anInt1249;
  12641.     private final int[] anIntArray1250;
  12642.     private int anInt1251;
  12643.     private final boolean rsAlreadyLoaded;
  12644.     private int anInt1253;
  12645.     private int anInt1254;
  12646.     private boolean welcomeScreenRaised;
  12647.     private boolean messagePromptRaised;
  12648.     private int anInt1257;
  12649.     private byte[][][] byteGroundArray;
  12650.     private int prevSong;
  12651.     private int destX;
  12652.     private int destY;
  12653.     private Sprite aClass30_Sub2_Sub1_Sub1_1263;
  12654.     private int anInt1264;
  12655.     private int anInt1265;
  12656.     private String loginMessage1;
  12657.     private String loginMessage2;
  12658.     private int anInt1268;
  12659.     private int anInt1269;
  12660.     private TextDrawingArea smallText;
  12661.     private TextDrawingArea aTextDrawingArea_1271;
  12662.     private TextDrawingArea chatTextDrawingArea;
  12663.     private int anInt1275;
  12664.     private int backDialogID;
  12665.     private int anInt1278;
  12666.     private int anInt1279;
  12667.     private int[] bigX;
  12668.     private int[] bigY;
  12669.     private int itemSelected;
  12670.     private int anInt1283;
  12671.     private int anInt1284;
  12672.     private int anInt1285;
  12673.     private String selectedItemName;
  12674.     private int publicChatMode;
  12675.     private static int anInt1288;
  12676.     private int anInt1289;
  12677.     public static int anInt1290;
  12678.     public static String server = "";
  12679.     public int drawCount;
  12680.     public int fullscreenInterfaceID;
  12681.     public int anInt1044;//377
  12682.     public int anInt1129;//377
  12683.     public int anInt1315;//377
  12684.     public int anInt1500;//377
  12685.     public int anInt1501;//377
  12686.     public int[] fullScreenTextureArray;
  12687.     public void resetAllImageProducers() {
  12688.         if (super.fullGameScreen != null) {
  12689.             return;
  12690.         }
  12691.         aRSImageProducer_1166 = null;
  12692.         aRSImageProducer_1164 = null;
  12693.         aRSImageProducer_1163 = null;
  12694.         aRSImageProducer_1165 = null;
  12695.         aRSImageProducer_1123 = null;
  12696.         aRSImageProducer_1124 = null;
  12697.         aRSImageProducer_1125 = null;
  12698.         aRSImageProducer_1107 = null;
  12699.         aRSImageProducer_1108 = null;
  12700.         aRSImageProducer_1109 = null;
  12701.         aRSImageProducer_1110 = null;
  12702.         aRSImageProducer_1111 = null;
  12703.         aRSImageProducer_1112 = null;
  12704.         aRSImageProducer_1113 = null;
  12705.         aRSImageProducer_1114 = null;
  12706.         aRSImageProducer_1115 = null;
  12707.         super.fullGameScreen = new RSImageProducer(765, 503, getGameComponent());
  12708.         welcomeScreenRaised = true;
  12709.     }
  12710.    
  12711.    
  12712.     public void launchURL(String url) {
  12713.         String osName = System.getProperty("os.name");
  12714.         try {
  12715.             if (osName.startsWith("Mac OS")) {
  12716.                 Class fileMgr = Class.forName("com.apple.eio.FileManager");
  12717.                 Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class});
  12718.                 openURL.invoke(null, new Object[] {url});
  12719.             } else if (osName.startsWith("Windows"))
  12720.                 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
  12721.             else { //assume Unix or Linux
  12722.                 String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape", "safari" };
  12723.             String browser = null;
  12724.             for (int count = 0; count < browsers.length && browser == null; count++)
  12725.                 if (Runtime.getRuntime().exec(new String[] {"which", browsers[count]}).waitFor() == 0)
  12726.                     browser = browsers[count];
  12727.             if (browser == null) {
  12728.                  throw new Exception("Could not find web browser");
  12729.             } else
  12730.                  Runtime.getRuntime().exec(new String[] {browser, url});
  12731.             }
  12732.         } catch (Exception e) {
  12733.             pushMessage("Failed to open URL.", 0, "");
  12734.         }
  12735.     }
  12736.  
  12737.     static  {
  12738.         anIntArray1019 = new int[99];
  12739.         int i = 0;
  12740.         for(int j = 0; j < 99; j++) {
  12741.             int l = j + 1;
  12742.             int i1 = (int)((double)l + 300D * Math.pow(2D, (double)l / 7D));
  12743.             i += i1;
  12744.             anIntArray1019[j] = i / 4;
  12745.         }
  12746.         anIntArray1232 = new int[32];
  12747.         i = 2;
  12748.         for(int k = 0; k < 32; k++) {
  12749.             anIntArray1232[k] = i - 1;
  12750.             i += i;
  12751.         }
  12752.     }
  12753. }
Advertisement
Add Comment
Please, Sign In to add comment